Docs

viemAdapter

let viemAdapter: { contract: { fromViem: (options: FromViemContractOptions<TAbi>) => ThirdwebContract<TAbi>; toViem: (options: { thirdwebContract: Readonly<ContractOptions<TAbi>> }) => Promise<GetContractReturnType<TAbi>> }; publicClient: { toViem: (options: ToViemPublicClientOptions) => PublicClient }; walletClient: { fromViem: (options: { walletClient: { account: undefined | (Account); addChain: (args: AddChainParameters) => Promise<void>; batch?: { multicall?: boolean | ({ batchSize?: number; wait?: number }) }; cacheTime: number; ccipRead?: false | ({ request?: (parameters: CcipRequestParameters) => Promise<`0x${...}`> }); chain: undefined | (Chain); deployContract: (args: DeployContractParameters<abi, undefined | (Chain), undefined | (Account), chainOverride>) => Promise<`0x${string}`>; extend: (fn: (client: Client<Transport, undefined | (Chain), undefined | (Account), WalletRpcSchema, WalletActions<undefined | (Chain), undefined | (Account)>>) => client) => Client<Transport, undefined | (Chain), undefined | (Account), WalletRpcSchema, ({[K in string | number | symbol] : client[K]}) & (WalletActions<undefined | (Chain), undefined | (Account)>)>; getAddresses: () => Promise<GetAddressesReturnType>; getChainId: () => Promise<number>; getPermissions: () => Promise<GetPermissionsReturnType>; key: string; name: string; pollingInterval: number; prepareTransactionRequest: (args: PrepareTransactionRequestParameters<undefined | (Chain), undefined | (Account), TChainOverride, TAccountOverride, TRequest>) => Promise<{[K in string | number | symbol] : (UnionRequiredBy<..., ...>) & (... extends ... ? ... : ...)[K]}>; request: EIP1193RequestFn<WalletRpcSchema>; requestAddresses: () => Promise<RequestAddressesReturnType>; requestPermissions: (args: { eth_accounts: Record<string, any> }) => Promise<RequestPermissionsReturnType>; sendRawTransaction: (args: SendRawTransactionParameters) => Promise<`0x${string}`>; sendTransaction: (args: SendTransactionParameters<undefined | (Chain), undefined | (Account), TChainOverride, TRequest>) => Promise<`0x${string}`>; signMessage: (args: SignMessageParameters<undefined | (Account)>) => Promise<`0x${string}`>; signTransaction: (args: SignTransactionParameters<undefined | (Chain), undefined | (Account), TChainOverride>) => Promise<(`0x02${string}`) | (`0x01${string}`) | (`0x03${string}`) | (TransactionSerializedLegacy)>; signTypedData: (args: SignTypedDataParameters<TTypedData, TPrimaryType, undefined | (Account)>) => Promise<`0x${string}`>; switchChain: (args: SwitchChainParameters) => Promise<void>; transport: (TransportConfig<string, EIP1193RequestFn>) & (Record<string, any>); type: string; uid: string; watchAsset: (args: WatchAssetParams) => Promise<boolean>; writeContract: (args: WriteContractParameters<abi, functionName, args, undefined | (Chain), undefined | (Account), TChainOverride>) => Promise<`0x${string}`> } }) => Account; toViem: (options: ToViemWalletClientOptions) => { account: { address: string; type: "json-rpc" }; addChain: (args: AddChainParameters) => Promise<void>; batch?: { multicall?: boolean | ({ batchSize?: number; wait?: number }) }; cacheTime: number; ccipRead?: false | ({ request?: (parameters: CcipRequestParameters) => Promise<`0x${string}`> }); chain: Chain; deployContract: (args: DeployContractParameters<abi, Chain, { address: string; type: "json-rpc" }, chainOverride>) => Promise<`0x${string}`>; extend: (fn: (client: Client<CustomTransport, Chain, { address: string; type: "json-rpc" }, WalletRpcSchema, WalletActions<Chain, { address: string; type: "json-rpc" }>>) => client) => Client<CustomTransport, Chain, { address: string; type: "json-rpc" }, WalletRpcSchema, ({[K in string | number | symbol] : client[K]}) & (WalletActions<Chain, { address: string; type: "json-rpc" }>)>; getAddresses: () => Promise<GetAddressesReturnType>; getChainId: () => Promise<number>; getPermissions: () => Promise<GetPermissionsReturnType>; key: string; name: string; pollingInterval: number; prepareTransactionRequest: (args: PrepareTransactionRequestParameters<Chain, { address: string; type: "json-rpc" }, TChainOverride, TAccountOverride, TRequest>) => Promise<{[K in string | number | symbol] : (UnionRequiredBy<(...) & (...), ParameterTypeToParameters<...>>) & (unknown extends ...[...] ? { } : Pick<..., ...>)[K]}>; request: EIP1193RequestFn<WalletRpcSchema>; requestAddresses: () => Promise<RequestAddressesReturnType>; requestPermissions: (args: { eth_accounts: Record<string, any> }) => Promise<RequestPermissionsReturnType>; sendRawTransaction: (args: SendRawTransactionParameters) => Promise<`0x${string}`>; sendTransaction: (args: SendTransactionParameters<Chain, { address: string; type: "json-rpc" }, TChainOverride, TRequest>) => Promise<`0x${string}`>; signMessage: (args: SignMessageParameters<{ address: string; type: "json-rpc" }>) => Promise<`0x${string}`>; signTransaction: (args: SignTransactionParameters<Chain, { address: string; type: "json-rpc" }, TChainOverride>) => Promise<(`0x02${string}`) | (`0x01${string}`) | (`0x03${string}`) | (TransactionSerializedLegacy)>; signTypedData: (args: SignTypedDataParameters<TTypedData, TPrimaryType, { address: string; type: "json-rpc" }>) => Promise<`0x${string}`>; switchChain: (args: SwitchChainParameters) => Promise<void>; transport: TransportConfig<"custom", EIP1193RequestFn>; type: string; uid: string; watchAsset: (args: WatchAssetParams) => Promise<boolean>; writeContract: (args: WriteContractParameters<abi, functionName, args, Chain, { address: string; type: "json-rpc" }, TChainOverride>) => Promise<`0x${string}`> } } }