@rholabs/rho-sdk
Advanced tools
Comparing version 0.2.15 to 0.2.16
@@ -177,3 +177,3 @@ import { BrowserProvider, JsonRpcSigner, JsonRpcProvider, TransactionReceipt, Wallet, TransactionRequest } from "ethers"; | ||
} | ||
export type RhoSDKNetwork = 'mainnet' | 'testnet' | 'custom'; | ||
export type RhoSDKNetwork = 'mainnet' | 'testnet' | 'devnet' | 'custom'; | ||
export interface RhoSDKParams { | ||
@@ -346,2 +346,6 @@ network?: RhoSDKNetwork; | ||
} & UserPaginationParams): Promise<MakerLiquidityDistribution>; | ||
futuresInfoCloseToMaturityWithoutIndex(params: { | ||
marketId: string; | ||
maturityBufferSeconds: number; | ||
}): Promise<FutureInfo[]>; | ||
isLiquidatable(params: MarketUserOracleParams): Promise<boolean>; | ||
@@ -348,0 +352,0 @@ isProvisionCancellable(params: MarketUserOracleParams): Promise<boolean>; |
{ | ||
"name": "@rholabs/rho-sdk", | ||
"version": "0.2.15", | ||
"version": "0.2.16", | ||
"description": "Rho Protocol SDK", | ||
@@ -5,0 +5,0 @@ "source": "src/index.ts", |
@@ -19,2 +19,10 @@ import { RhoSDKConfig, RhoSDKParams } from './sdk-typings' | ||
export const DevnetConfig: RhoSDKConfig = { | ||
routerAddress: '0xd1C8cf53af805658BA0973fe48C5B71D54FB099E', | ||
viewAddress: '0xe5FCccE16D38B3D11Eaa3B8186B5Eb771dCD95C3', | ||
quoterAddress: '0xAe02aa198718c26e83a61bbE09BCC2ba34E4Ef5a', | ||
rpcUrl: 'https://arbitrum-sepolia.publicnode.com', | ||
oracleServiceUrl: ['https://v2.roaracle.dev', 'https://testnet.roaracle.app'], | ||
} | ||
export const parseConfig = (params: RhoSDKParams = {}): RhoSDKConfig => { | ||
@@ -29,2 +37,4 @@ const { network = 'mainnet' } = params | ||
baseConfig = TestnetConfig | ||
} else if(network === 'devnet') { | ||
baseConfig = DevnetConfig | ||
} else if(network === 'custom') { | ||
@@ -31,0 +41,0 @@ baseConfig = {...params} |
import { RouterABI, ViewABI, QuoterABI, ERC20ABI, ACMABI } from './abi' | ||
import { parseConfig } from './config' | ||
import { | ||
FutureInfo, | ||
LiquidityDistribution, | ||
@@ -246,2 +247,10 @@ LiquidityQuote, | ||
public async futuresInfoCloseToMaturityWithoutIndex(params: { | ||
marketId: string, | ||
maturityBufferSeconds: number, | ||
}): Promise<FutureInfo[]> { | ||
const { marketId, maturityBufferSeconds } = params | ||
return await this.view.futuresInfoCloseToMaturityWithoutIndex(marketId, maturityBufferSeconds) | ||
} | ||
public async isLiquidatable(params: MarketUserOracleParams): Promise<boolean> { | ||
@@ -248,0 +257,0 @@ const { marketId, userAddress } = params |
import { BrowserProvider, JsonRpcSigner, JsonRpcProvider } from 'ethers' | ||
import { LiquidityOperation, MarketOraclePackages, RiskDirection } from './typings' | ||
export type RhoSDKNetwork = 'mainnet' | 'testnet' | 'custom' | ||
export type RhoSDKNetwork = 'mainnet' | 'testnet' | 'devnet' | 'custom' | ||
@@ -6,0 +6,0 @@ export interface RhoSDKParams { |
@@ -242,2 +242,15 @@ import * as dotenv from 'dotenv' | ||
) | ||
test( | ||
'futuresInfoCloseToMaturityWithoutIndex', | ||
async () => { | ||
const [market] = markets | ||
const futures = await sdk.futuresInfoCloseToMaturityWithoutIndex({ | ||
marketId: market.descriptor.id, | ||
maturityBufferSeconds: 12 * 24 * 60_60_1000 | ||
}) | ||
expect(futures.length).toBeGreaterThan(0) | ||
}, | ||
waitTimeout | ||
) | ||
}) | ||
@@ -244,0 +257,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5289857
15424