@v3finance/core-sdk 0.2.5 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/README.md +9 -2
- package/dist/cjs/client.d.ts +2 -0
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +2 -0
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/core/gated.d.ts +6 -5
- package/dist/cjs/core/gated.d.ts.map +1 -1
- package/dist/cjs/core/gated.js +6 -5
- package/dist/cjs/core/gated.js.map +1 -1
- package/dist/cjs/core/pagination.d.ts +4 -3
- package/dist/cjs/core/pagination.d.ts.map +1 -1
- package/dist/cjs/core/pagination.js +4 -3
- package/dist/cjs/core/pagination.js.map +1 -1
- package/dist/cjs/generated/operations.d.ts +40 -0
- package/dist/cjs/generated/operations.d.ts.map +1 -1
- package/dist/cjs/generated/operations.js +42 -2
- package/dist/cjs/generated/operations.js.map +1 -1
- package/dist/cjs/generated/types.d.ts +50 -1
- package/dist/cjs/generated/types.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/resources/approvals.d.ts +11 -1
- package/dist/cjs/resources/approvals.d.ts.map +1 -1
- package/dist/cjs/resources/approvals.js +11 -1
- package/dist/cjs/resources/approvals.js.map +1 -1
- package/dist/cjs/resources/transferDrafts.d.ts +119 -0
- package/dist/cjs/resources/transferDrafts.d.ts.map +1 -0
- package/dist/cjs/resources/transferDrafts.js +128 -0
- package/dist/cjs/resources/transferDrafts.js.map +1 -0
- package/dist/cjs/resources/transfers.d.ts +18 -2
- package/dist/cjs/resources/transfers.d.ts.map +1 -1
- package/dist/cjs/resources/transfers.js +18 -2
- package/dist/cjs/resources/transfers.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client.d.ts +2 -0
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +2 -0
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/core/gated.d.ts +6 -5
- package/dist/esm/core/gated.d.ts.map +1 -1
- package/dist/esm/core/gated.js +6 -5
- package/dist/esm/core/gated.js.map +1 -1
- package/dist/esm/core/pagination.d.ts +4 -3
- package/dist/esm/core/pagination.d.ts.map +1 -1
- package/dist/esm/core/pagination.js +4 -3
- package/dist/esm/core/pagination.js.map +1 -1
- package/dist/esm/generated/operations.d.ts +40 -0
- package/dist/esm/generated/operations.d.ts.map +1 -1
- package/dist/esm/generated/operations.js +42 -2
- package/dist/esm/generated/operations.js.map +1 -1
- package/dist/esm/generated/types.d.ts +50 -1
- package/dist/esm/generated/types.d.ts.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/resources/approvals.d.ts +11 -1
- package/dist/esm/resources/approvals.d.ts.map +1 -1
- package/dist/esm/resources/approvals.js +11 -1
- package/dist/esm/resources/approvals.js.map +1 -1
- package/dist/esm/resources/transferDrafts.d.ts +119 -0
- package/dist/esm/resources/transferDrafts.d.ts.map +1 -0
- package/dist/esm/resources/transferDrafts.js +124 -0
- package/dist/esm/resources/transferDrafts.js.map +1 -0
- package/dist/esm/resources/transfers.d.ts +18 -2
- package/dist/esm/resources/transfers.d.ts.map +1 -1
- package/dist/esm/resources/transfers.js +18 -2
- package/dist/esm/resources/transfers.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/concepts.md +14 -2
- package/docs/errors.md +22 -5
- package/package.json +1 -1
- package/src/client.ts +3 -0
- package/src/core/gated.ts +6 -5
- package/src/core/pagination.ts +4 -3
- package/src/generated/operations.ts +42 -2
- package/src/generated/types.ts +54 -1
- package/src/index.ts +5 -0
- package/src/resources/approvals.ts +11 -1
- package/src/resources/transferDrafts.ts +157 -0
- package/src/resources/transfers.ts +18 -2
- package/src/version.ts +1 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { type HttpClient } from '../core/http.js';
|
|
2
|
+
import type { PageParams } from '../core/pagination.js';
|
|
3
|
+
import { type Gated } from '../core/gated.js';
|
|
4
|
+
import type { CreateTransactionResult, CreateTransferDraftBody, TransferDraft, TransferDraftResult, TransferDraftsPage } from '../generated/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* `draft` — waiting to be sent from the mobile app; `sent` — a transfer was
|
|
7
|
+
* created from it, which is NOT the same as "the money left" (read the
|
|
8
|
+
* transfer by `transactionId`); `discarded` — deleted, no transfer was created.
|
|
9
|
+
*/
|
|
10
|
+
export type TransferDraftStatus = TransferDraft['status'];
|
|
11
|
+
export interface ListTransferDraftsParams extends PageParams {
|
|
12
|
+
/** One status. Omitted — every draft of yours, discarded ones included. */
|
|
13
|
+
status?: TransferDraftStatus | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Transfer drafts: how a transfer is prepared in a web session.
|
|
17
|
+
*
|
|
18
|
+
* Money is sent and signatures are given from the mobile app. Who may depends
|
|
19
|
+
* on how the session was obtained:
|
|
20
|
+
*
|
|
21
|
+
* mobile app — anyone (an older session, issued before the API told
|
|
22
|
+
* sessions apart, counts as one);
|
|
23
|
+
* browser — signed in by the email link, as the admin panel is: a
|
|
24
|
+
* platform administrator only;
|
|
25
|
+
* web login — nobody, a platform administrator included.
|
|
26
|
+
*
|
|
27
|
+
* A session that may not is refused with 403 `WEB_SESSION_CANNOT_SIGN` on
|
|
28
|
+
* `transfers.send`, `transfers.vote`, `transfers.reconcile`, `approvals.vote`
|
|
29
|
+
* and `send` below — the refusal is the server's, so hiding a button in a web
|
|
30
|
+
* client is not what enforces it. What a web session can do is create a
|
|
31
|
+
* draft: the API pushes it to the author's mobile devices, and the author
|
|
32
|
+
* sends it from there. Cancelling your OWN transfer or request is open to any
|
|
33
|
+
* session.
|
|
34
|
+
*
|
|
35
|
+
* A draft is seen and touched ONLY by its author — an administrator included.
|
|
36
|
+
* Anyone else's draft, a missing one and one from another vault all answer
|
|
37
|
+
* the same 404 `TRANSFER_DRAFT_NOT_FOUND`.
|
|
38
|
+
*
|
|
39
|
+
* A draft is immutable: for other parameters create a new one and discard the
|
|
40
|
+
* old.
|
|
41
|
+
*/
|
|
42
|
+
export declare class TransferDraftsResource {
|
|
43
|
+
#private;
|
|
44
|
+
constructor(http: HttpClient, vaultCode: string);
|
|
45
|
+
/**
|
|
46
|
+
* Creates a draft. Allowed in a web session — that is what it is for.
|
|
47
|
+
*
|
|
48
|
+
* Checked as `transfers.send` checks, with the same codes: the address
|
|
49
|
+
* (404 `ADDRESS_NOT_FOUND`, 400 `ADDRESS_NOT_IN_VAULT`), the right to
|
|
50
|
+
* transfer from it (403 `ADDRESS_TRANSFER_FORBIDDEN`), the token (400
|
|
51
|
+
* `TOKEN_NOT_FOUND`, `TOKEN_NETWORK_MISMATCH`), the amount (400
|
|
52
|
+
* `INVALID_AMOUNT`) and the recipient's format (400
|
|
53
|
+
* `INVALID_DESTINATION_ADDRESS`). AML, policies and the balance are NOT
|
|
54
|
+
* checked here: they are decided when the draft is sent.
|
|
55
|
+
*
|
|
56
|
+
* `amount` is a decimal string, as in `transfers.send`; the draft keeps it
|
|
57
|
+
* in smallest units (`draft.amount`) beside `amountDecimal`.
|
|
58
|
+
*
|
|
59
|
+
* There is no idempotency key: a retry creates a second draft. After
|
|
60
|
+
* creation the author gets a push on their mobile devices (`data.type` is
|
|
61
|
+
* `transfer_draft_created`, with `draftId`); a failed push does not fail
|
|
62
|
+
* the call.
|
|
63
|
+
*/
|
|
64
|
+
create(input: CreateTransferDraftBody): Promise<TransferDraftResult>;
|
|
65
|
+
/** Your own drafts, newest first. Keyset-paginated: `{items, nextCursor}`. */
|
|
66
|
+
list(params?: ListTransferDraftsParams): Promise<TransferDraftsPage>;
|
|
67
|
+
get(draftId: string): Promise<TransferDraftResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Deletes a draft — softly: `draft` becomes `discarded`, and it can no
|
|
70
|
+
* longer be sent. Discarding one already discarded answers 200 with the
|
|
71
|
+
* same draft. Allowed in a web session.
|
|
72
|
+
*
|
|
73
|
+
* A draft a transfer was created from is 409 `TRANSFER_DRAFT_ALREADY_SENT`,
|
|
74
|
+
* with `details.transactionId`: discarding it does not undo the transfer.
|
|
75
|
+
* A transfer still awaiting signatures is withdrawn with
|
|
76
|
+
* `transfers.cancel()`. The same 409 comes back when the transfer exists
|
|
77
|
+
* but the draft is not marked `sent` yet — it is being sent from a phone
|
|
78
|
+
* right now, or that send broke off — and the mark is written then.
|
|
79
|
+
*/
|
|
80
|
+
discard(draftId: string): Promise<TransferDraftResult>;
|
|
81
|
+
/**
|
|
82
|
+
* Sends a draft: creates the transfer the same way `transfers.send` does —
|
|
83
|
+
* address right, token, amount, recipient, AML, policies, limits,
|
|
84
|
+
* signatures, reserve. Only the author can, and only from a session that may
|
|
85
|
+
* send money (see the class): a web login, or a browser of anyone but a
|
|
86
|
+
* platform administrator, gets 403 `WEB_SESSION_CANNOT_SIGN`. There is no
|
|
87
|
+
* body; the parameters come from the draft alone.
|
|
88
|
+
*
|
|
89
|
+
* The answer is exactly that of `transfers.send`, and so are its errors:
|
|
90
|
+
* `applied` (201), `pending` (202 — waiting for signatures, funds
|
|
91
|
+
* reserved) or `replayed` (200). Read the TSDoc of `TransfersResource` on
|
|
92
|
+
* what each means; the timeout caveats of a money path apply here too.
|
|
93
|
+
*
|
|
94
|
+
* A DRAFT IS SENT ONCE. The transfer's idempotency key is derived from the
|
|
95
|
+
* draft, so a repeated send — a double tap, a second phone, a retry after a
|
|
96
|
+
* broken connection — returns the SAME transfer as `replayed`, as it stands
|
|
97
|
+
* now, and never a second one. That holds after `failed` too: a transfer
|
|
98
|
+
* from a draft is not sent again; a new attempt is an ordinary transfer.
|
|
99
|
+
* `replayed` does not mean the money left — read
|
|
100
|
+
* `data.transaction.status`.
|
|
101
|
+
*
|
|
102
|
+
* A refusal before the transfer exists (policy, balance, unsatisfiable
|
|
103
|
+
* approval, token) leaves the draft a `draft`, to send later or discard.
|
|
104
|
+
* Once the transfer exists — `failed` after the gas station and 502
|
|
105
|
+
* `TRANSFER_OUTCOME_UNKNOWN` included — the draft is `sent` with
|
|
106
|
+
* `transactionId`. A discarded draft with no transfer is 409
|
|
107
|
+
* `TRANSFER_DRAFT_DISCARDED`.
|
|
108
|
+
*
|
|
109
|
+
* The token is resolved before the replay: if the draft's token was
|
|
110
|
+
* disabled after it was sent, a repeated send answers 400
|
|
111
|
+
* `TOKEN_NOT_FOUND` instead of the transfer. No new transfer is created
|
|
112
|
+
* either way; read it by the draft's `transactionId`.
|
|
113
|
+
*/
|
|
114
|
+
send(draftId: string, options?: {
|
|
115
|
+
signal?: AbortSignal;
|
|
116
|
+
timeoutMs?: number;
|
|
117
|
+
}): Promise<Gated<CreateTransactionResult>>;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=transferDrafts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transferDrafts.d.ts","sourceRoot":"","sources":["../../../src/resources/transferDrafts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,uBAAuB,CAAA;AAE9B;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;AAEzD,MAAM,WAAW,wBAAyB,SAAQ,UAAU;IAC1D,2EAA2E;IAC3E,MAAM,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAA;CACzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,sBAAsB;;IAIjC,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAEnE;IAED,8EAA8E;IAC9E,IAAI,CAAC,MAAM,GAAE,wBAA6B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAEvE;IAED,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAEjD;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAErD;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,IAAI,CACR,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GACzD,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAYzC;CACF"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransferDraftsResource = void 0;
|
|
4
|
+
const http_js_1 = require("../core/http.js");
|
|
5
|
+
const gated_js_1 = require("../core/gated.js");
|
|
6
|
+
/**
|
|
7
|
+
* Transfer drafts: how a transfer is prepared in a web session.
|
|
8
|
+
*
|
|
9
|
+
* Money is sent and signatures are given from the mobile app. Who may depends
|
|
10
|
+
* on how the session was obtained:
|
|
11
|
+
*
|
|
12
|
+
* mobile app — anyone (an older session, issued before the API told
|
|
13
|
+
* sessions apart, counts as one);
|
|
14
|
+
* browser — signed in by the email link, as the admin panel is: a
|
|
15
|
+
* platform administrator only;
|
|
16
|
+
* web login — nobody, a platform administrator included.
|
|
17
|
+
*
|
|
18
|
+
* A session that may not is refused with 403 `WEB_SESSION_CANNOT_SIGN` on
|
|
19
|
+
* `transfers.send`, `transfers.vote`, `transfers.reconcile`, `approvals.vote`
|
|
20
|
+
* and `send` below — the refusal is the server's, so hiding a button in a web
|
|
21
|
+
* client is not what enforces it. What a web session can do is create a
|
|
22
|
+
* draft: the API pushes it to the author's mobile devices, and the author
|
|
23
|
+
* sends it from there. Cancelling your OWN transfer or request is open to any
|
|
24
|
+
* session.
|
|
25
|
+
*
|
|
26
|
+
* A draft is seen and touched ONLY by its author — an administrator included.
|
|
27
|
+
* Anyone else's draft, a missing one and one from another vault all answer
|
|
28
|
+
* the same 404 `TRANSFER_DRAFT_NOT_FOUND`.
|
|
29
|
+
*
|
|
30
|
+
* A draft is immutable: for other parameters create a new one and discard the
|
|
31
|
+
* old.
|
|
32
|
+
*/
|
|
33
|
+
class TransferDraftsResource {
|
|
34
|
+
#http;
|
|
35
|
+
#base;
|
|
36
|
+
constructor(http, vaultCode) {
|
|
37
|
+
this.#http = http;
|
|
38
|
+
this.#base = `/api/v1/vaults/${(0, http_js_1.seg)(vaultCode)}/transfer-drafts`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates a draft. Allowed in a web session — that is what it is for.
|
|
42
|
+
*
|
|
43
|
+
* Checked as `transfers.send` checks, with the same codes: the address
|
|
44
|
+
* (404 `ADDRESS_NOT_FOUND`, 400 `ADDRESS_NOT_IN_VAULT`), the right to
|
|
45
|
+
* transfer from it (403 `ADDRESS_TRANSFER_FORBIDDEN`), the token (400
|
|
46
|
+
* `TOKEN_NOT_FOUND`, `TOKEN_NETWORK_MISMATCH`), the amount (400
|
|
47
|
+
* `INVALID_AMOUNT`) and the recipient's format (400
|
|
48
|
+
* `INVALID_DESTINATION_ADDRESS`). AML, policies and the balance are NOT
|
|
49
|
+
* checked here: they are decided when the draft is sent.
|
|
50
|
+
*
|
|
51
|
+
* `amount` is a decimal string, as in `transfers.send`; the draft keeps it
|
|
52
|
+
* in smallest units (`draft.amount`) beside `amountDecimal`.
|
|
53
|
+
*
|
|
54
|
+
* There is no idempotency key: a retry creates a second draft. After
|
|
55
|
+
* creation the author gets a push on their mobile devices (`data.type` is
|
|
56
|
+
* `transfer_draft_created`, with `draftId`); a failed push does not fail
|
|
57
|
+
* the call.
|
|
58
|
+
*/
|
|
59
|
+
create(input) {
|
|
60
|
+
return this.#http.request('POST', this.#base, { body: input });
|
|
61
|
+
}
|
|
62
|
+
/** Your own drafts, newest first. Keyset-paginated: `{items, nextCursor}`. */
|
|
63
|
+
list(params = {}) {
|
|
64
|
+
return this.#http.request('GET', this.#base, { query: { ...params } });
|
|
65
|
+
}
|
|
66
|
+
get(draftId) {
|
|
67
|
+
return this.#http.request('GET', `${this.#base}/${(0, http_js_1.seg)(draftId)}`);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Deletes a draft — softly: `draft` becomes `discarded`, and it can no
|
|
71
|
+
* longer be sent. Discarding one already discarded answers 200 with the
|
|
72
|
+
* same draft. Allowed in a web session.
|
|
73
|
+
*
|
|
74
|
+
* A draft a transfer was created from is 409 `TRANSFER_DRAFT_ALREADY_SENT`,
|
|
75
|
+
* with `details.transactionId`: discarding it does not undo the transfer.
|
|
76
|
+
* A transfer still awaiting signatures is withdrawn with
|
|
77
|
+
* `transfers.cancel()`. The same 409 comes back when the transfer exists
|
|
78
|
+
* but the draft is not marked `sent` yet — it is being sent from a phone
|
|
79
|
+
* right now, or that send broke off — and the mark is written then.
|
|
80
|
+
*/
|
|
81
|
+
discard(draftId) {
|
|
82
|
+
return this.#http.request('DELETE', `${this.#base}/${(0, http_js_1.seg)(draftId)}`);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Sends a draft: creates the transfer the same way `transfers.send` does —
|
|
86
|
+
* address right, token, amount, recipient, AML, policies, limits,
|
|
87
|
+
* signatures, reserve. Only the author can, and only from a session that may
|
|
88
|
+
* send money (see the class): a web login, or a browser of anyone but a
|
|
89
|
+
* platform administrator, gets 403 `WEB_SESSION_CANNOT_SIGN`. There is no
|
|
90
|
+
* body; the parameters come from the draft alone.
|
|
91
|
+
*
|
|
92
|
+
* The answer is exactly that of `transfers.send`, and so are its errors:
|
|
93
|
+
* `applied` (201), `pending` (202 — waiting for signatures, funds
|
|
94
|
+
* reserved) or `replayed` (200). Read the TSDoc of `TransfersResource` on
|
|
95
|
+
* what each means; the timeout caveats of a money path apply here too.
|
|
96
|
+
*
|
|
97
|
+
* A DRAFT IS SENT ONCE. The transfer's idempotency key is derived from the
|
|
98
|
+
* draft, so a repeated send — a double tap, a second phone, a retry after a
|
|
99
|
+
* broken connection — returns the SAME transfer as `replayed`, as it stands
|
|
100
|
+
* now, and never a second one. That holds after `failed` too: a transfer
|
|
101
|
+
* from a draft is not sent again; a new attempt is an ordinary transfer.
|
|
102
|
+
* `replayed` does not mean the money left — read
|
|
103
|
+
* `data.transaction.status`.
|
|
104
|
+
*
|
|
105
|
+
* A refusal before the transfer exists (policy, balance, unsatisfiable
|
|
106
|
+
* approval, token) leaves the draft a `draft`, to send later or discard.
|
|
107
|
+
* Once the transfer exists — `failed` after the gas station and 502
|
|
108
|
+
* `TRANSFER_OUTCOME_UNKNOWN` included — the draft is `sent` with
|
|
109
|
+
* `transactionId`. A discarded draft with no transfer is 409
|
|
110
|
+
* `TRANSFER_DRAFT_DISCARDED`.
|
|
111
|
+
*
|
|
112
|
+
* The token is resolved before the replay: if the draft's token was
|
|
113
|
+
* disabled after it was sent, a repeated send answers 400
|
|
114
|
+
* `TOKEN_NOT_FOUND` instead of the transfer. No new transfer is created
|
|
115
|
+
* either way; read it by the draft's `transactionId`.
|
|
116
|
+
*/
|
|
117
|
+
async send(draftId, options = {}) {
|
|
118
|
+
const res = await this.#http.requestRaw('POST', `${this.#base}/${(0, http_js_1.seg)(draftId)}/send`, {
|
|
119
|
+
...(options.signal === undefined ? {} : { signal: options.signal }),
|
|
120
|
+
...(options.timeoutMs === undefined ? {} : { timeoutMs: options.timeoutMs }),
|
|
121
|
+
});
|
|
122
|
+
return (0, gated_js_1.toGated)(res.status, res.data, {
|
|
123
|
+
replayOn200: true,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.TransferDraftsResource = TransferDraftsResource;
|
|
128
|
+
//# sourceMappingURL=transferDrafts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transferDrafts.js","sourceRoot":"","sources":["../../../src/resources/transferDrafts.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AAEtD,+CAAsD;AAqBtD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;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,kBAAkB,CAAA;IACjE,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,KAA8B;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAsB,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IACrF,CAAC;IAED,8EAA8E;IAC9E,IAAI,CAAC,MAAM,GAA6B,EAAE;QACxC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAqB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAA;IAC5F,CAAC;IAED,GAAG,CAAC,OAAe;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAsB,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,IAAA,aAAG,EAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IACxF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,OAAe;QACrB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAsB,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,IAAA,aAAG,EAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC3F,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,KAAK,CAAC,IAAI,CACR,OAAe,EACf,OAAO,GAAiD,EAAE;QAE1D,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CACrC,MAAM,EACN,GAAG,IAAI,CAAC,KAAK,IAAI,IAAA,aAAG,EAAC,OAAO,CAAC,OAAO,EACpC;YACE,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,CACF,CAAA;QACD,OAAO,IAAA,kBAAO,EAAmD,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE;YACrF,WAAW,EAAE,IAAI;SAClB,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -33,6 +33,14 @@ export interface VoteInput {
|
|
|
33
33
|
* administrator reconciles it;
|
|
34
34
|
* failed, rejected,
|
|
35
35
|
* cancelled — it did not leave.
|
|
36
|
+
*
|
|
37
|
+
* `send`, `vote` and `reconcile` move money or give a signature, and they are
|
|
38
|
+
* refused with 403 `WEB_SESSION_CANNOT_SIGN` to a session that may not: money
|
|
39
|
+
* is sent and signatures are given from the mobile app; from a browser only
|
|
40
|
+
* by a platform administrator; from a web login by nobody (the table is on
|
|
41
|
+
* `TransferDraftsResource`). A web client prepares a transfer with
|
|
42
|
+
* `transferDrafts.create()` instead. `cancel` of your own transfer is open to
|
|
43
|
+
* any session.
|
|
36
44
|
*/
|
|
37
45
|
export declare class TransfersResource {
|
|
38
46
|
#private;
|
|
@@ -49,6 +57,9 @@ export declare class TransfersResource {
|
|
|
49
57
|
* transfer stays `pending` with its funds reserved (`details.transactionId`).
|
|
50
58
|
* Retry it only with the SAME key — that returns the transfer without
|
|
51
59
|
* executing it again; a new key can send the money twice.
|
|
60
|
+
*
|
|
61
|
+
* A key beginning with `draft:` is refused with 400 `BAD_REQUEST`: the
|
|
62
|
+
* prefix is reserved for the transfers `transferDrafts.send()` creates.
|
|
52
63
|
*/
|
|
53
64
|
send(input: CreateTransferBody, options?: {
|
|
54
65
|
signal?: AbortSignal;
|
|
@@ -105,7 +116,10 @@ export declare class TransfersResource {
|
|
|
105
116
|
* Cancels your own transfer that is awaiting signatures and releases the
|
|
106
117
|
* reserve. A transfer already broadcast cannot be cancelled; administrators
|
|
107
118
|
* may cancel somebody else's, so a stuck request is not hostage to an
|
|
108
|
-
* absent initiator
|
|
119
|
+
* absent initiator — but cancelling someone else's is a "no" like a veto,
|
|
120
|
+
* so only from a session that may sign: an administrator from the mobile
|
|
121
|
+
* app, a platform administrator also from a browser. Otherwise 403
|
|
122
|
+
* `NOT_INITIATOR`. Your own is cancelled from any session.
|
|
109
123
|
*
|
|
110
124
|
* The resulting status is its own value, `cancelled` — not the `rejected`
|
|
111
125
|
* of a veto and not `failed`. Worth keeping apart in the interface: "you
|
|
@@ -117,7 +131,9 @@ export declare class TransfersResource {
|
|
|
117
131
|
*/
|
|
118
132
|
cancel(transferId: string): Promise<CancelResult>;
|
|
119
133
|
/**
|
|
120
|
-
* Settles a transfer nothing else can close.
|
|
134
|
+
* Settles a transfer nothing else can close. Platform administrators only,
|
|
135
|
+
* and not from a web-login session: 403 `WEB_SESSION_CANNOT_SIGN` (a browser
|
|
136
|
+
* or the mobile app is fine).
|
|
121
137
|
*
|
|
122
138
|
* pending — execution died, or its outcome is unknown (the
|
|
123
139
|
* send answered 502 `TRANSFER_OUTCOME_UNKNOWN`);
|
|
@@ -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,iBAAiB,EACjB,UAAU,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
|
|
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,iBAAiB,EACjB,UAAU,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,qBAAa,iBAAiB;;IAI5B,YAAY,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAG9C;IAED;;;;;;;;;;;;;;;OAeG;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;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAEhD;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,SAAS,CACP,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,qBAA0B,GAChC,OAAO,CAAC,uBAAuB,CAAC,CAMlC;CACF"}
|
|
@@ -31,6 +31,14 @@ const gated_js_1 = require("../core/gated.js");
|
|
|
31
31
|
* administrator reconciles it;
|
|
32
32
|
* failed, rejected,
|
|
33
33
|
* cancelled — it did not leave.
|
|
34
|
+
*
|
|
35
|
+
* `send`, `vote` and `reconcile` move money or give a signature, and they are
|
|
36
|
+
* refused with 403 `WEB_SESSION_CANNOT_SIGN` to a session that may not: money
|
|
37
|
+
* is sent and signatures are given from the mobile app; from a browser only
|
|
38
|
+
* by a platform administrator; from a web login by nobody (the table is on
|
|
39
|
+
* `TransferDraftsResource`). A web client prepares a transfer with
|
|
40
|
+
* `transferDrafts.create()` instead. `cancel` of your own transfer is open to
|
|
41
|
+
* any session.
|
|
34
42
|
*/
|
|
35
43
|
class TransfersResource {
|
|
36
44
|
#http;
|
|
@@ -51,6 +59,9 @@ class TransfersResource {
|
|
|
51
59
|
* transfer stays `pending` with its funds reserved (`details.transactionId`).
|
|
52
60
|
* Retry it only with the SAME key — that returns the transfer without
|
|
53
61
|
* executing it again; a new key can send the money twice.
|
|
62
|
+
*
|
|
63
|
+
* A key beginning with `draft:` is refused with 400 `BAD_REQUEST`: the
|
|
64
|
+
* prefix is reserved for the transfers `transferDrafts.send()` creates.
|
|
54
65
|
*/
|
|
55
66
|
async send(input, options = {}) {
|
|
56
67
|
const res = await this.#http.requestRaw('POST', this.#base, {
|
|
@@ -118,7 +129,10 @@ class TransfersResource {
|
|
|
118
129
|
* Cancels your own transfer that is awaiting signatures and releases the
|
|
119
130
|
* reserve. A transfer already broadcast cannot be cancelled; administrators
|
|
120
131
|
* may cancel somebody else's, so a stuck request is not hostage to an
|
|
121
|
-
* absent initiator
|
|
132
|
+
* absent initiator — but cancelling someone else's is a "no" like a veto,
|
|
133
|
+
* so only from a session that may sign: an administrator from the mobile
|
|
134
|
+
* app, a platform administrator also from a browser. Otherwise 403
|
|
135
|
+
* `NOT_INITIATOR`. Your own is cancelled from any session.
|
|
122
136
|
*
|
|
123
137
|
* The resulting status is its own value, `cancelled` — not the `rejected`
|
|
124
138
|
* of a veto and not `failed`. Worth keeping apart in the interface: "you
|
|
@@ -132,7 +146,9 @@ class TransfersResource {
|
|
|
132
146
|
return this.#http.request('POST', `${this.#base}/${(0, http_js_1.seg)(transferId)}/cancel`);
|
|
133
147
|
}
|
|
134
148
|
/**
|
|
135
|
-
* Settles a transfer nothing else can close.
|
|
149
|
+
* Settles a transfer nothing else can close. Platform administrators only,
|
|
150
|
+
* and not from a web-login session: 403 `WEB_SESSION_CANNOT_SIGN` (a browser
|
|
151
|
+
* or the mobile app is fine).
|
|
136
152
|
*
|
|
137
153
|
* pending — execution died, or its outcome is unknown (the
|
|
138
154
|
* send answered 502 `TRANSFER_OUTCOME_UNKNOWN`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfers.js","sourceRoot":"","sources":["../../../src/resources/transfers.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;A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OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAoB,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,IAAA,aAAG,EAAC,UAAU,CAAC,EAAE,CAAC,CAAA;IACzF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,IAAI,CAAC,UAAkB,EAAE,KAAgB;QACvC,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;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;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"}
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** SDK version, sent in the `user-agent` header. */
|
|
2
|
-
export declare const SDK_VERSION = "0.
|
|
2
|
+
export declare const SDK_VERSION = "0.3.1";
|
|
3
3
|
/** Default API base URL. */
|
|
4
4
|
export declare const DEFAULT_BASE_URL = "https://policy-engine-rest.ezig.workers.dev";
|
|
5
5
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/cjs/version.js
CHANGED
|
@@ -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.
|
|
5
|
+
exports.SDK_VERSION = '0.3.1';
|
|
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
|
package/dist/esm/client.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { RegistriesResource } from './resources/registries.js';
|
|
|
15
15
|
import { ReportsResource } from './resources/reports.js';
|
|
16
16
|
import { SharingResource } from './resources/sharing.js';
|
|
17
17
|
import { MeResource } from './resources/me.js';
|
|
18
|
+
import { TransferDraftsResource } from './resources/transferDrafts.js';
|
|
18
19
|
import { TransfersResource } from './resources/transfers.js';
|
|
19
20
|
/**
|
|
20
21
|
* Client for the V3 Finance Core API.
|
|
@@ -54,6 +55,7 @@ export interface VaultScope {
|
|
|
54
55
|
readonly code: string;
|
|
55
56
|
readonly addresses: AddressesResource;
|
|
56
57
|
readonly transfers: TransfersResource;
|
|
58
|
+
readonly transferDrafts: TransferDraftsResource;
|
|
57
59
|
readonly history: HistoryResource;
|
|
58
60
|
readonly balances: BalancesResource;
|
|
59
61
|
readonly approvals: ApprovalsResource;
|
package/dist/esm/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAO,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACpE,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,MAAM,EACN,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,aAAa,EACd,MAAM,sBAAsB,CAAA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@ import { RegistriesResource } from './resources/registries.js';
|
|
|
14
14
|
import { ReportsResource } from './resources/reports.js';
|
|
15
15
|
import { SharingResource } from './resources/sharing.js';
|
|
16
16
|
import { MeResource } from './resources/me.js';
|
|
17
|
+
import { TransferDraftsResource } from './resources/transferDrafts.js';
|
|
17
18
|
import { TransfersResource } from './resources/transfers.js';
|
|
18
19
|
import { DEFAULT_BASE_URL } from './version.js';
|
|
19
20
|
export class CoreClient {
|
|
@@ -34,6 +35,7 @@ export class CoreClient {
|
|
|
34
35
|
code,
|
|
35
36
|
addresses: new AddressesResource(this.http, code),
|
|
36
37
|
transfers: new TransfersResource(this.http, code),
|
|
38
|
+
transferDrafts: new TransferDraftsResource(this.http, code),
|
|
37
39
|
history: new HistoryResource(this.http, code),
|
|
38
40
|
balances: new BalancesResource(this.http, code),
|
|
39
41
|
approvals: new ApprovalsResource(this.http, code),
|
package/dist/esm/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAsB,MAAM,gBAAgB,CAAA;AAYpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,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AAK,EAAE,CAAC;QAE3E;;;;;;;;;;;;;;;;WAgBG;QACH,mBAAmB,EAAE,CAAC,IAAY,EAAE,IAAmB,EAA8B,EAAE,CACrF,IAAI,CAAC,IAAI,CAAC,OAAO,CACf,MAAM,EACN,kBAAkB,GAAG,CAAC,IAAI,CAAC,wBAAwB,EACnD,EAAE,IAAI,EAAE,CACT;QAEH;;;;;;WAMG;QACH,mBAAmB,EAAE,CAAC,IAAY,EAAE,IAAmB,EAA+B,EAAE,CACtF,IAAI,CAAC,IAAI,CAAC,OAAO,CACf,MAAM,EACN,kBAAkB,GAAG,CAAC,IAAI,CAAC,wBAAwB,EACnD,EAAE,IAAI,EAAE,CACT;KACJ,CAAA;IAED;;;;;;OAMG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAS,KAAK,EAAE,GAAG,CAAC,CAAA;IAC9C,CAAC;IAED,yDAAyD;IAChD,EAAE,CAAY;IAEvB,2EAA2E;IAClE,UAAU,CAAoB;IAEvC,qFAAqF;IAC5E,KAAK,CAAe;IAE7B,sEAAsE;IAC7D,IAAI,CAAc;CAC5B"}
|
package/dist/esm/core/gated.d.ts
CHANGED
|
@@ -54,11 +54,12 @@ export type Gated<TApplied, TPending = TApplied> = {
|
|
|
54
54
|
* of the two it is instead of the helper guessing.
|
|
55
55
|
*
|
|
56
56
|
* Which also means `outcome: 'replayed'` is UNREACHABLE for every gated
|
|
57
|
-
* method other than `transfers.send`: replay
|
|
58
|
-
* key, and the
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
57
|
+
* method other than `transfers.send` and `transferDrafts.send`: replay
|
|
58
|
+
* protection needs an idempotency key, and the API has one only on a
|
|
59
|
+
* transfer — taken from the transfer body, or derived from the draft when a
|
|
60
|
+
* draft is sent. The three-way `switch` in `docs/concepts.md` is right for a
|
|
61
|
+
* transfer; beside a counterparty edit its `case 'replayed'` is dead, and it
|
|
62
|
+
* is not evidence that such an edit can come back as a replay.
|
|
62
63
|
*/
|
|
63
64
|
export declare function toGated<TApplied, TPending>(status: number, data: unknown, options?: {
|
|
64
65
|
replayOn200?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gated.d.ts","sourceRoot":"","sources":["../../../src/core/gated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;AAE7D;;;;;;;;GAQG;AACH,MAAM,MAAM,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,IAC3C;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GACpF;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC/E;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAA;AAElF
|
|
1
|
+
{"version":3,"file":"gated.d.ts","sourceRoot":"","sources":["../../../src/core/gated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;AAE7D;;;;;;;;GAQG;AACH,MAAM,MAAM,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,IAC3C;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GACpF;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC/E;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAA;AAElF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,QAAQ,EACxC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GACtC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAgB3B;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAC5B,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GACb,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;IAAE,OAAO,EAAE,SAAS,GAAG,UAAU,CAAA;CAAE,CAAC,CAEhE;AAED,yEAAyE;AACzE,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAC5B,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GACb,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;IAAE,OAAO,EAAE,SAAS,CAAA;CAAE,CAAC,CAEnD"}
|
package/dist/esm/core/gated.js
CHANGED
|
@@ -31,11 +31,12 @@
|
|
|
31
31
|
* of the two it is instead of the helper guessing.
|
|
32
32
|
*
|
|
33
33
|
* Which also means `outcome: 'replayed'` is UNREACHABLE for every gated
|
|
34
|
-
* method other than `transfers.send`: replay
|
|
35
|
-
* key, and the
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
34
|
+
* method other than `transfers.send` and `transferDrafts.send`: replay
|
|
35
|
+
* protection needs an idempotency key, and the API has one only on a
|
|
36
|
+
* transfer — taken from the transfer body, or derived from the draft when a
|
|
37
|
+
* draft is sent. The three-way `switch` in `docs/concepts.md` is right for a
|
|
38
|
+
* transfer; beside a counterparty edit its `case 'replayed'` is dead, and it
|
|
39
|
+
* is not evidence that such an edit can come back as a replay.
|
|
39
40
|
*/
|
|
40
41
|
export function toGated(status, data, options = {}) {
|
|
41
42
|
switch (status) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gated.js","sourceRoot":"","sources":["../../../src/core/gated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAkBH
|
|
1
|
+
{"version":3,"file":"gated.js","sourceRoot":"","sources":["../../../src/core/gated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAkBH;;;;;;;;;;;;;;;;;GAiBG;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,EAAE,CAAA;QACjE,KAAK,GAAG;YACN,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAgB,EAAE,CAAA;QACpE,KAAK,GAAG;YACN,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAgB,EAAE,CAAA;QACpE;YACE,MAAM,IAAI,KAAK,CACb,kDAAkD,MAAM,IAAI;gBAC1D,yDAAyD,CAC5D,CAAA;IACL,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CACvB,CAAc;IAEd,OAAO,CAAC,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO,KAAK,UAAU,CAAA;AAC5D,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,SAAS,CACvB,CAAc;IAEd,OAAO,CAAC,CAAC,OAAO,KAAK,SAAS,CAAA;AAChC,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Keyset pagination — for the
|
|
2
|
+
* Keyset pagination — for the twelve endpoints that have it.
|
|
3
3
|
*
|
|
4
4
|
* "Every list returns `{items, nextCursor}`" is what this file used to claim,
|
|
5
5
|
* and it is not what the API does. Counted over the spec snapshot
|
|
6
6
|
* (`openapi/spec.json`), the reading endpoints fall into three shapes:
|
|
7
7
|
*
|
|
8
|
-
* •
|
|
8
|
+
* • 12 GETs take `cursor`/`limit` and answer a `nextCursor` — addresses,
|
|
9
9
|
* history, approval requests, members, counterparties, counterparty
|
|
10
10
|
* groups, operation categories, operation relations, ledger entries, a
|
|
11
|
-
* vault's policies, balances. These are what `paginate`
|
|
11
|
+
* vault's policies, balances, transfer drafts. These are what `paginate`
|
|
12
|
+
* is for;
|
|
12
13
|
* • 18 answer `{items}` with NO cursor parameter at all — folders and their
|
|
13
14
|
* grants, address shares, shared-with-me / shared-by-me, visibility
|
|
14
15
|
* grants, category assignments and their versions, report templates and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/core/pagination.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/core/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,MAAM,WAAW,IAAI,CAAC,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,CAAA;IACnB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CACnC;AAED,MAAM,WAAW,UAAU;IACzB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED;;;;;;;;;GASG;AACH,wBAAuB,QAAQ,CAAC,CAAC,EAC/B,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EACnD,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAClD,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAmCpC;AAED,uEAAuE;AACvE,wBAAsB,UAAU,CAAC,CAAC,EAChC,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EACnD,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAClD,OAAO,CAAC,CAAC,EAAE,CAAC,CAId"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Keyset pagination — for the
|
|
2
|
+
* Keyset pagination — for the twelve endpoints that have it.
|
|
3
3
|
*
|
|
4
4
|
* "Every list returns `{items, nextCursor}`" is what this file used to claim,
|
|
5
5
|
* and it is not what the API does. Counted over the spec snapshot
|
|
6
6
|
* (`openapi/spec.json`), the reading endpoints fall into three shapes:
|
|
7
7
|
*
|
|
8
|
-
* •
|
|
8
|
+
* • 12 GETs take `cursor`/`limit` and answer a `nextCursor` — addresses,
|
|
9
9
|
* history, approval requests, members, counterparties, counterparty
|
|
10
10
|
* groups, operation categories, operation relations, ledger entries, a
|
|
11
|
-
* vault's policies, balances. These are what `paginate`
|
|
11
|
+
* vault's policies, balances, transfer drafts. These are what `paginate`
|
|
12
|
+
* is for;
|
|
12
13
|
* • 18 answer `{items}` with NO cursor parameter at all — folders and their
|
|
13
14
|
* grants, address shares, shared-with-me / shared-by-me, visibility
|
|
14
15
|
* grants, category assignments and their versions, report templates and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../src/core/pagination.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../src/core/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAcH;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,QAAQ,CAC7B,SAAmD,EACnD,OAAO,GAA0C,EAAE;IAEnD,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAA;IACzC,IAAI,MAA0B,CAAA;IAC9B,IAAI,IAAI,GAAG,CAAC,CAAA;IAEZ,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;QAC3C,MAAM,MAAM,GAAY,MAAM,SAAS,CAAC;YACtC,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;YAChE,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;SAC5C,CAAC,CAAA;QACF,2EAA2E;QAC3E,sEAAsE;QACtE,4DAA4D;QAC5D,IA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