Prime SDK examples
Get SimpleAccount Address
Prime SDK
Prime SDK examples
- Run Prime SDK examples
- Get Address
- Transfer Funds
- Transfer ERC20
- Transfer NFT
- Social Logins
- Get Account Balances
- Get Transaction
- Get Token List
- Get NFT List
- Show gas fee in fiat
- Get Exchange Rates
- Get Exchange Supported assets
- Use Paymaster
- Paymaster valid until after specified time
- Swap
- Get bridging quotes (LiFi)
- Get bridging quotes (other)
- Get Zerodev Address
- Get SimpleAccount Address
- User Specific callGasLimit
- Concurrent UserOps
- Add Guardians
Integrations
Chain Specific Tutorials
Prime SDK examples
Get SimpleAccount Address
import { EtherspotBundler, Factory, PrimeSdk } from '../src';
import * as dotenv from 'dotenv';
dotenv.config();
async function main() {
const bundlerApiKey = 'eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjMxMDZiOGY2NTRhZTRhZTM4MGVjYjJiN2Q2NDMzMjM4IiwiaCI6Im11cm11cjEyOCJ9';
// initializating sdk...
const primeSdk = new PrimeSdk({ privateKey: process.env.WALLET_PRIVATE_KEY }, { chainId: Number(process.env.CHAIN_ID), factoryWallet: Factory.SIMPLE_ACCOUNT,
bundlerProvider: new EtherspotBundler(Number(process.env.CHAIN_ID), bundlerApiKey)
})
// get SimpleAccount address...
const address: string = await primeSdk.getCounterFactualAddress();
console.log('\x1b[33m%s\x1b[0m', `SimpleAccount address: ${address}`);
}
main()
.catch(console.error)
.finally(() => process.exit());