Xyra Developer Docs
Integrate via standard browser APIs — no SDK required
Stable URL
/developers

Sign flow

Xyra supports signing any valid XRPL/Xahau transaction type. By default, transactions are sign-only. You can optionally request sign + submit by setting submit: true. Xyra will clearly display whether a transaction will be submitted or not.

Sign Only (Default)

Transactions are signed but not submitted. You receive a signed transaction blob that you can submit later using your own RPC endpoint.

// Sign only (default behavior)
const tx = {
  TransactionType: 'Payment',
  Account: address,
  Destination: 'rDESTINATION...',
  Amount: '1000000',
  Fee: '12',
  Sequence: accountSequence,
  LastLedgerSequence: currentLedger + 20
};

const encodedTx = btoa(JSON.stringify(tx));

const popup = window.open(
  `https://wallet.xyra.now/sign?session=${sessionId}&tx=${encodedTx}&network=xrpl-testnet`,
  'xyra_approval',
  'width=420,height=640'
);

popup.postMessage(
  {
    type: 'SIGN',
    sessionId,
    network: 'xrpl-testnet',
    tx: encodedTx
    // submit is optional, defaults to false
  },
  'https://wallet.xyra.now'
);

window.addEventListener('message', (event) => {
  if (event.origin !== 'https://wallet.xyra.now') return;

  if (event.data?.type === 'SIGN_RESPONSE') {
    console.log('Signed TX:', event.data.tx_blob);
    console.log('Hash:', event.data.hash);
    console.log('Submitted:', event.data.submitted); // false
    // You can submit later using your own RPC endpoint
  }
});
Sign & Submit (Opt-in)

Warning: When submit: true is set, Xyra will submit the transaction immediately after signing. Network fees will be spent and the action is irreversible. The approval UI will clearly warn users about this.

// Sign and submit (requires explicit opt-in)
const tx = {
  TransactionType: 'Payment',
  Account: address,
  Destination: 'rDESTINATION...',
  Amount: '1000000',
  Fee: '12',
  Sequence: accountSequence,
  LastLedgerSequence: currentLedger + 20
};

const encodedTx = btoa(JSON.stringify(tx));

const popup = window.open(
  `https://wallet.xyra.now/sign?session=${sessionId}&tx=${encodedTx}&network=xrpl-testnet`,
  'xyra_approval',
  'width=420,height=640'
);

popup.postMessage(
  {
    type: 'SIGN',
    sessionId,
    network: 'xrpl-testnet',
    tx: encodedTx,
    submit: true // Explicitly request submission
  },
  'https://wallet.xyra.now'
);

window.addEventListener('message', (event) => {
  if (event.origin !== 'https://wallet.xyra.now') return;

  if (event.data?.type === 'SIGN_RESPONSE') {
    console.log('Signed TX:', event.data.tx_blob);
    console.log('Hash:', event.data.hash);
    console.log('Submitted:', event.data.submitted); // true
    
    if (event.data.submitted && event.data.submitResult) {
      console.log('Result:', event.data.submitResult.engine_result);
      console.log('Message:', event.data.submitResult.engine_result_message);
    }
  }
});
Notes
Always validate event.origin. The approval UI will always show the requesting domain to the user before they approve or reject.