@v3finance/core-sdk 0.10.0 → 0.12.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 +45 -0
- package/dist/cjs/generated/operations.d.ts +24 -0
- package/dist/cjs/generated/operations.d.ts.map +1 -1
- package/dist/cjs/generated/operations.js +26 -2
- package/dist/cjs/generated/operations.js.map +1 -1
- package/dist/cjs/generated/types.d.ts +194 -8
- package/dist/cjs/generated/types.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/resources/aml.d.ts +40 -2
- package/dist/cjs/resources/aml.d.ts.map +1 -1
- package/dist/cjs/resources/aml.js +30 -1
- package/dist/cjs/resources/aml.js.map +1 -1
- package/dist/cjs/resources/history.d.ts +2 -0
- package/dist/cjs/resources/history.d.ts.map +1 -1
- package/dist/cjs/resources/history.js.map +1 -1
- package/dist/cjs/resources/reports.d.ts +4 -0
- package/dist/cjs/resources/reports.d.ts.map +1 -1
- package/dist/cjs/resources/reports.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/generated/operations.d.ts +24 -0
- package/dist/esm/generated/operations.d.ts.map +1 -1
- package/dist/esm/generated/operations.js +26 -2
- package/dist/esm/generated/operations.js.map +1 -1
- package/dist/esm/generated/types.d.ts +194 -8
- package/dist/esm/generated/types.d.ts.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/resources/aml.d.ts +40 -2
- package/dist/esm/resources/aml.d.ts.map +1 -1
- package/dist/esm/resources/aml.js +30 -1
- package/dist/esm/resources/aml.js.map +1 -1
- package/dist/esm/resources/history.d.ts +2 -0
- package/dist/esm/resources/history.d.ts.map +1 -1
- package/dist/esm/resources/history.js.map +1 -1
- package/dist/esm/resources/reports.d.ts +4 -0
- package/dist/esm/resources/reports.d.ts.map +1 -1
- package/dist/esm/resources/reports.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/errors.md +3 -1
- package/package.json +1 -1
- package/src/generated/operations.ts +26 -2
- package/src/generated/types.ts +200 -8
- package/src/index.ts +1 -0
- package/src/resources/aml.ts +58 -1
- package/src/resources/history.ts +2 -0
- package/src/resources/reports.ts +4 -0
- package/src/version.ts +1 -1
package/src/generated/types.ts
CHANGED
|
@@ -890,6 +890,30 @@ export interface ApprovalRequestStep {
|
|
|
890
890
|
appliedAt: string | null
|
|
891
891
|
}
|
|
892
892
|
|
|
893
|
+
export interface RequestRisk {
|
|
894
|
+
role: "recipient" | "sender" | "counterparty"
|
|
895
|
+
network: string
|
|
896
|
+
address: string
|
|
897
|
+
/** На момент операции. null — не проверяли; у правок справочника снимка нет */
|
|
898
|
+
snapshot: {
|
|
899
|
+
/** Запись проверки — GET /vaults/{code}/aml/checks/{id} */
|
|
900
|
+
checkId: string | null
|
|
901
|
+
level: "critical" | "high" | "medium" | "low" | "minimal" | null
|
|
902
|
+
score: number | null
|
|
903
|
+
checkedAt: string | null
|
|
904
|
+
} | null
|
|
905
|
+
/** Последняя СОХРАНЁННАЯ проверка; null — не проверяли или заявка уже решена. Обновить — POST /vaults/{code}/aml/checks (офицер, админ) */
|
|
906
|
+
current: {
|
|
907
|
+
/** Запись проверки — GET /vaults/{code}/aml/checks/{id} */
|
|
908
|
+
checkId: string | null
|
|
909
|
+
level: "critical" | "high" | "medium" | "low" | "minimal" | null
|
|
910
|
+
score: number | null
|
|
911
|
+
checkedAt: string | null
|
|
912
|
+
} | null
|
|
913
|
+
/** Уровень вырос с момента операции */
|
|
914
|
+
worsened: boolean
|
|
915
|
+
}
|
|
916
|
+
|
|
893
917
|
export interface ApprovalRequestDetail {
|
|
894
918
|
/** cuid */
|
|
895
919
|
id: string
|
|
@@ -935,6 +959,10 @@ export interface ApprovalRequestDetail {
|
|
|
935
959
|
initiator: UserCard | null
|
|
936
960
|
/** Шаги композитной заявки (пусто для single-action) */
|
|
937
961
|
steps: ApprovalRequestStep[]
|
|
962
|
+
/** Риск второй стороны на момент заявки и сейчас (AML v2, R31). Подписанту, AML-офицеру и админу в GET /{id}; остальным и в теле 202 — пусто */
|
|
963
|
+
amlRisk: RequestRisk[]
|
|
964
|
+
/** Отказать без комментария нельзя: вы AML-офицер, и решаете за AML (O23). true — только у подписанта, чей голос ещё ждут; в теле 202 — false */
|
|
965
|
+
rejectCommentRequired: boolean
|
|
938
966
|
}
|
|
939
967
|
|
|
940
968
|
export interface ApprovalRequest {
|
|
@@ -2364,8 +2392,8 @@ export interface HistoryInItem {
|
|
|
2364
2392
|
/** 0–10; решения — по amlLevel */
|
|
2365
2393
|
amlScore: number | null
|
|
2366
2394
|
amlCheckedAt: string | null
|
|
2367
|
-
/** Удержание поступления AML-правилом: held — деньги ждут офицера; released — офицер выпустил; blocked — отклонил; unblocked — отклонил, потом выпустил. null — не удерживалось (у переводов — всегда) */
|
|
2368
|
-
amlHoldStatus: "held" | "released" | "blocked" | "unblocked" | null
|
|
2395
|
+
/** Удержание поступления AML-правилом: held — деньги ждут офицера; released — офицер выпустил; blocked — отклонил; unblocked — отклонил, потом выпустил. missed — сработало, а удерживать было нечего (видят офицер и админ). null — не удерживалось (у переводов — всегда) */
|
|
2396
|
+
amlHoldStatus: "held" | "released" | "blocked" | "unblocked" | "missed" | null
|
|
2369
2397
|
/** Запись AML-проверки на момент операции (AML v2) — GET /vaults/{code}/aml/checks/{id}. null — нет записи */
|
|
2370
2398
|
amlCheckId: string | null
|
|
2371
2399
|
/** Старая разметка операции (то же, что GET …/metadata: назначение системной категории general, видно каждому, кто видит строку; sensitive-поле general без права — null); null — не заполнена */
|
|
@@ -2456,8 +2484,8 @@ export interface HistoryOutItem {
|
|
|
2456
2484
|
/** 0–10; решения — по amlLevel */
|
|
2457
2485
|
amlScore: number | null
|
|
2458
2486
|
amlCheckedAt: string | null
|
|
2459
|
-
/** Удержание поступления AML-правилом: held — деньги ждут офицера; released — офицер выпустил; blocked — отклонил; unblocked — отклонил, потом выпустил. null — не удерживалось (у переводов — всегда) */
|
|
2460
|
-
amlHoldStatus: "held" | "released" | "blocked" | "unblocked" | null
|
|
2487
|
+
/** Удержание поступления AML-правилом: held — деньги ждут офицера; released — офицер выпустил; blocked — отклонил; unblocked — отклонил, потом выпустил. missed — сработало, а удерживать было нечего (видят офицер и админ). null — не удерживалось (у переводов — всегда) */
|
|
2488
|
+
amlHoldStatus: "held" | "released" | "blocked" | "unblocked" | "missed" | null
|
|
2461
2489
|
/** Запись AML-проверки на момент операции (AML v2) — GET /vaults/{code}/aml/checks/{id}. null — нет записи */
|
|
2462
2490
|
amlCheckId: string | null
|
|
2463
2491
|
/** Старая разметка операции (то же, что GET …/metadata: назначение системной категории general, видно каждому, кто видит строку; sensitive-поле general без права — null); null — не заполнена */
|
|
@@ -2694,8 +2722,8 @@ export interface IncomingTransactionDetail {
|
|
|
2694
2722
|
amlScore: number | null
|
|
2695
2723
|
/** Когда провайдер сделал проверку */
|
|
2696
2724
|
amlCheckedAt: string | null
|
|
2697
|
-
/** Удержание поступления AML-правилом: held — деньги ждут офицера; released — офицер выпустил; blocked — отклонил; unblocked — отклонил, потом выпустил. null — не удерживалось (у переводов — всегда) */
|
|
2698
|
-
amlHoldStatus: "held" | "released" | "blocked" | "unblocked" | null
|
|
2725
|
+
/** Удержание поступления AML-правилом: held — деньги ждут офицера; released — офицер выпустил; blocked — отклонил; unblocked — отклонил, потом выпустил. missed — сработало, а удерживать было нечего (видят офицер и админ). null — не удерживалось (у переводов — всегда) */
|
|
2726
|
+
amlHoldStatus: "held" | "released" | "blocked" | "unblocked" | "missed" | null
|
|
2699
2727
|
/** Запись AML-проверки, по которой снят снимок (AML v2): всё, что знали в момент операции, включая связи. Открывается через GET /vaults/{code}/aml/checks/{id}. null — не проверяли или запись не сохранилась; у операций до AML v2 — всегда null */
|
|
2700
2728
|
amlCheckId: string | null
|
|
2701
2729
|
/** Курс токена к USD на момент депозита (USD за 1 единицу); null — недоступен */
|
|
@@ -5297,6 +5325,17 @@ export interface OperationsExceptionsReport {
|
|
|
5297
5325
|
averageAgeSeconds: number | null
|
|
5298
5326
|
medianAgeSeconds: number | null
|
|
5299
5327
|
}
|
|
5328
|
+
/** Поступления, удержанные AML: в статусах выше их нет (они confirmed), а деньги стоят */
|
|
5329
|
+
amlHeld: {
|
|
5330
|
+
operationsCount: number
|
|
5331
|
+
/** По суммам поступлений; удержать могли не всё */
|
|
5332
|
+
usdValue: string | null
|
|
5333
|
+
oldestOperationAt: string | null
|
|
5334
|
+
/** Ждут решения AML-офицера */
|
|
5335
|
+
held: number
|
|
5336
|
+
/** Отклонены */
|
|
5337
|
+
blocked: number
|
|
5338
|
+
}
|
|
5300
5339
|
/** Всегда шесть строк в этом порядке, включая пустые корзины */
|
|
5301
5340
|
ageBuckets: Array<{
|
|
5302
5341
|
bucket: "0-15m" | "15-60m" | "1-6h" | "6-24h" | "1-3d" | ">3d"
|
|
@@ -5633,6 +5672,10 @@ export interface ReportingOperation {
|
|
|
5633
5672
|
/** AML-снимок на момент операции; null — не проверяли, а НЕ «риска нет» */
|
|
5634
5673
|
amlLevel: string | null
|
|
5635
5674
|
amlScore: number | null
|
|
5675
|
+
/** Запись проверки — GET /vaults/{code}/aml/checks/{id} */
|
|
5676
|
+
amlCheckId: string | null
|
|
5677
|
+
/** Удержание поступления: held | released | blocked | unblocked; missed (не успели) — только админу */
|
|
5678
|
+
amlHoldStatus: string | null
|
|
5636
5679
|
ownAddressId: string
|
|
5637
5680
|
ownAddress: string
|
|
5638
5681
|
ownAddressLabel: string | null
|
|
@@ -5696,7 +5739,7 @@ export interface LedgerEntriesPage {
|
|
|
5696
5739
|
export interface LedgerEntry {
|
|
5697
5740
|
id: string
|
|
5698
5741
|
vaultId: string
|
|
5699
|
-
/** topup | transfer_reserve | transfer_confirm | transfer_refund | adjustment | genesis | aml_release | aml_block | aml_unblock. Это НЕ хранимый kind: три вида переименованы на выходе (reserve → transfer_reserve, confirm → transfer_confirm, release → transfer_refund), остальные отдаются как есть. Фильтр ?entryType= понимает оба написания */
|
|
5742
|
+
/** topup | transfer_reserve | transfer_confirm | transfer_refund | adjustment | genesis | aml_hold | aml_release | aml_block | aml_unblock. Это НЕ хранимый kind: три вида переименованы на выходе (reserve → transfer_reserve, confirm → transfer_confirm, release → transfer_refund), остальные отдаются как есть. Фильтр ?entryType= понимает оба написания */
|
|
5700
5743
|
entryType: string
|
|
5701
5744
|
/** Документ-источник; null у корректировок и genesis */
|
|
5702
5745
|
operationType: "transfer" | "deposit" | null
|
|
@@ -6119,7 +6162,7 @@ export interface ScorechainLinkNative {
|
|
|
6119
6162
|
|
|
6120
6163
|
export interface AmlDepositDecisionResult {
|
|
6121
6164
|
depositId: string
|
|
6122
|
-
amlHoldStatus: "held" | "released" | "blocked" | "unblocked"
|
|
6165
|
+
amlHoldStatus: "held" | "released" | "blocked" | "unblocked" | "missed"
|
|
6123
6166
|
}
|
|
6124
6167
|
|
|
6125
6168
|
export interface AmlDepositReviewBody {
|
|
@@ -6150,6 +6193,108 @@ export interface AmlInternalCheckBody {
|
|
|
6150
6193
|
addressId: string
|
|
6151
6194
|
}
|
|
6152
6195
|
|
|
6196
|
+
export interface AmlOperation {
|
|
6197
|
+
type: "transfer" | "deposit"
|
|
6198
|
+
id: string
|
|
6199
|
+
/** format: date-time */
|
|
6200
|
+
createdAt: string
|
|
6201
|
+
direction: "out" | "in"
|
|
6202
|
+
/** Статус перевода; у поступления — confirmed (удержание — amlHoldStatus) */
|
|
6203
|
+
status: string
|
|
6204
|
+
asset: string
|
|
6205
|
+
/** raw smallest units */
|
|
6206
|
+
amount: string
|
|
6207
|
+
amountDecimal: string | null
|
|
6208
|
+
network: string
|
|
6209
|
+
ownAddress: {
|
|
6210
|
+
id: string
|
|
6211
|
+
address: string
|
|
6212
|
+
label: string | null
|
|
6213
|
+
}
|
|
6214
|
+
/** Получатель перевода или отправитель поступления */
|
|
6215
|
+
externalAddress: string
|
|
6216
|
+
/** Вторая сторона — наш адрес: у провайдера не проверяется */
|
|
6217
|
+
internal: boolean
|
|
6218
|
+
/** Снимок на момент операции; null — не проверяли */
|
|
6219
|
+
amlLevel: AmlLevel | null
|
|
6220
|
+
amlScore: number | null
|
|
6221
|
+
amlCheckedAt: string | null
|
|
6222
|
+
amlCheckId: string | null
|
|
6223
|
+
provider: string | null
|
|
6224
|
+
categories: Array<{
|
|
6225
|
+
category: string
|
|
6226
|
+
/** range: -9007199254740991..9007199254740991 */
|
|
6227
|
+
count: number
|
|
6228
|
+
maxLevel: AmlLevel | null
|
|
6229
|
+
}>
|
|
6230
|
+
/** missed — правило сработало, но к моменту проверки удерживать было нечего */
|
|
6231
|
+
amlHoldStatus: "held" | "released" | "blocked" | "unblocked" | "missed" | null
|
|
6232
|
+
txHash: string | null
|
|
6233
|
+
/** Заявка AML-офицеру, если была */
|
|
6234
|
+
request: {
|
|
6235
|
+
id: string
|
|
6236
|
+
status: string
|
|
6237
|
+
} | null
|
|
6238
|
+
decisions: Array<{
|
|
6239
|
+
decision: "release" | "block" | "unblock"
|
|
6240
|
+
decidedById: string
|
|
6241
|
+
comment: string | null
|
|
6242
|
+
/** format: date-time */
|
|
6243
|
+
createdAt: string
|
|
6244
|
+
}>
|
|
6245
|
+
}
|
|
6246
|
+
|
|
6247
|
+
export interface AmlOperations {
|
|
6248
|
+
items: AmlOperation[]
|
|
6249
|
+
nextCursor: string | null
|
|
6250
|
+
}
|
|
6251
|
+
|
|
6252
|
+
export interface AmlProvenance {
|
|
6253
|
+
addressId: string
|
|
6254
|
+
/** range: -9007199254740991..9007199254740991 */
|
|
6255
|
+
depth: number
|
|
6256
|
+
/** Источников больше предела — правило считает происхождение неизвестным */
|
|
6257
|
+
truncated: boolean
|
|
6258
|
+
/** range: -9007199254740991..9007199254740991 */
|
|
6259
|
+
total: number
|
|
6260
|
+
/**
|
|
6261
|
+
* Источников без проверки
|
|
6262
|
+
*
|
|
6263
|
+
* range: -9007199254740991..9007199254740991
|
|
6264
|
+
*/
|
|
6265
|
+
unchecked: number
|
|
6266
|
+
items: Array<{
|
|
6267
|
+
depositId: string
|
|
6268
|
+
toAddressId: string
|
|
6269
|
+
from: string
|
|
6270
|
+
network: string
|
|
6271
|
+
/**
|
|
6272
|
+
* Через сколько наших адресов: 0 — прямо на этот
|
|
6273
|
+
*
|
|
6274
|
+
* range: -9007199254740991..9007199254740991
|
|
6275
|
+
*/
|
|
6276
|
+
hops: number
|
|
6277
|
+
/** format: date-time */
|
|
6278
|
+
createdAt: string
|
|
6279
|
+
asset: string | null
|
|
6280
|
+
amount: string | null
|
|
6281
|
+
amountDecimal: string | null
|
|
6282
|
+
check: {
|
|
6283
|
+
id: string
|
|
6284
|
+
level: AmlLevel | null
|
|
6285
|
+
score: number | null
|
|
6286
|
+
/** format: date-time */
|
|
6287
|
+
checkedAt: string
|
|
6288
|
+
categories: Array<{
|
|
6289
|
+
category: string
|
|
6290
|
+
/** range: -9007199254740991..9007199254740991 */
|
|
6291
|
+
count: number
|
|
6292
|
+
maxLevel: AmlLevel | null
|
|
6293
|
+
}>
|
|
6294
|
+
} | null
|
|
6295
|
+
}>
|
|
6296
|
+
}
|
|
6297
|
+
|
|
6153
6298
|
export interface AmlProvider {
|
|
6154
6299
|
id: "scorechain"
|
|
6155
6300
|
displayName: string
|
|
@@ -6288,6 +6433,53 @@ export interface AmlRule {
|
|
|
6288
6433
|
updatedAt: string
|
|
6289
6434
|
}
|
|
6290
6435
|
|
|
6436
|
+
export interface AmlRuleVersion {
|
|
6437
|
+
/** range: -9007199254740991..9007199254740991 */
|
|
6438
|
+
version: number
|
|
6439
|
+
changedById: string
|
|
6440
|
+
/** format: date-time */
|
|
6441
|
+
changedAt: string
|
|
6442
|
+
/** Правило целиком в этой версии */
|
|
6443
|
+
snapshot: {
|
|
6444
|
+
code: string
|
|
6445
|
+
name: string
|
|
6446
|
+
description: string | null
|
|
6447
|
+
enabled: boolean
|
|
6448
|
+
enabledAt: string | null
|
|
6449
|
+
/**
|
|
6450
|
+
* Растёт на каждой правке
|
|
6451
|
+
*
|
|
6452
|
+
* range: -9007199254740991..9007199254740991
|
|
6453
|
+
*/
|
|
6454
|
+
version: number
|
|
6455
|
+
provider: "scorechain"
|
|
6456
|
+
/** Где стоит правило: transfer — перевод; deposit — поступление (отправитель; деньги удерживаются до решения офицера, исход только officer); counterparty_address_add — новый адрес контрагента (создание с адресами, правка, отдельная ручка адреса); counterparty_group_add — контрагент в группу (проверяются ВСЕ его адреса). Белый список стоит на контрагенте, поэтому эти правки расширяют круг получателей */
|
|
6457
|
+
appliesTo: Array<"transfer" | "deposit" | "counterparty_address_add" | "counterparty_group_add">
|
|
6458
|
+
/** К каким операциям: селекторы перевода (senderPattern, destination, counterparty, counterpartyGroup, amount perTx, token) и destinationPattern — путь деривации НАШЕГО адреса-получателя. null — ко всем. Только у переводов: правило на правках справочника обязано иметь null */
|
|
6459
|
+
scope: PolicyCondition | null
|
|
6460
|
+
/** Чей риск: counterparty — получателя перевода; provenance — источников средств адреса-отправителя (внешние депозиты за всю историю, через внутренние переводы до provenance.depth); совпадение хотя бы одного источника — срабатывание */
|
|
6461
|
+
subject: "counterparty" | "provenance"
|
|
6462
|
+
/** null — срабатывает всегда */
|
|
6463
|
+
risk: AmlRiskCondition | null
|
|
6464
|
+
/** Только для subject = provenance */
|
|
6465
|
+
provenance: {
|
|
6466
|
+
/**
|
|
6467
|
+
* 0..3 внутренних перевода назад
|
|
6468
|
+
*
|
|
6469
|
+
* range: -9007199254740991..9007199254740991
|
|
6470
|
+
*/
|
|
6471
|
+
depth: number
|
|
6472
|
+
} | null
|
|
6473
|
+
outcome: "block" | "officer"
|
|
6474
|
+
/** Может ли офицер подтвердить собственный перевод (по умолчанию нет) */
|
|
6475
|
+
allowInitiatorApproval: boolean
|
|
6476
|
+
}
|
|
6477
|
+
}
|
|
6478
|
+
|
|
6479
|
+
export interface AmlRuleVersions {
|
|
6480
|
+
items: AmlRuleVersion[]
|
|
6481
|
+
}
|
|
6482
|
+
|
|
6291
6483
|
export interface AmlRules {
|
|
6292
6484
|
items: AmlRule[]
|
|
6293
6485
|
}
|
package/src/index.ts
CHANGED
|
@@ -113,6 +113,7 @@ export { SharingResource } from './resources/sharing.js'
|
|
|
113
113
|
export { FoldersResource } from './resources/folders.js'
|
|
114
114
|
export { MembersResource, type PolicyDirectoryParams } from './resources/members.js'
|
|
115
115
|
export { AmlResource } from './resources/aml.js'
|
|
116
|
+
export type { AmlOperationsFilter } from './resources/aml.js'
|
|
116
117
|
export { RegistriesResource, type AmlScore } from './resources/registries.js'
|
|
117
118
|
export { CategoriesResource, type OperationType } from './resources/categories.js'
|
|
118
119
|
/**
|
package/src/resources/aml.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { toGated, type Gated } from '../core/gated.js'
|
|
|
3
3
|
import type {
|
|
4
4
|
AddAmlStopListBody,
|
|
5
5
|
AmlDepositDecisionResult,
|
|
6
|
+
AmlOperations,
|
|
7
|
+
AmlProvenance,
|
|
8
|
+
AmlRuleVersions,
|
|
6
9
|
AmlDepositReview,
|
|
7
10
|
AmlRule,
|
|
8
11
|
AmlRuleEvaluateBody,
|
|
@@ -23,6 +26,21 @@ import type {
|
|
|
23
26
|
UpdateAmlSettingsBody,
|
|
24
27
|
} from '../generated/types.js'
|
|
25
28
|
|
|
29
|
+
/** Filters of the officer's operations list and of its CSV. */
|
|
30
|
+
export interface AmlOperationsFilter {
|
|
31
|
+
from?: string | undefined
|
|
32
|
+
to?: string | undefined
|
|
33
|
+
type?: 'transfer' | 'deposit' | undefined
|
|
34
|
+
/** CSV; `unchecked` — operations never checked. */
|
|
35
|
+
amlLevel?: string | undefined
|
|
36
|
+
/** CSV: `held,released,blocked,unblocked,missed`; `missed` — nothing was left to hold. */
|
|
37
|
+
amlHoldStatus?: string | undefined
|
|
38
|
+
provider?: 'scorechain' | undefined
|
|
39
|
+
category?: string | undefined
|
|
40
|
+
/** The other side is exactly this address. */
|
|
41
|
+
address?: string | undefined
|
|
42
|
+
}
|
|
43
|
+
|
|
26
44
|
/**
|
|
27
45
|
* AML checks of a vault, in the typed model (AML v2).
|
|
28
46
|
*
|
|
@@ -206,7 +224,15 @@ export class AmlResource {
|
|
|
206
224
|
return this.#http.request<AmlRule>('GET', `${this.#base}/rules/${seg(ruleId)}`)
|
|
207
225
|
}
|
|
208
226
|
|
|
209
|
-
/**
|
|
227
|
+
/** Every version of a rule, newest first: who changed, enabled or disabled it, and when. */
|
|
228
|
+
ruleVersions(ruleId: string): Promise<AmlRuleVersions> {
|
|
229
|
+
return this.#http.request<AmlRuleVersions>('GET', `${this.#base}/rules/${seg(ruleId)}/versions`)
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Absent fields stay; the RESULTING rule is validated. Every change is a new
|
|
234
|
+
* `version`. 409 `AML_RULE_CONFLICT` — someone changed it meanwhile: reload.
|
|
235
|
+
*/
|
|
210
236
|
updateRule(ruleId: string, patch: PatchAmlRuleBody): Promise<AmlRule> {
|
|
211
237
|
return this.#http.request<AmlRule>('PATCH', `${this.#base}/rules/${seg(ruleId)}`, { body: patch })
|
|
212
238
|
}
|
|
@@ -267,4 +293,35 @@ export class AmlResource {
|
|
|
267
293
|
body: { comment },
|
|
268
294
|
})
|
|
269
295
|
}
|
|
296
|
+
|
|
297
|
+
// ---------- Officer's view ----------
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Transfers and deposits of the WHOLE vault through the AML lens: risk,
|
|
301
|
+
* categories, holding, the officer's request and decisions. AML officers and
|
|
302
|
+
* admins. It does not open financial reports to an officer.
|
|
303
|
+
*/
|
|
304
|
+
operations(
|
|
305
|
+
params: AmlOperationsFilter & { limit?: number | undefined; cursor?: string | undefined } = {},
|
|
306
|
+
): Promise<AmlOperations> {
|
|
307
|
+
return this.#http.request<AmlOperations>('GET', `${this.#base}/operations`, { query: { ...params } })
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* The same operations as a CSV file, same filters, up to 5000 rows. The
|
|
312
|
+
* header `x-truncated: true` says the file is cut: narrow the period.
|
|
313
|
+
*/
|
|
314
|
+
operationsCsv(params: AmlOperationsFilter = {}): Promise<Response> {
|
|
315
|
+
return this.#http.fetchRaw('GET', `${this.#base}/operations`, { query: { ...params, format: 'csv' } })
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** Where one of our addresses got its funds, as a `provenance` rule sees it: riskiest first. */
|
|
319
|
+
provenance(
|
|
320
|
+
addressId: string,
|
|
321
|
+
params: { depth?: number | undefined; limit?: number | undefined } = {},
|
|
322
|
+
): Promise<AmlProvenance> {
|
|
323
|
+
return this.#http.request<AmlProvenance>('GET', `${this.#base}/addresses/${seg(addressId)}/provenance`, {
|
|
324
|
+
query: { ...params },
|
|
325
|
+
})
|
|
326
|
+
}
|
|
270
327
|
}
|
package/src/resources/history.ts
CHANGED
|
@@ -121,6 +121,8 @@ export interface HistoryFilters {
|
|
|
121
121
|
amlLevel?: OneOrMany<HistoryAmlLevelFilter> | undefined
|
|
122
122
|
/** `unchecked` here drops the unchecked ones; without it they stay. */
|
|
123
123
|
amlLevelNot?: OneOrMany<HistoryAmlLevelFilter> | undefined
|
|
124
|
+
/** Deposits held by an AML rule. Transfers drop out — they are never held. */
|
|
125
|
+
amlHoldStatus?: OneOrMany<'held' | 'released' | 'blocked' | 'unblocked'> | undefined
|
|
124
126
|
/** A deposit always has a hash. */
|
|
125
127
|
hasTxHash?: boolean | undefined
|
|
126
128
|
/** Whether the transfer has a fee recorded. A deposit has none: `true` drops it, `false` keeps it. */
|
package/src/resources/reports.ts
CHANGED
|
@@ -77,6 +77,10 @@ export interface ReportFilters {
|
|
|
77
77
|
counterpartyAddressIds?: readonly string[] | undefined
|
|
78
78
|
categories?: readonly string[] | undefined
|
|
79
79
|
amlLevels?: readonly string[] | undefined
|
|
80
|
+
/** Provider of the operation's AML check. An operation without a check does not match. */
|
|
81
|
+
amlProviders?: readonly string[] | undefined
|
|
82
|
+
/** Provider categories in the operation's AML check, any of them. See `registries.amlProviders()`. */
|
|
83
|
+
amlCategories?: readonly string[] | undefined
|
|
80
84
|
categoryKeys?: readonly string[] | undefined
|
|
81
85
|
categoryField?: string | undefined
|
|
82
86
|
initiatorIds?: readonly string[] | undefined
|
package/src/version.ts
CHANGED