Table of Contents

Class AccountClient

Namespace
Aptos
Assembly
Aptos.dll
public class AccountClient
Inheritance
AccountClient
Inherited Members

Constructors

AccountClient(AptosClient)

public AccountClient(AptosClient client)

Parameters

client AptosClient

Methods

GetCoinBalance(AccountAddress, string, int, int, current_fungible_asset_balances_bool_exp?, current_fungible_asset_balances_order_by?)

Gets the coin balance of the given address and coin type. When providing the types, its important to include both the Fungible Asset address and the coin type if they both exist for the asset.
The default will be "0xa" and "0x1::aptos_coin::AptosCoin".

public Task<CoinBalance?> GetCoinBalance(AccountAddress address, string type = "0xa", int offset = 0, int limit = 50, current_fungible_asset_balances_bool_exp? where = null, current_fungible_asset_balances_order_by? orderBy = null)

Parameters

address AccountAddress

The address of the account.

type string

The type of the coin.

offset int

The offset of the query.

limit int

The item limit of the query.

where current_fungible_asset_balances_bool_exp

The condition to filter the coin balances.

orderBy current_fungible_asset_balances_order_by

The order by condition of the query.

Returns

Task<CoinBalance>

The coin balance of the given address and coin type.

GetCoinBalance(string, string, int, int, current_fungible_asset_balances_bool_exp?, current_fungible_asset_balances_order_by?)

Gets the coin balance of the given address and coin type. When providing the types, its important to include both the Fungible Asset address and the coin type if they both exist for the asset.
The default will be "0xa" and "0x1::aptos_coin::AptosCoin".

public Task<CoinBalance?> GetCoinBalance(string address, string type = "0xa", int offset = 0, int limit = 50, current_fungible_asset_balances_bool_exp? where = null, current_fungible_asset_balances_order_by? orderBy = null)

Parameters

address string

The address of the account.

type string

The type of the coin.

offset int

The offset of the query.

limit int

The item limit of the query.

where current_fungible_asset_balances_bool_exp

The condition to filter the coin balances.

orderBy current_fungible_asset_balances_order_by

The order by condition of the query.

Returns

Task<CoinBalance>

The coin balance of the given address and coin type.

GetCoinBalances(AccountAddress, List<string>?, int, int, current_fungible_asset_balances_bool_exp?, current_fungible_asset_balances_order_by?)

Gets a paginated list of coin balances of the given address.

public Task<List<CoinBalance>> GetCoinBalances(AccountAddress address, List<string>? types = null, int offset = 0, int limit = 50, current_fungible_asset_balances_bool_exp? where = null, current_fungible_asset_balances_order_by? orderBy = null)

Parameters

address AccountAddress

The address of the account.

types List<string>

The types of the coin balances to return.

offset int

The offset of the query.

limit int

The item limit of the query.

where current_fungible_asset_balances_bool_exp

The condition to filter the coin balances.

orderBy current_fungible_asset_balances_order_by

The order by condition of the query.

Returns

Task<List<CoinBalance>>

A list of coin balances.

GetCoinBalances(string, List<string>?, int, int, current_fungible_asset_balances_bool_exp?, current_fungible_asset_balances_order_by?)

Gets a paginated list of coin balances of the given address.

public Task<List<CoinBalance>> GetCoinBalances(string address, List<string>? types = null, int offset = 0, int limit = 50, current_fungible_asset_balances_bool_exp? where = null, current_fungible_asset_balances_order_by? orderBy = null)

Parameters

address string

The address of the account.

types List<string>

The types of the coin balances to return.

offset int

The offset of the query.

limit int

The item limit of the query.

where current_fungible_asset_balances_bool_exp

The condition to filter the coin balances.

orderBy current_fungible_asset_balances_order_by

The order by condition of the query.

Returns

Task<List<CoinBalance>>

A list of coin balances.

GetInfo(AccountAddress)

Gets the account information of the given address. This includes the sequence number and authentication key.

public Task<AccountData> GetInfo(AccountAddress address)

Parameters

address AccountAddress

The address of the account.

Returns

Task<AccountData>

The account information of the given address.

GetInfo(string)

Gets the account information of the given address. This includes the sequence number and authentication key.

public Task<AccountData> GetInfo(string address)

Parameters

address string

The address of the account.

Returns

Task<AccountData>

The account information of the given address.

GetModule(AccountAddress, string, ulong?)

Gets the Move module of the given address and module name.

The function will be cached every time it is called with the same parameters to avoid unnecessary network requests.

public Task<MoveModuleBytecode> GetModule(AccountAddress address, string moduleName, ulong? ledgerVersion = null)

Parameters

address AccountAddress

The address of the account.

moduleName string

The name of the module.

ledgerVersion ulong?

The ledger version to use for the module call.

Returns

Task<MoveModuleBytecode>

The Move bytecode and ABI.

GetModule(string, string, ulong?)

Gets the Move module of the given address and module name.

The function will be cached every time it is called with the same parameters to avoid unnecessary network requests.

public Task<MoveModuleBytecode> GetModule(string address, string moduleName, ulong? ledgerVersion = null)

Parameters

address string

The address of the account.

moduleName string

The name of the module.

ledgerVersion ulong?

The ledger version to use for the module call.

Returns

Task<MoveModuleBytecode>

The Move bytecode and ABI.

GetResource(AccountAddress, string, ulong?)

public Task<MoveResource> GetResource(AccountAddress address, string resourceType, ulong? ledgerVersion = null)

Parameters

address AccountAddress
resourceType string
ledgerVersion ulong?

Returns

Task<MoveResource>

GetResource(string, string, ulong?)

public Task<MoveResource> GetResource(string address, string resourceType, ulong? ledgerVersion = null)

Parameters

address string
resourceType string
ledgerVersion ulong?

Returns

Task<MoveResource>

GetResource<T>(string, string, ulong?)

Gets the resource of the given address and resource type.

public Task<T> GetResource<T>(string address, string resourceType, ulong? ledgerVersion = null) where T : class

Parameters

address string

The address of the account.

resourceType string

The resource type.

ledgerVersion ulong?

The ledger version to use for the resource call.

Returns

Task<T>

The resource of the given address and resource type.

Type Parameters

T

The return type of the resource. Should typically be MoveResource.

GetResources(AccountAddress, int?, int?)

Gets a paginated list of resources of the given address.

public Task<List<MoveResource>> GetResources(AccountAddress address, int? start = null, int? limit = null)

Parameters

address AccountAddress

The address of the account.

start int?

The start index of the resources to return.

limit int?

The limit of the resources to return.

Returns

Task<List<MoveResource>>

The resources of the given address.

GetResources(string, int?, int?)

Gets a paginated list of resources of the given address.

public Task<List<MoveResource>> GetResources(string address, int? start = null, int? limit = null)

Parameters

address string

The address of the account.

start int?

The start index of the resources to return.

limit int?

The limit of the resources to return.

Returns

Task<List<MoveResource>>

The resources of the given address.

GetTokenOwnership(AccountAddress, string, int, int, current_token_ownerships_v2_bool_exp?, current_token_ownerships_v2_order_by?)

Gets the token ownership of the given address and token id.

public Task<TokenOwnership?> GetTokenOwnership(AccountAddress address, string tokenId, int offset = 0, int limit = 50, current_token_ownerships_v2_bool_exp? where = null, current_token_ownerships_v2_order_by? orderBy = null)

Parameters

address AccountAddress

The address of the account.

tokenId string

The token id of the token ownership to return.

offset int

The offset of the query.

limit int

The item limit of the query.

where current_token_ownerships_v2_bool_exp

The condition to filter the token ownerships.

orderBy current_token_ownerships_v2_order_by

The order by condition of the query.

Returns

Task<TokenOwnership>

The token ownership of the given address and token id.

GetTokenOwnership(string, string, int, int, current_token_ownerships_v2_bool_exp?, current_token_ownerships_v2_order_by?)

Gets the token ownership of the given address and token id.

public Task<TokenOwnership?> GetTokenOwnership(string address, string tokenId, int offset = 0, int limit = 50, current_token_ownerships_v2_bool_exp? where = null, current_token_ownerships_v2_order_by? orderBy = null)

Parameters

address string

The address of the account.

tokenId string

The token id of the token ownership to return.

offset int

The offset of the query.

limit int

The item limit of the query.

where current_token_ownerships_v2_bool_exp

The condition to filter the token ownerships.

orderBy current_token_ownerships_v2_order_by

The order by condition of the query.

Returns

Task<TokenOwnership>

The token ownership of the given address and token id.

GetTokenOwnerships(AccountAddress, List<string>?, int, int, current_token_ownerships_v2_bool_exp?, current_token_ownerships_v2_order_by?)

Gets a paginated list of token ownerships of the given address.

public Task<List<TokenOwnership>> GetTokenOwnerships(AccountAddress address, List<string>? collectionIds = null, int offset = 0, int limit = 50, current_token_ownerships_v2_bool_exp? where = null, current_token_ownerships_v2_order_by? orderBy = null)

Parameters

address AccountAddress

The address of the account.

collectionIds List<string>

The collection ids of the token ownerships to return.

offset int

The offset of the query.

limit int

The item limit of the query.

where current_token_ownerships_v2_bool_exp

The condition to filter the token ownerships.

orderBy current_token_ownerships_v2_order_by

The order by condition of the query.

Returns

Task<List<TokenOwnership>>

A list of token ownerships.

GetTokenOwnerships(string, List<string>?, int, int, current_token_ownerships_v2_bool_exp?, current_token_ownerships_v2_order_by?)

Gets a paginated list of token ownerships of the given address.

public Task<List<TokenOwnership>> GetTokenOwnerships(string address, List<string>? collectionIds = null, int offset = 0, int limit = 50, current_token_ownerships_v2_bool_exp? where = null, current_token_ownerships_v2_order_by? orderBy = null)

Parameters

address string

The address of the account.

collectionIds List<string>

The collection ids of the token ownerships to return.

offset int

The offset of the query.

limit int

The item limit of the query.

where current_token_ownerships_v2_bool_exp

The condition to filter the token ownerships.

orderBy current_token_ownerships_v2_order_by

The order by condition of the query.

Returns

Task<List<TokenOwnership>>

A list of token ownerships.

GetTransactionCount(AccountAddress)

Gets the number of transactions committed for the given address.

public Task<int> GetTransactionCount(AccountAddress address)

Parameters

address AccountAddress

The address of the account.

Returns

Task<int>

The number of transactions committed for the given address.

GetTransactionCount(string)

Gets the number of transactions committed for the given address.

public Task<int> GetTransactionCount(string address)

Parameters

address string

The address of the account.

Returns

Task<int>

The number of transactions committed for the given address.

LookupOriginalAccountAddress(string)

public Task<AccountAddress> LookupOriginalAccountAddress(string authenticationKey)

Parameters

authenticationKey string

Returns

Task<AccountAddress>