EthersV5
createAccountEthers5(params) → Account
Creates an account representation from an Ethers v5 signer or wallet. (You only need to provide either a signer or a wallet.)
Parameters
Parameter
Type
Required
Description
Returns: Account
Example
import { createAccountEthers5, createClient, createPublicProviderEthers5, EditionProduct } from '@manifoldxyz/client-sdk';
import { ethers } from 'ethers';
// Create provider for the network
const provider = new ethers.providers.JsonRpcProvider('YOUR_RPC_URL');
// Create public provider for the client
const publicProvider = createPublicProviderEthers5({
1: provider // mainnet
});
// Initialize the client
const client = createClient({ publicProvider });
const product = await client.getProduct('4150231280') as EditionProduct;
// Create wallet for signing
const wallet = new ethers.Wallet('wallet-private-key', provider);
const prepared = await product.preparePurchase({
address: wallet.address,
payload: {
quantity: 1
},
});
// Create account from wallet
const account = createAccountEthers5({
wallet
})
const order = await product.purchase({
account,
preparedPurchase: prepared,
});Code
Message
INVALID_INPUT
Provide either signer or wallet, not both | Signer or wallet is required
Last updated