3.1.0 • Published 6 days ago

@circle-fin/user-controlled-wallets v3.1.0

Weekly downloads
-
License
-
Repository
-
Last release
6 days ago

Circle's User Controlled Wallets NodeJS SDK

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.

Installation

Install the package with:

npm install @circle-fin/user-controlled-wallets --save

or

yarn add @circle-fin/user-controlled-wallets

Usage

  1. 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.

  2. Follow our User-Controlled QuickStart. This step ensures that you fully grasp the concept of Circle's User-Controlled Wallets.

  3. 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>'
    })
  4. 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.

Configuration

The client accepts the following configuration parameters:

OptionRequiredDescription
apiKeyxApi 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.

Need help or have questions?

Here are some helpful links, if you encounter any issues or have questions about this SDK:

Happy coding!

3.1.0

6 days ago

3.0.0

1 month ago

2.1.0

2 months ago

2.0.0

2 months ago

1.3.0

3 months ago

1.2.1

3 months ago

1.2.0

4 months ago

1.1.0

5 months ago

1.0.2

6 months ago

1.0.1

6 months ago