new TokenHistoryApi()
- Version:
- 1.0
TokenHistory service.
Methods
getTransfers(xChainId, presets, opts, callback)
getTransfers
Search for integrated transfer details. The transfer details include KLAY (KlayTransfer
), FT (FtTransfer
), and NFT (NftTransfer
) transfers.
KlayTransfer
transfer detail for executing the token transfer is included. This is because the FT/NFT token transfer is basically an execution of the FT/NFT contract function, and the API includes the triggering KlayTransfer in response which executed the token transfer. Because transactions that execute contract functions do not generally transfer KLAY, the value
of the KlayTransfer
for executing the FT and NFT transfers can be 0. ## Transaction Type * Set the kind
parameter to search for transaction details regarding KLAY, FT, or NFT.* Transaction details for all types will be included in the search response if the
kind
parameter is not set.## Search period * For
range
, enter the query in the range={from},{to}
format.*
{from}
and {to}
will be regarded as Unix time if they are integers and block numbers if they are in hexadecimal format.* If the
{to}
value is empty, the current time or recent block number will be used.* Transaction details can be retrieved for up to six (6) months at once (for both Unix time and block numbers).
## Preset A Preset contains EOA, FT, and NFT contract addresses, allowing users to easily and quickly retrieve transfer histories of a frequently requested set of accounts. * The
presets
query parameter is a required parameter.* Preset must be pre-generated in the KAS Console.
* The preset ID can be checked in the KAS Console.
## Size * The
size
query parameter is optional (minimum = 1, maximum = 1000, default = 100).* Submitting negative values result in errors.
* Submitting zero results in a query with
size=100
, which is the default value.* Submitting values greater than 1000 result in queries with
size=1000
, which is the maximum value.Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
xChainId |
String | Klaytn network chain ID (1001 or 8217) |
|||||||||||||||
presets |
String | (csv) Preset IDs to use in search, check Preset IDs in KSA Console |
|||||||||||||||
opts |
Object | Optional parameters Properties
|
|||||||||||||||
callback |
TokenHistoryApi~getTransfersCallback | The callback function, accepting three arguments: error, data, response data is of type: PageableTransfers |
getTransfersByEoa(xChainId, address, opts, callback)
getTransfersByEoa
Search for token transfer details of a specific EOA. This is functionally similar to GET /v2/transfer
. However, if this EOA receives or transfers the token in the returned transfer object, to
or from
is the same with the EOA, respectively.
KlayTransfer
), FT (FtTransfer
), and NFT (NftTransfer
) transfers. For the FT and NFT transfers, the KlayTransfer transfer details for executing the token transfer are included. The value
of the KlayTransfer
for executing the FT and NFT transfers can be 0. For more details, refer to GET /v2/transfer
. ## Transaction Type * Set the kind
parameter to search for transaction details regarding KLAY, FT, or NFT.* Transaction details for all types will be included in the search response if the
kind
parameter is not set.## Search period * For
range
, enter the query in the range={from},{to}
format.*
{from}
and {to}
will be regarded as Unix time if they are integers and block numbers if they are in hexadecimal format.* If the
{to}
value is empty, the current time or recent block number will be used.* Transaction details can be retrieved for up to six (6) months at once (for both Unix time and block numbers).
## Size * The
size
query parameter is optional (minimum = 1, maximum = 1000, default = 100).* Submitting negative values result in errors.
* Submitting zero results in a query with
size=100
, which is the default value.* Submitting values greater than 1000 result in queries with
size=1000
, which is the maximum value.Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
xChainId |
String | Klaytn chain network ID (1001 or 8217) |
||||||||||||||||||
address |
String | EOA to search, the response only contains transfer details where each transfer detail's |
||||||||||||||||||
opts |
Object | Optional parameters Properties
|
||||||||||||||||||
callback |
TokenHistoryApi~getTransfersByEoaCallback | The callback function, accepting three arguments: error, data, response data is of type: PageableTransfers |
getTransfersByTxHash(xChainId, transactionHash, callback)
getTransfersByTxHash
Search for transfer details with a transaction hash. Transfer details include KLAY (KlayTransfer
), FT (FtTransfer
), and NFT (NftTransfer
) transfers. For the FT and NFT transfers, the KlayTransfer transfer details for executing the token transfer are included. The value
of the KlayTransfer
for executing the FT and NFT transfers can be 0. For more details, refer to GET /v2/transfer
.
Parameters:
Name | Type | Description |
---|---|---|
xChainId |
String | Klaytn network chain ID (1001 or 8217) |
transactionHash |
String | Transaction hash to search |
callback |
TokenHistoryApi~getTransfersByTxHashCallback | The callback function, accepting three arguments: error, data, response data is of type: Transfers |
Type Definitions
getTransfersCallback(error, data, response)
Callback function to receive the result of the getTransfers operation.
Parameters:
Name | Type | Description |
---|---|---|
error |
String | Error message, if any. |
data |
PageableTransfers | The data returned by the service call. |
response |
String | The complete HTTP response. |
getTransfersByEoaCallback(error, data, response)
Callback function to receive the result of the getTransfersByEoa operation.
Parameters:
Name | Type | Description |
---|---|---|
error |
String | Error message, if any. |
data |
PageableTransfers | The data returned by the service call. |
response |
String | The complete HTTP response. |
getTransfersByTxHashCallback(error, data, response)
Callback function to receive the result of the getTransfersByTxHash operation.
Parameters:
Name | Type | Description |
---|---|---|
error |
String | Error message, if any. |
data |
Transfers | The data returned by the service call. |
response |
String | The complete HTTP response. |