@v3finance/core-sdk 0.8.0 → 0.10.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 +44 -0
- package/dist/cjs/generated/operations.d.ts +8 -0
- package/dist/cjs/generated/operations.d.ts.map +1 -1
- package/dist/cjs/generated/operations.js +10 -2
- package/dist/cjs/generated/operations.js.map +1 -1
- package/dist/cjs/generated/types.d.ts +90 -17
- package/dist/cjs/generated/types.d.ts.map +1 -1
- package/dist/cjs/resources/aml.d.ts +14 -1
- package/dist/cjs/resources/aml.d.ts.map +1 -1
- package/dist/cjs/resources/aml.js +17 -0
- package/dist/cjs/resources/aml.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.d.ts.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/generated/operations.d.ts +8 -0
- package/dist/esm/generated/operations.d.ts.map +1 -1
- package/dist/esm/generated/operations.js +10 -2
- package/dist/esm/generated/operations.js.map +1 -1
- package/dist/esm/generated/types.d.ts +90 -17
- package/dist/esm/generated/types.d.ts.map +1 -1
- package/dist/esm/resources/aml.d.ts +14 -1
- package/dist/esm/resources/aml.d.ts.map +1 -1
- package/dist/esm/resources/aml.js +17 -0
- package/dist/esm/resources/aml.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.d.ts.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/docs/errors.md +9 -2
- package/package.json +1 -1
- package/src/generated/operations.ts +10 -2
- package/src/generated/types.ts +91 -17
- package/src/resources/aml.ts +18 -0
- package/src/version.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type HttpClient } from '../core/http.js';
|
|
2
2
|
import { type Gated } from '../core/gated.js';
|
|
3
|
-
import type { AddAmlStopListBody, AmlDepositReview, AmlRule, AmlRuleEvaluateBody, AmlRuleEvaluation, AmlRules, AmlStopList, AmlStopListEntry, CreateAmlRuleBody, PatchAmlRuleBody, AmlCheck, AmlOfficers, AmlRecheckBody, AmlSettings, AmlVisibilityGrant, AmlVisibilityGrants, ApprovalRequestCreated, CreateAmlVisibilityGrantBody, UpdateAmlSettingsBody } from '../generated/types.js';
|
|
3
|
+
import type { AddAmlStopListBody, AmlDepositDecisionResult, AmlDepositReview, AmlRule, AmlRuleEvaluateBody, AmlRuleEvaluation, AmlRules, AmlStopList, AmlStopListEntry, CreateAmlRuleBody, PatchAmlRuleBody, AmlCheck, AmlOfficers, AmlRecheckBody, AmlSettings, AmlVisibilityGrant, AmlVisibilityGrants, ApprovalRequestCreated, CreateAmlVisibilityGrantBody, UpdateAmlSettingsBody } from '../generated/types.js';
|
|
4
4
|
/**
|
|
5
5
|
* AML checks of a vault, in the typed model (AML v2).
|
|
6
6
|
*
|
|
@@ -127,6 +127,10 @@ export declare class AmlResource {
|
|
|
127
127
|
* from `fromAddressId` to `address`. `ruleIds` runs exactly those rules,
|
|
128
128
|
* DISABLED ones included — to see a rule before switching it on. `amount`
|
|
129
129
|
* is a decimal string, as in `transfers.create`.
|
|
130
|
+
*
|
|
131
|
+
* With `action: "counterparty_address_add" | "counterparty_group_add"` it
|
|
132
|
+
* runs the rules on counterparty-directory edits instead: `address` is the
|
|
133
|
+
* counterparty's address and `network` is required; `fromAddressId` is not.
|
|
130
134
|
*/
|
|
131
135
|
evaluateRules(input: AmlRuleEvaluateBody): Promise<AmlRuleEvaluation>;
|
|
132
136
|
/** Addresses the vault considers unacceptable. Acts only through a rule with a `stopList` leaf. */
|
|
@@ -144,5 +148,14 @@ export declare class AmlResource {
|
|
|
144
148
|
* `WEB_SESSION_CANNOT_SIGN`. One mark per deposit; a repeat returns it.
|
|
145
149
|
*/
|
|
146
150
|
markDepositReviewed(depositId: string, comment: string): Promise<AmlDepositReview>;
|
|
151
|
+
/**
|
|
152
|
+
* An AML officer changes their mind about a rejected deposit: its money
|
|
153
|
+
* moves from blocked to available. The rejection stays in history; the
|
|
154
|
+
* comment is required. AML officers only, only from the PHONE, and not for
|
|
155
|
+
* a deposit to the officer's own address unless the rule allows it (403
|
|
156
|
+
* `AML_OWN_DEPOSIT`). Safe to repeat — the money moves once. Releasing or
|
|
157
|
+
* rejecting a HELD deposit is a vote: `approvals.vote`.
|
|
158
|
+
*/
|
|
159
|
+
unblockDeposit(depositId: string, comment: string): Promise<AmlDepositDecisionResult>;
|
|
147
160
|
}
|
|
148
161
|
//# sourceMappingURL=aml.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aml.d.ts","sourceRoot":"","sources":["../../../src/resources/aml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,uBAAuB,CAAA;AAE9B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,WAAW;;IAItB,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAED;;;;;OAKG;IACH,KAAK,CACH,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;KAAO,GAC9F,OAAO,CAAC,QAAQ,CAAC,CAKnB;IAED;;;OAGG;IACH,OAAO,CAAC,KAAK,EAAE,cAAc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AAG,SAAS,CAAA;KAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAEpF;IAED,uGAAuG;IACvG,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAElE;IAED,0CAA0C;IAC1C,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAE7D;IAED;;;;;OAKG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAIjF;IAED;;;;;;;OAOG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAIpF;CACF"}
|
|
@@ -166,6 +166,10 @@ export class AmlResource {
|
|
|
166
166
|
* from `fromAddressId` to `address`. `ruleIds` runs exactly those rules,
|
|
167
167
|
* DISABLED ones included — to see a rule before switching it on. `amount`
|
|
168
168
|
* is a decimal string, as in `transfers.create`.
|
|
169
|
+
*
|
|
170
|
+
* With `action: "counterparty_address_add" | "counterparty_group_add"` it
|
|
171
|
+
* runs the rules on counterparty-directory edits instead: `address` is the
|
|
172
|
+
* counterparty's address and `network` is required; `fromAddressId` is not.
|
|
169
173
|
*/
|
|
170
174
|
evaluateRules(input) {
|
|
171
175
|
return this.#http.request('POST', `${this.#base}/rules/evaluate`, { body: input });
|
|
@@ -194,5 +198,18 @@ export class AmlResource {
|
|
|
194
198
|
body: { comment },
|
|
195
199
|
});
|
|
196
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* An AML officer changes their mind about a rejected deposit: its money
|
|
203
|
+
* moves from blocked to available. The rejection stays in history; the
|
|
204
|
+
* comment is required. AML officers only, only from the PHONE, and not for
|
|
205
|
+
* a deposit to the officer's own address unless the rule allows it (403
|
|
206
|
+
* `AML_OWN_DEPOSIT`). Safe to repeat — the money moves once. Releasing or
|
|
207
|
+
* rejecting a HELD deposit is a vote: `approvals.vote`.
|
|
208
|
+
*/
|
|
209
|
+
unblockDeposit(depositId, comment) {
|
|
210
|
+
return this.#http.request('POST', `${this.#base}/deposits/${seg(depositId)}/unblock`, {
|
|
211
|
+
body: { comment },
|
|
212
|
+
});
|
|
213
|
+
}
|
|
197
214
|
}
|
|
198
215
|
//# sourceMappingURL=aml.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aml.js","sourceRoot":"","sources":["../../../src/resources/aml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"aml.js","sourceRoot":"","sources":["../../../src/resources/aml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAwBtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,WAAW;IACb,KAAK,CAAY;IACjB,KAAK,CAAQ;IAEtB,YAAY,IAAgB,EAAE,SAAiB;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,KAAK,GAAG,kBAAkB,GAAG,CAAC,SAAS,CAAC,MAAM,CAAA;IACrD,CAAC;IAED;;;;;OAKG;IACH,KAAK,CACH,OAAe,EACf,OAAO,GAAsF,EAAE;QAE/F,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAW,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,SAAS,EAAE;YACjE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE;YAC9C,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAA;IACJ,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,KAAqB;QAC3B,OAAO,IAAI,CAAC,K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,CAAC,WAAW,EAAE;YACvG,IAAI,EAAE,EAAE,OAAO,EAAE;SAClB,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,cAAc,CAAC,SAAiB,EAAE,OAAe;QAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAA2B,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,aAAa,GAAG,CAAC,SAAS,CAAC,UAAU,EAAE;YAC9G,IAAI,EAAE,EAAE,OAAO,EAAE;SAClB,CAAC,CAAA;IACJ,CAAC;CACF"}
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** SDK version, sent in the `user-agent` header. */
|
|
2
|
-
export declare const SDK_VERSION = "0.
|
|
2
|
+
export declare const SDK_VERSION = "0.10.0";
|
|
3
3
|
/** Default API base URL. */
|
|
4
4
|
export declare const DEFAULT_BASE_URL = "https://policy-engine-rest.ezig.workers.dev";
|
|
5
5
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,eAAO,MAAM,WAAW,WAAW,CAAA;AAEnC,4BAA4B;AAC5B,eAAO,MAAM,gBAAgB,gDAAgD,CAAA"}
|
package/dist/esm/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** SDK version, sent in the `user-agent` header. */
|
|
2
|
-
export const SDK_VERSION = '0.
|
|
2
|
+
export const SDK_VERSION = '0.10.0';
|
|
3
3
|
/** Default API base URL. */
|
|
4
4
|
export const DEFAULT_BASE_URL = 'https://policy-engine-rest.ezig.workers.dev';
|
|
5
5
|
//# sourceMappingURL=version.js.map
|
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,CAAC,MAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAA;AAEnC,4BAA4B;AAC5B,MAAM,CAAC,MAAM,gBAAgB,GAAG,6CAA6C,CAAA"}
|
package/docs/errors.md
CHANGED
|
@@ -477,7 +477,7 @@ The public invitation lookup (`GET /invitations/by-token/{token}`) signals a dea
|
|
|
477
477
|
| `AML_CHECK_NOT_FOUND` | 404 | `aml.getCheck(id)` for an id that is no check record. | Records never disappear, so this is a wrong id — usually not an `amlCheckId` of an operation. |
|
|
478
478
|
| `AML_RAW_NOT_FOUND` | 404 | `aml.rawCheck(id)` for a record whose full provider response was not archived (archive write failed, or the record predates the archive). `hasRaw: false` on the record says so in advance. | Use the typed record from `aml.getCheck(id)`; the full response will not appear later. |
|
|
479
479
|
| `AML_ARCHIVE_DISABLED` | 501 | `aml.rawCheck(id)` on a server without the archive configured. | Server configuration, not a client error. The typed record still works. |
|
|
480
|
-
| `AML_LAST_OFFICER` | 409 | `members.setAmlOfficer(id, false)` for the last AML officer of a vault while an enabled policy needs an officer
|
|
480
|
+
| `AML_LAST_OFFICER` | 409 | `members.setAmlOfficer(id, false)` for the last AML officer of a vault while an enabled policy or AML rule needs an officer, or deposits are held. `details.policies`, `details.amlRules` — their codes; `details.heldDeposits` — how many deposits wait for an officer. | Show the policies: the admin must change their approvers or disable them, or appoint another officer first. |
|
|
481
481
|
| `MEMBER_NOT_FOUND` | 404 | `members.setAmlOfficer(id, …)` for someone who is not a member of the vault. | Only members can be officers; invite the person first. |
|
|
482
482
|
| `AML_PROVIDER_DISABLED` | 400 | `aml.check(address, { provider })` with a provider the vault has not enabled. | Omit `provider` to use the vault's default, or enable it in `aml.updateSettings()`. |
|
|
483
483
|
| `AML_PROVIDER_UNKNOWN` | 400 | `aml.updateSettings()` names a provider that is not in the registry. | Take ids from `registries.amlProviders()`. |
|
|
@@ -485,7 +485,14 @@ The public invitation lookup (`GET /invitations/by-token/{token}`) signals a dea
|
|
|
485
485
|
| `AML_MAX_AGE_OUT_OF_RANGE` | 400 | `maxAgeSeconds` is not an integer from 0 to 30 days. | 0 means every check calls the (paid) provider. |
|
|
486
486
|
| `GRANT_NOT_FOUND` | 404 | `aml.revokeVisibility(id)` for a grant that is not in this vault. | Refresh the list from `aml.visibilityGrants()`. |
|
|
487
487
|
| `AML_BLOCKED` | 403 | Creating a transfer: an AML rule of the vault blocks it (the recipient's risk). `message` says which rule and why. | Not a policy setting — the vault's AML officer decides. Do not retry. |
|
|
488
|
-
| `AML_NO_ELIGIBLE_OFFICER` | 409 | Creating a transfer: an AML rule needs an officer's approval and nobody can give it (no officers, or the only one is the initiator). | Ask an admin to appoint another AML officer. |
|
|
488
|
+
| `AML_NO_ELIGIBLE_OFFICER` | 409 | Creating a transfer, or editing the counterparty directory: an AML rule needs an officer's approval and nobody can give it (no officers, or the only one is the initiator). | Ask an admin to appoint another AML officer. |
|
|
489
|
+
| `AML_DEPOSIT_RULES_DISABLED` | 409 | Switching on an AML rule with `appliesTo: ["deposit"]` in a vault where deposit holding is not enabled yet. | Save the rule with `enabled: false`; holding is enabled per vault by the service. |
|
|
490
|
+
| `AML_REJECT_REASON_REQUIRED` | 400 | `approvals.vote` with `reject` on a held deposit (`aml_deposit_review`) without a comment. Nothing was recorded. | Ask the officer for the reason and repeat. |
|
|
491
|
+
| `AML_REVIEW_NOT_CANCELLABLE` | 409 | Cancelling an `aml_deposit_review` request — by the address owner or an admin. | Do not offer cancel for this action: only an AML officer decides. |
|
|
492
|
+
| `AML_OWN_DEPOSIT` | 403 | `aml.unblockDeposit` for a deposit to the officer's own address while the rule does not allow it. | Another AML officer must do it. |
|
|
493
|
+
| `DEPOSIT_ALREADY_DECIDED` | 409 | Another officer has already decided this held deposit the other way; your vote was not kept. | Reload the request. |
|
|
494
|
+
| `DEPOSIT_NOT_BLOCKED` | 409 | `aml.unblockDeposit` for a deposit that was not rejected. | Reload the deposit. |
|
|
495
|
+
| `DEPOSIT_MONEY_MISSING` | 409, 500 | The deposit's money is not on the hold account yet (409: the credit is still being retried), or the hold balance does not cover it (500: a ledger discrepancy). Nothing moved. | 409 — retry later; 500 — report it. |
|
|
489
496
|
| `AML_RULE_INVALID` | 400 | `aml.createRule` / `updateRule`: the rule's shape is wrong (code, scope, risk, appliesTo, subject, provenance). | Fix the field named in `message`. |
|
|
490
497
|
| `AML_PROVIDER_CAPABILITY` | 400 | The rule needs data the provider does not report (shares of funds, the address's own entity, sanction authorities). | Offer only conditions listed in `registries.amlProviders()` → `capabilities`. |
|
|
491
498
|
| `AML_NO_OFFICERS` | 400 | Enabling a rule that can require an officer's approval (outcome `officer`, any risk condition, or `subject: provenance`) in a vault without AML officers. | Appoint an officer first, or save the rule disabled. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v3finance/core-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "The official TypeScript SDK for the V3 Finance Core API — custodial addresses, transfers under policy control, approvals, shared access, labelling and reports",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
// resource method calls an operation that exists, and that a new endpoint in
|
|
9
9
|
// the API does not slip in unclassified.
|
|
10
10
|
//
|
|
11
|
-
// Operations:
|
|
12
|
-
// Spec sha256:
|
|
11
|
+
// Operations: 226 · admin: 45 · both: 1 · member: 177 · service: 3
|
|
12
|
+
// Spec sha256: 59ab014d45728b551f6126f70a1ca9ee1a0eec61e8c67b9d496f1efca2c5c323
|
|
13
13
|
|
|
14
14
|
export type Audience = 'member' | 'admin' | 'service' | 'both' | 'unknown'
|
|
15
15
|
|
|
@@ -1504,6 +1504,14 @@ export const OPERATIONS = {
|
|
|
1504
1504
|
"summary": "Отметить прошлый депозит «проверено»",
|
|
1505
1505
|
"audience": "member"
|
|
1506
1506
|
},
|
|
1507
|
+
"POST /api/v1/vaults/{code}/aml/deposits/{depositId}/unblock": {
|
|
1508
|
+
"method": "post",
|
|
1509
|
+
"path": "/api/v1/vaults/{code}/aml/deposits/{depositId}/unblock",
|
|
1510
|
+
"operationId": "postApiV1VaultsByCodeAmlDepositsByDepositIdUnblock",
|
|
1511
|
+
"tag": "AML",
|
|
1512
|
+
"summary": "Выпустить отклонённый депозит",
|
|
1513
|
+
"audience": "member"
|
|
1514
|
+
},
|
|
1507
1515
|
"POST /api/v1/vaults/{code}/aml/internal-checks": {
|
|
1508
1516
|
"method": "post",
|
|
1509
1517
|
"path": "/api/v1/vaults/{code}/aml/internal-checks",
|
package/src/generated/types.ts
CHANGED
|
@@ -247,6 +247,12 @@ export interface AddressDetail {
|
|
|
247
247
|
/** Заморожено под переводы, ждущие подписи или исполнения */
|
|
248
248
|
reserved: string
|
|
249
249
|
reservedDecimal: string
|
|
250
|
+
/** Удержано AML, ждёт решения офицера (raw). Тратить нельзя */
|
|
251
|
+
held: string
|
|
252
|
+
heldDecimal: string
|
|
253
|
+
/** Отклонено AML-офицером (raw). Тратить нельзя */
|
|
254
|
+
blocked: string
|
|
255
|
+
blockedDecimal: string
|
|
250
256
|
}>
|
|
251
257
|
/** Денормализованный актив адреса — FK на Token (из asset-сегмента пути) */
|
|
252
258
|
tokenId: string | null
|
|
@@ -514,6 +520,12 @@ export interface AddressListItem {
|
|
|
514
520
|
/** Заморожено под переводы, ждущие подписи или исполнения */
|
|
515
521
|
reserved: string
|
|
516
522
|
reservedDecimal: string
|
|
523
|
+
/** Удержано AML, ждёт решения офицера (raw). Тратить нельзя */
|
|
524
|
+
held: string
|
|
525
|
+
heldDecimal: string
|
|
526
|
+
/** Отклонено AML-офицером (raw). Тратить нельзя */
|
|
527
|
+
blocked: string
|
|
528
|
+
blockedDecimal: string
|
|
517
529
|
}>
|
|
518
530
|
/** Денормализованный актив адреса — FK на Token (из asset-сегмента пути) */
|
|
519
531
|
tokenId: string | null
|
|
@@ -582,6 +594,12 @@ export interface Address {
|
|
|
582
594
|
/** Заморожено под переводы, ждущие подписи или исполнения */
|
|
583
595
|
reserved: string
|
|
584
596
|
reservedDecimal: string
|
|
597
|
+
/** Удержано AML, ждёт решения офицера (raw). Тратить нельзя */
|
|
598
|
+
held: string
|
|
599
|
+
heldDecimal: string
|
|
600
|
+
/** Отклонено AML-офицером (raw). Тратить нельзя */
|
|
601
|
+
blocked: string
|
|
602
|
+
blockedDecimal: string
|
|
585
603
|
}>
|
|
586
604
|
/** Денормализованный актив адреса — FK на Token (из asset-сегмента пути) */
|
|
587
605
|
tokenId: string | null
|
|
@@ -1843,7 +1861,7 @@ export interface RuleInput {
|
|
|
1843
1861
|
* - create_address → senderPattern
|
|
1844
1862
|
* - counterparty_* / counterparty_group_* → actorRole
|
|
1845
1863
|
*
|
|
1846
|
-
*
|
|
1864
|
+
* Снят: aml (AML v2) — риск теперь условие AML-правил Vault'а (/vaults/{code}/aml/rules); в схеме остаётся, чтобы отказ (400) объяснял, куда он переехал. Ретайрнуты: actorType (был no-op — единственный фактический тип инициатора «user», миграция 0043), signers (мультиподписи нет, контекст не заполнялся и селектор никогда бы не совпал)
|
|
1847
1865
|
*/
|
|
1848
1866
|
export type SelectorInput = {
|
|
1849
1867
|
type: "senderPattern"
|
|
@@ -2346,6 +2364,8 @@ export interface HistoryInItem {
|
|
|
2346
2364
|
/** 0–10; решения — по amlLevel */
|
|
2347
2365
|
amlScore: number | null
|
|
2348
2366
|
amlCheckedAt: string | null
|
|
2367
|
+
/** Удержание поступления AML-правилом: held — деньги ждут офицера; released — офицер выпустил; blocked — отклонил; unblocked — отклонил, потом выпустил. null — не удерживалось (у переводов — всегда) */
|
|
2368
|
+
amlHoldStatus: "held" | "released" | "blocked" | "unblocked" | null
|
|
2349
2369
|
/** Запись AML-проверки на момент операции (AML v2) — GET /vaults/{code}/aml/checks/{id}. null — нет записи */
|
|
2350
2370
|
amlCheckId: string | null
|
|
2351
2371
|
/** Старая разметка операции (то же, что GET …/metadata: назначение системной категории general, видно каждому, кто видит строку; sensitive-поле general без права — null); null — не заполнена */
|
|
@@ -2436,6 +2456,8 @@ export interface HistoryOutItem {
|
|
|
2436
2456
|
/** 0–10; решения — по amlLevel */
|
|
2437
2457
|
amlScore: number | null
|
|
2438
2458
|
amlCheckedAt: string | null
|
|
2459
|
+
/** Удержание поступления AML-правилом: held — деньги ждут офицера; released — офицер выпустил; blocked — отклонил; unblocked — отклонил, потом выпустил. null — не удерживалось (у переводов — всегда) */
|
|
2460
|
+
amlHoldStatus: "held" | "released" | "blocked" | "unblocked" | null
|
|
2439
2461
|
/** Запись AML-проверки на момент операции (AML v2) — GET /vaults/{code}/aml/checks/{id}. null — нет записи */
|
|
2440
2462
|
amlCheckId: string | null
|
|
2441
2463
|
/** Старая разметка операции (то же, что GET …/metadata: назначение системной категории general, видно каждому, кто видит строку; sensitive-поле general без права — null); null — не заполнена */
|
|
@@ -2672,6 +2694,8 @@ export interface IncomingTransactionDetail {
|
|
|
2672
2694
|
amlScore: number | null
|
|
2673
2695
|
/** Когда провайдер сделал проверку */
|
|
2674
2696
|
amlCheckedAt: string | null
|
|
2697
|
+
/** Удержание поступления AML-правилом: held — деньги ждут офицера; released — офицер выпустил; blocked — отклонил; unblocked — отклонил, потом выпустил. null — не удерживалось (у переводов — всегда) */
|
|
2698
|
+
amlHoldStatus: "held" | "released" | "blocked" | "unblocked" | null
|
|
2675
2699
|
/** Запись AML-проверки, по которой снят снимок (AML v2): всё, что знали в момент операции, включая связи. Открывается через GET /vaults/{code}/aml/checks/{id}. null — не проверяли или запись не сохранилась; у операций до AML v2 — всегда null */
|
|
2676
2700
|
amlCheckId: string | null
|
|
2677
2701
|
/** Курс токена к USD на момент депозита (USD за 1 единицу); null — недоступен */
|
|
@@ -2813,8 +2837,8 @@ export interface Invitation {
|
|
|
2813
2837
|
|
|
2814
2838
|
export interface LedgerAccountItem {
|
|
2815
2839
|
id: string
|
|
2816
|
-
/** available/reserved — счета адресов; external/adjustment — vault-level */
|
|
2817
|
-
purpose: "available" | "reserved" | "external" | "adjustment"
|
|
2840
|
+
/** available/reserved — счета адресов; aml_hold/aml_blocked — депозиты адресов, удержанные и отклонённые AML; external/adjustment — vault-level */
|
|
2841
|
+
purpose: "available" | "reserved" | "external" | "adjustment" | "aml_hold" | "aml_blocked"
|
|
2818
2842
|
/** raw smallest units (signed) */
|
|
2819
2843
|
balance: string
|
|
2820
2844
|
balanceDecimal: string
|
|
@@ -4456,7 +4480,7 @@ export interface UserProfile {
|
|
|
4456
4480
|
|
|
4457
4481
|
export interface VaultBalancesResponse {
|
|
4458
4482
|
vaultId: string
|
|
4459
|
-
/** Агрегаты по токенам (available/reserved) */
|
|
4483
|
+
/** Агрегаты по токенам (available/reserved/held/blocked) */
|
|
4460
4484
|
totals: Array<{
|
|
4461
4485
|
token: {
|
|
4462
4486
|
code: string
|
|
@@ -4469,6 +4493,12 @@ export interface VaultBalancesResponse {
|
|
|
4469
4493
|
availableDecimal: string
|
|
4470
4494
|
reserved: string
|
|
4471
4495
|
reservedDecimal: string
|
|
4496
|
+
/** Удержано AML, ждёт офицера (raw) */
|
|
4497
|
+
held: string
|
|
4498
|
+
heldDecimal: string
|
|
4499
|
+
/** Отклонено AML-офицером (raw) */
|
|
4500
|
+
blocked: string
|
|
4501
|
+
blockedDecimal: string
|
|
4472
4502
|
}>
|
|
4473
4503
|
/** Отсутствует при ?summary=true */
|
|
4474
4504
|
accounts?: LedgerAccountItem[]
|
|
@@ -4757,6 +4787,11 @@ export interface StatementTokenRow {
|
|
|
4757
4787
|
network: string
|
|
4758
4788
|
openingAvailable: string
|
|
4759
4789
|
openingReserved: string
|
|
4790
|
+
/** Удержано AML (aml_hold) */
|
|
4791
|
+
openingHeld: string
|
|
4792
|
+
/** Отклонено AML (aml_blocked) */
|
|
4793
|
+
openingBlocked: string
|
|
4794
|
+
/** available + reserved + held + blocked */
|
|
4760
4795
|
openingTotal: string
|
|
4761
4796
|
incomingExternal: string
|
|
4762
4797
|
outgoingExternal: string
|
|
@@ -4766,6 +4801,9 @@ export interface StatementTokenRow {
|
|
|
4766
4801
|
adjustments: string
|
|
4767
4802
|
closingAvailable: string
|
|
4768
4803
|
closingReserved: string
|
|
4804
|
+
closingHeld: string
|
|
4805
|
+
closingBlocked: string
|
|
4806
|
+
/** available + reserved + held + blocked */
|
|
4769
4807
|
closingTotal: string
|
|
4770
4808
|
/** (opening + движения + adjustments) − closing из ledger. Ожидается "0"; ненулевое значение — операции и ledger разошлись, и оно же считается в dataQuality.ledgerReconciliationDifferences */
|
|
4771
4809
|
reconciliationDifference: string
|
|
@@ -5143,7 +5181,11 @@ export interface AssetMovementReport {
|
|
|
5143
5181
|
available: string
|
|
5144
5182
|
/** decimal */
|
|
5145
5183
|
reserved: string
|
|
5146
|
-
/**
|
|
5184
|
+
/** Удержано AML, decimal */
|
|
5185
|
+
held: string
|
|
5186
|
+
/** Отклонено AML, decimal */
|
|
5187
|
+
blocked: string
|
|
5188
|
+
/** available + reserved + held + blocked, decimal */
|
|
5147
5189
|
total: string
|
|
5148
5190
|
}
|
|
5149
5191
|
/** Остаток актива на конец периода (to), из ledger. DECIMAL в единицах актива — не raw, в отличие от openingBalances у address_activity */
|
|
@@ -5152,7 +5194,11 @@ export interface AssetMovementReport {
|
|
|
5152
5194
|
available: string
|
|
5153
5195
|
/** decimal */
|
|
5154
5196
|
reserved: string
|
|
5155
|
-
/**
|
|
5197
|
+
/** Удержано AML, decimal */
|
|
5198
|
+
held: string
|
|
5199
|
+
/** Отклонено AML, decimal */
|
|
5200
|
+
blocked: string
|
|
5201
|
+
/** available + reserved + held + blocked, decimal */
|
|
5156
5202
|
total: string
|
|
5157
5203
|
}
|
|
5158
5204
|
summary: ReportSummary
|
|
@@ -5231,7 +5277,7 @@ export interface AddressActivityReport {
|
|
|
5231
5277
|
export interface ReportAccountBalance {
|
|
5232
5278
|
accountId: string
|
|
5233
5279
|
/** available / reserved — счета адресов; external / adjustment — счета уровня Vault'а (без адреса): встречная сторона двойной записи */
|
|
5234
|
-
purpose: "available" | "reserved" | "external" | "adjustment"
|
|
5280
|
+
purpose: "available" | "reserved" | "external" | "adjustment" | "aml_hold" | "aml_blocked"
|
|
5235
5281
|
tokenId: string
|
|
5236
5282
|
/** null у счетов уровня Vault'а */
|
|
5237
5283
|
addressId: string | null
|
|
@@ -5379,7 +5425,11 @@ export interface BalancePositionReport {
|
|
|
5379
5425
|
available: string
|
|
5380
5426
|
/** decimal */
|
|
5381
5427
|
reserved: string
|
|
5382
|
-
/**
|
|
5428
|
+
/** Удержано AML, decimal */
|
|
5429
|
+
held: string
|
|
5430
|
+
/** Отклонено AML, decimal */
|
|
5431
|
+
blocked: string
|
|
5432
|
+
/** available + reserved + held + blocked, decimal */
|
|
5383
5433
|
total: string
|
|
5384
5434
|
usdRate: string | null
|
|
5385
5435
|
/** USD-оценка, decimal-строка. null — курса на момент операции не было */
|
|
@@ -5396,6 +5446,10 @@ export interface BalancePositionReport {
|
|
|
5396
5446
|
/** decimal */
|
|
5397
5447
|
reserved: string
|
|
5398
5448
|
/** decimal */
|
|
5449
|
+
held: string
|
|
5450
|
+
/** decimal */
|
|
5451
|
+
blocked: string
|
|
5452
|
+
/** decimal */
|
|
5399
5453
|
total: string
|
|
5400
5454
|
/** USD-оценка, decimal-строка. null — курса на момент операции не было */
|
|
5401
5455
|
usdValue: string | null
|
|
@@ -5454,7 +5508,7 @@ export interface CategoryAnalytics {
|
|
|
5454
5508
|
export interface BalancesAsOfAccount {
|
|
5455
5509
|
accountId: string
|
|
5456
5510
|
/** available / reserved — счета адресов; external / adjustment — счета уровня Vault'а (без адреса): встречная сторона двойной записи */
|
|
5457
|
-
purpose: "available" | "reserved" | "external" | "adjustment"
|
|
5511
|
+
purpose: "available" | "reserved" | "external" | "adjustment" | "aml_hold" | "aml_blocked"
|
|
5458
5512
|
tokenId: string
|
|
5459
5513
|
/** null у vault-level счетов */
|
|
5460
5514
|
addressId: string | null
|
|
@@ -5488,7 +5542,11 @@ export interface BalancesAsOfTotal {
|
|
|
5488
5542
|
/** DECIMAL (не raw!) — дубль reservedDecimal; у GET /balances это поле raw */
|
|
5489
5543
|
reserved: string
|
|
5490
5544
|
reservedDecimal: string
|
|
5491
|
-
/**
|
|
5545
|
+
/** Удержано AML, decimal */
|
|
5546
|
+
held: string
|
|
5547
|
+
/** Отклонено AML, decimal */
|
|
5548
|
+
blocked: string
|
|
5549
|
+
/** available + reserved + held + blocked, decimal: резерв — ещё не расход, пока перевод не подтверждён */
|
|
5492
5550
|
ownedTotal: string
|
|
5493
5551
|
}
|
|
5494
5552
|
|
|
@@ -5638,7 +5696,7 @@ export interface LedgerEntriesPage {
|
|
|
5638
5696
|
export interface LedgerEntry {
|
|
5639
5697
|
id: string
|
|
5640
5698
|
vaultId: string
|
|
5641
|
-
/** topup | transfer_reserve | transfer_confirm | transfer_refund | adjustment | genesis. Это НЕ хранимый kind: три вида переименованы на выходе (reserve → transfer_reserve, confirm → transfer_confirm, release → transfer_refund), остальные отдаются как есть. Фильтр ?entryType= понимает оба написания */
|
|
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= понимает оба написания */
|
|
5642
5700
|
entryType: string
|
|
5643
5701
|
/** Документ-источник; null у корректировок и genesis */
|
|
5644
5702
|
operationType: "transfer" | "deposit" | null
|
|
@@ -5674,7 +5732,7 @@ export interface LedgerPosting {
|
|
|
5674
5732
|
id: string
|
|
5675
5733
|
accountId: string
|
|
5676
5734
|
/** available / reserved — счета адресов; external / adjustment — счета уровня Vault'а (без адреса): встречная сторона двойной записи */
|
|
5677
|
-
accountPurpose: "available" | "reserved" | "external" | "adjustment"
|
|
5735
|
+
accountPurpose: "available" | "reserved" | "external" | "adjustment" | "aml_hold" | "aml_blocked"
|
|
5678
5736
|
/** address — счёт адреса; vault — счёт уровня Vault'а (external/adjustment) */
|
|
5679
5737
|
ownerType: "address" | "vault"
|
|
5680
5738
|
/** addressId для ownerType=address, иначе vaultId */
|
|
@@ -6059,6 +6117,11 @@ export interface ScorechainLinkNative {
|
|
|
6059
6117
|
address: string
|
|
6060
6118
|
}
|
|
6061
6119
|
|
|
6120
|
+
export interface AmlDepositDecisionResult {
|
|
6121
|
+
depositId: string
|
|
6122
|
+
amlHoldStatus: "held" | "released" | "blocked" | "unblocked"
|
|
6123
|
+
}
|
|
6124
|
+
|
|
6062
6125
|
export interface AmlDepositReviewBody {
|
|
6063
6126
|
/**
|
|
6064
6127
|
* Почему депозит признан проверенным
|
|
@@ -6130,18 +6193,26 @@ export type AmlRiskCondition = {
|
|
|
6130
6193
|
}
|
|
6131
6194
|
|
|
6132
6195
|
export interface AmlRuleEvaluateBody {
|
|
6196
|
+
/** Что прогоняем; по умолчанию transfer. Для поступления `address` — отправитель, для правок справочника — адрес контрагента; сеть — `network`, `fromAddressId`/`amount`/`asset` не нужны */
|
|
6197
|
+
action?: "transfer" | "deposit" | "counterparty_address_add" | "counterparty_group_add"
|
|
6133
6198
|
/**
|
|
6134
|
-
* Получатель
|
|
6199
|
+
* Получатель перевода или адрес контрагента
|
|
6135
6200
|
*
|
|
6136
6201
|
* length: 1..∞
|
|
6137
6202
|
*/
|
|
6138
6203
|
address: string
|
|
6139
6204
|
/**
|
|
6140
|
-
* Наш адрес-отправитель (для senderPattern и сети)
|
|
6205
|
+
* Наш адрес-отправитель (для senderPattern и сети). Обязателен для transfer
|
|
6141
6206
|
*
|
|
6142
6207
|
* length: 1..∞
|
|
6143
6208
|
*/
|
|
6144
|
-
fromAddressId
|
|
6209
|
+
fromAddressId?: string
|
|
6210
|
+
/**
|
|
6211
|
+
* Сеть адреса контрагента (Network.slug). Обязательна для правок справочника
|
|
6212
|
+
*
|
|
6213
|
+
* length: 1..∞
|
|
6214
|
+
*/
|
|
6215
|
+
network?: string
|
|
6145
6216
|
/** DECIMAL строка, как в POST /transfers (для селектора amount) */
|
|
6146
6217
|
amount?: string
|
|
6147
6218
|
/** Код токена; по умолчанию — токен адреса */
|
|
@@ -6169,6 +6240,8 @@ export interface AmlRuleEvaluation {
|
|
|
6169
6240
|
why?: "match" | "unknown"
|
|
6170
6241
|
outcome?: "block" | "officer"
|
|
6171
6242
|
detail?: string
|
|
6243
|
+
/** Правки справочника: адрес, на котором сработало */
|
|
6244
|
+
address?: string
|
|
6172
6245
|
}>
|
|
6173
6246
|
}
|
|
6174
6247
|
|
|
@@ -6187,8 +6260,9 @@ export interface AmlRule {
|
|
|
6187
6260
|
*/
|
|
6188
6261
|
version: number
|
|
6189
6262
|
provider: "scorechain"
|
|
6190
|
-
|
|
6191
|
-
|
|
6263
|
+
/** Где стоит правило: transfer — перевод; deposit — поступление (отправитель; деньги удерживаются до решения офицера, исход только officer); counterparty_address_add — новый адрес контрагента (создание с адресами, правка, отдельная ручка адреса); counterparty_group_add — контрагент в группу (проверяются ВСЕ его адреса). Белый список стоит на контрагенте, поэтому эти правки расширяют круг получателей */
|
|
6264
|
+
appliesTo: Array<"transfer" | "deposit" | "counterparty_address_add" | "counterparty_group_add">
|
|
6265
|
+
/** К каким операциям: селекторы перевода (senderPattern, destination, counterparty, counterpartyGroup, amount perTx, token) и destinationPattern — путь деривации НАШЕГО адреса-получателя. null — ко всем. Только у переводов: правило на правках справочника обязано иметь null */
|
|
6192
6266
|
scope: PolicyCondition | null
|
|
6193
6267
|
/** Чей риск: counterparty — получателя перевода; provenance — источников средств адреса-отправителя (внешние депозиты за всю историю, через внутренние переводы до provenance.depth); совпадение хотя бы одного источника — срабатывание */
|
|
6194
6268
|
subject: "counterparty" | "provenance"
|
package/src/resources/aml.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { seg, type HttpClient } from '../core/http.js'
|
|
|
2
2
|
import { toGated, type Gated } from '../core/gated.js'
|
|
3
3
|
import type {
|
|
4
4
|
AddAmlStopListBody,
|
|
5
|
+
AmlDepositDecisionResult,
|
|
5
6
|
AmlDepositReview,
|
|
6
7
|
AmlRule,
|
|
7
8
|
AmlRuleEvaluateBody,
|
|
@@ -215,6 +216,10 @@ export class AmlResource {
|
|
|
215
216
|
* from `fromAddressId` to `address`. `ruleIds` runs exactly those rules,
|
|
216
217
|
* DISABLED ones included — to see a rule before switching it on. `amount`
|
|
217
218
|
* is a decimal string, as in `transfers.create`.
|
|
219
|
+
*
|
|
220
|
+
* With `action: "counterparty_address_add" | "counterparty_group_add"` it
|
|
221
|
+
* runs the rules on counterparty-directory edits instead: `address` is the
|
|
222
|
+
* counterparty's address and `network` is required; `fromAddressId` is not.
|
|
218
223
|
*/
|
|
219
224
|
evaluateRules(input: AmlRuleEvaluateBody): Promise<AmlRuleEvaluation> {
|
|
220
225
|
return this.#http.request<AmlRuleEvaluation>('POST', `${this.#base}/rules/evaluate`, { body: input })
|
|
@@ -249,4 +254,17 @@ export class AmlResource {
|
|
|
249
254
|
})
|
|
250
255
|
}
|
|
251
256
|
|
|
257
|
+
/**
|
|
258
|
+
* An AML officer changes their mind about a rejected deposit: its money
|
|
259
|
+
* moves from blocked to available. The rejection stays in history; the
|
|
260
|
+
* comment is required. AML officers only, only from the PHONE, and not for
|
|
261
|
+
* a deposit to the officer's own address unless the rule allows it (403
|
|
262
|
+
* `AML_OWN_DEPOSIT`). Safe to repeat — the money moves once. Releasing or
|
|
263
|
+
* rejecting a HELD deposit is a vote: `approvals.vote`.
|
|
264
|
+
*/
|
|
265
|
+
unblockDeposit(depositId: string, comment: string): Promise<AmlDepositDecisionResult> {
|
|
266
|
+
return this.#http.request<AmlDepositDecisionResult>('POST', `${this.#base}/deposits/${seg(depositId)}/unblock`, {
|
|
267
|
+
body: { comment },
|
|
268
|
+
})
|
|
269
|
+
}
|
|
252
270
|
}
|
package/src/version.ts
CHANGED