@hsuite/smart-engines-cli 2.0.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.
Files changed (77) hide show
  1. package/README.md +3 -2
  2. package/dist/_lib/cluster-convergence.d.ts.map +1 -1
  3. package/dist/_lib/cluster-convergence.js +1 -1
  4. package/dist/_lib/cluster-convergence.js.map +1 -1
  5. package/dist/_lib/deposit-verification.d.ts +91 -0
  6. package/dist/_lib/deposit-verification.d.ts.map +1 -0
  7. package/dist/_lib/deposit-verification.js +265 -0
  8. package/dist/_lib/deposit-verification.js.map +1 -0
  9. package/dist/_lib/payment-guard.d.ts +2 -2
  10. package/dist/_lib/payment-guard.d.ts.map +1 -1
  11. package/dist/_lib/payment-guard.js.map +1 -1
  12. package/dist/_lib/payment-record.d.ts +6 -0
  13. package/dist/_lib/payment-record.d.ts.map +1 -1
  14. package/dist/_lib/payment-record.js +7 -1
  15. package/dist/_lib/payment-record.js.map +1 -1
  16. package/dist/_lib/subscription-client.d.ts +152 -4
  17. package/dist/_lib/subscription-client.d.ts.map +1 -1
  18. package/dist/_lib/subscription-client.js +35 -2
  19. package/dist/_lib/subscription-client.js.map +1 -1
  20. package/dist/_lib/swap-payment.d.ts +54 -0
  21. package/dist/_lib/swap-payment.d.ts.map +1 -0
  22. package/dist/_lib/swap-payment.js +203 -0
  23. package/dist/_lib/swap-payment.js.map +1 -0
  24. package/dist/_lib/xrp-payment.d.ts +20 -5
  25. package/dist/_lib/xrp-payment.d.ts.map +1 -1
  26. package/dist/_lib/xrp-payment.js +26 -8
  27. package/dist/_lib/xrp-payment.js.map +1 -1
  28. package/dist/commands/billing.d.ts +5 -3
  29. package/dist/commands/billing.d.ts.map +1 -1
  30. package/dist/commands/billing.js +12 -6
  31. package/dist/commands/billing.js.map +1 -1
  32. package/dist/commands/deploy.d.ts +1 -1
  33. package/dist/commands/deploy.js +2 -2
  34. package/dist/commands/deploy.js.map +1 -1
  35. package/dist/commands/list.d.ts.map +1 -1
  36. package/dist/commands/list.js +4 -2
  37. package/dist/commands/list.js.map +1 -1
  38. package/dist/commands/redeploy.d.ts +4 -3
  39. package/dist/commands/redeploy.d.ts.map +1 -1
  40. package/dist/commands/redeploy.js +5 -4
  41. package/dist/commands/redeploy.js.map +1 -1
  42. package/dist/commands/renew.d.ts +47 -4
  43. package/dist/commands/renew.d.ts.map +1 -1
  44. package/dist/commands/renew.js +338 -9
  45. package/dist/commands/renew.js.map +1 -1
  46. package/dist/commands/status.d.ts.map +1 -1
  47. package/dist/commands/status.js +22 -2
  48. package/dist/commands/status.js.map +1 -1
  49. package/dist/commands/subscribe.d.ts +22 -0
  50. package/dist/commands/subscribe.d.ts.map +1 -1
  51. package/dist/commands/subscribe.js +207 -9
  52. package/dist/commands/subscribe.js.map +1 -1
  53. package/dist/commands/topup.d.ts +14 -0
  54. package/dist/commands/topup.d.ts.map +1 -1
  55. package/dist/commands/topup.js +22 -2
  56. package/dist/commands/topup.js.map +1 -1
  57. package/dist/commands/upgrade.d.ts +7 -0
  58. package/dist/commands/upgrade.d.ts.map +1 -1
  59. package/dist/commands/upgrade.js +20 -1
  60. package/dist/commands/upgrade.js.map +1 -1
  61. package/dist/commands/verify.js +1 -1
  62. package/dist/commands/verify.js.map +1 -1
  63. package/dist/index.d.ts +1 -1
  64. package/dist/index.js +1 -1
  65. package/package.json +9 -9
  66. package/dist/__tests__/helpers/fixtures-image-hygiene.d.ts +0 -18
  67. package/dist/__tests__/helpers/fixtures-image-hygiene.d.ts.map +0 -1
  68. package/dist/__tests__/helpers/fixtures-image-hygiene.js +0 -42
  69. package/dist/__tests__/helpers/fixtures-image-hygiene.js.map +0 -1
  70. package/dist/__tests__/helpers/fixtures.d.ts +0 -48
  71. package/dist/__tests__/helpers/fixtures.d.ts.map +0 -1
  72. package/dist/__tests__/helpers/fixtures.js +0 -79
  73. package/dist/__tests__/helpers/fixtures.js.map +0 -1
  74. package/dist/__tests__/helpers/xrpl-signing.d.ts +0 -26
  75. package/dist/__tests__/helpers/xrpl-signing.d.ts.map +0 -1
  76. package/dist/__tests__/helpers/xrpl-signing.js +0 -39
  77. package/dist/__tests__/helpers/xrpl-signing.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":";;;;;;AAwCA,gCAGC;AAUD,wCAgBC;AAMD,8BA+BC;AA4BD,wDAuEC;AAcD,4CA2BC;AAGD,wDAkBC;AAGD,oCA6BC;AA3SD;;;;;;;;GAQG;AACH,yCAAoC;AACpC,kDAA0B;AAG1B,qCAA0D;AAC1D,+DAAkF;AAClF,6CAAkD;AAClD,uCAA8C;AAC9C,qEAGqC;AAmBrC,0EAA0E;AAC1E,SAAgB,UAAU,CAAC,CAAoB;IAC7C,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,CAAC;IACnC,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,cAAc,CAAC;AAC9F,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,cAAc,CAClC,MAAkB,EAClB,KAAa,EACb,OAA0F,EAAE;IAE5F,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1F,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;IACrC,IAAI,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,OAAO,CAAC,UAAU,C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ityCreateIntentSigner } from '@hsuite/smart-engines-sdk';
75
+ import { type DepositVerifierFactory } from '../_lib/deposit-verification';
75
76
  import { SubscriptionClient, DepositInstructions } from '../_lib/subscription-client';
76
77
  /**
77
78
  * Minimal structural shape of the bits of the `xrpl` Client we use for the
@@ -123,6 +124,15 @@ type SubscribeOpts = {
123
124
  * created); one that answers with HST instructions anyway is refused HERE before anything is paid.
124
125
  */
125
126
  payWith?: string;
127
+ /**
128
+ * #3699 PR3 — for a SWAP asset (`--pay-with btc`): the network the ticker travels on when it has several
129
+ * (`--pay-network trx` for USDT), and where the swap provider returns the funds if the swap cannot complete
130
+ * (`--refund-address`, REQUIRED for a swap asset) with its memo (`--refund-extra-id`, required for an asset
131
+ * whose addresses take one). The CLI never pays a swap asset: it prints where the builder sends it.
132
+ */
133
+ payNetwork?: string;
134
+ refundAddress?: string;
135
+ refundExtraId?: string;
126
136
  pollIntervalMs?: number;
127
137
  pollTimeoutMs?: number;
128
138
  /**
@@ -155,6 +165,12 @@ type SubscribeOpts = {
155
165
  * `walletSignFactory`).
156
166
  */
157
167
  intentSignerFactory?: (address: string, seed: string) => EntityCreateIntentSigner | Promise<EntityCreateIntentSigner>;
168
+ /**
169
+ * Builds the verifier that checks a deposit address through a validator OTHER than the one that
170
+ * answered (#3506), before it is shown or paid. Defaults to the SDK's cluster discovery; exposed so
171
+ * unit tests can stand in for the network.
172
+ */
173
+ depositVerifierFactory?: DepositVerifierFactory;
158
174
  };
159
175
  /**
160
176
  * Pure orchestration body — exported for unit tests.
@@ -173,6 +189,12 @@ declare function runSubscribeLocked(opts: SubscribeOpts): Promise<{
173
189
  status?: string;
174
190
  depositPaid: boolean;
175
191
  nftAccepted: boolean;
192
+ /** #3699 PR3 — the order is paid through a swap: the builder sends it, this run printed where and stopped. */
193
+ awaitingSwapPayment?: boolean;
194
+ /** #3699 PR3 — the swap's payout has landed and been counted: the platform is converting it, nothing is left to send. */
195
+ swapPaymentCounted?: boolean;
196
+ /** #3699 pre-arming item 4 — what is left of a swap order is plain XRP: this run printed it and stopped (`--pay-with xrp` pays it). */
197
+ awaitingSwapRemainder?: boolean;
176
198
  }>;
177
199
  /**
178
200
  * #3022 — show the reserve surcharge as its own line item. It is already inside
@@ -1 +1 @@
1
- {"version":3,"file":"subscribe.d.ts","sourceRoot":"","sources":["../../src/commands/subscribe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAQL,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAC;AAqBnC,OAAO,EACL,kBAAkB,EAElB,mBAAmB,EAIpB,MAAM,6BAA6B,CAAC;AA6BrC;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/B,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,GAAG,CAAA;KAAE,CAAC,CAAC;IAChE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACxE,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,GAAG,CAAA;SAAE,CAAA;KAAE,CAAC,CAAC;CACjF,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb;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,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;IAC9E,yHAAyH;IACzH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,CACpB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,KACT,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAClE;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACjD,CAAC;AA6CF;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAK7F;AAED,wFAAwF;AACxF,iBAAe,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,8GAA8G;IAC9G,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,yHAAyH;IACzH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,uIAAuI;IACvI,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC,CA+qBD;AAqyBD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,mBAAmB,GAAG,IAAI,CASnE;AAyBD,eAAO,MAAM,gBAAgB,SAgHzB,CAAC"}
@@ -83,6 +83,7 @@ const chalk_1 = __importDefault(require("chalk"));
83
83
  const ora_1 = __importDefault(require("ora"));
84
84
  const smart_engines_sdk_1 = require("@hsuite/smart-engines-sdk");
85
85
  const env_1 = require("../_lib/env");
86
+ const deposit_verification_1 = require("../_lib/deposit-verification");
86
87
  const decimal_compare_1 = require("../_lib/decimal-compare");
87
88
  const payment_record_1 = require("../_lib/payment-record");
88
89
  const payment_lock_1 = require("../_lib/payment-lock");
@@ -94,6 +95,7 @@ const subscription_env_1 = require("../_lib/subscription-env");
94
95
  const order_deadline_1 = require("../_lib/order-deadline");
95
96
  const xrpl_login_signer_1 = require("../_lib/xrpl-login-signer");
96
97
  const xrp_payment_1 = require("../_lib/xrp-payment");
98
+ const swap_payment_1 = require("../_lib/swap-payment");
97
99
  /** Public XRPL testnet websocket endpoint (matches `hsuite init` + faucet). */
98
100
  const XRPL_TESTNET_WSS = 'wss://s.altnet.rippletest.net:51233';
99
101
  /**
@@ -157,7 +159,29 @@ async function runSubscribeLocked(opts) {
157
159
  throw new Error(`unknown tier "${opts.tier}". Valid: ${VALID_TIERS.join(', ')}`);
158
160
  }
159
161
  // #3699 PR2 — parsed before anything is sent: an unknown asset is a mistake, not a default.
160
- const payWith = (0, xrp_payment_1.parsePayWith)(opts.payWith);
162
+ const payChoice = (0, xrp_payment_1.parsePayChoice)(opts.payWith);
163
+ const payWith = payChoice.kind;
164
+ const payNetwork = (0, xrp_payment_1.parsePayNetwork)(opts.payNetwork);
165
+ // #3699 PR3 — a SWAP asset (anything but hsuite and xrp) is paid by the builder from their own wallet, and the
166
+ // provider needs somewhere to return the funds if the swap cannot complete: the builder's own address, REQUIRED.
167
+ // Everything the swap needs is known, and refused, before a single request is made.
168
+ let swapAsk;
169
+ if (payWith === 'swap') {
170
+ const refundAddress = opts.refundAddress?.trim();
171
+ if (!refundAddress) {
172
+ throw new Error(`--pay-with ${payChoice.asset} needs --refund-address <your ${String(payChoice.asset).toUpperCase()} address>: ` +
173
+ 'the swap provider returns your funds to it if the swap cannot complete. Nothing was created.');
174
+ }
175
+ swapAsk = {
176
+ ticker: String(payChoice.asset),
177
+ ...(payNetwork !== undefined ? { network: payNetwork } : {}),
178
+ refundAddress,
179
+ ...(opts.refundExtraId?.trim() ? { refundExtraId: opts.refundExtraId.trim() } : {}),
180
+ };
181
+ }
182
+ else if (opts.refundAddress !== undefined || opts.refundExtraId !== undefined || payNetwork !== undefined) {
183
+ throw new Error('--refund-address, --refund-extra-id and --pay-network apply only to a swap asset (--pay-with btc, eth, usdt, ...). Nothing was created.');
184
+ }
161
185
  const baseUrl = (0, subscription_env_1.requireValidatorUrl)(env, { gateway: opts.gateway });
162
186
  const client = (opts.clientFactory ??
163
187
  ((b) => new subscription_client_1.SubscriptionClient({ baseUrl: b, auth: { chain: 'xrpl', address, seed } })))(baseUrl);
@@ -270,17 +294,23 @@ async function runSubscribeLocked(opts) {
270
294
  'deposit token for xrpl — this cluster predates payer-signed deposit wallets (#3506 A2c); ' +
271
295
  'upgrade the cluster before running `hsuite subscribe`.');
272
296
  }
273
- const { proof } = await (0, smart_engines_sdk_1.signDepositWalletIntent)(await intentSigner(), {
297
+ const { proof, intent } = await (0, smart_engines_sdk_1.signDepositWalletIntent)(await intentSigner(), {
274
298
  network,
275
299
  depositType: 'subscription',
276
300
  chain: 'xrpl',
277
301
  tokenId,
278
302
  appId: forAppId,
279
303
  });
304
+ // #3506 — kept BEFORE the proof is sent: the wallet may be created even if the answer is lost, and
305
+ // every payment made at its address (this run's, `topup`, `upgrade`) is verified against it. A
306
+ // wallet this CLI could not later verify is not created.
307
+ (0, deposit_verification_1.rememberDepositIntent)(opts.env, forAppId, intent);
280
308
  return proof;
281
309
  };
282
310
  let appId;
283
311
  let created;
312
+ /** The swap asset's entry in what the network offers, when this run created the entity (#3699 PR3). */
313
+ let swapListing;
284
314
  if (preexistingAppId) {
285
315
  appId = preexistingAppId;
286
316
  // Say so: the platform's stored subscription decides the tier and the amount,
@@ -289,6 +319,20 @@ async function runSubscribeLocked(opts) {
289
319
  'it keeps the tier and name it was created with; --tier and --app-name are ignored'));
290
320
  }
291
321
  else {
322
+ // #3699 PR3 — a swap asset is checked against what this network offers BEFORE anything is signed or created:
323
+ // an asset it does not offer, a ticker on several networks with none named, and a refund memo it needs and
324
+ // was not given are all refused here, with nothing made.
325
+ if (swapAsk) {
326
+ let offered;
327
+ try {
328
+ offered = (await client.paymentAssets()).assets;
329
+ }
330
+ catch (err) {
331
+ throw new Error(`could not read what this network can be paid in (GET /api/v3/subscription/payment-assets): ${(0, error_message_1.errorMessage)(err)} — ` +
332
+ 'it may predate swap payments. Nothing was created.', { cause: err });
333
+ }
334
+ swapListing = (0, swap_payment_1.resolveSwapListing)(offered, swapAsk);
335
+ }
292
336
  const network = await intentNetwork();
293
337
  // The developer authors the rule CLIENT-SIDE (the wallet signs its hash) —
294
338
  // the standard default, byte-identical to what the validator would
@@ -326,6 +370,8 @@ async function runSubscribeLocked(opts) {
326
370
  depositCreationIntent,
327
371
  // #3699 PR2 — priced in XRP when asked; omitted (= HSUITE) otherwise, as ever.
328
372
  ...(payWith === 'xrp' ? { paymentAsset: 'XRP' } : {}),
373
+ // #3699 PR3 — a swap asset, its network and the builder's refund address.
374
+ ...(swapAsk ? (0, swap_payment_1.swapCreateFields)(swapAsk, swapListing) : {}),
329
375
  });
330
376
  }
331
377
  catch (err) {
@@ -393,6 +439,7 @@ async function runSubscribeLocked(opts) {
393
439
  selectedTier: tier,
394
440
  selectedNetworks: ['xrpl'],
395
441
  ...(payWith === 'xrp' ? { paymentAsset: 'XRP' } : {}),
442
+ ...(swapAsk ? (0, swap_payment_1.swapRequestFields)(swapAsk, swapListing) : {}),
396
443
  };
397
444
  try {
398
445
  // #3506 A2c — the request creates the deposit wallet only when this node has none. A RESUMED
@@ -472,6 +519,23 @@ async function runSubscribeLocked(opts) {
472
519
  throw paid ? paidThenFailed(err, paid, appId, opts.env, inv) : err;
473
520
  }
474
521
  };
522
+ // #3506 — the address the validator that answered gave, checked through a validator it did NOT
523
+ // answer from (the payer's own signed intent decides which wallet is meant), before it is shown or
524
+ // paid. A swap order is the exception: the builder sends to the provider, not to this account.
525
+ const verifyDeposit = async (d) => {
526
+ try {
527
+ const verified = await (0, deposit_verification_1.verifyDepositForPayment)({
528
+ envPath: opts.env,
529
+ appId,
530
+ baseUrl,
531
+ ...(opts.depositVerifierFactory ? { factory: opts.depositVerifierFactory } : {}),
532
+ }, { address: d.walletAddress, chain: d.chain });
533
+ console.log(chalk_1.default.gray(` ${(0, deposit_verification_1.describeVerified)(verified)}`));
534
+ }
535
+ catch (err) {
536
+ throw new Error(`${(0, error_message_1.errorMessage)(err)}${unpaidNote(appId, opts.env, inv)}`, { cause: err });
537
+ }
538
+ };
475
539
  if (creditedAs) {
476
540
  // Credited, so there is nothing left to pay — however the run was started
477
541
  // (`--no-autopay` only governs PAYING): carry on to mint + accept. This is
@@ -487,6 +551,84 @@ async function runSubscribeLocked(opts) {
487
551
  'Try again in a minute: a retry can reach a node that has it.'
488
552
  : 'no depositInstructions for the created entity — server contract violation');
489
553
  }
554
+ // #3699 PR3 — an order paid through a swap: the builder sends the source asset to the PROVIDER from their own
555
+ // wallet. This CLI holds an XRPL key and cannot spend it, so it checks what it is told, prints it, and stops
556
+ // (as `--no-autopay` does): it never pays, whatever else the instructions carry. A lapsed swap quote is not
557
+ // shown at all: the platform requotes it (a NEW exchange) when this run names the asset and the refund address
558
+ // again, which is the request above, so what comes back is a live quote or a refusal that says why.
559
+ const swapInstruction = (0, swap_payment_1.swapPaymentOf)(deposit);
560
+ if (swapInstruction) {
561
+ if (payWith === 'xrp') {
562
+ throw new Error('asked to pay in XRP, but this subscription is already priced through a swap ' +
563
+ `(${swapInstruction.asset}) — nothing was paid${unpaidNote(appId, opts.env, inv)} ` +
564
+ `Re-run without --pay-with to see the ${swapInstruction.asset} instructions.`);
565
+ }
566
+ try {
567
+ (0, swap_payment_1.assertSwapPaymentConsistent)(swapInstruction, swapAsk);
568
+ // A payout that has already been counted is past its deadline by nature: nothing is left to send, so the
569
+ // deadline is not held against it.
570
+ if (!(0, swap_payment_1.swapPaymentCounted)(swapInstruction))
571
+ (0, swap_payment_1.assertSwapQuoteLive)(swapInstruction);
572
+ }
573
+ catch (err) {
574
+ throw new Error(`${(0, error_message_1.errorMessage)(err)}${unpaidNote(appId, opts.env, inv)}`, { cause: err });
575
+ }
576
+ if ((0, swap_payment_1.swapPaymentCounted)(swapInstruction)) {
577
+ console.log(chalk_1.default.cyan(`\n Your ${swapInstruction.asset} swap payment has been counted (order ${swapInstruction.status}): the platform is converting it ` +
578
+ 'into your subscription deposit. Do NOT send it again. Re-run `hsuite subscribe` in a minute to mint + accept the NFT.\n'));
579
+ return {
580
+ appId,
581
+ subscriptionId,
582
+ tier,
583
+ status: standing?.status ?? requested?.status ?? 'pending_deposit',
584
+ depositPaid: false,
585
+ nftAccepted: false,
586
+ swapPaymentCounted: true,
587
+ };
588
+ }
589
+ renderDepositInstructions(deposit, preexistingAppId ? undefined : tier, appId);
590
+ // #3506 — the independent check covers the XRPL deposit account only. What the builder SENDS goes to
591
+ // the swap provider's pay-in address (and memo), which the validator that answered gave and nothing
592
+ // here can confirm: say so rather than let a verified-looking line sit next to it.
593
+ console.log(chalk_1.default.yellow(' NOTE: the pay-in address and memo above come from the validator that answered. The independent ' +
594
+ 'deposit-address check covers the XRPL deposit account, not a swap provider\'s pay-in address, so they ' +
595
+ 'are NOT verified: confirm them with the swap provider before you send.'));
596
+ console.log(chalk_1.default.cyan(` Send the ${swapInstruction.asset} above from your own wallet, then re-run \`hsuite subscribe\` ` +
597
+ 'once it has been counted to mint + accept the NFT. Nothing is paid by this command.\n'));
598
+ return {
599
+ appId,
600
+ subscriptionId,
601
+ tier,
602
+ status: standing?.status ?? requested?.status ?? 'pending_deposit',
603
+ depositPaid: false,
604
+ nftAccepted: false,
605
+ awaitingSwapPayment: true,
606
+ };
607
+ }
608
+ // #3699 pre-arming item 4 — the REMAINDER of an underpaid swap order is plain XRP instructions to the same deposit
609
+ // account and tag (no new exchange): the one answer to a swap request that is neither a swap nor the wrong asset.
610
+ const isSwapRemainder = deposit.swapRemainder === true && (0, xrp_payment_1.xrpPaymentOf)(deposit) !== undefined;
611
+ // #3699 PR3 — asked for a swap asset, answered with something else: it would be paid in the wrong asset.
612
+ if (payWith === 'swap' && !isSwapRemainder) {
613
+ throw new Error(`asked to pay in ${String(payChoice.asset).toUpperCase()} through a swap, but the validator did not price this ` +
614
+ `subscription that way (no swap payment instruction came back) — nothing was paid${unpaidNote(appId, opts.env, inv)} ` +
615
+ 'Re-run without --pay-with to pay in HSUITE, or check GET /api/v3/subscription/payment-assets.');
616
+ }
617
+ // #3699 pre-arming item 4 — a remainder that has been counted (the XRP is on the deposit account, the platform is
618
+ // converting it) is not to be sent again, however this run was started and whatever its deadline says.
619
+ if (isSwapRemainder && (deposit.orderStatus === 'paid' || deposit.orderStatus === 'converting')) {
620
+ console.log(chalk_1.default.cyan(`\n Your remainder payment has been counted (order ${deposit.orderStatus}): the platform is converting it into your subscription deposit. ` +
621
+ 'Do NOT send it again. Re-run `hsuite subscribe` in a minute to mint + accept the NFT.\n'));
622
+ return {
623
+ appId,
624
+ subscriptionId,
625
+ tier,
626
+ status: standing?.status ?? requested?.status ?? 'pending_deposit',
627
+ depositPaid: false,
628
+ nftAccepted: false,
629
+ swapPaymentCounted: true,
630
+ };
631
+ }
490
632
  // #3699 D8 / #3765 — never put an expired quote in front of a payer, on EITHER path:
491
633
  // requote first if the deadline has already passed, then show / pay the NEW amount and tag.
492
634
  // (A manual payer used to be shown whatever the replay re-attached, expired or not.)
@@ -516,9 +658,29 @@ async function runSubscribeLocked(opts) {
516
658
  throw new Error(`${(0, error_message_1.errorMessage)(err)}${unpaidNote(appId, opts.env, inv)}`, { cause: err });
517
659
  }
518
660
  }
661
+ // #3506 — nothing below shows or pays an address that was not verified.
662
+ await verifyDeposit(deposit);
519
663
  // A resumed entity keeps the tier it was created with, which this run's
520
664
  // --tier says nothing about: print the tier only for an entity created now.
521
665
  renderDepositInstructions(deposit, preexistingAppId ? undefined : tier, appId);
666
+ // #3699 pre-arming item 4 — the builder chose to pay this subscription in another asset, and what is left of it is a
667
+ // small amount of XRP: this run does not pay it on their behalf, however it was started, unless they ask it to
668
+ // (`--pay-with xrp`). It prints what is owed and stops, as it does for a swap.
669
+ if (isSwapRemainder && payWith !== 'xrp') {
670
+ console.log(chalk_1.default.cyan(' This is the REMAINDER of your swap payment: the XRP the swap delivered fell short of what the subscription now costs, ' +
671
+ 'and this is what is left, as XRP to the same deposit account and tag (no new swap is opened). ' +
672
+ 'Send it from your own wallet, or re-run `hsuite subscribe --pay-with xrp` to have this CLI pay it from your XRPL wallet. ' +
673
+ 'Nothing is paid by this command.\n'));
674
+ return {
675
+ appId,
676
+ subscriptionId,
677
+ tier,
678
+ status: standing?.status ?? requested?.status ?? 'pending_deposit',
679
+ depositPaid: false,
680
+ nftAccepted: false,
681
+ awaitingSwapRemainder: true,
682
+ };
683
+ }
522
684
  // Step 3: auto-pay the deposit from the dev wallet (unless --no-autopay).
523
685
  if (opts.autopay === false) {
524
686
  renderManualPaymentHint(deposit);
@@ -1021,7 +1183,17 @@ async function pollStatus(client, appId, sleep, opts, done, maxAttempts) {
1021
1183
  // wall-clock deadline — whichever comes first.
1022
1184
  let attempt = 0;
1023
1185
  while (true) {
1024
- const status = await client.status(appId);
1186
+ // A node that has not replicated the row yet answers a retryable 503 (#4081): the same "not there yet" this loop
1187
+ // already waits through when it is told `not_found`.
1188
+ let status;
1189
+ try {
1190
+ status = await client.status(appId);
1191
+ }
1192
+ catch (err) {
1193
+ if (!(0, subscription_client_1.isSubscriptionNotReplicatedYet)(err))
1194
+ throw err;
1195
+ status = (0, subscription_client_1.notYetReplicatedStatus)(appId);
1196
+ }
1025
1197
  if (done(status))
1026
1198
  return status;
1027
1199
  attempt += 1;
@@ -1175,6 +1347,14 @@ function renderDepositInstructions(d, tier, appId) {
1175
1347
  if (tier)
1176
1348
  console.log(chalk_1.default.gray(` tier: ${tier}`));
1177
1349
  console.log(chalk_1.default.gray(` chain: ${d.chain}`));
1350
+ // #3699 PR3 — paid through a swap: what to SEND is the source asset, to the provider.
1351
+ const swapPay = (0, swap_payment_1.swapPaymentOf)(d);
1352
+ if (swapPay) {
1353
+ (0, swap_payment_1.renderSwapPayment)(swapPay);
1354
+ renderReserveSurcharge(d);
1355
+ console.log('');
1356
+ return;
1357
+ }
1178
1358
  const xrpPay = (0, xrp_payment_1.xrpPaymentOf)(d);
1179
1359
  if (xrpPay) {
1180
1360
  // #3699 PR2 — priced in XRP: what to SEND is the XRP payment; the HST lines say what it becomes.
@@ -1232,10 +1412,16 @@ exports.subscribeCommand = new commander_1.Command('subscribe')
1232
1412
  .option('--app-id <id>', 'Resume an already-created entity by its appId (defaults to SUBSCRIPTION_APP_ID env). When unset, subscribe CREATES the DKG entity and uses its entityId.')
1233
1413
  .option('--app-name <name>', 'Smart-app display name')
1234
1414
  .option('--no-autopay', 'Skip auto-paying the deposit; print instructions for manual (XUMM) payment')
1235
- .option('--pay-with <asset>', 'Asset to pay the subscription in: hsuite (default) or xrp. With xrp the validator quotes the price in XRP ' +
1236
- '(the HST/XRP market plus a buffer) and the deposit is an XRP payment of the quoted amount with the order\'s ' +
1237
- 'Destination Tag; the platform converts it into HST inside the deposit account. A validator with XRP ' +
1238
- 'payments off or no HST/XRP market refuses, and nothing is created.')
1415
+ .option('--pay-with <asset>', 'Asset to pay the subscription in: hsuite (default), xrp, or a swap asset such as btc, eth, usdt (see ' +
1416
+ 'GET /api/v3/subscription/payment-assets for what the network offers). With xrp the validator quotes the price in ' +
1417
+ 'XRP (the HST/XRP market plus a buffer) and the deposit is an XRP payment of the quoted amount with the order\'s ' +
1418
+ 'Destination Tag; the platform converts it into HST inside the deposit account. With a swap asset the validator ' +
1419
+ 'opens a fixed-rate exchange at a swap provider and prints where YOU send the asset (--refund-address is required): ' +
1420
+ 'this command never pays it. A validator with that payment off, or no HST/XRP market, refuses, and nothing is created.')
1421
+ .option('--pay-network <network>', 'Swap assets only: the network the --pay-with ticker travels on when it has several (e.g. --pay-with usdt --pay-network trx).')
1422
+ .option('--refund-address <address>', 'REQUIRED for a swap asset (--pay-with btc, eth, usdt, ...): YOUR address on that asset\'s network, where the swap ' +
1423
+ 'provider returns your funds if the swap cannot complete. The CLI cannot send these assets: it prints where YOU send them.')
1424
+ .option('--refund-extra-id <memo>', 'Swap assets only: the memo / tag of --refund-address, for an asset whose addresses take one (XLM, ATOM, ...).')
1239
1425
  .option('--nft-issuer <address>', 'Optional override for the XRPL subscription-NFT issuer. No longer required: the /status response now exposes chainNfts.xrpl (nftId + issuerAddress) and the offer is resolved from it automatically. Defaults to SUBSCRIPTION_NFT_ISSUER env.')
1240
1426
  .action(async (opts) => {
1241
1427
  console.log(chalk_1.default.bold.cyan('\n hsuite subscribe\n'));
@@ -1258,7 +1444,13 @@ exports.subscribeCommand = new commander_1.Command('subscribe')
1258
1444
  process.exit(1);
1259
1445
  }
1260
1446
  if (!result.depositPaid) {
1261
- spinner.info(`subscription requested (appId=${result.appId}) — deposit not paid (--no-autopay)`);
1447
+ spinner.info(result.swapPaymentCounted
1448
+ ? `subscription requested (appId=${result.appId}) — your swap payment is counted, converting`
1449
+ : result.awaitingSwapPayment
1450
+ ? `subscription requested (appId=${result.appId}) — waiting for YOUR swap payment (see above)`
1451
+ : result.awaitingSwapRemainder
1452
+ ? `subscription requested (appId=${result.appId}) — waiting for the XRP remainder of your swap payment (see above)`
1453
+ : `subscription requested (appId=${result.appId}) — deposit not paid (--no-autopay)`);
1262
1454
  const updates = {
1263
1455
  SUBSCRIPTION_APP_ID: result.appId,
1264
1456
  APP_ID: result.appId,
@@ -1266,7 +1458,13 @@ exports.subscribeCommand = new commander_1.Command('subscribe')
1266
1458
  if (saveEnv(opts.env, updates)) {
1267
1459
  console.log(chalk_1.default.gray(`\n wrote SUBSCRIPTION_APP_ID to ${opts.env}`));
1268
1460
  }
1269
- console.log(chalk_1.default.yellow('\n Pay the deposit, then re-run `hsuite subscribe` to mint + accept the NFT.\n'));
1461
+ console.log(chalk_1.default.yellow(result.swapPaymentCounted
1462
+ ? '\n Wait for the conversion, then re-run `hsuite subscribe` to mint + accept the NFT.\n'
1463
+ : result.awaitingSwapPayment
1464
+ ? '\n Send the swap payment from your own wallet, then re-run `hsuite subscribe` to mint + accept the NFT.\n'
1465
+ : result.awaitingSwapRemainder
1466
+ ? '\n Send the XRP remainder from your own wallet (or re-run with `--pay-with xrp` to have this CLI pay it), then re-run `hsuite subscribe` to mint + accept the NFT.\n'
1467
+ : '\n Pay the deposit, then re-run `hsuite subscribe` to mint + accept the NFT.\n'));
1270
1468
  return;
1271
1469
  }
1272
1470
  spinner.succeed(`subscription active (appId=${result.appId})`);