@golan,
- The approximate time the API call was performed - The response time is immediate.
- The requestId from the response headers if it exists. - NA
- Hostname - fireblockInstance.NCW.invokeWalletRpc (fireblockInstance was created using Signer Api_key from our Sandbox workspace)
See below the steps from Frontend to Backend, and let us know if we missed anything.
- await FireblockService.AssignDevice() - Frontend
- await initFireblocksNCW() - Frontend
- await fireblocksNCW.generateMPCKeys() - Frontend
- await fireSigner.NCW.invokeWalletRpc (walletId, deviceId, strPayload) - Backend
initFireblocksNCW instance (frontend) is created by:
fireblocksNCW = await FireblocksNCWFactory({
logLevel: "INFO",
deviceId,
messagesHandler,
eventsHandler,
secureStorageProvider,
});
fireSigner instance (backend) is created as:
{
const dirPath = path.resolve(__dirname, '../keys');
let apiSecret = fs.readFileSync(path.join(dirPath, 'fireblocks_admin_secret.key'), 'utf8');
apiSecret = apiSecret.replace(/\\n/g, "\n");
const apiKey = process.env.SIGNER_API_KEY
const fireblocks = new FireblocksSDK(apiSecret, apiKey, process.env.FIREBLOCKS_BASE_URL);
return fireblocks;
}
Finally, getTransactions worked fine but the apiKey used is that of the admin (i.e., apiKey = process.env.ADMIN_API_KEY
).
This is the final error messages that is seen at the frontend.
ERROR Request failed with status code 401
LOG DEBUG : Error Headers:
{
"access-control-allow-headers": "Origin, X-Requested-With, Content-Type, Accept, Authorization",
"access-control-allow-methods": "GET, POST, PATCH, DELETE",
"access-control-allow-origin": "*",
"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
"content-length": "65",
"content-type": "application/json; charset=utf-8",
"date": "Tue, 09 Jul 2024 11:20:43 GMT",
"etag": "W/\"41-DXEuJgo1HyxuYzoDNTCOnBUGE0g\"",
"function-execution-id": "a9ssh192ud7o",
"server": "Google Frontend",
"x-cloud-trace-context": "9019bc977c620559757990ab87eb5996",
"x-powered-by": "Express"
}
LOG [AxiosError: Request failed with status code 500] SendMessage error