@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.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createContext, forwardRef, useContext, useRef, useState, useCallback, useMemo, useEffect, useSyncExternalStore, useReducer, Component } from 'react';
2
2
  import { PrivyProvider, usePrivy, useLoginWithPasskey, useSignupWithPasskey } from '@privy-io/react-auth';
3
3
  import { createConfig, http, WagmiProvider, useConfig, useConnect, useSwitchChain } from 'wagmi';
4
- import { mainnet, arbitrum, base, polygon, bsc, megaeth, baseSepolia } from 'wagmi/chains';
4
+ import { mainnet, arbitrum, base, polygon, bsc, megaeth, monad, baseSepolia } from 'wagmi/chains';
5
5
  import { injected, coinbaseWallet } from 'wagmi/connectors';
6
6
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -287,10 +287,15 @@ function getDepositSourceTier(chainName, tokenSymbol, priorityContext) {
287
287
  if (sameAsset) return 2;
288
288
  return 3;
289
289
  }
290
+ function getDepositAuthorizationRank(status) {
291
+ return status == null || status === "ACTIVE" || status === "AUTHORIZED" ? 0 : 1;
292
+ }
290
293
  function compareDepositSourcePriority(a, b) {
291
294
  const aSufficient = a.transferAmount <= 0 || a.balance >= a.transferAmount;
292
295
  const bSufficient = b.transferAmount <= 0 || b.balance >= b.transferAmount;
293
296
  if (aSufficient !== bSufficient) return aSufficient ? -1 : 1;
297
+ const authDiff = getDepositAuthorizationRank(a.tokenStatus) - getDepositAuthorizationRank(b.tokenStatus);
298
+ if (authDiff !== 0) return authDiff;
294
299
  const priorityContext = {
295
300
  destinationChainName: a.destinationChainName ?? b.destinationChainName ?? null,
296
301
  destinationTokenSymbol: a.destinationTokenSymbol ?? b.destinationTokenSymbol ?? null
@@ -329,6 +334,7 @@ function sourcePriorityInput(chainName, source, transferAmount, priorityContext)
329
334
  tokenSymbol: source.token.symbol,
330
335
  balance: source.balance.available.amount,
331
336
  transferAmount,
337
+ tokenStatus: source.token.status,
332
338
  destinationChainName: priorityContext?.destinationChainName ?? null,
333
339
  destinationTokenSymbol: priorityContext?.destinationTokenSymbol ?? null
334
340
  };
@@ -600,7 +606,7 @@ function resolveSelectSourceOption(choices, options, chainName, tokenSymbol, rec
600
606
  }
601
607
  var BLINK_PRIVY_APP_ID = "cmlil87uv004n0ck0blwumwek";
602
608
  var wagmiConfig = createConfig({
603
- chains: [mainnet, arbitrum, base, polygon, bsc, megaeth, baseSepolia],
609
+ chains: [mainnet, arbitrum, base, polygon, bsc, megaeth, monad, baseSepolia],
604
610
  connectors: [
605
611
  injected({ unstable_shimAsyncInject: 2e3 }),
606
612
  // `preference: 'all'` (default) lets the Coinbase Wallet SDK prefer an
@@ -619,6 +625,7 @@ var wagmiConfig = createConfig({
619
625
  [polygon.id]: http("https://polygon-bor-rpc.publicnode.com"),
620
626
  [bsc.id]: http(),
621
627
  [megaeth.id]: http(),
628
+ [monad.id]: http(),
622
629
  [baseSepolia.id]: http()
623
630
  }
624
631
  });
@@ -5440,21 +5447,16 @@ var POLYGON_CHAIN_SVG = `<svg width="150" height="150" viewBox="0 0 150 150" fil
5440
5447
  <rect width="150" height="150" rx="75" fill="#8247E5"/>
5441
5448
  <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"/>
5442
5449
  </svg>`;
5443
- var ETHEREUM_CHAIN_SVG = `<svg width="150" height="150" viewBox="0 0 150 150" fill="none" xmlns="http://www.w3.org/2000/svg">
5444
- <rect width="150" height="150" rx="75" fill="#627EEA"/>
5445
- <path fill-rule="evenodd" clip-rule="evenodd" d="M108.532 81.6914L74.8068 126.42V101.308L108.532 81.6914Z" fill="#C0CCF7"/>
5446
- <path fill-rule="evenodd" clip-rule="evenodd" d="M41.0841 81.6914L74.8094 126.42V101.308L41.0841 81.6914Z" fill="white"/>
5447
- <path fill-rule="evenodd" clip-rule="evenodd" d="M41.0762 76.5079L74.8079 61.5098V95.7005L41.0762 76.5079Z" fill="#C0CCF7"/>
5448
- <path fill-rule="evenodd" clip-rule="evenodd" d="M108.538 76.5079L74.8062 61.5098V95.7005L108.538 76.5079Z" fill="#8198EE"/>
5449
- <path fill-rule="evenodd" clip-rule="evenodd" d="M41.0841 76.5067L74.8094 23.5806V61.5087L41.0841 76.5067Z" fill="white"/>
5450
- <path fill-rule="evenodd" clip-rule="evenodd" d="M108.532 76.5067L74.8068 23.5806V61.5087L108.532 76.5067Z" fill="#C0CCF7"/>
5451
- </svg>`;
5452
5450
  var MEGAETH_CHAIN_SVG = `<svg xmlns="http://www.w3.org/2000/svg" width="105" height="105" viewBox="0 0 105 105" fill="none">
5453
5451
  <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"/>
5454
5452
  <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"/>
5455
5453
  <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"/>
5456
5454
  <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"/>
5457
5455
  </svg>`;
5456
+ var MONAD_CHAIN_SVG = `<svg xmlns="http://www.w3.org/2000/svg" width="105" height="105" viewBox="0 0 105 105" fill="none">
5457
+ <rect width="105" height="105" rx="52.5" fill="#200052"/>
5458
+ <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"/>
5459
+ </svg>`;
5458
5460
  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">
5459
5461
  <defs>
5460
5462
  <style>
@@ -5572,8 +5574,9 @@ var BASE_CHAIN_LOGO = svgToDataUri(BASE_CHAIN_SVG);
5572
5574
  var ARBITRUM_CHAIN_LOGO = svgToDataUri(ARBITRUM_CHAIN_SVG);
5573
5575
  var BNB_CHAIN_LOGO = svgToDataUri(BNB_CHAIN_SVG);
5574
5576
  var POLYGON_CHAIN_LOGO = svgToDataUri(POLYGON_CHAIN_SVG);
5575
- var ETHEREUM_CHAIN_LOGO = svgToDataUri(ETHEREUM_CHAIN_SVG);
5577
+ var ETHEREUM_CHAIN_LOGO = "https://assets.relay.link/icons/1/light.png";
5576
5578
  var MEGAETH_CHAIN_LOGO = svgToDataUri(MEGAETH_CHAIN_SVG);
5579
+ var MONAD_CHAIN_LOGO = svgToDataUri(MONAD_CHAIN_SVG);
5577
5580
  var USDM_LOGO = svgToDataUri(USDM_TOKEN_SVG);
5578
5581
  var METAMASK_LOGO = svgToDataUri(METAMASK_SVG);
5579
5582
  var TRUST_WALLET_LOGO = svgToDataUri(TRUST_WALLET_SVG);
@@ -5606,7 +5609,8 @@ var CHAIN_LOGOS = {
5606
5609
  "bnb chain": BNB_CHAIN_LOGO,
5607
5610
  "bnb smart chain": BNB_CHAIN_LOGO,
5608
5611
  bsc: BNB_CHAIN_LOGO,
5609
- megaeth: MEGAETH_CHAIN_LOGO
5612
+ megaeth: MEGAETH_CHAIN_LOGO,
5613
+ monad: MONAD_CHAIN_LOGO
5610
5614
  };
5611
5615
  function ScreenLayout({ children, footer }) {
5612
5616
  const { tokens, theme } = useBlinkConfig();
@@ -11198,6 +11202,7 @@ function selectedSourceForWallet(selectedWallet, selectedTokenSymbol, depositAmo
11198
11202
  tokenSymbol: a.source.token.symbol,
11199
11203
  balance: a.source.balance.available.amount,
11200
11204
  transferAmount: depositAmount,
11205
+ tokenStatus: a.source.token.status,
11201
11206
  destinationChainName: priorityContext?.destinationChainName ?? null,
11202
11207
  destinationTokenSymbol: priorityContext?.destinationTokenSymbol ?? null
11203
11208
  },
@@ -11206,6 +11211,7 @@ function selectedSourceForWallet(selectedWallet, selectedTokenSymbol, depositAmo
11206
11211
  tokenSymbol: b.source.token.symbol,
11207
11212
  balance: b.source.balance.available.amount,
11208
11213
  transferAmount: depositAmount,
11214
+ tokenStatus: b.source.token.status,
11209
11215
  destinationChainName: priorityContext?.destinationChainName ?? null,
11210
11216
  destinationTokenSymbol: priorityContext?.destinationTokenSymbol ?? null
11211
11217
  }