Venly API
Search…
Update offer: TxApprove
Endpoint to pass the transaction hash of the Approve transaction
In order for the market to take an NFT into custody, the market requires the end user to execute a contract call, allowing the market to move the NFT. Since the market doesn't know the end-users of the client, it is up to the client to ask the user to perform the Approve transaction. Once the user has launched the Approve transaction the client sends the transaction hash of that transaction back to the market for validation.
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.
patch
https://api.arkane.market
/offers/:offerId/txapprove
Update offer: TxApprove
Note that in order to move an offer from state NEW to state READY, the offer will need a 2nd update, which is Update offer: Signature.
Note: The order is important. First the TxApprove, then the Signature.

TxApprove not always required

The Approve transaction is not always required, when a wallet has approved the market for a specific NFT contract in the past the wallet will not be required to approve the market a second time. More concrete if a user has approved the market to take an NFT of a certain NFT contract into custody he will not have to approve the market next time he wants to sell a different NFT of the same NFT contract.
In this case the Update offer: TxApprove step can be skipped and moved directly to Update offer: Signature.

How can you know if the Approve is required?

An easy way is to call the Get prepared Approve tx endpoint. When the result set is empty it means the Approve step can be skipped. If the result set contains data, then the Approve still needs to happen.

Example

Request

1
https://api.arkane.market/offers/b91c6f5f-5ebd-4941-99c1-94e9d1cbd9d5/txapprove
Copied!

Request Body

1
{
2
"txApprove": "0x7c7fe6ffa8100851e00676ebfea524dc6c666e017da67f07ac4f93e48d1329af"
3
}
Copied!

Response

1
{
2
"success": true,
3
"result": {
4
"id": "b91c6f5f-5ebd-4941-99c1-94e9d1cbd9d5",
5
"nft": {
6
"tokenId": "2",
7
"address": "0x492aef91afb79efaa508debbed7b3e21069d13e3",
8
"chain": "ETHEREUM",
9
"name": "Cauliflower Pizza",
10
"description": "Awesome cauliflower crust pizza with cured pepperoni. Found on a BBS in the early 80s.",
11
"imageUrl": "https://lh3.googleusercontent.com/0Dw7pMcyX_m7T_6q3zzrvjmYMg-Matgg8c42DTGvviRDI8M7fa3Ot9siVfhzE0gqolLshVp2O6T3QdccmVblMurg7A",
12
"url": "",
13
"imagePreviewUrl": "https://lh3.googleusercontent.com/0Dw7pMcyX_m7T_6q3zzrvjmYMg-Matgg8c42DTGvviRDI8M7fa3Ot9siVfhzE0gqolLshVp2O6T3QdccmVblMurg7A=s250",
14
"imageThumbnailUrl": "https://lh3.googleusercontent.com/0Dw7pMcyX_m7T_6q3zzrvjmYMg-Matgg8c42DTGvviRDI8M7fa3Ot9siVfhzE0gqolLshVp2O6T3QdccmVblMurg7A=s128",
15
"attributes": [
16
{
17
"traitType": "topping",
18
"value": "cheese",
19
"traitCount": 4
20
},
21
{
22
"traitType": "crust",
23
"value": "cauliflower",
24
"traitCount": 2
25
},
26
{
27
"traitType": "topping",
28
"value": "pepperoni",
29
"traitCount": 2
30
},
31
{
32
"traitType": "level",
33
"value": "7",
34
"traitCount": 1
35
},
36
{
37
"traitType": "fuel",
38
"value": "3.4",
39
"traitCount": 1
40
},
41
{
42
"traitType": "cauliflower_power",
43
"value": "80",
44
"displayType": "boost_number",
45
"traitCount": 1
46
},
47
{
48
"traitType": "bellyfat_increase",
49
"value": "3",
50
"displayType": "boost_percentage",
51
"traitCount": 1
52
}
53
],
54
"contract": {
55
"chain": "ETHEREUM",
56
"address": "0x492aef91afb79efaa508debbed7b3e21069d13e3",
57
"count": 0,
58
"name": "CryptoPizza Shop",
59
"description": "In honor of the dude who paid 10k BTC for two large pizzas in 2010, I'm proud to announce the first ever CryptoPizza Shop! Collect these slices - more to be added soon, but these OG CryptoPizza Slices will go down in history!",
60
"symbol": "OSC",
61
"imageUrl": "https://rinkeby-storage.opensea.io/0x492aef91afb79efaa508debbed7b3e21069d13e3-1561429292.png"
62
}
63
},
64
"sellerId": "7cbc2bd3-b3d7-4d8e-bda8-173e56189f75",
65
"sellerAddress": "0xdb7c22EA49EF93F753F2ed4c9E1A2589aC6E7690",
66
"startDate": "2020-10-21T14:46:09.252659Z",
67
"endDate": "2020-10-31T14:46:09.252674Z",
68
"type": "SALE",
69
"status": "NEW",
70
"dataToSign": "b91c6f5f-5ebd-4941-99c1-94e9d1cbd9d5_0xdb7c22EA49EF93F753F2ed4c9E1A2589aC6E7690_0xb06b3f1e824BD7eFC0BCe584cF6B772dC0Ff7C75_2",
71
"txApprove": "0xd5234cc910c382a4807d94b5af3be68f62ecac867bef9a61e984dfad08257a44",
72
"createdOn": "2020-10-21T14:46:09.305261Z",
73
"createdBy": "7cbc2bd3-b3d7-4d8e-bda8-173e56189f75",
74
"price": 25
75
}
76
}
Copied!
Last modified 4mo ago