@coinbase/cdp-sdk 1.6.0 → 1.8.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 +23 -0
- package/README.md +284 -1
- package/_cjs/accounts/evm/toEvmServerAccount.js +4 -2
- package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_cjs/accounts/evm/toEvmSmartAccount.js +7 -0
- package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_cjs/accounts/evm/types.js.map +1 -0
- package/_cjs/accounts/solana/toSolanaAccount.js +42 -0
- package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -0
- package/_cjs/accounts/solana/types.js +3 -0
- package/_cjs/accounts/solana/types.js.map +1 -0
- package/_cjs/actions/evm/getUserOperation.js +36 -0
- package/_cjs/actions/evm/getUserOperation.js.map +1 -0
- package/_cjs/actions/evm/transfer/accountTransferStrategy.js +11 -7
- package/_cjs/actions/evm/transfer/accountTransferStrategy.js.map +1 -1
- package/_cjs/actions/evm/transfer/smartAccountTransferStrategy.js +9 -6
- package/_cjs/actions/evm/transfer/smartAccountTransferStrategy.js.map +1 -1
- package/_cjs/actions/evm/transfer/transfer.js +7 -3
- package/_cjs/actions/evm/transfer/transfer.js.map +1 -1
- package/_cjs/actions/solana/requestFaucet.js +29 -0
- package/_cjs/actions/solana/requestFaucet.js.map +1 -0
- package/_cjs/actions/solana/signMessage.js +29 -0
- package/_cjs/actions/solana/signMessage.js.map +1 -0
- package/_cjs/actions/solana/signTransaction.js +46 -0
- package/_cjs/actions/solana/signTransaction.js.map +1 -0
- package/_cjs/actions/solana/types.js +3 -0
- package/_cjs/actions/solana/types.js.map +1 -0
- package/_cjs/analytics.js +68 -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 +135 -27
- 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 +84 -22
- 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 +59 -1
- 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 +3 -2
- package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.js +56 -0
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.js.map +1 -0
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js +284 -0
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -0
- 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 +7 -1
- package/_cjs/openapi-client/index.js.map +1 -1
- package/_cjs/policies/schema.js +186 -0
- package/_cjs/policies/schema.js.map +1 -0
- package/_cjs/policies/types.js +3 -0
- package/_cjs/{accounts → policies}/types.js.map +1 -1
- 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 +7 -0
- package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_esm/accounts/evm/types.js.map +1 -0
- package/_esm/accounts/solana/toSolanaAccount.js +39 -0
- package/_esm/accounts/solana/toSolanaAccount.js.map +1 -0
- package/_esm/accounts/solana/types.js +2 -0
- package/_esm/accounts/solana/types.js.map +1 -0
- package/_esm/actions/evm/getUserOperation.js +33 -0
- package/_esm/actions/evm/getUserOperation.js.map +1 -0
- package/_esm/actions/evm/transfer/accountTransferStrategy.js +11 -7
- package/_esm/actions/evm/transfer/accountTransferStrategy.js.map +1 -1
- package/_esm/actions/evm/transfer/smartAccountTransferStrategy.js +9 -6
- package/_esm/actions/evm/transfer/smartAccountTransferStrategy.js.map +1 -1
- package/_esm/actions/evm/transfer/transfer.js +7 -3
- package/_esm/actions/evm/transfer/transfer.js.map +1 -1
- package/_esm/actions/solana/requestFaucet.js +26 -0
- package/_esm/actions/solana/requestFaucet.js.map +1 -0
- package/_esm/actions/solana/signMessage.js +26 -0
- package/_esm/actions/solana/signMessage.js.map +1 -0
- package/_esm/actions/solana/signTransaction.js +43 -0
- package/_esm/actions/solana/signTransaction.js.map +1 -0
- package/_esm/actions/solana/types.js +2 -0
- package/_esm/actions/solana/types.js.map +1 -0
- package/_esm/analytics.js +68 -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 +135 -27
- 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 +84 -22
- 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 +58 -0
- 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 +3 -2
- package/_esm/openapi-client/generated/index.msw.js.map +1 -1
- package/_esm/openapi-client/generated/policy-engine/policy-engine.js +48 -0
- package/_esm/openapi-client/generated/policy-engine/policy-engine.js.map +1 -0
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js +259 -0
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -0
- 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 +6 -0
- package/_esm/openapi-client/index.js.map +1 -1
- package/_esm/policies/schema.js +183 -0
- package/_esm/policies/schema.js.map +1 -0
- package/_esm/policies/types.js +2 -0
- package/_esm/{accounts → policies}/types.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/accounts/evm/toEvmServerAccount.d.ts +1 -1
- package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
- package/_types/accounts/evm/toEvmSmartAccount.d.ts +1 -1
- package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
- package/_types/accounts/{types.d.ts → evm/types.d.ts} +10 -7
- package/_types/accounts/evm/types.d.ts.map +1 -0
- package/_types/accounts/solana/toSolanaAccount.d.ts +20 -0
- package/_types/accounts/solana/toSolanaAccount.d.ts.map +1 -0
- package/_types/accounts/solana/types.d.ts +12 -0
- package/_types/accounts/solana/types.d.ts.map +1 -0
- package/_types/actions/evm/getUserOperation.d.ts +22 -0
- package/_types/actions/evm/getUserOperation.d.ts.map +1 -0
- package/_types/actions/evm/sendUserOperation.d.ts +1 -1
- package/_types/actions/evm/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/evm/transfer/accountTransferStrategy.d.ts +1 -1
- package/_types/actions/evm/transfer/accountTransferStrategy.d.ts.map +1 -1
- package/_types/actions/evm/transfer/smartAccountTransferStrategy.d.ts +1 -1
- package/_types/actions/evm/transfer/smartAccountTransferStrategy.d.ts.map +1 -1
- package/_types/actions/evm/transfer/transfer.d.ts +3 -3
- package/_types/actions/evm/transfer/transfer.d.ts.map +1 -1
- package/_types/actions/evm/transfer/types.d.ts +39 -6
- package/_types/actions/evm/transfer/types.d.ts.map +1 -1
- package/_types/actions/evm/types.d.ts +28 -5
- package/_types/actions/evm/types.d.ts.map +1 -1
- package/_types/actions/solana/requestFaucet.d.ts +23 -0
- package/_types/actions/solana/requestFaucet.d.ts.map +1 -0
- package/_types/actions/solana/signMessage.d.ts +23 -0
- package/_types/actions/solana/signMessage.d.ts.map +1 -0
- package/_types/actions/solana/signTransaction.d.ts +38 -0
- package/_types/actions/solana/signTransaction.d.ts.map +1 -0
- package/_types/actions/solana/types.d.ts +80 -0
- package/_types/actions/solana/types.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 +36 -6
- 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 +47 -4
- package/_types/client/solana/solana.d.ts.map +1 -1
- package/_types/client/solana/solana.types.d.ts +21 -12
- package/_types/client/solana/solana.types.d.ts.map +1 -1
- package/_types/index.d.ts +3 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +299 -0
- 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 +3 -2
- package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/policy-engine/policy-engine.d.ts +43 -0
- package/_types/openapi-client/generated/policy-engine/policy-engine.d.ts.map +1 -0
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts +25 -0
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts.map +1 -0
- 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 +19 -0
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/policies/schema.d.ts +922 -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 +7 -4
- package/accounts/evm/toEvmSmartAccount.ts +11 -1
- package/accounts/{types.ts → evm/types.ts} +10 -12
- package/accounts/solana/toSolanaAccount.ts +60 -0
- package/accounts/solana/types.ts +13 -0
- package/actions/evm/getUserOperation.ts +40 -0
- package/actions/evm/sendUserOperation.ts +1 -1
- package/actions/evm/transfer/accountTransferStrategy.ts +12 -8
- package/actions/evm/transfer/smartAccountTransferStrategy.ts +10 -7
- package/actions/evm/transfer/transfer.ts +17 -6
- package/actions/evm/transfer/types.ts +54 -11
- package/actions/evm/types.ts +37 -5
- package/actions/solana/requestFaucet.ts +35 -0
- package/actions/solana/signMessage.ts +36 -0
- package/actions/solana/signTransaction.ts +53 -0
- package/actions/solana/types.ts +87 -0
- package/analytics.ts +84 -11
- package/client/cdp.ts +11 -4
- package/client/evm/evm.ts +162 -33
- package/client/evm/evm.types.ts +42 -4
- 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 +107 -38
- package/client/solana/solana.types.ts +25 -15
- package/index.ts +8 -1
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +360 -0
- 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 +3 -2
- package/openapi-client/generated/policy-engine/policy-engine.msw.ts +404 -0
- package/openapi-client/generated/policy-engine/policy-engine.ts +95 -0
- 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 +7 -0
- package/package.json +3 -2
- package/policies/schema.ts +266 -0
- package/policies/types.ts +19 -0
- package/types/misc.ts +41 -0
- package/version.ts +1 -1
- package/_types/accounts/types.d.ts.map +0 -1
- /package/_cjs/accounts/{types.js → evm/types.js} +0 -0
- /package/_esm/accounts/{types.js → evm/types.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evm.types.d.ts","sourceRoot":"","sources":["../../../client/evm/evm.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,IAAI,OAAO,EACrB,gBAAgB,IAAI,aAAa,EACjC,eAAe,IAAI,YAAY,EAChC,MAAM,
|
|
1
|
+
{"version":3,"file":"evm.types.d.ts","sourceRoot":"","sources":["../../../client/evm/evm.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,IAAI,OAAO,EACrB,gBAAgB,IAAI,aAAa,EACjC,eAAe,IAAI,YAAY,EAChC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACpG,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EACV,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC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,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,iCAAiC;IACjC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,gCAAgC;IAChC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9B,6HAA6H;IAC7H,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC1C,oHAAoH;IACpH,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAClC,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,WAAW,EAAE,GAAG,CAAC;IACjB,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,SAAS,EAAE,GAAG,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,iCAAiC;IACjC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,+BAA+B;IAC/B,UAAU,EAAE,GAAG,CAAC;IAChB,wBAAwB;IACxB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../client/policies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { PoliciesClientInterface, CreatePolicyOptions, ListPoliciesOptions, ListPoliciesResult, GetPolicyByIdOptions, DeletePolicyOptions, UpdatePolicyOptions } from "./policies.types.js";
|
|
2
|
+
import { Policy } from "../../policies/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The namespace containing all Policy methods.
|
|
5
|
+
*/
|
|
6
|
+
export declare class PoliciesClient implements PoliciesClientInterface {
|
|
7
|
+
/**
|
|
8
|
+
* Lists policies belonging to the developer's CDP Project.
|
|
9
|
+
* Can be filtered by scope (project or account).
|
|
10
|
+
*
|
|
11
|
+
* @param {ListPoliciesOptions} [options] - Options for filtering and paginating the results
|
|
12
|
+
* @param {string} [options.scope] - Filter policies by scope ('project' or 'account')
|
|
13
|
+
* @param {number} [options.pageSize] - Maximum number of policies to return
|
|
14
|
+
* @param {string} [options.pageToken] - Pagination cursor for fetching next page of results
|
|
15
|
+
*
|
|
16
|
+
* @returns {Promise<ListPoliciesResult>} A paginated list of policies
|
|
17
|
+
*
|
|
18
|
+
* @example **List all policies**
|
|
19
|
+
* ```ts
|
|
20
|
+
* const { policies } = await cdp.policies.listPolicies();
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example **Filter by scope**
|
|
24
|
+
* ```ts
|
|
25
|
+
* const { policies } = await cdp.policies.listPolicies({
|
|
26
|
+
* scope: 'project'
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example **With pagination**
|
|
31
|
+
* ```ts
|
|
32
|
+
* // Get first page
|
|
33
|
+
* const firstPage = await cdp.policies.listPolicies({
|
|
34
|
+
* pageSize: 10
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* // Get next page using cursor
|
|
38
|
+
* const nextPage = await cdp.policies.listPolicies({
|
|
39
|
+
* pageSize: 10,
|
|
40
|
+
* pageToken: firstPage.pageToken
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
listPolicies(options?: ListPoliciesOptions): Promise<ListPoliciesResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a new policy that can be used to govern the behavior of projects and accounts.
|
|
47
|
+
*
|
|
48
|
+
* @param {CreatePolicyOptions} options - Options for creating the policy
|
|
49
|
+
* @param {CreatePolicyBody} options.policy - The policy configuration to create
|
|
50
|
+
* @param {string} [options.policy.description] - Description of the policy's purpose
|
|
51
|
+
* @param {Rule[]} options.policy.rules - Rules that define the policy behavior
|
|
52
|
+
* @param {string} [options.idempotencyKey] - An idempotency key to prevent duplicate policy creation
|
|
53
|
+
*
|
|
54
|
+
* @returns {Promise<Policy>} The created policy
|
|
55
|
+
* @throws {ZodError<typeof CreatePolicyBodySchema>} When the policy is invalid
|
|
56
|
+
*
|
|
57
|
+
* @example **Creating a new policy**
|
|
58
|
+
* ```ts
|
|
59
|
+
* const policy = await cdp.policies.createPolicy({
|
|
60
|
+
* policy: {
|
|
61
|
+
* scope: "account",
|
|
62
|
+
* description: "Limits the amount of ETH in transaction",
|
|
63
|
+
* rules: [
|
|
64
|
+
* {
|
|
65
|
+
* action: "reject",
|
|
66
|
+
* operation: "signEvmTransaction",
|
|
67
|
+
* criteria: [
|
|
68
|
+
* {
|
|
69
|
+
* type: "ethValue",
|
|
70
|
+
* ethValue: "1000000000000000000",
|
|
71
|
+
* operator: ">",
|
|
72
|
+
* },
|
|
73
|
+
* ],
|
|
74
|
+
* },
|
|
75
|
+
* ],
|
|
76
|
+
* }
|
|
77
|
+
* });
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @example **With idempotency key**
|
|
81
|
+
* ```ts
|
|
82
|
+
* const idempotencyKey = uuidv4();
|
|
83
|
+
*
|
|
84
|
+
* // First call creates the policy
|
|
85
|
+
* const policy = await cdp.policies.createPolicy({
|
|
86
|
+
* policy: {
|
|
87
|
+
* scope: "account",
|
|
88
|
+
* description: "Limits the amount of ETH in transaction",
|
|
89
|
+
* rules: [
|
|
90
|
+
* {
|
|
91
|
+
* action: "reject",
|
|
92
|
+
* operation: "signEvmTransaction",
|
|
93
|
+
* criteria: [
|
|
94
|
+
* {
|
|
95
|
+
* type: "ethValue",
|
|
96
|
+
* ethValue: "1000000000000000000",
|
|
97
|
+
* operator: ">",
|
|
98
|
+
* },
|
|
99
|
+
* ],
|
|
100
|
+
* },
|
|
101
|
+
* ],
|
|
102
|
+
* },
|
|
103
|
+
* idempotencyKey
|
|
104
|
+
* });
|
|
105
|
+
*
|
|
106
|
+
* // Second call with same key returns the same policy
|
|
107
|
+
* const samePolicy = await cdp.policies.createPolicy({
|
|
108
|
+
* policy: { ... },
|
|
109
|
+
* idempotencyKey
|
|
110
|
+
* });
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
createPolicy(options: CreatePolicyOptions): Promise<Policy>;
|
|
114
|
+
/**
|
|
115
|
+
* Retrieves a policy by its unique identifier.
|
|
116
|
+
*
|
|
117
|
+
* @param {GetPolicyByIdOptions} options - Options containing the policy ID to retrieve
|
|
118
|
+
* @param {string} options.id - The unique identifier of the policy to retrieve
|
|
119
|
+
*
|
|
120
|
+
* @returns {Promise<Policy>} The requested policy
|
|
121
|
+
*
|
|
122
|
+
* @example **Retrieving a policy by ID**
|
|
123
|
+
* ```ts
|
|
124
|
+
* const policy = await cdp.policies.getPolicyById({
|
|
125
|
+
* id: "__ID__"
|
|
126
|
+
* });
|
|
127
|
+
*
|
|
128
|
+
* console.log(policy.name);
|
|
129
|
+
* console.log(policy.rules);
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
getPolicyById(options: GetPolicyByIdOptions): Promise<Policy>;
|
|
133
|
+
/**
|
|
134
|
+
* Deletes a policy by its unique identifier.
|
|
135
|
+
* If a policy is referenced by an active project or account, this operation will fail.
|
|
136
|
+
*
|
|
137
|
+
* @param {DeletePolicyOptions} options - Options containing the policy ID to delete
|
|
138
|
+
* @param {string} options.id - The unique identifier of the policy to delete
|
|
139
|
+
* @param {string} [options.idempotencyKey] - An idempotency key to prevent duplicate deletion
|
|
140
|
+
*
|
|
141
|
+
* @returns {Promise<void>} Void on successful deletion
|
|
142
|
+
*
|
|
143
|
+
* @example **Deleting a policy**
|
|
144
|
+
* ```ts
|
|
145
|
+
* await cdp.policies.deletePolicy({
|
|
146
|
+
* id: "__ID__"
|
|
147
|
+
* });
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* @example **With idempotency key**
|
|
151
|
+
* ```ts
|
|
152
|
+
* const idempotencyKey = uuidv4();
|
|
153
|
+
*
|
|
154
|
+
* // This operation is idempotent with the key
|
|
155
|
+
* await cdp.policies.deletePolicy({
|
|
156
|
+
* id: "__ID__",
|
|
157
|
+
* idempotencyKey
|
|
158
|
+
* });
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
deletePolicy(options: DeletePolicyOptions): Promise<void>;
|
|
162
|
+
/**
|
|
163
|
+
* Updates an existing policy by its unique identifier.
|
|
164
|
+
* This will apply the updated policy to any project or accounts that are currently using it.
|
|
165
|
+
*
|
|
166
|
+
* @param {UpdatePolicyOptions} options - Options containing the policy ID and updated policy data
|
|
167
|
+
* @param {string} options.id - The unique identifier of the policy to update
|
|
168
|
+
* @param {UpdatePolicyBody} options.policy - The updated policy configuration
|
|
169
|
+
* @param {string} [options.policy.description] - Updated description of the policy's purpose
|
|
170
|
+
* @param {Rule[]} [options.policy.rules] - Updated rules that define the policy behavior
|
|
171
|
+
* @param {string} [options.idempotencyKey] - An idempotency key to prevent duplicate updates
|
|
172
|
+
*
|
|
173
|
+
* @returns {Promise<Policy>} The updated policy
|
|
174
|
+
* @throws {ZodError<typeof UpdatePolicyBodySchema>} When the updated policy is invalid
|
|
175
|
+
*
|
|
176
|
+
* @example **Updating a policy**
|
|
177
|
+
* ```ts
|
|
178
|
+
* const updatedPolicy = await cdp.policies.updatePolicy({
|
|
179
|
+
* id: "__ID__",
|
|
180
|
+
* policy: {
|
|
181
|
+
* description: "Now with lower transaction limits",
|
|
182
|
+
* rules: [
|
|
183
|
+
* {
|
|
184
|
+
* action: "reject",
|
|
185
|
+
* operation: "signEvmTransaction",
|
|
186
|
+
* criteria: [
|
|
187
|
+
* {
|
|
188
|
+
* type: "ethValue",
|
|
189
|
+
* ethValue: "1000000000",
|
|
190
|
+
* operator: ">",
|
|
191
|
+
* },
|
|
192
|
+
* ],
|
|
193
|
+
* },
|
|
194
|
+
* ],
|
|
195
|
+
* },
|
|
196
|
+
* });
|
|
197
|
+
* ```
|
|
198
|
+
*
|
|
199
|
+
* @example **With idempotency key**
|
|
200
|
+
* ```ts
|
|
201
|
+
* const idempotencyKey = uuidv4();
|
|
202
|
+
*
|
|
203
|
+
* // This operation is idempotent with the key
|
|
204
|
+
* await cdp.policies.updatePolicy({
|
|
205
|
+
* id: "__ID__",
|
|
206
|
+
* policy: {
|
|
207
|
+
* description: "Modified Policy",
|
|
208
|
+
* rules: { ... }
|
|
209
|
+
* },
|
|
210
|
+
* idempotencyKey
|
|
211
|
+
* });
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
updatePolicy(options: UpdatePolicyOptions): Promise<Policy>;
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=policies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../../client/policies/policies.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD;;GAEG;AACH,qBAAa,cAAe,YAAW,uBAAuB;IAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACG,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIlF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmEG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;IAKjE;;;;;;;;;;;;;;;;;OAiBG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IAInE;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;CAQlE"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { OpenApiPoliciesMethods } from "../../openapi-client/index.js";
|
|
2
|
+
import { CreatePolicyBody, PolicyScope, UpdatePolicyBody } from "../../policies/schema.js";
|
|
3
|
+
import { Policy } from "../../policies/types.js";
|
|
4
|
+
/**
|
|
5
|
+
* The PoliciesClient type, where all OpenApiPoliciesMethods methods are wrapped.
|
|
6
|
+
*/
|
|
7
|
+
export type PoliciesClientInterface = Omit<typeof OpenApiPoliciesMethods, "createPolicy" | "listPolicies" | "getPolicyById" | "deletePolicy" | "updatePolicy"> & {
|
|
8
|
+
listPolicies: (options: ListPoliciesOptions) => Promise<ListPoliciesResult>;
|
|
9
|
+
createPolicy: (options: CreatePolicyOptions) => Promise<Policy>;
|
|
10
|
+
getPolicyById: (options: GetPolicyByIdOptions) => Promise<Policy>;
|
|
11
|
+
deletePolicy: (options: DeletePolicyOptions) => Promise<void>;
|
|
12
|
+
updatePolicy: (options: UpdatePolicyOptions) => Promise<Policy>;
|
|
13
|
+
};
|
|
14
|
+
export interface ListPoliciesOptions {
|
|
15
|
+
/** The page size to paginate through the accounts. */
|
|
16
|
+
pageSize?: number;
|
|
17
|
+
/** The page token to paginate through the accounts. */
|
|
18
|
+
pageToken?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The scope of the policies to return. If `project`, the response will include exactly one policy, which is the project-level policy. If `account`, the response will include all account-level policies for the developer's CDP Project.
|
|
21
|
+
*/
|
|
22
|
+
scope?: PolicyScope;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The result of listing policies.
|
|
26
|
+
*/
|
|
27
|
+
export interface ListPoliciesResult {
|
|
28
|
+
/** The list of policies matching the query parameters. */
|
|
29
|
+
policies: Policy[];
|
|
30
|
+
/**
|
|
31
|
+
* The next page token to paginate through the policies.
|
|
32
|
+
* If undefined, there are no more policies to paginate through.
|
|
33
|
+
*/
|
|
34
|
+
nextPageToken?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Options for creating a Policy.
|
|
38
|
+
*/
|
|
39
|
+
export interface CreatePolicyOptions {
|
|
40
|
+
/**
|
|
41
|
+
* The idempotency key to ensure the request is processed exactly once.
|
|
42
|
+
* Used to safely retry requests without accidentally performing the same operation twice.
|
|
43
|
+
*/
|
|
44
|
+
idempotencyKey?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The policy definition to create.
|
|
47
|
+
* Contains the scope, description, and rules for the policy.
|
|
48
|
+
*/
|
|
49
|
+
policy: CreatePolicyBody;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Options for retrieving a Policy by ID.
|
|
53
|
+
*/
|
|
54
|
+
export interface GetPolicyByIdOptions {
|
|
55
|
+
/**
|
|
56
|
+
* The unique identifier of the policy to retrieve.
|
|
57
|
+
* This is a UUID that's generated when the policy is created.
|
|
58
|
+
*/
|
|
59
|
+
id: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Options for deleting a Policy.
|
|
63
|
+
*/
|
|
64
|
+
export interface DeletePolicyOptions {
|
|
65
|
+
/**
|
|
66
|
+
* The unique identifier of the policy to delete.
|
|
67
|
+
* This is a UUID that's generated when the policy is created.
|
|
68
|
+
*/
|
|
69
|
+
id: string;
|
|
70
|
+
/**
|
|
71
|
+
* The idempotency key to ensure the request is processed exactly once.
|
|
72
|
+
* Used to safely retry requests without accidentally performing the same operation twice.
|
|
73
|
+
*/
|
|
74
|
+
idempotencyKey?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Options for updating a Policy.
|
|
78
|
+
*/
|
|
79
|
+
export interface UpdatePolicyOptions {
|
|
80
|
+
/**
|
|
81
|
+
* The unique identifier of the policy to update.
|
|
82
|
+
* This is a UUID that's generated when the policy is created.
|
|
83
|
+
*/
|
|
84
|
+
id: string;
|
|
85
|
+
/**
|
|
86
|
+
* The updated policy definition.
|
|
87
|
+
* Contains the description and rules for the policy.
|
|
88
|
+
*/
|
|
89
|
+
policy: UpdatePolicyBody;
|
|
90
|
+
/**
|
|
91
|
+
* The idempotency key to ensure the request is processed exactly once.
|
|
92
|
+
* Used to safely retry requests without accidentally performing the same operation twice.
|
|
93
|
+
*/
|
|
94
|
+
idempotencyKey?: string;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=policies.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policies.types.d.ts","sourceRoot":"","sources":["../../../client/policies/policies.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,OAAO,sBAAsB,EAC3B,cAAc,GACd,cAAc,GACd,eAAe,GACf,cAAc,GACd,cAAc,CACjB,GAAG;IACF,YAAY,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC5E,YAAY,EAAE,CAAC,OAAO,EA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CreateAccountOptions, GetAccountOptions, GetOrCreateAccountOptions, ListAccountsOptions, ListAccountsResult, RequestFaucetOptions, SignatureResult, SignMessageOptions, SignTransactionOptions, SolanaClientInterface, UpdateSolanaAccountOptions } from "./solana.types.js";
|
|
2
|
+
import { SolanaAccount } from "../../accounts/solana/types.js";
|
|
2
3
|
/**
|
|
3
4
|
* The namespace containing all Solana methods.
|
|
4
5
|
*/
|
|
@@ -33,7 +34,7 @@ export declare class SolanaClient implements SolanaClientInterface {
|
|
|
33
34
|
* await cdp.solana.createAccount({ idempotencyKey });
|
|
34
35
|
* ```
|
|
35
36
|
*/
|
|
36
|
-
createAccount(options?: CreateAccountOptions): Promise<
|
|
37
|
+
createAccount(options?: CreateAccountOptions): Promise<SolanaAccount>;
|
|
37
38
|
/**
|
|
38
39
|
* Gets a Solana account by its address.
|
|
39
40
|
*
|
|
@@ -59,7 +60,7 @@ export declare class SolanaClient implements SolanaClientInterface {
|
|
|
59
60
|
* });
|
|
60
61
|
* ```
|
|
61
62
|
*/
|
|
62
|
-
getAccount(options: GetAccountOptions): Promise<
|
|
63
|
+
getAccount(options: GetAccountOptions): Promise<SolanaAccount>;
|
|
63
64
|
/**
|
|
64
65
|
* Gets a Solana account by its address.
|
|
65
66
|
*
|
|
@@ -75,7 +76,7 @@ export declare class SolanaClient implements SolanaClientInterface {
|
|
|
75
76
|
* });
|
|
76
77
|
* ```
|
|
77
78
|
*/
|
|
78
|
-
getOrCreateAccount(options: GetOrCreateAccountOptions): Promise<
|
|
79
|
+
getOrCreateAccount(options: GetOrCreateAccountOptions): Promise<SolanaAccount>;
|
|
79
80
|
/**
|
|
80
81
|
* Lists all Solana accounts.
|
|
81
82
|
*
|
|
@@ -181,5 +182,47 @@ export declare class SolanaClient implements SolanaClientInterface {
|
|
|
181
182
|
* ```
|
|
182
183
|
*/
|
|
183
184
|
signTransaction(options: SignTransactionOptions): Promise<SignatureResult>;
|
|
185
|
+
/**
|
|
186
|
+
* Updates a CDP Solana account.
|
|
187
|
+
*
|
|
188
|
+
* @param {UpdateSolanaAccountOptions} [options] - Optional parameters for creating the account.
|
|
189
|
+
* @param {string} options.address - The address of the account to update
|
|
190
|
+
* @param {UpdateSolanaAccountBody} options.update - An object containing account fields to update.
|
|
191
|
+
* @param {string} [options.update.name] - The new name for the account.
|
|
192
|
+
* @param {string} [options.update.accountPolicy] - The ID of a Policy to apply to the account.
|
|
193
|
+
* @param {string} [options.idempotencyKey] - An idempotency key.
|
|
194
|
+
*
|
|
195
|
+
* @returns A promise that resolves to the updated account.
|
|
196
|
+
*
|
|
197
|
+
* @example **With a name**
|
|
198
|
+
* ```ts
|
|
199
|
+
* const account = await cdp.sol.updateAccount({ address: "...", update: { name: "New Name" } });
|
|
200
|
+
* ```
|
|
201
|
+
*
|
|
202
|
+
* @example **With an account policy**
|
|
203
|
+
* ```ts
|
|
204
|
+
* const account = await cdp.sol.updateAccount({ address: "...", update: { accountPolicy: "73bcaeeb-d7af-4615-b064-42b5fe83a31e" } });
|
|
205
|
+
* ```
|
|
206
|
+
*
|
|
207
|
+
* @example **With an idempotency key**
|
|
208
|
+
* ```ts
|
|
209
|
+
* const idempotencyKey = uuidv4();
|
|
210
|
+
*
|
|
211
|
+
* // First call
|
|
212
|
+
* await cdp.sol.updateAccount({
|
|
213
|
+
* address: "0x...",
|
|
214
|
+
* update: { accountPolicy: "73bcaeeb-d7af-4615-b064-42b5fe83a31e" },
|
|
215
|
+
* idempotencyKey,
|
|
216
|
+
* });
|
|
217
|
+
*
|
|
218
|
+
* // Second call with the same idempotency key will not update
|
|
219
|
+
* await cdp.sol.updateAccount({
|
|
220
|
+
* address: '0x...',
|
|
221
|
+
* update: { name: "" },
|
|
222
|
+
* idempotencyKey,
|
|
223
|
+
* });
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
updateAccount(options: UpdateSolanaAccountOptions): Promise<SolanaAccount>;
|
|
184
227
|
}
|
|
185
228
|
//# sourceMappingURL=solana.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../client/solana/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../client/solana/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAQ/D;;GAEG;AACH,qBAAa,YAAa,YAAW,qBAAqB;IACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC;IAe/E;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;IAsBpE;;;;;;;;;;;;;;OAcG;IACG,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC;IA0BpF;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAoBlF;;;;;;;;;;;;;;;;;OAiBG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IAI5E;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC;IAIxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAIhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACG,aAAa,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,aAAa,CAAC;CAejF"}
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Account, SolanaAccount } from "../../accounts/solana/types.js";
|
|
2
|
+
import { OpenApiSolanaMethods, UpdateSolanaAccountBody } from "../../openapi-client/index.js";
|
|
2
3
|
/**
|
|
3
4
|
* The SolanaClient type, where all OpenApiSolanaMethods methods are wrapped.
|
|
4
5
|
*/
|
|
5
|
-
export type SolanaClientInterface = Omit<typeof OpenApiSolanaMethods, "createSolanaAccount" | "getSolanaAccount" | "getSolanaAccountByName" | "listSolanaAccounts" | "requestSolanaFaucet" | "signSolanaMessage" | "signSolanaTransaction"> & {
|
|
6
|
+
export type SolanaClientInterface = Omit<typeof OpenApiSolanaMethods, "createSolanaAccount" | "getSolanaAccount" | "getSolanaAccountByName" | "updateSolanaAccount" | "listSolanaAccounts" | "requestSolanaFaucet" | "signSolanaMessage" | "signSolanaTransaction" | "updateSolanaAccount"> & {
|
|
6
7
|
createAccount: (options: CreateAccountOptions) => Promise<Account>;
|
|
7
8
|
getAccount: (options: GetAccountOptions) => Promise<Account>;
|
|
8
9
|
getOrCreateAccount: (options: GetOrCreateAccountOptions) => Promise<Account>;
|
|
10
|
+
updateAccount: (options: UpdateSolanaAccountOptions) => Promise<Account>;
|
|
9
11
|
listAccounts: (options: ListAccountsOptions) => Promise<ListAccountsResult>;
|
|
10
12
|
requestFaucet: (options: RequestFaucetOptions) => Promise<SignatureResult>;
|
|
11
13
|
signMessage: (options: SignMessageOptions) => Promise<SignatureResult>;
|
|
12
14
|
signTransaction: (options: SignTransactionOptions) => Promise<SignatureResult>;
|
|
13
15
|
};
|
|
14
16
|
/**
|
|
15
|
-
* A Solana
|
|
17
|
+
* A Solana signature result.
|
|
16
18
|
*/
|
|
17
|
-
export
|
|
19
|
+
export interface SignatureResult {
|
|
20
|
+
/** The signature. */
|
|
21
|
+
signature: string;
|
|
22
|
+
}
|
|
18
23
|
/**
|
|
19
24
|
* Options for creating a Solana account.
|
|
20
25
|
*/
|
|
@@ -40,6 +45,17 @@ export interface GetOrCreateAccountOptions {
|
|
|
40
45
|
/** The name of the account. */
|
|
41
46
|
name: string;
|
|
42
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Options for creating a SOL server account.
|
|
50
|
+
*/
|
|
51
|
+
export interface UpdateSolanaAccountOptions {
|
|
52
|
+
/** The address of the account. */
|
|
53
|
+
address: string;
|
|
54
|
+
/** The updates to apply to the account */
|
|
55
|
+
update: UpdateSolanaAccountBody;
|
|
56
|
+
/** The idempotency key. */
|
|
57
|
+
idempotencyKey?: string;
|
|
58
|
+
}
|
|
43
59
|
/**
|
|
44
60
|
* Options for listing Solana accounts.
|
|
45
61
|
*/
|
|
@@ -54,7 +70,7 @@ export interface ListAccountsOptions {
|
|
|
54
70
|
*/
|
|
55
71
|
export interface ListAccountsResult {
|
|
56
72
|
/** The accounts. */
|
|
57
|
-
accounts:
|
|
73
|
+
accounts: SolanaAccount[];
|
|
58
74
|
/**
|
|
59
75
|
* The token for the next page of accounts, if any.
|
|
60
76
|
*/
|
|
@@ -93,11 +109,4 @@ export interface SignTransactionOptions {
|
|
|
93
109
|
/** The idempotency key. */
|
|
94
110
|
idempotencyKey?: string;
|
|
95
111
|
}
|
|
96
|
-
/**
|
|
97
|
-
* A Solana signature result.
|
|
98
|
-
*/
|
|
99
|
-
export interface SignatureResult {
|
|
100
|
-
/** The signature. */
|
|
101
|
-
signature: string;
|
|
102
|
-
}
|
|
103
112
|
//# sourceMappingURL=solana.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana.types.d.ts","sourceRoot":"","sources":["../../../client/solana/solana.types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"solana.types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M,CAAC;IAChB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
package/_types/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { CdpClient } from "./client/cdp.js";
|
|
2
|
-
export type { EvmServerAccount, EvmSmartAccount } from "./accounts/types.js";
|
|
2
|
+
export type { EvmServerAccount, EvmSmartAccount } from "./accounts/evm/types.js";
|
|
3
|
+
export type { Policy } from "./policies/types.js";
|
|
4
|
+
export { CreatePolicyBodySchema, UpdatePolicyBodySchema, type CreatePolicyBody, type UpdatePolicyBody, } from "./policies/schema.js";
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
package/_types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACjF,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,sBAAsB,CAAC"}
|