Buy Presale
Participate in the presale from a holder's account with USDC.
POSTapi.metal.build/holder/:holderId/buy-presale
Buy presale
This endpoint allows you to buy presale with USDC. Tokens purchased in presales will be automatically locked for the presale's lock duration (default: 7 days) after distribution.
Required attributes
- Name
presaleId
- Type
- string
- Description
The ID of the presale you want to buy.
- Name
usdcAmount
- Type
- number
- Description
The amount of USDC you want to spend on the presale.
Request
POST
api.metal.build/holder/:holderId/buy-presaleconst response = await fetch('https://api.metal.build/holder/:holderId/buy-presale', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_SECRET_API_KEY',
},
body: JSON.stringify({
"presaleId": "81ce774a-ebaf-4d19-ba77-b1dbb41bc5d1",
"usdcAmount": 0.5
}),
})
const presaleBuy = await response.json()
Response
{
"success": true
}
Token Lock Behavior: When the presale completes and tokens are distributed:
- Tokens will be automatically locked for the presale's lock duration
- Locked tokens appear in the holder's
locks
array with anunlockDate
- During the lock period, tokens cannot be transferred or sold
- After the unlock date, tokens automatically become available for trading