Skip to content

GemWallet Adapter ​

GemWallet connects through its browser extension API. No API key or WalletConnect project ID is required.

IntegrationValue
Package@xrpl-wallet-kit/adapter-gemwallet
Adapter IDgemwallet
Wallet typeBrowser extension
Client registrationIncluded in default wallet lists

Installation ​

sh
npm install @xrpl-wallet-kit/core @xrpl-wallet-kit/adapter-gemwallet xrpl@^4

For the Client tab below, install @xrpl-wallet-kit/client instead. Enable the GemWallet extension for the dApp's origin.

Connect ​

ts
import { createWalletKit } from "@xrpl-wallet-kit/client";

const kit = createWalletKit({ network: "mainnet", wallets: ["gemwallet"] });
const { manager } = kit;
const { account } = await kit.connect("gemwallet");
ts
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.

OperationSupport
ConnectYes
DisconnectLocal Kit cleanup; no provider-level disconnect
Session restoreYes, 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 transactionsYes, through txJson
QR / deep linkNo

Options ​

These options apply to createGemWalletAdapter(). For custom adapter options with the client, pass a configured adapter through adapters.

OptionTypeDefaultDescription
providerGemWalletProviderDetected providerSupply a specific extension provider
supportedChainsWalletChainFilterXRPL integrationRestrict chains in a protocol-aware integration
xrplMaxFeeDropsstring"1000000"Fee ceiling for XRPL sign-only; a request ceiling can lower it
maxLastLedgerSequenceExtensionnumber50Allowed 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 ​

ts
const result = await manager.signAndSubmit({
  txJson: {
    TransactionType: "Payment",
    Account: account.address,
    Destination: "<recipient_address>",
    Amount: "1000000",
  },
  maxFeeDrops: "50000",
});
console.log(result.hash);
ts
const result = await manager.signTransaction({
  txJson: {
    TransactionType: "Payment",
    Account: account.address,
    Destination: "<recipient_address>",
    Amount: "1000000",
  },
  maxFeeDrops: "50000",
});
console.log(result.txBlob); // Signed, not broadcast

On 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.

ts
await manager.signAndSubmit({
  txJson: {
    TransactionType: "NFTokenMint",
    Account: account.address,
    NFTokenTaxon: 0,
    Flags: 8, // tfTransferable
  },
  maxFeeDrops: "50000",
});
ts
await manager.signAndSubmit({
  txJson: {
    TransactionType: "NFTokenCreateOffer",
    Account: account.address,
    NFTokenID: "<nft_id>",
    Amount: "1000000",
    Flags: 1, // tfSellNFToken
  },
  maxFeeDrops: "50000",
});
ts
await manager.signAndSubmit({
  txJson: {
    TransactionType: "NFTokenAcceptOffer",
    Account: account.address, // Buyer's account
    NFTokenSellOffer: "<sell_offer_id>",
  },
  maxFeeDrops: "50000",
});
ts
await manager.signAndSubmit({
  txJson: {
    TransactionType: "NFTokenCancelOffer",
    Account: account.address, // Offer creator's account
    NFTokenOffers: ["<offer_id>"],
  },
  maxFeeDrops: "50000",
});
ts
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 ​

ts
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; check manager.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 ​

SymptomAction
Extension or Installed badge is missingEnable GemWallet for this site and let detection refresh
Network mismatchSelect the requested chain/network in the extension and reconnect
Sign-only is unavailableUpdate the extension or check your custom provider's methods
Wrong specialized transaction methodUse standard txJson, or specify an appropriate methodHint

Released under the MIT License.