@coinlist-co/react 0.12.1-rc.e183ffd → 0.12.1-rc.f51a0c2

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.
@@ -77,7 +77,7 @@ __export(universal_exports, {
77
77
  OAuthRefreshToken: () => OAuthRefreshToken,
78
78
  OAuthSession: () => OAuthSession,
79
79
  ONDO_POLL_INTERVAL_MS: () => ONDO_POLL_INTERVAL_MS,
80
- ONDO_QUOTE_EXPIRY_THRESHOLD_MS: () => ONDO_QUOTE_EXPIRY_THRESHOLD_MS,
80
+ ONDO_QUOTE_MAX_TTL_MS: () => ONDO_QUOTE_MAX_TTL_MS,
81
81
  ONDO_SETTLEMENT_ASSET: () => ONDO_SETTLEMENT_ASSET,
82
82
  ONDO_SUPPORTED_INPUT_ASSETS: () => ONDO_SUPPORTED_INPUT_ASSETS,
83
83
  Offer: () => Offer,
@@ -173,6 +173,7 @@ __export(universal_exports, {
173
173
  isChain: () => isChain,
174
174
  isOfferType: () => isOfferType,
175
175
  isSwapAvailable: () => isSwapAvailable,
176
+ ondoQuoteOfferDeadline: () => ondoQuoteOfferDeadline,
176
177
  parseBlockchainAmount: () => parseBlockchainAmount,
177
178
  parseUint256: () => parseUint256,
178
179
  shortenAddress: () => shortenAddress,
@@ -1191,7 +1192,7 @@ var TOKEN_REGISTRY = {
1191
1192
 
1192
1193
  // src/universal/core/checkout/ondo/constants.ts
1193
1194
  var ONDO_POLL_INTERVAL_MS = 15e3;
1194
- var ONDO_QUOTE_EXPIRY_THRESHOLD_MS = 5e3;
1195
+ var ONDO_QUOTE_MAX_TTL_MS = 15e3;
1195
1196
  var DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE = DecimalString("1000");
1196
1197
  var ONDO_SETTLEMENT_ASSET = USDC_SYMBOL;
1197
1198
  var DEFAULT_ONDO_SELL_TOKENS_TO_COMPUTE_PRICE = 1;
@@ -1214,6 +1215,9 @@ function computeOndoSellPrice(transaction) {
1214
1215
  shares: spendInputAmount
1215
1216
  });
1216
1217
  }
1218
+ function ondoQuoteOfferDeadline(expiresAt, nowMs = Date.now()) {
1219
+ return new Date(Math.min(expiresAt.getTime(), nowMs + ONDO_QUOTE_MAX_TTL_MS));
1220
+ }
1217
1221
  function grossProceeds(expected) {
1218
1222
  const raw = expected.quantity.raw + expected.fee.raw;
1219
1223
  if (raw > MAX_UINT_256) {
@@ -3865,7 +3869,7 @@ var User = {
3865
3869
  OAuthRefreshToken,
3866
3870
  OAuthSession,
3867
3871
  ONDO_POLL_INTERVAL_MS,
3868
- ONDO_QUOTE_EXPIRY_THRESHOLD_MS,
3872
+ ONDO_QUOTE_MAX_TTL_MS,
3869
3873
  ONDO_SETTLEMENT_ASSET,
3870
3874
  ONDO_SUPPORTED_INPUT_ASSETS,
3871
3875
  Offer,
@@ -3961,6 +3965,7 @@ var User = {
3961
3965
  isChain,
3962
3966
  isOfferType,
3963
3967
  isSwapAvailable,
3968
+ ondoQuoteOfferDeadline,
3964
3969
  parseBlockchainAmount,
3965
3970
  parseUint256,
3966
3971
  shortenAddress,