@coinbase/cdp-sdk 1.40.1 → 1.41.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 +12 -0
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +13 -5
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +12 -4
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +371 -64
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +393 -68
- package/package.json +4 -4
- package/version.ts +1 -1
|
@@ -114,6 +114,66 @@ export type AuthenticationMethod =
|
|
|
114
114
|
*/
|
|
115
115
|
export type AuthenticationMethods = AuthenticationMethod[];
|
|
116
116
|
|
|
117
|
+
/**
|
|
118
|
+
* An object containing information about the end user's TOTP enrollment.
|
|
119
|
+
*/
|
|
120
|
+
export type MFAMethodsTotp = {
|
|
121
|
+
/** The date and time when the method was enrolled, in ISO 8601 format. */
|
|
122
|
+
enrolledAt: string;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Information about the end user's MFA enrollments.
|
|
127
|
+
|
|
128
|
+
*/
|
|
129
|
+
export interface MFAMethods {
|
|
130
|
+
/** The date and time when the end user was prompted for MFA enrollment, in ISO 8601 format. If the this field exists, and the user has no other enrolled MFA methods, then the user skipped MFA enrollment. */
|
|
131
|
+
enrollmentPromptedAt?: string;
|
|
132
|
+
/** An object containing information about the end user's TOTP enrollment. */
|
|
133
|
+
totp?: MFAMethodsTotp;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Information about an EVM account associated with an end user.
|
|
138
|
+
*/
|
|
139
|
+
export interface EndUserEvmAccount {
|
|
140
|
+
/**
|
|
141
|
+
* The address of the EVM account.
|
|
142
|
+
* @pattern ^0x[0-9a-fA-F]{40}$
|
|
143
|
+
*/
|
|
144
|
+
address: string;
|
|
145
|
+
/** The date and time when the account was created, in ISO 8601 format. */
|
|
146
|
+
createdAt: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Information about an EVM smart account associated with an end user.
|
|
151
|
+
*/
|
|
152
|
+
export interface EndUserEvmSmartAccount {
|
|
153
|
+
/**
|
|
154
|
+
* The address of the EVM smart account.
|
|
155
|
+
* @pattern ^0x[0-9a-fA-F]{40}$
|
|
156
|
+
*/
|
|
157
|
+
address: string;
|
|
158
|
+
/** The addresses of the EVM EOA accounts that own this smart account. Smart accounts can have multiple owners, such as when spend permissions are enabled. */
|
|
159
|
+
ownerAddresses: string[];
|
|
160
|
+
/** The date and time when the account was created, in ISO 8601 format. */
|
|
161
|
+
createdAt: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Information about a Solana account associated with an end user.
|
|
166
|
+
*/
|
|
167
|
+
export interface EndUserSolanaAccount {
|
|
168
|
+
/**
|
|
169
|
+
* The base58 encoded address of the Solana account.
|
|
170
|
+
* @pattern ^[1-9A-HJ-NP-Za-km-z]{32,44}$
|
|
171
|
+
*/
|
|
172
|
+
address: string;
|
|
173
|
+
/** The date and time when the account was created, in ISO 8601 format. */
|
|
174
|
+
createdAt: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
117
177
|
/**
|
|
118
178
|
* Information about the end user.
|
|
119
179
|
*/
|
|
@@ -124,21 +184,28 @@ export interface EndUser {
|
|
|
124
184
|
*/
|
|
125
185
|
userId: string;
|
|
126
186
|
authenticationMethods: AuthenticationMethods;
|
|
187
|
+
mfaMethods?: MFAMethods;
|
|
127
188
|
/**
|
|
128
189
|
* **DEPRECATED**: Use `evmAccountObjects` instead for richer account information. The list of EVM account addresses associated with the end user. End users can have up to 10 EVM accounts.
|
|
129
190
|
* @deprecated
|
|
130
191
|
*/
|
|
131
192
|
evmAccounts: string[];
|
|
193
|
+
/** The list of EVM accounts associated with the end user. End users can have up to 10 EVM accounts. */
|
|
194
|
+
evmAccountObjects: EndUserEvmAccount[];
|
|
132
195
|
/**
|
|
133
196
|
* **DEPRECATED**: Use `evmSmartAccountObjects` instead for richer account information including owner relationships. The list of EVM smart account addresses associated with the end user. Each EVM EOA can own one smart account.
|
|
134
197
|
* @deprecated
|
|
135
198
|
*/
|
|
136
199
|
evmSmartAccounts: string[];
|
|
200
|
+
/** The list of EVM smart accounts associated with the end user. Each EVM EOA can own one smart account. */
|
|
201
|
+
evmSmartAccountObjects: EndUserEvmSmartAccount[];
|
|
137
202
|
/**
|
|
138
203
|
* **DEPRECATED**: Use `solanaAccountObjects` instead for richer account information. The list of Solana account addresses associated with the end user. End users can have up to 10 Solana accounts.
|
|
139
204
|
* @deprecated
|
|
140
205
|
*/
|
|
141
206
|
solanaAccounts: string[];
|
|
207
|
+
/** The list of Solana accounts associated with the end user. End users can have up to 10 Solana accounts. */
|
|
208
|
+
solanaAccountObjects: EndUserSolanaAccount[];
|
|
142
209
|
/** The date and time when the end user was created, in ISO 8601 format. */
|
|
143
210
|
createdAt: string;
|
|
144
211
|
}
|
|
@@ -2505,10 +2572,10 @@ export interface WebhookTarget {
|
|
|
2505
2572
|
* Additional metadata for the subscription.
|
|
2506
2573
|
*/
|
|
2507
2574
|
export type WebhookSubscriptionResponseMetadata = {
|
|
2508
|
-
/**
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2575
|
+
/**
|
|
2576
|
+
* Use the root-level `secret` field instead. Maintained for backward compatibility only.
|
|
2577
|
+
* @deprecated
|
|
2578
|
+
*/
|
|
2512
2579
|
secret?: string;
|
|
2513
2580
|
};
|
|
2514
2581
|
|
|
@@ -2535,13 +2602,27 @@ service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detec
|
|
|
2535
2602
|
isEnabled: boolean;
|
|
2536
2603
|
/** Additional metadata for the subscription. */
|
|
2537
2604
|
metadata?: WebhookSubscriptionResponseMetadata;
|
|
2605
|
+
/** Secret for webhook signature validation. */
|
|
2606
|
+
secret: string;
|
|
2538
2607
|
/** Unique identifier for the subscription. */
|
|
2539
2608
|
subscriptionId: string;
|
|
2540
2609
|
target: WebhookTarget;
|
|
2541
|
-
/**
|
|
2610
|
+
/**
|
|
2611
|
+
* (Deprecated) Use `labels` field instead.
|
|
2612
|
+
|
|
2613
|
+
Label key for filtering events. Present when subscription uses traditional single-label format.
|
|
2614
|
+
Maintained for backward compatibility only.
|
|
2615
|
+
|
|
2616
|
+
* @deprecated
|
|
2542
2617
|
*/
|
|
2543
2618
|
labelKey?: string;
|
|
2544
|
-
/**
|
|
2619
|
+
/**
|
|
2620
|
+
* (Deprecated) Use `labels` field instead.
|
|
2621
|
+
|
|
2622
|
+
Label value for filtering events. Present when subscription uses traditional single-label format.
|
|
2623
|
+
Maintained for backward compatibility only.
|
|
2624
|
+
|
|
2625
|
+
* @deprecated
|
|
2545
2626
|
*/
|
|
2546
2627
|
labelValue?: string;
|
|
2547
2628
|
/** Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs.
|
|
@@ -2569,7 +2650,10 @@ export type WebhookSubscriptionRequestMetadata = { [key: string]: unknown };
|
|
|
2569
2650
|
* Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2570
2651
|
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2571
2652
|
the event are allowed and will not prevent matching.
|
|
2572
|
-
|
|
2653
|
+
|
|
2654
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2655
|
+
|
|
2656
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2573
2657
|
|
|
2574
2658
|
*/
|
|
2575
2659
|
export type WebhookSubscriptionRequestLabels = { [key: string]: string };
|
|
@@ -2593,20 +2677,37 @@ The subscription will only receive events matching these types AND the label fil
|
|
|
2593
2677
|
target?: WebhookTarget;
|
|
2594
2678
|
/** Additional metadata for the subscription. */
|
|
2595
2679
|
metadata?: WebhookSubscriptionRequestMetadata;
|
|
2596
|
-
/**
|
|
2680
|
+
/**
|
|
2681
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2682
|
+
|
|
2683
|
+
Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
|
|
2597
2684
|
in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
|
|
2598
2685
|
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2599
|
-
|
|
2686
|
+
|
|
2687
|
+
Maintained for backward compatibility only.
|
|
2688
|
+
|
|
2689
|
+
* @deprecated
|
|
2690
|
+
*/
|
|
2600
2691
|
labelKey?: string;
|
|
2601
|
-
/**
|
|
2692
|
+
/**
|
|
2693
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2694
|
+
|
|
2695
|
+
Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
|
|
2602
2696
|
Only events with this exact label value will be delivered.
|
|
2603
2697
|
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2604
|
-
|
|
2698
|
+
|
|
2699
|
+
Maintained for backward compatibility only.
|
|
2700
|
+
|
|
2701
|
+
* @deprecated
|
|
2702
|
+
*/
|
|
2605
2703
|
labelValue?: string;
|
|
2606
2704
|
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2607
2705
|
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2608
2706
|
the event are allowed and will not prevent matching.
|
|
2609
|
-
|
|
2707
|
+
|
|
2708
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2709
|
+
|
|
2710
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2610
2711
|
*/
|
|
2611
2712
|
labels?: WebhookSubscriptionRequestLabels;
|
|
2612
2713
|
})
|
|
@@ -2623,20 +2724,37 @@ The subscription will only receive events matching these types AND the label fil
|
|
|
2623
2724
|
target?: WebhookTarget;
|
|
2624
2725
|
/** Additional metadata for the subscription. */
|
|
2625
2726
|
metadata?: WebhookSubscriptionRequestMetadata;
|
|
2626
|
-
/**
|
|
2727
|
+
/**
|
|
2728
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2729
|
+
|
|
2730
|
+
Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
|
|
2627
2731
|
in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
|
|
2628
2732
|
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2629
|
-
|
|
2733
|
+
|
|
2734
|
+
Maintained for backward compatibility only.
|
|
2735
|
+
|
|
2736
|
+
* @deprecated
|
|
2737
|
+
*/
|
|
2630
2738
|
labelKey?: string;
|
|
2631
|
-
/**
|
|
2739
|
+
/**
|
|
2740
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2741
|
+
|
|
2742
|
+
Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
|
|
2632
2743
|
Only events with this exact label value will be delivered.
|
|
2633
2744
|
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2634
|
-
|
|
2745
|
+
|
|
2746
|
+
Maintained for backward compatibility only.
|
|
2747
|
+
|
|
2748
|
+
* @deprecated
|
|
2749
|
+
*/
|
|
2635
2750
|
labelValue?: string;
|
|
2636
2751
|
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2637
2752
|
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2638
2753
|
the event are allowed and will not prevent matching.
|
|
2639
|
-
|
|
2754
|
+
|
|
2755
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2756
|
+
|
|
2757
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2640
2758
|
*/
|
|
2641
2759
|
labels?: WebhookSubscriptionRequestLabels;
|
|
2642
2760
|
});
|
|
@@ -2647,8 +2765,11 @@ NOTE: Use either labels OR (labelKey + labelValue), not both.
|
|
|
2647
2765
|
export type WebhookSubscriptionUpdateRequestMetadata = { [key: string]: unknown };
|
|
2648
2766
|
|
|
2649
2767
|
/**
|
|
2650
|
-
* Multi-label filters
|
|
2651
|
-
|
|
2768
|
+
* Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2769
|
+
|
|
2770
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2771
|
+
|
|
2772
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2652
2773
|
|
|
2653
2774
|
*/
|
|
2654
2775
|
export type WebhookSubscriptionUpdateRequestLabels = { [key: string]: string };
|
|
@@ -2671,16 +2792,31 @@ service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detec
|
|
|
2671
2792
|
target?: WebhookTarget;
|
|
2672
2793
|
/** Additional metadata for the subscription. */
|
|
2673
2794
|
metadata?: WebhookSubscriptionUpdateRequestMetadata;
|
|
2674
|
-
/**
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
labelValue?: string;
|
|
2680
|
-
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2681
|
-
an event contains ALL the key-value pairs specified here. Use either labels OR (labelKey + labelValue), not both.
|
|
2795
|
+
/** Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2796
|
+
|
|
2797
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2798
|
+
|
|
2799
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2682
2800
|
*/
|
|
2683
2801
|
labels?: WebhookSubscriptionUpdateRequestLabels;
|
|
2802
|
+
/**
|
|
2803
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2804
|
+
|
|
2805
|
+
Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2806
|
+
Maintained for backward compatibility only.
|
|
2807
|
+
|
|
2808
|
+
* @deprecated
|
|
2809
|
+
*/
|
|
2810
|
+
labelKey?: string;
|
|
2811
|
+
/**
|
|
2812
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2813
|
+
|
|
2814
|
+
Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2815
|
+
Maintained for backward compatibility only.
|
|
2816
|
+
|
|
2817
|
+
* @deprecated
|
|
2818
|
+
*/
|
|
2819
|
+
labelValue?: string;
|
|
2684
2820
|
})
|
|
2685
2821
|
| (unknown & {
|
|
2686
2822
|
/** Description of the webhook subscription. */
|
|
@@ -2694,16 +2830,31 @@ service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detec
|
|
|
2694
2830
|
target?: WebhookTarget;
|
|
2695
2831
|
/** Additional metadata for the subscription. */
|
|
2696
2832
|
metadata?: WebhookSubscriptionUpdateRequestMetadata;
|
|
2697
|
-
/**
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
labelValue?: string;
|
|
2703
|
-
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2704
|
-
an event contains ALL the key-value pairs specified here. Use either labels OR (labelKey + labelValue), not both.
|
|
2833
|
+
/** Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2834
|
+
|
|
2835
|
+
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2836
|
+
|
|
2837
|
+
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2705
2838
|
*/
|
|
2706
2839
|
labels?: WebhookSubscriptionUpdateRequestLabels;
|
|
2840
|
+
/**
|
|
2841
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2842
|
+
|
|
2843
|
+
Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2844
|
+
Maintained for backward compatibility only.
|
|
2845
|
+
|
|
2846
|
+
* @deprecated
|
|
2847
|
+
*/
|
|
2848
|
+
labelKey?: string;
|
|
2849
|
+
/**
|
|
2850
|
+
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2851
|
+
|
|
2852
|
+
Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2853
|
+
Maintained for backward compatibility only.
|
|
2854
|
+
|
|
2855
|
+
* @deprecated
|
|
2856
|
+
*/
|
|
2857
|
+
labelValue?: string;
|
|
2707
2858
|
});
|
|
2708
2859
|
|
|
2709
2860
|
/**
|
|
@@ -2714,6 +2865,7 @@ export type X402Version = (typeof X402Version)[keyof typeof X402Version];
|
|
|
2714
2865
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2715
2866
|
export const X402Version = {
|
|
2716
2867
|
NUMBER_1: 1,
|
|
2868
|
+
NUMBER_2: 2,
|
|
2717
2869
|
} as const;
|
|
2718
2870
|
|
|
2719
2871
|
/**
|
|
@@ -2761,22 +2913,22 @@ export interface X402ExactSolanaPayload {
|
|
|
2761
2913
|
/**
|
|
2762
2914
|
* The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`.
|
|
2763
2915
|
*/
|
|
2764
|
-
export type
|
|
2765
|
-
(typeof
|
|
2916
|
+
export type X402V1PaymentPayloadScheme =
|
|
2917
|
+
(typeof X402V1PaymentPayloadScheme)[keyof typeof X402V1PaymentPayloadScheme];
|
|
2766
2918
|
|
|
2767
2919
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2768
|
-
export const
|
|
2920
|
+
export const X402V1PaymentPayloadScheme = {
|
|
2769
2921
|
exact: "exact",
|
|
2770
2922
|
} as const;
|
|
2771
2923
|
|
|
2772
2924
|
/**
|
|
2773
2925
|
* The network of the blockchain to send payment on.
|
|
2774
2926
|
*/
|
|
2775
|
-
export type
|
|
2776
|
-
(typeof
|
|
2927
|
+
export type X402V1PaymentPayloadNetwork =
|
|
2928
|
+
(typeof X402V1PaymentPayloadNetwork)[keyof typeof X402V1PaymentPayloadNetwork];
|
|
2777
2929
|
|
|
2778
2930
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2779
|
-
export const
|
|
2931
|
+
export const X402V1PaymentPayloadNetwork = {
|
|
2780
2932
|
"base-sepolia": "base-sepolia",
|
|
2781
2933
|
base: "base",
|
|
2782
2934
|
"solana-devnet": "solana-devnet",
|
|
@@ -2786,40 +2938,130 @@ export const X402PaymentPayloadNetwork = {
|
|
|
2786
2938
|
/**
|
|
2787
2939
|
* The payload of the payment depending on the x402Version, scheme, and network.
|
|
2788
2940
|
*/
|
|
2789
|
-
export type
|
|
2941
|
+
export type X402V1PaymentPayloadPayload = X402ExactEvmPayload | X402ExactSolanaPayload;
|
|
2790
2942
|
|
|
2791
2943
|
/**
|
|
2792
2944
|
* The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header.
|
|
2793
2945
|
*/
|
|
2794
|
-
export interface
|
|
2946
|
+
export interface X402V1PaymentPayload {
|
|
2795
2947
|
x402Version: X402Version;
|
|
2796
2948
|
/** The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. */
|
|
2797
|
-
scheme:
|
|
2949
|
+
scheme: X402V1PaymentPayloadScheme;
|
|
2798
2950
|
/** The network of the blockchain to send payment on. */
|
|
2799
|
-
network:
|
|
2951
|
+
network: X402V1PaymentPayloadNetwork;
|
|
2952
|
+
/** The payload of the payment depending on the x402Version, scheme, and network. */
|
|
2953
|
+
payload: X402V1PaymentPayloadPayload;
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
/**
|
|
2957
|
+
* The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`.
|
|
2958
|
+
*/
|
|
2959
|
+
export type X402V2PaymentRequirementsScheme =
|
|
2960
|
+
(typeof X402V2PaymentRequirementsScheme)[keyof typeof X402V2PaymentRequirementsScheme];
|
|
2961
|
+
|
|
2962
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2963
|
+
export const X402V2PaymentRequirementsScheme = {
|
|
2964
|
+
exact: "exact",
|
|
2965
|
+
} as const;
|
|
2966
|
+
|
|
2967
|
+
/**
|
|
2968
|
+
* The optional additional scheme-specific payment info.
|
|
2969
|
+
*/
|
|
2970
|
+
export type X402V2PaymentRequirementsExtra = { [key: string]: unknown };
|
|
2971
|
+
|
|
2972
|
+
/**
|
|
2973
|
+
* The x402 protocol payment requirements that the resource server expects the client's payment payload to meet.
|
|
2974
|
+
*/
|
|
2975
|
+
export interface X402V2PaymentRequirements {
|
|
2976
|
+
/** The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. */
|
|
2977
|
+
scheme: X402V2PaymentRequirementsScheme;
|
|
2978
|
+
/** The network of the blockchain to send payment on in caip2 format. */
|
|
2979
|
+
network: string;
|
|
2980
|
+
/**
|
|
2981
|
+
* The asset to pay with.
|
|
2982
|
+
|
|
2983
|
+
For EVM networks, the asset will be a 0x-prefixed, checksum EVM address.
|
|
2984
|
+
|
|
2985
|
+
For Solana-based networks, the asset will be a base58-encoded Solana address.
|
|
2986
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
2987
|
+
*/
|
|
2988
|
+
asset: string;
|
|
2989
|
+
/** The amount to pay for the resource in atomic units of the payment asset. */
|
|
2990
|
+
amount: string;
|
|
2991
|
+
/**
|
|
2992
|
+
* The destination to pay value to.
|
|
2993
|
+
|
|
2994
|
+
For EVM networks, payTo will be a 0x-prefixed, checksum EVM address.
|
|
2995
|
+
|
|
2996
|
+
For Solana-based networks, payTo will be a base58-encoded Solana address.
|
|
2997
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
2998
|
+
*/
|
|
2999
|
+
payTo: string;
|
|
3000
|
+
/** The maximum time in seconds for the resource server to respond. */
|
|
3001
|
+
maxTimeoutSeconds: number;
|
|
3002
|
+
/** The optional additional scheme-specific payment info. */
|
|
3003
|
+
extra?: X402V2PaymentRequirementsExtra;
|
|
3004
|
+
}
|
|
3005
|
+
|
|
3006
|
+
/**
|
|
3007
|
+
* Describes the resource being accessed in x402 protocol.
|
|
3008
|
+
*/
|
|
3009
|
+
export interface X402ResourceInfo {
|
|
3010
|
+
/** The URL of the resource. */
|
|
3011
|
+
url?: string;
|
|
3012
|
+
/** The description of the resource. */
|
|
3013
|
+
description?: string;
|
|
3014
|
+
/** The MIME type of the resource response. */
|
|
3015
|
+
mimeType?: string;
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
/**
|
|
3019
|
+
* The payload of the payment depending on the x402Version, scheme, and network.
|
|
3020
|
+
*/
|
|
3021
|
+
export type X402V2PaymentPayloadPayload = X402ExactEvmPayload | X402ExactSolanaPayload;
|
|
3022
|
+
|
|
3023
|
+
/**
|
|
3024
|
+
* Optional protocol extensions.
|
|
3025
|
+
*/
|
|
3026
|
+
export type X402V2PaymentPayloadExtensions = { [key: string]: unknown };
|
|
3027
|
+
|
|
3028
|
+
/**
|
|
3029
|
+
* The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header.
|
|
3030
|
+
*/
|
|
3031
|
+
export interface X402V2PaymentPayload {
|
|
3032
|
+
x402Version: X402Version;
|
|
2800
3033
|
/** The payload of the payment depending on the x402Version, scheme, and network. */
|
|
2801
|
-
payload:
|
|
3034
|
+
payload: X402V2PaymentPayloadPayload;
|
|
3035
|
+
accepted: X402V2PaymentRequirements;
|
|
3036
|
+
resource?: X402ResourceInfo;
|
|
3037
|
+
/** Optional protocol extensions. */
|
|
3038
|
+
extensions?: X402V2PaymentPayloadExtensions;
|
|
2802
3039
|
}
|
|
2803
3040
|
|
|
3041
|
+
/**
|
|
3042
|
+
* The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the X-PAYMENT header.
|
|
3043
|
+
*/
|
|
3044
|
+
export type X402PaymentPayload = X402V1PaymentPayload | X402V2PaymentPayload;
|
|
3045
|
+
|
|
2804
3046
|
/**
|
|
2805
3047
|
* The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`.
|
|
2806
3048
|
*/
|
|
2807
|
-
export type
|
|
2808
|
-
(typeof
|
|
3049
|
+
export type X402V1PaymentRequirementsScheme =
|
|
3050
|
+
(typeof X402V1PaymentRequirementsScheme)[keyof typeof X402V1PaymentRequirementsScheme];
|
|
2809
3051
|
|
|
2810
3052
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2811
|
-
export const
|
|
3053
|
+
export const X402V1PaymentRequirementsScheme = {
|
|
2812
3054
|
exact: "exact",
|
|
2813
3055
|
} as const;
|
|
2814
3056
|
|
|
2815
3057
|
/**
|
|
2816
3058
|
* The network of the blockchain to send payment on.
|
|
2817
3059
|
*/
|
|
2818
|
-
export type
|
|
2819
|
-
(typeof
|
|
3060
|
+
export type X402V1PaymentRequirementsNetwork =
|
|
3061
|
+
(typeof X402V1PaymentRequirementsNetwork)[keyof typeof X402V1PaymentRequirementsNetwork];
|
|
2820
3062
|
|
|
2821
3063
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2822
|
-
export const
|
|
3064
|
+
export const X402V1PaymentRequirementsNetwork = {
|
|
2823
3065
|
"base-sepolia": "base-sepolia",
|
|
2824
3066
|
base: "base",
|
|
2825
3067
|
"solana-devnet": "solana-devnet",
|
|
@@ -2829,38 +3071,38 @@ export const X402PaymentRequirementsNetwork = {
|
|
|
2829
3071
|
/**
|
|
2830
3072
|
* The optional JSON schema describing the resource output.
|
|
2831
3073
|
*/
|
|
2832
|
-
export type
|
|
3074
|
+
export type X402V1PaymentRequirementsOutputSchema = { [key: string]: unknown };
|
|
2833
3075
|
|
|
2834
3076
|
/**
|
|
2835
3077
|
* The optional additional scheme-specific payment info.
|
|
2836
3078
|
*/
|
|
2837
|
-
export type
|
|
3079
|
+
export type X402V1PaymentRequirementsExtra = { [key: string]: unknown };
|
|
2838
3080
|
|
|
2839
3081
|
/**
|
|
2840
3082
|
* The x402 protocol payment requirements that the resource server expects the client's payment payload to meet.
|
|
2841
3083
|
*/
|
|
2842
|
-
export interface
|
|
3084
|
+
export interface X402V1PaymentRequirements {
|
|
2843
3085
|
/** The scheme of the payment protocol to use. Currently, the only supported scheme is `exact`. */
|
|
2844
|
-
scheme:
|
|
3086
|
+
scheme: X402V1PaymentRequirementsScheme;
|
|
2845
3087
|
/** The network of the blockchain to send payment on. */
|
|
2846
|
-
network:
|
|
3088
|
+
network: X402V1PaymentRequirementsNetwork;
|
|
2847
3089
|
/** The maximum amount required to pay for the resource in atomic units of the payment asset. */
|
|
2848
3090
|
maxAmountRequired: string;
|
|
2849
3091
|
/** The URL of the resource to pay for. */
|
|
2850
|
-
resource:
|
|
3092
|
+
resource: string;
|
|
2851
3093
|
/** The description of the resource. */
|
|
2852
3094
|
description: string;
|
|
2853
3095
|
/** The MIME type of the resource response. */
|
|
2854
3096
|
mimeType: string;
|
|
2855
3097
|
/** The optional JSON schema describing the resource output. */
|
|
2856
|
-
outputSchema?:
|
|
3098
|
+
outputSchema?: X402V1PaymentRequirementsOutputSchema;
|
|
2857
3099
|
/**
|
|
2858
3100
|
* The destination to pay value to.
|
|
2859
3101
|
|
|
2860
3102
|
For EVM networks, payTo will be a 0x-prefixed, checksum EVM address.
|
|
2861
3103
|
|
|
2862
3104
|
For Solana-based networks, payTo will be a base58-encoded Solana address.
|
|
2863
|
-
* @pattern ^0x[a-fA-F0-9]{40}|[
|
|
3105
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
2864
3106
|
*/
|
|
2865
3107
|
payTo: string;
|
|
2866
3108
|
/** The maximum time in seconds for the resource server to respond. */
|
|
@@ -2871,13 +3113,18 @@ For Solana-based networks, payTo will be a base58-encoded Solana address.
|
|
|
2871
3113
|
For EVM networks, the asset will be a 0x-prefixed, checksum EVM address.
|
|
2872
3114
|
|
|
2873
3115
|
For Solana-based networks, the asset will be a base58-encoded Solana address.
|
|
2874
|
-
* @pattern ^0x[a-fA-F0-9]{40}|[
|
|
3116
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
2875
3117
|
*/
|
|
2876
3118
|
asset: string;
|
|
2877
3119
|
/** The optional additional scheme-specific payment info. */
|
|
2878
|
-
extra?:
|
|
3120
|
+
extra?: X402V1PaymentRequirementsExtra;
|
|
2879
3121
|
}
|
|
2880
3122
|
|
|
3123
|
+
/**
|
|
3124
|
+
* The x402 protocol payment requirements that the resource server expects the client's payment payload to meet.
|
|
3125
|
+
*/
|
|
3126
|
+
export type X402PaymentRequirements = X402V1PaymentRequirements | X402V2PaymentRequirements;
|
|
3127
|
+
|
|
2881
3128
|
/**
|
|
2882
3129
|
* The reason the payment is invalid on the x402 protocol.
|
|
2883
3130
|
*/
|
|
@@ -2948,6 +3195,24 @@ export const X402VerifyInvalidReason = {
|
|
|
2948
3195
|
"invalid_exact_svm_payload_transaction_fee_payer_transferring_funds",
|
|
2949
3196
|
} as const;
|
|
2950
3197
|
|
|
3198
|
+
/**
|
|
3199
|
+
* The result when x402 payment verification fails.
|
|
3200
|
+
*/
|
|
3201
|
+
export interface X402VerifyPaymentRejection {
|
|
3202
|
+
/** Indicates whether the payment is valid. */
|
|
3203
|
+
isValid: boolean;
|
|
3204
|
+
invalidReason: X402VerifyInvalidReason;
|
|
3205
|
+
/**
|
|
3206
|
+
* The onchain address of the client that is paying for the resource.
|
|
3207
|
+
|
|
3208
|
+
For EVM networks, the payer will be a 0x-prefixed, checksum EVM address.
|
|
3209
|
+
|
|
3210
|
+
For Solana-based networks, the payer will be a base58-encoded Solana address.
|
|
3211
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
3212
|
+
*/
|
|
3213
|
+
payer?: string;
|
|
3214
|
+
}
|
|
3215
|
+
|
|
2951
3216
|
/**
|
|
2952
3217
|
* The reason the payment settlement errored on the x402 protocol.
|
|
2953
3218
|
*/
|
|
@@ -2974,11 +3239,42 @@ export const X402SettleErrorReason = {
|
|
|
2974
3239
|
invalid_exact_evm_payload_authorization_to_address_kyt:
|
|
2975
3240
|
"invalid_exact_evm_payload_authorization_to_address_kyt",
|
|
2976
3241
|
invalid_exact_evm_payload_signature_address: "invalid_exact_evm_payload_signature_address",
|
|
3242
|
+
settle_exact_evm_transaction_confirmation_timed_out:
|
|
3243
|
+
"settle_exact_evm_transaction_confirmation_timed_out",
|
|
3244
|
+
settle_exact_node_failure: "settle_exact_node_failure",
|
|
3245
|
+
settle_exact_failed_onchain: "settle_exact_failed_onchain",
|
|
2977
3246
|
settle_exact_svm_block_height_exceeded: "settle_exact_svm_block_height_exceeded",
|
|
2978
3247
|
settle_exact_svm_transaction_confirmation_timed_out:
|
|
2979
3248
|
"settle_exact_svm_transaction_confirmation_timed_out",
|
|
2980
3249
|
} as const;
|
|
2981
3250
|
|
|
3251
|
+
/**
|
|
3252
|
+
* The result when x402 payment settlement fails.
|
|
3253
|
+
*/
|
|
3254
|
+
export interface X402SettlePaymentRejection {
|
|
3255
|
+
/** Indicates whether the payment settlement is successful. */
|
|
3256
|
+
success: boolean;
|
|
3257
|
+
errorReason: X402SettleErrorReason;
|
|
3258
|
+
/**
|
|
3259
|
+
* The onchain address of the client that is paying for the resource.
|
|
3260
|
+
|
|
3261
|
+
For EVM networks, the payer will be a 0x-prefixed, checksum EVM address.
|
|
3262
|
+
|
|
3263
|
+
For Solana-based networks, the payer will be a base58-encoded Solana address.
|
|
3264
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
3265
|
+
*/
|
|
3266
|
+
payer?: string;
|
|
3267
|
+
/**
|
|
3268
|
+
* The transaction of the settlement.
|
|
3269
|
+
For EVM networks, the transaction will be a 0x-prefixed, EVM transaction hash.
|
|
3270
|
+
For Solana-based networks, the transaction will be a base58-encoded Solana signature.
|
|
3271
|
+
* @pattern ^(0x[a-fA-F0-9]{64}|[1-9A-HJ-NP-Za-km-z]{87,88})$
|
|
3272
|
+
*/
|
|
3273
|
+
transaction?: string;
|
|
3274
|
+
/** The network where the settlement occurred. */
|
|
3275
|
+
network?: string;
|
|
3276
|
+
}
|
|
3277
|
+
|
|
2982
3278
|
/**
|
|
2983
3279
|
* The scheme of the payment protocol.
|
|
2984
3280
|
*/
|
|
@@ -3144,6 +3440,14 @@ export const OnrampQuotePaymentMethodTypeId = {
|
|
|
3144
3440
|
CRYPTO_WALLET: "CRYPTO_WALLET",
|
|
3145
3441
|
} as const;
|
|
3146
3442
|
|
|
3443
|
+
/**
|
|
3444
|
+
* A valid URI.
|
|
3445
|
+
* @minLength 5
|
|
3446
|
+
* @maxLength 2048
|
|
3447
|
+
* @pattern ^.*://.*$
|
|
3448
|
+
*/
|
|
3449
|
+
export type Uri = string;
|
|
3450
|
+
|
|
3147
3451
|
/**
|
|
3148
3452
|
* An onramp session containing a ready-to-use onramp URL.
|
|
3149
3453
|
*/
|
|
@@ -3229,11 +3533,16 @@ export type X402VerifyResponseResponse = {
|
|
|
3229
3533
|
For EVM networks, the payer will be a 0x-prefixed, checksum EVM address.
|
|
3230
3534
|
|
|
3231
3535
|
For Solana-based networks, the payer will be a base58-encoded Solana address.
|
|
3232
|
-
* @pattern ^0x[a-fA-F0-9]{40}|[
|
|
3536
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
3233
3537
|
*/
|
|
3234
3538
|
payer: string;
|
|
3235
3539
|
};
|
|
3236
3540
|
|
|
3541
|
+
/**
|
|
3542
|
+
* Invalid payment verification on the x402 protocol.
|
|
3543
|
+
*/
|
|
3544
|
+
export type X402VerifyInvalidErrorResponse = X402VerifyPaymentRejection;
|
|
3545
|
+
|
|
3237
3546
|
export type X402SettleResponseResponse = {
|
|
3238
3547
|
/** Indicates whether the payment settlement is successful. */
|
|
3239
3548
|
success: boolean;
|
|
@@ -3244,23 +3553,37 @@ export type X402SettleResponseResponse = {
|
|
|
3244
3553
|
For EVM networks, the payer will be a 0x-prefixed, checksum EVM address.
|
|
3245
3554
|
|
|
3246
3555
|
For Solana-based networks, the payer will be a base58-encoded Solana address.
|
|
3247
|
-
* @pattern ^0x[a-fA-F0-9]{40}|[
|
|
3556
|
+
* @pattern ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
|
|
3248
3557
|
*/
|
|
3249
3558
|
payer: string;
|
|
3250
3559
|
/**
|
|
3251
3560
|
* The transaction of the settlement.
|
|
3252
3561
|
For EVM networks, the transaction will be a 0x-prefixed, EVM transaction hash.
|
|
3253
3562
|
For Solana-based networks, the transaction will be a base58-encoded Solana signature.
|
|
3254
|
-
* @pattern ^0x[a-fA-F0-9]{
|
|
3563
|
+
* @pattern ^(0x[a-fA-F0-9]{64}|[1-9A-HJ-NP-Za-km-z]{87,88})$
|
|
3255
3564
|
*/
|
|
3256
3565
|
transaction: string;
|
|
3257
3566
|
/** The network where the settlement occurred. */
|
|
3258
3567
|
network: string;
|
|
3259
3568
|
};
|
|
3260
3569
|
|
|
3570
|
+
/**
|
|
3571
|
+
* Unsuccessful payment settlement on the x402 protocol.
|
|
3572
|
+
*/
|
|
3573
|
+
export type X402SettleErrorResponse = X402SettlePaymentRejection;
|
|
3574
|
+
|
|
3575
|
+
/**
|
|
3576
|
+
* A map of CAIP-2 network or protocol family patterns to their supported signer addresses.
|
|
3577
|
+
*/
|
|
3578
|
+
export type X402SupportedPaymentKindsResponseResponseSigners = { [key: string]: string[] };
|
|
3579
|
+
|
|
3261
3580
|
export type X402SupportedPaymentKindsResponseResponse = {
|
|
3262
3581
|
/** The list of supported payment kinds. */
|
|
3263
3582
|
kinds: X402SupportedPaymentKind[];
|
|
3583
|
+
/** The list of supported x402 extensions. */
|
|
3584
|
+
extensions: string[];
|
|
3585
|
+
/** A map of CAIP-2 network or protocol family patterns to their supported signer addresses. */
|
|
3586
|
+
signers: X402SupportedPaymentKindsResponseResponseSigners;
|
|
3264
3587
|
};
|
|
3265
3588
|
|
|
3266
3589
|
/**
|
|
@@ -3300,6 +3623,8 @@ export type PageTokenParameter = string;
|
|
|
3300
3623
|
export type CreateEndUserBodyEvmAccount = {
|
|
3301
3624
|
/** If true, creates an EVM smart account and a default EVM EOA account as the owner. If false, only a EVM EOA account is created. */
|
|
3302
3625
|
createSmartAccount?: boolean;
|
|
3626
|
+
/** If true, enables spend permissions for the EVM smart account. */
|
|
3627
|
+
enableSpendPermissions?: boolean;
|
|
3303
3628
|
};
|
|
3304
3629
|
|
|
3305
3630
|
/**
|
|
@@ -4057,11 +4382,11 @@ Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/res
|
|
|
4057
4382
|
country?: string;
|
|
4058
4383
|
/** The ISO 3166-2 two letter state code (e.g. NY). Only required for US. */
|
|
4059
4384
|
subdivision?: string;
|
|
4060
|
-
/**
|
|
4061
|
-
redirectUrl?:
|
|
4385
|
+
/** URI to redirect the user to when they successfully complete a transaction. This URI will be embedded in the returned onramp URI as a query parameter. */
|
|
4386
|
+
redirectUrl?: Uri;
|
|
4062
4387
|
/** The IP address of the end user requesting the onramp transaction. */
|
|
4063
4388
|
clientIp?: string;
|
|
4064
|
-
/** A unique string that represents the user in your app. This can be used to link individual transactions
|
|
4389
|
+
/** A unique string that represents the user in your app. This can be used to link individual transactions together so you can retrieve the transaction history for your users. Prefix this string with “sandbox-” (e.g. "sandbox-user-1234") to perform a sandbox transaction which will allow you to test your integration without any real transfer of funds.
|
|
4065
4390
|
|
|
4066
4391
|
This value can be used with with [Onramp User Transactions API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-onramp-transactions-by-id) to retrieve all transactions created by the user. */
|
|
4067
4392
|
partnerUserRef?: string;
|