@nexus-cross/connect-kit-react 1.1.4 → 1.3.0
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/README.md +15 -29
- package/dist/chunk-KM3ZTTHL.js +143 -0
- package/dist/client.d.ts +46 -0
- package/dist/client.js +1 -0
- package/dist/index.d.ts +378 -25
- package/dist/index.js +1 -12
- package/package.json +15 -6
- package/dist/components/ConnectButton.d.ts +0 -87
- package/dist/components/ConnectButton.d.ts.map +0 -1
- package/dist/components/ConnectButton.js +0 -417
- package/dist/components/ConnectButton.js.map +0 -1
- package/dist/components/CrossConnectKitProvider.d.ts +0 -38
- package/dist/components/CrossConnectKitProvider.d.ts.map +0 -1
- package/dist/components/CrossConnectKitProvider.js +0 -737
- package/dist/components/CrossConnectKitProvider.js.map +0 -1
- package/dist/components/CrossConnectModal.d.ts +0 -20
- package/dist/components/CrossConnectModal.d.ts.map +0 -1
- package/dist/components/CrossConnectModal.js +0 -80
- package/dist/components/CrossConnectModal.js.map +0 -1
- package/dist/components/OtherWalletsModal.d.ts +0 -20
- package/dist/components/OtherWalletsModal.d.ts.map +0 -1
- package/dist/components/OtherWalletsModal.js +0 -300
- package/dist/components/OtherWalletsModal.js.map +0 -1
- package/dist/components/WalletInfoPopover.d.ts +0 -7
- package/dist/components/WalletInfoPopover.d.ts.map +0 -1
- package/dist/components/WalletInfoPopover.js +0 -166
- package/dist/components/WalletInfoPopover.js.map +0 -1
- package/dist/components/types.d.ts +0 -23
- package/dist/components/types.d.ts.map +0 -1
- package/dist/components/types.js +0 -2
- package/dist/components/types.js.map +0 -1
- package/dist/context/CrossConnectKitContext.d.ts +0 -93
- package/dist/context/CrossConnectKitContext.d.ts.map +0 -1
- package/dist/context/CrossConnectKitContext.js +0 -10
- package/dist/context/CrossConnectKitContext.js.map +0 -1
- package/dist/context/CrossConnectKitThemeContext.d.ts +0 -41
- package/dist/context/CrossConnectKitThemeContext.d.ts.map +0 -1
- package/dist/context/CrossConnectKitThemeContext.js +0 -22
- package/dist/context/CrossConnectKitThemeContext.js.map +0 -1
- package/dist/hooks/useCrossxEmbeddedInfo.d.ts +0 -41
- package/dist/hooks/useCrossxEmbeddedInfo.d.ts.map +0 -1
- package/dist/hooks/useCrossxEmbeddedInfo.js +0 -241
- package/dist/hooks/useCrossxEmbeddedInfo.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useState } from 'react';
|
|
3
|
-
import { useAccount, useBalance, useDisconnect, useEnsName } from 'wagmi';
|
|
4
|
-
import { formatBalance } from '@nexus-cross/connect-kit-core';
|
|
5
|
-
import { useCrossConnectKit } from '../context/CrossConnectKitContext.js';
|
|
6
|
-
function truncateAddress(address) {
|
|
7
|
-
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
8
|
-
}
|
|
9
|
-
export function WalletInfoPopover({ open, onClose }) {
|
|
10
|
-
const { address, chain } = useAccount();
|
|
11
|
-
const { data: ensName } = useEnsName({ address });
|
|
12
|
-
const { data: balance } = useBalance({ address });
|
|
13
|
-
const { disconnect } = useDisconnect();
|
|
14
|
-
const { selectWallet, currentWallet } = useCrossConnectKit();
|
|
15
|
-
const [copied, setCopied] = useState(false);
|
|
16
|
-
const isEmbedded = currentWallet === 'cross_embedded';
|
|
17
|
-
const handleCopy = useCallback(() => {
|
|
18
|
-
if (!address)
|
|
19
|
-
return;
|
|
20
|
-
navigator.clipboard.writeText(address).then(() => {
|
|
21
|
-
setCopied(true);
|
|
22
|
-
setTimeout(() => setCopied(false), 2000);
|
|
23
|
-
});
|
|
24
|
-
}, [address]);
|
|
25
|
-
const handleDisconnect = useCallback(() => {
|
|
26
|
-
disconnect();
|
|
27
|
-
onClose();
|
|
28
|
-
}, [disconnect, onClose]);
|
|
29
|
-
const handleExplorer = useCallback(() => {
|
|
30
|
-
if (!chain?.blockExplorers?.default?.url || !address)
|
|
31
|
-
return;
|
|
32
|
-
window.open(`${chain.blockExplorers.default.url}/address/${address}`, '_blank');
|
|
33
|
-
}, [chain, address]);
|
|
34
|
-
if (!open || !address)
|
|
35
|
-
return null;
|
|
36
|
-
const displayName = ensName ?? truncateAddress(address);
|
|
37
|
-
const balanceText = balance
|
|
38
|
-
? `${formatBalance(balance.value, balance.decimals)} ${balance.symbol}`
|
|
39
|
-
: '—';
|
|
40
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { style: s.backdrop, onClick: onClose }), _jsxs("div", { style: s.popover, children: [_jsxs("div", { style: s.identity, children: [_jsx("div", { style: s.avatar, children: _jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", children: [_jsx("rect", { width: "40", height: "40", rx: "20", fill: "#00D5AA" }), _jsx("text", { x: "50%", y: "55%", textAnchor: "middle", dominantBaseline: "middle", fontSize: "16", fontWeight: "bold", fill: "#000", children: address.slice(2, 4).toUpperCase() })] }) }), _jsxs("div", { style: s.identityText, children: [_jsx("div", { style: s.displayName, children: displayName }), chain && _jsx("div", { style: s.chainName, children: chain.name })] })] }), _jsxs("div", { style: s.balanceCard, children: [_jsx("div", { style: s.balanceLabel, children: "Balance" }), _jsx("div", { style: s.balanceValue, children: balanceText })] }), _jsxs("div", { style: s.addressRow, children: [_jsx("code", { style: s.addressCode, children: truncateAddress(address) }), _jsx("button", { type: "button", onClick: handleCopy, style: s.actionBtn, title: "Copy address", children: copied ? (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#00D5AA", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("polyline", { points: "20 6 9 17 4 12" }) })) : (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }), _jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })] })) }), chain?.blockExplorers?.default && (_jsx("button", { type: "button", onClick: handleExplorer, style: s.actionBtn, title: "View on explorer", children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }), _jsx("polyline", { points: "15 3 21 3 21 9" }), _jsx("line", { x1: "10", y1: "14", x2: "21", y2: "3" })] }) }))] }), isEmbedded && (_jsxs("button", { type: "button", onClick: () => { selectWallet(); onClose(); }, style: s.selectWalletBtn, children: [_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("rect", { x: "2", y: "6", width: "20", height: "14", rx: "2" }), _jsx("path", { d: "M22 10H2" })] }), "Select Wallet"] })), _jsxs("button", { type: "button", onClick: handleDisconnect, style: s.disconnectBtn, children: [_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }), _jsx("polyline", { points: "16 17 21 12 16 7" }), _jsx("line", { x1: "21", y1: "12", x2: "9", y2: "12" })] }), "Disconnect"] })] })] }));
|
|
41
|
-
}
|
|
42
|
-
const s = {
|
|
43
|
-
backdrop: {
|
|
44
|
-
position: 'fixed',
|
|
45
|
-
inset: 0,
|
|
46
|
-
zIndex: 9999,
|
|
47
|
-
},
|
|
48
|
-
popover: {
|
|
49
|
-
position: 'absolute',
|
|
50
|
-
top: 'calc(100% + 8px)',
|
|
51
|
-
right: 0,
|
|
52
|
-
width: '320px',
|
|
53
|
-
background: '#161922',
|
|
54
|
-
border: '1px solid #2a2d3a',
|
|
55
|
-
borderRadius: '20px',
|
|
56
|
-
padding: '20px',
|
|
57
|
-
zIndex: 10000,
|
|
58
|
-
boxShadow: '0 8px 40px rgba(0,0,0,0.5)',
|
|
59
|
-
display: 'flex',
|
|
60
|
-
flexDirection: 'column',
|
|
61
|
-
gap: '16px',
|
|
62
|
-
},
|
|
63
|
-
identity: {
|
|
64
|
-
display: 'flex',
|
|
65
|
-
alignItems: 'center',
|
|
66
|
-
gap: '12px',
|
|
67
|
-
},
|
|
68
|
-
avatar: {
|
|
69
|
-
flexShrink: 0,
|
|
70
|
-
borderRadius: '20px',
|
|
71
|
-
overflow: 'hidden',
|
|
72
|
-
},
|
|
73
|
-
identityText: {
|
|
74
|
-
display: 'flex',
|
|
75
|
-
flexDirection: 'column',
|
|
76
|
-
gap: '2px',
|
|
77
|
-
minWidth: 0,
|
|
78
|
-
},
|
|
79
|
-
displayName: {
|
|
80
|
-
fontSize: '16px',
|
|
81
|
-
fontWeight: 700,
|
|
82
|
-
color: '#fff',
|
|
83
|
-
overflow: 'hidden',
|
|
84
|
-
textOverflow: 'ellipsis',
|
|
85
|
-
whiteSpace: 'nowrap',
|
|
86
|
-
},
|
|
87
|
-
chainName: {
|
|
88
|
-
fontSize: '12px',
|
|
89
|
-
color: '#ffffff60',
|
|
90
|
-
fontWeight: 500,
|
|
91
|
-
},
|
|
92
|
-
balanceCard: {
|
|
93
|
-
background: '#1e232e',
|
|
94
|
-
borderRadius: '14px',
|
|
95
|
-
padding: '14px 16px',
|
|
96
|
-
},
|
|
97
|
-
balanceLabel: {
|
|
98
|
-
fontSize: '11px',
|
|
99
|
-
fontWeight: 600,
|
|
100
|
-
color: '#ffffff50',
|
|
101
|
-
marginBottom: '4px',
|
|
102
|
-
textTransform: 'uppercase',
|
|
103
|
-
letterSpacing: '0.05em',
|
|
104
|
-
},
|
|
105
|
-
balanceValue: {
|
|
106
|
-
fontSize: '20px',
|
|
107
|
-
fontWeight: 700,
|
|
108
|
-
color: '#fff',
|
|
109
|
-
},
|
|
110
|
-
addressRow: {
|
|
111
|
-
display: 'flex',
|
|
112
|
-
alignItems: 'center',
|
|
113
|
-
gap: '8px',
|
|
114
|
-
background: '#1e232e',
|
|
115
|
-
borderRadius: '12px',
|
|
116
|
-
padding: '10px 12px',
|
|
117
|
-
},
|
|
118
|
-
addressCode: {
|
|
119
|
-
flex: 1,
|
|
120
|
-
fontSize: '13px',
|
|
121
|
-
color: '#ffffff90',
|
|
122
|
-
fontFamily: 'monospace',
|
|
123
|
-
},
|
|
124
|
-
actionBtn: {
|
|
125
|
-
background: 'none',
|
|
126
|
-
border: 'none',
|
|
127
|
-
color: '#ffffff60',
|
|
128
|
-
cursor: 'pointer',
|
|
129
|
-
padding: '4px',
|
|
130
|
-
borderRadius: '6px',
|
|
131
|
-
display: 'flex',
|
|
132
|
-
alignItems: 'center',
|
|
133
|
-
justifyContent: 'center',
|
|
134
|
-
},
|
|
135
|
-
selectWalletBtn: {
|
|
136
|
-
width: '100%',
|
|
137
|
-
padding: '12px',
|
|
138
|
-
borderRadius: '12px',
|
|
139
|
-
border: 'none',
|
|
140
|
-
background: 'rgba(255,255,255,0.05)',
|
|
141
|
-
color: '#ffffffb2',
|
|
142
|
-
fontWeight: 600,
|
|
143
|
-
fontSize: '14px',
|
|
144
|
-
cursor: 'pointer',
|
|
145
|
-
display: 'flex',
|
|
146
|
-
alignItems: 'center',
|
|
147
|
-
justifyContent: 'center',
|
|
148
|
-
gap: '8px',
|
|
149
|
-
},
|
|
150
|
-
disconnectBtn: {
|
|
151
|
-
width: '100%',
|
|
152
|
-
padding: '12px',
|
|
153
|
-
borderRadius: '12px',
|
|
154
|
-
border: 'none',
|
|
155
|
-
background: 'rgba(255,255,255,0.05)',
|
|
156
|
-
color: '#ffffffb2',
|
|
157
|
-
fontWeight: 600,
|
|
158
|
-
fontSize: '14px',
|
|
159
|
-
cursor: 'pointer',
|
|
160
|
-
display: 'flex',
|
|
161
|
-
alignItems: 'center',
|
|
162
|
-
justifyContent: 'center',
|
|
163
|
-
gap: '8px',
|
|
164
|
-
},
|
|
165
|
-
};
|
|
166
|
-
//# sourceMappingURL=WalletInfoPopover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletInfoPopover.js","sourceRoot":"","sources":["../../src/components/WalletInfoPopover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAQ1E,SAAS,eAAe,CAAC,OAAe;IACtC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAA0B;IACzE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,CAAC;IACxC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAClD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAClD,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,EAAE,CAAC;IACvC,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAC7D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C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AG,EAAE,KAAK;KACX;CACF,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { WalletId } from '@nexus-cross/connect-kit-core';
|
|
3
|
-
import type { CrossxConfig } from '@nexus-cross/connect-kit-wagmi';
|
|
4
|
-
export interface CrossConnectKitProviderProps {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
config: CrossxConfig;
|
|
7
|
-
}
|
|
8
|
-
export interface ConnectButtonProps {
|
|
9
|
-
showBalance?: boolean;
|
|
10
|
-
label?: string;
|
|
11
|
-
className?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface OtherWalletsModalProps {
|
|
14
|
-
open: boolean;
|
|
15
|
-
onClose: () => void;
|
|
16
|
-
onSelect: (walletId: WalletId) => void;
|
|
17
|
-
}
|
|
18
|
-
export interface WalletInfoPopoverProps {
|
|
19
|
-
open: boolean;
|
|
20
|
-
onClose: () => void;
|
|
21
|
-
anchorRef?: React.RefObject<HTMLElement | null>;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CACjD"}
|
package/dist/components/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import type { CrossConnectKitConfig, OAuthPort, WalletId } from '@nexus-cross/connect-kit-core';
|
|
2
|
-
import type { ConnectorEntry, ConnectorRegistry } from '@nexus-cross/connect-kit-wagmi';
|
|
3
|
-
export interface CrossConnectKitContextValue {
|
|
4
|
-
kitConfig: CrossConnectKitConfig;
|
|
5
|
-
connectorRegistry: ConnectorRegistry;
|
|
6
|
-
/** Available wallets derived from the registry (excludes embedded) */
|
|
7
|
-
availableWallets: readonly ConnectorEntry[];
|
|
8
|
-
/** Connect by walletId — resolved through the registry */
|
|
9
|
-
connect: (walletId: WalletId) => Promise<void>;
|
|
10
|
-
/** Shortcut: trigger embedded wallet connect (SDK modal) */
|
|
11
|
-
connectWallet: () => Promise<void>;
|
|
12
|
-
/** Disconnect and clean up wagmi + SDK + cached session storage. */
|
|
13
|
-
disconnect: () => Promise<void>;
|
|
14
|
-
/** Open the SDK's wallet selector (embedded only) */
|
|
15
|
-
selectWallet: () => Promise<{
|
|
16
|
-
address: string;
|
|
17
|
-
index: number;
|
|
18
|
-
} | null>;
|
|
19
|
-
/** Currently active wallet type, resolved from registry */
|
|
20
|
-
currentWallet: WalletId | null;
|
|
21
|
-
/**
|
|
22
|
-
* The most recent wallet the user picked from the unified connect
|
|
23
|
-
* modal. Set by `runConnect` before the wagmi-side connect begins,
|
|
24
|
-
* cleared on dismissal/error so callers can detect that the user
|
|
25
|
-
* gave up on the wallet UI even when wagmi's `isConnecting` stays
|
|
26
|
-
* stuck on a pending connector promise (WalletConnect QR, OAuth
|
|
27
|
-
* popup). Reads of this should be paired with `isConnected` —
|
|
28
|
-
* `lastIntent && !isConnected` means "we asked for X but X hasn't
|
|
29
|
-
* succeeded yet", and a transition from non-null → null while
|
|
30
|
-
* disconnected is the kit's "user cancelled" signal.
|
|
31
|
-
*/
|
|
32
|
-
lastIntent: WalletId | null;
|
|
33
|
-
/**
|
|
34
|
-
* Unified "a connect attempt is in flight" flag spanning EVERY
|
|
35
|
-
* connection path — so "Connecting…" UI behaves identically regardless
|
|
36
|
-
* of which wallet the user picked. Unlike wagmi's
|
|
37
|
-
* `useAccount().isConnecting`, this also covers:
|
|
38
|
-
*
|
|
39
|
-
* - the reown direct-connect AppKit flow (`metamask` / `binance`),
|
|
40
|
-
* which resolves outside wagmi's `connectAsync` and therefore never
|
|
41
|
-
* flips wagmi's own `isConnecting`;
|
|
42
|
-
* - the embedded OAuth popup (`google` / `apple`), wired through
|
|
43
|
-
* `oauth.signIn` rather than the wagmi connect path.
|
|
44
|
-
*
|
|
45
|
-
* Set the instant the user picks a wallet in the modal; cleared on
|
|
46
|
-
* success (`isConnected`), cancel, or error. In-memory only — a stale
|
|
47
|
-
* persisted `lastIntent` from a previous page load never turns it on,
|
|
48
|
-
* and silent background reconnects (wagmi `isReconnecting`) don't either.
|
|
49
|
-
*/
|
|
50
|
-
isConnecting: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* The `walletId` of the in-flight connect attempt, or `null` when idle.
|
|
53
|
-
* Same lifecycle as {@link isConnecting} — use it to drive a per-wallet
|
|
54
|
-
* spinner inside a custom connect modal.
|
|
55
|
-
*/
|
|
56
|
-
connectingWalletId: WalletId | null;
|
|
57
|
-
/** Open the "Other Wallets" modal */
|
|
58
|
-
openOtherWallets: () => void;
|
|
59
|
-
/** Close the "Other Wallets" modal */
|
|
60
|
-
closeOtherWallets: () => void;
|
|
61
|
-
/** Whether the "Other Wallets" modal is open */
|
|
62
|
-
otherWalletsOpen: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Headless OAuth entry point. Non-null only when the kit was created
|
|
65
|
-
* with an `embeddedConnectorFactory` (i.e. crossy-sdk is present).
|
|
66
|
-
* Used by `<CrossConnectModal>` to wire the Google/Apple buttons.
|
|
67
|
-
*/
|
|
68
|
-
oauth: OAuthPort | null;
|
|
69
|
-
/**
|
|
70
|
-
* Extra wallet click-handlers the DApp wants to render in the connect
|
|
71
|
-
* modal that have NO wagmi connector behind them (e.g. coming-soon
|
|
72
|
-
* placeholders or dapp-ui-only wallets like Verse8 / Tron). Keys are
|
|
73
|
-
* walletIds known to dapp-ui's `WALLET_REGISTRY`; values are click
|
|
74
|
-
* handlers (typically opening an alert or external page).
|
|
75
|
-
*/
|
|
76
|
-
extraWallets: Partial<Record<WalletId, () => void | Promise<void>>>;
|
|
77
|
-
/**
|
|
78
|
-
* Optional whitelist controlling which wallet ids appear in the
|
|
79
|
-
* connect modal's "Other Wallets" list.
|
|
80
|
-
*
|
|
81
|
-
* - `undefined` (default) — show every registered wallet
|
|
82
|
-
* - `[]` — show none (social row only)
|
|
83
|
-
* - `['cross_wallet', ...]` — show only the listed ids
|
|
84
|
-
*
|
|
85
|
-
* Applies to both wagmi-backed entries and `extraWallets`. The social
|
|
86
|
-
* row is independent of this — disable social by omitting
|
|
87
|
-
* `embeddedConnectorFactory` from `createCrossxConfig`.
|
|
88
|
-
*/
|
|
89
|
-
walletAllowlist: readonly WalletId[] | null;
|
|
90
|
-
}
|
|
91
|
-
export declare const CrossConnectKitContext: import("react").Context<CrossConnectKitContextValue | null>;
|
|
92
|
-
export declare function useCrossConnectKit(): CrossConnectKitContextValue;
|
|
93
|
-
//# sourceMappingURL=CrossConnectKitContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Cross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;IACH,YAAY,EAAE,OAAO,CACnB,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAC7C,CAAC;IAEF;;;;;;;;;;;OAWG;IACH,eAAe,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,sBAAsB,6DAA0D,CAAC;AAE9F,wBAAgB,kBAAkB,IAAI,2BAA2B,CAMhE"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
2
|
-
export const CrossConnectKitContext = createContext(null);
|
|
3
|
-
export function useCrossConnectKit() {
|
|
4
|
-
const ctx = useContext(CrossConnectKitContext);
|
|
5
|
-
if (!ctx) {
|
|
6
|
-
throw new Error('useCrossConnectKit must be used within <CrossConnectKitProvider>');
|
|
7
|
-
}
|
|
8
|
-
return ctx;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=CrossConnectKitContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CrossConnectKitContext.js","sourceRoot":"","sources":["../../src/context/CrossConnectKitContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AA0GlD,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAqC,IAAI,CAAC,CAAC;AAE9F,MAAM,UAAU,kBAAkB;IAChC,MAAM,GAAG,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;IAC/C,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ThemeMode, ThemeTokens } from '@nexus-cross/connect-kit-core';
|
|
2
|
-
/**
|
|
3
|
-
* Resolved theme state exposed to consumers inside `<CrossConnectKitProvider>`.
|
|
4
|
-
* `mode` already accounts for `autoDetectTheme` and any runtime
|
|
5
|
-
* overrides via `setTheme`.
|
|
6
|
-
*/
|
|
7
|
-
export interface CrossConnectKitThemeContextValue {
|
|
8
|
-
/** Active theme mode (respects `autoDetectTheme` + runtime overrides). */
|
|
9
|
-
mode: ThemeMode;
|
|
10
|
-
/** Resolved token set passed to crossy-sdk + published as `--cck-*`. */
|
|
11
|
-
tokens: ThemeTokens | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Override the theme mode at runtime. Mirrors crossy-sdk's
|
|
14
|
-
* `sdk.applyTheme(mode)`.
|
|
15
|
-
*
|
|
16
|
-
* Passing `null` reverts to whatever the original `CrossConnectKitConfig`
|
|
17
|
-
* declared (including `autoDetectTheme`).
|
|
18
|
-
*/
|
|
19
|
-
setThemeMode: (mode: ThemeMode | null) => void;
|
|
20
|
-
/**
|
|
21
|
-
* Override color tokens at runtime. Passed straight through to
|
|
22
|
-
* crossy-sdk's `applyTheme(mode, themeTokens)` on the next render,
|
|
23
|
-
* and re-published as CSS variables so dapp-ui surfaces update too.
|
|
24
|
-
*
|
|
25
|
-
* Passing `null` reverts to `CrossConnectKitConfig.themeTokens`.
|
|
26
|
-
*/
|
|
27
|
-
setThemeTokens: (tokens: ThemeTokens | null) => void;
|
|
28
|
-
}
|
|
29
|
-
export declare const CrossConnectKitThemeContext: import("react").Context<CrossConnectKitThemeContextValue | null>;
|
|
30
|
-
/**
|
|
31
|
-
* Access the resolved theme and the runtime override setters. Must be
|
|
32
|
-
* called inside `<CrossConnectKitProvider>`.
|
|
33
|
-
*/
|
|
34
|
-
export declare function useCrossConnectKitTheme(): CrossConnectKitThemeContextValue;
|
|
35
|
-
/**
|
|
36
|
-
* Version that returns `null` when called outside the provider — handy
|
|
37
|
-
* for components (like `WalletInfo`) that want to opt into the kit's
|
|
38
|
-
* theme if mounted under the provider, but keep working standalone.
|
|
39
|
-
*/
|
|
40
|
-
export declare function useOptionalCrossConnectKitTheme(): CrossConnectKitThemeContextValue | null;
|
|
41
|
-
//# sourceMappingURL=CrossConnectKitThemeContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CrossConnectKitThemeContext.d.ts","sourceRoot":"","sources":["../../src/context/CrossConnectKitThemeContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;;;GAIG;AACH,MAAM,WAAW,gCAAgC;IAC/C,0EAA0E;IAC1E,IAAI,EAAE,SAAS,CAAC;IAChB,wEAAwE;IACxE,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IAChC;;;;;;OAMG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C;;;;;;OAMG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;CACtD;AAED,eAAO,MAAM,2BAA2B,kEACsB,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,gCAAgC,CAQ1E;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,IAAI,gCAAgC,GAAG,IAAI,CAEzF"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
2
|
-
export const CrossConnectKitThemeContext = createContext(null);
|
|
3
|
-
/**
|
|
4
|
-
* Access the resolved theme and the runtime override setters. Must be
|
|
5
|
-
* called inside `<CrossConnectKitProvider>`.
|
|
6
|
-
*/
|
|
7
|
-
export function useCrossConnectKitTheme() {
|
|
8
|
-
const ctx = useContext(CrossConnectKitThemeContext);
|
|
9
|
-
if (!ctx) {
|
|
10
|
-
throw new Error('useCrossConnectKitTheme must be used within <CrossConnectKitProvider>');
|
|
11
|
-
}
|
|
12
|
-
return ctx;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Version that returns `null` when called outside the provider — handy
|
|
16
|
-
* for components (like `WalletInfo`) that want to opt into the kit's
|
|
17
|
-
* theme if mounted under the provider, but keep working standalone.
|
|
18
|
-
*/
|
|
19
|
-
export function useOptionalCrossConnectKitTheme() {
|
|
20
|
-
return useContext(CrossConnectKitThemeContext);
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=CrossConnectKitThemeContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CrossConnectKitThemeContext.js","sourceRoot":"","sources":["../../src/context/CrossConnectKitThemeContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AA+BlD,MAAM,CAAC,MAAM,2BAA2B,GACtC,aAAa,CAA0C,IAAI,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAM,UAAU,uBAAuB;IACrC,MAAM,GAAG,GAAG,UAAU,CAAC,2BAA2B,CAAC,CAAC;IACpD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B;IAC7C,OAAO,UAAU,CAAC,2BAA2B,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { Connector } from 'wagmi';
|
|
2
|
-
export interface CrossxEmbeddedInfo {
|
|
3
|
-
/** crossy-sdk OAuth 로그인 타입. embedded가 아니면 `null`. */
|
|
4
|
-
loginType: 'google' | 'apple' | null;
|
|
5
|
-
/** SDK `getAddresses()`가 리턴한 현재 주소의 `name` 필드(계정 라벨). */
|
|
6
|
-
accountName: string | null;
|
|
7
|
-
/** SDK `getAddresses()`가 리턴한 전체 계정 목록. embedded가 아니면 빈 배열. */
|
|
8
|
-
accounts: Array<{
|
|
9
|
-
address: `0x${string}`;
|
|
10
|
-
index?: number;
|
|
11
|
-
name?: string;
|
|
12
|
-
}>;
|
|
13
|
-
/**
|
|
14
|
-
* SDK 조회가 완료됐는지 여부. embedded 세션에서 처음 마운트됐을 때
|
|
15
|
-
* `loginType`은 잠시 `null`이고 다음 틱에 `google`/`apple`로 바뀌는데,
|
|
16
|
-
* 이 플래그로 "아직 해석 중" vs "해석 완료(OAuth 아님)"을 구분한다.
|
|
17
|
-
* embedded가 아닌 wallet은 즉시 `true`.
|
|
18
|
-
*/
|
|
19
|
-
isResolved: boolean;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* crossy-sdk 2.0 세션 메타데이터(`getUserInfo().loginType`,
|
|
23
|
-
* `getAddresses()[].name`)를 비동기로 읽어오는 훅.
|
|
24
|
-
*
|
|
25
|
-
* - `walletId`가 `"cross_embedded"`가 아니면 항상
|
|
26
|
-
* `{ loginType: null, accountName: null, accounts: [], isResolved: true }`.
|
|
27
|
-
* - 내부 호출은 연결된 Provider가 `sdk` 필드를 노출하는 crossy-sdk 스펙을
|
|
28
|
-
* 가정하며, 필드가 없거나 에러가 나면 조용히 nulls로 떨어진다.
|
|
29
|
-
* - RN native bridge가 walletChanged 이벤트로 보내주는 walletName(예: imported
|
|
30
|
-
* wallet의 사용자 라벨)도 함께 구독해, SDK 서버 캐시 `name`보다 우선
|
|
31
|
-
* accountName으로 사용한다.
|
|
32
|
-
*
|
|
33
|
-
* 인자 없이 호출하면 `useAccount()` / `useCrossConnectKit()`에서 값을 자동으로
|
|
34
|
-
* 받아오고, 명시적으로 제어하고 싶으면 오버라이드 값을 넘길 수 있다.
|
|
35
|
-
*/
|
|
36
|
-
export declare function useCrossxEmbeddedInfo(args?: {
|
|
37
|
-
walletId?: string | null;
|
|
38
|
-
connector?: Connector;
|
|
39
|
-
address?: string;
|
|
40
|
-
}): CrossxEmbeddedInfo;
|
|
41
|
-
//# sourceMappingURL=useCrossxEmbeddedInfo.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossxEmbeddedInfo.d.ts","sourceRoot":"","sources":["../../src/hooks/useCrossxEmbeddedInfo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,SAAS,EAAE,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;IACrC,yDAAyD;IACzD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,8DAA8D;IAC9D,QAAQ,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3E;;;;;OAKG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,CAAC,EAAE;IAC3C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,kBAAkB,CAgRrB"}
|