@swype-org/react-sdk 0.2.170 → 0.2.173
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 +18 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -290,10 +290,15 @@ function getDepositSourceTier(chainName, tokenSymbol, priorityContext) {
|
|
|
290
290
|
if (sameAsset) return 2;
|
|
291
291
|
return 3;
|
|
292
292
|
}
|
|
293
|
+
function getDepositAuthorizationRank(status) {
|
|
294
|
+
return status == null || status === "ACTIVE" || status === "AUTHORIZED" ? 0 : 1;
|
|
295
|
+
}
|
|
293
296
|
function compareDepositSourcePriority(a, b) {
|
|
294
297
|
const aSufficient = a.transferAmount <= 0 || a.balance >= a.transferAmount;
|
|
295
298
|
const bSufficient = b.transferAmount <= 0 || b.balance >= b.transferAmount;
|
|
296
299
|
if (aSufficient !== bSufficient) return aSufficient ? -1 : 1;
|
|
300
|
+
const authDiff = getDepositAuthorizationRank(a.tokenStatus) - getDepositAuthorizationRank(b.tokenStatus);
|
|
301
|
+
if (authDiff !== 0) return authDiff;
|
|
297
302
|
const priorityContext = {
|
|
298
303
|
destinationChainName: a.destinationChainName ?? b.destinationChainName ?? null,
|
|
299
304
|
destinationTokenSymbol: a.destinationTokenSymbol ?? b.destinationTokenSymbol ?? null
|
|
@@ -332,6 +337,7 @@ function sourcePriorityInput(chainName, source, transferAmount, priorityContext)
|
|
|
332
337
|
tokenSymbol: source.token.symbol,
|
|
333
338
|
balance: source.balance.available.amount,
|
|
334
339
|
transferAmount,
|
|
340
|
+
tokenStatus: source.token.status,
|
|
335
341
|
destinationChainName: priorityContext?.destinationChainName ?? null,
|
|
336
342
|
destinationTokenSymbol: priorityContext?.destinationTokenSymbol ?? null
|
|
337
343
|
};
|
|
@@ -603,7 +609,7 @@ function resolveSelectSourceOption(choices, options, chainName, tokenSymbol, rec
|
|
|
603
609
|
}
|
|
604
610
|
var BLINK_PRIVY_APP_ID = "cmlil87uv004n0ck0blwumwek";
|
|
605
611
|
var wagmiConfig = wagmi.createConfig({
|
|
606
|
-
chains: [chains.mainnet, chains.arbitrum, chains.base, chains.polygon, chains.bsc, chains.megaeth, chains.baseSepolia],
|
|
612
|
+
chains: [chains.mainnet, chains.arbitrum, chains.base, chains.polygon, chains.bsc, chains.megaeth, chains.monad, chains.baseSepolia],
|
|
607
613
|
connectors: [
|
|
608
614
|
connectors.injected({ unstable_shimAsyncInject: 2e3 }),
|
|
609
615
|
// `preference: 'all'` (default) lets the Coinbase Wallet SDK prefer an
|
|
@@ -622,6 +628,7 @@ var wagmiConfig = wagmi.createConfig({
|
|
|
622
628
|
[chains.polygon.id]: wagmi.http("https://polygon-bor-rpc.publicnode.com"),
|
|
623
629
|
[chains.bsc.id]: wagmi.http(),
|
|
624
630
|
[chains.megaeth.id]: wagmi.http(),
|
|
631
|
+
[chains.monad.id]: wagmi.http(),
|
|
625
632
|
[chains.baseSepolia.id]: wagmi.http()
|
|
626
633
|
}
|
|
627
634
|
});
|
|
@@ -5443,21 +5450,16 @@ var POLYGON_CHAIN_SVG = `<svg width="150" height="150" viewBox="0 0 150 150" fil
|
|
|
5443
5450
|
<rect width="150" height="150" rx="75" fill="#8247E5"/>
|
|
5444
5451
|
<path d="M96.836 28.5L67.9327 45.0996V96.9076L51.9855 106.152L35.9408 96.9003V78.4038L51.9855 69.2417L62.3023 75.2246V60.2596L51.8955 54.3516L23 71.1384V104.345L51.993 121.042L80.8886 104.345V52.5446L96.9331 43.2926L112.971 52.5446V70.9588L96.9331 80.2932L86.5268 74.2575V89.1475L96.836 95.0934L126.016 78.4936V45.0996L96.836 28.5Z" fill="white"/>
|
|
5445
5452
|
</svg>`;
|
|
5446
|
-
var ETHEREUM_CHAIN_SVG = `<svg width="150" height="150" viewBox="0 0 150 150" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5447
|
-
<rect width="150" height="150" rx="75" fill="#627EEA"/>
|
|
5448
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M108.532 81.6914L74.8068 126.42V101.308L108.532 81.6914Z" fill="#C0CCF7"/>
|
|
5449
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M41.0841 81.6914L74.8094 126.42V101.308L41.0841 81.6914Z" fill="white"/>
|
|
5450
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M41.0762 76.5079L74.8079 61.5098V95.7005L41.0762 76.5079Z" fill="#C0CCF7"/>
|
|
5451
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M108.538 76.5079L74.8062 61.5098V95.7005L108.538 76.5079Z" fill="#8198EE"/>
|
|
5452
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M41.0841 76.5067L74.8094 23.5806V61.5087L41.0841 76.5067Z" fill="white"/>
|
|
5453
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M108.532 76.5067L74.8068 23.5806V61.5087L108.532 76.5067Z" fill="#C0CCF7"/>
|
|
5454
|
-
</svg>`;
|
|
5455
5453
|
var MEGAETH_CHAIN_SVG = `<svg xmlns="http://www.w3.org/2000/svg" width="105" height="105" viewBox="0 0 105 105" fill="none">
|
|
5456
5454
|
<path d="M62.7534 81.6321C65.9781 81.6321 68.5825 79.0297 68.5825 75.8195C68.5825 72.6093 65.9781 70.0068 62.7534 70.0068C59.5536 70.0068 56.9492 72.6093 56.9492 75.8195C56.9492 79.0297 59.5536 81.6321 62.7534 81.6321Z" fill="#19191A"/>
|
|
5457
5455
|
<path d="M41.8648 81.805C45.0894 81.805 47.6693 79.2026 47.6693 75.9923C47.6693 72.7821 45.0894 70.1797 41.8648 70.1797C38.665 70.1797 36.0605 72.7821 36.0605 75.9923C36.0605 79.2026 38.665 81.805 41.8648 81.805Z" fill="#19191A"/>
|
|
5458
5456
|
<path d="M29.1376 21.0791H42.9855C45.5913 28.1286 52.3911 48.1021 52.8874 49.215C53.0115 48.6586 59.8608 26.8919 61.7966 21.2028H76.1904V70.8582C74.4036 69.8687 72.6166 68.8795 70.6809 67.7662C69.3407 67.0863 68.1 66.344 66.7351 65.7875C66.611 56.1409 66.487 46.5561 66.1892 36.5385C64.2535 42.2894 57.5776 62.5721 57.0316 63.1286H48.1225C48.1225 63.1286 39.4613 38.5172 39.0394 37.4042C38.9154 46.8653 38.7913 56.3264 38.4687 66.0968C33.1579 68.8175 30.0063 70.3635 29.0137 70.7344V21.0791H29.1376Z" fill="#19191A"/>
|
|
5459
5457
|
<path d="M52.5124 8.34804C76.8081 8.34804 96.6616 28.136 96.6616 52.4999C96.6616 76.864 76.8825 96.6519 52.5124 96.6519C28.1423 96.6519 8.36325 76.864 8.36325 52.4999C8.36325 28.136 28.1423 8.34804 52.5124 8.34804ZM52.5124 0C23.5016 0 0 23.4983 0 52.4999C0 81.5016 23.5016 105 52.5124 105C81.4984 105 105 81.5016 105 52.4999C105 23.4983 81.4984 0 52.5124 0Z" fill="#19191A"/>
|
|
5460
5458
|
</svg>`;
|
|
5459
|
+
var MONAD_CHAIN_SVG = `<svg xmlns="http://www.w3.org/2000/svg" width="105" height="105" viewBox="0 0 105 105" fill="none">
|
|
5460
|
+
<rect width="105" height="105" rx="52.5" fill="#200052"/>
|
|
5461
|
+
<path d="M52.5 19.6875C44.7715 19.6875 22.7227 49.2188 22.7227 52.5C22.7227 55.7812 44.7715 85.3125 52.5 85.3125C60.2285 85.3125 82.2773 55.7812 82.2773 52.5C82.2773 49.2188 60.2285 19.6875 52.5 19.6875ZM48.7559 76.7344C46.4707 76.1426 33.5215 57.4805 33.5215 52.5C33.5215 47.5195 46.4707 28.8574 48.7559 28.2656C51.041 27.6738 51.041 77.3262 48.7559 76.7344ZM56.2441 76.7344C53.959 77.3262 53.959 27.6738 56.2441 28.2656C58.5293 28.8574 71.4785 47.5195 71.4785 52.5C71.4785 57.4805 58.5293 76.1426 56.2441 76.7344Z" fill="white"/>
|
|
5462
|
+
</svg>`;
|
|
5461
5463
|
var USDM_TOKEN_SVG = `<svg xmlns="http://www.w3.org/2000/svg" id="_\u56FE\u5C42_2" data-name="\u56FE\u5C42 2" viewBox="0 0 1068.49 1068.74">
|
|
5462
5464
|
<defs>
|
|
5463
5465
|
<style>
|
|
@@ -5575,8 +5577,9 @@ var BASE_CHAIN_LOGO = svgToDataUri(BASE_CHAIN_SVG);
|
|
|
5575
5577
|
var ARBITRUM_CHAIN_LOGO = svgToDataUri(ARBITRUM_CHAIN_SVG);
|
|
5576
5578
|
var BNB_CHAIN_LOGO = svgToDataUri(BNB_CHAIN_SVG);
|
|
5577
5579
|
var POLYGON_CHAIN_LOGO = svgToDataUri(POLYGON_CHAIN_SVG);
|
|
5578
|
-
var ETHEREUM_CHAIN_LOGO =
|
|
5580
|
+
var ETHEREUM_CHAIN_LOGO = "https://assets.relay.link/icons/1/light.png";
|
|
5579
5581
|
var MEGAETH_CHAIN_LOGO = svgToDataUri(MEGAETH_CHAIN_SVG);
|
|
5582
|
+
var MONAD_CHAIN_LOGO = svgToDataUri(MONAD_CHAIN_SVG);
|
|
5580
5583
|
var USDM_LOGO = svgToDataUri(USDM_TOKEN_SVG);
|
|
5581
5584
|
var METAMASK_LOGO = svgToDataUri(METAMASK_SVG);
|
|
5582
5585
|
var TRUST_WALLET_LOGO = svgToDataUri(TRUST_WALLET_SVG);
|
|
@@ -5609,7 +5612,8 @@ var CHAIN_LOGOS = {
|
|
|
5609
5612
|
"bnb chain": BNB_CHAIN_LOGO,
|
|
5610
5613
|
"bnb smart chain": BNB_CHAIN_LOGO,
|
|
5611
5614
|
bsc: BNB_CHAIN_LOGO,
|
|
5612
|
-
megaeth: MEGAETH_CHAIN_LOGO
|
|
5615
|
+
megaeth: MEGAETH_CHAIN_LOGO,
|
|
5616
|
+
monad: MONAD_CHAIN_LOGO
|
|
5613
5617
|
};
|
|
5614
5618
|
function ScreenLayout({ children, footer }) {
|
|
5615
5619
|
const { tokens, theme } = useBlinkConfig();
|
|
@@ -11201,6 +11205,7 @@ function selectedSourceForWallet(selectedWallet, selectedTokenSymbol, depositAmo
|
|
|
11201
11205
|
tokenSymbol: a.source.token.symbol,
|
|
11202
11206
|
balance: a.source.balance.available.amount,
|
|
11203
11207
|
transferAmount: depositAmount,
|
|
11208
|
+
tokenStatus: a.source.token.status,
|
|
11204
11209
|
destinationChainName: priorityContext?.destinationChainName ?? null,
|
|
11205
11210
|
destinationTokenSymbol: priorityContext?.destinationTokenSymbol ?? null
|
|
11206
11211
|
},
|
|
@@ -11209,6 +11214,7 @@ function selectedSourceForWallet(selectedWallet, selectedTokenSymbol, depositAmo
|
|
|
11209
11214
|
tokenSymbol: b.source.token.symbol,
|
|
11210
11215
|
balance: b.source.balance.available.amount,
|
|
11211
11216
|
transferAmount: depositAmount,
|
|
11217
|
+
tokenStatus: b.source.token.status,
|
|
11212
11218
|
destinationChainName: priorityContext?.destinationChainName ?? null,
|
|
11213
11219
|
destinationTokenSymbol: priorityContext?.destinationTokenSymbol ?? null
|
|
11214
11220
|
}
|