ucc-sdk
Version:
UnchainedCarrot SDK
34 lines (32 loc) • 1.14 kB
JavaScript
import axios from 'axios';
// track methods
import { _submitEvent } from '../track/ucc-web-tracker';
/**
* Create Crypto Deposit
* @function
* @memberof payments
* @param {string} customerId - customerId
* @param {string} chainName - chainName
* @param {string} userId - userId
* @param {string} currency - currency
* @param {string} amount - amount
* @param {string} tokenSymbol - tokenSymbol
* @param {Array<Object>} events - events
* @returns {Promise<any>} Create Crypto Deposit Response
*/
async function createDeposit(customerId, chainName, userId, currency, amount, tokenSymbol, events) {
const response = await axios.post(
`https://4wm9uqkg41.execute-api.eu-central-1.amazonaws.com/customers/${customerId}/crypto-deposits`,
{
"chainName": chainName,
"userId": userId,
"currency": currency,
"amount": amount,
"tokenSymbol": tokenSymbol.toUpperCase(),
"events": events
}
);
await _submitEvent({ event: 'CRYPTO_DEPOSIT_CREATED', data: response.data.result });
return response.data;
}
export const _createDeposit = createDeposit;