Develop Solana dApps

Solana Provider

Similarly to the Phantom Provider, XDEFI Wallet provider exposes different methods in window.solana or window.xfi.solana
Below are the different functions exposed in the provider window.solana window.xfi.solana.


isXDEFI returns true if the provider is XDEFI.

connect(): Promise<{publicKey: PublicKey}>

It returns the current PublicKey of the connected account.

disconnect(): Promise<void>

Disconnect the wallet.

signTransaction(transaction: Transaction): Promise<Transaction>

Add a signature to @solana/web3.js Transaction object;

signAllTransactions(transactions: Transaction[]): Promise<Transaction[]>

Add a signature for each @solana/web3.js Transaction object passed in parameters;

signMessage(message: string | Uint8Array, display?: DisplayEncoding | undefined): Promise<{signature:string, publicKey: string}>

Returns a signature and the publicKey who signed the message;
Last modified 11mo ago
XDEFI Technologies 2024