@coinbase/cdp-sdk 1.1.0 → 1.1.2
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 +2 -2
- package/dist/client/cdp.d.ts +1 -1
- package/dist/client/cdp.js +3 -3
- package/dist/client/evm/evm.js +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ To start, [create a CDP API Key](https://portal.cdp.coinbase.com/access/api). Sa
|
|
|
38
38
|
One option is to export your CDP API Key and Wallet Secret as environment variables:
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
export
|
|
41
|
+
export CDP_API_KEY_ID="YOUR_API_KEY_ID"
|
|
42
42
|
export CDP_API_KEY_SECRET="YOUR_API_KEY_SECRET"
|
|
43
43
|
export CDP_WALLET_SECRET="YOUR_WALLET_SECRET"
|
|
44
44
|
```
|
|
@@ -57,7 +57,7 @@ Another option is to save your CDP API Key and Wallet Secret in a `.env` file:
|
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
59
|
touch .env
|
|
60
|
-
echo "
|
|
60
|
+
echo "CDP_API_KEY_ID=YOUR_API_KEY_ID" >> .env
|
|
61
61
|
echo "CDP_API_KEY_SECRET=YOUR_API_KEY_SECRET" >> .env
|
|
62
62
|
echo "CDP_WALLET_SECRET=YOUR_WALLET_SECRET" >> .env
|
|
63
63
|
```
|
package/dist/client/cdp.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare class CdpClient {
|
|
|
32
32
|
*
|
|
33
33
|
* These parameters can be set as environment variables:
|
|
34
34
|
* ```
|
|
35
|
-
*
|
|
35
|
+
* CDP_API_KEY_ID=your-api-key-id
|
|
36
36
|
* CDP_API_KEY_SECRET=your-api-key-secret
|
|
37
37
|
* CDP_WALLET_SECRET=your-wallet-secret
|
|
38
38
|
* ```
|
package/dist/client/cdp.js
CHANGED
|
@@ -21,7 +21,7 @@ class CdpClient {
|
|
|
21
21
|
*
|
|
22
22
|
* These parameters can be set as environment variables:
|
|
23
23
|
* ```
|
|
24
|
-
*
|
|
24
|
+
* CDP_API_KEY_ID=your-api-key-id
|
|
25
25
|
* CDP_API_KEY_SECRET=your-api-key-secret
|
|
26
26
|
* CDP_WALLET_SECRET=your-wallet-secret
|
|
27
27
|
* ```
|
|
@@ -45,7 +45,7 @@ class CdpClient {
|
|
|
45
45
|
* @param {CdpClientOptions} [options] - Configuration options for the CdpClient.
|
|
46
46
|
*/
|
|
47
47
|
constructor(options = {}) {
|
|
48
|
-
const apiKeyId = options.apiKeyId ?? process.env.CDP_API_KEY_NAME;
|
|
48
|
+
const apiKeyId = options.apiKeyId ?? process.env.CDP_API_KEY_ID ?? process.env.CDP_API_KEY_NAME;
|
|
49
49
|
const apiKeySecret = options.apiKeySecret ?? process.env.CDP_API_KEY_SECRET;
|
|
50
50
|
const walletSecret = options.walletSecret ?? process.env.CDP_WALLET_SECRET;
|
|
51
51
|
if (!apiKeyId || !apiKeySecret) {
|
|
@@ -54,7 +54,7 @@ class CdpClient {
|
|
|
54
54
|
|
|
55
55
|
You can set them as environment variables:
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
CDP_API_KEY_ID=your-api-key-id
|
|
58
58
|
CDP_API_KEY_SECRET=your-api-key-secret
|
|
59
59
|
|
|
60
60
|
You can also pass them as options to the constructor:
|
package/dist/client/evm/evm.js
CHANGED
|
@@ -191,14 +191,15 @@ class EvmClient {
|
|
|
191
191
|
async getUserOperation(options) {
|
|
192
192
|
const userOp = await openapi_client_1.CdpOpenApiClient.getUserOperation(options.smartAccount.address, options.userOpHash);
|
|
193
193
|
return {
|
|
194
|
-
network: userOp.network,
|
|
195
|
-
userOpHash: userOp.userOpHash,
|
|
196
|
-
status: userOp.status,
|
|
197
194
|
calls: userOp.calls.map(call => ({
|
|
198
195
|
to: call.to,
|
|
199
196
|
value: BigInt(call.value),
|
|
200
197
|
data: call.data,
|
|
201
198
|
})),
|
|
199
|
+
network: userOp.network,
|
|
200
|
+
status: userOp.status,
|
|
201
|
+
transactionHash: userOp.transactionHash,
|
|
202
|
+
userOpHash: userOp.userOpHash,
|
|
202
203
|
};
|
|
203
204
|
}
|
|
204
205
|
/**
|