@rhinestone/deposit-modal 0.2.4 → 0.2.5-alpha.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/dist/{DepositModalReown-CY5MSQGK.mjs → DepositModalReown-GIODYNOK.mjs} +4 -2
- package/dist/{DepositModalReown-2UMPITRN.cjs → DepositModalReown-SVVA3OZ6.cjs} +5 -3
- package/dist/{WithdrawModalReown-YSRO5ZTA.mjs → WithdrawModalReown-HTEB4XGU.mjs} +3 -2
- package/dist/{WithdrawModalReown-Z5BUZQ4Z.cjs → WithdrawModalReown-VNTKGALT.cjs} +4 -3
- package/dist/{chunk-QUOP5C6V.cjs → chunk-4S262VLP.cjs} +54 -338
- package/dist/{chunk-ARGMXV6E.cjs → chunk-AHQY2O3U.cjs} +507 -235
- package/dist/{chunk-WNFGZS56.mjs → chunk-DUGDAMAF.mjs} +134 -132
- package/dist/chunk-J2SWZSXL.mjs +295 -0
- package/dist/{chunk-NFXJEOE6.cjs → chunk-KE6CJVOV.cjs} +88 -86
- package/dist/chunk-LHOHM67Z.mjs +234 -0
- package/dist/{chunk-HFQV7EHS.mjs → chunk-RQ2VCKLS.mjs} +451 -179
- package/dist/{chunk-KJEHVIPZ.mjs → chunk-WA4RA4HB.mjs} +14 -298
- package/dist/chunk-YKGL66EF.cjs +295 -0
- package/dist/chunk-ZHLQMSQM.cjs +234 -0
- package/dist/deposit.cjs +5 -3
- package/dist/deposit.d.cts +3 -3
- package/dist/deposit.d.ts +3 -3
- package/dist/deposit.mjs +4 -2
- package/dist/index.cjs +6 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +5 -3
- package/dist/reown.cjs +6 -4
- package/dist/reown.d.cts +2 -2
- package/dist/reown.d.ts +2 -2
- package/dist/reown.mjs +5 -3
- package/dist/safe-CB7TvRCc.d.cts +62 -0
- package/dist/safe-CB7TvRCc.d.ts +62 -0
- package/dist/safe.cjs +22 -1
- package/dist/safe.d.cts +11 -59
- package/dist/safe.d.ts +11 -59
- package/dist/safe.mjs +22 -0
- package/dist/{types-DGQzvl6v.d.ts → types-CeFbJ-MW.d.ts} +8 -1
- package/dist/{types-DJ1fzNC7.d.cts → types-D0NawmZ8.d.cts} +8 -1
- package/dist/withdraw.cjs +4 -3
- package/dist/withdraw.d.cts +3 -3
- package/dist/withdraw.d.ts +3 -3
- package/dist/withdraw.mjs +3 -2
- package/package.json +1 -1
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getChainName
|
|
3
|
+
} from "./chunk-WHW3ZMOT.mjs";
|
|
4
|
+
|
|
5
|
+
// src/core/safe.ts
|
|
6
|
+
import {
|
|
7
|
+
concat,
|
|
8
|
+
encodeFunctionData,
|
|
9
|
+
erc20Abi,
|
|
10
|
+
hashTypedData,
|
|
11
|
+
pad,
|
|
12
|
+
parseEventLogs,
|
|
13
|
+
toHex,
|
|
14
|
+
zeroAddress
|
|
15
|
+
} from "viem";
|
|
16
|
+
var SAFE_ABI = [
|
|
17
|
+
{
|
|
18
|
+
type: "function",
|
|
19
|
+
name: "isOwner",
|
|
20
|
+
stateMutability: "view",
|
|
21
|
+
inputs: [{ name: "owner", type: "address" }],
|
|
22
|
+
outputs: [{ name: "", type: "bool" }]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: "function",
|
|
26
|
+
name: "nonce",
|
|
27
|
+
stateMutability: "view",
|
|
28
|
+
inputs: [],
|
|
29
|
+
outputs: [{ type: "uint256" }]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
type: "function",
|
|
33
|
+
name: "execTransaction",
|
|
34
|
+
stateMutability: "payable",
|
|
35
|
+
inputs: [
|
|
36
|
+
{ name: "to", type: "address" },
|
|
37
|
+
{ name: "value", type: "uint256" },
|
|
38
|
+
{ name: "data", type: "bytes" },
|
|
39
|
+
{ name: "operation", type: "uint8" },
|
|
40
|
+
{ name: "safeTxGas", type: "uint256" },
|
|
41
|
+
{ name: "baseGas", type: "uint256" },
|
|
42
|
+
{ name: "gasPrice", type: "uint256" },
|
|
43
|
+
{ name: "gasToken", type: "address" },
|
|
44
|
+
{ name: "refundReceiver", type: "address" },
|
|
45
|
+
{ name: "signatures", type: "bytes" }
|
|
46
|
+
],
|
|
47
|
+
outputs: [{ name: "success", type: "bool" }]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type: "event",
|
|
51
|
+
name: "ExecutionSuccess",
|
|
52
|
+
inputs: [
|
|
53
|
+
{ name: "txHash", type: "bytes32", indexed: true },
|
|
54
|
+
{ name: "payment", type: "uint256", indexed: false }
|
|
55
|
+
],
|
|
56
|
+
anonymous: false
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: "event",
|
|
60
|
+
name: "ExecutionFailure",
|
|
61
|
+
inputs: [
|
|
62
|
+
{ name: "txHash", type: "bytes32", indexed: true },
|
|
63
|
+
{ name: "payment", type: "uint256", indexed: false }
|
|
64
|
+
],
|
|
65
|
+
anonymous: false
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
async function executeSafeEthTransfer(params) {
|
|
69
|
+
const {
|
|
70
|
+
walletClient,
|
|
71
|
+
publicClient,
|
|
72
|
+
safeAddress,
|
|
73
|
+
recipient,
|
|
74
|
+
amount,
|
|
75
|
+
chainId
|
|
76
|
+
} = params;
|
|
77
|
+
const account = walletClient.account;
|
|
78
|
+
const chain = walletClient.chain;
|
|
79
|
+
if (!account || !chain) {
|
|
80
|
+
throw new Error("Wallet not connected");
|
|
81
|
+
}
|
|
82
|
+
if (chain.id !== chainId) {
|
|
83
|
+
throw new Error(`Switch to ${getChainName(chainId)} to sign`);
|
|
84
|
+
}
|
|
85
|
+
const isOwner = await publicClient.readContract({
|
|
86
|
+
address: safeAddress,
|
|
87
|
+
abi: SAFE_ABI,
|
|
88
|
+
functionName: "isOwner",
|
|
89
|
+
args: [account.address]
|
|
90
|
+
});
|
|
91
|
+
if (!isOwner) {
|
|
92
|
+
throw new Error("Connected wallet is not a Safe owner");
|
|
93
|
+
}
|
|
94
|
+
const safeTx = {
|
|
95
|
+
to: recipient,
|
|
96
|
+
value: amount,
|
|
97
|
+
data: "0x",
|
|
98
|
+
operation: 0,
|
|
99
|
+
safeTxGas: 0n,
|
|
100
|
+
baseGas: 0n,
|
|
101
|
+
gasPrice: 0n,
|
|
102
|
+
gasToken: zeroAddress,
|
|
103
|
+
refundReceiver: zeroAddress
|
|
104
|
+
};
|
|
105
|
+
const signature = concat([
|
|
106
|
+
pad(account.address, { size: 32 }),
|
|
107
|
+
pad(toHex(0), { size: 32 }),
|
|
108
|
+
toHex(1, { size: 1 })
|
|
109
|
+
]);
|
|
110
|
+
const txHash = await walletClient.writeContract({
|
|
111
|
+
account,
|
|
112
|
+
chain,
|
|
113
|
+
address: safeAddress,
|
|
114
|
+
abi: SAFE_ABI,
|
|
115
|
+
functionName: "execTransaction",
|
|
116
|
+
args: [
|
|
117
|
+
safeTx.to,
|
|
118
|
+
safeTx.value,
|
|
119
|
+
safeTx.data,
|
|
120
|
+
safeTx.operation,
|
|
121
|
+
safeTx.safeTxGas,
|
|
122
|
+
safeTx.baseGas,
|
|
123
|
+
safeTx.gasPrice,
|
|
124
|
+
safeTx.gasToken,
|
|
125
|
+
safeTx.refundReceiver,
|
|
126
|
+
signature
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
const receipt = await publicClient.waitForTransactionReceipt({
|
|
130
|
+
hash: txHash
|
|
131
|
+
});
|
|
132
|
+
const safeLogs = receipt.logs.filter(
|
|
133
|
+
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
134
|
+
);
|
|
135
|
+
const parsed = parseEventLogs({
|
|
136
|
+
abi: SAFE_ABI,
|
|
137
|
+
logs: safeLogs,
|
|
138
|
+
strict: false
|
|
139
|
+
});
|
|
140
|
+
const failed = parsed.find((log) => log.eventName === "ExecutionFailure");
|
|
141
|
+
if (failed) {
|
|
142
|
+
throw new Error("Safe transaction failed");
|
|
143
|
+
}
|
|
144
|
+
const succeeded = parsed.find((log) => log.eventName === "ExecutionSuccess");
|
|
145
|
+
if (!succeeded) {
|
|
146
|
+
throw new Error("Safe transaction status unavailable");
|
|
147
|
+
}
|
|
148
|
+
return { txHash };
|
|
149
|
+
}
|
|
150
|
+
async function executeSafeErc20Transfer(params) {
|
|
151
|
+
const {
|
|
152
|
+
walletClient,
|
|
153
|
+
publicClient,
|
|
154
|
+
safeAddress,
|
|
155
|
+
tokenAddress,
|
|
156
|
+
recipient,
|
|
157
|
+
amount,
|
|
158
|
+
chainId
|
|
159
|
+
} = params;
|
|
160
|
+
const account = walletClient.account;
|
|
161
|
+
const chain = walletClient.chain;
|
|
162
|
+
if (!account || !chain) {
|
|
163
|
+
throw new Error("Wallet not connected");
|
|
164
|
+
}
|
|
165
|
+
if (chain.id !== chainId) {
|
|
166
|
+
throw new Error(`Switch to ${getChainName(chainId)} to sign`);
|
|
167
|
+
}
|
|
168
|
+
const isOwner = await publicClient.readContract({
|
|
169
|
+
address: safeAddress,
|
|
170
|
+
abi: SAFE_ABI,
|
|
171
|
+
functionName: "isOwner",
|
|
172
|
+
args: [account.address]
|
|
173
|
+
});
|
|
174
|
+
if (!isOwner) {
|
|
175
|
+
throw new Error("Connected wallet is not a Safe owner");
|
|
176
|
+
}
|
|
177
|
+
const data = encodeFunctionData({
|
|
178
|
+
abi: erc20Abi,
|
|
179
|
+
functionName: "transfer",
|
|
180
|
+
args: [recipient, amount]
|
|
181
|
+
});
|
|
182
|
+
const safeTx = {
|
|
183
|
+
to: tokenAddress,
|
|
184
|
+
value: 0n,
|
|
185
|
+
data,
|
|
186
|
+
operation: 0,
|
|
187
|
+
safeTxGas: 0n,
|
|
188
|
+
baseGas: 0n,
|
|
189
|
+
gasPrice: 0n,
|
|
190
|
+
gasToken: zeroAddress,
|
|
191
|
+
refundReceiver: zeroAddress
|
|
192
|
+
};
|
|
193
|
+
const signature = concat([
|
|
194
|
+
pad(account.address, { size: 32 }),
|
|
195
|
+
pad(toHex(0), { size: 32 }),
|
|
196
|
+
toHex(1, { size: 1 })
|
|
197
|
+
]);
|
|
198
|
+
const txHash = await walletClient.writeContract({
|
|
199
|
+
account,
|
|
200
|
+
chain,
|
|
201
|
+
address: safeAddress,
|
|
202
|
+
abi: SAFE_ABI,
|
|
203
|
+
functionName: "execTransaction",
|
|
204
|
+
args: [
|
|
205
|
+
safeTx.to,
|
|
206
|
+
safeTx.value,
|
|
207
|
+
safeTx.data,
|
|
208
|
+
safeTx.operation,
|
|
209
|
+
safeTx.safeTxGas,
|
|
210
|
+
safeTx.baseGas,
|
|
211
|
+
safeTx.gasPrice,
|
|
212
|
+
safeTx.gasToken,
|
|
213
|
+
safeTx.refundReceiver,
|
|
214
|
+
signature
|
|
215
|
+
]
|
|
216
|
+
});
|
|
217
|
+
const receipt = await publicClient.waitForTransactionReceipt({
|
|
218
|
+
hash: txHash
|
|
219
|
+
});
|
|
220
|
+
const safeLogs = receipt.logs.filter(
|
|
221
|
+
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
222
|
+
);
|
|
223
|
+
const parsed = parseEventLogs({
|
|
224
|
+
abi: SAFE_ABI,
|
|
225
|
+
logs: safeLogs,
|
|
226
|
+
strict: false
|
|
227
|
+
});
|
|
228
|
+
const failed = parsed.find((log) => log.eventName === "ExecutionFailure");
|
|
229
|
+
if (failed) {
|
|
230
|
+
throw new Error("Safe transaction failed");
|
|
231
|
+
}
|
|
232
|
+
const succeeded = parsed.find((log) => log.eventName === "ExecutionSuccess");
|
|
233
|
+
if (!succeeded) {
|
|
234
|
+
throw new Error("Safe transaction status unavailable");
|
|
235
|
+
}
|
|
236
|
+
return { txHash };
|
|
237
|
+
}
|
|
238
|
+
var SAFE_TX_TYPES = {
|
|
239
|
+
SafeTx: [
|
|
240
|
+
{ name: "to", type: "address" },
|
|
241
|
+
{ name: "value", type: "uint256" },
|
|
242
|
+
{ name: "data", type: "bytes" },
|
|
243
|
+
{ name: "operation", type: "uint8" },
|
|
244
|
+
{ name: "safeTxGas", type: "uint256" },
|
|
245
|
+
{ name: "baseGas", type: "uint256" },
|
|
246
|
+
{ name: "gasPrice", type: "uint256" },
|
|
247
|
+
{ name: "gasToken", type: "address" },
|
|
248
|
+
{ name: "refundReceiver", type: "address" },
|
|
249
|
+
{ name: "nonce", type: "uint256" }
|
|
250
|
+
]
|
|
251
|
+
};
|
|
252
|
+
async function buildSafeTransaction(params) {
|
|
253
|
+
const { publicClient, safeAddress, to, value, data, chainId } = params;
|
|
254
|
+
const nonce = await publicClient.readContract({
|
|
255
|
+
address: safeAddress,
|
|
256
|
+
abi: SAFE_ABI,
|
|
257
|
+
functionName: "nonce"
|
|
258
|
+
});
|
|
259
|
+
const message = {
|
|
260
|
+
to,
|
|
261
|
+
value,
|
|
262
|
+
data,
|
|
263
|
+
operation: 0,
|
|
264
|
+
safeTxGas: 0n,
|
|
265
|
+
baseGas: 0n,
|
|
266
|
+
gasPrice: 0n,
|
|
267
|
+
gasToken: zeroAddress,
|
|
268
|
+
refundReceiver: zeroAddress,
|
|
269
|
+
nonce
|
|
270
|
+
};
|
|
271
|
+
const safeTxHash = hashTypedData({
|
|
272
|
+
domain: { chainId, verifyingContract: safeAddress },
|
|
273
|
+
types: SAFE_TX_TYPES,
|
|
274
|
+
primaryType: "SafeTx",
|
|
275
|
+
message
|
|
276
|
+
});
|
|
277
|
+
return {
|
|
278
|
+
chainId,
|
|
279
|
+
safeAddress,
|
|
280
|
+
safeTxHash,
|
|
281
|
+
typedData: {
|
|
282
|
+
domain: { chainId, verifyingContract: safeAddress },
|
|
283
|
+
types: SAFE_TX_TYPES,
|
|
284
|
+
primaryType: "SafeTx",
|
|
285
|
+
message
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export {
|
|
291
|
+
SAFE_ABI,
|
|
292
|
+
executeSafeEthTransfer,
|
|
293
|
+
executeSafeErc20Transfer,
|
|
294
|
+
buildSafeTransaction
|
|
295
|
+
};
|
|
@@ -1146,16 +1146,6 @@ function TransferIcon() {
|
|
|
1146
1146
|
}
|
|
1147
1147
|
) });
|
|
1148
1148
|
}
|
|
1149
|
-
function CheckIcon() {
|
|
1150
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1151
|
-
"path",
|
|
1152
|
-
{
|
|
1153
|
-
d: "M5 13l4 4L19 7",
|
|
1154
|
-
strokeLinecap: "round",
|
|
1155
|
-
strokeLinejoin: "round"
|
|
1156
|
-
}
|
|
1157
|
-
) });
|
|
1158
|
-
}
|
|
1159
1149
|
function ChevronRightIcon() {
|
|
1160
1150
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1161
1151
|
"path",
|
|
@@ -1167,6 +1157,43 @@ function ChevronRightIcon() {
|
|
|
1167
1157
|
) });
|
|
1168
1158
|
}
|
|
1169
1159
|
|
|
1160
|
+
// src/components/ui/PoweredBy.tsx
|
|
1161
|
+
|
|
1162
|
+
function PoweredBy() {
|
|
1163
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-powered-by", children: [
|
|
1164
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1165
|
+
"svg",
|
|
1166
|
+
{
|
|
1167
|
+
viewBox: "0 0 24 24",
|
|
1168
|
+
fill: "none",
|
|
1169
|
+
stroke: "currentColor",
|
|
1170
|
+
strokeWidth: "2",
|
|
1171
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1172
|
+
"path",
|
|
1173
|
+
{
|
|
1174
|
+
strokeLinecap: "round",
|
|
1175
|
+
strokeLinejoin: "round",
|
|
1176
|
+
d: "M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z"
|
|
1177
|
+
}
|
|
1178
|
+
)
|
|
1179
|
+
}
|
|
1180
|
+
),
|
|
1181
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
1182
|
+
"Powered by",
|
|
1183
|
+
" ",
|
|
1184
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1185
|
+
"a",
|
|
1186
|
+
{
|
|
1187
|
+
href: "https://www.rhinestone.dev",
|
|
1188
|
+
target: "_blank",
|
|
1189
|
+
rel: "noopener noreferrer",
|
|
1190
|
+
children: "Rhinestone"
|
|
1191
|
+
}
|
|
1192
|
+
)
|
|
1193
|
+
] })
|
|
1194
|
+
] });
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1170
1197
|
// src/components/steps/ConnectStep.tsx
|
|
1171
1198
|
|
|
1172
1199
|
function rowIcon(kind) {
|
|
@@ -1176,14 +1203,13 @@ function rowIcon(kind) {
|
|
|
1176
1203
|
}
|
|
1177
1204
|
function ConnectStep({
|
|
1178
1205
|
walletOptions,
|
|
1179
|
-
|
|
1206
|
+
enablePolymarketMigration,
|
|
1180
1207
|
onSelectWallet,
|
|
1181
1208
|
onSelectTransferCrypto,
|
|
1209
|
+
onSelectPolymarket,
|
|
1182
1210
|
onRequestConnect,
|
|
1183
1211
|
onConnect,
|
|
1184
1212
|
onDisconnect,
|
|
1185
|
-
onContinue,
|
|
1186
|
-
continueButtonLabel = "Continue",
|
|
1187
1213
|
connectButtonLabel = "Connect external wallet"
|
|
1188
1214
|
}) {
|
|
1189
1215
|
const hasWalletOptions = (_nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _56 => _56.length]), () => ( 0))) > 0;
|
|
@@ -1195,36 +1221,45 @@ function ConnectStep({
|
|
|
1195
1221
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
1196
1222
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-centered rs-connect-centered--wallets", children: [
|
|
1197
1223
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-list", children: [
|
|
1224
|
+
onSelectTransferCrypto && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1225
|
+
"button",
|
|
1226
|
+
{
|
|
1227
|
+
type: "button",
|
|
1228
|
+
className: "rs-connect-wallet-row rs-connect-wallet-row--action",
|
|
1229
|
+
onClick: onSelectTransferCrypto,
|
|
1230
|
+
children: [
|
|
1231
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-icon rs-connect-wallet-icon--action", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TransferIcon, {}) }),
|
|
1232
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-meta", children: [
|
|
1233
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-label", children: "Transfer Crypto" }),
|
|
1234
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-address", children: "No limit instant transfer" })
|
|
1235
|
+
] }),
|
|
1236
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronRightIcon, {}) })
|
|
1237
|
+
]
|
|
1238
|
+
}
|
|
1239
|
+
),
|
|
1198
1240
|
_optionalChain([walletOptions, 'optionalAccess', _59 => _59.map, 'call', _60 => _60((option) => {
|
|
1199
|
-
const isSelected = option.id === selectedWalletId;
|
|
1200
1241
|
const rawAddress = _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id));
|
|
1201
1242
|
const shortAddress = rawAddress.length > 12 ? `${rawAddress.slice(0, 6)}...${rawAddress.slice(-4)}` : rawAddress;
|
|
1202
1243
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1203
1244
|
"button",
|
|
1204
1245
|
{
|
|
1205
1246
|
type: "button",
|
|
1206
|
-
className:
|
|
1247
|
+
className: "rs-connect-wallet-row",
|
|
1207
1248
|
onClick: () => _optionalChain([onSelectWallet, 'optionalCall', _61 => _61(option.id)]),
|
|
1208
1249
|
children: [
|
|
1209
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1210
|
-
"
|
|
1250
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-icon", children: option.icon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1251
|
+
"img",
|
|
1211
1252
|
{
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
{
|
|
1216
|
-
src: option.icon,
|
|
1217
|
-
alt: option.label,
|
|
1218
|
-
style: { width: 24, height: 24, borderRadius: 6 }
|
|
1219
|
-
}
|
|
1220
|
-
) : rowIcon(option.kind)
|
|
1253
|
+
src: option.icon,
|
|
1254
|
+
alt: option.label,
|
|
1255
|
+
style: { width: 24, height: 24, borderRadius: 6 }
|
|
1221
1256
|
}
|
|
1222
|
-
),
|
|
1257
|
+
) : rowIcon(option.kind) }),
|
|
1223
1258
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-meta", children: [
|
|
1224
1259
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-label", children: option.label }),
|
|
1225
1260
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-address", children: shortAddress })
|
|
1226
1261
|
] }),
|
|
1227
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-indicator", children:
|
|
1262
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronRightIcon, {}) })
|
|
1228
1263
|
]
|
|
1229
1264
|
},
|
|
1230
1265
|
option.id
|
|
@@ -1246,18 +1281,15 @@ function ConnectStep({
|
|
|
1246
1281
|
]
|
|
1247
1282
|
}
|
|
1248
1283
|
),
|
|
1249
|
-
|
|
1284
|
+
enablePolymarketMigration && onSelectPolymarket && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1250
1285
|
"button",
|
|
1251
1286
|
{
|
|
1252
1287
|
type: "button",
|
|
1253
1288
|
className: "rs-connect-wallet-row rs-connect-wallet-row--action",
|
|
1254
|
-
onClick:
|
|
1289
|
+
onClick: onSelectPolymarket,
|
|
1255
1290
|
children: [
|
|
1256
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-icon rs-connect-wallet-icon--action", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1257
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1258
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-label", children: "Transfer Crypto" }),
|
|
1259
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-address", children: "No limit instant transfer" })
|
|
1260
|
-
] }),
|
|
1291
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-icon rs-connect-wallet-icon--action", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExternalLinkIcon, {}) }),
|
|
1292
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-meta", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-label", children: "Migrate from Polymarket" }) }),
|
|
1261
1293
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronRightIcon, {}) })
|
|
1262
1294
|
]
|
|
1263
1295
|
}
|
|
@@ -1275,16 +1307,7 @@ function ConnectStep({
|
|
|
1275
1307
|
}
|
|
1276
1308
|
)
|
|
1277
1309
|
] }),
|
|
1278
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1279
|
-
Button,
|
|
1280
|
-
{
|
|
1281
|
-
onClick: onContinue,
|
|
1282
|
-
variant: "accent",
|
|
1283
|
-
fullWidth: true,
|
|
1284
|
-
disabled: !selectedWalletId || !onContinue,
|
|
1285
|
-
children: continueButtonLabel
|
|
1286
|
-
}
|
|
1287
|
-
) })
|
|
1310
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PoweredBy, {})
|
|
1288
1311
|
] });
|
|
1289
1312
|
}
|
|
1290
1313
|
const handleConnect = _nullishCoalesce(onConnect, () => ( onRequestConnect));
|
|
@@ -1321,6 +1344,22 @@ function ConnectStep({
|
|
|
1321
1344
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronRightIcon, {}) })
|
|
1322
1345
|
]
|
|
1323
1346
|
}
|
|
1347
|
+
),
|
|
1348
|
+
enablePolymarketMigration && handleConnect && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1349
|
+
"button",
|
|
1350
|
+
{
|
|
1351
|
+
type: "button",
|
|
1352
|
+
className: "rs-connect-wallet-row rs-connect-wallet-row--action",
|
|
1353
|
+
onClick: _nullishCoalesce(onSelectPolymarket, () => ( handleConnect)),
|
|
1354
|
+
children: [
|
|
1355
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-icon rs-connect-wallet-icon--action", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExternalLinkIcon, {}) }),
|
|
1356
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-meta", children: [
|
|
1357
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-label", children: "Connect Polymarket" }),
|
|
1358
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-address", children: "Connect the EOA that owns your Polymarket wallet" })
|
|
1359
|
+
] }),
|
|
1360
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronRightIcon, {}) })
|
|
1361
|
+
]
|
|
1362
|
+
}
|
|
1324
1363
|
)
|
|
1325
1364
|
] }) }) });
|
|
1326
1365
|
}
|
|
@@ -1430,43 +1469,6 @@ function accountFromPrivateKey(privateKey) {
|
|
|
1430
1469
|
|
|
1431
1470
|
|
|
1432
1471
|
|
|
1433
|
-
// src/components/ui/PoweredBy.tsx
|
|
1434
|
-
|
|
1435
|
-
function PoweredBy() {
|
|
1436
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-powered-by", children: [
|
|
1437
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1438
|
-
"svg",
|
|
1439
|
-
{
|
|
1440
|
-
viewBox: "0 0 24 24",
|
|
1441
|
-
fill: "none",
|
|
1442
|
-
stroke: "currentColor",
|
|
1443
|
-
strokeWidth: "2",
|
|
1444
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1445
|
-
"path",
|
|
1446
|
-
{
|
|
1447
|
-
strokeLinecap: "round",
|
|
1448
|
-
strokeLinejoin: "round",
|
|
1449
|
-
d: "M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z"
|
|
1450
|
-
}
|
|
1451
|
-
)
|
|
1452
|
-
}
|
|
1453
|
-
),
|
|
1454
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
1455
|
-
"Powered by",
|
|
1456
|
-
" ",
|
|
1457
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1458
|
-
"a",
|
|
1459
|
-
{
|
|
1460
|
-
href: "https://www.rhinestone.dev",
|
|
1461
|
-
target: "_blank",
|
|
1462
|
-
rel: "noopener noreferrer",
|
|
1463
|
-
children: "Rhinestone"
|
|
1464
|
-
}
|
|
1465
|
-
)
|
|
1466
|
-
] })
|
|
1467
|
-
] });
|
|
1468
|
-
}
|
|
1469
|
-
|
|
1470
1472
|
// src/core/webhook.ts
|
|
1471
1473
|
function isRecord(value) {
|
|
1472
1474
|
return typeof value === "object" && value !== null;
|
|
@@ -1991,11 +1993,11 @@ function ProcessingStep({
|
|
|
1991
1993
|
const bridgeExplorerUrl = bridgeTxHash ? _chunkR2HP743Tcjs.getExplorerTxUrl.call(void 0, targetChain, bridgeTxHash) : null;
|
|
1992
1994
|
const destExplorerUrl = destinationTxHash ? _chunkR2HP743Tcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1993
1995
|
const isEvmSourceToken = /^0x[a-fA-F0-9]{40}$/.test(displaySourceToken);
|
|
1994
|
-
const sourceSymbol =
|
|
1995
|
-
const sourceDecimals =
|
|
1996
|
+
const sourceSymbol = _nullishCoalesce(providedSourceSymbol, () => ( (displaySourceChain === "solana" ? "SOL" : isEvmSourceToken ? _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, displaySourceToken, displaySourceChain) : "Token")));
|
|
1997
|
+
const sourceDecimals = _nullishCoalesce(providedSourceDecimals, () => ( (displaySourceChain === "solana" ? 9 : isEvmSourceToken ? _chunkR2HP743Tcjs.getTokenDecimalsByAddress.call(void 0,
|
|
1996
1998
|
displaySourceToken,
|
|
1997
1999
|
displaySourceChain
|
|
1998
|
-
) :
|
|
2000
|
+
) : 18)));
|
|
1999
2001
|
const formattedReceivedAmount = (() => {
|
|
2000
2002
|
try {
|
|
2001
2003
|
const raw = _viem.formatUnits.call(void 0, BigInt(displayAmount), sourceDecimals);
|
|
@@ -2333,4 +2335,4 @@ function getPublicClient(chainId) {
|
|
|
2333
2335
|
|
|
2334
2336
|
|
|
2335
2337
|
|
|
2336
|
-
exports.Modal = Modal; exports.Spinner = Spinner; exports.Button = Button; exports.ConnectStep = ConnectStep; exports.debugLog = debugLog; exports.debugError = debugError; exports.toEvmCaip2 = toEvmCaip2; exports.parseEvmChainId = parseEvmChainId; exports.isSolanaCaip2 = isSolanaCaip2; exports.buildSessionDetails = buildSessionDetails; exports.createDepositService = createDepositService; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.
|
|
2338
|
+
exports.Modal = Modal; exports.Spinner = Spinner; exports.Button = Button; exports.PoweredBy = PoweredBy; exports.ConnectStep = ConnectStep; exports.debugLog = debugLog; exports.debugError = debugError; exports.toEvmCaip2 = toEvmCaip2; exports.parseEvmChainId = parseEvmChainId; exports.isSolanaCaip2 = isSolanaCaip2; exports.buildSessionDetails = buildSessionDetails; exports.createDepositService = createDepositService; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.formatUserError = formatUserError; exports.getEventTxHash = getEventTxHash; exports.isDepositEvent = isDepositEvent; exports.txRefsMatch = txRefsMatch; exports.useLatestRef = useLatestRef; exports.ProcessingStep = ProcessingStep; exports.getPublicClient = getPublicClient; exports.applyTheme = applyTheme;
|