UNPKG

opnet

Version:

The perfect library for building Bitcoin-based applications.

29 lines (28 loc) 1.18 kB
import { Address } from '@btc-vision/transaction'; import { TransactionBase } from '../Transaction.js'; export class DeploymentTransaction extends TransactionBase { contractAddress; contractTweakedPublicKey; bytecode; wasCompressed; deployerPubKey; deployerAddress; contractSeed; contractSaltHash; from; constructor(transaction, network) { super(transaction, network); try { this.from = new Address(Buffer.from(transaction.from, 'base64')); this.contractAddress = transaction.contractAddress; this.contractTweakedPublicKey = new Address(Buffer.from(transaction.contractTweakedPublicKey, 'base64')); this.bytecode = Buffer.from(transaction.bytecode, 'base64'); this.wasCompressed = transaction.wasCompressed; this.deployerPubKey = Buffer.from(transaction.deployerPubKey, 'base64'); this.deployerAddress = new Address(this.deployerPubKey); this.contractSeed = Buffer.from(transaction.contractSeed, 'base64'); this.contractSaltHash = Buffer.from(transaction.contractSaltHash, 'base64'); } catch { } } }