Before doing anything with the SDK, we must instantiate it.
This will set the sessionKey, chainId and all properties needed to authenticate and authorise the remote-signing
- privateKey
- ChainID
- etherspotWalletAddress
- sessionKey
- bundlerApiKey
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
export WALLET_PRIVATE_KEY=''
export CHAIN_ID=
export API_KEY=''
import { RemoteSignerSdk } from '@etherspot/remote-signer';
import { privateKeyToAccount } from 'viem/accounts';
import { Account, Hex } from "viem";
import * as dotenv from 'dotenv';
import { createLocalAccount, EtherspotBundler, ExtendedLocalAccount, getViemAccount, RemoteSignerSdk, toRemoteSigner } from '@etherspot/remote-signer';
const externalViemAccount = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as string as Hex);
const bundlerProvider = new EtherspotBundler(chainId, bundlerApiKey);
const bundlerApiKey = process.env.API_KEY as string;
const sessionKey = ''; // sessionKey generated by modularSDK
const apiKey = process.env.API_KEY as string;
const etherspotWalletAddress = ''; // your etherspotModularWallet address
const chainId = Number(process.env.CHAIN_ID);
const remoteSignerSdk = await RemoteSignerSdk.create(externalViemAccount, {
etherspotWalletAddress: etherspotWalletAddress,
chainId: chainId,
apiKey: apiKey,
sessionKey: sessionKey,
bundlerProvider: bundlerProvider
});
