@coinbase/cdp-api-client 0.0.123 → 0.0.125
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/dist/esm/index.js +149 -134
- package/dist/esm/index11.js +1 -1
- package/dist/esm/index13.js +7 -38
- package/dist/esm/index15.js +358 -67
- package/dist/esm/index16.js +852 -34
- package/dist/esm/index17.js +38 -14
- package/dist/esm/index18.js +2 -8
- package/dist/esm/index19.js +70 -2
- package/dist/esm/index20.js +29 -355
- package/dist/esm/index21.js +14 -852
- package/dist/esm/index22.js +2 -2
- package/dist/esm/index23.js +2 -2
- package/dist/esm/index24.js +2 -2
- package/dist/esm/index3.js +1 -1
- package/dist/esm/index4.js +1 -1
- package/dist/esm/index5.js +115 -85
- package/dist/esm/index6.js +220 -199
- package/dist/esm/index7.js +22 -15
- package/dist/esm/index8.js +184 -124
- package/dist/types/index.d.ts +699 -17
- package/package.json +1 -1
package/dist/esm/index7.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const d = {
|
|
2
2
|
unexpected_error: "unexpected_error",
|
|
3
3
|
unauthorized: "unauthorized",
|
|
4
4
|
not_found: "not_found",
|
|
@@ -6,12 +6,18 @@ const u = {
|
|
|
6
6
|
service_unavailable: "service_unavailable",
|
|
7
7
|
unknown: "unknown"
|
|
8
8
|
};
|
|
9
|
-
class
|
|
9
|
+
class c extends Error {
|
|
10
10
|
statusCode;
|
|
11
11
|
errorType;
|
|
12
12
|
errorMessage;
|
|
13
13
|
correlationId;
|
|
14
14
|
errorLink;
|
|
15
|
+
/**
|
|
16
|
+
* Response headers, lowercase-keyed (e.g. `x-mfa-challenge-id`). Never included in
|
|
17
|
+
* {@link toJSON}. Multi-value headers (e.g. `set-cookie`) come back as arrays; callers
|
|
18
|
+
* must guard with `Array.isArray` before treating a value as a string.
|
|
19
|
+
*/
|
|
20
|
+
headers;
|
|
15
21
|
/**
|
|
16
22
|
* Constructor for the APIError class
|
|
17
23
|
*
|
|
@@ -21,9 +27,10 @@ class a extends Error {
|
|
|
21
27
|
* @param correlationId - The correlation ID
|
|
22
28
|
* @param errorLink - URL to documentation about this error
|
|
23
29
|
* @param cause - The cause of the error
|
|
30
|
+
* @param headers - The response headers, lowercase-keyed
|
|
24
31
|
*/
|
|
25
|
-
constructor(e, o, n, t,
|
|
26
|
-
super(n, { cause:
|
|
32
|
+
constructor(e, o, n, s, t, a, i) {
|
|
33
|
+
super(n, { cause: a }), this.name = "APIError", this.statusCode = e, this.errorType = o, this.errorMessage = n, s !== void 0 && (this.correlationId = s), t !== void 0 && (this.errorLink = t), i !== void 0 && (this.headers = i);
|
|
27
34
|
}
|
|
28
35
|
/**
|
|
29
36
|
* Convert the error to a JSON object, excluding undefined properties
|
|
@@ -41,7 +48,7 @@ class a extends Error {
|
|
|
41
48
|
};
|
|
42
49
|
}
|
|
43
50
|
}
|
|
44
|
-
class
|
|
51
|
+
class l extends c {
|
|
45
52
|
/**
|
|
46
53
|
* Constructor for the UnknownApiError class
|
|
47
54
|
*
|
|
@@ -53,7 +60,7 @@ class d extends a {
|
|
|
53
60
|
super(0, e, o, void 0, void 0, n), this.name = "UnknownApiError";
|
|
54
61
|
}
|
|
55
62
|
}
|
|
56
|
-
class
|
|
63
|
+
class h extends Error {
|
|
57
64
|
/**
|
|
58
65
|
* Constructor for the UnknownError class
|
|
59
66
|
*
|
|
@@ -67,7 +74,7 @@ class l extends Error {
|
|
|
67
74
|
function E(r) {
|
|
68
75
|
return r !== null && typeof r == "object" && "errorType" in r && typeof r.errorType == "string" && "errorMessage" in r && typeof r.errorMessage == "string";
|
|
69
76
|
}
|
|
70
|
-
class
|
|
77
|
+
class p extends Error {
|
|
71
78
|
/** Stable discriminator used for cross-package detection. */
|
|
72
79
|
code = "CDP_REFRESH_TOKEN_UNAVAILABLE";
|
|
73
80
|
/**
|
|
@@ -86,14 +93,14 @@ class h extends Error {
|
|
|
86
93
|
super(o ?? `Refresh token unavailable in local storage (${e})`), this.name = "RefreshTokenUnavailableError", this.outcome = e;
|
|
87
94
|
}
|
|
88
95
|
}
|
|
89
|
-
const
|
|
96
|
+
const T = (r) => typeof r == "object" && r !== null && r.code === "CDP_REFRESH_TOKEN_UNAVAILABLE", u = /user interaction is not allowed/i, _ = (r) => r.outcome === "error" && u.test(r.message ?? "");
|
|
90
97
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
c as APIError,
|
|
99
|
+
d as HttpErrorType,
|
|
100
|
+
p as RefreshTokenUnavailableError,
|
|
101
|
+
l as UnknownApiError,
|
|
102
|
+
h as UnknownError,
|
|
96
103
|
E as isOpenAPIError,
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
T as isRefreshTokenUnavailableError,
|
|
105
|
+
_ as isTransientTokenReadError
|
|
99
106
|
};
|