@circle-fin/usdckit 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -26
- package/dist/cjs/metadata.js +1 -1
- package/dist/cjs/providers/developer-controlled-wallets/actions/createWalletSet.d.ts +1 -1
- package/dist/cjs/providers/developer-controlled-wallets/actions/createWalletSet.js +1 -1
- package/dist/esm/metadata.js +1 -1
- package/dist/esm/providers/developer-controlled-wallets/actions/createWalletSet.d.ts +1 -1
- package/dist/esm/providers/developer-controlled-wallets/actions/createWalletSet.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,60 +5,66 @@ USDCKit is a Node.js SDK that streamlines interactions with USDC. With USDCKit,
|
|
|
5
5
|
|
|
6
6
|
The SDK is compatible with popular open-source clients like viem, web3.js, and ethers.js, and can also function as a standalone client. The SDK is built with TypeScript and supports high-level use cases involving USDC, making it an important tool for developers working with digital currencies.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
This guide will help you get started quickly and efficiently, whether you're building a wallet, a payment gateway, or anything in between. It covers the following items:
|
|
9
|
+
- [Benefits of using USDCKit](#benefits-of-using-usdckit)
|
|
10
|
+
- [Quickstart to write your first line of code using USDCKit](#quickstart)
|
|
11
|
+
- [Sample Code to run USDC Acquiring Flow](./documents/Solutions.USDC_Acquiring_Flow.html)
|
|
12
|
+
|
|
13
|
+
### Benefits of Using USDCKit
|
|
14
|
+
- **Faster time-to-market**. USDCKit simplifies accepting and managing USDC payments with minimal code. It provides reusable payment modules and removes technical complexities for faster integration.
|
|
15
|
+
- **Payment Focused**. USDCKit is built to offer all the features and tools required to create a complete end-to-end USDC payment flow, with functionalities tailored for payment use cases. It also includes sample code for specific payment products, making it easier to develop your own. The focus of the current release is USDC Acquiring use case.
|
|
16
|
+
- **Scalable payments without bottlenecks**. Process millions of transactions efficiently with USDCKit’s high-performance infrastructure.
|
|
17
|
+
- **Enterprise-grade compliance management**. Adhere to global regulatory standards with real-time transaction screening through Compliance Engine.
|
|
18
|
+
|
|
19
|
+
#### Key features
|
|
10
20
|
USDCKit supports the following features:
|
|
11
21
|
* Wallet management: Create and manage wallets across multiple chains.
|
|
12
22
|
* Balance querying and filtering: Query wallet balances and filter wallets by balance threshold.
|
|
13
23
|
* Fund transfer: Transfer funds between wallets.
|
|
14
24
|
* Fund sweeping: Automate fund aggregation and optimize gas efficiency.
|
|
15
25
|
|
|
16
|
-
##
|
|
17
|
-
|
|
18
|
-
USDCKit is built on top of Circle
|
|
19
|
-
|
|
20
|
-
1. **Sign Up**: Go to the [Circle Programmable Wallets](https://www.circle.com/en/programmable-wallets) website and sign up for an account. This account will be used to manage your access to Circle Web3 services.
|
|
26
|
+
## Quickstart Steps
|
|
27
|
+
### Setup
|
|
28
|
+
USDCKit is built on top of Circle Wallets’ developer-controlled wallets. You will need to set up a Developer Console account before using the service. Please follow these steps:
|
|
29
|
+
1. **Sign Up**: Go to the Developer Console and sign up for an account. This account will be used to manage your access to Circle’s Developer Services. Follow the [instructions](https://developers.circle.com/interactive-quickstarts/get-started#create-a-web3-services-account) for more details.
|
|
21
30
|
2. **Generate API Keys**: Navigate to the API section of your project and generate a new API key. Make sure to store the API key securely as it will be used to authenticate your requests. Follow the [instructions](https://developers.circle.com/interactive-quickstarts/get-started#create-your-api-key) for more details.
|
|
22
31
|
3. **Generate Entity Secret**: The Entity Secret is a robust 32-byte key engineered to enhance the security mechanisms of wallets. Follow the [instructions](https://developers.circle.com/interactive-quickstarts/dev-controlled-wallets#setup-your-entity-secret) to setup your Entity Secret.
|
|
23
32
|
4. **You are good to go!**
|
|
24
33
|
|
|
25
|
-
|
|
26
34
|
### Installation
|
|
27
|
-
|
|
28
35
|
To install USDCKit from NPM, run the following command in your project directory:
|
|
29
|
-
|
|
30
36
|
```bash
|
|
31
37
|
npm install @circle-fin/usdckit
|
|
32
38
|
```
|
|
33
|
-
|
|
34
|
-
## Usage
|
|
35
|
-
|
|
36
39
|
### Initialization
|
|
37
|
-
|
|
38
40
|
To get started with USDKit, initialize a client with the API Key and Entity Secret from [Setup](#setup)
|
|
41
|
+
|
|
39
42
|
```typescript
|
|
40
43
|
import { createCircleClient } from '@circle-fin/usdckit'
|
|
41
44
|
import { ETH_SEPOLIA } from '@circle-fin/usdckit/chains'
|
|
42
45
|
|
|
43
46
|
const client = createCircleClient({
|
|
44
|
-
apiKey: '
|
|
45
|
-
entitySecret: '
|
|
46
|
-
|
|
47
|
+
apiKey: 'REPLACE_WITH_CIRCLE_API_KEY',
|
|
48
|
+
entitySecret: 'REPLACE_WITH_CIRCLE_ENTITY_SECRET',
|
|
49
|
+
|
|
50
|
+
// Optional. Defaults to `ETH_SEPOLIA`
|
|
51
|
+
chain: ETH_SEPOLIA,
|
|
47
52
|
})
|
|
48
53
|
```
|
|
49
54
|
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
50
57
|
### Create Account
|
|
51
58
|
To create a new account, use the `createAccount` method. This will generate a new account that you can use for various operations such as transferring tokens and retrieving balances.
|
|
52
59
|
|
|
53
60
|
```typescript
|
|
54
|
-
|
|
61
|
+
// Creates an account on the default chain ETH_SEPOLIA
|
|
62
|
+
const account = await client.createAccount()
|
|
55
63
|
```
|
|
56
64
|
|
|
57
|
-
|
|
58
65
|
### Query for accounts
|
|
59
66
|
To query for existing accounts, use the getAccounts method. This will return the account details associated with the provided account query.
|
|
60
67
|
|
|
61
|
-
|
|
62
68
|
```typescript
|
|
63
69
|
// Query by Address
|
|
64
70
|
const account = await client.getAccounts({ address: '0xmy-address' })
|
|
@@ -70,15 +76,18 @@ const account = await client.getAccounts({ refId: 'user-1' })
|
|
|
70
76
|
const account = await client.getAccounts({ amountGte: 1000 })
|
|
71
77
|
```
|
|
72
78
|
|
|
73
|
-
|
|
74
79
|
### Fund Account with Testnet Tokens
|
|
75
|
-
|
|
76
80
|
To fund an account with testnet tokens, you can use the `drip` method. This method provides native tokens, USDC, and EURC for testing purposes.
|
|
77
81
|
|
|
78
82
|
```typescript
|
|
79
|
-
|
|
80
|
-
await client.drip({ account
|
|
81
|
-
|
|
83
|
+
// Receive native tokens, USDC, and EURC
|
|
84
|
+
await client.drip({ account })
|
|
85
|
+
|
|
86
|
+
// Receive native
|
|
87
|
+
await client.drip({ account, token: null })
|
|
88
|
+
|
|
89
|
+
// Receive USDC
|
|
90
|
+
await client.drip({ account, token: client.chain.contracts.USDC })
|
|
82
91
|
```
|
|
83
92
|
|
|
84
93
|
### Transfer tokens
|
|
@@ -102,6 +111,7 @@ const transaction_usdc = await client.transfer({
|
|
|
102
111
|
```
|
|
103
112
|
|
|
104
113
|
#### Batch Transfers
|
|
114
|
+
Transfer from multiple source accounts to a single destination account
|
|
105
115
|
|
|
106
116
|
```typescript
|
|
107
117
|
// Create Transfer - Batch transfer
|
|
@@ -129,4 +139,20 @@ Retrieves the token balances for a specified account.
|
|
|
129
139
|
|
|
130
140
|
```typescript
|
|
131
141
|
const balance = await client.getTokenBalances({ account: account_2 })
|
|
132
|
-
```
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Sample Code to run USDC Acquiring Flow
|
|
145
|
+
For more details on how to run an end-to-end USDC Acquiring Flow to support your business, refer to the [USDC Acquiring Flow sample code](./documents/Solutions.USDC_Acquiring_Flow.html)
|
|
146
|
+
|
|
147
|
+
## Future Plans
|
|
148
|
+
The current private release marks the first version of USDCKit, and we recognize that additional tools are needed to create a smooth USDC payment experience. As such, we are actively working on several modules and would greatly appreciate your feedback. Our roadmap includes, but is not limited to, the following:
|
|
149
|
+
- Cross-Chain Send of USDC
|
|
150
|
+
- Swap of USDC
|
|
151
|
+
- Mass Payout of USDC
|
|
152
|
+
- Gas Efficiency Enhancement
|
|
153
|
+
|
|
154
|
+
## Feedback & Support
|
|
155
|
+
If you have any questions or need assistance, don't hesitate to reach out to the team directly([usdckit@circle.com](mailto:usdckit@circle.com)). We're here to support you every step of the way.
|
|
156
|
+
|
|
157
|
+
Happy coding!
|
|
158
|
+
|
package/dist/cjs/metadata.js
CHANGED
package/dist/esm/metadata.js
CHANGED