@rhinestone/deposit-modal 0.13.0 → 0.14.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 +43 -2
- package/bridge-transcript.json +653 -0
- package/dist/ClaimModal-IKTJU43Y.cjs +13 -0
- package/dist/ClaimModal-SEKNWRMA.mjs +13 -0
- package/dist/{DepositModalReown-YNNHLAV2.cjs → DepositModalReown-46LPVFB6.cjs} +16 -15
- package/dist/{DepositModalReown-3H75G3XQ.mjs → DepositModalReown-Q2JMLT47.mjs} +6 -5
- package/dist/WithdrawModal-5ICGD4HJ.mjs +12 -0
- package/dist/WithdrawModal-VP6PMIRO.cjs +12 -0
- package/dist/{chunk-GACIGCSN.cjs → chunk-6KG642KH.cjs} +1 -1
- package/dist/{chunk-RAADLTSW.cjs → chunk-7ICSHJFE.cjs} +179 -138
- package/dist/{chunk-COCBCQQC.mjs → chunk-7SR7ENVJ.mjs} +46 -5
- package/dist/{chunk-OLCD75JK.mjs → chunk-CFKC77SV.mjs} +451 -131
- package/dist/{chunk-EOMT5LKX.mjs → chunk-IN77XSWO.mjs} +526 -3
- package/dist/{chunk-FZ5FZFIG.mjs → chunk-K4H6TGBE.mjs} +1 -1
- package/dist/{chunk-DSIZNRWA.mjs → chunk-KTUVSKR4.mjs} +979 -360
- package/dist/{chunk-HOGZKHHY.cjs → chunk-LZFRL2AL.cjs} +3 -3
- package/dist/{chunk-7N77GIP4.cjs → chunk-MTFJSE52.cjs} +465 -171
- package/dist/{chunk-LTMMETAB.mjs → chunk-PKML3XVS.mjs} +404 -110
- package/dist/{chunk-ZMT4ATHR.cjs → chunk-V2OBGLJD.cjs} +564 -41
- package/dist/{chunk-XYJFEN5D.mjs → chunk-WUJIKCFU.mjs} +1 -1
- package/dist/{chunk-CVGNCUVU.cjs → chunk-X2IPAPXU.cjs} +22 -13
- package/dist/{chunk-2G2EIN4A.cjs → chunk-YCQZJQO6.cjs} +1272 -653
- package/dist/{chunk-5NUIKYSF.cjs → chunk-YWMWI7PZ.cjs} +458 -138
- package/dist/{chunk-YREVFB64.mjs → chunk-ZEO6ADM3.mjs} +16 -7
- package/dist/claim.cjs +6 -6
- package/dist/claim.d.cts +3 -3
- package/dist/claim.d.ts +3 -3
- package/dist/claim.mjs +5 -5
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +5 -5
- package/dist/embed.cjs +310 -102
- package/dist/embed.d.cts +7 -1
- package/dist/embed.d.ts +7 -1
- package/dist/embed.mjs +285 -77
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +8 -8
- package/dist/types-Bho4OA03.d.ts +982 -0
- package/dist/types-DP_3KwlD.d.cts +982 -0
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.d.cts +3 -3
- package/dist/withdraw.d.ts +3 -3
- package/dist/withdraw.mjs +4 -4
- package/package.json +28 -7
- package/dist/ClaimModal-CREZO27I.mjs +0 -11
- package/dist/ClaimModal-JRIA32U2.cjs +0 -11
- package/dist/WithdrawModal-NVRX44IZ.mjs +0 -10
- package/dist/WithdrawModal-YYSBPCJJ.cjs +0 -10
- package/dist/types-B89I8_8H.d.ts +0 -638
- package/dist/types-nnDR4tqA.d.cts +0 -638
|
@@ -1,10 +1,10 @@
|
|
|
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
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkV2OBGLJDcjs = require('./chunk-V2OBGLJD.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk6KG642KHcjs = require('./chunk-6KG642KH.cjs');
|
|
8
8
|
|
|
9
9
|
// src/core/recovery.ts
|
|
10
10
|
var RECOVER_DOMAIN = {
|
|
@@ -18,12 +18,13 @@ var RECOVER_TYPES = {
|
|
|
18
18
|
]
|
|
19
19
|
};
|
|
20
20
|
var RecoveryError = class extends Error {
|
|
21
|
-
constructor(message, status, code, retryable = false) {
|
|
21
|
+
constructor(message, status, code, retryable = false, phase = "response") {
|
|
22
22
|
super(message);
|
|
23
23
|
this.name = "RecoveryError";
|
|
24
24
|
this.status = status;
|
|
25
25
|
this.code = code;
|
|
26
26
|
this.retryable = retryable;
|
|
27
|
+
this.phase = phase;
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
30
|
function formatRecoveryError(status, code, serverMessage) {
|
|
@@ -90,12 +91,13 @@ async function submitSignedRecovery(params) {
|
|
|
90
91
|
destination
|
|
91
92
|
});
|
|
92
93
|
} catch (error) {
|
|
93
|
-
|
|
94
|
+
_chunkV2OBGLJDcjs.debugError.call(void 0, debug, scope, "signRecovery:failed", error);
|
|
94
95
|
throw new RecoveryError(
|
|
95
96
|
"Signature request was declined. Approve it in your wallet to recover this deposit.",
|
|
96
97
|
0,
|
|
97
98
|
void 0,
|
|
98
|
-
true
|
|
99
|
+
true,
|
|
100
|
+
"signature"
|
|
99
101
|
);
|
|
100
102
|
}
|
|
101
103
|
if (!signature) {
|
|
@@ -103,11 +105,12 @@ async function submitSignedRecovery(params) {
|
|
|
103
105
|
"Signature request was declined. Approve it in your wallet to recover this deposit.",
|
|
104
106
|
0,
|
|
105
107
|
void 0,
|
|
106
|
-
true
|
|
108
|
+
true,
|
|
109
|
+
"signature"
|
|
107
110
|
);
|
|
108
111
|
}
|
|
109
112
|
const url = `${backendUrl.replace(/\/$/, "")}/deposits/recover`;
|
|
110
|
-
|
|
113
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, scope, "submitSignedRecovery:request", {
|
|
111
114
|
url,
|
|
112
115
|
depositId,
|
|
113
116
|
signer
|
|
@@ -119,19 +122,19 @@ async function submitSignedRecovery(params) {
|
|
|
119
122
|
// The shared const, so recovery carries `x-deposit-modal-version` like
|
|
120
123
|
// every other backend call. Without it this path would be invisible in the
|
|
121
124
|
// per-client version telemetry the processor records.
|
|
122
|
-
headers:
|
|
125
|
+
headers: _chunk6KG642KHcjs.serviceHeaders.call(void 0, ),
|
|
123
126
|
// `depositId` as a string: it is a uint256 upstream and JSON numbers lose
|
|
124
127
|
// precision well before that range.
|
|
125
128
|
body: JSON.stringify({ depositId, destination, signature })
|
|
126
129
|
});
|
|
127
130
|
} catch (error) {
|
|
128
|
-
|
|
131
|
+
_chunkV2OBGLJDcjs.debugError.call(void 0, debug, scope, "submitSignedRecovery:network", error);
|
|
129
132
|
const { message, retryable } = formatRecoveryError(0);
|
|
130
|
-
throw new RecoveryError(message, 0, void 0, retryable);
|
|
133
|
+
throw new RecoveryError(message, 0, void 0, retryable, "request");
|
|
131
134
|
}
|
|
132
135
|
if (!response.ok) {
|
|
133
136
|
const body = await response.json().catch(() => ({}));
|
|
134
|
-
|
|
137
|
+
_chunkV2OBGLJDcjs.debugError.call(void 0, debug, scope, "submitSignedRecovery:failed", body, {
|
|
135
138
|
status: response.status
|
|
136
139
|
});
|
|
137
140
|
const { message, retryable } = formatRecoveryError(
|
|
@@ -139,10 +142,16 @@ async function submitSignedRecovery(params) {
|
|
|
139
142
|
body.code,
|
|
140
143
|
body.error
|
|
141
144
|
);
|
|
142
|
-
throw new RecoveryError(
|
|
145
|
+
throw new RecoveryError(
|
|
146
|
+
message,
|
|
147
|
+
response.status,
|
|
148
|
+
body.code,
|
|
149
|
+
retryable,
|
|
150
|
+
"response"
|
|
151
|
+
);
|
|
143
152
|
}
|
|
144
153
|
const result = await response.json();
|
|
145
|
-
|
|
154
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, scope, "submitSignedRecovery:success", {
|
|
146
155
|
transactionHash: result.transactionHash
|
|
147
156
|
});
|
|
148
157
|
return result;
|