Awards
Awards
These endpoints can be used to facilitate Awards payments as part of a promotional program, prize pool, bonus pool, giveaway, etc. See release notes here for more information
POST /awards/fund
POST /awards/fundSpecify the amount, quoted currency, and asset that you intend to ultimately distribute to your customers via the POST /awards/distribute endpoint.
const fundAwards = (asset: string, notional: string) => {
const body = `{
asset: ${asset},
total: ${notional}
}`
const timestamp = Math.round(Date.now() / 1000)
const payload = timestamp + 'POST' + '/awards' + body
const decodedSecret = Buffer.from(apiSecret, 'base64')
const hmac = crypto.createHmac('sha256', decodedSecret)
const signedPayload = hmac.update(payload).digest('base64')
// SET HEADERS
const headers = {
'X-NDAX-API-KEY': 'public_key',
'X-NDAX-SIGNED': signedPayload,
'X-NDAX-TIMESTAMP': timestamp,
'X-NDAX-PASSPHRASE': 'passphrase'
}
const options = {
headers,
body,
json: true
}
return request.post(`https://api.ndax.in/awards/fund`, options)
}Sample Response
Body parameters include:
underlying(required) the underlying asset for to be awarded.quoted_currency(required) the quoted asset for purchase of the rewardquantity(optional) the desired amount of theunderlyingfor the quote (eitherquantityortotalmust be provided)total(optional) the desired amount of thequoted_currencyfor the quote (eitherquantityortotalmust be provided)
Response:
request_id
The identifier of the RFQ
string
quote
The quote object that was executed
quote
trade_id
The unique identifier assigned to the trade, which is the same trade_id as found in a GET /trades request
Note: the quote_id will be saved as the client_trade_id
string
status
The status of the trade, e.g. Completed
string
POST /awards/distribute
POST /awards/distributeEvenly distribute the purchased crypto among the specified customers.
Sample Response
Body parameters include:
asset(required) the asset for to be awarded.quantity(required) the desired amount of theassetfor to be awarded to each customer in the requestparticipant_codes(required) the list of customers to receivequantityamount of reward
Response:
request_id
The identifier of the request
string
confirms
A list of participant_code plus trade identifiers for the executed trades confirm
confirm
Last updated