@xswap-link/sdk 0.11.1 → 0.11.3
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/CHANGELOG.md +13 -0
- package/dist/index.global.js +460 -700
- package/dist/index.js +35 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/config/wagmiConfig.ts +34 -2
- package/src/services/integrations/transactions.ts +3 -2
package/dist/index.mjs
CHANGED
|
@@ -25113,6 +25113,7 @@ var ArrowIcon = () => {
|
|
|
25113
25113
|
};
|
|
25114
25114
|
|
|
25115
25115
|
// src/config/wagmiConfig.ts
|
|
25116
|
+
import { defineChain } from "viem";
|
|
25116
25117
|
import * as WagmiChains from "viem/chains";
|
|
25117
25118
|
import { mainnet } from "viem/chains";
|
|
25118
25119
|
import { createConfig, createStorage, http } from "@wagmi/core";
|
|
@@ -25143,7 +25144,39 @@ var mapChains = (supportedChains) => {
|
|
|
25143
25144
|
(chain) => chain.id !== mainnet.id && supportedChains.some(({ chainId }) => chainId === chain.id.toString())
|
|
25144
25145
|
)
|
|
25145
25146
|
);
|
|
25146
|
-
|
|
25147
|
+
for (const s of supportedChains) {
|
|
25148
|
+
if (s.ecosystem !== "evm") continue;
|
|
25149
|
+
const id2 = Number(s.chainId);
|
|
25150
|
+
const exists = result.some((c) => c.id === id2);
|
|
25151
|
+
if (!exists) {
|
|
25152
|
+
const custom = defineChain({
|
|
25153
|
+
id: id2,
|
|
25154
|
+
name: s.name,
|
|
25155
|
+
nativeCurrency: {
|
|
25156
|
+
name: s.tokenSymbol,
|
|
25157
|
+
symbol: s.tokenSymbol,
|
|
25158
|
+
decimals: 18
|
|
25159
|
+
},
|
|
25160
|
+
rpcUrls: {
|
|
25161
|
+
default: { http: s.publicRpcUrls }
|
|
25162
|
+
},
|
|
25163
|
+
blockExplorers: {
|
|
25164
|
+
default: {
|
|
25165
|
+
name: s.transactionExplorer.match(/\/\/([^.]*)\./)?.[1] || "",
|
|
25166
|
+
url: s.transactionExplorer
|
|
25167
|
+
}
|
|
25168
|
+
}
|
|
25169
|
+
});
|
|
25170
|
+
result.push(custom);
|
|
25171
|
+
}
|
|
25172
|
+
}
|
|
25173
|
+
const seen = /* @__PURE__ */ new Set();
|
|
25174
|
+
const deduped = result.filter((c) => {
|
|
25175
|
+
if (seen.has(c.id)) return false;
|
|
25176
|
+
seen.add(c.id);
|
|
25177
|
+
return true;
|
|
25178
|
+
});
|
|
25179
|
+
return deduped;
|
|
25147
25180
|
};
|
|
25148
25181
|
var mapTransports = (chains) => {
|
|
25149
25182
|
const transports = {};
|
|
@@ -29722,7 +29755,7 @@ var openTransactionModal = async ({
|
|
|
29722
29755
|
highlightedDstTokens
|
|
29723
29756
|
}) => {
|
|
29724
29757
|
const supportedChains = (await getChains()).filter(
|
|
29725
|
-
({ web3Environment, swapSupported }) => web3Environment === "mainnet" /* MAINNET */ && swapSupported
|
|
29758
|
+
({ web3Environment, swapSupported, bridgeSupported }) => web3Environment === "mainnet" /* MAINNET */ && (swapSupported || bridgeSupported)
|
|
29726
29759
|
);
|
|
29727
29760
|
validateSwapTxData(
|
|
29728
29761
|
integratorId,
|