Withdrawals

Withdraw on-chain

POST/account/withdraw/on-chainPrivate

Request a new on-chain withdrawal. The withdrawal request will be reviewed and processed asynchronously. Withdrawals at or above the Travel Rule threshold are rejected with a 403 TRAVEL_RULE_REQUIRED error and must be completed in the LN Markets app, where the required transfer information can be provided. Repeated below-threshold withdrawals in a short time period may also be rejected with a 403 SELF_HOSTED_EDD_REQUIRED error if their sum is above the threshold; complete these in the LN Markets app as well.

Permissions: account:withdrawals:write

Request Body

application/json
  1. body
amount*integer

Amount to withdraw

Range0 < value
address*string

Address to withdraw to

Response Body

OK

application/json
  1. response
id*string

Unique identifier for the withdrawal

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
amount*integer

Amount to withdraw

address*string

Address to withdraw to

Lengthlength <= 128
status*string

Status of the withdrawal

createdAt*string

Timestamp when the withdrawal was created

Formatdate-time
import { createHttpClient } from '@ln-markets/sdk/rest/v3'const client = createHttpClient({  key: 'your-key',  secret: 'your-secret',  passphrase: 'your-passphrase',})const result = await client.account.withdrawOnChain({  amount: 21000000,  address: 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh'})
{  "id": "f8cc0da3-127b-4583-9b56-e2cc074db218",  "amount": 21000000,  "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",  "status": "pending",  "createdAt": "2024-02-08T08:37:47.490Z"}