Skip to content

Instantly share code, notes, and snippets.

View ip-config's full-sized avatar
🏠
Working from home

ip config ip-config

🏠
Working from home
View GitHub Profile
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 09:33 — forked from libotony/delegated-tx.js
Build delegated tx by thor-devkit.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