Skip to main content

ThirdwebSDK.fromWallet() method

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Get an instance of the thirdweb SDK based on an AbstractWallet

Example

import { ThirdwebSDK } from "@thirdweb-dev/sdk";

const wallet = new AbstractWalletImplementation();
const sdk = await ThirdwebSDK.fromWallet(wallet, "mainnet");

Signature:

static fromWallet(wallet: EVMWallet, network: ChainOrRpc, options?: SDKOptions, storage?: ThirdwebStorage): Promise<ThirdwebSDK>;

Parameters

ParameterTypeDescription
walletEVMWalletthe implementation of the AbstractWallet class to use for signing
networkChainOrRpcthe network (chain) to connect to (e.g. "mainnet", "rinkeby", "polygon", "mumbai"...) or a fully formed RPC url
optionsSDKOptions(Optional) the SDK options to use
storageThirdwebStorage(Optional) optional storage implementation to use

Returns:

Promise<ThirdwebSDK>

an instance of the SDK