@kasufinance/kasu-sdk 2.7.1 → 2.8.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.
@@ -25146,6 +25146,31 @@ function classifyWalletFailure(step, err) {
25146
25146
  : { step, reason: 'failed', error: err };
25147
25147
  }
25148
25148
 
25149
+ /**
25150
+ * What a `depositBatch` port throws when it KNOWS the batch reverted — from a
25151
+ * simulation before sending, or from the submitter refusing to broadcast a
25152
+ * batch that would revert. The run ends `{ step: 'request', reason:
25153
+ * 'reverted', revertError }`.
25154
+ *
25155
+ * `revertError` is the custom error the contract named (`'ClearingIsPending'`,
25156
+ * `'UserNotKycd'`, …), exactly as the ABI declares it. Pass `''` when the
25157
+ * batch is known to revert but not why: the consumer then renders its generic
25158
+ * `reverted` copy, which is what an unknown name gets anyway.
25159
+ *
25160
+ * Any OTHER throw from the port is read the way a direct deposit's is — a
25161
+ * wallet rejection is `cancelled`, a decodable revert is `reverted`, and
25162
+ * everything else is `failed` with the error kept. A port that cannot tell is
25163
+ * better off throwing what it has than guessing a name.
25164
+ */
25165
+ class BatchRevertedError extends Error {
25166
+ constructor(revertError, message) {
25167
+ super(message !== null && message !== void 0 ? message : `DepositFlow: the batch reverted${revertError ? ` with ${revertError}` : ''}`);
25168
+ this.name = 'BatchRevertedError';
25169
+ this.revertError = revertError;
25170
+ // Keeps `instanceof` honest under a down-levelled build.
25171
+ Object.setPrototypeOf(this, BatchRevertedError.prototype);
25172
+ }
25173
+ }
25149
25174
  /** Generated agreements are valid for five minutes upstream. */
25150
25175
  const CONTRACT_TTL_MS = 5 * 60 * 1000;
25151
25176
  /** What a run without a spender, from either source, fails with. */
@@ -25172,9 +25197,43 @@ const INITIAL$1 = {
25172
25197
  stepIndex: 0,
25173
25198
  stepTotal: 4,
25174
25199
  approvalRequired: true,
25200
+ batched: false,
25175
25201
  contract: null,
25176
25202
  failure: null,
25177
25203
  };
25204
+ const ERC20 = IERC20MetadataAbi__factory.createInterface();
25205
+ const LENDING_POOL_MANAGER = ILendingPoolManagerAbi__factory.createInterface();
25206
+ /**
25207
+ * The batch path's two calls, encoded by the SDK so no consumer has to: the
25208
+ * EXACT-amount approve, then the very `requestDepositWithKyc` the default
25209
+ * `deposit` port sends — `swapData` `'0x'`, no value. Both read `amount` from
25210
+ * the same variable, so the batch cannot approve one figure and deposit
25211
+ * another.
25212
+ */
25213
+ function encodeDepositBatch(args) {
25214
+ const { stableAsset, spender, input, depositData, kyc } = args;
25215
+ return [
25216
+ {
25217
+ to: stableAsset,
25218
+ data: ERC20.encodeFunctionData('approve', [spender, input.amount]),
25219
+ },
25220
+ {
25221
+ to: spender,
25222
+ data: LENDING_POOL_MANAGER.encodeFunctionData('requestDepositWithKyc', [
25223
+ input.poolId,
25224
+ input.trancheId,
25225
+ input.amount,
25226
+ '0x',
25227
+ input.fixedTermConfigId,
25228
+ depositData,
25229
+ {
25230
+ blockExpiration: kyc.blockExpiration,
25231
+ signature: kyc.signature,
25232
+ },
25233
+ ]),
25234
+ },
25235
+ ];
25236
+ }
25178
25237
  /** 1-based badge position, with `approve` dropped when it is out of scope. */
25179
25238
  function stepIndexOf(step, approvalRequired) {
25180
25239
  const order = approvalRequired
@@ -25220,6 +25279,22 @@ function classifyRequest(err) {
25220
25279
  }
25221
25280
  return classifyWalletFailure('request', err);
25222
25281
  }
25282
+ /**
25283
+ * A `depositBatch` rejection. A submitter that KNOWS the batch reverts says so
25284
+ * with `BatchRevertedError`; anything else is read exactly as a direct
25285
+ * deposit's throw is, so a non-wallet error can never become `cancelled`.
25286
+ */
25287
+ function classifyBatch(err) {
25288
+ if (err instanceof BatchRevertedError) {
25289
+ return {
25290
+ step: 'request',
25291
+ reason: 'reverted',
25292
+ revertError: err.revertError,
25293
+ error: err,
25294
+ };
25295
+ }
25296
+ return classifyRequest(err);
25297
+ }
25223
25298
  // ---------------------------------------------------------------------------
25224
25299
  // The flow
25225
25300
  // ---------------------------------------------------------------------------
@@ -25246,8 +25321,15 @@ class DepositFlow extends Flow {
25246
25321
  * A stale token simply is not the current generation.
25247
25322
  */
25248
25323
  this._acceptingFor = null;
25324
+ /**
25325
+ * The batch path's authorisation handshake. Same shape and lifetime as
25326
+ * `_accept`: the run parks on it, `authoriseTransfer`, `declineTransfer`
25327
+ * and `reset` settle it, and it is cleared the moment it settles.
25328
+ */
25329
+ this._authorise = null;
25249
25330
  this._ttlMs = (_a = opts === null || opts === void 0 ? void 0 : opts.contractTtlMs) !== null && _a !== void 0 ? _a : CONTRACT_TTL_MS;
25250
25331
  this._defaultSpender = opts === null || opts === void 0 ? void 0 : opts.spender;
25332
+ this._stableAsset = opts === null || opts === void 0 ? void 0 : opts.stableAsset;
25251
25333
  // Called through the ports object, never captured off it: a consumer
25252
25334
  // whose clock is a method on its own object keeps its `this`.
25253
25335
  this._now = () => { var _a, _b; return (_b = (_a = _ports.now) === null || _a === void 0 ? void 0 : _a.call(_ports)) !== null && _b !== void 0 ? _b : Date.now(); };
@@ -25309,6 +25391,33 @@ class DepositFlow extends Flow {
25309
25391
  this._accept = null;
25310
25392
  bridge.settle({ kind: 'declined' });
25311
25393
  }
25394
+ /**
25395
+ * Batch path: authorise the single transaction that approves and deposits,
25396
+ * and resume the parked run. A no-op when nothing is parked on
25397
+ * `awaiting-authorise`, so a double tap cannot submit twice.
25398
+ *
25399
+ * The batch has no wallet prompt per call, so this is the lender's
25400
+ * explicit consent to the transfer — call it only from their action.
25401
+ */
25402
+ authoriseTransfer() {
25403
+ const bridge = this._authorise;
25404
+ if (!bridge)
25405
+ return;
25406
+ this._authorise = null;
25407
+ bridge.settle({ kind: 'authorised' });
25408
+ }
25409
+ /**
25410
+ * Batch path: refuse the transfer. The run ends on `error` with `{ step:
25411
+ * 'request', reason: 'cancelled' }` and nothing is submitted. A no-op when
25412
+ * nothing is parked on `awaiting-authorise`.
25413
+ */
25414
+ declineTransfer() {
25415
+ const bridge = this._authorise;
25416
+ if (!bridge)
25417
+ return;
25418
+ this._authorise = null;
25419
+ bridge.settle({ kind: 'declined' });
25420
+ }
25312
25421
  /** True only while THIS generation is waiting on the acceptance signature. */
25313
25422
  _isAccepting() {
25314
25423
  return (this._acceptingFor !== null &&
@@ -25320,6 +25429,9 @@ class DepositFlow extends Flow {
25320
25429
  this._accept = null;
25321
25430
  this._acceptingFor = null;
25322
25431
  bridge === null || bridge === void 0 ? void 0 : bridge.settle({ kind: 'abandoned' });
25432
+ const authorise = this._authorise;
25433
+ this._authorise = null;
25434
+ authorise === null || authorise === void 0 ? void 0 : authorise.settle({ kind: 'abandoned' });
25323
25435
  }
25324
25436
  // -----------------------------------------------------------------------
25325
25437
  _run(input, token) {
@@ -25327,6 +25439,7 @@ class DepositFlow extends Flow {
25327
25439
  var _a;
25328
25440
  this._accept = null;
25329
25441
  this._acceptingFor = null;
25442
+ this._authorise = null;
25330
25443
  const ports = this._ports;
25331
25444
  const owner = input.userAddress.toLowerCase();
25332
25445
  // 0. The spender, from the input or from the chain config the facade
@@ -25347,21 +25460,32 @@ class DepositFlow extends Flow {
25347
25460
  // live, never cached: an exact-amount approval is fully consumed by
25348
25461
  // the deposit it paid for, so a stale allowance is exactly the value
25349
25462
  // that would wrongly skip the approve and revert the deposit.
25350
- let approvalRequired = true;
25463
+ let allowanceShort = true;
25351
25464
  try {
25352
25465
  const allowance = yield ports.readAllowance(owner, spender);
25353
- approvalRequired = allowance.lt(input.amount);
25466
+ allowanceShort = allowance.lt(input.amount);
25354
25467
  }
25355
25468
  catch (_b) {
25356
25469
  // A read failure is not a reason to skip an approval. Assume one is
25357
25470
  // needed: the cost is a redundant approve, the alternative is a
25358
25471
  // reverted deposit.
25359
- approvalRequired = true;
25472
+ allowanceShort = true;
25360
25473
  }
25361
25474
  if (!this._store.isCurrent(token))
25362
25475
  return;
25476
+ // The path is chosen HERE, with the allowance, so the badge is right
25477
+ // from the first state the lender sees. Batch only when there is an
25478
+ // approval to fold in, a port to submit it, and a known token to
25479
+ // approve on — never a guessed one. A batched run never enters the
25480
+ // `approve` step, so every badge counts it as a three-step run.
25481
+ const stableAsset = this._stableAsset;
25482
+ const batched = allowanceShort &&
25483
+ typeof ports.depositBatch === 'function' &&
25484
+ !!stableAsset;
25485
+ const approvalRequired = allowanceShort && !batched;
25363
25486
  // 2. Generate — sign the auth message.
25364
- this._store.patch(Object.assign({ approvalRequired, phase: 'generating-sign' }, badgeFor('generate', approvalRequired)), token);
25487
+ this._store.patch(Object.assign({ approvalRequired,
25488
+ batched, phase: 'generating-sign' }, badgeFor('generate', approvalRequired)), token);
25365
25489
  const timestamp = this._now();
25366
25490
  const signedMessage = buildAuthMessage(input, owner, timestamp);
25367
25491
  let signature;
@@ -25463,6 +25587,18 @@ class DepositFlow extends Flow {
25463
25587
  });
25464
25588
  return;
25465
25589
  }
25590
+ if (batched && stableAsset) {
25591
+ yield this._runBatch({
25592
+ token,
25593
+ input,
25594
+ owner,
25595
+ spender,
25596
+ stableAsset,
25597
+ depositData,
25598
+ contract,
25599
+ });
25600
+ return;
25601
+ }
25466
25602
  // 6. Approve — the EXACT amount, never `MaxUint256`. House rule: an
25467
25603
  // unlimited allowance outlives the deposit it was granted for, and a
25468
25604
  // later exploit of the spender would drain a wallet that has long
@@ -25526,6 +25662,108 @@ class DepositFlow extends Flow {
25526
25662
  this._store.patch(Object.assign({ phase: 'success' }, badgeFor('request', approvalRequired)), token);
25527
25663
  });
25528
25664
  }
25665
+ /**
25666
+ * The batch path, from the accepted agreement to the receipt.
25667
+ *
25668
+ * 1. PARK on `awaiting-authorise`. A batch puts no wallet prompt in front
25669
+ * of each call, so the flow waits for an explicit authorisation before
25670
+ * any money moves. `declineTransfer()` ends it as `cancelled`.
25671
+ * 2. Re-check the TTL: the lender may have idled on the authorisation as
25672
+ * long as they did on the agreement.
25673
+ * 3. Only now fetch the KYC signature — it has a block expiration of its
25674
+ * own, and an authorisation left open must not spend it.
25675
+ * 4. Encode both calls and hand them to `depositBatch`; then the receipt.
25676
+ */
25677
+ _runBatch(args) {
25678
+ return __awaiter(this, void 0, void 0, function* () {
25679
+ const { token, input, owner, spender, stableAsset, depositData } = args;
25680
+ const ports = this._ports;
25681
+ // A batched run is a three-step run on every badge.
25682
+ const approvalRequired = false;
25683
+ // Every settler clears the handshake before settling it, so there is
25684
+ // nothing to clear here — and clearing it anyway could drop the
25685
+ // handshake of a NEWER run that `reset(); start()` already parked.
25686
+ const outcome = yield new Promise((resolve) => {
25687
+ this._authorise = { settle: resolve };
25688
+ this._store.patch(Object.assign({ phase: 'awaiting-authorise' }, badgeFor('request', approvalRequired)), token);
25689
+ });
25690
+ if (!this._store.isCurrent(token))
25691
+ return;
25692
+ if (outcome.kind === 'declined') {
25693
+ this._fail(token, approvalRequired, {
25694
+ step: 'request',
25695
+ reason: 'cancelled',
25696
+ });
25697
+ return;
25698
+ }
25699
+ if (outcome.kind !== 'authorised')
25700
+ return;
25701
+ if (this._now() > args.contract.timestamp + this._ttlMs) {
25702
+ this._fail(token, approvalRequired, {
25703
+ step: 'request',
25704
+ reason: 'contract-expired',
25705
+ });
25706
+ return;
25707
+ }
25708
+ this._store.patch(Object.assign({ phase: 'request-sign' }, badgeFor('request', approvalRequired)), token);
25709
+ // The consumer's backend, so `failed` — never `cancelled` — exactly as
25710
+ // on the two-transaction path.
25711
+ let kyc;
25712
+ try {
25713
+ const kycParams = yield ports.buildKycParams(owner);
25714
+ kyc = yield ports.getKycSignature(kycParams);
25715
+ }
25716
+ catch (err) {
25717
+ this._fail(token, approvalRequired, {
25718
+ step: 'request',
25719
+ reason: 'failed',
25720
+ error: err,
25721
+ });
25722
+ return;
25723
+ }
25724
+ if (!this._store.isCurrent(token))
25725
+ return;
25726
+ // Encoded from values a backend returned (the KYC signature), so a
25727
+ // shape the coder refuses is a failure the consumer can render, not a
25728
+ // rejection out of a `start()` that promises it has none.
25729
+ let calls;
25730
+ try {
25731
+ calls = encodeDepositBatch({
25732
+ stableAsset,
25733
+ spender,
25734
+ input,
25735
+ depositData,
25736
+ kyc,
25737
+ });
25738
+ }
25739
+ catch (err) {
25740
+ this._fail(token, approvalRequired, {
25741
+ step: 'request',
25742
+ reason: 'failed',
25743
+ error: err,
25744
+ });
25745
+ return;
25746
+ }
25747
+ try {
25748
+ // Called through the ports object, so a port that is a method
25749
+ // keeps its `this`. Its presence decided the path; a consumer
25750
+ // that removed it since gets a `failed`, not a crash.
25751
+ if (typeof ports.depositBatch !== 'function') {
25752
+ throw new Error('DepositFlow: the depositBatch port is gone');
25753
+ }
25754
+ const tx = yield ports.depositBatch(calls);
25755
+ this._store.patch(Object.assign({ phase: 'request-confirm' }, badgeFor('request', approvalRequired)), token);
25756
+ yield tx.wait();
25757
+ }
25758
+ catch (err) {
25759
+ this._fail(token, approvalRequired, classifyBatch(err));
25760
+ return;
25761
+ }
25762
+ if (!this._store.isCurrent(token))
25763
+ return;
25764
+ this._store.patch(Object.assign({ phase: 'success' }, badgeFor('request', approvalRequired)), token);
25765
+ });
25766
+ }
25529
25767
  _fail(token, approvalRequired, failure) {
25530
25768
  this._store.patch(Object.assign({ phase: 'error', failure }, badgeFor(failure.step, approvalRequired)), token);
25531
25769
  }
@@ -25678,11 +25916,18 @@ class FlowsFacade {
25678
25916
  * an address whose only wrong value grants an approval to the wrong
25679
25917
  * contract.
25680
25918
  */
25681
- _spender) {
25919
+ _spender,
25920
+ /**
25921
+ * This chain's stable token address — the target of the batch path's
25922
+ * approve. `undefined` for a hand-built config without `stableAsset`,
25923
+ * in which case a run never batches: it does not guess a token.
25924
+ */
25925
+ _stableAsset) {
25682
25926
  this._deposits = _deposits;
25683
25927
  this._erc20 = _erc20;
25684
25928
  this._isReadOnly = _isReadOnly;
25685
25929
  this._spender = _spender;
25930
+ this._stableAsset = _stableAsset;
25686
25931
  }
25687
25932
  /**
25688
25933
  * A deposit pipeline. `readAllowance`, `approve`, `deposit` and
@@ -25695,9 +25940,13 @@ class FlowsFacade {
25695
25940
  * delete the default it was meant to keep, and
25696
25941
  * `approve: sponsoredGas ? sponsoredApprove : undefined` is exactly how a
25697
25942
  * consumer writes a conditional override.
25943
+ *
25944
+ * `depositBatch` has NO default: how several calls become one atomic
25945
+ * transaction is the application's business. Supplying it lets a run
25946
+ * whose allowance is short approve and deposit in one batch.
25698
25947
  */
25699
25948
  deposit(ports, opts) {
25700
- var _a, _b, _c, _d, _e;
25949
+ var _a, _b, _c, _d, _e, _f;
25701
25950
  return new DepositFlow({
25702
25951
  signMessage: ports.signMessage,
25703
25952
  generateContract: ports.generateContract,
@@ -25712,12 +25961,14 @@ class FlowsFacade {
25712
25961
  return yield this._erc20().approve(spender, amount);
25713
25962
  })),
25714
25963
  deposit: (_d = ports.deposit) !== null && _d !== void 0 ? _d : ((params) => this._deposits.deposit(params)),
25964
+ depositBatch: ports.depositBatch,
25715
25965
  now: ports.now,
25716
25966
  }, {
25717
25967
  contractTtlMs: opts === null || opts === void 0 ? void 0 : opts.contractTtlMs,
25718
25968
  // Per key here too, for the same reason the ports are: an
25719
25969
  // explicit `spender: undefined` must not delete the default.
25720
25970
  spender: (_e = opts === null || opts === void 0 ? void 0 : opts.spender) !== null && _e !== void 0 ? _e : this._spender,
25971
+ stableAsset: (_f = opts === null || opts === void 0 ? void 0 : opts.stableAsset) !== null && _f !== void 0 ? _f : this._stableAsset,
25721
25972
  });
25722
25973
  }
25723
25974
  /**
@@ -26478,6 +26729,7 @@ class PortfolioFacade {
26478
26729
  */
26479
26730
  class Kasu {
26480
26731
  constructor(sdk, chainConfig, signerOrProvider, configOverrides) {
26732
+ var _a;
26481
26733
  this._sdk = sdk;
26482
26734
  this._chainConfig = chainConfig;
26483
26735
  this._signerOrProvider = signerOrProvider;
@@ -26489,7 +26741,7 @@ class Kasu {
26489
26741
  const isReadOnly = !Signer.isSigner(signerOrProvider);
26490
26742
  this.deposits = new DepositsFacade(sdk.UserLending, chainConfig.chainId.toString(), isReadOnly);
26491
26743
  this.portfolio = new PortfolioFacade(sdk.DataService, sdk.UserLending, sdk.Portfolio);
26492
- this.flows = new FlowsFacade(this.deposits, () => erc20Of(chainConfig, signerOrProvider), isReadOnly, chainConfig.contracts.LendingPoolManager);
26744
+ this.flows = new FlowsFacade(this.deposits, () => erc20Of(chainConfig, signerOrProvider), isReadOnly, chainConfig.contracts.LendingPoolManager, (_a = stableAssetOf(chainConfig)) === null || _a === void 0 ? void 0 : _a.address);
26493
26745
  }
26494
26746
  /**
26495
26747
  * Create a Kasu instance with built-in chain config.
@@ -27150,4 +27402,4 @@ function getTrancheDisplayName(trancheName, pool) {
27150
27402
  : trancheName;
27151
27403
  }
27152
27404
 
27153
- export { APXIUM, AU_ALPHA3, AU_MIN_CUMULATIVE_BY_STABLE, CHAIN_CONFIGS, CLEARING_WINDOW_SECONDS, CONTRACT_TTL_MS, DepositFlow, DepositsFacade, EPOCHS_IN_YEAR, Flow, FlowStore, FlowsFacade, INVALID_ACCEPTANCE_SIGNATURE_MESSAGE, INVALID_AUTH_SIGNATURE_MESSAGE, INVOICEMATE, Kasu, KasuSdk, MAX_LENDING_AMOUNT_FALLBACK, MIN_LENDING_AMOUNT_FALLBACK, MIN_TRANCHE_CAPACITY, NO_DIRECTUS_URL_MESSAGE, NO_KYC_PARAMS_MESSAGE, NO_SPENDER_MESSAGE, PortfolioFacade, READ_ONLY_MESSAGE, RIXON_CAPITAL, SdkConfig, StrategiesFacade, UPPER_MEZZANINE, WithdrawFlow, apyToEpochRate, asContractType, auMinimumRemaining, auThresholdFor, buildContractVersionType, buildFullNameRequestMessage, buildLegacyContractRequestMessage, buildLoanAgreementSignMessage, ceilToCents, classifyWalletFailure, compareTrancheSeniority, computeSettlementWindow, countSubmissions, decodeRevert, deriveCycleDates, derivePoolStatus, deriveRequestState, encodeDepositData, epochRateToApy, extractRevertData, fetchUnusedPoolIds, firstSubmissionTimestamp, floorToCents, formatSignTimestampUtc, getCreditOriginator, getInstitutionalLender, getTrancheDisplayName, isAuMinimumExempt, isAustralianKyc, isBelowMinimumCapacity, isCycleClosed, isUnpredictableGas, isUserRejected, lastEventTimestamp, maxNetRateCeiling, netEffectiveApy, netTrancheApyBounds, nextCycleBoundary, parseFormattedMessage, parseMinorUnits, parseTrancheBound, pickDefaultTrancheId, pickHighestYieldTranche, poolAllTranchesFull, poolMaxApy, resolveBoundShortcuts, resolveDepositBounds, selectVisiblePools, submissionEvents, trancheApyBounds, trancheHasCapacity, trancheRiskRank };
27405
+ export { APXIUM, AU_ALPHA3, AU_MIN_CUMULATIVE_BY_STABLE, BatchRevertedError, CHAIN_CONFIGS, CLEARING_WINDOW_SECONDS, CONTRACT_TTL_MS, DepositFlow, DepositsFacade, EPOCHS_IN_YEAR, Flow, FlowStore, FlowsFacade, INVALID_ACCEPTANCE_SIGNATURE_MESSAGE, INVALID_AUTH_SIGNATURE_MESSAGE, INVOICEMATE, Kasu, KasuSdk, MAX_LENDING_AMOUNT_FALLBACK, MIN_LENDING_AMOUNT_FALLBACK, MIN_TRANCHE_CAPACITY, NO_DIRECTUS_URL_MESSAGE, NO_KYC_PARAMS_MESSAGE, NO_SPENDER_MESSAGE, PortfolioFacade, READ_ONLY_MESSAGE, RIXON_CAPITAL, SdkConfig, StrategiesFacade, UPPER_MEZZANINE, WithdrawFlow, apyToEpochRate, asContractType, auMinimumRemaining, auThresholdFor, buildContractVersionType, buildFullNameRequestMessage, buildLegacyContractRequestMessage, buildLoanAgreementSignMessage, ceilToCents, classifyWalletFailure, compareTrancheSeniority, computeSettlementWindow, countSubmissions, decodeRevert, deriveCycleDates, derivePoolStatus, deriveRequestState, encodeDepositData, epochRateToApy, extractRevertData, fetchUnusedPoolIds, firstSubmissionTimestamp, floorToCents, formatSignTimestampUtc, getCreditOriginator, getInstitutionalLender, getTrancheDisplayName, isAuMinimumExempt, isAustralianKyc, isBelowMinimumCapacity, isCycleClosed, isUnpredictableGas, isUserRejected, lastEventTimestamp, maxNetRateCeiling, netEffectiveApy, netTrancheApyBounds, nextCycleBoundary, parseFormattedMessage, parseMinorUnits, parseTrancheBound, pickDefaultTrancheId, pickHighestYieldTranche, poolAllTranchesFull, poolMaxApy, resolveBoundShortcuts, resolveDepositBounds, selectVisiblePools, submissionEvents, trancheApyBounds, trancheHasCapacity, trancheRiskRank };
@@ -55,6 +55,12 @@ export declare class FlowsFacade {
55
55
  * contract.
56
56
  */
57
57
  private readonly _spender;
58
+ /**
59
+ * This chain's stable token address — the target of the batch path's
60
+ * approve. `undefined` for a hand-built config without `stableAsset`,
61
+ * in which case a run never batches: it does not guess a token.
62
+ */
63
+ private readonly _stableAsset?;
58
64
  constructor(_deposits: DepositsFacade,
59
65
  /**
60
66
  * The chain's stable token, bound to whatever the Kasu instance holds.
@@ -71,7 +77,13 @@ export declare class FlowsFacade {
71
77
  * an address whose only wrong value grants an approval to the wrong
72
78
  * contract.
73
79
  */
74
- _spender: string);
80
+ _spender: string,
81
+ /**
82
+ * This chain's stable token address — the target of the batch path's
83
+ * approve. `undefined` for a hand-built config without `stableAsset`,
84
+ * in which case a run never batches: it does not guess a token.
85
+ */
86
+ _stableAsset?: string | undefined);
75
87
  /**
76
88
  * A deposit pipeline. `readAllowance`, `approve`, `deposit` and
77
89
  * `buildKycParams` default to the SDK's own implementations; pass any of
@@ -83,6 +95,10 @@ export declare class FlowsFacade {
83
95
  * delete the default it was meant to keep, and
84
96
  * `approve: sponsoredGas ? sponsoredApprove : undefined` is exactly how a
85
97
  * consumer writes a conditional override.
98
+ *
99
+ * `depositBatch` has NO default: how several calls become one atomic
100
+ * transaction is the application's business. Supplying it lets a run
101
+ * whose allowance is short approve and deposit in one batch.
86
102
  */
87
103
  deposit(ports: DepositFlowPortOverrides, opts?: DepositFlowOptions): DepositFlow;
88
104
  /**
@@ -47,11 +47,18 @@ export class FlowsFacade {
47
47
  * an address whose only wrong value grants an approval to the wrong
48
48
  * contract.
49
49
  */
50
- _spender) {
50
+ _spender,
51
+ /**
52
+ * This chain's stable token address — the target of the batch path's
53
+ * approve. `undefined` for a hand-built config without `stableAsset`,
54
+ * in which case a run never batches: it does not guess a token.
55
+ */
56
+ _stableAsset) {
51
57
  this._deposits = _deposits;
52
58
  this._erc20 = _erc20;
53
59
  this._isReadOnly = _isReadOnly;
54
60
  this._spender = _spender;
61
+ this._stableAsset = _stableAsset;
55
62
  }
56
63
  /**
57
64
  * A deposit pipeline. `readAllowance`, `approve`, `deposit` and
@@ -64,9 +71,13 @@ export class FlowsFacade {
64
71
  * delete the default it was meant to keep, and
65
72
  * `approve: sponsoredGas ? sponsoredApprove : undefined` is exactly how a
66
73
  * consumer writes a conditional override.
74
+ *
75
+ * `depositBatch` has NO default: how several calls become one atomic
76
+ * transaction is the application's business. Supplying it lets a run
77
+ * whose allowance is short approve and deposit in one batch.
67
78
  */
68
79
  deposit(ports, opts) {
69
- var _a, _b, _c, _d, _e;
80
+ var _a, _b, _c, _d, _e, _f;
70
81
  return new DepositFlow({
71
82
  signMessage: ports.signMessage,
72
83
  generateContract: ports.generateContract,
@@ -81,12 +92,14 @@ export class FlowsFacade {
81
92
  return yield this._erc20().approve(spender, amount);
82
93
  })),
83
94
  deposit: (_d = ports.deposit) !== null && _d !== void 0 ? _d : ((params) => this._deposits.deposit(params)),
95
+ depositBatch: ports.depositBatch,
84
96
  now: ports.now,
85
97
  }, {
86
98
  contractTtlMs: opts === null || opts === void 0 ? void 0 : opts.contractTtlMs,
87
99
  // Per key here too, for the same reason the ports are: an
88
100
  // explicit `spender: undefined` must not delete the default.
89
101
  spender: (_e = opts === null || opts === void 0 ? void 0 : opts.spender) !== null && _e !== void 0 ? _e : this._spender,
102
+ stableAsset: (_f = opts === null || opts === void 0 ? void 0 : opts.stableAsset) !== null && _f !== void 0 ? _f : this._stableAsset,
90
103
  });
91
104
  }
92
105
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"flows.js","sourceRoot":"","sources":["../../src/facade/flows.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EACH,WAAW,EAIX,YAAY,GAEf,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAwBhD;;;;;;;;;;;;;;;;;;;;GAo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AAW,CAAC,CAAC;SACtE,CAAC,CAAC;IACP,CAAC;IAEO,eAAe;QACnB,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACvC,CAAC;IACL,CAAC;CACJ"}
@@ -31,6 +31,7 @@ import { PortfolioFacade } from './user-portfolio';
31
31
  */
32
32
  export class Kasu {
33
33
  constructor(sdk, chainConfig, signerOrProvider, configOverrides) {
34
+ var _a;
34
35
  this._sdk = sdk;
35
36
  this._chainConfig = chainConfig;
36
37
  this._signerOrProvider = signerOrProvider;
@@ -42,7 +43,7 @@ export class Kasu {
42
43
  const isReadOnly = !Signer.isSigner(signerOrProvider);
43
44
  this.deposits = new DepositsFacade(sdk.UserLending, chainConfig.chainId.toString(), isReadOnly);
44
45
  this.portfolio = new PortfolioFacade(sdk.DataService, sdk.UserLending, sdk.Portfolio);
45
- this.flows = new FlowsFacade(this.deposits, () => erc20Of(chainConfig, signerOrProvider), isReadOnly, chainConfig.contracts.LendingPoolManager);
46
+ this.flows = new FlowsFacade(this.deposits, () => erc20Of(chainConfig, signerOrProvider), isReadOnly, chainConfig.contracts.LendingPoolManager, (_a = stableAssetOf(chainConfig)) === null || _a === void 0 ? void 0 : _a.address);
46
47
  }
47
48
  /**
48
49
  * Create a Kasu instance with built-in chain config.
@@ -1 +1 @@
1
- {"version":3,"file":"kasu.js","sourceRoot":"","sources":["../../src/facade/kasu.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,SAAS,EAAoB,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA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