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,23 @@
import type { WalletWithFeatures } from '@wallet-standard/base';
import type { SolanaSignAndSendTransactionFeature } from './signAndSendTransaction.js';
import type { SolanaSignInFeature } from './signIn.js';
import type { SolanaSignMessageFeature } from './signMessage.js';
import type { SolanaSignTransactionFeature } from './signTransaction.js';
import type { SolanaSignAndSendAllTransactionsFeature } from './signAndSendAllTransactions.js';
/** TODO: docs */
export type SolanaFeatures =
| SolanaSignAndSendTransactionFeature
| SolanaSignInFeature
| SolanaSignMessageFeature
| SolanaSignTransactionFeature
| SolanaSignAndSendAllTransactionsFeature;
/** TODO: docs */
export type WalletWithSolanaFeatures = WalletWithFeatures<SolanaFeatures>;
export * from './signAndSendTransaction.js';
export * from './signIn.js';
export * from './signMessage.js';
export * from './signTransaction.js';
export * from './signAndSendAllTransactions.js';

View File

@@ -0,0 +1,48 @@
import type { SolanaTransactionVersion } from './signTransaction.js';
import type {
SolanaSignAndSendTransactionInput,
SolanaSignAndSendTransactionOutput,
} from './signAndSendTransaction.js';
/** Name of the feature */
export const SignAndSendAllTransactions = 'solana:signAndSendAllTransactions';
/** TODO: docs */
export type SolanaSignAndSendAllTransactionsFeature = {
/** Name of the feature. */
readonly [SignAndSendAllTransactions]: {
/** Version of the feature API. */
readonly version: SolanaSignAndSendAllTransactionsVersion;
/** TODO: docs */
readonly supportedTransactionVersions: readonly SolanaTransactionVersion[];
/**
* Sign transactions using the account's secret key and send them to the chain.
*
* @param inputs {SolanaSignAndSendTransactionInput[]} Inputs for signing and sending multiple transactions.
* @param options {SolanaSignAndSendAllTransactionsOptions} Options for signing and sending transactions.
*
* @return Outputs of signing and sending transactions.
*/
readonly signAndSendAllTransactions: SolanaSignAndSendAllTransactionsMethod;
};
};
/** Version of the feature. */
export type SolanaSignAndSendAllTransactionsVersion = '1.0.0';
/** TODO: docs */
export type SolanaSignAndSendAllTransactionsMethod = (
inputs: readonly SolanaSignAndSendTransactionInput[],
options?: SolanaSignAndSendAllTransactionsOptions
) => Promise<readonly PromiseSettledResult<SolanaSignAndSendTransactionOutput>[]>;
/** Options for signing and sending multiple transactions. */
export type SolanaSignAndSendAllTransactionsOptions = {
/** Mode for signing and sending transactions. */
readonly mode?: SolanaSignAndSendAllTransactionsMode;
};
/** Mode for signing and sending transactions. */
export type SolanaSignAndSendAllTransactionsMode = 'parallel' | 'serial';

View File

@@ -0,0 +1,66 @@
import type { IdentifierString } from '@wallet-standard/base';
import type {
SolanaSignTransactionInput,
SolanaSignTransactionOptions,
SolanaTransactionCommitment,
SolanaTransactionVersion,
} from './signTransaction.js';
/** Name of the feature. */
export const SolanaSignAndSendTransaction = 'solana:signAndSendTransaction';
/** TODO: docs */
export type SolanaSignAndSendTransactionFeature = {
/** Name of the feature. */
readonly [SolanaSignAndSendTransaction]: {
/** Version of the feature API. */
readonly version: SolanaSignAndSendTransactionVersion;
/** TODO: docs */
readonly supportedTransactionVersions: readonly SolanaTransactionVersion[];
/**
* Sign transactions using the account's secret key and send them to the chain.
*
* @param inputs Inputs for signing and sending transactions.
*
* @return Outputs of signing and sending transactions.
*/
readonly signAndSendTransaction: SolanaSignAndSendTransactionMethod;
};
};
/** Version of the feature. */
export type SolanaSignAndSendTransactionVersion = '1.0.0';
/** TODO: docs */
export type SolanaSignAndSendTransactionMethod = (
...inputs: readonly SolanaSignAndSendTransactionInput[]
) => Promise<readonly SolanaSignAndSendTransactionOutput[]>;
/** Input for signing and sending a transaction. */
export interface SolanaSignAndSendTransactionInput extends SolanaSignTransactionInput {
/** Chain to use. */
readonly chain: IdentifierString;
/** TODO: docs */
readonly options?: SolanaSignAndSendTransactionOptions;
}
/** Output of signing and sending a transaction. */
export interface SolanaSignAndSendTransactionOutput {
/** Transaction signature, as raw bytes. */
readonly signature: Uint8Array;
}
/** Options for signing and sending a transaction. */
export type SolanaSignAndSendTransactionOptions = SolanaSignTransactionOptions & {
/** Desired commitment level. If provided, confirm the transaction after sending. */
readonly commitment?: SolanaTransactionCommitment;
/** Disable transaction verification at the RPC. */
readonly skipPreflight?: boolean;
/** Maximum number of times for the RPC node to retry sending the transaction to the leader. */
readonly maxRetries?: number;
};

View File

@@ -0,0 +1,124 @@
import type { WalletAccount } from '@wallet-standard/base';
/** Name of the feature. */
export const SolanaSignIn = 'solana:signIn';
/** TODO: docs */
export type SolanaSignInFeature = {
/** Name of the feature. */
readonly [SolanaSignIn]: {
/** Version of the feature API. */
readonly version: SolanaSignInVersion;
/** Sign In With Solana (based on https://eips.ethereum.org/EIPS/eip-4361 and https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-122.md). */
readonly signIn: SolanaSignInMethod;
};
};
/** Version of the feature. */
export type SolanaSignInVersion = '1.0.0';
/** TODO: docs */
export type SolanaSignInMethod = (...inputs: readonly SolanaSignInInput[]) => Promise<readonly SolanaSignInOutput[]>;
/** Input for signing in. */
export interface SolanaSignInInput {
/**
* Optional EIP-4361 Domain.
* If not provided, the wallet must determine the Domain to include in the message.
*/
readonly domain?: string;
/**
* Optional EIP-4361 Address.
* If not provided, the wallet must determine the Address to include in the message.
*/
readonly address?: string;
/**
* Optional EIP-4361 Statement.
* If not provided, the wallet must not include Statement in the message.
*/
readonly statement?: string;
/**
* Optional EIP-4361 URI.
* If not provided, the wallet must not include URI in the message.
*/
readonly uri?: string;
/**
* Optional EIP-4361 Version.
* If not provided, the wallet must not include Version in the message.
*/
readonly version?: string;
/**
* Optional EIP-4361 Chain ID.
* If not provided, the wallet must not include Chain ID in the message.
*/
readonly chainId?: string;
/**
* Optional EIP-4361 Nonce.
* If not provided, the wallet must not include Nonce in the message.
*/
readonly nonce?: string;
/**
* Optional EIP-4361 Issued At.
* If not provided, the wallet must not include Issued At in the message.
*/
readonly issuedAt?: string;
/**
* Optional EIP-4361 Expiration Time.
* If not provided, the wallet must not include Expiration Time in the message.
*/
readonly expirationTime?: string;
/**
* Optional EIP-4361 Not Before.
* If not provided, the wallet must not include Not Before in the message.
*/
readonly notBefore?: string;
/**
* Optional EIP-4361 Request ID.
* If not provided, the wallet must not include Request ID in the message.
*/
readonly requestId?: string;
/**
* Optional EIP-4361 Resources.
* If not provided, the wallet must not include Resources in the message.
*/
readonly resources?: readonly string[];
}
/** Output of signing in. */
export interface SolanaSignInOutput {
/**
* Account that was signed in.
* The address of the account may be different from the provided input Address.
*/
readonly account: WalletAccount;
/**
* Message bytes that were signed.
* The wallet may prefix or otherwise modify the message before signing it.
*/
readonly signedMessage: Uint8Array;
/**
* Message signature produced.
* If the signature type is provided, the signature must be Ed25519.
*/
readonly signature: Uint8Array;
/**
* Optional type of the message signature produced.
* If not provided, the signature must be Ed25519.
*/
readonly signatureType?: 'ed25519';
}

View File

@@ -0,0 +1,54 @@
import type { WalletAccount } from '@wallet-standard/base';
/** Name of the feature. */
export const SolanaSignMessage = 'solana:signMessage';
/** TODO: docs */
export type SolanaSignMessageFeature = {
/** Name of the feature. */
readonly [SolanaSignMessage]: {
/** Version of the feature API. */
readonly version: SolanaSignMessageVersion;
/** Sign messages (arbitrary bytes) using the account's secret key. */
readonly signMessage: SolanaSignMessageMethod;
};
};
/** Version of the feature. */
export type SolanaSignMessageVersion = '1.1.0' | '1.0.0';
/** TODO: docs */
export type SolanaSignMessageMethod = (
...inputs: readonly SolanaSignMessageInput[]
) => Promise<readonly SolanaSignMessageOutput[]>;
/** Input for signing a message. */
export interface SolanaSignMessageInput {
/** Account to use. */
readonly account: WalletAccount;
/** Message to sign, as raw bytes. */
readonly message: Uint8Array;
}
/** Output of signing a message. */
export interface SolanaSignMessageOutput {
/**
* Message bytes that were signed.
* The wallet may prefix or otherwise modify the message before signing it.
*/
readonly signedMessage: Uint8Array;
/**
* Message signature produced.
* If the signature type is provided, the signature must be Ed25519.
*/
readonly signature: Uint8Array;
/**
* Optional type of the message signature produced.
* If not provided, the signature must be Ed25519.
*/
readonly signatureType?: 'ed25519';
}

View File

@@ -0,0 +1,73 @@
import type { IdentifierString, WalletAccount } from '@wallet-standard/base';
/** Name of the feature. */
export const SolanaSignTransaction = 'solana:signTransaction';
/** TODO: docs */
export type SolanaSignTransactionFeature = {
/** Name of the feature. */
readonly [SolanaSignTransaction]: {
/** Version of the feature API. */
readonly version: SolanaSignTransactionVersion;
/** TODO: docs */
readonly supportedTransactionVersions: readonly SolanaTransactionVersion[];
/**
* Sign transactions using the account's secret key.
*
* @param inputs Inputs for signing transactions.
*
* @return Outputs of signing transactions.
*/
readonly signTransaction: SolanaSignTransactionMethod;
};
};
/** Version of the feature. */
export type SolanaSignTransactionVersion = '1.0.0';
/** TODO: docs */
export type SolanaTransactionVersion = 'legacy' | 0;
/** TODO: docs */
export type SolanaSignTransactionMethod = (
...inputs: readonly SolanaSignTransactionInput[]
) => Promise<readonly SolanaSignTransactionOutput[]>;
/** Input for signing a transaction. */
export interface SolanaSignTransactionInput {
/** Account to use. */
readonly account: WalletAccount;
/** Serialized transaction, as raw bytes. */
readonly transaction: Uint8Array;
/** Chain to use. */
readonly chain?: IdentifierString;
/** TODO: docs */
readonly options?: SolanaSignTransactionOptions;
}
/** Output of signing a transaction. */
export interface SolanaSignTransactionOutput {
/**
* Signed, serialized transaction, as raw bytes.
* Returning a transaction rather than signatures allows multisig wallets, program wallets, and other wallets that
* use meta-transactions to return a modified, signed transaction.
*/
readonly signedTransaction: Uint8Array;
}
/** Options for signing a transaction. */
export type SolanaSignTransactionOptions = {
/** Preflight commitment level. */
readonly preflightCommitment?: SolanaTransactionCommitment;
/** The minimum slot that the request can be evaluated at. */
readonly minContextSlot?: number;
};
/** Commitment level for transactions. */
export type SolanaTransactionCommitment = 'processed' | 'confirmed' | 'finalized';