@coinbase/cdp-sdk 1.46.1 → 1.48.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 +14 -0
- package/README.md +332 -0
- package/_cjs/actions/solana/sendTransaction.js +3 -0
- package/_cjs/actions/solana/sendTransaction.js.map +1 -1
- package/_cjs/actions/webhooks/createWebhookSubscription.js +48 -0
- package/_cjs/actions/webhooks/createWebhookSubscription.js.map +1 -0
- package/_cjs/actions/webhooks/index.js +6 -0
- package/_cjs/actions/webhooks/index.js.map +1 -0
- package/_cjs/client/cdp.js +5 -4
- package/_cjs/client/cdp.js.map +1 -1
- package/_cjs/client/end-user/endUser.js +19 -89
- package/_cjs/client/end-user/endUser.js.map +1 -1
- package/_cjs/client/end-user/toEndUserAccount.js +13 -43
- package/_cjs/client/end-user/toEndUserAccount.js.map +1 -1
- package/_cjs/client/solana/solana.js +2 -0
- package/_cjs/client/solana/solana.js.map +1 -1
- package/_cjs/client/webhooks/webhooks.js +58 -0
- package/_cjs/client/webhooks/webhooks.js.map +1 -0
- package/_cjs/index.js.map +1 -1
- package/_cjs/openapi-client/cdpApiClient.js +0 -32
- package/_cjs/openapi-client/cdpApiClient.js.map +1 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +51 -11
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/{embedded-wallets-core-functionality/embedded-wallets-core-functionality.js → embedded-wallets/embedded-wallets.js} +37 -65
- package/_cjs/openapi-client/generated/embedded-wallets/embedded-wallets.js.map +1 -0
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +2 -2
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/sql-api/sql-api.js +12 -1
- package/_cjs/openapi-client/generated/sql-api/sql-api.js.map +1 -1
- package/_cjs/openapi-client/generated/webhooks/webhooks.js +32 -5
- package/_cjs/openapi-client/generated/webhooks/webhooks.js.map +1 -1
- package/_cjs/openapi-client/index.js +2 -2
- package/_cjs/openapi-client/index.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/actions/solana/sendTransaction.js +3 -0
- package/_esm/actions/solana/sendTransaction.js.map +1 -1
- package/_esm/actions/webhooks/createWebhookSubscription.js +45 -0
- package/_esm/actions/webhooks/createWebhookSubscription.js.map +1 -0
- package/_esm/actions/webhooks/index.js +2 -0
- package/_esm/actions/webhooks/index.js.map +1 -0
- package/_esm/client/cdp.js +6 -5
- package/_esm/client/cdp.js.map +1 -1
- package/_esm/client/end-user/endUser.js +17 -87
- package/_esm/client/end-user/endUser.js.map +1 -1
- package/_esm/client/end-user/toEndUserAccount.js +13 -43
- package/_esm/client/end-user/toEndUserAccount.js.map +1 -1
- package/_esm/client/solana/solana.js +2 -0
- package/_esm/client/solana/solana.js.map +1 -1
- package/_esm/client/webhooks/webhooks.js +54 -0
- package/_esm/client/webhooks/webhooks.js.map +1 -0
- package/_esm/index.js.map +1 -1
- package/_esm/openapi-client/cdpApiClient.js +0 -32
- package/_esm/openapi-client/cdpApiClient.js.map +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +48 -8
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/{embedded-wallets-core-functionality/embedded-wallets-core-functionality.js → embedded-wallets/embedded-wallets.js} +36 -61
- package/_esm/openapi-client/generated/embedded-wallets/embedded-wallets.js.map +1 -0
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +2 -2
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/sql-api/sql-api.js +10 -0
- package/_esm/openapi-client/generated/sql-api/sql-api.js.map +1 -1
- package/_esm/openapi-client/generated/webhooks/webhooks.js +30 -4
- package/_esm/openapi-client/generated/webhooks/webhooks.js.map +1 -1
- package/_esm/openapi-client/index.js +2 -2
- package/_esm/openapi-client/index.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/actions/solana/sendTransaction.d.ts +2 -0
- package/_types/actions/solana/sendTransaction.d.ts.map +1 -1
- package/_types/actions/webhooks/createWebhookSubscription.d.ts +68 -0
- package/_types/actions/webhooks/createWebhookSubscription.d.ts.map +1 -0
- package/_types/actions/webhooks/index.d.ts +2 -0
- package/_types/actions/webhooks/index.d.ts.map +1 -0
- package/_types/client/cdp.d.ts +5 -6
- package/_types/client/cdp.d.ts.map +1 -1
- package/_types/client/end-user/endUser.d.ts +2 -52
- package/_types/client/end-user/endUser.d.ts.map +1 -1
- package/_types/client/end-user/endUser.types.d.ts +1 -63
- package/_types/client/end-user/endUser.types.d.ts.map +1 -1
- package/_types/client/end-user/toEndUserAccount.d.ts +0 -2
- package/_types/client/end-user/toEndUserAccount.d.ts.map +1 -1
- package/_types/client/solana/solana.d.ts +2 -0
- package/_types/client/solana/solana.d.ts.map +1 -1
- package/_types/client/solana/solana.types.d.ts +2 -0
- package/_types/client/solana/solana.types.d.ts.map +1 -1
- package/_types/client/webhooks/webhooks.d.ts +41 -0
- package/_types/client/webhooks/webhooks.d.ts.map +1 -0
- package/_types/index.d.ts +2 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/openapi-client/cdpApiClient.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +285 -85
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/openapi-client/generated/{embedded-wallets-core-functionality/embedded-wallets-core-functionality.d.ts → embedded-wallets/embedded-wallets.d.ts} +14 -32
- package/_types/openapi-client/generated/embedded-wallets/embedded-wallets.d.ts.map +1 -0
- package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts +2 -2
- package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/sql-api/sql-api.d.ts +10 -1
- package/_types/openapi-client/generated/sql-api/sql-api.d.ts.map +1 -1
- package/_types/openapi-client/generated/webhooks/webhooks.d.ts +30 -5
- package/_types/openapi-client/generated/webhooks/webhooks.d.ts.map +1 -1
- package/_types/openapi-client/index.d.ts +16 -18
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/actions/solana/sendTransaction.ts +3 -0
- package/actions/webhooks/createWebhookSubscription.ts +104 -0
- package/actions/webhooks/index.ts +6 -0
- package/client/cdp.ts +8 -8
- package/client/end-user/endUser.ts +55 -187
- package/client/end-user/endUser.types.ts +0 -72
- package/client/end-user/toEndUserAccount.ts +57 -152
- package/client/solana/solana.ts +2 -0
- package/client/solana/solana.types.ts +2 -0
- package/client/webhooks/webhooks.ts +61 -0
- package/index.ts +6 -4
- package/openapi-client/cdpApiClient.ts +0 -34
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +331 -93
- package/openapi-client/generated/{embedded-wallets-core-functionality/embedded-wallets-core-functionality.ts → embedded-wallets/embedded-wallets.ts} +45 -99
- package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +3 -3
- package/openapi-client/generated/sql-api/sql-api.ts +19 -0
- package/openapi-client/generated/webhooks/webhooks.ts +42 -4
- package/openapi-client/index.ts +2 -2
- package/package.json +1 -1
- package/version.ts +1 -1
- package/_cjs/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js.map +0 -1
- package/_esm/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js.map +0 -1
- package/_types/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../../openapi-client/generated/webhooks/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAC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,CAAC,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC,CAC1D,CAAC"}
|
|
@@ -10,25 +10,22 @@ export * from "./generated/policy-engine/policy-engine.js";
|
|
|
10
10
|
export * from "./generated/onramp/onramp.js";
|
|
11
11
|
export * from "./generated/onchain-data/onchain-data.js";
|
|
12
12
|
export * from "./generated/end-user-accounts/end-user-accounts.js";
|
|
13
|
-
export * from "./generated/embedded-wallets
|
|
13
|
+
export * from "./generated/embedded-wallets/embedded-wallets.js";
|
|
14
14
|
export * from "./generated/x402-facilitator/x402-facilitator.js";
|
|
15
15
|
export declare const CdpOpenApiClient: {
|
|
16
16
|
configure: (options: import("./cdpApiClient.js").CdpOptions) => void;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
signSolanaTransactionWithEndUserAccount: (projectId: string, userId: string, signSolanaTransactionWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignSolanaTransactionWithEndUserAccountBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignSolanaTransactionWithEndUserAccount200>;
|
|
30
|
-
sendSolanaTransactionWithEndUserAccount: (projectId: string, userId: string, sendSolanaTransactionWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendSolanaTransactionWithEndUserAccountBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendSolanaTransactionWithEndUserAccount200>;
|
|
31
|
-
sendSolanaAssetWithEndUserAccount: (projectId: string, userId: string, address: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").BlockchainAddress, asset: "usdc", sendSolanaAssetWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendSolanaAssetWithEndUserAccountBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendSolanaAssetWithEndUserAccount200>;
|
|
17
|
+
signEvmTransactionWithEndUserAccount: (userId: string, signEvmTransactionWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignEvmTransactionWithEndUserAccountBody, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignEvmTransactionWithEndUserAccountParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignEvmTransactionWithEndUserAccount200>;
|
|
18
|
+
sendEvmTransactionWithEndUserAccount: (userId: string, sendEvmTransactionWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendEvmTransactionWithEndUserAccountBody, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendEvmTransactionWithEndUserAccountParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendEvmTransactionWithEndUserAccount200>;
|
|
19
|
+
sendEvmAssetWithEndUserAccount: (userId: string, address: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").BlockchainAddress, asset: "usdc", sendEvmAssetWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendEvmAssetWithEndUserAccountBody, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendEvmAssetWithEndUserAccountParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendEvmAssetWithEndUserAccount200>;
|
|
20
|
+
signEvmMessageWithEndUserAccount: (userId: string, signEvmMessageWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignEvmMessageWithEndUserAccountBody, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignEvmMessageWithEndUserAccountParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignEvmMessageWithEndUserAccount200>;
|
|
21
|
+
signEvmTypedDataWithEndUserAccount: (userId: string, signEvmTypedDataWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignEvmTypedDataWithEndUserAccountBody, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignEvmTypedDataWithEndUserAccountParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignEvmTypedDataWithEndUserAccount200>;
|
|
22
|
+
revokeDelegationForEndUser: (userId: string, revokeDelegationForEndUserBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").RevokeDelegationForEndUserBody, options?: string | undefined) => Promise<void>;
|
|
23
|
+
createEvmEip7702DelegationWithEndUserAccount: (userId: string, createEvmEip7702DelegationWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmEip7702DelegationWithEndUserAccountBody, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmEip7702DelegationWithEndUserAccountParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmEip7702DelegationWithEndUserAccount201>;
|
|
24
|
+
sendUserOperationWithEndUserAccount: (userId: string, address: string, sendUserOperationWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendUserOperationWithEndUserAccountBody, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendUserOperationWithEndUserAccountParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
25
|
+
signSolanaMessageWithEndUserAccount: (userId: string, signSolanaMessageWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignSolanaMessageWithEndUserAccountBody, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignSolanaMessageWithEndUserAccountParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignSolanaMessageWithEndUserAccount200>;
|
|
26
|
+
signSolanaTransactionWithEndUserAccount: (userId: string, signSolanaTransactionWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignSolanaTransactionWithEndUserAccountBody, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignSolanaTransactionWithEndUserAccountParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SignSolanaTransactionWithEndUserAccount200>;
|
|
27
|
+
sendSolanaTransactionWithEndUserAccount: (userId: string, sendSolanaTransactionWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendSolanaTransactionWithEndUserAccountBody, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendSolanaTransactionWithEndUserAccountParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendSolanaTransactionWithEndUserAccount200>;
|
|
28
|
+
sendSolanaAssetWithEndUserAccount: (userId: string, address: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").BlockchainAddress, asset: "usdc", sendSolanaAssetWithEndUserAccountBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendSolanaAssetWithEndUserAccountBody, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendSolanaAssetWithEndUserAccountParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendSolanaAssetWithEndUserAccount200>;
|
|
32
29
|
createEndUser: (createEndUserBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEndUserBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EndUser>;
|
|
33
30
|
listEndUsers: (params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEndUsersParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEndUsers200>;
|
|
34
31
|
validateEndUserAccessToken: (validateEndUserAccessTokenBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ValidateEndUserAccessTokenBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EndUser>;
|
|
@@ -63,6 +60,7 @@ export declare const CdpOpenApiClient: {
|
|
|
63
60
|
getWebhookSubscription: (subscriptionId: string, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").WebhookSubscriptionResponse>;
|
|
64
61
|
updateWebhookSubscription: (subscriptionId: string, webhookSubscriptionUpdateRequest: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").WebhookSubscriptionUpdateRequest, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").WebhookSubscriptionResponse>;
|
|
65
62
|
deleteWebhookSubscription: (subscriptionId: string, options?: string | undefined) => Promise<void>;
|
|
63
|
+
listWebhookSubscriptionEvents: (subscriptionId: string, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListWebhookSubscriptionEventsParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").WebhookEventListResponse>;
|
|
66
64
|
listEvmTokenBalances: (network: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmTokenBalancesNetwork, address: string, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmTokenBalancesParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmTokenBalances200>;
|
|
67
65
|
getEvmSwapPrice: (params: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").GetEvmSwapPriceParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").GetSwapPriceResponseWrapper>;
|
|
68
66
|
createEvmSwapQuote: (createEvmSwapQuoteBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmSwapQuoteBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateSwapQuoteResponseWrapper>;
|
|
@@ -77,7 +75,7 @@ export declare const CdpOpenApiClient: {
|
|
|
77
75
|
sendUserOperation: (address: string, userOpHash: string, sendUserOperationBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendUserOperationBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
78
76
|
createSpendPermission: (address: string, createSpendPermissionRequest: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateSpendPermissionRequest, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
79
77
|
listSpendPermissions: (address: string, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListSpendPermissionsParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListSpendPermissions200>;
|
|
80
|
-
revokeSpendPermission: (address: string,
|
|
78
|
+
revokeSpendPermission: (address: string, revokeSpendPermissionRequest: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").RevokeSpendPermissionRequest, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
81
79
|
listEvmAccounts: (params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmAccountsParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmAccounts200>;
|
|
82
80
|
createEvmAccount: (createEvmAccountBody?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmAccountBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmAccount>;
|
|
83
81
|
getEvmAccount: (address: string, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmAccount>;
|
|
@@ -110,7 +108,7 @@ export declare const OpenApiEvmMethods: {
|
|
|
110
108
|
sendUserOperation: (address: string, userOpHash: string, sendUserOperationBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendUserOperationBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
111
109
|
createSpendPermission: (address: string, createSpendPermissionRequest: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateSpendPermissionRequest, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
112
110
|
listSpendPermissions: (address: string, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListSpendPermissionsParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListSpendPermissions200>;
|
|
113
|
-
revokeSpendPermission: (address: string,
|
|
111
|
+
revokeSpendPermission: (address: string, revokeSpendPermissionRequest: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").RevokeSpendPermissionRequest, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
114
112
|
listEvmAccounts: (params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmAccountsParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmAccounts200>;
|
|
115
113
|
createEvmAccount: (createEvmAccountBody?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmAccountBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmAccount>;
|
|
116
114
|
getEvmAccount: (address: string, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmAccount>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../openapi-client/index.ts"],"names":[],"mappings":"AAAA,cAAc,sDAAsD,CAAC;AACrE,cAAc,0CAA0C,CAAC;AACzD,cAAc,sDAAsD,CAAC;A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jB,eAAkB,EAAC,qGAAyC,EAAC,4BAAoE;uBAAwa,eAAkB,EAAC,2FAA+B,EAAC,4BAAsE;iCAA6wB,eAAkB,EAAC,6HAAiE,EAAC,4BAAgF;2CAAujB,6BAAgC,EAAC,4BAAgF;uBAAod,yGAA6C,EAAC,4BAA6D;uBAA+a,eAAkB,EAAC,yGAA6C,EAAC,4BAAsE;6BAA6d,YAAe,EAAC,qHAAyD,EAAC,4BAA4E;CAbx2Q,CAAC;AAEF,eAAO,MAAM,oBAAoB;;yBAlC1B,gGAAoC,EAAC,4BAClB;0BAGmC,gHACrB,EAAC,4BACR;uBAWd,eACR,EAAC,4BAIL;0BAiBU,eAAkB,EAAC,+GAIR,EAAC,4BACI;6BAC6T,YAAe,EAAC,4BAAgE;0BAAib,+GAAmD,EAAC,4BAAgE;0BAAic,eAAkB,EAAC,+GAAmD,EAAC,4BAAyE;gCAA8e,YAAe,EAAC,2HAA+D,EAAC,4BAA+E;4BAAk4B,eAAkB,EAAC,mHAAuD,EAAC,4BAA2E;wBAAijB,eAAkB,EAAC,2GAA+C,EAAC,4BAAuE;4BAAwhD,mHAAuD,EAAC,4BAA2E;CAR9hL,CAAC;AAEF,eAAO,MAAM,sBAAsB;mBA9CL,0FAA8B,EAAC,4BACA;mBAKb,iGAC5B,EAAC,4BAAyD;oBAKzD,gBAAkB,EAAC,4BACf;mBASnB,gBACI,EAAC,4BAGE;mBAiB6B,gBAGrC,EAAE,iGACJ,EAAC,4BAGsC;CAFzC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,OAAO,gBAAgB,CAAC;AAC3D,cAAc,gCAAgC,CAAC"}
|
package/_types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.
|
|
1
|
+
export declare const version = "1.48.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -15,6 +15,7 @@ export interface SendTransactionResult {
|
|
|
15
15
|
* @param {SendTransactionOptions} options - Parameters for sending the Solana transaction.
|
|
16
16
|
* @param {string} options.network - The network to send the transaction to.
|
|
17
17
|
* @param {string} options.transaction - The base64 encoded transaction to send.
|
|
18
|
+
* @param {boolean} [options.useCdpSponsor] - Whether CDP should sponsor the transaction fees.
|
|
18
19
|
* @param {string} [options.idempotencyKey] - An idempotency key.
|
|
19
20
|
*
|
|
20
21
|
* @returns A promise that resolves to the transaction result.
|
|
@@ -24,6 +25,7 @@ export interface SendTransactionResult {
|
|
|
24
25
|
* const signature = await sendTransaction({
|
|
25
26
|
* network: "solana-devnet",
|
|
26
27
|
* transaction: "...",
|
|
28
|
+
* useCdpSponsor: true,
|
|
27
29
|
* });
|
|
28
30
|
* ```
|
|
29
31
|
*/
|
|
@@ -35,6 +37,7 @@ export async function sendTransaction(
|
|
|
35
37
|
{
|
|
36
38
|
network: options.network,
|
|
37
39
|
transaction: options.transaction,
|
|
40
|
+
useCdpSponsor: options.useCdpSponsor,
|
|
38
41
|
},
|
|
39
42
|
options.idempotencyKey,
|
|
40
43
|
);
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { CdpOpenApiClientType } from "../../openapi-client/index.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The supported wallet transaction webhook event types.
|
|
5
|
+
*/
|
|
6
|
+
export type WebhookEventType =
|
|
7
|
+
| "wallet.transaction.created"
|
|
8
|
+
| "wallet.transaction.broadcast"
|
|
9
|
+
| "wallet.transaction.pending"
|
|
10
|
+
| "wallet.transaction.replaced"
|
|
11
|
+
| "wallet.transaction.confirmed"
|
|
12
|
+
| "wallet.transaction.failed"
|
|
13
|
+
| "wallet.transaction.signed";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Options for creating a webhook subscription.
|
|
17
|
+
*/
|
|
18
|
+
export interface CreateWebhookSubscriptionOptions {
|
|
19
|
+
/** A description of the webhook subscription. */
|
|
20
|
+
description?: string;
|
|
21
|
+
/** The event types to subscribe to. */
|
|
22
|
+
eventTypes: WebhookEventType[];
|
|
23
|
+
/** The URL to deliver webhook events to. */
|
|
24
|
+
targetUrl: string;
|
|
25
|
+
/** Additional headers to include in webhook requests. */
|
|
26
|
+
targetHeaders?: Record<string, string>;
|
|
27
|
+
/** Whether the subscription is enabled. Defaults to `true`. */
|
|
28
|
+
isEnabled?: boolean;
|
|
29
|
+
/** Additional metadata for the subscription. */
|
|
30
|
+
metadata?: Record<string, string>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The result of creating a webhook subscription.
|
|
35
|
+
*/
|
|
36
|
+
export interface CreateWebhookSubscriptionResult {
|
|
37
|
+
/** The unique identifier for the subscription. */
|
|
38
|
+
subscriptionId: string;
|
|
39
|
+
/** The description of the webhook subscription. */
|
|
40
|
+
description?: string;
|
|
41
|
+
/** The event types the subscription is subscribed to. */
|
|
42
|
+
eventTypes: string[];
|
|
43
|
+
/** The webhook URL events are delivered to. */
|
|
44
|
+
targetUrl: string;
|
|
45
|
+
/** Additional headers included in webhook requests. */
|
|
46
|
+
targetHeaders?: Record<string, string>;
|
|
47
|
+
/** Whether the subscription is enabled. */
|
|
48
|
+
isEnabled: boolean;
|
|
49
|
+
/** Secret for webhook signature verification. */
|
|
50
|
+
secret: string;
|
|
51
|
+
/** When the subscription was created. */
|
|
52
|
+
createdAt: string;
|
|
53
|
+
/** When the subscription was last updated. */
|
|
54
|
+
updatedAt?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Creates a webhook subscription for wallet transaction events.
|
|
59
|
+
*
|
|
60
|
+
* @param client - The CDP OpenAPI client.
|
|
61
|
+
* @param options - The options for creating the webhook subscription.
|
|
62
|
+
* @returns The created webhook subscription.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const subscription = await createWebhookSubscription(client, {
|
|
67
|
+
* description: "Monitor wallet transactions",
|
|
68
|
+
* eventTypes: [
|
|
69
|
+
* "wallet.transaction.pending",
|
|
70
|
+
* "wallet.transaction.confirmed",
|
|
71
|
+
* "wallet.transaction.failed",
|
|
72
|
+
* ],
|
|
73
|
+
* targetUrl: "https://example.com/webhook",
|
|
74
|
+
* isEnabled: true,
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export async function createWebhookSubscription(
|
|
79
|
+
client: CdpOpenApiClientType,
|
|
80
|
+
options: CreateWebhookSubscriptionOptions,
|
|
81
|
+
): Promise<CreateWebhookSubscriptionResult> {
|
|
82
|
+
const response = await client.createWebhookSubscription({
|
|
83
|
+
description: options.description,
|
|
84
|
+
eventTypes: options.eventTypes,
|
|
85
|
+
target: {
|
|
86
|
+
url: options.targetUrl,
|
|
87
|
+
headers: options.targetHeaders,
|
|
88
|
+
},
|
|
89
|
+
isEnabled: options.isEnabled ?? true,
|
|
90
|
+
metadata: options.metadata,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
subscriptionId: response.subscriptionId,
|
|
95
|
+
description: response.description,
|
|
96
|
+
eventTypes: response.eventTypes,
|
|
97
|
+
targetUrl: response.target.url,
|
|
98
|
+
targetHeaders: response.target.headers,
|
|
99
|
+
isEnabled: response.isEnabled,
|
|
100
|
+
secret: response.secret,
|
|
101
|
+
createdAt: response.createdAt,
|
|
102
|
+
updatedAt: response.updatedAt,
|
|
103
|
+
};
|
|
104
|
+
}
|
package/client/cdp.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Analytics } from "../analytics.js";
|
|
2
2
|
import { CdpOpenApiClient } from "../openapi-client/index.js";
|
|
3
3
|
import { version } from "../version.js";
|
|
4
|
-
import {
|
|
4
|
+
import { EndUserClient } from "./end-user/endUser.js";
|
|
5
5
|
import { EvmClient } from "./evm/evm.js";
|
|
6
6
|
import { PoliciesClient } from "./policies/policies.js";
|
|
7
7
|
import { SolanaClient } from "./solana/solana.js";
|
|
8
|
+
import { WebhooksClient } from "./webhooks/webhooks.js";
|
|
8
9
|
|
|
9
10
|
export interface CdpClientOptions {
|
|
10
11
|
/** The API key ID. */
|
|
@@ -13,8 +14,6 @@ export interface CdpClientOptions {
|
|
|
13
14
|
apiKeySecret?: string;
|
|
14
15
|
/** The wallet secret. */
|
|
15
16
|
walletSecret?: string;
|
|
16
|
-
/** The CDP project ID. Required for end-user delegation operations (signing, sending). */
|
|
17
|
-
projectId?: string;
|
|
18
17
|
/** Whether to enable debugging. */
|
|
19
18
|
debugging?: boolean;
|
|
20
19
|
/** The host URL to connect to. */
|
|
@@ -35,7 +34,10 @@ export class CdpClient {
|
|
|
35
34
|
public policies: PoliciesClient;
|
|
36
35
|
|
|
37
36
|
/** Namespace containing all end user methods. */
|
|
38
|
-
public endUser:
|
|
37
|
+
public endUser: EndUserClient;
|
|
38
|
+
|
|
39
|
+
/** Namespace containing all webhook methods. */
|
|
40
|
+
public webhooks: WebhooksClient;
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
43
|
* The CdpClient is the main class for interacting with the CDP API.
|
|
@@ -52,7 +54,6 @@ export class CdpClient {
|
|
|
52
54
|
* CDP_API_KEY_ID=your-api-key-id
|
|
53
55
|
* CDP_API_KEY_SECRET=your-api-key-secret
|
|
54
56
|
* CDP_WALLET_SECRET=your-wallet-secret
|
|
55
|
-
* CDP_PROJECT_ID=your-project-id
|
|
56
57
|
* ```
|
|
57
58
|
*
|
|
58
59
|
* Or passed as options to the constructor:
|
|
@@ -62,7 +63,6 @@ export class CdpClient {
|
|
|
62
63
|
* apiKeyId: "your-api-key-id",
|
|
63
64
|
* apiKeySecret: "your-api-key-secret",
|
|
64
65
|
* walletSecret: "your-wallet-secret",
|
|
65
|
-
* projectId: "your-project-id",
|
|
66
66
|
* });
|
|
67
67
|
* ```
|
|
68
68
|
*
|
|
@@ -87,7 +87,6 @@ We recommend using https://github.com/Schniz/fnm for managing your Node.js versi
|
|
|
87
87
|
const apiKeyId = options.apiKeyId ?? process.env.CDP_API_KEY_ID ?? process.env.CDP_API_KEY_NAME;
|
|
88
88
|
const apiKeySecret = options.apiKeySecret ?? process.env.CDP_API_KEY_SECRET;
|
|
89
89
|
const walletSecret = options.walletSecret ?? process.env.CDP_WALLET_SECRET;
|
|
90
|
-
const projectId = options.projectId ?? process.env.CDP_PROJECT_ID;
|
|
91
90
|
|
|
92
91
|
if (!apiKeyId || !apiKeySecret) {
|
|
93
92
|
throw new Error(`
|
|
@@ -140,6 +139,7 @@ For more information, see: https://github.com/coinbase/cdp-sdk/blob/main/typescr
|
|
|
140
139
|
this.evm = new EvmClient();
|
|
141
140
|
this.solana = new SolanaClient();
|
|
142
141
|
this.policies = new PoliciesClient();
|
|
143
|
-
this.endUser = new
|
|
142
|
+
this.endUser = new EndUserClient();
|
|
143
|
+
this.webhooks = new WebhooksClient();
|
|
144
144
|
}
|
|
145
145
|
}
|