GemWallet Adapter
GemWallet connects through its browser extension API. No API key or WalletConnect project ID is required.
| Integration | Value |
|---|---|
| Package | @xrpl-wallet-kit/adapter-gemwallet |
| Adapter ID | gemwallet |
| Wallet type | Browser extension |
| Client registration | Included in default wallet lists |
Installation
npm install @xrpl-wallet-kit/core @xrpl-wallet-kit/adapter-gemwallet xrpl@^4For the Client tab below, install @xrpl-wallet-kit/client instead. Enable the GemWallet extension for the dApp's origin.
Connect
import { createWalletKit } from "@xrpl-wallet-kit/client";
const kit = createWalletKit({ network: "mainnet", wallets: ["gemwallet"] });
const { manager } = kit;
const { account } = await kit.connect("gemwallet");import { WalletManager } from "@xrpl-wallet-kit/core";
import { createGemWalletAdapter } from "@xrpl-wallet-kit/adapter-gemwallet";
const manager = new WalletManager({
network: "mainnet",
adapters: [createGemWalletAdapter()],
});
const { account } = await manager.connect("gemwallet");Start connection from a user action and approve access in the extension.
Networks
Supports XRPL and Xahau; select the matching chain and network in GemWallet. For Xahau, the full client accepts network: "xahau-mainnet" or "xahau-testnet" with a positive preflight.maxFeeDrops. Core/selective integrations must configure the protocol and chain filter explicitly. See Xahau Configuration.
Capabilities
This table describes manager-level operations on XRPL. Xahau signing uses the chain-aware protocol path.
| Operation | Support |
|---|---|
| Connect | Yes |
| Disconnect | Local Kit cleanup; no provider-level disconnect |
| Session restore | Yes, with matching passive XRPL account; reconnect on Xahau |
signTransaction() | Yes, if the provider exposes signTransaction |
signAndSubmit() | Yes |
signMessage() | Yes; signature proof |
signIn() | Not exposed |
switchNetwork() | Not exposed; select in GemWallet and reconnect |
| Payment / NFT transactions | Yes, through txJson |
| QR / deep link | No |
Options
These options apply to createGemWalletAdapter(). For custom adapter options with the client, pass a configured adapter through adapters.
| Option | Type | Default | Description |
|---|---|---|---|
provider | GemWalletProvider | Detected provider | Supply a specific extension provider |
supportedChains | WalletChainFilter | XRPL integration | Restrict chains in a protocol-aware integration |
xrplMaxFeeDrops | string | "1000000" | Fee ceiling for XRPL sign-only; a request ceiling can lower it |
maxLastLedgerSequenceExtension | number | 50 | Allowed expiry extension in the external-protocol path |
Transactions
These XRPL examples use manager and account from either Connect tab. Run each request separately from a user action. Replace recipient addresses and 64-character NFT/offer IDs before signing. Amounts are in drops: "1000000" is 1 XRP. Include DestinationTag when the recipient requires it.
maxFeeDrops is an application-selected ceiling, not the expected fee. Adjust the example limit for your application.
A returned hash or submitted status is not validated ledger confirmation. Check the transaction result before treating a payment or NFT transfer as complete. See WalletManager Events.
Payment
const result = await manager.signAndSubmit({
txJson: {
TransactionType: "Payment",
Account: account.address,
Destination: "<recipient_address>",
Amount: "1000000",
},
maxFeeDrops: "50000",
});
console.log(result.hash);const result = await manager.signTransaction({
txJson: {
TransactionType: "Payment",
Account: account.address,
Destination: "<recipient_address>",
Amount: "1000000",
},
maxFeeDrops: "50000",
});
console.log(result.txBlob); // Signed, not broadcastOn XRPL, submission maps Payment to sendPayment() and TrustSet to setTrustline(), including camelCase field conversion. NFT offers map to their provider methods; other transactions use generic signing. Set methodHint only when you need to override detection. On Xahau, Kit prepares and verifies the generic signed transaction before RPC submission.
NFT Transactions
Each tab signs and submits one transaction. Wallet display and supported transaction types depend on the wallet/provider; generic signing is not a promise of support for every amendment.
await manager.signAndSubmit({
txJson: {
TransactionType: "NFTokenMint",
Account: account.address,
NFTokenTaxon: 0,
Flags: 8, // tfTransferable
},
maxFeeDrops: "50000",
});await manager.signAndSubmit({
txJson: {
TransactionType: "NFTokenCreateOffer",
Account: account.address,
NFTokenID: "<nft_id>",
Amount: "1000000",
Flags: 1, // tfSellNFToken
},
maxFeeDrops: "50000",
});await manager.signAndSubmit({
txJson: {
TransactionType: "NFTokenAcceptOffer",
Account: account.address, // Buyer's account
NFTokenSellOffer: "<sell_offer_id>",
},
maxFeeDrops: "50000",
});await manager.signAndSubmit({
txJson: {
TransactionType: "NFTokenCancelOffer",
Account: account.address, // Offer creator's account
NFTokenOffers: ["<offer_id>"],
},
maxFeeDrops: "50000",
});await manager.signAndSubmit({
txJson: {
TransactionType: "NFTokenBurn",
Account: account.address,
NFTokenID: "<nft_id>",
},
maxFeeDrops: "50000",
});Burning permanently destroys the NFT. For buy offers, brokered acceptance and additional fields, see NFT Marketplace. Xahau uses different transaction examples; see the Xahau guide.
For sign-only NFT requests, pass the same txJson to manager.signTransaction() if manager.can("signTransaction") is true.
Authentication
const proof = await manager.signMessage({ message: "Verify wallet ownership" });
console.log(proof.signatureKind); // "signature"
console.log(proof.signature, proof.publicKey);GemWallet returns a compact message signature. Use a server-issued challenge and backend verification for login; see Message Authentication. Native signIn() is not exposed.
Sessions and Disconnect
manager.autoReconnect() checks that GemWallet still reports the stored XRPL account before restoring it. Xahau requires an explicit reconnect after reload.
manager.disconnect() clears Kit's session. It does not revoke the extension's site permissions.
Integration Notes
- Availability and the Installed badge do not mean the wallet is connected. Allow time for extension injection and grant site access.
- Sign-only requires a provider version with
signTransaction; checkmanager.can("signTransaction")when supplying a custom provider. - Xahau fees require a positive request or global ceiling; do not treat the XRPL adapter ceiling as a Xahau fee policy.
Troubleshooting
| Symptom | Action |
|---|---|
| Extension or Installed badge is missing | Enable GemWallet for this site and let detection refresh |
| Network mismatch | Select the requested chain/network in the extension and reconnect |
| Sign-only is unavailable | Update the extension or check your custom provider's methods |
| Wrong specialized transaction method | Use standard txJson, or specify an appropriate methodHint |