@coinbase/cdp-sdk 1.49.0 → 1.49.2

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/_cjs/index.js +5 -1
  3. package/_cjs/index.js.map +1 -1
  4. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +19 -1
  5. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  6. package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.js +45 -1
  7. package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.js.map +1 -1
  8. package/_cjs/version.js +1 -1
  9. package/_esm/index.js +1 -0
  10. package/_esm/index.js.map +1 -1
  11. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +18 -0
  12. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  13. package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.js +40 -0
  14. package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.js.map +1 -1
  15. package/_esm/version.js +1 -1
  16. package/_types/index.d.ts +2 -0
  17. package/_types/index.d.ts.map +1 -1
  18. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +267 -0
  19. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  20. package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.d.ts +32 -1
  21. package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.d.ts.map +1 -1
  22. package/_types/version.d.ts +1 -1
  23. package/index.ts +18 -0
  24. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +294 -0
  25. package/openapi-client/generated/x402-facilitator/x402-facilitator.ts +84 -0
  26. package/package.json +2 -2
  27. package/version.ts +1 -1
@@ -5,7 +5,7 @@
5
5
  * The Coinbase Developer Platform APIs - leading the world's transition onchain.
6
6
  * OpenAPI spec version: 2.0.0
7
7
  */
8
- import type { SettleX402PaymentBody, VerifyX402PaymentBody, X402SettleResponseResponse, X402SupportedPaymentKindsResponseResponse, X402VerifyResponseResponse } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
8
+ import type { ListX402DiscoveryMerchantParams, ListX402DiscoveryResourcesParams, SearchX402ResourcesParams, SettleX402PaymentBody, VerifyX402PaymentBody, X402DiscoveryMerchantResponse, X402DiscoveryResourcesResponse, X402McpRequest, X402McpResponse, X402SearchResourcesResponse, X402SettleResponseResponse, X402SupportedPaymentKindsResponseResponse, X402VerifyResponseResponse } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
9
9
  import { cdpApiClient } from "../../cdpApiClient.js";
10
10
  type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
11
11
  /**
@@ -23,8 +23,39 @@ export declare const settleX402Payment: (settleX402PaymentBody: SettleX402Paymen
23
23
  * @summary Get supported payment schemes and networks
24
24
  */
25
25
  export declare const supportedX402PaymentKinds: (options?: SecondParameter<typeof cdpApiClient<X402SupportedPaymentKindsResponseResponse>>) => Promise<X402SupportedPaymentKindsResponseResponse>;
26
+ /**
27
+ * Lists all active discovered x402 resources.
28
+ This endpoint returns resources that have been discovered and cached by the x402 facilitator, including their payment requirements and metadata.
29
+ The response is paginated, and by default, returns 100 items per page.
30
+ * @summary List discovered x402 resources
31
+ */
32
+ export declare const listX402DiscoveryResources: (params?: ListX402DiscoveryResourcesParams, options?: SecondParameter<typeof cdpApiClient<X402DiscoveryResourcesResponse>>) => Promise<X402DiscoveryResourcesResponse>;
33
+ /**
34
+ * Gets x402 merchant discovery information for a given merchant payment address.
35
+ This endpoint returns all active x402 resources associated with the specified `payTo` address, allowing clients to discover what payment-gated resources a merchant exposes and their corresponding payment requirements.
36
+ The response is paginated, and by default, returns 20 items per page.
37
+ * @summary List merchant discovery info
38
+ */
39
+ export declare const listX402DiscoveryMerchant: (params: ListX402DiscoveryMerchantParams, options?: SecondParameter<typeof cdpApiClient<X402DiscoveryMerchantResponse>>) => Promise<X402DiscoveryMerchantResponse>;
40
+ /**
41
+ * Searches for active x402 resources using a text query and optional filters.
42
+ Supports both text-based and vector-based search depending on availability. Results are sorted by relevance and quality score.
43
+ Legacy network names (e.g., `base`, `base-sepolia`, `solana`) are automatically normalized to their CAIP-2 equivalents.
44
+ The response is limited to 20 items per request. If more results exist, `partialResults` will be `true`.
45
+ * @summary Search x402 resources
46
+ */
47
+ export declare const searchX402Resources: (params?: SearchX402ResourcesParams, options?: SecondParameter<typeof cdpApiClient<X402SearchResourcesResponse>>) => Promise<X402SearchResourcesResponse>;
48
+ /**
49
+ * Handles JSON-RPC requests for the Model Context Protocol (MCP). Supports MCP methods for discovering x402 payment resources and tools.
50
+ * @summary Handle MCP JSON-RPC request
51
+ */
52
+ export declare const postX402DiscoveryMcp: (x402McpRequest: X402McpRequest, options?: SecondParameter<typeof cdpApiClient<X402McpResponse>>) => Promise<X402McpResponse>;
26
53
  export type VerifyX402PaymentResult = NonNullable<Awaited<ReturnType<typeof verifyX402Payment>>>;
27
54
  export type SettleX402PaymentResult = NonNullable<Awaited<ReturnType<typeof settleX402Payment>>>;
28
55
  export type SupportedX402PaymentKindsResult = NonNullable<Awaited<ReturnType<typeof supportedX402PaymentKinds>>>;
56
+ export type ListX402DiscoveryResourcesResult = NonNullable<Awaited<ReturnType<typeof listX402DiscoveryResources>>>;
57
+ export type ListX402DiscoveryMerchantResult = NonNullable<Awaited<ReturnType<typeof listX402DiscoveryMerchant>>>;
58
+ export type SearchX402ResourcesResult = NonNullable<Awaited<ReturnType<typeof searchX402Resources>>>;
59
+ export type PostX402DiscoveryMcpResult = NonNullable<Awaited<ReturnType<typeof postX402DiscoveryMcp>>>;
29
60
  export {};
30
61
  //# sourceMappingURL=x402-facilitator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"x402-facilitator.d.ts","sourceRoot":"","sources":["../../../../openapi-client/generated/x402-facilitator/x402-facilitator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,yCAAyC,EACzC,0BAA0B,EAC3B,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,KAAK,eAAe,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,uBAAuB,qBAAqB,EAC5C,UAAU,eAAe,CAAC,OAAO,YAAY,CAAC,0BAA0B,CAAC,CAAC,wCAW3E,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,uBAAuB,qBAAqB,EAC5C,UAAU,eAAe,CAAC,OAAO,YAAY,CAAC,0BAA0B,CAAC,CAAC,wCAW3E,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,GACpC,UAAU,eAAe,CAAC,OAAO,YAAY,CAAC,yCAAyC,CAAC,CAAC,uDAM1F,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC;AACjG,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC;AACjG,MAAM,MAAM,+BAA+B,GAAG,WAAW,CACvD,OAAO,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CACtD,CAAC"}
1
+ {"version":3,"file":"x402-facilitator.d.ts","sourceRoot":"","sources":["../../../../openapi-client/generated/x402-facilitator/x402-facilitator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,+BAA+B,EAC/B,gCAAgC,EAChC,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,cAAc,EACd,eAAe,EACf,2BAA2B,EAC3B,0BAA0B,EAC1B,yCAAyC,EACzC,0BAA0B,EAC3B,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,KAAK,eAAe,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,uBAAuB,qBAAqB,EAC5C,UAAU,eAAe,CAAC,OAAO,YAAY,CAAC,0BAA0B,CAAC,CAAC,wCAW3E,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,uBAAuB,qBAAqB,EAC5C,UAAU,eAAe,CAAC,OAAO,YAAY,CAAC,0BAA0B,CAAC,CAAC,wCAW3E,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,GACpC,UAAU,eAAe,CAAC,OAAO,YAAY,CAAC,yCAAyC,CAAC,CAAC,uDAM1F,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,gCAAgC,EACzC,UAAU,eAAe,CAAC,OAAO,YAAY,CAAC,8BAA8B,CAAC,CAAC,4CAM/E,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,GACpC,QAAQ,+BAA+B,EACvC,UAAU,eAAe,CAAC,OAAO,YAAY,CAAC,6BAA6B,CAAC,CAAC,2CAM9E,CAAC;AACF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,yBAAyB,EAClC,UAAU,eAAe,CAAC,OAAO,YAAY,CAAC,2BAA2B,CAAC,CAAC,yCAM5E,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,gBAAgB,cAAc,EAC9B,UAAU,eAAe,CAAC,OAAO,YAAY,CAAC,eAAe,CAAC,CAAC,6BAWhE,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC;AACjG,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC;AACjG,MAAM,MAAM,+BAA+B,GAAG,WAAW,CACvD,OAAO,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CACtD,CAAC;AACF,MAAM,MAAM,gCAAgC,GAAG,WAAW,CACxD,OAAO,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CACvD,CAAC;AACF,MAAM,MAAM,+BAA+B,GAAG,WAAW,CACvD,OAAO,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CACtD,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,WAAW,CACjD,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAChD,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAClD,OAAO,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CACjD,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "1.49.0";
1
+ export declare const version = "1.49.2";
2
2
  //# sourceMappingURL=version.d.ts.map
package/index.ts CHANGED
@@ -57,3 +57,21 @@ export type {
57
57
  } from "./actions/webhooks/index.js";
58
58
 
59
59
  export { parseEther, parseUnits } from "viem";
60
+
61
+ export type {
62
+ X402ResourceQuality,
63
+ X402DiscoveryResource,
64
+ X402DiscoveryResourceType,
65
+ X402DiscoveryResourcesResponse,
66
+ X402DiscoveryMerchantResponse,
67
+ X402SearchResourcesResponse,
68
+ X402SearchResourcesResponseSearchMethod,
69
+ ListX402DiscoveryResourcesParams,
70
+ ListX402DiscoveryMerchantParams,
71
+ SearchX402ResourcesParams,
72
+ } from "./openapi-client/index.js";
73
+ export {
74
+ listX402DiscoveryResources,
75
+ listX402DiscoveryMerchant,
76
+ searchX402Resources,
77
+ } from "./openapi-client/index.js";
@@ -4042,6 +4042,217 @@ export interface X402SupportedPaymentKind {
4042
4042
  extra?: X402SupportedPaymentKindExtra;
4043
4043
  }
4044
4044
 
4045
+ /**
4046
+ * Quality metrics for a discovered x402 resource.
4047
+ */
4048
+ export interface X402ResourceQuality {
4049
+ /** Total number of paid calls to a resource in the last 30 days. */
4050
+ l30DaysTotalCalls?: number;
4051
+ /** Number of unique payers to a resource in the last 30 days. */
4052
+ l30DaysUniquePayers?: number;
4053
+ /** Timestamp of the most recent paid call to a resource. */
4054
+ lastCalledAt?: string;
4055
+ }
4056
+
4057
+ /**
4058
+ * Communication protocol (e.g., "http", "mcp").
4059
+ */
4060
+ export type X402DiscoveryResourceType =
4061
+ (typeof X402DiscoveryResourceType)[keyof typeof X402DiscoveryResourceType];
4062
+
4063
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
4064
+ export const X402DiscoveryResourceType = {
4065
+ http: "http",
4066
+ mcp: "mcp",
4067
+ } as const;
4068
+
4069
+ /**
4070
+ * Map of x402 protocol extensions supported by the resource, keyed by extension name.
4071
+ */
4072
+ export type X402DiscoveryResourceExtensions = { [key: string]: unknown };
4073
+
4074
+ /**
4075
+ * A single discovered x402 resource.
4076
+ */
4077
+ export interface X402DiscoveryResource {
4078
+ /** The URL of the resource. */
4079
+ resource: string;
4080
+ /** A human-readable description of the resource. */
4081
+ description?: string;
4082
+ /** Communication protocol (e.g., "http", "mcp"). */
4083
+ type: X402DiscoveryResourceType;
4084
+ x402Version: X402Version;
4085
+ /** Timestamp of the last update. */
4086
+ lastUpdated?: string;
4087
+ /** Payment requirements accepted by the resource. */
4088
+ accepts?: X402PaymentRequirements[];
4089
+ /** Map of x402 protocol extensions supported by the resource, keyed by extension name. */
4090
+ extensions?: X402DiscoveryResourceExtensions;
4091
+ quality?: X402ResourceQuality;
4092
+ }
4093
+
4094
+ /**
4095
+ * Pagination information for the response.
4096
+ */
4097
+ export type X402DiscoveryResourcesResponsePagination = {
4098
+ /** The number of discovered x402 resources to return per page. */
4099
+ limit?: number;
4100
+ /** The offset of the first discovered x402 resource to return. */
4101
+ offset?: number;
4102
+ /** The total number of discovered x402 resources. */
4103
+ total?: number;
4104
+ };
4105
+
4106
+ /**
4107
+ * Response containing discovered x402 resources.
4108
+ */
4109
+ export interface X402DiscoveryResourcesResponse {
4110
+ x402Version: X402Version;
4111
+ /** List of discovered x402 resources. */
4112
+ items: X402DiscoveryResource[];
4113
+ /** Pagination information for the response. */
4114
+ pagination: X402DiscoveryResourcesResponsePagination;
4115
+ }
4116
+
4117
+ /**
4118
+ * Pagination information for the response.
4119
+ */
4120
+ export type X402DiscoveryMerchantResponsePagination = {
4121
+ /** The number of resources returned per page. */
4122
+ limit?: number;
4123
+ /** The offset of the first resource returned. */
4124
+ offset?: number;
4125
+ /** The total number of resources associated with the merchant's payTo address. */
4126
+ total?: number;
4127
+ };
4128
+
4129
+ /**
4130
+ * Response containing x402 resources associated with a merchant payment address.
4131
+ */
4132
+ export interface X402DiscoveryMerchantResponse {
4133
+ x402Version: X402Version;
4134
+ payTo: BlockchainAddress;
4135
+ /** List of discovered x402 resources associated with the merchant's payTo address. */
4136
+ resources: X402DiscoveryResource[];
4137
+ /** Pagination information for the response. */
4138
+ pagination: X402DiscoveryMerchantResponsePagination;
4139
+ }
4140
+
4141
+ /**
4142
+ * The search method used to retrieve the results (e.g., "text" or "vector").
4143
+ */
4144
+ export type X402SearchResourcesResponseSearchMethod =
4145
+ (typeof X402SearchResourcesResponseSearchMethod)[keyof typeof X402SearchResourcesResponseSearchMethod];
4146
+
4147
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
4148
+ export const X402SearchResourcesResponseSearchMethod = {
4149
+ text: "text",
4150
+ vector: "vector",
4151
+ } as const;
4152
+
4153
+ /**
4154
+ * Response from a search for x402 resources.
4155
+ */
4156
+ export interface X402SearchResourcesResponse {
4157
+ /** List of x402 resources matching the search query and filters. */
4158
+ resources: X402DiscoveryResource[];
4159
+ /** Indicates whether the result set was truncated because there were more results than the requested limit. */
4160
+ partialResults: boolean;
4161
+ /** The search method used to retrieve the results (e.g., "text" or "vector"). */
4162
+ searchMethod?: X402SearchResourcesResponseSearchMethod;
4163
+ x402Version: X402Version;
4164
+ }
4165
+
4166
+ /**
4167
+ * JSON-RPC version, must be "2.0".
4168
+ */
4169
+ export type X402McpRequestJsonrpc =
4170
+ (typeof X402McpRequestJsonrpc)[keyof typeof X402McpRequestJsonrpc];
4171
+
4172
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
4173
+ export const X402McpRequestJsonrpc = {
4174
+ "20": "2.0",
4175
+ } as const;
4176
+
4177
+ /**
4178
+ * Request identifier.
4179
+ */
4180
+ export type X402McpRequestId = string | number;
4181
+
4182
+ /**
4183
+ * Optional parameters for the method.
4184
+ */
4185
+ export type X402McpRequestParams = { [key: string]: unknown };
4186
+
4187
+ /**
4188
+ * A JSON-RPC 2.0 request for the Model Context Protocol.
4189
+ */
4190
+ export interface X402McpRequest {
4191
+ /** JSON-RPC version, must be "2.0". */
4192
+ jsonrpc: X402McpRequestJsonrpc;
4193
+ /** Request identifier. */
4194
+ id?: X402McpRequestId;
4195
+ /** The MCP method to invoke. */
4196
+ method: string;
4197
+ /** Optional parameters for the method. */
4198
+ params?: X402McpRequestParams;
4199
+ }
4200
+
4201
+ /**
4202
+ * Additional error data.
4203
+ */
4204
+ export type X402McpErrorData = { [key: string]: unknown };
4205
+
4206
+ /**
4207
+ * JSON-RPC 2.0 error object.
4208
+ */
4209
+ export interface X402McpError {
4210
+ /** Error code. */
4211
+ code: number;
4212
+ /** Error message. */
4213
+ message: string;
4214
+ /** Additional error data. */
4215
+ data?: X402McpErrorData;
4216
+ }
4217
+
4218
+ /**
4219
+ * JSON-RPC version.
4220
+ */
4221
+ export type X402McpResponseJsonrpc =
4222
+ (typeof X402McpResponseJsonrpc)[keyof typeof X402McpResponseJsonrpc];
4223
+
4224
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
4225
+ export const X402McpResponseJsonrpc = {
4226
+ "20": "2.0",
4227
+ } as const;
4228
+
4229
+ /**
4230
+ * Request identifier (matches the request ID, null for notifications).
4231
+ * @nullable
4232
+ */
4233
+ export type X402McpResponseId = string | number | null;
4234
+
4235
+ /**
4236
+ * The result of the method call (present on success).
4237
+ */
4238
+ export type X402McpResponseResult = { [key: string]: unknown };
4239
+
4240
+ /**
4241
+ * A JSON-RPC 2.0 response for the Model Context Protocol.
4242
+ */
4243
+ export interface X402McpResponse {
4244
+ /** JSON-RPC version. */
4245
+ jsonrpc: X402McpResponseJsonrpc;
4246
+ /**
4247
+ * Request identifier (matches the request ID, null for notifications).
4248
+ * @nullable
4249
+ */
4250
+ id?: X402McpResponseId;
4251
+ /** The result of the method call (present on success). */
4252
+ result?: X402McpResponseResult;
4253
+ error?: X402McpError;
4254
+ }
4255
+
4045
4256
  /**
4046
4257
  * The type of payment method to be used to complete an onramp order.
4047
4258
  */
@@ -5778,6 +5989,89 @@ export type SettleX402PaymentBody = {
5778
5989
  paymentRequirements: X402PaymentRequirements;
5779
5990
  };
5780
5991
 
5992
+ export type ListX402DiscoveryResourcesParams = {
5993
+ /**
5994
+ * Filter by protocol type (e.g., "http", "mcp").
5995
+ Currently, the only supported protocol type is "http".
5996
+ */
5997
+ type?: string;
5998
+ /**
5999
+ * The number of discovered x402 resources to return per page.
6000
+ */
6001
+ limit?: number;
6002
+ /**
6003
+ * The offset of the first discovered x402 resource to return.
6004
+ */
6005
+ offset?: number;
6006
+ };
6007
+
6008
+ export type ListX402DiscoveryMerchantParams = {
6009
+ /**
6010
+ * The merchant's payment address to look up.
6011
+ This is the onchain address that payment requirements route funds to.
6012
+ */
6013
+ payTo: BlockchainAddress;
6014
+ /**
6015
+ * The number of resources to return per page.
6016
+ */
6017
+ limit?: number;
6018
+ /**
6019
+ * The offset of the first resource to return.
6020
+ */
6021
+ offset?: number;
6022
+ };
6023
+
6024
+ export type SearchX402ResourcesParams = {
6025
+ /**
6026
+ * Full-text or semantic search query to find matching resources.
6027
+ * @maxLength 400
6028
+ */
6029
+ query?: string;
6030
+ /**
6031
+ * Filter results by network in CAIP-2 format (e.g., `eip155:8453`) or legacy name (e.g., `base`, `base-sepolia`, `solana`).
6032
+ Legacy names are normalized to their CAIP-2 equivalents before filtering.
6033
+ */
6034
+ network?: string;
6035
+ /**
6036
+ * Filter results by asset address.
6037
+ For EVM networks, provide a 0x-prefixed EVM address. For Solana networks, provide a base58-encoded address.
6038
+ Matching is case-insensitive.
6039
+ */
6040
+ asset?: string;
6041
+ /**
6042
+ * Filter results by payment scheme (e.g., `exact`).
6043
+ */
6044
+ scheme?: string;
6045
+ /**
6046
+ * Filter results by the merchant's payment address.
6047
+ For EVM networks, provide a 0x-prefixed EVM address. For Solana networks, provide a base58-encoded address.
6048
+ */
6049
+ payTo?: BlockchainAddress;
6050
+ /**
6051
+ * Filter results to resources whose URL contains this value (case-insensitive substring match against the resource URL).
6052
+ Useful for narrowing results to a specific domain, subdomain, or path segment. Combine with `query` to perform semantic search restricted to a URL subset.
6053
+ Tip: include enough of the URL to disambiguate (e.g. `api.example.com` rather than `example`) — a short substring may also match resources whose path contains the same string.
6054
+ * @minLength 3
6055
+ * @maxLength 2048
6056
+ */
6057
+ urlSubstring?: string;
6058
+ /**
6059
+ * Filter results to resources with a USD price at or below this value.
6060
+ */
6061
+ maxUsdPrice?: string;
6062
+ /**
6063
+ * Filter results to resources that support the specified protocol extensions. Can be specified multiple times to filter by multiple extensions.
6064
+ */
6065
+ extensions?: string[];
6066
+ /**
6067
+ * Maximum number of resources to return. Must be a positive integer no greater than 20.
6068
+ Defaults to 20.
6069
+ * @minimum 1
6070
+ * @maximum 20
6071
+ */
6072
+ limit?: number;
6073
+ };
6074
+
5781
6075
  export type CreateOnrampOrderBody = {
5782
6076
  /** 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). */
5783
6077
  agreementAcceptedAt: string;
@@ -6,8 +6,16 @@
6
6
  * OpenAPI spec version: 2.0.0
7
7
  */
8
8
  import type {
9
+ ListX402DiscoveryMerchantParams,
10
+ ListX402DiscoveryResourcesParams,
11
+ SearchX402ResourcesParams,
9
12
  SettleX402PaymentBody,
10
13
  VerifyX402PaymentBody,
14
+ X402DiscoveryMerchantResponse,
15
+ X402DiscoveryResourcesResponse,
16
+ X402McpRequest,
17
+ X402McpResponse,
18
+ X402SearchResourcesResponse,
11
19
  X402SettleResponseResponse,
12
20
  X402SupportedPaymentKindsResponseResponse,
13
21
  X402VerifyResponseResponse,
@@ -65,8 +73,84 @@ export const supportedX402PaymentKinds = (
65
73
  options,
66
74
  );
67
75
  };
76
+ /**
77
+ * Lists all active discovered x402 resources.
78
+ This endpoint returns resources that have been discovered and cached by the x402 facilitator, including their payment requirements and metadata.
79
+ The response is paginated, and by default, returns 100 items per page.
80
+ * @summary List discovered x402 resources
81
+ */
82
+ export const listX402DiscoveryResources = (
83
+ params?: ListX402DiscoveryResourcesParams,
84
+ options?: SecondParameter<typeof cdpApiClient<X402DiscoveryResourcesResponse>>,
85
+ ) => {
86
+ return cdpApiClient<X402DiscoveryResourcesResponse>(
87
+ { url: `/v2/x402/discovery/resources`, method: "GET", params },
88
+ options,
89
+ );
90
+ };
91
+ /**
92
+ * Gets x402 merchant discovery information for a given merchant payment address.
93
+ This endpoint returns all active x402 resources associated with the specified `payTo` address, allowing clients to discover what payment-gated resources a merchant exposes and their corresponding payment requirements.
94
+ The response is paginated, and by default, returns 20 items per page.
95
+ * @summary List merchant discovery info
96
+ */
97
+ export const listX402DiscoveryMerchant = (
98
+ params: ListX402DiscoveryMerchantParams,
99
+ options?: SecondParameter<typeof cdpApiClient<X402DiscoveryMerchantResponse>>,
100
+ ) => {
101
+ return cdpApiClient<X402DiscoveryMerchantResponse>(
102
+ { url: `/v2/x402/discovery/merchant`, method: "GET", params },
103
+ options,
104
+ );
105
+ };
106
+ /**
107
+ * Searches for active x402 resources using a text query and optional filters.
108
+ Supports both text-based and vector-based search depending on availability. Results are sorted by relevance and quality score.
109
+ Legacy network names (e.g., `base`, `base-sepolia`, `solana`) are automatically normalized to their CAIP-2 equivalents.
110
+ The response is limited to 20 items per request. If more results exist, `partialResults` will be `true`.
111
+ * @summary Search x402 resources
112
+ */
113
+ export const searchX402Resources = (
114
+ params?: SearchX402ResourcesParams,
115
+ options?: SecondParameter<typeof cdpApiClient<X402SearchResourcesResponse>>,
116
+ ) => {
117
+ return cdpApiClient<X402SearchResourcesResponse>(
118
+ { url: `/v2/x402/discovery/search`, method: "GET", params },
119
+ options,
120
+ );
121
+ };
122
+ /**
123
+ * Handles JSON-RPC requests for the Model Context Protocol (MCP). Supports MCP methods for discovering x402 payment resources and tools.
124
+ * @summary Handle MCP JSON-RPC request
125
+ */
126
+ export const postX402DiscoveryMcp = (
127
+ x402McpRequest: X402McpRequest,
128
+ options?: SecondParameter<typeof cdpApiClient<X402McpResponse>>,
129
+ ) => {
130
+ return cdpApiClient<X402McpResponse>(
131
+ {
132
+ url: `/v2/x402/discovery/mcp`,
133
+ method: "POST",
134
+ headers: { "Content-Type": "application/json" },
135
+ data: x402McpRequest,
136
+ },
137
+ options,
138
+ );
139
+ };
68
140
  export type VerifyX402PaymentResult = NonNullable<Awaited<ReturnType<typeof verifyX402Payment>>>;
69
141
  export type SettleX402PaymentResult = NonNullable<Awaited<ReturnType<typeof settleX402Payment>>>;
70
142
  export type SupportedX402PaymentKindsResult = NonNullable<
71
143
  Awaited<ReturnType<typeof supportedX402PaymentKinds>>
72
144
  >;
145
+ export type ListX402DiscoveryResourcesResult = NonNullable<
146
+ Awaited<ReturnType<typeof listX402DiscoveryResources>>
147
+ >;
148
+ export type ListX402DiscoveryMerchantResult = NonNullable<
149
+ Awaited<ReturnType<typeof listX402DiscoveryMerchant>>
150
+ >;
151
+ export type SearchX402ResourcesResult = NonNullable<
152
+ Awaited<ReturnType<typeof searchX402Resources>>
153
+ >;
154
+ export type PostX402DiscoveryMcpResult = NonNullable<
155
+ Awaited<ReturnType<typeof postX402DiscoveryMcp>>
156
+ >;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-sdk",
3
- "version": "1.49.0",
3
+ "version": "1.49.2",
4
4
  "description": "SDK for interacting with the Coinbase Developer Platform Wallet API",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
@@ -22,7 +22,7 @@
22
22
  "@solana-program/token": "^0.9.0",
23
23
  "@solana/kit": "^5.5.1",
24
24
  "abitype": "1.0.6",
25
- "axios": "1.13.6",
25
+ "axios": "1.16.0",
26
26
  "axios-retry": "^4.5.0",
27
27
  "bs58": "^6.0.0",
28
28
  "jose": "^6.2.0",
package/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "1.49.0";
1
+ export const version = "1.49.2";