This feature allows the user to make an offer to the seller to purchase a token. The process involves the following steps:
Steps to Make an Offer:
- Create Offer: The user can create an offer by calling the
createOffer
API. This API will fetch the Solana NFT asset information that is required to initiate a signature in the Phantom or Backpack wallet.
- Description: Fetches the relevant Solana NFT details and prepares the offer for signing.
- Sign the Offer: After calling the createOffer API, the user will be prompted to sign the transaction using their Phantom or Backpack wallet.
- Submit Proof of Offer: Once the transaction is signed successfully, the user will need to confirm the transaction via the
submitProofOfOffer
API. This will finalize the offer and create an offer order for the token owner.
- API Request: submitProofOfOffer
- Description: Confirms and submits the offer transaction to the token owner.
Sample mutations
mutation createOffer($nftTokenId: UUID1!, $orgId: UUID1!, $buyerAddress: String!, $offerPrice: Float!, $expiryDate: Time!, $paymentToken: String!, $currencyId: UUID1, $cryptoTax: CryptoTax, $taxAddress: TaxAddressInput, $currency: CurrencyCodeFiat) {
createOffer(
nftTokenId: $nftTokenId
orgId: $orgId
buyerAddress: $buyerAddress
offerPrice: $offerPrice
expiryDate: $expiryDate
paymentToken: $paymentToken
currencyId: $currencyId
cryptoTax: $cryptoTax
taxAddress: $taxAddress
currency: $currency
) {
messageToSign
order {
id
nftTokenId
tokenId
tokenContract
quantity
nftOwnerAddress
fixedPrice
nftToken {
id
name
deployed
tokenMetadata {
name
description
image
__typename
}
nftContractID
__typename
}
__typename
}
isSigningRequired
isNonEVM
bubblegumListParams {
seller
sellerTokenAccount
mintAccount
systemProgram
tokenProgram
rent
bubblegumProgram
compressionProgram
treeAuthority
leafOwner
previousLeafDelegate
newLeafDelegate
logWrapper
merkleTree
listDiscriminator
metadataId
bubblegumListArg {
price
isCnft
isVin
dataHash
creatorHash
nonce
index
__typename
}
__typename
}
bubblegumMakeOfferParams {
buyer
buyerTokenAccount
offerEscrow
mintAccount
metadataId
offer
systemProgram
tokenProgram
makeOfferDiscriminator
seller
bubblegumMakeOfferArg {
offerAmount
isCnft
isVin
expirationTime
nonce
index
__typename
}
totalActiveOfferAmount
__typename
}
__typename
}
}
mutation submitProofOfOffer($orderId: UUID1!, $orgId: UUID1!, $signature: String!, $buyerAddress: String, $currency: CurrencyCodeFiat, $offerReceipt: String) {
submitProofOfOffer(
orderId: $orderId
orgId: $orgId
signature: $signature
buyerAddress: $buyerAddress
currency: $currency
offerReceipt: $offerReceipt
)
}
Sample variable
{
"orgId": "0db10bbf-85fe-4c87-911b-d18f8568fc07",
"nftTokenId": "021272bc-e41b-412f-8631-f63304a6d3a6",
"buyerAddress": "AhE1ubLPzT6vY1rWFoPko5DSC3rpQUhLMjdEiWV1mJGh",
"offerPrice": 1,
"expiryDate": "2025-01-21T10:40:38Z",
"paymentToken": "0x0000000000000000000000000000000000000000",
"currencyId": "ef390e4c-3194-44ad-b4d7-14be88ed4ee7",
"currency": "USD"
}
{
"orgId": "0db10bbf-85fe-4c87-911b-d18f8568fc07",
"orderId": "daf8733d-7c27-43c5-9dc5-a6b9a4705017",
"signature": "58FiaAUqqLJdjb2Q4Pd1u9eS1GVZTr6cVTgALNnpArkYuH4WnmpWDKAhjTQGvP45p54rJpoQYH2SnuKXj64zatJm",
"offerReceipt": "Z4CpmimZHM31wLxC9sZHPfsUUbj8ihQYtSdntAQAUbt",
"currency": "USD"
}
Sample response
{
"data": {
"createOffer": {
"messageToSign": "",
"order": {
"id": "daf8733d-7c27-43c5-9dc5-a6b9a4705017",
"nftTokenId": "021272bc-e41b-412f-8631-f63304a6d3a6",
"tokenId": "7dDe5D6N16tkuM53RKEuKJ7gZDiB7NC6oyQKP2AQJDSc",
"tokenContract": "FytWTAobotGfihugTU8TEQzEgjfrttUVNWcRHv1GG2G3",
"quantity": 1,
"nftOwnerAddress": "7GckBHDKCMEdFdnxJV3qY12YCEVop6MKtgjVAnd7vHGD",
"fixedPrice": 1,
"nftToken": null,
"__typename": "Order"
},
"isSigningRequired": null,
"isNonEVM": true,
"bubblegumListParams": null,
"bubblegumMakeOfferParams": {
"buyer": "AhE1ubLPzT6vY1rWFoPko5DSC3rpQUhLMjdEiWV1mJGh",
"buyerTokenAccount": "HpmxiYp7pNS9bH9Bq5VpJDEw4P3hDu3WMg1VbwtHPnkB",
"offerEscrow": "4aRpxWDMLu9ZfYYFYPng2PnyUancWcZipkFhVHRxLREY",
"mintAccount": "FytWTAobotGfihugTU8TEQzEgjfrttUVNWcRHv1GG2G3",
"metadataId": "Zv2vv8roKtLuqQTFT14NpbhhjWVmu3qhqgiwaG8RrpF",
"offer": "",
"systemProgram": "11111111111111111111111111111111",
"tokenProgram": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"makeOfferDiscriminator": [
214,
98,
97,
35,
59,
12,
44,
178
],
"seller": "7GckBHDKCMEdFdnxJV3qY12YCEVop6MKtgjVAnd7vHGD",
"bubblegumMakeOfferArg": {
"offerAmount": 1000000000,
"isCnft": true,
"isVin": true,
"expirationTime": 1737456038,
"nonce": 6,
"index": 6,
"__typename": "bubblegumMakeOfferArg"
},
"totalActiveOfferAmount": 0,
"__typename": "bubblegumMakeOfferInfo"
},
"__typename": "SignatureResponse"
}
}
}
{
"data": {
"submitProofOfOffer": "Signature updated."
}
}
Fields
The table below provides an explanation of each variable in the respective column.
createOffer:
Name | Type | Description |
---|---|---|
orgId | UUID1 | The organization ID. |
nftTokenId | UUDI1 | The NFT token unique ID. |
buyerAddress | String | The user connected wallet address. |
offerPrice | Float | The user offers to the seller to buy the token. |
expiryDate | Time | The time limit for the offer expires. |
paymentToken | String | For Solana by default pass `0x0000000000000000000000000000000000000000 |
currencyId | UUDI1 | The payment currency ID is fetched from the supported currency API |
currency | Enum | This currency is used to display the conversion rate of the fiat currency amount. |
submitProofOfOffer:
Name | Type | Description |
---|---|---|
orgId | UUID1 | The organization ID. |
orderId | UUID1 | The unique offer order Id got from createOffer API |
signature | String | The Offer Solana transaction hash |
offerReceipt | String | The unique offer receipt is generated in the marketplace contract. |
currency | Enum | This currency is used to display the conversion rate of the fiat currency amount. |