@btc-vision/walletconnect
Version:
The OP_NET Wallet Connect library helps your dApp connect to any compatible wallet.
41 lines • 1.61 kB
TypeScript
import { type MLDSASignature, type Unisat, UnisatChainType, UnisatSigner } from '@btc-vision/transaction';
import { AbstractRpcProvider } from 'opnet';
import { SupportedWallets } from './supported-wallets';
export { type AbstractRpcProvider } from 'opnet';
export interface WalletBase {
isInstalled(): boolean;
isConnected(): boolean;
canAutoConnect(): Promise<boolean>;
getWalletInstance(): Unisat | null;
getProvider(): Promise<AbstractRpcProvider | null>;
getSigner(): Promise<UnisatSigner | null>;
connect(): Promise<string[] | undefined>;
disconnect(): Promise<void>;
getPublicKey(): Promise<string | null>;
getNetwork(): Promise<UnisatChainType>;
setAccountsChangedHook(fn: (accounts: string[]) => void): void;
removeAccountsChangedHook(): void;
setDisconnectHook(fn: () => void): void;
removeDisconnectHook(): void;
setChainChangedHook(fn: (network: UnisatChainType) => void): void;
removeChainChangedHook(): void;
getChainId(): void;
getMLDSAPublicKey(): Promise<string | null>;
getHashedMLDSAKey(): Promise<string | null>;
signMLDSAMessage(message: string): Promise<MLDSASignature | null>;
verifyMLDSASignature(message: string, signature: MLDSASignature): Promise<boolean>;
}
export interface WalletConnectWallet {
name: SupportedWallets;
icon: string;
controller: WalletBase;
}
export interface ControllerResponse<T> {
code: number;
data?: T;
}
export interface ControllerErrorResponse {
message: string;
}
export type ControllerConnectAccounts = string[];
//# sourceMappingURL=types.d.ts.map