This SDK provides convenient access to Circle's User Controlled Wallets APIs for applications written in NodeJS. For the API reference, see the Circle Web3 API docs.
Install the package with:
npm install @circle-fin/user-controlled-wallets --save
or
yarn add @circle-fin/user-controlled-wallets
-
Generate an API key, if you haven't already, in the Web3 Services Console. This API key will be used for authentication and authorization when making requests to Circle's APIs.
-
Follow our User-Controlled QuickStart. This step ensures that you fully grasp the concept of Circle's User-Controlled Wallets.
-
In your code, import the factory
initiateUserControlledWalletsClient
from the SDK and initialize the client using your API key and entity secret:const { initiateUserControlledWalletsClient } = require('@circle-fin/user-controlled-wallets') const client = initiateUserControlledWalletsClient({ apiKey: '<your-api-key>' })
or
import { initiateUserControlledWalletsClient } from '@circle-fin/user-controlled-wallets' const client = initiateUserControlledWalletsClient({ apiKey: '<your-api-key>' })
-
Interact with the client:
const response = await client.createTransaction({ userToken: 'dummy-user-token', amount: ['0.01'], destinationAddress: '0xa51c9c604b79a0fadbfed35dd576ca1bce71da0a', tokenId: '738c8a6d-8896-46d1-b2cb-083600c1c69b', walletId: 'a635d679-4207-4e37-b12e-766afb9b3892', fee: { type: 'level', config: { feeLevel: 'HIGH', }, }, }) console.log(response.data?.challengeId)
We recommend reading through the official documentation and QuickStart guides mentioned above to ensure a smooth setup and usage experience.
The client accepts the following configuration parameters:
Option | Required | Description |
---|---|---|
apiKey |
[x] | Api Key that is used to authenticate against Circle APIs. |
baseUrl |
[ ] | Optional base URL to override the default: https://api.circle.com . |
storage |
[ ] | Optional custom storage solution for persisting data. We will fallback to InMemoryStorage if none was provided. |
userAgent |
[ ] | Optional custom user agent request header. We will prepend it to default user agent header if provided. |
Here are some helpful links, if you encounter any issues or have questions about this SDK:
- 📖 Getting started: Check out our official User-Controlled Wallets QuickStart.
- 🎮 Join our Discord Community: Engage, learn, and collaborate.
- 🛎 Visit our Help-Desk Page: Dive into curated FAQs and guides.
- 📧 Direct Email: We're always a message away.
- 📖 Read docs: Check out our developer documentation.
Happy coding!