# xrpl_signTransaction

Sign, and by default submit, a single XRP Ledger transaction.

## Request

```ts
{
  tx_json: Transaction; // Account must be the session's account
  submit?: boolean;     // default true
  autofill?: boolean;   // see Methods
}
```

## Usage

```ts
const result = await provider.request(
  {
    method: 'xrpl_signTransaction',
    params: {
      tx_json: {
        TransactionType: 'Payment',
        Account: 'r…', // the session account
        Destination: 'r…',
        Amount: '1000000', // 1 XRP, in drops
      },
      submit: true,
    },
  },
  'xrpl:0', // xrpl:0, xrpl:1 or xrpl:2
);
```

When `submit` is true, Joey shows its full transaction review, then signs and submits. When `submit` is false, it shows a signing screen and returns the signature without submitting.

## Response

```ts
{ tx_json: { hash: string; /* …signed transaction fields */ } }
```

## With wc-client

```ts
import core from '@joey-wallet/wc-client/core';

const response = await core.methods.signTransaction({
  provider,
  chainId: chain,
  request: {
    tx_json: {
      TransactionType: 'AccountSet',
      Account: 'rUmoi1vt8apeKsqFYKMRSiMvWixFDMC8Jz',
    },
    options: { autofill: true, submit: true },
  },
});
```

## XLS-56 Batch

To sign a `Batch` transaction, send it as the `tx_json` of this method. Its inner transactions use the sequence numbers after the outer transaction, so don't combine it with other transactions.
