curl --request POST \
--url https://token-vesting.snek.fun/create-lock \
--header 'Content-Type: application/json' \
--data '{
"address": "addr1...",
"assetId": "policyId.assetNameHex",
"amount": "1000000000",
"lockEnd": 1735689600000,
"stagesCount": 4
}'
{
"cbor": "84a500..."
}
Transaction Builder API
Create vesting lock
Build a transaction that locks tokens into a vesting contract
POST
/
create-lock
curl --request POST \
--url https://token-vesting.snek.fun/create-lock \
--header 'Content-Type: application/json' \
--data '{
"address": "addr1...",
"assetId": "policyId.assetNameHex",
"amount": "1000000000",
"lockEnd": 1735689600000,
"stagesCount": 4
}'
{
"cbor": "84a500..."
}
Builds an unsigned transaction that locks tokens into the Snekfun vesting contract.
Auth: Public
Request body
Amount of tokens to lock (bigint string). When divided by
stagesCount, each stage amount must remain positive.Response
curl --request POST \
--url https://token-vesting.snek.fun/create-lock \
--header 'Content-Type: application/json' \
--data '{
"address": "addr1...",
"assetId": "policyId.assetNameHex",
"amount": "1000000000",
"lockEnd": 1735689600000,
"stagesCount": 4
}'
{
"cbor": "84a500..."
}
Error response
Possible errors:400 INVALID_PARAMS— one or more required fields are missing or have the wrong type.400 INVALID_LOCK_END—lockEndmust be in the future.400 INVALID_AMOUNT—amount / stagesCountis zero after integer division, so the per-stage amount is not positive.500 SERVER_ERROR— unexpected server-side failure.
{
"cause": "INVALID_LOCK_END",
"message": "lockEnd must be in the future"
}
Was this page helpful?