Bitcore创build交易脚本variables丢失

我正在使用Bitcore来尝试在这个例子中进行一个事务:

https://github.com/bitpay/bitcore-lib/blob/master/docs/examples.md (它说“创build交易”)。

不过,我在“脚本”部分有一些问题,这是我的代码:

var privateKey = new bitcore.PrivateKey('the private key :P'); var address = bitcore.Address.fromString('1PP4jkxPhJVDP9cEkdbHXvXCiFuiEZTjtb'); var script = bitcore.Script.buildPublicKeyHashOut(address); 

控制台显示我这个:

在这里输入图像说明

但是,当我使用JSON.stringify(脚本),我得到这个:

 { "chunks": [{ "opcodenum": 118 }, { "opcodenum": 169 }, { "buf": { "type": "Buffer", "data": [245, 127, 9, 190, 134, 210, 30, 178, 246, 47, 189, 61, 92, 64, 165, 177, 207, 158, 104, 156 ] }, "len": 20, "opcodenum": 20 }, { "opcodenum": 136 }, { "opcodenum": 172 }], "_network": { "name": "live net "," alias ":" mainnet "," pubkeyhash ":0," privatekey ":128," scripthash ":5," xpubkey ": 76067358, "xprivkey": 76066276, "networkMagic": { "type": "Buffer", "data": [249, 190, 180, 217] }, "port": 8333, "dnsSeeds": ["seed.bitcoin.sipa.be", "dnsseed.bluematt.me", "dns seed.bitcoin.dashjr.org "," seed.bitcoinstats.com "," seed.bitnodes.io "," bitseed.xf2 .org "] } } 

这些看起来都不像用于在Bitcore的github lib上进行事务的“脚本”variables。