USDL Contract Code

1. Get User Address:

URL: http://64.227.188.73:4000/balance/<user_address>

REQUEST PARAMS: @useraddress

RESPONSE: Get particular user address

METHOD: POST

CURL: curl — request POST — url http://64.227.188.73:26667/wallet/getaccount — header

‘Accept: application/json’ — header ‘Content-Type: application/json’ — data ‘{ “address”:

“309475a04fe3f25ec03cc0de680f316ecc3ee6fcc7” }’

**Note** owner_address — address in hex

eg: http://64.227.188.73:4000/getAddresshex/<address>

RESPONSE CURL

2. Transfer USDL Amount:

URL: http://64.227.188.73:4000/transfer/<from_PK>/<amount>/<to_address>

REQUEST PARAMS: @Private key for from address

@Amount to be transferred

@To address

RESPONSE: To transfer USDL amount

METHOD: POST

CURL STEPS FOR TRANSFER:

Create Transaction:

curl -X POST http://64.227.188.73:26667/wallet/createtransaction -d ‘{“to_address”:

“30405be4bf2610ec69d9c4ffa69de33875a438fe2f”, “owner_address”:

“309475a04fe3f25ec03cc0de680f316ecc3ee6fcc7”, “amount”: 1000 }’

Get Transaction Sign:

curl — request POST — url http://64.227.188.73:26667/wallet/gettransactionsign — data

‘{“transaction”:{“raw_data”:{“contract”:[{“parameter”:{“value”:

{“owner_address”:”3c7f9ca4a67a03182746173c562b0bf7ccd000d8d2",”url”:”7777772e746573742

e636f6d”},”type_url”:”type.googleapis.com/protocol.WitnessCreateContract”},”type”:”WitnessCrea

teContract”}],”ref_block_bytes”:”021d”,”ref_block_hash”:”e1f1e7e9743e69ae”,”expiration”:16170

22212000,”timestamp”:1617022154984},”raw_data_hex”:”0a02021d2208e1f1e7e9743e69ae40a0af

a3f0872f5a5f0805125b0a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e57

69746e657373437265617465436f6e747261637412250a153c7f9ca4a67a03182746173c562b0bf7cc

d000d8d2120c7777772e746573742e636f6d70e8f19ff0872f”},”privateKey”:”2f8887355130624327

358ceafddad6bdd8b00622e208ebdf492d254e1575318a”}’

Broadcast Transaction:

curl — request POST — url http://64.227.188.73:26667/wallet/broadcasttransaction — data

‘{“visible”:false,”signature”:

[“a0360b7b4feec424e19eb1e913218d255de7313ee6d5793101b91c9ab5504fe83f469e2a3ccefa7a9e

800f71f03603c92e26db8725106331722b57881a6bdd3b01"],”txID”:”1462d9d7012dc0860200ace63

212c34d397d320722368aba1e686ee0ff5ecb1c”,”raw_data”:{“contract”:[{“parameter”:{“value”:

{“owner_address”:”3c7f9ca4a67a03182746173c562b0bf7ccd000d8d2",”url”:”7777772e746573742

e636f6d”},”type_url”:”type.googleapis.com/protocol.WitnessCreateContract”},”type”:”WitnessCrea

teContract”}],”ref_block_bytes”:”021d”,”ref_block_hash”:”e1f1e7e9743e69ae”,”expiration”:16170

22212000,”timestamp”:1617022154984},”raw_data_hex”:”0a02021d2208e1f1e7e9743e69ae40a0af

a3f0872f5a5f0805125b0a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e57

69746e657373437265617465436f6e747261637412250a153c7f9ca4a67a03182746173c562b0bf7cc

d000d8d2120c7777772e746573742e636f6d70e8f19ff0872f”}’

**Note** owner_address — address in hex

url — url address in hex, you can convert hex to decimals in online

3. Transaction Details:

URL: http://64.227.188.73:4000/txinfo/<transaction_hash>

REQUEST PARAMS: @transaction hash

RESPONSE: To get the details of transaction hash

METHOD: POST

CURL: curl — request POST — url http://64.227.188.73:26667/wallet/gettransactionbyid

— header ‘Accept: application/json’ — header ‘Content-Type: application/json’ — data ‘{ “value”:

“08fcda8a557938579381235b92abd61bcfaac3190013572804634f58ae1ab8ed” }’

4. Transaction Info:

URL: http://64.227.188.73:4000/tx/<transaction_hash>

REQUEST PARAMS: @transaction hash

RESPONSE: To get the fee details of transaction hash

METHOD: POST

CURL: curl — request POST — url http://64.227.188.73:26667/wallet/gettransactioninfobyid

— header ‘Accept: application/json’ — header ‘Content-Type: application/json’ — data ‘{ “value”:

“08fcda8a557938579381235b92abd61bcfaac3190013572804634f58ae1ab8ed” }’

Last updated