@loopring-web/loopring-sdk / Exports / ExchangeAPI

Class: ExchangeAPI

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new ExchangeAPI(param, timeout?)

Parameters

Name Type Default value
param InitParam undefined
timeout number 3000

Inherited from

BaseAPI.constructor

Defined in

api/base_api.ts:86

Properties

baseUrl

Protected baseUrl: string = ""

Inherited from

BaseAPI.baseUrl

Defined in

api/base_api.ts:37


chainId

Protected chainId: ChainId = ChainId.MAINNET

Inherited from

BaseAPI.chainId

Defined in

api/base_api.ts:38


KEY_MESSAGE

Static KEY_MESSAGE: string = KEY_MESSAGE

Inherited from

BaseAPI.KEY_MESSAGE

Defined in

api/base_api.ts:36

Methods

disableWithdrawTokenList

disableWithdrawTokenList<R>(): Promise<{ disableWithdrawTokenList: any[] ; raw_data: R }>

Type parameters

Name
R

Returns

Promise<{ disableWithdrawTokenList: any[] ; raw_data: R }>

Defined in

api/exchange_api.ts:1051


genErr

genErr(err): RESULT_INFO

Parameters

Name Type
err Error

Returns

RESULT_INFO

Inherited from

BaseAPI.genErr

Defined in

api/base_api.ts:39


getAccount

getAccount<R>(request): Promise<{ accInfo: AccountInfo ; raw_data: R }>

Type parameters

Name
R

Parameters

Name Type
request GetAccountRequest

Returns

Promise<{ accInfo: AccountInfo ; raw_data: R }>

Defined in

api/exchange_api.ts:1125


getAccountServices

getAccountServices<R>(request): Promise<{ dAppTrade: any ; joinAmm: any ; legal: any ; order: any ; raw_data: R ; register: any }>

Type parameters

Name
R

Parameters

Name Type
request GetAccountServicesRequest

Returns

Promise<{ dAppTrade: any ; joinAmm: any ; legal: any ; order: any ; raw_data: R ; register: any }>

Defined in

api/exchange_api.ts:1226


getAllMixTickers

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

Parameters

Name Type Default value
markets undefined \ string undefined

Returns

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

Defined in

api/exchange_api.ts:834


getAllTickers

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

Parameters

Name Type Default value
markets undefined \ string undefined

Returns

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

Defined in

api/exchange_api.ts:854


getAllowances

getAllowances<R, T>(request): Promise<{ raw_data: R ; tokenAllowances: Map<T, string> }>

Type parameters

Name Type
R R
T string

Parameters

Name Type
request GetAllowancesRequest

Returns

Promise<{ raw_data: R ; tokenAllowances: Map<T, string> }>

Defined in

api/exchange_api.ts:608


getAvailableBroker

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

Returns

Promise<{ broker: string }>

Inherited from

BaseAPI.getAvailableBroker

Defined in

api/base_api.ts:97


getCandlestick

getCandlestick<R>(request, url?): Promise<{ candlesticks: Candlestick[] ; raw_data: R }>

Type parameters

Name
R

Parameters

Name Type Default value
request GetCandlestickRequest undefined
url string LOOPRING_URLs.GET_CANDLESTICK

Returns

Promise<{ candlesticks: Candlestick[] ; raw_data: R }>

Defined in

api/exchange_api.ts:884


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:108


getDepth

getDepth<R>(request, url?): Promise<{ depth: DepthData ; raw_data: R }>

Type parameters

Name
R

Parameters

Name Type Default value
request GetDepthRequest undefined
url string LOOPRING_URLs.GET_DEPTH

Returns

Promise<{ depth: DepthData ; raw_data: R }>

Defined in

api/exchange_api.ts:690


getEthBalances

getEthBalances<R>(request): Promise<{ ethBalance: string ; raw_data: R }>

Type parameters

Name
R

Parameters

Name Type
request GetEthBalancesRequest

Returns

Promise<{ ethBalance: string ; raw_data: R }>

Defined in

api/exchange_api.ts:543


getEthNonce

getEthNonce<R>(request): Promise<{ nonce: number ; raw_data: R }>

Type parameters

Name
R

Parameters

Name Type
request GetEthNonceRequest

Returns

Promise<{ nonce: number ; raw_data: R }>

Defined in

api/exchange_api.ts:1151


getExchangeFeeInfo

getExchangeFeeInfo<R>(): Promise<{ ammTradingFees: VipFeeRateInfoMap ; orderbookTradingFees: VipFeeRateInfoMap ; orderbookTradingFeesStablecoin: VipFeeRateInfoMap ; otherFees: { [key: string]: string; } ; raw_data: R }>

Type parameters

Name
R

Returns

Promise<{ ammTradingFees: VipFeeRateInfoMap ; orderbookTradingFees: VipFeeRateInfoMap ; orderbookTradingFeesStablecoin: VipFeeRateInfoMap ; otherFees: { [key: string]: string; } ; raw_data: R }>

Defined in

api/exchange_api.ts:216


getExchangeInfo

getExchangeInfo<R>(): Promise<{ exchangeInfo: ExchangeInfo ; raw_data: R }>

Type parameters

Name
R

Returns

Promise<{ exchangeInfo: ExchangeInfo ; raw_data: R }>

Defined in

api/exchange_api.ts:648


getFiatPrice

getFiatPrice<R>(request): Promise<any>

Type parameters

Name
R

Parameters

Name Type
request GetFiatPriceRequest

Returns

Promise<any>

Defined in

api/exchange_api.ts:1020


getGasPrice

getGasPrice<R>(): Promise<{ gasPrice: number ; raw_data: R }>

Type parameters

Name
R

Returns

Promise<{ gasPrice: number ; raw_data: R }>

Defined in

api/exchange_api.ts:1175


getGasPriceRange

getGasPriceRange<R>(): Promise<{ gasPriceRanges: any ; raw_data: R }>

Type parameters

Name
R

Returns

Promise<{ gasPriceRanges: any ; raw_data: R }>

Defined in

api/exchange_api.ts:1202


getMarketTrades

getMarketTrades<R>(request): Promise<{ marketTrades: MarketTradeInfo[] ; raw_data: R ; totalNum: number }>

Type parameters

Name
R

Parameters

Name Type
request GetMarketTradesRequest

Returns

Promise<{ marketTrades: MarketTradeInfo[] ; raw_data: R ; totalNum: number }>

Defined in

api/exchange_api.ts:1077


getMarkets

getMarkets<R>(url?): Promise<{ marketArr: string[] ; marketArrStr: string ; markets: LoopringMap<MarketInfo> ; pairs: LoopringMap<TokenRelatedInfo> ; raw_data: R ; tokenArr: string[] ; tokenArrStr: string }>

Type parameters

Name
R

Parameters

Name Type Default value
url string LOOPRING_URLs.GET_MARKETS

Returns

Promise<{ marketArr: string[] ; marketArrStr: string ; markets: LoopringMap<MarketInfo> ; pairs: LoopringMap<TokenRelatedInfo> ; raw_data: R ; tokenArr: string[] ; tokenArrStr: string }>

Defined in

api/exchange_api.ts:320


getMixCandlestick

getMixCandlestick<R>(request): Promise<{ candlesticks: Candlestick[] ; raw_data: R }>

Type parameters

Name
R

Parameters

Name Type
request GetCandlestickRequest

Returns

Promise<{ candlesticks: Candlestick[] ; raw_data: R }>

Defined in

api/exchange_api.ts:874


getMixDepth

getMixDepth<R>(request): Promise<{ depth: DepthData ; raw_data: R }>

Type parameters

Name
R

Parameters

Name Type
request GetDepthRequest

Returns

Promise<{ depth: DepthData ; raw_data: R }>

Defined in

api/exchange_api.ts:683


getMixMarkets

getMixMarkets<R>(): Promise<{ marketArr: string[] ; marketArrStr: string ; markets: LoopringMap<MarketInfo> ; pairs: LoopringMap<TokenRelatedInfo> ; raw_data: R ; tokenArr: string[] ; tokenArrStr: string }>

Type parameters

Name
R

Returns

Promise<{ marketArr: string[] ; marketArrStr: string ; markets: LoopringMap<MarketInfo> ; pairs: LoopringMap<TokenRelatedInfo> ; raw_data: R ; tokenArr: string[] ; tokenArrStr: string }>

Defined in

api/exchange_api.ts:413


getMixTicker

getMixTicker<R>(request): Promise<{ raw_data: R ; tickList: TickerData[] ; tickMap: LoopringMap<TickerData> }>

Type parameters

Name
R

Parameters

Name Type
request GetTickerRequest

Returns

Promise<{ raw_data: R ; tickList: TickerData[] ; tickMap: LoopringMap<TickerData> }>

Defined in

api/exchange_api.ts:750


getProtocolPortrait

getProtocolPortrait<R>(): Promise<{ raw_data: R } & R>

Type parameters

Name
R

Returns

Promise<{ raw_data: R } & R>

Defined in

api/exchange_api.ts:190


getRecommendedMarkets

getRecommendedMarkets<R>(): Promise<{ raw_data: R ; recommended: string[] }>

Type parameters

Name
R

Returns

Promise<{ raw_data: R ; recommended: string[] }>

Defined in

api/exchange_api.ts:285


getRelayerCurrentTime

getRelayerCurrentTime<R>(): Promise<{ raw_data: R } & R>

Type parameters

Name
R

Returns

Promise<{ raw_data: R } & R>

Defined in

api/exchange_api.ts:164


getTicker

getTicker<R>(request, url?): Promise<{ raw_data: R ; tickList: TickerData[] ; tickMap: LoopringMap<TickerData> }>

Type parameters

Name
R

Parameters

Name Type Default value
request GetTickerRequest undefined
url string LOOPRING_URLs.GET_TICKER

Returns

Promise<{ raw_data: R ; tickList: TickerData[] ; tickMap: LoopringMap<TickerData> }>

Defined in

api/exchange_api.ts:762


getTokenBalances

getTokenBalances<R, T>(request): Promise<{ raw_data: R ; tokenBalances: Map<T, string> }>

Type parameters

Name Type
R R
T string

Parameters

Name Type
request GetTokenBalancesRequest

Returns

Promise<{ raw_data: R ; tokenBalances: Map<T, string> }>

Defined in

api/exchange_api.ts:571


getTokens

getTokens<R>(): Promise<{ addressIndex: LoopringMap<string> ; coinMap: LoopringMap<{ company: string ; description?: string ; icon?: string ; name: string ; simpleName: string }> ; idIndex: LoopringMap<string> ; raw_data: R ; tokensMap: LoopringMap<TokenInfo> ; totalCoinMap: LoopringMap<{ company: string ; description?: string ; icon?: string ; name: string ; simpleName: string }> }>

Type parameters

Name
R

Returns

Promise<{ addressIndex: LoopringMap<string> ; coinMap: LoopringMap<{ company: string ; description?: string ; icon?: string ; name: string ; simpleName: string }> ; idIndex: LoopringMap<string> ; raw_data: R ; tokensMap: LoopringMap<TokenInfo> ; totalCoinMap: LoopringMap<{ company: string ; description?: string ; icon?: string ; name: string ; simpleName: string }> }>

Defined in

api/exchange_api.ts:428


getWithdrawalAgents

getWithdrawalAgents<R>(request): Promise<{ raw_data: R ; supportTokenMap: { [key: string]: any; } }>

Type parameters

Name
R

Parameters

Name Type
request GetWithdrawalAgentsRequest

Returns

Promise<{ raw_data: R ; supportTokenMap: { [key: string]: any; } }>

Defined in

api/exchange_api.ts:250


makeReq

Protected makeReq(): Request

Returns

Request

Inherited from

BaseAPI.makeReq

Defined in

api/base_api.ts:151


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:66


setBaseUrl

setBaseUrl(baseUrl): void

Parameters

Name Type
baseUrl string

Returns

void

Inherited from

BaseAPI.setBaseUrl

Defined in

api/base_api.ts:147


setChainId

setChainId(chainId): void

Parameters

Name Type
chainId ChainId

Returns

void

Inherited from

BaseAPI.setChainId

Defined in

api/base_api.ts:142

results matching ""

    No results matching ""