This mutation is called to validate the NFT owner and to create the order for listing the NFT and create and return the message to sign via metamask for listing NFT.
Sample mutation
mutation createSignatureToListNFTForSale(
$orgId: UUID1!
$nftTokenId: UUID1!
$tokenType: TokenType!
$quantity: Int!
$nftOwnerAddress: String!
$fixedPrice: Float!
$paymentToken: String!
$currencyId: UUID1!
$paymentSettlementAddress: String
$currency: CurrencyCodeFiat
) {
createSignatureToListNFTForSale(
orgId: $orgId
nftTokenId: $nftTokenId
tokenType: $tokenType
quantity: $quantity
nftOwnerAddress: $nftOwnerAddress
fixedPrice: $fixedPrice
paymentToken: $paymentToken
currencyId: $currencyId
paymentSettlementAddress: $paymentSettlementAddress
currency: $currency
) {
messageToSign
order {
id
nftTokenId
tokenContract
tokenId
tokenType
quantity
nftOwnerAddress
fixedPrice
paymentToken
orderType
}
}
}
Sample variable
{
"orgId": "8fb128bd-f55d-4bcc-8b6c-0beb684e4d4e",
"nftTokenId": "a3f42a21-c47a-45ea-a115-e209bb51b56e",
"tokenType": "ERC721",
"quantity": 1,
"nftOwnerAddress": "0xa77915a574e1f9b88db152525ceBfEAA8c71bAa4",
"fixedPrice": "0.04",
"paymentToken": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
"currencyId": "c41db347-0ee3-4212-563a-ca213b8e0ea8"
}
Sample response
{
"data": {
"createSignatureToListNFTForSale": {
"messageToSign": "0x3edcc148e253c720337ba43cf4bb79211127326a953aebe79e024435a9906592",
"order": {
"id": "8e433465-fad7-409b-927d-121a5f2655fe",
"nftTokenId": "a3f42a21-c47a-45ea-a115-e209bb51b56e",
"tokenContract": "0xcef83635de6935cb85192090564b0a8e08594584",
"tokenId": "1",
"tokenType": "ERC721",
"quantity": 1,
"nftOwnerAddress": "0xa77915a574e1f9b88db152525ceBfEAA8c71bAa4",
"fixedPrice": 0.04,
"paymentToken": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
"orderType": "LISTING"
}
}
}
}
Arguments
Name | Type | Description | Required |
---|---|---|---|
orgId | UUID | Organization id. | Yes |
nftTokenId | UUID | Nft token id. | Yes |
tokenType | Enum | Token type ERC1155 or ERC721 . | Yes |
quantity | Integer | Quantity of NFT. | Yes |
nftOwnerAddress | String | Owner of the NFT. | Yes |
fixedPrice | Float | Listing amount | Yes |
paymentToken | String | Currency contract Address. | Yes |
currencyId | UUID | Currency id like ETH or WETH | Yes |
paymentSettlementAddress | String | Payment settlement address of the sale | No |
currency | Enum | Fiat currency code | No |
Fields
Name | Type | Description |
---|---|---|
messageToSign | String | Hash for sign in metamask |
order | Object | Contains all the information from Order such as the nft token id, token contract,fixed price, buyer address and etc. |
isSigningRequired | Boolean | It indicates that the wallet is external. |
gatedCollection | String | If the NFT is under token gating, the gated collection will return. |
Example
create signature for list. this is not for all users token owner only need to call this api.