Withdraw on-chain
/account/withdraw/on-chainPrivateRequest an on-chain withdrawal of amount sats, between 10,000,000 (0.1 BTC) and 500,000,000 (5 BTC). The request is reviewed and processed asynchronously: it starts pending, track it with GET /account/withdrawals/on-chain. 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
0 < valueaddress*stringAddress to withdraw to
OK
application/json- response
id*stringUnique identifier for the withdrawal
^([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)$uuidamount*integerAmount to withdraw
address*stringAddress to withdraw to
length <= 128status*stringStatus of the withdrawal
createdAt*stringTimestamp when the withdrawal was created
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"
}