Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

ip-config

💭
I may be slow to respond.
View GitHub Profile
View build_vip191_tx.go
package demo
import (
"bytes"
"github.com/ethereum/go-ethereum/crypto"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/tx"
)
@ip-config
ip-config / delegated-tx.js
Created May 27, 2019 — forked from libotony/delegated-tx.js
Build delegated tx by thor-devkit.js
View delegated-tx.js
const originPriv = Buffer.from('c962bfd916c0f8d4c1866b11a24802815cf58ba981354fad0ac734d0217cfe73', 'hex')
const txOrigin = cry.publicKeyToAddress(cry.secp256k1.derivePublicKey(originPriv))
const delegatorPriv = Buffer.from('dce1443bd2ef0c2631adc1c67e5c93f13dc23a41c18b536effbbdcbcdb96fb65', 'hex')
const delegator = cry.publicKeyToAddress(cry.secp256k1.derivePublicKey(delegatorPriv))
const tx = new Transaction({
chainTag: 0x27,
blockRef: '0x002b99c540c4e267',
expiration: 30 * 8640, // Expires after 30 days