Skip to main content
POST
/
contracts
/
vesting
/
lock
Lock assets
curl --request POST \
  --url https://mainnet.gomaestro-api.org/v1/contracts/vesting/lock \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '
{
  "sender": "addr_test1vqade9vdg4uj3gsc5zfmmyavfd5tpssyxn4m7c4slzlxddcmxc00w",
  "beneficiary": "addr_test1vpvz8req5wn4serhfsg9ha9wg7rf7jsr5hels2llkacq5gcq4utja",
  "asset_policy_id": "fb2b3a629a09014e28d0a54fc06499af12127c79b0bc1c39478da1dd",
  "asset_token_name": "7449534b59",
  "total_vesting_quantity": 1000000,
  "vesting_period_start": 1690304810,
  "vesting_period_end": 1690391304,
  "first_unlock_possible_after": 1690304810,
  "total_installments": 4
}
'
import requests

url = "https://mainnet.gomaestro-api.org/v1/contracts/vesting/lock"

payload = {
"sender": "addr_test1vqade9vdg4uj3gsc5zfmmyavfd5tpssyxn4m7c4slzlxddcmxc00w",
"beneficiary": "addr_test1vpvz8req5wn4serhfsg9ha9wg7rf7jsr5hels2llkacq5gcq4utja",
"asset_policy_id": "fb2b3a629a09014e28d0a54fc06499af12127c79b0bc1c39478da1dd",
"asset_token_name": "7449534b59",
"total_vesting_quantity": 1000000,
"vesting_period_start": 1690304810,
"vesting_period_end": 1690391304,
"first_unlock_possible_after": 1690304810,
"total_installments": 4
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sender: 'addr_test1vqade9vdg4uj3gsc5zfmmyavfd5tpssyxn4m7c4slzlxddcmxc00w',
beneficiary: 'addr_test1vpvz8req5wn4serhfsg9ha9wg7rf7jsr5hels2llkacq5gcq4utja',
asset_policy_id: 'fb2b3a629a09014e28d0a54fc06499af12127c79b0bc1c39478da1dd',
asset_token_name: '7449534b59',
total_vesting_quantity: 1000000,
vesting_period_start: 1690304810,
vesting_period_end: 1690391304,
first_unlock_possible_after: 1690304810,
total_installments: 4
})
};

fetch('https://mainnet.gomaestro-api.org/v1/contracts/vesting/lock', 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/vesting/lock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sender' => 'addr_test1vqade9vdg4uj3gsc5zfmmyavfd5tpssyxn4m7c4slzlxddcmxc00w',
'beneficiary' => 'addr_test1vpvz8req5wn4serhfsg9ha9wg7rf7jsr5hels2llkacq5gcq4utja',
'asset_policy_id' => 'fb2b3a629a09014e28d0a54fc06499af12127c79b0bc1c39478da1dd',
'asset_token_name' => '7449534b59',
'total_vesting_quantity' => 1000000,
'vesting_period_start' => 1690304810,
'vesting_period_end' => 1690391304,
'first_unlock_possible_after' => 1690304810,
'total_installments' => 4
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)

func main() {

url := "https://mainnet.gomaestro-api.org/v1/contracts/vesting/lock"

payload := strings.NewReader("{\n \"sender\": \"addr_test1vqade9vdg4uj3gsc5zfmmyavfd5tpssyxn4m7c4slzlxddcmxc00w\",\n \"beneficiary\": \"addr_test1vpvz8req5wn4serhfsg9ha9wg7rf7jsr5hels2llkacq5gcq4utja\",\n \"asset_policy_id\": \"fb2b3a629a09014e28d0a54fc06499af12127c79b0bc1c39478da1dd\",\n \"asset_token_name\": \"7449534b59\",\n \"total_vesting_quantity\": 1000000,\n \"vesting_period_start\": 1690304810,\n \"vesting_period_end\": 1690391304,\n \"first_unlock_possible_after\": 1690304810,\n \"total_installments\": 4\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://mainnet.gomaestro-api.org/v1/contracts/vesting/lock")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sender\": \"addr_test1vqade9vdg4uj3gsc5zfmmyavfd5tpssyxn4m7c4slzlxddcmxc00w\",\n \"beneficiary\": \"addr_test1vpvz8req5wn4serhfsg9ha9wg7rf7jsr5hels2llkacq5gcq4utja\",\n \"asset_policy_id\": \"fb2b3a629a09014e28d0a54fc06499af12127c79b0bc1c39478da1dd\",\n \"asset_token_name\": \"7449534b59\",\n \"total_vesting_quantity\": 1000000,\n \"vesting_period_start\": 1690304810,\n \"vesting_period_end\": 1690391304,\n \"first_unlock_possible_after\": 1690304810,\n \"total_installments\": 4\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://mainnet.gomaestro-api.org/v1/contracts/vesting/lock")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sender\": \"addr_test1vqade9vdg4uj3gsc5zfmmyavfd5tpssyxn4m7c4slzlxddcmxc00w\",\n \"beneficiary\": \"addr_test1vpvz8req5wn4serhfsg9ha9wg7rf7jsr5hels2llkacq5gcq4utja\",\n \"asset_policy_id\": \"fb2b3a629a09014e28d0a54fc06499af12127c79b0bc1c39478da1dd\",\n \"asset_token_name\": \"7449534b59\",\n \"total_vesting_quantity\": 1000000,\n \"vesting_period_start\": 1690304810,\n \"vesting_period_end\": 1690391304,\n \"first_unlock_possible_after\": 1690304810,\n \"total_installments\": 4\n}"

response = http.request(request)
puts response.read_body
{
  "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

beneficiary
string
required

Beneficiary's bech32 address

asset_policy_id
string
required

Asset policy ID of the asset to be locked

asset_token_name
string
required

Asset policy token name of the asset to be locked

total_vesting_quantity
number
required

Total amount of the asset to be locked

vesting_period_start
number
required

Vesting period start in UNIX time (seconds)

vesting_period_end
number
required

Vesting period end in UNIX time (seconds)

first_unlock_possible_after
number
required

Valid initial unlock period start in UNIX time (seconds)

total_installments
number
required

Number of vesting installments used to collect vested assets

Response

Unsigned transaction created successfully

cbor_hex
string
tx_hash
string