@loopring-web/loopring-sdk / Exports / AmmpoolAPI
↳ AmmpoolAPI
• new AmmpoolAPI(param, timeout?, baseUrlMap?)
| Name | Type | Default value |
|---|---|---|
param |
InitParam |
undefined |
timeout |
number |
6000 |
baseUrlMap |
Object |
undefined |
baseUrlMap.1 |
string |
"https://api3.loopring.io" |
baseUrlMap.5 |
string |
"https://uat2.loopring.io" |
• Protected baseUrl: string = ""
• Protected chainId: ChainId = ChainId.MAINNET
▪ Static KEY_MESSAGE: string = KEY_MESSAGE
▸ exitAmmPool<R>(request, patch, apiKey): Promise<{ exitAmmPoolResult: ExitAmmPoolResult ; raw_data: R }>
| Name |
|---|
R |
| Name | Type |
|---|---|
request |
ExitAmmPoolRequest |
patch |
AmmPoolRequestPatch |
apiKey |
string |
Promise<{ exitAmmPoolResult: ExitAmmPoolResult ; raw_data: R }>
▸ genErr(err): RESULT_INFO
| Name | Type |
|---|---|
err |
Error | AxiosResponse<any> & Error |
▸ getAmmAssetHistory<R>(request): Promise<{ dataSeries: any ; market: string ; poolAddress: string ; raw_data: R }>
| Name |
|---|
R |
| Name | Type |
|---|---|
request |
GetAmmAssetRequest |
Promise<{ dataSeries: any ; market: string ; poolAddress: string ; raw_data: R }>
▸ getAmmPoolActivityRules<R>(): Promise<{ activityDateMap: LoopringMap<{ AMM_MINING?: LoopringMap<AmmPoolActivityRule> ; ORDERBOOK_MINING?: LoopringMap<AmmPoolActivityRule> ; SWAP_VOLUME_RANKING?: LoopringMap<AmmPoolActivityRule> }> ; activityInProgressRules: LoopringMap<AmmPoolInProgressActivityRule> ; groupByActivityStatus: LoopringMap<AmmPoolActivityRule[]> ; groupByRuleType: LoopringMap<AmmPoolActivityRule[]> ; groupByRuleTypeAndStatus: LoopringMap<LoopringMap<AmmPoolActivityRule[]>> ; raw_data: R }>
| Name |
|---|
R |
Promise<{ activityDateMap: LoopringMap<{ AMM_MINING?: LoopringMap<AmmPoolActivityRule> ; ORDERBOOK_MINING?: LoopringMap<AmmPoolActivityRule> ; SWAP_VOLUME_RANKING?: LoopringMap<AmmPoolActivityRule> }> ; activityInProgressRules: LoopringMap<AmmPoolInProgressActivityRule> ; groupByActivityStatus: LoopringMap<AmmPoolActivityRule[]> ; groupByRuleType: LoopringMap<AmmPoolActivityRule[]> ; groupByRuleTypeAndStatus: LoopringMap<LoopringMap<AmmPoolActivityRule[]>> ; raw_data: R }>
▸ getAmmPoolBalances<R>(): Promise<{ ammpoolsbalances: LoopringMap<AmmPoolBalance> ; raw_data: R }>
| Name |
|---|
R |
Promise<{ ammpoolsbalances: LoopringMap<AmmPoolBalance> ; raw_data: R }>
▸ getAmmPoolConf<R>(): Promise<{ ammpools: LoopringMap<AmmPoolInfoV3> ; pairs: LoopringMap<TokenRelatedInfo> ; raw_data: R }>
| Name |
|---|
R |
Promise<{ ammpools: LoopringMap<AmmPoolInfoV3> ; pairs: LoopringMap<TokenRelatedInfo> ; raw_data: R }>
▸ getAmmPoolGameRank<R>(request): Promise<{ raw_data: R ; totalRewards: TokenVolumeV3[] ; userRankList: GameRankInfo[] }>
| Name |
|---|
R |
| Name | Type |
|---|---|
request |
GetAmmPoolGameRankRequest |
Promise<{ raw_data: R ; totalRewards: TokenVolumeV3[] ; userRankList: GameRankInfo[] }>
▸ getAmmPoolGameUserRank<R>(request, apiKey): Promise<{ raw_data: R ; userRank: GameRankInfo }>
| Name |
|---|
R |
| Name | Type |
|---|---|
request |
GetAmmPoolGameUserRankRequest |
apiKey |
string |
Promise<{ raw_data: R ; userRank: GameRankInfo }>
▸ getAmmPoolSnapshot<R>(request): Promise<{ ammPoolSnapshot: AmmPoolSnapshot ; raw_data: R }>
| Name |
|---|
R |
| Name | Type |
|---|---|
request |
GetAmmPoolSnapshotRequest |
Promise<{ ammPoolSnapshot: AmmPoolSnapshot ; raw_data: R }>
▸ getAmmPoolStats<R>(): Promise<{ ammPoolStats: LoopringMap<AmmPoolStat> ; raw_data: R }>
| Name |
|---|
R |
Promise<{ ammPoolStats: LoopringMap<AmmPoolStat> ; raw_data: R }>
▸ getAmmPoolTrades<R>(request): Promise<{ ammPoolTrades: AmmPoolTrade[] ; raw_data: R ; totalNum: number }>
| Name |
|---|
R |
| Name | Type |
|---|---|
request |
GetAmmPoolTradesRequest |
Promise<{ ammPoolTrades: AmmPoolTrade[] ; raw_data: R ; totalNum: number }>
▸ getAmmPoolTxs<R>(request): Promise<{ raw_data: R ; totalNum: number ; transactions: AmmPoolTx[] }>
| Name |
|---|
R |
| Name | Type |
|---|---|
request |
GetAmmPoolTxsRequest |
Promise<{ raw_data: R ; totalNum: number ; transactions: AmmPoolTx[] }>
▸ getAmmPoolUserRewards<R>(request): Promise<{ ammUserRewardMap: AmmUserRewardMap ; raw_data: R }>
| Name |
|---|
R |
| Name | Type |
|---|---|
request |
GetAmmUserRewardsRequest |
Promise<{ ammUserRewardMap: AmmUserRewardMap ; raw_data: R }>
▸ getAvailableBroker(request): Promise<{ broker: string }>
| Name | Type |
|---|---|
request |
GetAvailableBrokerRequest |
Promise<{ broker: string }>
▸ getCounterFactualInfo<T>(request): Promise<{ counterFactualInfo: undefined | CounterFactualInfo ; error?: RESULT_INFO ; raw_data: T }>
| Name | Type |
|---|---|
T |
extends unknown |
| Name | Type |
|---|---|
request |
GetCounterFactualInfoRequest |
Promise<{ counterFactualInfo: undefined | CounterFactualInfo ; error?: RESULT_INFO ; raw_data: T }>
▸ getLiquidityMining<R>(request, apiKey): Promise<{ raw_data: R ; rewards: RewardItem[] }>
| Name |
|---|
R |
| Name | Type |
|---|---|
request |
GetLiquidityMiningRequest |
apiKey |
string |
Promise<{ raw_data: R ; rewards: RewardItem[] }>
▸ getLiquidityMiningUserHistory<R>(request): Promise<{ raw_data: R ; userMiningInfos: UserMiningInfo[] }>
| Name |
|---|
R |
| Name | Type |
|---|---|
request |
GetLiquidityMiningUserHistoryRequest |
Promise<{ raw_data: R ; userMiningInfos: UserMiningInfo[] }>
▸ Private getOrderList(lst, order): AmmPoolActivityRule[]
| Name | Type |
|---|---|
lst |
AmmPoolActivityRule[] |
order |
SortOrder |
▸ getUserAmmPoolTxs<R>(request, apiKey): Promise<{ raw_data: R ; totalNum: number ; userAmmPoolTxs: UserAmmPoolTx[] }>
| Name |
|---|
R |
| Name | Type |
|---|---|
request |
GetUserAmmPoolTxsRequest |
apiKey |
string |
Promise<{ raw_data: R ; totalNum: number ; userAmmPoolTxs: UserAmmPoolTx[] }>
▸ joinAmmPool<R>(request, patch, apiKey): Promise<{ joinAmmPoolResult: JoinAmmPoolResult ; raw_data: R }>
| Name |
|---|
R |
| Name | Type |
|---|---|
request |
JoinAmmPoolRequest |
patch |
AmmPoolRequestPatch |
apiKey |
string |
Promise<{ joinAmmPoolResult: JoinAmmPoolResult ; raw_data: R }>
▸ Protected makeReq(): Request
Request
▸ Protected returnTxHash<T>(raw_data): RESULT_INFO | Omit<T, "resultInfo"> & { raw_data: Omit<T, "resultInfo"> }
| Name | Type |
|---|---|
T |
extends TX_HASH_API |
| Name | Type |
|---|---|
raw_data |
T |
RESULT_INFO | Omit<T, "resultInfo"> & { raw_data: Omit<T, "resultInfo"> }
▸ setBaseUrl(baseUrl): void
| Name | Type |
|---|---|
baseUrl |
string |
void
▸ setChainId(chainId): void
| Name | Type |
|---|---|
chainId |
ChainId |
void