See the canonical spec:
.TypeScriptimport { Client, Wallet } from 'xrpl'; async function createEscrow(): Promise<void> { const client = new Client('wss://honeycluster.dev'); await client.connect(); const wallet = Wallet.fromSeed('s...'); const prepared = await client.autofill({ TransactionType: 'EscrowCreate', Account: wallet.address, Destination: 'r...dest', Amount: '1000000', FinishAfter: 725846400, }); const signed = wallet.sign(prepared); const res = await client.submitAndWait(signed.tx_blob); console.log(res); await client.disconnect(); } createEscrow().catch(console.error);
| Field | Type | Required | Description |
|---|---|---|---|
Account | String | Yes | The address of the account creating the escrow |
Destination | String | Yes | The address that can finish the escrow |
Amount | String | Yes | Amount of XRP to lock in the escrow (in drops) |
FinishAfter | Number | No | Time after which the escrow can be finished |
CancelAfter | Number | No | Time after which the escrow can be cancelled |
Condition | String | No | Hex-encoded condition for finishing the escrow |
DestinationTag | Number | No | Arbitrary tag to identify the reason for the escrow |
Time Fields:
FinishAfter: Unix timestamp in seconds
CancelAfter: Unix timestamp in seconds
At least one of FinishAfter, CancelAfter, or Condition must be specified
Amount:
Must be specified in drops (1 XRP = 1,000,000 drops)
Example: "1000000" = 1 XRP
Condition:
Hex-encoded fulfillment for conditional escrow
If specified, escrow can only be finished with matching fulfillment
Creates a time-locked escrow of XRP
Amount specifies the XRP to be locked
FinishAfter and CancelAfter set time-based conditions
Destination receives the escrow when conditions are met
Always use autofill to set fees and sequence safely when using the XRPL client library