import BigNumber from 'bignumber.js'; import { Account, Context } from '../../internal'; import { EventIdEnum, ModuleIdEnum } from '../../middleware/types'; import { EventIdentifier, ExtrinsicDataWithFees, MiddlewareMetadata, NetworkProperties, ProcedureMethod, ProtocolFees, SubCallback, SubmissionDetails, TransactionPayloadInput, TransferPolyxParams, TxTag, UnsubCallback } from '../../types'; /** * Handles all Network related functionality, including querying for historical events from middleware */ export declare class Network { private readonly context; /** * @hidden */ constructor(context: Context); /** * Retrieve the number of the latest finalized block in the chain */ getLatestBlock(): Promise; /** * Fetch the current network version (e.g. 3.1.0) */ getVersion(): Promise; /** * Retrieve the chain's SS58 format */ getSs58Format(): BigNumber; /** * Retrieve information for the current network */ getNetworkProperties(): Promise; /** * Retrieve the protocol fees associated with running specific transactions * * @param args.tags - list of transaction tags (e.g. [TxTags.asset.CreateAsset, TxTags.asset.RegisterUniqueTicker] or ["asset.createAsset", "asset.registerTicker"]) */ getProtocolFees(args: { tags: TxTag[]; }): Promise; /** * Get the treasury wallet address */ getTreasuryAccount(): Account; /** * Get the Treasury POLYX balance * * @returns Promise that resolves to the current Treasury balance */ getTreasuryBalance(): Promise; /** * Get the Treasury POLYX balance (with subscription support) * * @param callback - Callback function that receives balance updates * * @returns Promise that resolves to an unsubscribe function * * @note can be subscribed to, if connected to node using a web socket */ getTreasuryBalance(callback: SubCallback): Promise; /** * Transfer an amount of POLYX to a specified Account */ transferPolyx: ProcedureMethod; /** * Retrieve a single event by any of its indexed arguments. Can be filtered using parameters * * @param opts.moduleId - type of the module to fetch * @param opts.eventId - type of the event to fetch * @param opts.eventArg0 - event parameter value to filter by in position 0 * @param opts.eventArg1 - event parameter value to filter by in position 1 * @param opts.eventArg2 - event parameter value to filter by in position 2 * * @note uses the middlewareV2 */ getEventByIndexedArgs(opts: { moduleId: ModuleIdEnum; eventId: EventIdEnum; eventArg0?: string; eventArg1?: string; eventArg2?: string; }): Promise; /** * Submits a transaction payload with its signature to the chain. `signature` should be hex encoded * * @throws if the signature is not hex encoded */ submitTransaction(txPayload: TransactionPayloadInput, signature: string): Promise; /** * Retrieve a list of events. Can be filtered using parameters * * @deprecated * @param opts.moduleId - type of the module to fetch * @param opts.eventId - type of the event to fetch * @param opts.eventArg0 - event parameter value to filter by in position 0 * @param opts.eventArg1 - event parameter value to filter by in position 1 * @param opts.eventArg2 - event parameter value to filter by in position 2 * @param opts.size - page size * @param opts.start - page offset * * @note uses the middlewareV2 */ getEventsByIndexedArgs(opts: { moduleId: ModuleIdEnum; eventId: EventIdEnum; eventArg0?: string; eventArg1?: string; eventArg2?: string; size?: BigNumber; start?: BigNumber; }): Promise; /** * Retrieve a transaction by hash * * @param opts.txHash - hash of the transaction * * @note uses the middlewareV2 */ getTransactionByHash(opts: { txHash: string; }): Promise; /** * Retrieve middleware metadata. * Returns null if middleware is disabled * * @note uses the middleware V2 */ getMiddlewareMetadata(): Promise; /** * Get the number of blocks the middleware needs to process to be synced with chain. * The lag can be around somewhere upto 15 blocks, but this can increase if the block size being processed by the Middleware is too large. * If the lag is too large, its recommended to check the indexer health to make sure the Middleware is processing the blocks. * * @note uses the middleware V2 */ getMiddlewareLag(): Promise; /** * Returns whether or not the connected chain node as support for confidential assets */ supportsConfidentialAssets(): boolean; /** * Returns if functions can be subscribed. * * @returns `true` if connected over ws(s)://, otherwise `false` */ supportsSubscription(): boolean; } //# sourceMappingURL=Network.d.ts.map