Last active
July 28, 2021 16:11
-
-
Save pitersky/a1ef716c72b78be2c1feddb789c4b1bf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
1. load https://github.com/CityOfZion/neon-js/blob/next/examples/advanced/transfer.js | |
2. replace inputs with | |
const inputs = { | |
fromAccount: new wallet.Account( | |
"KwRkhiNzxvpLVuW292eQV1kyf9Dw4tit8Y8s2NXDm3RbrB2sKdrj" | |
), | |
toAccount: new wallet.Account( | |
"NXx9xwpH5tmAjsqbTyfZqFnQd74ME2eat5" | |
), | |
tokenScriptHash: CONST.NATIVE_CONTRACT_HASH.GasToken, | |
amountToTransfer: 1, | |
systemFee: 0, | |
networkFee: 0, | |
networkMagic: 1234567890, //CONST.MAGIC_NUMBER.TestNet, | |
nodeUrl: "http://seed2t.neo.org:20332", //"http://seed2t.neo.org:20332", | |
}; | |
3. run with node: | |
$ node advanced/transfer.js | |
--- Today's Task --- | |
Sending 1 token | |
from NXx9xwpH5tmAjsqbTyfZqFnQd74ME2eat5 | |
to NXx9xwpH5tmAjsqbTyfZqFnQd74ME2eat5 | |
✓ Transaction created | |
✓ Token found | |
✓ Network Fee set: 0.01049390 | |
✓ SystemFee set: 0.05977750 | |
✓ Token funds found | |
✓ Sufficient GAS for fees found (7027140) | |
{ | |
size: 244, | |
version: 0, | |
nonce: 1712482933, | |
sender: 'NXx9xwpH5tmAjsqbTyfZqFnQd74ME2eat5', | |
sysfee: '5977750', | |
netfee: '1049390', | |
validuntilblock: 377673, | |
attributes: [], | |
signers: [ | |
{ | |
account: '0x998f20d231f5c0dc39c73627cf4e7b54dc560b84', | |
scopes: 'CalledByEntry' | |
} | |
], | |
script: 'CxEMFIQLVtxUe07PJzbHOdzA9THSII+ZDBSEC1bcVHtOzyc2xzncwPUx0iCPmRTAHwwIdHJhbnNmZXIMFM924ovQBixKR47jVWEBExnzz6TSQWJ9W1I=', | |
witnesses: [ | |
{ | |
invocation: 'DEAXWFWWVfAHHNib5/0Fax/JCef6T9IxBlTXl5Wnj/i0FixCVg2YnOpd5kEBITxlwlcfmNlZS/mWMAd4noCptGa2', | |
verification: 'DCECpFcLZpD8RUExliuG8+KAr6h8E/amQyvtOxNyewQi5IZBVuezJw==' | |
} | |
] | |
} | |
RpcError: Invalid | |
at RPCClient.execute (C:\Users\yuris\projects\atomic\repos\neon-js\examples\node_modules\@cityofzion\neon-core\dist\index.js:27030:19) | |
at processTicksAndRejections (internal/process/task_queues.js:95:5) | |
at async RPCClient.sendRawTransaction (C:\Users\yuris\projects\atomic\repos\neon-js\examples\node_modules\@cityofzion\neon-core\dist\index.js:26864:30) | |
at async performTransfer (file:///C:/Users/yuris/projects/atomic/repos/neon-js/examples/advanced/transfer.js:255:18) { | |
code: -500 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment