@v3finance/core-sdk 0.2.0 → 0.2.2

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 (66) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +6 -2
  3. package/dist/cjs/core/gated.d.ts +9 -3
  4. package/dist/cjs/core/gated.d.ts.map +1 -1
  5. package/dist/cjs/core/gated.js +9 -3
  6. package/dist/cjs/core/gated.js.map +1 -1
  7. package/dist/cjs/core/http.d.ts.map +1 -1
  8. package/dist/cjs/core/http.js +17 -3
  9. package/dist/cjs/core/http.js.map +1 -1
  10. package/dist/cjs/generated/operations.js +1 -1
  11. package/dist/cjs/generated/types.d.ts +30 -14
  12. package/dist/cjs/generated/types.d.ts.map +1 -1
  13. package/dist/cjs/resources/addresses.d.ts +4 -3
  14. package/dist/cjs/resources/addresses.d.ts.map +1 -1
  15. package/dist/cjs/resources/addresses.js +4 -3
  16. package/dist/cjs/resources/addresses.js.map +1 -1
  17. package/dist/cjs/resources/approvals.d.ts +22 -0
  18. package/dist/cjs/resources/approvals.d.ts.map +1 -1
  19. package/dist/cjs/resources/approvals.js +22 -0
  20. package/dist/cjs/resources/approvals.js.map +1 -1
  21. package/dist/cjs/resources/transfers.d.ts +81 -17
  22. package/dist/cjs/resources/transfers.d.ts.map +1 -1
  23. package/dist/cjs/resources/transfers.js +81 -17
  24. package/dist/cjs/resources/transfers.js.map +1 -1
  25. package/dist/cjs/resources/types.d.ts +0 -4
  26. package/dist/cjs/resources/types.d.ts.map +1 -1
  27. package/dist/cjs/version.d.ts +1 -1
  28. package/dist/cjs/version.js +1 -1
  29. package/dist/esm/core/gated.d.ts +9 -3
  30. package/dist/esm/core/gated.d.ts.map +1 -1
  31. package/dist/esm/core/gated.js +9 -3
  32. package/dist/esm/core/gated.js.map +1 -1
  33. package/dist/esm/core/http.d.ts.map +1 -1
  34. package/dist/esm/core/http.js +17 -3
  35. package/dist/esm/core/http.js.map +1 -1
  36. package/dist/esm/generated/operations.js +1 -1
  37. package/dist/esm/generated/types.d.ts +30 -14
  38. package/dist/esm/generated/types.d.ts.map +1 -1
  39. package/dist/esm/resources/addresses.d.ts +4 -3
  40. package/dist/esm/resources/addresses.d.ts.map +1 -1
  41. package/dist/esm/resources/addresses.js +4 -3
  42. package/dist/esm/resources/addresses.js.map +1 -1
  43. package/dist/esm/resources/approvals.d.ts +22 -0
  44. package/dist/esm/resources/approvals.d.ts.map +1 -1
  45. package/dist/esm/resources/approvals.js +22 -0
  46. package/dist/esm/resources/approvals.js.map +1 -1
  47. package/dist/esm/resources/transfers.d.ts +81 -17
  48. package/dist/esm/resources/transfers.d.ts.map +1 -1
  49. package/dist/esm/resources/transfers.js +81 -17
  50. package/dist/esm/resources/transfers.js.map +1 -1
  51. package/dist/esm/resources/types.d.ts +0 -4
  52. package/dist/esm/resources/types.d.ts.map +1 -1
  53. package/dist/esm/version.d.ts +1 -1
  54. package/dist/esm/version.js +1 -1
  55. package/docs/concepts.md +7 -4
  56. package/docs/errors.md +54 -16
  57. package/package.json +1 -1
  58. package/src/core/gated.ts +9 -3
  59. package/src/core/http.ts +17 -3
  60. package/src/generated/operations.ts +1 -1
  61. package/src/generated/types.ts +31 -14
  62. package/src/resources/addresses.ts +4 -3
  63. package/src/resources/approvals.ts +22 -0
  64. package/src/resources/transfers.ts +81 -17
  65. package/src/resources/types.ts +0 -4
  66. package/src/version.ts +1 -1
@@ -11,17 +11,45 @@ export interface VoteInput {
11
11
  * The result of sending is `Gated`, and that is the main thing to understand
12
12
  * here. The same `{transaction}` body comes back in three situations:
13
13
  *
14
- * applied (201) — executed, the money left;
14
+ * applied (201) — executed, the money left (rarely the status is still
15
+ * `pending` with a `txHash`: it went out, but its
16
+ * accounting was not recorded, and an administrator's
17
+ * reconciliation finishes it — do not send it again);
15
18
  * pending (202) — awaiting signatures, funds RESERVED but not sent;
16
- * replayed (200) — a repeat; the transfer already existed.
19
+ * replayed (200) — a transfer with this `idempotencyKey` already existed,
20
+ * and this is that transfer as it stands NOW.
17
21
  *
18
22
  * They cannot be told apart by the body. Showing "sent" on `pending` tells
19
23
  * the person money has gone when it is frozen.
24
+ *
25
+ * `replayed` does not mean "sent" either. It says only that the request was
26
+ * seen before; what became of it is in `data.transaction.status`:
27
+ *
28
+ * confirmed, submitted — it left;
29
+ * awaiting_approval — waiting for signatures, funds reserved;
30
+ * pending — still executing, or its outcome is unknown
31
+ * (the first answer was 502
32
+ * `TRANSFER_OUTCOME_UNKNOWN`) until an
33
+ * administrator reconciles it;
34
+ * failed, rejected,
35
+ * cancelled — it did not leave.
20
36
  */
21
37
  export declare class TransfersResource {
22
38
  #private;
23
39
  constructor(http: HttpClient, vaultCode: string);
24
- /** Sends a transfer. The timeout is long: the path calls the wallet service. */
40
+ /**
41
+ * Sends a transfer. The timeout is long: the path calls the wallet service.
42
+ *
43
+ * On `outcome: 'replayed'` read `data.transaction.status` before telling
44
+ * anyone anything — a replay of an attempt that failed, or that is still
45
+ * waiting for signatures, comes back the same way as one that went out.
46
+ *
47
+ * A thrown 502 `TRANSFER_OUTCOME_UNKNOWN` is not a failure: the signing
48
+ * service gave no definite answer, the transaction may have left, and the
49
+ * transfer stays `pending` with its funds reserved (`details.transactionId`).
50
+ * Retry it only with the SAME key — that returns the transfer without
51
+ * executing it again; a new key can send the money twice.
52
+ */
25
53
  send(input: CreateTransferBody, options?: {
26
54
  signal?: AbortSignal;
27
55
  timeoutMs?: number;
@@ -29,7 +57,9 @@ export declare class TransfersResource {
29
57
  /**
30
58
  * One transfer in full. Note the shape: this is the transaction itself, not
31
59
  * the `{ transaction }` wrapper that `send()` returns — and it carries more,
32
- * including `amlLevel`, `approvers`, `usdRate` and `failureReason`.
60
+ * including `amlLevel`, `approvers`, `usdRate` and `failureReason` — the
61
+ * last only on `failed`, `rejected` and `cancelled`, `null` on any other
62
+ * status.
33
63
  */
34
64
  get(transferId: string): Promise<TransactionDetail>;
35
65
  /**
@@ -45,11 +75,30 @@ export declare class TransfersResource {
45
75
  * awaiting_approval — counted, more signatures still needed;
46
76
  * rejected — a `reject` is a veto, and the reserve is released;
47
77
  * confirmed/failed — this vote completed the threshold, so execution ran
48
- * INSIDE this request (gas, then broadcast, ~10s).
78
+ * INSIDE this request (gas, then broadcast, ~10s);
79
+ * pending — with no `executionError`: the outcome is NOT
80
+ * established by this answer. The signing service
81
+ * gave no definite answer (the transaction may have
82
+ * left; an administrator's reconciliation settles
83
+ * it), another call is executing the transfer, or
84
+ * the execution broke off. Re-read the transfer:
85
+ * `confirmed`/`failed` is the outcome, `pending` for
86
+ * over 10 minutes by `updatedAt` is waiting for
87
+ * reconciliation. Never send it again.
49
88
  *
50
89
  * `failed` means the money is back: execution broke after approval and the
51
90
  * reserve was released, with the reason in `executionError`. Treating the
52
- * call as "approved, done" hides both the success and that failure.
91
+ * call as "approved, done" hides both the success and that failure. The
92
+ * exception is a `failed` transfer that has a `txHash`: it went out after
93
+ * reconciliation had already returned the reserve, and an administrator has
94
+ * to correct the ledger. `executionError` beside `rejected` or `cancelled`
95
+ * means the transfer was no longer waiting for signatures when approved,
96
+ * and nothing was executed.
97
+ *
98
+ * Repeating the same decision while the transfer is still waiting finishes
99
+ * what an earlier call left undone (it recorded the vote and broke off) — a
100
+ * veto, or execution once the threshold is met — instead of 409
101
+ * `ALREADY_VOTED`.
53
102
  */
54
103
  vote(transferId: string, input: VoteInput): Promise<VoteResult>;
55
104
  /**
@@ -68,19 +117,34 @@ export declare class TransfersResource {
68
117
  */
69
118
  cancel(transferId: string): Promise<CancelResult>;
70
119
  /**
71
- * Settles a transfer stuck in `pending` — the case where the worker died
72
- * mid-execution, so cancelling does not apply. Administrators only.
120
+ * Settles a transfer nothing else can close. Administrators only.
121
+ *
122
+ * pending — execution died, or its outcome is unknown (the
123
+ * send answered 502 `TRANSFER_OUTCOME_UNKNOWN`);
124
+ * awaiting_approval — with no live approval request to vote on;
125
+ * failed, rejected,
126
+ * cancelled — closed, but the reserve is still held: it is
127
+ * returned, and the status stays.
128
+ *
129
+ * A pending transfer is decided by the HASH: send `txHash` and it is driven
130
+ * to `confirmed`; send none and the reserve is returned (`failed`). Sending
131
+ * none is YOUR statement that nothing was broadcast — the server does not
132
+ * check it, so look on the chain first: returning the reserve of a
133
+ * transaction that did go out creates money. If the transfer already holds
134
+ * a hash from the signing service, only that hash, sent explicitly, settles
135
+ * it — 409 `TRANSFER_BROADCAST` without one, `TXHASH_MISMATCH` with another,
136
+ * the saved hash in `details.txHash`. The other two cases never executed
137
+ * and take no hash.
73
138
  *
74
- * The decision is made by the HASH: send `txHash` and the transfer is
75
- * driven to `confirmed`, because the signing service did put it on the
76
- * chain; send none and the reserve is returned, because there was no
77
- * broadcast. A FRESH pending transfer is refused on purpose — while
78
- * execution may still be in flight, intervening risks a SECOND broadcast,
79
- * which costs more than waiting.
139
+ * A FRESH transfer is refused on purpose — while execution may still be in
140
+ * flight, intervening risks a SECOND broadcast, which costs more than
141
+ * waiting.
80
142
  *
81
- * Pass `fee` along with the hash if you know it: this is the only moment
82
- * it can be recorded on a transfer settled this way, and it stays null
83
- * otherwise. The answer says which way it went — `confirmed` or `failed`.
143
+ * Pass `fee` along with the hash if you know it: this is the only moment it
144
+ * can be recorded on a transfer settled this way; otherwise it stays as it
145
+ * is, null unless the signing service reported one. The answer says which
146
+ * way it went — `confirmed`, `failed`, or the unchanged `rejected` /
147
+ * `cancelled` of a closed transfer.
84
148
  */
85
149
  reconcile(transferId: string, input?: ReconcileTransferBody): Promise<ReconcileTransferResult>;
86
150
  }
@@ -1 +1 @@
1
- {"version":3,"file":"transfers.d.ts","sourceRoot":"","sources":["../../../src/resources/transfers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EACV,YAAY,EACZ,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB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AAU,EACX,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,iBAAiB;;IAI5B,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAED;;;;;;;;;;;;OAYG;IACG,IAAI,CACR,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GACzD,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAUzC;IAED;;;;;;OAMG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAElD;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAM9D;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAEhD;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,SAAS,CACP,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,qBAA0B,GAChC,OAAO,CAAC,uBAAuB,CAAC,CAMlC;CACF"}
@@ -9,12 +9,28 @@ const gated_js_1 = require("../core/gated.js");
9
9
  * The result of sending is `Gated`, and that is the main thing to understand
10
10
  * here. The same `{transaction}` body comes back in three situations:
11
11
  *
12
- * applied (201) — executed, the money left;
12
+ * applied (201) — executed, the money left (rarely the status is still
13
+ * `pending` with a `txHash`: it went out, but its
14
+ * accounting was not recorded, and an administrator's
15
+ * reconciliation finishes it — do not send it again);
13
16
  * pending (202) — awaiting signatures, funds RESERVED but not sent;
14
- * replayed (200) — a repeat; the transfer already existed.
17
+ * replayed (200) — a transfer with this `idempotencyKey` already existed,
18
+ * and this is that transfer as it stands NOW.
15
19
  *
16
20
  * They cannot be told apart by the body. Showing "sent" on `pending` tells
17
21
  * the person money has gone when it is frozen.
22
+ *
23
+ * `replayed` does not mean "sent" either. It says only that the request was
24
+ * seen before; what became of it is in `data.transaction.status`:
25
+ *
26
+ * confirmed, submitted — it left;
27
+ * awaiting_approval — waiting for signatures, funds reserved;
28
+ * pending — still executing, or its outcome is unknown
29
+ * (the first answer was 502
30
+ * `TRANSFER_OUTCOME_UNKNOWN`) until an
31
+ * administrator reconciles it;
32
+ * failed, rejected,
33
+ * cancelled — it did not leave.
18
34
  */
19
35
  class TransfersResource {
20
36
  #http;
@@ -23,7 +39,19 @@ class TransfersResource {
23
39
  this.#http = http;
24
40
  this.#base = `/api/v1/vaults/${(0, http_js_1.seg)(vaultCode)}/transfers`;
25
41
  }
26
- /** Sends a transfer. The timeout is long: the path calls the wallet service. */
42
+ /**
43
+ * Sends a transfer. The timeout is long: the path calls the wallet service.
44
+ *
45
+ * On `outcome: 'replayed'` read `data.transaction.status` before telling
46
+ * anyone anything — a replay of an attempt that failed, or that is still
47
+ * waiting for signatures, comes back the same way as one that went out.
48
+ *
49
+ * A thrown 502 `TRANSFER_OUTCOME_UNKNOWN` is not a failure: the signing
50
+ * service gave no definite answer, the transaction may have left, and the
51
+ * transfer stays `pending` with its funds reserved (`details.transactionId`).
52
+ * Retry it only with the SAME key — that returns the transfer without
53
+ * executing it again; a new key can send the money twice.
54
+ */
27
55
  async send(input, options = {}) {
28
56
  const res = await this.#http.requestRaw('POST', this.#base, {
29
57
  body: input,
@@ -38,7 +66,9 @@ class TransfersResource {
38
66
  /**
39
67
  * One transfer in full. Note the shape: this is the transaction itself, not
40
68
  * the `{ transaction }` wrapper that `send()` returns — and it carries more,
41
- * including `amlLevel`, `approvers`, `usdRate` and `failureReason`.
69
+ * including `amlLevel`, `approvers`, `usdRate` and `failureReason` — the
70
+ * last only on `failed`, `rejected` and `cancelled`, `null` on any other
71
+ * status.
42
72
  */
43
73
  get(transferId) {
44
74
  return this.#http.request('GET', `${this.#base}/${(0, http_js_1.seg)(transferId)}`);
@@ -56,11 +86,30 @@ class TransfersResource {
56
86
  * awaiting_approval — counted, more signatures still needed;
57
87
  * rejected — a `reject` is a veto, and the reserve is released;
58
88
  * confirmed/failed — this vote completed the threshold, so execution ran
59
- * INSIDE this request (gas, then broadcast, ~10s).
89
+ * INSIDE this request (gas, then broadcast, ~10s);
90
+ * pending — with no `executionError`: the outcome is NOT
91
+ * established by this answer. The signing service
92
+ * gave no definite answer (the transaction may have
93
+ * left; an administrator's reconciliation settles
94
+ * it), another call is executing the transfer, or
95
+ * the execution broke off. Re-read the transfer:
96
+ * `confirmed`/`failed` is the outcome, `pending` for
97
+ * over 10 minutes by `updatedAt` is waiting for
98
+ * reconciliation. Never send it again.
60
99
  *
61
100
  * `failed` means the money is back: execution broke after approval and the
62
101
  * reserve was released, with the reason in `executionError`. Treating the
63
- * call as "approved, done" hides both the success and that failure.
102
+ * call as "approved, done" hides both the success and that failure. The
103
+ * exception is a `failed` transfer that has a `txHash`: it went out after
104
+ * reconciliation had already returned the reserve, and an administrator has
105
+ * to correct the ledger. `executionError` beside `rejected` or `cancelled`
106
+ * means the transfer was no longer waiting for signatures when approved,
107
+ * and nothing was executed.
108
+ *
109
+ * Repeating the same decision while the transfer is still waiting finishes
110
+ * what an earlier call left undone (it recorded the vote and broke off) — a
111
+ * veto, or execution once the threshold is met — instead of 409
112
+ * `ALREADY_VOTED`.
64
113
  */
65
114
  vote(transferId, input) {
66
115
  return this.#http.request('POST', `${this.#base}/${(0, http_js_1.seg)(transferId)}/approvals`, { body: input });
@@ -83,19 +132,34 @@ class TransfersResource {
83
132
  return this.#http.request('POST', `${this.#base}/${(0, http_js_1.seg)(transferId)}/cancel`);
84
133
  }
85
134
  /**
86
- * Settles a transfer stuck in `pending` — the case where the worker died
87
- * mid-execution, so cancelling does not apply. Administrators only.
135
+ * Settles a transfer nothing else can close. Administrators only.
136
+ *
137
+ * pending — execution died, or its outcome is unknown (the
138
+ * send answered 502 `TRANSFER_OUTCOME_UNKNOWN`);
139
+ * awaiting_approval — with no live approval request to vote on;
140
+ * failed, rejected,
141
+ * cancelled — closed, but the reserve is still held: it is
142
+ * returned, and the status stays.
143
+ *
144
+ * A pending transfer is decided by the HASH: send `txHash` and it is driven
145
+ * to `confirmed`; send none and the reserve is returned (`failed`). Sending
146
+ * none is YOUR statement that nothing was broadcast — the server does not
147
+ * check it, so look on the chain first: returning the reserve of a
148
+ * transaction that did go out creates money. If the transfer already holds
149
+ * a hash from the signing service, only that hash, sent explicitly, settles
150
+ * it — 409 `TRANSFER_BROADCAST` without one, `TXHASH_MISMATCH` with another,
151
+ * the saved hash in `details.txHash`. The other two cases never executed
152
+ * and take no hash.
88
153
  *
89
- * The decision is made by the HASH: send `txHash` and the transfer is
90
- * driven to `confirmed`, because the signing service did put it on the
91
- * chain; send none and the reserve is returned, because there was no
92
- * broadcast. A FRESH pending transfer is refused on purpose — while
93
- * execution may still be in flight, intervening risks a SECOND broadcast,
94
- * which costs more than waiting.
154
+ * A FRESH transfer is refused on purpose — while execution may still be in
155
+ * flight, intervening risks a SECOND broadcast, which costs more than
156
+ * waiting.
95
157
  *
96
- * Pass `fee` along with the hash if you know it: this is the only moment
97
- * it can be recorded on a transfer settled this way, and it stays null
98
- * otherwise. The answer says which way it went — `confirmed` or `failed`.
158
+ * Pass `fee` along with the hash if you know it: this is the only moment it
159
+ * can be recorded on a transfer settled this way; otherwise it stays as it
160
+ * is, null unless the signing service reported one. The answer says which
161
+ * way it went — `confirmed`, `failed`, or the unchanged `rejected` /
162
+ * `cancelled` of a closed transfer.
99
163
  */
100
164
  reconcile(transferId, input = {}) {
101
165
  return this.#http.request('POST', `${this.#base}/${(0, http_js_1.seg)(transferId)}/reconcile`, { body: input });
@@ -1 +1 @@
1
- {"version":3,"file":"transfers.js","sourceRoot":"","sources":["../../../src/resources/transfers.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AACtD,+CAAsD;AAgBtD;;;;;;;;;;;;GAYG;AACH;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,YAAY,CAAA;IAC3D,CAAC;IAED,gFAAgF;IAChF,KAAK,CAAC,IAAI,CACR,KAAyB,EACzB,OAAO,GAAiD,EAAE;QAE1D,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAA0B,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE;YACnF,IAAI,EAAE,KAAK;YACX,GAAG,CAAC,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE,CAAC;YACvF,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;YACnE,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;SAC7E,CAAC,CAAA;QACF,OAAO,IAAA,kBAAO,EAAmD,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE;YACrF,WAAW,EAAE,IAAI;SAClB,CAAC,CAAA;IACJ,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,UAAkB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAoB,KAAK,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MAAM,CAAC,UAAkB;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAe,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,IAAA,aAAG,EAAC,UAAU,CAAC,SAAS,CAAC,CAAA;IAC5F,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,SAAS,CACP,UAAkB,EAClB,KAAK,GAA0B,EAAE;QAEjC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,MAAM,EACN,GAAG,IAAI,CAAC,KAAK,IAAI,IAAA,aAAG,EAAC,UAAU,CAAC,YAAY,EAC5C,EAAE,IAAI,EAAE,KAAK,EAAE,CAChB,CAAA;IACH,CAAC;CACF"}
@@ -34,10 +34,6 @@ import type { AddressDetail as GeneratedAddressDetail, AddressListItem, CreateTr
34
34
  * the two must not be merged, because "no account" and "empty account"
35
35
  * deserve different wording. Amounts are raw smallest units; put them through
36
36
  * the helpers in `units.ts` rather than `Number`.
37
- *
38
- * One field is thinner than the type admits: `sharing` is optional because
39
- * `PATCH /addresses/{id}` reuses this schema WITHOUT it (the document says so
40
- * itself, on the property). Listings and the detail endpoint do send it.
41
37
  */
42
38
  export type Address = AddressListItem;
43
39
  /** A single address with its sharing and access details. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/resources/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,aAAa,IAAI,sBAAsB,EACvC,eAAe,EACf,uBAAuB,EACvB,WAAW,IAAI,oBAAoB,EACnC,UAAU,EACX,MAAM,uBAAuB,CAAA;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,OAAO,GAAG,eAAe,CAAA;AAErC,4DAA4D;AAC5D,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAA;AAElD,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,uBAAuB,CAAC,aAAa,CAAC,CAAA;AAEhE,+CAA+C;AAC/C,MAAM,MAAM,WAAW,GAAG,oBAAoB,CAAA;AAE9C,4DAA4D;AAC5D,MAAM,MAAM,UAAU,GAAG,UAAU,CAAA;AAEnC;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GACzB,mBAAmB,GACnB,SAAS,GACT,WAAW,GACX,WAAW,GACX,QAAQ,GACR,WAAW,GACX,UAAU,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/resources/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,aAAa,IAAI,sBAAsB,EACvC,eAAe,EACf,uBAAuB,EACvB,WAAW,IAAI,oBAAoB,EACnC,UAAU,EACX,MAAM,uBAAuB,CAAA;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,OAAO,GAAG,eAAe,CAAA;AAErC,4DAA4D;AAC5D,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAA;AAElD,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,uBAAuB,CAAC,aAAa,CAAC,CAAA;AAEhE,+CAA+C;AAC/C,MAAM,MAAM,WAAW,GAAG,oBAAoB,CAAA;AAE9C,4DAA4D;AAC5D,MAAM,MAAM,UAAU,GAAG,UAAU,CAAA;AAEnC;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GACzB,mBAAmB,GACnB,SAAS,GACT,WAAW,GACX,WAAW,GACX,QAAQ,GACR,WAAW,GACX,UAAU,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /** SDK version, sent in the `user-agent` header. */
2
- export declare const SDK_VERSION = "0.2.0";
2
+ export declare const SDK_VERSION = "0.2.2";
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
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_BASE_URL = exports.SDK_VERSION = void 0;
4
4
  /** SDK version, sent in the `user-agent` header. */
5
- exports.SDK_VERSION = '0.2.0';
5
+ exports.SDK_VERSION = '0.2.2';
6
6
  /** Default API base URL. */
7
7
  exports.DEFAULT_BASE_URL = 'https://policy-engine-rest.ezig.workers.dev';
8
8
  //# sourceMappingURL=version.js.map
@@ -15,8 +15,10 @@
15
15
  * frozen.
16
16
  *
17
17
  * `replayed` is kept separate from `applied` on purpose. A replay means the
18
- * previous attempt DID reach the server and only the answer was lost, so the
19
- * person should be told "already sent", not "sent" a second time.
18
+ * previous attempt DID reach the server and only the answer was lost — not
19
+ * that it succeeded. The body is that operation as it stands now: a replayed
20
+ * transfer may have gone out, be waiting for signatures, be still executing
21
+ * or have failed, and only its own status says which.
20
22
  */
21
23
  export type GatedOutcome = 'applied' | 'pending' | 'replayed';
22
24
  /**
@@ -61,7 +63,11 @@ export type Gated<TApplied, TPending = TApplied> = {
61
63
  export declare function toGated<TApplied, TPending>(status: number, data: unknown, options?: {
62
64
  replayOn200?: boolean;
63
65
  }): Gated<TApplied, TPending>;
64
- /** Narrowing: the operation ran, now or earlier, and money moved. */
66
+ /**
67
+ * Narrowing: `applied` or `replayed`. For `applied` the operation ran now.
68
+ * For `replayed` it only existed already — whether money moved is in the
69
+ * body's own status, not in this check.
70
+ */
65
71
  export declare function isApplied<A, P>(r: Gated<A, P>): r is Extract<Gated<A, P>, {
66
72
  outcome: 'applied' | 'replayed';
67
73
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"gated.d.ts","sourceRoot":"","sources":["../../../src/core/gated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;AAE7D;;;;;;;;GAQG;AACH,MAAM,MAAM,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,IAC3C;IAA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,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;IAAE,OAAO,EAAE,SAAS,CAAA;CAAE,CAAC,CAEnD"}
@@ -15,8 +15,10 @@
15
15
  * frozen.
16
16
  *
17
17
  * `replayed` is kept separate from `applied` on purpose. A replay means the
18
- * previous attempt DID reach the server and only the answer was lost, so the
19
- * person should be told "already sent", not "sent" a second time.
18
+ * previous attempt DID reach the server and only the answer was lost — not
19
+ * that it succeeded. The body is that operation as it stands now: a replayed
20
+ * transfer may have gone out, be waiting for signatures, be still executing
21
+ * or have failed, and only its own status says which.
20
22
  */
21
23
  /**
22
24
  * Labels a response by status. An unexpected status throws rather than guessing.
@@ -50,7 +52,11 @@ export function toGated(status, data, options = {}) {
50
52
  'Expected 200, 201 (applied) or 202 (awaiting approval).');
51
53
  }
52
54
  }
53
- /** Narrowing: the operation ran, now or earlier, and money moved. */
55
+ /**
56
+ * Narrowing: `applied` or `replayed`. For `applied` the operation ran now.
57
+ * For `replayed` it only existed already — whether money moved is in the
58
+ * body's own status, not in this check.
59
+ */
54
60
  export function isApplied(r) {
55
61
  return r.outcome === 'applied' || r.outcome === 'replayed';
56
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gated.js","sourceRoot":"","sources":["../../../src/core/gated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAkBH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,OAAO,CACrB,MAAc,EACd,IAAa,EACb,OAAO,GAA8B,EAAE;IAEvC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,GAAG;YACN,OAAO,OAAO,CAAC,WAAW;gBACxB,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAgB,EAAE;gBAC9D,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAgB,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,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAqB5F;IAED,qFAAqF;IAC/E,UAAU,CAAC,CAAC,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAYzB;CA8FF"}
@@ -63,11 +63,25 @@ export class HttpClient {
63
63
  constructor(options) {
64
64
  this.baseUrl = options.baseUrl.replace(/\/+$/, '');
65
65
  this.#options = options;
66
- const f = options.fetch ?? globalThis.fetch;
67
- if (typeof f !== 'function') {
66
+ const custom = options.fetch;
67
+ if (typeof (custom ?? globalThis.fetch) !== 'function') {
68
68
  throw new Error('@v3finance/core-sdk: fetch is unavailable in this runtime — pass one to the client options.');
69
69
  }
70
- this.#fetch = f;
70
+ // NEVER store the function and call it as `this.#fetch(…)`. A private
71
+ // field call passes the client as the receiver, and a browser's `fetch`
72
+ // checks its receiver: anything but the window is
73
+ // `TypeError: Illegal invocation`, thrown before a single byte leaves.
74
+ // Node and React Native do not check, which is how every request from a
75
+ // web page failed while the whole test suite passed — and since a
76
+ // `TypeError` out of `fetch` is what a dropped connection looks like, the
77
+ // failure surfaced as a "network error" on a perfectly good network.
78
+ //
79
+ // The wrapper calls with no receiver at all. Without a custom fetch the
80
+ // global one is looked up per call rather than captured here, so whatever
81
+ // patches it later (instrumentation, a mock server) is still honoured.
82
+ this.#fetch = custom
83
+ ? (input, init) => custom(input, init)
84
+ : (input, init) => globalThis.fetch(input, init);
71
85
  this.#timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
72
86
  }
73
87
  /** Performs a request and returns the parsed body. Statuses >= 400 throw `CoreError`. */
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/core/http.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,YAAY,E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,KAAK,EACH,SAAS,CAAC,MAAM,GAAG,qBAAqB;YACtC,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,qBAAqB,CAAC,GAAG;YACjD,CAAC,CAAC,SAAS;KAChB,CAAA;AACH,CAAC"}
@@ -9,7 +9,7 @@
9
9
  // the API does not slip in unclassified.
10
10
  //
11
11
  // Operations: 171 · admin: 40 · both: 1 · member: 127 · service: 3
12
- // Spec sha256: a03bd2e06186734bd8816c3d764dd90a48c1c31d7edda2743a3ae29550601cd1
12
+ // Spec sha256: 30be5f9b9733d1d1d67eebf21e0bfaa457651e951676211ec9fa464cca5d3795
13
13
  export const OPERATIONS = {
14
14
  "DELETE /api/v1/me/push-tokens/{token}": {
15
15
  "method": "delete",