@cordystackx/cordy_minikit 3.0.6 → 3.0.10

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.
Files changed (43) hide show
  1. package/README.md +61 -11
  2. package/dist/client/runtimeConfig.d.ts +51 -3
  3. package/dist/client/runtimeConfig.d.ts.map +1 -1
  4. package/dist/client/runtimeConfig.js +15 -1
  5. package/dist/client/transfer.d.ts +21 -5
  6. package/dist/client/transfer.d.ts.map +1 -1
  7. package/dist/client/transfer.js +423 -72
  8. package/dist/client.d.ts +1 -1
  9. package/dist/client.d.ts.map +1 -1
  10. package/dist/client__provider.d.ts.map +1 -1
  11. package/dist/client__provider.js +2 -4
  12. package/dist/components/Connect_wallet_bt.d.ts +3 -3
  13. package/dist/components/Connect_wallet_bt.d.ts.map +1 -1
  14. package/dist/components/Connect_wallet_bt.js +13 -13
  15. package/dist/components/UI_Comp.js +8 -8
  16. package/dist/controllers/BridgeEvmWalletModal.d.ts +11 -0
  17. package/dist/controllers/BridgeEvmWalletModal.d.ts.map +1 -0
  18. package/dist/controllers/BridgeEvmWalletModal.js +154 -0
  19. package/dist/controllers/Get_Balance.d.ts.map +1 -1
  20. package/dist/controllers/Get_Balance.js +3 -2
  21. package/dist/controllers/Transactions.js +2 -2
  22. package/dist/controllers/bridgeWalletSession.d.ts +13 -0
  23. package/dist/controllers/bridgeWalletSession.d.ts.map +1 -0
  24. package/dist/controllers/bridgeWalletSession.js +37 -0
  25. package/dist/controllers/cctpBridge.d.ts +6 -0
  26. package/dist/controllers/cctpBridge.d.ts.map +1 -0
  27. package/dist/controllers/cctpBridge.js +326 -0
  28. package/dist/controllers/index.d.ts +4 -0
  29. package/dist/controllers/index.d.ts.map +1 -1
  30. package/dist/controllers/index.js +2 -0
  31. package/dist/controllers/useBridgeEvmWallet.d.ts +23 -0
  32. package/dist/controllers/useBridgeEvmWallet.d.ts.map +1 -0
  33. package/dist/controllers/useBridgeEvmWallet.js +83 -0
  34. package/dist/css/UI_Comp/styles.module.css +10 -0
  35. package/dist/index.d.ts +3 -2
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1 -1
  38. package/dist/package.json +8 -7
  39. package/dist/tsconfig.tsbuildinfo +1 -1
  40. package/dist/wagmi__providers.d.ts +2 -2
  41. package/dist/wagmi__providers.d.ts.map +1 -1
  42. package/dist/wagmi__providers.js +4 -4
  43. package/package.json +8 -7
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { cordy, cons_verify, cons_disconnect } from "./client/jwt";
2
2
  export type { ConsDisconnectResult, ConsSessionResult, ConsVerifyResult } from "./client/jwt";
3
3
  export { configureCordyAssets, cordy_configure, cordy_bridge, cordy_swap, cordy_transfer } from "./client/transfer";
4
- export type { CordyAssetsConfig, CordyBridgeResult, CordyBridgeSide, CordyTransferOptions, CordyTransferResult, CordySwapResult, EvmAssetConfig, EvmNetworkConfig, StellarAssetConfig } from "./client/transfer";
4
+ export type { CordyAssetsConfig, CordyBridgeConfig, CordyBridgeNetworkConfig, CordyBridgeOptions, CordyBridgeRouteConfig, CordyBridgeResult, CordyBridgeSide, CordyTransferOptions, CordyTransferResult, CordySwapOptions, CordySwapResult, EvmAssetConfig, EvmAssetRegistry, EvmNetworkConfig, StellarAssetConfig } from "./client/transfer";
5
5
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE9F,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpH,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,eAAe,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE9F,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpH,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,eAAe,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"client__provider.d.ts","sourceRoot":"","sources":["../client__provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAsB,MAAM,OAAO,CAAC;AACtD,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAUjF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B,+BAyBA"}
1
+ {"version":3,"file":"client__provider.d.ts","sourceRoot":"","sources":["../client__provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAsB,MAAM,OAAO,CAAC;AACtD,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAUjF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B,+BAwBA"}
@@ -10,6 +10,8 @@ const WalletProviders = dynamic(() => import('./wagmi__providers'), {
10
10
  ssr: false,
11
11
  });
12
12
  export default function ProvidersClientWrapper({ children, assets, }) {
13
+ if (assets)
14
+ configureCordyAssets({ assets });
13
15
  const walletConfig = useMemo(() => {
14
16
  const networks = assets?.networks ?? [];
15
17
  if (networks.length === 0)
@@ -28,10 +30,6 @@ export default function ProvidersClientWrapper({ children, assets, }) {
28
30
  ]));
29
31
  return getConfig(customChains, { walletConnectProjectId: assets?.walletConnectProjectId });
30
32
  }, [assets?.networks, assets?.walletConnectProjectId]);
31
- useEffect(() => {
32
- if (assets)
33
- configureCordyAssets({ assets });
34
- }, [assets]);
35
33
  useEffect(() => setActiveWagmiConfig(walletConfig), [walletConfig]);
36
34
  return _jsx(WalletProviders, { config: walletConfig, children: children });
37
35
  }
@@ -1,12 +1,12 @@
1
1
  type ConnectWalletBTProps = {
2
2
  className?: string;
3
3
  } & ({
4
- jwt_session: true;
4
+ cons_session: true;
5
5
  navigate: string;
6
6
  } | {
7
- jwt_session?: false;
7
+ cons_session?: false;
8
8
  navigate?: never;
9
9
  });
10
- export default function ConnectWalletBT({ className, jwt_session, navigate, }: ConnectWalletBTProps): import("react").JSX.Element;
10
+ export default function ConnectWalletBT({ className, cons_session, navigate, }: ConnectWalletBTProps): import("react").JSX.Element;
11
11
  export {};
12
12
  //# sourceMappingURL=Connect_wallet_bt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Connect_wallet_bt.d.ts","sourceRoot":"","sources":["../../components/Connect_wallet_bt.tsx"],"names":[],"mappings":"AAWA,KAAK,oBAAoB,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,CACA;IAAE,WAAW,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,WAAW,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,CAC5C,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,SAAS,EACT,WAAmB,EACnB,QAAQ,GACT,EAAE,oBAAoB,+BAuFtB"}
1
+ {"version":3,"file":"Connect_wallet_bt.d.ts","sourceRoot":"","sources":["../../components/Connect_wallet_bt.tsx"],"names":[],"mappings":"AAWA,KAAK,oBAAoB,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,CACA;IAAE,YAAY,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,CAC7C,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,SAAS,EACT,YAAoB,EACpB,QAAQ,GACT,EAAE,oBAAoB,+BAuFtB"}
@@ -7,7 +7,7 @@ import { getTokenBalance, loadStellarBalance } from "../controllers";
7
7
  import { useStellarWallet, useWalletModal } from "../wagmi__providers";
8
8
  // const ACTIVE_WALLET_SESSION_KEY = "cordy_minikit_active_wallet_session";
9
9
  const STELLAR_BALANCE_REFRESH_EVENT = "cordy:stellar-balance-updated";
10
- export default function ConnectWalletBT({ className, jwt_session = false, navigate, }) {
10
+ export default function ConnectWalletBT({ className, cons_session = false, navigate, }) {
11
11
  const router = useRouter();
12
12
  const { openModal, closeModal } = useWalletModal();
13
13
  const { stellarWallet, setStellarWallet } = useStellarWallet();
@@ -15,30 +15,30 @@ export default function ConnectWalletBT({ className, jwt_session = false, naviga
15
15
  const [balance, setBalance] = useState("");
16
16
  const [symbol, setSymbol] = useState("");
17
17
  const walletConnected = Boolean((isConnected && address) || stellarWallet.address);
18
- if (jwt_session !== Boolean(navigate)) {
19
- throw new Error('ConnectWalletBT: provide both "jwt_session={true}" and a "navigate" path, or neither.');
18
+ if (cons_session !== Boolean(navigate)) {
19
+ throw new Error('ConnectWalletBT: provide both "cons_session={true}" and a "navigate" path, or neither.');
20
20
  }
21
- if (jwt_session &&
21
+ if (cons_session &&
22
22
  navigate &&
23
23
  (!navigate.startsWith("/") || navigate.startsWith("//") || navigate.includes("\\"))) {
24
24
  throw new Error('ConnectWalletBT: "navigate" must be a safe internal path starting with "/".');
25
25
  }
26
26
  useEffect(() => {
27
- if (jwt_session && navigate && walletConnected) {
27
+ if (cons_session && navigate && walletConnected) {
28
28
  closeModal();
29
29
  router.replace(navigate);
30
30
  }
31
- }, [closeModal, jwt_session, navigate, router, walletConnected]);
31
+ }, [closeModal, cons_session, navigate, router, walletConnected]);
32
32
  useEffect(() => {
33
- if (jwt_session || !isConnected || !address)
33
+ if (cons_session || !isConnected || !address)
34
34
  return;
35
35
  void getTokenBalance(address).then(({ balance: nextBalance, symbol: nextSymbol }) => {
36
36
  setBalance(nextBalance);
37
37
  setSymbol(nextSymbol);
38
38
  });
39
- }, [address, isConnected, jwt_session]);
39
+ }, [address, isConnected, cons_session]);
40
40
  useEffect(() => {
41
- if (!stellarWallet.address || jwt_session)
41
+ if (!stellarWallet.address || cons_session)
42
42
  return;
43
43
  let active = true;
44
44
  void loadStellarBalance(stellarWallet.address)
@@ -58,9 +58,9 @@ export default function ConnectWalletBT({ className, jwt_session = false, naviga
58
58
  setStellarWallet((current) => ({ ...current, balance: "0" }));
59
59
  });
60
60
  return () => { active = false; };
61
- }, [jwt_session, setStellarWallet, stellarWallet.address]);
61
+ }, [cons_session, setStellarWallet, stellarWallet.address]);
62
62
  useEffect(() => {
63
- if (jwt_session || !stellarWallet.address)
63
+ if (cons_session || !stellarWallet.address)
64
64
  return;
65
65
  const handler = () => {
66
66
  void loadStellarBalance(stellarWallet.address).then((result) => {
@@ -74,8 +74,8 @@ export default function ConnectWalletBT({ className, jwt_session = false, naviga
74
74
  };
75
75
  window.addEventListener(STELLAR_BALANCE_REFRESH_EVENT, handler);
76
76
  return () => window.removeEventListener(STELLAR_BALANCE_REFRESH_EVENT, handler);
77
- }, [jwt_session, setStellarWallet, stellarWallet.address]);
78
- return (_jsx("button", { className: className, onClick: () => openModal({ jwtSession: jwt_session }), "data-jwt-session": jwt_session ? "enabled" : undefined, type: "button", children: jwt_session
77
+ }, [cons_session, setStellarWallet, stellarWallet.address]);
78
+ return (_jsx("button", { className: className, onClick: () => openModal({ consSession: cons_session }), "data-cons-session": cons_session ? "enabled" : undefined, type: "button", children: cons_session
79
79
  ? walletConnected ? "Connected" : "Connect Wallet"
80
80
  : isConnected
81
81
  ? `BAL ${balance} ${symbol}`
@@ -17,7 +17,7 @@ function CordyLogo() {
17
17
  return (_jsxs("svg", { viewBox: "0 0 512 512", role: "img", "aria-label": "Cordy Minikit", children: [_jsxs("defs", { children: [_jsxs("linearGradient", { id: "cordy-logo-gradient", x1: "140", y1: "140", x2: "350", y2: "380", gradientUnits: "userSpaceOnUse", children: [_jsx("stop", { offset: "0", stopColor: "#F2F4F8" }), _jsx("stop", { offset: "1", stopColor: "#AEBBD6" })] }), _jsxs("linearGradient", { id: "cordy-star-gradient", x1: "307", y1: "218", x2: "383", y2: "294", gradientUnits: "userSpaceOnUse", children: [_jsx("stop", { offset: "0", stopColor: "#4F8CFF" }), _jsx("stop", { offset: "1", stopColor: "#5CE1E6" })] })] }), _jsx("rect", { width: "512", height: "512", rx: "112", fill: "#111214" }), _jsx("path", { d: "M355.6 172.4 A130 130 0 1 0 355.6 339.6 A105 105 0 1 1 355.6 172.4 Z", fill: "url(#cordy-logo-gradient)" }), _jsx("path", { d: "M345 218 Q345 256 383 256 Q345 256 345 294 Q345 256 307 256 Q345 256 345 218 Z", fill: "url(#cordy-star-gradient)" })] }));
18
18
  }
19
19
  export default function UI_Comp() {
20
- const { closeModal, jwtSession } = useWalletModal();
20
+ const { closeModal, consSession } = useWalletModal();
21
21
  const { stellarWallet, setStellarWallet } = useStellarWallet();
22
22
  const { isConnected, address, chain } = useAccount();
23
23
  const [loading, setLoading] = useState(false);
@@ -29,13 +29,13 @@ export default function UI_Comp() {
29
29
  const [selectedRoute, setSelectedRoute] = useState(null);
30
30
  const { disconnectEVM, disconnectStellar } = useDisconnectWallets();
31
31
  useEffect(() => {
32
- if (!jwtSession && isConnected && address)
32
+ if (!consSession && isConnected && address)
33
33
  void Get_Balance();
34
- }, [isConnected, address, jwtSession]);
34
+ }, [isConnected, address, consSession]);
35
35
  useEffect(() => {
36
- if (!jwtSession && stellarWallet.address)
36
+ if (!consSession && stellarWallet.address)
37
37
  void loadStellarBalance(stellarWallet.address);
38
- }, [stellarWallet.address, jwtSession]);
38
+ }, [stellarWallet.address, consSession]);
39
39
  const Get_Balance = async () => {
40
40
  if (!address)
41
41
  return;
@@ -72,7 +72,7 @@ export default function UI_Comp() {
72
72
  const connectedBalance = isStellar
73
73
  ? stellarWallet.balance ? `${stellarWallet.balance} XLM` : "Loading balance…"
74
74
  : balance ? `${Number(balance).toFixed(4)} ${symbol}` : "Loading balance…";
75
- return (_jsx("div", { className: UI_Comp__css.container, children: _jsxs("section", { className: UI_Comp__css.connector, role: "dialog", "aria-modal": "true", "aria-labelledby": "wallet-modal-title", children: [_jsxs("header", { className: UI_Comp__css.modal_header, children: [_jsx("div", { className: UI_Comp__css.brand_mark, children: _jsx(CordyLogo, {}) }), _jsxs("div", { children: [_jsx("p", { className: UI_Comp__css.eyebrow, children: "CORDY MINIKIT" }), _jsx("h2", { id: "wallet-modal-title", children: "Wallet connected" })] }), _jsx("button", { className: UI_Comp__css.close_button, type: "button", onClick: closeModal, "aria-label": "Close wallet dialog", children: "\u00D7" })] }), _jsxs("div", { className: UI_Comp__css.connected_card, children: [_jsxs("div", { className: UI_Comp__css.connected_heading, children: [_jsx("span", { className: UI_Comp__css.connected_dot }), " ", isStellar ? "Stellar wallet" : "EVM wallet", _jsx("span", { className: UI_Comp__css.network_badge, children: connectedNetwork })] }), !jwtSession && _jsxs(_Fragment, { children: [_jsx("div", { className: UI_Comp__css.balance_value, children: connectedBalance }), _jsx("p", { className: UI_Comp__css.muted, children: isStellar ? "Native balance" : "Token balance" })] }), _jsxs("div", { className: UI_Comp__css.address_row, children: [_jsx("span", { children: "Address" }), _jsx("code", { title: connectedAddress || "", children: truncateAddress(connectedAddress, 12, 8) })] }), isStellar && stellarError && _jsx("p", { className: UI_Comp__css.error_message, role: "alert", children: stellarError })] }), _jsx("button", { className: UI_Comp__css.disconnect_button, type: "button", onClick: async () => { if (isStellar)
75
+ return (_jsx("div", { className: UI_Comp__css.container, children: _jsxs("section", { className: UI_Comp__css.connector, role: "dialog", "aria-modal": "true", "aria-labelledby": "wallet-modal-title", children: [_jsxs("header", { className: UI_Comp__css.modal_header, children: [_jsx("div", { className: UI_Comp__css.brand_mark, children: _jsx(CordyLogo, {}) }), _jsxs("div", { children: [_jsx("p", { className: UI_Comp__css.eyebrow, children: "CORDY MINIKIT" }), _jsx("h2", { id: "wallet-modal-title", children: "Wallet connected" })] }), _jsx("button", { className: UI_Comp__css.close_button, type: "button", onClick: closeModal, "aria-label": "Close wallet dialog", children: "\u00D7" })] }), _jsxs("div", { className: UI_Comp__css.connected_card, children: [_jsxs("div", { className: UI_Comp__css.connected_heading, children: [_jsx("span", { className: UI_Comp__css.connected_dot }), " ", isStellar ? "Stellar wallet" : "EVM wallet", _jsx("span", { className: UI_Comp__css.network_badge, children: connectedNetwork })] }), !consSession && _jsxs(_Fragment, { children: [_jsx("div", { className: UI_Comp__css.balance_value, children: connectedBalance }), _jsx("p", { className: UI_Comp__css.muted, children: isStellar ? "Native balance" : "Token balance" })] }), _jsxs("div", { className: UI_Comp__css.address_row, children: [_jsx("span", { children: "Address" }), _jsx("code", { title: connectedAddress || "", children: truncateAddress(connectedAddress, 12, 8) })] }), isStellar && stellarError && _jsx("p", { className: UI_Comp__css.error_message, role: "alert", children: stellarError })] }), _jsx("button", { className: UI_Comp__css.disconnect_button, type: "button", onClick: async () => { if (isStellar)
76
76
  await disconnectStellar();
77
77
  else
78
78
  await disconnectEVM(); }, children: "Disconnect wallet" }), footer] }) }));
@@ -80,14 +80,14 @@ export default function UI_Comp() {
80
80
  const selectedWalletRoute = walletRoutes.find((route) => route.id === selectedRoute);
81
81
  return (_jsx("div", { className: UI_Comp__css.container, children: _jsxs("section", { className: UI_Comp__css.connector, role: "dialog", "aria-modal": "true", "aria-labelledby": "wallet-modal-title", "aria-describedby": "wallet-modal-description", children: [_jsxs("header", { className: UI_Comp__css.modal_header, children: [_jsx("div", { className: UI_Comp__css.brand_mark, children: _jsx(CordyLogo, {}) }), _jsxs("div", { children: [_jsxs("p", { className: UI_Comp__css.eyebrow, children: ["CORDY MINIKIT ", _jsx("span", { children: "\u00B7" }), " WALLET ACCESS"] }), _jsx("h2", { id: "wallet-modal-title", children: selectedWalletRoute?.title || "Choose a wallet" })] }), _jsx("button", { className: UI_Comp__css.close_button, type: "button", onClick: closeModal, "aria-label": "Close wallet dialog", children: "\u00D7" })] }), _jsx("p", { id: "wallet-modal-description", className: UI_Comp__css.modal_description, children: selectedWalletRoute ? selectedWalletRoute.subtitle : "Select how you want to connect." }), (loading || stellarLoading) && _jsxs("div", { className: UI_Comp__css.loading_notice, role: "status", children: [_jsx("span", { className: UI_Comp__css.spinner }), " Waiting for wallet approval\u2026"] }), !selectedRoute ? (_jsx("div", { className: UI_Comp__css.wallet_choices, role: "group", "aria-label": "Wallet connection options", children: walletRoutes.map((route) => (_jsxs("button", { type: "button", className: UI_Comp__css.wallet_choice, onClick: () => { setErrorMsg(undefined); setStellarError(undefined); setSelectedRoute(route.id); }, children: [_jsx("span", { className: `${UI_Comp__css.choice_icon} ${route.id === "stellar" ? UI_Comp__css.stellar_choice_icon : ""}`, "aria-hidden": "true", children: route.icon }), _jsxs("span", { className: UI_Comp__css.choice_copy, children: [_jsx("span", { className: UI_Comp__css.choice_title, children: route.title }), _jsx("span", { className: UI_Comp__css.choice_subtitle, children: route.subtitle })] }), _jsx("span", { className: UI_Comp__css.choice_hint, children: route.hint }), _jsx("svg", { className: UI_Comp__css.choice_chevron, "aria-hidden": "true", viewBox: "0 0 16 16", fill: "none", children: _jsx("path", { d: "m6 3 5 5-5 5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })] }, route.id))) })) : (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: UI_Comp__css.back_button, onClick: () => { setSelectedRoute(null); setErrorMsg(undefined); setStellarError(undefined); }, children: [_jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", fill: "none", children: _jsx("path", { d: "M10 3 5 8l5 5M5 8h8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), "All connection options"] }), _jsxs("div", { className: UI_Comp__css.wallet_panel, children: [_jsx("p", { className: UI_Comp__css.panel_label, children: "AVAILABLE WALLETS" }), _jsxs("div", { className: UI_Comp__css.wallet_options, children: [selectedRoute === "browser-evm" && _jsx(WalletButton, { connectorGroup: "browser", onStatusChange: ({ isPending, error }) => { setLoading(isPending); setErrorMsg(error); } }), selectedRoute === "walletconnect" && _jsx(WalletButton, { connectorGroup: "walletconnect", onStatusChange: ({ isPending, error }) => { setLoading(isPending); setErrorMsg(error); } }), selectedRoute === "stellar" && _jsx(StellarWalletButton, { onConnect: (accountId) => {
82
82
  setStellarWallet((current) => ({ ...current, address: accountId }));
83
- if (!jwtSession)
83
+ if (!consSession)
84
84
  void handleLoadStellarBalance(accountId);
85
85
  }, onStatusChange: ({ isPending, error, address: accountId, network }) => {
86
86
  setStellarLoading(isPending);
87
87
  setStellarError(error);
88
88
  if (accountId) {
89
89
  setStellarWallet((current) => ({ ...current, address: accountId }));
90
- if (!jwtSession)
90
+ if (!consSession)
91
91
  void handleLoadStellarBalance(accountId);
92
92
  }
93
93
  if (network)
@@ -0,0 +1,11 @@
1
+ export type BridgeEvmWalletModalProps = {
2
+ open?: boolean;
3
+ onClose?: () => void;
4
+ onConnected?: (address?: string) => void;
5
+ onConnectionError?: (error: string) => void;
6
+ targetChainName?: string;
7
+ title?: string;
8
+ note?: string;
9
+ };
10
+ export default function BridgeEvmWalletModal({ open: controlledOpen, onClose: controlledOnClose, onConnected, onConnectionError, targetChainName, title, note, }: BridgeEvmWalletModalProps): import("react").JSX.Element | null;
11
+ //# sourceMappingURL=BridgeEvmWalletModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BridgeEvmWalletModal.d.ts","sourceRoot":"","sources":["../../controllers/BridgeEvmWalletModal.tsx"],"names":[],"mappings":"AAiBA,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAwEF,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,iBAAiB,EAC1B,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,KAAK,EACL,IAAI,GACL,EAAE,yBAAyB,sCAgH3B"}
@@ -0,0 +1,154 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useSyncExternalStore, useState } from "react";
4
+ import { useConnect } from "wagmi";
5
+ import Images from "../config/Image.json";
6
+ import { UI_Comp__css } from "../css";
7
+ import { isEvmEnvironmentConfigured } from "../config/walletConfig";
8
+ import { getConfiguredEvmAssets, getCordyRuntimeConfig } from "../client/runtimeConfig";
9
+ import { getBridgeWalletSession, rejectBridgeWalletSession, resolveBridgeWalletSession, subscribeBridgeWalletSession, } from "./bridgeWalletSession";
10
+ const ALWAYS_AVAILABLE_CONNECTOR_NAMES = new Set([
11
+ "WalletConnect",
12
+ "MetaMask",
13
+ "Coinbase Wallet",
14
+ "Trust Wallet",
15
+ ]);
16
+ async function prepareConnectedWallet(connector, routeId, from, to) {
17
+ const runtimeConfig = getCordyRuntimeConfig();
18
+ const route = runtimeConfig?.bridge?.routes?.find((candidate) => candidate.id === routeId);
19
+ const source = route?.[from ?? "internal"];
20
+ const destination = route?.[to ?? "external"];
21
+ const target = source?.networkType === "evm" ? source : destination?.networkType === "evm" ? destination : undefined;
22
+ const targetChainId = target?.chainId ?? runtimeConfig?.networks?.[0]?.chainId;
23
+ if (targetChainId === undefined)
24
+ return;
25
+ const network = runtimeConfig?.networks?.find((candidate) => candidate.chainId === targetChainId);
26
+ if (!network) {
27
+ throw new Error(`Chain ${targetChainId} is not configured in Cordy Minikit.`);
28
+ }
29
+ const provider = await connector.getProvider();
30
+ const chainId = `0x${targetChainId.toString(16)}`;
31
+ try {
32
+ await provider.request({ method: "wallet_switchEthereumChain", params: [{ chainId }] });
33
+ }
34
+ catch (error) {
35
+ const code = typeof error === "object" && error !== null && "code" in error
36
+ ? error.code
37
+ : undefined;
38
+ if (code !== 4902) {
39
+ throw new Error(`The wallet could not switch to ${network.name}. ${error instanceof Error ? error.message : "The request was rejected."}`);
40
+ }
41
+ await provider.request({
42
+ method: "wallet_addEthereumChain",
43
+ params: [{
44
+ chainId,
45
+ chainName: network.name,
46
+ nativeCurrency: network.nativeCurrency,
47
+ rpcUrls: [network.rpcUrl],
48
+ ...(network.blockExplorerUrl ? { blockExplorerUrls: [network.blockExplorerUrl] } : {}),
49
+ }],
50
+ });
51
+ await provider.request({ method: "wallet_switchEthereumChain", params: [{ chainId }] });
52
+ }
53
+ const token = target?.tokenAddress && target.assetSymbol
54
+ ? getConfiguredEvmAssets(runtimeConfig).find((asset) => asset.chainId === targetChainId &&
55
+ asset.contractAddress?.toLowerCase() === target.tokenAddress?.toLowerCase())
56
+ : undefined;
57
+ if (target?.tokenAddress && target.assetSymbol) {
58
+ await provider.request({
59
+ method: "wallet_watchAsset",
60
+ params: {
61
+ type: "ERC20",
62
+ options: {
63
+ address: target.tokenAddress,
64
+ symbol: target.assetSymbol,
65
+ decimals: token?.decimals ?? 18,
66
+ },
67
+ },
68
+ });
69
+ }
70
+ }
71
+ export default function BridgeEvmWalletModal({ open: controlledOpen, onClose: controlledOnClose, onConnected, onConnectionError, targetChainName, title, note, }) {
72
+ const sessionRequest = useSyncExternalStore(subscribeBridgeWalletSession, getBridgeWalletSession, () => undefined);
73
+ const open = controlledOpen ?? Boolean(sessionRequest);
74
+ const onClose = controlledOnClose ?? (() => rejectBridgeWalletSession());
75
+ const route = getCordyRuntimeConfig()?.bridge?.routes?.find((candidate) => candidate.id === sessionRequest?.routeId);
76
+ const source = route?.[sessionRequest?.from ?? "internal"];
77
+ const destination = route?.[sessionRequest?.to ?? "external"];
78
+ const resolvedTargetChain = targetChainName
79
+ ?? (source?.networkType === "evm" ? source.networkName : destination?.networkName)
80
+ ?? "the destination network";
81
+ const resolvedTitle = title
82
+ ?? (source?.networkType === "evm" ? "Connect the source EVM wallet" : "Connect the destination EVM wallet");
83
+ const { connectors, connectAsync } = useConnect();
84
+ const [pendingConnector, setPendingConnector] = useState();
85
+ const [error, setError] = useState();
86
+ const description = note ?? `Connect your EVM wallet. The bridge continues automatically on ${resolvedTargetChain}.`;
87
+ useEffect(() => {
88
+ if (!open) {
89
+ setPendingConnector(undefined);
90
+ setError(undefined);
91
+ }
92
+ }, [open]);
93
+ if (!open)
94
+ return null;
95
+ const connect = async (connector) => {
96
+ setPendingConnector(connector.uid);
97
+ setError(undefined);
98
+ try {
99
+ if (!isEvmEnvironmentConfigured()) {
100
+ throw new Error("EVM is not configured. Add an EVM network and asset to the provider configuration.");
101
+ }
102
+ const connection = await connectAsync({ connector });
103
+ const connectedAddress = connection.accounts?.[0];
104
+ await prepareConnectedWallet(connector, sessionRequest?.routeId, sessionRequest?.from, sessionRequest?.to);
105
+ onConnected?.(connectedAddress);
106
+ if (connectedAddress && sessionRequest)
107
+ resolveBridgeWalletSession(connectedAddress);
108
+ onClose();
109
+ }
110
+ catch (connectionError) {
111
+ const message = connectionError instanceof Error ? connectionError.message : "EVM wallet connection failed.";
112
+ setError(message);
113
+ onConnectionError?.(message);
114
+ if (sessionRequest)
115
+ rejectBridgeWalletSession(message);
116
+ }
117
+ finally {
118
+ setPendingConnector(undefined);
119
+ }
120
+ };
121
+ return (_jsx("div", { className: UI_Comp__css.bridge_modal_container, role: "presentation", children: _jsxs("section", { className: UI_Comp__css.bridge_modal, role: "dialog", "aria-modal": "true", "aria-labelledby": "cordy-bridge-wallet-title", children: [_jsxs("div", { className: UI_Comp__css.bridge_modal_header, children: [_jsxs("div", { children: [_jsx("p", { className: UI_Comp__css.eyebrow, children: "CORDY MINIKIT \u00B7 EVM DESTINATION" }), _jsx("h2", { id: "cordy-bridge-wallet-title", children: resolvedTitle })] }), _jsx("button", { className: UI_Comp__css.close_button, type: "button", onClick: onClose, "aria-label": "Close EVM wallet connection dialog", children: "\u00D7" })] }), _jsx("p", { className: UI_Comp__css.modal_description, children: description }), _jsx("div", { className: UI_Comp__css.bridge_wallet_options, children: connectors.map((connector) => {
122
+ const isTrustWallet = connector.name.toLowerCase().includes("trust");
123
+ const imageSource = Images[connector.name]
124
+ || (isTrustWallet ? Images["Trust Wallet"] : undefined);
125
+ const displayName = isTrustWallet ? "Trust Wallet" : connector.name;
126
+ const imageUnavailable = connector.type === "injected"
127
+ && !ALWAYS_AVAILABLE_CONNECTOR_NAMES.has(connector.name)
128
+ && !isTrustWallet;
129
+ return (_jsx(BridgeWalletOption, { connector: connector, displayName: displayName, imageSource: imageSource, imageUnavailable: imageUnavailable, isPending: pendingConnector === connector.uid, disabled: Boolean(pendingConnector), onClick: () => void connect(connector) }, connector.uid));
130
+ }) }), error && _jsx("div", { className: UI_Comp__css.error_message, role: "alert", children: error }), _jsxs("p", { className: UI_Comp__css.panel_note, children: ["Connect your EVM wallet. The bridge continues automatically on ", resolvedTargetChain, "."] })] }) }));
131
+ }
132
+ function BridgeWalletOption({ connector, displayName, imageSource, imageUnavailable, isPending, disabled, onClick, }) {
133
+ const [installed, setInstalled] = useState(!imageUnavailable);
134
+ const [imageFailed, setImageFailed] = useState(false);
135
+ const fallbackInitial = displayName.trim().charAt(0).toUpperCase() || "?";
136
+ useEffect(() => {
137
+ if (!imageUnavailable)
138
+ return;
139
+ let active = true;
140
+ void connector.getProvider().then((provider) => {
141
+ if (active)
142
+ setInstalled(Boolean(provider));
143
+ }).catch(() => {
144
+ if (active)
145
+ setInstalled(false);
146
+ });
147
+ return () => {
148
+ active = false;
149
+ };
150
+ }, [connector, imageUnavailable]);
151
+ return (_jsxs("button", { className: UI_Comp__css.bridge_wallet_option, type: "button", disabled: !installed || disabled, onClick: onClick, children: [imageSource && !imageFailed
152
+ ? _jsx("img", { src: imageSource, alt: "", "aria-hidden": "true", width: 23, height: 23, onError: () => setImageFailed(true) })
153
+ : _jsx("span", { className: UI_Comp__css.wallet_icon_fallback, "aria-hidden": "true", children: fallbackInitial }), isPending ? `Connecting ${displayName}…` : !installed ? `${displayName} (Not installed)` : displayName] }));
154
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"Get_Balance.d.ts","sourceRoot":"","sources":["../../controllers/Get_Balance.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAI1F,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,gBAAgB,CAAC,EAAE,QAAQ,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,4EAA4E;AAC5E,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAyF7B;AAED,0FAA0F;AAC1F,wBAA8B,eAAe,CAC3C,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAQ9C"}
1
+ {"version":3,"file":"Get_Balance.d.ts","sourceRoot":"","sources":["../../controllers/Get_Balance.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAI1F,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,gBAAgB,CAAC,EAAE,QAAQ,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,4EAA4E;AAC5E,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CA0F7B;AAED,0FAA0F;AAC1F,wBAA8B,eAAe,CAC3C,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAQ9C"}
@@ -1,11 +1,11 @@
1
1
  import { Contract, formatUnits, isAddress, JsonRpcProvider } from "ethers";
2
2
  import ERC20_ABI from "../config/ERC20_ABI.json";
3
- import { getCordyRuntimeConfig } from "../client/runtimeConfig";
3
+ import { getConfiguredEvmAssets, getCordyRuntimeConfig, requireConfiguredEvmNetwork } from "../client/runtimeConfig";
4
4
  /** Shared ERC-20 balance reader used by wallet status and the Cordy API. */
5
5
  export async function readTokenBalance(address, options = {}) {
6
6
  const assets = getCordyRuntimeConfig();
7
7
  const configuredChainId = options.expectedChainId ?? assets?.networks?.[0]?.chainId;
8
- const chainAssets = assets?.evm?.filter((asset) => (asset.chainId ?? assets.networks?.[0]?.chainId) === configuredChainId) ?? [];
8
+ const chainAssets = getConfiguredEvmAssets(assets).filter((asset) => asset.chainId === configuredChainId) ?? [];
9
9
  const defaultAsset = chainAssets.find((asset) => asset.contractAddress) || chainAssets[0];
10
10
  const tokenAddress = options.tokenAddress || defaultAsset?.contractAddress;
11
11
  const rpcUrl = options.rpcUrl || defaultAsset?.rpcUrl || assets?.networks?.find((network) => network.chainId === configuredChainId)?.rpcUrl;
@@ -24,6 +24,7 @@ export async function readTokenBalance(address, options = {}) {
24
24
  throw new Error("Could not connect to the configured EVM RPC endpoint.");
25
25
  }
26
26
  const chainId = Number(network.chainId);
27
+ requireConfiguredEvmNetwork(assets, chainId, network.name);
27
28
  if (options.expectedChainId !== undefined && chainId !== options.expectedChainId) {
28
29
  throw new Error(`The EVM RPC is on chain ID ${chainId}, but the wallet is on ${options.networkName || "another network"} (chain ID ${options.expectedChainId}).`);
29
30
  }
@@ -3,7 +3,7 @@ import { ethers, parseUnits } from 'ethers';
3
3
  import { Horizon, Asset, BASE_FEE, Memo, Operation, TransactionBuilder } from "@stellar/stellar-sdk";
4
4
  import { getNetworkDetails, requestAccess, signTransaction as freighterSignTransaction } from "@stellar/freighter-api";
5
5
  import tokenAbi from '../config/ERC20_ABI.json';
6
- import { getCordyRuntimeConfig } from '../client/runtimeConfig';
6
+ import { getConfiguredEvmAssets, getCordyRuntimeConfig } from '../client/runtimeConfig';
7
7
  /** @deprecated Use `cordy.transfer(amount, recipient, { asset })` instead. */
8
8
  export default async function CordyStackTrans(address, cost) {
9
9
  if (!address) {
@@ -13,7 +13,7 @@ export default async function CordyStackTrans(address, cost) {
13
13
  try {
14
14
  const runtimeConfig = getCordyRuntimeConfig();
15
15
  const defaultNetwork = runtimeConfig?.networks?.[0];
16
- const defaultAsset = runtimeConfig?.evm?.find((asset) => (asset.chainId ?? defaultNetwork?.chainId) === defaultNetwork?.chainId && asset.contractAddress);
16
+ const defaultAsset = getConfiguredEvmAssets(runtimeConfig).find((asset) => asset.chainId === defaultNetwork?.chainId && asset.contractAddress);
17
17
  const tokenAddress = defaultAsset?.contractAddress || "";
18
18
  const rpcEndpoint = defaultAsset?.rpcUrl || defaultNetwork?.rpcUrl || "";
19
19
  const ethereum = window?.ethereum;
@@ -0,0 +1,13 @@
1
+ import type { BridgeEvmWalletRequest } from "./useBridgeEvmWallet";
2
+ type PendingSession = {
3
+ request: BridgeEvmWalletRequest;
4
+ resolve: (address: string) => void;
5
+ reject: (error: Error) => void;
6
+ };
7
+ export declare function subscribeBridgeWalletSession(listener: () => void): () => void;
8
+ export declare function getBridgeWalletSession(): PendingSession["request"] | undefined;
9
+ export declare function waitForBridgeEvmWallet(request: BridgeEvmWalletRequest): Promise<string>;
10
+ export declare function resolveBridgeWalletSession(address: string): void;
11
+ export declare function rejectBridgeWalletSession(message?: string): void;
12
+ export {};
13
+ //# sourceMappingURL=bridgeWalletSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridgeWalletSession.d.ts","sourceRoot":"","sources":["../../controllers/bridgeWalletSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,sBAAsB,CAAC;IAChC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAChC,CAAC;AASF,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAG7E;AAED,wBAAgB,sBAAsB,IAAI,cAAc,CAAC,SAAS,CAAC,GAAG,SAAS,CAE9E;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQvF;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAMhE;AAED,wBAAgB,yBAAyB,CAAC,OAAO,SAAyC,GAAG,IAAI,CAMhG"}
@@ -0,0 +1,37 @@
1
+ let pendingSession;
2
+ const listeners = new Set();
3
+ function notify() {
4
+ listeners.forEach((listener) => listener());
5
+ }
6
+ export function subscribeBridgeWalletSession(listener) {
7
+ listeners.add(listener);
8
+ return () => listeners.delete(listener);
9
+ }
10
+ export function getBridgeWalletSession() {
11
+ return pendingSession?.request;
12
+ }
13
+ export function waitForBridgeEvmWallet(request) {
14
+ if (pendingSession) {
15
+ return Promise.reject(new Error("Another bridge wallet connection is already in progress."));
16
+ }
17
+ return new Promise((resolve, reject) => {
18
+ pendingSession = { request, resolve, reject };
19
+ notify();
20
+ });
21
+ }
22
+ export function resolveBridgeWalletSession(address) {
23
+ const session = pendingSession;
24
+ if (!session)
25
+ return;
26
+ pendingSession = undefined;
27
+ notify();
28
+ session.resolve(address);
29
+ }
30
+ export function rejectBridgeWalletSession(message = "EVM wallet connection was cancelled.") {
31
+ const session = pendingSession;
32
+ if (!session)
33
+ return;
34
+ pendingSession = undefined;
35
+ notify();
36
+ session.reject(new Error(message));
37
+ }
@@ -0,0 +1,6 @@
1
+ import type { CordyBridgeRouteConfig } from "../client/runtimeConfig";
2
+ import type { CordyBridgeResult } from "../client/transfer";
3
+ type CordyBridgeSide = "internal" | "external";
4
+ export declare function cctpBridge(amount: string, from: CordyBridgeSide, to: CordyBridgeSide, recipient: string, route: CordyBridgeRouteConfig): Promise<CordyBridgeResult>;
5
+ export {};
6
+ //# sourceMappingURL=cctpBridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cctpBridge.d.ts","sourceRoot":"","sources":["../../controllers/cctpBridge.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,KAAK,eAAe,GAAG,UAAU,GAAG,UAAU,CAAC;AAyP/C,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,eAAe,EACrB,EAAE,EAAE,eAAe,EACnB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,iBAAiB,CAAC,CAyH5B"}