For the complete documentation index, see llms.txt. This page is also available as Markdown.

Send

This API sends the Script tokens Note the API call can send Script tokens in one shot.

RPC Method: scriptcli.Send

Query Parameters

chain_id: ID of the chain

from: The address of the account to send tokens from

to: The address of the receipient account

SCPTWei: The amount of Theta tokens to be sent (in SCPTWei, 1 Scpt = 10^18 SCPTWei)

SPAYWei: The amount of TFuel tokens to be sent (in SPAYWei, 1 Spay = 10^18 SPAYWei)

fee: The transaction fee in SPAYWei

sequence: The expected sequence number of the from account

async: A boolean flag. If async is set to false, the RPC call will wait until the transaction has been included in a block, or a timeout reached. Otherwise, the RPC call will return immediately with the transaction hash.

Returns

hash: the hash of the transaction

block: the details of the block that has included the transaction

// Async Request

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"scriptcli.Send","params":[{"chain_id":"scriptnet", "from":"0x2E833968E5bB786Ae419c4d13189fB081Cc43bab", "to":"0xA47B89c94a50C32CEACE9cF64340C4Dce6E5EcC6", "SCPTWei":"0", "SPAYWei":"88000000000000000000", "fee":"1000000000000", "sequence":"6", "async":true}],"id":1}' http://localhost:16889/rpc

// Async Result

{

"jsonrpc": "2.0",

"id": 1,

"result": {

"hash": "0xe3e82ae1e08ca49f85842729bd3c70ba0874d59cca3812fe0807506463851d22",

"block": null

}

}

// Sync Request

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"scriptcli.Send","params":[{"chain_id":"scriptnet", "from":"0x2E833968E5bB786Ae419c4d13189fB081Cc43bab", "to":"0xA47B89c94a50C32CEACE9cF64340C4Dce6E5EcC6", "SCPTWei":"0", "SPAYWei":"88000000000000000000", "fee":"1000000000000", "sequence":"7", "async":false}],"id":1}' http://localhost:16889/rpc

// Sync Result

{

"jsonrpc": "2.0",

"id": 1,

"result": {

"hash": "0xd4dfa1b763cac0c18c816e31ff585c01f2c4f2604dfff01cb6638d6d19e1bd1e",

"block": {

"ChainID": "scriptnet",

"Epoch": 170511,

"Height": 170472,

"Parent": "0xe36483c52eeee44634038252bb33dfe6b70c439c94c89236c6f18c1a4a676e01",

"HCC": {

"Votes": {},

"BlockHash": "0xe36483c52eeee44634038252bb33dfe6b70c439c94c89236c6f18c1a4a676e01"

},

"TxHash": "0xff0d7f1bd6aa699369a935de46c287b30917958c6dbd2d542d31548eaf279525",

"ReceiptHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",

"Bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",

"StateHash": "0x49374ccea64633a51358816d29a55f372d0fbe7e2f9cb1447ddd2c7519fc17e5",

"Timestamp": 1550129583,

"Proposer": "0x2e833968e5bb786ae419c4d13189fb081cc43bab",

"Signature": "0x96dad1ff2ccc4eb2e18ca99f488cb9d6e6f3333c53a3347d7f8ded5f7301b613763bf0301a85b8f8e7342858c29dd1b262b1b6bdb9552fa5c9b6b61a9b4f6d5c01"

}

}

}

Last updated