UNPKG

starknetkit

Version:

<!-- logo --> <p align="center"> <img width='300' src="https://starknetkit-website-git-blo-1541-argentlabs.vercel.app/starknetKit-logo.svg"> </p>

42 lines (40 loc) 1.87 kB
import { JsonRpcProvider } from '@walletconnect/jsonrpc-provider'; import { default as SignClient } from '@walletconnect/sign-client'; import { SignerConnectionClientOpts, SignerConnection } from '@walletconnect/signer-connection'; import { ProposalTypes, SessionTypes } from '@walletconnect/types'; import { EventEmitter } from 'events'; import { ProviderInterface } from 'starknet'; import { EthereumRpcConfig } from './starknet/adapter'; export interface NamespaceAdapterOptions { client: SignClient; chainId?: string | number; rpcUrl?: string; provider: ProviderInterface; } export declare abstract class NamespaceAdapter { abstract namespace: string; abstract chainId: number | string; abstract methods: string[]; abstract events: string[]; abstract session?: SessionTypes.Struct; abstract signerConnection: SignerConnection; abstract rpc: EthereumRpcConfig; protected abstract rpcProvider: JsonRpcProvider; protected abstract parseChainId(chainId: string): number | string; protected abstract formatChainId(chainId: string | number): string; protected abstract setAccounts(accounts: string[]): void; protected accounts: string[]; protected eventEmitter: EventEmitter<[never]>; updateSession: (session: SessionTypes.Struct) => void; isValidSession: ({ namespaces, requiredNamespaces, }: SessionTypes.Struct) => boolean; getRequiredNamespaces(): ProposalTypes.RequiredNamespaces; protected isCompatibleChainId(chainId: string): boolean; protected setChainIds(chains: string[]): void; protected setChainId(chain: string): void; protected parseAccountId(account: string): { chainId: string; address: string; }; protected getSignerConnection(client?: SignerConnectionClientOpts): SignerConnection; protected registerEventListeners(): void; }