@rhea-finance/cross-chain-sdk 0.1.16 → 0.1.18

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
@@ -17530,6 +17530,7 @@ var NEAR_CONFIGS = {
17530
17530
  dataServiceUrl: "https://apidata.rhea.finance",
17531
17531
  txIdApiUrl: "https://api3.nearblocks.io",
17532
17532
  oneClickUrl: "https://1click.chaindefuser.com/v0",
17533
+ oneClickProxyUrl: "https://api.rhea.finance/api/1click",
17533
17534
  findPathUrl: "https://smartrouter.rhea.finance",
17534
17535
  hiddenAssets: [
17535
17536
  "meta-token.near",
@@ -17560,6 +17561,7 @@ var NEAR_CONFIGS = {
17560
17561
  dataServiceUrl: "https://apidata.rhea.finance",
17561
17562
  txIdApiUrl: "https://api3.nearblocks.io",
17562
17563
  oneClickUrl: "https://1click.chaindefuser.com/v0",
17564
+ oneClickProxyUrl: "https://api.rhea.finance/api/1click",
17563
17565
  findPathUrl: "https://smartrouter.rhea.finance",
17564
17566
  hiddenAssets: [
17565
17567
  "meta-token.near",
@@ -17582,6 +17584,14 @@ var setSdkEnv = (env) => {
17582
17584
  var getSdkEnv = () => {
17583
17585
  return currentSdkEnv;
17584
17586
  };
17587
+ var DEFAULT_REFERRAL = "rhea";
17588
+ var currentReferral = DEFAULT_REFERRAL;
17589
+ var setReferral = (referral) => {
17590
+ currentReferral = referral || DEFAULT_REFERRAL;
17591
+ };
17592
+ var getReferral = () => {
17593
+ return currentReferral;
17594
+ };
17585
17595
  var customNodeUrls = {};
17586
17596
  var setCustomNodeUrl = (nodeUrl) => {
17587
17597
  customNodeUrls[currentSdkEnv] = nodeUrl;
@@ -18017,6 +18027,7 @@ init_polyfills();
18017
18027
  function getNearRuntimeUrls() {
18018
18028
  return {
18019
18029
  oneClickUrl: config_near.oneClickUrl,
18030
+ oneClickProxyUrl: config_near.oneClickProxyUrl,
18020
18031
  indexUrl: config_near.indexUrl,
18021
18032
  findPathUrl: config_near.findPathUrl
18022
18033
  };
@@ -18222,7 +18233,7 @@ function buildIntentsQuoteRequest(params) {
18222
18233
  recipientType: "DESTINATION_CHAIN",
18223
18234
  depositType: "ORIGIN_CHAIN",
18224
18235
  deadline: new Date(Date.now() + 1 * 60 * 60 * 1e3).toISOString(),
18225
- referral: "rhea",
18236
+ referral: getReferral(),
18226
18237
  quoteWaitingTimeMs: 3e3,
18227
18238
  slippageTolerance: typeof params.slippageTolerance == "number" ? params.slippageTolerance : 50
18228
18239
  };
@@ -18253,8 +18264,8 @@ function normalizeIntentsQuoteResponse(response) {
18253
18264
  async function fetchIntentsQuotation(params) {
18254
18265
  try {
18255
18266
  const res_params = buildIntentsQuoteRequest(params);
18256
- const { oneClickUrl } = getNearRuntimeUrls();
18257
- const response = await fetch(`${oneClickUrl}/quote`, {
18267
+ const { oneClickProxyUrl } = getNearRuntimeUrls();
18268
+ const response = await fetch(`${oneClickProxyUrl}/quote`, {
18258
18269
  method: "POST",
18259
18270
  headers: {
18260
18271
  "Content-type": "application/json; charset=UTF-8",
@@ -18327,9 +18338,9 @@ async function fetchIntentsOrders(params) {
18327
18338
  }
18328
18339
  async function fetchIntentsTransactionStatus(depositAddress) {
18329
18340
  try {
18330
- const { oneClickUrl } = getNearRuntimeUrls();
18341
+ const { oneClickProxyUrl } = getNearRuntimeUrls();
18331
18342
  const response = await fetch(
18332
- `${oneClickUrl}/status?depositAddress=${depositAddress}`,
18343
+ `${oneClickProxyUrl}/status?depositAddress=${depositAddress}`,
18333
18344
  {
18334
18345
  method: "GET",
18335
18346
  headers: {
@@ -21931,6 +21942,7 @@ exports.getNearValue = getNearValue;
21931
21942
  exports.getNearValuesPaged = getNearValuesPaged;
21932
21943
  exports.getPrices = getPrices;
21933
21944
  exports.getPublicKeyByTAddress = getPublicKeyByTAddress;
21945
+ exports.getReferral = getReferral;
21934
21946
  exports.getRepayCustomRecipientMsg = getRepayCustomRecipientMsg;
21935
21947
  exports.getSdkEnv = getSdkEnv;
21936
21948
  exports.getSignature = getSignature;
@@ -21990,6 +22002,7 @@ exports.recomputeHealthFactorSupply = recomputeHealthFactorSupply;
21990
22002
  exports.recomputeHealthFactorWithdraw = recomputeHealthFactorWithdraw;
21991
22003
  exports.serializationObj = serializationObj;
21992
22004
  exports.setCustomNodeUrl = setCustomNodeUrl;
22005
+ exports.setReferral = setReferral;
21993
22006
  exports.setSdkEnv = setSdkEnv;
21994
22007
  exports.shrinkToken = shrinkToken;
21995
22008
  exports.shrinkTokenDecimal = shrinkTokenDecimal;