Skip to content

add token1155tx api v1 endpoint #385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions devs/apis/rpc/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,76 @@ Usage:
* To fetch ERC-721 token transfers by token, specify `contractaddress` parameter
* To fetch ERC-721 token transfers by address filtered by token, specify both `address` and `contractaddress` parameters

## Get ERC-1155 token transfer events by address

`token1155tx`

**Example:**

```
https://instance_base_url/api
?module=account
&action=token1155tx
&address={addressHash}
&page=1
&offset=10
&sort=asc
```

{% tabs %}
{% tab title="Request Params" %}
| Parameter | Description |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **address** | `string` containing the address hash. |
| contractaddress | <mark style="background-color:yellow;">optional</mark> `string` with the token contract address to identify a contract. |
| sort | <mark style="background-color:yellow;">optional</mark> sorting preference, `asc` for ascending and `desc` for descending. Descending is default. |
| startblock | <mark style="background-color:yellow;">optional</mark> `integer` block number to start transaction search |
| endblock | <mark style="background-color:yellow;">optional</mark> `integer` block number to stop transaction search. |
| page | <mark style="background-color:yellow;">optional</mark> `integer` representing the page number used for pagination. `offset` must also be provided. |
| offset | <mark style="background-color:yellow;">optional</mark> `integer` representing number of transactions returned per page. `page` must also be provided. |
{% endtab %}

{% tab title="Example Result" %}
```
{
"message": "OK",
"result": [
{
"tokenValue": "1",
"blockHash": "0x6e3c72d61ac3009270858dc9b948e5d0aef02f2a2fb4d65ea304962133e2591a",
"blockNumber": "15553171",
"confirmations": "55352",
"contractAddress": "0xb989e514980dc837fd554f1f85673b0091cf25f3",
"cumulativeGasUsed": "421864",
"from": "0x0000000000000000000000000000000000000000",
"gas": "584001",
"gasPrice": "1100253",
"gasUsed": "375795",
"hash": "0x3b3f4c5bdbdeda6e59320bde3b1c255688f844f4f7b188547a858c1dfcec5139",
"input": "deprecated",
"logIndex": "3",
"nonce": "57",
"timeStamp": "1737917053",
"to": "0x00ef535671bb9c13d195c5cc2fa3a65f522b764a",
"tokenDecimal": "0",
"tokenID": "16094937632875098518315637340985289426529430752651125844878390853242354271202",
"tokenName": "Frax Name",
"tokenSymbol": null,
"transactionIndex": "1"
}
],
"status": "1"
}
```
{% endtab %}
{% endtabs %}

Usage:

* To fetch ERC-1155 token transfers by address, specify `address` parameter
* To fetch ERC-1155 token transfers by token, specify `contractaddress` parameter
* To fetch ERC-1155 token transfers by address filtered by token, specify both `address` and `contractaddress` parameters

## Get token account balance for token contract address

`tokenbalance`
Expand Down