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
Parameter | Type | Description |
---|---|---|
wallet | EVMWallet | the implementation of the AbstractWallet class to use for signing |
network | ChainOrRpc | the network (chain) to connect to (e.g. "mainnet", "rinkeby", "polygon", "mumbai"...) or a fully formed RPC url |
options | SDKOptions | (Optional) the SDK options to use |
storage | ThirdwebStorage | (Optional) optional storage implementation to use |
Returns:
Promise<ThirdwebSDK>
an instance of the SDK