@multiversx/sdk-dapp-liquidity 2.1.0-alpha.1 → 2.1.0-alpha.2

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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@multiversx/sdk-dapp-liquidity",
3
3
  "author": "MultiversX",
4
- "description": "A complete toolkit for bridging assets between MultiversX, Ethereum, and BNB Chain",
4
+ "description": "A complete toolkit for bridging assets between MultiversX, Ethereum, BNB Chain and Sui",
5
5
  "license": "MIT",
6
- "version": "2.1.0-alpha.1",
6
+ "version": "2.1.0-alpha.2",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/multiversx/mx-sdk-dapp-liquidity.git"
@@ -15,6 +15,7 @@
15
15
  "binance chain",
16
16
  "blockchain",
17
17
  "evm",
18
+ "sui",
18
19
  "dapp integration",
19
20
  "bridge form",
20
21
  "bridge sdk",
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../../types/chainType.js"),f=require("../../../constants/index.js"),l=require("../../../utils/getCompletePathname.js"),y=({firstTokenId:e,secondTokenId:r,callbackRoute:s,isTokensLoading:n,onNavigate:i})=>{var o,a;if(n)return;const u=l.getCompletePathname(),t=new URLSearchParams(f.safeWindow.location.search);e&&t.set("firstToken",e),r&&t.set("secondToken",r);const d=`${s}?${t.toString()}`;u!==d&&((a=(o=f.safeWindow.history)==null?void 0:o.replaceState)==null||a.call(o,null,"",d),i==null||i(d,{replace:!0}))};function m(e,r){var s,n;return(s=e.suiParams)!=null&&s.transactionBytes&&((n=e.suiParams)!=null&&n.sender)?c.ChainType.sui:e.instructions&&e.feePayer?c.ChainType.sol:e.bitcoinParams?c.ChainType.btc:e.to&&e.data!==void 0?c.ChainType.evm:r==null?void 0:r.chainType}const p=(e,r,s)=>{if(s){const i=r==null?void 0:r.find(u=>u.symbol.toLowerCase()===s.toLowerCase());return i?[i]:[]}if(!(e!=null&&e.availableTokens))return[];const n=[];for(const i of e.availableTokens){const u=r==null?void 0:r.find(t=>t.address.toLowerCase()===i.address.toLowerCase());u&&n.push(u)}return n},h=(e,r)=>e.find(s=>s.symbol.toLowerCase().includes("usdc"))??(r==null?void 0:r.find(s=>s.symbol.toLowerCase().includes("usdc")));exports.getAvailableTokens=p;exports.getDefaultReceivingToken=h;exports.resolveSigningChainType=m;exports.updateUrlParams=y;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../../types/chainType.js"),c=require("../../../constants/index.js"),d=require("../../../utils/getCompletePathname.js"),f=({firstTokenId:e,secondTokenId:r,callbackRoute:s,isTokensLoading:n,onNavigate:t})=>{if(n)return;const i=d.getCompletePathname(),u=new URLSearchParams(c.safeWindow.location.search);e&&u.set("firstToken",e),r&&u.set("secondToken",r);const a=`${s}?${u.toString()}`};function m(e,r){var s,n;return(s=e.suiParams)!=null&&s.transactionBytes&&((n=e.suiParams)!=null&&n.sender)?o.ChainType.sui:e.instructions&&e.feePayer?o.ChainType.sol:e.bitcoinParams?o.ChainType.btc:e.to&&e.data!==void 0?o.ChainType.evm:r==null?void 0:r.chainType}const y=(e,r,s)=>{if(s){const t=r==null?void 0:r.find(i=>i.symbol.toLowerCase()===s.toLowerCase());return t?[t]:[]}if(!(e!=null&&e.availableTokens))return[];const n=[];for(const t of e.availableTokens){const i=r==null?void 0:r.find(u=>u.address.toLowerCase()===t.address.toLowerCase());i&&n.push(i)}return n},l=(e,r)=>e.find(s=>s.symbol.toLowerCase().includes("usdc"))??(r==null?void 0:r.find(s=>s.symbol.toLowerCase().includes("usdc")));exports.getAvailableTokens=y;exports.getDefaultReceivingToken=l;exports.resolveSigningChainType=m;exports.updateUrlParams=f;
@@ -1,46 +1,44 @@
1
1
  import { ChainType as t } from "../../../../types/chainType.mjs";
2
- import { safeWindow as c } from "../../../constants/index.mjs";
3
- import { getCompletePathname as w } from "../../../utils/getCompletePathname.mjs";
4
- const p = ({
2
+ import { safeWindow as d } from "../../../constants/index.mjs";
3
+ import { getCompletePathname as m } from "../../../utils/getCompletePathname.mjs";
4
+ const a = ({
5
5
  firstTokenId: e,
6
6
  secondTokenId: r,
7
7
  callbackRoute: s,
8
8
  isTokensLoading: i,
9
- onNavigate: u
9
+ onNavigate: o
10
10
  }) => {
11
- var n, m;
12
11
  if (i)
13
12
  return;
14
- const o = w(), f = new URLSearchParams(c.location.search);
15
- e && f.set("firstToken", e), r && f.set("secondToken", r);
16
- const d = `${s}?${f.toString()}`;
17
- o !== d && ((m = (n = c.history) == null ? void 0 : n.replaceState) == null || m.call(n, null, "", d), u == null || u(d, { replace: !0 }));
13
+ const u = m(), n = new URLSearchParams(d.location.search);
14
+ e && n.set("firstToken", e), r && n.set("secondToken", r);
15
+ const f = `${s}?${n.toString()}`;
18
16
  };
19
- function L(e, r) {
17
+ function P(e, r) {
20
18
  var s, i;
21
19
  return (s = e.suiParams) != null && s.transactionBytes && ((i = e.suiParams) != null && i.sender) ? t.sui : e.instructions && e.feePayer ? t.sol : e.bitcoinParams ? t.btc : e.to && e.data !== void 0 ? t.evm : r == null ? void 0 : r.chainType;
22
20
  }
23
- const h = (e, r, s) => {
21
+ const y = (e, r, s) => {
24
22
  if (s) {
25
- const u = r == null ? void 0 : r.find(
26
- (o) => o.symbol.toLowerCase() === s.toLowerCase()
23
+ const o = r == null ? void 0 : r.find(
24
+ (u) => u.symbol.toLowerCase() === s.toLowerCase()
27
25
  );
28
- return u ? [u] : [];
26
+ return o ? [o] : [];
29
27
  }
30
28
  if (!(e != null && e.availableTokens))
31
29
  return [];
32
30
  const i = [];
33
- for (const u of e.availableTokens) {
34
- const o = r == null ? void 0 : r.find(
35
- (f) => f.address.toLowerCase() === u.address.toLowerCase()
31
+ for (const o of e.availableTokens) {
32
+ const u = r == null ? void 0 : r.find(
33
+ (n) => n.address.toLowerCase() === o.address.toLowerCase()
36
34
  );
37
- o && i.push(o);
35
+ u && i.push(u);
38
36
  }
39
37
  return i;
40
- }, C = (e, r) => e.find((s) => s.symbol.toLowerCase().includes("usdc")) ?? (r == null ? void 0 : r.find((s) => s.symbol.toLowerCase().includes("usdc")));
38
+ }, L = (e, r) => e.find((s) => s.symbol.toLowerCase().includes("usdc")) ?? (r == null ? void 0 : r.find((s) => s.symbol.toLowerCase().includes("usdc")));
41
39
  export {
42
- h as getAvailableTokens,
43
- C as getDefaultReceivingToken,
44
- L as resolveSigningChainType,
45
- p as updateUrlParams
40
+ y as getAvailableTokens,
41
+ L as getDefaultReceivingToken,
42
+ P as resolveSigningChainType,
43
+ a as updateUrlParams
46
44
  };