Get Preparation Transaction & Signable Messages

How to get the preparations transactions and signable messages by offer ID.

This endpoint gets the preparations transactions and signable messages by offer ID. The result from this endpoint needs to be provided to the wallet to be executed.

Since there are multiple variants and standards of NFT contracts it can be difficult for a client to know for each NFT contract which function to call and which input parameter each function might need. To overcome that specific pain the market also provides an endpoint that returns that required information, allowing the client to easily query what they need to forward to their end-users.

Request Endpoint: reference

GET /offers/{id}/preparation/transactions
ParameterParam TypeDescriptionData TypeMandatory
{id}PathThe offer IDString
walletIdQueryThe wallet IDString

📘

When the end-user has executed the result of this call, that transaction hash should be providing back to the market by using Update offer: TxApprove.

Two types of Tx Approvals

The response returns either: approvalPreparationTransactions information OR signableMessages information (mutually exclusive).

  • approvalPreparationTransactions : this means you have to follow up with an execution of a contract call. See making a contract call.
    • With the transaction data, you can call the TxApprove step to continue the sales procedure.
  • signableMessages : this means you only need to sign a message to put the NFT on sale. See placing a signature.
    • With the signature data, you can call the metaTxApprove step to continue the sales procedure

📘

See How to put an item for sale? for the entire flow.

What if the result set is empty?

It is possible that in certain cases the call was successful, but that the result set is empty. This means that the wallet that stores the NFT, approved the market in the past for that specific NFT contract. Therefore the end-user is not required to perform the Approve transaction for a second time. In this case the Update offer: TxApprove step can be skipped and moved directly to Update offer: Signature.

{
    "success": true,
    "result": {} 
}

Example Request:

GET https://api.venly.market/offers/b91c6f5f-5ebd-4941-99c1-94e9d1cbd9d5/preparation/transactions

Response Body:

{
    "success": true,
    "result": [
        {
            "type": "CONTRACT_EXECUTION",
            "to": "0x563966a99550b1a7d1d917e2da28c6c59999f19f",
            "secretType": "MATIC",
            "value": 0,
            "functionName": "setApprovalForAll",
            "inputs": [
                {
                    "type": "address",
                    "value": "0xe885A1cD1b67bDC352A113AB2e6A5Fc6C924F888"
                },
                {
                    "type": "bool",
                    "value": "true"
                }
            ],
            "data": "0xa22cb465000000000000000000000000e885a1cd1b67bdc352a113ab2e6a5fc6c924f8880000000000000000000000000000000000000000000000000000000000000001"
        }
    ]
}