@v3finance/core-sdk 0.1.0 → 0.2.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 (217) hide show
  1. package/CHANGELOG.md +397 -7
  2. package/README.md +215 -72
  3. package/dist/cjs/client.d.ts +67 -22
  4. package/dist/cjs/client.d.ts.map +1 -1
  5. package/dist/cjs/client.js +38 -2
  6. package/dist/cjs/client.js.map +1 -1
  7. package/dist/cjs/core/errors.d.ts +30 -10
  8. package/dist/cjs/core/errors.d.ts.map +1 -1
  9. package/dist/cjs/core/errors.js +47 -15
  10. package/dist/cjs/core/errors.js.map +1 -1
  11. package/dist/cjs/core/gated.d.ts +21 -3
  12. package/dist/cjs/core/gated.d.ts.map +1 -1
  13. package/dist/cjs/core/gated.js +12 -3
  14. package/dist/cjs/core/gated.js.map +1 -1
  15. package/dist/cjs/core/http.d.ts +12 -8
  16. package/dist/cjs/core/http.d.ts.map +1 -1
  17. package/dist/cjs/core/http.js +130 -40
  18. package/dist/cjs/core/http.js.map +1 -1
  19. package/dist/cjs/core/pagination.d.ts +28 -1
  20. package/dist/cjs/core/pagination.d.ts.map +1 -1
  21. package/dist/cjs/core/pagination.js +36 -1
  22. package/dist/cjs/core/pagination.js.map +1 -1
  23. package/dist/cjs/generated/operations.js +1 -1
  24. package/dist/cjs/generated/types.d.ts +948 -172
  25. package/dist/cjs/generated/types.d.ts.map +1 -1
  26. package/dist/cjs/index.d.ts +32 -8
  27. package/dist/cjs/index.d.ts.map +1 -1
  28. package/dist/cjs/index.js +12 -0
  29. package/dist/cjs/index.js.map +1 -1
  30. package/dist/cjs/resources/addresses.d.ts +22 -8
  31. package/dist/cjs/resources/addresses.d.ts.map +1 -1
  32. package/dist/cjs/resources/addresses.js +7 -1
  33. package/dist/cjs/resources/addresses.js.map +1 -1
  34. package/dist/cjs/resources/admin.d.ts +150 -25
  35. package/dist/cjs/resources/admin.d.ts.map +1 -1
  36. package/dist/cjs/resources/admin.js +94 -23
  37. package/dist/cjs/resources/admin.js.map +1 -1
  38. package/dist/cjs/resources/approvals.d.ts +46 -5
  39. package/dist/cjs/resources/approvals.d.ts.map +1 -1
  40. package/dist/cjs/resources/approvals.js +27 -4
  41. package/dist/cjs/resources/approvals.js.map +1 -1
  42. package/dist/cjs/resources/balances.d.ts +152 -16
  43. package/dist/cjs/resources/balances.d.ts.map +1 -1
  44. package/dist/cjs/resources/balances.js +9 -5
  45. package/dist/cjs/resources/balances.js.map +1 -1
  46. package/dist/cjs/resources/categories.d.ts +93 -21
  47. package/dist/cjs/resources/categories.d.ts.map +1 -1
  48. package/dist/cjs/resources/categories.js +65 -18
  49. package/dist/cjs/resources/categories.js.map +1 -1
  50. package/dist/cjs/resources/counterparties.d.ts +26 -3
  51. package/dist/cjs/resources/counterparties.d.ts.map +1 -1
  52. package/dist/cjs/resources/counterparties.js +17 -0
  53. package/dist/cjs/resources/counterparties.js.map +1 -1
  54. package/dist/cjs/resources/folders.d.ts +51 -10
  55. package/dist/cjs/resources/folders.d.ts.map +1 -1
  56. package/dist/cjs/resources/folders.js +36 -5
  57. package/dist/cjs/resources/folders.js.map +1 -1
  58. package/dist/cjs/resources/history.d.ts +20 -2
  59. package/dist/cjs/resources/history.d.ts.map +1 -1
  60. package/dist/cjs/resources/history.js.map +1 -1
  61. package/dist/cjs/resources/me.d.ts +27 -4
  62. package/dist/cjs/resources/me.d.ts.map +1 -1
  63. package/dist/cjs/resources/me.js +22 -1
  64. package/dist/cjs/resources/me.js.map +1 -1
  65. package/dist/cjs/resources/members.d.ts +19 -4
  66. package/dist/cjs/resources/members.d.ts.map +1 -1
  67. package/dist/cjs/resources/members.js +15 -6
  68. package/dist/cjs/resources/members.js.map +1 -1
  69. package/dist/cjs/resources/operations.d.ts +64 -8
  70. package/dist/cjs/resources/operations.d.ts.map +1 -1
  71. package/dist/cjs/resources/operations.js +26 -2
  72. package/dist/cjs/resources/operations.js.map +1 -1
  73. package/dist/cjs/resources/registries.d.ts +87 -9
  74. package/dist/cjs/resources/registries.d.ts.map +1 -1
  75. package/dist/cjs/resources/registries.js +54 -11
  76. package/dist/cjs/resources/registries.js.map +1 -1
  77. package/dist/cjs/resources/reports.d.ts +300 -41
  78. package/dist/cjs/resources/reports.d.ts.map +1 -1
  79. package/dist/cjs/resources/reports.js +135 -7
  80. package/dist/cjs/resources/reports.js.map +1 -1
  81. package/dist/cjs/resources/sharing.d.ts +61 -10
  82. package/dist/cjs/resources/sharing.d.ts.map +1 -1
  83. package/dist/cjs/resources/sharing.js +51 -4
  84. package/dist/cjs/resources/sharing.js.map +1 -1
  85. package/dist/cjs/resources/transfers.d.ts +26 -4
  86. package/dist/cjs/resources/transfers.d.ts.map +1 -1
  87. package/dist/cjs/resources/transfers.js +23 -1
  88. package/dist/cjs/resources/transfers.js.map +1 -1
  89. package/dist/cjs/resources/types.d.ts +20 -0
  90. package/dist/cjs/resources/types.d.ts.map +1 -1
  91. package/dist/cjs/units.d.ts.map +1 -1
  92. package/dist/cjs/units.js +18 -2
  93. package/dist/cjs/units.js.map +1 -1
  94. package/dist/cjs/version.d.ts +1 -1
  95. package/dist/cjs/version.js +1 -1
  96. package/dist/esm/client.d.ts +67 -22
  97. package/dist/esm/client.d.ts.map +1 -1
  98. package/dist/esm/client.js +38 -2
  99. package/dist/esm/client.js.map +1 -1
  100. package/dist/esm/core/errors.d.ts +30 -10
  101. package/dist/esm/core/errors.d.ts.map +1 -1
  102. package/dist/esm/core/errors.js +47 -15
  103. package/dist/esm/core/errors.js.map +1 -1
  104. package/dist/esm/core/gated.d.ts +21 -3
  105. package/dist/esm/core/gated.d.ts.map +1 -1
  106. package/dist/esm/core/gated.js +12 -3
  107. package/dist/esm/core/gated.js.map +1 -1
  108. package/dist/esm/core/http.d.ts +12 -8
  109. package/dist/esm/core/http.d.ts.map +1 -1
  110. package/dist/esm/core/http.js +131 -41
  111. package/dist/esm/core/http.js.map +1 -1
  112. package/dist/esm/core/pagination.d.ts +28 -1
  113. package/dist/esm/core/pagination.d.ts.map +1 -1
  114. package/dist/esm/core/pagination.js +36 -1
  115. package/dist/esm/core/pagination.js.map +1 -1
  116. package/dist/esm/generated/operations.js +1 -1
  117. package/dist/esm/generated/types.d.ts +948 -172
  118. package/dist/esm/generated/types.d.ts.map +1 -1
  119. package/dist/esm/index.d.ts +32 -8
  120. package/dist/esm/index.d.ts.map +1 -1
  121. package/dist/esm/index.js +17 -5
  122. package/dist/esm/index.js.map +1 -1
  123. package/dist/esm/resources/addresses.d.ts +22 -8
  124. package/dist/esm/resources/addresses.d.ts.map +1 -1
  125. package/dist/esm/resources/addresses.js +7 -1
  126. package/dist/esm/resources/addresses.js.map +1 -1
  127. package/dist/esm/resources/admin.d.ts +150 -25
  128. package/dist/esm/resources/admin.d.ts.map +1 -1
  129. package/dist/esm/resources/admin.js +94 -23
  130. package/dist/esm/resources/admin.js.map +1 -1
  131. package/dist/esm/resources/approvals.d.ts +46 -5
  132. package/dist/esm/resources/approvals.d.ts.map +1 -1
  133. package/dist/esm/resources/approvals.js +27 -4
  134. package/dist/esm/resources/approvals.js.map +1 -1
  135. package/dist/esm/resources/balances.d.ts +152 -16
  136. package/dist/esm/resources/balances.d.ts.map +1 -1
  137. package/dist/esm/resources/balances.js +9 -5
  138. package/dist/esm/resources/balances.js.map +1 -1
  139. package/dist/esm/resources/categories.d.ts +93 -21
  140. package/dist/esm/resources/categories.d.ts.map +1 -1
  141. package/dist/esm/resources/categories.js +65 -18
  142. package/dist/esm/resources/categories.js.map +1 -1
  143. package/dist/esm/resources/counterparties.d.ts +26 -3
  144. package/dist/esm/resources/counterparties.d.ts.map +1 -1
  145. package/dist/esm/resources/counterparties.js +17 -0
  146. package/dist/esm/resources/counterparties.js.map +1 -1
  147. package/dist/esm/resources/folders.d.ts +51 -10
  148. package/dist/esm/resources/folders.d.ts.map +1 -1
  149. package/dist/esm/resources/folders.js +36 -5
  150. package/dist/esm/resources/folders.js.map +1 -1
  151. package/dist/esm/resources/history.d.ts +20 -2
  152. package/dist/esm/resources/history.d.ts.map +1 -1
  153. package/dist/esm/resources/history.js.map +1 -1
  154. package/dist/esm/resources/me.d.ts +27 -4
  155. package/dist/esm/resources/me.d.ts.map +1 -1
  156. package/dist/esm/resources/me.js +22 -1
  157. package/dist/esm/resources/me.js.map +1 -1
  158. package/dist/esm/resources/members.d.ts +19 -4
  159. package/dist/esm/resources/members.d.ts.map +1 -1
  160. package/dist/esm/resources/members.js +15 -6
  161. package/dist/esm/resources/members.js.map +1 -1
  162. package/dist/esm/resources/operations.d.ts +64 -8
  163. package/dist/esm/resources/operations.d.ts.map +1 -1
  164. package/dist/esm/resources/operations.js +26 -2
  165. package/dist/esm/resources/operations.js.map +1 -1
  166. package/dist/esm/resources/registries.d.ts +87 -9
  167. package/dist/esm/resources/registries.d.ts.map +1 -1
  168. package/dist/esm/resources/registries.js +54 -11
  169. package/dist/esm/resources/registries.js.map +1 -1
  170. package/dist/esm/resources/reports.d.ts +300 -41
  171. package/dist/esm/resources/reports.d.ts.map +1 -1
  172. package/dist/esm/resources/reports.js +135 -7
  173. package/dist/esm/resources/reports.js.map +1 -1
  174. package/dist/esm/resources/sharing.d.ts +61 -10
  175. package/dist/esm/resources/sharing.d.ts.map +1 -1
  176. package/dist/esm/resources/sharing.js +51 -4
  177. package/dist/esm/resources/sharing.js.map +1 -1
  178. package/dist/esm/resources/transfers.d.ts +26 -4
  179. package/dist/esm/resources/transfers.d.ts.map +1 -1
  180. package/dist/esm/resources/transfers.js +23 -1
  181. package/dist/esm/resources/transfers.js.map +1 -1
  182. package/dist/esm/resources/types.d.ts +20 -0
  183. package/dist/esm/resources/types.d.ts.map +1 -1
  184. package/dist/esm/units.d.ts.map +1 -1
  185. package/dist/esm/units.js +18 -2
  186. package/dist/esm/units.js.map +1 -1
  187. package/dist/esm/version.d.ts +1 -1
  188. package/dist/esm/version.js +1 -1
  189. package/docs/concepts.md +191 -0
  190. package/docs/errors.md +471 -0
  191. package/package.json +7 -6
  192. package/src/client.ts +89 -25
  193. package/src/core/errors.ts +49 -15
  194. package/src/core/gated.ts +22 -4
  195. package/src/core/http.ts +156 -46
  196. package/src/core/pagination.ts +38 -1
  197. package/src/generated/operations.ts +1 -1
  198. package/src/generated/types.ts +983 -173
  199. package/src/index.ts +64 -7
  200. package/src/resources/addresses.ts +23 -8
  201. package/src/resources/admin.ts +186 -33
  202. package/src/resources/approvals.ts +55 -9
  203. package/src/resources/balances.ts +186 -14
  204. package/src/resources/categories.ts +125 -30
  205. package/src/resources/counterparties.ts +23 -6
  206. package/src/resources/folders.ts +74 -18
  207. package/src/resources/history.ts +27 -2
  208. package/src/resources/me.ts +30 -5
  209. package/src/resources/members.ts +26 -7
  210. package/src/resources/operations.ts +73 -8
  211. package/src/resources/registries.ts +90 -11
  212. package/src/resources/reports.ts +348 -67
  213. package/src/resources/sharing.ts +71 -18
  214. package/src/resources/transfers.ts +33 -5
  215. package/src/resources/types.ts +20 -0
  216. package/src/units.ts +19 -2
  217. package/src/version.ts +1 -1
@@ -1,16 +1,121 @@
1
1
  import { type HttpClient } from '../core/http.js';
2
2
  import type { PageParams } from '../core/pagination.js';
3
- import type { BalancesAsOf, LedgerEntry, VaultBalancesResponse } from '../generated/types.js';
3
+ import type { BalancesAsOf, BalancesAsOfAccount, LedgerAccountItem, LedgerEntriesPage, LedgerEntry, LedgerPosting as GeneratedLedgerPosting, VaultBalancesResponse } from '../generated/types.js';
4
+ /**
5
+ * What a ledger account is FOR. A strict alias of the generated enum.
6
+ *
7
+ * `available` (spendable) and `reserved` (held for a transfer in flight)
8
+ * belong to an ADDRESS. `external` and `adjustment` are vault-level: they are
9
+ * the far side of the double entry — the outside world, and manual
10
+ * corrections — and belong to no address, which is why
11
+ * `LedgerAccountItem.address` is nullable.
12
+ */
13
+ export type LedgerPurpose = LedgerAccountItem['purpose'];
4
14
  export interface BalancesParams extends PageParams {
5
15
  /** Roll up the whole vault instead of listing per address. */
6
16
  summary?: boolean | undefined;
7
17
  addressId?: string | undefined;
8
18
  token?: string | undefined;
9
- /** `available` is spendable; `reserved` is held for transfers in flight. */
10
- purpose?: 'available' | 'reserved' | undefined;
19
+ /**
20
+ * Narrows `accounts` ONLY. `totals` ignores it and always reports
21
+ * `available` plus `reserved`, so `purpose: 'external'` lists the
22
+ * vault-level accounts beside totals that do not count them — the two
23
+ * halves of the answer are not filtered the same way.
24
+ */
25
+ purpose?: LedgerPurpose | undefined;
11
26
  /** Include addresses shared with you. Off by default. */
12
27
  includeShared?: boolean | undefined;
13
28
  }
29
+ /**
30
+ * `balances/as-of` parameters, beyond the moment itself.
31
+ *
32
+ * A superset of what `list()` takes: a replay can also be narrowed to a token
33
+ * id or a folder.
34
+ *
35
+ * Written by hand, like every query type in this package: the generator emits
36
+ * schemas and never looks at `parameters`, so there is no generated shape to
37
+ * alias. `test/queryParams.test.ts` holds it to the document instead — a
38
+ * parameter the endpoint declares and this interface lacks fails there.
39
+ */
40
+ export interface BalancesAsOfParams {
41
+ /** Token code, e.g. `usdt`. Ignored when `tokenId` is given. */
42
+ token?: string | undefined;
43
+ /** Registry token id. Wins over `token`. */
44
+ tokenId?: string | undefined;
45
+ addressId?: string | undefined;
46
+ /**
47
+ * Every address in the folder, by its CURRENT membership — a replay of past
48
+ * balances through today's folder. REPLACES `addressId` rather than
49
+ * intersecting with it, so sending both silently drops `addressId`.
50
+ */
51
+ folderId?: string | undefined;
52
+ purpose?: LedgerPurpose | undefined;
53
+ /** Totals only. See the overloads: `accounts` is then ABSENT, not empty. */
54
+ summary?: boolean | undefined;
55
+ includeShared?: boolean | undefined;
56
+ }
57
+ /**
58
+ * What `asOf` answers WITHOUT `summary` — the body with `accounts` present.
59
+ *
60
+ * The generated `BalancesAsOf` describes both modes with one schema, so its
61
+ * `accounts` is optional: absent under `summary: true`, always there
62
+ * otherwise (an empty array when nothing moved before the moment). This is
63
+ * the second half of that sentence as a type, so a call that did not ask for
64
+ * a summary is not made to check for a key that cannot be missing.
65
+ */
66
+ export type BalancesAsOfWithAccounts = BalancesAsOf & {
67
+ accounts: BalancesAsOfAccount[];
68
+ };
69
+ /**
70
+ * What `asOf` answers under `summary: true` — the same body WITHOUT
71
+ * `accounts`.
72
+ *
73
+ * Not an empty array: the key is absent, which is how the API tells "accounts
74
+ * were not asked for" from "there are none". The document says the same —
75
+ * `BalancesAsOf.accounts` is optional — and this type is the summary half of
76
+ * it, with the key removed rather than left optional.
77
+ *
78
+ * Spellable without importing it: `Omit<BalancesAsOf, 'accounts'>`.
79
+ */
80
+ export type BalancesAsOfSummary = Omit<BalancesAsOf, 'accounts'>;
81
+ /**
82
+ * One side of a ledger entry. A strict alias of the generated schema.
83
+ *
84
+ * Signed, with no `direction` field: which way the money went IS the sign of
85
+ * `amountRawSigned` — negative means debited from that account. A COMPLETE
86
+ * entry's postings sum to zero; see `entries` for why the ones you are shown
87
+ * may not. `ownerId` is the address id, or the vault id for a vault-level
88
+ * account, and `amountDecimalSigned` falls back to the raw figure when the
89
+ * posting's token is not in the registry.
90
+ */
91
+ export type LedgerPosting = GeneratedLedgerPosting;
92
+ /**
93
+ * The values `entryType` takes, as the journal REPORTS them.
94
+ *
95
+ * Stored as `reserve`/`confirm`/`release` and renamed on the way out, which
96
+ * is why the filter accepts either spelling: `entryType: 'reserve'` and
97
+ * `entryType: 'transfer_reserve'` select the same rows. `topup`, `adjustment`
98
+ * and `genesis` have no transfer stage and are not renamed. `genesis` is the
99
+ * opening correction written when the ledger was first backfilled; nothing
100
+ * creates new ones.
101
+ *
102
+ * Kept by hand because the document does not carry it as a type: the
103
+ * generated `LedgerEntry.entryType` is a bare `string` whose DESCRIPTION
104
+ * lists these six. The API does not close the list either — a stored kind it
105
+ * has no name for is passed through as it is — so this union types the
106
+ * FILTER, where a misspelling answers an empty page rather than an error,
107
+ * and is not forced onto the entries that come back.
108
+ */
109
+ export type LedgerEntryType = 'transfer_reserve' | 'transfer_confirm' | 'transfer_refund' | 'topup' | 'adjustment' | 'genesis';
110
+ /**
111
+ * One ledger entry. A strict alias of the generated `LedgerEntry`, kept under
112
+ * its earlier name.
113
+ *
114
+ * `token` is the entry's token by its FIRST posting, taken before postings
115
+ * are filtered for the caller — so it is present even when `postings` comes
116
+ * back empty for you.
117
+ */
118
+ export type LedgerEntryItem = LedgerEntry;
14
119
  /**
15
120
  * Balances and the ledger behind them.
16
121
  *
@@ -23,25 +128,56 @@ export declare class BalancesResource {
23
128
  #private;
24
129
  constructor(http: HttpClient, vaultCode: string);
25
130
  list(params?: BalancesParams): Promise<VaultBalancesResponse>;
26
- /** Balances as they stood at a moment in time, replayed from the ledger. */
27
- asOf(at: string, params?: {
28
- addressId?: string;
29
- token?: string;
30
- }): Promise<BalancesAsOf>;
31
- /** The raw ledger. Append-only: corrections arrive as reversing entries. */
131
+ /**
132
+ * Balances as they stood at a moment in time, replayed from the ledger.
133
+ *
134
+ * `at` is positional because it is required — a replay with no instant is
135
+ * not a replay. `totals` covers `available` and `reserved` only; the
136
+ * vault-level accounts appear in `accounts` and never in the totals.
137
+ *
138
+ * UNITS DIFFER FROM `list()`. In `totals`, `available` and `reserved` are
139
+ * DECIMAL here — duplicates of `availableDecimal`/`reservedDecimal` — while
140
+ * the fields of the same name on `list()` are raw smallest units. Raw
141
+ * figures exist only per account, in `accounts[].balance`. Read the totals
142
+ * with `parseDecimal`, not `amount`.
143
+ */
144
+ asOf(at: string, params?: BalancesAsOfParams & {
145
+ summary?: false | undefined;
146
+ }): Promise<BalancesAsOfWithAccounts>;
147
+ /** `summary: true` — totals only, and the body carries no `accounts` key. */
148
+ asOf(at: string, params: BalancesAsOfParams & {
149
+ summary: true;
150
+ }): Promise<BalancesAsOfSummary>;
151
+ /**
152
+ * `summary` decided at runtime. The answer is then one shape or the other,
153
+ * so this signature hands back the union rather than guessing: narrow it
154
+ * with `'accounts' in result`.
155
+ */
156
+ asOf(at: string, params: BalancesAsOfParams): Promise<BalancesAsOfWithAccounts | BalancesAsOfSummary>;
157
+ /**
158
+ * The raw ledger. Append-only: corrections arrive as reversing entries.
159
+ *
160
+ * Non-admins see only the entries that touch their own addresses, and
161
+ * within such an entry only their own postings plus the vault-level ones.
162
+ * The postings of a page therefore need not sum to zero, even though every
163
+ * complete entry does.
164
+ */
32
165
  entries(params?: PageParams & {
166
+ /**
167
+ * Entries with a posting on this address. For a non-admin it narrows
168
+ * WITHIN their own addresses: somebody else's id answers an empty page,
169
+ * not a 403.
170
+ */
33
171
  addressId?: string;
34
- /** Kind of posting: `reserve`, `confirm`, `release`, `topup`, `adjustment`. */
35
- entryType?: string;
36
- operationType?: string;
172
+ /** Either spelling of the stage — see `LedgerEntryType`. */
173
+ entryType?: LedgerEntryType | 'reserve' | 'confirm' | 'release' | undefined;
174
+ operationType?: 'deposit' | 'transfer' | undefined;
175
+ /** The transfer or deposit id. Only applied together with `operationType`. */
37
176
  operationId?: string;
38
177
  token?: string;
39
178
  tokenId?: string;
40
179
  from?: string;
41
180
  to?: string;
42
- }): Promise<{
43
- items: LedgerEntry[];
44
- nextCursor: string | null;
45
- }>;
181
+ }): Promise<LedgerEntriesPage>;
46
182
  }
47
183
  //# sourceMappingURL=balances.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"balances.d.ts","sourceRoot":"","sources":["../../../src/resources/balances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAE7F,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,CAAA;IA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CAAC,EAAE,MAAM,CAAA;KACP,GACL,OAAO,CAAC,iBAAiB,CAAC,CAM5B;CACF"}
@@ -17,15 +17,19 @@ export class BalancesResource {
17
17
  list(params = {}) {
18
18
  return this.#http.request('GET', `/api/v1/vaults/${this.#vault}/balances`, { query: { ...params } });
19
19
  }
20
- /** Balances as they stood at a moment in time, replayed from the ledger. */
21
20
  asOf(at, params = {}) {
22
21
  return this.#http.request('GET', `/api/v1/vaults/${this.#vault}/balances/as-of`, { query: { at, ...params } });
23
22
  }
24
- /** The raw ledger. Append-only: corrections arrive as reversing entries. */
23
+ /**
24
+ * The raw ledger. Append-only: corrections arrive as reversing entries.
25
+ *
26
+ * Non-admins see only the entries that touch their own addresses, and
27
+ * within such an entry only their own postings plus the vault-level ones.
28
+ * The postings of a page therefore need not sum to zero, even though every
29
+ * complete entry does.
30
+ */
25
31
  entries(params = {}) {
26
- return this.#http.request('GET', `/api/v1/vaults/${this.#vault}/ledger/entries`, {
27
- query: { ...params },
28
- });
32
+ return this.#http.request('GET', `/api/v1/vaults/${this.#vault}/ledger/entries`, { query: { ...params } });
29
33
  }
30
34
  }
31
35
  //# sourceMappingURL=balances.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"balances.js","sourceRoot":"","sources":["../../../src/resources/balances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;AAetD;;;;;;;GAOG;AACH,MAAM,OAAO,gBAAgB;IAClB,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,GAAmB,EAAE;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,KAAK,EACL,kBAAkB,IAAI,CAAC,MAAM,WAAW,EACxC,EAAE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AAC,MAAM,iBAAiB,EAC9C,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAC7B,CAAA;IACH,CAAC;IAED;;;;;;;OAOG;IACH,OAAO,CACL,MAAM,GAgBF,EAAE;QAEN,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,KAAK,EACL,kBAAkB,IAAI,CAAC,MAAM,iBAAiB,EAC9C,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CACzB,CAAA;IACH,CAAC;CACF"}
@@ -1,9 +1,18 @@
1
1
  import { type HttpClient } from '../core/http.js';
2
2
  import { type Gated } from '../core/gated.js';
3
3
  import type { PageParams } from '../core/pagination.js';
4
- import type { ApprovalRequestCreated, AssignCategoryBody, EditAssignmentBody, OperationCategoryAssignmentVersionDetail, CreateOperationCategoryBody, OperationCategoriesPage, OperationCategory, OperationCategoryAssignment, OperationCategoryAssignmentVersion, PatchOperationCategoryBody } from '../generated/types.js';
5
- /** Operation kind in a labelling path: `transfer`, `deposit`, … */
6
- export type OperationType = string;
4
+ import type { AddOperationCategoryApproverBody, AddOperationCategoryFieldBody, AddOperationCategoryGrantBody, ApprovalRequestCreated, AssignCategoryBody, EditAssignmentBody, OperationCategoryAssignmentVersionDetail, CreateOperationCategoryBody, OperationCategoriesPage, OperationCategory, OperationCategoryApprover, OperationCategoryAssignment, OperationCategoryAssignmentVersion, OperationCategoryField, OperationCategoryGrant, OperationType as GeneratedOperationType, PatchOperationCategoryBody, PatchOperationCategoryFieldBody } from '../generated/types.js';
5
+ /**
6
+ * Operation kind in a labelling path. Exactly two values exist.
7
+ *
8
+ * A strict alias, not `string`. Because `src/index.ts` re-exports this name
9
+ * explicitly, and an explicit re-export beats `export type *`, the old
10
+ * `= string` was what consumers actually got for a schema that eight
11
+ * operations reference by name — so a misspelled kind compiled here and came
12
+ * back as a 400 from production instead. Every endpoint that takes the kind
13
+ * as a path segment refuses anything but these two outright.
14
+ */
15
+ export type OperationType = GeneratedOperationType;
7
16
  /**
8
17
  * Configurable labelling of operations.
9
18
  *
@@ -37,10 +46,27 @@ export declare class CategoriesResource {
37
46
  appliesTo?: 'transfer' | 'deposit' | 'both';
38
47
  }): Promise<OperationCategoriesPage>;
39
48
  get(categoryId: string): Promise<OperationCategory>;
40
- /** Categories this person may apply to this operation, with their fields. */
41
- available(type: OperationType, operationId: string): Promise<unknown>;
42
- /** What is currently applied to an operation. */
43
- assignments(type: OperationType, operationId: string): Promise<unknown>;
49
+ /**
50
+ * Categories this person may apply to this operation, with their fields.
51
+ *
52
+ * This is the endpoint to build a labelling form from, not `list()`: it
53
+ * accounts for grants and for access to the operation's own address, and it
54
+ * leaves out archived fields. `grants` and `approvers` never come back here
55
+ * — that is access configuration, and only an administrator sees it.
56
+ */
57
+ available(type: OperationType, operationId: string): Promise<{
58
+ items: OperationCategory[];
59
+ }>;
60
+ /**
61
+ * What is currently applied to an operation.
62
+ *
63
+ * Only the assignments whose values this person may see; a category they
64
+ * have no view access to is absent rather than empty. Within a visible one,
65
+ * sensitive fields come back as `null` with their keys in `redactedFields`.
66
+ */
67
+ assignments(type: OperationType, operationId: string): Promise<{
68
+ items: OperationCategoryAssignment[];
69
+ }>;
44
70
  /**
45
71
  * Applies a category to an operation.
46
72
  *
@@ -61,27 +87,73 @@ export declare class CategoriesResource {
61
87
  * Returns `Gated` for the same reason as `assign`.
62
88
  */
63
89
  updateAssignment(type: OperationType, operationId: string, assignmentId: string, input: EditAssignmentBody): Promise<Gated<OperationCategoryAssignment, ApprovalRequestCreated>>;
64
- removeAssignment(type: OperationType, operationId: string, assignmentId: string): Promise<unknown>;
90
+ /** Soft: the assignment goes to `removed` and its history survives. */
91
+ removeAssignment(type: OperationType, operationId: string, assignmentId: string): Promise<{
92
+ removed: boolean;
93
+ }>;
65
94
  /** Every version of an assignment — the audit trail of who changed what. */
66
95
  versions(type: OperationType, operationId: string, assignmentId: string): Promise<{
67
96
  items: OperationCategoryAssignmentVersion[];
68
97
  }>;
69
98
  version(type: OperationType, operationId: string, assignmentId: string, version: number): Promise<OperationCategoryAssignmentVersionDetail>;
70
- /** Creates a category. Administrator only. */
99
+ /**
100
+ * Creates a category. Administrator only.
101
+ *
102
+ * `viewScope`, `assignScope` and `editScope` say what the category opens to
103
+ * people WITHOUT a grant, and each takes one of two values: `owner_only` —
104
+ * nothing beyond access through the operation's own address and the
105
+ * category's grants — or `vault_members`, every member of the vault.
106
+ *
107
+ * The API still accepts a third spelling on input, `restricted`, as an
108
+ * alias of `owner_only`: it is stored as `owner_only` and never comes back
109
+ * in an answer. `CategoryAccessScope` leaves it out on purpose, so it does
110
+ * not compile here — send `owner_only`.
111
+ */
71
112
  create(input: CreateOperationCategoryBody): Promise<OperationCategory>;
72
- /** Administrator only. `key` cannot be changed. */
113
+ /**
114
+ * Administrator only. `key` cannot be changed. The three scopes take the
115
+ * same two values as on `create`.
116
+ */
73
117
  update(categoryId: string, input: PatchOperationCategoryBody): Promise<OperationCategory>;
74
- /** Administrator only. A field's `key` and `type` are fixed once created. */
75
- addField(categoryId: string, input: unknown): Promise<unknown>;
76
- /** Administrator only. */
77
- updateField(categoryId: string, fieldId: string, input: unknown): Promise<unknown>;
118
+ /**
119
+ * Administrator only. A field's `key` and `type` are fixed once created.
120
+ *
121
+ * `currencyFieldKey` is only for `type: 'currency'` and must name a sibling
122
+ * field of this same category that holds the ticker; the server refuses a
123
+ * dangling or wrongly typed link with 400 `CATEGORY_FIELD_LINK`.
124
+ */
125
+ addField(categoryId: string, input: AddOperationCategoryFieldBody): Promise<OperationCategoryField>;
126
+ /**
127
+ * Administrator only.
128
+ *
129
+ * `key` and `type` are absent from the body on purpose — they are
130
+ * immutable, since stored values, reports and snapshots are keyed by them;
131
+ * `scale` is not patchable either, so a field's precision is decided once.
132
+ * For `select`, `optionsJson` is the FULL new list and options may only be
133
+ * added. `archived: true` is how a field is retired, because a field with
134
+ * history cannot be deleted. Passing `currencyFieldKey: null` drops the
135
+ * amount↔ticker link, after which reports go back to adding different
136
+ * currencies into one meaningless total.
137
+ */
138
+ updateField(categoryId: string, fieldId: string, input: PatchOperationCategoryFieldBody): Promise<OperationCategoryField>;
78
139
  /** Administrator only. Who approves edits gated by `approvalScope`. */
79
- addApprover(categoryId: string, input: unknown): Promise<unknown>;
80
- /** Administrator only. */
81
- removeApprover(categoryId: string, approverId: string): Promise<unknown>;
82
- /** Administrator only. Who may see or edit values of this category. */
83
- addGrant(categoryId: string, input: unknown): Promise<unknown>;
84
- /** Administrator only. */
85
- removeGrant(categoryId: string, grantId: string): Promise<unknown>;
140
+ addApprover(categoryId: string, input: AddOperationCategoryApproverBody): Promise<OperationCategoryApprover>;
141
+ /** Administrator only. `deleted: false` means there was nothing to remove. */
142
+ removeApprover(categoryId: string, approverId: string): Promise<{
143
+ deleted: boolean;
144
+ }>;
145
+ /**
146
+ * Administrator only. Who may see or edit values of this category.
147
+ *
148
+ * Idempotent, like every grant in this API: calling it again for the same
149
+ * subject updates the rights and revives a revoked grant, so there is no
150
+ * "already exists" error to handle. `canEdit` implies `canView` — the
151
+ * server fills it in, because the other combination is unenforceable.
152
+ */
153
+ addGrant(categoryId: string, input: AddOperationCategoryGrantBody): Promise<OperationCategoryGrant>;
154
+ /** Administrator only. Soft revoke; `revoked: false` means no such grant. */
155
+ removeGrant(categoryId: string, grantId: string): Promise<{
156
+ revoked: boolean;
157
+ }>;
86
158
  }
87
159
  //# sourceMappingURL=categories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../../src/resources/categories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,wCAAwC,EACxC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AAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKjE;CACF"}
1
+ {"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../../src/resources/categories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EACV,gCAAgC,EAChC,6BAA6B,EAC7B,6BAA6B,EAC7B,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,wCAAwC,EACxC,2BAA2B,EAC3B,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,2BAA2B,EAC3B,kCAAkC,EAClC,sBAAsB,EACtB,sBAAsB,EACtB,aAAa,IAAI,sBAAsB,EACvC,0BAA0B,EAC1B,+BAA+B,EAChC,MAAM,uBAAuB,CAAA;AAE9B;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,kBAAkB;;IAI7B,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAUD,0DAA0D;IAC1D,IAAI,CACF,MAAM,GAAE,UAAU,GAAG;QACnB,uEAAuE;QACvE,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,iEAAiE;QACjE,SAAS,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAAA;KACvC,GACL,OAAO,CAAC,uBAAuB,CAAC,CAIlC;IAED,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAElD;IAED;;;;;;;OAOG;IACH,SAAS,CACP,IAAI,EAAE,aAAa,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;QAAE,K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BAA0B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAMxF;IAED;;;;;;OAMG;IACH,QAAQ,CACN,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,sBAAsB,CAAC,CAMjC;IAED;;;;;;;;;;;OAWG;IACH,WAAW,CACT,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,+BAA+B,GACrC,OAAO,CAAC,sBAAsB,CAAC,CAMjC;IAED,uEAAuE;IACvE,WAAW,CACT,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,gCAAgC,GACtC,OAAO,CAAC,yBAAyB,CAAC,CAMpC;IAED,8EAA8E;IAC9E,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAKpF;IAED;;;;;;;OAOG;IACH,QAAQ,CACN,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,sBAAsB,CAAC,CAMjC;IAED,6EAA6E;IAC7E,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAK9E;CACF"}
@@ -44,11 +44,24 @@ export class CategoriesResource {
44
44
  get(categoryId) {
45
45
  return this.#http.request('GET', `${this.#catalogue}/${seg(categoryId)}`);
46
46
  }
47
- /** Categories this person may apply to this operation, with their fields. */
47
+ /**
48
+ * Categories this person may apply to this operation, with their fields.
49
+ *
50
+ * This is the endpoint to build a labelling form from, not `list()`: it
51
+ * accounts for grants and for access to the operation's own address, and it
52
+ * leaves out archived fields. `grants` and `approvers` never come back here
53
+ * — that is access configuration, and only an administrator sees it.
54
+ */
48
55
  available(type, operationId) {
49
56
  return this.#http.request('GET', `${this.#assignments(type, operationId)}/available`);
50
57
  }
51
- /** What is currently applied to an operation. */
58
+ /**
59
+ * What is currently applied to an operation.
60
+ *
61
+ * Only the assignments whose values this person may see; a category they
62
+ * have no view access to is absent rather than empty. Within a visible one,
63
+ * sensitive fields come back as `null` with their keys in `redactedFields`.
64
+ */
52
65
  assignments(type, operationId) {
53
66
  return this.#http.request('GET', this.#assignments(type, operationId));
54
67
  }
@@ -78,6 +91,7 @@ export class CategoriesResource {
78
91
  const res = await this.#http.requestRaw('PATCH', `${this.#assignments(type, operationId)}/${seg(assignmentId)}`, { body: input });
79
92
  return toGated(res.status, res.data);
80
93
  }
94
+ /** Soft: the assignment goes to `removed` and its history survives. */
81
95
  removeAssignment(type, operationId, assignmentId) {
82
96
  return this.#http.request('DELETE', `${this.#assignments(type, operationId)}/${seg(assignmentId)}`);
83
97
  }
@@ -89,41 +103,74 @@ export class CategoriesResource {
89
103
  return this.#http.request('GET', `${this.#assignments(type, operationId)}/${seg(assignmentId)}/versions/${version}`);
90
104
  }
91
105
  // --- administrator only -------------------------------------------------
92
- /** Creates a category. Administrator only. */
106
+ /**
107
+ * Creates a category. Administrator only.
108
+ *
109
+ * `viewScope`, `assignScope` and `editScope` say what the category opens to
110
+ * people WITHOUT a grant, and each takes one of two values: `owner_only` —
111
+ * nothing beyond access through the operation's own address and the
112
+ * category's grants — or `vault_members`, every member of the vault.
113
+ *
114
+ * The API still accepts a third spelling on input, `restricted`, as an
115
+ * alias of `owner_only`: it is stored as `owner_only` and never comes back
116
+ * in an answer. `CategoryAccessScope` leaves it out on purpose, so it does
117
+ * not compile here — send `owner_only`.
118
+ */
93
119
  create(input) {
94
120
  return this.#http.request('POST', this.#catalogue, { body: input });
95
121
  }
96
- /** Administrator only. `key` cannot be changed. */
122
+ /**
123
+ * Administrator only. `key` cannot be changed. The three scopes take the
124
+ * same two values as on `create`.
125
+ */
97
126
  update(categoryId, input) {
98
127
  return this.#http.request('PATCH', `${this.#catalogue}/${seg(categoryId)}`, { body: input });
99
128
  }
100
- /** Administrator only. A field's `key` and `type` are fixed once created. */
129
+ /**
130
+ * Administrator only. A field's `key` and `type` are fixed once created.
131
+ *
132
+ * `currencyFieldKey` is only for `type: 'currency'` and must name a sibling
133
+ * field of this same category that holds the ticker; the server refuses a
134
+ * dangling or wrongly typed link with 400 `CATEGORY_FIELD_LINK`.
135
+ */
101
136
  addField(categoryId, input) {
102
- return this.#http.request('POST', `${this.#catalogue}/${seg(categoryId)}/fields`, {
103
- body: input,
104
- });
137
+ return this.#http.request('POST', `${this.#catalogue}/${seg(categoryId)}/fields`, { body: input });
105
138
  }
106
- /** Administrator only. */
139
+ /**
140
+ * Administrator only.
141
+ *
142
+ * `key` and `type` are absent from the body on purpose — they are
143
+ * immutable, since stored values, reports and snapshots are keyed by them;
144
+ * `scale` is not patchable either, so a field's precision is decided once.
145
+ * For `select`, `optionsJson` is the FULL new list and options may only be
146
+ * added. `archived: true` is how a field is retired, because a field with
147
+ * history cannot be deleted. Passing `currencyFieldKey: null` drops the
148
+ * amount↔ticker link, after which reports go back to adding different
149
+ * currencies into one meaningless total.
150
+ */
107
151
  updateField(categoryId, fieldId, input) {
108
152
  return this.#http.request('PATCH', `${this.#catalogue}/${seg(categoryId)}/fields/${seg(fieldId)}`, { body: input });
109
153
  }
110
154
  /** Administrator only. Who approves edits gated by `approvalScope`. */
111
155
  addApprover(categoryId, input) {
112
- return this.#http.request('POST', `${this.#catalogue}/${seg(categoryId)}/approvers`, {
113
- body: input,
114
- });
156
+ return this.#http.request('POST', `${this.#catalogue}/${seg(categoryId)}/approvers`, { body: input });
115
157
  }
116
- /** Administrator only. */
158
+ /** Administrator only. `deleted: false` means there was nothing to remove. */
117
159
  removeApprover(categoryId, approverId) {
118
160
  return this.#http.request('DELETE', `${this.#catalogue}/${seg(categoryId)}/approvers/${seg(approverId)}`);
119
161
  }
120
- /** Administrator only. Who may see or edit values of this category. */
162
+ /**
163
+ * Administrator only. Who may see or edit values of this category.
164
+ *
165
+ * Idempotent, like every grant in this API: calling it again for the same
166
+ * subject updates the rights and revives a revoked grant, so there is no
167
+ * "already exists" error to handle. `canEdit` implies `canView` — the
168
+ * server fills it in, because the other combination is unenforceable.
169
+ */
121
170
  addGrant(categoryId, input) {
122
- return this.#http.request('POST', `${this.#catalogue}/${seg(categoryId)}/grants`, {
123
- body: input,
124
- });
171
+ return this.#http.request('POST', `${this.#catalogue}/${seg(categoryId)}/grants`, { body: input });
125
172
  }
126
- /** Administrator only. */
173
+ /** Administrator only. Soft revoke; `revoked: false` means no such grant. */
127
174
  removeGrant(categoryId, grantId) {
128
175
  return this.#http.request('DELETE', `${this.#catalogue}/${seg(categoryId)}/grants/${seg(grantId)}`);
129
176
  }
@@ -1 +1 @@
1
- {"version":3,"file":"categories.js","sourceRoot":"","sources":["../../../src/resources/categories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAkBtD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,kBAAkB;IACpB,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,UAAU;QACZ,OAAO,kBAAkB,IAAI,CAAC,MAAM,uBAAuB,CAAA;IAC7D,CAAC;IAED,YAAY,CAAC,IAAmB,EAAE,WAAmB;QACnD,OAAO,kBAAkB,IAAI,CAAC,MAAM,eAAe,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,aAAa,CAAA;IAC/F,CAAC;IAED,0DAA0D;IAC1D,IAAI,CACF,MAAM,GAKF,EAAE;QAEN,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAA0B,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE;YACzE,KAAK,EA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IAAI,GAAG,CAAC,UAAU,CAAC,WAAW,GAAG,CAAC,OAAO,CAAC,EAAE,CAC/D,CAAA;IACH,CAAC;CACF"}
@@ -42,7 +42,17 @@ export declare class CounterpartiesResource {
42
42
  /** Archiving is reversible — pass `false` to bring one back. */
43
43
  archive(counterpartyId: string, archived?: boolean): Promise<Gated<Counterparty, ApprovalRequestCreated>>;
44
44
  addAddress(counterpartyId: string, input: AddCounterpartyAddressBody): Promise<Gated<CounterpartyAddressCreated, ApprovalRequestCreated>>;
45
- removeAddress(counterpartyId: string, addressId: string): Promise<Gated<unknown, ApprovalRequestCreated>>;
45
+ /**
46
+ * Narrows any allow-list built on this counterparty, so it is gated like
47
+ * the rest — under the `counterparty_update` policy, not one of its own.
48
+ *
49
+ * Operations already attributed to this address KEEP the counterparty: at
50
+ * the time they happened the address did belong to it, and that is a
51
+ * historical fact. Only new operations stop matching.
52
+ */
53
+ removeAddress(counterpartyId: string, addressId: string): Promise<Gated<{
54
+ deleted: true;
55
+ }, ApprovalRequestCreated>>;
46
56
  }
47
57
  /**
48
58
  * Groups of counterparties.
@@ -61,7 +71,20 @@ export declare class CounterpartyGroupsResource {
61
71
  create(input: CreateCounterpartyGroupBody): Promise<Gated<CounterpartyGroup, ApprovalRequestCreated>>;
62
72
  update(groupId: string, input: PatchCounterpartyGroupBody): Promise<Gated<CounterpartyGroup, ApprovalRequestCreated>>;
63
73
  archive(groupId: string, archived?: boolean): Promise<Gated<CounterpartyGroup, ApprovalRequestCreated>>;
64
- addMember(groupId: string, counterpartyId: string): Promise<Gated<unknown, ApprovalRequestCreated>>;
65
- removeMember(groupId: string, counterpartyId: string): Promise<Gated<unknown, ApprovalRequestCreated>>;
74
+ /**
75
+ * WIDENS any allow-list built on this group, and does so the moment it
76
+ * applies — which is why it is gated by its own policy
77
+ * (`counterparty_group_add`) rather than riding on the group's update.
78
+ */
79
+ addMember(groupId: string, counterpartyId: string): Promise<Gated<{
80
+ added: true;
81
+ }, ApprovalRequestCreated>>;
82
+ /**
83
+ * Payments to this counterparty under the group's allow-list stop at once.
84
+ * `removed: false` means it was not in the group — not a failure.
85
+ */
86
+ removeMember(groupId: string, counterpartyId: string): Promise<Gated<{
87
+ removed: boolean;
88
+ }, ApprovalRequestCreated>>;
66
89
  }
67
90
  //# sourceMappingURL=counterparties.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"counterparties.d.ts","sourceRoot":"","sources":["../../../src/resources/counterparties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,wBAAyB,SAAQ,UAAU;IAC1D,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC/B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,sBAAsB;;IAIjC,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAED,IAAI,CAAC,MAAM,GAAE,wBAA6B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAEvE;IAED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