@loopring-web/loopring-sdk / Exports / ExchangeAPI
↳ ExchangeAPI
• new ExchangeAPI(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
▸ disableWithdrawTokenList<R
>(): Promise
<{ disableWithdrawTokenList
: any
[] ; raw_data
: R
}>
Name |
---|
R |
Promise
<{ disableWithdrawTokenList
: any
[] ; raw_data
: R
}>
▸ genErr(err
): RESULT_INFO
Name | Type |
---|---|
err |
Error | AxiosResponse <any > & Error |
▸ getAccount<R
>(request
): Promise
<{ accInfo
: AccountInfo
; raw_data
: R
}>
Name |
---|
R |
Name | Type |
---|---|
request |
GetAccountRequest |
Promise
<{ accInfo
: AccountInfo
; raw_data
: R
}>
▸ getAccountServices<R
>(request
): Promise
<{ dAppTrade
: any
; joinAmm
: any
; legal
: any
; order
: any
; raw_data
: R
; register
: any
}>
Name |
---|
R |
Name | Type |
---|---|
request |
GetAccountServicesRequest |
Promise
<{ dAppTrade
: any
; joinAmm
: any
; legal
: any
; order
: any
; raw_data
: R
; register
: any
}>
▸ getAllMixTickers(markets?
): Promise
<{ marketArr
: string
[] ; marketArrStr
: string
; markets
: LoopringMap
<MarketInfo
> ; pairs
: LoopringMap
<TokenRelatedInfo
> ; raw_data
: unknown
; tokenArr
: string
[] ; tokenArrStr
: string
} | { raw_data
: unknown
; tickList
: TickerData
[] ; tickMap
: LoopringMap
<TickerData
> }>
Name | Type | Default value |
---|---|---|
markets |
undefined | string |
undefined |
Promise
<{ marketArr
: string
[] ; marketArrStr
: string
; markets
: LoopringMap
<MarketInfo
> ; pairs
: LoopringMap
<TokenRelatedInfo
> ; raw_data
: unknown
; tokenArr
: string
[] ; tokenArrStr
: string
} | { raw_data
: unknown
; tickList
: TickerData
[] ; tickMap
: LoopringMap
<TickerData
> }>
▸ getAllTickers(markets?
): Promise
<{ marketArr
: string
[] ; marketArrStr
: string
; markets
: LoopringMap
<MarketInfo
> ; pairs
: LoopringMap
<TokenRelatedInfo
> ; raw_data
: unknown
; tokenArr
: string
[] ; tokenArrStr
: string
} | { raw_data
: unknown
; tickList
: TickerData
[] ; tickMap
: LoopringMap
<TickerData
> }>
Name | Type | Default value |
---|---|---|
markets |
undefined | string |
undefined |
Promise
<{ marketArr
: string
[] ; marketArrStr
: string
; markets
: LoopringMap
<MarketInfo
> ; pairs
: LoopringMap
<TokenRelatedInfo
> ; raw_data
: unknown
; tokenArr
: string
[] ; tokenArrStr
: string
} | { raw_data
: unknown
; tickList
: TickerData
[] ; tickMap
: LoopringMap
<TickerData
> }>
▸ getAllTokenBalances<R
, T
>(request
): Promise
<{ raw_data
: R
; tokenBalances
: LoopringMap
<string
> }>
Name | Type |
---|---|
R |
R |
T |
string |
Name | Type |
---|---|
request |
GetALLTokenBalancesRequest |
Promise
<{ raw_data
: R
; tokenBalances
: LoopringMap
<string
> }>
▸ getAllowances<R
, T
>(request
): Promise
<{ raw_data
: R
; tokenAllowances
: Map
<T
, string
> }>
Name | Type |
---|---|
R |
R |
T |
string |
Name | Type |
---|---|
request |
GetAllowancesRequest |
Promise
<{ raw_data
: R
; tokenAllowances
: Map
<T
, string
> }>
▸ getAvailableBroker(request
): Promise
<{ broker
: string
}>
Name | Type |
---|---|
request |
GetAvailableBrokerRequest |
Promise
<{ broker
: string
}>
▸ getCandlestick<R
>(request
, url?
): Promise
<{ candlesticks
: Candlestick
[] ; raw_data
: R
}>
Name |
---|
R |
Name | Type | Default value |
---|---|---|
request |
GetCandlestickRequest |
undefined |
url |
string |
LOOPRING_URLs.GET_CANDLESTICK |
Promise
<{ candlesticks
: Candlestick
[] ; raw_data
: R
}>
▸ 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
}>
▸ getDepth<R
>(request
, url?
): Promise
<{ depth
: DepthData
; raw_data
: R
}>
Name |
---|
R |
Name | Type | Default value |
---|---|---|
request |
GetDepthRequest |
undefined |
url |
string |
LOOPRING_URLs.GET_DEPTH |
Promise
<{ depth
: DepthData
; raw_data
: R
}>
▸ getEthBalances<R
>(request
): Promise
<{ ethBalance
: string
; raw_data
: R
}>
Name |
---|
R |
Name | Type |
---|---|
request |
GetEthBalancesRequest |
Promise
<{ ethBalance
: string
; raw_data
: R
}>
▸ getEthNonce<R
>(request
): Promise
<{ nonce
: number
; raw_data
: R
}>
Name |
---|
R |
Name | Type |
---|---|
request |
GetEthNonceRequest |
Promise
<{ nonce
: number
; raw_data
: R
}>
▸ getExchangeFeeInfo<R
>(): Promise
<{ ammTradingFees
: VipFeeRateInfoMap
; orderbookTradingFees
: VipFeeRateInfoMap
; orderbookTradingFeesStablecoin
: VipFeeRateInfoMap
; otherFees
: { [key: string]
: string
; } ; raw_data
: R
}>
Name |
---|
R |
Promise
<{ ammTradingFees
: VipFeeRateInfoMap
; orderbookTradingFees
: VipFeeRateInfoMap
; orderbookTradingFeesStablecoin
: VipFeeRateInfoMap
; otherFees
: { [key: string]
: string
; } ; raw_data
: R
}>
▸ getExchangeInfo<R
>(): Promise
<{ exchangeInfo
: ExchangeInfo
; raw_data
: R
}>
Name |
---|
R |
Promise
<{ exchangeInfo
: ExchangeInfo
; raw_data
: R
}>
▸ getFiatPrice<R
>(request
): Promise
<any
>
Name |
---|
R |
Name | Type |
---|---|
request |
GetFiatPriceRequest |
Promise
<any
>
▸ getGasPrice<R
>(): Promise
<{ gasPrice
: number
; raw_data
: R
}>
Name |
---|
R |
Promise
<{ gasPrice
: number
; raw_data
: R
}>
▸ getGasPriceRange<R
>(): Promise
<{ gasPriceRanges
: any
; raw_data
: R
}>
Name |
---|
R |
Promise
<{ gasPriceRanges
: any
; raw_data
: R
}>
▸ getMarketTrades<R
>(request
): Promise
<{ marketTrades
: MarketTradeInfo
[] ; raw_data
: R
; totalNum
: number
}>
Name |
---|
R |
Name | Type |
---|---|
request |
GetMarketTradesRequest |
Promise
<{ marketTrades
: MarketTradeInfo
[] ; raw_data
: R
; totalNum
: number
}>
▸ getMarkets<R
>(url?
): Promise
<{ marketArr
: string
[] ; marketArrStr
: string
; markets
: LoopringMap
<MarketInfo
> ; pairs
: LoopringMap
<TokenRelatedInfo
> ; raw_data
: R
; tokenArr
: string
[] ; tokenArrStr
: string
}>
Name |
---|
R |
Name | Type | Default value |
---|---|---|
url |
string |
LOOPRING_URLs.GET_MARKETS |
Promise
<{ marketArr
: string
[] ; marketArrStr
: string
; markets
: LoopringMap
<MarketInfo
> ; pairs
: LoopringMap
<TokenRelatedInfo
> ; raw_data
: R
; tokenArr
: string
[] ; tokenArrStr
: string
}>
▸ getMixCandlestick<R
>(request
): Promise
<{ candlesticks
: Candlestick
[] ; raw_data
: R
}>
Name |
---|
R |
Name | Type |
---|---|
request |
GetCandlestickRequest |
Promise
<{ candlesticks
: Candlestick
[] ; raw_data
: R
}>
▸ getMixDepth<R
>(request
): Promise
<{ depth
: DepthData
; raw_data
: R
}>
Name |
---|
R |
Name | Type |
---|---|
request |
GetDepthRequest |
Promise
<{ depth
: DepthData
; raw_data
: R
}>
▸ getMixMarkets<R
>(): Promise
<{ marketArr
: string
[] ; marketArrStr
: string
; markets
: LoopringMap
<MarketInfo
> ; pairs
: LoopringMap
<TokenRelatedInfo
> ; raw_data
: R
; tokenArr
: string
[] ; tokenArrStr
: string
}>
Name |
---|
R |
Promise
<{ marketArr
: string
[] ; marketArrStr
: string
; markets
: LoopringMap
<MarketInfo
> ; pairs
: LoopringMap
<TokenRelatedInfo
> ; raw_data
: R
; tokenArr
: string
[] ; tokenArrStr
: string
}>
▸ getMixTicker<R
>(request
): Promise
<{ raw_data
: R
; tickList
: TickerData
[] ; tickMap
: LoopringMap
<TickerData
> }>
Name |
---|
R |
Name | Type |
---|---|
request |
GetTickerRequest |
Promise
<{ raw_data
: R
; tickList
: TickerData
[] ; tickMap
: LoopringMap
<TickerData
> }>
▸ getProtocolPortrait<R
>(): Promise
<{ raw_data
: R
} & R
>
Name |
---|
R |
Promise
<{ raw_data
: R
} & R
>
▸ getRecommendedMarkets<R
>(): Promise
<{ raw_data
: R
; recommended
: string
[] }>
Name |
---|
R |
Promise
<{ raw_data
: R
; recommended
: string
[] }>
▸ getRelayerCurrentTime<R
>(): Promise
<{ raw_data
: R
} & R
>
Name |
---|
R |
Promise
<{ raw_data
: R
} & R
>
▸ getTicker<R
>(request
, url?
): Promise
<{ raw_data
: R
; tickList
: TickerData
[] ; tickMap
: LoopringMap
<TickerData
> }>
Name |
---|
R |
Name | Type | Default value |
---|---|---|
request |
GetTickerRequest |
undefined |
url |
string |
LOOPRING_URLs.GET_TICKER |
Promise
<{ raw_data
: R
; tickList
: TickerData
[] ; tickMap
: LoopringMap
<TickerData
> }>
▸ getTokenBalances<R
, T
>(request
): Promise
<{ raw_data
: R
; tokenBalances
: Map
<T
, string
> }>
Name | Type |
---|---|
R |
R |
T |
string |
Name | Type |
---|---|
request |
GetTokenBalancesRequest |
Promise
<{ raw_data
: R
; tokenBalances
: Map
<T
, string
> }>
▸ getTokens<R
>(): Promise
<TOKENMAPLIST
& { raw_data
: R
}>
Name |
---|
R |
Promise
<TOKENMAPLIST
& { raw_data
: R
}>
▸ getWithdrawalAgents<R
>(request
): Promise
<{ raw_data
: R
; supportTokenMap
: { [key: string]
: any
; } }>
Name |
---|
R |
Name | Type |
---|---|
request |
GetWithdrawalAgentsRequest |
Promise
<{ raw_data
: R
; supportTokenMap
: { [key: string]
: any
; } }>
▸ 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