UNPKG

@fastnear/api

Version:

Interact with NEAR Protocol blockchain including transaction signing, utilities, and more.

1,014 lines (1,008 loc) 34.5 kB
import * as reExportAllUtils from '@fastnear/utils'; import { NEP413Message } from '@fastnear/utils'; interface AccessKeyWithError { result: { nonce: number; permission?: any; error?: string; }; } interface BlockView { result: { header: { hash: string; timestamp_nanosec: string; }; }; } interface LastKnownBlock { header: { hash: string; timestamp_nanosec: string; }; } interface AccessKeyView { nonce: number; permission: any; } interface FastNearRpcAccountView { amount: string; locked?: string; storage_usage?: number; code_hash?: string; block_height?: number; block_hash?: string; [key: string]: any; } interface FastNearRpcQueryAccountResponse { result: FastNearRpcAccountView; [key: string]: any; } interface FastNearRecipeViewAccountResult extends FastNearRpcAccountView { } interface RecipeViewContractParams { contractId: string; methodName: string; args?: any; argsBase64?: string; blockId?: string; } interface RecipeViewAccountParams { accountId: string; blockId?: string; } type RecipeViewAccountInput = string | RecipeViewAccountParams; interface RecipeInspectTransactionParams { txHash: string; accountId?: string; } type RecipeInspectTransactionInput = string | RecipeInspectTransactionParams; interface RecipeFunctionCallParams { receiverId: string; methodName: string; args?: Record<string, any>; argsBase64?: string; gas?: string; deposit?: string; waitUntil?: string; network?: "mainnet" | "testnet"; } interface RecipeTransferParams { receiverId: string; amount: string; waitUntil?: string; network?: "mainnet" | "testnet"; } interface RecipeConnectParams { contractId?: string; excludedWallets?: string[]; features?: Record<string, boolean>; network?: "mainnet" | "testnet"; } interface FastNearRecipeDiscoveryEntry { id: string; api: string; title: string; } interface ExplainedAction { kind: "action"; type: string; params: Record<string, any>; methodName?: string | null; gas?: string | null; deposit?: string | null; args?: any; argsBase64?: string | null; publicKey?: string | null; stake?: string | null; beneficiaryId?: string | null; accessKey?: any; codeBase64?: string | null; codeLength?: number | null; } interface ExplainedTransaction { kind: "transaction"; signerId?: string | null; receiverId: string; actionCount: number; actions: ExplainedAction[]; } interface ExplainedError { kind: "rpc_error" | "wallet_error" | "transport_error" | "error"; code: string | number | null; name: string | null; message: string; data: any; retryable: boolean; } interface FastNearApiAccountState { balance: string; locked?: string; storage_usage?: number; code_hash?: string; block_height?: number; block_hash?: string; [key: string]: any; } interface FastNearApiTokenBalance { contract_id?: string; ft_id?: string; symbol?: string; balance?: string; balance_yocto?: string; decimals?: number; [key: string]: any; } interface FastNearApiNftContractHolding { contract_id?: string; nft_contract_id?: string; tokens?: any[]; [key: string]: any; } interface FastNearApiStakingPoolPosition { pool_id?: string; contract_id?: string; staked_balance?: string; unstaked_balance?: string; can_withdraw?: boolean; [key: string]: any; } interface FastNearApiPublicKeyAccount { account_id: string; public_key?: string; access_key?: any; [key: string]: any; } interface FastNearApiFtTopAccount { account_id: string; balance?: string; human_balance?: string; [key: string]: any; } interface FastNearApiV1AccountFullResponse { account_id: string; state: FastNearApiAccountState; tokens: FastNearApiTokenBalance[]; nfts: FastNearApiNftContractHolding[]; pools: FastNearApiStakingPoolPosition[]; [key: string]: any; } interface FastNearApiV1AccountFtResponse { account_id?: string; tokens: FastNearApiTokenBalance[]; page_token?: string | null; resume_token?: string | null; [key: string]: any; } interface FastNearApiV1AccountNftResponse { account_id?: string; nfts: FastNearApiNftContractHolding[]; page_token?: string | null; resume_token?: string | null; [key: string]: any; } interface FastNearApiV1AccountStakingResponse { account_id?: string; pools: FastNearApiStakingPoolPosition[]; page_token?: string | null; resume_token?: string | null; [key: string]: any; } interface FastNearApiV1PublicKeyResponse { public_key?: string; accounts: FastNearApiPublicKeyAccount[]; [key: string]: any; } interface FastNearApiV1PublicKeyAllResponse { public_key?: string; accounts: FastNearApiPublicKeyAccount[]; transactions?: any[]; [key: string]: any; } interface FastNearApiV1FtTopResponse { token_id?: string; accounts: FastNearApiFtTopAccount[]; page_token?: string | null; [key: string]: any; } interface FastNearTxExecutionOutcome { block_hash?: string; block_height?: number; id?: string; logs?: string[]; outcome?: any; proof?: any[]; executor_id?: string; status?: any; tokens_burnt?: string; [key: string]: any; } interface FastNearTxTransactionRecord { hash: string; signer_id: string; receiver_id: string; actions?: any[]; [key: string]: any; } interface FastNearTxReceiptRow { receipt_id?: string; receipt?: any; execution_outcome?: FastNearTxExecutionOutcome; [key: string]: any; } interface FastNearTxTransactionRow { transaction: FastNearTxTransactionRecord; execution_outcome: FastNearTxExecutionOutcome; receipts: FastNearTxReceiptRow[]; [key: string]: any; } interface FastNearTxBlockRow { block_height?: number; block_hash?: string; transactions?: FastNearTxTransactionRow[]; receipts?: FastNearTxReceiptRow[]; [key: string]: any; } interface FastNearTxTransactionsResponse { transactions: FastNearTxTransactionRow[]; resume_token?: string | null; page_token?: string | null; [key: string]: any; } interface FastNearTxReceiptResponse { receipt?: FastNearTxReceiptRow | null; receipts?: FastNearTxReceiptRow[]; transaction?: FastNearTxTransactionRow | null; [key: string]: any; } interface FastNearTxAccountResponse { transactions?: FastNearTxTransactionRow[]; resume_token?: string | null; page_token?: string | null; [key: string]: any; } interface FastNearTxBlockResponse { block?: FastNearTxBlockRow; [key: string]: any; } interface FastNearTxBlocksResponse { blocks: FastNearTxBlockRow[]; resume_token?: string | null; page_token?: string | null; [key: string]: any; } interface FastNearTransfersEntry { account_id?: string; asset_id?: string; human_amount?: string; other_account_id?: string; transfer_type?: string; transaction_id?: string; block_height?: number; [key: string]: any; } interface FastNearTransfersQueryResponse { transfers: FastNearTransfersEntry[]; resume_token?: string | null; [key: string]: any; } interface FastNearNeardataTransaction { hash?: string; signer_id?: string; receiver_id?: string; [key: string]: any; } interface FastNearNeardataBlockHeader { height: number; hash?: string; prev_hash?: string; timestamp_nanosec?: string; [key: string]: any; } interface FastNearNeardataChunk { chunk_hash?: string; shard_id?: number; transactions: FastNearNeardataTransaction[]; [key: string]: any; } interface FastNearNeardataShard { shard_id: number; chunk: FastNearNeardataChunk; [key: string]: any; } interface FastNearNeardataBlock { header: FastNearNeardataBlockHeader; [key: string]: any; } interface FastNearNeardataLastBlockFinalResponse { block: FastNearNeardataBlock; shards: FastNearNeardataShard[]; [key: string]: any; } interface FastNearNeardataLastBlockOptimisticResponse { block: FastNearNeardataBlock; shards: FastNearNeardataShard[]; [key: string]: any; } interface FastNearNeardataBlockResponse { block: FastNearNeardataBlock; shards: FastNearNeardataShard[]; [key: string]: any; } interface FastNearNeardataBlockHeadersResponse { block: FastNearNeardataBlock; shards?: FastNearNeardataShard[]; [key: string]: any; } interface FastNearNeardataBlockShardResponse { block: FastNearNeardataBlock; shard: FastNearNeardataShard; [key: string]: any; } interface FastNearNeardataBlockChunkResponse { block: FastNearNeardataBlock; chunk: FastNearNeardataChunk; [key: string]: any; } interface FastNearNeardataBlockOptimisticResponse { block: FastNearNeardataBlock; shards: FastNearNeardataShard[]; [key: string]: any; } interface FastNearNeardataFirstBlockResponse { block: FastNearNeardataBlock; [key: string]: any; } interface FastNearNeardataHealthResponse { status?: string; ok?: boolean; [key: string]: any; } interface FastNearKvEntry { current_account_id: string; predecessor_id: string; key: string; value: any; block_height?: number; block_hash?: string; timestamp_nanosec?: string; [key: string]: any; } interface FastNearKvEntriesResponse { entries: FastNearKvEntry[]; resume_token?: string | null; page_token?: string | null; [key: string]: any; } interface FastNearKvGetLatestKeyResponse extends FastNearKvEntriesResponse { } interface FastNearKvGetHistoryKeyResponse extends FastNearKvEntriesResponse { } interface FastNearKvLatestByAccountResponse extends FastNearKvEntriesResponse { } interface FastNearKvHistoryByAccountResponse extends FastNearKvEntriesResponse { } interface FastNearKvLatestByPredecessorResponse extends FastNearKvEntriesResponse { } interface FastNearKvHistoryByPredecessorResponse extends FastNearKvEntriesResponse { } interface FastNearKvAllByPredecessorResponse extends FastNearKvEntriesResponse { } interface FastNearKvMultiResult { entries?: FastNearKvEntry[]; [key: string]: any; } interface FastNearKvMultiResponse { results?: FastNearKvMultiResult[]; entries?: FastNearKvEntry[]; [key: string]: any; } type FastNearSignMessageParams = NEP413Message; type IntegerType = "u8" | "u16" | "u32" | "u64" | "u128"; type StringType = "string"; type OptionType = { option: Schema; }; type ArrayType = { array: { type: Schema; len?: number; }; }; type EnumType = { enum: Array<StructType>; }; type StructType = { struct: { [key: string]: Schema; }; }; type Schema = IntegerType | StringType | OptionType | ArrayType | EnumType | StructType; declare function serialize(schema: Schema, value: unknown): Uint8Array; declare function deserialize(schema: Schema, buffer: Uint8Array): any; type FastNearNetworkId = "mainnet" | "testnet"; interface FastNearServiceConfig { baseUrl?: string | null; } interface FastNearServicesConfig { rpc?: FastNearServiceConfig; archival?: FastNearServiceConfig; api?: FastNearServiceConfig; tx?: FastNearServiceConfig; transfers?: FastNearServiceConfig; neardata?: FastNearServiceConfig; fastdata?: { kvBaseUrl?: string | null; }; } interface NetworkConfig { networkId: FastNearNetworkId; apiKey?: string | null; nodeUrl?: string; walletUrl?: string; helperUrl?: string; explorerUrl?: string; services?: FastNearServicesConfig; [key: string]: any; } interface TxStatus { txId: string; updateTimestamp?: number; [key: string]: any; } type TxHistory = Record<string, TxStatus>; interface WalletProvider { connect(options?: { contractId?: string; network?: string; excludedWallets?: string[]; features?: Record<string, boolean>; }): Promise<{ accountId: string; network?: string; } | null>; restore?(options?: { contractId?: string; network?: string; }): Promise<{ accountId: string; network?: string; } | null>; disconnect(options?: { network?: string; }): Promise<void>; sendTransaction(params: { receiverId: string; actions: any[]; signerId?: string; network?: string; }): Promise<any>; signMessage?(params: { message: string; recipient: string; nonce: Uint8Array; network?: string; }): Promise<any>; accountId(options?: { network?: string; }): string | null; isConnected(options?: { network?: string; }): boolean; } declare const MaxBlockDelayMs: number; declare function withBlockId(params: Record<string, any>, blockId?: string): { finality: string; } | { block_id: string; }; interface RpcRouteOptions { /** * Route this call to the archival RPC (`services.archival.baseUrl`) * instead of the default. Useful for queries with a historical * `blockId`. Falls back to the regular RPC if archival isn't configured. */ useArchival?: boolean; /** * Route this call to the override network's RPC instead of the active * `near.config().networkId`. Useful when a page holds parallel * mainnet+testnet sessions and a single read or write needs to target * the non-active network without flipping config back and forth. */ network?: FastNearNetworkId; } declare function sendRpc<T = any>(method: string, params: Record<string, any> | any[], options?: RpcRouteOptions): Promise<T>; declare function afterTxSent(txId: string, network?: FastNearNetworkId): void; declare function sendTxToRpc(signedTxBase64: string, waitUntil: string | undefined, txId: string, network?: FastNearNetworkId): Promise<any>; /** * Generates a mock transaction ID. */ declare function generateTxId(): string; declare const accountId: (options?: { network?: FastNearNetworkId; }) => string | null | undefined; declare const publicKey: (options?: { network?: FastNearNetworkId; }) => string | null | undefined; declare const config: (newConfig?: Partial<NetworkConfig>) => NetworkConfig; declare const authStatus: (options?: { network?: FastNearNetworkId; }) => string | Record<string, any>; declare const getPublicKeyForContract: (options?: { network?: FastNearNetworkId; }) => string | null | undefined; declare const selected: (options?: { network?: FastNearNetworkId; }) => { network: FastNearNetworkId; nodeUrl: string | undefined; walletUrl: string | undefined; helperUrl: string | undefined; explorerUrl: string | undefined; account: string | null | undefined; contract: string | null | undefined; publicKey: string | null | undefined; }; declare const requestSignIn: ({ contractId, excludedWallets, features, network, }?: { contractId?: string; excludedWallets?: string[]; features?: Record<string, boolean>; network?: FastNearNetworkId; }) => Promise<{ accountId: string; network?: string; } | undefined>; declare const view: ({ contractId, methodName, args, argsBase64, blockId, useArchival, network, }: { contractId: string; methodName: string; args?: any; argsBase64?: string; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<any>; declare const queryAccount: ({ accountId, blockId, useArchival, network, }: { accountId: string; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<FastNearRpcQueryAccountResponse>; declare const queryBlock: ({ blockId, useArchival, network }: { blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<BlockView>; declare const queryAccessKey: ({ accountId, publicKey, blockId, useArchival, network, }: { accountId: string; publicKey: string; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<AccessKeyWithError>; declare const queryTx: ({ txHash, accountId, useArchival, network }: { txHash: string; accountId: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<any>; declare function print(value: unknown): void; declare const tx: { transactions: ({ txHashes, network, ...filters }: { txHashes: string[]; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearTxTransactionsResponse>; receipt: ({ receiptId, network, ...filters }: { receiptId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearTxReceiptResponse>; account: ({ accountId, network, ...filters }: { accountId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearTxAccountResponse>; block: ({ network, ...params }?: { network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearTxBlockResponse>; blocks: ({ network, ...params }?: { network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearTxBlocksResponse>; }; declare const api: { v1: { accountFull: ({ accountId, network, ...query }: { accountId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearApiV1AccountFullResponse>; accountFt: ({ accountId, network, ...query }: { accountId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearApiV1AccountFtResponse>; accountNft: ({ accountId, network, ...query }: { accountId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearApiV1AccountNftResponse>; accountStaking: ({ accountId, network, ...query }: { accountId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearApiV1AccountStakingResponse>; publicKey: ({ publicKey, network, ...query }: { publicKey: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearApiV1PublicKeyResponse>; publicKeyAll: ({ publicKey, network, ...query }: { publicKey: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearApiV1PublicKeyAllResponse>; ftTop: ({ tokenId, network, ...query }: { tokenId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearApiV1FtTopResponse>; }; }; declare const transfers: { query: ({ network, ...params }?: { network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearTransfersQueryResponse>; }; declare const ft: { balance: ({ contractId, accountId, blockId, useArchival, network }: { contractId: string; accountId: string; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<any>; metadata: ({ contractId, blockId, useArchival, network }: { contractId: string; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<any>; totalSupply: ({ contractId, blockId, useArchival, network }: { contractId: string; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<any>; storageBalance: ({ contractId, accountId, blockId, useArchival, network }: { contractId: string; accountId: string; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<any>; inventory: ({ accountId, network, ...query }: { accountId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearApiV1AccountFtResponse>; }; declare const nft: { metadata: ({ contractId, blockId, useArchival, network }: { contractId: string; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<any>; token: ({ contractId, tokenId, blockId, useArchival, network }: { contractId: string; tokenId: string; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<any>; forOwner: ({ contractId, accountId, fromIndex, limit, blockId, useArchival, network }: { contractId: string; accountId: string; fromIndex?: string; limit?: number; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<any>; supplyForOwner: ({ contractId, accountId, blockId, useArchival, network }: { contractId: string; accountId: string; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<any>; totalSupply: ({ contractId, blockId, useArchival, network }: { contractId: string; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<any>; tokens: ({ contractId, fromIndex, limit, blockId, useArchival, network }: { contractId: string; fromIndex?: string; limit?: number; blockId?: string; useArchival?: boolean; network?: FastNearNetworkId; }) => Promise<any>; inventory: ({ accountId, network, ...query }: { accountId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearApiV1AccountNftResponse>; }; declare const neardata: { lastBlockFinal: ({ network, ...query }?: { network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearNeardataLastBlockFinalResponse>; lastBlockOptimistic: ({ network, ...query }?: { network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearNeardataLastBlockOptimisticResponse>; block: ({ blockHeight, network, ...query }: { blockHeight: string | number; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearNeardataBlockResponse>; blockHeaders: ({ blockHeight, network, ...query }: { blockHeight: string | number; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearNeardataBlockHeadersResponse>; blockShard: ({ blockHeight, shardId, network, ...query }: { blockHeight: string | number; shardId: string | number; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearNeardataBlockShardResponse>; blockChunk: ({ blockHeight, shardId, network, ...query }: { blockHeight: string | number; shardId: string | number; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearNeardataBlockChunkResponse>; blockOptimistic: ({ blockHeight, network, ...query }: { blockHeight: string | number; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearNeardataBlockOptimisticResponse>; firstBlock: ({ network, ...query }?: { network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearNeardataFirstBlockResponse>; health: ({ network, ...query }?: { network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearNeardataHealthResponse>; }; declare const fastdata: { kv: { getLatestKey: ({ currentAccountId, predecessorId, key, network, ...query }: { currentAccountId: string; predecessorId: string; key: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearKvGetLatestKeyResponse>; getHistoryKey: ({ currentAccountId, predecessorId, key, network, ...query }: { currentAccountId: string; predecessorId: string; key: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearKvGetHistoryKeyResponse>; latestByAccount: ({ accountId, network, ...body }: { accountId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearKvLatestByAccountResponse>; historyByAccount: ({ accountId, network, ...body }: { accountId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearKvHistoryByAccountResponse>; latestByPredecessor: ({ currentAccountId, predecessorId, network, ...body }: { currentAccountId: string; predecessorId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearKvLatestByPredecessorResponse>; historyByPredecessor: ({ currentAccountId, predecessorId, network, ...body }: { currentAccountId: string; predecessorId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearKvHistoryByPredecessorResponse>; allByPredecessor: ({ predecessorId, network, ...body }: { predecessorId: string; network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearKvAllByPredecessorResponse>; multi: ({ network, ...body }: { network?: FastNearNetworkId; [key: string]: any; }) => Promise<FastNearKvMultiResponse>; }; }; declare const localTxHistory: () => TxHistory; declare const signOut: ({ network, }?: { network?: FastNearNetworkId; }) => Promise<void>; declare const sendTx: ({ receiverId, actions, waitUntil, network, }: { receiverId: string; actions: any[]; waitUntil?: string; network?: FastNearNetworkId; }) => Promise<any>; /** * Signs a NEP-413 message using the connected wallet. Pass an explicit * `{ network }` to route the signature through that network's wallet * session — useful when a page holds parallel mainnet+testnet sessions. * Without it, the active network's session is used. */ declare const signMessage: (message: NEP413Message, options?: { network?: FastNearNetworkId; }) => Promise<any>; /** * Set the wallet provider used by the API for signing and sending transactions. * Automatically called in IIFE builds when globalThis.nearWallet is present. */ declare const useWallet: (provider: WalletProvider) => void; declare const utils: typeof reExportAllUtils; declare const event: { _eventListeners: { account: Set<unknown>; tx: Set<unknown>; }; notifyAccountListeners: (accountId: string) => void; notifyTxListeners: (tx: TxStatus) => void; onAccount: (callback: (accountId: string) => void) => void; onTx: (callback: (tx: TxStatus) => void) => void; }; declare const state: Record<string, any>; declare const exp: { utils: typeof reExportAllUtils; borsh: { serialize: typeof serialize; deserialize: typeof deserialize; }; borshSchema: { Ed25519Signature: Schema; Secp256k1Signature: Schema; Signature: Schema; Ed25519Data: Schema; Secp256k1Data: Schema; PublicKey: Schema; FunctionCallPermission: Schema; FullAccessPermission: Schema; AccessKeyPermission: Schema; AccessKey: Schema; CreateAccount: Schema; DeployContract: Schema; FunctionCall: Schema; Transfer: Schema; Stake: Schema; AddKey: Schema; DeleteKey: Schema; DeleteAccount: Schema; ClassicAction: Schema; DelegateAction: Schema; SignedDelegate: Schema; Action: Schema; Transaction: Schema; SignedTransaction: Schema; }; }; declare const actions: { functionCall: ({ methodName, gas, deposit, args, argsBase64, }: { methodName: string; gas?: string; deposit?: string; args?: Record<string, any>; argsBase64?: string; }) => { type: string; methodName: string; args: Record<string, any> | undefined; argsBase64: string | undefined; gas: string | undefined; deposit: string | undefined; }; transfer: (yoctoAmount: string) => { type: string; deposit: string; }; stakeNEAR: ({ amount, publicKey }: { amount: string; publicKey: string; }) => { type: string; stake: string; publicKey: string; }; addFullAccessKey: ({ publicKey }: { publicKey: string; }) => { type: string; publicKey: string; accessKey: { permission: string; }; }; addLimitedAccessKey: ({ publicKey, allowance, accountId, methodNames, }: { publicKey: string; allowance: string; accountId: string; methodNames: string[]; }) => { type: string; publicKey: string; accessKey: { permission: string; allowance: string; receiverId: string; methodNames: string[]; }; }; deleteKey: ({ publicKey }: { publicKey: string; }) => { type: string; publicKey: string; }; deleteAccount: ({ beneficiaryId }: { beneficiaryId: string; }) => { type: string; beneficiaryId: string; }; createAccount: () => { type: string; }; deployContract: ({ codeBase64 }: { codeBase64: string; }) => { type: string; codeBase64: string; }; }; declare const explain: { action: (action: any) => ExplainedAction; tx: ({ signerId, receiverId, actions, }: { signerId?: string; receiverId: string; actions: any[]; }) => ExplainedTransaction; error: (error: unknown) => ExplainedError; }; declare function listRecipes(): FastNearRecipeDiscoveryEntry[]; declare function viewAccountRecipe(input: string): Promise<FastNearRecipeViewAccountResult>; declare function viewAccountRecipe(input: RecipeViewAccountParams): Promise<FastNearRecipeViewAccountResult>; declare function inspectTransactionRecipe(input: string): Promise<FastNearTxTransactionRow | null>; declare function inspectTransactionRecipe(input: RecipeInspectTransactionParams): Promise<FastNearTxTransactionRow | null>; declare const recipes: { viewContract: (params: RecipeViewContractParams) => Promise<any>; viewAccount: typeof viewAccountRecipe; inspectTransaction: typeof inspectTransactionRecipe; functionCall: ({ receiverId, methodName, args, argsBase64, gas, deposit, waitUntil, network, }: RecipeFunctionCallParams) => Promise<any>; transfer: ({ receiverId, amount, waitUntil, network, }: RecipeTransferParams) => Promise<any>; connect: (params?: RecipeConnectParams) => Promise<{ accountId: string; network?: string; } | undefined>; signMessage: (message: NEP413Message, options?: { network?: FastNearNetworkId; }) => Promise<any>; list: typeof listRecipes; toJSON: typeof listRecipes; }; export { type AccessKeyView, type AccessKeyWithError, type BlockView, type ExplainedAction, type ExplainedError, type ExplainedTransaction, type FastNearApiAccountState, type FastNearApiFtTopAccount, type FastNearApiNftContractHolding, type FastNearApiPublicKeyAccount, type FastNearApiStakingPoolPosition, type FastNearApiTokenBalance, type FastNearApiV1AccountFtResponse, type FastNearApiV1AccountFullResponse, type FastNearApiV1AccountNftResponse, type FastNearApiV1AccountStakingResponse, type FastNearApiV1FtTopResponse, type FastNearApiV1PublicKeyAllResponse, type FastNearApiV1PublicKeyResponse, type FastNearKvAllByPredecessorResponse, type FastNearKvEntriesResponse, type FastNearKvEntry, type FastNearKvGetHistoryKeyResponse, type FastNearKvGetLatestKeyResponse, type FastNearKvHistoryByAccountResponse, type FastNearKvHistoryByPredecessorResponse, type FastNearKvLatestByAccountResponse, type FastNearKvLatestByPredecessorResponse, type FastNearKvMultiResponse, type FastNearKvMultiResult, type FastNearNeardataBlock, type FastNearNeardataBlockChunkResponse, type FastNearNeardataBlockHeader, type FastNearNeardataBlockHeadersResponse, type FastNearNeardataBlockOptimisticResponse, type FastNearNeardataBlockResponse, type FastNearNeardataBlockShardResponse, type FastNearNeardataChunk, type FastNearNeardataFirstBlockResponse, type FastNearNeardataHealthResponse, type FastNearNeardataLastBlockFinalResponse, type FastNearNeardataLastBlockOptimisticResponse, type FastNearNeardataShard, type FastNearNeardataTransaction, type FastNearNetworkId, type FastNearRecipeDiscoveryEntry, type FastNearRecipeViewAccountResult, type FastNearRpcAccountView, type FastNearRpcQueryAccountResponse, type FastNearServiceConfig, type FastNearServicesConfig, type FastNearSignMessageParams, type FastNearTransfersEntry, type FastNearTransfersQueryResponse, type FastNearTxAccountResponse, type FastNearTxBlockResponse, type FastNearTxBlockRow, type FastNearTxBlocksResponse, type FastNearTxExecutionOutcome, type FastNearTxReceiptResponse, type FastNearTxReceiptRow, type FastNearTxTransactionRecord, type FastNearTxTransactionRow, type FastNearTxTransactionsResponse, type LastKnownBlock, MaxBlockDelayMs, type NetworkConfig, type RecipeConnectParams, type RecipeFunctionCallParams, type RecipeInspectTransactionInput, type RecipeInspectTransactionParams, type RecipeTransferParams, type RecipeViewAccountInput, type RecipeViewAccountParams, type RecipeViewContractParams, type RpcRouteOptions, type WalletProvider, accountId, actions, afterTxSent, api, authStatus, config, event, exp, explain, fastdata, ft, generateTxId, getPublicKeyForContract, localTxHistory, neardata, nft, print, publicKey, queryAccessKey, queryAccount, queryBlock, queryTx, recipes, requestSignIn, selected, sendRpc, sendTx, sendTxToRpc, signMessage, signOut, state, transfers, tx, useWallet, utils, view, withBlockId };