@rhea-finance/cross-chain-sdk 0.1.14 → 0.1.15

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/dist/index.cjs CHANGED
@@ -18187,7 +18187,10 @@ async function fetchIntentsQuotation(params) {
18187
18187
  const response = await fetch(`${oneClickUrl}/quote`, {
18188
18188
  method: "POST",
18189
18189
  headers: {
18190
- "Content-type": "application/json; charset=UTF-8"
18190
+ "Content-type": "application/json; charset=UTF-8",
18191
+ ...params.authorization ? {
18192
+ Authorization: params.authorization
18193
+ } : {}
18191
18194
  },
18192
18195
  body: JSON.stringify(res_params)
18193
18196
  }).then((res) => {
@@ -18213,12 +18216,13 @@ async function fetchIntentsCreateOrder(params) {
18213
18216
  }).then((res) => {
18214
18217
  return res.json();
18215
18218
  });
18216
- return normalizeIntentsQuoteResponse(response);
18219
+ const normalizedResponse = normalizeIntentsQuoteResponse(response);
18220
+ if (normalizedResponse.quoteStatus === "success") {
18221
+ return normalizedResponse;
18222
+ }
18223
+ return fetchIntentsQuotation(params);
18217
18224
  } catch (error) {
18218
- return {
18219
- quoteStatus: "error",
18220
- message: error?.message || error?.error
18221
- };
18225
+ return fetchIntentsQuotation(params);
18222
18226
  }
18223
18227
  }
18224
18228
  async function fetchIntentsOrders(params) {
@@ -20238,7 +20242,8 @@ async function intentsQuotation({
20238
20242
  customRecipientMsg,
20239
20243
  isReverse,
20240
20244
  dry,
20241
- slippageTolerance
20245
+ slippageTolerance,
20246
+ authorization
20242
20247
  }) {
20243
20248
  const res_quote = await fetchIntentsQuotation({
20244
20249
  originAsset,
@@ -20249,6 +20254,7 @@ async function intentsQuotation({
20249
20254
  isReverse,
20250
20255
  dry,
20251
20256
  slippageTolerance,
20257
+ authorization,
20252
20258
  ...customRecipientMsg ? { customRecipientMsg } : {}
20253
20259
  });
20254
20260
  return res_quote;
@@ -21136,6 +21142,7 @@ var BSC_USDT_INTENTS_ASSET_ID = "nep245:v2_1.omni.hot.tg:56_2CMMyVTGZkeyNZTSvS5s
21136
21142
  var NEAR_USDT_INTENTS_ASSET_ID = "nep141:usdt.tether-token.near";
21137
21143
  var BSC_NRUSDT_INTENTS_ASSET_ID = "1cs_v1:bsc:bep20:0x5382555840ef9f54ef6d3ee5da60f12bcabf4b87";
21138
21144
  var NEAR_NRUSDT_INTENTS_ASSET_ID = "nep141:lsd-usdt.rhealab.near";
21145
+ var LSD_INTENTS_QUOTE_AUTHORIZATION = "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjIwMjUtMDEtMTItdjEifQ.eyJ2IjoxLCJrZXlfdHlwZSI6ImRpc3RyaWJ1dGlvbl9jaGFubmVsIiwicGFydG5lcl9pZCI6InJoZWEiLCJpYXQiOjE3NzAwMjQ0MjQsImV4cCI6MTgwMTU2MDQyNH0.EAKZgGKPVLJkf1gbPAETZQ_sz20sTSg-QHbWBKWJWELMLQqQpA0Tbe8QJU7FuoQZRnor6osDEL-Wv6wWFxM0nWGKtU0ov7k5QhYsEQe-MhR-kEHA9YNz2Wm9YHCbf2fhTt7HJqN9lRTpfMqB67QaA9muGjYx8J50wh0plcfD-FVaOTHyyv4HNiQM_GTlxLwE9yHgrdBYh-okySMFX2Ok565vOe0nqjl2naJ86qatJyVrOUovGSbZJ1gO-NLfFafz2zjmTcIZsZOA5qGoiqEfg48ur5ISg-F94rNgdWU-PlIJLsCD-bEstEsUF8wQwxdQPbmNMFO4F7CCD7OmwZ5mLw";
21139
21146
 
21140
21147
  // src/lsd/intents.ts
21141
21148
  init_polyfills();
@@ -21244,7 +21251,8 @@ async function quoteBscUsdtToNearUsdt(params) {
21244
21251
  recipient: params.recipient,
21245
21252
  customRecipientMsg: params.customRecipientMsg,
21246
21253
  dry: params.dry,
21247
- slippageTolerance: params.slippageTolerance
21254
+ slippageTolerance: params.slippageTolerance,
21255
+ authorization: LSD_INTENTS_QUOTE_AUTHORIZATION
21248
21256
  });
21249
21257
  }
21250
21258
  async function quoteNearLsdToBscLsd(params) {
@@ -21256,7 +21264,8 @@ async function quoteNearLsdToBscLsd(params) {
21256
21264
  recipient: params.recipient,
21257
21265
  customRecipientMsg: params.customRecipientMsg,
21258
21266
  dry: params.dry,
21259
- slippageTolerance: params.slippageTolerance
21267
+ slippageTolerance: params.slippageTolerance,
21268
+ authorization: LSD_INTENTS_QUOTE_AUTHORIZATION
21260
21269
  });
21261
21270
  }
21262
21271
  async function quoteBscLsdToNearLsd(params) {
@@ -21268,7 +21277,8 @@ async function quoteBscLsdToNearLsd(params) {
21268
21277
  recipient: params.recipient,
21269
21278
  customRecipientMsg: params.customRecipientMsg,
21270
21279
  dry: params.dry,
21271
- slippageTolerance: params.slippageTolerance
21280
+ slippageTolerance: params.slippageTolerance,
21281
+ authorization: LSD_INTENTS_QUOTE_AUTHORIZATION
21272
21282
  });
21273
21283
  }
21274
21284
  async function quoteNearUsdtToBscUsdt(params) {
@@ -21280,7 +21290,8 @@ async function quoteNearUsdtToBscUsdt(params) {
21280
21290
  recipient: params.recipient,
21281
21291
  customRecipientMsg: params.customRecipientMsg,
21282
21292
  dry: params.dry,
21283
- slippageTolerance: params.slippageTolerance
21293
+ slippageTolerance: params.slippageTolerance,
21294
+ authorization: LSD_INTENTS_QUOTE_AUTHORIZATION
21284
21295
  });
21285
21296
  }
21286
21297
  async function createOrderBscUsdtToNearUsdt(params) {
@@ -21771,6 +21782,7 @@ exports.BURROW_CONTRACT_ID = BURROW_CONTRACT_ID;
21771
21782
  exports.DEFAULT_POSITION = DEFAULT_POSITION;
21772
21783
  exports.FRACTION_DIGITS = FRACTION_DIGITS;
21773
21784
  exports.LSD_CONTRACT_ID = LSD_CONTRACT_ID;
21785
+ exports.LSD_INTENTS_QUOTE_AUTHORIZATION = LSD_INTENTS_QUOTE_AUTHORIZATION;
21774
21786
  exports.LSD_USDT_DECIMALS = LSD_USDT_DECIMALS;
21775
21787
  exports.MAX_RATIO = MAX_RATIO;
21776
21788
  exports.NDeposit = NDeposit;