@cosmos-kit/core
Version:
cosmos-kit wallet connector core package
47 lines (46 loc) • 2.78 kB
TypeScript
/// <reference types="node" />
import type { AssetList, Chain } from '@chain-registry/types';
import { Origin } from '@dao-dao/cosmiframe';
import EventEmitter from 'events';
import type { ChainWalletBase, MainWalletBase } from './bases';
import { StateBase } from './bases';
import type { NameService } from './name-service';
import { WalletRepo } from './repository';
import { ChainName, ChainRecord, EndpointOptions, EventName, NameServiceName, SessionOptions, SignerOptions, WalletConnectOptions, WalletName } from './types';
import type { Logger } from './utils';
import { Session } from './utils';
export declare class WalletManager extends StateBase {
chainRecords: ChainRecord[];
walletRepos: WalletRepo[];
defaultNameService: NameServiceName;
mainWallets: MainWalletBase[];
coreEmitter: EventEmitter;
walletConnectOptions?: WalletConnectOptions;
readonly session: Session;
repelWallet: boolean;
isLazy?: boolean;
throwErrors: boolean | 'connect_only';
subscribeConnectEvents: boolean;
cosmiframeEnabled: boolean;
private _reconnectMap;
constructor(chains: (Chain | ChainName)[], wallets: MainWalletBase[], logger: Logger, throwErrors: boolean | 'connect_only', subscribeConnectEvents?: boolean, allowedCosmiframeParentOrigins?: Origin[], assetLists?: AssetList[], defaultNameService?: NameServiceName, walletConnectOptions?: WalletConnectOptions, signerOptions?: SignerOptions, endpointOptions?: EndpointOptions, sessionOptions?: SessionOptions);
init(chains: (Chain | ChainName)[], assetLists: AssetList[], wallets: MainWalletBase[], walletConnectOptions?: WalletConnectOptions, signerOptions?: SignerOptions, endpointOptions?: EndpointOptions): void;
private checkEndpoints;
setWalletRepel(value: boolean): void;
addEndpoints: (endpoints: EndpointOptions['endpoints']) => void;
addChains: (chains: (Chain | ChainName)[], assetLists: AssetList[], signerOptions?: SignerOptions, endpoints?: EndpointOptions['endpoints']) => void;
on: (event: EventName, handler: (params: any) => void) => void;
off: (event: EventName, handler: (params: any) => void) => void;
get activeRepos(): WalletRepo[];
getMainWallet: (walletName: WalletName) => MainWalletBase;
getWalletRepo: (chainName: ChainName) => WalletRepo;
getChainWallet: (chainName: ChainName, walletName: WalletName) => ChainWalletBase;
getChainRecord: (chainName: ChainName) => ChainRecord;
getChainLogo: (chainName: ChainName) => string | undefined;
getNameService: (chainName?: ChainName) => Promise<NameService>;
private _reconnect;
private _restoreAccounts;
_handleCosmiframeKeystoreChangeEvent: (event: MessageEvent) => void;
onMounted: () => Promise<void>;
onUnmounted: () => void;
}