Withdrawals
Withdraw on-chain
POST
/account/withdraw/on-chainPrivateRequest 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
application/json- body
amount*integerAmount to withdraw
Range
0 < valueaddress*stringAddress to withdraw to
OK
application/json- response
id*stringUnique 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)$Format
uuidamount*integerAmount to withdraw
address*stringAddress to withdraw to
Length
length <= 128status*stringStatus of the withdrawal
createdAt*stringTimestamp when the withdrawal was created
Format
date-timeimport { 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"}