
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
@rholabs/rho-sdk
Advanced tools
npm install @rholabs/rho-sdk
Create Rho SDK with testnet configuration:
import RhoSDK from '@rholabs/rho-sdk';
const rhoSDK = new RhoSDK({ network: 'testnet' });
RhoSDKParams: Object
(optional)
export type RhoSDKNetwork = 'mainnet' | 'testnet' | 'custom'
export interface RhoSDKParams {
network?: RhoSDKNetwork
routerAddress?: string
viewAddress?: string
quoterAddress?: string
rpcUrl?: string
oracleServiceUrl?: string
privateKey?: string
provider?: JsonRpcProvider | BrowserProvider
signer?: JsonRpcSigner
}
getActiveMarketIds(offset, limit)
Get active market ids
Parameters
offset
- Number
(optional)limit
- Number
(optional)Returns
String[]
getActiveMarkets({ oraclePackages, offset, limit })
Get active markets
Parameters
oraclePackages
- OraclePackages[]
(optional)offset
- Number
(optional)limit
- Number
(optional)Returns
MarketInfo[]
getPortfolio({ userAddress, oraclePackages, offset, limit })
Get user portfolio
Parameters
userAddress
- String
oraclePackages
- OraclePackages[]
(optional)offset
- Number
(optional)limit
- Number
(optional)Returns
MarketPortfolio[]
getTradeQuote({ marketId, futureId, notional, userAddress, oraclePackages? })
Get trade quote
Parameters
marketId
- String
futureId
- String
notional
- BigInt
userAddress
- String
oraclePackages
- OraclePackages[]
(optional)Returns
TradeQuote
getLiquidityProvisionQuote({ marketId, futureId, notional, operation, lowerBound, upperBound, userAddress, oraclePackages? })
Get liquidity provision quote
Parameters
marketId
- String
futureId
- String
notional
- BigInt
operation
- LiquidityOperation
lowerBound
- String
upperBound
- String
userAddress
- String
oraclePackages
- OraclePackages[]
(optional)Returns
LiquidityQuote
executeTrade({ marketId, futureId, notional, riskDirection, futureRateLimit, collateral, deadlineTimestamp, settleMaturedPositions?, oraclePackages? })
Execute trade
Parameters
marketId
- String
futureId
- String
notional
- BigInt
riskDirection
- RiskDirection
futureRateLimit
- BigInt
collateral
- BigInt
deadline
- Number
(optional, Date.now() + 5 _ 60 _ 1000)settleMaturedPositions
- Boolean
(optional, true)oraclePackages
- OraclePackages[]
(optional)Returns
TransactionReceipt
deposit({ marketId, recipientAddress, amount, settleMaturedPositions?, oraclePackages? })
Deposit
Parameters
marketId
- String
recipientAddress
- String
amount
- BigInt
settleMaturedPositions
- Boolean
(optional)oraclePackages
- OraclePackages[]
(optional)Returns
TransactionReceipt
withdraw({ marketId, amount, settleMaturedPositions?, oraclePackages? })
Withdraw
Parameters
marketId
- String
amount
- BigInt
settleMaturedPositions
- Boolean
(optional, true)oraclePackages
- OraclePackages[]
(optional)Returns
TransactionReceipt
provideLiquidity({ marketId, futureId, notional, collateral, lowerBound, upperBound, deadlineTimestamp?, settleMaturedPositions?, oraclePackages? })
Provide liquidity
Parameters
marketId
- String
futureId
- String
notional
- BigInt
collateral
- BigInt
lowerBound
- String
upperBound
- String
deadline
- Number
(optional, Date.now() + 5 _ 60 _ 1000)settleMaturedPositions
- Boolean
(optional, true)oraclePackages
- OraclePackages[]
(optional)Returns
TransactionReceipt
removeLiquidity({ marketId, futureId, notional, collateral, lowerBound, upperBound, deadlineTimestamp?, settleMaturedPositions?, oraclePackages? })
Remove liquidity
Parameters
marketId
- String
futureId
- String
notional
- BigInt
collateral
- BigInt
lowerBound
- String
upperBound
- String
deadline
- Number
settleMaturedPositions
- Boolean
(optional, Date.now() + 5 _ 60 _ 1000)oraclePackages
- OraclePackages[]
(optional)Returns
TransactionReceipt
import RhoSDK from '@rholabs/rho-sdk';
const rhoSDK = new RhoSDK({ network: 'testnet' })
import RhoSDK from '@rholabs/rho-sdk';
const rhoSDK = new RhoSDK({
network: 'testnet',
privateKey: '<PRIVATE_KEY>'
})
if (window.ethereum) {
const provider = new ethers.BrowserProvider(window.ethereum)
await provider.send("eth_requestAccounts", [])
const signer = await provider.getSigner()
const sdk = new RhoSDK({ network: 'testnet', signer })
const markets = await sdk.getActiveMarkets()
}
Create .env
file:
TEST_PRIVATE_KEY=12345
and run the tests:
yarn test
npm login
yarn build
npm publish --access public
FAQs
Rho Protocol SDK
We found that @rholabs/rho-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.