Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@nftperp/sdk
Advanced tools
SDK to interact with the nftperp protocol
For any queries, join our discord invite link
npm i @nftperp/sdk
import { ethers } from "ethers";
import { SDK } from "@nftperp/sdk";
const nftperp = new SDK({ rpcUrl: "<your-rpc-url>", privateKey: "<your-private-key>" });
import { Amm, Side } from "@nftperp/sdk/types";
const tx = await nftperp.openMarketOrder({
amm: Amm.BAYC,
side: Side.BUY,
margin: 0.1, // in eth
leverage: 3,
});
note: to get a list of supported amms do:
console.log(nftperp.getSupportedAmms());
/**
[ 'BAYC', 'MILADY', '...' ]
*/
import { Side } from "@nftperp/sdk/types";
await nftperp.openLimitOrder({
amm: AMM.BAYC,
side: Side.SELL,
price: 30,
margin: 0.1,
leverage: 1,
});
await nftperp.getPosition(Amm.BAYC);
await nftperp.openTriggerOrder({
amm: Amm.BAYC,
price: 20,
size: 0.1 // in BAYC
type: TriggerType.TAKE_PROFIT
});
await nftperp.closePosition({ amm: Amm.BAYC });
summary of entry price, price impact, fees etc to be implied on opening a position
await nftperp.getOpenSummary({
amm: Amm.BAYC,
amount: 1,
leverage: 1,
side: Side.BUY,
});
summary of exit price, price impact, fees etc to be implied on closing a position
const summary = await nftperp.getCloseMarketSummary({ amm: Amm.BAYC });
const markPrice = await nftperp.getMarkPrice(Amm.BAYC);
const indexPrice = await nftperp.getIndexPrice(Amm.BAYC);
const fundingRate = await nftperp.getFundingRate(Amm.BAYC);
await nftperp.getTrades({ amm: Amm.BAYC, trader: "<trader-address>" });
await nftperp.getTrades({ from: 1680307200, to: 1682899200, sort: Sort.ASC });
await nftperp.getTrades({ hash: "<transaction-hash>" });
await nftperp.getFundings({ amm: Amm.BAYC });
await nftperp.getFundings({ from: 1680307200, to: 1682899200, sort: Sort.ASC });
await nftperp.getFundings({ hash: "<transaction-hash>" });
FAQs
SDK for nftperp protocol
The npm package @nftperp/sdk receives a total of 177 weekly downloads. As such, @nftperp/sdk popularity was classified as not popular.
We found that @nftperp/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.