@powerhousedao/connect 1.0.16-dev.2 → 1.0.16-staging.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/assets/{app-DhH3gUSI.js → app-BjxLqcmz.js} +3794 -1119
- package/dist/assets/{app-CDOWlDp2.css → app-BoJet7fc.css} +69 -50
- package/dist/assets/{app-loader-Btk_wf_z.js → app-loader-nik9-lTL.js} +112 -111
- package/dist/assets/{ccip-D9a0ttP2.js → ccip-CscXGeGj.js} +3 -9
- package/dist/assets/{content-BlRqE_8w.js → content-CmVByr1W.js} +433 -22
- package/dist/assets/{index-Whh7mT2J.js → index-11j-ZVsN.js} +3 -3
- package/dist/assets/index-CpmCEBJz.js +404 -0
- package/dist/assets/{index-BuxuyYQU.js → index-DaRMlvdk.js} +3 -9
- package/dist/assets/{main.C1DJvpcL.js → main.BuoJ8woF.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/vite-envs.sh +1 -1
- package/package.json +9 -9
- package/dist/assets/index-D3bygFYe.js +0 -2560
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
4
|
+
};
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
8
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
9
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
+
var _DB_NAME, _STORE_NAME, _KEY, _db, _BrowserKeyStorage_instances, useStore_fn, _subtleCrypto, _keyPair, _keyPairStorage, _did, _ConnectCrypto_instances, initCrypto_fn, initialize_fn, parseDid_fn, generateECDSAKeyPair_fn, exportKeyPair_fn, importKeyPair_fn, _sign, _verify, _store, _namespace, _BaseStorage_instances, buildKey_fn, _baseUrl, _store2, _connectId, _eventEmitter, _Renown_instances, updateUser_fn, getCredential_fn;
|
|
13
|
+
import { _ as __vitePreload } from "./main.BuoJ8woF.js";
|
|
14
|
+
import { r as rawKeyInHexfromUncompressed, c as compressedKeyInHexfromRaw, e as encodeDIDfromHexString, a as eventsExports, R as RENOWN_URL, g as getEnsInfo } from "./app-BjxLqcmz.js";
|
|
15
|
+
import { i, h, d, j, b, f, s } from "./app-BjxLqcmz.js";
|
|
16
|
+
import { ah as connectConfig, ac as logger } from "./app-loader-nik9-lTL.js";
|
|
17
|
+
import "react/jsx-runtime";
|
|
18
|
+
import "react";
|
|
19
|
+
import "react-dom";
|
|
20
|
+
const _BrowserKeyStorage = class _BrowserKeyStorage {
|
|
21
|
+
constructor() {
|
|
22
|
+
__privateAdd(this, _BrowserKeyStorage_instances);
|
|
23
|
+
__privateAdd(this, _db);
|
|
24
|
+
__privateSet(this, _db, new Promise((resolve, reject) => {
|
|
25
|
+
const req = indexedDB.open(__privateGet(_BrowserKeyStorage, _DB_NAME), 1);
|
|
26
|
+
req.onupgradeneeded = () => {
|
|
27
|
+
req.result.createObjectStore(__privateGet(_BrowserKeyStorage, _STORE_NAME));
|
|
28
|
+
};
|
|
29
|
+
req.onsuccess = () => resolve(req.result);
|
|
30
|
+
req.onerror = () => reject(req.error);
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
async saveKeyPair(keyPair) {
|
|
34
|
+
const store2 = await __privateMethod(this, _BrowserKeyStorage_instances, useStore_fn).call(this);
|
|
35
|
+
const request = store2.put(keyPair, __privateGet(_BrowserKeyStorage, _KEY));
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
request.onsuccess = () => {
|
|
38
|
+
resolve();
|
|
39
|
+
};
|
|
40
|
+
request.onerror = () => {
|
|
41
|
+
reject(new Error("Failed to save key pair"));
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async loadKeyPair() {
|
|
46
|
+
const store2 = await __privateMethod(this, _BrowserKeyStorage_instances, useStore_fn).call(this, "readonly");
|
|
47
|
+
const request = store2.getAll();
|
|
48
|
+
return new Promise((resolve, reject) => {
|
|
49
|
+
request.onsuccess = () => {
|
|
50
|
+
const keyPair = request.result.length ? request.result[0] : void 0;
|
|
51
|
+
resolve(keyPair);
|
|
52
|
+
};
|
|
53
|
+
request.onerror = () => {
|
|
54
|
+
reject(new Error("Failed to load key pair"));
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
_DB_NAME = new WeakMap();
|
|
60
|
+
_STORE_NAME = new WeakMap();
|
|
61
|
+
_KEY = new WeakMap();
|
|
62
|
+
_db = new WeakMap();
|
|
63
|
+
_BrowserKeyStorage_instances = new WeakSet();
|
|
64
|
+
useStore_fn = async function(mode = "readwrite") {
|
|
65
|
+
const database = await __privateGet(this, _db);
|
|
66
|
+
const transaction = database.transaction(
|
|
67
|
+
__privateGet(_BrowserKeyStorage, _STORE_NAME),
|
|
68
|
+
mode
|
|
69
|
+
);
|
|
70
|
+
const store2 = transaction.objectStore(__privateGet(_BrowserKeyStorage, _STORE_NAME));
|
|
71
|
+
return store2;
|
|
72
|
+
};
|
|
73
|
+
__privateAdd(_BrowserKeyStorage, _DB_NAME, "browserKeyDB");
|
|
74
|
+
__privateAdd(_BrowserKeyStorage, _STORE_NAME, "keyPairs");
|
|
75
|
+
__privateAdd(_BrowserKeyStorage, _KEY, "keyPair");
|
|
76
|
+
let BrowserKeyStorage = _BrowserKeyStorage;
|
|
77
|
+
function ab2hex(ab) {
|
|
78
|
+
return Array.prototype.map.call(
|
|
79
|
+
new Uint8Array(ab),
|
|
80
|
+
(x) => ("00" + x.toString(16)).slice(-2)
|
|
81
|
+
).join("");
|
|
82
|
+
}
|
|
83
|
+
const _ConnectCrypto = class _ConnectCrypto {
|
|
84
|
+
constructor(keyPairStorage) {
|
|
85
|
+
__privateAdd(this, _ConnectCrypto_instances);
|
|
86
|
+
__privateAdd(this, _subtleCrypto);
|
|
87
|
+
__privateAdd(this, _keyPair);
|
|
88
|
+
__privateAdd(this, _keyPairStorage);
|
|
89
|
+
__privateAdd(this, _did);
|
|
90
|
+
__privateAdd(this, _sign, async (...args) => {
|
|
91
|
+
return (await __privateGet(this, _subtleCrypto)).sign(...args);
|
|
92
|
+
});
|
|
93
|
+
__privateAdd(this, _verify, async (...args) => {
|
|
94
|
+
return (await __privateGet(this, _subtleCrypto)).verify(...args);
|
|
95
|
+
});
|
|
96
|
+
__privateSet(this, _keyPairStorage, keyPairStorage);
|
|
97
|
+
__privateSet(this, _subtleCrypto, __privateMethod(this, _ConnectCrypto_instances, initCrypto_fn).call(this));
|
|
98
|
+
__privateSet(this, _did, __privateMethod(this, _ConnectCrypto_instances, initialize_fn).call(this));
|
|
99
|
+
}
|
|
100
|
+
did() {
|
|
101
|
+
return __privateGet(this, _did);
|
|
102
|
+
}
|
|
103
|
+
async regenerateDid() {
|
|
104
|
+
__privateSet(this, _keyPair, await __privateMethod(this, _ConnectCrypto_instances, generateECDSAKeyPair_fn).call(this));
|
|
105
|
+
await __privateGet(this, _keyPairStorage).saveKeyPair(await __privateMethod(this, _ConnectCrypto_instances, exportKeyPair_fn).call(this));
|
|
106
|
+
}
|
|
107
|
+
async sign(data) {
|
|
108
|
+
var _a;
|
|
109
|
+
if ((_a = __privateGet(this, _keyPair)) == null ? void 0 : _a.privateKey) {
|
|
110
|
+
const subtleCrypto = await __privateGet(this, _subtleCrypto);
|
|
111
|
+
const arrayBuffer = await subtleCrypto.sign(
|
|
112
|
+
_ConnectCrypto.signAlgorithm,
|
|
113
|
+
__privateGet(this, _keyPair).privateKey,
|
|
114
|
+
data.buffer
|
|
115
|
+
);
|
|
116
|
+
return new Uint8Array(arrayBuffer);
|
|
117
|
+
} else {
|
|
118
|
+
throw new Error("No private key available");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
_subtleCrypto = new WeakMap();
|
|
123
|
+
_keyPair = new WeakMap();
|
|
124
|
+
_keyPairStorage = new WeakMap();
|
|
125
|
+
_did = new WeakMap();
|
|
126
|
+
_ConnectCrypto_instances = new WeakSet();
|
|
127
|
+
initCrypto_fn = function() {
|
|
128
|
+
return new Promise((resolve, reject) => {
|
|
129
|
+
var _a;
|
|
130
|
+
if (typeof window === "undefined") {
|
|
131
|
+
__vitePreload(() => import("node:crypto"), true ? [] : void 0).then((module) => {
|
|
132
|
+
resolve(module.webcrypto.subtle);
|
|
133
|
+
}).catch(reject);
|
|
134
|
+
} else {
|
|
135
|
+
if (!((_a = window.crypto) == null ? void 0 : _a.subtle)) {
|
|
136
|
+
reject(new Error("Crypto module not available"));
|
|
137
|
+
}
|
|
138
|
+
resolve(window.crypto.subtle);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
initialize_fn = async function() {
|
|
143
|
+
const loadedKeyPair = await __privateGet(this, _keyPairStorage).loadKeyPair();
|
|
144
|
+
if (loadedKeyPair) {
|
|
145
|
+
__privateSet(this, _keyPair, await __privateMethod(this, _ConnectCrypto_instances, importKeyPair_fn).call(this, loadedKeyPair));
|
|
146
|
+
console.log("Found key pair");
|
|
147
|
+
} else {
|
|
148
|
+
__privateSet(this, _keyPair, await __privateMethod(this, _ConnectCrypto_instances, generateECDSAKeyPair_fn).call(this));
|
|
149
|
+
console.log("Created key pair");
|
|
150
|
+
await __privateGet(this, _keyPairStorage).saveKeyPair(await __privateMethod(this, _ConnectCrypto_instances, exportKeyPair_fn).call(this));
|
|
151
|
+
}
|
|
152
|
+
const did = await __privateMethod(this, _ConnectCrypto_instances, parseDid_fn).call(this);
|
|
153
|
+
console.log("Connect DID:", did);
|
|
154
|
+
return did;
|
|
155
|
+
};
|
|
156
|
+
parseDid_fn = async function() {
|
|
157
|
+
if (!__privateGet(this, _keyPair)) {
|
|
158
|
+
throw new Error("No key pair available");
|
|
159
|
+
}
|
|
160
|
+
const subtleCrypto = await __privateGet(this, _subtleCrypto);
|
|
161
|
+
const publicKeyRaw = await subtleCrypto.exportKey(
|
|
162
|
+
"raw",
|
|
163
|
+
__privateGet(this, _keyPair).publicKey
|
|
164
|
+
);
|
|
165
|
+
const multicodecName = "p256-pub";
|
|
166
|
+
const rawKey = rawKeyInHexfromUncompressed(ab2hex(publicKeyRaw));
|
|
167
|
+
const compressedKey = compressedKeyInHexfromRaw(rawKey);
|
|
168
|
+
const did = encodeDIDfromHexString(multicodecName, compressedKey);
|
|
169
|
+
return did;
|
|
170
|
+
};
|
|
171
|
+
generateECDSAKeyPair_fn = async function() {
|
|
172
|
+
const subtleCrypto = await __privateGet(this, _subtleCrypto);
|
|
173
|
+
const keyPair = await subtleCrypto.generateKey(
|
|
174
|
+
_ConnectCrypto.algorithm,
|
|
175
|
+
true,
|
|
176
|
+
["sign", "verify"]
|
|
177
|
+
);
|
|
178
|
+
return keyPair;
|
|
179
|
+
};
|
|
180
|
+
exportKeyPair_fn = async function() {
|
|
181
|
+
if (!__privateGet(this, _keyPair)) {
|
|
182
|
+
throw new Error("No key pair available");
|
|
183
|
+
}
|
|
184
|
+
const subtleCrypto = await __privateGet(this, _subtleCrypto);
|
|
185
|
+
const jwkKeyPair = {
|
|
186
|
+
publicKey: await subtleCrypto.exportKey(
|
|
187
|
+
"jwk",
|
|
188
|
+
__privateGet(this, _keyPair).publicKey
|
|
189
|
+
),
|
|
190
|
+
privateKey: await subtleCrypto.exportKey(
|
|
191
|
+
"jwk",
|
|
192
|
+
__privateGet(this, _keyPair).privateKey
|
|
193
|
+
)
|
|
194
|
+
};
|
|
195
|
+
return jwkKeyPair;
|
|
196
|
+
};
|
|
197
|
+
importKeyPair_fn = async function(jwkKeyPair) {
|
|
198
|
+
const subtleCrypto = await __privateGet(this, _subtleCrypto);
|
|
199
|
+
return {
|
|
200
|
+
publicKey: await subtleCrypto.importKey(
|
|
201
|
+
"jwk",
|
|
202
|
+
jwkKeyPair.publicKey,
|
|
203
|
+
_ConnectCrypto.algorithm,
|
|
204
|
+
true,
|
|
205
|
+
["verify"]
|
|
206
|
+
),
|
|
207
|
+
privateKey: await subtleCrypto.importKey(
|
|
208
|
+
"jwk",
|
|
209
|
+
jwkKeyPair.privateKey,
|
|
210
|
+
_ConnectCrypto.algorithm,
|
|
211
|
+
true,
|
|
212
|
+
["sign"]
|
|
213
|
+
)
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
_sign = new WeakMap();
|
|
217
|
+
_verify = new WeakMap();
|
|
218
|
+
__publicField(_ConnectCrypto, "algorithm", {
|
|
219
|
+
name: "ECDSA",
|
|
220
|
+
namedCurve: "P-256"
|
|
221
|
+
});
|
|
222
|
+
__publicField(_ConnectCrypto, "signAlgorithm", {
|
|
223
|
+
name: "ECDSA",
|
|
224
|
+
namedCurve: "P-256",
|
|
225
|
+
hash: "SHA-256"
|
|
226
|
+
});
|
|
227
|
+
let ConnectCrypto = _ConnectCrypto;
|
|
228
|
+
function parsePkhDid(did) {
|
|
229
|
+
const parts = did.split(":");
|
|
230
|
+
if (!did.startsWith("did:pkh:") || parts.length !== 5) {
|
|
231
|
+
throw new Error("Invalid pkh did");
|
|
232
|
+
}
|
|
233
|
+
const [, , networkId, chainIdStr, address] = parts;
|
|
234
|
+
if (!address.startsWith("0x")) {
|
|
235
|
+
throw new Error(`Invalid address: ${address}`);
|
|
236
|
+
}
|
|
237
|
+
const chainId = Number(chainIdStr);
|
|
238
|
+
if (isNaN(chainId)) {
|
|
239
|
+
throw new Error(`Invalid chain id: ${chainIdStr}`);
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
chainId,
|
|
243
|
+
networkId,
|
|
244
|
+
address
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
class BaseStorage {
|
|
248
|
+
constructor(store2, namespace) {
|
|
249
|
+
__privateAdd(this, _BaseStorage_instances);
|
|
250
|
+
__privateAdd(this, _store);
|
|
251
|
+
__privateAdd(this, _namespace);
|
|
252
|
+
__privateSet(this, _store, store2);
|
|
253
|
+
__privateSet(this, _namespace, namespace);
|
|
254
|
+
}
|
|
255
|
+
get(key) {
|
|
256
|
+
return __privateGet(this, _store).get(__privateMethod(this, _BaseStorage_instances, buildKey_fn).call(this, key));
|
|
257
|
+
}
|
|
258
|
+
set(key, value) {
|
|
259
|
+
return __privateGet(this, _store).set(__privateMethod(this, _BaseStorage_instances, buildKey_fn).call(this, key), value);
|
|
260
|
+
}
|
|
261
|
+
delete(key) {
|
|
262
|
+
return __privateGet(this, _store).delete(__privateMethod(this, _BaseStorage_instances, buildKey_fn).call(this, key));
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
_store = new WeakMap();
|
|
266
|
+
_namespace = new WeakMap();
|
|
267
|
+
_BaseStorage_instances = new WeakSet();
|
|
268
|
+
buildKey_fn = function(key) {
|
|
269
|
+
return `${__privateGet(this, _namespace)}:${key.toString()}`;
|
|
270
|
+
};
|
|
271
|
+
const store = {
|
|
272
|
+
get: function(key) {
|
|
273
|
+
const value = localStorage.getItem(key);
|
|
274
|
+
if (value) {
|
|
275
|
+
return JSON.parse(value);
|
|
276
|
+
}
|
|
277
|
+
return void 0;
|
|
278
|
+
},
|
|
279
|
+
set: function(key, value) {
|
|
280
|
+
return value ? localStorage.setItem(key, JSON.stringify(value)) : localStorage.removeItem(key);
|
|
281
|
+
},
|
|
282
|
+
delete: function(key) {
|
|
283
|
+
return localStorage.removeItem(key);
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
class BrowserStorage extends BaseStorage {
|
|
287
|
+
constructor(namespace) {
|
|
288
|
+
super(
|
|
289
|
+
store,
|
|
290
|
+
`${connectConfig.routerBasename}:${namespace}`
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
function initRenownBrowser(connectId) {
|
|
295
|
+
return new Renown(new BrowserStorage("renown"), connectId);
|
|
296
|
+
}
|
|
297
|
+
class Renown {
|
|
298
|
+
constructor(store2, connectId, baseUrl = RENOWN_URL) {
|
|
299
|
+
__privateAdd(this, _Renown_instances);
|
|
300
|
+
__privateAdd(this, _baseUrl);
|
|
301
|
+
__privateAdd(this, _store2);
|
|
302
|
+
__privateAdd(this, _connectId);
|
|
303
|
+
__privateAdd(this, _eventEmitter, new eventsExports.EventEmitter());
|
|
304
|
+
__privateSet(this, _store2, store2);
|
|
305
|
+
__privateSet(this, _connectId, connectId);
|
|
306
|
+
__privateSet(this, _baseUrl, baseUrl);
|
|
307
|
+
if (this.user) {
|
|
308
|
+
this.login(this.user.did).catch(() => void 0);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
get user() {
|
|
312
|
+
return __privateGet(this, _store2).get("user");
|
|
313
|
+
}
|
|
314
|
+
set connectId(connectId) {
|
|
315
|
+
__privateSet(this, _connectId, connectId);
|
|
316
|
+
const user = this.user;
|
|
317
|
+
__privateMethod(this, _Renown_instances, updateUser_fn).call(this, void 0);
|
|
318
|
+
if (user) {
|
|
319
|
+
this.login(user.did).catch((e) => {
|
|
320
|
+
console.log("User no longer authenticated:", e);
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
async login(did) {
|
|
325
|
+
try {
|
|
326
|
+
const result = parsePkhDid(did);
|
|
327
|
+
const credential = await __privateMethod(this, _Renown_instances, getCredential_fn).call(this, result.address, result.chainId, __privateGet(this, _connectId));
|
|
328
|
+
if (!credential) {
|
|
329
|
+
__privateMethod(this, _Renown_instances, updateUser_fn).call(this, void 0);
|
|
330
|
+
throw new Error("Credential not found");
|
|
331
|
+
}
|
|
332
|
+
const user = {
|
|
333
|
+
...result,
|
|
334
|
+
did,
|
|
335
|
+
credential
|
|
336
|
+
};
|
|
337
|
+
getEnsInfo(user.address, user.chainId).then((ens) => {
|
|
338
|
+
var _a;
|
|
339
|
+
if (((_a = this.user) == null ? void 0 : _a.address) === user.address && this.user.chainId === user.chainId) {
|
|
340
|
+
__privateMethod(this, _Renown_instances, updateUser_fn).call(this, { ...this.user, ens });
|
|
341
|
+
}
|
|
342
|
+
}).catch(logger.error);
|
|
343
|
+
__privateMethod(this, _Renown_instances, updateUser_fn).call(this, user);
|
|
344
|
+
return user;
|
|
345
|
+
} catch (error) {
|
|
346
|
+
logger.error(error);
|
|
347
|
+
__privateMethod(this, _Renown_instances, updateUser_fn).call(this, void 0);
|
|
348
|
+
throw error;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
logout() {
|
|
352
|
+
__privateMethod(this, _Renown_instances, updateUser_fn).call(this, void 0);
|
|
353
|
+
}
|
|
354
|
+
on(event, listener) {
|
|
355
|
+
__privateGet(this, _eventEmitter).on(event, listener);
|
|
356
|
+
return () => {
|
|
357
|
+
__privateGet(this, _eventEmitter).removeListener(event, listener);
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
_baseUrl = new WeakMap();
|
|
362
|
+
_store2 = new WeakMap();
|
|
363
|
+
_connectId = new WeakMap();
|
|
364
|
+
_eventEmitter = new WeakMap();
|
|
365
|
+
_Renown_instances = new WeakSet();
|
|
366
|
+
updateUser_fn = function(user) {
|
|
367
|
+
user ? __privateGet(this, _store2).set("user", user) : __privateGet(this, _store2).delete("user");
|
|
368
|
+
__privateGet(this, _eventEmitter).emit("user", user);
|
|
369
|
+
};
|
|
370
|
+
getCredential_fn = async function(address, chainId, connectId) {
|
|
371
|
+
if (!__privateGet(this, _baseUrl)) {
|
|
372
|
+
throw new Error("RENOWN_URL is not set");
|
|
373
|
+
}
|
|
374
|
+
const url = new URL(
|
|
375
|
+
`/api/auth/credential?address=${encodeURIComponent(address)}&chainId=${encodeURIComponent(chainId)}&connectId=${encodeURIComponent(connectId)}`,
|
|
376
|
+
__privateGet(this, _baseUrl)
|
|
377
|
+
);
|
|
378
|
+
const response = await fetch(url, {
|
|
379
|
+
method: "GET"
|
|
380
|
+
});
|
|
381
|
+
if (response.ok) {
|
|
382
|
+
const result = await response.json();
|
|
383
|
+
return result.credential;
|
|
384
|
+
} else {
|
|
385
|
+
throw new Error("Failed to get credential");
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
export {
|
|
389
|
+
BaseStorage,
|
|
390
|
+
BrowserKeyStorage,
|
|
391
|
+
ConnectCrypto,
|
|
392
|
+
i as RENOWN_CHAIN_ID,
|
|
393
|
+
h as RENOWN_NETWORK_ID,
|
|
394
|
+
RENOWN_URL,
|
|
395
|
+
Renown,
|
|
396
|
+
d as addExternalPackage,
|
|
397
|
+
j as getChain,
|
|
398
|
+
getEnsInfo,
|
|
399
|
+
b as getHMRModule,
|
|
400
|
+
initRenownBrowser,
|
|
401
|
+
parsePkhDid,
|
|
402
|
+
f as removeExternalPackage,
|
|
403
|
+
s as subscribeExternalPackages
|
|
404
|
+
};
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { t as twMerge,
|
|
3
|
-
import {
|
|
2
|
+
import { t as twMerge, ag as clsx, ah as get, ai as set, aj as appendErrors, ak as useFormContext, al as Primitive, am as cva, an as FormProvider, ao as Controller, ap as Slot, aq as useForm, ar as Root2, as as List, at as Trigger, au as Content, av as setModelName, aw as setModelId, ax as setModelDescription, ay as setModelExtension, az as setAuthorName, aA as setAuthorWebsite, aB as setStateSchema, aC as setInitialState, aD as addModule, aE as setModuleName, aF as deleteModule, aG as addOperation, aH as setOperationName, aI as setOperationSchema, aJ as setOperationDescription, aK as deleteOperation, aL as addOperationError, aM as deleteOperationError, aN as setOperationErrorName } from "./app-BjxLqcmz.js";
|
|
3
|
+
import { bb as inspect$1, bc as GraphQLError$1, bd as getNamedType, be as invariant$2, bf as isInputObjectType, bg as isScalarType, bh as isObjectType, bi as isInterfaceType, bj as isUnionType, bk as isEnumType, bl as print, bm as isPrintableAsBlockString, bn as Kind, bo as astFromValue$1, bp as DEFAULT_DEPRECATION_REASON, bq as isSpecifiedDirective, br as isSpecifiedScalarType, bs as isIntrospectionType, bt as z, bu as GraphQLScalarType, Z as pascalCase, bv as parse, bw as visit, bx as buildASTSchema, by as extendSchema, bz as getNullableType, bA as isListType, $ as getDefaultExportFromCjs, bB as snakeCase, bC as constantCase, bD as isAbstractType, bE as BREAK, bF as GraphQLInputObjectType, bG as GraphQLList, bH as GraphQLEnumType, bI as GraphQLObjectType, bJ as GraphQLInterfaceType, bK as SchemaMetaFieldDef, bL as TypeMetaFieldDef, bM as TypeNameMetaFieldDef, bN as isCompositeType, bO as isOutputType, bP as isInputType, bQ as GraphQLBoolean, bR as assertAbstractType, bS as doTypesOverlap, bT as DirectiveLocation, bU as specifiedRules$1, bV as NoUnusedFragmentsRule$1, bW as ExecutableDefinitionsRule$1, bX as validate$2, bY as validateSchema, bZ as GraphQLID, b_ as GraphQLString, b$ as GraphQLFloat, c0 as GraphQLInt, c1 as GraphQLDirective, c2 as GraphQLUnionType, c3 as isNonNullType, c4 as GraphQLNonNull, c5 as isNamedType, c6 as isLeafType, c7 as GraphQLSchema, c8 as buildSchema, c9 as sentenceCase, an as hashKey } from "./app-loader-nik9-lTL.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import React__default, { forwardRef, useRef, useCallback, useImperativeHandle, useEffect, useState, createContext, useContext, memo, useId, useMemo } from "react";
|
|
6
|
-
import "./main.
|
|
7
|
-
import "@powerhousedao/reactor-browser";
|
|
6
|
+
import "./main.BuoJ8woF.js";
|
|
8
7
|
import "react-dom";
|
|
9
|
-
import "@powerhousedao/reactor-browser/hooks/useUiNodesContext";
|
|
10
|
-
import "@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes";
|
|
11
|
-
import "@powerhousedao/reactor-browser/hooks/useDriveContext";
|
|
12
|
-
import "@powerhousedao/reactor-browser/uiNodes/constants";
|
|
13
|
-
import "@powerhousedao/reactor-browser/hooks/document-state";
|
|
14
8
|
const versionInfo = Object.freeze({
|
|
15
9
|
major: 16,
|
|
16
10
|
minor: 10,
|
|
@@ -99,7 +99,7 @@ const __vitePreload = function preload(baseModule, deps, importerUrl) {
|
|
|
99
99
|
return baseModule().catch(handlePreloadError);
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
|
-
__vitePreload(() => import("./index-
|
|
102
|
+
__vitePreload(() => import("./index-11j-ZVsN.js"), true ? [] : void 0);
|
|
103
103
|
export {
|
|
104
104
|
__vitePreload as _
|
|
105
105
|
};
|
package/dist/index.html
CHANGED
|
@@ -64,4 +64,4 @@
|
|
|
64
64
|
"react-dom": "https://esm.sh/react-dom",
|
|
65
65
|
"react-dom/": "https://esm.sh/react-dom/"
|
|
66
66
|
}
|
|
67
|
-
}</script><script type="module" crossorigin="" src="/assets/main.
|
|
67
|
+
}</script><script type="module" crossorigin="" src="/assets/main.BuoJ8woF.js"></script></head><body><div id="app"></div></body></html>
|
package/dist/vite-envs.sh
CHANGED
|
@@ -11,7 +11,7 @@ replaceAll() {
|
|
|
11
11
|
}'
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
html=$(echo "PCFET0NUWVBFIGh0bWw+PGh0bWw+PGhlYWQ+PG1ldGEgY2hhcnNldD0iVVRGLTgiPjxtZXRhIG5hbWU9InZpZXdwb3J0IiBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgsaW5pdGlhbC1zY2FsZT0xIj48dGl0bGU+UG93ZXJob3VzZSBDb25uZWN0PC90aXRsZT48YmFzZSBocmVmPSIvIj48bGluayByZWw9Imljb24iIGhyZWY9Ii9pY29uLmljbyI+PCEtLSB2aXRlLWVudnMgc2NyaXB0IHBsYWNlaG9sZGVyIHhLc1BtTHMzMHN3S3NkSXNWeCAtLT48c2NyaXB0IHR5cGU9ImltcG9ydG1hcCI+ewogICJpbXBvcnRzIjogewogICAgInJlYWN0IjogImh0dHBzOi8vZXNtLnNoL3JlYWN0IiwKICAgICJyZWFjdC8iOiAiaHR0cHM6Ly9lc20uc2gvcmVhY3QvIiwKICAgICJyZWFjdC1kb20iOiAiaHR0cHM6Ly9lc20uc2gvcmVhY3QtZG9tIiwKICAgICJyZWFjdC1kb20vIjogImh0dHBzOi8vZXNtLnNoL3JlYWN0LWRvbS8iCiAgfQp9PC9zY3JpcHQ+
|
|
14
|
+
html=$(echo "PCFET0NUWVBFIGh0bWw+PGh0bWw+PGhlYWQ+PG1ldGEgY2hhcnNldD0iVVRGLTgiPjxtZXRhIG5hbWU9InZpZXdwb3J0IiBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgsaW5pdGlhbC1zY2FsZT0xIj48dGl0bGU+UG93ZXJob3VzZSBDb25uZWN0PC90aXRsZT48YmFzZSBocmVmPSIvIj48bGluayByZWw9Imljb24iIGhyZWY9Ii9pY29uLmljbyI+PCEtLSB2aXRlLWVudnMgc2NyaXB0IHBsYWNlaG9sZGVyIHhLc1BtTHMzMHN3S3NkSXNWeCAtLT48c2NyaXB0IHR5cGU9ImltcG9ydG1hcCI+ewogICJpbXBvcnRzIjogewogICAgInJlYWN0IjogImh0dHBzOi8vZXNtLnNoL3JlYWN0IiwKICAgICJyZWFjdC8iOiAiaHR0cHM6Ly9lc20uc2gvcmVhY3QvIiwKICAgICJyZWFjdC1kb20iOiAiaHR0cHM6Ly9lc20uc2gvcmVhY3QtZG9tIiwKICAgICJyZWFjdC1kb20vIjogImh0dHBzOi8vZXNtLnNoL3JlYWN0LWRvbS8iCiAgfQp9PC9zY3JpcHQ+PHNjcmlwdCB0eXBlPSJtb2R1bGUiIGNyb3Nzb3JpZ2luPSIiIHNyYz0iL2Fzc2V0cy9tYWluLkJ1b0o4d29GLmpzIj48L3NjcmlwdD48L2hlYWQ+PGJvZHk+PGRpdiBpZD0iYXBwIj48L2Rpdj48L2JvZHk+PC9odG1sPg==" | base64 -d)
|
|
15
15
|
|
|
16
16
|
BASE_URL_base64="eEFwV2RSclg5OWtQclZnZ0UiLyIK"
|
|
17
17
|
BASE_URL=$(echo "Lwo=" | base64 -d)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/connect",
|
|
3
3
|
"productName": "Powerhouse-Connect",
|
|
4
|
-
"version": "1.0.16-
|
|
4
|
+
"version": "1.0.16-staging.0",
|
|
5
5
|
"description": "Powerhouse Connect",
|
|
6
6
|
"main": "./dist/index.html",
|
|
7
7
|
"type": "module",
|
|
@@ -82,14 +82,14 @@
|
|
|
82
82
|
"vite-plugin-svgr": "^4.2.0",
|
|
83
83
|
"vite-tsconfig-paths": "^4.3.2",
|
|
84
84
|
"xvfb-maybe": "^0.2.1",
|
|
85
|
-
"@powerhousedao/builder-tools": "0.9.27-
|
|
86
|
-
"@powerhousedao/config": "1.27.0-
|
|
87
|
-
"@powerhousedao/
|
|
88
|
-
"@powerhousedao/
|
|
89
|
-
"@powerhousedao/
|
|
90
|
-
"@powerhousedao/
|
|
91
|
-
"document-drive": "1.29.9-
|
|
92
|
-
"document-model": "2.28.1-
|
|
85
|
+
"@powerhousedao/builder-tools": "0.9.27-staging.0",
|
|
86
|
+
"@powerhousedao/config": "1.27.0-staging.2",
|
|
87
|
+
"@powerhousedao/design-system": "1.39.17-staging.0",
|
|
88
|
+
"@powerhousedao/common": "1.10.31-staging.0",
|
|
89
|
+
"@powerhousedao/reactor-browser": "1.22.25-staging.0",
|
|
90
|
+
"@powerhousedao/scalars": "1.33.1-staging.2",
|
|
91
|
+
"document-drive": "1.29.9-staging.0",
|
|
92
|
+
"document-model": "2.28.1-staging.2"
|
|
93
93
|
},
|
|
94
94
|
"optionalDependencies": {
|
|
95
95
|
"@esbuild/linux-x64": "^0.21.4",
|