@coinbase/cdp-sdk 1.25.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +58 -2
- package/_cjs/accounts/evm/networkToChainResolver.js +68 -0
- package/_cjs/accounts/evm/networkToChainResolver.js.map +1 -0
- package/_cjs/accounts/evm/resolveViemClients.js +6 -32
- package/_cjs/accounts/evm/resolveViemClients.js.map +1 -1
- package/_cjs/accounts/evm/toEvmServerAccount.js +84 -0
- package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_cjs/accounts/evm/toEvmSmartAccount.js +93 -0
- package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js +19 -7
- package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
- package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js +65 -0
- package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
- package/_cjs/accounts/solana/toSolanaAccount.js +20 -0
- package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -1
- package/_cjs/actions/evm/fund/fund.js +3 -2
- package/_cjs/actions/evm/fund/fund.js.map +1 -1
- package/_cjs/actions/evm/fund/quoteFund.js +3 -2
- package/_cjs/actions/evm/fund/quoteFund.js.map +1 -1
- package/_cjs/actions/solana/sendTransaction.js +32 -0
- package/_cjs/actions/solana/sendTransaction.js.map +1 -0
- package/_cjs/analytics.js +39 -3
- package/_cjs/analytics.js.map +1 -1
- package/_cjs/auth/utils/jwt.js +6 -5
- package/_cjs/auth/utils/jwt.js.map +1 -1
- package/_cjs/client/cdp.js +4 -1
- package/_cjs/client/cdp.js.map +1 -1
- package/_cjs/client/evm/evm.js +116 -10
- package/_cjs/client/evm/evm.js.map +1 -1
- package/_cjs/client/policies/policies.js +22 -0
- package/_cjs/client/policies/policies.js.map +1 -1
- package/_cjs/client/solana/solana.js +85 -8
- package/_cjs/client/solana/solana.js.map +1 -1
- package/_cjs/constants.js +1 -1
- package/_cjs/constants.js.map +1 -1
- package/_cjs/errors.js +19 -1
- package/_cjs/errors.js.map +1 -1
- package/_cjs/index.js +3 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/openapi-client/cdpApiClient.js +46 -6
- package/_cjs/openapi-client/cdpApiClient.js.map +1 -1
- package/_cjs/openapi-client/errors.js +38 -9
- package/_cjs/openapi-client/errors.js.map +1 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +6 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.js +34 -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 +18 -1
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/accounts/evm/networkToChainResolver.js +31 -0
- package/_esm/accounts/evm/networkToChainResolver.js.map +1 -0
- package/_esm/accounts/evm/resolveViemClients.js +4 -30
- package/_esm/accounts/evm/resolveViemClients.js.map +1 -1
- package/_esm/accounts/evm/toEvmServerAccount.js +84 -0
- package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
- package/_esm/accounts/evm/toEvmSmartAccount.js +93 -0
- package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js +19 -7
- package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
- package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js +65 -0
- package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
- package/_esm/accounts/solana/toSolanaAccount.js +20 -0
- package/_esm/accounts/solana/toSolanaAccount.js.map +1 -1
- package/_esm/actions/evm/fund/fund.js +3 -2
- package/_esm/actions/evm/fund/fund.js.map +1 -1
- package/_esm/actions/evm/fund/quoteFund.js +3 -2
- package/_esm/actions/evm/fund/quoteFund.js.map +1 -1
- package/_esm/actions/solana/sendTransaction.js +29 -0
- package/_esm/actions/solana/sendTransaction.js.map +1 -0
- package/_esm/analytics.js +39 -3
- package/_esm/analytics.js.map +1 -1
- package/_esm/auth/utils/jwt.js +3 -2
- package/_esm/auth/utils/jwt.js.map +1 -1
- package/_esm/client/cdp.js +4 -1
- package/_esm/client/cdp.js.map +1 -1
- package/_esm/client/evm/evm.js +110 -4
- package/_esm/client/evm/evm.js.map +1 -1
- package/_esm/client/policies/policies.js +22 -0
- package/_esm/client/policies/policies.js.map +1 -1
- package/_esm/client/solana/solana.js +82 -5
- package/_esm/client/solana/solana.js.map +1 -1
- package/_esm/constants.js +1 -1
- package/_esm/constants.js.map +1 -1
- package/_esm/errors.js +17 -0
- package/_esm/errors.js.map +1 -1
- package/_esm/index.js +1 -0
- package/_esm/index.js.map +1 -1
- package/_esm/openapi-client/cdpApiClient.js +47 -7
- package/_esm/openapi-client/cdpApiClient.js.map +1 -1
- package/_esm/openapi-client/errors.js +36 -8
- package/_esm/openapi-client/errors.js.map +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +5 -0
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js +32 -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 +15 -0
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/accounts/evm/networkToChainResolver.d.ts +14 -0
- package/_types/accounts/evm/networkToChainResolver.d.ts.map +1 -0
- package/_types/accounts/evm/resolveViemClients.d.ts.map +1 -1
- package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
- package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
- package/_types/accounts/evm/toNetworkScopedEvmServerAccount.d.ts.map +1 -1
- package/_types/accounts/evm/toNetworkScopedEvmSmartAccount.d.ts.map +1 -1
- package/_types/accounts/evm/types.d.ts +3 -3
- package/_types/accounts/evm/types.d.ts.map +1 -1
- package/_types/accounts/solana/toSolanaAccount.d.ts.map +1 -1
- package/_types/actions/evm/fund/fund.d.ts.map +1 -1
- package/_types/actions/evm/fund/quoteFund.d.ts.map +1 -1
- package/_types/actions/evm/types.d.ts +36 -3
- package/_types/actions/evm/types.d.ts.map +1 -1
- package/_types/actions/solana/sendTransaction.d.ts +23 -0
- package/_types/actions/solana/sendTransaction.d.ts.map +1 -0
- package/_types/analytics.d.ts +36 -1
- package/_types/analytics.d.ts.map +1 -1
- package/_types/auth/utils/jwt.d.ts.map +1 -1
- package/_types/client/cdp.d.ts.map +1 -1
- package/_types/client/evm/evm.d.ts +1 -0
- package/_types/client/evm/evm.d.ts.map +1 -1
- package/_types/client/policies/policies.d.ts.map +1 -1
- package/_types/client/solana/solana.d.ts +21 -2
- package/_types/client/solana/solana.d.ts.map +1 -1
- package/_types/client/solana/solana.types.d.ts +22 -3
- package/_types/client/solana/solana.types.d.ts.map +1 -1
- package/_types/constants.d.ts +1 -1
- package/_types/constants.d.ts.map +1 -1
- package/_types/errors.d.ts +11 -0
- package/_types/errors.d.ts.map +1 -1
- package/_types/index.d.ts +1 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/openapi-client/cdpApiClient.d.ts.map +1 -1
- package/_types/openapi-client/errors.d.ts +46 -9
- package/_types/openapi-client/errors.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +18 -0
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts +27 -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 +3 -1
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts.map +1 -1
- package/_types/openapi-client/index.d.ts +2 -0
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/accounts/evm/networkToChainResolver.ts +34 -0
- package/accounts/evm/resolveViemClients.ts +6 -32
- package/accounts/evm/toEvmServerAccount.ts +98 -0
- package/accounts/evm/toEvmSmartAccount.ts +114 -2
- package/accounts/evm/toNetworkScopedEvmServerAccount.ts +22 -8
- package/accounts/evm/toNetworkScopedEvmSmartAccount.ts +75 -0
- package/accounts/evm/types.ts +3 -3
- package/accounts/solana/toSolanaAccount.ts +24 -0
- package/actions/evm/fund/fund.ts +3 -2
- package/actions/evm/fund/quoteFund.ts +3 -2
- package/actions/evm/types.ts +41 -2
- package/actions/solana/sendTransaction.ts +38 -0
- package/analytics.ts +73 -4
- package/auth/utils/jwt.ts +5 -2
- package/client/cdp.ts +7 -1
- package/client/evm/evm.ts +135 -6
- package/client/policies/policies.ts +28 -0
- package/client/solana/solana.ts +97 -5
- package/client/solana/solana.types.ts +25 -1
- package/constants.ts +1 -1
- package/errors.ts +18 -0
- package/index.ts +1 -0
- package/openapi-client/cdpApiClient.ts +87 -17
- package/openapi-client/errors.ts +65 -10
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +24 -0
- package/openapi-client/generated/solana-accounts/solana-accounts.msw.ts +32 -0
- package/openapi-client/generated/solana-accounts/solana-accounts.ts +43 -0
- package/package.json +1 -1
- package/version.ts +1 -1
|
@@ -4,7 +4,8 @@ import { QuoteFundOptions } from "./fund/quoteFund.js";
|
|
|
4
4
|
import { FundOperationResult } from "./fund/types.js";
|
|
5
5
|
import { WaitForFundOperationOptions, WaitForFundOperationResult } from "./fund/waitForFundOperationReceipt.js";
|
|
6
6
|
import { SendUserOperationOptions, SendUserOperationReturnType } from "./sendUserOperation.js";
|
|
7
|
-
import {
|
|
7
|
+
import { KnownEvmNetworks } from "../../accounts/evm/types.js";
|
|
8
|
+
import { GetUserOperationOptions, SignTypedDataOptions, UserOperation } from "../../client/evm/evm.types.js";
|
|
8
9
|
import { Hex } from "../../types/misc.js";
|
|
9
10
|
import type { ListTokenBalancesOptions, ListTokenBalancesResult } from "./listTokenBalances.js";
|
|
10
11
|
import type { RequestFaucetOptions, RequestFaucetResult } from "./requestFaucet.js";
|
|
@@ -12,7 +13,7 @@ import type { SendTransactionOptions, TransactionResult } from "./sendTransactio
|
|
|
12
13
|
import type { AccountSwapOptions, AccountSwapResult, AccountQuoteSwapOptions, AccountQuoteSwapResult, SmartAccountSwapOptions, SmartAccountSwapResult, SmartAccountQuoteSwapOptions, SmartAccountQuoteSwapResult } from "./swap/types.js";
|
|
13
14
|
import type { SmartAccountTransferOptions, TransferOptions } from "./transfer/types.js";
|
|
14
15
|
import type { WaitForUserOperationOptions, WaitForUserOperationReturnType } from "./waitForUserOperation.js";
|
|
15
|
-
type Actions = {
|
|
16
|
+
export type Actions = {
|
|
16
17
|
/**
|
|
17
18
|
* List the token balances of an account.
|
|
18
19
|
*
|
|
@@ -562,6 +563,38 @@ export type SmartAccountActions = Actions & {
|
|
|
562
563
|
* ```
|
|
563
564
|
*/
|
|
564
565
|
swap: (options: SmartAccountSwapOptions) => Promise<SmartAccountSwapResult>;
|
|
566
|
+
/**
|
|
567
|
+
* Signs a typed data message.
|
|
568
|
+
*
|
|
569
|
+
* @param {SignTypedDataOptions} options - Configuration options for signing the typed data.
|
|
570
|
+
* @param {string} options.network - The network to sign the typed data on
|
|
571
|
+
* @param {string} options.typedData - The typed data to sign
|
|
572
|
+
*
|
|
573
|
+
* @returns A promise that resolves to the signature.
|
|
574
|
+
*
|
|
575
|
+
* @example
|
|
576
|
+
* ```ts
|
|
577
|
+
* const signature = await smartAccount.signTypedData({
|
|
578
|
+
* network: "base-sepolia",
|
|
579
|
+
* typedData: {
|
|
580
|
+
* domain: {
|
|
581
|
+
* name: "Test",
|
|
582
|
+
* chainId: 84532,
|
|
583
|
+
* verifyingContract: "0x0000000000000000000000000000000000000000",
|
|
584
|
+
* },
|
|
585
|
+
* types: {
|
|
586
|
+
* Test: [{ name: "name", type: "string" }],
|
|
587
|
+
* },
|
|
588
|
+
* primaryType: "Test",
|
|
589
|
+
* message: {
|
|
590
|
+
* name: "John Doe",
|
|
591
|
+
* },
|
|
592
|
+
* },
|
|
593
|
+
* });
|
|
594
|
+
* ```
|
|
595
|
+
*/
|
|
596
|
+
signTypedData: (options: Omit<SignTypedDataOptions, "address"> & {
|
|
597
|
+
network: KnownEvmNetworks;
|
|
598
|
+
}) => Promise<Hex>;
|
|
565
599
|
};
|
|
566
|
-
export {};
|
|
567
600
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../actions/evm/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../actions/evm/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO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../openapi-client/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Sends a Solana transaction using the Coinbase API.
|
|
5
|
+
*
|
|
6
|
+
* @param {CdpOpenApiClientType} apiClient - The API client to use.
|
|
7
|
+
* @param {SendTransactionOptions} options - Parameters for sending the Solana transaction.
|
|
8
|
+
* @param {string} options.network - The network to send the transaction to.
|
|
9
|
+
* @param {string} options.transaction - The base64 encoded transaction to send.
|
|
10
|
+
* @param {string} [options.idempotencyKey] - An idempotency key.
|
|
11
|
+
*
|
|
12
|
+
* @returns A promise that resolves to the transaction result.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const signature = await sendTransaction({
|
|
17
|
+
* network: "solana-devnet",
|
|
18
|
+
* transaction: "...",
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function sendTransaction(apiClient: CdpOpenApiClientType, options: SendTransactionOptions): Promise<TransactionResult>;
|
|
23
|
+
//# sourceMappingURL=sendTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendTransaction.d.ts","sourceRoot":"","sources":["../../../actions/solana/sendTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CAY5B"}
|
package/_types/analytics.d.ts
CHANGED
|
@@ -19,12 +19,34 @@ type ErrorEventData = {
|
|
|
19
19
|
*/
|
|
20
20
|
name: "error";
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The data in an action event
|
|
24
|
+
*/
|
|
25
|
+
type ActionEventData = {
|
|
26
|
+
/**
|
|
27
|
+
* The operation being performed, e.g. "transfer", "swap", "fund", "requestFaucet"
|
|
28
|
+
*/
|
|
29
|
+
action: string;
|
|
30
|
+
/**
|
|
31
|
+
* The account type, e.g. "evm-server", "evm-smart", "solana"
|
|
32
|
+
*/
|
|
33
|
+
accountType?: "evm_server" | "evm_smart" | "solana";
|
|
34
|
+
/**
|
|
35
|
+
* Additional properties specific to the action
|
|
36
|
+
*/
|
|
37
|
+
properties?: Record<string, unknown>;
|
|
38
|
+
/**
|
|
39
|
+
* The name of the event
|
|
40
|
+
*/
|
|
41
|
+
name: "action";
|
|
42
|
+
};
|
|
43
|
+
type EventData = ErrorEventData | ActionEventData;
|
|
23
44
|
export declare const Analytics: {
|
|
24
45
|
identifier: string;
|
|
25
46
|
wrapClassWithErrorTracking: typeof wrapClassWithErrorTracking;
|
|
26
47
|
wrapObjectMethodsWithErrorTracking: typeof wrapObjectMethodsWithErrorTracking;
|
|
27
48
|
sendEvent: typeof sendEvent;
|
|
49
|
+
trackAction: typeof trackAction;
|
|
28
50
|
};
|
|
29
51
|
/**
|
|
30
52
|
* Sends an analytics event to the default endpoint
|
|
@@ -33,6 +55,19 @@ export declare const Analytics: {
|
|
|
33
55
|
* @returns Promise that resolves when the event is sent
|
|
34
56
|
*/
|
|
35
57
|
declare function sendEvent(event: EventData): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Track an action being performed
|
|
60
|
+
*
|
|
61
|
+
* @param params - The parameters for tracking an action
|
|
62
|
+
* @param params.action - The action being performed
|
|
63
|
+
* @param params.accountType - The type of account
|
|
64
|
+
* @param params.properties - Additional properties
|
|
65
|
+
*/
|
|
66
|
+
declare function trackAction(params: {
|
|
67
|
+
action: string;
|
|
68
|
+
accountType?: "evm_server" | "evm_smart" | "solana";
|
|
69
|
+
properties?: Record<string, unknown>;
|
|
70
|
+
}): void;
|
|
36
71
|
/**
|
|
37
72
|
* Wraps all methods of a class with error tracking.
|
|
38
73
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../analytics.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../analytics.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,KAAK,cAAc,GAAG;IACpB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,KAAK,eAAe,GAAG;IACrB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;IACpD;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,KAAK,SAAS,GAAG,cAAc,GAAG,eAAe,CAAC;AAKlD,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AAEF;;;;;GAKG;AACH,iBAAe,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAgDxD;AAED;;;;;;;GAOG;AACH,iBAAS,WAAW,CAAC,MAAM,EAAE;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC,GAAG,IAAI,CAmBP;AAED;;;;GAIG;AAEH,iBAAS,0BAA0B,CAAC,WAAW,EAAE,GAAG,GAAG,IAAI,CAkC1D;AAED;;;;GAIG;AAEH,iBAAS,kCAAkC,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAkC7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../../auth/utils/jwt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../../auth/utils/jwt.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IAEH,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAmEtE;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoClF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdp.d.ts","sourceRoot":"","sources":["../../client/c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;;GAEG;AACH,qBAAa,SAAS;IACpB,4CAA4C;IACrC,GAAG,EAAE,SAAS,CAAC;IAEtB,+CAA+C;IACxC,MAAM,EAAE,YAAY,CAAC;IAE5B,iDAAiD;IAC1C,QAAQ,EAAE,cAAc,CAAC;IAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;gBACS,OAAO,GAAE,gBAAqB;CAyE3C"}
|
|
@@ -381,6 +381,7 @@ export declare class EvmClient implements EvmClientInterface {
|
|
|
381
381
|
* while (page.nextPageToken) {
|
|
382
382
|
* page = await cdp.evm.listSmartAccounts({ pageToken: page.nextPageToken });
|
|
383
383
|
* }
|
|
384
|
+
* ```
|
|
384
385
|
*/
|
|
385
386
|
listSmartAccounts(options?: ListSmartAccountsOptions): Promise<ListSmartAccountResult>;
|
|
386
387
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../client/evm/evm.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,0BAA0B,EAC1B,+BAA+B,EAC/B,8BAA8B,EAC9B,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAC3B,aAAa,EACb,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,EAC5B,aAAa,EACb,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAEL,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAEL,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,oCAAoC,CAA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;;;;OAwCG;IACG,aAAa,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,aAAa,CAAC;IAoB7E;;;;;;;;;;;OAWG;IACG,kBAAkB,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,YAAY,CAAC;IAqBtF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACG,oBAAoB,CACxB,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,8BAA8B,CAAC;CAS3C"}
|
|
@@ -1 +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;
|
|
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;AAQ7B,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;IAWlF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmEG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;IAiBjE;;;;;;;;;;;;;;;;;OAiBG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IAQnE;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;CAalE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateAccountOptions, ExportAccountOptions, GetAccountOptions, GetOrCreateAccountOptions, ImportAccountOptions, ListAccountsOptions, ListAccountsResult, ListTokenBalancesOptions, ListTokenBalancesResult, RequestFaucetOptions, SignatureResult, SignMessageOptions, SignTransactionOptions, SolanaClientInterface, UpdateSolanaAccountOptions } from "./solana.types.js";
|
|
1
|
+
import { CreateAccountOptions, ExportAccountOptions, GetAccountOptions, GetOrCreateAccountOptions, ImportAccountOptions, ListAccountsOptions, ListAccountsResult, ListTokenBalancesOptions, ListTokenBalancesResult, RequestFaucetOptions, SendTransactionOptions, SignatureResult, SignMessageOptions, SignTransactionOptions, SolanaClientInterface, TransactionResult, UpdateSolanaAccountOptions } from "./solana.types.js";
|
|
2
2
|
import { SolanaAccount } from "../../accounts/solana/types.js";
|
|
3
3
|
/**
|
|
4
4
|
* The namespace containing all Solana methods.
|
|
@@ -288,12 +288,31 @@ export declare class SolanaClient implements SolanaClientInterface {
|
|
|
288
288
|
* ```
|
|
289
289
|
*/
|
|
290
290
|
updateAccount(options: UpdateSolanaAccountOptions): Promise<SolanaAccount>;
|
|
291
|
+
/**
|
|
292
|
+
* Sends a Solana transaction using the Coinbase API.
|
|
293
|
+
*
|
|
294
|
+
* @param {SendTransactionOptions} options - Parameters for sending the Solana transaction.
|
|
295
|
+
* @param {string} options.network - The network to send the transaction to.
|
|
296
|
+
* @param {string} options.transaction - The base64 encoded transaction to send.
|
|
297
|
+
* @param {string} [options.idempotencyKey] - An idempotency key.
|
|
298
|
+
*
|
|
299
|
+
* @returns A promise that resolves to the transaction result.
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* ```ts
|
|
303
|
+
* const signature = await cdp.solana.sendTransaction({
|
|
304
|
+
* network: "solana-devnet",
|
|
305
|
+
* transaction: "...",
|
|
306
|
+
* });
|
|
307
|
+
* ```
|
|
308
|
+
*/
|
|
309
|
+
sendTransaction(options: SendTransactionOptions): Promise<TransactionResult>;
|
|
291
310
|
/**
|
|
292
311
|
* Lists the token balances for a Solana account.
|
|
293
312
|
*
|
|
294
313
|
* @param {ListTokenBalancesOptions} options - Parameters for listing the Solana token balances.
|
|
295
314
|
* @param {string} options.address - The address of the account to list token balances for.
|
|
296
|
-
* @param {string} options.network - The network to list token balances for.
|
|
315
|
+
* @param {string} [options.network] - The network to list token balances for. Defaults to "solana".
|
|
297
316
|
* @param {number} [options.pageSize] - The number of token balances to return.
|
|
298
317
|
* @param {string} [options.pageToken] - The page token to begin listing from.
|
|
299
318
|
* This is obtained by previous calls to this method.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../client/solana/solana.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../client/solana/solana.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,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;IACG,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAShF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACG,aAAa,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,aAAa,CAAC;IAqBhF;;;;;;;;;;;;;;;;;OAiBG;IACG,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAYlF;;;;;;;;;;;;;;;;OAgBG;IACG,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAmC7F"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Account, SolanaAccount } from "../../accounts/solana/types.js";
|
|
2
|
-
import { ListSolanaTokenBalancesNetwork, OpenApiSolanaMethods, UpdateSolanaAccountBody } from "../../openapi-client/index.js";
|
|
2
|
+
import { ListSolanaTokenBalancesNetwork, OpenApiSolanaMethods, SendSolanaTransactionBody, SendSolanaTransactionBodyNetwork, UpdateSolanaAccountBody } from "../../openapi-client/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* The SolanaClient type, where all OpenApiSolanaMethods methods are wrapped.
|
|
5
5
|
*/
|
|
6
|
-
export type SolanaClientInterface = Omit<typeof OpenApiSolanaMethods, "createSolanaAccount" | "getSolanaAccount" | "getSolanaAccountByName" | "updateSolanaAccount" | "listSolanaAccounts" | "requestSolanaFaucet" | "signSolanaMessage" | "signSolanaTransaction" | "updateSolanaAccount" | "exportSolanaAccount" | "exportSolanaAccountByName" | "importSolanaAccount" | "listSolanaTokenBalances"> & {
|
|
6
|
+
export type SolanaClientInterface = Omit<typeof OpenApiSolanaMethods, "createSolanaAccount" | "getSolanaAccount" | "getSolanaAccountByName" | "updateSolanaAccount" | "listSolanaAccounts" | "requestSolanaFaucet" | "signSolanaMessage" | "signSolanaTransaction" | "updateSolanaAccount" | "exportSolanaAccount" | "exportSolanaAccountByName" | "importSolanaAccount" | "listSolanaTokenBalances" | "sendSolanaTransaction"> & {
|
|
7
7
|
createAccount: (options: CreateAccountOptions) => Promise<Account>;
|
|
8
8
|
exportAccount: (options: ExportAccountOptions) => Promise<string>;
|
|
9
9
|
importAccount: (options: ImportAccountOptions) => Promise<SolanaAccount>;
|
|
@@ -15,6 +15,7 @@ export type SolanaClientInterface = Omit<typeof OpenApiSolanaMethods, "createSol
|
|
|
15
15
|
signMessage: (options: SignMessageOptions) => Promise<SignatureResult>;
|
|
16
16
|
signTransaction: (options: SignTransactionOptions) => Promise<SignatureResult>;
|
|
17
17
|
listTokenBalances: (options: ListTokenBalancesOptions) => Promise<ListTokenBalancesResult>;
|
|
18
|
+
sendTransaction: (options: SendSolanaTransactionBody) => Promise<SignatureResult>;
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
20
21
|
* A Solana signature result.
|
|
@@ -145,12 +146,30 @@ export interface ListTokenBalancesOptions {
|
|
|
145
146
|
/** The address of the account. */
|
|
146
147
|
address: string;
|
|
147
148
|
/** The network to list token balances for. */
|
|
148
|
-
network
|
|
149
|
+
network?: ListSolanaTokenBalancesNetwork;
|
|
149
150
|
/** The page size. */
|
|
150
151
|
pageSize?: number;
|
|
151
152
|
/** The page token. */
|
|
152
153
|
pageToken?: string;
|
|
153
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Options for sending a Solana transaction.
|
|
157
|
+
*/
|
|
158
|
+
export interface SendTransactionOptions {
|
|
159
|
+
/** The network to send the transaction to. */
|
|
160
|
+
network: SendSolanaTransactionBodyNetwork;
|
|
161
|
+
/** The base64 encoded transaction to send. */
|
|
162
|
+
transaction: string;
|
|
163
|
+
/** The idempotency key. */
|
|
164
|
+
idempotencyKey?: string;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The result of sending a Solana transaction.
|
|
168
|
+
*/
|
|
169
|
+
export interface TransactionResult {
|
|
170
|
+
/** The signature of the transaction base58 encoded. */
|
|
171
|
+
signature: string;
|
|
172
|
+
}
|
|
154
173
|
export interface SolanaTokenAmount {
|
|
155
174
|
/** The amount of the token. */
|
|
156
175
|
amount: bigint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana.types.d.ts","sourceRoot":"","sources":["../../../client/solana/solana.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EACL,8BAA8B,EAC9B,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,OAAO,oBAAoB,EACzB,qBAAqB,GACrB,kBAAkB,GAClB,wBAAwB,GACxB,qBAAqB,GACrB,oBAAoB,GACpB,qBAAqB,GACrB,mBAAmB,GACnB,uBAAuB,GACvB,qBAAqB,GACrB,qBAAqB,GACrB,2BAA2B,GAC3B,qBAAqB,GACrB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"solana.types.d.ts","sourceRoot":"","sources":["../../../client/solana/solana.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EACL,8BAA8B,EAC9B,oBAAoB,EACpB,yBAAyB,EACzB,gCAAgC,EAChC,uBAAuB,EACxB,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,OAAO,oBAAoB,EACzB,qBAAqB,GACrB,kBAAkB,GAClB,wBAAwB,GACxB,qBAAqB,GACrB,oBAAoB,GACpB,qBAAqB,GACrB,mBAAmB,GACnB,uBAAuB,GACvB,qBAAqB,GACrB,qBAAqB,GACrB,2BAA2B,GAC3B,qBAAqB,GACrB,yBAAyB,GACzB,uBAAuB,CAC1B,GAAG;IACF,aAAa,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,OAAO,CAAC,CAA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;IACd,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,iBAAiB;IACjB,KAAK,EAAE,WAAW,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,0BAA0B;IAC1B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
package/_types/constants.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The URL to the Coinbase CDP API error docs page.
|
|
3
3
|
*/
|
|
4
|
-
export declare const ERROR_DOCS_PAGE_URL = "https://docs.cdp.coinbase.com/api-v2/
|
|
4
|
+
export declare const ERROR_DOCS_PAGE_URL = "https://docs.cdp.coinbase.com/api-reference/v2/errors";
|
|
5
5
|
/**
|
|
6
6
|
* The public RSA key used to encrypt the private key when importing an EVM or Solana account.
|
|
7
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,mBAAmB,0DAA0D,CAAC;AAE3F;;GAEG;AACH,eAAO,MAAM,yBAAyB,izBAab,CAAC"}
|
package/_types/errors.d.ts
CHANGED
|
@@ -9,4 +9,15 @@ export declare class TimeoutError extends Error {
|
|
|
9
9
|
*/
|
|
10
10
|
constructor(message?: string);
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* UserInputValidationError is thrown when validation of a user-supplied input fails.
|
|
14
|
+
*/
|
|
15
|
+
export declare class UserInputValidationError extends Error {
|
|
16
|
+
/**
|
|
17
|
+
* Initializes a new UserInputValidationError instance.
|
|
18
|
+
*
|
|
19
|
+
* @param message - The user input validation error message.
|
|
20
|
+
*/
|
|
21
|
+
constructor(message: string);
|
|
22
|
+
}
|
|
12
23
|
//# sourceMappingURL=errors.d.ts.map
|
package/_types/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC;;;;OAIG;gBACS,OAAO,GAAE,MAAwB;CAO9C"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC;;;;OAIG;gBACS,OAAO,GAAE,MAAwB;CAO9C;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IACjD;;;;OAIG;gBACS,OAAO,EAAE,MAAM;CAO5B"}
|
package/_types/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export { CdpClient } from "./client/cdp.js";
|
|
|
2
2
|
export type { EvmServerAccount, EvmSmartAccount } from "./accounts/evm/types.js";
|
|
3
3
|
export type { Policy } from "./policies/types.js";
|
|
4
4
|
export { CreatePolicyBodySchema, UpdatePolicyBodySchema, type CreatePolicyBody, type UpdatePolicyBody, } from "./policies/schema.js";
|
|
5
|
+
export { NetworkError } from "./openapi-client/errors.js";
|
|
5
6
|
export { parseEther } from "viem";
|
|
6
7
|
//# 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,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;
|
|
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;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdpApiClient.d.ts","sourceRoot":"","sources":["../../openapi-client/cdpApiClient.ts"],"names":[],"mappings":"AACA,OAAc,EAAiB,kBAAkB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"cdpApiClient.d.ts","sourceRoot":"","sources":["../../openapi-client/cdpApiClient.ts"],"names":[],"mappings":"AACA,OAAc,EAAiB,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAMjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAIF,eAAO,IAAI,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SACxE,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,SAAS,UAAU,SAqB5C,CAAC;AA0BF;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAU,CAAC,EAClC,QAAQ,kBAAkB,EAC1B,iBAAiB,MAAM,KACtB,OAAO,CAAC,CAAC,CAkLX,CAAC"}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { Error as OpenAPIError, ErrorType as OpenAPIErrorType } from "./generated/coinbaseDeveloperPlatformAPIs.schemas.js";
|
|
2
|
-
export
|
|
3
|
-
readonly unexpected_error: "unexpected_error";
|
|
4
|
-
readonly unauthorized: "unauthorized";
|
|
5
|
-
readonly not_found: "not_found";
|
|
6
|
-
readonly bad_gateway: "bad_gateway";
|
|
7
|
-
readonly service_unavailable: "service_unavailable";
|
|
8
|
-
readonly unknown: "unknown";
|
|
9
|
-
};
|
|
10
|
-
export type HttpErrorType = (typeof HttpErrorType)[keyof typeof HttpErrorType];
|
|
2
|
+
export type HttpErrorType = "unexpected_error" | "unauthorized" | "not_found" | "bad_gateway" | "service_unavailable" | "unknown" | "network_timeout" | "network_connection_failed" | "network_ip_blocked" | "network_dns_failure";
|
|
11
3
|
/**
|
|
12
4
|
* Extended error codes that include both OpenAPI errors and network errors
|
|
13
5
|
*/
|
|
@@ -71,6 +63,51 @@ export declare class UnknownError extends Error {
|
|
|
71
63
|
*/
|
|
72
64
|
constructor(message: string, cause?: Error);
|
|
73
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Error thrown when a network-level failure occurs before reaching the CDP service
|
|
68
|
+
* This includes gateway errors, IP blocklist rejections, DNS failures, etc.
|
|
69
|
+
*/
|
|
70
|
+
export declare class NetworkError extends APIError {
|
|
71
|
+
networkDetails?: {
|
|
72
|
+
code?: string;
|
|
73
|
+
message?: string;
|
|
74
|
+
retryable?: boolean;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Constructor for the NetworkError class
|
|
78
|
+
*
|
|
79
|
+
* @param errorType - The type of network error
|
|
80
|
+
* @param errorMessage - The error message
|
|
81
|
+
* @param networkDetails - Additional network error details
|
|
82
|
+
* @param networkDetails.code - The error code
|
|
83
|
+
* @param networkDetails.message - The error message
|
|
84
|
+
* @param networkDetails.retryable - Whether the error is retryable
|
|
85
|
+
* @param cause - The cause of the error
|
|
86
|
+
*/
|
|
87
|
+
constructor(errorType: HttpErrorType, errorMessage: string, networkDetails?: {
|
|
88
|
+
code?: string;
|
|
89
|
+
message?: string;
|
|
90
|
+
retryable?: boolean;
|
|
91
|
+
}, cause?: Error);
|
|
92
|
+
/**
|
|
93
|
+
* Convert the error to a JSON object, including network details
|
|
94
|
+
*
|
|
95
|
+
* @returns The error as a JSON object
|
|
96
|
+
*/
|
|
97
|
+
toJSON(): {
|
|
98
|
+
networkDetails?: {
|
|
99
|
+
code?: string;
|
|
100
|
+
message?: string;
|
|
101
|
+
retryable?: boolean;
|
|
102
|
+
} | undefined;
|
|
103
|
+
errorLink?: string | undefined;
|
|
104
|
+
correlationId?: string | undefined;
|
|
105
|
+
name: string;
|
|
106
|
+
statusCode: number;
|
|
107
|
+
errorType: APIErrorType;
|
|
108
|
+
errorMessage: string;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
74
111
|
/**
|
|
75
112
|
* Type guard to check if an object is an OpenAPIError
|
|
76
113
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../openapi-client/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../openapi-client/errors.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,IAAI,YAAY,EACrB,SAAS,IAAI,gBAAgB,EAC9B,MAAM,sDAAsD,CAAC;AAE9D,MAAM,MAAM,aAAa,GACrB,kBAAkB,GAClB,cAAc,GACd,WAAW,GACX,aAAa,GACb,qBAAqB,GACrB,SAAS,GACT,iBAAiB,GACjB,2BAA2B,GAC3B,oBAAoB,GACpB,qBAAqB,CAAC;AAE1B;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAE5D;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,YAAY,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;OASG;gBAED,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,YAAY,EACvB,YAAY,EAAE,MAAM,EACpB,aAAa,CAAC,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,KAAK;IAmBf;;;;OAIG;IACH,MAAM;;;;;;;;CAUP;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,QAAQ;IAC3C;;;;;;OAMG;gBACS,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAIzE;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC;;;;;OAKG;gBACS,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAI3C;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,QAAQ;IACxC,cAAc,CAAC,EAAE;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;IAEF;;;;;;;;;;OAUG;gBAED,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,MAAM,EACpB,cAAc,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,EACzE,KAAK,CAAC,EAAE,KAAK;IAcf;;;;OAIG;IACH,MAAM;;mBAvCG,MAAM;sBACH,MAAM;wBACJ,OAAO;;;;;;;;;CA2CtB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,YAAY,CAShE"}
|
|
@@ -1854,6 +1854,24 @@ export type SignSolanaMessage200 = {
|
|
|
1854
1854
|
/** The signature of the message, as a base58 encoded string. */
|
|
1855
1855
|
signature: string;
|
|
1856
1856
|
};
|
|
1857
|
+
/**
|
|
1858
|
+
* The Solana network to send the transaction to.
|
|
1859
|
+
*/
|
|
1860
|
+
export type SendSolanaTransactionBodyNetwork = (typeof SendSolanaTransactionBodyNetwork)[keyof typeof SendSolanaTransactionBodyNetwork];
|
|
1861
|
+
export declare const SendSolanaTransactionBodyNetwork: {
|
|
1862
|
+
readonly solana: "solana";
|
|
1863
|
+
readonly "solana-devnet": "solana-devnet";
|
|
1864
|
+
};
|
|
1865
|
+
export type SendSolanaTransactionBody = {
|
|
1866
|
+
/** The Solana network to send the transaction to. */
|
|
1867
|
+
network: SendSolanaTransactionBodyNetwork;
|
|
1868
|
+
/** The base64 encoded transaction to sign and send. This transaction can contain multiple instructions for native Solana batching. */
|
|
1869
|
+
transaction: string;
|
|
1870
|
+
};
|
|
1871
|
+
export type SendSolanaTransaction200 = {
|
|
1872
|
+
/** The base58 encoded transaction signature. */
|
|
1873
|
+
transactionSignature: string;
|
|
1874
|
+
};
|
|
1857
1875
|
/**
|
|
1858
1876
|
* The token to request funds for.
|
|
1859
1877
|
*/
|