@coinbase/cdp-sdk 1.43.1 → 1.44.1
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 +18 -0
- package/README.md +55 -0
- package/_cjs/actions/evm/sendUserOperation.js +23 -10
- package/_cjs/actions/evm/sendUserOperation.js.map +1 -1
- package/_cjs/actions/evm/transfer/utils.js.map +1 -1
- package/_cjs/analytics.js +22 -23
- package/_cjs/analytics.js.map +1 -1
- package/_cjs/auth/utils/hash.js +1 -1
- package/_cjs/auth/utils/hash.js.map +1 -1
- package/_cjs/auth/utils/http.js +4 -1
- package/_cjs/auth/utils/http.js.map +1 -1
- package/_cjs/client/end-user/endUser.js +87 -4
- package/_cjs/client/end-user/endUser.js.map +1 -1
- package/_cjs/client/end-user/toEndUserAccount.js +51 -0
- package/_cjs/client/end-user/toEndUserAccount.js.map +1 -0
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +6 -2
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js +43 -1
- package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/webhooks/webhooks.js +8 -1
- package/_cjs/openapi-client/generated/webhooks/webhooks.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/actions/evm/sendUserOperation.js +23 -10
- package/_esm/actions/evm/sendUserOperation.js.map +1 -1
- package/_esm/actions/evm/transfer/utils.js.map +1 -1
- package/_esm/analytics.js +22 -23
- package/_esm/analytics.js.map +1 -1
- package/_esm/auth/utils/hash.js +1 -1
- package/_esm/auth/utils/hash.js.map +1 -1
- package/_esm/auth/utils/http.js +4 -1
- package/_esm/auth/utils/http.js.map +1 -1
- package/_esm/client/end-user/endUser.js +88 -5
- package/_esm/client/end-user/endUser.js.map +1 -1
- package/_esm/client/end-user/toEndUserAccount.js +48 -0
- package/_esm/client/end-user/toEndUserAccount.js.map +1 -0
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +6 -2
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js +39 -0
- package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/webhooks/webhooks.js +8 -1
- package/_esm/openapi-client/generated/webhooks/webhooks.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/actions/evm/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/evm/transfer/utils.d.ts +2 -1
- package/_types/actions/evm/transfer/utils.d.ts.map +1 -1
- package/_types/analytics.d.ts.map +1 -1
- package/_types/auth/utils/http.d.ts.map +1 -1
- package/_types/client/end-user/endUser.d.ts +64 -6
- package/_types/client/end-user/endUser.d.ts.map +1 -1
- package/_types/client/end-user/endUser.types.d.ts +119 -1
- package/_types/client/end-user/endUser.types.d.ts.map +1 -1
- package/_types/client/end-user/toEndUserAccount.d.ts +20 -0
- package/_types/client/end-user/toEndUserAccount.d.ts.map +1 -0
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +104 -211
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts +22 -1
- package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/webhooks/webhooks.d.ts +8 -1
- package/_types/openapi-client/generated/webhooks/webhooks.d.ts.map +1 -1
- package/_types/openapi-client/index.d.ts +3 -0
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/actions/evm/sendUserOperation.ts +45 -11
- package/actions/evm/transfer/utils.ts +4 -2
- package/analytics.ts +24 -34
- package/auth/utils/hash.ts +1 -1
- package/auth/utils/http.ts +5 -2
- package/client/end-user/endUser.ts +118 -13
- package/client/end-user/endUser.types.ts +135 -0
- package/client/end-user/toEndUserAccount.ts +80 -0
- package/index.ts +1 -1
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +106 -208
- package/openapi-client/generated/end-user-accounts/end-user-accounts.ts +75 -0
- package/openapi-client/generated/webhooks/webhooks.ts +8 -1
- package/package.json +1 -1
- package/version.ts +1 -1
|
@@ -270,8 +270,6 @@ export const ErrorType = {
|
|
|
270
270
|
mfa_flow_expired: "mfa_flow_expired",
|
|
271
271
|
mfa_required: "mfa_required",
|
|
272
272
|
mfa_not_enrolled: "mfa_not_enrolled",
|
|
273
|
-
mfa_multiple_methods_available: "mfa_multiple_methods_available",
|
|
274
|
-
mfa_invalid_method: "mfa_invalid_method",
|
|
275
273
|
} as const;
|
|
276
274
|
|
|
277
275
|
/**
|
|
@@ -2563,6 +2561,20 @@ export interface AccountTokenAddressesResponse {
|
|
|
2563
2561
|
totalCount?: number;
|
|
2564
2562
|
}
|
|
2565
2563
|
|
|
2564
|
+
/**
|
|
2565
|
+
* A human-readable description.
|
|
2566
|
+
* @minLength 0
|
|
2567
|
+
* @maxLength 500
|
|
2568
|
+
*/
|
|
2569
|
+
export type Description = string;
|
|
2570
|
+
|
|
2571
|
+
/**
|
|
2572
|
+
* Optional metadata as key-value pairs. Use this to store additional structured information on a resource, such as customer IDs, order references, or any application-specific data. Up to 50 key/value pairs may be provided. Keys and values are both strings. Keys must be ≤ 40 characters; values must be ≤ 500 characters.
|
|
2573
|
+
*/
|
|
2574
|
+
export interface Metadata {
|
|
2575
|
+
[key: string]: string;
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2566
2578
|
/**
|
|
2567
2579
|
* Additional headers to include in webhook requests.
|
|
2568
2580
|
*/
|
|
@@ -2580,10 +2592,7 @@ export interface WebhookTarget {
|
|
|
2580
2592
|
headers?: WebhookTargetHeaders;
|
|
2581
2593
|
}
|
|
2582
2594
|
|
|
2583
|
-
|
|
2584
|
-
* Additional metadata for the subscription.
|
|
2585
|
-
*/
|
|
2586
|
-
export type WebhookSubscriptionResponseMetadata = {
|
|
2595
|
+
export type WebhookSubscriptionResponseMetadataAllOf = {
|
|
2587
2596
|
/**
|
|
2588
2597
|
* Use the root-level `secret` field instead. Maintained for backward compatibility only.
|
|
2589
2598
|
* @deprecated
|
|
@@ -2591,6 +2600,12 @@ export type WebhookSubscriptionResponseMetadata = {
|
|
|
2591
2600
|
secret?: string;
|
|
2592
2601
|
};
|
|
2593
2602
|
|
|
2603
|
+
/**
|
|
2604
|
+
* Additional metadata for the subscription.
|
|
2605
|
+
*/
|
|
2606
|
+
export type WebhookSubscriptionResponseMetadata = Metadata &
|
|
2607
|
+
WebhookSubscriptionResponseMetadataAllOf;
|
|
2608
|
+
|
|
2594
2609
|
/**
|
|
2595
2610
|
* Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs.
|
|
2596
2611
|
Present when subscription uses multi-label format.
|
|
@@ -2605,8 +2620,8 @@ export interface WebhookSubscriptionResponse {
|
|
|
2605
2620
|
/** When the subscription was created. */
|
|
2606
2621
|
createdAt: string;
|
|
2607
2622
|
/** Description of the webhook subscription. */
|
|
2608
|
-
description?:
|
|
2609
|
-
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2623
|
+
description?: Description;
|
|
2624
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2610
2625
|
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2611
2626
|
*/
|
|
2612
2627
|
eventTypes: string[];
|
|
@@ -2619,24 +2634,6 @@ service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detec
|
|
|
2619
2634
|
/** Unique identifier for the subscription. */
|
|
2620
2635
|
subscriptionId: string;
|
|
2621
2636
|
target: WebhookTarget;
|
|
2622
|
-
/**
|
|
2623
|
-
* (Deprecated) Use `labels` field instead.
|
|
2624
|
-
|
|
2625
|
-
Label key for filtering events. Present when subscription uses traditional single-label format.
|
|
2626
|
-
Maintained for backward compatibility only.
|
|
2627
|
-
|
|
2628
|
-
* @deprecated
|
|
2629
|
-
*/
|
|
2630
|
-
labelKey?: string;
|
|
2631
|
-
/**
|
|
2632
|
-
* (Deprecated) Use `labels` field instead.
|
|
2633
|
-
|
|
2634
|
-
Label value for filtering events. Present when subscription uses traditional single-label format.
|
|
2635
|
-
Maintained for backward compatibility only.
|
|
2636
|
-
|
|
2637
|
-
* @deprecated
|
|
2638
|
-
*/
|
|
2639
|
-
labelValue?: string;
|
|
2640
2637
|
/** Multi-label filters using total overlap logic. Total overlap means the subscription only triggers when events contain ALL these key-value pairs.
|
|
2641
2638
|
Present when subscription uses multi-label format.
|
|
2642
2639
|
*/
|
|
@@ -2654,14 +2651,9 @@ export type WebhookSubscriptionListResponseAllOf = {
|
|
|
2654
2651
|
export type WebhookSubscriptionListResponse = WebhookSubscriptionListResponseAllOf & ListResponse;
|
|
2655
2652
|
|
|
2656
2653
|
/**
|
|
2657
|
-
*
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
/**
|
|
2662
|
-
* Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2663
|
-
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2664
|
-
the event are allowed and will not prevent matching.
|
|
2654
|
+
* Optional. Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2655
|
+
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2656
|
+
the event are allowed and will not prevent matching. Omit to receive all events for the selected event types.
|
|
2665
2657
|
|
|
2666
2658
|
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2667
2659
|
|
|
@@ -2671,203 +2663,67 @@ See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-refe
|
|
|
2671
2663
|
export type WebhookSubscriptionRequestLabels = { [key: string]: string };
|
|
2672
2664
|
|
|
2673
2665
|
/**
|
|
2674
|
-
* Request to create a new webhook subscription with support for
|
|
2675
|
-
and multi-label filtering formats.
|
|
2676
|
-
|
|
2677
|
-
*/
|
|
2678
|
-
export type WebhookSubscriptionRequest =
|
|
2679
|
-
| (unknown & {
|
|
2680
|
-
/** Description of the webhook subscription. */
|
|
2681
|
-
description?: string;
|
|
2682
|
-
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2683
|
-
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2684
|
-
The subscription will only receive events matching these types AND the label filter(s).
|
|
2685
|
-
*/
|
|
2686
|
-
eventTypes?: string[];
|
|
2687
|
-
/** Whether the subscription is enabled. */
|
|
2688
|
-
isEnabled?: boolean;
|
|
2689
|
-
target?: WebhookTarget;
|
|
2690
|
-
/** Additional metadata for the subscription. */
|
|
2691
|
-
metadata?: WebhookSubscriptionRequestMetadata;
|
|
2692
|
-
/**
|
|
2693
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2694
|
-
|
|
2695
|
-
Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
|
|
2696
|
-
in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
|
|
2697
|
-
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2698
|
-
|
|
2699
|
-
Maintained for backward compatibility only.
|
|
2700
|
-
|
|
2701
|
-
* @deprecated
|
|
2702
|
-
*/
|
|
2703
|
-
labelKey?: string;
|
|
2704
|
-
/**
|
|
2705
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2706
|
-
|
|
2707
|
-
Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
|
|
2708
|
-
Only events with this exact label value will be delivered.
|
|
2709
|
-
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2710
|
-
|
|
2711
|
-
Maintained for backward compatibility only.
|
|
2712
|
-
|
|
2713
|
-
* @deprecated
|
|
2714
|
-
*/
|
|
2715
|
-
labelValue?: string;
|
|
2716
|
-
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2717
|
-
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2718
|
-
the event are allowed and will not prevent matching.
|
|
2719
|
-
|
|
2720
|
-
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2666
|
+
* Request to create a new webhook subscription with support for multi-label filtering.
|
|
2721
2667
|
|
|
2722
|
-
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2723
2668
|
*/
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
description?: string;
|
|
2729
|
-
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2669
|
+
export interface WebhookSubscriptionRequest {
|
|
2670
|
+
/** Description of the webhook subscription. */
|
|
2671
|
+
description?: Description;
|
|
2672
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2730
2673
|
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2731
2674
|
The subscription will only receive events matching these types AND the label filter(s).
|
|
2732
2675
|
*/
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
Label key for filtering events. Each subscription filters on exactly one (labelKey, labelValue) pair
|
|
2743
|
-
in addition to the event types. Only events matching both the event types AND this label filter will be delivered.
|
|
2744
|
-
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2745
|
-
|
|
2746
|
-
Maintained for backward compatibility only.
|
|
2747
|
-
|
|
2748
|
-
* @deprecated
|
|
2749
|
-
*/
|
|
2750
|
-
labelKey?: string;
|
|
2751
|
-
/**
|
|
2752
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2753
|
-
|
|
2754
|
-
Label value for filtering events. Must correspond to the labelKey (e.g., contract address for contract_address key).
|
|
2755
|
-
Only events with this exact label value will be delivered.
|
|
2756
|
-
NOTE: Use either (labelKey + labelValue) OR labels, not both.
|
|
2757
|
-
|
|
2758
|
-
Maintained for backward compatibility only.
|
|
2759
|
-
|
|
2760
|
-
* @deprecated
|
|
2761
|
-
*/
|
|
2762
|
-
labelValue?: string;
|
|
2763
|
-
/** Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2764
|
-
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2765
|
-
the event are allowed and will not prevent matching.
|
|
2676
|
+
eventTypes: string[];
|
|
2677
|
+
/** Whether the subscription is enabled. */
|
|
2678
|
+
isEnabled: boolean;
|
|
2679
|
+
target: WebhookTarget;
|
|
2680
|
+
metadata?: Metadata;
|
|
2681
|
+
/** Optional. Multi-label filters using total overlap logic. Total overlap means the subscription will only trigger when
|
|
2682
|
+
an event contains ALL the key-value pairs specified here. Additional labels on
|
|
2683
|
+
the event are allowed and will not prevent matching. Omit to receive all events for the selected event types.
|
|
2766
2684
|
|
|
2767
2685
|
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2768
2686
|
|
|
2769
2687
|
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2770
2688
|
*/
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
/**
|
|
2775
|
-
* Additional metadata for the subscription.
|
|
2776
|
-
*/
|
|
2777
|
-
export type WebhookSubscriptionUpdateRequestMetadata = { [key: string]: unknown };
|
|
2689
|
+
labels?: WebhookSubscriptionRequestLabels;
|
|
2690
|
+
}
|
|
2778
2691
|
|
|
2779
2692
|
/**
|
|
2780
|
-
* Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2693
|
+
* Optional. Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2781
2694
|
|
|
2782
2695
|
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2783
2696
|
|
|
2784
2697
|
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2698
|
+
Omit to receive all events for the selected event types.
|
|
2785
2699
|
|
|
2786
2700
|
*/
|
|
2787
2701
|
export type WebhookSubscriptionUpdateRequestLabels = { [key: string]: string };
|
|
2788
2702
|
|
|
2789
2703
|
/**
|
|
2790
|
-
* Request to update an existing webhook subscription.
|
|
2791
|
-
the original subscription format (traditional or multi-label).
|
|
2792
|
-
|
|
2793
|
-
*/
|
|
2794
|
-
export type WebhookSubscriptionUpdateRequest =
|
|
2795
|
-
| (unknown & {
|
|
2796
|
-
/** Description of the webhook subscription. */
|
|
2797
|
-
description?: string;
|
|
2798
|
-
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2799
|
-
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2800
|
-
*/
|
|
2801
|
-
eventTypes?: string[];
|
|
2802
|
-
/** Whether the subscription is enabled. */
|
|
2803
|
-
isEnabled?: boolean;
|
|
2804
|
-
target?: WebhookTarget;
|
|
2805
|
-
/** Additional metadata for the subscription. */
|
|
2806
|
-
metadata?: WebhookSubscriptionUpdateRequestMetadata;
|
|
2807
|
-
/** Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2808
|
-
|
|
2809
|
-
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2704
|
+
* Request to update an existing webhook subscription.
|
|
2810
2705
|
|
|
2811
|
-
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2812
2706
|
*/
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2818
|
-
Maintained for backward compatibility only.
|
|
2819
|
-
|
|
2820
|
-
* @deprecated
|
|
2821
|
-
*/
|
|
2822
|
-
labelKey?: string;
|
|
2823
|
-
/**
|
|
2824
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2825
|
-
|
|
2826
|
-
Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2827
|
-
Maintained for backward compatibility only.
|
|
2828
|
-
|
|
2829
|
-
* @deprecated
|
|
2830
|
-
*/
|
|
2831
|
-
labelValue?: string;
|
|
2832
|
-
})
|
|
2833
|
-
| (unknown & {
|
|
2834
|
-
/** Description of the webhook subscription. */
|
|
2835
|
-
description?: string;
|
|
2836
|
-
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2707
|
+
export interface WebhookSubscriptionUpdateRequest {
|
|
2708
|
+
/** Description of the webhook subscription. */
|
|
2709
|
+
description?: Description;
|
|
2710
|
+
/** Types of events to subscribe to. Event types follow a three-part dot-separated format:
|
|
2837
2711
|
service.resource.verb (e.g., "onchain.activity.detected", "wallet.activity.detected", "onramp.transaction.created").
|
|
2838
2712
|
*/
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
/** Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2713
|
+
eventTypes: string[];
|
|
2714
|
+
/** Whether the subscription is enabled. */
|
|
2715
|
+
isEnabled: boolean;
|
|
2716
|
+
target: WebhookTarget;
|
|
2717
|
+
metadata?: Metadata;
|
|
2718
|
+
/** Optional. Multi-label filters that trigger only when an event contains ALL of these key-value pairs.
|
|
2846
2719
|
|
|
2847
2720
|
**Note:** Currently, labels are supported for onchain webhooks only.
|
|
2848
2721
|
|
|
2849
2722
|
See [allowed labels for onchain webhooks](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/webhooks/create-webhook-subscription#onchain-label-filtering).
|
|
2723
|
+
Omit to receive all events for the selected event types.
|
|
2850
2724
|
*/
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2854
|
-
|
|
2855
|
-
Label key for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2856
|
-
Maintained for backward compatibility only.
|
|
2857
|
-
|
|
2858
|
-
* @deprecated
|
|
2859
|
-
*/
|
|
2860
|
-
labelKey?: string;
|
|
2861
|
-
/**
|
|
2862
|
-
* (Deprecated) Use `labels` instead for better filtering capabilities, including filtering on multiple labels simultaneously.
|
|
2863
|
-
|
|
2864
|
-
Label value for filtering events. Use either (labelKey + labelValue) OR labels, not both.
|
|
2865
|
-
Maintained for backward compatibility only.
|
|
2866
|
-
|
|
2867
|
-
* @deprecated
|
|
2868
|
-
*/
|
|
2869
|
-
labelValue?: string;
|
|
2870
|
-
});
|
|
2725
|
+
labels?: WebhookSubscriptionUpdateRequestLabels;
|
|
2726
|
+
}
|
|
2871
2727
|
|
|
2872
2728
|
/**
|
|
2873
2729
|
* The version of the x402 protocol.
|
|
@@ -3021,8 +2877,8 @@ For Solana-based networks, payTo will be a base58-encoded Solana address.
|
|
|
3021
2877
|
export interface X402ResourceInfo {
|
|
3022
2878
|
/** The URL of the resource. */
|
|
3023
2879
|
url?: string;
|
|
3024
|
-
/**
|
|
3025
|
-
description?:
|
|
2880
|
+
/** A human-readable description of the resource. */
|
|
2881
|
+
description?: Description;
|
|
3026
2882
|
/** The MIME type of the resource response. */
|
|
3027
2883
|
mimeType?: string;
|
|
3028
2884
|
}
|
|
@@ -3102,8 +2958,8 @@ export interface X402V1PaymentRequirements {
|
|
|
3102
2958
|
maxAmountRequired: string;
|
|
3103
2959
|
/** The URL of the resource to pay for. */
|
|
3104
2960
|
resource: string;
|
|
3105
|
-
/**
|
|
3106
|
-
description:
|
|
2961
|
+
/** A human-readable description of the resource. */
|
|
2962
|
+
description: Description;
|
|
3107
2963
|
/** The MIME type of the resource response. */
|
|
3108
2964
|
mimeType: string;
|
|
3109
2965
|
/** The optional JSON schema describing the resource output. */
|
|
@@ -3205,6 +3061,7 @@ export const X402VerifyInvalidReason = {
|
|
|
3205
3061
|
"invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts",
|
|
3206
3062
|
invalid_exact_svm_payload_transaction_fee_payer_transferring_funds:
|
|
3207
3063
|
"invalid_exact_svm_payload_transaction_fee_payer_transferring_funds",
|
|
3064
|
+
unknown_error: "unknown_error",
|
|
3208
3065
|
} as const;
|
|
3209
3066
|
|
|
3210
3067
|
/**
|
|
@@ -3214,6 +3071,8 @@ export interface X402VerifyPaymentRejection {
|
|
|
3214
3071
|
/** Indicates whether the payment is valid. */
|
|
3215
3072
|
isValid: boolean;
|
|
3216
3073
|
invalidReason: X402VerifyInvalidReason;
|
|
3074
|
+
/** The message describing the invalid reason. */
|
|
3075
|
+
invalidMessage?: string;
|
|
3217
3076
|
/**
|
|
3218
3077
|
* The onchain address of the client that is paying for the resource.
|
|
3219
3078
|
|
|
@@ -3300,6 +3159,7 @@ export const X402SettleErrorReason = {
|
|
|
3300
3159
|
settle_exact_svm_block_height_exceeded: "settle_exact_svm_block_height_exceeded",
|
|
3301
3160
|
settle_exact_svm_transaction_confirmation_timed_out:
|
|
3302
3161
|
"settle_exact_svm_transaction_confirmation_timed_out",
|
|
3162
|
+
unknown_error: "unknown_error",
|
|
3303
3163
|
} as const;
|
|
3304
3164
|
|
|
3305
3165
|
/**
|
|
@@ -3309,6 +3169,8 @@ export interface X402SettlePaymentRejection {
|
|
|
3309
3169
|
/** Indicates whether the payment settlement is successful. */
|
|
3310
3170
|
success: boolean;
|
|
3311
3171
|
errorReason: X402SettleErrorReason;
|
|
3172
|
+
/** The message describing the error reason. */
|
|
3173
|
+
errorMessage?: string;
|
|
3312
3174
|
/**
|
|
3313
3175
|
* The onchain address of the client that is paying for the resource.
|
|
3314
3176
|
|
|
@@ -3352,6 +3214,10 @@ export const X402SupportedPaymentKindNetwork = {
|
|
|
3352
3214
|
base: "base",
|
|
3353
3215
|
"solana-devnet": "solana-devnet",
|
|
3354
3216
|
solana: "solana",
|
|
3217
|
+
"eip155:8453": "eip155:8453",
|
|
3218
|
+
"eip155:84532": "eip155:84532",
|
|
3219
|
+
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
3220
|
+
"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
|
|
3355
3221
|
} as const;
|
|
3356
3222
|
|
|
3357
3223
|
/**
|
|
@@ -3372,6 +3238,13 @@ export interface X402SupportedPaymentKind {
|
|
|
3372
3238
|
extra?: X402SupportedPaymentKindExtra;
|
|
3373
3239
|
}
|
|
3374
3240
|
|
|
3241
|
+
/**
|
|
3242
|
+
* A blockchain address. Format varies by network (e.g., 0x-prefixed for EVM, base58 for Solana).
|
|
3243
|
+
* @minLength 1
|
|
3244
|
+
* @maxLength 128
|
|
3245
|
+
*/
|
|
3246
|
+
export type BlockchainAddress = string;
|
|
3247
|
+
|
|
3375
3248
|
/**
|
|
3376
3249
|
* The type of payment method to be used to complete an onramp order.
|
|
3377
3250
|
*/
|
|
@@ -3442,7 +3315,7 @@ export interface OnrampOrder {
|
|
|
3442
3315
|
/** The exchange rate used to convert fiat to crypto i.e. the crypto value of one fiat. */
|
|
3443
3316
|
exchangeRate: string;
|
|
3444
3317
|
/** The destination address to send the crypto to. */
|
|
3445
|
-
destinationAddress:
|
|
3318
|
+
destinationAddress: BlockchainAddress;
|
|
3446
3319
|
/** The network to send the crypto on. */
|
|
3447
3320
|
destinationNetwork: string;
|
|
3448
3321
|
status: OnrampOrderStatus;
|
|
@@ -3581,6 +3454,8 @@ export type X402VerifyResponseResponse = {
|
|
|
3581
3454
|
/** Indicates whether the payment is valid. */
|
|
3582
3455
|
isValid: boolean;
|
|
3583
3456
|
invalidReason?: X402VerifyInvalidReason;
|
|
3457
|
+
/** The message describing the invalid reason. */
|
|
3458
|
+
invalidMessage?: string;
|
|
3584
3459
|
/**
|
|
3585
3460
|
* The onchain address of the client that is paying for the resource.
|
|
3586
3461
|
|
|
@@ -3601,6 +3476,8 @@ export type X402SettleResponseResponse = {
|
|
|
3601
3476
|
/** Indicates whether the payment settlement is successful. */
|
|
3602
3477
|
success: boolean;
|
|
3603
3478
|
errorReason?: X402SettleErrorReason;
|
|
3479
|
+
/** The message describing the error reason. */
|
|
3480
|
+
errorMessage?: string;
|
|
3604
3481
|
/**
|
|
3605
3482
|
* The onchain address of the client that is paying for the resource.
|
|
3606
3483
|
|
|
@@ -3742,6 +3619,27 @@ export type ValidateEndUserAccessTokenBody = {
|
|
|
3742
3619
|
accessToken: string;
|
|
3743
3620
|
};
|
|
3744
3621
|
|
|
3622
|
+
export type AddEndUserEvmAccountBody = { [key: string]: unknown };
|
|
3623
|
+
|
|
3624
|
+
export type AddEndUserEvmAccount201 = {
|
|
3625
|
+
evmAccount: EndUserEvmAccount;
|
|
3626
|
+
};
|
|
3627
|
+
|
|
3628
|
+
export type AddEndUserEvmSmartAccountBody = {
|
|
3629
|
+
/** If true, enables spend permissions for the EVM smart account. */
|
|
3630
|
+
enableSpendPermissions?: boolean;
|
|
3631
|
+
};
|
|
3632
|
+
|
|
3633
|
+
export type AddEndUserEvmSmartAccount201 = {
|
|
3634
|
+
evmSmartAccount: EndUserEvmSmartAccount;
|
|
3635
|
+
};
|
|
3636
|
+
|
|
3637
|
+
export type AddEndUserSolanaAccountBody = { [key: string]: unknown };
|
|
3638
|
+
|
|
3639
|
+
export type AddEndUserSolanaAccount201 = {
|
|
3640
|
+
solanaAccount: EndUserSolanaAccount;
|
|
3641
|
+
};
|
|
3642
|
+
|
|
3745
3643
|
/**
|
|
3746
3644
|
* The type of key being imported. Determines what type of account will be associated for the end user.
|
|
3747
3645
|
*/
|
|
@@ -4394,7 +4292,7 @@ export type CreateOnrampOrderBody = {
|
|
|
4394
4292
|
/** The timestamp of when the user acknowledged that by using Coinbase Onramp they are accepting the Coinbase Terms (https://www.coinbase.com/legal/guest-checkout/us), User Agreement (https://www.coinbase.com/legal/user_agreement), and Privacy Policy (https://www.coinbase.com/legal/privacy). */
|
|
4395
4293
|
agreementAcceptedAt: string;
|
|
4396
4294
|
/** The address the purchased crypto will be sent to. */
|
|
4397
|
-
destinationAddress:
|
|
4295
|
+
destinationAddress: BlockchainAddress;
|
|
4398
4296
|
/** The name of the crypto network the purchased currency will be sent on.
|
|
4399
4297
|
|
|
4400
4298
|
Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location. */
|
|
@@ -4451,7 +4349,7 @@ Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/res
|
|
|
4451
4349
|
Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location. */
|
|
4452
4350
|
destinationNetwork: string;
|
|
4453
4351
|
/** The address the purchased crypto will be sent to. */
|
|
4454
|
-
destinationAddress:
|
|
4352
|
+
destinationAddress: BlockchainAddress;
|
|
4455
4353
|
/** A string representing the amount of fiat the user wishes to pay in exchange for crypto. When using this parameter, the returned quote will be inclusive of fees i.e. the user will pay this exact amount of the payment currency. */
|
|
4456
4354
|
paymentAmount?: string;
|
|
4457
4355
|
/** A string representing the amount of crypto the user wishes to purchase. When using this parameter, the returned quote will be exclusive of fees i.e. the user will receive this exact amount of the purchase currency. */
|
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
* OpenAPI spec version: 2.0.0
|
|
7
7
|
*/
|
|
8
8
|
import type {
|
|
9
|
+
AddEndUserEvmAccount201,
|
|
10
|
+
AddEndUserEvmAccountBody,
|
|
11
|
+
AddEndUserEvmSmartAccount201,
|
|
12
|
+
AddEndUserEvmSmartAccountBody,
|
|
13
|
+
AddEndUserSolanaAccount201,
|
|
14
|
+
AddEndUserSolanaAccountBody,
|
|
9
15
|
CreateEndUserBody,
|
|
10
16
|
EndUser,
|
|
11
17
|
ImportEndUserBody,
|
|
@@ -77,6 +83,66 @@ This API is intended to be used by the developer's own backend, and is authentic
|
|
|
77
83
|
export const getEndUser = (userId: string, options?: SecondParameter<typeof cdpApiClient>) => {
|
|
78
84
|
return cdpApiClient<EndUser>({ url: `/v2/end-users/${userId}`, method: "GET" }, options);
|
|
79
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* Adds a new EVM EOA account to an existing end user. End users can have up to 10 EVM accounts.
|
|
88
|
+
This API is intended to be used by the developer's own backend, and is authenticated using the developer's CDP API key.
|
|
89
|
+
* @summary Add an EVM account to an end user
|
|
90
|
+
*/
|
|
91
|
+
export const addEndUserEvmAccount = (
|
|
92
|
+
userId: string,
|
|
93
|
+
addEndUserEvmAccountBody?: AddEndUserEvmAccountBody,
|
|
94
|
+
options?: SecondParameter<typeof cdpApiClient>,
|
|
95
|
+
) => {
|
|
96
|
+
return cdpApiClient<AddEndUserEvmAccount201>(
|
|
97
|
+
{
|
|
98
|
+
url: `/v2/end-users/${userId}/evm`,
|
|
99
|
+
method: "POST",
|
|
100
|
+
headers: { "Content-Type": "application/json" },
|
|
101
|
+
data: addEndUserEvmAccountBody,
|
|
102
|
+
},
|
|
103
|
+
options,
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Creates an EVM smart account for an existing end user. The backend will create a new EVM EOA account to serve as the owner of the smart account.
|
|
108
|
+
This API is intended to be used by the developer's own backend, and is authenticated using the developer's CDP API key.
|
|
109
|
+
* @summary Add an EVM smart account to an end user
|
|
110
|
+
*/
|
|
111
|
+
export const addEndUserEvmSmartAccount = (
|
|
112
|
+
userId: string,
|
|
113
|
+
addEndUserEvmSmartAccountBody?: AddEndUserEvmSmartAccountBody,
|
|
114
|
+
options?: SecondParameter<typeof cdpApiClient>,
|
|
115
|
+
) => {
|
|
116
|
+
return cdpApiClient<AddEndUserEvmSmartAccount201>(
|
|
117
|
+
{
|
|
118
|
+
url: `/v2/end-users/${userId}/evm-smart-account`,
|
|
119
|
+
method: "POST",
|
|
120
|
+
headers: { "Content-Type": "application/json" },
|
|
121
|
+
data: addEndUserEvmSmartAccountBody,
|
|
122
|
+
},
|
|
123
|
+
options,
|
|
124
|
+
);
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Adds a new Solana account to an existing end user. End users can have up to 10 Solana accounts.
|
|
128
|
+
This API is intended to be used by the developer's own backend, and is authenticated using the developer's CDP API key.
|
|
129
|
+
* @summary Add a Solana account to an end user
|
|
130
|
+
*/
|
|
131
|
+
export const addEndUserSolanaAccount = (
|
|
132
|
+
userId: string,
|
|
133
|
+
addEndUserSolanaAccountBody?: AddEndUserSolanaAccountBody,
|
|
134
|
+
options?: SecondParameter<typeof cdpApiClient>,
|
|
135
|
+
) => {
|
|
136
|
+
return cdpApiClient<AddEndUserSolanaAccount201>(
|
|
137
|
+
{
|
|
138
|
+
url: `/v2/end-users/${userId}/solana`,
|
|
139
|
+
method: "POST",
|
|
140
|
+
headers: { "Content-Type": "application/json" },
|
|
141
|
+
data: addEndUserSolanaAccountBody,
|
|
142
|
+
},
|
|
143
|
+
options,
|
|
144
|
+
);
|
|
145
|
+
};
|
|
80
146
|
/**
|
|
81
147
|
* Imports an existing private key for an end user into the developer's CDP Project. The private key must be encrypted using the CDP SDK's encryption scheme before being sent to this endpoint. This API should be called from the [CDP SDK](https://github.com/coinbase/cdp-sdk) to ensure that the associated private key is properly encrypted.
|
|
82
148
|
|
|
@@ -103,4 +169,13 @@ export type ValidateEndUserAccessTokenResult = NonNullable<
|
|
|
103
169
|
Awaited<ReturnType<typeof validateEndUserAccessToken>>
|
|
104
170
|
>;
|
|
105
171
|
export type GetEndUserResult = NonNullable<Awaited<ReturnType<typeof getEndUser>>>;
|
|
172
|
+
export type AddEndUserEvmAccountResult = NonNullable<
|
|
173
|
+
Awaited<ReturnType<typeof addEndUserEvmAccount>>
|
|
174
|
+
>;
|
|
175
|
+
export type AddEndUserEvmSmartAccountResult = NonNullable<
|
|
176
|
+
Awaited<ReturnType<typeof addEndUserEvmSmartAccount>>
|
|
177
|
+
>;
|
|
178
|
+
export type AddEndUserSolanaAccountResult = NonNullable<
|
|
179
|
+
Awaited<ReturnType<typeof addEndUserSolanaAccount>>
|
|
180
|
+
>;
|
|
106
181
|
export type ImportEndUserResult = NonNullable<Awaited<ReturnType<typeof importEndUser>>>;
|
|
@@ -54,12 +54,19 @@ export const listWebhookSubscriptions = (
|
|
|
54
54
|
- `offramp.transaction.success`, `offramp.transaction.failed`
|
|
55
55
|
- **No labels required** - maximum simplicity for transaction monitoring
|
|
56
56
|
|
|
57
|
+
**Payments Transfers Events** - Transfer lifecycle notifications:
|
|
58
|
+
- `payments.transfers.quoted`
|
|
59
|
+
- `payments.transfers.processing`
|
|
60
|
+
- `payments.transfers.completed`
|
|
61
|
+
- `payments.transfers.failed`
|
|
62
|
+
- **No labels required** - enable the transfers webhook to monitor status transitions
|
|
63
|
+
|
|
57
64
|
**Wallet Events** - Wallet activity notifications:
|
|
58
65
|
- `wallet.activity.detected`
|
|
59
66
|
|
|
60
67
|
### Webhook Signature Verification
|
|
61
68
|
All webhooks include cryptographic signatures for security.
|
|
62
|
-
The signature secret is returned in `
|
|
69
|
+
The signature secret is returned in `secret` field when creating a subscription.
|
|
63
70
|
|
|
64
71
|
**Note:** Webhooks are in beta and this interface is subject to change.
|
|
65
72
|
|
package/package.json
CHANGED
package/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "1.
|
|
1
|
+
export const version = "1.44.1";
|