@hsuite/smart-engines-cli 1.9.0 → 2.1.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.
- package/README.md +4 -2
- package/dist/_lib/cluster-convergence.d.ts.map +1 -1
- package/dist/_lib/cluster-convergence.js +1 -1
- package/dist/_lib/cluster-convergence.js.map +1 -1
- package/dist/_lib/deposit-verification.d.ts +91 -0
- package/dist/_lib/deposit-verification.d.ts.map +1 -0
- package/dist/_lib/deposit-verification.js +265 -0
- package/dist/_lib/deposit-verification.js.map +1 -0
- package/dist/_lib/env.d.ts.map +1 -1
- package/dist/_lib/env.js +9 -7
- package/dist/_lib/env.js.map +1 -1
- package/dist/_lib/error-message.d.ts +7 -0
- package/dist/_lib/error-message.d.ts.map +1 -0
- package/dist/_lib/error-message.js +21 -0
- package/dist/_lib/error-message.js.map +1 -0
- package/dist/_lib/order-deadline.d.ts +23 -0
- package/dist/_lib/order-deadline.d.ts.map +1 -1
- package/dist/_lib/order-deadline.js +40 -6
- package/dist/_lib/order-deadline.js.map +1 -1
- package/dist/_lib/payment-guard.d.ts +59 -0
- package/dist/_lib/payment-guard.d.ts.map +1 -0
- package/dist/_lib/payment-guard.js +188 -0
- package/dist/_lib/payment-guard.js.map +1 -0
- package/dist/_lib/payment-lock.d.ts +27 -0
- package/dist/_lib/payment-lock.d.ts.map +1 -0
- package/dist/_lib/payment-lock.js +199 -0
- package/dist/_lib/payment-lock.js.map +1 -0
- package/dist/_lib/payment-record.d.ts +76 -0
- package/dist/_lib/payment-record.d.ts.map +1 -0
- package/dist/_lib/payment-record.js +84 -0
- package/dist/_lib/payment-record.js.map +1 -0
- package/dist/_lib/runtime-env.d.ts.map +1 -1
- package/dist/_lib/runtime-env.js +5 -0
- package/dist/_lib/runtime-env.js.map +1 -1
- package/dist/_lib/subscription-client.d.ts +192 -15
- package/dist/_lib/subscription-client.d.ts.map +1 -1
- package/dist/_lib/subscription-client.js +44 -2
- package/dist/_lib/subscription-client.js.map +1 -1
- package/dist/_lib/swap-payment.d.ts +54 -0
- package/dist/_lib/swap-payment.d.ts.map +1 -0
- package/dist/_lib/swap-payment.js +203 -0
- package/dist/_lib/swap-payment.js.map +1 -0
- package/dist/_lib/xrp-payment.d.ts +48 -0
- package/dist/_lib/xrp-payment.d.ts.map +1 -0
- package/dist/_lib/xrp-payment.js +117 -0
- package/dist/_lib/xrp-payment.js.map +1 -0
- package/dist/_lib/xrpl-login-signer.d.ts +16 -1
- package/dist/_lib/xrpl-login-signer.d.ts.map +1 -1
- package/dist/_lib/xrpl-login-signer.js +25 -1
- package/dist/_lib/xrpl-login-signer.js.map +1 -1
- package/dist/commands/billing.d.ts +5 -3
- package/dist/commands/billing.d.ts.map +1 -1
- package/dist/commands/billing.js +12 -6
- package/dist/commands/billing.js.map +1 -1
- package/dist/commands/deploy.d.ts +1 -1
- package/dist/commands/deploy.js +2 -2
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/faucet.d.ts +1 -1
- package/dist/commands/faucet.d.ts.map +1 -1
- package/dist/commands/faucet.js +2 -7
- package/dist/commands/faucet.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +4 -2
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/redeploy.d.ts +4 -3
- package/dist/commands/redeploy.d.ts.map +1 -1
- package/dist/commands/redeploy.js +5 -4
- package/dist/commands/redeploy.js.map +1 -1
- package/dist/commands/renew.d.ts +47 -4
- package/dist/commands/renew.d.ts.map +1 -1
- package/dist/commands/renew.js +338 -9
- package/dist/commands/renew.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +22 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/subscribe.d.ts +39 -3
- package/dist/commands/subscribe.d.ts.map +1 -1
- package/dist/commands/subscribe.js +424 -110
- package/dist/commands/subscribe.js.map +1 -1
- package/dist/commands/topup.d.ts +33 -7
- package/dist/commands/topup.d.ts.map +1 -1
- package/dist/commands/topup.js +148 -16
- package/dist/commands/topup.js.map +1 -1
- package/dist/commands/upgrade.d.ts +7 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +35 -5
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +8 -2
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +9 -9
- package/dist/__tests__/helpers/fixtures-image-hygiene.d.ts +0 -18
- package/dist/__tests__/helpers/fixtures-image-hygiene.d.ts.map +0 -1
- package/dist/__tests__/helpers/fixtures-image-hygiene.js +0 -42
- package/dist/__tests__/helpers/fixtures-image-hygiene.js.map +0 -1
- package/dist/__tests__/helpers/fixtures.d.ts +0 -48
- package/dist/__tests__/helpers/fixtures.d.ts.map +0 -1
- package/dist/__tests__/helpers/fixtures.js +0 -79
- package/dist/__tests__/helpers/fixtures.js.map +0 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `hsuite subscribe` remembers about the deposit payment it sent (#3917 item 3, #3813).
|
|
3
|
+
*
|
|
4
|
+
* The CLI's guard before paying used to compare the deposit account's HST BALANCE with the quote.
|
|
5
|
+
* A balance says nothing about WHICH payment is in it: a payment the platform has not counted yet,
|
|
6
|
+
* made at an earlier price, followed by a requote at a higher price, left the balance short of the
|
|
7
|
+
* new ask and the CLI paid in full a second time. So the CLI records the hash of the payment it is
|
|
8
|
+
* about to submit (`SUBSCRIPTION_PENDING_PAYMENT=<appId>@<tx hash>@<LastLedgerSequence>` in the env
|
|
9
|
+
* file, written BEFORE the blob leaves the process — as the pending-create record is, #3766) and,
|
|
10
|
+
* on resume, asks the ledger what became of THAT transaction. This module holds the pure parts: the
|
|
11
|
+
* record's format and the classification of the ledger's answer.
|
|
12
|
+
*/
|
|
13
|
+
/** The env key that records the deposit payment `hsuite subscribe` sent for an entity. */
|
|
14
|
+
export declare const PENDING_PAYMENT_KEY = "SUBSCRIPTION_PENDING_PAYMENT";
|
|
15
|
+
/**
|
|
16
|
+
* The env key that records the credit payment `hsuite topup` sent for an entity (#3917 item 5).
|
|
17
|
+
* Its own slot, in the same format: a top-up must not read a deposit payment `subscribe` could not
|
|
18
|
+
* clear, nor the other way round.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PENDING_TOPUP_PAYMENT_KEY = "SUBSCRIPTION_PENDING_TOPUP_PAYMENT";
|
|
21
|
+
/**
|
|
22
|
+
* The env key that records the renewal payment `hsuite renew --pay-with` sent for an entity (#3699). Its own slot,
|
|
23
|
+
* in the same format: a renewal must not read a deposit or a credit payment it could not clear. It is cleared once
|
|
24
|
+
* the platform has extended the period, so next year's renewal is not refused by this year's payment.
|
|
25
|
+
*/
|
|
26
|
+
export declare const PENDING_RENEW_PAYMENT_KEY = "SUBSCRIPTION_PENDING_RENEW_PAYMENT";
|
|
27
|
+
export type PendingPayment = {
|
|
28
|
+
appId: string;
|
|
29
|
+
/** `hashSignedTx` of the signed blob: 64 upper-case hex characters. */
|
|
30
|
+
txHash: string;
|
|
31
|
+
/** The last ledger the transaction can validate in; absent when the blob carried none. */
|
|
32
|
+
lastLedgerSequence?: number;
|
|
33
|
+
};
|
|
34
|
+
export declare function formatPendingPayment(p: PendingPayment): string;
|
|
35
|
+
/**
|
|
36
|
+
* `<appId>@<tx hash>@<LastLedgerSequence or empty>` → the record, or `undefined` for anything else.
|
|
37
|
+
* Strict on purpose: the hash is sent to the ledger and printed into advice, and the sequence
|
|
38
|
+
* decides whether a payment may be sent again, so neither is read by `Number()`'s lenient rules.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parsePendingPayment(raw: string): PendingPayment | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* How far behind its `LastLedgerSequence` a transaction can sit in a ledger: autofill sets
|
|
43
|
+
* LLS = the current ledger + a small buffer, so the payment cannot be in a ledger older than
|
|
44
|
+
* `LLS - 256`. The `tx` lookup searches exactly `[LLS - 256, LLS]`, which is what lets a
|
|
45
|
+
* `txnNotFound` answer mean "not in any ledger it could have been in" (`searched_all`).
|
|
46
|
+
*/
|
|
47
|
+
export declare const LLS_HISTORY_WINDOW = 256;
|
|
48
|
+
/**
|
|
49
|
+
* What the ledger says became of a recorded payment:
|
|
50
|
+
* - `delivered`: validated `tesSUCCESS` — the HST is in the deposit account;
|
|
51
|
+
* - `failed`: validated with a readable non-success result — nothing was delivered, paying again
|
|
52
|
+
* is safe;
|
|
53
|
+
* - `never-landed`: the server searched the whole `[LLS - 256, LLS]` range and did not find it,
|
|
54
|
+
* and the validated ledger is past `LastLedgerSequence`, so it can never validate — paying
|
|
55
|
+
* again is safe;
|
|
56
|
+
* - `pending`: anything that could still turn into a delivery, or that cannot be read (found but
|
|
57
|
+
* not validated; validated with no readable result; not found while it still could be, or
|
|
58
|
+
* not found by a server that did not search the whole range). Paying again could pay twice.
|
|
59
|
+
*/
|
|
60
|
+
export type RecordedPaymentVerdict = 'delivered' | 'failed' | 'never-landed' | 'pending';
|
|
61
|
+
/**
|
|
62
|
+
* What a `tx` lookup came back with. `{ found: false }` is the ledger's `txnNotFound`;
|
|
63
|
+
* `searchedAll` is its `searched_all`: true only when the server held every ledger in the range
|
|
64
|
+
* asked for (a pruned or partial-history server answers the same `txnNotFound` for a payment that
|
|
65
|
+
* DID validate).
|
|
66
|
+
*/
|
|
67
|
+
export type TxLookup = {
|
|
68
|
+
found: true;
|
|
69
|
+
validated: boolean;
|
|
70
|
+
result?: string;
|
|
71
|
+
} | {
|
|
72
|
+
found: false;
|
|
73
|
+
searchedAll: boolean;
|
|
74
|
+
};
|
|
75
|
+
export declare function classifyRecordedPayment(lookup: TxLookup, payment: Pick<PendingPayment, 'lastLedgerSequence'>, validatedLedger: number | undefined): RecordedPaymentVerdict;
|
|
76
|
+
//# sourceMappingURL=payment-record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-record.d.ts","sourceRoot":"","sources":["../../src/_lib/payment-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,0FAA0F;AAC1F,eAAO,MAAM,mBAAmB,iCAAiC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,uCAAuC,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,uCAAuC,CAAC;AAE9E,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,0FAA0F;IAC1F,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAOF,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,cAAc,GAAG,MAAM,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAS3E;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,sBAAsB,GAAG,WAAW,GAAG,QAAQ,GAAG,cAAc,GAAG,SAAS,CAAC;AAEzF;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAChB;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3C,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,oBAAoB,CAAC,EACnD,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,sBAAsB,CAiBxB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* What `hsuite subscribe` remembers about the deposit payment it sent (#3917 item 3, #3813).
|
|
4
|
+
*
|
|
5
|
+
* The CLI's guard before paying used to compare the deposit account's HST BALANCE with the quote.
|
|
6
|
+
* A balance says nothing about WHICH payment is in it: a payment the platform has not counted yet,
|
|
7
|
+
* made at an earlier price, followed by a requote at a higher price, left the balance short of the
|
|
8
|
+
* new ask and the CLI paid in full a second time. So the CLI records the hash of the payment it is
|
|
9
|
+
* about to submit (`SUBSCRIPTION_PENDING_PAYMENT=<appId>@<tx hash>@<LastLedgerSequence>` in the env
|
|
10
|
+
* file, written BEFORE the blob leaves the process — as the pending-create record is, #3766) and,
|
|
11
|
+
* on resume, asks the ledger what became of THAT transaction. This module holds the pure parts: the
|
|
12
|
+
* record's format and the classification of the ledger's answer.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LLS_HISTORY_WINDOW = exports.PENDING_RENEW_PAYMENT_KEY = exports.PENDING_TOPUP_PAYMENT_KEY = exports.PENDING_PAYMENT_KEY = void 0;
|
|
16
|
+
exports.formatPendingPayment = formatPendingPayment;
|
|
17
|
+
exports.parsePendingPayment = parsePendingPayment;
|
|
18
|
+
exports.classifyRecordedPayment = classifyRecordedPayment;
|
|
19
|
+
/** The env key that records the deposit payment `hsuite subscribe` sent for an entity. */
|
|
20
|
+
exports.PENDING_PAYMENT_KEY = 'SUBSCRIPTION_PENDING_PAYMENT';
|
|
21
|
+
/**
|
|
22
|
+
* The env key that records the credit payment `hsuite topup` sent for an entity (#3917 item 5).
|
|
23
|
+
* Its own slot, in the same format: a top-up must not read a deposit payment `subscribe` could not
|
|
24
|
+
* clear, nor the other way round.
|
|
25
|
+
*/
|
|
26
|
+
exports.PENDING_TOPUP_PAYMENT_KEY = 'SUBSCRIPTION_PENDING_TOPUP_PAYMENT';
|
|
27
|
+
/**
|
|
28
|
+
* The env key that records the renewal payment `hsuite renew --pay-with` sent for an entity (#3699). Its own slot,
|
|
29
|
+
* in the same format: a renewal must not read a deposit or a credit payment it could not clear. It is cleared once
|
|
30
|
+
* the platform has extended the period, so next year's renewal is not refused by this year's payment.
|
|
31
|
+
*/
|
|
32
|
+
exports.PENDING_RENEW_PAYMENT_KEY = 'SUBSCRIPTION_PENDING_RENEW_PAYMENT';
|
|
33
|
+
/** An entity id as the CLI saves it (`SUBSCRIPTION_APP_ID`): no `@`, so the record splits unambiguously. */
|
|
34
|
+
const APP_ID = /^[A-Za-z0-9._-]{1,128}$/;
|
|
35
|
+
const TX_HASH = /^[0-9A-F]{64}$/;
|
|
36
|
+
const LEDGER_SEQUENCE = /^\d{1,10}$/;
|
|
37
|
+
function formatPendingPayment(p) {
|
|
38
|
+
return `${p.appId}@${p.txHash}@${p.lastLedgerSequence ?? ''}`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* `<appId>@<tx hash>@<LastLedgerSequence or empty>` → the record, or `undefined` for anything else.
|
|
42
|
+
* Strict on purpose: the hash is sent to the ledger and printed into advice, and the sequence
|
|
43
|
+
* decides whether a payment may be sent again, so neither is read by `Number()`'s lenient rules.
|
|
44
|
+
*/
|
|
45
|
+
function parsePendingPayment(raw) {
|
|
46
|
+
const parts = raw.trim().split('@');
|
|
47
|
+
if (parts.length !== 3)
|
|
48
|
+
return undefined;
|
|
49
|
+
const [appId, hash, sequence] = parts;
|
|
50
|
+
const txHash = hash.toUpperCase();
|
|
51
|
+
if (!APP_ID.test(appId) || !TX_HASH.test(txHash))
|
|
52
|
+
return undefined;
|
|
53
|
+
if (sequence === '')
|
|
54
|
+
return { appId, txHash };
|
|
55
|
+
if (!LEDGER_SEQUENCE.test(sequence))
|
|
56
|
+
return undefined;
|
|
57
|
+
return { appId, txHash, lastLedgerSequence: Number(sequence) };
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* How far behind its `LastLedgerSequence` a transaction can sit in a ledger: autofill sets
|
|
61
|
+
* LLS = the current ledger + a small buffer, so the payment cannot be in a ledger older than
|
|
62
|
+
* `LLS - 256`. The `tx` lookup searches exactly `[LLS - 256, LLS]`, which is what lets a
|
|
63
|
+
* `txnNotFound` answer mean "not in any ledger it could have been in" (`searched_all`).
|
|
64
|
+
*/
|
|
65
|
+
exports.LLS_HISTORY_WINDOW = 256;
|
|
66
|
+
function classifyRecordedPayment(lookup, payment, validatedLedger) {
|
|
67
|
+
if (lookup.found) {
|
|
68
|
+
if (!lookup.validated)
|
|
69
|
+
return 'pending';
|
|
70
|
+
// A validated transaction whose result cannot be read may be a success.
|
|
71
|
+
if (lookup.result === undefined)
|
|
72
|
+
return 'pending';
|
|
73
|
+
return lookup.result === 'tesSUCCESS' ? 'delivered' : 'failed';
|
|
74
|
+
}
|
|
75
|
+
const { lastLedgerSequence } = payment;
|
|
76
|
+
if (lookup.searchedAll &&
|
|
77
|
+
lastLedgerSequence !== undefined &&
|
|
78
|
+
validatedLedger !== undefined &&
|
|
79
|
+
validatedLedger > lastLedgerSequence) {
|
|
80
|
+
return 'never-landed';
|
|
81
|
+
}
|
|
82
|
+
return 'pending';
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=payment-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-record.js","sourceRoot":"","sources":["../../src/_lib/payment-record.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAgCH,oDAEC;AAOD,kDASC;AAkCD,0DAqBC;AAvGD,0FAA0F;AAC7E,QAAA,mBAAmB,GAAG,8BAA8B,CAAC;AAElE;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,oCAAoC,CAAC;AAE9E;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,oCAAoC,CAAC;AAU9E,4GAA4G;AAC5G,MAAM,MAAM,GAAG,yBAAyB,CAAC;AACzC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AACjC,MAAM,eAAe,GAAG,YAAY,CAAC;AAErC,SAAgB,oBAAoB,CAAC,CAAiB;IACpD,OAAO,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,IAAI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AC;IACvC,IACE,MAAM,CAAC,WAAW;QAClB,kBAAkB,KAAK,SAAS;QAChC,eAAe,KAAK,SAAS;QAC7B,eAAe,GAAG,kBAAkB,EACpC,CAAC;QACD,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-env.d.ts","sourceRoot":"","sources":["../../src/_lib/runtime-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"runtime-env.d.ts","sourceRoot":"","sources":["../../src/_lib/runtime-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAiBjD,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAAkB,CAAC;AAE3E,MAAM,WAAW,sBAAsB;IACrC,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAWD;;;;;;GAMG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,SAAS,MAAM,EAAE;CAWvC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,sBAAsB,GAC5B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA6CxB"}
|
package/dist/_lib/runtime-env.js
CHANGED
|
@@ -20,6 +20,11 @@ exports.NON_FORWARDED_KEYS = new Set([
|
|
|
20
20
|
// `hsuite subscribe`'s own bookkeeping (#3766): an unfinished entity create. Meaningless to the
|
|
21
21
|
// app, and not the developer's to ship into a running container's environment.
|
|
22
22
|
'SUBSCRIPTION_PENDING_CREATE',
|
|
23
|
+
// Likewise (#3917): the hash of the deposit payment `subscribe` last signed, kept until the
|
|
24
|
+
// platform credits it so a re-priced quote is never paid over it.
|
|
25
|
+
'SUBSCRIPTION_PENDING_PAYMENT',
|
|
26
|
+
// And the same for `hsuite topup`'s credit payment (#3917 item 5).
|
|
27
|
+
'SUBSCRIPTION_PENDING_TOPUP_PAYMENT',
|
|
23
28
|
]);
|
|
24
29
|
/**
|
|
25
30
|
* Keys whose presence lets the deployed app authenticate as the developer's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-env.js","sourceRoot":"","sources":["../../src/_lib/runtime-env.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"runtime-env.js","sourceRoot":"","sources":["../../src/_lib/runtime-env.ts"],"names":[],"mappings":";;;AAoJA,8CA+CC;AA/JD;;;;;GAKG;AACU,QAAA,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IAC7D,6EAA6E;IAC7E,+EAA+E;IAC/E,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,kEAAkE;IAClE,UAAU;IACV,gBAAgB;IAChB,gGAAgG;IAChG,+EAA+E;IAC/E,6BAA6B;IAC7B,4FAA4F;IAC5F,kEAAkE;IAClE,8BAA8B;IAC9B,mEAAmE;IACnE,oCAAoC;CACrC,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACU,QAAA,0BAA0B,GAAsB,CAAC,WAA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AM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACrD,IAAI,IAAI,IAAI,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;YACpC,IAAI,CACF,kDAAkD,GAAG,sBAAsB;gBACzE,kEAAkE;gBAClE,kEAAkE;gBAClE,mCAAmC,CACtC,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;IACpB,CAAC;IAED,4DAA4D;IAC5D,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,OAAO,GAAG,kCAA0B,CAAC,MAAM,CAC/C,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,CACnD,CAAC;QACF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -51,6 +51,12 @@ export type DepositInstructions = {
|
|
|
51
51
|
orderId?: string;
|
|
52
52
|
/** #3699 — the order's locked quote expiry (deadline display comes in PR1b). */
|
|
53
53
|
expiresAt?: string;
|
|
54
|
+
/**
|
|
55
|
+
* #4081 — present ONLY on the answer to a repeated `request` for a subscription still awaiting its deposit:
|
|
56
|
+
* whether `expiresAt` had already passed on the validator's clock. The validator requotes a lapsed order itself, so
|
|
57
|
+
* `true` means it could not and these are the lapsed quote's instructions.
|
|
58
|
+
*/
|
|
59
|
+
expired?: boolean;
|
|
54
60
|
/** #3699 — the CSPRNG tag the auto-pay Payment must carry so PR1b's
|
|
55
61
|
* `account_tx` matcher (never bare `Amount`) can find it. */
|
|
56
62
|
destinationTag?: number;
|
|
@@ -63,6 +69,70 @@ export type DepositInstructions = {
|
|
|
63
69
|
priceUsd?: number;
|
|
64
70
|
/** #3699 — the locked HSUITE smallest-units due. */
|
|
65
71
|
hsuiteDue?: string;
|
|
72
|
+
/**
|
|
73
|
+
* #3699 PR2 — present ONLY for an order priced in XRP: pay THIS (XRP drops to `address`, carrying the tag)
|
|
74
|
+
* instead of the HST `amount`, which then describes what the deposit account holds once the platform has
|
|
75
|
+
* converted the XRP.
|
|
76
|
+
*/
|
|
77
|
+
pay?: {
|
|
78
|
+
asset: string;
|
|
79
|
+
amount: string;
|
|
80
|
+
address: string;
|
|
81
|
+
destinationTag: number;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* #3699 PR3 — present ONLY for an order paid through a swap provider (BTC, ETH, ...): what the BUILDER sends,
|
|
85
|
+
* and where. This CLI cannot spend those assets and never tries: it prints this and stops. There is no `pay`
|
|
86
|
+
* block with it, and the HST fields above describe what the deposit account ends up holding once the provider
|
|
87
|
+
* has landed the XRP and the platform has converted it.
|
|
88
|
+
*/
|
|
89
|
+
swap?: SwapPaymentInstruction;
|
|
90
|
+
/**
|
|
91
|
+
* #3699 pre-arming item 4 — `true` when this plain XRP order (`pay`) is the REMAINDER of a swap order: what is still
|
|
92
|
+
* owed after the swap's XRP reached the deposit account short. The builder chose to pay in another asset, so this CLI
|
|
93
|
+
* prints the instruction and stops unless the builder asks it to pay XRP (`--pay-with xrp`).
|
|
94
|
+
*/
|
|
95
|
+
swapRemainder?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* #3699 pre-arming item 4 — with `swapRemainder`: the order's status when this was answered. `paid` / `converting`
|
|
98
|
+
* mean the remainder has been counted and is being converted: nothing is left to send.
|
|
99
|
+
*/
|
|
100
|
+
orderStatus?: string;
|
|
101
|
+
};
|
|
102
|
+
/** What to send to the swap provider (#3699 PR3); see {@link DepositInstructions.swap}. */
|
|
103
|
+
export type SwapPaymentInstruction = {
|
|
104
|
+
provider: string;
|
|
105
|
+
exchangeId: string;
|
|
106
|
+
/** The source asset's ticker, upper case ('BTC'). */
|
|
107
|
+
asset: string;
|
|
108
|
+
/** The network it is sent on ('btc', 'trx'). */
|
|
109
|
+
network: string;
|
|
110
|
+
/** How much to send, a plain decimal in the asset's own units. */
|
|
111
|
+
amount: string;
|
|
112
|
+
/** The provider's deposit address. */
|
|
113
|
+
payinAddress: string;
|
|
114
|
+
/** The memo the payment must carry, for an asset that uses one. */
|
|
115
|
+
payinExtraId?: string;
|
|
116
|
+
/** The provider holds this price until then (ISO time). */
|
|
117
|
+
validUntil: string;
|
|
118
|
+
/** Where the provider returns the funds if the exchange cannot complete: the builder's own. */
|
|
119
|
+
refundAddress: string;
|
|
120
|
+
refundExtraId?: string;
|
|
121
|
+
/** The XRP the exchange lands on the deposit account (a plain decimal). */
|
|
122
|
+
toAmountXrp: string;
|
|
123
|
+
/** The order's status: `paid` / `converting` mean the payout has landed and the platform is converting it. */
|
|
124
|
+
status?: string;
|
|
125
|
+
};
|
|
126
|
+
/** One entry of `GET /api/v3/subscription/payment-assets` (#3699 PR3). */
|
|
127
|
+
export type PaymentAssetOption = {
|
|
128
|
+
symbol: string;
|
|
129
|
+
kind: 'native' | 'swap';
|
|
130
|
+
chain: string;
|
|
131
|
+
network?: string;
|
|
132
|
+
name?: string;
|
|
133
|
+
provider?: string;
|
|
134
|
+
/** The asset's refund addresses take a memo, which `--refund-extra-id` must then carry. */
|
|
135
|
+
refundExtraIdRequired?: boolean;
|
|
66
136
|
};
|
|
67
137
|
/**
|
|
68
138
|
* Canonical `ValidatorRules` block — what the validator's mandatory creation
|
|
@@ -99,21 +169,39 @@ export type CreateAppPayload = {
|
|
|
99
169
|
tier: string;
|
|
100
170
|
networks: string[];
|
|
101
171
|
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* now ALWAYS sends the exact rule it signed the intent over (#3506 A3) — see
|
|
106
|
-
* `buildDefaultSmartAppValidatorRules` in `@hsuite/smart-engines-sdk`.
|
|
172
|
+
* The exact rule the intent signs. Required by the validator (#3632): it no
|
|
173
|
+
* longer synthesizes a default, so `hsuite subscribe` sends
|
|
174
|
+
* `buildDefaultSmartAppValidatorRules()` from `@hsuite/smart-engines-sdk`.
|
|
107
175
|
*/
|
|
108
|
-
validatorRules
|
|
176
|
+
validatorRules: ValidatorRules;
|
|
109
177
|
/**
|
|
110
178
|
* The requestor-signed proof (#3506 A3) binding this create to `validatorRules`
|
|
111
|
-
* and to a leader-independent `entityId
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
|
|
179
|
+
* and to a leader-independent `entityId`. Required by the validator (#3632):
|
|
180
|
+
* a create without it is refused (400), and every responder withholds an
|
|
181
|
+
* intent-less smart-app.
|
|
182
|
+
*/
|
|
183
|
+
creationIntent: CreationIntentProof;
|
|
184
|
+
/**
|
|
185
|
+
* The DEVELOPER's signed create intent for the subscription's deposit wallet (#3506 A2c):
|
|
186
|
+
* app-bound (v2) to the smart-app's own intent-derived entityId, signing the canonical
|
|
187
|
+
* `subscription` deposit rule. Required by the validator: it checks it before the smart-app's
|
|
188
|
+
* DKG runs, so a bad one is a 400 with nothing created.
|
|
189
|
+
*/
|
|
190
|
+
depositCreationIntent: CreationIntentProof;
|
|
191
|
+
/**
|
|
192
|
+
* #3699 PR2 — the asset to pay the subscription in (a symbol; omitted = HSUITE). `hsuite subscribe
|
|
193
|
+
* --pay-with xrp` sends `'XRP'`; the validator answers with `depositInstructions.pay` (XRP drops, with
|
|
194
|
+
* the order's tag) or refuses (`xrp_quote_unavailable:`, or "not yet supported" when XRP payments are off).
|
|
115
195
|
*/
|
|
116
|
-
|
|
196
|
+
paymentAsset?: string;
|
|
197
|
+
/**
|
|
198
|
+
* #3699 PR3 — for a SWAP asset (anything but hsuite and xrp): the network the ticker travels on when it has
|
|
199
|
+
* several, and where the swap provider returns the builder's funds if the exchange cannot complete
|
|
200
|
+
* (`refundAddress`, required by the validator for a swap asset) with its memo (`refundExtraId`).
|
|
201
|
+
*/
|
|
202
|
+
paymentNetwork?: string;
|
|
203
|
+
refundAddress?: string;
|
|
204
|
+
refundExtraId?: string;
|
|
117
205
|
};
|
|
118
206
|
/**
|
|
119
207
|
* Response from `POST /api/v3/smart-apps` (SmartAppController.create).
|
|
@@ -163,9 +251,36 @@ export type SubscriptionStatusResponse = {
|
|
|
163
251
|
expiresAt?: string | number;
|
|
164
252
|
remainingBalance?: string;
|
|
165
253
|
createdAt?: string | number;
|
|
254
|
+
/** #4081 — the tier the subscription is on, in every state. */
|
|
255
|
+
tier?: string;
|
|
256
|
+
/** #4081 — the scheduled tier change, while one exists. Same spelling as the upgrade/downgrade answers. */
|
|
257
|
+
pendingTierChange?: {
|
|
258
|
+
fromTier: string;
|
|
259
|
+
toTier: string;
|
|
260
|
+
direction: 'upgrade' | 'downgrade';
|
|
261
|
+
/** ISO-8601; a downgrade's renewal boundary. Never present for an upgrade. */
|
|
262
|
+
effectiveAt?: string;
|
|
263
|
+
orderId?: string;
|
|
264
|
+
};
|
|
265
|
+
/** #4081 — while `pending_deposit`: the order the deposit is waiting on (the one `getOrder` returns). */
|
|
266
|
+
currentOrder?: {
|
|
267
|
+
orderId: string;
|
|
268
|
+
status: string;
|
|
269
|
+
pay?: {
|
|
270
|
+
asset: string;
|
|
271
|
+
amount: string;
|
|
272
|
+
address: string;
|
|
273
|
+
destinationTag: number;
|
|
274
|
+
};
|
|
275
|
+
swap?: SwapPaymentInstruction;
|
|
276
|
+
swapRemainder?: true;
|
|
277
|
+
expiresAt: string;
|
|
278
|
+
receivedAmount?: string;
|
|
279
|
+
};
|
|
166
280
|
depositWallet?: {
|
|
167
281
|
walletAddress: string;
|
|
168
282
|
chain: string;
|
|
283
|
+
/** The deposit required at creation (the bond); a tier upgrade does not raise it. `actualDepositAmount` is what the account holds. */
|
|
169
284
|
depositAmount: string;
|
|
170
285
|
status: string;
|
|
171
286
|
actualDepositAmount?: string;
|
|
@@ -184,12 +299,21 @@ export type RenewResponse = {
|
|
|
184
299
|
appId: string;
|
|
185
300
|
newExpiresAt?: string | number;
|
|
186
301
|
message?: string;
|
|
302
|
+
/**
|
|
303
|
+
* #3699 — set when renewal is PAID on the validator (`subscription.renewal.paid`): nothing is extended yet, and
|
|
304
|
+
* `depositInstructions` is the price-locked `renew` order to pay (its `orderStatus` says whether a payment has
|
|
305
|
+
* already been seen). Absent when the validator extends the lock and takes no payment, as it always did.
|
|
306
|
+
*/
|
|
307
|
+
pendingPayment?: boolean;
|
|
308
|
+
depositInstructions?: DepositInstructions;
|
|
187
309
|
};
|
|
188
310
|
export type TierChangeResponse = {
|
|
189
311
|
success: boolean;
|
|
190
312
|
appId: string;
|
|
191
313
|
fromTier?: string;
|
|
192
314
|
toTier?: string;
|
|
315
|
+
/** #4081 — `direction` is the one name for the kind of a tier change in every response. */
|
|
316
|
+
direction?: 'upgrade' | 'downgrade';
|
|
193
317
|
effectiveAt?: string | number;
|
|
194
318
|
depositInstructions?: DepositInstructions;
|
|
195
319
|
message?: string;
|
|
@@ -219,16 +343,30 @@ export type UsageStatusResponse = {
|
|
|
219
343
|
};
|
|
220
344
|
projectedDaysUntilLimit: number | null;
|
|
221
345
|
};
|
|
346
|
+
/**
|
|
347
|
+
* One page of `GET /api/v3/subscription/billing/:appId` (#4092 C4): the orders of the app that took a payment, and its
|
|
348
|
+
* float credits, newest first. Kept local (the published SDK this CLI depends on predates the entry type).
|
|
349
|
+
*/
|
|
222
350
|
export type BillingLedgerResponse = {
|
|
223
351
|
appId: string;
|
|
224
352
|
entries: Array<{
|
|
353
|
+
/** The order id, or `credit:<tx hash>` for a float credit. */
|
|
225
354
|
id: string;
|
|
226
|
-
|
|
355
|
+
/** `subscribe` (the initial deposit), `upgrade`, `topup`, `renew` or `credit`. */
|
|
227
356
|
operation: string;
|
|
357
|
+
status: string;
|
|
358
|
+
tier?: string;
|
|
359
|
+
priceUsd?: number;
|
|
360
|
+
/** `HSUITE`, or `XRP` for an XRP order. */
|
|
361
|
+
asset: string;
|
|
362
|
+
/** What reached the deposit account, exact: XRP drops, or an HST decimal (`'49.5'`). */
|
|
228
363
|
amount: string;
|
|
229
|
-
|
|
364
|
+
due?: string;
|
|
365
|
+
/** XRP orders: the HST its conversion delivered. */
|
|
366
|
+
hsuiteCredited?: string;
|
|
367
|
+
txHashes: string[];
|
|
368
|
+
account?: string;
|
|
230
369
|
timestamp: string;
|
|
231
|
-
metadata?: Record<string, unknown>;
|
|
232
370
|
}>;
|
|
233
371
|
total: number;
|
|
234
372
|
hasMore: boolean;
|
|
@@ -341,6 +479,14 @@ export declare class SubscriptionClient {
|
|
|
341
479
|
appId: string;
|
|
342
480
|
configCid?: string;
|
|
343
481
|
}>;
|
|
482
|
+
/**
|
|
483
|
+
* What a subscription can be paid in right now (`GET /api/v3/subscription/payment-assets`, public): HSUITE,
|
|
484
|
+
* XRP when it is on, and the swap provider's assets when swap payments are on (#3699 PR3). Called through the
|
|
485
|
+
* same HTTP client as the rest, so no SDK release is needed for it.
|
|
486
|
+
*/
|
|
487
|
+
paymentAssets(): Promise<{
|
|
488
|
+
assets: PaymentAssetOption[];
|
|
489
|
+
}>;
|
|
344
490
|
request(payload: {
|
|
345
491
|
appId: string;
|
|
346
492
|
developerAccountId: string;
|
|
@@ -351,10 +497,29 @@ export declare class SubscriptionClient {
|
|
|
351
497
|
appDescription?: string;
|
|
352
498
|
logoUrl?: string;
|
|
353
499
|
metadata?: Record<string, unknown>;
|
|
500
|
+
/** #3699 PR2/PR3 — the asset to pay in (a symbol); the swap fields go with a swap asset. */
|
|
501
|
+
paymentAsset?: string | {
|
|
502
|
+
symbol: string;
|
|
503
|
+
network?: string;
|
|
504
|
+
};
|
|
505
|
+
refundAddress?: string;
|
|
506
|
+
refundExtraId?: string;
|
|
507
|
+
/** The developer's signed intent for the deposit wallet this request creates (#3506 A2c). */
|
|
508
|
+
depositCreationIntent?: CreationIntentProof;
|
|
354
509
|
}): Promise<SubscriptionRequestResponse>;
|
|
510
|
+
/**
|
|
511
|
+
* The deposit token a deposit-rule intent is signed over for `chain` (XRPL: `HST.<issuer>`), from
|
|
512
|
+
* the PUBLIC `GET /api/v3/subscription/config` (`depositTokenIds`). `undefined` when the cluster
|
|
513
|
+
* reports none or predates payer-signed deposit wallets (#3506 A2c) — the caller must not sign.
|
|
514
|
+
*/
|
|
515
|
+
depositTokenId(chain: string): Promise<string | undefined>;
|
|
355
516
|
status(appId: string): Promise<SubscriptionStatusResponse>;
|
|
356
517
|
mint(appId: string): Promise<MintResponse>;
|
|
357
|
-
|
|
518
|
+
/**
|
|
519
|
+
* `paymentAsset` (`HSUITE` | `XRP`) is read only by a PAID renewal (#3699), which prices the order in it; it rides
|
|
520
|
+
* the request only when named, so a request that names none is the call it always was.
|
|
521
|
+
*/
|
|
522
|
+
renew(appId: string, additionalDays?: number, paymentAsset?: string): Promise<RenewResponse>;
|
|
358
523
|
/**
|
|
359
524
|
* Request a SAME-TIER prepaid-float top-up (#2857).
|
|
360
525
|
*
|
|
@@ -396,4 +561,16 @@ export declare class SubscriptionClient {
|
|
|
396
561
|
usageStatus(appId: string): Promise<UsageStatusResponse>;
|
|
397
562
|
billing(appId: string, limit?: number, offset?: number): Promise<BillingLedgerResponse>;
|
|
398
563
|
}
|
|
564
|
+
/**
|
|
565
|
+
* The code a validator's retryable 503 carries when it has not yet replicated the subscription of an app its caller
|
|
566
|
+
* owns (#4081): `subscription_not_replicated: ...` in the message, with `Retry-After`.
|
|
567
|
+
*/
|
|
568
|
+
export declare const SUBSCRIPTION_NOT_REPLICATED_CODE = "subscription_not_replicated";
|
|
569
|
+
/** Is `err` the validator's "this node has not replicated that subscription yet" 503 (see {@link SUBSCRIPTION_NOT_REPLICATED_CODE})? */
|
|
570
|
+
export declare function isSubscriptionNotReplicatedYet(err: unknown): boolean;
|
|
571
|
+
/**
|
|
572
|
+
* What a polling loop reads in place of that 503: the not-found answer a node that does not hold the subscription gave
|
|
573
|
+
* before #4081, which every wait for a deposit already waits through (its `done` test is false, so it polls again).
|
|
574
|
+
*/
|
|
575
|
+
export declare function notYetReplicatedStatus(appId: string): SubscriptionStatusResponse;
|
|
399
576
|
//# sourceMappingURL=subscription-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-client.d.ts","sourceRoot":"","sources":["../../src/_lib/subscription-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAInE,MAAM,MAAM,mBAAmB,GAAG;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,gBAAgB,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1G;yDACqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;iEAC6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2EAA2E;IAC3E,IAAI,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"subscription-client.d.ts","sourceRoot":"","sources":["../../src/_lib/subscription-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,2BAA2B,CAAC;AAEnC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,mBAAmB,CAAC;IAMxD,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAK,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAMrF;AA2BD;;;GAGG;AACH,eAAO,MAAM,gCAAgC,gCAAgC,CAAC;AAE9E,wIAAwI;AACxI,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGpE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,0BAA0B,CAEhF"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubscriptionClient = void 0;
|
|
3
|
+
exports.SUBSCRIPTION_NOT_REPLICATED_CODE = exports.SubscriptionClient = void 0;
|
|
4
|
+
exports.isSubscriptionNotReplicatedYet = isSubscriptionNotReplicatedYet;
|
|
5
|
+
exports.notYetReplicatedStatus = notYetReplicatedStatus;
|
|
4
6
|
/**
|
|
5
7
|
* Thin CLI adapter over the SDK's subscription + validator-auth clients.
|
|
6
8
|
*
|
|
@@ -172,19 +174,41 @@ class SubscriptionClient {
|
|
|
172
174
|
async setCustomerScope(appId, customerScope) {
|
|
173
175
|
return this.withReauth(() => this.http.put(`/smart-apps/${encodeURIComponent(appId)}`, { config: { customerScope } }));
|
|
174
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* What a subscription can be paid in right now (`GET /api/v3/subscription/payment-assets`, public): HSUITE,
|
|
179
|
+
* XRP when it is on, and the swap provider's assets when swap payments are on (#3699 PR3). Called through the
|
|
180
|
+
* same HTTP client as the rest, so no SDK release is needed for it.
|
|
181
|
+
*/
|
|
182
|
+
async paymentAssets() {
|
|
183
|
+
return this.withReauth(() => this.http.get('/subscription/payment-assets'));
|
|
184
|
+
}
|
|
175
185
|
async request(payload) {
|
|
176
186
|
return this.withReauth(() => this.sdk.request(payload));
|
|
177
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* The deposit token a deposit-rule intent is signed over for `chain` (XRPL: `HST.<issuer>`), from
|
|
190
|
+
* the PUBLIC `GET /api/v3/subscription/config` (`depositTokenIds`). `undefined` when the cluster
|
|
191
|
+
* reports none or predates payer-signed deposit wallets (#3506 A2c) — the caller must not sign.
|
|
192
|
+
*/
|
|
193
|
+
async depositTokenId(chain) {
|
|
194
|
+
const config = await this.withReauth(() => this.sdk.getConfig());
|
|
195
|
+
return config.depositTokenIds?.[chain];
|
|
196
|
+
}
|
|
178
197
|
async status(appId) {
|
|
179
198
|
return this.withReauth(() => this.sdk.getStatus(appId));
|
|
180
199
|
}
|
|
181
200
|
async mint(appId) {
|
|
182
201
|
return this.withReauth(() => this.sdk.mintNft(appId));
|
|
183
202
|
}
|
|
184
|
-
|
|
203
|
+
/**
|
|
204
|
+
* `paymentAsset` (`HSUITE` | `XRP`) is read only by a PAID renewal (#3699), which prices the order in it; it rides
|
|
205
|
+
* the request only when named, so a request that names none is the call it always was.
|
|
206
|
+
*/
|
|
207
|
+
async renew(appId, additionalDays, paymentAsset) {
|
|
185
208
|
return this.withReauth(() => this.sdk.renew({
|
|
186
209
|
appId,
|
|
187
210
|
...(additionalDays !== undefined ? { additionalDays } : {}),
|
|
211
|
+
...(paymentAsset !== undefined ? { paymentAsset } : {}),
|
|
188
212
|
}));
|
|
189
213
|
}
|
|
190
214
|
/**
|
|
@@ -265,6 +289,23 @@ function isAuthExpiredError(err) {
|
|
|
265
289
|
return true;
|
|
266
290
|
return /(invalid|expired)[^.]*authentication token/i.test(message);
|
|
267
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* The code a validator's retryable 503 carries when it has not yet replicated the subscription of an app its caller
|
|
294
|
+
* owns (#4081): `subscription_not_replicated: ...` in the message, with `Retry-After`.
|
|
295
|
+
*/
|
|
296
|
+
exports.SUBSCRIPTION_NOT_REPLICATED_CODE = 'subscription_not_replicated';
|
|
297
|
+
/** Is `err` the validator's "this node has not replicated that subscription yet" 503 (see {@link SUBSCRIPTION_NOT_REPLICATED_CODE})? */
|
|
298
|
+
function isSubscriptionNotReplicatedYet(err) {
|
|
299
|
+
const message = err instanceof Error ? err.message : typeof err === 'string' ? err : '';
|
|
300
|
+
return message.includes(`${exports.SUBSCRIPTION_NOT_REPLICATED_CODE}:`);
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* What a polling loop reads in place of that 503: the not-found answer a node that does not hold the subscription gave
|
|
304
|
+
* before #4081, which every wait for a deposit already waits through (its `done` test is false, so it polls again).
|
|
305
|
+
*/
|
|
306
|
+
function notYetReplicatedStatus(appId) {
|
|
307
|
+
return { appId, hasSubscription: false, status: 'not_found' };
|
|
308
|
+
}
|
|
268
309
|
/**
|
|
269
310
|
* Normalize the SDK's tier-change envelope onto the flat shape the CLI
|
|
270
311
|
* consumers read. The SDK nests `effectiveAt`/`depositInstructions` under
|
|
@@ -280,6 +321,7 @@ function flattenTierChange(res) {
|
|
|
280
321
|
message: res.message,
|
|
281
322
|
fromTier: ptc?.fromTier,
|
|
282
323
|
toTier: ptc?.toTier,
|
|
324
|
+
direction: ptc?.direction,
|
|
283
325
|
effectiveAt: ptc?.effectiveAt,
|
|
284
326
|
depositInstructions: res.depositInstructions ?? ptc?.depositInstructions,
|
|
285
327
|
};
|