@rhinestone/deposit-modal 0.3.0-alpha.15 → 0.3.0-alpha.17
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/{DepositModalReown-CAX35NN2.mjs → DepositModalReown-ADTQMSTI.mjs} +4 -4
- package/dist/{DepositModalReown-P4QGKQRZ.cjs → DepositModalReown-XYQNNZAC.cjs} +7 -7
- package/dist/{WithdrawModalReown-V4YYPNBE.mjs → WithdrawModalReown-EAST32BT.mjs} +4 -4
- package/dist/{WithdrawModalReown-ZSFALZOB.cjs → WithdrawModalReown-FJ4MPMFA.cjs} +7 -7
- package/dist/{constants-DqVn968d.d.ts → caip-CrQ2KKU-.d.cts} +11 -1
- package/dist/{constants-DqVn968d.d.cts → caip-CrQ2KKU-.d.ts} +11 -1
- package/dist/{chunk-6O4NGY2N.cjs → chunk-5H72PM2N.cjs} +5 -5
- package/dist/{chunk-7C4SPVM5.mjs → chunk-6YRDD462.mjs} +57 -1
- package/dist/{chunk-7LJYEGZZ.cjs → chunk-AX4OHTFC.cjs} +93 -93
- package/dist/{chunk-LDMY67HP.mjs → chunk-BDMPIDTR.mjs} +5 -5
- package/dist/{chunk-KDJS56TQ.mjs → chunk-DHCJGPT3.mjs} +98 -15
- package/dist/{chunk-H2WSFD53.mjs → chunk-DQ4SKF37.mjs} +2 -2
- package/dist/{chunk-IZMF2WHM.mjs → chunk-H2FI4RN7.mjs} +287 -235
- package/dist/{chunk-7NO7WVJV.cjs → chunk-LJLTLPHL.cjs} +255 -203
- package/dist/{chunk-DZ2RPLBM.cjs → chunk-MILJQWPT.cjs} +67 -11
- package/dist/{chunk-AAQPYKBA.cjs → chunk-PSFPXDKE.cjs} +549 -466
- package/dist/constants.cjs +6 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +5 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +9 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +8 -4
- package/dist/styles.css +10 -0
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.mjs +3 -3
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DHCJGPT3.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-DQ4SKF37.mjs";
|
|
8
|
+
import "./chunk-H2FI4RN7.mjs";
|
|
9
|
+
import "./chunk-6YRDD462.mjs";
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
12
12
|
import { useCallback, useMemo } from "react";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkPSFPXDKEcjs = require('./chunk-PSFPXDKE.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
7
|
+
var _chunk5H72PM2Ncjs = require('./chunk-5H72PM2N.cjs');
|
|
8
|
+
require('./chunk-LJLTLPHL.cjs');
|
|
9
|
+
require('./chunk-MILJQWPT.cjs');
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
12
12
|
var _react = require('react');
|
|
@@ -14,7 +14,7 @@ var _react3 = require('@reown/appkit/react');
|
|
|
14
14
|
var _react5 = require('@reown/appkit-adapter-solana/react');
|
|
15
15
|
var _jsxruntime = require('react/jsx-runtime');
|
|
16
16
|
function DepositModalWithReown(props) {
|
|
17
|
-
const reown =
|
|
17
|
+
const reown = _chunk5H72PM2Ncjs.useReownWallet.call(void 0, );
|
|
18
18
|
const enableSolana = _nullishCoalesce(props.enableSolana, () => ( true));
|
|
19
19
|
const { walletProvider: solanaWalletProvider } = _react3.useAppKitProvider.call(void 0,
|
|
20
20
|
enableSolana ? "solana" : "eip155"
|
|
@@ -35,7 +35,7 @@ function DepositModalWithReown(props) {
|
|
|
35
35
|
reown.disconnect();
|
|
36
36
|
}, [reown.disconnect]);
|
|
37
37
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
38
|
-
|
|
38
|
+
_chunkPSFPXDKEcjs.DepositModalInner,
|
|
39
39
|
{
|
|
40
40
|
...props,
|
|
41
41
|
reownWallet: reownWithSolana,
|
|
@@ -46,7 +46,7 @@ function DepositModalWithReown(props) {
|
|
|
46
46
|
}
|
|
47
47
|
function DepositModalReown(props) {
|
|
48
48
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
49
|
-
|
|
49
|
+
_chunk5H72PM2Ncjs.ReownWalletProvider,
|
|
50
50
|
{
|
|
51
51
|
projectId: props.reownAppId,
|
|
52
52
|
theme: props.theme,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BDMPIDTR.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-DQ4SKF37.mjs";
|
|
8
|
+
import "./chunk-H2FI4RN7.mjs";
|
|
9
|
+
import "./chunk-6YRDD462.mjs";
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
12
12
|
import { useCallback } from "react";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkAX4OHTFCcjs = require('./chunk-AX4OHTFC.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
7
|
+
var _chunk5H72PM2Ncjs = require('./chunk-5H72PM2N.cjs');
|
|
8
|
+
require('./chunk-LJLTLPHL.cjs');
|
|
9
|
+
require('./chunk-MILJQWPT.cjs');
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
12
12
|
var _react = require('react');
|
|
13
13
|
var _jsxruntime = require('react/jsx-runtime');
|
|
14
14
|
function WithdrawModalWithReown(props) {
|
|
15
|
-
const reown =
|
|
15
|
+
const reown = _chunk5H72PM2Ncjs.useReownWallet.call(void 0, );
|
|
16
16
|
const handleConnect = _react.useCallback.call(void 0, () => {
|
|
17
17
|
reown.openConnect();
|
|
18
18
|
}, [reown.openConnect]);
|
|
@@ -20,7 +20,7 @@ function WithdrawModalWithReown(props) {
|
|
|
20
20
|
reown.disconnect();
|
|
21
21
|
}, [reown.disconnect]);
|
|
22
22
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
23
|
-
|
|
23
|
+
_chunkAX4OHTFCcjs.WithdrawModalInner,
|
|
24
24
|
{
|
|
25
25
|
...props,
|
|
26
26
|
reownWallet: reown,
|
|
@@ -30,7 +30,7 @@ function WithdrawModalWithReown(props) {
|
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
function WithdrawModalReown(props) {
|
|
33
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
33
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5H72PM2Ncjs.ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawModalWithReown, { ...props }) });
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
|
|
@@ -49,4 +49,14 @@ declare function getExplorerUrl(chainId: number | "solana"): string | undefined;
|
|
|
49
49
|
declare function getExplorerTxUrl(chainId: number | "solana", txHash: string): string | undefined;
|
|
50
50
|
declare function getExplorerName(chainId: number | "solana"): string;
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* HyperCore — Hyperliquid's virtual trading L1 (chain id 1337), settling on
|
|
54
|
+
* HyperEVM (999). It is USDC-only and requires an EOA recipient. It has no node
|
|
55
|
+
* of its own, so `targetChainToCaip2(1337)` still emits `eip155:1337` (the
|
|
56
|
+
* backend maps 1337 → 999), but it must never be used as an EVM RPC target.
|
|
57
|
+
*/
|
|
58
|
+
declare const HYPERCORE_CHAIN_ID = 1337;
|
|
59
|
+
/** Canonical USDC on HyperEVM (999), the HyperCore settlement chain. */
|
|
60
|
+
declare const HYPERCORE_USDC_ADDRESS = "0xb88339CB7199b77E23DB6E890353E22632Ba630f";
|
|
61
|
+
|
|
62
|
+
export { CHAIN_BY_ID as C, DEFAULT_BACKEND_URL as D, HYPERCORE_CHAIN_ID as H, NATIVE_TOKEN_ADDRESS as N, SOURCE_CHAINS as S, DEFAULT_SIGNER_ADDRESS as a, HYPERCORE_USDC_ADDRESS as b, SUPPORTED_CHAINS as c, chainRegistry as d, getChainIcon as e, findChainIdForToken as f, getChainBadge as g, getChainId as h, getChainName as i, getChainObject as j, getExplorerName as k, getExplorerTxUrl as l, getExplorerUrl as m, getSupportedChainIds as n, getSupportedTargetTokens as o, getSupportedTokenSymbolsForChain as p, getTargetTokenSymbolsForChain as q, getTokenAddress as r, getTokenDecimals as s, getTokenDecimalsByAddress as t, getTokenIcon as u, getTokenSymbol as v, getUsdcAddress as w, getUsdcDecimals as x, isSupportedTokenAddressForChain as y, type SupportedTokenOption as z };
|
|
@@ -49,4 +49,14 @@ declare function getExplorerUrl(chainId: number | "solana"): string | undefined;
|
|
|
49
49
|
declare function getExplorerTxUrl(chainId: number | "solana", txHash: string): string | undefined;
|
|
50
50
|
declare function getExplorerName(chainId: number | "solana"): string;
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* HyperCore — Hyperliquid's virtual trading L1 (chain id 1337), settling on
|
|
54
|
+
* HyperEVM (999). It is USDC-only and requires an EOA recipient. It has no node
|
|
55
|
+
* of its own, so `targetChainToCaip2(1337)` still emits `eip155:1337` (the
|
|
56
|
+
* backend maps 1337 → 999), but it must never be used as an EVM RPC target.
|
|
57
|
+
*/
|
|
58
|
+
declare const HYPERCORE_CHAIN_ID = 1337;
|
|
59
|
+
/** Canonical USDC on HyperEVM (999), the HyperCore settlement chain. */
|
|
60
|
+
declare const HYPERCORE_USDC_ADDRESS = "0xb88339CB7199b77E23DB6E890353E22632Ba630f";
|
|
61
|
+
|
|
62
|
+
export { CHAIN_BY_ID as C, DEFAULT_BACKEND_URL as D, HYPERCORE_CHAIN_ID as H, NATIVE_TOKEN_ADDRESS as N, SOURCE_CHAINS as S, DEFAULT_SIGNER_ADDRESS as a, HYPERCORE_USDC_ADDRESS as b, SUPPORTED_CHAINS as c, chainRegistry as d, getChainIcon as e, findChainIdForToken as f, getChainBadge as g, getChainId as h, getChainName as i, getChainObject as j, getExplorerName as k, getExplorerTxUrl as l, getExplorerUrl as m, getSupportedChainIds as n, getSupportedTargetTokens as o, getSupportedTokenSymbolsForChain as p, getTargetTokenSymbolsForChain as q, getTokenAddress as r, getTokenDecimals as s, getTokenDecimalsByAddress as t, getTokenIcon as u, getTokenSymbol as v, getUsdcAddress as w, getUsdcDecimals as x, isSupportedTokenAddressForChain as y, type SupportedTokenOption as z };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkLJLTLPHLcjs = require('./chunk-LJLTLPHL.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkMILJQWPTcjs = require('./chunk-MILJQWPT.cjs');
|
|
8
8
|
|
|
9
9
|
// src/core/reown.tsx
|
|
10
10
|
var _react = require('react');
|
|
@@ -45,7 +45,7 @@ var APPKIT_NETWORK_BY_ID = {
|
|
|
45
45
|
[_networks.soneium.id]: _networks.soneium,
|
|
46
46
|
[_networks.plasma.id]: _networks.plasma
|
|
47
47
|
};
|
|
48
|
-
var EVM_NETWORKS =
|
|
48
|
+
var EVM_NETWORKS = _chunkMILJQWPTcjs.SUPPORTED_CHAINS.map((chain) => {
|
|
49
49
|
const network = APPKIT_NETWORK_BY_ID[chain.id];
|
|
50
50
|
if (!network) {
|
|
51
51
|
throw new Error(
|
|
@@ -145,9 +145,9 @@ function useReownWallet() {
|
|
|
145
145
|
await switchChainAsync({ chainId });
|
|
146
146
|
}
|
|
147
147
|
} catch (err) {
|
|
148
|
-
if (
|
|
148
|
+
if (_chunkLJLTLPHLcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
|
|
149
149
|
throw new Error(
|
|
150
|
-
`Switch to ${
|
|
150
|
+
`Switch to ${_chunkMILJQWPTcjs.getChainName.call(void 0, chainId)} in your wallet to continue`
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
153
|
throw err;
|
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
// src/core/caip.ts
|
|
2
|
+
var SOLANA_MAINNET_GENESIS = "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
3
|
+
var SOLANA_MAINNET_CAIP2 = `solana:${SOLANA_MAINNET_GENESIS}`;
|
|
4
|
+
function toEvmCaip2(chainId) {
|
|
5
|
+
return `eip155:${chainId}`;
|
|
6
|
+
}
|
|
7
|
+
function targetChainToCaip2(targetChain) {
|
|
8
|
+
return targetChain === "solana" ? SOLANA_MAINNET_CAIP2 : toEvmCaip2(targetChain);
|
|
9
|
+
}
|
|
10
|
+
function parseEvmChainId(value) {
|
|
11
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
if (typeof value !== "string") return null;
|
|
15
|
+
const match = value.match(/^eip155:(\d+)$/);
|
|
16
|
+
if (!match?.[1]) return null;
|
|
17
|
+
const parsed = Number.parseInt(match[1], 10);
|
|
18
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
19
|
+
}
|
|
20
|
+
function isSolanaCaip2(value) {
|
|
21
|
+
return typeof value === "string" && value.startsWith("solana:");
|
|
22
|
+
}
|
|
23
|
+
var HYPERCORE_CHAIN_ID = 1337;
|
|
24
|
+
var HYPERCORE_USDC_ADDRESS = "0xb88339CB7199b77E23DB6E890353E22632Ba630f";
|
|
25
|
+
var HYPERCORE_MIN_DEPOSIT_USD = 1;
|
|
26
|
+
function isVirtualDestination(targetChain) {
|
|
27
|
+
return targetChain === "solana" || targetChain === HYPERCORE_CHAIN_ID;
|
|
28
|
+
}
|
|
29
|
+
function isContractBytecode(code) {
|
|
30
|
+
if (!code || code === "0x") return false;
|
|
31
|
+
if (code.toLowerCase().startsWith("0xef0100")) return false;
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
|
|
1
35
|
// src/core/solana-tokens.ts
|
|
2
36
|
var SOLANA_TOKENS = [
|
|
3
37
|
{ symbol: "SOL", mint: "native", decimals: 9 },
|
|
@@ -67,6 +101,7 @@ var SOLANA_CHAIN_ICON = SOL_BADGE_SVG;
|
|
|
67
101
|
var SOLANA_TOKEN_ICON = SOL_BADGE_SVG;
|
|
68
102
|
function getChainIcon(chainId) {
|
|
69
103
|
if (chainId === "solana") return SOLANA_CHAIN_ICON;
|
|
104
|
+
if (chainId === HYPERCORE_CHAIN_ID) return CHAIN_ICONS[hyperliquid.id];
|
|
70
105
|
return CHAIN_ICONS[chainId];
|
|
71
106
|
}
|
|
72
107
|
function getTokenIcon(symbol) {
|
|
@@ -303,6 +338,13 @@ var chainRegistry = {
|
|
|
303
338
|
decimals: 6
|
|
304
339
|
}
|
|
305
340
|
]
|
|
341
|
+
},
|
|
342
|
+
// HyperCore (virtual chain 1337) is a USDC-only deposit *destination*. It has
|
|
343
|
+
// no viem chain / RPC, so it lives only here for name + token resolution —
|
|
344
|
+
// deliberately absent from the source-chain matrices above.
|
|
345
|
+
[HYPERCORE_CHAIN_ID]: {
|
|
346
|
+
name: "HyperCore",
|
|
347
|
+
tokens: [{ symbol: "USDC", address: HYPERCORE_USDC_ADDRESS, decimals: 6 }]
|
|
306
348
|
}
|
|
307
349
|
};
|
|
308
350
|
function getChainId(chain) {
|
|
@@ -482,7 +524,12 @@ var CHAIN_BADGES = {
|
|
|
482
524
|
[sonic2.id]: { shortLabel: "Sonic", color: "#5B6DEF", bg: "#EDEFFE" },
|
|
483
525
|
[gnosis2.id]: { shortLabel: "Gnosis", color: "#3E6957", bg: "#E5F0EB" },
|
|
484
526
|
[hyperliquid2.id]: { shortLabel: "Hyper", color: "#5BE7C4", bg: "#E5FFF8" },
|
|
485
|
-
[monad2.id]: { shortLabel: "Monad", color: "#6E54FF", bg: "#EEEBFF" }
|
|
527
|
+
[monad2.id]: { shortLabel: "Monad", color: "#6E54FF", bg: "#EEEBFF" },
|
|
528
|
+
[HYPERCORE_CHAIN_ID]: {
|
|
529
|
+
shortLabel: "HyperCore",
|
|
530
|
+
color: "#5BE7C4",
|
|
531
|
+
bg: "#E5FFF8"
|
|
532
|
+
}
|
|
486
533
|
};
|
|
487
534
|
function getChainName(chainId) {
|
|
488
535
|
if (chainId === "solana") return "Solana";
|
|
@@ -520,6 +567,15 @@ function getExplorerName(chainId) {
|
|
|
520
567
|
}
|
|
521
568
|
|
|
522
569
|
export {
|
|
570
|
+
toEvmCaip2,
|
|
571
|
+
targetChainToCaip2,
|
|
572
|
+
parseEvmChainId,
|
|
573
|
+
isSolanaCaip2,
|
|
574
|
+
HYPERCORE_CHAIN_ID,
|
|
575
|
+
HYPERCORE_USDC_ADDRESS,
|
|
576
|
+
HYPERCORE_MIN_DEPOSIT_USD,
|
|
577
|
+
isVirtualDestination,
|
|
578
|
+
isContractBytecode,
|
|
523
579
|
SOLANA_TOKENS,
|
|
524
580
|
getSolanaTokenBySymbol,
|
|
525
581
|
getSolanaTokenByMint,
|