Description
API Methods
createrawtx
createrawtx
- Parameters (positional)
-d
or[--deposit]
Deposits support [7, 30, 90, 182, 365] days. defaluts to 7 days-f
or[--fee]
Transaction fee. defaults to 10000 ETP bits-h
or[--help]
Get a description and instructions for this command.-i
or[--message]
Message/Information attached to this transaction-m
or[--mychange]
Mychange to this address, includes etp and asset change-n
or[--symbol]
asset name, not specify this option for etp tx-r
or[--receivers]
Send to [address:amount]. amount is asset number if sybol option specified-s
or[--senders]
Send from addresses-t
or[--type]
Transaction type. 0 – transfer etp, 1 – deposit etp, 3 – transfer asset, 6 – just only send message
- Returns
Object
-
hex
- The Base16 transaction.
- Example
// Request
curl http://127.0.0.1:8820/rpc/v2 -X POST --data '{"jsonrpc":"2.0","method":"createrawtx",
"params":[{"type":"3", "senders":"tCrRWkDBZQTqp3AdZc39DSMJ8FremrTinj", "receivers":"t7M89JNHrVn3TwNDq2HTGbTMmCXCXQNhqr:100", "symbol":"RMB"}],"id":7}'
// Response
{
"id" : 7,
"jsonrpc" : "2.0",
"result" :
{
"hex" : "02000000011b1cb3fc24c24e13a71e11f26fd3bc8c69ff15e1269783e09b276a23b6bf1e180000000000ffffffff0264000000000000001976a91404a31ae84a152ca773728761b7260726d8aeff8c88ac01000000000000008c7be111000000001976a91441064be4875b7a3608a891173540e534d4b89b6f88ac010000000000000000000000"
}
}
signrawtx
signrawtx
- Parameters (positional)
ACCOUNTNAME
Account name required.ACCOUNTAUTH
Account password(authorization) required.TRANSACTION
The input Base16 transaction to sign.params: [
"ACCOUNTNAME",
"ACCOUNTAUTH",
"TRANSACTION"
]
- Returns
Object
-
hash
- transaction hashhex
- The Base16 transaction.
- Example
// Request
curl http://127.0.0.1:8820/rpc/v2 -X POST --data '{"jsonrpc":"2.0","method":"signrawtx",
"params":["test10", "123456", "02000000011b1cb3fc24c24e13a71e11f26fd3bc8c69ff15e1269783e09b276a23b6bf1e180000000000ffffffff0264000000000000001976a91404a31ae84a152ca773728761b7260726d8aeff8c88ac01000000000000008c7be111000000001976a91441064be4875b7a3608a891173540e534d4b89b6f88ac010000000000000000000000"],"id":7}'
// Response
{
"id" : 7,
"jsonrpc" : "2.0",
"result" :
{
"hash" : "cb1906fee17d72a4bc71cfdb5b0e0f66d7a5067fd941e74cd703367d384821ff",
"hex" : "02000000011b1cb3fc24c24e13a71e11f26fd3bc8c69ff15e1269783e09b276a23b6bf1e18000000006b483045022100a59159cc8d3018899815e3189893c81b741166a7ee6e69cd5b04f989afe498e50220364a7b0a6ec0a0276e2019f372003b1fb88cb087791c368bb29bdff514ebb0ca012103046e1c2777cfa064932a2f4c12f8dd307c1702c9cd77d14c48daf134627e355effffffff0264000000000000001976a91404a31ae84a152ca773728761b7260726d8aeff8c88ac01000000000000008c7be111000000001976a91441064be4875b7a3608a891173540e534d4b89b6f88ac010000000000000000000000"
}
}
}
decoderawtx
- Arguments (positional):
TRANSACTION
The input Base16 transaction to sign.params: [
"TRANSACTION"
]
- Returns
Object
-
transaction
- transaction object
- Example
// Request
curl http://127.0.0.1:8820/rpc/v2 -X POST --data '{"jsonrpc":"2.0","method":"decoderawtx",
"params":["02000000011b1cb3fc24c24e13a71e11f26fd3bc8c69ff15e1269783e09b276a23b6bf1e18000000006b483045022100a59159cc8d3018899815e3189893c81b741166a7ee6e69cd5b04f989afe498e50220364a7b0a6ec0a0276e2019f372003b1fb88cb087791c368bb29bdff514ebb0ca012103046e1c2777cfa064932a2f4c12f8dd307c1702c9cd77d14c48daf134627e355effffffff0264000000000000001976a91404a31ae84a152ca773728761b7260726d8aeff8c88ac01000000000000008c7be111000000001976a91441064be4875b7a3608a891173540e534d4b89b6f88ac010000000000000000000000"],"id":7}'
// Response
{
"id" : 7,
"jsonrpc" : "2.0",
"result" :
{
"transaction" :
{
"hash" : "cb1906fee17d72a4bc71cfdb5b0e0f66d7a5067fd941e74cd703367d384821ff",
"inputs" :
[
{
"address" : "tCrRWkDBZQTqp3AdZc39DSMJ8FremrTinj",
"previous_output" :
{
"hash" : "181ebfb6236a279be0839726e115ff698cbcd36ff2111ea7134ec224fcb31c1b",
"index" : 0
},
"script" : "[ 3045022100a59159cc8d3018899815e3189893c81b741166a7ee6e69cd5b04f989afe498e50220364a7b0a6ec0a0276e2019f372003b1fb88cb087791c368bb29bdff514ebb0ca01 ] [ 03046e1c2777cfa064932a2f4c12f8dd307c1702c9cd77d14c48daf134627e355e ]",
"sequence" : 4294967295
}
],
"lock_time" : "0",
"outputs" :
[
{
"address" : "t7M89JNHrVn3TwNDq2HTGbTMmCXCXQNhqr",
"attachment" :
{
"type" : "etp"
},
"index" : 0,
"locked_height_range" : 0,
"script" : "dup hash160 [ 04a31ae84a152ca773728761b7260726d8aeff8c ] equalverify checksig",
"value" : 100
},
{
"address" : "tCrRWkDBZQTqp3AdZc39DSMJ8FremrTinj",
"attachment" :
{
"type" : "etp"
},
"index" : 1,
"locked_height_range" : 0,
"script" : "dup hash160 [ 41064be4875b7a3608a891173540e534d4b89b6f ] equalverify checksig",
"value" : 299989900
}
],
"version" : "2"
}
}
}
sendrawtx
- Options (named):
-h
or[--help]
Get a description and instructions for this command.-f
or[--fee]
The max tx fee. default_value 10 etp
- Arguments (positional):
TRANSACTION
The input Base16 transaction to broadcast.params:[
"TRANSACTION"
]
- Returns
Object
- - Example
// Request
curl http://127.0.0.1:8820/rpc -X POST --data '{"jsonrpc":"2.0","method":"sendrawtx",
"params":["02000000016164c4ccd70b57a9d7b956d63bf0d0c9bccb72cfaba49891fa9e833adacb65a401000000db00473044022042ccd72c3ce0f7bc34d4507964d6442877165e9efd8c45ca1b3f2721331f48f102200e5c1402d2775e87d258aa60feac3d79b2ba377e6665104196ad9ca75dc1c30b01483045022100b78987209417d81ffad5d45719e8a78a5730b6b8e22b98c73b6ca927a001fe6b022004b48edf88370fa001ae9423561762cbdd489b619ab82fcab64852e08358c7b0014c4752210200e5782241ce24af725f2e823dfcc325101cec604e422566ba5ce4ca4bd5bc8c2103046e1c2777cfa064932a2f4c12f8dd307c1702c9cd77d14c48daf134627e355e52aeffffffff0264000000000000001976a91404a31ae84a152ca773728761b7260726d8aeff8c88ac0100000000000000b83701000000000017a91409594fe3a84e3de95831d2474ca3ca29d2f9053d87010000000000000000000000"],"id":7}'
// Response
{
"id" : 7,
"jsonrpc" : "2.0",
"result" :
{
"hash" : "aedd4bdf49a688cdfd23c056848149568a198f8088ac5e15fc38418dc429ae2a"
}
}