@txnlab/use-wallet-solid 3.0.0-beta.6
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/LICENSE.md +20 -0
- package/README.md +7 -0
- package/dist/chunk/2PWOQULK.jsx +14 -0
- package/dist/chunk/4NZZSEHL.mjs +26472 -0
- package/dist/chunk/752NCLKP.jsx +1010 -0
- package/dist/chunk/A4QL3JBU.mjs +9 -0
- package/dist/chunk/AQD2655F.jsx +539 -0
- package/dist/chunk/D5JCOGLV.mjs +520 -0
- package/dist/chunk/NK6TZ2ZJ.jsx +26620 -0
- package/dist/chunk/PIH3UREM.jsx +51 -0
- package/dist/chunk/PSSN5NVY.mjs +8733 -0
- package/dist/chunk/TPM22PST.jsx +8821 -0
- package/dist/chunk/XOH5VQOG.mjs +958 -0
- package/dist/chunk/YXEL5RAT.mjs +43 -0
- package/dist/dev.cjs +784 -0
- package/dist/dev.js +776 -0
- package/dist/dev.jsx +3164 -0
- package/dist/dist/4VXEBRHF.mjs +17141 -0
- package/dist/dist/5CZLQJ23.jsx +24 -0
- package/dist/dist/ONNQ4WBY.jsx +17204 -0
- package/dist/dist/OOWARLTL.jsx +4784 -0
- package/dist/dist/RJ6UCT74.mjs +10444 -0
- package/dist/dist/TK75RCUF.mjs +4722 -0
- package/dist/dist/TLV6C2JZ.mjs +18 -0
- package/dist/dist/Y3EB35O7.jsx +11033 -0
- package/dist/index.d.cts +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.es/F3DWLLSH.jsx +12293 -0
- package/dist/index.es/RVXGNQBK.mjs +11829 -0
- package/dist/index.js +84958 -0
- package/dist/index.jsx +719 -0
- package/dist/index.mjs +3109 -0
- package/dist/main.esm/3Z2KJMX5.jsx +112 -0
- package/dist/main.esm/VQKMPFEL.mjs +111 -0
- package/package.json +102 -0
|
@@ -0,0 +1,958 @@
|
|
|
1
|
+
import { __esm, __export, __commonJS, __toCommonJS, __toESM, __reExport } from './YXEL5RAT.mjs';
|
|
2
|
+
|
|
3
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/constants.js
|
|
4
|
+
var PARSE_ERROR, INVALID_REQUEST, METHOD_NOT_FOUND, INVALID_PARAMS, INTERNAL_ERROR, SERVER_ERROR, RESERVED_ERROR_CODES, SERVER_ERROR_CODE_RANGE, STANDARD_ERROR_MAP, DEFAULT_ERROR;
|
|
5
|
+
var init_constants = __esm({
|
|
6
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/constants.js"() {
|
|
7
|
+
PARSE_ERROR = "PARSE_ERROR";
|
|
8
|
+
INVALID_REQUEST = "INVALID_REQUEST";
|
|
9
|
+
METHOD_NOT_FOUND = "METHOD_NOT_FOUND";
|
|
10
|
+
INVALID_PARAMS = "INVALID_PARAMS";
|
|
11
|
+
INTERNAL_ERROR = "INTERNAL_ERROR";
|
|
12
|
+
SERVER_ERROR = "SERVER_ERROR";
|
|
13
|
+
RESERVED_ERROR_CODES = [-32700, -32600, -32601, -32602, -32603];
|
|
14
|
+
SERVER_ERROR_CODE_RANGE = [-32e3, -32099];
|
|
15
|
+
STANDARD_ERROR_MAP = {
|
|
16
|
+
[PARSE_ERROR]: { code: -32700, message: "Parse error" },
|
|
17
|
+
[INVALID_REQUEST]: { code: -32600, message: "Invalid Request" },
|
|
18
|
+
[METHOD_NOT_FOUND]: { code: -32601, message: "Method not found" },
|
|
19
|
+
[INVALID_PARAMS]: { code: -32602, message: "Invalid params" },
|
|
20
|
+
[INTERNAL_ERROR]: { code: -32603, message: "Internal error" },
|
|
21
|
+
[SERVER_ERROR]: { code: -32e3, message: "Server error" }
|
|
22
|
+
};
|
|
23
|
+
DEFAULT_ERROR = SERVER_ERROR;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/error.js
|
|
28
|
+
function isServerErrorCode(code) {
|
|
29
|
+
return code <= SERVER_ERROR_CODE_RANGE[0] && code >= SERVER_ERROR_CODE_RANGE[1];
|
|
30
|
+
}
|
|
31
|
+
function isReservedErrorCode(code) {
|
|
32
|
+
return RESERVED_ERROR_CODES.includes(code);
|
|
33
|
+
}
|
|
34
|
+
function isValidErrorCode(code) {
|
|
35
|
+
return typeof code === "number";
|
|
36
|
+
}
|
|
37
|
+
function getError(type) {
|
|
38
|
+
if (!Object.keys(STANDARD_ERROR_MAP).includes(type)) {
|
|
39
|
+
return STANDARD_ERROR_MAP[DEFAULT_ERROR];
|
|
40
|
+
}
|
|
41
|
+
return STANDARD_ERROR_MAP[type];
|
|
42
|
+
}
|
|
43
|
+
function getErrorByCode(code) {
|
|
44
|
+
const match = Object.values(STANDARD_ERROR_MAP).find((e) => e.code === code);
|
|
45
|
+
if (!match) {
|
|
46
|
+
return STANDARD_ERROR_MAP[DEFAULT_ERROR];
|
|
47
|
+
}
|
|
48
|
+
return match;
|
|
49
|
+
}
|
|
50
|
+
function validateJsonRpcError(response) {
|
|
51
|
+
if (typeof response.error.code === "undefined") {
|
|
52
|
+
return { valid: false, error: "Missing code for JSON-RPC error" };
|
|
53
|
+
}
|
|
54
|
+
if (typeof response.error.message === "undefined") {
|
|
55
|
+
return { valid: false, error: "Missing message for JSON-RPC error" };
|
|
56
|
+
}
|
|
57
|
+
if (!isValidErrorCode(response.error.code)) {
|
|
58
|
+
return {
|
|
59
|
+
valid: false,
|
|
60
|
+
error: `Invalid error code type for JSON-RPC: ${response.error.code}`
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (isReservedErrorCode(response.error.code)) {
|
|
64
|
+
const error = getErrorByCode(response.error.code);
|
|
65
|
+
if (error.message !== STANDARD_ERROR_MAP[DEFAULT_ERROR].message && response.error.message === error.message) {
|
|
66
|
+
return {
|
|
67
|
+
valid: false,
|
|
68
|
+
error: `Invalid error code message for JSON-RPC: ${response.error.code}`
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return { valid: true };
|
|
73
|
+
}
|
|
74
|
+
function parseConnectionError(e, url, type) {
|
|
75
|
+
return e.message.includes("getaddrinfo ENOTFOUND") || e.message.includes("connect ECONNREFUSED") ? new Error(`Unavailable ${type} RPC url at ${url}`) : e;
|
|
76
|
+
}
|
|
77
|
+
var init_error = __esm({
|
|
78
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/error.js"() {
|
|
79
|
+
init_constants();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/format.js
|
|
84
|
+
function payloadId(entropy = 3) {
|
|
85
|
+
const date = Date.now() * Math.pow(10, entropy);
|
|
86
|
+
const extra = Math.floor(Math.random() * Math.pow(10, entropy));
|
|
87
|
+
return date + extra;
|
|
88
|
+
}
|
|
89
|
+
function getBigIntRpcId(entropy = 6) {
|
|
90
|
+
return BigInt(payloadId(entropy));
|
|
91
|
+
}
|
|
92
|
+
function formatJsonRpcRequest(method, params, id) {
|
|
93
|
+
return {
|
|
94
|
+
id: id || payloadId(),
|
|
95
|
+
jsonrpc: "2.0",
|
|
96
|
+
method,
|
|
97
|
+
params
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function formatJsonRpcResult(id, result) {
|
|
101
|
+
return {
|
|
102
|
+
id,
|
|
103
|
+
jsonrpc: "2.0",
|
|
104
|
+
result
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function formatJsonRpcError(id, error, data) {
|
|
108
|
+
return {
|
|
109
|
+
id,
|
|
110
|
+
jsonrpc: "2.0",
|
|
111
|
+
error: formatErrorMessage(error, data)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function formatErrorMessage(error, data) {
|
|
115
|
+
if (typeof error === "undefined") {
|
|
116
|
+
return getError(INTERNAL_ERROR);
|
|
117
|
+
}
|
|
118
|
+
if (typeof error === "string") {
|
|
119
|
+
error = Object.assign(Object.assign({}, getError(SERVER_ERROR)), { message: error });
|
|
120
|
+
}
|
|
121
|
+
if (typeof data !== "undefined") {
|
|
122
|
+
error.data = data;
|
|
123
|
+
}
|
|
124
|
+
if (isReservedErrorCode(error.code)) {
|
|
125
|
+
error = getErrorByCode(error.code);
|
|
126
|
+
}
|
|
127
|
+
return error;
|
|
128
|
+
}
|
|
129
|
+
var init_format = __esm({
|
|
130
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/format.js"() {
|
|
131
|
+
init_error();
|
|
132
|
+
init_constants();
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/validators.js
|
|
137
|
+
function isJsonRpcPayload(payload) {
|
|
138
|
+
return typeof payload === "object" && "id" in payload && "jsonrpc" in payload && payload.jsonrpc === "2.0";
|
|
139
|
+
}
|
|
140
|
+
function isJsonRpcRequest(payload) {
|
|
141
|
+
return isJsonRpcPayload(payload) && "method" in payload;
|
|
142
|
+
}
|
|
143
|
+
function isJsonRpcResponse(payload) {
|
|
144
|
+
return isJsonRpcPayload(payload) && (isJsonRpcResult(payload) || isJsonRpcError(payload));
|
|
145
|
+
}
|
|
146
|
+
function isJsonRpcResult(payload) {
|
|
147
|
+
return "result" in payload;
|
|
148
|
+
}
|
|
149
|
+
function isJsonRpcError(payload) {
|
|
150
|
+
return "error" in payload;
|
|
151
|
+
}
|
|
152
|
+
function isJsonRpcValidationInvalid(validation) {
|
|
153
|
+
return "error" in validation && validation.valid === false;
|
|
154
|
+
}
|
|
155
|
+
var init_validators = __esm({
|
|
156
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/validators.js"() {
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// ../../node_modules/.pnpm/tslib@1.14.1/node_modules/tslib/tslib.es6.js
|
|
161
|
+
var tslib_es6_exports = {};
|
|
162
|
+
__export(tslib_es6_exports, {
|
|
163
|
+
__assign: () => __assign,
|
|
164
|
+
__asyncDelegator: () => __asyncDelegator,
|
|
165
|
+
__asyncGenerator: () => __asyncGenerator,
|
|
166
|
+
__asyncValues: () => __asyncValues,
|
|
167
|
+
__await: () => __await,
|
|
168
|
+
__awaiter: () => __awaiter,
|
|
169
|
+
__classPrivateFieldGet: () => __classPrivateFieldGet,
|
|
170
|
+
__classPrivateFieldSet: () => __classPrivateFieldSet,
|
|
171
|
+
__createBinding: () => __createBinding,
|
|
172
|
+
__decorate: () => __decorate,
|
|
173
|
+
__exportStar: () => __exportStar,
|
|
174
|
+
__extends: () => __extends,
|
|
175
|
+
__generator: () => __generator,
|
|
176
|
+
__importDefault: () => __importDefault,
|
|
177
|
+
__importStar: () => __importStar,
|
|
178
|
+
__makeTemplateObject: () => __makeTemplateObject,
|
|
179
|
+
__metadata: () => __metadata,
|
|
180
|
+
__param: () => __param,
|
|
181
|
+
__read: () => __read,
|
|
182
|
+
__rest: () => __rest,
|
|
183
|
+
__spread: () => __spread,
|
|
184
|
+
__spreadArrays: () => __spreadArrays,
|
|
185
|
+
__values: () => __values
|
|
186
|
+
});
|
|
187
|
+
function __extends(d, b) {
|
|
188
|
+
extendStatics(d, b);
|
|
189
|
+
function __() {
|
|
190
|
+
this.constructor = d;
|
|
191
|
+
}
|
|
192
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
193
|
+
}
|
|
194
|
+
function __rest(s, e) {
|
|
195
|
+
var t = {};
|
|
196
|
+
for (var p in s)
|
|
197
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
198
|
+
t[p] = s[p];
|
|
199
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
200
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
201
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
202
|
+
t[p[i]] = s[p[i]];
|
|
203
|
+
}
|
|
204
|
+
return t;
|
|
205
|
+
}
|
|
206
|
+
function __decorate(decorators, target, key, desc) {
|
|
207
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
208
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
209
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
210
|
+
else
|
|
211
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
212
|
+
if (d = decorators[i])
|
|
213
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
214
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
215
|
+
}
|
|
216
|
+
function __param(paramIndex, decorator) {
|
|
217
|
+
return function(target, key) {
|
|
218
|
+
decorator(target, key, paramIndex);
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function __metadata(metadataKey, metadataValue) {
|
|
222
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
223
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
224
|
+
}
|
|
225
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
226
|
+
function adopt(value) {
|
|
227
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
228
|
+
resolve(value);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
232
|
+
function fulfilled(value) {
|
|
233
|
+
try {
|
|
234
|
+
step(generator.next(value));
|
|
235
|
+
} catch (e) {
|
|
236
|
+
reject(e);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function rejected(value) {
|
|
240
|
+
try {
|
|
241
|
+
step(generator["throw"](value));
|
|
242
|
+
} catch (e) {
|
|
243
|
+
reject(e);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function step(result) {
|
|
247
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
248
|
+
}
|
|
249
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
function __generator(thisArg, body) {
|
|
253
|
+
var _ = { label: 0, sent: function() {
|
|
254
|
+
if (t[0] & 1)
|
|
255
|
+
throw t[1];
|
|
256
|
+
return t[1];
|
|
257
|
+
}, trys: [], ops: [] }, f, y, t, g;
|
|
258
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
259
|
+
return this;
|
|
260
|
+
}), g;
|
|
261
|
+
function verb(n) {
|
|
262
|
+
return function(v) {
|
|
263
|
+
return step([n, v]);
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function step(op) {
|
|
267
|
+
if (f)
|
|
268
|
+
throw new TypeError("Generator is already executing.");
|
|
269
|
+
while (_)
|
|
270
|
+
try {
|
|
271
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
272
|
+
return t;
|
|
273
|
+
if (y = 0, t)
|
|
274
|
+
op = [op[0] & 2, t.value];
|
|
275
|
+
switch (op[0]) {
|
|
276
|
+
case 0:
|
|
277
|
+
case 1:
|
|
278
|
+
t = op;
|
|
279
|
+
break;
|
|
280
|
+
case 4:
|
|
281
|
+
_.label++;
|
|
282
|
+
return { value: op[1], done: false };
|
|
283
|
+
case 5:
|
|
284
|
+
_.label++;
|
|
285
|
+
y = op[1];
|
|
286
|
+
op = [0];
|
|
287
|
+
continue;
|
|
288
|
+
case 7:
|
|
289
|
+
op = _.ops.pop();
|
|
290
|
+
_.trys.pop();
|
|
291
|
+
continue;
|
|
292
|
+
default:
|
|
293
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
294
|
+
_ = 0;
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
298
|
+
_.label = op[1];
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
302
|
+
_.label = t[1];
|
|
303
|
+
t = op;
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
if (t && _.label < t[2]) {
|
|
307
|
+
_.label = t[2];
|
|
308
|
+
_.ops.push(op);
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
if (t[2])
|
|
312
|
+
_.ops.pop();
|
|
313
|
+
_.trys.pop();
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
op = body.call(thisArg, _);
|
|
317
|
+
} catch (e) {
|
|
318
|
+
op = [6, e];
|
|
319
|
+
y = 0;
|
|
320
|
+
} finally {
|
|
321
|
+
f = t = 0;
|
|
322
|
+
}
|
|
323
|
+
if (op[0] & 5)
|
|
324
|
+
throw op[1];
|
|
325
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
function __createBinding(o, m, k, k2) {
|
|
329
|
+
if (k2 === void 0)
|
|
330
|
+
k2 = k;
|
|
331
|
+
o[k2] = m[k];
|
|
332
|
+
}
|
|
333
|
+
function __exportStar(m, exports) {
|
|
334
|
+
for (var p in m)
|
|
335
|
+
if (p !== "default" && !exports.hasOwnProperty(p))
|
|
336
|
+
exports[p] = m[p];
|
|
337
|
+
}
|
|
338
|
+
function __values(o) {
|
|
339
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
340
|
+
if (m)
|
|
341
|
+
return m.call(o);
|
|
342
|
+
if (o && typeof o.length === "number")
|
|
343
|
+
return {
|
|
344
|
+
next: function() {
|
|
345
|
+
if (o && i >= o.length)
|
|
346
|
+
o = void 0;
|
|
347
|
+
return { value: o && o[i++], done: !o };
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
351
|
+
}
|
|
352
|
+
function __read(o, n) {
|
|
353
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
354
|
+
if (!m)
|
|
355
|
+
return o;
|
|
356
|
+
var i = m.call(o), r, ar = [], e;
|
|
357
|
+
try {
|
|
358
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
359
|
+
ar.push(r.value);
|
|
360
|
+
} catch (error) {
|
|
361
|
+
e = { error };
|
|
362
|
+
} finally {
|
|
363
|
+
try {
|
|
364
|
+
if (r && !r.done && (m = i["return"]))
|
|
365
|
+
m.call(i);
|
|
366
|
+
} finally {
|
|
367
|
+
if (e)
|
|
368
|
+
throw e.error;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return ar;
|
|
372
|
+
}
|
|
373
|
+
function __spread() {
|
|
374
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
375
|
+
ar = ar.concat(__read(arguments[i]));
|
|
376
|
+
return ar;
|
|
377
|
+
}
|
|
378
|
+
function __spreadArrays() {
|
|
379
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
380
|
+
s += arguments[i].length;
|
|
381
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
382
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
383
|
+
r[k] = a[j];
|
|
384
|
+
return r;
|
|
385
|
+
}
|
|
386
|
+
function __await(v) {
|
|
387
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
388
|
+
}
|
|
389
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
390
|
+
if (!Symbol.asyncIterator)
|
|
391
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
392
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
393
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
394
|
+
return this;
|
|
395
|
+
}, i;
|
|
396
|
+
function verb(n) {
|
|
397
|
+
if (g[n])
|
|
398
|
+
i[n] = function(v) {
|
|
399
|
+
return new Promise(function(a, b) {
|
|
400
|
+
q.push([n, v, a, b]) > 1 || resume(n, v);
|
|
401
|
+
});
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
function resume(n, v) {
|
|
405
|
+
try {
|
|
406
|
+
step(g[n](v));
|
|
407
|
+
} catch (e) {
|
|
408
|
+
settle(q[0][3], e);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function step(r) {
|
|
412
|
+
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
|
|
413
|
+
}
|
|
414
|
+
function fulfill(value) {
|
|
415
|
+
resume("next", value);
|
|
416
|
+
}
|
|
417
|
+
function reject(value) {
|
|
418
|
+
resume("throw", value);
|
|
419
|
+
}
|
|
420
|
+
function settle(f, v) {
|
|
421
|
+
if (f(v), q.shift(), q.length)
|
|
422
|
+
resume(q[0][0], q[0][1]);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
function __asyncDelegator(o) {
|
|
426
|
+
var i, p;
|
|
427
|
+
return i = {}, verb("next"), verb("throw", function(e) {
|
|
428
|
+
throw e;
|
|
429
|
+
}), verb("return"), i[Symbol.iterator] = function() {
|
|
430
|
+
return this;
|
|
431
|
+
}, i;
|
|
432
|
+
function verb(n, f) {
|
|
433
|
+
i[n] = o[n] ? function(v) {
|
|
434
|
+
return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v;
|
|
435
|
+
} : f;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
function __asyncValues(o) {
|
|
439
|
+
if (!Symbol.asyncIterator)
|
|
440
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
441
|
+
var m = o[Symbol.asyncIterator], i;
|
|
442
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
443
|
+
return this;
|
|
444
|
+
}, i);
|
|
445
|
+
function verb(n) {
|
|
446
|
+
i[n] = o[n] && function(v) {
|
|
447
|
+
return new Promise(function(resolve, reject) {
|
|
448
|
+
v = o[n](v), settle(resolve, reject, v.done, v.value);
|
|
449
|
+
});
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
function settle(resolve, reject, d, v) {
|
|
453
|
+
Promise.resolve(v).then(function(v2) {
|
|
454
|
+
resolve({ value: v2, done: d });
|
|
455
|
+
}, reject);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
function __makeTemplateObject(cooked, raw) {
|
|
459
|
+
if (Object.defineProperty) {
|
|
460
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
461
|
+
} else {
|
|
462
|
+
cooked.raw = raw;
|
|
463
|
+
}
|
|
464
|
+
return cooked;
|
|
465
|
+
}
|
|
466
|
+
function __importStar(mod) {
|
|
467
|
+
if (mod && mod.__esModule)
|
|
468
|
+
return mod;
|
|
469
|
+
var result = {};
|
|
470
|
+
if (mod != null) {
|
|
471
|
+
for (var k in mod)
|
|
472
|
+
if (Object.hasOwnProperty.call(mod, k))
|
|
473
|
+
result[k] = mod[k];
|
|
474
|
+
}
|
|
475
|
+
result.default = mod;
|
|
476
|
+
return result;
|
|
477
|
+
}
|
|
478
|
+
function __importDefault(mod) {
|
|
479
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
480
|
+
}
|
|
481
|
+
function __classPrivateFieldGet(receiver, privateMap) {
|
|
482
|
+
if (!privateMap.has(receiver)) {
|
|
483
|
+
throw new TypeError("attempted to get private field on non-instance");
|
|
484
|
+
}
|
|
485
|
+
return privateMap.get(receiver);
|
|
486
|
+
}
|
|
487
|
+
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
488
|
+
if (!privateMap.has(receiver)) {
|
|
489
|
+
throw new TypeError("attempted to set private field on non-instance");
|
|
490
|
+
}
|
|
491
|
+
privateMap.set(receiver, value);
|
|
492
|
+
return value;
|
|
493
|
+
}
|
|
494
|
+
var extendStatics, __assign;
|
|
495
|
+
var init_tslib_es6 = __esm({
|
|
496
|
+
"../../node_modules/.pnpm/tslib@1.14.1/node_modules/tslib/tslib.es6.js"() {
|
|
497
|
+
extendStatics = function(d, b) {
|
|
498
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
499
|
+
d2.__proto__ = b2;
|
|
500
|
+
} || function(d2, b2) {
|
|
501
|
+
for (var p in b2)
|
|
502
|
+
if (b2.hasOwnProperty(p))
|
|
503
|
+
d2[p] = b2[p];
|
|
504
|
+
};
|
|
505
|
+
return extendStatics(d, b);
|
|
506
|
+
};
|
|
507
|
+
__assign = function() {
|
|
508
|
+
__assign = Object.assign || function __assign2(t) {
|
|
509
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
510
|
+
s = arguments[i];
|
|
511
|
+
for (var p in s)
|
|
512
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
513
|
+
t[p] = s[p];
|
|
514
|
+
}
|
|
515
|
+
return t;
|
|
516
|
+
};
|
|
517
|
+
return __assign.apply(this, arguments);
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
// ../../node_modules/.pnpm/@walletconnect+environment@1.0.1/node_modules/@walletconnect/environment/dist/cjs/crypto.js
|
|
523
|
+
var require_crypto = __commonJS({
|
|
524
|
+
"../../node_modules/.pnpm/@walletconnect+environment@1.0.1/node_modules/@walletconnect/environment/dist/cjs/crypto.js"(exports) {
|
|
525
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
526
|
+
exports.isBrowserCryptoAvailable = exports.getSubtleCrypto = exports.getBrowerCrypto = void 0;
|
|
527
|
+
function getBrowerCrypto() {
|
|
528
|
+
return (global === null || global === void 0 ? void 0 : global.crypto) || (global === null || global === void 0 ? void 0 : global.msCrypto) || {};
|
|
529
|
+
}
|
|
530
|
+
exports.getBrowerCrypto = getBrowerCrypto;
|
|
531
|
+
function getSubtleCrypto() {
|
|
532
|
+
const browserCrypto = getBrowerCrypto();
|
|
533
|
+
return browserCrypto.subtle || browserCrypto.webkitSubtle;
|
|
534
|
+
}
|
|
535
|
+
exports.getSubtleCrypto = getSubtleCrypto;
|
|
536
|
+
function isBrowserCryptoAvailable() {
|
|
537
|
+
return !!getBrowerCrypto() && !!getSubtleCrypto();
|
|
538
|
+
}
|
|
539
|
+
exports.isBrowserCryptoAvailable = isBrowserCryptoAvailable;
|
|
540
|
+
}
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
// ../../node_modules/.pnpm/@walletconnect+environment@1.0.1/node_modules/@walletconnect/environment/dist/cjs/env.js
|
|
544
|
+
var require_env = __commonJS({
|
|
545
|
+
"../../node_modules/.pnpm/@walletconnect+environment@1.0.1/node_modules/@walletconnect/environment/dist/cjs/env.js"(exports) {
|
|
546
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
547
|
+
exports.isBrowser = exports.isNode = exports.isReactNative = void 0;
|
|
548
|
+
function isReactNative() {
|
|
549
|
+
return typeof document === "undefined" && typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
550
|
+
}
|
|
551
|
+
exports.isReactNative = isReactNative;
|
|
552
|
+
function isNode2() {
|
|
553
|
+
return typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.versions.node !== "undefined";
|
|
554
|
+
}
|
|
555
|
+
exports.isNode = isNode2;
|
|
556
|
+
function isBrowser() {
|
|
557
|
+
return !isReactNative() && !isNode2();
|
|
558
|
+
}
|
|
559
|
+
exports.isBrowser = isBrowser;
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
|
|
563
|
+
// ../../node_modules/.pnpm/@walletconnect+environment@1.0.1/node_modules/@walletconnect/environment/dist/cjs/index.js
|
|
564
|
+
var require_cjs = __commonJS({
|
|
565
|
+
"../../node_modules/.pnpm/@walletconnect+environment@1.0.1/node_modules/@walletconnect/environment/dist/cjs/index.js"(exports) {
|
|
566
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
567
|
+
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
568
|
+
tslib_1.__exportStar(require_crypto(), exports);
|
|
569
|
+
tslib_1.__exportStar(require_env(), exports);
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
|
|
573
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/env.js
|
|
574
|
+
var env_exports = {};
|
|
575
|
+
__export(env_exports, {
|
|
576
|
+
isNodeJs: () => isNodeJs
|
|
577
|
+
});
|
|
578
|
+
var import_environment, isNodeJs;
|
|
579
|
+
var init_env = __esm({
|
|
580
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/env.js"() {
|
|
581
|
+
import_environment = __toESM(require_cjs());
|
|
582
|
+
__reExport(env_exports, __toESM(require_cjs()));
|
|
583
|
+
isNodeJs = import_environment.isNode;
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
|
|
587
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/routing.js
|
|
588
|
+
function isValidRoute(route) {
|
|
589
|
+
if (route.includes("*")) {
|
|
590
|
+
return isValidWildcardRoute(route);
|
|
591
|
+
}
|
|
592
|
+
if (/\W/g.test(route)) {
|
|
593
|
+
return false;
|
|
594
|
+
}
|
|
595
|
+
return true;
|
|
596
|
+
}
|
|
597
|
+
function isValidDefaultRoute(route) {
|
|
598
|
+
return route === "*";
|
|
599
|
+
}
|
|
600
|
+
function isValidWildcardRoute(route) {
|
|
601
|
+
if (isValidDefaultRoute(route)) {
|
|
602
|
+
return true;
|
|
603
|
+
}
|
|
604
|
+
if (!route.includes("*")) {
|
|
605
|
+
return false;
|
|
606
|
+
}
|
|
607
|
+
if (route.split("*").length !== 2) {
|
|
608
|
+
return false;
|
|
609
|
+
}
|
|
610
|
+
if (route.split("*").filter((x) => x.trim() === "").length !== 1) {
|
|
611
|
+
return false;
|
|
612
|
+
}
|
|
613
|
+
return true;
|
|
614
|
+
}
|
|
615
|
+
function isValidLeadingWildcardRoute(route) {
|
|
616
|
+
return !isValidDefaultRoute(route) && isValidWildcardRoute(route) && !route.split("*")[0].trim();
|
|
617
|
+
}
|
|
618
|
+
function isValidTrailingWildcardRoute(route) {
|
|
619
|
+
return !isValidDefaultRoute(route) && isValidWildcardRoute(route) && !route.split("*")[1].trim();
|
|
620
|
+
}
|
|
621
|
+
var init_routing = __esm({
|
|
622
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/routing.js"() {
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
|
|
626
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-types@1.0.3/node_modules/@walletconnect/jsonrpc-types/dist/esm/jsonrpc.js
|
|
627
|
+
var init_jsonrpc = __esm({
|
|
628
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-types@1.0.3/node_modules/@walletconnect/jsonrpc-types/dist/esm/jsonrpc.js"() {
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-types@1.0.3/node_modules/@walletconnect/jsonrpc-types/dist/esm/misc.js
|
|
633
|
+
var IEvents;
|
|
634
|
+
var init_misc = __esm({
|
|
635
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-types@1.0.3/node_modules/@walletconnect/jsonrpc-types/dist/esm/misc.js"() {
|
|
636
|
+
IEvents = class {
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
|
|
641
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-types@1.0.3/node_modules/@walletconnect/jsonrpc-types/dist/esm/provider.js
|
|
642
|
+
var IJsonRpcConnection, IBaseJsonRpcProvider, IJsonRpcProvider;
|
|
643
|
+
var init_provider = __esm({
|
|
644
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-types@1.0.3/node_modules/@walletconnect/jsonrpc-types/dist/esm/provider.js"() {
|
|
645
|
+
init_misc();
|
|
646
|
+
IJsonRpcConnection = class extends IEvents {
|
|
647
|
+
constructor(opts) {
|
|
648
|
+
super();
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
IBaseJsonRpcProvider = class extends IEvents {
|
|
652
|
+
constructor() {
|
|
653
|
+
super();
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
IJsonRpcProvider = class extends IBaseJsonRpcProvider {
|
|
657
|
+
constructor(connection) {
|
|
658
|
+
super();
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-types@1.0.3/node_modules/@walletconnect/jsonrpc-types/dist/esm/validator.js
|
|
665
|
+
var init_validator = __esm({
|
|
666
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-types@1.0.3/node_modules/@walletconnect/jsonrpc-types/dist/esm/validator.js"() {
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
|
|
670
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-types@1.0.3/node_modules/@walletconnect/jsonrpc-types/dist/esm/index.js
|
|
671
|
+
var init_esm = __esm({
|
|
672
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-types@1.0.3/node_modules/@walletconnect/jsonrpc-types/dist/esm/index.js"() {
|
|
673
|
+
init_jsonrpc();
|
|
674
|
+
init_misc();
|
|
675
|
+
init_provider();
|
|
676
|
+
init_validator();
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/types.js
|
|
681
|
+
var init_types = __esm({
|
|
682
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/types.js"() {
|
|
683
|
+
init_esm();
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/url.js
|
|
688
|
+
function getUrlProtocol(url) {
|
|
689
|
+
const matches = url.match(new RegExp(/^\w+:/, "gi"));
|
|
690
|
+
if (!matches || !matches.length)
|
|
691
|
+
return;
|
|
692
|
+
return matches[0];
|
|
693
|
+
}
|
|
694
|
+
function matchRegexProtocol(url, regex) {
|
|
695
|
+
const protocol = getUrlProtocol(url);
|
|
696
|
+
if (typeof protocol === "undefined")
|
|
697
|
+
return false;
|
|
698
|
+
return new RegExp(regex).test(protocol);
|
|
699
|
+
}
|
|
700
|
+
function isHttpUrl(url) {
|
|
701
|
+
return matchRegexProtocol(url, HTTP_REGEX);
|
|
702
|
+
}
|
|
703
|
+
function isWsUrl(url) {
|
|
704
|
+
return matchRegexProtocol(url, WS_REGEX);
|
|
705
|
+
}
|
|
706
|
+
function isLocalhostUrl(url) {
|
|
707
|
+
return new RegExp("wss?://localhost(:d{2,5})?").test(url);
|
|
708
|
+
}
|
|
709
|
+
var HTTP_REGEX, WS_REGEX;
|
|
710
|
+
var init_url = __esm({
|
|
711
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/url.js"() {
|
|
712
|
+
HTTP_REGEX = "^https?:";
|
|
713
|
+
WS_REGEX = "^wss?:";
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
|
|
717
|
+
// ../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/index.js
|
|
718
|
+
var esm_exports = {};
|
|
719
|
+
__export(esm_exports, {
|
|
720
|
+
DEFAULT_ERROR: () => DEFAULT_ERROR,
|
|
721
|
+
IBaseJsonRpcProvider: () => IBaseJsonRpcProvider,
|
|
722
|
+
IEvents: () => IEvents,
|
|
723
|
+
IJsonRpcConnection: () => IJsonRpcConnection,
|
|
724
|
+
IJsonRpcProvider: () => IJsonRpcProvider,
|
|
725
|
+
INTERNAL_ERROR: () => INTERNAL_ERROR,
|
|
726
|
+
INVALID_PARAMS: () => INVALID_PARAMS,
|
|
727
|
+
INVALID_REQUEST: () => INVALID_REQUEST,
|
|
728
|
+
METHOD_NOT_FOUND: () => METHOD_NOT_FOUND,
|
|
729
|
+
PARSE_ERROR: () => PARSE_ERROR,
|
|
730
|
+
RESERVED_ERROR_CODES: () => RESERVED_ERROR_CODES,
|
|
731
|
+
SERVER_ERROR: () => SERVER_ERROR,
|
|
732
|
+
SERVER_ERROR_CODE_RANGE: () => SERVER_ERROR_CODE_RANGE,
|
|
733
|
+
STANDARD_ERROR_MAP: () => STANDARD_ERROR_MAP,
|
|
734
|
+
formatErrorMessage: () => formatErrorMessage,
|
|
735
|
+
formatJsonRpcError: () => formatJsonRpcError,
|
|
736
|
+
formatJsonRpcRequest: () => formatJsonRpcRequest,
|
|
737
|
+
formatJsonRpcResult: () => formatJsonRpcResult,
|
|
738
|
+
getBigIntRpcId: () => getBigIntRpcId,
|
|
739
|
+
getError: () => getError,
|
|
740
|
+
getErrorByCode: () => getErrorByCode,
|
|
741
|
+
isHttpUrl: () => isHttpUrl,
|
|
742
|
+
isJsonRpcError: () => isJsonRpcError,
|
|
743
|
+
isJsonRpcPayload: () => isJsonRpcPayload,
|
|
744
|
+
isJsonRpcRequest: () => isJsonRpcRequest,
|
|
745
|
+
isJsonRpcResponse: () => isJsonRpcResponse,
|
|
746
|
+
isJsonRpcResult: () => isJsonRpcResult,
|
|
747
|
+
isJsonRpcValidationInvalid: () => isJsonRpcValidationInvalid,
|
|
748
|
+
isLocalhostUrl: () => isLocalhostUrl,
|
|
749
|
+
isNodeJs: () => isNodeJs,
|
|
750
|
+
isReservedErrorCode: () => isReservedErrorCode,
|
|
751
|
+
isServerErrorCode: () => isServerErrorCode,
|
|
752
|
+
isValidDefaultRoute: () => isValidDefaultRoute,
|
|
753
|
+
isValidErrorCode: () => isValidErrorCode,
|
|
754
|
+
isValidLeadingWildcardRoute: () => isValidLeadingWildcardRoute,
|
|
755
|
+
isValidRoute: () => isValidRoute,
|
|
756
|
+
isValidTrailingWildcardRoute: () => isValidTrailingWildcardRoute,
|
|
757
|
+
isValidWildcardRoute: () => isValidWildcardRoute,
|
|
758
|
+
isWsUrl: () => isWsUrl,
|
|
759
|
+
parseConnectionError: () => parseConnectionError,
|
|
760
|
+
payloadId: () => payloadId,
|
|
761
|
+
validateJsonRpcError: () => validateJsonRpcError
|
|
762
|
+
});
|
|
763
|
+
var init_esm2 = __esm({
|
|
764
|
+
"../../node_modules/.pnpm/@walletconnect+jsonrpc-utils@1.0.8/node_modules/@walletconnect/jsonrpc-utils/dist/esm/index.js"() {
|
|
765
|
+
init_constants();
|
|
766
|
+
init_error();
|
|
767
|
+
init_env();
|
|
768
|
+
__reExport(esm_exports, env_exports);
|
|
769
|
+
init_format();
|
|
770
|
+
init_routing();
|
|
771
|
+
init_types();
|
|
772
|
+
init_url();
|
|
773
|
+
init_validators();
|
|
774
|
+
}
|
|
775
|
+
});
|
|
776
|
+
|
|
777
|
+
// ../../node_modules/.pnpm/@walletconnect+window-getters@1.0.1/node_modules/@walletconnect/window-getters/dist/cjs/index.js
|
|
778
|
+
var require_cjs2 = __commonJS({
|
|
779
|
+
"../../node_modules/.pnpm/@walletconnect+window-getters@1.0.1/node_modules/@walletconnect/window-getters/dist/cjs/index.js"(exports) {
|
|
780
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
781
|
+
exports.getLocalStorage = exports.getLocalStorageOrThrow = exports.getCrypto = exports.getCryptoOrThrow = exports.getLocation = exports.getLocationOrThrow = exports.getNavigator = exports.getNavigatorOrThrow = exports.getDocument = exports.getDocumentOrThrow = exports.getFromWindowOrThrow = exports.getFromWindow = void 0;
|
|
782
|
+
function getFromWindow(name) {
|
|
783
|
+
let res = void 0;
|
|
784
|
+
if (typeof window !== "undefined" && typeof window[name] !== "undefined") {
|
|
785
|
+
res = window[name];
|
|
786
|
+
}
|
|
787
|
+
return res;
|
|
788
|
+
}
|
|
789
|
+
exports.getFromWindow = getFromWindow;
|
|
790
|
+
function getFromWindowOrThrow(name) {
|
|
791
|
+
const res = getFromWindow(name);
|
|
792
|
+
if (!res) {
|
|
793
|
+
throw new Error(`${name} is not defined in Window`);
|
|
794
|
+
}
|
|
795
|
+
return res;
|
|
796
|
+
}
|
|
797
|
+
exports.getFromWindowOrThrow = getFromWindowOrThrow;
|
|
798
|
+
function getDocumentOrThrow() {
|
|
799
|
+
return getFromWindowOrThrow("document");
|
|
800
|
+
}
|
|
801
|
+
exports.getDocumentOrThrow = getDocumentOrThrow;
|
|
802
|
+
function getDocument() {
|
|
803
|
+
return getFromWindow("document");
|
|
804
|
+
}
|
|
805
|
+
exports.getDocument = getDocument;
|
|
806
|
+
function getNavigatorOrThrow() {
|
|
807
|
+
return getFromWindowOrThrow("navigator");
|
|
808
|
+
}
|
|
809
|
+
exports.getNavigatorOrThrow = getNavigatorOrThrow;
|
|
810
|
+
function getNavigator() {
|
|
811
|
+
return getFromWindow("navigator");
|
|
812
|
+
}
|
|
813
|
+
exports.getNavigator = getNavigator;
|
|
814
|
+
function getLocationOrThrow() {
|
|
815
|
+
return getFromWindowOrThrow("location");
|
|
816
|
+
}
|
|
817
|
+
exports.getLocationOrThrow = getLocationOrThrow;
|
|
818
|
+
function getLocation() {
|
|
819
|
+
return getFromWindow("location");
|
|
820
|
+
}
|
|
821
|
+
exports.getLocation = getLocation;
|
|
822
|
+
function getCryptoOrThrow() {
|
|
823
|
+
return getFromWindowOrThrow("crypto");
|
|
824
|
+
}
|
|
825
|
+
exports.getCryptoOrThrow = getCryptoOrThrow;
|
|
826
|
+
function getCrypto() {
|
|
827
|
+
return getFromWindow("crypto");
|
|
828
|
+
}
|
|
829
|
+
exports.getCrypto = getCrypto;
|
|
830
|
+
function getLocalStorageOrThrow() {
|
|
831
|
+
return getFromWindowOrThrow("localStorage");
|
|
832
|
+
}
|
|
833
|
+
exports.getLocalStorageOrThrow = getLocalStorageOrThrow;
|
|
834
|
+
function getLocalStorage() {
|
|
835
|
+
return getFromWindow("localStorage");
|
|
836
|
+
}
|
|
837
|
+
exports.getLocalStorage = getLocalStorage;
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
|
|
841
|
+
// ../../node_modules/.pnpm/strict-uri-encode@2.0.0/node_modules/strict-uri-encode/index.js
|
|
842
|
+
var require_strict_uri_encode = __commonJS({
|
|
843
|
+
"../../node_modules/.pnpm/strict-uri-encode@2.0.0/node_modules/strict-uri-encode/index.js"(exports, module) {
|
|
844
|
+
module.exports = (str) => encodeURIComponent(str).replace(/[!'()*]/g, (x) => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
845
|
+
}
|
|
846
|
+
});
|
|
847
|
+
|
|
848
|
+
// ../../node_modules/.pnpm/decode-uri-component@0.2.2/node_modules/decode-uri-component/index.js
|
|
849
|
+
var require_decode_uri_component = __commonJS({
|
|
850
|
+
"../../node_modules/.pnpm/decode-uri-component@0.2.2/node_modules/decode-uri-component/index.js"(exports, module) {
|
|
851
|
+
var token = "%[a-f0-9]{2}";
|
|
852
|
+
var singleMatcher = new RegExp("(" + token + ")|([^%]+?)", "gi");
|
|
853
|
+
var multiMatcher = new RegExp("(" + token + ")+", "gi");
|
|
854
|
+
function decodeComponents(components, split) {
|
|
855
|
+
try {
|
|
856
|
+
return [decodeURIComponent(components.join(""))];
|
|
857
|
+
} catch (err) {
|
|
858
|
+
}
|
|
859
|
+
if (components.length === 1) {
|
|
860
|
+
return components;
|
|
861
|
+
}
|
|
862
|
+
split = split || 1;
|
|
863
|
+
var left = components.slice(0, split);
|
|
864
|
+
var right = components.slice(split);
|
|
865
|
+
return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
|
|
866
|
+
}
|
|
867
|
+
function decode(input) {
|
|
868
|
+
try {
|
|
869
|
+
return decodeURIComponent(input);
|
|
870
|
+
} catch (err) {
|
|
871
|
+
var tokens = input.match(singleMatcher) || [];
|
|
872
|
+
for (var i = 1; i < tokens.length; i++) {
|
|
873
|
+
input = decodeComponents(tokens, i).join("");
|
|
874
|
+
tokens = input.match(singleMatcher) || [];
|
|
875
|
+
}
|
|
876
|
+
return input;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
function customDecodeURIComponent(input) {
|
|
880
|
+
var replaceMap = {
|
|
881
|
+
"%FE%FF": "\uFFFD\uFFFD",
|
|
882
|
+
"%FF%FE": "\uFFFD\uFFFD"
|
|
883
|
+
};
|
|
884
|
+
var match = multiMatcher.exec(input);
|
|
885
|
+
while (match) {
|
|
886
|
+
try {
|
|
887
|
+
replaceMap[match[0]] = decodeURIComponent(match[0]);
|
|
888
|
+
} catch (err) {
|
|
889
|
+
var result = decode(match[0]);
|
|
890
|
+
if (result !== match[0]) {
|
|
891
|
+
replaceMap[match[0]] = result;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
match = multiMatcher.exec(input);
|
|
895
|
+
}
|
|
896
|
+
replaceMap["%C2"] = "\uFFFD";
|
|
897
|
+
var entries = Object.keys(replaceMap);
|
|
898
|
+
for (var i = 0; i < entries.length; i++) {
|
|
899
|
+
var key = entries[i];
|
|
900
|
+
input = input.replace(new RegExp(key, "g"), replaceMap[key]);
|
|
901
|
+
}
|
|
902
|
+
return input;
|
|
903
|
+
}
|
|
904
|
+
module.exports = function(encodedURI) {
|
|
905
|
+
if (typeof encodedURI !== "string") {
|
|
906
|
+
throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof encodedURI + "`");
|
|
907
|
+
}
|
|
908
|
+
try {
|
|
909
|
+
encodedURI = encodedURI.replace(/\+/g, " ");
|
|
910
|
+
return decodeURIComponent(encodedURI);
|
|
911
|
+
} catch (err) {
|
|
912
|
+
return customDecodeURIComponent(encodedURI);
|
|
913
|
+
}
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
});
|
|
917
|
+
|
|
918
|
+
// ../../node_modules/.pnpm/split-on-first@1.1.0/node_modules/split-on-first/index.js
|
|
919
|
+
var require_split_on_first = __commonJS({
|
|
920
|
+
"../../node_modules/.pnpm/split-on-first@1.1.0/node_modules/split-on-first/index.js"(exports, module) {
|
|
921
|
+
module.exports = (string, separator) => {
|
|
922
|
+
if (!(typeof string === "string" && typeof separator === "string")) {
|
|
923
|
+
throw new TypeError("Expected the arguments to be of type `string`");
|
|
924
|
+
}
|
|
925
|
+
if (separator === "") {
|
|
926
|
+
return [string];
|
|
927
|
+
}
|
|
928
|
+
const separatorIndex = string.indexOf(separator);
|
|
929
|
+
if (separatorIndex === -1) {
|
|
930
|
+
return [string];
|
|
931
|
+
}
|
|
932
|
+
return [
|
|
933
|
+
string.slice(0, separatorIndex),
|
|
934
|
+
string.slice(separatorIndex + separator.length)
|
|
935
|
+
];
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
});
|
|
939
|
+
/*! Bundled license information:
|
|
940
|
+
|
|
941
|
+
tslib/tslib.es6.js:
|
|
942
|
+
(*! *****************************************************************************
|
|
943
|
+
Copyright (c) Microsoft Corporation.
|
|
944
|
+
|
|
945
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
946
|
+
purpose with or without fee is hereby granted.
|
|
947
|
+
|
|
948
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
949
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
950
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
951
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
952
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
953
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
954
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
955
|
+
***************************************************************************** *)
|
|
956
|
+
*/
|
|
957
|
+
|
|
958
|
+
export { IJsonRpcProvider, esm_exports, formatJsonRpcError, formatJsonRpcRequest, formatJsonRpcResult, getBigIntRpcId, init_esm2 as init_esm, init_tslib_es6, isJsonRpcError, isJsonRpcRequest, isJsonRpcResponse, isJsonRpcResult, isLocalhostUrl, isWsUrl, parseConnectionError, payloadId, require_cjs2 as require_cjs, require_cjs as require_cjs2, require_decode_uri_component, require_split_on_first, require_strict_uri_encode, tslib_es6_exports };
|