@rhinestone/deposit-modal 0.14.0 → 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.
Files changed (69) hide show
  1. package/README.md +12 -12
  2. package/bridge-transcript.json +14 -0
  3. package/dist/ClaimModal-GFDBVCN5.cjs +11 -0
  4. package/dist/ClaimModal-VQS3AKEL.mjs +11 -0
  5. package/dist/{DepositModalReown-Q2JMLT47.mjs → DepositModalReown-KOJ7VEY7.mjs} +30 -29
  6. package/dist/{DepositModalReown-46LPVFB6.cjs → DepositModalReown-R37SSHUF.cjs} +79 -78
  7. package/dist/WithdrawModal-QVXHMH43.mjs +12 -0
  8. package/dist/WithdrawModal-RY2NMFLE.cjs +12 -0
  9. package/dist/{caip-D8aRWdEY.d.cts → caip-BMi-9t09.d.cts} +27 -3
  10. package/dist/{caip-D8aRWdEY.d.ts → caip-BMi-9t09.d.ts} +27 -3
  11. package/dist/{chunk-V2OBGLJD.cjs → chunk-3OOY67VJ.cjs} +1103 -253
  12. package/dist/{chunk-6KG642KH.cjs → chunk-5P2PVLS4.cjs} +1 -1
  13. package/dist/{chunk-IN77XSWO.mjs → chunk-5VONFVQN.mjs} +976 -126
  14. package/dist/chunk-6HUHVXCY.cjs +704 -0
  15. package/dist/{chunk-PKML3XVS.mjs → chunk-7UQ6OUEE.mjs} +166 -45
  16. package/dist/{chunk-K4H6TGBE.mjs → chunk-CXBMIZUF.mjs} +1 -1
  17. package/dist/{chunk-MTFJSE52.cjs → chunk-DTVZUBHI.cjs} +236 -115
  18. package/dist/{chunk-VUATPOWJ.mjs → chunk-EAGMY3QE.mjs} +74 -17
  19. package/dist/{chunk-RN5VKWI6.mjs → chunk-FTWKAJGN.mjs} +1 -1
  20. package/dist/{chunk-KTUVSKR4.mjs → chunk-IKUYZA7A.mjs} +265 -523
  21. package/dist/{chunk-DW2EQA2U.cjs → chunk-LVCD6RHF.cjs} +2 -2
  22. package/dist/{chunk-4KCSH4T3.cjs → chunk-OY5N3E6L.cjs} +86 -29
  23. package/dist/chunk-QJ7RCCU7.mjs +704 -0
  24. package/dist/chunk-UCBUCX2W.mjs +3169 -0
  25. package/dist/{chunk-YCQZJQO6.cjs → chunk-VPDCGD2D.cjs} +622 -880
  26. package/dist/{chunk-7ICSHJFE.cjs → chunk-X4D52IZK.cjs} +1501 -176
  27. package/dist/claim.cjs +5 -7
  28. package/dist/claim.d.cts +3 -3
  29. package/dist/claim.d.ts +3 -3
  30. package/dist/claim.mjs +4 -6
  31. package/dist/{constants-DBrWhJWE.d.cts → constants-BT4ctuHo.d.cts} +7 -6
  32. package/dist/{constants-DBrWhJWE.d.ts → constants-D21ZdNOP.d.ts} +7 -6
  33. package/dist/constants.cjs +3 -3
  34. package/dist/constants.d.cts +3 -3
  35. package/dist/constants.d.ts +3 -3
  36. package/dist/constants.mjs +2 -2
  37. package/dist/deposit.cjs +7 -8
  38. package/dist/deposit.d.cts +3 -3
  39. package/dist/deposit.d.ts +3 -3
  40. package/dist/deposit.mjs +6 -7
  41. package/dist/embed.cjs +135 -44
  42. package/dist/embed.d.cts +2 -2
  43. package/dist/embed.d.ts +2 -2
  44. package/dist/embed.mjs +116 -25
  45. package/dist/index.cjs +13 -11
  46. package/dist/index.d.cts +3 -3
  47. package/dist/index.d.ts +3 -3
  48. package/dist/index.mjs +12 -10
  49. package/dist/polymarket.cjs +6 -6
  50. package/dist/polymarket.mjs +2 -2
  51. package/dist/styles.css +132 -100
  52. package/dist/{types-Bho4OA03.d.ts → types-CQ0NHqCy.d.ts} +146 -11
  53. package/dist/{types-DP_3KwlD.d.cts → types-CxiLX5sv.d.cts} +146 -11
  54. package/dist/withdraw.cjs +6 -6
  55. package/dist/withdraw.d.cts +4 -4
  56. package/dist/withdraw.d.ts +4 -4
  57. package/dist/withdraw.mjs +5 -5
  58. package/package.json +7 -6
  59. package/dist/ClaimModal-IKTJU43Y.cjs +0 -13
  60. package/dist/ClaimModal-SEKNWRMA.mjs +0 -13
  61. package/dist/WithdrawModal-5ICGD4HJ.mjs +0 -12
  62. package/dist/WithdrawModal-VP6PMIRO.cjs +0 -12
  63. package/dist/chunk-7SR7ENVJ.mjs +0 -1844
  64. package/dist/chunk-CFKC77SV.mjs +0 -1062
  65. package/dist/chunk-LZFRL2AL.cjs +0 -81
  66. package/dist/chunk-WUJIKCFU.mjs +0 -81
  67. package/dist/chunk-X2IPAPXU.cjs +0 -163
  68. package/dist/chunk-YWMWI7PZ.cjs +0 -1062
  69. package/dist/chunk-ZEO6ADM3.mjs +0 -163
@@ -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 _chunkV2OBGLJDcjs = require('./chunk-V2OBGLJD.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, _chunkV2OBGLJDcjs.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, _chunkV2OBGLJDcjs.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;
@@ -1,81 +0,0 @@
1
- import {
2
- CdnIcon,
3
- ChevronRightIcon
4
- } from "./chunk-IN77XSWO.mjs";
5
-
6
- // src/components/ui/ListRow.tsx
7
- import { Fragment, jsx, jsxs } from "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__ */ jsxs(Fragment, { children: [
22
- leadingMedia ? /* @__PURE__ */ jsx("span", { className: "rs-list-row-leading rs-list-row-leading--media", children: /* @__PURE__ */ jsx(CdnIcon, { src: leadingMedia }) }) : leading ? /* @__PURE__ */ jsx("span", { className: "rs-list-row-leading", children: leading }) : null,
23
- /* @__PURE__ */ jsxs("div", { className: "rs-list-row-body", children: [
24
- /* @__PURE__ */ jsxs("div", { className: "rs-list-row-text", children: [
25
- /* @__PURE__ */ jsx("span", { className: "rs-list-row-title", children: title }),
26
- subtitle && /* @__PURE__ */ jsx("span", { className: "rs-list-row-subtitle", children: subtitle })
27
- ] }),
28
- action ? /* @__PURE__ */ jsx(
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__ */ jsx("div", { className: "rs-list-row-meta", children: meta })
41
- ] }),
42
- /* @__PURE__ */ jsx("span", { className: "rs-list-row-chevron", children: trailing ?? (disabled ? null : /* @__PURE__ */ jsx(ChevronRightIcon, {})) })
43
- ] });
44
- if (action) {
45
- const handleKey = (e) => {
46
- if (disabled) return;
47
- if (e.key === "Enter" || e.key === " ") {
48
- e.preventDefault();
49
- onClick?.(e);
50
- }
51
- };
52
- return /* @__PURE__ */ jsx(
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) => onClick?.(e),
60
- onKeyDown: handleKey,
61
- children: inner
62
- }
63
- );
64
- }
65
- return /* @__PURE__ */ jsx(
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
- export {
80
- ListRow
81
- };
@@ -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 _chunkV2OBGLJDcjs = require('./chunk-V2OBGLJD.cjs');
5
-
6
-
7
- var _chunk6KG642KHcjs = require('./chunk-6KG642KH.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
- _chunkV2OBGLJDcjs.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
- _chunkV2OBGLJDcjs.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: _chunk6KG642KHcjs.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
- _chunkV2OBGLJDcjs.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
- _chunkV2OBGLJDcjs.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
- _chunkV2OBGLJDcjs.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;