SDK
The Checkout SDKs provide specialised utilities designed to accommodate advanced users requiring customisation capabilities that exceed the default widget-based Checkout experience.
Guides
Guide | Description |
---|---|
Connect wallets | In this brief step-by-step guide we will use the Checkout SDK to create a Web3 provider for any of the supported wallets and ensure it is connected to the zkEVM network. |
Switch networks | In this brief step-by-step guide we will use the Checkout SDK to ask a user to add the zkEVM network to the wallet and switch to this new network. |
Wallet balances | In this brief step-by-step guide we will use the Checkout SDK to fetch the tokens (ERC20) balances in a wallet. This list will contain tokens such as IMX, USDC, etc. |
Gas amount estimation | In this brief guide we will use the Checkout SDK to fetch the estimated gas amount required for performing key Checkout operations on zkEVM and L1 (e.g. Ethereum). |
Smart checkout | Guide to purchasing an item with the Checkout SDK using the Smart Checkout flow. |
Error Handling
Operations performed via the Checkout SDK may be rejected with the error type ErrorType
. Errors are thrown with well-defined types (ref: CheckoutErrorType
) so that the root cause can be easily identified. The error payload will also contain additional metadata, such as a message and raw data available via the data response property (e.g. original error).
export class CheckoutError extends Error {
public message: string;
public type: CheckoutErrorType;
public data?: { [key: string]: string };
}