Skip to main content
POST
/
contracts
/
directSwap
/
createOffer
Create an offer
curl --request POST \
  --url https://mainnet.gomaestro-api.org/v1/contracts/directSwap/createOffer \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '{
  "sender": "<string>",
  "offer": {
    "policyId1assetName1": "123",
    "policyId2assetName2": "456",
    "policyId3assetName3": "789"
  },
  "toBuy": {
    "policyId1assetName1": "123",
    "policyId2assetName2": "456",
    "policyId3assetName3": "789"
  }
}'
{
  "cbor_hex": "<string>",
  "tx_hash": "<string>"
}

Authorizations

api-key
string
header
required

Project API Key

Body

application/json
sender
string
required

Sender's bech32 address

offer
object
required

Offer assets

Example:
{
"policyId1assetName1": "123",
"policyId2assetName2": "456",
"policyId3assetName3": "789"
}
toBuy
object
required

Assets to buy

Example:
{
"policyId1assetName1": "123",
"policyId2assetName2": "456",
"policyId3assetName3": "789"
}

Response

Offer created successfully

Unsigned transaction

cbor_hex
string
required

CBOR hexadecimal representation of the transaction

tx_hash
string
required

Transaction hash