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

View File

@@ -0,0 +1,112 @@
import EventEmitter from 'eventemitter3';
import { WalletNotConnectedError } from './errors.js';
export { EventEmitter };
/**
* A wallet's readiness describes a series of states that the wallet can be in,
* depending on what kind of wallet it is. An installable wallet (eg. a browser
* extension like Phantom) might be `Installed` if we've found the Phantom API
* in the global scope, or `NotDetected` otherwise. A loadable, zero-install
* runtime (eg. Torus Wallet) might simply signal that it's `Loadable`. Use this
* metadata to personalize the wallet list for each user (eg. to show their
* installed wallets first).
*/
export var WalletReadyState;
(function (WalletReadyState) {
/**
* User-installable wallets can typically be detected by scanning for an API
* that they've injected into the global context. If such an API is present,
* we consider the wallet to have been installed.
*/
WalletReadyState["Installed"] = "Installed";
WalletReadyState["NotDetected"] = "NotDetected";
/**
* Loadable wallets are always available to you. Since you can load them at
* any time, it's meaningless to say that they have been detected.
*/
WalletReadyState["Loadable"] = "Loadable";
/**
* If a wallet is not supported on a given platform (eg. server-rendering, or
* mobile) then it will stay in the `Unsupported` state.
*/
WalletReadyState["Unsupported"] = "Unsupported";
})(WalletReadyState || (WalletReadyState = {}));
export class BaseWalletAdapter extends EventEmitter {
get connected() {
return !!this.publicKey;
}
async autoConnect() {
await this.connect();
}
async prepareTransaction(transaction, connection, options = {}) {
const publicKey = this.publicKey;
if (!publicKey)
throw new WalletNotConnectedError();
transaction.feePayer = transaction.feePayer || publicKey;
transaction.recentBlockhash =
transaction.recentBlockhash ||
(await connection.getLatestBlockhash({
commitment: options.preflightCommitment,
minContextSlot: options.minContextSlot,
})).blockhash;
return transaction;
}
}
export function scopePollingDetectionStrategy(detect) {
// Early return when server-side rendering
if (typeof window === 'undefined' || typeof document === 'undefined')
return;
const disposers = [];
function detectAndDispose() {
const detected = detect();
if (detected) {
for (const dispose of disposers) {
dispose();
}
}
}
// Strategy #1: Try detecting every second.
const interval =
// TODO: #334 Replace with idle callback strategy.
setInterval(detectAndDispose, 1000);
disposers.push(() => clearInterval(interval));
// Strategy #2: Detect as soon as the DOM becomes 'ready'/'interactive'.
if (
// Implies that `DOMContentLoaded` has not yet fired.
document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', detectAndDispose, { once: true });
disposers.push(() => document.removeEventListener('DOMContentLoaded', detectAndDispose));
}
// Strategy #3: Detect after the `window` has fully loaded.
if (
// If the `complete` state has been reached, we're too late.
document.readyState !== 'complete') {
window.addEventListener('load', detectAndDispose, { once: true });
disposers.push(() => window.removeEventListener('load', detectAndDispose));
}
// Strategy #4: Detect synchronously, now.
detectAndDispose();
}
/**
* Users on iOS can be redirected into a wallet's in-app browser automatically,
* if that wallet has a universal link configured to do so
* But should not be redirected from within a webview, eg. if they're already
* inside a wallet's browser
* This function can be used to identify users who are on iOS and can be redirected
*
* @returns true if the user can be redirected
*/
export function isIosAndRedirectable() {
// SSR: return false
if (!navigator)
return false;
const userAgent = navigator.userAgent.toLowerCase();
// if on iOS the user agent will contain either iPhone or iPad
// caveat: if requesting desktop site then this won't work
const isIos = userAgent.includes('iphone') || userAgent.includes('ipad');
// if in a webview then it will not include Safari
// note that other iOS browsers also include Safari
// so we will redirect only if Safari is also included
const isSafari = userAgent.includes('safari');
return isIos && isSafari;
}
//# sourceMappingURL=adapter.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/adapter.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAoB,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAGxE,OAAO,EAAE,YAAY,EAAE,CAAC;AAuCxB;;;;;;;;GAQG;AACH,MA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AAM,CAAC,CAAC;IAEzE,kDAAkD;IAClD,mDAAmD;IACnD,sDAAsD;IACtD,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAE9C,OAAO,KAAK,IAAI,QAAQ,CAAC;AAC7B,CAAC"}

View File

@@ -0,0 +1,110 @@
export class WalletError extends Error {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
constructor(message, error) {
super(message);
this.error = error;
}
}
export class WalletNotReadyError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletNotReadyError';
}
}
export class WalletLoadError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletLoadError';
}
}
export class WalletConfigError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletConfigError';
}
}
export class WalletConnectionError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletConnectionError';
}
}
export class WalletDisconnectedError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletDisconnectedError';
}
}
export class WalletDisconnectionError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletDisconnectionError';
}
}
export class WalletAccountError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletAccountError';
}
}
export class WalletPublicKeyError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletPublicKeyError';
}
}
export class WalletKeypairError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletKeypairError';
}
}
export class WalletNotConnectedError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletNotConnectedError';
}
}
export class WalletSendTransactionError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletSendTransactionError';
}
}
export class WalletSignTransactionError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletSignTransactionError';
}
}
export class WalletSignMessageError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletSignMessageError';
}
}
export class WalletSignInError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletSignInError';
}
}
export class WalletTimeoutError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletTimeoutError';
}
}
export class WalletWindowBlockedError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletWindowBlockedError';
}
}
export class WalletWindowClosedError extends WalletError {
constructor() {
super(...arguments);
this.name = 'WalletWindowClosedError';
}
}
//# sourceMappingURL=errors.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAY,SAAQ,KAAK;IAGlC,6EAA6E;IAC7E,YAAY,OAAgB,EAAE,KAAW;QACrC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;CACJ;AAED,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAApD;;QACI,SAAI,GAAG,qBAAqB,CAAC;IACjC,CAAC;CAAA;AAED,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAAhD;;QACI,SAAI,GAAG,iBAAiB,CAAC;IAC7B,CAAC;CAAA;AAED,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAAlD;;QACI,SAAI,GAAG,mBAAmB,CAAC;IAC/B,CAAC;CAAA;AAED,MAAM,OAAO,qBAAsB,SAAQ,WAAW;IAAtD;;QACI,SAAI,GAAG,uBAAuB,CAAC;IACnC,CAAC;CAAA;AAED,MAAM,OAAO,uBAAwB,SAAQ,WAAW;IAAxD;;QACI,SAAI,GAAG,yBAAyB,CAAC;IACrC,CAAC;CAAA;AAED,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IAAzD;;QACI,SAAI,GAAG,0BAA0B,CAAC;IACtC,CAAC;CAAA;AAED,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IAAnD;;QACI,SAAI,GAAG,oBAAoB,CAAC;IAChC,CAAC;CAAA;AAED,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IAArD;;QACI,SAAI,GAAG,sBAAsB,CAAC;IAClC,CAAC;CAAA;AAED,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IAAnD;;QACI,SAAI,GAAG,oBAAoB,CAAC;IAChC,CAAC;CAAA;AAED,MAAM,OAAO,uBAAwB,SAAQ,WAAW;IAAxD;;QACI,SAAI,GAAG,yBAAyB,CAAC;IACrC,CAAC;CAAA;AAED,MAAM,OAAO,0BAA2B,SAAQ,WAAW;IAA3D;;QACI,SAAI,GAAG,4BAA4B,CAAC;IACxC,CAAC;CAAA;AAED,MAAM,OAAO,0BAA2B,SAAQ,WAAW;IAA3D;;QACI,SAAI,GAAG,4BAA4B,CAAC;IACxC,CAAC;CAAA;AAED,MAAM,OAAO,sBAAuB,SAAQ,WAAW;IAAvD;;QACI,SAAI,GAAG,wBAAwB,CAAC;IACpC,CAAC;CAAA;AAED,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAAlD;;QACI,SAAI,GAAG,mBAAmB,CAAC;IAC/B,CAAC;CAAA;AAED,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IAAnD;;QACI,SAAI,GAAG,oBAAoB,CAAC;IAChC,CAAC;CAAA;AAED,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IAAzD;;QACI,SAAI,GAAG,0BAA0B,CAAC;IACtC,CAAC;CAAA;AAED,MAAM,OAAO,uBAAwB,SAAQ,WAAW;IAAxD;;QACI,SAAI,GAAG,yBAAyB,CAAC;IACrC,CAAC;CAAA"}

View File

@@ -0,0 +1,7 @@
export * from './adapter.js';
export * from './errors.js';
export * from './signer.js';
export * from './standard.js';
export * from './transaction.js';
export * from './types.js';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}

View File

@@ -0,0 +1,73 @@
import { BaseWalletAdapter, } from './adapter.js';
import { WalletSendTransactionError, WalletSignTransactionError } from './errors.js';
import { isVersionedTransaction } from './transaction.js';
export class BaseSignerWalletAdapter extends BaseWalletAdapter {
async sendTransaction(transaction, connection, options = {}) {
let emit = true;
try {
if (isVersionedTransaction(transaction)) {
if (!this.supportedTransactionVersions)
throw new WalletSendTransactionError(`Sending versioned transactions isn't supported by this wallet`);
if (!this.supportedTransactionVersions.has(transaction.version))
throw new WalletSendTransactionError(`Sending transaction version ${transaction.version} isn't supported by this wallet`);
try {
transaction = await this.signTransaction(transaction);
const rawTransaction = transaction.serialize();
return await connection.sendRawTransaction(rawTransaction, options);
}
catch (error) {
// If the error was thrown by `signTransaction`, rethrow it and don't emit a duplicate event
if (error instanceof WalletSignTransactionError) {
emit = false;
throw error;
}
throw new WalletSendTransactionError(error?.message, error);
}
}
else {
try {
const { signers, ...sendOptions } = options;
transaction = await this.prepareTransaction(transaction, connection, sendOptions);
signers?.length && transaction.partialSign(...signers);
transaction = await this.signTransaction(transaction);
const rawTransaction = transaction.serialize();
return await connection.sendRawTransaction(rawTransaction, sendOptions);
}
catch (error) {
// If the error was thrown by `signTransaction`, rethrow it and don't emit a duplicate event
if (error instanceof WalletSignTransactionError) {
emit = false;
throw error;
}
throw new WalletSendTransactionError(error?.message, error);
}
}
}
catch (error) {
if (emit) {
this.emit('error', error);
}
throw error;
}
}
async signAllTransactions(transactions) {
for (const transaction of transactions) {
if (isVersionedTransaction(transaction)) {
if (!this.supportedTransactionVersions)
throw new WalletSignTransactionError(`Signing versioned transactions isn't supported by this wallet`);
if (!this.supportedTransactionVersions.has(transaction.version))
throw new WalletSignTransactionError(`Signing transaction version ${transaction.version} isn't supported by this wallet`);
}
}
const signedTransactions = [];
for (const transaction of transactions) {
signedTransactions.push(await this.signTransaction(transaction));
}
return signedTransactions;
}
}
export class BaseMessageSignerWalletAdapter extends BaseSignerWalletAdapter {
}
export class BaseSignInMessageSignerWalletAdapter extends BaseMessageSignerWalletAdapter {
}
//# sourceMappingURL=signer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../src/signer.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,iBAAiB,GAIpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAA0C,MAAM,kBAAkB,CAAC;AAalG,MAAM,OAAgB,uBAClB,SAAQ,iBAAuB;IAG/B,KAAK,CAAC,eAAe,CACjB,WAAoF,EACpF,UAAsB,EACtB,UAAkC,EAAE;QAEpC,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC;YACD,IAAI,sBAAsB,CAAC,WAAW,CAAC,EAAE,CAAC;gBACtC,IAAI,CAAC,IAAI,CAAC,4BAA4B;oBAClC,MAAM,IAAI,0BAA0B,CAChC,+DAA+D,CAClE,CAAC;gBAEN,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC;oBAC3D,MAAM,IAAI,0BAA0B,CAChC,+BAA+B,WAAW,CAAC,OAAO,iCAAiC,CACtF,CAAC;gBAEN,IAAI,CAAC;oBACD,WAAW,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;oBAEtD,MAAM,cAAc,GAAG,WAAW,CAAC,SAAS,EAAE,CAAC;oBAE/C,OAAO,MAAM,UAAU,CAAC,kBAAkB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;gBACxE,CAAC;gBAAC,OAAO,KAAU,EAAE,CAAC;oBAClB,4FAA4F;oBAC5F,IAAI,KAAK,YAAY,0BAA0B,EAAE,CAAC;wBAC9C,IAAI,GAAG,KAAK,CAAC;wBACb,MAAM,KAAK,CAAC;oBAChB,CAAC;oBACD,MAAM,IAAI,0BAA0B,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;gBAChE,CAAC;Y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AAG,CAAC,WAAW,CAAC,OAAO,CAAC;oBAC3D,MAAM,IAAI,0BAA0B,CAChC,+BAA+B,WAAW,CAAC,OAAO,iCAAiC,CACtF,CAAC;YACV,CAAC;QACL,CAAC;QAED,MAAM,kBAAkB,GAAQ,EAAE,CAAC;QACnC,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;YACrC,kBAAkB,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,kBAAkB,CAAC;IAC9B,CAAC;CACJ;AASD,MAAM,OAAgB,8BAClB,SAAQ,uBAA6B;CAIxC;AASD,MAAM,OAAgB,oCAClB,SAAQ,8BAAoC;CAI/C"}

View File

@@ -0,0 +1,8 @@
import { SolanaSignAndSendTransaction, SolanaSignTransaction, } from '@solana/wallet-standard-features';
import { StandardConnect, StandardEvents, } from '@wallet-standard/features';
export function isWalletAdapterCompatibleStandardWallet(wallet) {
return (StandardConnect in wallet.features &&
StandardEvents in wallet.features &&
(SolanaSignAndSendTransaction in wallet.features || SolanaSignTransaction in wallet.features));
}
//# sourceMappingURL=standard.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"standard.js","sourceRoot":"","sources":["../../src/standard.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,4BAA4B,EAI5B,qBAAqB,GAExB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACH,eAAe,EAGf,cAAc,GAEjB,MAAM,2BAA2B,CAAC;AAkBnC,MAAM,UAAU,uCAAuC,CACnD,MAAsB;IAEtB,OAAO,CACH,eAAe,IAAI,MAAM,CAAC,QAAQ;QAClC,cAAc,IAAI,MAAM,CAAC,QAAQ;QACjC,CAAC,4BAA4B,IAAI,MAAM,CAAC,QAAQ,IAAI,qBAAqB,IAAI,MAAM,CAAC,QAAQ,CAAC,CAChG,CAAC;AACN,CAAC"}

View File

@@ -0,0 +1,4 @@
export function isVersionedTransaction(transaction) {
return 'version' in transaction;
}
//# sourceMappingURL=transaction.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src/transaction.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,sBAAsB,CAClC,WAA+C;IAE/C,OAAO,SAAS,IAAI,WAAW,CAAC;AACpC,CAAC"}

View File

@@ -0,0 +1 @@
{"root":["../../src/adapter.ts","../../src/errors.ts","../../src/index.ts","../../src/signer.ts","../../src/standard.ts","../../src/transaction.ts","../../src/types.ts"],"version":"5.8.3"}

View File

@@ -0,0 +1,7 @@
export var WalletAdapterNetwork;
(function (WalletAdapterNetwork) {
WalletAdapterNetwork["Mainnet"] = "mainnet-beta";
WalletAdapterNetwork["Testnet"] = "testnet";
WalletAdapterNetwork["Devnet"] = "devnet";
})(WalletAdapterNetwork || (WalletAdapterNetwork = {}));
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAWA,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC5B,gDAAwB,CAAA;IACxB,2CAAmB,CAAA;IACnB,yCAAiB,CAAA;AACrB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B"}