@rhinestone/deposit-modal 0.14.1 → 0.15.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 +6 -0
- package/bridge-transcript.json +14 -0
- package/dist/ClaimModal-GFDBVCN5.cjs +11 -0
- package/dist/ClaimModal-VQS3AKEL.mjs +11 -0
- package/dist/{DepositModalReown-2EVV64OA.mjs → DepositModalReown-KOJ7VEY7.mjs} +6 -7
- package/dist/{DepositModalReown-GAD45GIC.cjs → DepositModalReown-R37SSHUF.cjs} +21 -22
- package/dist/WithdrawModal-QVXHMH43.mjs +12 -0
- package/dist/WithdrawModal-RY2NMFLE.cjs +12 -0
- package/dist/{caip-D8aRWdEY.d.cts → caip-BMi-9t09.d.cts} +27 -3
- package/dist/{caip-D8aRWdEY.d.ts → caip-BMi-9t09.d.ts} +27 -3
- package/dist/{chunk-HAQOFI3D.cjs → chunk-3OOY67VJ.cjs} +1046 -226
- package/dist/{chunk-AQVJUXSG.cjs → chunk-5P2PVLS4.cjs} +1 -1
- package/dist/{chunk-UX35GYLM.mjs → chunk-5VONFVQN.mjs} +918 -98
- package/dist/chunk-6HUHVXCY.cjs +704 -0
- package/dist/{chunk-GZ4GQ5MC.mjs → chunk-7UQ6OUEE.mjs} +166 -45
- package/dist/{chunk-LMG46EP2.mjs → chunk-CXBMIZUF.mjs} +1 -1
- package/dist/{chunk-A6JPBMYY.cjs → chunk-DTVZUBHI.cjs} +236 -115
- package/dist/{chunk-VUATPOWJ.mjs → chunk-EAGMY3QE.mjs} +74 -17
- package/dist/{chunk-RN5VKWI6.mjs → chunk-FTWKAJGN.mjs} +1 -1
- package/dist/{chunk-5Q5CSVKF.mjs → chunk-IKUYZA7A.mjs} +195 -495
- package/dist/{chunk-DW2EQA2U.cjs → chunk-LVCD6RHF.cjs} +2 -2
- package/dist/{chunk-4KCSH4T3.cjs → chunk-OY5N3E6L.cjs} +86 -29
- package/dist/chunk-QJ7RCCU7.mjs +704 -0
- package/dist/{chunk-XCTRKCNM.mjs → chunk-UCBUCX2W.mjs} +1515 -194
- package/dist/{chunk-NQMC5VKQ.cjs → chunk-VPDCGD2D.cjs} +552 -852
- package/dist/{chunk-4J5ADVIN.cjs → chunk-X4D52IZK.cjs} +1496 -175
- package/dist/claim.cjs +5 -7
- package/dist/claim.d.cts +3 -3
- package/dist/claim.d.ts +3 -3
- package/dist/claim.mjs +4 -6
- package/dist/{constants-DBrWhJWE.d.cts → constants-BT4ctuHo.d.cts} +7 -6
- package/dist/{constants-DBrWhJWE.d.ts → constants-D21ZdNOP.d.ts} +7 -6
- package/dist/constants.cjs +3 -3
- package/dist/constants.d.cts +3 -3
- package/dist/constants.d.ts +3 -3
- package/dist/constants.mjs +2 -2
- package/dist/deposit.cjs +7 -8
- package/dist/deposit.d.cts +3 -3
- package/dist/deposit.d.ts +3 -3
- package/dist/deposit.mjs +6 -7
- package/dist/embed.cjs +135 -44
- package/dist/embed.d.cts +2 -2
- package/dist/embed.d.ts +2 -2
- package/dist/embed.mjs +116 -25
- package/dist/index.cjs +13 -11
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +12 -10
- package/dist/polymarket.cjs +6 -6
- package/dist/polymarket.mjs +2 -2
- package/dist/styles.css +132 -100
- package/dist/{types-DP_3KwlD.d.cts → types-CQ0NHqCy.d.ts} +146 -11
- package/dist/{types-Bho4OA03.d.ts → types-CxiLX5sv.d.cts} +146 -11
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.d.cts +4 -4
- package/dist/withdraw.d.ts +4 -4
- package/dist/withdraw.mjs +5 -5
- package/package.json +6 -6
- package/dist/ClaimModal-GDFENSLV.mjs +0 -13
- package/dist/ClaimModal-L3FUBI5U.cjs +0 -13
- package/dist/WithdrawModal-FAQH35NG.cjs +0 -12
- package/dist/WithdrawModal-IKUHF5CF.mjs +0 -12
- package/dist/chunk-62UCV2LG.cjs +0 -81
- package/dist/chunk-7AZFT2MV.cjs +0 -163
- package/dist/chunk-QACOOLOE.mjs +0 -1062
- package/dist/chunk-R5UQ3TN4.mjs +0 -81
- package/dist/chunk-VALXN5IO.mjs +0 -163
- package/dist/chunk-YP7QVKQ6.cjs +0 -1062
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ClaimModal,
|
|
3
|
-
buildClaimAnalyticsSessionProperties
|
|
4
|
-
} from "./chunk-QACOOLOE.mjs";
|
|
5
|
-
import "./chunk-VALXN5IO.mjs";
|
|
6
|
-
import "./chunk-R5UQ3TN4.mjs";
|
|
7
|
-
import "./chunk-UX35GYLM.mjs";
|
|
8
|
-
import "./chunk-LMG46EP2.mjs";
|
|
9
|
-
import "./chunk-VUATPOWJ.mjs";
|
|
10
|
-
export {
|
|
11
|
-
ClaimModal,
|
|
12
|
-
buildClaimAnalyticsSessionProperties
|
|
13
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkYP7QVKQ6cjs = require('./chunk-YP7QVKQ6.cjs');
|
|
5
|
-
require('./chunk-7AZFT2MV.cjs');
|
|
6
|
-
require('./chunk-62UCV2LG.cjs');
|
|
7
|
-
require('./chunk-HAQOFI3D.cjs');
|
|
8
|
-
require('./chunk-AQVJUXSG.cjs');
|
|
9
|
-
require('./chunk-4KCSH4T3.cjs');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
exports.ClaimModal = _chunkYP7QVKQ6cjs.ClaimModal; exports.buildClaimAnalyticsSessionProperties = _chunkYP7QVKQ6cjs.buildClaimAnalyticsSessionProperties;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkA6JPBMYYcjs = require('./chunk-A6JPBMYY.cjs');
|
|
5
|
-
require('./chunk-4J5ADVIN.cjs');
|
|
6
|
-
require('./chunk-HAQOFI3D.cjs');
|
|
7
|
-
require('./chunk-AQVJUXSG.cjs');
|
|
8
|
-
require('./chunk-4KCSH4T3.cjs');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.WithdrawModal = _chunkA6JPBMYYcjs.WithdrawModal; exports.buildWithdrawAnalyticsSessionProperties = _chunkA6JPBMYYcjs.buildWithdrawAnalyticsSessionProperties;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
WithdrawModal,
|
|
3
|
-
buildWithdrawAnalyticsSessionProperties
|
|
4
|
-
} from "./chunk-GZ4GQ5MC.mjs";
|
|
5
|
-
import "./chunk-XCTRKCNM.mjs";
|
|
6
|
-
import "./chunk-UX35GYLM.mjs";
|
|
7
|
-
import "./chunk-LMG46EP2.mjs";
|
|
8
|
-
import "./chunk-VUATPOWJ.mjs";
|
|
9
|
-
export {
|
|
10
|
-
WithdrawModal,
|
|
11
|
-
buildWithdrawAnalyticsSessionProperties
|
|
12
|
-
};
|
package/dist/chunk-62UCV2LG.cjs
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkHAQOFI3Dcjs = require('./chunk-HAQOFI3D.cjs');
|
|
5
|
-
|
|
6
|
-
// src/components/ui/ListRow.tsx
|
|
7
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
8
|
-
function ListRow({
|
|
9
|
-
leading,
|
|
10
|
-
leadingMedia,
|
|
11
|
-
title,
|
|
12
|
-
subtitle,
|
|
13
|
-
meta,
|
|
14
|
-
trailing,
|
|
15
|
-
action,
|
|
16
|
-
className = "",
|
|
17
|
-
onClick,
|
|
18
|
-
disabled,
|
|
19
|
-
...props
|
|
20
|
-
}) {
|
|
21
|
-
const inner = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
22
|
-
leadingMedia ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-leading rs-list-row-leading--media", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: leadingMedia }) }) : leading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-leading", children: leading }) : null,
|
|
23
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-list-row-body", children: [
|
|
24
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-list-row-text", children: [
|
|
25
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-title", children: title }),
|
|
26
|
-
subtitle && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-subtitle", children: subtitle })
|
|
27
|
-
] }),
|
|
28
|
-
action ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
29
|
-
"button",
|
|
30
|
-
{
|
|
31
|
-
type: "button",
|
|
32
|
-
className: "rs-list-row-action",
|
|
33
|
-
disabled,
|
|
34
|
-
onClick: (e) => {
|
|
35
|
-
e.stopPropagation();
|
|
36
|
-
action.onClick();
|
|
37
|
-
},
|
|
38
|
-
children: action.label
|
|
39
|
-
}
|
|
40
|
-
) : meta && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-list-row-meta", children: meta })
|
|
41
|
-
] }),
|
|
42
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-chevron", children: _nullishCoalesce(trailing, () => ( (disabled ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChevronRightIcon, {})))) })
|
|
43
|
-
] });
|
|
44
|
-
if (action) {
|
|
45
|
-
const handleKey = (e) => {
|
|
46
|
-
if (disabled) return;
|
|
47
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
48
|
-
e.preventDefault();
|
|
49
|
-
_optionalChain([onClick, 'optionalCall', _ => _(e)]);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
53
|
-
"div",
|
|
54
|
-
{
|
|
55
|
-
className: `rs-list-row ${className}`.trim(),
|
|
56
|
-
role: "button",
|
|
57
|
-
tabIndex: disabled ? -1 : 0,
|
|
58
|
-
"aria-disabled": disabled || void 0,
|
|
59
|
-
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall', _2 => _2(e)]),
|
|
60
|
-
onKeyDown: handleKey,
|
|
61
|
-
children: inner
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
66
|
-
"button",
|
|
67
|
-
{
|
|
68
|
-
type: "button",
|
|
69
|
-
className: `rs-list-row ${className}`.trim(),
|
|
70
|
-
onClick,
|
|
71
|
-
disabled,
|
|
72
|
-
...props,
|
|
73
|
-
children: inner
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
ListRow.displayName = "ListRow";
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
exports.ListRow = ListRow;
|
package/dist/chunk-7AZFT2MV.cjs
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkHAQOFI3Dcjs = require('./chunk-HAQOFI3D.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunkAQVJUXSGcjs = require('./chunk-AQVJUXSG.cjs');
|
|
8
|
-
|
|
9
|
-
// src/core/recovery.ts
|
|
10
|
-
var RECOVER_DOMAIN = {
|
|
11
|
-
name: "Rhinestone Deposit Recovery",
|
|
12
|
-
version: "1"
|
|
13
|
-
};
|
|
14
|
-
var RECOVER_TYPES = {
|
|
15
|
-
RecoverDeposit: [
|
|
16
|
-
{ name: "depositId", type: "uint256" },
|
|
17
|
-
{ name: "destination", type: "address" }
|
|
18
|
-
]
|
|
19
|
-
};
|
|
20
|
-
var RecoveryError = class extends Error {
|
|
21
|
-
constructor(message, status, code, retryable = false, phase = "response") {
|
|
22
|
-
super(message);
|
|
23
|
-
this.name = "RecoveryError";
|
|
24
|
-
this.status = status;
|
|
25
|
-
this.code = code;
|
|
26
|
-
this.retryable = retryable;
|
|
27
|
-
this.phase = phase;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
function formatRecoveryError(status, code, serverMessage) {
|
|
31
|
-
switch (code) {
|
|
32
|
-
case "DEPOSIT_NOT_RECOVERABLE":
|
|
33
|
-
return {
|
|
34
|
-
message: "This deposit can't be recovered \u2014 it may already have been claimed.",
|
|
35
|
-
retryable: false
|
|
36
|
-
};
|
|
37
|
-
case "RECOVERY_UNSUPPORTED":
|
|
38
|
-
return {
|
|
39
|
-
message: "This deposit can't be recovered automatically. Contact support to get your funds back.",
|
|
40
|
-
retryable: false
|
|
41
|
-
};
|
|
42
|
-
case "SIGNATURE_INVALID":
|
|
43
|
-
return {
|
|
44
|
-
message: "That signature wasn't accepted for this wallet. Contact support to recover this deposit.",
|
|
45
|
-
retryable: false
|
|
46
|
-
};
|
|
47
|
-
case "VERIFICATION_UNAVAILABLE":
|
|
48
|
-
return {
|
|
49
|
-
message: "Couldn't verify your signature just now. Try again shortly.",
|
|
50
|
-
retryable: true
|
|
51
|
-
};
|
|
52
|
-
case "REFUND_RECONCILIATION_REQUIRED":
|
|
53
|
-
return {
|
|
54
|
-
message: "Your recovery is being reviewed. Contact support with this deposit if it doesn't arrive.",
|
|
55
|
-
retryable: false
|
|
56
|
-
};
|
|
57
|
-
case "REFUND_FAILED":
|
|
58
|
-
return {
|
|
59
|
-
message: _nullishCoalesce(serverMessage, () => ( "The recovery couldn't be completed. Please try again or contact support.")),
|
|
60
|
-
retryable: true
|
|
61
|
-
};
|
|
62
|
-
default:
|
|
63
|
-
if (status === 0) {
|
|
64
|
-
return {
|
|
65
|
-
message: "Couldn't reach the recovery service. Check your connection and try again.",
|
|
66
|
-
retryable: true
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
message: _nullishCoalesce(serverMessage, () => ( "The recovery couldn't be completed. Please try again or contact support.")),
|
|
71
|
-
retryable: true
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
async function submitSignedRecovery(params) {
|
|
76
|
-
const { backendUrl, chainId, depositId, signer, destination, signRecovery, debug } = params;
|
|
77
|
-
const scope = "service:recovery";
|
|
78
|
-
const typedData = {
|
|
79
|
-
domain: RECOVER_DOMAIN,
|
|
80
|
-
types: RECOVER_TYPES,
|
|
81
|
-
primaryType: "RecoverDeposit",
|
|
82
|
-
message: { depositId: BigInt(depositId), destination }
|
|
83
|
-
};
|
|
84
|
-
let signature;
|
|
85
|
-
try {
|
|
86
|
-
signature = await signRecovery({
|
|
87
|
-
typedData,
|
|
88
|
-
chainId,
|
|
89
|
-
signer,
|
|
90
|
-
depositId,
|
|
91
|
-
destination
|
|
92
|
-
});
|
|
93
|
-
} catch (error) {
|
|
94
|
-
_chunkHAQOFI3Dcjs.debugError.call(void 0, debug, scope, "signRecovery:failed", error);
|
|
95
|
-
throw new RecoveryError(
|
|
96
|
-
"Signature request was declined. Approve it in your wallet to recover this deposit.",
|
|
97
|
-
0,
|
|
98
|
-
void 0,
|
|
99
|
-
true,
|
|
100
|
-
"signature"
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
if (!signature) {
|
|
104
|
-
throw new RecoveryError(
|
|
105
|
-
"Signature request was declined. Approve it in your wallet to recover this deposit.",
|
|
106
|
-
0,
|
|
107
|
-
void 0,
|
|
108
|
-
true,
|
|
109
|
-
"signature"
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
const url = `${backendUrl.replace(/\/$/, "")}/deposits/recover`;
|
|
113
|
-
_chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, scope, "submitSignedRecovery:request", {
|
|
114
|
-
url,
|
|
115
|
-
depositId,
|
|
116
|
-
signer
|
|
117
|
-
});
|
|
118
|
-
let response;
|
|
119
|
-
try {
|
|
120
|
-
response = await fetch(url, {
|
|
121
|
-
method: "POST",
|
|
122
|
-
// The shared const, so recovery carries `x-deposit-modal-version` like
|
|
123
|
-
// every other backend call. Without it this path would be invisible in the
|
|
124
|
-
// per-client version telemetry the processor records.
|
|
125
|
-
headers: _chunkAQVJUXSGcjs.serviceHeaders.call(void 0, ),
|
|
126
|
-
// `depositId` as a string: it is a uint256 upstream and JSON numbers lose
|
|
127
|
-
// precision well before that range.
|
|
128
|
-
body: JSON.stringify({ depositId, destination, signature })
|
|
129
|
-
});
|
|
130
|
-
} catch (error) {
|
|
131
|
-
_chunkHAQOFI3Dcjs.debugError.call(void 0, debug, scope, "submitSignedRecovery:network", error);
|
|
132
|
-
const { message, retryable } = formatRecoveryError(0);
|
|
133
|
-
throw new RecoveryError(message, 0, void 0, retryable, "request");
|
|
134
|
-
}
|
|
135
|
-
if (!response.ok) {
|
|
136
|
-
const body = await response.json().catch(() => ({}));
|
|
137
|
-
_chunkHAQOFI3Dcjs.debugError.call(void 0, debug, scope, "submitSignedRecovery:failed", body, {
|
|
138
|
-
status: response.status
|
|
139
|
-
});
|
|
140
|
-
const { message, retryable } = formatRecoveryError(
|
|
141
|
-
response.status,
|
|
142
|
-
body.code,
|
|
143
|
-
body.error
|
|
144
|
-
);
|
|
145
|
-
throw new RecoveryError(
|
|
146
|
-
message,
|
|
147
|
-
response.status,
|
|
148
|
-
body.code,
|
|
149
|
-
retryable,
|
|
150
|
-
"response"
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
const result = await response.json();
|
|
154
|
-
_chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, scope, "submitSignedRecovery:success", {
|
|
155
|
-
transactionHash: result.transactionHash
|
|
156
|
-
});
|
|
157
|
-
return result;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
exports.RecoveryError = RecoveryError; exports.submitSignedRecovery = submitSignedRecovery;
|