@codedartdev/coinsentry-sdk 0.1.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.
Files changed (66) hide show
  1. package/README.md +271 -0
  2. package/dist/brand/config.d.ts +78 -0
  3. package/dist/brand/config.d.ts.map +1 -0
  4. package/dist/brand/config.js +274 -0
  5. package/dist/brand/config.js.map +1 -0
  6. package/dist/brand/index.d.ts +4 -0
  7. package/dist/brand/index.d.ts.map +1 -0
  8. package/dist/brand/index.js +2 -0
  9. package/dist/brand/index.js.map +1 -0
  10. package/dist/brand/types.d.ts +122 -0
  11. package/dist/brand/types.d.ts.map +1 -0
  12. package/dist/brand/types.js +2 -0
  13. package/dist/brand/types.js.map +1 -0
  14. package/dist/client.d.ts +169 -0
  15. package/dist/client.d.ts.map +1 -0
  16. package/dist/client.js +239 -0
  17. package/dist/client.js.map +1 -0
  18. package/dist/errors.d.ts +32 -0
  19. package/dist/errors.d.ts.map +1 -0
  20. package/dist/errors.js +143 -0
  21. package/dist/errors.js.map +1 -0
  22. package/dist/guards.d.ts +12 -0
  23. package/dist/guards.d.ts.map +1 -0
  24. package/dist/guards.js +76 -0
  25. package/dist/guards.js.map +1 -0
  26. package/dist/http.d.ts +38 -0
  27. package/dist/http.d.ts.map +1 -0
  28. package/dist/http.js +175 -0
  29. package/dist/http.js.map +1 -0
  30. package/dist/index.d.ts +16 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +8 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/kyc/config.d.ts +20 -0
  35. package/dist/kyc/config.d.ts.map +1 -0
  36. package/dist/kyc/config.js +224 -0
  37. package/dist/kyc/config.js.map +1 -0
  38. package/dist/kyc/flow.d.ts +37 -0
  39. package/dist/kyc/flow.d.ts.map +1 -0
  40. package/dist/kyc/flow.js +329 -0
  41. package/dist/kyc/flow.js.map +1 -0
  42. package/dist/kyc/index.d.ts +6 -0
  43. package/dist/kyc/index.d.ts.map +1 -0
  44. package/dist/kyc/index.js +4 -0
  45. package/dist/kyc/index.js.map +1 -0
  46. package/dist/kyc/locale.d.ts +17 -0
  47. package/dist/kyc/locale.d.ts.map +1 -0
  48. package/dist/kyc/locale.js +40 -0
  49. package/dist/kyc/locale.js.map +1 -0
  50. package/dist/kyc/types.d.ts +289 -0
  51. package/dist/kyc/types.d.ts.map +1 -0
  52. package/dist/kyc/types.js +2 -0
  53. package/dist/kyc/types.js.map +1 -0
  54. package/dist/products.d.ts +280 -0
  55. package/dist/products.d.ts.map +1 -0
  56. package/dist/products.js +302 -0
  57. package/dist/products.js.map +1 -0
  58. package/dist/realtime.d.ts +33 -0
  59. package/dist/realtime.d.ts.map +1 -0
  60. package/dist/realtime.js +28 -0
  61. package/dist/realtime.js.map +1 -0
  62. package/dist/types.d.ts +145 -0
  63. package/dist/types.d.ts.map +1 -0
  64. package/dist/types.js +2 -0
  65. package/dist/types.js.map +1 -0
  66. package/package.json +46 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/brand/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,WAAW,EACX,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { buildBrandCss, buildBrandIconsMetadata, buildBrandManifest, fontSansToCssFamily, getBrandCssVariables, getBrandFaviconUrl, getLogoImageUrl, getLogoTextColors, getLogoTextFontFamily, inferImageMimeType, isImageLogoType, normalizeBrandConfig, normalizeFontSans, normalizeLogoDimension, normalizeLogoLayout, normalizeLogoType, resolveBrandThemeMode, } from './config.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/brand/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,aAAa,CAAC","sourcesContent":["export type {\n BackendBrandLogoType,\n BrandConfig,\n BrandLogoType,\n ColorSet,\n DeepPartial,\n SecurityTxtConfig,\n} from './types.js';\n\nexport {\n buildBrandCss,\n buildBrandIconsMetadata,\n buildBrandManifest,\n fontSansToCssFamily,\n getBrandCssVariables,\n getBrandFaviconUrl,\n getLogoImageUrl,\n getLogoTextColors,\n getLogoTextFontFamily,\n inferImageMimeType,\n isImageLogoType,\n normalizeBrandConfig,\n normalizeFontSans,\n normalizeLogoDimension,\n normalizeLogoLayout,\n normalizeLogoType,\n resolveBrandThemeMode,\n} from './config.js';\n\nexport type {\n BrandIconDescriptor,\n BrandManifestIcon,\n BrandMode,\n BrandWebManifest,\n NormalizedLogoLayout,\n} from './config.js';\n"]}
@@ -0,0 +1,122 @@
1
+ export interface SecurityTxtConfig {
2
+ contact?: string | string[];
3
+ contacts?: string[];
4
+ canonical?: string;
5
+ expires?: string;
6
+ policy?: string;
7
+ preferredLanguages?: string | string[];
8
+ }
9
+ export type BrandLogoType = 'text' | 'image';
10
+ export type BackendBrandLogoType = BrandLogoType | 'url' | 'upload';
11
+ /** Shape of the canonical payload returned by GET /api/brand/theme. */
12
+ export interface BrandConfig {
13
+ brand: {
14
+ name: string;
15
+ logo: {
16
+ /** Backend may still send url/upload; the frontend normalizes those to image. */
17
+ type: BackendBrandLogoType;
18
+ text: {
19
+ base: string;
20
+ accent: string;
21
+ fontFamily?: string | null;
22
+ colors?: {
23
+ light?: {
24
+ base?: string | null;
25
+ accent?: string | null;
26
+ };
27
+ dark?: {
28
+ base?: string | null;
29
+ accent?: string | null;
30
+ };
31
+ };
32
+ };
33
+ imageUrl: string | null;
34
+ darkImageUrl?: string | null;
35
+ layout?: {
36
+ width?: string | number | null;
37
+ height?: string | number | null;
38
+ } | null;
39
+ };
40
+ tagline: string;
41
+ description: string;
42
+ };
43
+ /** Browser title and meta-description per locale.
44
+ * Keys are BCP-47 locale strings matching the locales array in i18n/config.ts */
45
+ seo: {
46
+ title: Record<string, string>;
47
+ description: Record<string, string>;
48
+ };
49
+ favicon: {
50
+ default: string | null;
51
+ dark?: string | null;
52
+ };
53
+ /** Default application locale (BCP-47). Must be one of the values in i18n/config.ts */
54
+ defaultLocale: string;
55
+ availableLocales?: string[];
56
+ theme: {
57
+ defaultMode: 'light' | 'dark' | 'system';
58
+ font: {
59
+ sans: string;
60
+ };
61
+ radius: string;
62
+ colors: {
63
+ light: ColorSet;
64
+ dark: ColorSet;
65
+ };
66
+ };
67
+ /** Left branding panel used in login / register split-screen layout */
68
+ authPanel: {
69
+ /** Main panel background colour (hex). A darker gradient is derived from it. */
70
+ background: string;
71
+ /** Radial glow accent colour (hex). Applied at low opacity as a centre highlight. */
72
+ accentGlow: string;
73
+ };
74
+ /** Feature flags — all optional; defaults to disabled when absent */
75
+ features?: {
76
+ /** Show CPF field in the registration form (Brasil-specific). Default: false */
77
+ registerCpf?: boolean;
78
+ };
79
+ registration_document?: {
80
+ collect_tax_id?: boolean;
81
+ field?: string;
82
+ required?: boolean;
83
+ read_only_after_registration?: boolean;
84
+ };
85
+ client_flow?: Array<{
86
+ screen?: string;
87
+ collect_tax_id?: boolean;
88
+ [key: string]: unknown;
89
+ }>;
90
+ compliance_config?: {
91
+ client_flow?: Array<{
92
+ screen?: string;
93
+ collect_tax_id?: boolean;
94
+ [key: string]: unknown;
95
+ }>;
96
+ [key: string]: unknown;
97
+ };
98
+ flow_config?: {
99
+ compliance_config?: {
100
+ client_flow?: Array<{
101
+ screen?: string;
102
+ collect_tax_id?: boolean;
103
+ [key: string]: unknown;
104
+ }>;
105
+ [key: string]: unknown;
106
+ };
107
+ [key: string]: unknown;
108
+ };
109
+ securityTxt?: SecurityTxtConfig;
110
+ security_txt?: SecurityTxtConfig;
111
+ }
112
+ export interface ColorSet {
113
+ primary: string;
114
+ primaryForeground: string;
115
+ background: string;
116
+ foreground: string;
117
+ }
118
+ /** Utility: deep-partial for update patches */
119
+ export type DeepPartial<T> = {
120
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
121
+ };
122
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/brand/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACxC;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,CAAC;AAC7C,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEpE,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE;YAC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AO,CAAC;gBACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;aACxB,CAAC,CAAC;YACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;QACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAClC;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,+CAA+C;AAC/C,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/brand/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface SecurityTxtConfig {\n contact?: string | string[];\n contacts?: string[];\n canonical?: string;\n expires?: string;\n policy?: string;\n preferredLanguages?: string | string[];\n}\n\nexport type BrandLogoType = 'text' | 'image';\nexport type BackendBrandLogoType = BrandLogoType | 'url' | 'upload';\n\n/** Shape of the canonical payload returned by GET /api/brand/theme. */\nexport interface BrandConfig {\n brand: {\n name: string;\n logo: {\n /** Backend may still send url/upload; the frontend normalizes those to image. */\n type: BackendBrandLogoType;\n text: {\n base: string;\n accent: string;\n fontFamily?: string | null;\n colors?: {\n light?: {\n base?: string | null;\n accent?: string | null;\n };\n dark?: {\n base?: string | null;\n accent?: string | null;\n };\n };\n };\n imageUrl: string | null;\n darkImageUrl?: string | null;\n layout?: {\n width?: string | number | null;\n height?: string | number | null;\n } | null;\n };\n tagline: string;\n description: string;\n };\r\n /** Browser title and meta-description per locale.\r\n * Keys are BCP-47 locale strings matching the locales array in i18n/config.ts */\r\n seo: {\r\n title: Record<string, string>;\r\n description: Record<string, string>;\r\n };\r\n favicon: {\n default: string | null;\n dark?: string | null;\n };\n /** Default application locale (BCP-47). Must be one of the values in i18n/config.ts */\n defaultLocale: string;\n availableLocales?: string[];\n theme: {\r\n defaultMode: 'light' | 'dark' | 'system';\r\n font: {\r\n sans: string;\r\n };\r\n radius: string;\r\n colors: {\r\n light: ColorSet;\r\n dark: ColorSet;\r\n };\r\n };\r\n /** Left branding panel used in login / register split-screen layout */\r\n authPanel: {\r\n /** Main panel background colour (hex). A darker gradient is derived from it. */\r\n background: string;\r\n /** Radial glow accent colour (hex). Applied at low opacity as a centre highlight. */\r\n accentGlow: string;\r\n };\r\n /** Feature flags — all optional; defaults to disabled when absent */\r\n features?: {\n /** Show CPF field in the registration form (Brasil-specific). Default: false */\n registerCpf?: boolean;\n };\n registration_document?: {\n collect_tax_id?: boolean;\n field?: string;\n required?: boolean;\n read_only_after_registration?: boolean;\n };\n client_flow?: Array<{\n screen?: string;\n collect_tax_id?: boolean;\n [key: string]: unknown;\n }>;\n compliance_config?: {\n client_flow?: Array<{\n screen?: string;\n collect_tax_id?: boolean;\n [key: string]: unknown;\n }>;\n [key: string]: unknown;\n };\n flow_config?: {\n compliance_config?: {\n client_flow?: Array<{\n screen?: string;\n collect_tax_id?: boolean;\n [key: string]: unknown;\n }>;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n };\n securityTxt?: SecurityTxtConfig;\n security_txt?: SecurityTxtConfig;\n}\n\r\nexport interface ColorSet {\r\n primary: string;\r\n primaryForeground: string;\r\n background: string;\r\n foreground: string;\r\n}\r\n\r\n/** Utility: deep-partial for update patches */\r\nexport type DeepPartial<T> = {\r\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\r\n};\r\n"]}
@@ -0,0 +1,169 @@
1
+ import { type CoinSentryError } from './errors.js';
2
+ import { type CoinSentryHttpAdapter, type CoinSentryHttpRequest } from './http.js';
3
+ import { type CoinSentryPasswordResetPayload, type CoinSentryResetPasswordPayload } from './products.js';
4
+ import type { CoinSentryBrandConfig, CoinSentryEntity, CoinSentryLoginResponse, CoinSentryRegisterPayload, CoinSentrySelectEntityResponse, CoinSentrySession } from './types.js';
5
+ import type { ClientFlowStep, KycFlowScreen, KycOverviewData, KycVerificationData } from './kyc/index.js';
6
+ export type CoinSentryClientOptions = {
7
+ baseUrl?: string;
8
+ locale?: string;
9
+ timeoutMs?: number;
10
+ http?: CoinSentryHttpAdapter;
11
+ onError?: (error: CoinSentryError) => void;
12
+ };
13
+ export type CoinSentryCsrfInitOptions = {
14
+ force?: boolean;
15
+ staleMs?: number;
16
+ };
17
+ export type CoinSentryLoginPayload = {
18
+ email: string;
19
+ password: string;
20
+ slideCaptchaToken: string;
21
+ };
22
+ export type CoinSentryTwoFactorPayload = {
23
+ code: string;
24
+ recovery?: boolean;
25
+ };
26
+ export type { CoinSentryPasswordResetPayload, CoinSentryResetPasswordPayload, } from './products.js';
27
+ export type CoinSentryEntitySelectPayload = {
28
+ entityUuid: string;
29
+ entityId?: never;
30
+ } | {
31
+ entityId: number;
32
+ entityUuid?: never;
33
+ };
34
+ export type CoinSentryKycSubmitPayload = {
35
+ step?: ClientFlowStep | null;
36
+ stepKey?: string;
37
+ screen?: KycFlowScreen;
38
+ payload?: unknown;
39
+ };
40
+ export type CoinSentryKycUploadPayload = {
41
+ step?: ClientFlowStep | null;
42
+ stepKey?: string;
43
+ screen?: KycFlowScreen;
44
+ formData: FormData;
45
+ };
46
+ export type CoinSentryClient = ReturnType<typeof createCoinSentryClient>;
47
+ export declare function createCoinSentryClient(options?: CoinSentryClientOptions): {
48
+ account: {
49
+ twoFactor: {
50
+ enable: () => Promise<unknown>;
51
+ qrCode: () => Promise<{
52
+ svg: string;
53
+ }>;
54
+ confirm: (code: string) => Promise<unknown>;
55
+ recoveryCodes: () => Promise<string[]>;
56
+ regenerateRecoveryCodes: () => Promise<string[]>;
57
+ disable: () => Promise<unknown>;
58
+ status: () => Promise<import("./products.js").CoinSentryTwoFactorStatus>;
59
+ };
60
+ };
61
+ contacts: {
62
+ bank: {
63
+ list: <T = unknown>(options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
64
+ create: <T = unknown>(payload: unknown) => Promise<T>;
65
+ delete: (id: number) => Promise<unknown>;
66
+ };
67
+ banks: {
68
+ list: <T = unknown>(options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
69
+ };
70
+ wallet: {
71
+ getByNetwork: <T = unknown>(network: string, options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
72
+ create: <T = unknown>(payload: unknown) => Promise<T>;
73
+ update: <T = unknown>(payload: unknown) => Promise<T>;
74
+ };
75
+ };
76
+ deposits: {
77
+ get: <T = unknown>(currency: string, options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
78
+ createIntent: <T = unknown>(payload: unknown) => Promise<T>;
79
+ };
80
+ withdrawals: {
81
+ get: <T = unknown>(currency: string, options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
82
+ fiat: <T = unknown>(payload: unknown) => Promise<T>;
83
+ crypto: <T = unknown>(payload: unknown) => Promise<T>;
84
+ networkFee: <T = unknown>(query: import("./products.js").CoinSentryQuery, options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
85
+ };
86
+ payments: {
87
+ getCurrencies: <T = unknown>(options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
88
+ getHistory: <T = unknown>(query?: import("./products.js").CoinSentryPaginationParams, options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
89
+ createReceiveIntent: <T = unknown>(payload: unknown) => Promise<T>;
90
+ getReceiveStatus: <T = unknown>(id: string, options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
91
+ lookup: <T = unknown>(payload: unknown) => Promise<T>;
92
+ pay: <T = unknown>(payload: unknown) => Promise<T>;
93
+ };
94
+ affiliate: {
95
+ getCode: <T = unknown>(options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
96
+ getStatus: <T = unknown>(options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
97
+ getReferrals: <T = unknown>(query?: import("./products.js").CoinSentryPaginationParams, options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
98
+ getPayouts: <T = unknown>(query?: import("./products.js").CoinSentryPaginationParams & {
99
+ type?: string;
100
+ }, options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
101
+ getRankingsByValueReceived: <T = unknown>(options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
102
+ getRankingsByActiveReferrals: <T = unknown>(options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
103
+ };
104
+ market: {
105
+ getOrderbook: <T = unknown>(symbol: string, depth?: number, options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
106
+ getMarket: <T = unknown>(symbol: string, options?: import("./products.js").CoinSentryRequestOptions) => Promise<T>;
107
+ createOrder: <T = unknown>(payload: unknown) => Promise<T>;
108
+ cancelOrder: (orderId: number) => Promise<unknown>;
109
+ cancelAllOrders: (symbol: string) => Promise<unknown>;
110
+ };
111
+ otc: {
112
+ createQuote: (payload: import("./products.js").CoinSentryOtcConvertQuoteRequest) => Promise<import("./products.js").CoinSentryOtcConvertQuote>;
113
+ executeConvert: (payload: import("./products.js").CoinSentryOtcConvertExecuteRequest) => Promise<import("./products.js").CoinSentryOtcConvertResult>;
114
+ getConvertHistory: (query?: import("./products.js").CoinSentryPaginationParams) => Promise<{
115
+ data: import("./products.js").CoinSentryOtcConvertResult[];
116
+ meta: import("./products.js").CoinSentryPaginationMeta;
117
+ }>;
118
+ activateQuote: (quoteId: string) => Promise<unknown>;
119
+ deactivateQuote: (quoteId: string) => Promise<unknown>;
120
+ getRecurringPlans: (query?: {
121
+ status?: string;
122
+ }) => Promise<import("./products.js").CoinSentryOtcRecurringPlan[]>;
123
+ createRecurringPlan: (payload: import("./products.js").CoinSentryOtcRecurringPlanRequest) => Promise<import("./products.js").CoinSentryOtcRecurringPlan>;
124
+ getRecurringPlan: (id: number) => Promise<import("./products.js").CoinSentryOtcRecurringPlan>;
125
+ updateRecurringPlan: (id: number, payload: Partial<import("./products.js").CoinSentryOtcRecurringPlanRequest>) => Promise<import("./products.js").CoinSentryOtcRecurringPlan>;
126
+ cancelRecurringPlan: (id: number) => Promise<unknown>;
127
+ pauseRecurringPlan: (id: number) => Promise<import("./products.js").CoinSentryOtcRecurringPlan>;
128
+ activateRecurringPlan: (id: number) => Promise<import("./products.js").CoinSentryOtcRecurringPlan>;
129
+ getRecurringExecutions: (id: number, query?: import("./products.js").CoinSentryPaginationParams) => Promise<{
130
+ data: import("./products.js").CoinSentryOtcRecurringExecution[];
131
+ meta: import("./products.js").CoinSentryPaginationMeta;
132
+ }>;
133
+ getTradingPairs: (symbol?: string) => Promise<import("./products.js").CoinSentryOtcTradingPairsResponse>;
134
+ };
135
+ request: <T>(input: CoinSentryHttpRequest) => Promise<T>;
136
+ locale: {
137
+ set: (locale: string | null | undefined) => void;
138
+ setKyc: (locale: string | null | undefined) => void;
139
+ clearKyc: () => void;
140
+ };
141
+ csrf: {
142
+ init: (initOptions?: CoinSentryCsrfInitOptions) => Promise<void>;
143
+ };
144
+ auth: {
145
+ login(payload: CoinSentryLoginPayload): Promise<CoinSentryLoginResponse>;
146
+ register(payload: CoinSentryRegisterPayload): Promise<unknown>;
147
+ requestPasswordReset(payload: CoinSentryPasswordResetPayload): Promise<unknown>;
148
+ resetPassword(payload: CoinSentryResetPasswordPayload): Promise<unknown>;
149
+ logout(): Promise<unknown>;
150
+ twoFactorChallenge(payload: CoinSentryTwoFactorPayload): Promise<CoinSentryLoginResponse>;
151
+ };
152
+ session: {
153
+ refresh(): Promise<CoinSentrySession>;
154
+ };
155
+ entity: {
156
+ list(): Promise<CoinSentryEntity[]>;
157
+ select(payload: CoinSentryEntitySelectPayload): Promise<CoinSentrySelectEntityResponse>;
158
+ };
159
+ kyc: {
160
+ getOverview(): Promise<KycOverviewData>;
161
+ getStatus(): Promise<KycVerificationData>;
162
+ submitStep(input: CoinSentryKycSubmitPayload): Promise<unknown>;
163
+ upload(input: CoinSentryKycUploadPayload): Promise<unknown>;
164
+ };
165
+ brand: {
166
+ getConfig(): Promise<CoinSentryBrandConfig>;
167
+ };
168
+ };
169
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEjG,OAAO,EAAoB,KAAK,qBAAqB,EAAE,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACrG,OAAO,EAEL,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACpC,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EACzB,8BAA8B,EAC9B,iBAAiB,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1G,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAA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M,GAAG,IAAI,GAAG,SAAS,KAAG,IAAI;yBAI7B,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,IAAI;wBAInC,IAAI;;;6BA9BM,yBAAyB,KAAQ,OAAO,CAAC,IAAI,CAAC;;;uBA+C1D,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;0BAetD,yBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC;sCAShC,8BAA8B,GAAG,OAAO,CAAC,OAAO,CAAC;+BAaxD,8BAA8B,GAAG,OAAO,CAAC,OAAO,CAAC;kBAS9D,OAAO,CAAC,OAAO,CAAC;oCAGE,0BAA0B,GAAG,OAAO,CAAC,uBAAuB,CAAC;;;mBAc9E,OAAO,CAAC,iBAAiB,CAAC;;;gBAK7B,OAAO,CAAC,gBAAgB,EAAE,CAAC;wBAOnB,6BAA6B,GAAG,OAAO,CAAC,8BAA8B,CAAC;;;uBAWxE,OAAO,CAAC,eAAe,CAAC;qBAO1B,OAAO,CAAC,mBAAmB,CAAC;0BAOvB,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC;sBAOjD,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC;;;qBAS9C,OAAO,CAAC,qBAAqB,CAAC;;EAgBtD"}
package/dist/client.js ADDED
@@ -0,0 +1,239 @@
1
+ import { CoinSentryApiError, normalizeCoinSentryError } from './errors.js';
2
+ import { normalizeCoinSentryLoginResponse } from './guards.js';
3
+ import { FetchHttpAdapter } from './http.js';
4
+ import { createCoinSentryProductServices, } from './products.js';
5
+ const DEFAULT_CSRF_STALE_MS = 120_000;
6
+ const KYC_STEP_ENDPOINTS = {
7
+ account: '/api/v1/kyc/email',
8
+ email: '/api/v1/kyc/email',
9
+ phone: '/api/v1/kyc/phone',
10
+ personal_data: '/api/v1/kyc/profile',
11
+ tax_profile: '/api/v1/kyc/profile',
12
+ company_data: '/api/v1/kyc/company-data',
13
+ beneficial_owners: '/api/v1/kyc/beneficial-owners',
14
+ transaction_profile: '/api/v1/kyc/transaction-profile',
15
+ address: '/api/v1/kyc/address',
16
+ document_upload: '/api/v1/kyc/document-photo',
17
+ selfie: '/api/v1/kyc/selfie',
18
+ review: '/api/v1/kyc/submit',
19
+ };
20
+ function createContractError(message) {
21
+ return new CoinSentryApiError({
22
+ code: 'validation_failed',
23
+ status: 0,
24
+ message,
25
+ });
26
+ }
27
+ function assertKycEndpoint(endpoint) {
28
+ if (!endpoint.startsWith('/api/v1/kyc/')) {
29
+ throw createContractError('KYC endpoint must stay inside /api/v1/kyc');
30
+ }
31
+ return endpoint;
32
+ }
33
+ function resolveKycEndpoint(input) {
34
+ const screen = input.screen ?? input.step?.screen;
35
+ const endpoint = input.step?.endpoint ?? (screen ? KYC_STEP_ENDPOINTS[screen] : undefined);
36
+ if (!endpoint) {
37
+ throw createContractError(`Unsupported KYC screen: ${screen ?? 'unknown'}`);
38
+ }
39
+ return assertKycEndpoint(endpoint);
40
+ }
41
+ function unwrapEnvelopeData(payload) {
42
+ if (payload
43
+ && typeof payload === 'object'
44
+ && 'data' in payload
45
+ && payload.data !== undefined) {
46
+ return payload.data;
47
+ }
48
+ return payload;
49
+ }
50
+ export function createCoinSentryClient(options = {}) {
51
+ const http = options.http ?? new FetchHttpAdapter({
52
+ baseUrl: options.baseUrl ?? '/',
53
+ locale: options.locale,
54
+ timeoutMs: options.timeoutMs,
55
+ });
56
+ let csrfInitPromise = null;
57
+ let csrfInitializedAt = 0;
58
+ async function request(input) {
59
+ try {
60
+ return await http.request(input);
61
+ }
62
+ catch (error) {
63
+ const normalized = normalizeCoinSentryError(error);
64
+ options.onError?.(normalized.toJSON());
65
+ throw normalized;
66
+ }
67
+ }
68
+ async function initCsrf(initOptions = {}) {
69
+ const staleMs = initOptions.staleMs ?? DEFAULT_CSRF_STALE_MS;
70
+ const now = Date.now();
71
+ if (csrfInitPromise)
72
+ return csrfInitPromise;
73
+ if (!initOptions.force && csrfInitializedAt > 0 && now - csrfInitializedAt < staleMs) {
74
+ return;
75
+ }
76
+ csrfInitPromise = request({
77
+ method: 'GET',
78
+ path: '/sanctum/csrf-cookie',
79
+ retryOnCsrf: false,
80
+ }).then(() => {
81
+ csrfInitializedAt = Date.now();
82
+ }).finally(() => {
83
+ csrfInitPromise = null;
84
+ });
85
+ return csrfInitPromise;
86
+ }
87
+ function setLocale(locale) {
88
+ http.setLocale?.(locale);
89
+ }
90
+ function setKycLocale(locale) {
91
+ http.setKycLocale?.(locale);
92
+ }
93
+ function clearKycLocale() {
94
+ http.clearKycLocale?.();
95
+ }
96
+ const productServices = createCoinSentryProductServices(request);
97
+ return {
98
+ request,
99
+ locale: {
100
+ set: setLocale,
101
+ setKyc: setKycLocale,
102
+ clearKyc: clearKycLocale,
103
+ },
104
+ csrf: {
105
+ init: initCsrf,
106
+ },
107
+ auth: {
108
+ async login(payload) {
109
+ await initCsrf({ force: true });
110
+ const response = await request({
111
+ method: 'POST',
112
+ path: '/auth/login',
113
+ retryOnCsrf: false,
114
+ body: {
115
+ email: payload.email,
116
+ password: payload.password,
117
+ slide_captcha_token: payload.slideCaptchaToken,
118
+ slide_captcha_verified: '1',
119
+ },
120
+ });
121
+ return normalizeCoinSentryLoginResponse(response);
122
+ },
123
+ async register(payload) {
124
+ await initCsrf({ force: true });
125
+ return request({
126
+ method: 'POST',
127
+ path: '/auth/register',
128
+ retryOnCsrf: false,
129
+ body: payload,
130
+ });
131
+ },
132
+ async requestPasswordReset(payload) {
133
+ await initCsrf({ force: true });
134
+ return request({
135
+ method: 'POST',
136
+ path: '/auth/forgot-password',
137
+ retryOnCsrf: false,
138
+ body: {
139
+ email: payload.email,
140
+ slide_captcha_token: payload.slideCaptchaToken,
141
+ slide_captcha_verified: '1',
142
+ },
143
+ });
144
+ },
145
+ async resetPassword(payload) {
146
+ await initCsrf({ force: true });
147
+ return request({
148
+ method: 'POST',
149
+ path: '/auth/reset-password',
150
+ retryOnCsrf: false,
151
+ body: payload,
152
+ });
153
+ },
154
+ async logout() {
155
+ return request({ method: 'POST', path: '/auth/logout' });
156
+ },
157
+ async twoFactorChallenge(payload) {
158
+ await initCsrf({ force: true });
159
+ const response = await request({
160
+ method: 'POST',
161
+ path: '/auth/two-factor-challenge',
162
+ retryOnCsrf: false,
163
+ body: payload.recovery
164
+ ? { recovery_code: payload.code }
165
+ : { code: payload.code },
166
+ });
167
+ return normalizeCoinSentryLoginResponse(response);
168
+ },
169
+ },
170
+ session: {
171
+ async refresh() {
172
+ return request({ method: 'GET', path: '/api/user' });
173
+ },
174
+ },
175
+ entity: {
176
+ async list() {
177
+ const response = await request({
178
+ method: 'GET',
179
+ path: '/api/v1/entities',
180
+ });
181
+ return unwrapEnvelopeData(response) ?? [];
182
+ },
183
+ async select(payload) {
184
+ return request({
185
+ method: 'POST',
186
+ path: '/api/v1/select-entity',
187
+ body: 'entityUuid' in payload
188
+ ? { entity_uuid: payload.entityUuid }
189
+ : { entity_id: payload.entityId },
190
+ });
191
+ },
192
+ },
193
+ kyc: {
194
+ async getOverview() {
195
+ const response = await request({
196
+ method: 'GET',
197
+ path: '/api/v1/kyc',
198
+ });
199
+ return unwrapEnvelopeData(response);
200
+ },
201
+ async getStatus() {
202
+ const response = await request({
203
+ method: 'GET',
204
+ path: '/api/v1/kyc/status',
205
+ });
206
+ return unwrapEnvelopeData(response);
207
+ },
208
+ async submitStep(input) {
209
+ return request({
210
+ method: 'POST',
211
+ path: resolveKycEndpoint(input),
212
+ body: input.payload ?? {},
213
+ });
214
+ },
215
+ async upload(input) {
216
+ return request({
217
+ method: 'POST',
218
+ path: resolveKycEndpoint(input),
219
+ body: input.formData,
220
+ });
221
+ },
222
+ },
223
+ brand: {
224
+ async getConfig() {
225
+ const response = await request({
226
+ method: 'GET',
227
+ path: '/api/brand/theme',
228
+ });
229
+ if (response && typeof response === 'object' && 'data' in response) {
230
+ const data = response.data;
231
+ return data?.payload ?? {};
232
+ }
233
+ return response;
234
+ },
235
+ },
236
+ ...productServices,
237
+ };
238
+ }
239
+ //# sourceMappingURL=client.js.map
@@ -0,0 +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,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC;gBAC7B,CAAC;gBAED,OAAO,QAAiC,CAAC;YAC3C,CAAC;SACF;QACD,GAAG,eAAe;KACnB,CAAC;AACJ,CAAC","sourcesContent":["import { CoinSentryApiError, normalizeCoinSentryError, type CoinSentryError } from './errors.js';\nimport { normalizeCoinSentryLoginResponse } from './guards.js';\nimport { FetchHttpAdapter, type CoinSentryHttpAdapter, type CoinSentryHttpRequest } from './http.js';\nimport {\n createCoinSentryProductServices,\n type CoinSentryPasswordResetPayload,\n type CoinSentryResetPasswordPayload,\n} from './products.js';\nimport type {\n CoinSentryBrandConfig,\n CoinSentryEntity,\n CoinSentryLoginResponse,\n CoinSentryRegisterPayload,\n CoinSentrySelectEntityResponse,\n CoinSentrySession,\n} from './types.js';\nimport type { ClientFlowStep, KycFlowScreen, KycOverviewData, KycVerificationData } from './kyc/index.js';\n\nexport type CoinSentryClientOptions = {\n baseUrl?: string;\n locale?: string;\n timeoutMs?: number;\n http?: CoinSentryHttpAdapter;\n onError?: (error: CoinSentryError) => void;\n};\n\nexport type CoinSentryCsrfInitOptions = {\n force?: boolean;\n staleMs?: number;\n};\n\nexport type CoinSentryLoginPayload = {\n email: string;\n password: string;\n slideCaptchaToken: string;\n};\n\nexport type CoinSentryTwoFactorPayload = {\n code: string;\n recovery?: boolean;\n};\n\nexport type {\n CoinSentryPasswordResetPayload,\n CoinSentryResetPasswordPayload,\n} from './products.js';\n\nexport type CoinSentryEntitySelectPayload =\n | { entityUuid: string; entityId?: never }\n | { entityId: number; entityUuid?: never };\n\nexport type CoinSentryKycSubmitPayload = {\n step?: ClientFlowStep | null;\n stepKey?: string;\n screen?: KycFlowScreen;\n payload?: unknown;\n};\n\nexport type CoinSentryKycUploadPayload = {\n step?: ClientFlowStep | null;\n stepKey?: string;\n screen?: KycFlowScreen;\n formData: FormData;\n};\n\nexport type CoinSentryClient = ReturnType<typeof createCoinSentryClient>;\n\nconst DEFAULT_CSRF_STALE_MS = 120_000;\n\nconst KYC_STEP_ENDPOINTS: Partial<Record<KycFlowScreen, string>> = {\n account: '/api/v1/kyc/email',\n email: '/api/v1/kyc/email',\n phone: '/api/v1/kyc/phone',\n personal_data: '/api/v1/kyc/profile',\n tax_profile: '/api/v1/kyc/profile',\n company_data: '/api/v1/kyc/company-data',\n beneficial_owners: '/api/v1/kyc/beneficial-owners',\n transaction_profile: '/api/v1/kyc/transaction-profile',\n address: '/api/v1/kyc/address',\n document_upload: '/api/v1/kyc/document-photo',\n selfie: '/api/v1/kyc/selfie',\n review: '/api/v1/kyc/submit',\n};\n\nfunction createContractError(message: string): CoinSentryApiError {\n return new CoinSentryApiError({\n code: 'validation_failed',\n status: 0,\n message,\n });\n}\n\nfunction assertKycEndpoint(endpoint: string): string {\n if (!endpoint.startsWith('/api/v1/kyc/')) {\n throw createContractError('KYC endpoint must stay inside /api/v1/kyc');\n }\n\n return endpoint;\n}\n\nfunction resolveKycEndpoint(input: {\n step?: ClientFlowStep | null;\n screen?: KycFlowScreen;\n}): string {\n const screen = input.screen ?? input.step?.screen;\n const endpoint = input.step?.endpoint ?? (screen ? KYC_STEP_ENDPOINTS[screen] : undefined);\n\n if (!endpoint) {\n throw createContractError(`Unsupported KYC screen: ${screen ?? 'unknown'}`);\n }\n\n return assertKycEndpoint(endpoint);\n}\n\nfunction unwrapEnvelopeData<T>(payload: T | { data?: T; success?: boolean }): T {\n if (\n payload\n && typeof payload === 'object'\n && 'data' in payload\n && (payload as { data?: unknown }).data !== undefined\n ) {\n return (payload as { data: T }).data;\n }\n\n return payload as T;\n}\n\nexport function createCoinSentryClient(options: CoinSentryClientOptions = {}) {\n const http = options.http ?? new FetchHttpAdapter({\n baseUrl: options.baseUrl ?? '/',\n locale: options.locale,\n timeoutMs: options.timeoutMs,\n });\n let csrfInitPromise: Promise<void> | null = null;\n let csrfInitializedAt = 0;\n\n async function request<T>(input: CoinSentryHttpRequest): Promise<T> {\n try {\n return await http.request<T>(input);\n } catch (error) {\n const normalized = normalizeCoinSentryError(error);\n options.onError?.(normalized.toJSON());\n throw normalized;\n }\n }\n\n async function initCsrf(initOptions: CoinSentryCsrfInitOptions = {}): Promise<void> {\n const staleMs = initOptions.staleMs ?? DEFAULT_CSRF_STALE_MS;\n const now = Date.now();\n\n if (csrfInitPromise) return csrfInitPromise;\n if (!initOptions.force && csrfInitializedAt > 0 && now - csrfInitializedAt < staleMs) {\n return;\n }\n\n csrfInitPromise = request<void>({\n method: 'GET',\n path: '/sanctum/csrf-cookie',\n retryOnCsrf: false,\n }).then(() => {\n csrfInitializedAt = Date.now();\n }).finally(() => {\n csrfInitPromise = null;\n });\n\n return csrfInitPromise;\n }\n\n function setLocale(locale: string | null | undefined): void {\n http.setLocale?.(locale);\n }\n\n function setKycLocale(locale: string | null | undefined): void {\n http.setKycLocale?.(locale);\n }\n\n function clearKycLocale(): void {\n http.clearKycLocale?.();\n }\n\n const productServices = createCoinSentryProductServices(request);\n\n return {\n request,\n locale: {\n set: setLocale,\n setKyc: setKycLocale,\n clearKyc: clearKycLocale,\n },\n csrf: {\n init: initCsrf,\n },\n auth: {\n async login(payload: CoinSentryLoginPayload): Promise<CoinSentryLoginResponse> {\n await initCsrf({ force: true });\n const response = await request<CoinSentryLoginResponse>({\n method: 'POST',\n path: '/auth/login',\n retryOnCsrf: false,\n body: {\n email: payload.email,\n password: payload.password,\n slide_captcha_token: payload.slideCaptchaToken,\n slide_captcha_verified: '1',\n },\n });\n return normalizeCoinSentryLoginResponse(response);\n },\n async register(payload: CoinSentryRegisterPayload): Promise<unknown> {\n await initCsrf({ force: true });\n return request<unknown>({\n method: 'POST',\n path: '/auth/register',\n retryOnCsrf: false,\n body: payload,\n });\n },\n async requestPasswordReset(payload: CoinSentryPasswordResetPayload): Promise<unknown> {\n await initCsrf({ force: true });\n return request<unknown>({\n method: 'POST',\n path: '/auth/forgot-password',\n retryOnCsrf: false,\n body: {\n email: payload.email,\n slide_captcha_token: payload.slideCaptchaToken,\n slide_captcha_verified: '1',\n },\n });\n },\n async resetPassword(payload: CoinSentryResetPasswordPayload): Promise<unknown> {\n await initCsrf({ force: true });\n return request<unknown>({\n method: 'POST',\n path: '/auth/reset-password',\n retryOnCsrf: false,\n body: payload,\n });\n },\n async logout(): Promise<unknown> {\n return request<unknown>({ method: 'POST', path: '/auth/logout' });\n },\n async twoFactorChallenge(payload: CoinSentryTwoFactorPayload): Promise<CoinSentryLoginResponse> {\n await initCsrf({ force: true });\n const response = await request<CoinSentryLoginResponse>({\n method: 'POST',\n path: '/auth/two-factor-challenge',\n retryOnCsrf: false,\n body: payload.recovery\n ? { recovery_code: payload.code }\n : { code: payload.code },\n });\n return normalizeCoinSentryLoginResponse(response);\n },\n },\n session: {\n async refresh(): Promise<CoinSentrySession> {\n return request<CoinSentrySession>({ method: 'GET', path: '/api/user' });\n },\n },\n entity: {\n async list(): Promise<CoinSentryEntity[]> {\n const response = await request<CoinSentryEntity[] | { data?: CoinSentryEntity[] }>({\n method: 'GET',\n path: '/api/v1/entities',\n });\n return unwrapEnvelopeData<CoinSentryEntity[]>(response) ?? [];\n },\n async select(payload: CoinSentryEntitySelectPayload): Promise<CoinSentrySelectEntityResponse> {\n return request<CoinSentrySelectEntityResponse>({\n method: 'POST',\n path: '/api/v1/select-entity',\n body: 'entityUuid' in payload\n ? { entity_uuid: payload.entityUuid }\n : { entity_id: payload.entityId },\n });\n },\n },\n kyc: {\n async getOverview(): Promise<KycOverviewData> {\n const response = await request<KycOverviewData | { data?: KycOverviewData }>({\n method: 'GET',\n path: '/api/v1/kyc',\n });\n return unwrapEnvelopeData<KycOverviewData>(response);\n },\n async getStatus(): Promise<KycVerificationData> {\n const response = await request<KycVerificationData | { data?: KycVerificationData }>({\n method: 'GET',\n path: '/api/v1/kyc/status',\n });\n return unwrapEnvelopeData<KycVerificationData>(response);\n },\n async submitStep(input: CoinSentryKycSubmitPayload): Promise<unknown> {\n return request<unknown>({\n method: 'POST',\n path: resolveKycEndpoint(input),\n body: input.payload ?? {},\n });\n },\n async upload(input: CoinSentryKycUploadPayload): Promise<unknown> {\n return request<unknown>({\n method: 'POST',\n path: resolveKycEndpoint(input),\n body: input.formData,\n });\n },\n },\n brand: {\n async getConfig(): Promise<CoinSentryBrandConfig> {\n const response = await request<CoinSentryBrandConfig | { data?: { payload?: CoinSentryBrandConfig } }>({\n method: 'GET',\n path: '/api/brand/theme',\n });\n\n if (response && typeof response === 'object' && 'data' in response) {\n const data = (response as { data?: { payload?: CoinSentryBrandConfig } }).data;\n return data?.payload ?? {};\n }\n\n return response as CoinSentryBrandConfig;\n },\n },\n ...productServices,\n };\n}\n"]}
@@ -0,0 +1,32 @@
1
+ import type { CoinSentryFieldErrors } from './types.js';
2
+ export declare const COINSENTRY_ERROR_CODES: readonly ["unauthenticated", "csrf_expired", "kyc_required", "entity_required", "invalid_signature", "origin_not_allowed", "missing_signature_headers", "validation_failed", "rate_limited", "forbidden", "network_error", "server_error", "unknown_error"];
3
+ export type CoinSentryErrorCode = typeof COINSENTRY_ERROR_CODES[number];
4
+ export type CoinSentryError = {
5
+ code: CoinSentryErrorCode;
6
+ status: number;
7
+ message: string;
8
+ reason?: string;
9
+ fieldErrors?: CoinSentryFieldErrors;
10
+ requestId?: string;
11
+ details?: unknown;
12
+ };
13
+ export declare class CoinSentryApiError extends Error implements CoinSentryError {
14
+ readonly code: CoinSentryErrorCode;
15
+ readonly status: number;
16
+ readonly reason?: string;
17
+ readonly fieldErrors?: CoinSentryFieldErrors;
18
+ readonly requestId?: string;
19
+ readonly details?: unknown;
20
+ constructor(error: CoinSentryError);
21
+ toJSON(): CoinSentryError;
22
+ }
23
+ export declare function isCoinSentryError(error: unknown): error is CoinSentryApiError;
24
+ export declare function isCoinSentryErrorCode(value: unknown): value is CoinSentryErrorCode;
25
+ export declare function normalizeCoinSentryError(error: unknown): CoinSentryApiError;
26
+ export declare function coinSentryErrorFromResponse(input: {
27
+ status: number;
28
+ statusText?: string;
29
+ body?: unknown;
30
+ requestId?: string | null;
31
+ }): CoinSentryAp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