@rhinestone/deposit-modal 0.3.0-alpha.14 → 0.3.0-alpha.16
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-4I47KSPN.cjs → DepositModalReown-QRLLANTS.cjs} +7 -7
- package/dist/{DepositModalReown-DIUIB3MU.mjs → DepositModalReown-THU2QG76.mjs} +4 -4
- package/dist/{WithdrawModalReown-Y3NRAKXJ.cjs → WithdrawModalReown-PHWLYDZQ.cjs} +7 -7
- package/dist/{WithdrawModalReown-WRUEALDP.mjs → WithdrawModalReown-SSRJNUGZ.mjs} +4 -4
- 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-SZIYS42B.mjs → chunk-6YRDD462.mjs} +63 -3
- package/dist/{chunk-N4XRQPVA.cjs → chunk-7W5M6WEE.cjs} +226 -203
- package/dist/{chunk-JTMGFWXO.mjs → chunk-E2K7XWMN.mjs} +2 -2
- package/dist/{chunk-2NUXDEEO.cjs → chunk-G5YDICEN.cjs} +93 -93
- package/dist/{chunk-7JIDIX27.cjs → chunk-MILJQWPT.cjs} +73 -13
- package/dist/{chunk-VD4WTEHP.mjs → chunk-PAK3NUGY.mjs} +5 -5
- package/dist/{chunk-3CYGTYMY.cjs → chunk-PXQBJMNF.cjs} +526 -451
- package/dist/{chunk-JTULAFMU.cjs → chunk-UD6QUZJS.cjs} +5 -5
- package/dist/{chunk-XG474KUR.mjs → chunk-YX3I7C2R.mjs} +101 -26
- package/dist/{chunk-4ZN726P5.mjs → chunk-Z7OJPEV2.mjs} +258 -235
- 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.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +9 -5
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +8 -4
- package/dist/{types-C8i2ebY1.d.cts → types-cXr3j4NV.d.cts} +26 -0
- package/dist/{types-C8i2ebY1.d.ts → types-cXr3j4NV.d.ts} +26 -0
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +1 -1
|
@@ -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 _chunkPXQBJMNFcjs = require('./chunk-PXQBJMNF.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
7
|
+
var _chunkUD6QUZJScjs = require('./chunk-UD6QUZJS.cjs');
|
|
8
|
+
require('./chunk-7W5M6WEE.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 = _chunkUD6QUZJScjs.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
|
+
_chunkPXQBJMNFcjs.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
|
+
_chunkUD6QUZJScjs.ReownWalletProvider,
|
|
50
50
|
{
|
|
51
51
|
projectId: props.reownAppId,
|
|
52
52
|
theme: props.theme,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YX3I7C2R.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-E2K7XWMN.mjs";
|
|
8
|
+
import "./chunk-Z7OJPEV2.mjs";
|
|
9
|
+
import "./chunk-6YRDD462.mjs";
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
12
12
|
import { useCallback, useMemo } from "react";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkG5YDICENcjs = require('./chunk-G5YDICEN.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
7
|
+
var _chunkUD6QUZJScjs = require('./chunk-UD6QUZJS.cjs');
|
|
8
|
+
require('./chunk-7W5M6WEE.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 = _chunkUD6QUZJScjs.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
|
+
_chunkG5YDICENcjs.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, _chunkUD6QUZJScjs.ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawModalWithReown, { ...props }) });
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PAK3NUGY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-E2K7XWMN.mjs";
|
|
8
|
+
import "./chunk-Z7OJPEV2.mjs";
|
|
9
|
+
import "./chunk-6YRDD462.mjs";
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
12
12
|
import { useCallback } from "react";
|
|
@@ -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,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) {
|
|
@@ -403,7 +445,7 @@ function getSupportedTargetTokens(chainId) {
|
|
|
403
445
|
}
|
|
404
446
|
return options;
|
|
405
447
|
}
|
|
406
|
-
function
|
|
448
|
+
function findTokenDecimals(token, chainId) {
|
|
407
449
|
const normalized = token.toLowerCase();
|
|
408
450
|
if (normalized === NATIVE_TOKEN_ADDRESS) {
|
|
409
451
|
return 18;
|
|
@@ -423,7 +465,10 @@ function getTokenDecimalsByAddress(token, chainId) {
|
|
|
423
465
|
);
|
|
424
466
|
if (found) return found.decimals;
|
|
425
467
|
}
|
|
426
|
-
return
|
|
468
|
+
return void 0;
|
|
469
|
+
}
|
|
470
|
+
function getTokenDecimalsByAddress(token, chainId) {
|
|
471
|
+
return findTokenDecimals(token, chainId) ?? 18;
|
|
427
472
|
}
|
|
428
473
|
function findChainIdForToken(address) {
|
|
429
474
|
const normalized = address.toLowerCase();
|
|
@@ -479,7 +524,12 @@ var CHAIN_BADGES = {
|
|
|
479
524
|
[sonic2.id]: { shortLabel: "Sonic", color: "#5B6DEF", bg: "#EDEFFE" },
|
|
480
525
|
[gnosis2.id]: { shortLabel: "Gnosis", color: "#3E6957", bg: "#E5F0EB" },
|
|
481
526
|
[hyperliquid2.id]: { shortLabel: "Hyper", color: "#5BE7C4", bg: "#E5FFF8" },
|
|
482
|
-
[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
|
+
}
|
|
483
533
|
};
|
|
484
534
|
function getChainName(chainId) {
|
|
485
535
|
if (chainId === "solana") return "Solana";
|
|
@@ -517,6 +567,15 @@ function getExplorerName(chainId) {
|
|
|
517
567
|
}
|
|
518
568
|
|
|
519
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,
|
|
520
579
|
SOLANA_TOKENS,
|
|
521
580
|
getSolanaTokenBySymbol,
|
|
522
581
|
getSolanaTokenByMint,
|
|
@@ -541,6 +600,7 @@ export {
|
|
|
541
600
|
getSupportedChainIds,
|
|
542
601
|
isSupportedTokenAddressForChain,
|
|
543
602
|
getSupportedTargetTokens,
|
|
603
|
+
findTokenDecimals,
|
|
544
604
|
getTokenDecimalsByAddress,
|
|
545
605
|
findChainIdForToken,
|
|
546
606
|
getTokenSymbol,
|