Skip to content
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

remove eth_getAssetBalance #1979

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
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
60 changes: 1 addition & 59 deletions content/docs/api-reference/c-chain/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ number of items is 40. We are working on to support a larger batch size.

### Avalanche - Ethereum APIs

In addition to the standard Ethereum APIs, Avalanche offers `eth_getAssetBalance`, `eth_baseFee`,
In addition to the standard Ethereum APIs, Avalanche offers `eth_baseFee`,
`eth_maxPriorityFeePerGas`, and `eth_getChainConfig`.

They use the same endpoint as standard Ethereum APIs:
Expand All @@ -92,64 +92,6 @@ They use the same endpoint as standard Ethereum APIs:
/ext/bc/C/rpc
```

#### `eth_getAssetBalance`

Retrieves the balance of first class Avalanche Native Tokens on the C-Chain (excluding AVAX,
which must be fetched with `eth_getBalance`).

<Callout title="Note">

The AssetID for AVAX differs depending on the network you are on.

Mainnet: FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z

Testnet: U8iRqJoiJm8xZHAacmvYyZVwqQx6uDNtQeP3CQ6fcgQk3JqnK

For finding the `assetID` of other assets, please note that
`avax.getUTXOs` and `avax.getAtomicTx` return the `assetID` in
their output.

</Callout>

**Signature:**

```sh
eth_getAssetBalance({
address: string,
blk: BlkNrOrHash,
assetID: string,
}) -> {balance: int}
```

- `address` owner of the asset
- `blk` is the block number or hash at which to retrieve the balance
- `assetID` id of the asset for which the balance is requested

**Example Call:**

```sh
curl -X POST --data '{
"jsonrpc": "2.0",
"method": "eth_getAssetBalance",
"params": [
"0x8723e5773847A4Eb5FeEDabD9320802c5c812F46",
"latest",
"3RvKBAmQnfYionFXMfW5P8TDZgZiogKbHjM8cjpu16LKAgF5T"
],
"id": 1
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/C/rpc
```

**Example Response:**

```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1388"
}
```

#### `eth_baseFee`

Get the base fee for the next block.
Expand Down
1 change: 0 additions & 1 deletion content/docs/api-reference/c-chain/configs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ Adds the following RPC calls to the `eth_*` namespace. Defaults to `true`.
- `eth_chainId`
- `eth_blockNumber`
- `eth_getBalance`
- `eth_getAssetBalance`
- `eth_getProof`
- `eth_getHeaderByNumber`
- `eth_getHeaderByHash`
Expand Down
1 change: 0 additions & 1 deletion content/docs/nodes/chain-configs/c-chain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ Adds the following RPC calls to the `eth_*` namespace. Defaults to `true`.
- `eth_chainId`
- `eth_blockNumber`
- `eth_getBalance`
- `eth_getAssetBalance`
- `eth_getProof`
- `eth_getHeaderByNumber`
- `eth_getHeaderByHash`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Data visualizations are available for following API calls:
- [`eth_baseFee`](/api-reference/c-chain/api#eth_basefee)
- [`eth_blockNumber`](https://www.quicknode.com/docs/ethereum/eth_blockNumber)
- [`eth_chainId`](https://www.quicknode.com/docs/ethereum/eth_chainId)
- [`eth_getAssetBalance`](/api-reference/c-chain/api#eth_getassetbalance)
- [`eth_getBalance`](https://www.quicknode.com/docs/ethereum/eth_getBalance)
- [`eth_getBlockByHash`](https://www.quicknode.com/docs/ethereum/eth_getBlockByHash)
- [`eth_getBlockByNumber`](https://www.quicknode.com/docs/ethereum/eth_getBlockByNumber)
Expand Down
Loading