@coinbase/cdp-sdk 1.41.0 → 1.42.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # CDP SDK Changelog
2
2
 
3
+ ## 1.42.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#547](https://github.com/coinbase/cdp-sdk/pull/547) [`bccbced`](https://github.com/coinbase/cdp-sdk/commit/bccbceda35fd141fb327514be5ab24b573a4dba8) Thanks [@milan-cb](https://github.com/milan-cb)! - Added getEndUser method for End User operations
8
+
3
9
  ## 1.41.0
4
10
 
5
11
  ### Minor Changes
@@ -89,6 +89,28 @@ class CDPEndUserClient {
89
89
  };
90
90
  return index_js_1.CdpOpenApiClient.listEndUsers(params);
91
91
  }
92
+ /**
93
+ * Gets an end user by their unique identifier.
94
+ *
95
+ * @param options - The options for getting an end user.
96
+ *
97
+ * @returns A promise that resolves to the end user.
98
+ *
99
+ * @example **Get an end user by ID**
100
+ * ```ts
101
+ * const endUser = await cdp.endUser.getEndUser({
102
+ * userId: "user-123"
103
+ * });
104
+ * console.log(endUser.userId);
105
+ * ```
106
+ */
107
+ async getEndUser(options) {
108
+ analytics_js_1.Analytics.trackAction({
109
+ action: "get_end_user",
110
+ });
111
+ const { userId } = options;
112
+ return index_js_1.CdpOpenApiClient.getEndUser(userId);
113
+ }
92
114
  /**
93
115
  * Validates an end user's access token. Throws an error if the access token is invalid.
94
116
  *
@@ -1 +1 @@
1
- {"version":3,"file":"endUser.js","sourceRoot":"","sources":["../../../client/end-user/endUser.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAOpC,qDAA+C;AAC/C,4DAIuC;AAEvC;;GAEG;AACH,MAAa,gBAAgB;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,KAAK,CAAC,aAAa,CAAC,OAA6B;QAC/C,wBAAS,CAAC,WAAW,CAAC;YACpB,MAAM,EAAE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,OAAO,CAAC,MAAM,IAAI,IAAA,mBAAU,GAAE,CAAC;QAE9C,OAAO,2BAAgB,CAAC,aAAa,CAAC;YACpC,GAAG,OAAO;YACV,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,KAAK,CAAC,YAAY,CAAC,UAA+B,EAAE;QAClD,wBAAS,CAAC,WAAW,CAAC;YACpB,MAAM,EAAE,gBAAgB;SACzB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG;YACb,GAAG,OAAO;YACV,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;SACtD,CAAC;QAEF,OAAO,2BAAgB,CAAC,YAAY,CAAC,MAA6B,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,UAAU,CAAC,OAA0B;QACzC,wBAAS,CAAC,WAAW,CAAC;YACpB,MAAM,EAAE,cAAc;SACvB,CAAC,CAAC;QAEH,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAE3B,OAAO,2BAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,mBAAmB,CAAC,OAAmC;QAC3D,wBAAS,CAAC,WAAW,CAAC;YACpB,MAAM,EAAE,uBAAuB;SAChC,CAAC,CAAC;QAEH,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;QAEhC,OAAO,2BAAgB,CAAC,0BAA0B,CAAC;YACjD,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;CACF;AAnID,4CAmIC"}
package/_cjs/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = "1.41.0";
4
+ exports.version = "1.42.0";
5
5
  //# sourceMappingURL=version.js.map
@@ -86,6 +86,28 @@ export class CDPEndUserClient {
86
86
  };
87
87
  return CdpOpenApiClient.listEndUsers(params);
88
88
  }
89
+ /**
90
+ * Gets an end user by their unique identifier.
91
+ *
92
+ * @param options - The options for getting an end user.
93
+ *
94
+ * @returns A promise that resolves to the end user.
95
+ *
96
+ * @example **Get an end user by ID**
97
+ * ```ts
98
+ * const endUser = await cdp.endUser.getEndUser({
99
+ * userId: "user-123"
100
+ * });
101
+ * console.log(endUser.userId);
102
+ * ```
103
+ */
104
+ async getEndUser(options) {
105
+ Analytics.trackAction({
106
+ action: "get_end_user",
107
+ });
108
+ const { userId } = options;
109
+ return CdpOpenApiClient.getEndUser(userId);
110
+ }
89
111
  /**
90
112
  * Validates an end user's access token. Throws an error if the access token is invalid.
91
113
  *
@@ -1 +1 @@
1
- {"version":3,"file":"endUser.js","sourceRoot":"","sources":["../../../client/end-user/endUser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAOpC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,gBAAgB,GAGjB,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,KAAK,CAAC,aAAa,CAAC,OAA6B;QAC/C,SAAS,CAAC,WAAW,CAAC;YACpB,MAAM,EAAE,iBAAiB;SAC1B,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,UAAU,EAAE,CAAC;QAE9C,OAAO,gBAAgB,CAAC,aAAa,CAAC;YACpC,GAAG,OAAO;YACV,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,KAAK,CAAC,YAAY,CAAC,UAA+B,EAAE;QAClD,SAAS,CAAC,W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C,UAA+B,EAAE;QAClD,SAAS,CAAC,WAAW,CAAC;YACpB,MAAM,EAAE,gBAAgB;SACzB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG;YACb,GAAG,OAAO;YACV,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;SACtD,CAAC;QAEF,OAAO,gBAAgB,CAAC,YAAY,CAAC,MAA6B,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,UAAU,CAAC,OAA0B;QACzC,SAAS,CAAC,WAAW,CAAC;YACpB,MAAM,EAAE,cAAc;SACvB,CAAC,CAAC;QAEH,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAE3B,OAAO,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,mBAAmB,CAAC,OAAmC;QAC3D,SAAS,CAAC,WAAW,CAAC;YACpB,MAAM,EAAE,uBAAuB;SAChC,CAAC,CAAC;QAEH,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;QAEhC,OAAO,gBAAgB,CAAC,0BAA0B,CAAC;YACjD,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;CACF"}
package/_esm/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const version = "1.41.0";
1
+ export const version = "1.42.0";
2
2
  //# sourceMappingURL=version.js.map
@@ -1,4 +1,4 @@
1
- import { type ValidateAccessTokenOptions, type ListEndUsersOptions, type CreateEndUserOptions } from "./endUser.types.js";
1
+ import { type ValidateAccessTokenOptions, type ListEndUsersOptions, type CreateEndUserOptions, type GetEndUserOptions } from "./endUser.types.js";
2
2
  import { type EndUser, type ListEndUsers200 } from "../../openapi-client/index.js";
3
3
  /**
4
4
  * The CDP end user client.
@@ -67,6 +67,22 @@ export declare class CDPEndUserClient {
67
67
  * ```
68
68
  */
69
69
  listEndUsers(options?: ListEndUsersOptions): Promise<ListEndUsers200>;
70
+ /**
71
+ * Gets an end user by their unique identifier.
72
+ *
73
+ * @param options - The options for getting an end user.
74
+ *
75
+ * @returns A promise that resolves to the end user.
76
+ *
77
+ * @example **Get an end user by ID**
78
+ * ```ts
79
+ * const endUser = await cdp.endUser.getEndUser({
80
+ * userId: "user-123"
81
+ * });
82
+ * console.log(endUser.userId);
83
+ * ```
84
+ */
85
+ getEndUser(options: GetEndUserOptions): Promise<EndUser>;
70
86
  /**
71
87
  * Validates an end user's access token. Throws an error if the access token is invalid.
72
88
  *
@@ -1 +1 @@
1
- {"version":3,"file":"endUser.d.ts","sourceRoot":"","sources":["../../../client/end-user/endUser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,eAAe,EACrB,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,qBAAa,gBAAgB;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAapE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;IAa/E;;;;;;OAMG;IACG,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC;CAWjF"}
1
+ {"version":3,"file":"endUser.d.ts","sourceRoot":"","sources":["../../../client/end-user/endUser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,eAAe,EACrB,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,qBAAa,gBAAgB;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAapE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;IAa/E;;;;;;;;;;;;;;OAcG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAU9D;;;;;;OAMG;IACG,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC;CAWjF"}
@@ -8,6 +8,15 @@ export interface ValidateAccessTokenOptions {
8
8
  */
9
9
  accessToken: string;
10
10
  }
11
+ /**
12
+ * The options for getting an end user.
13
+ */
14
+ export interface GetEndUserOptions {
15
+ /**
16
+ * The unique identifier of the end user to retrieve.
17
+ */
18
+ userId: string;
19
+ }
11
20
  /**
12
21
  * The options for listing end users.
13
22
  */
@@ -1 +1 @@
1
- {"version":3,"file":"endUser.types.d.ts","sourceRoot":"","sources":["../../../client/end-user/endUser.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC"}
1
+ {"version":3,"file":"endUser.types.d.ts","sourceRoot":"","sources":["../../../client/end-user/endUser.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "1.41.0";
1
+ export declare const version = "1.42.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -4,6 +4,7 @@ import {
4
4
  type ValidateAccessTokenOptions,
5
5
  type ListEndUsersOptions,
6
6
  type CreateEndUserOptions,
7
+ type GetEndUserOptions,
7
8
  } from "./endUser.types.js";
8
9
  import { Analytics } from "../../analytics.js";
9
10
  import {
@@ -103,6 +104,31 @@ export class CDPEndUserClient {
103
104
  return CdpOpenApiClient.listEndUsers(params as ListEndUsersOptions);
104
105
  }
105
106
 
107
+ /**
108
+ * Gets an end user by their unique identifier.
109
+ *
110
+ * @param options - The options for getting an end user.
111
+ *
112
+ * @returns A promise that resolves to the end user.
113
+ *
114
+ * @example **Get an end user by ID**
115
+ * ```ts
116
+ * const endUser = await cdp.endUser.getEndUser({
117
+ * userId: "user-123"
118
+ * });
119
+ * console.log(endUser.userId);
120
+ * ```
121
+ */
122
+ async getEndUser(options: GetEndUserOptions): Promise<EndUser> {
123
+ Analytics.trackAction({
124
+ action: "get_end_user",
125
+ });
126
+
127
+ const { userId } = options;
128
+
129
+ return CdpOpenApiClient.getEndUser(userId);
130
+ }
131
+
106
132
  /**
107
133
  * Validates an end user's access token. Throws an error if the access token is invalid.
108
134
  *
@@ -10,6 +10,16 @@ export interface ValidateAccessTokenOptions {
10
10
  accessToken: string;
11
11
  }
12
12
 
13
+ /**
14
+ * The options for getting an end user.
15
+ */
16
+ export interface GetEndUserOptions {
17
+ /**
18
+ * The unique identifier of the end user to retrieve.
19
+ */
20
+ userId: string;
21
+ }
22
+
13
23
  /**
14
24
  * The options for listing end users.
15
25
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-sdk",
3
- "version": "1.41.0",
3
+ "version": "1.42.0",
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",
package/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "1.41.0";
1
+ export const version = "1.42.0";