squarefi-bff-api-module 1.36.109 → 1.36.110

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.
@@ -105,6 +105,15 @@ export declare const frontend: {
105
105
  };
106
106
  };
107
107
  };
108
+ aml: {
109
+ quote: ({ wallet_id, ...params }: API.Frontend.Aml.Quote.Request) => Promise<API.Frontend.Aml.Quote.Response>;
110
+ screenings: {
111
+ create: ({ wallet_id, idempotency_key, ...data }: API.Frontend.Aml.Screenings.Create.Request) => Promise<API.Frontend.Aml.Screenings.Create.Response>;
112
+ list: ({ wallet_id, ...params }: API.Frontend.Aml.Screenings.List.Request) => Promise<API.Frontend.Aml.Screenings.List.Response>;
113
+ getById: ({ wallet_id, id, }: API.Frontend.Aml.Screenings.GetById.Request) => Promise<API.Frontend.Aml.Screenings.GetById.Response>;
114
+ report: ({ wallet_id, id, }: API.Frontend.Aml.Screenings.Report.Request) => Promise<API.Frontend.Aml.Screenings.Report.Response>;
115
+ };
116
+ };
108
117
  reference: {
109
118
  exchangeRates: {
110
119
  list: (params?: API.Frontend.Reference.ExchangeRates.List.Request) => Promise<API.Frontend.Reference.ExchangeRates.List.Response>;
@@ -115,6 +124,12 @@ export declare const frontend: {
115
124
  orderTypes: {
116
125
  list: (params?: API.Frontend.Reference.OrderTypes.List.Request) => Promise<API.Frontend.Reference.OrderTypes.List.Response>;
117
126
  };
127
+ currencies: {
128
+ list: (params?: API.Frontend.Reference.Currencies.List.Request) => Promise<API.Frontend.Reference.Currencies.List.Response>;
129
+ };
130
+ chains: {
131
+ list: (params?: API.Frontend.Reference.Chains.List.Request) => Promise<API.Frontend.Reference.Chains.List.Response>;
132
+ };
118
133
  };
119
134
  notificationPreferences: {
120
135
  get: () => Promise<API.Frontend.NotificationPreferences.Get.Response>;
@@ -228,6 +228,21 @@ export const frontend = {
228
228
  },
229
229
  },
230
230
  },
231
+ // AML screening of crypto addresses. `quote` charges nothing; `screenings.create` charges the fee (an `AML_CHECK`
232
+ // order) and answers `PENDING` — wait for the realtime `WALLET_AML_SCREENINGS` hint, then `getById`, do not poll.
233
+ aml: {
234
+ quote: ({ wallet_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/aml/${wallet_id}/quote`, { params }),
235
+ screenings: {
236
+ create: ({ wallet_id, idempotency_key, ...data }) => apiClientV1Frontend.postRequest(`/frontend/aml/${wallet_id}/screenings`, {
237
+ data,
238
+ headers: idempotency_key ? { 'Idempotency-Key': idempotency_key } : undefined,
239
+ }),
240
+ list: ({ wallet_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/aml/${wallet_id}/screenings`, { params }),
241
+ getById: ({ wallet_id, id, }) => apiClientV1Frontend.getRequest(`/frontend/aml/${wallet_id}/screenings/${id}`),
242
+ // With `responseType: 'blob'` an error body (JSON) arrives as a Blob too.
243
+ report: ({ wallet_id, id, }) => apiClientV1Frontend.getRequest(`/frontend/aml/${wallet_id}/screenings/${id}/report`, { responseType: 'blob' }),
244
+ },
245
+ },
231
246
  reference: {
232
247
  // Frontend twin of `exchange.byOrderType.*` (legacy `GET /exchange/`): the same tenant pairs, but paged in
233
248
  // memory — 50 per page by default, 500 at most, in no particular order — and behind the bearer session.
@@ -247,6 +262,18 @@ export const frontend = {
247
262
  orderTypes: {
248
263
  list: (params = {}) => apiClientV1Frontend.getRequest('/frontend/reference/order_types', { params }),
249
264
  },
265
+ // `aml_supported`: the tenant's AML provider can screen addresses on the token's network; always `false` while
266
+ // screening is off for the tenant. The backend pages it (50 by default), so the whole list is asked for by default.
267
+ currencies: {
268
+ list: (params = {}) => apiClientV1Frontend.getRequest('/frontend/reference/currencies', { params: { limit: 500, ...params } }),
269
+ },
270
+ // `aml_supported`: the tenant's AML provider can screen addresses on the network; always `false` while screening
271
+ // is off for the tenant. Paged like `currencies`, so the whole list is asked for by default.
272
+ chains: {
273
+ list: (params = {}) => apiClientV1Frontend.getRequest('/frontend/reference/chains', {
274
+ params: { limit: 500, ...params },
275
+ }),
276
+ },
250
277
  },
251
278
  // IN_APP stays on (400 INBOX_CHANNEL_LOCKED); channels vary by tenant (TELEGRAM needs a bot); PUT upserts any subset.
252
279
  notificationPreferences: {
@@ -1031,6 +1031,48 @@ export declare namespace API {
1031
1031
  }
1032
1032
  export {};
1033
1033
  }
1034
+ namespace Aml {
1035
+ type QuoteRoot = pathsV1Frontend['/frontend/aml/{wallet_id}/quote'];
1036
+ type ScreeningsRoot = pathsV1Frontend['/frontend/aml/{wallet_id}/screenings'];
1037
+ type ScreeningRoot = pathsV1Frontend['/frontend/aml/{wallet_id}/screenings/{id}'];
1038
+ type ReportRoot = pathsV1Frontend['/frontend/aml/{wallet_id}/screenings/{id}/report'];
1039
+ type Schemas = componentsV1Frontend['schemas'];
1040
+ export type Screening = Schemas['AmlScreening'];
1041
+ export type Quote = Schemas['AmlScreeningQuote'];
1042
+ export type Result = Schemas['AmlScreeningResult'];
1043
+ export type CheckedCategory = Schemas['AmlCheckedCategory'];
1044
+ export type Asset = Schemas['AmlScreeningAsset'];
1045
+ export type Provider = Schemas['AmlProvider'];
1046
+ export namespace Quote {
1047
+ type Request = QuoteRoot['get']['parameters']['path'] & QuoteRoot['get']['parameters']['query'];
1048
+ type Response = QuoteRoot['get']['responses'][200]['content']['application/json'];
1049
+ }
1050
+ export namespace Screenings {
1051
+ namespace Create {
1052
+ type Request = ScreeningsRoot['post']['parameters']['path'] & ScreeningsRoot['post']['requestBody']['content']['application/json'] & {
1053
+ /**
1054
+ * Sent as the `Idempotency-Key` header, 8–128 characters: a retry with the same key returns the
1055
+ * screening the first call created instead of charging again.
1056
+ */
1057
+ idempotency_key?: NonNullable<ScreeningsRoot['post']['parameters']['header']>['Idempotency-Key'];
1058
+ };
1059
+ type Response = ScreeningsRoot['post']['responses'][201]['content']['application/json'];
1060
+ }
1061
+ namespace List {
1062
+ type Request = ScreeningsRoot['get']['parameters']['path'] & NonNullable<ScreeningsRoot['get']['parameters']['query']>;
1063
+ type Response = ScreeningsRoot['get']['responses'][200]['content']['application/json'];
1064
+ }
1065
+ namespace GetById {
1066
+ type Request = ScreeningRoot['get']['parameters']['path'];
1067
+ type Response = ScreeningRoot['get']['responses'][200]['content']['application/json'];
1068
+ }
1069
+ namespace Report {
1070
+ type Request = ReportRoot['get']['parameters']['path'];
1071
+ type Response = Blob;
1072
+ }
1073
+ }
1074
+ export {};
1075
+ }
1034
1076
  namespace Reference {
1035
1077
  namespace ExchangeRates {
1036
1078
  type ExchangeRatesRoot = pathsV1Frontend['/frontend/reference/exchange_rates'];
@@ -1061,6 +1103,24 @@ export declare namespace API {
1061
1103
  }
1062
1104
  export {};
1063
1105
  }
1106
+ namespace Currencies {
1107
+ type CurrenciesRoot = pathsV1Frontend['/frontend/reference/currencies'];
1108
+ export type Currency = componentsV1Frontend['schemas']['ReferenceCurrency'];
1109
+ export namespace List {
1110
+ type Request = NonNullable<CurrenciesRoot['get']['parameters']['query']>;
1111
+ type Response = CurrenciesRoot['get']['responses'][200]['content']['application/json'];
1112
+ }
1113
+ export {};
1114
+ }
1115
+ namespace Chains {
1116
+ type ChainsRoot = pathsV1Frontend['/frontend/reference/chains'];
1117
+ export type Chain = componentsV1Frontend['schemas']['ReferenceChain'];
1118
+ export namespace List {
1119
+ type Request = NonNullable<ChainsRoot['get']['parameters']['query']>;
1120
+ type Response = ChainsRoot['get']['responses'][200]['content']['application/json'];
1121
+ }
1122
+ export {};
1123
+ }
1064
1124
  }
1065
1125
  namespace NotificationPreferences {
1066
1126
  type NotificationPreferencesRoot = pathsV1Frontend['/frontend/notification-preferences'];
@@ -168,7 +168,8 @@ export declare enum OrderType {
168
168
  REFUND_CARD_SUBACCOUNT = "REFUND_CARD_SUBACCOUNT",
169
169
  ADJUSTMENT = "ADJUSTMENT",
170
170
  MONTHLY_FEE = "MONTHLY_FEE",
171
- REFERRAL_PAYOUT = "REFERRAL_PAYOUT"
171
+ REFERRAL_PAYOUT = "REFERRAL_PAYOUT",
172
+ AML_CHECK = "AML_CHECK"
172
173
  }
173
174
  export declare enum WalletTransactionRecordType {
174
175
  CARD_PROVIDER_DEPOSIT = "CARD_PROVIDER_DEPOSIT",
@@ -292,8 +293,9 @@ export declare enum WalletTransactionRecordType {
292
293
  REFERRAL_PAYOUT = "REFERRAL_PAYOUT"
293
294
  }
294
295
  export type OrderTypeMissingInWalletTransactionRecordType = Exclude<EnumValues<OrderType>, EnumValues<WalletTransactionRecordType>>;
295
- export declare const orderTypeIncludedInWalletTransactionRecordTypeCheck: IsUnionSubset<EnumValues<OrderType>, EnumValues<WalletTransactionRecordType>>;
296
- export type OrderTypeIncludedInWalletTransactionRecordTypeMismatch = UnionSubsetMismatch<EnumValues<OrderType>, EnumValues<WalletTransactionRecordType>>;
296
+ type OrderTypeWithoutRecordType = EnumValues<OrderType.AML_CHECK>;
297
+ export declare const orderTypeIncludedInWalletTransactionRecordTypeCheck: IsUnionSubset<Exclude<EnumValues<OrderType>, OrderTypeWithoutRecordType>, EnumValues<WalletTransactionRecordType>>;
298
+ export type OrderTypeIncludedInWalletTransactionRecordTypeMismatch = UnionSubsetMismatch<Exclude<EnumValues<OrderType>, OrderTypeWithoutRecordType>, EnumValues<WalletTransactionRecordType>>;
297
299
  type BackendOrderTypeId = componentsV1Frontend['schemas']['OrderTypeId'] | componentsV1Tenant['schemas']['OrderTypeId'] | componentsV1External['schemas']['OrderTypeId'] | componentsV1Legacy['schemas']['OrderTypeId'];
298
300
  export declare const backendOrderTypeIdIncludedInOrderTypeCheck: IsUnionSubset<BackendOrderTypeId, EnumValues<OrderType>>;
299
301
  export type BackendOrderTypeIdIncludedInOrderTypeMismatch = UnionSubsetMismatch<BackendOrderTypeId, EnumValues<OrderType>>;
package/dist/constants.js CHANGED
@@ -166,6 +166,8 @@ export var OrderType;
166
166
  OrderType["ADJUSTMENT"] = "ADJUSTMENT";
167
167
  OrderType["MONTHLY_FEE"] = "MONTHLY_FEE";
168
168
  OrderType["REFERRAL_PAYOUT"] = "REFERRAL_PAYOUT";
169
+ // Not in WalletTransactionRecordType, see OrderTypeWithoutRecordType.
170
+ OrderType["AML_CHECK"] = "AML_CHECK";
169
171
  // when extend do not forget to add new order type to the enum WalletTransactionRecordType
170
172
  })(OrderType || (OrderType = {}));
171
173
  export var WalletTransactionRecordType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.36.109",
3
+ "version": "1.36.110",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",