Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@bifrost-finance/slpx
Advanced tools
SLPx offers ways to stake and unstake vToken assets.
npm install @bifrost-finance/slpx
First, import the necessary modules and instantiate the SLPx
class:
import { usePublicClient, useWalletClient } from 'wagmi';
import SLPx from '@bifrost-finance/slpx';
// in React component
const publicClient = usePublicClient();
const { data: walletClient } = useWalletClient();
const slpx = new SLPx(publicClient, walletClient, channel);
import { useContractReads, erc20ABI, useAccount } from 'wagmi';
const { address } = useAccount()
const vToken = 'vBNC'; // vGLMR, vFIL, vDOT, vMOVR, vBNC, vKSM, vASTR, vETH
const amount = 1.0;
const token = vToken?.replace(/^v/, '').toUpperCase();
// Query allowance
const { data, refetch } = useContractReads(
{
contracts: [
{
address: slpx.getContractAddressByToken(token),
abi: erc20ABI,
functionName: 'allowance',
args: [address, slpx.getContractAddressByToken('SLPx')]
}
]
}
)
// Approving a Stake
slpx.approveStake(vToken, amount)
.then(txHash => console.log(`Transaction hash: ${txHash}`))
.catch(error => console.error(`Error approving stake: ${error}`));
// Get the minimum amount to stake
const minStake = slpx.getMinStake(vToken)
// Staking an Asset
slpx.stakeAsset(vToken, amount)
.then(txHash => console.log(`Transaction hash: ${txHash}`))
.catch(error => console.error(`Error staking asset: ${error}`));
import { useContractReads, erc20ABI, useAccount } from 'wagmi';
const { address } = useAccount();
const vToken = 'vBNC'; // vGLMR, vFIL, vDOT, vMOVR, vBNC, vKSM, vASTR, vETH
const amount = 1.0;
// Query allowance
const { data, refetch } = useContractReads(
{
contracts: [
{
address: slpx.getContractAddressByToken(vToken),
abi: erc20ABI,
functionName: 'allowance',
args: [address, slpx.getContractAddressByToken('SLPx')]
}
]
}
)
// Approving a Unstake
slpx.approveUnstake(vToken, amount)
.then(txHash => console.log(`Transaction hash: ${txHash}`))
.catch(error => console.error(`Error approving stake: ${error}`));
// Get the minimum amount to unstake
const minStake = slpx.getMinUnstake(vToken)
// Unstaking an Asset
slpx.unstakeAsset(vToken, amount)
.then(txHash => console.log(`Transaction hash: ${txHash}`))
.catch(error => console.error(`Error staking asset: ${error}`));
After the completion of vETH Unstaking, the dedicated interface for claiming
// Get claim info (currently only supports vETH)
slpx.getClaimInfo('vETH')
.then(info => console.log(`Claim info: ${JSON.stringify(info)}`))
.catch(error => console.error(`Error getting claim info: ${error}`));
// To claim info (currently only supports vETH)
slpx.toClaim('vETH')
.then(info => console.log(`Claim info: ${JSON.stringify(info)}`))
.catch(error => console.error(`Error getting claim info: ${error}`));
FAQs
SLPx offers ways to stake and unstake vToken assets.
The npm package @bifrost-finance/slpx receives a total of 3 weekly downloads. As such, @bifrost-finance/slpx popularity was classified as not popular.
We found that @bifrost-finance/slpx demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.