@v3finance/core-sdk 0.7.0 → 0.9.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 +51 -0
- package/dist/cjs/generated/operations.d.ts +72 -0
- package/dist/cjs/generated/operations.d.ts.map +1 -1
- package/dist/cjs/generated/operations.js +74 -2
- package/dist/cjs/generated/operations.js.map +1 -1
- package/dist/cjs/generated/types.d.ts +228 -4
- package/dist/cjs/generated/types.d.ts.map +1 -1
- package/dist/cjs/resources/aml.d.ts +46 -1
- package/dist/cjs/resources/aml.d.ts.map +1 -1
- package/dist/cjs/resources/aml.js +65 -0
- package/dist/cjs/resources/aml.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 +72 -0
- package/dist/esm/generated/operations.d.ts.map +1 -1
- package/dist/esm/generated/operations.js +74 -2
- package/dist/esm/generated/operations.js.map +1 -1
- package/dist/esm/generated/types.d.ts +228 -4
- package/dist/esm/generated/types.d.ts.map +1 -1
- package/dist/esm/resources/aml.d.ts +46 -1
- package/dist/esm/resources/aml.d.ts.map +1 -1
- package/dist/esm/resources/aml.js +65 -0
- package/dist/esm/resources/aml.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/errors.md +9 -0
- package/package.json +1 -1
- package/src/generated/operations.ts +74 -2
- package/src/generated/types.ts +241 -4
- package/src/resources/aml.ts +87 -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 { AmlCheck, AmlOfficers, AmlRecheckBody, AmlSettings, AmlVisibilityGrant, AmlVisibilityGrants, ApprovalRequestCreated, CreateAmlVisibilityGrantBody, UpdateAmlSettingsBody } from '../generated/types.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';
|
|
4
4
|
/**
|
|
5
5
|
* AML checks of a vault, in the typed model (AML v2).
|
|
6
6
|
*
|
|
@@ -103,5 +103,50 @@ export declare class AmlResource {
|
|
|
103
103
|
* carries the check; `'pending'` — the request awaiting approval.
|
|
104
104
|
*/
|
|
105
105
|
checkInternal(addressId: string): Promise<Gated<AmlCheck, ApprovalRequestCreated>>;
|
|
106
|
+
/**
|
|
107
|
+
* The vault's AML rules. A rule applies to the WHOLE vault, admins
|
|
108
|
+
* included, after the policies: it only ADDS — a block (`AML_BLOCKED`) or
|
|
109
|
+
* an AML officer's approval. It never allows what policies denied and never
|
|
110
|
+
* drops their approvals. Unknown risk leads to an officer, never to a
|
|
111
|
+
* block or a pass. Admins and officers only.
|
|
112
|
+
*/
|
|
113
|
+
rules(): Promise<AmlRules>;
|
|
114
|
+
/**
|
|
115
|
+
* Creates a rule. `scope` — which transfers (transfer selectors plus
|
|
116
|
+
* `destinationPattern`, the derivation path of OUR recipient address);
|
|
117
|
+
* `risk` — on what risk (`null` — always); `subject: 'provenance'` judges
|
|
118
|
+
* where the sender's funds came from instead of the recipient. A condition
|
|
119
|
+
* the provider cannot serve is a 400 `AML_PROVIDER_CAPABILITY`.
|
|
120
|
+
*/
|
|
121
|
+
createRule(input: CreateAmlRuleBody): Promise<AmlRule>;
|
|
122
|
+
getRule(ruleId: string): Promise<AmlRule>;
|
|
123
|
+
/** Absent fields stay; the RESULTING rule is validated. Every change is a new `version`. */
|
|
124
|
+
updateRule(ruleId: string, patch: PatchAmlRuleBody): Promise<AmlRule>;
|
|
125
|
+
/**
|
|
126
|
+
* Dry run of the AML rules only (not the caller's policies) for a transfer
|
|
127
|
+
* from `fromAddressId` to `address`. `ruleIds` runs exactly those rules,
|
|
128
|
+
* DISABLED ones included — to see a rule before switching it on. `amount`
|
|
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.
|
|
134
|
+
*/
|
|
135
|
+
evaluateRules(input: AmlRuleEvaluateBody): Promise<AmlRuleEvaluation>;
|
|
136
|
+
/** Addresses the vault considers unacceptable. Acts only through a rule with a `stopList` leaf. */
|
|
137
|
+
stopList(params?: {
|
|
138
|
+
includeRevoked?: boolean | undefined;
|
|
139
|
+
}): Promise<AmlStopList>;
|
|
140
|
+
/** Idempotent: the same address again updates the reason or brings it back. EVM — stored lowercase. */
|
|
141
|
+
addToStopList(input: AddAmlStopListBody): Promise<AmlStopListEntry>;
|
|
142
|
+
/** Soft; repeating it is not an error. */
|
|
143
|
+
removeFromStopList(entryId: string): Promise<AmlStopListEntry>;
|
|
144
|
+
/**
|
|
145
|
+
* An AML officer marks a past deposit as reviewed: it stops being a source
|
|
146
|
+
* of risk for provenance rules (they have no time window). AML officers
|
|
147
|
+
* only, and only from the PHONE — web sessions get 403
|
|
148
|
+
* `WEB_SESSION_CANNOT_SIGN`. One mark per deposit; a repeat returns it.
|
|
149
|
+
*/
|
|
150
|
+
markDepositReviewed(depositId: string, comment: string): Promise<AmlDepositReview>;
|
|
106
151
|
}
|
|
107
152
|
//# 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;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O,CAAC,OAAO,CAAC,CAEpE;IAED;;;;;;;;;OASG;IACH,aAAa,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAEpE;IAID,mGAAmG;IACnG,QAAQ,CAAC,MAAM,GAAE;QAAE,cAAc,CAAC,EAAE,OAAO,GAAG,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;CAEF"}
|
|
@@ -133,5 +133,70 @@ export class AmlResource {
|
|
|
133
133
|
});
|
|
134
134
|
return toGated(res.status, res.data);
|
|
135
135
|
}
|
|
136
|
+
// ---------- AML rules (A3) ----------
|
|
137
|
+
/**
|
|
138
|
+
* The vault's AML rules. A rule applies to the WHOLE vault, admins
|
|
139
|
+
* included, after the policies: it only ADDS — a block (`AML_BLOCKED`) or
|
|
140
|
+
* an AML officer's approval. It never allows what policies denied and never
|
|
141
|
+
* drops their approvals. Unknown risk leads to an officer, never to a
|
|
142
|
+
* block or a pass. Admins and officers only.
|
|
143
|
+
*/
|
|
144
|
+
rules() {
|
|
145
|
+
return this.#http.request('GET', `${this.#base}/rules`);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Creates a rule. `scope` — which transfers (transfer selectors plus
|
|
149
|
+
* `destinationPattern`, the derivation path of OUR recipient address);
|
|
150
|
+
* `risk` — on what risk (`null` — always); `subject: 'provenance'` judges
|
|
151
|
+
* where the sender's funds came from instead of the recipient. A condition
|
|
152
|
+
* the provider cannot serve is a 400 `AML_PROVIDER_CAPABILITY`.
|
|
153
|
+
*/
|
|
154
|
+
createRule(input) {
|
|
155
|
+
return this.#http.request('POST', `${this.#base}/rules`, { body: input });
|
|
156
|
+
}
|
|
157
|
+
getRule(ruleId) {
|
|
158
|
+
return this.#http.request('GET', `${this.#base}/rules/${seg(ruleId)}`);
|
|
159
|
+
}
|
|
160
|
+
/** Absent fields stay; the RESULTING rule is validated. Every change is a new `version`. */
|
|
161
|
+
updateRule(ruleId, patch) {
|
|
162
|
+
return this.#http.request('PATCH', `${this.#base}/rules/${seg(ruleId)}`, { body: patch });
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Dry run of the AML rules only (not the caller's policies) for a transfer
|
|
166
|
+
* from `fromAddressId` to `address`. `ruleIds` runs exactly those rules,
|
|
167
|
+
* DISABLED ones included — to see a rule before switching it on. `amount`
|
|
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.
|
|
173
|
+
*/
|
|
174
|
+
evaluateRules(input) {
|
|
175
|
+
return this.#http.request('POST', `${this.#base}/rules/evaluate`, { body: input });
|
|
176
|
+
}
|
|
177
|
+
// ---------- Stop list (A3) ----------
|
|
178
|
+
/** Addresses the vault considers unacceptable. Acts only through a rule with a `stopList` leaf. */
|
|
179
|
+
stopList(params = {}) {
|
|
180
|
+
return this.#http.request('GET', `${this.#base}/stop-list`, { query: { ...params } });
|
|
181
|
+
}
|
|
182
|
+
/** Idempotent: the same address again updates the reason or brings it back. EVM — stored lowercase. */
|
|
183
|
+
addToStopList(input) {
|
|
184
|
+
return this.#http.request('POST', `${this.#base}/stop-list`, { body: input });
|
|
185
|
+
}
|
|
186
|
+
/** Soft; repeating it is not an error. */
|
|
187
|
+
removeFromStopList(entryId) {
|
|
188
|
+
return this.#http.request('DELETE', `${this.#base}/stop-list/${seg(entryId)}`);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* An AML officer marks a past deposit as reviewed: it stops being a source
|
|
192
|
+
* of risk for provenance rules (they have no time window). AML officers
|
|
193
|
+
* only, and only from the PHONE — web sessions get 403
|
|
194
|
+
* `WEB_SESSION_CANNOT_SIGN`. One mark per deposit; a repeat returns it.
|
|
195
|
+
*/
|
|
196
|
+
markDepositReviewed(depositId, comment) {
|
|
197
|
+
return this.#http.request('POST', `${this.#base}/deposits/${seg(depositId)}/reviewed`, {
|
|
198
|
+
body: { comment },
|
|
199
|
+
});
|
|
200
|
+
}
|
|
136
201
|
}
|
|
137
202
|
//# 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;AAuBtD;;;;;;;;;;;;;;;;;;;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,K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cAAc,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAClG,CAAC;IAED;;;;;OAKG;IACH,mBAAmB,CAAC,SAAiB,EAAE,OAAe;QACpD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAmB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,aAAa,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE;YACvG,IAAI,EAAE,EAAE,OAAO,EAAE;SAClB,CAAC,CAAA;IACJ,CAAC;CAEF"}
|
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.9.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
|
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.9.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/docs/errors.md
CHANGED
|
@@ -484,6 +484,15 @@ The public invitation lookup (`GET /invitations/by-token/{token}`) signals a dea
|
|
|
484
484
|
| `AML_DEFAULT_PROVIDER_REQUIRED` | 400 | `aml.updateSettings()` would leave the vault without exactly one enabled default provider. | Its check is recorded on every operation, so there must be one: keep a default enabled, or switch `isDefault` to another enabled provider in the same call. |
|
|
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
|
+
| `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. |
|
|
489
|
+
| `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
|
+
| `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
|
+
| `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. |
|
|
492
|
+
| `AML_RULE_CODE_TAKEN` | 409 | `aml.createRule` with a code that exists in this vault. | Codes are unique per vault and immutable. |
|
|
493
|
+
| `AML_RULE_NOT_FOUND` | 404 | `aml.getRule` / `updateRule` for an id not in this vault. | — |
|
|
494
|
+
| `STOP_LIST_ENTRY_NOT_FOUND` | 404 | `aml.removeFromStopList` for an entry not in this vault. | Refresh from `aml.stopList()`. |
|
|
495
|
+
| `DEPOSIT_NOT_FOUND` | 404 | `aml.markDepositReviewed` for a deposit that is not a posted deposit of this vault. | — |
|
|
487
496
|
|
|
488
497
|
Two rules the API enforces and your interface has to mirror:
|
|
489
498
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v3finance/core-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.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: 225 · admin: 45 · both: 1 · member: 176 · service: 3
|
|
12
|
+
// Spec sha256: 3b96e1515464c0531895a4f4588812587ad9f612236f81d990bbff16389e5dff
|
|
13
13
|
|
|
14
14
|
export type Audience = 'member' | 'admin' | 'service' | 'both' | 'unknown'
|
|
15
15
|
|
|
@@ -96,6 +96,14 @@ export const OPERATIONS = {
|
|
|
96
96
|
"summary": "Отозвать доступ (soft)",
|
|
97
97
|
"audience": "member"
|
|
98
98
|
},
|
|
99
|
+
"DELETE /api/v1/vaults/{code}/aml/stop-list/{entryId}": {
|
|
100
|
+
"method": "delete",
|
|
101
|
+
"path": "/api/v1/vaults/{code}/aml/stop-list/{entryId}",
|
|
102
|
+
"operationId": "deleteApiV1VaultsByCodeAmlStopListByEntryId",
|
|
103
|
+
"tag": "AML",
|
|
104
|
+
"summary": "Убрать адрес из стоп-листа",
|
|
105
|
+
"audience": "member"
|
|
106
|
+
},
|
|
99
107
|
"DELETE /api/v1/vaults/{code}/aml/visibility-grants/{grantId}": {
|
|
100
108
|
"method": "delete",
|
|
101
109
|
"path": "/api/v1/vaults/{code}/aml/visibility-grants/{grantId}",
|
|
@@ -576,6 +584,22 @@ export const OPERATIONS = {
|
|
|
576
584
|
"summary": "AML-офицеры",
|
|
577
585
|
"audience": "member"
|
|
578
586
|
},
|
|
587
|
+
"GET /api/v1/vaults/{code}/aml/rules": {
|
|
588
|
+
"method": "get",
|
|
589
|
+
"path": "/api/v1/vaults/{code}/aml/rules",
|
|
590
|
+
"operationId": "getApiV1VaultsByCodeAmlRules",
|
|
591
|
+
"tag": "AML",
|
|
592
|
+
"summary": "AML-правила Vault'а",
|
|
593
|
+
"audience": "member"
|
|
594
|
+
},
|
|
595
|
+
"GET /api/v1/vaults/{code}/aml/rules/{ruleId}": {
|
|
596
|
+
"method": "get",
|
|
597
|
+
"path": "/api/v1/vaults/{code}/aml/rules/{ruleId}",
|
|
598
|
+
"operationId": "getApiV1VaultsByCodeAmlRulesByRuleId",
|
|
599
|
+
"tag": "AML",
|
|
600
|
+
"summary": "AML-правило",
|
|
601
|
+
"audience": "member"
|
|
602
|
+
},
|
|
579
603
|
"GET /api/v1/vaults/{code}/aml/settings": {
|
|
580
604
|
"method": "get",
|
|
581
605
|
"path": "/api/v1/vaults/{code}/aml/settings",
|
|
@@ -584,6 +608,14 @@ export const OPERATIONS = {
|
|
|
584
608
|
"summary": "Настройки AML Vault'а",
|
|
585
609
|
"audience": "member"
|
|
586
610
|
},
|
|
611
|
+
"GET /api/v1/vaults/{code}/aml/stop-list": {
|
|
612
|
+
"method": "get",
|
|
613
|
+
"path": "/api/v1/vaults/{code}/aml/stop-list",
|
|
614
|
+
"operationId": "getApiV1VaultsByCodeAmlStopList",
|
|
615
|
+
"tag": "AML",
|
|
616
|
+
"summary": "Стоп-лист AML",
|
|
617
|
+
"audience": "member"
|
|
618
|
+
},
|
|
587
619
|
"GET /api/v1/vaults/{code}/aml/visibility-grants": {
|
|
588
620
|
"method": "get",
|
|
589
621
|
"path": "/api/v1/vaults/{code}/aml/visibility-grants",
|
|
@@ -1168,6 +1200,14 @@ export const OPERATIONS = {
|
|
|
1168
1200
|
"summary": "Изменить права гранта",
|
|
1169
1201
|
"audience": "member"
|
|
1170
1202
|
},
|
|
1203
|
+
"PATCH /api/v1/vaults/{code}/aml/rules/{ruleId}": {
|
|
1204
|
+
"method": "patch",
|
|
1205
|
+
"path": "/api/v1/vaults/{code}/aml/rules/{ruleId}",
|
|
1206
|
+
"operationId": "patchApiV1VaultsByCodeAmlRulesByRuleId",
|
|
1207
|
+
"tag": "AML",
|
|
1208
|
+
"summary": "Изменить AML-правило",
|
|
1209
|
+
"audience": "member"
|
|
1210
|
+
},
|
|
1171
1211
|
"PATCH /api/v1/vaults/{code}/counterparties/{id}": {
|
|
1172
1212
|
"method": "patch",
|
|
1173
1213
|
"path": "/api/v1/vaults/{code}/counterparties/{id}",
|
|
@@ -1456,6 +1496,14 @@ export const OPERATIONS = {
|
|
|
1456
1496
|
"summary": "Перепроверить адрес",
|
|
1457
1497
|
"audience": "admin"
|
|
1458
1498
|
},
|
|
1499
|
+
"POST /api/v1/vaults/{code}/aml/deposits/{depositId}/reviewed": {
|
|
1500
|
+
"method": "post",
|
|
1501
|
+
"path": "/api/v1/vaults/{code}/aml/deposits/{depositId}/reviewed",
|
|
1502
|
+
"operationId": "postApiV1VaultsByCodeAmlDepositsByDepositIdReviewed",
|
|
1503
|
+
"tag": "AML",
|
|
1504
|
+
"summary": "Отметить прошлый депозит «проверено»",
|
|
1505
|
+
"audience": "member"
|
|
1506
|
+
},
|
|
1459
1507
|
"POST /api/v1/vaults/{code}/aml/internal-checks": {
|
|
1460
1508
|
"method": "post",
|
|
1461
1509
|
"path": "/api/v1/vaults/{code}/aml/internal-checks",
|
|
@@ -1464,6 +1512,30 @@ export const OPERATIONS = {
|
|
|
1464
1512
|
"summary": "Проверить наш адрес",
|
|
1465
1513
|
"audience": "member"
|
|
1466
1514
|
},
|
|
1515
|
+
"POST /api/v1/vaults/{code}/aml/rules": {
|
|
1516
|
+
"method": "post",
|
|
1517
|
+
"path": "/api/v1/vaults/{code}/aml/rules",
|
|
1518
|
+
"operationId": "postApiV1VaultsByCodeAmlRules",
|
|
1519
|
+
"tag": "AML",
|
|
1520
|
+
"summary": "Создать AML-правило",
|
|
1521
|
+
"audience": "member"
|
|
1522
|
+
},
|
|
1523
|
+
"POST /api/v1/vaults/{code}/aml/rules/evaluate": {
|
|
1524
|
+
"method": "post",
|
|
1525
|
+
"path": "/api/v1/vaults/{code}/aml/rules/evaluate",
|
|
1526
|
+
"operationId": "postApiV1VaultsByCodeAmlRulesEvaluate",
|
|
1527
|
+
"tag": "AML",
|
|
1528
|
+
"summary": "Сухой прогон AML-правил",
|
|
1529
|
+
"audience": "member"
|
|
1530
|
+
},
|
|
1531
|
+
"POST /api/v1/vaults/{code}/aml/stop-list": {
|
|
1532
|
+
"method": "post",
|
|
1533
|
+
"path": "/api/v1/vaults/{code}/aml/stop-list",
|
|
1534
|
+
"operationId": "postApiV1VaultsByCodeAmlStopList",
|
|
1535
|
+
"tag": "AML",
|
|
1536
|
+
"summary": "Добавить адрес в стоп-лист",
|
|
1537
|
+
"audience": "member"
|
|
1538
|
+
},
|
|
1467
1539
|
"POST /api/v1/vaults/{code}/aml/visibility-grants": {
|
|
1468
1540
|
"method": "post",
|
|
1469
1541
|
"path": "/api/v1/vaults/{code}/aml/visibility-grants",
|