Getting started with the SDK
This guide will help you get started with the Circles SDK. It shows how to use the Circles SDK with MetaMask.
Prerequisites
Metamask Plugin installed in browser
Setup Gnosis Chain (Mainnet) and/or Chiado Chain (Testnet). Check out Gnosis Chain docs here.
Install packages for CirclesSDK
If you have all prerequisites in place, start by installing the Circles SDK package and ethers v6 in your project using npm.
1. Add imports
Then, import the necessary interfaces from the Circles SDK and Ethers.
2. Add CirclesConfig
for SDK
CirclesConfig
for SDKCirclesConfig
defines the configuration settings needed to set up the SDK. You provide an object that follows this structure when initializing the SDK.
Circles is available on Gnosis Chain and Chiado Testnet. You need to specify the correct contract addresses and service endpoints for each environment.
v2PathfinderUrl?
The URL for the V2 Pathfinder service (if using V2).
pathfinderUrl?
The URL for the Pathfinder service (used in V1).
circlesRpcUrl
The URL for the Circles RPC service
profileServiceUrl?
The URL for the profile service that manages user profiles in Circles.
v1HubAddress
The contract address for the Circles V1 Hub.
v2HubAddress?
The contract address for the Circles V2 Hub.
nameRegistryAddress?
The address of the name registry contract.
migrationAddress?
The address used for migrating avatars and tokens from V1 to V2.
baseGroupMintPolicy?
The address of the minting policy used for group avatars in Circles.
The Gnosis Chain mainnet is the production chain for Circles.
3. Setup Provider and Signer
To setup provider and signer, we would utilize the Circles Adapter that is built to support transactions via ethers. Once you have already imported the BrowserProviderContractRunner
, you would need to initialize it.
3. Initialize the Circles SDK
To initialize the CirclesSDK, we will pass on the CirclesConfig
and Adapter
to SDK instance.
Once you have successfully created a SDK instance, you are all set to use Circles in your dApp. Let's learn more about the Circles SDK features and how you can use them on the next pages.\
Choose which Avatar would you like to build on
Last updated