Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.
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
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Release Notes

## [v0.14.1](https://github.com/ava-labs/coreth/releases/tag/v0.14.1)
- TBD
- Remove API eth_getAssetBalance that was used to query ANT balances (deprecated since v0.10.0)

## [v0.14.0](https://github.com/ava-labs/coreth/releases/tag/v0.14.0)
- Minor version update to correspond to avalanchego v1.12.0 / Etna.
Expand Down
10 changes: 0 additions & 10 deletions ethclient/ethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"fmt"
"math/big"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/coreth/accounts/abi/bind"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/interfaces"
Expand Down Expand Up @@ -90,7 +89,6 @@ type Client interface {
SubscribeNewHead(context.Context, chan<- *types.Header) (interfaces.Subscription, error)
NetworkID(context.Context) (*big.Int, error)
BalanceAt(context.Context, common.Address, *big.Int) (*big.Int, error)
AssetBalanceAt(context.Context, common.Address, ids.ID, *big.Int) (*big.Int, error)
BalanceAtHash(ctx context.Context, account common.Address, blockHash common.Hash) (*big.Int, error)
StorageAt(context.Context, common.Address, common.Hash, *big.Int) ([]byte, error)
StorageAtHash(ctx context.Context, account common.Address, key common.Hash, blockHash common.Hash) ([]byte, error)
Expand Down Expand Up @@ -467,14 +465,6 @@ func (ec *client) BalanceAt(ctx context.Context, account common.Address, blockNu
return (*big.Int)(&result), err
}

// AssetBalanceAt returns the [assetID] balance of the given account
// The block number can be nil, in which case the balance is taken from the latest known block.
func (ec *client) AssetBalanceAt(ctx context.Context, account common.Address, assetID ids.ID, blockNumber *big.Int) (*big.Int, error) {
var result hexutil.Big
err := ec.c.CallContext(ctx, &result, "eth_getAssetBalance", account, ToBlockNumArg(blockNumber), assetID)
return (*big.Int)(&result), err
}

// BalanceAtHash returns the wei balance of the given account.
func (ec *client) BalanceAtHash(ctx context.Context, account common.Address, blockHash common.Hash) (*big.Int, error) {
var result hexutil.Big
Expand Down
12 changes: 0 additions & 12 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"strings"
"time"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/coreth/accounts"
"github.com/ava-labs/coreth/accounts/keystore"
"github.com/ava-labs/coreth/accounts/scwallet"
Expand Down Expand Up @@ -646,17 +645,6 @@ func (s *BlockChainAPI) GetBalance(ctx context.Context, address common.Address,
return (*hexutil.Big)(b), state.Error()
}

// GetAssetBalance returns the amount of [assetID] for the given address in the state of the
// given block number. The rpc.LatestBlockNumber, rpc.PendingBlockNumber, and
// rpc.AcceptedBlockNumber meta block numbers are also allowed.
func (s *BlockChainAPI) GetAssetBalance(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash, assetID ids.ID) (*hexutil.Big, error) {
state, _, err := s.b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash)
if state == nil || err != nil {
return nil, err
}
return (*hexutil.Big)(state.GetBalanceMultiCoin(address, common.Hash(assetID))), state.Error()
}

// AccountResult structs for GetProof
type AccountResult struct {
Address common.Address `json:"address"`
Expand Down
Loading