SmartContract.(constructor)
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.
Constructs a new instance of the SmartContract
class
Signature:
constructor(network: NetworkInput, address: string, abi: ContractInterface, storage: ThirdwebStorage, options: {
supportedChains?: {
rpc: string[];
chainId: number;
nativeCurrency: {
decimals?: number | undefined;
symbol: string;
name: string;
};
}[] | undefined;
thirdwebApiKey?: string | undefined;
alchemyApiKey?: string | undefined;
infuraApiKey?: string | undefined;
readonlySettings?: {
chainId?: number | undefined;
rpcUrl: string;
} | undefined;
gasSettings?: {
maxPriceInGwei?: number | undefined;
speed?: "standard" | "fast" | "fastest" | undefined;
} | undefined;
gasless?: {
experimentalChainlessSupport?: boolean | undefined;
openzeppelin: {
relayerForwarderAddress?: string | undefined;
useEOAForwarder?: boolean | undefined;
relayerUrl: string;
};
} | {
biconomy: {
deadlineSeconds?: number | undefined;
apiId: string;
apiKey: string;
};
} | undefined;
} | undefined, chainId: number, contractWrapper?: ContractWrapper<TContract>);
Parameters
Parameter | Type | Description |
---|---|---|
network | NetworkInput | |
address | string | |
abi | ContractInterface | |
storage | ThirdwebStorage | |
options | { supportedChains?: { rpc: string[]; chainId: number; nativeCurrency: { decimals?: number | undefined; symbol: string; name: string; }; }[] | undefined; thirdwebApiKey?: string | undefined; alchemyApiKey?: string | undefined; infuraApiKey?: string | undefined; readonlySettings?: { chainId?: number | undefined; rpcUrl: string; } | undefined; gasSettings?: { maxPriceInGwei?: number | undefined; speed?: "standard" | "fast" | "fastest" | undefined; } | undefined; gasless?: { experimentalChainlessSupport?: boolean | undefined; openzeppelin: { relayerForwarderAddress?: string | undefined; useEOAForwarder?: boolean | undefined; relayerUrl: string; }; } | { biconomy: { deadlineSeconds?: number | undefined; apiId: string; apiKey: string; }; } | undefined; } | undefined | |
chainId | number | |
contractWrapper | ContractWrapper<TContract> | (Optional) |