@loopring-web/loopring-sdk / Exports

@loopring-web/loopring-sdk

Table of contents

Enumerations

Classes

Interfaces

Type aliases

Properties

Variables

Functions

Type aliases

ERROR_INFO

Ƭ ERROR_INFO: Object

Type declaration

Name Type
resultInfo RESULT_INFO

Defined in

defs/error_codes.ts:69


GetAccountRequest

Ƭ GetAccountRequest: { owner: string } | { accountId: number }

Defined in

defs/loopring_defs.ts:697


GetNFTOffchainFeeAmtRequest

Ƭ GetNFTOffchainFeeAmtRequest: { accountId: number ; amount?: string } & XOR<{ requestType: Omit<OffchainNFTFeeReqType, 9 | 10> }, { requestType: 9 ; tokenAddress: string } | { deployInWithdraw?: boolean ; requestType: 10 ; tokenAddress: string }>

methodof OffchainNFTFeeReqType.NFT_MINT

requires tokenAddress

methodof {} OffchainNFTFeeReqType.NFT_WITHDRAWAL

param

Defined in

defs/loopring_defs.ts:763


GetOffchainFeeAmtRequest

Ƭ GetOffchainFeeAmtRequest: { accountId: number ; amount?: string } & { requestType: Omit<OffchainFeeReqType, OFFCHAIN_WITHDRAWAL | AMM_JOIN | AMM_EXIT | ORDER | FAST_OFFCHAIN_WITHDRAWAL> } | { requestType: OFFCHAIN_WITHDRAWAL | AMM_JOIN | AMM_EXIT | ORDER ; tokenSymbol: string } | { amount: string ; requestType: FAST_OFFCHAIN_WITHDRAWAL ; tokenSymbol: string }

Defined in

defs/loopring_defs.ts:728


GetUserNFTDepositHistoryRequest

Ƭ GetUserNFTDepositHistoryRequest: Object

Type declaration

Name Type
accountId number
end? number
hashes? string
limit? number
nftData? string
start? number
startId? number
txStatus? string

Defined in

defs/loopring_defs.ts:2387


GetUserNFTMintHistoryRequest

Ƭ GetUserNFTMintHistoryRequest: Object

Type declaration

Name Type
accountId number
end? number
hashes? string
limit? number
nftData? string
start? number
startId? number
txStatus? string

Defined in

defs/loopring_defs.ts:2374


GetUserNFTTransferHistoryRequest

Ƭ GetUserNFTTransferHistoryRequest: Object

Type declaration

Name Type
accountId number
end? number
hashes? string
limit? number
nftData? string
start? number
txStatus? string

Defined in

defs/loopring_defs.ts:2362


GetUserNFTWithdrawalHistoryRequest

Ƭ GetUserNFTWithdrawalHistoryRequest: Object

Type declaration

Name Type
accountId number
end? number
hashes? string
limit? number
nftData? string
start? number
startId? number
txStatus? string

Defined in

defs/loopring_defs.ts:2398


GuardiaContractAddress

Ƭ GuardiaContractAddress: string

export

interface ApproveHebaoRequest

Defined in

defs/loopring_defs.ts:2590


Guardian

Ƭ Guardian: Object

Type declaration

Name Type
address string
businessDataJson any
createAt number
ens string
id string
messageHash string
signedRequest any
type keyof typeof HEBAO_META_TYPE

Defined in

defs/loopring_defs.ts:2574


HebaoOperationLog

Ƭ HebaoOperationLog: Object

Type declaration

Name Type
createdAt number
ens string
from string
hebaoTxType HEBAO_META_TYPE
id number
status 0 \ 1
to string

Defined in

defs/loopring_defs.ts:2564


IPFS_METADATA

Ƭ IPFS_METADATA: Object

Type declaration

Name Type
base { decimals: number ; description: string ; image: string ; localization: string ; name: string ; properties: string }
base.decimals number
base.description string
base.image string
base.localization string
base.name string
base.properties string
extra { animationUrl: string ; attributes: string ; backgroundColor: string ; externalUrl: string ; imageData: string ; minter: string ; youtubeUrl: string }
extra.animationUrl string
extra.attributes string
extra.backgroundColor string
extra.externalUrl string
extra.imageData string
extra.minter string
extra.youtubeUrl string
imageSize { [P in NFT_IMAGE_SIZES]?: string }
network 0
nftId? string
nftType NFTType
tokenAddress string
tokenId string
uri string

Defined in

defs/loopring_defs.ts:2289


NFTOrderRequestV3

Ƭ NFTOrderRequestV3: { accountId: number ; affiliate?: string ; allOrNone: boolean ; clientOrderId?: string ; eddsaSignature?: string ; exchange: string ; fillAmountBOrS: boolean ; maxFeeBips?: number | 0 ; orderType?: string ; storageId: number ; taker?: string ; tradeChannel?: string ; validUntil: number } & XOR<{ buyToken: TokenVolumeV5 ; sellToken: NFTTokenAmountInfo }, { buyToken: NFTTokenAmountInfo ; sellToken: TokenVolumeV5 }>

export

interface NFTOrderRequestV3

Defined in

defs/loopring_defs.ts:1850


NftData

Ƭ NftData: string

Defined in

defs/loopring_defs.ts:2345


Protector

Ƭ Protector: Object

Type declaration

Name Type
address string
ens string
lockStatus HEBAO_LOCK_STATUS

Defined in

defs/loopring_defs.ts:2559


TX_HASH_API

Ƭ TX_HASH_API: Object

Type declaration

Name Type
hash? string
resultInfo? RESULT_INFO

Defined in

defs/loopring_defs.ts:48


TX_HASH_RESULT

Ƭ TX_HASH_RESULT<T>: T & { raw_data: T }

Type parameters

Name
T

Defined in

defs/loopring_defs.ts:49


TokenAddress

Ƭ TokenAddress: string

Defined in

defs/loopring_defs.ts:667


UserNFTMintHistoryTx

Ƭ UserNFTMintHistoryTx: Object

Type declaration

Name Type
accountId number
amount string
blockIdInfo { blockId: number ; indexInBlock: number }
blockIdInfo.blockId number
blockIdInfo.indexInBlock number
createdAt number
feeAmount string
feeTokenSymbol string
hash string
id string
memo string
minterAddress string
minterId number
nftData string
owner string
requestId number
status string
storageInfo { accountId: number ; storageId: number ; tokenId: number }
storageInfo.accountId number
storageInfo.storageId number
storageInfo.tokenId number
txHash string
updatedAt number

Defined in

defs/loopring_defs.ts:2488


UserPwdResetTx

Ƭ UserPwdResetTx: UserRegTx

Defined in

defs/loopring_defs.ts:1012


UserTrade

Ƭ UserTrade: MarketTradeInfo

Defined in

defs/loopring_defs.ts:1280


VipFeeRateInfoMap

Ƭ VipFeeRateInfoMap: Object

Index signature

▪ [key: string]: VipFeeRateInfo

Defined in

defs/loopring_defs.ts:46


Without

Ƭ Without<T, U>: { [P in Exclude]?: never }

Type parameters

Name
T
U

Defined in

defs/loopring_defs.ts:35


XOR

Ƭ XOR<T, U>: T | U extends { [key: string]: any; } ? Without<T, U> & U | Without<U, T> & T : T | U

Type parameters

Name
T
U

Defined in

defs/loopring_defs.ts:36

Properties

contractWallet_abi

contractWallet_abi: ({ constant: undefined = true; inputs: { internalType: string = "bytes"; name: string = "_data"; type: string = "bytes" }[] ; name: string = "isValidSignature"; outputs: { internalType: string = "bytes4"; name: string = "magicValue"; type: string = "bytes4" }[] ; payable: undefined = false; stateMutability: string = "view"; type: string = "function" } | { constant: boolean = true; inputs: { name: string = "_account"; type: string = "address" }[] ; name: string = "getKeyData"; outputs: { name: string = ""; type: string = "address" }[] ; payable: boolean = false; stateMutability: string = "view"; type: string = "function" })[]


erc20_abi

erc20_abi: ({ anonymous: undefined = false; constant: boolean = false; inputs: { name: string = "_spender"; type: string = "address" }[] ; name: string = "approve"; outputs: { name: string = ""; type: string = "bool" }[] ; payable: boolean = false; stateMutability: string = "nonpayable"; type: string = "function" } | { anonymous: undefined = false; constant: undefined = true; inputs: undefined ; name: undefined = "Approval"; outputs: undefined ; payable: boolean = true; stateMutability: string = "payable"; type: string = "fallback" } | { anonymous: boolean = false; constant: undefined = true; inputs: { indexed: boolean = true; name: string = "owner"; type: string = "address" }[] ; name: string = "Approval"; outputs: undefined ; payable: undefined = false; stateMutability: undefined = "payable"; type: string = "event" })[]


exchange_abi

exchange_abi: { inputs: { internalType: string = "address"; name: string = "owner"; type: string = "address" }[] ; name: string = "getAmountWithdrawable"; outputs: { internalType: string = "uint256"; name: string = ""; type: string = "uint256" }[] ; stateMutability: string = "view"; type: string = "function" }[]


hebao_abi

hebao_abi: { inputs: { internalType: string = "address"; name: string = "wallet"; type: string = "address" }[] ; name: string = "lock"; outputs: never[] = []; stateMutability: string = "nonpayable"; type: string = "function" }[]

Variables

ApproveVal

Const ApproveVal: Object

Type declaration

Name Type
Max string
Zero string

Defined in

api/contract_api.ts:20


IsMobile

Const IsMobile: Object

Type declaration

Name Type
Android () => null \ RegExpMatchArray
BlackBerry () => null \ RegExpMatchArray
Ethereum () => any
Opera () => null \ RegExpMatchArray
Windows () => null \ RegExpMatchArray
any () => any
iOS () => null \ RegExpMatchArray

Defined in

defs/index.ts:10


KEY_MESSAGE

Const KEY_MESSAGE: string

Defined in

api/base_api.ts:30


NFTFactory

Const NFTFactory: Object

Type declaration

Name Type
1 string
5 string

Defined in

defs/web3_defs.ts:26


NetworkContextName

Const NetworkContextName: "NETWORK"

Defined in

defs/web3_defs.ts:6


SoursURL

Const SoursURL: "https://static.loopring.io/assets/"

Defined in

defs/loopring_constants.ts:19

Functions

addHexPrefix

addHexPrefix(input): string

Returns hex string with '0x' prefix

Parameters

Name Type
input any

Returns

string

Defined in

utils/formatter.ts:16


ammPoolCalc

ammPoolCalc(rawVal, isAtoB, coinA, coinB): Object

Parameters

Name Type
rawVal string
isAtoB boolean
coinA TokenVolumeV3
coinB TokenVolumeV3

Returns

Object

Name Type
output string
ratio BigNumber

Defined in

utils/swap_calc_utils.ts:785


approve

approve(web3, from, to, depositAddress, _value, chainId, nonce, gasPrice, gasLimit, sendByMetaMask): Promise<any>

Parameters

Name Type
web3 default
from string
to string
depositAddress string
_value string
chainId ChainId
nonce number
gasPrice number
gasLimit number
sendByMetaMask boolean

Returns

Promise<any>

Defined in

api/contract_api.ts:152


approveMax

approveMax(web3, owner, tokenAddress, depositAddress, gasPrice, gasLimit, chainId?, nonce, sendByMetaMask?): Promise<any>

Approve Max

Parameters

Name Type Default value
web3 any undefined
owner string undefined
tokenAddress string undefined
depositAddress string undefined
gasPrice number undefined
gasLimit number undefined
chainId ChainId ChainId.GOERLI
nonce number undefined
sendByMetaMask boolean false

Returns

Promise<any>

Defined in

api/contract_api.ts:224


approveZero

approveZero(web3, owner, tokenAddress, depositAddress, gasPrice, gasLimit, chainId?, nonce, sendByMetaMask?): Promise<any>

Approve Zero

Parameters

Name Type Default value
web3 any undefined
owner string undefined
tokenAddress string undefined
depositAddress string undefined
gasPrice number undefined
gasLimit number undefined
chainId ChainId ChainId.GOERLI
nonce number undefined
sendByMetaMask boolean false

Returns

Promise<any>

Defined in

api/contract_api.ts:191


clearHexPrefix

clearHexPrefix(input): string

Returns hex string without '0x' prefix

Parameters

Name Type Description
input any string

Returns

string

Defined in

utils/formatter.ts:194


contractWalletValidate32

contractWalletValidate32(web3, account, msg, sig): Promise<unknown>

Parameters

Name Type
web3 any
account string
msg string
sig any

Returns

Promise<unknown>

Defined in

api/base_api.ts:185


convertPublicKey

convertPublicKey(pk): BN

Parameters

Name Type
pk PublicKey

Returns

BN

Defined in

api/sign/sign_tools.ts:392


convertPublicKey2

convertPublicKey2(pk): BN

Parameters

Name Type
pk PublicKey

Returns

BN

Defined in

api/sign/sign_tools.ts:387


deposit

deposit(web3, from, exchangeAddress, token, value, fee, gasPrice, gasLimit, chainId?, nonce, sendByMetaMask?, to?): Promise<any>

deposit

Parameters

Name Type Default value
web3 any undefined
from string undefined
exchangeAddress string undefined
token TokenInfo undefined
value number undefined
fee number undefined
gasPrice number undefined
gasLimit number undefined
chainId ChainId ChainId.GOERLI
nonce number undefined
sendByMetaMask boolean true
to? string undefined

Returns

Promise<any>

Defined in

api/contract_api.ts:253


dumpError400

dumpError400(reason, src?): void

Parameters

Name Type Default value
reason any undefined
src string ""

Returns

void

Defined in

utils/network_tools.ts:2


ecRecover

ecRecover(web3, account, msg, sig): Promise<unknown>

Parameters

Name Type
web3 default
account string
msg string
sig any

Returns

Promise<unknown>

Defined in

api/base_api.ts:156


ecRecover2

ecRecover2(account, message, signature): Promise<unknown>

Parameters

Name Type
account string
message string
signature any

Returns

Promise<unknown>

Defined in

api/base_api.ts:258


eddsaSign

eddsaSign(typedData, eddsaKey): Object

Parameters

Name Type
typedData any
eddsaKey string

Returns

Object

Name Type
eddsaSig string

Defined in

api/sign/sign_tools.ts:1398


fcWalletValid

fcWalletValid(web3, account, msg, result, accountId, chainId, counterFactualInfo?): Promise<{ counterFactualInfo?: CounterFactualInfo ; error?: any ; result?: boolean }>

Parameters

Name Type
web3 any
account string
msg string
result any
accountId number
chainId ChainId
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo?: CounterFactualInfo ; error?: any ; result?: boolean }>

Defined in

api/base_api.ts:492


forceWithdrawal

forceWithdrawal(web3, from, accountID, exchangeAddress, token, fee, gasPrice, gasLimit, chainId?, nonce, sendByMetaMask?): Promise<any>

forceWithdrawal

Parameters

Name Type Default value
web3 any undefined
from string undefined
accountID number undefined
exchangeAddress string undefined
token TokenInfo undefined
fee number undefined
gasPrice number undefined
gasLimit number undefined
chainId ChainId ChainId.GOERLI
nonce number undefined
sendByMetaMask boolean false

Returns

Promise<any>

Defined in

api/contract_api.ts:302


formatAddress

formatAddress(mixed): string

Returns hex string of a given address

Parameters

Name Type Description
mixed string \ Buffer \ Uint8Array Buffer \ string \ Uint8Array

Returns

string

Defined in

utils/formatter.ts:176


formatEddsaKey

formatEddsaKey(key): string

Parameters

Name Type
key any

Returns

string

Defined in

utils/formatter.ts:255


formatKey

formatKey(mixed): string

Returns formatted hex string of a given private key

Parameters

Name Type Description
mixed string \ Buffer \ Uint8Array Buffer \ string \ Uint8Array

Returns

string

Defined in

utils/formatter.ts:160


formatSig

formatSig(rpcSig): string

Parameters

Name Type
rpcSig string

Returns

string

Defined in

api/base_api.ts:328


fromGWEI

fromGWEI(value): BigNumber

Parameters

Name Type Description
value any number \ BigNumber \ Buffer \ string

Returns

BigNumber

Defined in

utils/formatter.ts:142


fromWEI

fromWEI(tokens, symbol, valueInWEI, precision?, ceil?): undefined | string

Parameters

Name Type
tokens any
symbol any
valueInWEI any
precision? any
ceil? any

Returns

undefined | string

Defined in

utils/swap_calc_utils.ts:51


genExchangeData

genExchangeData(method, data): any

Parameters

Name Type
method string
data any

Returns

any

Defined in

api/contract_api.ts:148


generateKeyPair

generateKeyPair(__namedParameters): Promise<{ counterFactualInfo: any = result.counterFactualInfo; formatedPx: string ; formatedPy: string ; keyPair: { publicKeyX: string ; publicKeyY: string ; secretKey: string } ; sk: string }>

Parameters

Name Type
__namedParameters KeyPairParams

Returns

Promise<{ counterFactualInfo: any = result.counterFactualInfo; formatedPx: string ; formatedPy: string ; keyPair: { publicKeyX: string ; publicKeyY: string ; secretKey: string } ; sk: string }>

Defined in

api/sign/sign_tools.ts:68


getAccountArg

getAccountArg(): Object

Returns

Object

Name Type
topic WsTopicType

Defined in

defs/ws_defs.ts:26


getAmmExitEcdsaTypedData

getAmmExitEcdsaTypedData(data, patch): EIP712TypedData

Parameters

Name Type
data ExitAmmPoolRequest
patch AmmPoolRequestPatch

Returns

EIP712TypedData

Defined in

api/sign/sign_tools.ts:1469


getAmmJoinEcdsaTypedData

getAmmJoinEcdsaTypedData(data, patch): Object

Parameters

Name Type
data JoinAmmPoolRequest
patch AmmPoolRequestPatch

Returns

Object

Name Type
domain { chainId: ChainId = patch.chainId; name: string = patch.ammName; verifyingContract: string = patch.poolAddress; version: string = "1.0.0" }
domain.chainId ChainId
domain.name string
domain.verifyingContract string
domain.version string
message { fee: string = data.fee; joinAmounts: string[] ; joinStorageIDs: number[] = data.storageIds; mintMinAmount: string = data.joinTokens.minimumLp.volume; owner: string = data.owner; validUntil: undefined \ number = data.validUntil }
message.fee string
message.joinAmounts string[]
message.joinStorageIDs number[]
message.mintMinAmount string
message.owner string
message.validUntil undefined \ number
primaryType string
types { EIP712Domain: { name: string = "name"; type: string = "string" }[] ; PoolJoin: { name: string = "owner"; type: string = "address" }[] }
types.EIP712Domain { name: string = "name"; type: string = "string" }[]
types.PoolJoin { name: string = "owner"; type: string = "address" }[]

Defined in

api/sign/sign_tools.ts:1414


getAmmpoolArg

getAmmpoolArg(poolAddress): Object

Parameters

Name Type
poolAddress string

Returns

Object

Name Type
poolAddress string
snapshot boolean
topic WsTopicType

Defined in

defs/ws_defs.ts:145


getBaseQuote

getBaseQuote(symbol): { base: undefined = undefined; quote: undefined = undefined } | { base: string ; quote: string }

Parameters

Name Type
symbol string

Returns

{ base: undefined = undefined; quote: undefined = undefined } | { base: string ; quote: string }

Defined in

utils/symbol_tools.ts:5


getCandlestickArg

getCandlestickArg(market): Object

Parameters

Name Type
market string

Returns

Object

Name Type
market string
topic WsTopicType

Defined in

defs/ws_defs.ts:138


getCurPrice

getCurPrice(reserveIn, reserveOut): string

Parameters

Name Type
reserveIn string
reserveOut string

Returns

string

Defined in

utils/swap_calc_utils.ts:410


getDisplaySymbol

getDisplaySymbol(settingsCurrency): "" | "¥" | "$"

Returns symbol of a given kind of currency

Parameters

Name Type
settingsCurrency any

Returns

"" | "¥" | "$"

Defined in

utils/formatter.ts:215


getEcDSASig

getEcDSASig(web3, typedData, address, type, chainId, accountId?, pwd?, walletType?, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type Default value
web3 any undefined
typedData any undefined
address undefined \ string undefined
type GetEcDSASigType undefined
chainId ChainId undefined
accountId? number undefined
pwd string ""
walletType? ConnectorNames undefined
counterFactualInfo? CounterFactualInfo undefined

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:291


getEdDSASig

getEdDSASig(method, basePath, api_url, requestInfo, PrivateKey): string

Parameters

Name Type
method string
basePath string
api_url string
requestInfo any
PrivateKey undefined \ string

Returns

string

Defined in

api/sign/sign_tools.ts:173


getEdDSASigWithPoseidon

getEdDSASigWithPoseidon(inputs, PrivateKey): string

Parameters

Name Type
inputs any
PrivateKey undefined \ string

Returns

string

Defined in

api/sign/sign_tools.ts:204


getExistedMarket

getExistedMarket(marketArr, base, quote): Object

Parameters

Name Type
marketArr any
base undefined \ string
quote undefined \ string

Returns

Object

Name Type
amm undefined \ string
baseShow any
market any
quoteShow any

Defined in

utils/symbol_tools.ts:86


getMidPrice

getMidPrice(__namedParameters): Object

Parameters

Name Type
__namedParameters Object
__namedParameters._asks any
__namedParameters._bids any
__namedParameters.askReverse? boolean
__namedParameters.bidReverse? boolean

Returns

Object

Name Type
asks { ab_amtTotals: string[] ; ab_arr: ABInfo[] ; ab_prices: number[] ; ab_volTotals: string[] ; amtTotal: BigNumber ; best: number ; volTotal: BigNumber }
asks.ab_amtTotals string[]
asks.ab_arr ABInfo[]
asks.ab_prices number[]
asks.ab_volTotals string[]
asks.amtTotal BigNumber
asks.best number
asks.volTotal BigNumber
bids { ab_amtTotals: string[] ; ab_arr: ABInfo[] ; ab_prices: number[] ; ab_volTotals: string[] ; amtTotal: BigNumber ; best: number ; volTotal: BigNumber }
bids.ab_amtTotals string[]
bids.ab_arr ABInfo[]
bids.ab_prices number[]
bids.ab_volTotals string[]
bids.amtTotal BigNumber
bids.best number
bids.volTotal BigNumber
mid_price number

Defined in

api/exchange_api.ts:128


getMinReceived

getMinReceived(amountBOut, minimumDecimal, slipBips): Object

Parameters

Name Type
amountBOut string
minimumDecimal number
slipBips string

Returns

Object

Name Type
minReceived string
minReceivedVal string
minimumDecimal number

Defined in

utils/swap_calc_utils.ts:513


getMixOrderArg

getMixOrderArg(__namedParameters): any

Parameters

Name Type
__namedParameters Object
__namedParameters.count? number
__namedParameters.level number
__namedParameters.market string
__namedParameters.showOverlap? boolean
__namedParameters.snapshot? boolean

Returns

any

Defined in

defs/ws_defs.ts:94


getMixTradeArg

getMixTradeArg(market): Object

Parameters

Name Type
market string

Returns

Object

Name Type
market string
topic WsTopicType

Defined in

defs/ws_defs.ts:124


getNFTMintTypedData

getNFTMintTypedData(data, chainId, web3): EIP712TypedData

Parameters

Name Type
data NFTMintRequestV3
chainId ChainId
web3 default

Returns

EIP712TypedData

Defined in

api/sign/sign_tools.ts:784


getNFTTransferTypedData

getNFTTransferTypedData(data, chainId): EIP712TypedData

Parameters

Name Type
data OriginNFTTransferRequestV3
chainId ChainId

Returns

EIP712TypedData

Defined in

api/sign/sign_tools.ts:1275


getNFTWithdrawTypedData

getNFTWithdrawTypedData(data, chainId): EIP712TypedData

Parameters

Name Type
data NFTWithdrawRequestV3
chainId ChainId

Returns

EIP712TypedData

Defined in

api/sign/sign_tools.ts:839


getNftData

getNftData(request): any

Parameters

Name Type
request NFTMintRequestV3

Returns

any

Defined in

api/sign/sign_tools.ts:740


getNftTradeHash

getNftTradeHash(request): any

Parameters

Name Type
request NFTTradeRequestV3

Returns

any

Defined in

api/sign/sign_tools.ts:1242


getNonce

getNonce(web3, addr): Promise<number>

Parameters

Name Type
web3 default
addr string

Returns

Promise<number>

Defined in

api/contract_api.ts:96


getOrderArg

getOrderArg(market): Object

Parameters

Name Type
market string

Returns

Object

Name Type
market string
topic WsTopicType

Defined in

defs/ws_defs.ts:39


getOrderBookArg

getOrderBookArg(__namedParameters): any

Parameters

Name Type
__namedParameters Object
__namedParameters.count? number
__namedParameters.level number
__namedParameters.market string
__namedParameters.showOverlap? boolean
__namedParameters.snapshot? boolean
__namedParameters.topic? string

Returns

any

Defined in

defs/ws_defs.ts:63


getOrderHash

getOrderHash(request): any

Parameters

Name Type
request SubmitOrderRequestV3

Returns

any

Defined in

api/sign/sign_tools.ts:547


getOutputAmount

getOutputAmount(__namedParameters): { amountBOut: string ; amountBOutSlip: { minReceived: string ; minReceivedVal: string ; minimumDecimal: number } ; amountBOutWithoutFee: string ; amountS: string ; buyAmt: string ; exceedDepth: boolean ; feeBips: string ; isAtoB: boolean ; isReverse: boolean ; output: any ; priceImpact: string ; sellAmt: string ; slipBips: string ; takerRate: string } | undefined

Parameters

Name Type
__namedParameters Object
__namedParameters.ammPoolSnapshot undefined \ AmmPoolSnapshot
__namedParameters.buy string
__namedParameters.depth DepthData
__namedParameters.feeBips string
__namedParameters.input string
__namedParameters.isAtoB boolean
__namedParameters.marketArr string[]
__namedParameters.marketMap LoopringMap<MarketInfo>
__namedParameters.sell string
__namedParameters.slipBips string
__namedParameters.takerRate string
__namedParameters.tokenMap LoopringMap<TokenInfo>

Returns

{ amountBOut: string ; amountBOutSlip: { minReceived: string ; minReceivedVal: string ; minimumDecimal: number } ; amountBOutWithoutFee: string ; amountS: string ; buyAmt: string ; exceedDepth: boolean ; feeBips: string ; isAtoB: boolean ; isReverse: boolean ; output: any ; priceImpact: string ; sellAmt: string ; slipBips: string ; takerRate: string } | undefined

Defined in

utils/swap_calc_utils.ts:529


getPair

getPair(marketArr, market): Object

Parameters

Name Type
marketArr any
market string

Returns

Object

Name Type
amm undefined \ string
baseShow any
market any
quoteShow any

Defined in

utils/symbol_tools.ts:121


getPriceImpact

getPriceImpact(reserveIn, reserveOut, amountS, feeBips, takerFee): string

Parameters

Name Type
reserveIn string
reserveOut string
amountS string
feeBips string
takerFee string

Returns

string

Defined in

utils/swap_calc_utils.ts:446


getReserveInfo

getReserveInfo(sell, buy, marketArr, tokenMap, marketMap, ammPoolSnapshot?): undefined | { buyToken: undefined | TokenInfo ; coinA: undefined | TokenVolumeV3 ; coinB: undefined | TokenVolumeV3 ; isReverse: boolean ; marketInfo: MarketInfo ; reserveIn: string ; reserveOut: string ; sellToken: undefined | TokenInfo }

Parameters

Name Type Default value
sell string undefined
buy string undefined
marketArr string[] undefined
tokenMap LoopringMap<TokenInfo> undefined
marketMap LoopringMap<MarketInfo> undefined
ammPoolSnapshot undefined \ AmmPoolSnapshot undefined

Returns

undefined | { buyToken: undefined | TokenInfo ; coinA: undefined | TokenVolumeV3 ; coinB: undefined | TokenVolumeV3 ; isReverse: boolean ; marketInfo: MarketInfo ; reserveIn: string ; reserveOut: string ; sellToken: undefined | TokenInfo }

Defined in

utils/swap_calc_utils.ts:326


getTickerArg

getTickerArg(market): Object

Parameters

Name Type
market string

Returns

Object

Name Type
market string
topic WsTopicType

Defined in

defs/ws_defs.ts:131


getToPrice

getToPrice(amountS, amountB): string

Parameters

Name Type
amountS string
amountB string

Returns

string

Defined in

utils/swap_calc_utils.ts:428


getToken

getToken(tokens, token): any

Parameters

Name Type
tokens any
token any

Returns

any

Defined in

utils/swap_calc_utils.ts:27


getTokenInfoById

getTokenInfoById(tokenIdMap, id): undefined | TokenInfo

Parameters

Name Type
tokenIdMap Object
id number

Returns

undefined | TokenInfo

Defined in

utils/symbol_tools.ts:60


getTokenInfoBySymbol

getTokenInfoBySymbol(tokenSymbolMap, symbol): undefined | TokenInfo

Parameters

Name Type
tokenSymbolMap Object
symbol string

Returns

undefined | TokenInfo

Defined in

utils/symbol_tools.ts:45


getTokenInfoByToken

getTokenInfoByToken(ammBalance, tokens, token): Object

Parameters

Name Type
ammBalance any
tokens any
token any

Returns

Object

Name Type
reserve BigNumber
tokenInfo any
tokenVol any

Defined in

utils/swap_calc_utils.ts:34


getTradeArg

getTradeArg(market): Object

Parameters

Name Type
market string

Returns

Object

Name Type
market string
topic WsTopicType

Defined in

defs/ws_defs.ts:117


getTransferTypedData

getTransferTypedData(data, chainId): EIP712TypedData

Parameters

Name Type
data OriginTransferRequestV3
chainId ChainId

Returns

EIP712TypedData

Defined in

api/sign/sign_tools.ts:1105


getUpdateAccountEcdsaTypedData

getUpdateAccountEcdsaTypedData(data, chainId): EIP712TypedData

Parameters

Name Type
data UpdateAccountRequestV3
chainId ChainId

Returns

EIP712TypedData

Defined in

api/sign/sign_tools.ts:400


getWithdrawTypedData

getWithdrawTypedData(data, chainId): EIP712TypedData

Parameters

Name Type
data OffChainWithdrawalRequestV3
chainId ChainId

Returns

EIP712TypedData

Defined in

api/sign/sign_tools.ts:585


get_EddsaSig_ExitAmmPool

get_EddsaSig_ExitAmmPool(data, patch): Object

Parameters

Name Type
data ExitAmmPoolRequest
patch AmmPoolRequestPatch

Returns

Object

Name Type
eddsaSig string

Defined in

api/sign/sign_tools.ts:1514


get_EddsaSig_JoinAmmPool

get_EddsaSig_JoinAmmPool(data, patch): Object

Parameters

Name Type
data JoinAmmPoolRequest
patch AmmPoolRequestPatch

Returns

Object

Name Type
eddsaSig string

Defined in

api/sign/sign_tools.ts:1461


get_EddsaSig_NFT_Mint

get_EddsaSig_NFT_Mint(request, eddsaKey): string

Parameters

Name Type
request NFTMintRequestV3
eddsaKey string

Returns

string

Defined in

api/sign/sign_tools.ts:963


get_EddsaSig_NFT_Order

get_EddsaSig_NFT_Order(request, eddsaKey): string

Parameters

Name Type
request NFTOrderRequestV3
eddsaKey string

Returns

string

Defined in

api/sign/sign_tools.ts:986


get_EddsaSig_NFT_Transfer

get_EddsaSig_NFT_Transfer(request, eddsaKey): string

Parameters

Name Type
request OriginNFTTransferRequestV3
eddsaKey string

Returns

string

Defined in

api/sign/sign_tools.ts:1221


get_EddsaSig_NFT_Withdraw

get_EddsaSig_NFT_Withdraw(request, eddsaKey): string

Parameters

Name Type
request NFTWithdrawRequestV3
eddsaKey string

Returns

string

Defined in

api/sign/sign_tools.ts:708


get_EddsaSig_OffChainWithdraw

get_EddsaSig_OffChainWithdraw(request, eddsaKey): string

Parameters

Name Type
request OffChainWithdrawalRequestV3
eddsaKey string

Returns

string

Defined in

api/sign/sign_tools.ts:515


get_EddsaSig_Transfer

get_EddsaSig_Transfer(request, eddsaKey): string

Parameters

Name Type
request OriginTransferRequestV3
eddsaKey string

Returns

string

Defined in

api/sign/sign_tools.ts:1084


get_Is_Nft_Token

get_Is_Nft_Token(tokenId): boolean

Parameters

Name Type
tokenId number

Returns

boolean

Defined in

api/sign/sign_tools.ts:981


hasMarket

hasMarket(marketArr, market): boolean

Parameters

Name Type
marketArr any
market string

Returns

boolean

Defined in

utils/symbol_tools.ts:75


isContract

isContract(web3, address): Promise<any>

Parameters

Name Type
web3 any
address string

Returns

Promise<any>

Defined in

api/contract_api.ts:361


isEmpty

isEmpty(input): boolean

Parameters

Name Type
input any

Returns

boolean

Defined in

utils/swap_calc_utils.ts:85


makeExitAmmPoolRequest

makeExitAmmPoolRequest(rawVal, isAtoB, slippageTolerance, owner, fees, ammPoolSnapshot, tokenMap, idIdx, offchainId?): Object

Parameters

Name Type Default value
rawVal string undefined
isAtoB boolean undefined
slippageTolerance string undefined
owner string undefined
fees LoopringMap<OffchainFeeInfo> undefined
ammPoolSnapshot AmmPoolSnapshot undefined
tokenMap LoopringMap<TokenInfo> undefined
idIdx LoopringMap<string> undefined
offchainId number 0

Returns

Object

Name Type
request ExitAmmPoolRequest

Defined in

utils/swap_calc_utils.ts:899


makeExitAmmPoolRequest2

makeExitAmmPoolRequest2(rawVal, slippageTolerance, owner, fees, ammPoolSnapshot, tokenMap, idIdx, offchainId?): Object

Parameters

Name Type Default value
rawVal string undefined
slippageTolerance string undefined
owner string undefined
fees LoopringMap<OffchainFeeInfo> undefined
ammPoolSnapshot AmmPoolSnapshot undefined
tokenMap LoopringMap<TokenInfo> undefined
idIdx LoopringMap<string> undefined
offchainId number 0

Returns

Object

Name Type
ratio BigNumber
request ExitAmmPoolRequest
volA string
volA_show number
volB string
volB_show number

Defined in

utils/swap_calc_utils.ts:962


makeJoinAmmPoolRequest

makeJoinAmmPoolRequest(rawVal, isAtoB, slippageTolerance, owner, fees, ammPoolSnapshot, tokenMap, idIdx, coinAOffchainId?, coinBOffchainId?, rawValMatchForRawVal?): Object

Parameters

Name Type Default value Description
rawVal string undefined
isAtoB boolean undefined
slippageTolerance string undefined
owner string undefined
fees LoopringMap<OffchainFeeInfo> undefined
ammPoolSnapshot AmmPoolSnapshot undefined
tokenMap LoopringMap<TokenInfo> undefined
idIdx LoopringMap<string> undefined
coinAOffchainId number 0
coinBOffchainId number 0
rawValMatchForRawVal? string undefined first time add to pool

Returns

Object

Name Type
request JoinAmmPoolRequest

Defined in

utils/swap_calc_utils.ts:830


mykeyWalletValid

mykeyWalletValid(web3, account, msg, sig): Promise<unknown>

Parameters

Name Type
web3 any
account string
msg string
sig any

Returns

Promise<unknown>

Defined in

api/base_api.ts:221


numberWithCommas

numberWithCommas(number): any

Returns a number with commas as thousands separators

Parameters

Name Type Description
number any number

Returns

any

Defined in

utils/formatter.ts:265


padLeftEven

padLeftEven(hex): any

Parameters

Name Type
hex any

Returns

any

Defined in

utils/formatter.ts:206


personalSign

personalSign(web3, account, pwd, msg, walletType, chainId, accountId?, counterFactualInfo?, isMobile?): Promise<unknown>

Parameters

Name Type
web3 any
account undefined \ string
pwd string
msg string
walletType ConnectorNames
chainId ChainId
accountId? number
counterFactualInfo? CounterFactualInfo
isMobile? boolean

Returns

Promise<unknown>

Defined in

api/base_api.ts:347


recoverSignType

recoverSignType(web3, account, msg, sig): "" | "03"

Parameters

Name Type
web3 any
account string
msg string
sig string

Returns

"" | "03"

Defined in

api/base_api.ts:332


sendRawTx

sendRawTx(web3, from, to, value, data, chainId, nonce, gasPrice, gasLimit, sendByMetaMask?): Promise<any>

Parameters

Name Type Default value
web3 any undefined
from string undefined
to string undefined
value any undefined
data any undefined
chainId ChainId undefined
nonce undefined \ null \ number undefined
gasPrice any undefined
gasLimit undefined \ number undefined
sendByMetaMask boolean true

Returns

Promise<any>

Defined in

api/contract_api.ts:101


sendTransaction

sendTransaction(web3, tx): Promise<any>

description Sends ethereum tx through MetaMask

Parameters

Name Type
web3 any
tx any

Returns

Promise<any>

Defined in

api/contract_api.ts:341


sign

sign(web3, account, pwd, hash): Promise<unknown>

description sign hash

Parameters

Name Type
web3 any
account string
pwd string
hash string

Returns

Promise<unknown>

Defined in

api/contract_api.ts:36


signEip712

signEip712(web3, account, method, params): Promise<any>

description sign EIP712

Parameters

Name Type
web3 any
account string
method string
params any

Returns

Promise<any>

Defined in

api/sign/sign_tools.ts:238


signEip712WalletConnect

signEip712WalletConnect(web3, account, typedData): Promise<any>

Parameters

Name Type
web3 any
account string
typedData any

Returns

Promise<any>

Defined in

api/sign/sign_tools.ts:274


signEthereumTx

signEthereumTx(web3, account, rawTx, chainId): Promise<{ error: undefined = response.error; rawTx: any = jsonTx; result: string } | { error: any = response.error; rawTx: undefined = jsonTx; result: undefined }>

description Signs ethereum tx

Parameters

Name Type
web3 any
account string
rawTx any
chainId ChainId

Returns

Promise<{ error: undefined = response.error; rawTx: any = jsonTx; result: string } | { error: any = response.error; rawTx: undefined = jsonTx; result: undefined }>

Defined in

api/contract_api.ts:66


signNFTMintWithDataStructure

signNFTMintWithDataStructure(web3, owner, bodyParams, chainId, walletType, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams NFTMintRequestV3
chainId ChainId
walletType ConnectorNames
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:1012


signNFTMintWithDataStructureForContract

signNFTMintWithDataStructureForContract(web3, owner, bodyParams, chainId, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams NFTMintRequestV3
chainId ChainId
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:1060


signNFTMintWithoutDataStructure

signNFTMintWithoutDataStructure(web3, owner, bodyParams, chainId, walletType, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams NFTMintRequestV3
chainId ChainId
walletType ConnectorNames
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:1036


signNFTTransferWithDataStructureForContract

signNFTTransferWithDataStructureForContract(web3, owner, bodyParams, chainId, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams OriginNFTTransferRequestV3
chainId ChainId
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:1375


signNFTTransferWithoutDataStructure

signNFTTransferWithoutDataStructure(web3, owner, bodyParams, chainId, walletType, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams OriginNFTTransferRequestV3
chainId ChainId
walletType ConnectorNames
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:1344


signNFTWithdrawWithDataStructure

signNFTWithdrawWithDataStructure(web3, owner, bodyParams, chainId, walletType, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams NFTWithdrawRequestV3
chainId ChainId
walletType ConnectorNames
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:891


signNFTWithdrawWithDataStructureForContract

signNFTWithdrawWithDataStructureForContract(web3, owner, bodyParams, chainId, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams NFTWithdrawRequestV3
chainId ChainId
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:939


signNFTWithdrawWithoutDataStructure

signNFTWithdrawWithoutDataStructure(web3, owner, bodyParams, chainId, walletType, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams NFTWithdrawRequestV3
chainId ChainId
walletType ConnectorNames
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:915


signOffchainWithdrawWithDataStructure

signOffchainWithdrawWithDataStructure(web3, owner, bodyParams, chainId, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams OffChainWithdrawalRequestV3
chainId ChainId
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:637


signOffchainWithdrawWithDataStructureForContract

signOffchainWithdrawWithDataStructureForContract(web3, owner, bodyParams, chainId, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams OffChainWithdrawalRequestV3
chainId ChainId
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:684


signOffchainWithdrawWithoutDataStructure

signOffchainWithdrawWithoutDataStructure(web3, owner, bodyParams, chainId, walletType, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams OffChainWithdrawalRequestV3
chainId ChainId
walletType ConnectorNames
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:660


signTNFTransferWithDataStructure

signTNFTransferWithDataStructure(web3, owner, bodyParams, chainId, walletType, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams OriginNFTTransferRequestV3
chainId ChainId
walletType ConnectorNames
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:1320


signTransferWithDataStructure

signTransferWithDataStructure(web3, owner, bodyParams, chainId, walletType, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams OriginTransferRequestV3
chainId ChainId
walletType ConnectorNames
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:1150


signTransferWithDataStructureForContract

signTransferWithDataStructureForContract(web3, owner, bodyParams, chainId, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams OriginTransferRequestV3
chainId ChainId
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:1198


signTransferWithoutDataStructure

signTransferWithoutDataStructure(web3, owner, bodyParams, chainId, walletType, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
owner string
bodyParams OriginTransferRequestV3
chainId ChainId
walletType ConnectorNames
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:1174


signUpdateAccountWithDataStructure

signUpdateAccountWithDataStructure(web3, bodyParams, chainId, walletType, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
bodyParams UpdateAccountRequestV3
chainId ChainId
walletType ConnectorNames
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:445


signUpdateAccountWithDataStructureForContract

signUpdateAccountWithDataStructureForContract(web3, bodyParams, chainId, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
bodyParams UpdateAccountRequestV3
chainId ChainId
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:492


signUpdateAccountWithoutDataStructure

signUpdateAccountWithoutDataStructure(web3, bodyParams, chainId, walletType, accountId, counterFactualInfo?): Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Parameters

Name Type
web3 default
bodyParams UpdateAccountRequestV3
chainId ChainId
walletType ConnectorNames
accountId number
counterFactualInfo? CounterFactualInfo

Returns

Promise<{ counterFactualInfo: undefined = signature.counterFactualInfo; ecdsaSig: any = response.result } | { counterFactualInfo: any = signature.counterFactualInfo; ecdsaSig: any = signature.sig }>

Defined in

api/sign/sign_tools.ts:469


sleep

sleep(milliseconds): Promise<unknown>

Parameters

Name Type
milliseconds number

Returns

Promise<unknown>

Defined in

utils/network_tools.ts:13


toBN

toBN(mixed): BN

Parameters

Name Type Description
mixed any number \ BigNumber \ BN \ Buffer \ string

Returns

BN

Defined in

utils/formatter.ts:133


toBig

toBig(mixed): BigNumber

Parameters

Name Type Description
mixed string \ number \ Buffer \ Uint8Array \ BigNumber \ BN number \ BigNumber \ BN \ Buffer \ string \ Uint8Array

Returns

BigNumber

Defined in

utils/formatter.ts:107


toBuffer

toBuffer(mixed): Buffer | Uint8Array

Parameters

Name Type Description
mixed any Buffer\ number\ string (hex string must be with '0x' prefix)

Returns

Buffer | Uint8Array

Defined in

utils/formatter.ts:28


toFixed

toFixed(number, precision, ceil): string

Returns number in string with a given precision

Parameters

Name Type Description
number any number \ BigNumber
precision any number
ceil any bool round up

Returns

string

Defined in

utils/formatter.ts:233


toGWEI

toGWEI(value): BigNumber

Parameters

Name Type Description
value any number \ BigNumber \ Buffer \ string

Returns

BigNumber

Defined in

utils/formatter.ts:151


toHex

toHex(mixed): string

Parameters

Name Type Description
mixed string \ number \ Buffer \ Uint8Array \ BigNumber \ BN number \ BigNumber \ BN \ Buffer \ string \ Uint8Array

Returns

string

Defined in

utils/formatter.ts:51


toNumber

toNumber(mixed): number

Parameters

Name Type Description
mixed string \ number \ Buffer \ Uint8Array \ BigNumber \ BN number \ BigNumber \ BN \ Buffer \ string \ Uint8Array

Returns

number

Defined in

utils/formatter.ts:80


toWEI

toWEI(tokens, symbol, value, rm?): string

Parameters

Name Type Default value
tokens any undefined
symbol any undefined
value any undefined
rm any undefined

Returns

string

Defined in

utils/swap_calc_utils.ts:69


updatePriceImpact_new

updatePriceImpact_new(reverseIn, reverseOut, amountS, sellDecimal, amountBOut, buyDecimal, feeBips, takerFee, isAtoB, isReversed, exceedDepth, depth): string

Parameters

Name Type
reverseIn string
reverseOut string
amountS string
sellDecimal number
amountBOut string
buyDecimal number
feeBips string
takerFee string
isAtoB boolean
isReversed boolean
exceedDepth boolean
depth DepthData

Returns

string

Defined in

utils/swap_calc_utils.ts:466


zeroPad

zeroPad(num, places): Buffer | Uint8Array

Parameters

Name Type Description
num any number\ string (hex string must be with '0x' prefix)
places any number of zeros to pad

Returns

Buffer | Uint8Array

Defined in

utils/formatter.ts:42

results matching ""

    No results matching ""