Request a sign-in message
curl --request POST \
--url https://api.lamarge.trade/v1/auth/challenge \
--header 'Content-Type: application/json' \
--data '
{
"address": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({address: '<string>'})
};
fetch('https://api.lamarge.trade/v1/auth/challenge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/auth/challenge"
payload = { "address": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"message": "<string>",
"nonce": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"typed_data": {
"types": {},
"primaryType": "<string>",
"domain": {
"name": "<string>",
"version": "<string>",
"chainId": 123,
"verifyingContract": "<string>"
},
"message": {}
}
}{
"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
}
}Authentication
Request a sign-in message
A one-use SIWE message for the master address, valid ten minutes. Check its domain, URI, address and expiry before personal_sign. Budget per address: burst 6, refill 6/minute; global: 60/s, burst 120.
POST
/
v1
/
auth
/
challenge
Request a sign-in message
curl --request POST \
--url https://api.lamarge.trade/v1/auth/challenge \
--header 'Content-Type: application/json' \
--data '
{
"address": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({address: '<string>'})
};
fetch('https://api.lamarge.trade/v1/auth/challenge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/auth/challenge"
payload = { "address": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"message": "<string>",
"nonce": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"typed_data": {
"types": {},
"primaryType": "<string>",
"domain": {
"name": "<string>",
"version": "<string>",
"chainId": 123,
"verifyingContract": "<string>"
},
"message": {}
}
}{
"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
}
}Body
application/json
The master address, any case.
Pattern:
^0x[0-9a-fA-F]{40}$Response
The message to sign.
Sign with personal_sign exactly as given. On Aster, the body of the agent approval, signed as typed_data instead.
RFC 3339 UTC; snapshots and history may keep fractional seconds.
Aster only: the agent approval as EIP-712 typed data, Message{msg} in Aster's AsterSignTransaction domain for chain 42161. Sign it with eth_signTypedData_v4 within seconds: Aster takes its nonce as fresh. It names LaMarge's agent for the account with every permission false, for 365 days.
Show child attributes
Show child attributes