Hi, I’m having issues trying to make a fiat deposit (aud).
I already added the aud asset and I can see it in my wallet. My idea is at the beginning allow people to make a deposit through their bank to our company bank account and notify us about this deposit. Once we get the notification and the money is in our bank account, we can confirm the deposit on the operator control panel. To achieve that, I added a route:
router.post(’/bank/deposit’, toolsLib.security.verifyBearerTokenExpressMiddleware([‘user’]), (req, res) => {
var amount = req.body.amount;
var currency = req.body.currency;
var transaction_id = req.body.transaction_id;
const user_id = req.auth.sub.id;
const mintResponse = await toolsLib.wallet.mintAssetByKitId(
user_id, // User kit id
currency, // currency
amount, // amount
{
description: 'Bank Deposit', // description
transactionId: transaction_id // transaction id
}
);
return res.json({mintresponse: mintResponse, user_id: user_id, amount: amount, currency: currency, transaction_id: transaction_id});
});
I made a post request with postman, using api key, token, api signature and api expires headers to this URL: https://api.dev.erthexchange.com.au/plugins/bank/deposit
and this body:
{
“amount”: 10,
“currency”: “aud”,
“transaction_id”: “5633245235”
}
The response is this one:
{
“amount”: 10,
“currency”: “aud”,
“transaction_id”: “5633245235”
}
But the deposit isn’t done. I got this log:
{“message”:"::ffff:172.24.0.7 - - [10/Jan/2022:23:32:11 +0000] “POST /plugins/bank/deposit HTTP/1.0” 200 128 “-” “PostmanRuntime/7.19.0”\n ",“level”:“info”,“timestamp”:“2022-01-10T23:32:11.781Z”}
Unhandled rejection StatusCodeError: 400 - {“message”:“Error 1001 - You do not have permission for this operation”}
at new StatusCodeError (/app/node_modules/request-promise-core/lib/errors.js:32:15)
at Request.plumbing.callback (/app/node_modules/request-promise-core/lib/plumbing.js:104:33)
at Request.RP$callback [as _callback] (/app/node_modules/request-promise-core/lib/plumbing.js:46:31)
at Request.self.callback (/app/node_modules/request/request.js:186:22)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:448:20)
at Request. (/app/node_modules/request/request.js:1163:10)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:448:20)
at IncomingMessage. (/app/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:286:20)
at IncomingMessage.emit (events.js:203:15)
at IncomingMessage.EventEmitter.emit (domain.js:448:20)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Do you have any idea about if it’s possible and if I’m doing something wrong?
Thank you!!