@tixprotocol/tdp-sdk 0.2.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.
@@ -0,0 +1,40 @@
1
+ // src/wallet-custody/http-error.ts
2
+ var WalletCustodyApiError = class extends Error {
3
+ kind;
4
+ route;
5
+ method;
6
+ path;
7
+ status;
8
+ statusText;
9
+ payload;
10
+ validationError;
11
+ constructor({
12
+ kind,
13
+ route,
14
+ method,
15
+ path,
16
+ status,
17
+ statusText,
18
+ payload,
19
+ validationError
20
+ }) {
21
+ super(
22
+ kind === "response-validation" ? `Wallet Custody API response failed validation: ${method} ${route} ${path} ${status} ${statusText}` : `Wallet Custody API request failed: ${method} ${route} ${path} ${status} ${statusText}`,
23
+ { cause: validationError }
24
+ );
25
+ this.name = "WalletCustodyApiError";
26
+ this.kind = kind;
27
+ this.route = route;
28
+ this.method = method;
29
+ this.path = path;
30
+ this.status = status;
31
+ this.statusText = statusText;
32
+ this.payload = payload;
33
+ this.validationError = validationError;
34
+ }
35
+ };
36
+
37
+ export {
38
+ WalletCustodyApiError
39
+ };
40
+ //# sourceMappingURL=chunk-RLIW34CX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/wallet-custody/http-error.ts"],"sourcesContent":["import type { z } from \"zod\";\n\nexport type WalletCustodyApiErrorKind = \"http-status\" | \"response-validation\";\n\nexport class WalletCustodyApiError extends Error {\n readonly kind: WalletCustodyApiErrorKind;\n readonly route: string;\n readonly method: string;\n readonly path: string;\n readonly status: number;\n readonly statusText: string;\n readonly payload: unknown;\n readonly validationError?: z.ZodError;\n\n constructor({\n kind,\n route,\n method,\n path,\n status,\n statusText,\n payload,\n validationError,\n }: {\n kind: WalletCustodyApiErrorKind;\n route: string;\n method: string;\n path: string;\n status: number;\n statusText: string;\n payload: unknown;\n validationError?: z.ZodError;\n }) {\n super(\n kind === \"response-validation\"\n ? `Wallet Custody API response failed validation: ${method} ${route} ${path} ${status} ${statusText}`\n : `Wallet Custody API request failed: ${method} ${route} ${path} ${status} ${statusText}`,\n { cause: validationError },\n );\n\n this.name = \"WalletCustodyApiError\";\n this.kind = kind;\n this.route = route;\n this.method = method;\n this.path = path;\n this.status = status;\n this.statusText = statusText;\n this.payload = payload;\n this.validationError = validationError;\n }\n}\n"],"mappings":";AAIO,IAAM,wBAAN,cAAoC,MAAM;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GASG;AACD;AAAA,MACE,SAAS,wBACL,kDAAkD,MAAM,IAAI,KAAK,IAAI,IAAI,IAAI,MAAM,IAAI,UAAU,KACjG,sCAAsC,MAAM,IAAI,KAAK,IAAI,IAAI,IAAI,MAAM,IAAI,UAAU;AAAA,MACzF,EAAE,OAAO,gBAAgB;AAAA,IAC3B;AAEA,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,SAAK,SAAS;AACd,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,UAAU;AACf,SAAK,kBAAkB;AAAA,EACzB;AACF;","names":[]}
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+
3
+ type WalletCustodyApiErrorKind = "http-status" | "response-validation";
4
+ declare class WalletCustodyApiError extends Error {
5
+ readonly kind: WalletCustodyApiErrorKind;
6
+ readonly route: string;
7
+ readonly method: string;
8
+ readonly path: string;
9
+ readonly status: number;
10
+ readonly statusText: string;
11
+ readonly payload: unknown;
12
+ readonly validationError?: z.ZodError;
13
+ constructor({ kind, route, method, path, status, statusText, payload, validationError, }: {
14
+ kind: WalletCustodyApiErrorKind;
15
+ route: string;
16
+ method: string;
17
+ path: string;
18
+ status: number;
19
+ statusText: string;
20
+ payload: unknown;
21
+ validationError?: z.ZodError;
22
+ });
23
+ }
24
+
25
+ export { WalletCustodyApiError, type WalletCustodyApiErrorKind };
package/dist/errors.js ADDED
@@ -0,0 +1,7 @@
1
+ import {
2
+ WalletCustodyApiError
3
+ } from "./chunk-RLIW34CX.js";
4
+ export {
5
+ WalletCustodyApiError
6
+ };
7
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}