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

6
node_modules/@wallet-standard/base/src/bytes.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
type TypedArrayMutableProperties = 'copyWithin' | 'fill' | 'reverse' | 'set' | 'sort';
export interface ReadonlyUint8Array extends Omit<Uint8Array, TypedArrayMutableProperties> {
readonly [n: number]: number;
}
export {};

27
node_modules/@wallet-standard/base/src/identifier.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
/**
* A namespaced identifier in the format `${namespace}:${reference}`.
*
* Used by {@link IdentifierArray} and {@link IdentifierRecord}.
*
* @group Identifier
*/
export type IdentifierString = `${string}:${string}`;
/**
* A read-only array of namespaced identifiers in the format `${namespace}:${reference}`.
*
* Used by {@link Wallet.chains | Wallet::chains}, {@link WalletAccount.chains | WalletAccount::chains}, and
* {@link WalletAccount.features | WalletAccount::features}.
*
* @group Identifier
*/
export type IdentifierArray = readonly IdentifierString[];
/**
* A read-only object with keys of namespaced identifiers in the format `${namespace}:${reference}`.
*
* Used by {@link Wallet.features | Wallet::features}.
*
* @group Identifier
*/
export type IdentifierRecord<T> = Readonly<Record<IdentifierString, T>>;

4
node_modules/@wallet-standard/base/src/index.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export * from './bytes.js';
export * from './identifier.js';
export * from './wallet.js';
export * from './window.js';

166
node_modules/@wallet-standard/base/src/wallet.ts generated vendored Normal file
View File

@@ -0,0 +1,166 @@
import type { ReadonlyUint8Array } from './bytes.js';
import type { IdentifierArray, IdentifierRecord, IdentifierString } from './identifier.js';
/**
* Version of the Wallet Standard implemented by a {@link Wallet}.
*
* Used by {@link Wallet.version | Wallet::version}.
*
* Note that this is _NOT_ a version of the Wallet, but a version of the Wallet Standard itself that the Wallet
* supports.
*
* This may be used by the app to determine compatibility and feature detect.
*
* @group Wallet
*/
export type WalletVersion = '1.0.0';
/**
* A data URI containing a base64-encoded SVG, WebP, PNG, or GIF image.
*
* Used by {@link Wallet.icon | Wallet::icon} and {@link WalletAccount.icon | WalletAccount::icon}.
*
* @group Wallet
*/
export type WalletIcon = `data:image/${'svg+xml' | 'webp' | 'png' | 'gif'};base64,${string}`;
/**
* Interface of a **Wallet**, also referred to as a **Standard Wallet**.
*
* A Standard Wallet implements and adheres to the Wallet Standard.
*
* @group Wallet
*/
export interface Wallet {
/**
* {@link WalletVersion | Version} of the Wallet Standard implemented by the Wallet.
*
* Must be read-only, static, and canonically defined by the Wallet Standard.
*/
readonly version: WalletVersion;
/**
* Name of the Wallet. This may be displayed by the app.
*
* Must be read-only, static, descriptive, unique, and canonically defined by the wallet extension or application.
*/
readonly name: string;
/**
* {@link WalletIcon | Icon} of the Wallet. This may be displayed by the app.
*
* Must be read-only, static, and canonically defined by the wallet extension or application.
*/
readonly icon: WalletIcon;
/**
* Chains supported by the Wallet.
*
* A **chain** is an {@link IdentifierString} which identifies a blockchain in a canonical, human-readable format.
* [CAIP-2](https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md) chain IDs are compatible with this,
* but are not required to be used.
*
* Each blockchain should define its own **chains** by extension of the Wallet Standard, using its own namespace.
* The `standard` and `experimental` namespaces are reserved by the Wallet Standard.
*
* The {@link "@wallet-standard/features".EventsFeature | `standard:events` feature} should be used to notify the
* app if the value changes.
*/
readonly chains: IdentifierArray;
/**
* Features supported by the Wallet.
*
* A **feature name** is an {@link IdentifierString} which identifies a **feature** in a canonical, human-readable
* format.
*
* Each blockchain should define its own features by extension of the Wallet Standard.
*
* The `standard` and `experimental` namespaces are reserved by the Wallet Standard.
*
* A **feature** may have any type. It may be a single method or value, or a collection of them.
*
* A **conventional feature** has the following structure:
*
* ```ts
* export type ExperimentalEncryptFeature = {
* // Name of the feature.
* 'experimental:encrypt': {
* // Version of the feature.
* version: '1.0.0';
* // Properties of the feature.
* ciphers: readonly 'x25519-xsalsa20-poly1305'[];
* // Methods of the feature.
* encrypt (data: Uint8Array): Promise<Uint8Array>;
* };
* };
* ```
*
* The {@link "@wallet-standard/features".EventsFeature | `standard:events` feature} should be used to notify the
* app if the value changes.
*/
readonly features: IdentifierRecord<unknown>;
/**
* {@link WalletAccount | Accounts} that the app is authorized to use.
*
* This can be set by the Wallet so the app can use authorized accounts on the initial page load.
*
* The {@link "@wallet-standard/features".ConnectFeature | `standard:connect` feature} should be used to obtain
* authorization to the accounts.
*
* The {@link "@wallet-standard/features".EventsFeature | `standard:events` feature} should be used to notify the
* app if the value changes.
*/
readonly accounts: readonly WalletAccount[];
}
/**
* Interface of a **WalletAccount**, also referred to as an **Account**.
*
* An account is a _read-only data object_ that is provided from the Wallet to the app, authorizing the app to use it.
*
* The app can use an account to display and query information from a chain.
*
* The app can also act using an account by passing it to {@link Wallet.features | features} of the Wallet.
*
* Wallets may use or extend {@link "@wallet-standard/wallet".ReadonlyWalletAccount} which implements this interface.
*
* @group Wallet
*/
export interface WalletAccount {
/** Address of the account, corresponding with a public key. */
readonly address: string;
/** Public key of the account, corresponding with a secret key to use. */
readonly publicKey: ReadonlyUint8Array;
/**
* Chains supported by the account.
*
* This must be a subset of the {@link Wallet.chains | chains} of the Wallet.
*/
readonly chains: IdentifierArray;
/**
* Feature names supported by the account.
*
* This must be a subset of the names of {@link Wallet.features | features} of the Wallet.
*/
readonly features: IdentifierArray;
/** Optional user-friendly descriptive label or name for the account. This may be displayed by the app. */
readonly label?: string;
/** Optional user-friendly icon for the account. This may be displayed by the app. */
readonly icon?: WalletIcon;
}
/**
* Helper type for defining a {@link Wallet} with a union or intersection of {@link Wallet.features | features}.
*
* @group Wallet
*/
export type WalletWithFeatures<Features extends Wallet['features']> = Omit<Wallet, 'features'> & {
features: Features;
};

148
node_modules/@wallet-standard/base/src/window.ts generated vendored Normal file
View File

@@ -0,0 +1,148 @@
import type { Wallet } from './wallet.js';
/**
* Global `window` type for dispatching and listening for {@link WindowAppReadyEvent} and {@link WindowRegisterWalletEvent}.
*
* ```ts
* import { WalletEventsWindow } from '@wallet-standard/base';
*
* declare const window: WalletEventsWindow;
* // OR
* (window as WalletEventsWindow)
* ```
*
* @group Window
*/
export interface WalletEventsWindow extends Omit<Window, 'addEventListener' | 'dispatchEvent'> {
/** Add a listener for {@link WindowAppReadyEvent}. */
addEventListener(type: WindowAppReadyEventType, listener: (event: WindowAppReadyEvent) => void): void;
/** Add a listener for {@link WindowRegisterWalletEvent}. */
addEventListener(type: WindowRegisterWalletEventType, listener: (event: WindowRegisterWalletEvent) => void): void;
/** Dispatch a {@link WindowAppReadyEvent}. */
dispatchEvent(event: WindowAppReadyEvent): void;
/** Dispatch a {@link WindowRegisterWalletEvent}. */
dispatchEvent(event: WindowRegisterWalletEvent): void;
}
/**
* Type of {@link WindowAppReadyEvent}.
*
* @group App Ready Event
*/
export type WindowAppReadyEventType = 'wallet-standard:app-ready';
/** Interface that will be provided to {@link Wallet | Wallets} by the app when the app calls the
* {@link WindowRegisterWalletEventCallback} provided by Wallets.
*
* Wallets must call the {@link WindowAppReadyEventAPI.register | register} method to register themselves.
*
* @group App Ready Event
*/
export interface WindowAppReadyEventAPI {
/**
* Register a {@link Wallet} with the app.
*
* @return
* `unregister` function to programmatically unregister the Wallet.
*
* Wallets generally do not need to, and should not, call this.
*/
register(wallet: Wallet): () => void;
}
/**
* Event that will be dispatched by the app on the `window` when the app is ready to register {@link Wallet | Wallets}.
*
* Wallets must listen for this event, and {@link WindowAppReadyEventAPI.register register} themselves when the event is
* dispatched.
*
* @group App Ready Event
*/
export type WindowAppReadyEvent = UnstoppableCustomEvent<WindowAppReadyEventType, WindowAppReadyEventAPI>;
/**
* Type of {@link WindowRegisterWalletEvent}.
*
* @group Register Wallet Event
*/
export type WindowRegisterWalletEventType = 'wallet-standard:register-wallet';
/**
* Callback function provided by {@link Wallet | Wallets} to be called by the app when the app is ready to register
* Wallets.
*
* @group Register Wallet Event
*/
export type WindowRegisterWalletEventCallback = (api: WindowAppReadyEventAPI) => void;
/**
* Event that will be dispatched on the `window` by each {@link Wallet | Wallet} when the Wallet is ready to be
* registered by the app.
*
* The app must listen for this event, and register Wallets when the event is dispatched.
*
* @group Register Wallet Event
*/
export type WindowRegisterWalletEvent = UnstoppableCustomEvent<
WindowRegisterWalletEventType,
WindowRegisterWalletEventCallback
>;
/**
* @deprecated Use {@link WalletEventsWindow} instead.
*
* @group Deprecated
*/
export interface DEPRECATED_WalletsWindow extends Window {
navigator: DEPRECATED_WalletsNavigator;
}
/**
* @deprecated Use {@link WalletEventsWindow} instead.
*
* @group Deprecated
*/
export interface DEPRECATED_WalletsNavigator extends Navigator {
wallets?: DEPRECATED_Wallets;
}
/**
* @deprecated Use {@link WalletEventsWindow} instead.
*
* @group Deprecated
*/
export interface DEPRECATED_Wallets {
push(...callbacks: DEPRECATED_WalletsCallback[]): void;
}
/**
* @deprecated Use {@link WalletEventsWindow} instead.
*
* @group Deprecated
*/
export type DEPRECATED_WalletsCallback = (wallets: { register(...wallets: Wallet[]): () => void }) => void;
/**
* @internal
*
* A custom event that cannot have its default behavior prevented or its propagation stopped.
*
* This is an internal type, extended by {@link WindowAppReadyEvent} and {@link WindowRegisterWalletEvent}.
*
* [`window.CustomEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent) is not used because
* Node.js doesn't have it, but this interface is compatible with it.
*
* @group Internal
*/
export interface UnstoppableCustomEvent<T extends string, D> extends Event {
/** Type of the event. */
readonly type: T;
/** Data attached to the event. */
readonly detail: D;
/** @deprecated Does nothing and throws an error if called. */
preventDefault(): never;
/** @deprecated Does nothing and throws an error if called. */
stopImmediatePropagation(): never;
/** @deprecated Does nothing and throws an error if called. */
stopPropagation(): never;
}