A unified, plug-and-play SDK for connecting to XRPL wallets (Gem Wallet, Crossmark, Xaman) in your web app.
npm install xrpl-wallet-connectA unified, plug-and-play SDK for connecting to XRPL wallets (Gem Wallet, Crossmark, Xaman) in your web app.
``bash`
npm install xrpl-wallet-connect
`ts
import { XRPLWalletConnect } from 'xrpl-wallet-connect';
const walletConnect = new XRPLWalletConnect({
xamanApiKey: 'YOUR_XAMAN_API_KEY', // Only needed for Xaman
});
// Developer selects wallet
walletConnect.selectWallet("gemwallet"); //options are: xaman, gemwallet, crossmark
// Sign in
const { address } = await walletConnect.signIn();
// Prepare a transaction
const tx = {
TransactionType: 'Payment',
Account: address,
Destination: 'r...',
Amount: '1000000',
};
// Sign and submit
const { hash } = await walletConnect.signAndSubmit(tx);
``