Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@mercurial-finance/farming-sdk
Advanced tools
NPM: https://www.npmjs.com/package/@mercurial-finance/farming-sdk
SDK: https://github.com/MeteoraAg/reward-pool
Discord: https://discord.com/channels/841152225564950528/864859354335412224
npm i @mercurial-finance/farming-sdk @coral-xyz/anchor @solana/web3.js @solana/spl-token @solana/spl-token-registry
import { PoolFarmImpl } from "@mercurial-finance/farming-sdk";
import { Wallet, AnchorProvider } from "@coral-xyz/anchor";
import { Connection, PublicKey, Keypair } from "@solana/web3.js";
// Connection, Wallet, and AnchorProvider to interact with the network
const mainnetConnection = new Connection("https://api.mainnet-beta.solana.com");
const mockWallet = new Wallet(new Keypair());
const provider = new AnchorProvider(mainnetConnection, mockWallet, {
commitment: "confirmed",
});
// Alternatively, to use Solana Wallet Adapter
const USDC_acUSDC_POOL = new PublicKey(
"6ZLKLjMd2KzH7PPHCXUPgbMAtdTT37VgTtdeXWLoJppr"
); // Pool Address can get from https://docs.meteora.ag/dynamic-pools-integration/dynamic-pool-api/pool-info
const farmingPools = await PoolFarmImpl.getFarmAddressesByPoolAddress(
USDC_acUSDC_POOL
);
// farmingPools is an array (A pool can have multiple farms)
const farmingPool = farmingPools[0];
const farm = await PoolFarmImpl.create(
mainnetConnection,
farmingPool.farmAddress
);
// https://station.jup.ag/blog/jupiter-token-list-api#endpoints
const tokenList = await fetch('https://token.jup.ag/all').then(res => res.json());
const USDC = tokenList.find(token => token.address === <USDC_ADDRESS>);
const USDT = tokenList.find(token => token.address === <USDT_ADDRESS>);
// Get pool lp balance from `@mercurial-finance/dynamic-amm-sdk` package
const pool = await AmmImpl.create(connection, MAINNET_POOL.USDC_USDT, USDC, USDT);
const lpBalance = await pool.getUserBalance(mockWallet.publicKey);
const stakeTx = await farm.deposit(mockWallet.publicKey, lpBalance); // Web3 Transaction Object
const stakeResult = await provider.sendAndConfirm(stakeTx); // Transaction hash
const farmBalance = await farm.getUserBalance(mockWallet.publicKey);
const claimTx = await farm.claim(mockWallet.publicKey); // Web3 Transaction Object
const claimResult = await provider.sendAndConfirm(claimTx); // Transaction hash
const unStakeTx = await farm.withdraw(mockWallet.publicKey, farmBalance); // Web3 Transaction Object
const unstakeResult = await provider.sendAndConfirm(depositTx); // Transaction hash
FAQs
Unknown package
The npm package @mercurial-finance/farming-sdk receives a total of 175 weekly downloads. As such, @mercurial-finance/farming-sdk popularity was classified as not popular.
We found that @mercurial-finance/farming-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.