Prime SDK
Instantiation
Before doing anything with the SDK, we must instantiate it. This will create the Etherspot smart account based off of the values we pass in.
Step 1. Import the Etherspot Prime SDK.
Step 2. Instantiate the SDK with a private key and Chain ID using this block of code.
And that’s it! You’re now ready to call any of the Prime SDK functions.
You can also pass in different parameters when instantiating the SDK.
- chainId : The chain ID of the blockchain.
- entryPointAddress : The 4337 entry point address you wish to use.
- bundlerRpcUrl : The bundler you wish to use.
- walletFactoryAddress : The wallet factory implementation you wish to use.
An example of how to configure this is shown below:
You can check primeSdk.state() to check if the Etherspot network is up and running correctly.
In the next page we’ll take a look at the various functions the SDK offers.