curl --request POST \
--url https://api.lamarge.trade/v1/escrow/close \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"venue": "<string>",
"order_id": "<string>",
"dex": 123,
"nonce": "<string>",
"deadline": 123,
"signature": "<string>",
"to_margin": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
venue: '<string>',
order_id: '<string>',
dex: 123,
nonce: '<string>',
deadline: 123,
signature: '<string>',
to_margin: true
})
};
fetch('https://api.lamarge.trade/v1/escrow/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/escrow/close"
payload = {
"venue": "<string>",
"order_id": "<string>",
"dex": 123,
"nonce": "<string>",
"deadline": 123,
"signature": "<string>",
"to_margin": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"venue": "<string>",
"order_id": "<string>",
"owner": "<string>",
"available": "<string>",
"operator": "<string>",
"managed": true,
"closing": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}Close by signature
The prepared terms with the linked address’s signature. LaMarge relays closeOfferBySig and pays gas; funds go to your margin, or stay in your available escrow balance when the venue refuses the deposit. closing stays true until the transaction is final or a minute past its deadline; after a revert, close again with a new signature. At most 10 pending closes per owner and chain. A retry with the same terms returns the same close.
curl --request POST \
--url https://api.lamarge.trade/v1/escrow/close \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"venue": "<string>",
"order_id": "<string>",
"dex": 123,
"nonce": "<string>",
"deadline": 123,
"signature": "<string>",
"to_margin": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
venue: '<string>',
order_id: '<string>',
dex: 123,
nonce: '<string>',
deadline: 123,
signature: '<string>',
to_margin: true
})
};
fetch('https://api.lamarge.trade/v1/escrow/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/escrow/close"
payload = {
"venue": "<string>",
"order_id": "<string>",
"dex": 123,
"nonce": "<string>",
"deadline": 123,
"signature": "<string>",
"to_margin": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"venue": "<string>",
"order_id": "<string>",
"owner": "<string>",
"available": "<string>",
"operator": "<string>",
"managed": true,
"closing": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}Authorizations
Master session from POST /v1/auth/verify. Revocable; expires after seven days by default. Required for financial operations.
Body
A venue id from GET /v1/venues.
^0x[0-9a-fA-F]{64}$A 65-byte signature r ‖ s ‖ v, v 0, 1, 27 or 28, s low (EIP-2).
^0x[0-9a-fA-F]{130}$False withdraws to the owner wallet.
Response
The order as GET /v1/escrow shows it.
An order a linked address owns in an escrow, with its unlocked funds.
A venue id from GET /v1/venues.
Zero is the owner's available balance; other ids are funded orders.
^0x[0-9a-fA-F]{64}$Linked address owning it in the escrow.
^0x[0-9a-fA-F]{40}$Unlocked; what a close releases.
^[0-9]{1,78}$Operator named at funding.
^0x[0-9a-fA-F]{40}$This LaMarge operates it; close it with POST /v1/closes.
A close by signature is pending.