import { ApiPromise } from '@polkadot/api'; import { SigningManager } from '@polymathnetwork/signing-manager-types'; import { NormalizedCacheObject } from 'apollo-cache-inmemory'; import { ApolloClient } from 'apollo-client'; import { AccountManagement } from "./AccountManagement"; import { Assets } from "./Assets"; import { Identities } from "./Identities"; import { Account, Identity } from "./internal"; import { Settlements } from "./Settlements"; import { MiddlewareConfig } from "./types"; import { Claims } from './Claims'; import { Network } from './Network'; interface ConnectParams { nodeUrl: string; signingManager?: SigningManager; middleware?: MiddlewareConfig; } /** * Main entry point of the Polymesh SDK */ export declare class Polymesh { private context; /** * A set of methods to deal with Claims */ claims: Claims; /** * A set of methods to interact with the Polymesh network. This includes transferring POLYX, reading network properties and querying for historical events */ network: Network; /** * A set of methods for exchanging Assets */ settlements: Settlements; /** * A set of methods for managing a Polymesh Identity's Accounts and their permissions */ accountManagement: AccountManagement; /** * A set of methods for interacting with Polymesh Identities. */ identities: Identities; /** * A set of methods for interacting with Assets */ assets: Assets; /** * @hidden */ private constructor(); /** * Create an SDK instance and connect to a Polymesh node * * @param params.nodeUrl - URL of the Polymesh node this instance will be connecting to * @param params.signingManager - object in charge of managing keys and signing transactions * (optional, if not passed the SDK will not be able to submit transactions). Can be set later with * `setSigningManager` * @param params.middleware - middleware API URL and key (optional, used for historic queries) */ static connect(params: ConnectParams): Promise; /** * Retrieve the Identity associated to the signing Account (null if there is none) * * @throws if there is no signing Account associated to the SDK */ getSigningIdentity(): Promise; /** * Handle connection errors * * @returns an unsubscribe callback */ onConnectionError(callback: (...args: unknown[]) => unknown): () => void; /** * Handle disconnection * * @returns an unsubscribe callback */ onDisconnect(callback: (...args: unknown[]) => unknown): () => void; /** * Disconnect the client and close all open connections and subscriptions * * @note the SDK will become unusable after this operation. It will throw an error when attempting to * access any chain or middleware data. If you wish to continue using the SDK, you must * create a new instance by calling {@link connect} */ disconnect(): Promise; /** * Set the SDK's signing Account to the provided one * * @throws if the passed Account is not present in the Signing Manager (or there is no Signing Manager) */ setSigningAccount(signer: string | Account): Promise; /** * Set the SDK's Signing Manager to the provided one */ setSigningManager(signingManager: SigningManager): Promise; /** * Polkadot client */ get _polkadotApi(): ApiPromise; /** * signing address (to manually submit transactions with the polkadot API) */ get _signingAddress(): string; /** * Middleware client */ get _middlewareApi(): ApolloClient; } export {}; //# sourceMappingURL=Polymesh.d.ts.map