UNPKG

@ledgerhq/coin-stacks

Version:
66 lines 3.04 kB
import { BalanceResponse, BroadcastTransactionRequest, EstimatedFeesRequest, FungibleTokenMetadataResponse, GetNonceResponse, MempoolResponse, MempoolTransaction, NetworkStatusResponse, TokenBalanceResponse, TransactionResponse, TransactionsResponse } from "../types/api"; import { StacksMainnet, StacksTestnet } from "@stacks/network"; export declare const StacksNetwork: { mainnet: StacksMainnet; testnet: StacksTestnet; }; /** * Fetches STX balance for an address */ export declare const fetchBalances: (addr: string) => Promise<BalanceResponse>; /** * Fetches a page of token balances for an address */ export declare const fetchTokenBalancesPage: (addr: string, offset?: number, limit?: number) => Promise<TokenBalanceResponse>; /** * Fetches all token balances for an address by paginating through results */ export declare const fetchAllTokenBalances: (addr: string) => Promise<Record<string, string>>; /** * Fetches estimated fees for a transfer */ export declare const fetchEstimatedFees: (request: EstimatedFeesRequest) => Promise<number>; /** * Fetches current blockchain status, including block height */ export declare const fetchBlockHeight: () => Promise<NetworkStatusResponse>; /** * Fetches a page of transactions for an address */ export declare const fetchTransactionsPage: (addr: string, offset?: number, limit?: number) => Promise<TransactionsResponse>; /** * Fetches all transactions for an address */ export declare const fetchAllTransactions: (addr: string) => Promise<TransactionResponse[]>; /** * Fetches all transactions for an address and organizes them by type */ export declare const fetchFullTxs: (addr: string) => Promise<[TransactionResponse[], Record<string, TransactionResponse[]>]>; /** * Broadcasts a signed transaction to the Stacks network */ export declare const broadcastTx: (message: BroadcastTransactionRequest) => Promise<string>; /** * Fetches a page of mempool transactions for an address */ export declare const fetchMempoolTransactionsPage: (addr: string, offset?: number, limit?: number) => Promise<MempoolResponse>; /** * Fetches all mempool transactions for an address */ export declare const fetchFullMempoolTxs: (addr: string) => Promise<MempoolTransaction[]>; /** * Fetches the nonce for an address */ export declare const fetchNonce: (addr: string) => Promise<GetNonceResponse>; /** * Fetches metadata for a fungible token by contract address * This can be used to extract the asset_identifier from a contract_id * @param contractAddress - The contract address in format: ADDRESS.CONTRACT_NAME * @returns The fungible token metadata including asset_identifier */ export declare const fetchFungibleTokenMetadata: (contractAddress: string) => Promise<FungibleTokenMetadataResponse>; /** * Fetches metadata for a fungible token by contract address with caching */ export declare const fetchFungibleTokenMetadataCached: import("@ledgerhq/live-network/cache").CacheRes<[args: string], FungibleTokenMetadataResponse>; //# sourceMappingURL=api.d.ts.map