@v3finance/core-sdk 0.4.0 → 0.6.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 (175) hide show
  1. package/CHANGELOG.md +185 -0
  2. package/README.md +18 -14
  3. package/dist/cjs/client.d.ts +30 -34
  4. package/dist/cjs/client.d.ts.map +1 -1
  5. package/dist/cjs/client.js +71 -0
  6. package/dist/cjs/client.js.map +1 -1
  7. package/dist/cjs/core/gated.d.ts +12 -10
  8. package/dist/cjs/core/gated.d.ts.map +1 -1
  9. package/dist/cjs/core/gated.js +12 -10
  10. package/dist/cjs/core/gated.js.map +1 -1
  11. package/dist/cjs/core/http.d.ts +18 -0
  12. package/dist/cjs/core/http.d.ts.map +1 -1
  13. package/dist/cjs/core/http.js +11 -1
  14. package/dist/cjs/core/http.js.map +1 -1
  15. package/dist/cjs/core/pagination.d.ts +11 -9
  16. package/dist/cjs/core/pagination.d.ts.map +1 -1
  17. package/dist/cjs/core/pagination.js +11 -9
  18. package/dist/cjs/core/pagination.js.map +1 -1
  19. package/dist/cjs/generated/operations.d.ts +250 -2
  20. package/dist/cjs/generated/operations.d.ts.map +1 -1
  21. package/dist/cjs/generated/operations.js +252 -4
  22. package/dist/cjs/generated/operations.js.map +1 -1
  23. package/dist/cjs/generated/types.d.ts +1137 -113
  24. package/dist/cjs/generated/types.d.ts.map +1 -1
  25. package/dist/cjs/index.d.ts +7 -6
  26. package/dist/cjs/index.d.ts.map +1 -1
  27. package/dist/cjs/index.js +3 -1
  28. package/dist/cjs/index.js.map +1 -1
  29. package/dist/cjs/resources/addresses.d.ts +91 -4
  30. package/dist/cjs/resources/addresses.d.ts.map +1 -1
  31. package/dist/cjs/resources/addresses.js +55 -3
  32. package/dist/cjs/resources/addresses.js.map +1 -1
  33. package/dist/cjs/resources/admin.d.ts +32 -1
  34. package/dist/cjs/resources/admin.d.ts.map +1 -1
  35. package/dist/cjs/resources/admin.js +45 -0
  36. package/dist/cjs/resources/admin.js.map +1 -1
  37. package/dist/cjs/resources/aml.d.ts +56 -0
  38. package/dist/cjs/resources/aml.d.ts.map +1 -0
  39. package/dist/cjs/resources/aml.js +71 -0
  40. package/dist/cjs/resources/aml.js.map +1 -0
  41. package/dist/cjs/resources/approvals.d.ts +30 -2
  42. package/dist/cjs/resources/approvals.d.ts.map +1 -1
  43. package/dist/cjs/resources/approvals.js.map +1 -1
  44. package/dist/cjs/resources/balances.d.ts +14 -7
  45. package/dist/cjs/resources/balances.d.ts.map +1 -1
  46. package/dist/cjs/resources/balances.js +10 -4
  47. package/dist/cjs/resources/balances.js.map +1 -1
  48. package/dist/cjs/resources/categories.d.ts +20 -6
  49. package/dist/cjs/resources/categories.d.ts.map +1 -1
  50. package/dist/cjs/resources/categories.js +19 -7
  51. package/dist/cjs/resources/categories.js.map +1 -1
  52. package/dist/cjs/resources/counterparties.d.ts +52 -6
  53. package/dist/cjs/resources/counterparties.d.ts.map +1 -1
  54. package/dist/cjs/resources/counterparties.js +24 -0
  55. package/dist/cjs/resources/counterparties.js.map +1 -1
  56. package/dist/cjs/resources/history.d.ts +227 -26
  57. package/dist/cjs/resources/history.d.ts.map +1 -1
  58. package/dist/cjs/resources/history.js +46 -0
  59. package/dist/cjs/resources/history.js.map +1 -1
  60. package/dist/cjs/resources/me.d.ts +17 -1
  61. package/dist/cjs/resources/me.d.ts.map +1 -1
  62. package/dist/cjs/resources/me.js +19 -0
  63. package/dist/cjs/resources/me.js.map +1 -1
  64. package/dist/cjs/resources/members.d.ts +21 -1
  65. package/dist/cjs/resources/members.d.ts.map +1 -1
  66. package/dist/cjs/resources/members.js +15 -0
  67. package/dist/cjs/resources/members.js.map +1 -1
  68. package/dist/cjs/resources/operations.d.ts +179 -4
  69. package/dist/cjs/resources/operations.d.ts.map +1 -1
  70. package/dist/cjs/resources/operations.js +192 -2
  71. package/dist/cjs/resources/operations.js.map +1 -1
  72. package/dist/cjs/resources/registries.d.ts +28 -2
  73. package/dist/cjs/resources/registries.d.ts.map +1 -1
  74. package/dist/cjs/resources/registries.js +27 -0
  75. package/dist/cjs/resources/registries.js.map +1 -1
  76. package/dist/cjs/version.d.ts +1 -1
  77. package/dist/cjs/version.js +1 -1
  78. package/dist/esm/client.d.ts +30 -34
  79. package/dist/esm/client.d.ts.map +1 -1
  80. package/dist/esm/client.js +71 -0
  81. package/dist/esm/client.js.map +1 -1
  82. package/dist/esm/core/gated.d.ts +12 -10
  83. package/dist/esm/core/gated.d.ts.map +1 -1
  84. package/dist/esm/core/gated.js +12 -10
  85. package/dist/esm/core/gated.js.map +1 -1
  86. package/dist/esm/core/http.d.ts +18 -0
  87. package/dist/esm/core/http.d.ts.map +1 -1
  88. package/dist/esm/core/http.js +11 -1
  89. package/dist/esm/core/http.js.map +1 -1
  90. package/dist/esm/core/pagination.d.ts +11 -9
  91. package/dist/esm/core/pagination.d.ts.map +1 -1
  92. package/dist/esm/core/pagination.js +11 -9
  93. package/dist/esm/core/pagination.js.map +1 -1
  94. package/dist/esm/generated/operations.d.ts +250 -2
  95. package/dist/esm/generated/operations.d.ts.map +1 -1
  96. package/dist/esm/generated/operations.js +252 -4
  97. package/dist/esm/generated/operations.js.map +1 -1
  98. package/dist/esm/generated/types.d.ts +1137 -113
  99. package/dist/esm/generated/types.d.ts.map +1 -1
  100. package/dist/esm/index.d.ts +7 -6
  101. package/dist/esm/index.d.ts.map +1 -1
  102. package/dist/esm/index.js +1 -0
  103. package/dist/esm/index.js.map +1 -1
  104. package/dist/esm/resources/addresses.d.ts +91 -4
  105. package/dist/esm/resources/addresses.d.ts.map +1 -1
  106. package/dist/esm/resources/addresses.js +55 -3
  107. package/dist/esm/resources/addresses.js.map +1 -1
  108. package/dist/esm/resources/admin.d.ts +32 -1
  109. package/dist/esm/resources/admin.d.ts.map +1 -1
  110. package/dist/esm/resources/admin.js +45 -0
  111. package/dist/esm/resources/admin.js.map +1 -1
  112. package/dist/esm/resources/aml.d.ts +56 -0
  113. package/dist/esm/resources/aml.d.ts.map +1 -0
  114. package/dist/esm/resources/aml.js +67 -0
  115. package/dist/esm/resources/aml.js.map +1 -0
  116. package/dist/esm/resources/approvals.d.ts +30 -2
  117. package/dist/esm/resources/approvals.d.ts.map +1 -1
  118. package/dist/esm/resources/approvals.js.map +1 -1
  119. package/dist/esm/resources/balances.d.ts +14 -7
  120. package/dist/esm/resources/balances.d.ts.map +1 -1
  121. package/dist/esm/resources/balances.js +10 -4
  122. package/dist/esm/resources/balances.js.map +1 -1
  123. package/dist/esm/resources/categories.d.ts +20 -6
  124. package/dist/esm/resources/categories.d.ts.map +1 -1
  125. package/dist/esm/resources/categories.js +19 -7
  126. package/dist/esm/resources/categories.js.map +1 -1
  127. package/dist/esm/resources/counterparties.d.ts +52 -6
  128. package/dist/esm/resources/counterparties.d.ts.map +1 -1
  129. package/dist/esm/resources/counterparties.js +24 -0
  130. package/dist/esm/resources/counterparties.js.map +1 -1
  131. package/dist/esm/resources/history.d.ts +227 -26
  132. package/dist/esm/resources/history.d.ts.map +1 -1
  133. package/dist/esm/resources/history.js +46 -0
  134. package/dist/esm/resources/history.js.map +1 -1
  135. package/dist/esm/resources/me.d.ts +17 -1
  136. package/dist/esm/resources/me.d.ts.map +1 -1
  137. package/dist/esm/resources/me.js +19 -0
  138. package/dist/esm/resources/me.js.map +1 -1
  139. package/dist/esm/resources/members.d.ts +21 -1
  140. package/dist/esm/resources/members.d.ts.map +1 -1
  141. package/dist/esm/resources/members.js +15 -0
  142. package/dist/esm/resources/members.js.map +1 -1
  143. package/dist/esm/resources/operations.d.ts +179 -4
  144. package/dist/esm/resources/operations.d.ts.map +1 -1
  145. package/dist/esm/resources/operations.js +192 -2
  146. package/dist/esm/resources/operations.js.map +1 -1
  147. package/dist/esm/resources/registries.d.ts +28 -2
  148. package/dist/esm/resources/registries.d.ts.map +1 -1
  149. package/dist/esm/resources/registries.js +27 -0
  150. package/dist/esm/resources/registries.js.map +1 -1
  151. package/dist/esm/version.d.ts +1 -1
  152. package/dist/esm/version.js +1 -1
  153. package/docs/concepts.md +13 -11
  154. package/docs/errors.md +76 -5
  155. package/package.json +1 -1
  156. package/src/client.ts +44 -0
  157. package/src/core/gated.ts +12 -10
  158. package/src/core/http.ts +30 -1
  159. package/src/core/pagination.ts +11 -9
  160. package/src/generated/operations.ts +252 -4
  161. package/src/generated/types.ts +1173 -95
  162. package/src/index.ts +16 -1
  163. package/src/resources/addresses.ts +102 -4
  164. package/src/resources/admin.ts +59 -0
  165. package/src/resources/aml.ts +76 -0
  166. package/src/resources/approvals.ts +30 -2
  167. package/src/resources/balances.ts +14 -7
  168. package/src/resources/categories.ts +19 -5
  169. package/src/resources/counterparties.ts +59 -5
  170. package/src/resources/history.ts +238 -27
  171. package/src/resources/me.ts +22 -0
  172. package/src/resources/members.ts +30 -0
  173. package/src/resources/operations.ts +264 -5
  174. package/src/resources/registries.ts +39 -3
  175. package/src/version.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  import { type HttpClient } from '../core/http.js';
2
- import type { Page, PageParams } from '../core/pagination.js';
3
- import type { HistoryItem } from '../generated/types.js';
2
+ import type { PageParams } from '../core/pagination.js';
3
+ import type { HistoryResponse, HistorySummary } from '../generated/types.js';
4
4
  /**
5
5
  * One feed of operations: incoming and outgoing together.
6
6
  *
@@ -13,47 +13,248 @@ import type { HistoryItem } from '../generated/types.js';
13
13
  *
14
14
  * One value short of `TransactionStatus`, which is the right set for reading
15
15
  * a transfer: `submitted` is missing here. It is a legacy status — still the
16
- * column default in the schema, so old rows carry it — and the endpoint's
17
- * enum does not accept it, so filtering by it is a 400 rather than an empty
18
- * page. Hence a separate type: taking the reader's union would have the
19
- * package suggest a value its own filter rejects.
16
+ * column default in the schema, so old rows carry it, and `HistoryOutItem`
17
+ * can report it — but the filter does not accept it, so filtering by it is a
18
+ * 400 `INVALID_FILTER_VALUE` rather than an empty page. Hence a separate
19
+ * type: taking the reader's union would have the package suggest a value its
20
+ * own filter rejects.
20
21
  */
21
22
  export type HistoryStatusFilter = 'awaiting_approval' | 'pending' | 'confirmed' | 'failed' | 'rejected' | 'cancelled';
22
- export interface HistoryParams extends PageParams {
23
- direction?: 'in' | 'out' | undefined;
23
+ /**
24
+ * AML levels the feed can be filtered by. `unchecked` selects the operations
25
+ * nobody checked (`amlLevel: null`) — which is NOT "clean", so it has to be
26
+ * asked for by name.
27
+ */
28
+ export type HistoryAmlLevelFilter = 'critical' | 'high' | 'medium' | 'low' | 'minimal' | 'unchecked';
29
+ export type OperationRelationType = 'refund' | 'reversal' | 'correction' | 'replacement';
30
+ /** One value, or several — sent as one comma-separated value. */
31
+ type OneOrMany<T> = T | readonly T[];
32
+ /**
33
+ * The filters `list()` and `summary()` share.
34
+ *
35
+ * A multi-value filter takes a string or an array; an array goes out as one
36
+ * comma-separated value — OR within the filter, AND between filters, at most
37
+ * 50 values (more is 400 `TOO_MANY_VALUES`). An unknown value of an
38
+ * enumeration (`direction`, `status`, `flowType`, `amlLevel`,
39
+ * `relationType`…) is 400 `INVALID_FILTER_VALUE`, with `details.param`,
40
+ * `details.invalid` and `details.allowed`.
41
+ *
42
+ * `<name>Not` means "none of": an operation that has NO value there is kept,
43
+ * because "not X" includes "none". No filter widens the scope — a folder you
44
+ * cannot see, an address you cannot reach or an initiator outside your scope
45
+ * yields nothing rather than someone else's operations.
46
+ */
47
+ export interface HistoryFilters {
48
+ /** `in` — deposits, `out` — transfers. Both is the same as neither. */
49
+ direction?: OneOrMany<'in' | 'out'> | undefined;
24
50
  /**
25
51
  * Outgoing only, whichever value you pass: a status belongs to a transfer,
26
52
  * so setting this EXCLUDES the incoming side of the feed even without
27
- * `direction: 'out'`. The same goes for `awaitingMyApproval` and
28
- * `decisionPolicyId`.
53
+ * `direction: 'out'`. The same goes for `awaitingMyApproval`,
54
+ * `decisionPolicyId` and `initiatorId`.
55
+ */
56
+ status?: OneOrMany<HistoryStatusFilter> | undefined;
57
+ /**
58
+ * None of these statuses. A deposit counts as `confirmed` here, as its row
59
+ * shows it: `statusNot: 'failed'` keeps deposits, `statusNot: 'confirmed'`
60
+ * drops them.
61
+ */
62
+ statusNot?: OneOrMany<HistoryStatusFilter> | undefined;
63
+ /**
64
+ * Only what awaits MY signature. For the approvals screen. Implies
65
+ * `direction: 'out'` and `status: 'awaiting_approval'` — a `status` passed
66
+ * alongside is ignored; the other filters, `statusNot` included, still
67
+ * apply.
29
68
  */
30
- status?: HistoryStatusFilter | undefined;
31
- /** Only what awaits MY signature. For the approvals screen. */
32
69
  awaitingMyApproval?: boolean | undefined;
33
- asset?: string | undefined;
34
- tokenId?: string | undefined;
35
- network?: string | undefined;
36
- addressId?: string | undefined;
37
- folderId?: string | undefined;
38
- counterpartyId?: string | undefined;
39
- counterpartyGroupId?: string | undefined;
40
- counterpartyAddressId?: string | undefined;
70
+ /** Token code. */
71
+ asset?: OneOrMany<string> | undefined;
72
+ assetNot?: OneOrMany<string> | undefined;
73
+ /** Token id from the registry. With `asset` — the intersection. */
74
+ tokenId?: OneOrMany<string> | undefined;
75
+ tokenIdNot?: OneOrMany<string> | undefined;
76
+ /** `Network.slug`. */
77
+ network?: OneOrMany<string> | undefined;
78
+ networkNot?: OneOrMany<string> | undefined;
79
+ /** Our address: the sender of a transfer, the recipient of a deposit. */
80
+ addressId?: OneOrMany<string> | undefined;
81
+ addressIdNot?: OneOrMany<string> | undefined;
82
+ /**
83
+ * Operations on the addresses of a folder, as it is now. Any folder you can
84
+ * see; it narrows, never widens — without `includeShared` a shared folder
85
+ * narrows only your own operations.
86
+ */
87
+ folderId?: OneOrMany<string> | undefined;
88
+ folderIdNot?: OneOrMany<string> | undefined;
89
+ counterpartyId?: OneOrMany<string> | undefined;
90
+ counterpartyIdNot?: OneOrMany<string> | undefined;
91
+ /** By the group's current members. */
92
+ counterpartyGroupId?: OneOrMany<string> | undefined;
93
+ counterpartyGroupIdNot?: OneOrMany<string> | undefined;
94
+ /** The on-chain address of the other side. EVM addresses compare case-insensitively. */
95
+ counterpartyAddressId?: OneOrMany<string> | undefined;
41
96
  /** `internal` — the other side is an address of this vault; `external` — it is not. */
42
- flowType?: 'internal' | 'external' | undefined;
43
- category?: string | undefined;
97
+ flowType?: OneOrMany<'internal' | 'external'> | undefined;
98
+ /** The `category` of the older metadata (the system category `general`). */
99
+ category?: OneOrMany<string> | undefined;
100
+ categoryNot?: OneOrMany<string> | undefined;
101
+ /** Exact match, ONE value: a comma is part of the text here, not a separator. */
44
102
  paymentPurpose?: string | undefined;
45
- decisionPolicyId?: string | undefined;
46
- txHash?: string | undefined;
103
+ decisionPolicyId?: OneOrMany<string> | undefined;
104
+ decisionPolicyIdNot?: OneOrMany<string> | undefined;
105
+ /** Who started the transfer (member ids). Deposits drop out — they have no initiator. */
106
+ initiatorId?: OneOrMany<string> | undefined;
107
+ initiatorIdNot?: OneOrMany<string> | undefined;
108
+ /** The recipient's risk on a transfer, the sender's on a deposit. */
109
+ amlLevel?: OneOrMany<HistoryAmlLevelFilter> | undefined;
110
+ /** `unchecked` here drops the unchecked ones; without it they stay. */
111
+ amlLevelNot?: OneOrMany<HistoryAmlLevelFilter> | undefined;
112
+ /** A deposit always has a hash. */
113
+ hasTxHash?: boolean | undefined;
114
+ /** Whether the transfer has a fee recorded. A deposit has none: `true` drops it, `false` keeps it. */
115
+ hasFee?: boolean | undefined;
116
+ hasCounterparty?: boolean | undefined;
117
+ /**
118
+ * What `from`/`to` apply to. With `confirmedAt` and a period, a transfer that
119
+ * was never confirmed does not match; a deposit's `confirmedAt` is its
120
+ * `createdAt`. The ORDER of the feed is not affected — that is `sort`.
121
+ */
122
+ dateBasis?: 'createdAt' | 'confirmedAt' | undefined;
123
+ /** Tags of the older metadata, matched after normalisation (case, `ё` = `е`, spaces). */
124
+ tag?: OneOrMany<string> | undefined;
125
+ tagNot?: OneOrMany<string> | undefined;
126
+ /**
127
+ * Has an active assignment of a vault category, by key. Only assignments
128
+ * VISIBLE to you count — as on the operation's card; the same holds for the
129
+ * other category filters, and a hidden sensitive value never matches.
130
+ */
131
+ categoryKey?: OneOrMany<string> | undefined;
132
+ categoryKeyNot?: OneOrMany<string> | undefined;
133
+ /** `false` — no visible assignment at all ("unlabelled"). */
134
+ hasCategory?: boolean | undefined;
135
+ /**
136
+ * A field's value — the grammar of the reports' `categoryField`:
137
+ * `key:v1|v2,key2:v3` (`,` is AND, `|` is OR), every condition on ONE
138
+ * assignment; with `categoryKey`, within those categories only. Values in
139
+ * canonical form (`84.10` for 84.1 at scale 2).
140
+ */
141
+ categoryField?: string | undefined;
142
+ /**
143
+ * A range over a field: `key:from..to[,…]`, both ends inclusive, either may
144
+ * be omitted (`amount:100..`). Numbers compare as decimals; dates are ISO in
145
+ * UTC, and an END date without a time covers that WHOLE day — unlike the
146
+ * feed's own `to`. Same one assignment as `categoryField`.
147
+ */
148
+ categoryFieldRange?: string | undefined;
149
+ /**
150
+ * The assignment has no value in these fields (keys). A hidden sensitive
151
+ * field counts as FILLED, whatever it holds — otherwise the filter would
152
+ * reveal whether it is empty.
153
+ */
154
+ categoryFieldEmpty?: OneOrMany<string> | undefined;
155
+ /** Has a relation (refund, reversal, correction, replacement) in either role. */
156
+ hasRelations?: boolean | undefined;
157
+ /** A relation of this type, in either role. */
158
+ relationType?: OneOrMany<OperationRelationType> | undefined;
159
+ /**
160
+ * Amount at least (inclusive) — a decimal string IN THE OPERATION'S OWN
161
+ * TOKEN: `'100'` is 100 USDT on a USDT operation and 100 TRX on a TRX one.
162
+ * Compared exactly. An operation whose token is outside the registry never
163
+ * matches. Add `asset` or `tokenId` to compare one asset.
164
+ */
165
+ minimumAmount?: string | undefined;
166
+ maximumAmount?: string | undefined;
167
+ /**
168
+ * USD valuation at least (inclusive), a decimal string — the row's
169
+ * `usdValue`. An operation without a valuation NEVER matches; how many there
170
+ * are is `usd.unpricedCount` of `summary()`.
171
+ */
172
+ minimumUsd?: string | undefined;
173
+ maximumUsd?: string | undefined;
174
+ /** `false` — no USD valuation: no rate at the time, or a token outside the registry. */
175
+ hasUsd?: boolean | undefined;
47
176
  /** Include operations on addresses shared with you. Off by default. */
48
177
  includeShared?: boolean | undefined;
49
- /** ISO date, inclusive. */
178
+ /** Exact on-chain hash, one value. */
179
+ txHash?: string | undefined;
180
+ /**
181
+ * BOTH INCLUSIVE, by `dateBasis`: ISO moment or `YYYY-MM-DD` (midnight UTC).
182
+ * Reports treat `to` as exclusive, so the same pair selects different sets
183
+ * there and here — exactly on the operations at `to`. To take a whole day
184
+ * here, pass its last moment or the next midnight.
185
+ */
50
186
  from?: string | undefined;
51
187
  to?: string | undefined;
188
+ /**
189
+ * Administrators — of the platform or of THIS vault — see the whole vault;
190
+ * this narrows it to one person. Anyone else may name only themselves (403).
191
+ */
52
192
  userId?: string | undefined;
53
193
  }
194
+ export interface HistoryParams extends HistoryFilters, PageParams {
195
+ /**
196
+ * Order of the feed; `createdAt` by default. `confirmedAt` — only confirmed
197
+ * operations. `amount` — by the raw amount, and ONLY with exactly one asset
198
+ * in `asset`/`tokenId` (amounts of different tokens do not compare), else
199
+ * 400 `SORT_REQUIRES_SINGLE_ASSET`; "largest in any asset" is `usd`. `usd` —
200
+ * by the USD valuation, valued operations only. Equal keys go by id.
201
+ */
202
+ sort?: 'createdAt' | 'confirmedAt' | 'amount' | 'usd' | undefined;
203
+ /** `desc` by default. */
204
+ order?: 'desc' | 'asc' | undefined;
205
+ }
206
+ /** What `summary()` can count by. */
207
+ export type HistoryFacet = keyof HistorySummary['facets'];
208
+ export interface HistorySummaryParams extends HistoryFilters {
209
+ /** Which counters to compute. Only those asked for come back. */
210
+ facets?: OneOrMany<HistoryFacet> | undefined;
211
+ }
54
212
  export declare class HistoryResource {
55
213
  #private;
56
214
  constructor(http: HttpClient, vaultCode: string);
57
- list(params?: HistoryParams): Promise<Page<HistoryItem>>;
215
+ /**
216
+ * One page of the feed. A member sees their own transfers and the deposits
217
+ * to their addresses; `includeShared` adds the operations of addresses
218
+ * opened to them, `awaitingMyApproval` the transfers waiting for their vote.
219
+ * An administrator of the platform or of THIS vault sees the whole vault —
220
+ * seeing is not acting: what a vault administrator may send, sign or label
221
+ * is still decided by their own rights as a member.
222
+ *
223
+ * A cursor remembers `sort` and `order`: one issued for another order is
224
+ * 400 `INVALID_CURSOR` (older cursors are `createdAt desc`).
225
+ *
226
+ * Two flags can come back, and neither means the end of the feed:
227
+ *
228
+ * • `scanTruncated` — some filters are decided over rows already read,
229
+ * and the page did not fill within 50 000 of them. What was found is
230
+ * returned and `nextCursor` continues from where the scan stopped:
231
+ * keep paging;
232
+ * • `sortIncomplete` — with `sort: 'amount' | 'usd'`, some operations
233
+ * have no sort key yet and this request could not compute them all
234
+ * (200 rows per table per request); those operations are not in the
235
+ * order yet. Repeat the request.
236
+ */
237
+ list(params?: HistoryParams): Promise<HistoryResponse>;
238
+ /**
239
+ * Totals for the same scope and filters as `list()`: how many operations,
240
+ * amounts per asset, the USD total and counters per value of the requested
241
+ * `facets`. `count` is the length of the feed paged to its end, the amounts
242
+ * the sum of its rows.
243
+ *
244
+ * `byAsset` is per asset AND per direction, in raw units (a BigInt string)
245
+ * and as a decimal — there is no cross-asset "turnover", and the sums
246
+ * include unsuccessful transfers unless a filter drops them
247
+ * (`statusNot: ['failed', 'rejected', 'cancelled']`). Different assets add
248
+ * up only in `usd`, valued as the rows' `usdValue`; operations without a
249
+ * valuation are counted in `usd.unpricedCount` and are in no USD total.
250
+ *
251
+ * A facet is counted with every filter EXCEPT its own dimension.
252
+ *
253
+ * More than 25 000 operations after filtering is 422
254
+ * `HISTORY_SUMMARY_TOO_BROAD` with `details.limit` — narrow the period or
255
+ * the filters; a cut-off total would look like a complete one.
256
+ */
257
+ summary(params?: HistorySummaryParams): Promise<HistorySummary>;
58
258
  }
259
+ export {};
59
260
  //# sourceMappingURL=history.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/resources/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MA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,GAAG,KAAK,GAAG,SAAS,CAAA;IACjE,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;CACnC;AAED,qCAAqC;AACrC,MAAM,MAAM,YAAY,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;AAEzD,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,iEAAiE;IACjE,MAAM,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAA;CAC7C;AAED,qBAAa,eAAe;;IAI1B,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,CAAC,MAAM,GAAE,aAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,CAEzD;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,MAAM,GAAE,oBAAyB,GAAG,OAAO,CAAC,cAAc,CAAC,CAIlE;CACF"}
@@ -9,9 +9,55 @@ class HistoryResource {
9
9
  this.#http = http;
10
10
  this.#base = `/api/v1/vaults/${(0, http_js_1.seg)(vaultCode)}/history`;
11
11
  }
12
+ /**
13
+ * One page of the feed. A member sees their own transfers and the deposits
14
+ * to their addresses; `includeShared` adds the operations of addresses
15
+ * opened to them, `awaitingMyApproval` the transfers waiting for their vote.
16
+ * An administrator of the platform or of THIS vault sees the whole vault —
17
+ * seeing is not acting: what a vault administrator may send, sign or label
18
+ * is still decided by their own rights as a member.
19
+ *
20
+ * A cursor remembers `sort` and `order`: one issued for another order is
21
+ * 400 `INVALID_CURSOR` (older cursors are `createdAt desc`).
22
+ *
23
+ * Two flags can come back, and neither means the end of the feed:
24
+ *
25
+ * • `scanTruncated` — some filters are decided over rows already read,
26
+ * and the page did not fill within 50 000 of them. What was found is
27
+ * returned and `nextCursor` continues from where the scan stopped:
28
+ * keep paging;
29
+ * • `sortIncomplete` — with `sort: 'amount' | 'usd'`, some operations
30
+ * have no sort key yet and this request could not compute them all
31
+ * (200 rows per table per request); those operations are not in the
32
+ * order yet. Repeat the request.
33
+ */
12
34
  list(params = {}) {
13
35
  return this.#http.request('GET', this.#base, { query: { ...params } });
14
36
  }
37
+ /**
38
+ * Totals for the same scope and filters as `list()`: how many operations,
39
+ * amounts per asset, the USD total and counters per value of the requested
40
+ * `facets`. `count` is the length of the feed paged to its end, the amounts
41
+ * the sum of its rows.
42
+ *
43
+ * `byAsset` is per asset AND per direction, in raw units (a BigInt string)
44
+ * and as a decimal — there is no cross-asset "turnover", and the sums
45
+ * include unsuccessful transfers unless a filter drops them
46
+ * (`statusNot: ['failed', 'rejected', 'cancelled']`). Different assets add
47
+ * up only in `usd`, valued as the rows' `usdValue`; operations without a
48
+ * valuation are counted in `usd.unpricedCount` and are in no USD total.
49
+ *
50
+ * A facet is counted with every filter EXCEPT its own dimension.
51
+ *
52
+ * More than 25 000 operations after filtering is 422
53
+ * `HISTORY_SUMMARY_TOO_BROAD` with `details.limit` — narrow the period or
54
+ * the filters; a cut-off total would look like a complete one.
55
+ */
56
+ summary(params = {}) {
57
+ return this.#http.request('GET', `${this.#base}/summary`, {
58
+ query: { ...params },
59
+ });
60
+ }
15
61
  }
16
62
  exports.HistoryResource = HistoryResource;
17
63
  //# sourceMappingURL=history.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/resources/history.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AA+DtD;IACW,KAAK,CAAY;IACjB,KAAK,CAAQ;IAEtB,YAAY,IAAgB,EAAE,SAAiB;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,KAAK,GAAG,kBAAkB,IAAA,aAAG,EAAC,SAAS,CAAC,UAAU,CAAA;IACzD,CAAC;IAED,IAAI,CAAC,MAAM,GAAkB,EAAE;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAoB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAA;IAC3F,CAAC;CACF"}
1
+ {"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/resources/history.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AAmOtD;IACW,KAAK,CAAY;IACjB,KAAK,CAAQ;IAEtB,YAAY,IAAgB,EAAE,SAAiB;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,KAAK,GAAG,kBAAkB,IAAA,aAAG,EAAC,SAAS,CAAC,UAAU,CAAA;IACzD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,CAAC,MAAM,GAAkB,EAAE;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAkB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAA;IACzF,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,MAAM,GAAyB,EAAE;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAiB,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,UAAU,EAAE;YACxE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE;SACrB,CAAC,CAAA;IACJ,CAAC;CACF"}
@@ -1,5 +1,6 @@
1
1
  import type { HttpClient } from '../core/http.js';
2
- import type { AllowedSegmentsResponse, MeVaultResponse, PatchProfileBody, PushToken, RegisterPushTokenBody, UserProfile } from '../generated/types.js';
2
+ import type { PageParams } from '../core/pagination.js';
3
+ import type { AllowedSegmentsResponse, MeVaultResponse, MySessionList, PatchProfileBody, PushToken, RegisterPushTokenBody, UserProfile } from '../generated/types.js';
3
4
  /** The caller's own profile, devices and permissions. Not scoped to a vault. */
4
5
  export declare class MeResource {
5
6
  #private;
@@ -51,6 +52,21 @@ export declare class MeResource {
51
52
  vaultId: string;
52
53
  action: string;
53
54
  }): Promise<AllowedSegmentsResponse>;
55
+ /**
56
+ * Where I am signed in: my live sessions — the phone, the web version, the
57
+ * Mac app, a browser — newest first, with `current` on the one making this
58
+ * request.
59
+ *
60
+ * Open to ANY session, a web or Mac one included, because it carries
61
+ * nothing worth stealing: no tokens, no IP addresses, no raw user agent.
62
+ * Read-only — ending another session is better-auth's own
63
+ * `/api/auth/revoke-session` and its neighbours, which a web or Mac
64
+ * session is refused; signing out of this session is always possible.
65
+ * Expired sessions are not listed, and neither are web or Mac ones older
66
+ * than 30 days from sign-in — their real ceiling, which is what
67
+ * `expiresAt` says for them.
68
+ */
69
+ sessions(params?: PageParams): Promise<MySessionList>;
54
70
  registerPushToken(input: RegisterPushTokenBody): Promise<PushToken>;
55
71
  /** `deleted: false` simply means the token was not registered — not a failure. */
56
72
  removePushToken(token: string): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/resources/me.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,qBAAqB,EACrB,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAE9B,gFAAgF;AAChF,qBAAa,UAAU;;IAGrB,YAAY,IAAI,EAAE,UAAU,EAE3B;IAED,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAE9B;IAED;;;;;;;OAOG;IACH,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAE3D;IAED;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAInD;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,IAAI,OAAO,CAAC,eAAe,CAAC,CAEhC;IAED;;;;;;;O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;OAaG;IACH,QAAQ,CAAC,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,aAAa,CAAC,CAIxD;IAED,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC,CAElE;IAED,kFAAkF;IAClF,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAK5D;CACF"}
@@ -63,6 +63,25 @@ class MeResource {
63
63
  query: { ...params },
64
64
  });
65
65
  }
66
+ /**
67
+ * Where I am signed in: my live sessions — the phone, the web version, the
68
+ * Mac app, a browser — newest first, with `current` on the one making this
69
+ * request.
70
+ *
71
+ * Open to ANY session, a web or Mac one included, because it carries
72
+ * nothing worth stealing: no tokens, no IP addresses, no raw user agent.
73
+ * Read-only — ending another session is better-auth's own
74
+ * `/api/auth/revoke-session` and its neighbours, which a web or Mac
75
+ * session is refused; signing out of this session is always possible.
76
+ * Expired sessions are not listed, and neither are web or Mac ones older
77
+ * than 30 days from sign-in — their real ceiling, which is what
78
+ * `expiresAt` says for them.
79
+ */
80
+ sessions(params = {}) {
81
+ return this.#http.request('GET', '/api/v1/me/sessions', {
82
+ query: { ...params },
83
+ });
84
+ }
66
85
  registerPushToken(input) {
67
86
  return this.#http.request('POST', '/api/v1/me/push-tokens', { body: input });
68
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"me.js","sourceRoot":"","sources":["../../../src/resources/me.ts"],"names":[],"mappings":";;;AAUA,gFAAgF;AAChF;IACW,KAAK,CAAY;IAE1B,YAAY,IAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;IACnB,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAc,KAAK,EAAE,oBAAoB,CAAC,CAAA;IACrE,CAAC;IAED;;;;;;;OAOG;IACH,aAAa,CAAC,KAAuB;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO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import type { PageParams } from '../core/pagination.js';
3
- import type { MemberCard, MemberDetail, MembersPage, UserGroup, UserGroupDetail, UserGroupMembers } from '../generated/types.js';
3
+ import type { ActionType, MemberCard, MemberDetail, MembersPage, PolicyDirectoryPage, UserGroup, UserGroupDetail, UserGroupMembers } from '../generated/types.js';
4
+ export interface PolicyDirectoryParams extends PageParams {
5
+ actionType?: ActionType | undefined;
6
+ effect?: 'allow' | 'block' | undefined;
7
+ enabled?: boolean | undefined;
8
+ /** Only the policies of groups I belong to. Without it — every group's. */
9
+ mine?: boolean | undefined;
10
+ }
4
11
  /**
5
12
  * People in the vault, and the groups they belong to.
6
13
  *
@@ -48,6 +55,19 @@ export declare class MembersResource {
48
55
  * policies stays administrator-only.
49
56
  */
50
57
  group(groupId: string): Promise<UserGroupDetail>;
58
+ /**
59
+ * Every policy of the vault by name — code, name, look, `actionType`,
60
+ * `effect`, `enabled` and the group it hangs on — for a "decided by" label
61
+ * and the feed's `decisionPolicyId` filter. Open to any member, and it
62
+ * lists the policies of ALL groups, not only yours: rule names are not
63
+ * personal data and each group's detail already shows them.
64
+ *
65
+ * No rules, conditions, limits, thresholds or signers here — those stay
66
+ * with the administrator endpoints (`admin.policies`). The fields are the
67
+ * ones `group()` shows in `policies[]`, gathered into one list. Keyset
68
+ * paging, newest first.
69
+ */
70
+ policyDirectory(params?: PolicyDirectoryParams): Promise<PolicyDirectoryPage>;
51
71
  groupMembers(groupId: string): Promise<UserGroupMembers>;
52
72
  }
53
73
  //# 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,YAAY,EACZ,WAAW,EACX,SAAS,EACT,eAAe,EACf,gBAAgB,EAC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tC,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,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;CACF"}
@@ -59,6 +59,21 @@ class MembersResource {
59
59
  group(groupId) {
60
60
  return this.#http.request('GET', `/api/v1/vaults/${this.#vault}/user-groups/${(0, http_js_1.seg)(groupId)}`);
61
61
  }
62
+ /**
63
+ * Every policy of the vault by name — code, name, look, `actionType`,
64
+ * `effect`, `enabled` and the group it hangs on — for a "decided by" label
65
+ * and the feed's `decisionPolicyId` filter. Open to any member, and it
66
+ * lists the policies of ALL groups, not only yours: rule names are not
67
+ * personal data and each group's detail already shows them.
68
+ *
69
+ * No rules, conditions, limits, thresholds or signers here — those stay
70
+ * with the administrator endpoints (`admin.policies`). The fields are the
71
+ * ones `group()` shows in `policies[]`, gathered into one list. Keyset
72
+ * paging, newest first.
73
+ */
74
+ policyDirectory(params = {}) {
75
+ return this.#http.request('GET', `/api/v1/vaults/${this.#vault}/policy-directory`, { query: { ...params } });
76
+ }
62
77
  groupMembers(groupId) {
63
78
  return this.#http.request('GET', `/api/v1/vaults/${this.#vault}/user-groups/${(0, http_js_1.seg)(groupId)}/members`);
64
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"members.js","sourceRoot":"","sources":["../../../src/resources/members.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AAWtD;;;;;;;GAOG;AACH;IACW,KAAK,CAAY;IACjB,MAAM,CAAQ;IAEvB,YAAY,IAAgB,EAAE,SAAiB;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,MAAM,GAAG,IAAA,aAAG,EAAC,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,IAAA,aAAG,EAAC,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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