Submit offchain withdraw request

流量控制: 5 每 秒

摘要


HTTP 方法

POST

访问路径

/api/v3/user/withdrawals

功能

Submit offchain withdraw request

API 描述


HTTP头

字段 类型 必须 说明 举例
X-API-KEY string ApiKey "HlkcGxbqBeaF76j4rvPaOasyfPwnkQ
6B6DQ6THZWbvrAGxzEdulXQvOKLrRW
ZLnN"
X-API-SIG string ECDSA 签名信息 "0xccf0a141fce2dc5cbbd4f802c52220e9
e2ce260e86704d6258603eb346eefe2d
4a450005c362b223b28402d087f7065e
a5eee0314531adf6a580fce64c25dca81c02"

请求参数

字段 类型 必须 说明 举例
exchange string exchange address "1"
accountId integer account ID 1003
owner string account owner address "0xbbbbca6a90
1c926f240b89
eacb641d8aec
7aeafd"
token Token
VolumeV3
token to be withdrawal "{tokenId: 0, volume: 1000000}"
maxFee Token
VolumeV3
maximum fee of withdrawal "{tokenId: 0, volume: 1000000}"
storageId integer offchain ID 1
validUntil integer Timestamp for order to become invalid 1519217383
minGas integer min gas for on-chain withdraw, Loopring exchange allocates gas for each distribution, but people can also assign this min gas, so Loopring have to allocate higher gas value for this specific distribution, 0 means let loopring choose the reasonable gas 1519217383
to string withdraw to address "0x12345678"
extraData string extra data for complex withdraw mode, normally none "0xABCD1234"
fastWithdrawalMode boolean is fast withdraw mode "false"
counterFactualInfo Counter
Factual
Info
Counter factual wallet extra info to verify L1 ecdsa signature. "{walletFacto
ry: 0xABCD, walletOwner: 0xABCD, walletSalt: 1234}"
eddsaSignature string eddsa signature "0xccf0a141fc
e2dc5cbbd4f8
02c52220e9e2
ce260e86704d
6258603eb346
eefe2d4a4500
05c362b223b2
8402d087f706
5ea5eee03145
31adf6a580fc
e64c25dca81c
02"
ecdsaSignature string ecdsa signature "0xeb14773e8a
07d19bc4fe56
e36d041dcb00
2652f7e92160
deaf5e6bf21e
05c7a9eb1477
3e8a07d19bc4
fe56e36d041d
cb002652f7e9
2160deaf5e6b
f21e05c7a9eb
14773e8a07d1
9bc4fe56e36d
041dcb002652
f7e92160deaf
5e6bf21e05c7
a9"
hashApproved string An approved hash string which was already submitted on eth mainnet "0xf7c9323511
86c3a9053f31
3eefa16209c0
18f7f1dba8aa
8ca7100400f7
c31085"

请求示例

HTTP
CURL
POST https://api3.loopring.io/api/v3/user/withdrawals HTTP/1.1
Host: api3.loopring.io
Connection: keep-alive
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: zh,en;q=0.9
X-API-KEY: sra1aavfa
X-API-SIG: dkkfinfasdf
Content-Type: application/json

{
  "exchange" : "1",
  "accountId" : 1003,
  "owner" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
  "token" : {
    "tokenId" : 0,
    "volume" : "1000000000000"
  },
  "maxFee" : {
    "tokenId" : 0,
    "volume" : "1000000000000"
  },
  "storageId" : 1,
  "validUntil" : 1519217383,
  "minGas" : 1519217383,
  "to" : "0x12345678",
  "extraData" : "0xABCD1234",
  "fastWithdrawalMode" : false,
  "counterFactualInfo" : {
    "walletFactory" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
    "walletOwner" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
    "walletSalt" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd"
  },
  "eddsaSignature" : "0xccf0a141fce2dc5cbbd4f802c52220e9e2ce260e86704d6258603eb346eefe2d4a450005c362b223b28402d087f7065ea5eee0314531adf6a580fce64c25dca81c02",
  "ecdsaSignature" : "0xeb14773e8a07d19bc4fe56e36d041dcb002652f7e92160deaf5e6bf21e05c7a9eb14773e8a07d19bc4fe56e36d041dcb002652f7e92160deaf5e6bf21e05c7a9eb14773e8a07d19bc4fe56e36d041dcb002652f7e92160deaf5e6bf21e05c7a9",
  "hashApproved" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085"
}
curl -X POST -H "X-API-KEY:sra1aavfa" -H "X-API-SIG:dkkfinfasdf" -H "Content-Type:application/json" https://api3.loopring.io/api/v3/user/withdrawals -d \
'{
  "exchange" : "1",
  "accountId" : 1003,
  "owner" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
  "token" : {
    "tokenId" : 0,
    "volume" : "1000000000000"
  },
  "maxFee" : {
    "tokenId" : 0,
    "volume" : "1000000000000"
  },
  "storageId" : 1,
  "validUntil" : 1519217383,
  "minGas" : 1519217383,
  "to" : "0x12345678",
  "extraData" : "0xABCD1234",
  "fastWithdrawalMode" : false,
  "counterFactualInfo" : {
    "walletFactory" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
    "walletOwner" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
    "walletSalt" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd"
  },
  "eddsaSignature" : "0xccf0a141fce2dc5cbbd4f802c52220e9e2ce260e86704d6258603eb346eefe2d4a450005c362b223b28402d087f7065ea5eee0314531adf6a580fce64c25dca81c02",
  "ecdsaSignature" : "0xeb14773e8a07d19bc4fe56e36d041dcb002652f7e92160deaf5e6bf21e05c7a9eb14773e8a07d19bc4fe56e36d041dcb002652f7e92160deaf5e6bf21e05c7a9eb14773e8a07d19bc4fe56e36d041dcb002652f7e92160deaf5e6bf21e05c7a9",
  "hashApproved" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085"
}'

响应字段

字段 类型 必须 说明 举例
hash string The order hash identifier set by the user at the time of submission "0x1d923ca783
4dc90484fa2e
b611f0f0bc7e
741bb107007e
bea19ba8caea
b4f9d3"
status string Whether the order was successfully submitted or not, please note, user may query after a while to get real process status, as most offchain requests are async processed
取值范围 : ['received', 'processing', 'processed', 'failed']
"received"
isIdempotent boolean Idempotent of submit order response, submit same order again when order was UNKNOWN or WAIT_FREEZE_BALANCE in relayer, idempotent will be true
取值范围 : [True, False]
"true"

响应示例

{
  "hash" : "0x1d923ca7834dc90484fa2eb611f0f0bc7e741bb107007ebea19ba8caeab4f9d3",
  "status" : "received",
  "isIdempotent" : true
}

状态码

状态码 描述
100000 Unknown error
100001 Invalid argument
102001 Exchange ID is incorrect
102021 Nonce is invalid
102022 Transfer sender is invalid
102023 Transfer receiver is invalid
102024 Fee token is unsupported
102025 Transfer token isnt consistent with fee token

模型


TokenVolumeV3

Wrapper object used to describe a token associated with a certain quantity.

字段 类型 必须 说明 举例
tokenId integer The Loopring's token identifier. 0
volume string The volume of the token "100000000000
0"

CounterFactualInfo

字段 类型 必须 说明 举例
walletFactory string Counter factual wallet factory contract address "0xbbbbca6a90
1c926f240b89
eacb641d8aec
7aeafd"
walletOwner string Counter factual wallet owner address, NOT the wallet address "0xbbbbca6a90
1c926f240b89
eacb641d8aec
7aeafd"
walletSalt string Salt to generate address from owner & other related info "0xbbbbca6a90
1c926f240b89
eacb641d8aec
7aeafd"

results matching ""

    No results matching ""