UNPKG

@okcontract/sdk

Version:

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

36 lines (35 loc) 2.03 kB
import type { Connector, WindowProvider } from "@wagmi/connectors"; import { type AbiFunction } from "viem"; import { type AnyCell, type MapCell, type SheetProxy } from "@okcontract/cells"; import { type Environment } from "@okcontract/lambdascript"; import { type Chain, type ChainType, type EVMType, type StringAddress } from "@okcontract/multichain"; import type { SignedMessage } from "@scv/auth"; import { type CompiledContract } from "./deploy"; import type { ConnectorOptions, OKConnector, Transaction, WalletConnector } from "./wallet"; export declare class ViemConnector implements OKConnector<EVMType> { readonly ID: WalletConnector; 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 _conn; private readonly _prov; private readonly _wc; private readonly _local; private readonly _options; constructor(proxy: SheetProxy, chains: AnyCell<Record<string, Chain>>, id: WalletConnector, conn: Connector<WindowProvider, unknown>, options?: ConnectorOptions); private _disconnectFn; connect: () => Promise<Required<import("@wagmi/connectors").ConnectorData>>; disconnect: () => Promise<void>; private _wantedChain; switchChain: (id: ChainType) => Promise<string>; signMessage: (message: string) => Promise<`0x${string}`>; signedMessage: (Msg: string) => Promise<SignedMessage>; sendTransaction: (tx: Transaction<EVMType>) => Promise<`0x${string}`>; private _convertChain; addChain: (id: ChainType) => Promise<string>; deployContract: (comp: CompiledContract, fn: AbiFunction, env: Environment) => Promise<`0x${string}`>; signTransaction: (tx: Transaction<EVMType>) => Promise<`0x02${string}` | `0x01${string}` | `0x03${string}` | `0x04${string}` | import("viem").TransactionSerializedLegacy>; }