@skip-go/widget 2.3.1-alpha.1 → 2.3.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/build/index.es.js +24 -4
- package/build/index.es.js.map +1 -1
- package/package.json +1 -1
- package/build/utils/chain.d.ts +0 -6
- package/build/utils/explorer.d.ts +0 -5
package/build/index.es.js
CHANGED
|
@@ -2340,7 +2340,15 @@ function useSwapWidget(persistSwapWidgetState = true) {
|
|
|
2340
2340
|
return;
|
|
2341
2341
|
const feeAsset = (_a = srcChain.feeAssets) === null || _a === void 0 ? void 0 : _a[0];
|
|
2342
2342
|
const gas = `${(_b = feeAsset === null || feeAsset === void 0 ? void 0 : feeAsset.gasPrice) === null || _b === void 0 ? void 0 : _b.average}${feeAsset.denom}`;
|
|
2343
|
-
const gasPrice =
|
|
2343
|
+
const gasPrice = (() => {
|
|
2344
|
+
try {
|
|
2345
|
+
return GasPrice.fromString(gas);
|
|
2346
|
+
}
|
|
2347
|
+
catch (error) {
|
|
2348
|
+
toast.error('Unable to parse gas price asset');
|
|
2349
|
+
return undefined;
|
|
2350
|
+
}
|
|
2351
|
+
})();
|
|
2344
2352
|
let srcGasPrice = (feeAsset === null || feeAsset === void 0 ? void 0 : feeAsset.gasPrice) && gasPrice;
|
|
2345
2353
|
if (!srcFeeAsset || srcFeeAsset.chainID !== srcChain.chainID) {
|
|
2346
2354
|
if (srcGasPrice) {
|
|
@@ -2370,7 +2378,19 @@ function useSwapWidget(persistSwapWidgetState = true) {
|
|
|
2370
2378
|
toast.error(`Unable to find gas prices for ${srcFeeAsset.denom} on ${srcChain.chainName}`);
|
|
2371
2379
|
return;
|
|
2372
2380
|
}
|
|
2373
|
-
|
|
2381
|
+
const _gasPrice = (() => {
|
|
2382
|
+
try {
|
|
2383
|
+
return GasPrice.fromString(`${feeDenomPrices.gasPrice.average}${feeDenomPrices.denom}`);
|
|
2384
|
+
}
|
|
2385
|
+
catch (error) {
|
|
2386
|
+
return undefined;
|
|
2387
|
+
}
|
|
2388
|
+
})();
|
|
2389
|
+
if (!_gasPrice) {
|
|
2390
|
+
toast.error(`Unable to parse gas price for ${srcFeeAsset.denom} on ${srcChain.chainName}`);
|
|
2391
|
+
return;
|
|
2392
|
+
}
|
|
2393
|
+
srcGasPrice = _gasPrice;
|
|
2374
2394
|
selectedGasPrice = BigNumber(feeDenomPrices.gasPrice.average);
|
|
2375
2395
|
}
|
|
2376
2396
|
const gasRequired = selectedGasPrice
|
|
@@ -4045,7 +4065,7 @@ const SetAddressDialog = ({ open, onOpen, chain, index, signRequired, isDestinat
|
|
|
4045
4065
|
: wallet.walletInfo.logo.major, "aria-hidden": "true" })), jsx("p", { className: "flex-1 text-left font-semibold", children: wallet.walletPrettyName === 'Leap Cosmos MetaMask'
|
|
4046
4066
|
? 'Metamask (Leap Snap)'
|
|
4047
4067
|
: wallet.walletPrettyName }), wallet.walletName === 'prax' && (jsx(PraxWalletIndex, { praxWalletIndex: praxWalletIndex, setPraxWalletIndex: setPraxWalletIndex }))] }), chainType === 'svm' && wallet.isAvailable !== true && (jsx("div", { className: "absolute right-4 top-1/2 flex -translate-y-1/2 items-center gap-1 rounded-lg bg-[#c2c2c2]/20 px-2.5 py-1 text-xs font-semibold text-[#909090] transition-colors focus:outline-none group-hover:bg-[#c2c2c2]/30", children: "Not Installed" }))] }, wallet.walletName));
|
|
4048
|
-
}), !signRequired && (jsx("div", { className: "group relative mb-2 data-[unsupported=true]:opacity-30", children: isEditing ? (jsxs("div", { className: "flex items-center space-x-2 py-2 px-1", children: [jsx(StyledBorderDiv, { as: "input", type: "text", className: cn(`w-full rounded-md border px-2 py-1`, !isValid && 'border-red-500'), placeholder: placeholder, value: address, onChange: (e) => setAddress(e.target.value) }), jsx(StyledApproveButton, { as: "button", className: cn('flex w-12 items-center justify-center rounded-md border-2 text-sm text-white', 'disabled:cursor-not-allowed'), onClick: () => save(), disabled: !isValid, children: jsx(MdCheck, { className: "size-6" }) }), jsx(StyledCancelButton, { className: cn('flex w-12 items-center justify-center rounded-md border-2'), onClick: () => cancel(), children: jsx(MdClose, { className: "size-6" }) })] })) : (jsxs(StyledThemedButton, { onClick: () => setIsEditing(true), className: cn('flex w-full items-center gap-2 rounded-lg p-2 py-3 transition-colors focus:-outline-offset-2'), children: [jsx(FaKeyboard, { className: "mx-[6px] h-[24px] w-[24px] text-neutral-400" }), jsx("p", { className: "flex-1 text-left font-semibold", children: "Set Manually" })] })) }))] }), jsx(ScrollArea.Scrollbar, { className: "z-20 flex touch-none select-none py-4 transition-colors ease-out data-[orientation=horizontal]:h-2 data-[orientation=vertical]:w-2 data-[orientation=horizontal]:flex-col", orientation: "vertical", children: jsx(ScrollArea.Thumb, { className: "relative flex-1 rounded-[10px] bg-neutral-500/50 transition-colors before:absolute before:left-1/2 before:top-1/2 before:h-2 before:w-2 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] hover:bg-neutral-500" }) }), jsx(ScrollArea.Corner, {})] })] }) }) }, chainID));
|
|
4068
|
+
}), !chain.chainID.includes('penumbra') && !signRequired && (jsx("div", { className: "group relative mb-2 data-[unsupported=true]:opacity-30", children: isEditing ? (jsxs("div", { className: "flex items-center space-x-2 py-2 px-1", children: [jsx(StyledBorderDiv, { as: "input", type: "text", className: cn(`w-full rounded-md border px-2 py-1`, !isValid && 'border-red-500'), placeholder: placeholder, value: address, onChange: (e) => setAddress(e.target.value) }), jsx(StyledApproveButton, { as: "button", className: cn('flex w-12 items-center justify-center rounded-md border-2 text-sm text-white', 'disabled:cursor-not-allowed'), onClick: () => save(), disabled: !isValid, children: jsx(MdCheck, { className: "size-6" }) }), jsx(StyledCancelButton, { className: cn('flex w-12 items-center justify-center rounded-md border-2'), onClick: () => cancel(), children: jsx(MdClose, { className: "size-6" }) })] })) : (jsxs(StyledThemedButton, { onClick: () => setIsEditing(true), className: cn('flex w-full items-center gap-2 rounded-lg p-2 py-3 transition-colors focus:-outline-offset-2'), children: [jsx(FaKeyboard, { className: "mx-[6px] h-[24px] w-[24px] text-neutral-400" }), jsx("p", { className: "flex-1 text-left font-semibold", children: "Set Manually" })] })) }))] }), jsx(ScrollArea.Scrollbar, { className: "z-20 flex touch-none select-none py-4 transition-colors ease-out data-[orientation=horizontal]:h-2 data-[orientation=vertical]:w-2 data-[orientation=horizontal]:flex-col", orientation: "vertical", children: jsx(ScrollArea.Thumb, { className: "relative flex-1 rounded-[10px] bg-neutral-500/50 transition-colors before:absolute before:left-1/2 before:top-1/2 before:h-2 before:w-2 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] hover:bg-neutral-500" }) }), jsx(ScrollArea.Corner, {})] })] }) }) }, chainID));
|
|
4049
4069
|
};
|
|
4050
4070
|
|
|
4051
4071
|
function useBridges(args = {}) {
|
|
@@ -4922,7 +4942,7 @@ const PreviewRoute = ({ route, disclosure, isAmountError, }) => {
|
|
|
4922
4942
|
isPending: submitMutation.isPending,
|
|
4923
4943
|
}, setShowLedgerWarning: setShowLedgerWarning, setIsAddressDialogOpen: (v) => setIndexIsSetAddressDialogOpen(v), isSetAddressDialogOpen: indexSetAddressDialogOpen === index, isExpanded: isExpanded, setIsExpanded: setIsExpanded, isOpen: isOpen, chainAddresses: chainAddresses, setChainAddresses: setChainAddresses }, `${index}-${chainID}`))) }), jsxs("div", { className: "flex-1 space-y-4", children: [(statusData === null || statusData === void 0 ? void 0 : statusData.isSuccess) && submitMutation.isSuccess ? (jsxs("div", { className: "flex flex-row items-center space-x-2 font-semibold", children: [jsx(CheckCircleIcon, { className: "h-8 w-8 text-green-500" }), jsxs("p", { children: [route.doesSwap &&
|
|
4924
4944
|
`Successfully swapped ${(_b = (_a = getAsset(route.sourceAssetDenom, route.sourceAssetChainID)) === null || _a === void 0 ? void 0 : _a.recommendedSymbol) !== null && _b !== void 0 ? _b : route.sourceAssetDenom} for ${(_d = (_c = getAsset(route.destAssetDenom, route.destAssetChainID)) === null || _c === void 0 ? void 0 : _c.recommendedSymbol) !== null && _d !== void 0 ? _d : route.destAssetDenom}`, !route.doesSwap &&
|
|
4925
|
-
`Successfully transfered ${(_f = (_e = getAsset(route.sourceAssetDenom, route.sourceAssetChainID)) === null || _e === void 0 ? void 0 : _e.recommendedSymbol) !== null && _f !== void 0 ? _f : route.sourceAssetDenom} from ${(_g = chains === null || chains === void 0 ? void 0 : chains.find((c) => c.chainID === route.sourceAssetChainID)) === null || _g === void 0 ? void 0 : _g.prettyName} to ${(_h = chains === null || chains === void 0 ? void 0 : chains.find((c) => c.chainID === route.destAssetChainID)) === null || _h === void 0 ? void 0 : _h.prettyName}`] })] })) : route.txsRequired === broadcastedTxs.length ? (jsxs("div", { className: "flex w-full items-center justify-center space-x-2 text-sm font-medium", children: [jsx(CheckCircleIcon, { className: "h-8 w-8 text-green-500" }), jsx("p", { className: "text-sm font-semibold", children: "You can safely navigate away from this page while your transaction is pending" })] })) : null, estimatedFinalityTime !== '' && (jsxs(Root, { type: "info", children: [jsxs(Trigger, { children: ["EVM bridging finality time is ", estimatedFinalityTime] }), jsx(Content, { children: jsxs("p", { children: ["This swap contains at least one EVM chain, so it might take longer. Read more about", ' ', jsx("a", { href: HREF_COMMON_FINALITY_TIMES, className: "underline", target: "_blank", rel: "noopener noreferrer", children: "common finality times" }), "."] }) })] })), _showLedgerWarning.cctp && (jsx(Root, { type: "warning", initialOpen: true, children: jsx(Content, { children: jsxs("p", { children: [jsx("b", { children: "WARNING: " }), "go.skip.build does not support signing with Ledger when transferring over CCTP to the Ethereum
|
|
4945
|
+
`Successfully transfered ${(_f = (_e = getAsset(route.sourceAssetDenom, route.sourceAssetChainID)) === null || _e === void 0 ? void 0 : _e.recommendedSymbol) !== null && _f !== void 0 ? _f : route.sourceAssetDenom} from ${(_g = chains === null || chains === void 0 ? void 0 : chains.find((c) => c.chainID === route.sourceAssetChainID)) === null || _g === void 0 ? void 0 : _g.prettyName} to ${(_h = chains === null || chains === void 0 ? void 0 : chains.find((c) => c.chainID === route.destAssetChainID)) === null || _h === void 0 ? void 0 : _h.prettyName}`] })] })) : route.txsRequired === broadcastedTxs.length ? (jsxs("div", { className: "flex w-full items-center justify-center space-x-2 text-sm font-medium", children: [jsx(CheckCircleIcon, { className: "h-8 w-8 text-green-500" }), jsx("p", { className: "text-sm font-semibold", children: "You can safely navigate away from this page while your transaction is pending" })] })) : null, estimatedFinalityTime !== '' && (jsxs(Root, { type: "info", children: [jsxs(Trigger, { children: ["EVM bridging finality time is ", estimatedFinalityTime] }), jsx(Content, { children: jsxs("p", { children: ["This swap contains at least one EVM chain, so it might take longer. Read more about", ' ', jsx("a", { href: HREF_COMMON_FINALITY_TIMES, className: "underline", target: "_blank", rel: "noopener noreferrer", children: "common finality times" }), "."] }) })] })), _showLedgerWarning.cctp && (jsx(Root, { type: "warning", initialOpen: true, children: jsx(Content, { children: jsxs("p", { children: [jsx("b", { children: "WARNING: " }), "go.skip.build does not support signing with Ledger when transferring over CCTP to the Ethereum/Solana ecosystems. We're actively working on fixing this with the Noble/Circle teams. We apologize for the inconvenience"] }) }) })), _showLedgerWarning.ethermint && (jsx(Root, { type: "warning", initialOpen: true, children: jsx(Content, { children: jsxs("p", { children: [jsx("b", { children: "WARNING: " }), "go.skip.build does not support signing with Ledger on Ethermint-like chains (e.g. Injective, Dymension, EVMOS, etc...). We're actively working on fixing this with the Ledger team. We apologize for the inconvenience."] }) }) })), isAmountError &&
|
|
4926
4946
|
!submitMutation.isPending &&
|
|
4927
4947
|
!submitMutation.isSuccess && (jsx("p", { className: "text-balance text-center text-sm font-medium text-red-500", children: typeof isAmountError === 'string'
|
|
4928
4948
|
? isAmountError
|