@coinbase/cdp-sdk 1.7.0 → 1.9.0
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/CHANGELOG.md +20 -0
- package/README.md +326 -28
- package/_cjs/accounts/evm/toEvmServerAccount.js +4 -2
- package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_cjs/accounts/solana/toSolanaAccount.js +8 -0
- package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -1
- package/_cjs/actions/evm/transfer/accountTransferStrategy.js +30 -63
- package/_cjs/actions/evm/transfer/accountTransferStrategy.js.map +1 -1
- package/_cjs/actions/evm/transfer/smartAccountTransferStrategy.js +39 -56
- package/_cjs/actions/evm/transfer/smartAccountTransferStrategy.js.map +1 -1
- package/_cjs/actions/evm/transfer/transfer.js +2 -39
- package/_cjs/actions/evm/transfer/transfer.js.map +1 -1
- package/_cjs/actions/evm/transfer/utils.js +0 -12
- package/_cjs/actions/evm/transfer/utils.js.map +1 -1
- package/_cjs/actions/solana/constants.js +9 -0
- package/_cjs/actions/solana/constants.js.map +1 -0
- package/_cjs/actions/solana/transfer.js +117 -0
- package/_cjs/actions/solana/transfer.js.map +1 -0
- package/_cjs/actions/solana/utils.js +66 -0
- package/_cjs/actions/solana/utils.js.map +1 -0
- package/_cjs/analytics.js +70 -8
- package/_cjs/analytics.js.map +1 -1
- package/_cjs/client/cdp.js +9 -3
- package/_cjs/client/cdp.js.map +1 -1
- package/_cjs/client/evm/evm.js +133 -15
- package/_cjs/client/evm/evm.js.map +1 -1
- package/_cjs/client/policies/index.js +6 -0
- package/_cjs/client/policies/index.js.map +1 -0
- package/_cjs/client/policies/policies.js +232 -0
- package/_cjs/client/policies/policies.js.map +1 -0
- package/_cjs/client/policies/policies.types.js +3 -0
- package/_cjs/client/policies/policies.types.js.map +1 -0
- package/_cjs/client/solana/solana.js +76 -19
- package/_cjs/client/solana/solana.js.map +1 -1
- package/_cjs/index.js +4 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +35 -4
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.js +27 -1
- package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.msw.js +56 -1
- package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +3 -1
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/index.msw.js +2 -2
- package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js +121 -36
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.js +14 -1
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js +42 -1
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -1
- package/_cjs/openapi-client/index.js +6 -1
- package/_cjs/openapi-client/index.js.map +1 -1
- package/_cjs/policies/schema.js +245 -0
- package/_cjs/policies/schema.js.map +1 -0
- package/_cjs/policies/types.js +3 -0
- package/_cjs/policies/types.js.map +1 -0
- package/_cjs/version.js +1 -1
- package/_esm/accounts/evm/toEvmServerAccount.js +4 -2
- package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_esm/accounts/solana/toSolanaAccount.js +8 -0
- package/_esm/accounts/solana/toSolanaAccount.js.map +1 -1
- package/_esm/actions/evm/transfer/accountTransferStrategy.js +31 -64
- package/_esm/actions/evm/transfer/accountTransferStrategy.js.map +1 -1
- package/_esm/actions/evm/transfer/smartAccountTransferStrategy.js +39 -56
- package/_esm/actions/evm/transfer/smartAccountTransferStrategy.js.map +1 -1
- package/_esm/actions/evm/transfer/transfer.js +2 -39
- package/_esm/actions/evm/transfer/transfer.js.map +1 -1
- package/_esm/actions/evm/transfer/utils.js +0 -11
- package/_esm/actions/evm/transfer/utils.js.map +1 -1
- package/_esm/actions/solana/constants.js +6 -0
- package/_esm/actions/solana/constants.js.map +1 -0
- package/_esm/actions/solana/transfer.js +114 -0
- package/_esm/actions/solana/transfer.js.map +1 -0
- package/_esm/actions/solana/utils.js +61 -0
- package/_esm/actions/solana/utils.js.map +1 -0
- package/_esm/analytics.js +70 -7
- package/_esm/analytics.js.map +1 -1
- package/_esm/client/cdp.js +10 -4
- package/_esm/client/cdp.js.map +1 -1
- package/_esm/client/evm/evm.js +133 -15
- package/_esm/client/evm/evm.js.map +1 -1
- package/_esm/client/policies/index.js +2 -0
- package/_esm/client/policies/index.js.map +1 -0
- package/_esm/client/policies/policies.js +228 -0
- package/_esm/client/policies/policies.js.map +1 -0
- package/_esm/client/policies/policies.types.js +2 -0
- package/_esm/client/policies/policies.types.js.map +1 -0
- package/_esm/client/solana/solana.js +76 -19
- package/_esm/client/solana/solana.js.map +1 -1
- package/_esm/index.js +1 -0
- package/_esm/index.js.map +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +34 -3
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js +24 -0
- package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/evm-accounts/evm-accounts.msw.js +51 -0
- package/_esm/openapi-client/generated/evm-accounts/evm-accounts.msw.js.map +1 -1
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +3 -1
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/index.msw.js +2 -2
- package/_esm/openapi-client/generated/index.msw.js.map +1 -1
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js +116 -35
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js +12 -0
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js +39 -0
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -1
- package/_esm/openapi-client/index.js +5 -0
- package/_esm/openapi-client/index.js.map +1 -1
- package/_esm/policies/schema.js +242 -0
- package/_esm/policies/schema.js.map +1 -0
- package/_esm/policies/types.js +2 -0
- package/_esm/policies/types.js.map +1 -0
- package/_esm/version.js +1 -1
- package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
- package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
- package/_types/accounts/evm/types.d.ts +6 -3
- package/_types/accounts/evm/types.d.ts.map +1 -1
- package/_types/accounts/solana/toSolanaAccount.d.ts.map +1 -1
- package/_types/actions/evm/transfer/accountTransferStrategy.d.ts +2 -2
- package/_types/actions/evm/transfer/accountTransferStrategy.d.ts.map +1 -1
- package/_types/actions/evm/transfer/smartAccountTransferStrategy.d.ts +2 -2
- package/_types/actions/evm/transfer/smartAccountTransferStrategy.d.ts.map +1 -1
- package/_types/actions/evm/transfer/transfer.d.ts +6 -4
- package/_types/actions/evm/transfer/transfer.d.ts.map +1 -1
- package/_types/actions/evm/transfer/types.d.ts +8 -54
- package/_types/actions/evm/transfer/types.d.ts.map +1 -1
- package/_types/actions/evm/transfer/utils.d.ts +0 -619
- package/_types/actions/evm/transfer/utils.d.ts.map +1 -1
- package/_types/actions/evm/types.d.ts +140 -68
- package/_types/actions/evm/types.d.ts.map +1 -1
- package/_types/actions/solana/constants.d.ts +6 -0
- package/_types/actions/solana/constants.d.ts.map +1 -0
- package/_types/actions/solana/transfer.d.ts +36 -0
- package/_types/actions/solana/transfer.d.ts.map +1 -0
- package/_types/actions/solana/types.d.ts +27 -0
- package/_types/actions/solana/types.d.ts.map +1 -1
- package/_types/actions/solana/utils.d.ts +34 -0
- package/_types/actions/solana/utils.d.ts.map +1 -0
- package/_types/analytics.d.ts +14 -5
- package/_types/analytics.d.ts.map +1 -1
- package/_types/client/cdp.d.ts +3 -0
- package/_types/client/cdp.d.ts.map +1 -1
- package/_types/client/evm/evm.d.ts +89 -1
- package/_types/client/evm/evm.d.ts.map +1 -1
- package/_types/client/evm/evm.types.d.ts +33 -3
- package/_types/client/evm/evm.types.d.ts.map +1 -1
- package/_types/client/policies/index.d.ts +2 -0
- package/_types/client/policies/index.d.ts.map +1 -0
- package/_types/client/policies/policies.d.ts +216 -0
- package/_types/client/policies/policies.d.ts.map +1 -0
- package/_types/client/policies/policies.types.d.ts +96 -0
- package/_types/client/policies/policies.types.d.ts.map +1 -0
- package/_types/client/solana/solana.d.ts +43 -1
- package/_types/client/solana/solana.d.ts.map +1 -1
- package/_types/client/solana/solana.types.d.ts +14 -2
- package/_types/client/solana/solana.types.d.ts.map +1 -1
- package/_types/index.d.ts +2 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +176 -17
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts +13 -1
- package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-accounts/evm-accounts.msw.d.ts +5 -1
- package/_types/openapi-client/generated/evm-accounts/evm-accounts.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts +3 -1
- package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/index.msw.d.ts +2 -2
- package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts +5 -1
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts +7 -1
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts +2 -0
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts.map +1 -1
- package/_types/openapi-client/index.d.ts +18 -0
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/policies/schema.d.ts +1552 -0
- package/_types/policies/schema.d.ts.map +1 -0
- package/_types/policies/types.d.ts +19 -0
- package/_types/policies/types.d.ts.map +1 -0
- package/_types/types/misc.d.ts +39 -0
- package/_types/types/misc.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/accounts/evm/toEvmServerAccount.ts +11 -7
- package/accounts/evm/toEvmSmartAccount.ts +1 -2
- package/accounts/evm/types.ts +6 -8
- package/accounts/solana/toSolanaAccount.ts +8 -0
- package/actions/evm/transfer/accountTransferStrategy.ts +38 -78
- package/actions/evm/transfer/smartAccountTransferStrategy.ts +43 -63
- package/actions/evm/transfer/transfer.ts +10 -51
- package/actions/evm/transfer/types.ts +9 -67
- package/actions/evm/transfer/utils.ts +0 -13
- package/actions/evm/types.ts +143 -78
- package/actions/solana/constants.ts +6 -0
- package/actions/solana/transfer.ts +219 -0
- package/actions/solana/types.ts +28 -0
- package/actions/solana/utils.ts +79 -0
- package/analytics.ts +86 -11
- package/client/cdp.ts +11 -4
- package/client/evm/evm.ts +159 -17
- package/client/evm/evm.types.ts +38 -1
- package/client/policies/index.ts +1 -0
- package/client/policies/policies.ts +246 -0
- package/client/policies/policies.types.ts +109 -0
- package/client/solana/solana.ts +94 -20
- package/client/solana/solana.types.ts +16 -1
- package/index.ts +7 -0
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +220 -18
- package/openapi-client/generated/evm-accounts/evm-accounts.msw.ts +102 -0
- package/openapi-client/generated/evm-accounts/evm-accounts.ts +43 -0
- package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +3 -1
- package/openapi-client/generated/index.msw.ts +2 -2
- package/openapi-client/generated/policy-engine/policy-engine.msw.ts +199 -56
- package/openapi-client/generated/solana-accounts/solana-accounts.msw.ts +75 -0
- package/openapi-client/generated/solana-accounts/solana-accounts.ts +23 -0
- package/openapi-client/index.ts +6 -0
- package/package.json +4 -2
- package/policies/schema.ts +349 -0
- package/policies/types.ts +19 -0
- package/types/misc.ts +41 -0
- package/version.ts +1 -1
package/_cjs/client/evm/evm.js
CHANGED
|
@@ -9,6 +9,7 @@ const requestFaucet_js_1 = require("../../actions/evm/requestFaucet.js");
|
|
|
9
9
|
const sendTransaction_js_1 = require("../../actions/evm/sendTransaction.js");
|
|
10
10
|
const sendUserOperation_js_1 = require("../../actions/evm/sendUserOperation.js");
|
|
11
11
|
const waitForUserOperation_js_1 = require("../../actions/evm/waitForUserOperation.js");
|
|
12
|
+
const analytics_js_1 = require("../../analytics.js");
|
|
12
13
|
const errors_js_1 = require("../../openapi-client/errors.js");
|
|
13
14
|
const index_js_1 = require("../../openapi-client/index.js");
|
|
14
15
|
/**
|
|
@@ -50,12 +51,14 @@ class EvmClient {
|
|
|
50
51
|
* ```
|
|
51
52
|
*/
|
|
52
53
|
async createAccount(options = {}) {
|
|
53
|
-
const
|
|
54
|
+
const openApiAccount = await index_js_1.CdpOpenApiClient.createEvmAccount({
|
|
54
55
|
name: options.name,
|
|
55
56
|
}, options.idempotencyKey);
|
|
56
|
-
|
|
57
|
-
account,
|
|
57
|
+
const account = (0, toEvmServerAccount_js_1.toEvmServerAccount)(index_js_1.CdpOpenApiClient, {
|
|
58
|
+
account: openApiAccount,
|
|
58
59
|
});
|
|
60
|
+
analytics_js_1.Analytics.wrapObjectMethodsWithErrorTracking(account);
|
|
61
|
+
return account;
|
|
59
62
|
}
|
|
60
63
|
/**
|
|
61
64
|
* Creates a new CDP EVM smart account.
|
|
@@ -103,13 +106,15 @@ class EvmClient {
|
|
|
103
106
|
* ```
|
|
104
107
|
*/
|
|
105
108
|
async createSmartAccount(options) {
|
|
106
|
-
const
|
|
109
|
+
const openApiSmartAccount = await index_js_1.CdpOpenApiClient.createEvmSmartAccount({
|
|
107
110
|
owners: [options.owner.address],
|
|
108
111
|
}, options.idempotencyKey);
|
|
109
|
-
|
|
110
|
-
smartAccount,
|
|
112
|
+
const smartAccount = (0, toEvmSmartAccount_js_1.toEvmSmartAccount)(index_js_1.CdpOpenApiClient, {
|
|
113
|
+
smartAccount: openApiSmartAccount,
|
|
111
114
|
owner: options.owner,
|
|
112
115
|
});
|
|
116
|
+
analytics_js_1.Analytics.wrapObjectMethodsWithErrorTracking(smartAccount);
|
|
117
|
+
return smartAccount;
|
|
113
118
|
}
|
|
114
119
|
/**
|
|
115
120
|
* Gets a CDP EVM account.
|
|
@@ -137,7 +142,7 @@ class EvmClient {
|
|
|
137
142
|
* ```
|
|
138
143
|
*/
|
|
139
144
|
async getAccount(options) {
|
|
140
|
-
const
|
|
145
|
+
const openApiAccount = await (() => {
|
|
141
146
|
if (options.address) {
|
|
142
147
|
return index_js_1.CdpOpenApiClient.getEvmAccount(options.address);
|
|
143
148
|
}
|
|
@@ -146,9 +151,11 @@ class EvmClient {
|
|
|
146
151
|
}
|
|
147
152
|
throw new Error("Either address or name must be provided");
|
|
148
153
|
})();
|
|
149
|
-
|
|
150
|
-
account,
|
|
154
|
+
const account = (0, toEvmServerAccount_js_1.toEvmServerAccount)(index_js_1.CdpOpenApiClient, {
|
|
155
|
+
account: openApiAccount,
|
|
151
156
|
});
|
|
157
|
+
analytics_js_1.Analytics.wrapObjectMethodsWithErrorTracking(account);
|
|
158
|
+
return account;
|
|
152
159
|
}
|
|
153
160
|
/**
|
|
154
161
|
* Gets a CDP EVM smart account.
|
|
@@ -170,11 +177,13 @@ class EvmClient {
|
|
|
170
177
|
* ```
|
|
171
178
|
*/
|
|
172
179
|
async getSmartAccount(options) {
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
smartAccount,
|
|
180
|
+
const openApiSmartAccount = await index_js_1.CdpOpenApiClient.getEvmSmartAccount(options.address);
|
|
181
|
+
const smartAccount = (0, toEvmSmartAccount_js_1.toEvmSmartAccount)(index_js_1.CdpOpenApiClient, {
|
|
182
|
+
smartAccount: openApiSmartAccount,
|
|
176
183
|
owner: options.owner,
|
|
177
184
|
});
|
|
185
|
+
analytics_js_1.Analytics.wrapObjectMethodsWithErrorTracking(smartAccount);
|
|
186
|
+
return smartAccount;
|
|
178
187
|
}
|
|
179
188
|
/**
|
|
180
189
|
* Gets a CDP EVM account, or creates one if it doesn't exist.
|
|
@@ -267,9 +276,13 @@ class EvmClient {
|
|
|
267
276
|
pageToken: options.pageToken,
|
|
268
277
|
});
|
|
269
278
|
return {
|
|
270
|
-
accounts: ethAccounts.accounts.map(account =>
|
|
271
|
-
|
|
272
|
-
|
|
279
|
+
accounts: ethAccounts.accounts.map(account => {
|
|
280
|
+
const evmAccount = (0, toEvmServerAccount_js_1.toEvmServerAccount)(index_js_1.CdpOpenApiClient, {
|
|
281
|
+
account,
|
|
282
|
+
});
|
|
283
|
+
analytics_js_1.Analytics.wrapObjectMethodsWithErrorTracking(evmAccount);
|
|
284
|
+
return evmAccount;
|
|
285
|
+
}),
|
|
273
286
|
nextPageToken: ethAccounts.nextPageToken,
|
|
274
287
|
};
|
|
275
288
|
}
|
|
@@ -561,6 +574,62 @@ class EvmClient {
|
|
|
561
574
|
signature: signature.signature,
|
|
562
575
|
};
|
|
563
576
|
}
|
|
577
|
+
/**
|
|
578
|
+
* Signs an EIP-712 message.
|
|
579
|
+
*
|
|
580
|
+
* @param {SignTypedDataOptions} options - Parameters for signing the EIP-712 message.
|
|
581
|
+
* @returns A promise that resolves to the signature.
|
|
582
|
+
*
|
|
583
|
+
* @example
|
|
584
|
+
* ```ts
|
|
585
|
+
* const signature = await cdp.evm.signTypedData({
|
|
586
|
+
* address: account.address,
|
|
587
|
+
* domain: {
|
|
588
|
+
* name: "Permit2",
|
|
589
|
+
* chainId: 1,
|
|
590
|
+
* verifyingContract: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
591
|
+
* },
|
|
592
|
+
* types: {
|
|
593
|
+
* EIP712Domain: [
|
|
594
|
+
* { name: "name", type: "string" },
|
|
595
|
+
* { name: "chainId", type: "uint256" },
|
|
596
|
+
* { name: "verifyingContract", type: "address" },
|
|
597
|
+
* ],
|
|
598
|
+
* PermitTransferFrom: [
|
|
599
|
+
* { name: "permitted", type: "TokenPermissions" },
|
|
600
|
+
* { name: "spender", type: "address" },
|
|
601
|
+
* { name: "nonce", type: "uint256" },
|
|
602
|
+
* { name: "deadline", type: "uint256" },
|
|
603
|
+
* ],
|
|
604
|
+
* TokenPermissions: [
|
|
605
|
+
* { name: "token", type: "address" },
|
|
606
|
+
* { name: "amount", type: "uint256" },
|
|
607
|
+
* ],
|
|
608
|
+
* },
|
|
609
|
+
* primaryType: "PermitTransferFrom",
|
|
610
|
+
* message: {
|
|
611
|
+
* permitted: {
|
|
612
|
+
* token: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
613
|
+
* amount: "1000000",
|
|
614
|
+
* },
|
|
615
|
+
* spender: "0xFfFfFfFFfFFfFFfFFfFFFFFffFFFffffFfFFFfFf",
|
|
616
|
+
* nonce: "0",
|
|
617
|
+
* deadline: "1717123200",
|
|
618
|
+
* },
|
|
619
|
+
* });
|
|
620
|
+
* ```
|
|
621
|
+
*/
|
|
622
|
+
async signTypedData(options) {
|
|
623
|
+
const signature = await index_js_1.CdpOpenApiClient.signEvmTypedData(options.address, {
|
|
624
|
+
domain: options.domain,
|
|
625
|
+
types: options.types,
|
|
626
|
+
primaryType: options.primaryType,
|
|
627
|
+
message: options.message,
|
|
628
|
+
}, options.idempotencyKey);
|
|
629
|
+
return {
|
|
630
|
+
signature: signature.signature,
|
|
631
|
+
};
|
|
632
|
+
}
|
|
564
633
|
/**
|
|
565
634
|
* Signs an EVM transaction.
|
|
566
635
|
*
|
|
@@ -599,6 +668,55 @@ class EvmClient {
|
|
|
599
668
|
signature: signature.signedTransaction,
|
|
600
669
|
};
|
|
601
670
|
}
|
|
671
|
+
/**
|
|
672
|
+
* Updates a CDP EVM account.
|
|
673
|
+
*
|
|
674
|
+
* @param {UpdateEvmAccountOptions} [options] - Optional parameters for creating the account.
|
|
675
|
+
* @param {string} options.address - The address of the account to update
|
|
676
|
+
* @param {UpdateEvmAccountBody} options.update - An object containing account fields to update.
|
|
677
|
+
* @param {string} [options.update.name] - The new name for the account.
|
|
678
|
+
* @param {string} [options.update.accountPolicy] - The ID of a Policy to apply to the account.
|
|
679
|
+
* @param {string} [options.idempotencyKey] - An idempotency key.
|
|
680
|
+
*
|
|
681
|
+
* @returns A promise that resolves to the updated account.
|
|
682
|
+
*
|
|
683
|
+
* @example **With a name**
|
|
684
|
+
* ```ts
|
|
685
|
+
* const account = await cdp.evm.updateAccount({ address: "0x...", update: { name: "New Name" } });
|
|
686
|
+
* ```
|
|
687
|
+
*
|
|
688
|
+
* @example **With an account policy**
|
|
689
|
+
* ```ts
|
|
690
|
+
* const account = await cdp.evm.updateAccount({ address: "0x...", update: { accountPolicy: "73bcaeeb-d7af-4615-b064-42b5fe83a31e" } });
|
|
691
|
+
* ```
|
|
692
|
+
*
|
|
693
|
+
* @example **With an idempotency key**
|
|
694
|
+
* ```ts
|
|
695
|
+
* const idempotencyKey = uuidv4();
|
|
696
|
+
*
|
|
697
|
+
* // First call
|
|
698
|
+
* await cdp.evm.updateAccount({
|
|
699
|
+
* address: "0x...",
|
|
700
|
+
* update: { accountPolicy: "73bcaeeb-d7af-4615-b064-42b5fe83a31e" },
|
|
701
|
+
* idempotencyKey,
|
|
702
|
+
* });
|
|
703
|
+
*
|
|
704
|
+
* // Second call with the same idempotency key will not update
|
|
705
|
+
* await cdp.evm.updateAccount({
|
|
706
|
+
* address: '0x...',
|
|
707
|
+
* update: { name: "" },
|
|
708
|
+
* idempotencyKey,
|
|
709
|
+
* });
|
|
710
|
+
* ```
|
|
711
|
+
*/
|
|
712
|
+
async updateAccount(options) {
|
|
713
|
+
const openApiAccount = await index_js_1.CdpOpenApiClient.updateEvmAccount(options.address, options.update, options.idempotencyKey);
|
|
714
|
+
const account = (0, toEvmServerAccount_js_1.toEvmServerAccount)(index_js_1.CdpOpenApiClient, {
|
|
715
|
+
account: openApiAccount,
|
|
716
|
+
});
|
|
717
|
+
analytics_js_1.Analytics.wrapObjectMethodsWithErrorTracking(account);
|
|
718
|
+
return account;
|
|
719
|
+
}
|
|
602
720
|
/**
|
|
603
721
|
* Waits for a user operation to complete or fail.
|
|
604
722
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evm.js","sourceRoot":"","sources":["../../../client/evm/evm.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"evm.js","sourceRoot":"","sources":["../../../client/evm/evm.ts"],"names":[],"mappings":";;;AA0BA,oFAA8E;AAC9E,kFAA4E;AAC5E,+EAAyE;AACzE,iFAIgD;AAChD,yEAI4C;AAC5C,6EAAuE;AACvE,iFAIgD;AAChD,uFAGmD;AACnD,qDAA+C;AAC/C,8DAA0D;AAC1D,4DAAiE;AAQjE;;GAEG;AACH,MAAa,SAAS;IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,KAAK,CAAC,aAAa,CAAC,UAAsC,EAAE;QAC1D,MAAM,cAAc,GAAG,MAAM,2BAAgB,CAAC,gBAAgB,CAC5D;YACE,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,EACD,OAAO,CAAC,cAAc,CACvB,CAAC;QAEF,MAAM,OAAO,GAAG,IAAA,0CAAkB,EAAC,2B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2BAAgB,EAAE;YAC5C,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AA5yBD,8BA4yBC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PoliciesClient = void 0;
|
|
4
|
+
var policies_js_1 = require("./policies.js");
|
|
5
|
+
Object.defineProperty(exports, "PoliciesClient", { enumerable: true, get: function () { return policies_js_1.PoliciesClient; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/policies/index.ts"],"names":[],"mappings":";;;AAAA,6CAA+C;AAAtC,6GAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PoliciesClient = void 0;
|
|
4
|
+
const index_js_1 = require("../../openapi-client/index.js");
|
|
5
|
+
const schema_js_1 = require("../../policies/schema.js");
|
|
6
|
+
/**
|
|
7
|
+
* The namespace containing all Policy methods.
|
|
8
|
+
*/
|
|
9
|
+
class PoliciesClient {
|
|
10
|
+
/**
|
|
11
|
+
* Lists policies belonging to the developer's CDP Project.
|
|
12
|
+
* Can be filtered by scope (project or account).
|
|
13
|
+
*
|
|
14
|
+
* @param {ListPoliciesOptions} [options] - Options for filtering and paginating the results
|
|
15
|
+
* @param {string} [options.scope] - Filter policies by scope ('project' or 'account')
|
|
16
|
+
* @param {number} [options.pageSize] - Maximum number of policies to return
|
|
17
|
+
* @param {string} [options.pageToken] - Pagination cursor for fetching next page of results
|
|
18
|
+
*
|
|
19
|
+
* @returns {Promise<ListPoliciesResult>} A paginated list of policies
|
|
20
|
+
*
|
|
21
|
+
* @example **List all policies**
|
|
22
|
+
* ```ts
|
|
23
|
+
* const { policies } = await cdp.policies.listPolicies();
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example **Filter by scope**
|
|
27
|
+
* ```ts
|
|
28
|
+
* const { policies } = await cdp.policies.listPolicies({
|
|
29
|
+
* scope: 'project'
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example **With pagination**
|
|
34
|
+
* ```ts
|
|
35
|
+
* // Get first page
|
|
36
|
+
* const firstPage = await cdp.policies.listPolicies({
|
|
37
|
+
* pageSize: 10
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* // Get next page using cursor
|
|
41
|
+
* const nextPage = await cdp.policies.listPolicies({
|
|
42
|
+
* pageSize: 10,
|
|
43
|
+
* pageToken: firstPage.pageToken
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
async listPolicies(options = {}) {
|
|
48
|
+
return index_js_1.CdpOpenApiClient.listPolicies(options);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Creates a new policy that can be used to govern the behavior of projects and accounts.
|
|
52
|
+
*
|
|
53
|
+
* @param {CreatePolicyOptions} options - Options for creating the policy
|
|
54
|
+
* @param {CreatePolicyBody} options.policy - The policy configuration to create
|
|
55
|
+
* @param {string} [options.policy.description] - Description of the policy's purpose
|
|
56
|
+
* @param {Rule[]} options.policy.rules - Rules that define the policy behavior
|
|
57
|
+
* @param {string} [options.idempotencyKey] - An idempotency key to prevent duplicate policy creation
|
|
58
|
+
*
|
|
59
|
+
* @returns {Promise<Policy>} The created policy
|
|
60
|
+
* @throws {ZodError<typeof CreatePolicyBodySchema>} When the policy is invalid
|
|
61
|
+
*
|
|
62
|
+
* @example **Creating a new policy**
|
|
63
|
+
* ```ts
|
|
64
|
+
* const policy = await cdp.policies.createPolicy({
|
|
65
|
+
* policy: {
|
|
66
|
+
* scope: "account",
|
|
67
|
+
* description: "Limits the amount of ETH in transaction",
|
|
68
|
+
* rules: [
|
|
69
|
+
* {
|
|
70
|
+
* action: "reject",
|
|
71
|
+
* operation: "signEvmTransaction",
|
|
72
|
+
* criteria: [
|
|
73
|
+
* {
|
|
74
|
+
* type: "ethValue",
|
|
75
|
+
* ethValue: "1000000000000000000",
|
|
76
|
+
* operator: ">",
|
|
77
|
+
* },
|
|
78
|
+
* ],
|
|
79
|
+
* },
|
|
80
|
+
* ],
|
|
81
|
+
* }
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @example **With idempotency key**
|
|
86
|
+
* ```ts
|
|
87
|
+
* const idempotencyKey = uuidv4();
|
|
88
|
+
*
|
|
89
|
+
* // First call creates the policy
|
|
90
|
+
* const policy = await cdp.policies.createPolicy({
|
|
91
|
+
* policy: {
|
|
92
|
+
* scope: "account",
|
|
93
|
+
* description: "Limits the amount of ETH in transaction",
|
|
94
|
+
* rules: [
|
|
95
|
+
* {
|
|
96
|
+
* action: "reject",
|
|
97
|
+
* operation: "signEvmTransaction",
|
|
98
|
+
* criteria: [
|
|
99
|
+
* {
|
|
100
|
+
* type: "ethValue",
|
|
101
|
+
* ethValue: "1000000000000000000",
|
|
102
|
+
* operator: ">",
|
|
103
|
+
* },
|
|
104
|
+
* ],
|
|
105
|
+
* },
|
|
106
|
+
* ],
|
|
107
|
+
* },
|
|
108
|
+
* idempotencyKey
|
|
109
|
+
* });
|
|
110
|
+
*
|
|
111
|
+
* // Second call with same key returns the same policy
|
|
112
|
+
* const samePolicy = await cdp.policies.createPolicy({
|
|
113
|
+
* policy: { ... },
|
|
114
|
+
* idempotencyKey
|
|
115
|
+
* });
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
async createPolicy(options) {
|
|
119
|
+
schema_js_1.CreatePolicyBodySchema.parse(options.policy);
|
|
120
|
+
return index_js_1.CdpOpenApiClient.createPolicy(options.policy, options.idempotencyKey);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Retrieves a policy by its unique identifier.
|
|
124
|
+
*
|
|
125
|
+
* @param {GetPolicyByIdOptions} options - Options containing the policy ID to retrieve
|
|
126
|
+
* @param {string} options.id - The unique identifier of the policy to retrieve
|
|
127
|
+
*
|
|
128
|
+
* @returns {Promise<Policy>} The requested policy
|
|
129
|
+
*
|
|
130
|
+
* @example **Retrieving a policy by ID**
|
|
131
|
+
* ```ts
|
|
132
|
+
* const policy = await cdp.policies.getPolicyById({
|
|
133
|
+
* id: "__ID__"
|
|
134
|
+
* });
|
|
135
|
+
*
|
|
136
|
+
* console.log(policy.name);
|
|
137
|
+
* console.log(policy.rules);
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
async getPolicyById(options) {
|
|
141
|
+
return index_js_1.CdpOpenApiClient.getPolicyById(options.id);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Deletes a policy by its unique identifier.
|
|
145
|
+
* If a policy is referenced by an active project or account, this operation will fail.
|
|
146
|
+
*
|
|
147
|
+
* @param {DeletePolicyOptions} options - Options containing the policy ID to delete
|
|
148
|
+
* @param {string} options.id - The unique identifier of the policy to delete
|
|
149
|
+
* @param {string} [options.idempotencyKey] - An idempotency key to prevent duplicate deletion
|
|
150
|
+
*
|
|
151
|
+
* @returns {Promise<void>} Void on successful deletion
|
|
152
|
+
*
|
|
153
|
+
* @example **Deleting a policy**
|
|
154
|
+
* ```ts
|
|
155
|
+
* await cdp.policies.deletePolicy({
|
|
156
|
+
* id: "__ID__"
|
|
157
|
+
* });
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
160
|
+
* @example **With idempotency key**
|
|
161
|
+
* ```ts
|
|
162
|
+
* const idempotencyKey = uuidv4();
|
|
163
|
+
*
|
|
164
|
+
* // This operation is idempotent with the key
|
|
165
|
+
* await cdp.policies.deletePolicy({
|
|
166
|
+
* id: "__ID__",
|
|
167
|
+
* idempotencyKey
|
|
168
|
+
* });
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
async deletePolicy(options) {
|
|
172
|
+
return index_js_1.CdpOpenApiClient.deletePolicy(options.id, options.idempotencyKey);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Updates an existing policy by its unique identifier.
|
|
176
|
+
* This will apply the updated policy to any project or accounts that are currently using it.
|
|
177
|
+
*
|
|
178
|
+
* @param {UpdatePolicyOptions} options - Options containing the policy ID and updated policy data
|
|
179
|
+
* @param {string} options.id - The unique identifier of the policy to update
|
|
180
|
+
* @param {UpdatePolicyBody} options.policy - The updated policy configuration
|
|
181
|
+
* @param {string} [options.policy.description] - Updated description of the policy's purpose
|
|
182
|
+
* @param {Rule[]} [options.policy.rules] - Updated rules that define the policy behavior
|
|
183
|
+
* @param {string} [options.idempotencyKey] - An idempotency key to prevent duplicate updates
|
|
184
|
+
*
|
|
185
|
+
* @returns {Promise<Policy>} The updated policy
|
|
186
|
+
* @throws {ZodError<typeof UpdatePolicyBodySchema>} When the updated policy is invalid
|
|
187
|
+
*
|
|
188
|
+
* @example **Updating a policy**
|
|
189
|
+
* ```ts
|
|
190
|
+
* const updatedPolicy = await cdp.policies.updatePolicy({
|
|
191
|
+
* id: "__ID__",
|
|
192
|
+
* policy: {
|
|
193
|
+
* description: "Now with lower transaction limits",
|
|
194
|
+
* rules: [
|
|
195
|
+
* {
|
|
196
|
+
* action: "reject",
|
|
197
|
+
* operation: "signEvmTransaction",
|
|
198
|
+
* criteria: [
|
|
199
|
+
* {
|
|
200
|
+
* type: "ethValue",
|
|
201
|
+
* ethValue: "1000000000",
|
|
202
|
+
* operator: ">",
|
|
203
|
+
* },
|
|
204
|
+
* ],
|
|
205
|
+
* },
|
|
206
|
+
* ],
|
|
207
|
+
* },
|
|
208
|
+
* });
|
|
209
|
+
* ```
|
|
210
|
+
*
|
|
211
|
+
* @example **With idempotency key**
|
|
212
|
+
* ```ts
|
|
213
|
+
* const idempotencyKey = uuidv4();
|
|
214
|
+
*
|
|
215
|
+
* // This operation is idempotent with the key
|
|
216
|
+
* await cdp.policies.updatePolicy({
|
|
217
|
+
* id: "__ID__",
|
|
218
|
+
* policy: {
|
|
219
|
+
* description: "Modified Policy",
|
|
220
|
+
* rules: { ... }
|
|
221
|
+
* },
|
|
222
|
+
* idempotencyKey
|
|
223
|
+
* });
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
async updatePolicy(options) {
|
|
227
|
+
schema_js_1.UpdatePolicyBodySchema.parse(options.policy);
|
|
228
|
+
return index_js_1.CdpOpenApiClient.updatePolicy(options.id, options.policy, options.idempotencyKey);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
exports.PoliciesClient = PoliciesClient;
|
|
232
|
+
//# sourceMappingURL=policies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policies.js","sourceRoot":"","sources":["../../../client/policies/policies.ts"],"names":[],"mappings":";;;AASA,4DAAiE;AACjE,wDAA0F;AAG1F;;GAEG;AACH,MAAa,cAAc;IACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,KAAK,CAAC,YAAY,CAAC,UAA+B,EAAE;QAClD,OAAO,2BAAgB,CAAC,YAAY,CAAC,OAAO,CAAgC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmEG;IACH,KAAK,CAAC,YAAY,CAAC,OAA4B;QAC7C,kCAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,2BAAgB,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAoB,CAAC;IAClG,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,aAAa,CAAC,OAA6B;QAC/C,OAAO,2BAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAoB,CAAC;IACvE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,KAAK,CAAC,YAAY,CAAC,OAA4B;QAC7C,OAAO,2BAAgB,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACH,KAAK,CAAC,YAAY,CAAC,OAA4B;QAC7C,kCAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,2BAAgB,CAAC,YAAY,CAClC,OAAO,CAAC,EAAE,EACV,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,cAAc,CACJ,CAAC;IACvB,CAAC;CACF;AArOD,wCAqOC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policies.types.js","sourceRoot":"","sources":["../../../client/policies/policies.types.ts"],"names":[],"mappings":""}
|
|
@@ -5,6 +5,7 @@ const toSolanaAccount_js_1 = require("../../accounts/solana/toSolanaAccount.js")
|
|
|
5
5
|
const requestFaucet_js_1 = require("../../actions/solana/requestFaucet.js");
|
|
6
6
|
const signMessage_js_1 = require("../../actions/solana/signMessage.js");
|
|
7
7
|
const signTransaction_js_1 = require("../../actions/solana/signTransaction.js");
|
|
8
|
+
const analytics_js_1 = require("../../analytics.js");
|
|
8
9
|
const errors_js_1 = require("../../openapi-client/errors.js");
|
|
9
10
|
const index_js_1 = require("../../openapi-client/index.js");
|
|
10
11
|
/**
|
|
@@ -42,10 +43,12 @@ class SolanaClient {
|
|
|
42
43
|
* ```
|
|
43
44
|
*/
|
|
44
45
|
async createAccount(options = {}) {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
account,
|
|
46
|
+
const openApiAccount = await index_js_1.CdpOpenApiClient.createSolanaAccount(options, options.idempotencyKey);
|
|
47
|
+
const account = (0, toSolanaAccount_js_1.toSolanaAccount)(index_js_1.CdpOpenApiClient, {
|
|
48
|
+
account: openApiAccount,
|
|
48
49
|
});
|
|
50
|
+
analytics_js_1.Analytics.wrapObjectMethodsWithErrorTracking(account);
|
|
51
|
+
return account;
|
|
49
52
|
}
|
|
50
53
|
/**
|
|
51
54
|
* Gets a Solana account by its address.
|
|
@@ -73,19 +76,20 @@ class SolanaClient {
|
|
|
73
76
|
* ```
|
|
74
77
|
*/
|
|
75
78
|
async getAccount(options) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
79
|
+
const openApiAccount = await (() => {
|
|
80
|
+
if (options.address) {
|
|
81
|
+
return index_js_1.CdpOpenApiClient.getSolanaAccount(options.address);
|
|
82
|
+
}
|
|
83
|
+
if (options.name) {
|
|
84
|
+
return index_js_1.CdpOpenApiClient.getSolanaAccountByName(options.name);
|
|
85
|
+
}
|
|
86
|
+
throw new Error("Either address or name must be provided");
|
|
87
|
+
})();
|
|
88
|
+
const account = (0, toSolanaAccount_js_1.toSolanaAccount)(index_js_1.CdpOpenApiClient, {
|
|
89
|
+
account: openApiAccount,
|
|
90
|
+
});
|
|
91
|
+
analytics_js_1.Analytics.wrapObjectMethodsWithErrorTracking(account);
|
|
92
|
+
return account;
|
|
89
93
|
}
|
|
90
94
|
/**
|
|
91
95
|
* Gets a Solana account by its address.
|
|
@@ -162,9 +166,13 @@ class SolanaClient {
|
|
|
162
166
|
pageToken: options.pageToken,
|
|
163
167
|
});
|
|
164
168
|
return {
|
|
165
|
-
accounts: solAccounts.accounts.map(account =>
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
accounts: solAccounts.accounts.map(account => {
|
|
170
|
+
const solanaAccount = (0, toSolanaAccount_js_1.toSolanaAccount)(index_js_1.CdpOpenApiClient, {
|
|
171
|
+
account,
|
|
172
|
+
});
|
|
173
|
+
analytics_js_1.Analytics.wrapObjectMethodsWithErrorTracking(solanaAccount);
|
|
174
|
+
return solanaAccount;
|
|
175
|
+
}),
|
|
168
176
|
nextPageToken: solAccounts.nextPageToken,
|
|
169
177
|
};
|
|
170
178
|
}
|
|
@@ -250,6 +258,55 @@ class SolanaClient {
|
|
|
250
258
|
async signTransaction(options) {
|
|
251
259
|
return (0, signTransaction_js_1.signTransaction)(index_js_1.CdpOpenApiClient, options);
|
|
252
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Updates a CDP Solana account.
|
|
263
|
+
*
|
|
264
|
+
* @param {UpdateSolanaAccountOptions} [options] - Optional parameters for creating the account.
|
|
265
|
+
* @param {string} options.address - The address of the account to update
|
|
266
|
+
* @param {UpdateSolanaAccountBody} options.update - An object containing account fields to update.
|
|
267
|
+
* @param {string} [options.update.name] - The new name for the account.
|
|
268
|
+
* @param {string} [options.update.accountPolicy] - The ID of a Policy to apply to the account.
|
|
269
|
+
* @param {string} [options.idempotencyKey] - An idempotency key.
|
|
270
|
+
*
|
|
271
|
+
* @returns A promise that resolves to the updated account.
|
|
272
|
+
*
|
|
273
|
+
* @example **With a name**
|
|
274
|
+
* ```ts
|
|
275
|
+
* const account = await cdp.sol.updateAccount({ address: "...", update: { name: "New Name" } });
|
|
276
|
+
* ```
|
|
277
|
+
*
|
|
278
|
+
* @example **With an account policy**
|
|
279
|
+
* ```ts
|
|
280
|
+
* const account = await cdp.sol.updateAccount({ address: "...", update: { accountPolicy: "73bcaeeb-d7af-4615-b064-42b5fe83a31e" } });
|
|
281
|
+
* ```
|
|
282
|
+
*
|
|
283
|
+
* @example **With an idempotency key**
|
|
284
|
+
* ```ts
|
|
285
|
+
* const idempotencyKey = uuidv4();
|
|
286
|
+
*
|
|
287
|
+
* // First call
|
|
288
|
+
* await cdp.sol.updateAccount({
|
|
289
|
+
* address: "0x...",
|
|
290
|
+
* update: { accountPolicy: "73bcaeeb-d7af-4615-b064-42b5fe83a31e" },
|
|
291
|
+
* idempotencyKey,
|
|
292
|
+
* });
|
|
293
|
+
*
|
|
294
|
+
* // Second call with the same idempotency key will not update
|
|
295
|
+
* await cdp.sol.updateAccount({
|
|
296
|
+
* address: '0x...',
|
|
297
|
+
* update: { name: "" },
|
|
298
|
+
* idempotencyKey,
|
|
299
|
+
* });
|
|
300
|
+
* ```
|
|
301
|
+
*/
|
|
302
|
+
async updateAccount(options) {
|
|
303
|
+
const openApiAccount = await index_js_1.CdpOpenApiClient.updateSolanaAccount(options.address, options.update, options.idempotencyKey);
|
|
304
|
+
const account = (0, toSolanaAccount_js_1.toSolanaAccount)(index_js_1.CdpOpenApiClient, {
|
|
305
|
+
account: openApiAccount,
|
|
306
|
+
});
|
|
307
|
+
analytics_js_1.Analytics.wrapObjectMethodsWithErrorTracking(account);
|
|
308
|
+
return account;
|
|
309
|
+
}
|
|
253
310
|
}
|
|
254
311
|
exports.SolanaClient = SolanaClient;
|
|
255
312
|
//# sourceMappingURL=solana.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana.js","sourceRoot":"","sources":["../../../client/solana/solana.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"solana.js","sourceRoot":"","sources":["../../../client/solana/solana.ts"],"names":[],"mappings":";;;AAaA,iFAA2E;AAE3E,4EAAsE;AACtE,wEAAkE;AAClE,gFAA0E;AAC1E,qDAA+C;AAC/C,8DAA0D;AAC1D,4DAAiE;AAEjE;;GAEG;AACH,MAAa,YAAY;IACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,KAAK,CAAC,aAAa,CAAC,UAAgC,EAAE;QACpD,MAAM,cAAc,GAAG,MAAM,2BAAgB,CAAC,mBAAmB,CAC/D,OAAO,EACP,OAAO,CAAC,cAAc,CACvB,CAAC;QAEF,MAAM,OAAO,GAAG,IAAA,oCAAe,EAAC,2BAAgB,EAAE;YAChD,OAAO,EAAE,cAAc;SACxB,CAAC,CAAC;QAEH,wBAAS,CAAC,kCAAkC,CAAC,OAAO,CAAC,CAAC;QAEtD,OAAO,OAAO,CAAC;IACjB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