@v3finance/core-sdk 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/dist/cjs/generated/operations.d.ts +138 -2
  3. package/dist/cjs/generated/operations.d.ts.map +1 -1
  4. package/dist/cjs/generated/operations.js +140 -4
  5. package/dist/cjs/generated/operations.js.map +1 -1
  6. package/dist/cjs/generated/types.d.ts +318 -7
  7. package/dist/cjs/generated/types.d.ts.map +1 -1
  8. package/dist/cjs/resources/aml.d.ts +102 -10
  9. package/dist/cjs/resources/aml.d.ts.map +1 -1
  10. package/dist/cjs/resources/aml.js +140 -9
  11. package/dist/cjs/resources/aml.js.map +1 -1
  12. package/dist/cjs/resources/approvals.d.ts +6 -0
  13. package/dist/cjs/resources/approvals.d.ts.map +1 -1
  14. package/dist/cjs/resources/approvals.js.map +1 -1
  15. package/dist/cjs/resources/members.d.ts +11 -1
  16. package/dist/cjs/resources/members.d.ts.map +1 -1
  17. package/dist/cjs/resources/members.js +12 -0
  18. package/dist/cjs/resources/members.js.map +1 -1
  19. package/dist/cjs/version.d.ts +1 -1
  20. package/dist/cjs/version.js +1 -1
  21. package/dist/esm/generated/operations.d.ts +138 -2
  22. package/dist/esm/generated/operations.d.ts.map +1 -1
  23. package/dist/esm/generated/operations.js +140 -4
  24. package/dist/esm/generated/operations.js.map +1 -1
  25. package/dist/esm/generated/types.d.ts +318 -7
  26. package/dist/esm/generated/types.d.ts.map +1 -1
  27. package/dist/esm/resources/aml.d.ts +102 -10
  28. package/dist/esm/resources/aml.d.ts.map +1 -1
  29. package/dist/esm/resources/aml.js +140 -9
  30. package/dist/esm/resources/aml.js.map +1 -1
  31. package/dist/esm/resources/approvals.d.ts +6 -0
  32. package/dist/esm/resources/approvals.d.ts.map +1 -1
  33. package/dist/esm/resources/approvals.js.map +1 -1
  34. package/dist/esm/resources/members.d.ts +11 -1
  35. package/dist/esm/resources/members.d.ts.map +1 -1
  36. package/dist/esm/resources/members.js +12 -0
  37. package/dist/esm/resources/members.js.map +1 -1
  38. package/dist/esm/version.d.ts +1 -1
  39. package/dist/esm/version.js +1 -1
  40. package/docs/errors.md +16 -0
  41. package/package.json +1 -1
  42. package/src/generated/operations.ts +140 -4
  43. package/src/generated/types.ts +343 -7
  44. package/src/resources/aml.ts +186 -10
  45. package/src/resources/approvals.ts +6 -0
  46. package/src/resources/members.ts +19 -0
  47. package/src/version.ts +1 -1
@@ -1,13 +1,16 @@
1
1
  import { type HttpClient } from '../core/http.js';
2
- import type { AmlCheck, AmlRecheckBody } from '../generated/types.js';
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
4
  /**
4
5
  * AML checks of a vault, in the typed model (AML v2).
5
6
  *
6
7
  * WHAT YOU GET DEPENDS ON WHO YOU ARE, and `view` on the answer says which:
7
- * `summary` (any member) — level, score, categories; `links` (a vault or
8
- * platform admin) — plus the address's links; `full` (`getCheck` only) —
9
- * plus the provider's own response, typed. The server decides; reading
10
- * `links` from a `summary` answer gets `undefined`, not an error.
8
+ * `summary` — level, score, categories; `links` — plus the address's links;
9
+ * `full` (`getCheck` only) — plus the provider's own response, typed. Admins
10
+ * and AML officers get everything; a member gets the vault's default
11
+ * (`summary` unless changed) widened by their visibility grants. The server
12
+ * decides; reading `links` from a `summary` answer gets `undefined`, not an
13
+ * error.
11
14
  *
12
15
  * `level` is what to branch on. `null` means NOT CHECKED, never "clean" —
13
16
  * draw it as a third, neutral state. `share` and `amountUsd` are `null` for
@@ -37,20 +40,109 @@ export declare class AmlResource {
37
40
  */
38
41
  recheck(input: AmlRecheckBody): Promise<AmlCheck>;
39
42
  /**
40
- * One record, whole (`view: full`). This is how an operation's snapshot is
41
- * opened: pass its `amlCheckId` — what was known at the moment of the
42
- * transfer or deposit. Records never change. `native: null` — the full
43
- * provider response is not in the archive. Admins only.
43
+ * One record. This is how an operation's snapshot is opened: pass its
44
+ * `amlCheckId` — what was known at the moment of the transfer or deposit.
45
+ * Records never change. Any member, in their own `view`; only `full`
46
+ * carries `native` (`null` — the full response is not in the archive).
44
47
  */
45
48
  getCheck(id: string): Promise<AmlCheck>;
46
49
  /**
47
50
  * The provider's response byte for byte, for audit (hundreds of kilobytes
48
51
  * for an active address). Returns the untouched `Response`. 404
49
52
  * `AML_RAW_NOT_FOUND` — not archived for this record; 501
50
- * `AML_ARCHIVE_DISABLED` — no archive on the server. Admins only.
53
+ * `AML_ARCHIVE_DISABLED` — no archive on the server. Only with `full`
54
+ * (admins, officers, a `full` visibility grant) — 403 otherwise.
51
55
  */
52
56
  rawCheck(id: string, options?: {
53
57
  signal?: AbortSignal | undefined;
54
58
  }): Promise<Response>;
59
+ /**
60
+ * The vault's AML officers, and who appointed them when. These are the
61
+ * people an approver `{ kind: 'aml_officers' }` resolves to — at the moment
62
+ * a request is created, not later. Admins and officers only (403 for a
63
+ * member). Appointing is `members.setAmlOfficer()`.
64
+ */
65
+ officers(): Promise<AmlOfficers>;
66
+ /**
67
+ * The vault's AML settings: providers (enabled, default — whose check is
68
+ * recorded on every operation — and how fresh a stored check may be) and
69
+ * what any member sees without a grant. Untouched vault — Scorechain,
70
+ * 24 h, `summary`. Admins and officers only.
71
+ */
72
+ settings(): Promise<AmlSettings>;
73
+ /**
74
+ * Changes the settings; absent fields stay as they are. The RESULTING state
75
+ * is validated: exactly one enabled default provider (400
76
+ * `AML_DEFAULT_PROVIDER_REQUIRED`), `maxAgeSeconds` 0…30 days (0 — every
77
+ * check calls the paid provider). Admins and officers only.
78
+ */
79
+ updateSettings(input: UpdateAmlSettingsBody): Promise<AmlSettings>;
80
+ /** Who sees more than the vault's default. Admins and officers only. */
81
+ visibilityGrants(params?: {
82
+ includeRevoked?: boolean | undefined;
83
+ }): Promise<AmlVisibilityGrants>;
84
+ /**
85
+ * Opens `links` or `full` to a member or a group (its CURRENT members).
86
+ * Idempotent like every grant: the same subject again changes the role or
87
+ * reactivates a revoked grant. You must be able to see the member
88
+ * (`NOT_VISIBLE`); not to yourself (`SELF_SHARE`). Admins and officers only.
89
+ */
90
+ grantVisibility(input: CreateAmlVisibilityGrantBody): Promise<AmlVisibilityGrant>;
91
+ /** Soft and immediate; repeating it is not an error. Admins and officers only. */
92
+ revokeVisibility(grantId: string): Promise<AmlVisibilityGrant>;
93
+ /**
94
+ * Checks one of OUR addresses with the provider — how the provider sees it
95
+ * (blacklisted or not). Not done by default: only with permission.
96
+ *
97
+ * Admins and officers — at once. A member — by their policy on the action
98
+ * `aml_check_internal`: an allowing one checks at once, one that needs
99
+ * approval (typically from `{ kind: 'aml_officers' }`) returns the created
100
+ * request instead, and the check runs once it is approved — its record id
101
+ * is the request's `resolvedResultId`. No policy — 403. No view of the
102
+ * address — 404. Always a fresh, paid provider call. `outcome: 'applied'`
103
+ * carries the check; `'pending'` — the request awaiting approval.
104
+ */
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
+ evaluateRules(input: AmlRuleEvaluateBody): Promise<AmlRuleEvaluation>;
132
+ /** Addresses the vault considers unacceptable. Acts only through a rule with a `stopList` leaf. */
133
+ stopList(params?: {
134
+ includeRevoked?: boolean | undefined;
135
+ }): Promise<AmlStopList>;
136
+ /** Idempotent: the same address again updates the reason or brings it back. EVM — stored lowercase. */
137
+ addToStopList(input: AddAmlStopListBody): Promise<AmlStopListEntry>;
138
+ /** Soft; repeating it is not an error. */
139
+ removeFromStopList(entryId: string): Promise<AmlStopListEntry>;
140
+ /**
141
+ * An AML officer marks a past deposit as reviewed: it stops being a source
142
+ * of risk for provenance rules (they have no time window). AML officers
143
+ * only, and only from the PHONE — web sessions get 403
144
+ * `WEB_SESSION_CANNOT_SIGN`. One mark per deposit; a repeat returns it.
145
+ */
146
+ markDepositReviewed(depositId: string, comment: string): Promise<AmlDepositReview>;
55
147
  }
56
148
  //# 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,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAErE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,WAAW;;IAItB,YAAY,IAAI,EAAE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;;;;OAMG;IACH,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,CAEzB;IAED;;;;;;OAMG;IACH,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAErD;IAED,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAExC;IAED,4FAA4F;IAC5F,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAEpE;IAED;;;;;OAKG;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"}
@@ -1,12 +1,15 @@
1
1
  import { seg } from '../core/http.js';
2
+ import { toGated } from '../core/gated.js';
2
3
  /**
3
4
  * AML checks of a vault, in the typed model (AML v2).
4
5
  *
5
6
  * WHAT YOU GET DEPENDS ON WHO YOU ARE, and `view` on the answer says which:
6
- * `summary` (any member) — level, score, categories; `links` (a vault or
7
- * platform admin) — plus the address's links; `full` (`getCheck` only) —
8
- * plus the provider's own response, typed. The server decides; reading
9
- * `links` from a `summary` answer gets `undefined`, not an error.
7
+ * `summary` — level, score, categories; `links` — plus the address's links;
8
+ * `full` (`getCheck` only) — plus the provider's own response, typed. Admins
9
+ * and AML officers get everything; a member gets the vault's default
10
+ * (`summary` unless changed) widened by their visibility grants. The server
11
+ * decides; reading `links` from a `summary` answer gets `undefined`, not an
12
+ * error.
10
13
  *
11
14
  * `level` is what to branch on. `null` means NOT CHECKED, never "clean" —
12
15
  * draw it as a third, neutral state. `share` and `amountUsd` are `null` for
@@ -44,10 +47,10 @@ export class AmlResource {
44
47
  return this.#http.request('POST', `${this.#base}/checks`, { body: input });
45
48
  }
46
49
  /**
47
- * One record, whole (`view: full`). This is how an operation's snapshot is
48
- * opened: pass its `amlCheckId` — what was known at the moment of the
49
- * transfer or deposit. Records never change. `native: null` — the full
50
- * provider response is not in the archive. Admins only.
50
+ * One record. This is how an operation's snapshot is opened: pass its
51
+ * `amlCheckId` — what was known at the moment of the transfer or deposit.
52
+ * Records never change. Any member, in their own `view`; only `full`
53
+ * carries `native` (`null` — the full response is not in the archive).
51
54
  */
52
55
  getCheck(id) {
53
56
  return this.#http.request('GET', `${this.#base}/checks/${seg(id)}`);
@@ -56,12 +59,140 @@ export class AmlResource {
56
59
  * The provider's response byte for byte, for audit (hundreds of kilobytes
57
60
  * for an active address). Returns the untouched `Response`. 404
58
61
  * `AML_RAW_NOT_FOUND` — not archived for this record; 501
59
- * `AML_ARCHIVE_DISABLED` — no archive on the server. Admins only.
62
+ * `AML_ARCHIVE_DISABLED` — no archive on the server. Only with `full`
63
+ * (admins, officers, a `full` visibility grant) — 403 otherwise.
60
64
  */
61
65
  rawCheck(id, options = {}) {
62
66
  return this.#http.fetchRaw('GET', `${this.#base}/checks/${seg(id)}/raw`, {
63
67
  signal: options.signal,
64
68
  });
65
69
  }
70
+ /**
71
+ * The vault's AML officers, and who appointed them when. These are the
72
+ * people an approver `{ kind: 'aml_officers' }` resolves to — at the moment
73
+ * a request is created, not later. Admins and officers only (403 for a
74
+ * member). Appointing is `members.setAmlOfficer()`.
75
+ */
76
+ officers() {
77
+ return this.#http.request('GET', `${this.#base}/officers`);
78
+ }
79
+ /**
80
+ * The vault's AML settings: providers (enabled, default — whose check is
81
+ * recorded on every operation — and how fresh a stored check may be) and
82
+ * what any member sees without a grant. Untouched vault — Scorechain,
83
+ * 24 h, `summary`. Admins and officers only.
84
+ */
85
+ settings() {
86
+ return this.#http.request('GET', `${this.#base}/settings`);
87
+ }
88
+ /**
89
+ * Changes the settings; absent fields stay as they are. The RESULTING state
90
+ * is validated: exactly one enabled default provider (400
91
+ * `AML_DEFAULT_PROVIDER_REQUIRED`), `maxAgeSeconds` 0…30 days (0 — every
92
+ * check calls the paid provider). Admins and officers only.
93
+ */
94
+ updateSettings(input) {
95
+ return this.#http.request('PUT', `${this.#base}/settings`, { body: input });
96
+ }
97
+ /** Who sees more than the vault's default. Admins and officers only. */
98
+ visibilityGrants(params = {}) {
99
+ return this.#http.request('GET', `${this.#base}/visibility-grants`, {
100
+ query: { ...params },
101
+ });
102
+ }
103
+ /**
104
+ * Opens `links` or `full` to a member or a group (its CURRENT members).
105
+ * Idempotent like every grant: the same subject again changes the role or
106
+ * reactivates a revoked grant. You must be able to see the member
107
+ * (`NOT_VISIBLE`); not to yourself (`SELF_SHARE`). Admins and officers only.
108
+ */
109
+ grantVisibility(input) {
110
+ return this.#http.request('POST', `${this.#base}/visibility-grants`, {
111
+ body: input,
112
+ });
113
+ }
114
+ /** Soft and immediate; repeating it is not an error. Admins and officers only. */
115
+ revokeVisibility(grantId) {
116
+ return this.#http.request('DELETE', `${this.#base}/visibility-grants/${seg(grantId)}`);
117
+ }
118
+ /**
119
+ * Checks one of OUR addresses with the provider — how the provider sees it
120
+ * (blacklisted or not). Not done by default: only with permission.
121
+ *
122
+ * Admins and officers — at once. A member — by their policy on the action
123
+ * `aml_check_internal`: an allowing one checks at once, one that needs
124
+ * approval (typically from `{ kind: 'aml_officers' }`) returns the created
125
+ * request instead, and the check runs once it is approved — its record id
126
+ * is the request's `resolvedResultId`. No policy — 403. No view of the
127
+ * address — 404. Always a fresh, paid provider call. `outcome: 'applied'`
128
+ * carries the check; `'pending'` — the request awaiting approval.
129
+ */
130
+ async checkInternal(addressId) {
131
+ const res = await this.#http.requestRaw('POST', `${this.#base}/internal-checks`, {
132
+ body: { addressId },
133
+ });
134
+ return toGated(res.status, res.data);
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
+ evaluateRules(input) {
171
+ return this.#http.request('POST', `${this.#base}/rules/evaluate`, { body: input });
172
+ }
173
+ // ---------- Stop list (A3) ----------
174
+ /** Addresses the vault considers unacceptable. Acts only through a rule with a `stopList` leaf. */
175
+ stopList(params = {}) {
176
+ return this.#http.request('GET', `${this.#base}/stop-list`, { query: { ...params } });
177
+ }
178
+ /** Idempotent: the same address again updates the reason or brings it back. EVM — stored lowercase. */
179
+ addToStopList(input) {
180
+ return this.#http.request('POST', `${this.#base}/stop-list`, { body: input });
181
+ }
182
+ /** Soft; repeating it is not an error. */
183
+ removeFromStopList(entryId) {
184
+ return this.#http.request('DELETE', `${this.#base}/stop-list/${seg(entryId)}`);
185
+ }
186
+ /**
187
+ * An AML officer marks a past deposit as reviewed: it stops being a source
188
+ * of risk for provenance rules (they have no time window). AML officers
189
+ * only, and only from the PHONE — web sessions get 403
190
+ * `WEB_SESSION_CANNOT_SIGN`. One mark per deposit; a repeat returns it.
191
+ */
192
+ markDepositReviewed(depositId, comment) {
193
+ return this.#http.request('POST', `${this.#base}/deposits/${seg(depositId)}/reviewed`, {
194
+ body: { comment },
195
+ });
196
+ }
66
197
  }
67
198
  //# 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;AAGtD;;;;;;;;;;;;;;;;;GAiBG;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,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I,CAAC,KAAK,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"}
@@ -47,6 +47,12 @@ export interface ListApprovalsParams extends PageParams {
47
47
  vote?: 'approve' | 'reject' | 'any' | 'none' | undefined;
48
48
  decisionPolicyId?: string | undefined;
49
49
  targetType?: string | undefined;
50
+ /**
51
+ * The AML officer's queue: pending requests waiting for MY vote that need
52
+ * an AML officer's approval (a policy with an `aml_officers` approver) or
53
+ * are an AML action themselves (`aml_check_internal`).
54
+ */
55
+ forAmlOfficer?: boolean | undefined;
50
56
  /**
51
57
  * `newest` (default) or `oldest` — with `status: 'PENDING'`, the ones
52
58
  * waiting longest. A cursor belongs to its order: one from the other is a
@@ -1 +1 @@
1
- {"version":3,"file":"approvals.d.ts","sourceRoot":"","sources":["../../../src/resources/approvals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACT,MAAM,uBAAuB,CAAA;AAE9B;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CAAA;AAErF,MAAM,WAAW,mBAAoB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K,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;IAC5F,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,IAAI,CAAC,SAAiB,EAAE,KAAe;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,MAAM,EACN,GAAG,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,SAAS,CAAC,YAAY,EAC3C,EAAE,IAAI,EAAE,KAAK,EAAE,CAChB,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,SAAiB,EAAE,MAAe;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,MAAM,EACN,GAAG,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,SAAS,CAAC,SAAS,CACzC,CAAA;IACH,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,eAAe,CACnB,KAA0B;QAE1B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAU,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,YAAY,EAAE;YAClF,IAAI,EAAE,KAAK;SACZ,CAAC,CAAA;QACF,OAAO,OAAO,CAA2C,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IAChF,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import { type HttpClient } from '../core/http.js';
2
2
  import type { PageParams } from '../core/pagination.js';
3
- import type { ActionType, MemberCard, MemberDetail, MembersPage, PolicyDirectoryPage, UserGroup, UserGroupDetail, UserGroupMembers } from '../generated/types.js';
3
+ import type { ActionType, AmlOfficerState, MemberCard, MemberDetail, MembersPage, PolicyDirectoryPage, UserGroup, UserGroupDetail, UserGroupMembers } from '../generated/types.js';
4
4
  export interface PolicyDirectoryParams extends PageParams {
5
5
  actionType?: ActionType | undefined;
6
6
  effect?: 'allow' | 'block' | undefined;
@@ -69,5 +69,15 @@ export declare class MembersResource {
69
69
  */
70
70
  policyDirectory(params?: PolicyDirectoryParams): Promise<PolicyDirectoryPage>;
71
71
  groupMembers(groupId: string): Promise<UserGroupMembers>;
72
+ /**
73
+ * Appoints or removes an AML officer. An officer is a FLAG on a member, not
74
+ * a role: a member or an admin of the vault can also be an officer. Vault
75
+ * or platform administrators only (403 otherwise). Idempotent.
76
+ *
77
+ * 409 `AML_LAST_OFFICER` — the last officer cannot be removed while an
78
+ * enabled policy needs an officer's approval: `details.policies` lists
79
+ * their codes. Change those policies first, or appoint another officer.
80
+ */
81
+ setAmlOfficer(userId: string, isAmlOfficer: boolean): Promise<AmlOfficerState>;
72
82
  }
73
83
  //# sourceMappingURL=members.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"members.d.ts","sourceRoot":"","sources":["../../../src/resources/members.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,qBAAsB,SAAQ,UAAU;IACvD,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;IACtC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,2EAA2E;IAC3E,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC3B;AAED;;;;;;;GAOG;AACH,qBAAa,eAAe;;IAI1B,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAED,IAAI,CAAC,MAAM,GAAE,UAAU,GAAG;QAAE,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AC3E,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC3B;AAED;;;;;;;GAOG;AACH,qBAAa,eAAe;;IAI1B,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAED,IAAI,CAAC,MAAM,GAAE,UAAU,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAIxE;IAED,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAKzC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAM7C;IAED;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAO,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,SAAS,EAAE,CAAA;KAAE,CAAC,CAMpF;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAK/C;IAED;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,MAAM,GAAE,qBAA0B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAMhF;IAED,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAKvD;IAED;;;;;;;;OAQG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAM7E;CAEF"}
@@ -74,5 +74,17 @@ export class MembersResource {
74
74
  groupMembers(groupId) {
75
75
  return this.#http.request('GET', `/api/v1/vaults/${this.#vault}/user-groups/${seg(groupId)}/members`);
76
76
  }
77
+ /**
78
+ * Appoints or removes an AML officer. An officer is a FLAG on a member, not
79
+ * a role: a member or an admin of the vault can also be an officer. Vault
80
+ * or platform administrators only (403 otherwise). Idempotent.
81
+ *
82
+ * 409 `AML_LAST_OFFICER` — the last officer cannot be removed while an
83
+ * enabled policy needs an officer's approval: `details.policies` lists
84
+ * their codes. Change those policies first, or appoint another officer.
85
+ */
86
+ setAmlOfficer(userId, isAmlOfficer) {
87
+ return this.#http.request('PATCH', `/api/v1/vaults/${this.#vault}/members/${seg(userId)}`, { body: { isAmlOfficer } });
88
+ }
77
89
  }
78
90
  //# sourceMappingURL=members.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"members.js","sourceRoot":"","sources":["../../../src/resources/members.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;AAqBtD;;;;;;;GAOG;AACH,MAAM,OAAO,eAAe;IACjB,KAAK,CAAY;IACjB,MAAM,CAAQ;IAEvB,YAAY,IAAgB,EAAE,SAAiB;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IAC9B,CAAC;IAED,IAAI,CAAC,MAAM,GAAqC,EAAE;QAChD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAc,KAAK,EAAE,kBAAkB,IAAI,CAAC,MAAM,UAAU,EAAE;YACrF,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE;SACrB,CAAC,CAAA;IACJ,CAAC;IAED,GAAG,CAAC,MAAc;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,KAAK,EACL,kBAAkB,IAAI,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,EAAE,CACvD,CAAA;IACH,CAAC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,QAAgB;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,KAAK,EACL,kBAAkB,IAAI,CAAC,MAAM,kBAAkB,EAC/C,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,CACxB,CAAA;IACH,CA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,CACvB,KAAK,EACL,kBAAkB,IAAI,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAO,CAAC,UAAU,CACpE,CAAA;IACH,CAAC;IAED;;;;;;;;OAQG;IACH,aAAa,CAAC,MAAc,EAAE,YAAqB;QACjD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,OAAO,EACP,kBAAkB,IAAI,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,EAAE,EACtD,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,EAAE,CAC3B,CAAA;IACH,CAAC;CAEF"}
@@ -1,5 +1,5 @@
1
1
  /** SDK version, sent in the `user-agent` header. */
2
- export declare const SDK_VERSION = "0.6.0";
2
+ export declare const SDK_VERSION = "0.8.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,5 +1,5 @@
1
1
  /** SDK version, sent in the `user-agent` header. */
2
- export const SDK_VERSION = '0.6.0';
2
+ export const SDK_VERSION = '0.8.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
@@ -477,6 +477,22 @@ 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's approval. `details.policies` — codes of those policies. | Show the policies: the admin must change their approvers or disable them, or appoint another officer first. |
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
+ | `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
+ | `AML_PROVIDER_UNKNOWN` | 400 | `aml.updateSettings()` names a provider that is not in the registry. | Take ids from `registries.amlProviders()`. |
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
+ | `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
+ | `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. | — |
480
496
 
481
497
  Two rules the API enforces and your interface has to mirror:
482
498
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v3finance/core-sdk",
3
- "version": "0.6.0",
3
+ "version": "0.8.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": {