@coinbase/cdp-sdk 1.46.1 → 1.47.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 +6 -0
- package/README.md +50 -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 +4 -0
- package/_cjs/client/cdp.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/generated/coinbaseDeveloperPlatformAPIs.schemas.js +39 -43
- 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 +33 -1
- package/_cjs/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js.map +1 -1
- 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 +28 -1
- package/_cjs/openapi-client/generated/webhooks/webhooks.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 +4 -0
- package/_esm/client/cdp.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/generated/coinbaseDeveloperPlatformAPIs.schemas.js +36 -40
- 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 +32 -0
- package/_esm/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js.map +1 -1
- 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 +26 -0
- package/_esm/openapi-client/generated/webhooks/webhooks.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 +3 -0
- package/_types/client/cdp.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 +1 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +255 -452
- 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 +150 -1
- package/_types/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.d.ts.map +1 -1
- 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 +26 -1
- package/_types/openapi-client/generated/webhooks/webhooks.d.ts.map +1 -1
- package/_types/openapi-client/index.d.ts +46 -16
- 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 +5 -0
- 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 -0
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +293 -505
- package/openapi-client/generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.ts +154 -26
- 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 +38 -0
- package/package.json +1 -1
- package/version.ts +1 -1
|
@@ -12,23 +12,52 @@ export * from "./generated/onchain-data/onchain-data.js";
|
|
|
12
12
|
export * from "./generated/end-user-accounts/end-user-accounts.js";
|
|
13
13
|
export * from "./generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js";
|
|
14
14
|
export * from "./generated/x402-facilitator/x402-facilitator.js";
|
|
15
|
+
import * as embeddedWallets from "./generated/embedded-wallets-core-functionality/embedded-wallets-core-functionality.js";
|
|
15
16
|
export declare const CdpOpenApiClient: {
|
|
16
17
|
configure: (options: import("./cdpApiClient.js").CdpOptions) => void;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
SendEvmTransactionWithEndUserAccountBodyNetwork: {
|
|
19
|
+
readonly base: "base";
|
|
20
|
+
readonly "base-sepolia": "base-sepolia";
|
|
21
|
+
readonly ethereum: "ethereum";
|
|
22
|
+
readonly "ethereum-sepolia": "ethereum-sepolia";
|
|
23
|
+
readonly avalanche: "avalanche";
|
|
24
|
+
readonly polygon: "polygon";
|
|
25
|
+
readonly optimism: "optimism";
|
|
26
|
+
readonly arbitrum: "arbitrum";
|
|
27
|
+
};
|
|
28
|
+
SendEvmAssetWithEndUserAccountBodyNetwork: {
|
|
29
|
+
readonly base: "base";
|
|
30
|
+
readonly "base-sepolia": "base-sepolia";
|
|
31
|
+
readonly ethereum: "ethereum";
|
|
32
|
+
readonly "ethereum-sepolia": "ethereum-sepolia";
|
|
33
|
+
readonly avalanche: "avalanche";
|
|
34
|
+
readonly polygon: "polygon";
|
|
35
|
+
readonly optimism: "optimism";
|
|
36
|
+
readonly arbitrum: "arbitrum";
|
|
37
|
+
};
|
|
38
|
+
SendSolanaTransactionWithEndUserAccountBodyNetwork: {
|
|
39
|
+
readonly solana: "solana";
|
|
40
|
+
readonly "solana-devnet": "solana-devnet";
|
|
41
|
+
};
|
|
42
|
+
SendSolanaAssetWithEndUserAccountBodyNetwork: {
|
|
43
|
+
readonly solana: "solana";
|
|
44
|
+
readonly "solana-devnet": "solana-devnet";
|
|
45
|
+
};
|
|
46
|
+
signEvmHashWithEndUserAccount: (projectId: string, userId: string, signEvmHashWithEndUserAccountBody: embeddedWallets.SignEvmHashWithEndUserAccountBody, options?: string | undefined) => Promise<embeddedWallets.SignEvmHashWithEndUserAccount200>;
|
|
47
|
+
signEvmTransactionWithEndUserAccount: (projectId: string, userId: string, signEvmTransactionWithEndUserAccountBody: embeddedWallets.SignEvmTransactionWithEndUserAccountBody, options?: string | undefined) => Promise<embeddedWallets.SignEvmTransactionWithEndUserAccount200>;
|
|
48
|
+
sendEvmTransactionWithEndUserAccount: (projectId: string, userId: string, sendEvmTransactionWithEndUserAccountBody: embeddedWallets.SendEvmTransactionWithEndUserAccountBody, options?: string | undefined) => Promise<embeddedWallets.SendEvmTransactionWithEndUserAccount200>;
|
|
49
|
+
sendEvmAssetWithEndUserAccount: (projectId: string, userId: string, address: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").BlockchainAddress, asset: "usdc", sendEvmAssetWithEndUserAccountBody: embeddedWallets.SendEvmAssetWithEndUserAccountBody, options?: string | undefined) => Promise<embeddedWallets.SendEvmAssetWithEndUserAccount200>;
|
|
50
|
+
signEvmMessageWithEndUserAccount: (projectId: string, userId: string, signEvmMessageWithEndUserAccountBody: embeddedWallets.SignEvmMessageWithEndUserAccountBody, options?: string | undefined) => Promise<embeddedWallets.SignEvmMessageWithEndUserAccount200>;
|
|
51
|
+
signEvmTypedDataWithEndUserAccount: (projectId: string, userId: string, signEvmTypedDataWithEndUserAccountBody: embeddedWallets.SignEvmTypedDataWithEndUserAccountBody, options?: string | undefined) => Promise<embeddedWallets.SignEvmTypedDataWithEndUserAccount200>;
|
|
52
|
+
revokeDelegationForEndUser: (projectId: string, userId: string, revokeDelegationForEndUserBody: embeddedWallets.RevokeDelegationForEndUserBody, options?: string | undefined) => Promise<void>;
|
|
53
|
+
createEvmEip7702DelegationWithEndUserAccount: (projectId: string, userId: string, createEvmEip7702DelegationWithEndUserAccountBody: embeddedWallets.CreateEvmEip7702DelegationWithEndUserAccountBody, options?: string | undefined) => Promise<embeddedWallets.CreateEvmEip7702DelegationWithEndUserAccount201>;
|
|
54
|
+
sendUserOperationWithEndUserAccount: (projectId: string, userId: string, address: string, sendUserOperationWithEndUserAccountBody: embeddedWallets.SendUserOperationWithEndUserAccountBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
26
55
|
revokeSpendPermissionWithEndUserAccount: (projectId: string, userId: string, address: string, revokeSpendPermissionRequest: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").RevokeSpendPermissionRequest, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
27
|
-
signSolanaHashWithEndUserAccount: (projectId: string, userId: string, signSolanaHashWithEndUserAccountBody:
|
|
28
|
-
signSolanaMessageWithEndUserAccount: (projectId: string, userId: string, signSolanaMessageWithEndUserAccountBody:
|
|
29
|
-
signSolanaTransactionWithEndUserAccount: (projectId: string, userId: string, signSolanaTransactionWithEndUserAccountBody:
|
|
30
|
-
sendSolanaTransactionWithEndUserAccount: (projectId: string, userId: string, sendSolanaTransactionWithEndUserAccountBody:
|
|
31
|
-
sendSolanaAssetWithEndUserAccount: (projectId: string, userId: string, address: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").BlockchainAddress, asset: "usdc", sendSolanaAssetWithEndUserAccountBody:
|
|
56
|
+
signSolanaHashWithEndUserAccount: (projectId: string, userId: string, signSolanaHashWithEndUserAccountBody: embeddedWallets.SignSolanaHashWithEndUserAccountBody, options?: string | undefined) => Promise<embeddedWallets.SignSolanaHashWithEndUserAccount200>;
|
|
57
|
+
signSolanaMessageWithEndUserAccount: (projectId: string, userId: string, signSolanaMessageWithEndUserAccountBody: embeddedWallets.SignSolanaMessageWithEndUserAccountBody, options?: string | undefined) => Promise<embeddedWallets.SignSolanaMessageWithEndUserAccount200>;
|
|
58
|
+
signSolanaTransactionWithEndUserAccount: (projectId: string, userId: string, signSolanaTransactionWithEndUserAccountBody: embeddedWallets.SignSolanaTransactionWithEndUserAccountBody, options?: string | undefined) => Promise<embeddedWallets.SignSolanaTransactionWithEndUserAccount200>;
|
|
59
|
+
sendSolanaTransactionWithEndUserAccount: (projectId: string, userId: string, sendSolanaTransactionWithEndUserAccountBody: embeddedWallets.SendSolanaTransactionWithEndUserAccountBody, options?: string | undefined) => Promise<embeddedWallets.SendSolanaTransactionWithEndUserAccount200>;
|
|
60
|
+
sendSolanaAssetWithEndUserAccount: (projectId: string, userId: string, address: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").BlockchainAddress, asset: "usdc", sendSolanaAssetWithEndUserAccountBody: embeddedWallets.SendSolanaAssetWithEndUserAccountBody, options?: string | undefined) => Promise<embeddedWallets.SendSolanaAssetWithEndUserAccount200>;
|
|
32
61
|
createEndUser: (createEndUserBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEndUserBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EndUser>;
|
|
33
62
|
listEndUsers: (params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEndUsersParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEndUsers200>;
|
|
34
63
|
validateEndUserAccessToken: (validateEndUserAccessTokenBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ValidateEndUserAccessTokenBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EndUser>;
|
|
@@ -63,6 +92,7 @@ export declare const CdpOpenApiClient: {
|
|
|
63
92
|
getWebhookSubscription: (subscriptionId: string, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").WebhookSubscriptionResponse>;
|
|
64
93
|
updateWebhookSubscription: (subscriptionId: string, webhookSubscriptionUpdateRequest: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").WebhookSubscriptionUpdateRequest, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").WebhookSubscriptionResponse>;
|
|
65
94
|
deleteWebhookSubscription: (subscriptionId: string, options?: string | undefined) => Promise<void>;
|
|
95
|
+
listWebhookSubscriptionEvents: (subscriptionId: string, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListWebhookSubscriptionEventsParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").WebhookEventListResponse>;
|
|
66
96
|
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
97
|
getEvmSwapPrice: (params: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").GetEvmSwapPriceParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").GetSwapPriceResponseWrapper>;
|
|
68
98
|
createEvmSwapQuote: (createEvmSwapQuoteBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmSwapQuoteBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateSwapQuoteResponseWrapper>;
|
|
@@ -77,7 +107,7 @@ export declare const CdpOpenApiClient: {
|
|
|
77
107
|
sendUserOperation: (address: string, userOpHash: string, sendUserOperationBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendUserOperationBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
78
108
|
createSpendPermission: (address: string, createSpendPermissionRequest: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateSpendPermissionRequest, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
79
109
|
listSpendPermissions: (address: string, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListSpendPermissionsParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListSpendPermissions200>;
|
|
80
|
-
revokeSpendPermission: (address: string,
|
|
110
|
+
revokeSpendPermission: (address: string, revokeSpendPermissionRequest: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").RevokeSpendPermissionRequest, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
81
111
|
listEvmAccounts: (params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmAccountsParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmAccounts200>;
|
|
82
112
|
createEvmAccount: (createEvmAccountBody?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmAccountBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmAccount>;
|
|
83
113
|
getEvmAccount: (address: string, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmAccount>;
|
|
@@ -110,7 +140,7 @@ export declare const OpenApiEvmMethods: {
|
|
|
110
140
|
sendUserOperation: (address: string, userOpHash: string, sendUserOperationBody: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").SendUserOperationBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
111
141
|
createSpendPermission: (address: string, createSpendPermissionRequest: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateSpendPermissionRequest, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
112
142
|
listSpendPermissions: (address: string, params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListSpendPermissionsParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListSpendPermissions200>;
|
|
113
|
-
revokeSpendPermission: (address: string,
|
|
143
|
+
revokeSpendPermission: (address: string, revokeSpendPermissionRequest: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").RevokeSpendPermissionRequest, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmUserOperation>;
|
|
114
144
|
listEvmAccounts: (params?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmAccountsParams, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").ListEvmAccounts200>;
|
|
115
145
|
createEvmAccount: (createEvmAccountBody?: import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").CreateEvmAccountBody, options?: string | undefined) => Promise<import("./generated/coinbaseDeveloperPlatformAPIs.schemas.js").EvmAccount>;
|
|
116
146
|
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;AACrE,cAAc,oCAAoC,CAAC;AACnD,cAAc,sDAAsD,CAAC;AACrE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4DAA4D,CAAC;AAC3E,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0CAA0C,CAAC;AACzD,cAAc,oDAAoD,CAAC;AACnE,cAAc,wFAAwF,CAAC;AACvG,cAAc,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../openapi-client/index.ts"],"names":[],"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AC,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;CAb5xQ,CAAC;AAEF,eAAO,MAAM,oBAAoB;;yBApCkD,gGACnD,EAAC,4BACO;0BAGI,gHACP,EAAC,4BACT;uBAQpB,eACG,EAAC,4BAIb;0BAiBU,eACK,EAAC,+GAGL,EAAE,4BAII;6BAEiQ,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;CARl9K,CAAC;AAEF,eAAO,MAAM,sBAAsB;mBA9CL,0FAA8B,EAAC,4BACtC;mBAIoC,iGAClD,EAAC,4BACR;oBAIe,gBAAmB,EAAC,4BAChB;mBAMnB,gBACQ,EAAC,4BAGN;mBAmBY,gBAAmB,EAClC,iGACqB,EAAC,4BAGC;CAExB,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.47.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
|
@@ -5,6 +5,7 @@ import { CDPEndUserClient } 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. */
|
|
@@ -37,6 +38,9 @@ export class CdpClient {
|
|
|
37
38
|
/** Namespace containing all end user methods. */
|
|
38
39
|
public endUser: CDPEndUserClient;
|
|
39
40
|
|
|
41
|
+
/** Namespace containing all webhook methods. */
|
|
42
|
+
public webhooks: WebhooksClient;
|
|
43
|
+
|
|
40
44
|
/**
|
|
41
45
|
* The CdpClient is the main class for interacting with the CDP API.
|
|
42
46
|
*
|
|
@@ -141,5 +145,6 @@ For more information, see: https://github.com/coinbase/cdp-sdk/blob/main/typescr
|
|
|
141
145
|
this.solana = new SolanaClient();
|
|
142
146
|
this.policies = new PoliciesClient();
|
|
143
147
|
this.endUser = new CDPEndUserClient(projectId);
|
|
148
|
+
this.webhooks = new WebhooksClient();
|
|
144
149
|
}
|
|
145
150
|
}
|
package/client/solana/solana.ts
CHANGED
|
@@ -613,6 +613,7 @@ export class SolanaClient implements SolanaClientInterface {
|
|
|
613
613
|
* @param {SendTransactionOptions} options - Parameters for sending the Solana transaction.
|
|
614
614
|
* @param {string} options.network - The network to send the transaction to.
|
|
615
615
|
* @param {string} options.transaction - The base64 encoded transaction to send.
|
|
616
|
+
* @param {boolean} [options.useCdpSponsor] - Whether CDP should sponsor the transaction fees.
|
|
616
617
|
* @param {string} [options.idempotencyKey] - An idempotency key.
|
|
617
618
|
*
|
|
618
619
|
* @returns A promise that resolves to the transaction result.
|
|
@@ -622,6 +623,7 @@ export class SolanaClient implements SolanaClientInterface {
|
|
|
622
623
|
* const signature = await cdp.solana.sendTransaction({
|
|
623
624
|
* network: "solana-devnet",
|
|
624
625
|
* transaction: "...",
|
|
626
|
+
* useCdpSponsor: true,
|
|
625
627
|
* });
|
|
626
628
|
* ```
|
|
627
629
|
*/
|
|
@@ -201,6 +201,8 @@ export interface SendTransactionOptions {
|
|
|
201
201
|
network: SendSolanaTransactionBodyNetwork;
|
|
202
202
|
/** The base64 encoded transaction to send. */
|
|
203
203
|
transaction: string;
|
|
204
|
+
/** Whether CDP should sponsor the transaction fees. */
|
|
205
|
+
useCdpSponsor?: boolean;
|
|
204
206
|
/** The idempotency key. */
|
|
205
207
|
idempotencyKey?: string;
|
|
206
208
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Client
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
createWebhookSubscription,
|
|
7
|
+
CreateWebhookSubscriptionOptions,
|
|
8
|
+
CreateWebhookSubscriptionResult,
|
|
9
|
+
} from "../../actions/webhooks/createWebhookSubscription.js";
|
|
10
|
+
import { Analytics } from "../../analytics.js";
|
|
11
|
+
import { CdpOpenApiClient } from "../../openapi-client/index.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The namespace containing all webhook methods.
|
|
15
|
+
*/
|
|
16
|
+
export class WebhooksClient {
|
|
17
|
+
/**
|
|
18
|
+
* Creates a webhook subscription for wallet transaction events.
|
|
19
|
+
*
|
|
20
|
+
* @param {CreateWebhookSubscriptionOptions} options - Parameters for creating the webhook subscription.
|
|
21
|
+
* @param {string} [options.description] - A description of the webhook subscription.
|
|
22
|
+
* @param {WebhookEventType[]} options.eventTypes - The event types to subscribe to.
|
|
23
|
+
* @param {string} options.targetUrl - The URL to deliver webhook events to.
|
|
24
|
+
* @param {Record<string, string>} [options.targetHeaders] - Additional headers to include in webhook requests.
|
|
25
|
+
* @param {boolean} [options.isEnabled] - Whether the subscription is enabled. Defaults to `true`.
|
|
26
|
+
* @param {Record<string, string>} [options.metadata] - Additional metadata for the subscription.
|
|
27
|
+
*
|
|
28
|
+
* @returns A promise that resolves to the created webhook subscription.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const subscription = await cdp.webhooks.createSubscription({
|
|
33
|
+
* description: "Monitor wallet transactions",
|
|
34
|
+
* eventTypes: [
|
|
35
|
+
* "wallet.transaction.pending",
|
|
36
|
+
* "wallet.transaction.confirmed",
|
|
37
|
+
* "wallet.transaction.failed",
|
|
38
|
+
* ],
|
|
39
|
+
* targetUrl: "https://example.com/webhook",
|
|
40
|
+
* isEnabled: true,
|
|
41
|
+
* });
|
|
42
|
+
*
|
|
43
|
+
* console.log("Subscription ID:", subscription.subscriptionId);
|
|
44
|
+
* console.log("Secret:", subscription.secret);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
async createSubscription(
|
|
48
|
+
options: CreateWebhookSubscriptionOptions,
|
|
49
|
+
): Promise<CreateWebhookSubscriptionResult> {
|
|
50
|
+
Analytics.trackAction({
|
|
51
|
+
action: "create_webhook_subscription",
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
return await createWebhookSubscription(CdpOpenApiClient, options);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
Analytics.trackError(error, "createWebhookSubscription");
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
package/index.ts
CHANGED
|
@@ -51,4 +51,10 @@ export {
|
|
|
51
51
|
SPEND_PERMISSION_MANAGER_ADDRESS as spendPermissionManagerAddress,
|
|
52
52
|
} from "./spend-permissions/constants.js";
|
|
53
53
|
|
|
54
|
+
export type {
|
|
55
|
+
CreateWebhookSubscriptionOptions,
|
|
56
|
+
CreateWebhookSubscriptionResult,
|
|
57
|
+
WebhookEventType,
|
|
58
|
+
} from "./actions/webhooks/index.js";
|
|
59
|
+
|
|
54
60
|
export { parseEther, parseUnits } from "viem";
|