Skip to main content
On this page we’ll run through some introductory code on getting set up with using Etherspot Prime on Flare.

Installing packages

Prerequisite You should have installed Node.js (version 18.10.0 or higher).
Install Etherspot Prime SDK with this command

A look into the code

Importing the SDK

Getting the smart account address

If you’re unsure about the difference between key based accounts and smart contract accounts, please take a look at this page In this example we simply create a key based wallet with ethers.js like so:
Then we use this key based wallet to instantiate the SDK on Coston2 and get the wallet address.

Sending funds to another address

Now that we have a smart contract account on Coston2, we can fund it using Flare’s offical faucet. Once we have funds on our account (you can check this here) we can try a simple send operation. This can be done through creating a sendFunds function like so: We’ll want to save destinationAddress and amount in some input field within the dapp.

Next steps

For next steps you can look at functions or examples to tailor the dapp to what you’re trying to achieve.