Get user's offers
curl --request GET \
--url https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address} \
--header 'api-key: <api-key>'import requests
url = "https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address}"
headers = {"api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'api-key': '<api-key>'}};
fetch('https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address}")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"outRef": {
"tx_hash": "<string>",
"output_index": 123
},
"datum": {
"creator": {
"paymentCredential": [
"<string>"
],
"stakeCredential": [
[
"<string>"
]
]
},
"toBuy": {
"policyId1": {
"assetName1": "123"
},
"policyId2": {
"assetName2": "456"
},
"policyId3": {
"assetName3": "789"
}
}
},
"assets": {
"policyId1assetName1": "123",
"policyId2assetName2": "456",
"policyId3assetName3": "789"
}
}
]Direct Swap
Get user's offers
Get all direct swap offers created by a specific Cardano address with details and current status.
GET
/
contracts
/
directSwap
/
getOffers
/
{address}
Get user's offers
curl --request GET \
--url https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address} \
--header 'api-key: <api-key>'import requests
url = "https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address}"
headers = {"api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'api-key': '<api-key>'}};
fetch('https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address}")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.gomaestro-api.org/v1/contracts/directSwap/getOffers/{address}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"outRef": {
"tx_hash": "<string>",
"output_index": 123
},
"datum": {
"creator": {
"paymentCredential": [
"<string>"
],
"stakeCredential": [
[
"<string>"
]
]
},
"toBuy": {
"policyId1": {
"assetName1": "123"
},
"policyId2": {
"assetName2": "456"
},
"policyId3": {
"assetName3": "789"
}
}
},
"assets": {
"policyId1assetName1": "123",
"policyId2assetName2": "456",
"policyId3assetName3": "789"
}
}
]Authorizations
Project API Key
Path Parameters
User's bech32 address
Response
Offers retrieved successfully
Was this page helpful?
⌘I

