loopring_sdk

@loopring-web/loopring-sdk / Exports / AmmpoolAPI

Class: AmmpoolAPI

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new AmmpoolAPI(param, timeout?, baseUrlMap?)

Parameters

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"

Inherited from

BaseAPI.constructor

Defined in

api/base_api.ts:104

Properties

baseUrl

Protected baseUrl: string = ""

Inherited from

BaseAPI.baseUrl

Defined in

api/base_api.ts:39


chainId

Protected chainId: ChainId = ChainId.MAINNET

Inherited from

BaseAPI.chainId

Defined in

api/base_api.ts:40


KEY_MESSAGE

Static KEY_MESSAGE: string = KEY_MESSAGE

Inherited from

BaseAPI.KEY_MESSAGE

Defined in

api/base_api.ts:38

Methods

exitAmmPool

exitAmmPool<R>(request, patch, apiKey): Promise<{ exitAmmPoolResult: ExitAmmPoolResult ; raw_data: R }>

Type parameters

Name
R

Parameters

Name Type
request ExitAmmPoolRequest
patch AmmPoolRequestPatch
apiKey string

Returns

Promise<{ exitAmmPoolResult: ExitAmmPoolResult ; raw_data: R }>

Defined in

api/ammpool_api.ts:661


genErr

genErr(err): RESULT_INFO

Parameters

Name Type
err Error | AxiosResponse<any> & Error

Returns

RESULT_INFO

Inherited from

BaseAPI.genErr

Defined in

api/base_api.ts:41


getAmmAssetHistory

getAmmAssetHistory<R>(request): Promise<{ dataSeries: any ; market: string ; poolAddress: string ; raw_data: R }>

Type parameters

Name
R

Parameters

Name Type
request GetAmmAssetRequest

Returns

Promise<{ dataSeries: any ; market: string ; poolAddress: string ; raw_data: R }>

Defined in

api/ammpool_api.ts:330


getAmmPoolActivityRules

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 }>

Type parameters

Name
R

Returns

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 }>

Defined in

api/ammpool_api.ts:210


getAmmPoolBalances

getAmmPoolBalances<R>(): Promise<{ ammpoolsbalances: LoopringMap<AmmPoolBalance> ; raw_data: R }>

Type parameters

Name
R

Returns

Promise<{ ammpoolsbalances: LoopringMap<AmmPoolBalance> ; raw_data: R }>

Defined in

api/ammpool_api.ts:425


getAmmPoolConf

getAmmPoolConf<R>(): Promise<{ ammpools: LoopringMap<AmmPoolInfoV3> ; pairs: LoopringMap<TokenRelatedInfo> ; raw_data: R }>

Type parameters

Name
R

Returns

Promise<{ ammpools: LoopringMap<AmmPoolInfoV3> ; pairs: LoopringMap<TokenRelatedInfo> ; raw_data: R }>

Defined in

api/ammpool_api.ts:50


getAmmPoolGameRank

getAmmPoolGameRank<R>(request): Promise<{ raw_data: R ; totalRewards: TokenVolumeV3[] ; userRankList: GameRankInfo[] }>

Type parameters

Name
R

Parameters

Name Type
request GetAmmPoolGameRankRequest

Returns

Promise<{ raw_data: R ; totalRewards: TokenVolumeV3[] ; userRankList: GameRankInfo[] }>

Defined in

api/ammpool_api.ts:132


getAmmPoolGameUserRank

getAmmPoolGameUserRank<R>(request, apiKey): Promise<{ raw_data: R ; userRank: GameRankInfo }>

Type parameters

Name
R

Parameters

Name Type
request GetAmmPoolGameUserRankRequest
apiKey string

Returns

Promise<{ raw_data: R ; userRank: GameRankInfo }>

Defined in

api/ammpool_api.ts:169


getAmmPoolSnapshot

getAmmPoolSnapshot<R>(request): Promise<{ ammPoolSnapshot: AmmPoolSnapshot ; raw_data: R }>

Type parameters

Name
R

Parameters

Name Type
request GetAmmPoolSnapshotRequest

Returns

Promise<{ ammPoolSnapshot: AmmPoolSnapshot ; raw_data: R }>

Defined in

api/ammpool_api.ts:395


getAmmPoolStats

getAmmPoolStats<R>(): Promise<{ ammPoolStats: LoopringMap<AmmPoolStat> ; raw_data: R }>

Type parameters

Name
R

Returns

Promise<{ ammPoolStats: LoopringMap<AmmPoolStat> ; raw_data: R }>

Defined in

api/ammpool_api.ts:363


getAmmPoolTrades

getAmmPoolTrades<R>(request): Promise<{ ammPoolTrades: AmmPoolTrade[] ; raw_data: R ; totalNum: number }>

Type parameters

Name
R

Parameters

Name Type
request GetAmmPoolTradesRequest

Returns

Promise<{ ammPoolTrades: AmmPoolTrade[] ; raw_data: R ; totalNum: number }>

Defined in

api/ammpool_api.ts:598


getAmmPoolTxs

getAmmPoolTxs<R>(request): Promise<{ raw_data: R ; totalNum: number ; transactions: AmmPoolTx[] }>

Type parameters

Name
R

Parameters

Name Type
request GetAmmPoolTxsRequest

Returns

Promise<{ raw_data: R ; totalNum: number ; transactions: AmmPoolTx[] }>

Defined in

api/ammpool_api.ts:563


getAmmPoolUserRewards

getAmmPoolUserRewards<R>(request): Promise<{ ammUserRewardMap: AmmUserRewardMap ; raw_data: R }>

Type parameters

Name
R

Parameters

Name Type
request GetAmmUserRewardsRequest

Returns

Promise<{ ammUserRewardMap: AmmUserRewardMap ; raw_data: R }>

Defined in

api/ammpool_api.ts:84


getAvailableBroker

getAvailableBroker(request): Promise<{ broker: string }>

Parameters

Name Type
request GetAvailableBrokerRequest

Returns

Promise<{ broker: string }>

Inherited from

BaseAPI.getAvailableBroker

Defined in

api/base_api.ts:123


getCounterFactualInfo

getCounterFactualInfo<T>(request): Promise<{ counterFactualInfo: undefined | CounterFactualInfo ; error?: RESULT_INFO ; raw_data: T }>

Type parameters

Name Type
T extends unknown

Parameters

Name Type
request GetCounterFactualInfoRequest

Returns

Promise<{ counterFactualInfo: undefined | CounterFactualInfo ; error?: RESULT_INFO ; raw_data: T }>

Inherited from

BaseAPI.getCounterFactualInfo

Defined in

api/base_api.ts:136


getLiquidityMining

getLiquidityMining<R>(request, apiKey): Promise<{ raw_data: R ; rewards: RewardItem[] }>

Type parameters

Name
R

Parameters

Name Type
request GetLiquidityMiningRequest
apiKey string

Returns

Promise<{ raw_data: R ; rewards: RewardItem[] }>

Defined in

api/ammpool_api.ts:472


getLiquidityMiningUserHistory

getLiquidityMiningUserHistory<R>(request): Promise<{ raw_data: R ; userMiningInfos: UserMiningInfo[] }>

Type parameters

Name
R

Parameters

Name Type
request GetLiquidityMiningUserHistoryRequest

Returns

Promise<{ raw_data: R ; userMiningInfos: UserMiningInfo[] }>

Defined in

api/ammpool_api.ts:502


getOrderList

Private getOrderList(lst, order): AmmPoolActivityRule[]

Parameters

Name Type
lst AmmPoolActivityRule[]
order SortOrder

Returns

AmmPoolActivityRule[]

Defined in

api/ammpool_api.ts:198


getUserAmmPoolTxs

getUserAmmPoolTxs<R>(request, apiKey): Promise<{ raw_data: R ; totalNum: number ; userAmmPoolTxs: UserAmmPoolTx[] }>

Type parameters

Name
R

Parameters

Name Type
request GetUserAmmPoolTxsRequest
apiKey string

Returns

Promise<{ raw_data: R ; totalNum: number ; userAmmPoolTxs: UserAmmPoolTx[] }>

Defined in

api/ammpool_api.ts:531


joinAmmPool

joinAmmPool<R>(request, patch, apiKey): Promise<{ joinAmmPoolResult: JoinAmmPoolResult ; raw_data: R }>

Type parameters

Name
R

Parameters

Name Type
request JoinAmmPoolRequest
patch AmmPoolRequestPatch
apiKey string

Returns

Promise<{ joinAmmPoolResult: JoinAmmPoolResult ; raw_data: R }>

Defined in

api/ammpool_api.ts:625


makeReq

Protected makeReq(): Request

Returns

Request

Inherited from

BaseAPI.makeReq

Defined in

api/base_api.ts:182


returnTxHash

Protected returnTxHash<T>(raw_data): RESULT_INFO | Omit<T, "resultInfo"> & { raw_data: Omit<T, "resultInfo"> }

Type parameters

Name Type
T extends TX_HASH_API

Parameters

Name Type
raw_data T

Returns

RESULT_INFO | Omit<T, "resultInfo"> & { raw_data: Omit<T, "resultInfo"> }

Inherited from

BaseAPI.returnTxHash

Defined in

api/base_api.ts:82


setBaseUrl

setBaseUrl(baseUrl): void

Parameters

Name Type
baseUrl string

Returns

void

Inherited from

BaseAPI.setBaseUrl

Defined in

api/base_api.ts:178


setChainId

setChainId(chainId): void

Parameters

Name Type
chainId ChainId

Returns

void

Inherited from

BaseAPI.setChainId

Defined in

api/base_api.ts:170