The token owner can accept any offer made by a buyer. Once the offer is accepted, the token will be transferred to the offer maker.
.This process involves two APIs:
- getSignatureForOfferApproval: This API retrieves the offer details required for the token owner to approve the offer. It initiates the process of accepting the offer.
- acceptOffer: After the front end successfully processes the offer acceptance transaction, confirm the transaction by calling the
acceptOffer API
. This finalizes the acceptance and records the transactional activity.
Sample query/mutation
query ($orderId: UUID1!, $orgId: UUID1!, $creatorFee: Float) {
getSignatureForOfferApproval(
orderId: $orderId
orgId: $orgId
creatorFee: $creatorFee
) {
proofOfApproval
order {
id
nftTokenId
tokenId
tokenType
quantity
nftOwnerAddress
fixedPrice
price {
value
unit
type
__typename
}
buyerAddress
buyerTax
paymentToken
orderType
orderStatus
__typename
}
Network {
id
name
chainID
rpcURL
wethAddress
defaultCurrency
isTestnet
paymentCurrency
__typename
}
bubblegumParams {
buyer
seller
buyerTokenAccount
sellerTokenAccount
systemProgram
tokenProgram
bubblegumProgram
compressionProgram
treeAuthority
leafOwner
leafDelegate
newLeafDelegate
logWrapper
merkleTree
buyDiscriminator
marketplaceAddress
mintAccount
buyerVinTokenAccount
sellerVinTokenAccount
commissionVinTokenAccount
platformVinTokenAccount
initializeAccount
metadataId
listing
delegateAuthority
bubblegumArg {
amount
dataHash
creatorHash
nonce
index
root
proof
__typename
}
offer
offerEscrow
acceptOfferDiscriminator
__typename
}
__typename
}
}
mutation acceptOffer($orderId: UUID1!, $orgId: UUID1!, $transactionHash: String!, $paymentSettlementAddress: String, $currency: CurrencyCodeFiat) {
acceptOffer(
orderId: $orderId
orgId: $orgId
transactionHash: $transactionHash
paymentSettlementAddress: $paymentSettlementAddress
currency: $currency
) {
success
newNFTID
__typename
}
}
Sample variable
{
"orgId": "0db10bbf-85fe-4c87-911b-d18f8568fc07",
"orderId": "d04419b1-d41f-4e00-a24b-fca29d42b704"
}
{
"orgId": "0db10bbf-85fe-4c87-911b-d18f8568fc07",
"orderId": "d04419b1-d41f-4e00-a24b-fca29d42b704",
"transactionHash": "5KDPuBLd2fVF74uKyfPMEuN79ZfUNnns44k249nhtNUf2eioQnsshnV1vfKhVX2PKdwQ6icwokvQZri7oyhT1nA8"
}
Sample response
{
"data": {
"getSignatureForOfferApproval": {
"proofOfApproval": "6oJtSiod36gLtk5evwB6uhoBpxp5nemW73NQH5BVr6nS",
"order": {
"id": "d04419b1-d41f-4e00-a24b-fca29d42b704",
"nftTokenId": "021272bc-e41b-412f-8631-f63304a6d3a6",
"tokenId": "7dDe5D6N16tkuM53RKEuKJ7gZDiB7NC6oyQKP2AQJDSc",
"tokenType": "NonFungible",
"quantity": 1,
"nftOwnerAddress": "AhE1ubLPzT6vY1rWFoPko5DSC3rpQUhLMjdEiWV1mJGh",
"fixedPrice": 1,
"price": [],
"buyerAddress": "7GckBHDKCMEdFdnxJV3qY12YCEVop6MKtgjVAnd7vHGD",
"buyerTax": 0,
"paymentToken": "0x0000000000000000000000000000000000000000",
"orderType": "OFFER",
"orderStatus": "PENDING",
"__typename": "Order"
},
"Network": {
"id": "51987430-77d2-4633-99c3-100cdd9952c7",
"name": "Solana Devnet",
"chainID": 901,
"rpcURL": "https://solana-devnet.g.alchemy.com/v2/p_wXpC4yF_4fkupNob_zWnml_Wf962ZV",
"wethAddress": "",
"defaultCurrency": "VIN",
"isTestnet": true,
"paymentCurrency": "VIN",
"__typename": "Network"
},
"bubblegumParams": {
"buyer": "7GckBHDKCMEdFdnxJV3qY12YCEVop6MKtgjVAnd7vHGD",
"seller": "AhE1ubLPzT6vY1rWFoPko5DSC3rpQUhLMjdEiWV1mJGh",
"buyerTokenAccount": "D5RsufniFeb1zEygWM1SZ4kg2oxnFS8A67dvhjtWvToD",
"sellerTokenAccount": "HpmxiYp7pNS9bH9Bq5VpJDEw4P3hDu3WMg1VbwtHPnkB",
"systemProgram": "11111111111111111111111111111111",
"tokenProgram": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"bubblegumProgram": "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY",
"compressionProgram": "cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK",
"treeAuthority": "DnuWkN8zJAk2H5PwaYkEPRyQkVZb3LN7BtoLzXykRQf5",
"leafOwner": "AhE1ubLPzT6vY1rWFoPko5DSC3rpQUhLMjdEiWV1mJGh",
"leafDelegate": "",
"newLeafDelegate": "7GckBHDKCMEdFdnxJV3qY12YCEVop6MKtgjVAnd7vHGD",
"logWrapper": "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV",
"merkleTree": "4iCY74wJcHPfskyoJaYh788Y8nPKY78DagE7Z2X1er2y",
"buyDiscriminator": [],
"marketplaceAddress": "4aRpxWDMLu9ZfYYFYPng2PnyUancWcZipkFhVHRxLREY",
"mintAccount": "FytWTAobotGfihugTU8TEQzEgjfrttUVNWcRHv1GG2G3",
"buyerVinTokenAccount": "7wrTJoBe5SVtpohw6cHr3YV9hLYWtTZAhETtv2oRtHXf",
"sellerVinTokenAccount": "EaXKtgnKwXvxfeiMR1eCq21EWUzc9NLkY9t8oCUNGxpV",
"commissionVinTokenAccount": "H5cQLHmLcvexAtUT2Lb6dnPc5dKgtZye31tkUmeUp54J",
"platformVinTokenAccount": "E63JtPtbmRCjNx8mA73xHJZ6gX5CeEuFDsJGykyNSYqb",
"initializeAccount": "6wFGPaANJuXeWHSEjGhtMhKQftQaTTvhxZxBrUhgn9pF",
"metadataId": "Zv2vv8roKtLuqQTFT14NpbhhjWVmu3qhqgiwaG8RrpF",
"listing": "",
"delegateAuthority": null,
"bubblegumArg": {
"amount": 1000000000,
"dataHash": "923Pyist1hp5sAQLwTHrJnsDs4eHf2cR3UhuhyagYzUh",
"creatorHash": "E85ZyyjjrrsKAgeGeqBE2RSkfzs94FTdfEtefJpnJHrp",
"nonce": 6,
"index": 6,
"root": "27PcDX2Fv9RPqrP7cLhceLMteB7WHPKxcXHgzufkieWr",
"proof": [
"EVpnpyr76cRj9hsbanRPPHe3Xy68Gs6X2Z2BwAtwWFTn",
"BWJVP3XGfLCUHxWsYV3fJB5VpxgTbDikWX1w5WuFHXqz",
"DUPLo4PDHx9zDwMAkzr5go9PRvAN8kA9B9HejTK62HSm",
"8WkbxHTtzURPaXrj2U57TKmcQLzYk9ubre7co3vkPeBT",
"GSz87YKd3YoZWcEKhnjSsYJwv8o5aWGdBdGGYUphRfTh",
"zLUDhASAn7WA1Aqc724azRpZjKCjMQNATApe74JMg8C",
"ABnEXHmveD6iuMwfw2po7t6TPjn5kYMVwYJMi3fa9K91",
"JDh7eiWiUWtiWn623iybHqjQ6AQ6c2Czz8m6ZxwSCkta",
"BFvmeiEuzAYcMR8YxcuCMGYPDpjcmP5hsNbcswgQ8pMc",
"EvxphsdRErrDMs9nhFfF4nzq8i1C2KSogA7uB96TPpPR",
"HpMJWAzQv9HFgHBqY1o8V1B27sCYPFHJdGivDA658jEL",
"HjnrJn5vBUUzpCxzjjM9ZnCPuXei2cXKJjX468B9yWD7",
"4YCF1CSyTXm1Yi9W9JeYevawupkomdgy2dLxEBHL9euq",
"E3oMtCuPEauftdZLX8EZ8YX7BbFzpBCVRYEiLxwPJLY2",
"7DiCkBhs5HQLPEsKY6EjfNd3oBswnfRk9UAZcHqczL7m",
"FhsNgK6GGU1cRPFbmPhrEZ95Zj8vorjK6GmhFuwmZsUm",
"3e2oBSLfSDVdUdS7jRGFKa8nreJUA9sFPEELrHaQyd4J",
"GCXyEHiFMtRFTNFT5LNHwxiXZfooBpUMGSkjyz7pfcS5",
"752CmMF5k7acEFEmJA7oE3aobbWj7CAZVm3KpDR6HiRV",
"D9GGr1ycBmgRbHJyJzmxMk5aoKZmjdezB4NpxopAcgpP"
],
"__typename": "bubblegumArg"
},
"offer": "6oJtSiod36gLtk5evwB6uhoBpxp5nemW73NQH5BVr6nS",
"offerEscrow": "4aRpxWDMLu9ZfYYFYPng2PnyUancWcZipkFhVHRxLREY",
"acceptOfferDiscriminator": [
227,
82,
234,
131,
1,
18,
48,
2
],
"__typename": "bubblegumInfo"
},
"__typename": "NFTSaleDetails"
}
}
}
{
"data": {
"acceptOffer": {
"success": true,
"newNFTID": "021272bc-e41b-412f-8631-f63304a6d3a6",
"__typename": "TransactionResponse"
}
}
}
Field
The table below provides an explanation of each variable in the respective column.
getSignatureForOfferApproval:
Name | Type | Description |
---|---|---|
orgId | UUID1 | The organization ID. |
orderId | UUID1 | The offer order unique ID. |
acceptOffer:
Name | Type | Description |
---|---|---|
orgId | UUID1 | The organization ID. |
orderId | UUID1 | The offer order unique ID. |
transactionHash | String | The accept offer transaction hash. |