Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@triviumcapital/trivium-ts-sdk
Advanced tools
To use SDK:
import { Configuration, UserApi, CashApi, FixedDepositApi, TransactionsApi } from '@triviumcapital/trivium-ts-sdk';
const TriviumService = (() => {
const triviumUrl = 'https://staging.api.triviumcapital.tech';
const configuration = new Configuration({
apiKey: '<your-api-key>',
accessToken: '<your-api-secret>'
});
const userApi = new UserApi(configuration, triviumUrl);
const cashApi = new CashApi(configuration, triviumUrl);
const fixedDepositApi = new FixedDepositApi(configuration, triviumUrl);
const transactionsApi = new TransactionsApi(configuration, triviumUrl);
return {
userApi,
cashApi,
fixedDepositApi,
transactionsApi
};
})();
const companyDetails = ...
const user = await TriviumService.userApi.postApiV1User(companyDetails); // creates trivium user and returns user id
Example server to verify callback requests from Trivium:
import express from "express";
import { verifyTriviumCallbackRequest } from "@triviumcapital/trivium-ts-sdk/security";
const app = express();
app.use(
express.json({
limit: "5mb",
verify: (req, res, buf) => {
req.rawBody = buf.toString();
},
})
);
const port = 3000;
const publicKey = "<public key retrieved from Trivium API>";
app.put("/webhook", (req, res) => {
const { rawBody } = req;
const timestamp = req.header("Trivium-Timestamp");
const signature = req.header("Trivium-Signature");
const isVerified = verifyTriviumCallbackRequest(
signature,
rawBody,
timestamp,
publicKey
);
console.log(`timestamp: ${timestamp}`);
console.log(`signature: ${signature}`);
console.log(`body: ${rawBody}`);
console.log(`isVerified: ${isVerified}`);
if (isVerified) {
res.sendStatus(200);
} else {
res.sendStatus(500);
}
});
app.listen(port, () => {
console.log(`Example app listening on port ${port}`);
});
FAQs
Typescript Axios Client SDK for trivium APIs
We found that @triviumcapital/trivium-ts-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.