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
// copy and run following lines into your browser dev console, | |
// you'll get connex ready | |
const connex = await (() => { | |
const script = document.createElement('script') | |
script.src = 'https://unpkg.com/@vechain/connex@2' | |
document.body.appendChild(script) | |
return new Promise((resolve, reject) => { | |
script.onload = () => { | |
resolve(new Connex({ | |
node: 'https://testnet.veblocks.net', |
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
function contract(thor: Connex.Thor, address: string, abis: Array<any>) { | |
const obj: Record<string, Connex.Thor.Account.Method> = {} | |
abis.filter(i => i.type === 'function' && i.name) | |
.forEach(i => { | |
obj[i.name] = thor.account(address).method(i) | |
}) | |
return obj | |
} |
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
func main() { | |
var node [16][]byte | |
for i := 0; i < len(node); i++ { | |
b := make([]byte, 32) | |
rand.Read(b) | |
node[i] = b | |
} | |
buf := bytes.NewBuffer(nil) |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"math/rand" | |
"os" | |
"path" | |
"time" |
OlderNewer