UNPKG

@ponziland/account

Version:

Account management library for Starknet with wallet modal and connection state

23 lines (22 loc) 1.02 kB
import type { AccountProvider, StoredSession } from '../context/account.svelte.js'; import { WALLET_API } from '@starknet-io/types-js'; import { WalletAccount, Account } from 'starknet'; export declare abstract class CommonStarknetWallet implements AccountProvider { protected _wallet?: WalletAccount; protected _session?: Account; protected _walletObject: WALLET_API.StarknetWindowObject; constructor(walletObject: WALLET_API.StarknetWindowObject); abstract supportsSession(): boolean; abstract getAccount(): Account | undefined; abstract setupSession(): Promise<StoredSession | void>; connect(): Promise<void>; disconnect(): Promise<void>; loadSession(storage: StoredSession): Promise<any>; getWalletAccount(): WalletAccount | undefined; get icon(): string; } export declare class NoSessionStarknetWallet extends CommonStarknetWallet { supportsSession(): boolean; getAccount(): WalletAccount | undefined; setupSession(): Promise<StoredSession | void>; }