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 demo | |
import ( | |
"bytes" | |
"github.com/ethereum/go-ethereum/crypto" | |
"github.com/vechain/thor/thor" | |
"github.com/vechain/thor/tx" | |
) |
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 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 |