This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html[data-theme="twelvedays"] .proton-link-inner, | |
html[data-theme="twelvedays"] .wallet-selector-inner, | |
html[data-theme="twelvedays"] .wallet-selector-connect | |
{ | |
background-color: #0b211c; | |
} | |
html[data-theme="twelvedays"] .proton-link-header, | |
html[data-theme="twelvedays"] .wallet-selector-title { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generating smart contract TS types definition from local abi file with abi2ts | |
// npx abi2ts betsxpr -f ./target/betxpr.contract.abi > ./tests/interfaces/betxpr.ts | |
describe("End prediction", () => { | |
it("Should pick resolvers 4 resolvers (resolverSeeds length + 1) ", async () => { | |
// {contractName}_actionParams<'{action_name}'> turn a typed action parameters object to an array | |
const predictionEndParams = betsxpr_actionParams<'gov.endpoll'>({ | |
predictionKey: 0, | |
resolverSeeds:[0,1,2] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextResponse } from "next/server"; | |
import { PostMethodSymbol } from "./http-methods/post"; | |
import { GetMethodSymbol } from "./http-methods/get"; | |
export interface APIService { | |
GET:()=>void, | |
POST:()=>void, | |
} | |
// How can i fix the return type to avoid type check issue ? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"[typescriptreact]": { | |
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint" | |
}, | |
"[typescript]": { | |
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint" | |
}, | |
"[scss]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useState, useEffect} from "react"; | |
import {Api, JsonRpc, JsSignatureProvider} from "@proton/js"; | |
import {SigningRequest} from "@proton/signing-request"; | |
import pako from "pako"; | |
import {Text, View, StyleSheet, Button} from "react-native"; | |
import {BarCodeScanner} from "expo-barcode-scanner"; | |
import * as encodeAndDecodeModule from "fastestsmallesttextencoderdecoder"; | |
const fetch = require("node-fetch"); // ou d'autres alternatives selon l'environnement | |
const endpoints = ["https://api.protonnz.com"]; // Remplacez par l'URL de votre nœud EOSIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Checksum256,U256,sha256 } from "proton-tsc"; | |
export function u64ArrayToU256(assetIds:u64[]): U256 { | |
const hash: U256 = new U256() | |
const sortedAsset: u64[] = (assetIds).sort((a: u64, b: u64) => u32(a - b)); | |
return sortedAsset.reduce((prev: U256, current: u64): U256 => { | |
return U256.add(prev, U256.fromU64(current)); | |
},new U256()) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use client" | |
import React, { | |
createContext, | |
useState, | |
useCallback, | |
useContext | |
} from 'react'; | |
import ProtonWebSDK,{ ProtonWebLink, Link,LinkSession } from '@proton/web-sdk'; | |
export interface AuthState { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Api, JsonRpc, JsSignatureProvider } from "@proton/js"; | |
// THOSE ENDPOINTS ARE TESTNET | |
// BE SURE TO TEST THIS SCRIPT WITH A TESTNET ACCOUNT | |
const EPS = [ | |
"https://testnet.brotonbp.com", | |
"https://api-protontest.saltant.io", | |
"https://api.testnet.protongb.com", | |
"https://testnet-api.protongroup.info", | |
"https://test.proton.kiwi", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const account = require('./account.json'); | |
const hdkey = require('hdkey') | |
const wif = require('wif') | |
const ecc = require('eosjs-ecc') | |
const bip39 = require('bip39') | |
const eos = require('eosjs') | |
async function generateKeyPair(mnemonicString){ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { JsonRpc }= require("@eoscafe/light-api"); | |
const rpc = new JsonRpc("proton"); | |
/** | |
* Fetch token holder counts | |
* @returns {any} | |
*/ | |
async getTokenHolders (){ | |
return rpc.get_tokenholder_count('accountName','TOKEN'); | |
NewerOlder