跳至主要內容

Transactions

tokenview大约 1 分钟

Transactions

gettransactionsign

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/gettransactionsign?apikey={apikey}

Sign the transaction, it is recommended to sign transactions offline.

Parameters

  • transaction: object, required.
  • privateKey: string, required. privateKey is the user private key

Returns:

  • Signed Transaction contract data

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/gettransactionsign?apikey={apikey}' \
--data '{
  "transaction": {
    "raw_data": "{\"contract\":[{\"parameter\":{\"value\":{\"amount\":1000,\"owner_address\":\"41608f8da72479edc7dd921e4c30bb7e7cddbe722e\",\"to_address\":\"41e9d79cc47518930bc322d9bf7cddd260a0260a8d\"},\"type_url\":\"type.googleapis.com/protocol.TransferContract\"},\"type\":\"TransferContract\"}],\"ref_block_bytes\":\"5e4b\",\"ref_block_hash\":\"47c9dc89341b300d\",\"expiration\":1591089627000,\"timestamp\":1591089567635}",
    "raw_data_hex": "0a025e4b220847c9dc89341b300d40f8fed3a2a72e5a66080112620a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412310a1541608f8da72479edc7dd921e4c30bb7e7cddbe722e121541e9d79cc47518930bc322d9bf7cddd260a0260a8d18e8077093afd0a2a72e"
  },
  "privateKey": "your private key"
}'

Response


broadcasttransaction

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/broadcasttransaction?apikey={apikey}

Broadcast the signed transaction.

请求参数说明:

  • RAW_BODY: Object. required.

Returns:

  • broadcast success or failure

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/broadcasttransaction?apikey={apikey}' \
--data '{
  "raw_data": "{\"contract\":[{\"parameter\":{\"value\":{\"amount\":1000,\"owner_address\":\"41608f8da72479edc7dd921e4c30bb7e7cddbe722e\",\"to_address\":\"41e9d79cc47518930bc322d9bf7cddd260a0260a8d\"},\"type_url\":\"type.googleapis.com/protocol.TransferContract\"},\"type\":\"TransferContract\"}],\"ref_block_bytes\":\"5e4b\",\"ref_block_hash\":\"47c9dc89341b300d\",\"expiration\":1591089627000,\"timestamp\":1591089567635}",
  "raw_data_hex": "0a025e4b220847c9dc89341b300d40f8fed3a2a72e5a66080112620a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412310a1541608f8da72479edc7dd921e4c30bb7e7cddbe722e121541e9d79cc47518930bc322d9bf7cddd260a0260a8d18e8077093afd0a2a72e"
}'

Response


broadcasthex

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/broadcasthex?apikey={apikey}

Broadcast the protobuf encoded transaction hex string after sign.

请求参数说明:

  • transaction: string. required.

Returns:

  • The result of the broadcast

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/broadcasthex?apikey={apikey}' \
--data '{
  "transaction": "0A8A010A0202DB2208C89D4811359A28004098A4E0A6B52D5A730802126F0A32747970652E676F6F676C65617069732E636F6D2F70726F746F636F6C2E5472616E736665724173736574436F6E747261637412390A07313030303030311215415A523B449890854C8FC460AB602DF9F31FE4293F1A15416B0580DA195542DDABE288FEC436C7D5AF769D24206412418BF3F2E492ED443607910EA9EF0A7EF79728DAAAAC0EE2BA6CB87DA38366DF9AC4ADE54B2912C1DEB0EE6666B86A07A6C7DF68F1F9DA171EEE6A370B3CA9CBBB00"
}'

Response


easytransfer

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/easytransfer?apikey={apikey}

This interface has been deprecated.

请求参数说明:

  • passPhrase: string. Required.
  • toAddress: string. Required.
  • amount: int32. Required.

Returns:

  • transaction, including execution results.

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/easytransfer?apikey={apikey}' \
--data '{
  "passPhrase": "string",
  "toAddress": "string",
  "amount": 0
}'

Response


easytransferbyprivate

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/easytransferbyprivate?apikey={apikey}

This interface has been deprecated.

请求参数说明:

  • privateKey: string. required.
  • toAddress: string. required.
  • amount: int32. required.

Returns:

  • transaction, including execution results.

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/easytransferbyprivate?apikey={apikey}' \
--data '{
  "privateKey": "string",
  "toAddress": "string",
  "amount": 0
}'

Response


createtransaction

POST https://services.tokenview.io/vipapi/nodeservice/trx/wallet/createtransaction?apikey={apikey}

Create a TRX transfer transaction. If to_address does not exist, then create the account on the blockchain.

请求参数说明:

  • to_address: string. To_address is the transfer address, converted to a hex string.
  • owner_address: string. Owner_address is the transfer address, converted to a hex string.
  • amount: int32. Amount is the transfer amount in denominations of SUN.
  • permission_id: int32.Optional, for multi-signature use.
  • visible: boolean. Optional.Whehter the address is in base58 format.
  • extra_data: string. Optional, totes on the transaction, HEX format.

Request

curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/createtransaction?apikey={apikey}' \
--data '{
    "to_address": "414A5FE0179F2DD9C900194E63D661863CD0ADE7B0",
    "owner_address": "41718DE6B323652D1257437ACE160C4F4198AAE4E1",
    "amount": 1000
}'

Response

{
    "visible": false,
    "txID": "c525c6f610363389a40c4ed58611452997f8466360b832163a9f131e2a547528",
    "raw_data": {
        "contract": [
            {
                "parameter": {
                    "value": {
                        "amount": 1000,
                        "owner_address": "41718de6b323652d1257437ace160c4f4198aae4e1",
                        "to_address": "414a5fe0179f2dd9c900194e63d661863cd0ade7b0"
                    },
                    "type_url": "type.googleapis.com/protocol.TransferContract"
                },
                "type": "TransferContract"
            }
        ],
        "ref_block_bytes": "b2fc",
        "ref_block_hash": "0a2b9fe502b2a13c",
        "expiration": 1680762282000,
        "timestamp": 1680762225369
    },
    "raw_data_hex": "0a02b2fc22080a2b9fe502b2a13c4090c0f4a9f5305a66080112620a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412310a1541718de6b323652d1257437ace160c4f4198aae4e11215414a5fe0179f2dd9c900194e63d661863cd0ade7b018e80770d985f1a9f530"
}
上次编辑于: