Mint a NFT token in Loopring L2
流量控制: 5 每 秒
摘要
HTTP 方法
POST
访问路径
/api/v3/nft/mint
功能
Mint a NFT token in Loopring L2
API 描述
HTTP头
字段 | 类型 | 必须 | 说明 | 举例 |
---|---|---|---|---|
X-API-KEY | string | 是 | ApiKey | "HlkcGxbqBeaF76j4rvPaOasyfPwnkQ 6B6DQ6THZWbvrAGxzEdulXQvOKLrRW ZLnN" |
请求参数
字段 | 类型 | 必须 | 说明 | 举例 |
---|---|---|---|---|
exchange | string | 是 | field.SubmitNftMintRequest.exchange | "1" |
minterId | integer | 是 | minters accountId | 1 |
minterAddress | string | 是 | minters address | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
toAccountId | integer | 是 | =The account receive the minted NFT token, now should be minter himself. | 1 |
toAddress | string | 否 | field.SubmitNftMintRequest.toAddress | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
nftType | integer | 是 | nftType: 0 for EIP1155, 1 for EIP712. EIP1155 by default. | "0:ERC1155,1: ERC721" |
tokenAddress | string | 是 | field.SubmitNftMintRequest.tokenAddress | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
nftId | string | 是 | NFT_ID | "0xf7c9323511 86c3a9053f31 3eefa16209c0 18f7f1dba8aa 8ca7100400f7 c31085" |
amount | string | 是 | how many tokens to be mint. | "1" |
creatorFeeBips | integer | 是 | fee to the creator of each NFT transaction. | 0 |
validUntil | integer | 是 | field.SubmitNftMintRequest.validUntil | 1567053142 |
storageId | integer | 是 | field.SubmitNftMintRequest.storageId | 1 |
maxFee | Token Amount Info |
是 | field.SubmitNftMintRequest.tokenB | "TokenAmount{ tokenId: 0, amount: 1234}" |
eddsaSignature | string | 否 | field.SubmitNftMintRequest.eddsaSignature | "0xccf0a141fc e2dc5cbbd4f8 02c52220e9e2 ce260e86704d 6258603eb346 eefe2d4a4500 05c362b223b2 8402d087f706 5ea5eee03145 31adf6a580fc e64c25dca81c 02" |
ecdsaSignature | string | 否 | field.SubmitNftMintRequest.ecdsaSignature | "0xeb14773e8a 07d19bc4fe56 e36d041dcb00 2652f7e92160 deaf5e6bf21e 05c7a9eb1477 3e8a07d19bc4 fe56e36d041d cb002652f7e9 2160deaf5e6b f21e05c7a9eb 14773e8a07d1 9bc4fe56e36d 041dcb002652 f7e92160deaf 5e6bf21e05c7 a9" |
hashApproved | string | 否 | field.SubmitNftMintRequest.hashApproved | "0xf7c9323511 86c3a9053f31 3eefa16209c0 18f7f1dba8aa 8ca7100400f7 c31085" |
forceToMint | boolean | 否 | force to mint, regardless the previous mint record | "false" |
counterFactualNftInfo | Counter Factual NftInfo |
否 | field.SubmitNftMintRequest.counterFactualNftInfo | "{nftFactory: 0xABCD, nftOwner: 0xABCD, nftBaseUri: }" |
royaltyAddress | string | 否 | field.CounterFactualNftInfo.royaltyAddress | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
请求示例
HTTP
CURL
POST https://api3.loopring.io/api/v3/nft/mint 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
Content-Type: application/json
{
"exchange" : "1",
"minterId" : 1,
"minterAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"toAccountId" : 1,
"toAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"nftType" : 0:ERC1155,1:ERC721,
"tokenAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"nftId" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
"amount" : "1",
"creatorFeeBips" : 0,
"validUntil" : 1567053142,
"storageId" : 1,
"maxFee" : {
"tokenId" : 0,
"amount" : "1"
},
"eddsaSignature" : "0xccf0a141fce2dc5cbbd4f802c52220e9e2ce260e86704d6258603eb346eefe2d4a450005c362b223b28402d087f7065ea5eee0314531adf6a580fce64c25dca81c02",
"ecdsaSignature" : "0xeb14773e8a07d19bc4fe56e36d041dcb002652f7e92160deaf5e6bf21e05c7a9eb14773e8a07d19bc4fe56e36d041dcb002652f7e92160deaf5e6bf21e05c7a9eb14773e8a07d19bc4fe56e36d041dcb002652f7e92160deaf5e6bf21e05c7a9",
"hashApproved" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
"forceToMint" : false,
"counterFactualNftInfo" : {
"nftFactory" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"nftOwner" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"nftBaseUri" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd"
},
"royaltyAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd"
}
curl -X POST -H "X-API-KEY:sra1aavfa" -H "Content-Type:application/json" https://api3.loopring.io/api/v3/nft/mint -d \
'{
"exchange" : "1",
"minterId" : 1,
"minterAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"toAccountId" : 1,
"toAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"nftType" : 0:ERC1155,1:ERC721,
"tokenAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"nftId" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
"amount" : "1",
"creatorFeeBips" : 0,
"validUntil" : 1567053142,
"storageId" : 1,
"maxFee" : {
"tokenId" : 0,
"amount" : "1"
},
"eddsaSignature" : "0xccf0a141fce2dc5cbbd4f802c52220e9e2ce260e86704d6258603eb346eefe2d4a450005c362b223b28402d087f7065ea5eee0314531adf6a580fce64c25dca81c02",
"ecdsaSignature" : "0xeb14773e8a07d19bc4fe56e36d041dcb002652f7e92160deaf5e6bf21e05c7a9eb14773e8a07d19bc4fe56e36d041dcb002652f7e92160deaf5e6bf21e05c7a9eb14773e8a07d19bc4fe56e36d041dcb002652f7e92160deaf5e6bf21e05c7a9",
"hashApproved" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
"forceToMint" : false,
"counterFactualNftInfo" : {
"nftFactory" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"nftOwner" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"nftBaseUri" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd"
},
"royaltyAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd"
}'
响应字段
字段 | 类型 | 必须 | 说明 | 举例 |
---|---|---|---|---|
hash | string | 是 | Mint request hash. | "133754509012 921794171549 748495717930 699115173547 203971250276 332426804700 75859" |
nftTokenId | integer | 是 | field.SubmitMintNftResponseItem.nftTokenId | 32768 |
nftData | string | 是 | Mint tokens nftData. | "0xf7c9323511 86c3a9053f31 3eefa16209c0 18f7f1dba8aa 8ca7100400f7 c31085" |
status | string | 是 | Mint status. 取值范围 : ['processing', 'processed', 'cancelling', 'cancelled', 'expired', 'failed'] |
"cancelled" |
isIdempotent | boolean | 是 | Idempotent of submit order response. True if the same request is sent more than once. 取值范围 : [True, False] |
"false" |
响应示例
{
"hash" : "13375450901292179417154974849571793069911517354720397125027633242680470075859",
"nftTokenId" : 32768,
"nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
"status" : "cancelled",
"isIdempotent" : false
}
状态码
状态码 | 描述 |
---|---|
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 |
108003 | code.108003 |
模型
TokenAmountInfo
Wrapper object used to describe a token associated with a certain quantity.
字段 | 类型 | 必须 | 说明 | 举例 |
---|---|---|---|---|
tokenId | integer | 是 | The Loopring's NFT token identifier. | 0 |
amount | string | 是 | The amount of the NFT token | "1" |
CounterFactualNftInfo
字段 | 类型 | 必须 | 说明 | 举例 |
---|---|---|---|---|
nftFactory | string | 是 | field.CounterFactualNftInfo.nftFactory | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
nftOwner | string | 是 | field.CounterFactualNftInfo.nftOwner | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
nftBaseUri | string | 否 | field.CounterFactualNftInfo.nftBaseUri | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |