FRE-600: Fix code review blockers

- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 00:08:01 -04:00
parent 65b552bb08
commit 7c684a42cc
48450 changed files with 5679671 additions and 383 deletions

18
node_modules/@wallet-standard/app/lib/cjs/index.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./wallets.js"), exports);
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}

View File

@@ -0,0 +1 @@
{ "type": "commonjs" }

172
node_modules/@wallet-standard/app/lib/cjs/wallets.js generated vendored Normal file
View File

@@ -0,0 +1,172 @@
"use strict";
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var _AppReadyEvent_detail;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEPRECATED_getWallets = exports.getWallets = void 0;
let wallets = undefined;
const registeredWalletsSet = new Set();
function addRegisteredWallet(wallet) {
cachedWalletsArray = undefined;
registeredWalletsSet.add(wallet);
}
function removeRegisteredWallet(wallet) {
cachedWalletsArray = undefined;
registeredWalletsSet.delete(wallet);
}
const listeners = {};
/**
* Get an API for {@link Wallets.get | getting}, {@link Wallets.on | listening for}, and
* {@link Wallets.register | registering} {@link "@wallet-standard/base".Wallet | Wallets}.
*
* When called for the first time --
*
* This dispatches a {@link "@wallet-standard/base".WindowAppReadyEvent} to notify each Wallet that the app is ready
* to register it.
*
* This also adds a listener for {@link "@wallet-standard/base".WindowRegisterWalletEvent} to listen for a notification
* from each Wallet that the Wallet is ready to be registered by the app.
*
* This combination of event dispatch and listener guarantees that each Wallet will be registered synchronously as soon
* as the app is ready whether the app loads before or after each Wallet.
*
* @return API for getting, listening for, and registering Wallets.
*
* @group App
*/
function getWallets() {
if (wallets)
return wallets;
wallets = Object.freeze({ register, get, on });
if (typeof window === 'undefined')
return wallets;
const api = Object.freeze({ register });
try {
window.addEventListener('wallet-standard:register-wallet', ({ detail: callback }) => callback(api));
}
catch (error) {
console.error('wallet-standard:register-wallet event listener could not be added\n', error);
}
try {
window.dispatchEvent(new AppReadyEvent(api));
}
catch (error) {
console.error('wallet-standard:app-ready event could not be dispatched\n', error);
}
return wallets;
}
exports.getWallets = getWallets;
function register(...wallets) {
var _a;
// Filter out wallets that have already been registered.
// This prevents the same wallet from being registered twice, but it also prevents wallets from being
// unregistered by reusing a reference to the wallet to obtain the unregister function for it.
wallets = wallets.filter((wallet) => !registeredWalletsSet.has(wallet));
// If there are no new wallets to register, just return a no-op unregister function.
// eslint-disable-next-line @typescript-eslint/no-empty-function
if (!wallets.length)
return () => { };
wallets.forEach((wallet) => addRegisteredWallet(wallet));
(_a = listeners['register']) === null || _a === void 0 ? void 0 : _a.forEach((listener) => guard(() => listener(...wallets)));
// Return a function that unregisters the registered wallets.
return function unregister() {
var _a;
wallets.forEach((wallet) => removeRegisteredWallet(wallet));
(_a = listeners['unregister']) === null || _a === void 0 ? void 0 : _a.forEach((listener) => guard(() => listener(...wallets)));
};
}
let cachedWalletsArray;
function get() {
if (!cachedWalletsArray) {
cachedWalletsArray = [...registeredWalletsSet];
}
return cachedWalletsArray;
}
function on(event, listener) {
var _a;
((_a = listeners[event]) === null || _a === void 0 ? void 0 : _a.push(listener)) || (listeners[event] = [listener]);
// Return a function that removes the event listener.
return function off() {
var _a;
listeners[event] = (_a = listeners[event]) === null || _a === void 0 ? void 0 : _a.filter((existingListener) => listener !== existingListener);
};
}
function guard(callback) {
try {
callback();
}
catch (error) {
console.error(error);
}
}
class AppReadyEvent extends Event {
get detail() {
return __classPrivateFieldGet(this, _AppReadyEvent_detail, "f");
}
get type() {
return 'wallet-standard:app-ready';
}
constructor(api) {
super('wallet-standard:app-ready', {
bubbles: false,
cancelable: false,
composed: false,
});
_AppReadyEvent_detail.set(this, void 0);
__classPrivateFieldSet(this, _AppReadyEvent_detail, api, "f");
}
/** @deprecated */
preventDefault() {
throw new Error('preventDefault cannot be called');
}
/** @deprecated */
stopImmediatePropagation() {
throw new Error('stopImmediatePropagation cannot be called');
}
/** @deprecated */
stopPropagation() {
throw new Error('stopPropagation cannot be called');
}
}
_AppReadyEvent_detail = new WeakMap();
/**
* @deprecated Use {@link getWallets} instead.
*
* @group Deprecated
*/
function DEPRECATED_getWallets() {
if (wallets)
return wallets;
wallets = getWallets();
if (typeof window === 'undefined')
return wallets;
const callbacks = window.navigator.wallets || [];
if (!Array.isArray(callbacks)) {
console.error('window.navigator.wallets is not an array');
return wallets;
}
const { register } = wallets;
const push = (...callbacks) => callbacks.forEach((callback) => guard(() => callback({ register })));
try {
Object.defineProperty(window.navigator, 'wallets', {
value: Object.freeze({ push }),
});
}
catch (error) {
console.error('window.navigator.wallets could not be set');
return wallets;
}
push(...callbacks);
return wallets;
}
exports.DEPRECATED_getWallets = DEPRECATED_getWallets;
//# sourceMappingURL=wallets.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"wallets.js","sourceRoot":"","sources":["../../src/wallets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AASA,IAAI,OAAO,GAAwB,SAAS,CAAC;AAC7C,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAU,CAAC;AAC/C,SAAS,mBAAmB,CAAC,MAAc;IACvC,kBAAkB,GAAG,SAAS,CAAC;IAC/B,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AACD,SAAS,sBAAsB,CAAC,MAAc;IAC1C,kBAAkB,GAAG,SAAS,CAAC;IAC/B,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACxC,CAAC;AACD,MAAM,SAAS,GAA+D,EAAE,CAAC;AAEjF;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,UAAU;IACtB,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAC5B,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/C,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,OAAO,CAAC;IAElD,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IACxC,IAAI,CAAC;QACA,MAA6B,CAAC,gBAAgB,CAAC,iCAAiC,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EA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