UNPKG

@okcontract/sdk

Version:

One-stop-shop permissionless SDK for building any blockchain frontend

37 lines (36 loc) 1.63 kB
import type Transport from "@ledgerhq/hw-transport"; import { type AnyCell, type MapCell, type SheetProxy } from "@okcontract/cells"; import type { CacheQuery } from "@okcontract/coredata"; import { type Chain, type ChainType, type EVMType, type StringAddress } from "@okcontract/multichain"; import type { SignedMessage } from "@scv/auth"; import type { LocalSubscriber } from "@scv/cache"; import { type OKConnector, type Transaction } from "./wallet"; export declare class LedgerHQConnector implements OKConnector<EVMType> { readonly ID = "ledger"; readonly Network: "evm"; readonly Account: MapCell<StringAddress<EVMType>, true>; readonly ChainId: MapCell<number, true>; readonly Chain: AnyCell<Chain>; readonly Chains: AnyCell<Record<ChainType, Chain>>; readonly Addresses: AnyCell<StringAddress<EVMType>[]>; private readonly transport; private readonly ethApp; private readonly _local; constructor(proxy: SheetProxy, chains: AnyCell<Record<string, Chain>>, transport: Transport, options?: { local?: LocalSubscriber<CacheQuery>; }); private getAddressFromLedger; connect: () => Promise<{ account: `0x${string}`; chain: { id: number; }; }>; disconnect: () => Promise<void>; switchChain: (id: ChainType) => Promise<string>; signMessage: (message: string) => Promise<`0x${string}${string}${string}`>; signedMessage: (Msg: string) => Promise<SignedMessage>; sendTransaction: (tx: Transaction<EVMType>) => Promise<`0x${string}`>; deployContract: () => Promise<never>; addChain: () => Promise<never>; }