import { AccountData, PaginationArgs, LedgerVersionArg, MoveModuleBytecode, TransactionResponse, MoveResource, MoveStructId, PaginationArgsOfIndexer } from '../types/index.mjs'; import { AccountAddressInput, AccountAddress } from '../core/accountAddress.mjs'; import { PrivateKey } from '../core/crypto/privateKey.mjs'; import { EndlessConfig } from './endlessConfig.mjs'; import { A as Account$1 } from '../Ed25519Account-JTDdDAW6.mjs'; import { GetAccountCoinsDataResponse, GetCreatedCoinDataResponse, GetAccountsCoinBalanceResponse, AccountBalancesResponse, PageableCollectionResponse, PageableNftTokenResponse, PageableNftOwnedCollectionResponse } from '../types/indexer.mjs'; import '../utils/apiEndpoints.mjs'; import '../bcs/serializer.mjs'; import '../core/hex.mjs'; import '../core/common.mjs'; import '../bcs/deserializer.mjs'; import '../transactions/instances/transactionArgument.mjs'; import '../authenticationKey-BaHTUD3k.mjs'; import '../core/crypto/signature.mjs'; import '../utils/const.mjs'; import '../transactions/authenticator/account.mjs'; import '../core/crypto/ed25519.mjs'; import '../core/crypto/multiEd25519.mjs'; import '../core/crypto/multiKey.mjs'; import '../core/crypto/singleKey.mjs'; import '../core/crypto/bls12381.mjs'; import '../core/crypto/multiAuthKey.mjs'; import '../transactions/types.mjs'; import '../bcs/serializable/moveStructs.mjs'; import '../bcs/serializable/movePrimitives.mjs'; import '../bcs/serializable/fixedBytes.mjs'; import '../transactions/instances/rawTransaction.mjs'; import '../transactions/instances/chainId.mjs'; import '../transactions/instances/transactionPayload.mjs'; import '../transactions/instances/identifier.mjs'; import '../transactions/instances/moduleId.mjs'; import '../transactions/typeTag/index.mjs'; import '../transactions/instances/simpleTransaction.mjs'; import '../transactions/instances/multiAgentTransaction.mjs'; /** * A class to query all `Account` related queries on Endless. */ declare class Account { readonly config: EndlessConfig; constructor(config: EndlessConfig); /** * Queries the current state for an Endless account given its account address * * @param args.accountAddress Endless account address * * @returns The account data * * @example An example of the returned account * ``` * { * sequence_number: "1", * authentication_key: "0x5307b5f4bc67829097a8ba9b43dba3b88261eeccd1f709d9bde240fc100fbb69" * } * ``` */ getAccountInfo(args: { accountAddress: AccountAddressInput; }): Promise; /** * Queries for all modules in an account given an account address * * Note: In order to get all account modules, this function may call the API * multiple times as it auto paginates. * * @param args.accountAddress Endless account address * @param args.options.offset The number module to start returning results from * @param args.options.limit The number of results to return * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version * * @returns Account modules */ getAccountModules(args: { accountAddress: AccountAddressInput; options?: PaginationArgs & LedgerVersionArg; }): Promise; /** * Queries for a specific account module given account address and module name * * @param args.accountAddress Endless account address * @param args.moduleName The name of the module * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version * * @returns Account module * * @example * const module = await endless.getAccountModule({accountAddress:"0x456"}) * // An example of an account module response * ``` * { * bytecode: "0xa11ceb0b0600000006010002030206050807070f0d081c200", * abi: { address: "0x1" } * } * ``` */ getAccountModule(args: { accountAddress: AccountAddressInput; moduleName: string; options?: LedgerVersionArg; }): Promise; /** * Queries account transactions given an account address * * Note: In order to get all account transactions, this function may call the API * multiple times as it auto paginates. * * @example * const transactions = await endless.getAccountTransactions({accountAddress:"0x456"}) * * @param args.accountAddress Endless account address * @param args.options.offset The number transaction to start returning results from * @param args.options.limit The number of results to return * * @returns The account transactions */ getAccountTransactions(args: { accountAddress: AccountAddressInput; options?: PaginationArgs; }): Promise; /** * Queries all account resources given an account address * * Note: In order to get all account resources, this function may call the API * multiple times as it auto paginates. * * @example * const resources = await endless.getAccountResources({accountAddress:"0x456"}) * * @param args.accountAddress Endless account address * @param args.options.offset The number resource to start returning results from * @param args.options.limit The number of results to return * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version * @returns Account resources */ getAccountResources(args: { accountAddress: AccountAddressInput; options?: PaginationArgs & LedgerVersionArg; }): Promise; /** * Queries a specific account resource given account address and resource type. Note that the default is `any` in order * to allow for ease of accessing properties of the object. * * @type The typed output of the resource * @param args.accountAddress Endless account address * @param args.resourceType String representation of an on-chain Move struct type, i.e "0x1::endless_coin::EndlessCoin" * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version * * @returns Account resource * * @example * const resource = await endless.getAccountResource({accountAddress:"0x456"}) * */ getAccountResource(args: { accountAddress: AccountAddressInput; resourceType: MoveStructId; options?: LedgerVersionArg; }): Promise; /** * Looks up the account address for a given authentication key * * This handles both if the account's authentication key has been rotated or not. * * @example * const accountAddress = await endless.lookupOriginalAccountAddress({authenticationKey:account.accountAddress}) * * @param args.authenticationKey The authentication key * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version * @returns Promise The accountAddress associated with the authentication key */ lookupOriginalAccountAddress(args: { authenticationKey: AccountAddressInput; options?: LedgerVersionArg; }): Promise; /** * Queries an account's coins data * * @example * const accountCoinsData = await endless.getAccountCoinsData({accountAddress:"0x123"}) * * @param args.accountAddress The account address we want to get the coins data for * @param args.options.page optional. The page number * @param args.options.pageSize optional. The number of results to return * @param args.options.coin optional. Filter by coin id * @returns Array with the coins data */ getAccountCoinsData(args: { accountAddress: AccountAddressInput; options?: PaginationArgsOfIndexer & { coin?: string; }; }): Promise; /** * Queries coins data created by account * * @example * const accountCoinsData = await endless.getCoinsDataCreatedBy({accountAddress:"0x123"}) * * @param args.accountAddress The account address of who create the coins * @param args.options.page optional. The page number * @param args.options.pageSize optional. The number of results to return * @param args.options.coin optional. Filter by coin id * @returns Array with the coins data */ getCoinsDataCreatedBy(args: { accountAddress: AccountAddressInput; options?: PaginationArgsOfIndexer & { coin?: string; }; }): Promise; /** * Queries the account's EDS amount * * @example * const accountAPTAmount = await endless.getAccountAPTAmount({accountAddress:"0x123"}) * * @param args.accountAddress The account address we want to get the total count for * @returns Current amount of account's APT */ getAccountEDSAmount(args: { accountAddress: AccountAddressInput; }): Promise; /** * Queries the account's coin amount by the coin type * * @example * const accountCoinAmount = await endless.getAccountCoinAmount({accountAddress:"0x123", coinType:"0x1::endless_coin::EndlessCoin"}) * * @param args.accountAddress The account address we want to get the total count for * @param args.coinType The coin type to query * @returns Current amount of account's coin */ getAccountCoinAmount(args: { accountAddress: AccountAddressInput; coinId: string; }): Promise; /** * Derives an account by providing a private key. * This functions resolves the provided private key type and derives the public key from it. * * If the privateKey is a Secp256k1 type, it derives the account using the derived public key and * auth key using the SingleKey scheme locally. * * If the privateKey is a ED25519 type, it looks up the authentication key on chain, and uses it to resolve * whether it is a Legacy ED25519 key or a Unified ED25519 key. It then derives the account based * on that. * * @example * const account = await endless.deriveAccountFromPrivateKey({privateKey:new Ed25519PrivateKey("0x123")}) * * @param args.privateKey An account private key * @returns Account type */ deriveAccountFromPrivateKey(args: { privateKey: PrivateKey; }): Promise; /** * Queries an account's coins data * * @example * const accountCoinsData = await endless.getAccountCoinsData({accountAddress:["0x123"]}) * * @param args.accountAddress The account address we want to get the coins data for * @param args.coinAddress The coinAddress address we want to get the coins data for * @returns Array with the coins data */ getAccountsCoinBalance(args: { accountAddress: AccountAddressInput[]; coinAddress: AccountAddressInput; }): Promise; /** * Queries the balances of specified coins for multiple accounts. * * @example * const balances = await endless.getAccountsCoinsBalances({ * accounts: ["0x123", "0x456"], * coins: ["0x1::aptos_coin::AptosCoin"] * }); * * @param args.accounts The account addresses to query balances for. * @param args.coins The coin types (e.g., "0x1::aptos_coin::AptosCoin") to query balances for. * @returns An array of account balances corresponding to the requested accounts. */ getAccountsCoinsBalances(args: { accounts: AccountAddressInput[]; coins: string[]; }): Promise; /** * Queries for collections created by an account * * @param args.accountAddress The account address * @param args.options.page optional. The page number * @param args.options.pageSize optional. The number of results per page * @param args.options.collection optional. Filter by collection name or ID * @returns PageableCollectionResponse */ getAccountCollections(args: { accountAddress: AccountAddressInput; options?: PaginationArgsOfIndexer & { collection?: string; }; }): Promise; /** * Queries for NFTs owned by an account * * @param args.accountAddress The account address * @param args.options.page optional. The page number * @param args.options.pageSize optional. The number of results per page * @param args.options.token optional. Filter by token name or ID * @param args.options.collection optional. Filter by collection name or ID * @returns PageableNftTokenResponse */ getAccountNfts(args: { accountAddress: AccountAddressInput; options?: PaginationArgsOfIndexer & { token?: string; collection?: string; }; }): Promise; /** * Queries for NFT collections where the account owns tokens * * @param args.accountAddress The account address * @param args.options.page optional. The page number * @param args.options.pageSize optional. The number of results per page * @param args.options.collection optional. Filter by collection name or ID * @returns PageableNftOwnedCollectionResponse */ getAccountNftCollections(args: { accountAddress: AccountAddressInput; options?: PaginationArgsOfIndexer & { collection?: string; }; }): Promise; } export { Account };