@loopring-web/loopring-sdk / Exports
Ƭ CalDualResult: Object
Name | Type |
---|---|
feeTokenSymbol? |
string |
feeVol |
string | undefined |
greaterEarnTokenSymbol |
string |
greaterEarnVol |
string |
lessEarnTokenSymbol |
string |
lessEarnVol |
string |
maxFeeBips |
number |
maxSellAmount |
string |
miniSellVol |
string |
quota |
string |
sellToken |
TokenInfo |
sellVol |
string |
Ƭ CollectionBasicMeta: Object
Name | Type |
---|---|
avatar? |
string |
banner? |
string |
description? |
string |
name |
string |
nftFactory? |
string |
owner |
string |
tileUri |
string |
Ƭ CollectionDelete: Object
Name | Type |
---|---|
accountId |
number |
collectionId |
number |
Ƭ CollectionExtendsKey: Object
Name | Type |
---|---|
baseUri |
string |
cached |
{ avatar : string ; banner : string ; thumbnail : string ; tileUri : string } |
cached.avatar |
string |
cached.banner |
string |
cached.thumbnail |
string |
cached.tileUri |
string |
cid? |
string |
collectionAddress |
string |
collectionTitle? |
string |
contractAddress |
string |
createdAt |
number |
deployStatus |
DEPLOYMENT_STATUS |
extra |
{ mintChannel : string ; properties : { isCounterFactualNFT : boolean ; isDeletable : boolean ; isEditable : boolean ; isLegacy : boolean ; isMintable : boolean ; isPublic : boolean } } |
extra.mintChannel |
string |
extra.properties |
{ isCounterFactualNFT : boolean ; isDeletable : boolean ; isEditable : boolean ; isLegacy : boolean ; isMintable : boolean ; isPublic : boolean } |
extra.properties.isCounterFactualNFT |
boolean |
extra.properties.isDeletable |
boolean |
extra.properties.isEditable |
boolean |
extra.properties.isLegacy |
boolean |
extra.properties.isMintable |
boolean |
extra.properties.isPublic |
boolean |
id? |
string |
isCounterFactualNFT? |
boolean |
isDeletable? |
boolean |
isEditable? |
boolean |
isLegacy? |
boolean |
isMintable? |
boolean |
isPublic? |
boolean |
nftType |
string |
thumbnail? |
string |
updatedAt |
number |
Ƭ CollectionLegacyMeta: Omit
<CollectionBasicMeta
, "owner"
> & { accountId
: number
; tokenAddress
: string
}
Ƭ CollectionMeta: CollectionExtendsKey
& CollectionBasicMeta
CollectionMeta
property
name string useToCreate Collection
property
name string
property
tileUri string option
property
owner? string option
property
nftFactory? string option
property
baseUri? string option
property
collectionTitle? string option
property
description? string option
property
avatar? string option
property
banner? string option
property
thumbnail? string option
property
cid? string option
Ƭ DualBalance: Object
Name | Type |
---|---|
coin |
string |
free |
string |
frozen |
string |
Ƭ DualBid: Object
Name | Type |
---|---|
baseProfit |
string |
baseQty |
string |
Ƭ DualIndex: Object
Name | Type |
---|---|
base |
string |
index |
string |
indexTime |
number |
quote |
string |
Ƭ DualPrice: Object
Name | Type |
---|---|
cacheQty |
string |
dualBid |
DualBid [] |
priceTime |
number |
productId |
string |
Ƭ DualProductAndPrice: Object
Name | Type |
---|---|
base |
string |
baseSize |
string |
createTime |
number |
currency |
string |
dualType |
DUAL_TYPE |
expireTime |
number |
expired |
boolean |
productId |
string |
profit |
string |
quote |
string |
ratio |
number |
strike |
string |
Ƭ DualRulesCoinsInfo: Object
Name | Type |
---|---|
base |
string |
baseMax |
string |
baseMin |
string |
basePrecision |
number |
baseProfitStep |
number |
currency |
string |
currencyMax |
string |
currencyMin |
string |
currencyPrecision |
number |
granulation |
number |
quote |
string |
Ƭ ERROR_INFO: Object
Name | Type |
---|---|
resultInfo |
RESULT_INFO |
Ƭ GetAccountRequest: { owner
: string
} | { accountId
: number
}
Ƭ GetDualInfosRequest: Object
Name | Type |
---|---|
baseSymbol |
string |
currency |
string |
dualType |
DUAL_TYPE |
limit |
number |
maxStrike? |
string |
minStrike? |
string |
quoteSymbol |
string |
startTime? |
number |
timeSpan? |
number |
Ƭ GetDualPricesRequest: Object
Name | Type |
---|---|
baseSymbol |
string |
productIds |
string |
Ƭ GetDualRuleRequest: Object
Name | Type |
---|---|
baseSymbol |
string |
currency? |
string |
Ƭ 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
Ƭ 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
} | { market
: string
; requestType
: DEFI_EXIT
| DEFI_JOIN
} | { amount
: string
; requestType
: FAST_OFFCHAIN_WITHDRAWAL
; tokenSymbol
: string
}
Ƭ GetUserNFTDepositHistoryRequest: Object
Name | Type |
---|---|
accountId |
number |
end? |
number |
hashes? |
string |
limit? |
number |
nftData? |
string |
start? |
number |
startId? |
number |
txStatus? |
string |
Ƭ GetUserNFTMintHistoryRequest: Object
Name | Type |
---|---|
accountId |
number |
end? |
number |
hashes? |
string |
limit? |
number |
nftData? |
string |
start? |
number |
startId? |
number |
txStatus? |
string |
Ƭ GetUserNFTTransferHistoryRequest: Object
Name | Type |
---|---|
accountId |
number |
end? |
number |
hashes? |
string |
limit? |
number |
nftData? |
string |
start? |
number |
txStatus? |
string |
Ƭ GetUserNFTWithdrawalHistoryRequest: Object
Name | Type |
---|---|
accountId |
number |
end? |
number |
hashes? |
string |
limit? |
number |
nftData? |
string |
start? |
number |
startId? |
number |
txStatus? |
string |
Ƭ GuardiaContractAddress: string
export
interface
ApproveHebaoRequest
Ƭ Guardian: Object
Name | Type |
---|---|
address |
string |
businessDataJson |
any |
createAt |
number |
ens |
string |
id |
string |
messageHash |
string |
signedRequest |
any |
type |
keyof typeof HEBAO_META_TYPE |
Ƭ HebaoOperationLog: Object
Name | Type |
---|---|
createdAt |
number |
ens |
string |
from |
string |
hebaoTxType |
HEBAO_META_TYPE |
id |
number |
status |
0 | 1 |
to |
string |
Ƭ IPFS_METADATA: Object
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 |
Ƭ LuckTokenClaim: Object
Name | Type |
---|---|
amount |
number |
claimId |
number |
claimer |
{ accountId : number ; address : string ; ens : string } |
claimer.accountId |
number |
claimer.address |
string |
claimer.ens |
string |
createdAt |
number |
hash |
string |
helper |
{ accountId : number ; address : number ; ens : number } |
helper.accountId |
number |
helper.address |
number |
helper.ens |
number |
referrer |
{ accountId : number ; address : number ; ens : string } |
referrer.accountId |
number |
referrer.address |
number |
referrer.ens |
string |
Ƭ LuckTokenClaimDetail: Object
Name | Type |
---|---|
champion |
LuckyTokenChampion |
claimAmount |
number |
claims |
{ id : number } & LuckTokenClaim [] |
hash |
string |
helpers |
{ accountId : number ; address : number ; amount : number ; ens : number }[] |
luckyToken |
{ id : number } & LuckyTokenItemForReceive |
tokenId |
number |
Ƭ LuckTokenHistory: Object
Name | Type |
---|---|
champion |
LuckyTokenChampion |
claim |
{ id : number } & LuckTokenClaim |
claimAmount |
number |
hash |
string |
helpers |
{ accountId : number ; address : number ; ens : number }[] |
luckyToken |
{ id : number } & LuckyTokenItemForReceive |
tokenId |
number |
Ƭ LuckTokenWithdraw: Object
Name | Type |
---|---|
amount |
string |
claimer |
{ accountId : number ; address : number ; ens : string } |
claimer.accountId |
number |
claimer.address |
number |
claimer.ens |
string |
createdAt |
number |
feeAmount |
number |
feeTokenId |
number |
hash |
string |
id |
number |
isNft |
boolean |
nftTokenInfo? |
UserNFTBalanceInfo |
status |
0 | 1 | 2 |
tokenId |
number |
updatedAt |
number |
Ƭ LuckyTokenAmount: Object
Name | Type |
---|---|
remainAmount |
string |
remainCount |
number |
totalAmount |
string |
totalCount |
number |
Ƭ LuckyTokenChampion: Object
Name | Type |
---|---|
accountId |
number |
address |
string |
amount |
number |
ens |
string |
Ƭ LuckyTokenInfo: Object
Name | Type |
---|---|
logoUrl |
string |
memo |
string |
signer |
string |
signerUrl |
string |
Ƭ LuckyTokenItemForReceive: Object
Name | Type |
---|---|
champion |
LuckyTokenChampion |
createdAt |
number |
hash |
string |
info |
LuckyTokenInfo |
isNft? |
boolean |
nftTokenInfo? |
UserNFTBalanceInfo |
sender |
LuckyTokenSender |
status |
LuckyTokenItemStatus |
templateNo |
number |
tokenAmount |
LuckyTokenAmount |
tokenId |
number |
type |
LuckyTokenType |
validSince |
number |
validUntil |
number |
Ƭ LuckyTokenItemForSendV3: { memo
: string
; numbers
: number
; signerFlag
: boolean
; templateId
: number
; type
: LuckyTokenType
; validSince
: number
; validUntil
: number
} & { luckyToken
: OriginTransfer3RequestV3
; nftData
: string
} | { luckyToken
: OriginTransfer3RequestV3
}
LuckyTokenItemForSend
Ƭ LuckyTokenSender: Object
Name | Type |
---|---|
accountId |
number |
address |
string |
ens |
string |
Ƭ LuckyTokenSignerFlag: 0
| 1
Ƭ LuckyTokenType: Object
Name | Type |
---|---|
mode |
LuckyTokenClaimType |
partition |
LuckyTokenAmountType |
scope |
LuckyTokenViewType |
Ƭ NFTOrderInfo: Object
Name | Type |
---|---|
accountId |
number |
address |
string |
feeAmount |
string |
orderHash |
string |
storageId |
number |
Ƭ 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
Ƭ NftData: string
Ƭ Protector: Object
Name | Type |
---|---|
address |
string |
ens |
string |
lockStatus |
HEBAO_LOCK_STATUS |
Ƭ STACKING_PRODUCT: Object
Name | Type |
---|---|
address |
string |
apr |
string |
decimals |
number |
maxAmount |
string |
minAmount |
string |
precision |
number |
rewardPeriod |
string |
staked |
string |
status |
number |
symbol |
string |
tokenId |
number |
Ƭ STACKING_SUMMARY: Object
Name | Type |
---|---|
staking |
StakeInfoOrigin [] |
totalClaimableRewards |
string |
totalLastDayPendingRewards |
string |
totalStaked |
string |
totalStakedRewards |
string |
Ƭ STACKING_TRANSACTIONS: Object
Name | Type |
---|---|
accountId |
number |
amount |
string |
createdAt |
number |
hash |
string |
productId |
string |
tokenId |
number |
type |
StakeTransactionType |
updatedAt |
number |
Ƭ StakeInfoOrigin: Object
Name | Type |
---|---|
accountId |
number |
apr |
string |
claimableTime |
number |
createdAt |
number |
hash |
string |
initialAmount |
string |
lastDayPendingRewards |
string |
productId |
string |
remainAmount |
string |
stakeAt |
number |
status |
StakeStatus |
tokenId |
number |
totalRewards |
string |
updatedAt |
number |
Ƭ TOKENMAPLIST: Object
Name | Type |
---|---|
addressIndex |
LoopringMap <TokenAddress > |
coinMap |
LoopringMap <{ company : string ; description? : string ; icon? : string ; name : string ; simpleName : string }> |
idIndex |
LoopringMap <string > |
tokensMap |
LoopringMap <TokenInfo > |
totalCoinMap |
LoopringMap <{ company : string ; description? : string ; icon? : string ; name : string ; simpleName : string }> |
Ƭ TX_HASH_API: Object
Name | Type |
---|---|
hash? |
string |
resultInfo? |
RESULT_INFO |
Ƭ TX_HASH_RESULT<T
>: T
& { raw_data
: T
}
Name |
---|
T |
Ƭ TokenAddress: string
Ƭ UpdateNFTGroupRequest: Object
Name | Type |
---|---|
accountId |
number |
collectionId? |
number |
nftHashes |
string [] |
preferenceType |
NFT_PREFERENCE_TYPE |
statusToUpdate |
boolean |
Ƭ UpdateNFTLegacyCollectionRequest: Object
Name | Type |
---|---|
accountId |
number |
collectionId? |
number |
nftHashes |
string [] |
Ƭ UserNFTMintHistoryTx: Object
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 |
Ƭ UserPwdResetTx: UserRegTx
Ƭ UserTrade: MarketTradeInfo
Ƭ VipFeeRateInfoMap: Object
▪ [key: string
]: VipFeeRateInfo
Ƭ Without<T
, U
>: { [P in Exclude<keyof T, keyof U>]?: never }
Name |
---|
T |
U |
Ƭ XOR<T
, U
>: T
| U
extends { [key: string]
: any
; } ? Without
<T
, U
> & U
| Without
<U
, T
> & T
: T
| U
Name |
---|
T |
U |
• 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: ({ 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: { 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: { inputs
: { internalType
: string
= “address”; name
: string
= “wallet”; type
: string
= “address” }[] ; name
: string
= “lock”; outputs
: never
[] = []; stateMutability
: string
= “nonpayable”; type
: string
= “function” }[]
• Const
ApproveVal: Object
Name | Type |
---|---|
Max |
string |
Zero |
string |
• Const
IsMobile: Object
Name | Type |
---|---|
Android |
() => null | RegExpMatchArray |
BlackBerry |
() => null | RegExpMatchArray |
Ethereum |
() => any |
Opera |
() => null | RegExpMatchArray |
Windows |
() => null | RegExpMatchArray |
any |
() => any |
iOS |
() => null | RegExpMatchArray |
• Const
KEY_MESSAGE: string
• Const
NFTFactory: Object
Name | Type |
---|---|
1 |
string |
5 |
string |
• Const
NFTFactory_Collection: Object
Name | Type |
---|---|
1 |
string |
5 |
string |
• Const
NetworkContextName: "NETWORK"
• Const
SEP: ","
• Const
SoursURL: "https://static.loopring.io/assets/"
▸ addHexPrefix(input
): string
Returns hex string with ‘0x’ prefix
Name | Type |
---|---|
input |
any |
string
▸ ammPoolCalc(rawVal
, isAtoB
, coinA
, coinB
): Object
Name | Type |
---|---|
rawVal |
string |
isAtoB |
boolean |
coinA |
TokenVolumeV3 |
coinB |
TokenVolumeV3 |
Object
Name | Type |
---|---|
output |
string |
ratio |
BigNumber |
▸ approve(web3
, from
, to
, depositAddress
, _value
, chainId
, nonce
, gasPrice
, gasLimit
, sendByMetaMask
): Promise
<any
>
Name | Type |
---|---|
web3 |
default |
from |
string |
to |
string |
depositAddress |
string |
_value |
string |
chainId |
ChainId |
nonce |
number |
gasPrice |
number |
gasLimit |
number |
sendByMetaMask |
boolean |
Promise
<any
>
▸ approveMax(web3
, owner
, tokenAddress
, depositAddress
, gasPrice
, gasLimit
, chainId?
, nonce
, sendByMetaMask?
): Promise
<any
>
Approve Max
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 |
Promise
<any
>
▸ approveZero(web3
, owner
, tokenAddress
, depositAddress
, gasPrice
, gasLimit
, chainId?
, nonce
, sendByMetaMask?
): Promise
<any
>
Approve Zero
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 |
Promise
<any
>
▸ calcDefi(__namedParameters
): Object
calcDefi
Name | Type |
---|---|
__namedParameters |
{ buyTokenBalanceVol : string ; feeVol : string ; isInputSell : boolean ; isJoin : boolean ; marketInfo : DefiMarketInfo ; tokenBuy : TokenInfo ; tokenSell : TokenInfo } & Without <{ sellAmount : string }, { buyAmount : string }> & { buyAmount : string } & { buyTokenBalanceVol : string ; feeVol : string ; isInputSell : boolean ; isJoin : boolean ; marketInfo : DefiMarketInfo ; tokenBuy : TokenInfo ; tokenSell : TokenInfo } & Without <{ buyAmount : string }, { sellAmount : string }> & { sellAmount : string } |
Object
sell Volume (decimals);
Name | Type |
---|---|
buyVol |
string |
isInputSell |
boolean |
isJoin |
boolean |
maxFeeBips |
number |
maxSellVol |
string |
miniSellVol |
string |
sellVol |
string |
▸ calcDual(__namedParameters
): CalDualResult
Name | Type |
---|---|
__namedParameters |
Object |
__namedParameters.balance |
Object |
__namedParameters.buyToken |
TokenInfo |
__namedParameters.dualMarket |
DefiMarketInfo |
__namedParameters.feeVol? |
string |
__namedParameters.index |
DualIndex |
__namedParameters.info |
DualProductAndPrice |
__namedParameters.rule |
DualRulesCoinsInfo |
__namedParameters.sellAmount |
undefined | string |
__namedParameters.sellToken |
TokenInfo |
▸ checkErrorInfo(errorInfo
, isFirstTime?
): undefined
| string
Name | Type |
---|---|
errorInfo |
RESULT_INFO |
isFirstTime? |
boolean |
undefined
| string
▸ clearHexPrefix(input
): string
Returns hex string without ‘0x’ prefix
Name | Type | Description |
---|---|---|
input |
any |
string |
string
▸ contractWalletValidate32(web3
, account
, msg
, sig
): Promise
<unknown
>
Name | Type |
---|---|
web3 |
any |
account |
string |
msg |
string |
sig |
any |
Promise
<unknown
>
▸ convertPublicKey(pk
): BN
Name | Type |
---|---|
pk |
PublicKey |
BN
▸ convertPublicKey2(pk
): BN
Name | Type |
---|---|
pk |
PublicKey |
BN
▸ deposit(web3
, from
, exchangeAddress
, token
, value
, fee
, gasPrice
, gasLimit
, chainId?
, nonce
, sendByMetaMask?
, to?
): Promise
<any
>
deposit
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 |
Promise
<any
>
▸ dumpError400(reason
, src?
): void
Name | Type | Default value |
---|---|---|
reason |
any |
undefined |
src |
string |
"" |
void
▸ ecRecover(web3
, account
, msg
, sig
): Promise
<unknown
>
Name | Type |
---|---|
web3 |
default |
account |
string |
msg |
string |
sig |
any |
Promise
<unknown
>
▸ ecRecover2(account
, message
, signature
): Promise
<unknown
>
Name | Type |
---|---|
account |
string |
message |
string |
signature |
any |
Promise
<unknown
>
▸ eddsaSign(typedData
, eddsaKey
): Object
Name | Type |
---|---|
typedData |
any |
eddsaKey |
string |
Object
Name | Type |
---|---|
eddsaSig |
string |
▸ eddsaSignWithDomain(domainHax
, primaryType
, message
, types
, eddsaKey
): Object
Name | Type |
---|---|
domainHax |
string |
primaryType |
string |
message |
EIP712Message |
types |
EIP712Types |
eddsaKey |
string |
Object
Name | Type |
---|---|
eddsaSig |
string |
▸ fcWalletValid(web3
, account
, msg
, result
, accountId
, chainId
, counterFactualInfo?
): Promise
<{ counterFactualInfo?
: CounterFactualInfo
; error?
: any
; result?
: boolean
}>
Name | Type |
---|---|
web3 |
any |
account |
string |
msg |
string |
result |
any |
accountId |
number |
chainId |
ChainId |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo?
: CounterFactualInfo
; error?
: any
; result?
: boolean
}>
▸ forceWithdrawal(web3
, from
, accountID
, exchangeAddress
, token
, fee
, gasPrice
, gasLimit
, chainId?
, nonce
, sendByMetaMask?
): Promise
<any
>
forceWithdrawal
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 |
Promise
<any
>
▸ formatAddress(mixed
): string
Returns hex string of a given address
Name | Type | Description |
---|---|---|
mixed |
string | Buffer | Uint8Array |
Buffer | string |Uint8Array |
string
▸ formatEddsaKey(key
): string
Name | Type |
---|---|
key |
any |
string
▸ formatKey(mixed
): string
Returns formatted hex string of a given private key
Name | Type | Description |
---|---|---|
mixed |
string | Buffer | Uint8Array |
Buffer | string | Uint8Array |
string
▸ formatSig(rpcSig
): string
Name | Type |
---|---|
rpcSig |
string |
string
▸ fromGWEI(value
): BigNumber
Name | Type | Description |
---|---|---|
value |
any |
number | BigNumber | Buffer | string |
BigNumber
▸ fromWEI(tokens
, symbol
, valueInWEI
, precision?
, ceil?
): undefined
| string
Name | Type |
---|---|
tokens |
any |
symbol |
any |
valueInWEI |
any |
precision? |
any |
ceil? |
any |
undefined
| string
▸ genExchangeData(method
, data
): any
Name | Type |
---|---|
method |
string |
data |
any |
any
▸ generateKeyPair(__namedParameters
, publicKey?
): Promise
<{ counterFactualInfo
: any
; formatedPx
: string
= newValue.formatedPx; formatedPy
: string
= newValue.formatedPy; keyPair
: { publicKeyX
: string
; publicKeyY
: string
; secretKey
: string
} = newValue.keyPair; sk
: string
= newValue.sk }>
Name | Type | Default value |
---|---|---|
__namedParameters |
KeyPairParams |
undefined |
publicKey |
undefined | { x : string ; y : string } |
undefined |
Promise
<{ counterFactualInfo
: any
; formatedPx
: string
= newValue.formatedPx; formatedPy
: string
= newValue.formatedPy; keyPair
: { publicKeyX
: string
; publicKeyY
: string
; secretKey
: string
} = newValue.keyPair; sk
: string
= newValue.sk }>
▸ generatePrivateKey(result
): Object
Name | Type |
---|---|
result |
Object |
result.counterFactualInfo |
any |
result.error |
any |
result.sig |
string |
Object
Name | Type |
---|---|
counterFactualInfo |
any |
formatedPx |
string |
formatedPy |
string |
keyPair |
{ publicKeyX : string ; publicKeyY : string ; secretKey : string } |
keyPair.publicKeyX |
string |
keyPair.publicKeyY |
string |
keyPair.secretKey |
string |
sk |
string |
▸ getAccountArg(): Object
Object
Name | Type |
---|---|
topic |
WsTopicType |
▸ getAmmExitEcdsaTypedData(data
, patch
): EIP712TypedData
Name | Type |
---|---|
data |
ExitAmmPoolRequest |
patch |
AmmPoolRequestPatch |
EIP712TypedData
▸ getAmmJoinEcdsaTypedData(data
, patch
): Object
Name | Type |
---|---|
data |
JoinAmmPoolRequest |
patch |
AmmPoolRequestPatch |
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” }[] |
▸ getAmmpoolArg(poolAddress
): Object
Name | Type |
---|---|
poolAddress |
string |
Object
Name | Type |
---|---|
poolAddress |
string |
snapshot |
boolean |
topic |
WsTopicType |
▸ getBaseQuote(symbol
): { base
: undefined
= undefined; quote
: undefined
= undefined } | { base
: string
; quote
: string
}
Name | Type |
---|---|
symbol |
string |
{ base
: undefined
= undefined; quote
: undefined
= undefined } | { base
: string
; quote
: string
}
▸ getCandlestickArg(market
): Object
Name | Type |
---|---|
market |
string |
Object
Name | Type |
---|---|
market |
string |
topic |
WsTopicType |
▸ getCurPrice(reserveIn
, reserveOut
): string
Name | Type |
---|---|
reserveIn |
string |
reserveOut |
string |
string
▸ getDisplaySymbol(settingsCurrency
): ""
| "¥"
| "$"
Returns symbol of a given kind of currency
Name | Type |
---|---|
settingsCurrency |
any |
""
| "¥"
| "$"
▸ 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 }>
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 |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ getEdDSASig(method
, basePath
, api_url
, requestInfo
, PrivateKey
): string
Name | Type |
---|---|
method |
string |
basePath |
string |
api_url |
string |
requestInfo |
any |
PrivateKey |
undefined | string |
string
▸ getEdDSASigWithPoseidon(inputs
, PrivateKey
): Object
Name | Type |
---|---|
inputs |
any |
PrivateKey |
undefined | string |
Object
Name | Type |
---|---|
hash |
any |
result |
string |
▸ getExistedMarket(marketArr
, base
, quote
): Object
Name | Type |
---|---|
marketArr |
any |
base |
undefined | string |
quote |
undefined | string |
Object
Name | Type |
---|---|
amm |
undefined | string |
baseShow |
any |
market |
any |
quoteShow |
any |
▸ getMidPrice(__namedParameters
): Object
Name | Type |
---|---|
__namedParameters |
Object |
__namedParameters._asks |
any |
__namedParameters._bids |
any |
__namedParameters.askReverse? |
boolean |
__namedParameters.bidReverse? |
boolean |
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 |
▸ getMinReceived(amountBOut
, minimumDecimal
, slipBips
): Object
Name | Type |
---|---|
amountBOut |
string |
minimumDecimal |
number |
slipBips |
string |
Object
Name | Type |
---|---|
minReceived |
string |
minReceivedVal |
string |
minimumDecimal |
number |
▸ getMixOrderArg(__namedParameters
): any
Name | Type |
---|---|
__namedParameters |
Object |
__namedParameters.count? |
number |
__namedParameters.level |
number |
__namedParameters.market |
string |
__namedParameters.showOverlap? |
boolean |
__namedParameters.snapshot? |
boolean |
any
▸ getMixTradeArg(market
): Object
Name | Type |
---|---|
market |
string |
Object
Name | Type |
---|---|
market |
string |
topic |
WsTopicType |
▸ getNFTMintTypedData(data
, chainId
, web3
): EIP712TypedData
Name | Type |
---|---|
data |
NFTMintRequestV3 |
chainId |
ChainId |
web3 |
default |
EIP712TypedData
▸ getNFTTransferTypedData(data
, chainId
): EIP712TypedData
Name | Type |
---|---|
data |
OriginNFTTransferRequestV3 |
chainId |
ChainId |
EIP712TypedData
▸ getNFTWithdrawTypedData(data
, chainId
): EIP712TypedData
Name | Type |
---|---|
data |
NFTWithdrawRequestV3 |
chainId |
ChainId |
EIP712TypedData
▸ getNftData(request
): any
Name | Type |
---|---|
request |
NFTMintRequestV3 |
any
▸ getNftTradeHash(request
): any
Name | Type |
---|---|
request |
NFTTradeRequestV3 |
any
▸ getNonce(web3
, addr
): Promise
<number
>
Name | Type |
---|---|
web3 |
default |
addr |
string |
Promise
<number
>
▸ getOrderArg(market
): Object
Name | Type |
---|---|
market |
string |
Object
Name | Type |
---|---|
market |
string |
topic |
WsTopicType |
▸ getOrderBookArg(__namedParameters
): any
Name | Type |
---|---|
__namedParameters |
Object |
__namedParameters.count? |
number |
__namedParameters.level |
number |
__namedParameters.market |
string |
__namedParameters.showOverlap? |
boolean |
__namedParameters.snapshot? |
boolean |
__namedParameters.topic? |
string |
any
▸ getOrderHash(request
): any
Name | Type |
---|---|
request |
SubmitOrderRequestV3 |
any
▸ 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
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 > |
{ 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
▸ getPair(marketArr
, market
): Object
Name | Type |
---|---|
marketArr |
any |
market |
string |
Object
Name | Type |
---|---|
amm |
undefined | string |
baseShow |
any |
market |
any |
quoteShow |
any |
▸ getPriceImpact(reserveIn
, reserveOut
, amountS
, feeBips
, takerFee
): string
Name | Type |
---|---|
reserveIn |
string |
reserveOut |
string |
amountS |
string |
feeBips |
string |
takerFee |
string |
string
▸ 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
}
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 |
undefined
| { buyToken
: undefined
| TokenInfo
; coinA
: undefined
| TokenVolumeV3
; coinB
: undefined
| TokenVolumeV3
; isReverse
: boolean
; marketInfo
: MarketInfo
; reserveIn
: string
; reserveOut
: string
; sellToken
: undefined
| TokenInfo
}
▸ getTickerArg(market
): Object
Name | Type |
---|---|
market |
string |
Object
Name | Type |
---|---|
market |
string |
topic |
WsTopicType |
▸ getToPrice(amountS
, amountB
): string
Name | Type |
---|---|
amountS |
string |
amountB |
string |
string
▸ getToken(tokens
, token
): any
Name | Type |
---|---|
tokens |
any |
token |
any |
any
▸ getTokenInfoById(tokenIdMap
, id
): undefined
| TokenInfo
Name | Type |
---|---|
tokenIdMap |
Object |
id |
number |
undefined
| TokenInfo
▸ getTokenInfoBySymbol(tokenSymbolMap
, symbol
): undefined
| TokenInfo
Name | Type |
---|---|
tokenSymbolMap |
Object |
symbol |
string |
undefined
| TokenInfo
▸ getTokenInfoByToken(ammBalance
, tokens
, token
): Object
Name | Type |
---|---|
ammBalance |
any |
tokens |
any |
token |
any |
Object
Name | Type |
---|---|
reserve |
BigNumber |
tokenInfo |
any |
tokenVol |
any |
▸ getTradeArg(market
): Object
Name | Type |
---|---|
market |
string |
Object
Name | Type |
---|---|
market |
string |
topic |
WsTopicType |
▸ getTransferOldTypedData(data
, chainId
): EIP712TypedData
Name | Type |
---|---|
data |
OriginTransferRequestV3 |
chainId |
ChainId |
EIP712TypedData
▸ getTransferTypedData(data
, chainId
): EIP712TypedData
Name | Type |
---|---|
data |
OriginTransferRequestV3 |
chainId |
ChainId |
EIP712TypedData
▸ getUpdateAccountEcdsaTypedData(data
, chainId
): EIP712TypedData
Name | Type |
---|---|
data |
UpdateAccountRequestV3 |
chainId |
ChainId |
EIP712TypedData
▸ getWithdrawTypedData(data
, chainId
): EIP712TypedData
Name | Type |
---|---|
data |
OffChainWithdrawalRequestV3 |
chainId |
ChainId |
EIP712TypedData
▸ get_EddsaSig_Dual_Order(request
, eddsaKey
): Object
Name | Type |
---|---|
request |
DualOrderRequest |
eddsaKey |
string |
Object
Name | Type |
---|---|
hash |
any |
result |
string |
▸ get_EddsaSig_ExitAmmPool(data
, patch
): Object
Name | Type |
---|---|
data |
ExitAmmPoolRequest |
patch |
AmmPoolRequestPatch |
Object
Name | Type |
---|---|
eddsaSig |
string |
▸ get_EddsaSig_JoinAmmPool(data
, patch
): Object
Name | Type |
---|---|
data |
JoinAmmPoolRequest |
patch |
AmmPoolRequestPatch |
Object
Name | Type |
---|---|
eddsaSig |
string |
▸ get_EddsaSig_NFT_Mint(request
, eddsaKey
): Object
Name | Type |
---|---|
request |
NFTMintRequestV3 |
eddsaKey |
string |
Object
Name | Type |
---|---|
hash |
any |
result |
string |
▸ get_EddsaSig_NFT_Order(request
, eddsaKey
): Object
Name | Type |
---|---|
request |
NFTOrderRequestV3 |
eddsaKey |
string |
Object
Name | Type |
---|---|
hash |
any |
result |
string |
▸ get_EddsaSig_NFT_Transfer(request
, eddsaKey
): Object
Name | Type |
---|---|
request |
OriginNFTTransferRequestV3 |
eddsaKey |
string |
Object
Name | Type |
---|---|
hash |
any |
result |
string |
▸ get_EddsaSig_NFT_Withdraw(request
, eddsaKey
): Object
Name | Type |
---|---|
request |
NFTWithdrawRequestV3 |
eddsaKey |
string |
Object
Name | Type |
---|---|
hash |
any |
result |
string |
▸ get_EddsaSig_OffChainWithdraw(request
, eddsaKey
): Object
Name | Type |
---|---|
request |
OffChainWithdrawalRequestV3 |
eddsaKey |
string |
Object
Name | Type |
---|---|
hash |
any |
result |
string |
▸ get_EddsaSig_Transfer(request
, eddsaKey
): Object
Name | Type |
---|---|
request |
OriginTransferRequestV3 |
eddsaKey |
string |
Object
Name | Type |
---|---|
hash |
any |
result |
string |
▸ get_Is_Nft_Token(tokenId
): boolean
Name | Type |
---|---|
tokenId |
number |
boolean
▸ hasMarket(marketArr
, market
): boolean
Name | Type |
---|---|
marketArr |
any |
market |
string |
boolean
▸ isContract(web3
, address
): Promise
<any
>
Name | Type |
---|---|
web3 |
any |
address |
string |
Promise
<any
>
▸ isEmpty(input
): boolean
Name | Type |
---|---|
input |
any |
boolean
▸ makeAmmPool<R
>(raw_data
): Object
Name |
---|
R |
Name | Type |
---|---|
raw_data |
any |
Object
Name | Type |
---|---|
ammpools |
LoopringMap <AmmPoolInfoV3 > |
pairs |
LoopringMap <TokenRelatedInfo > |
▸ makeExitAmmCoverFeeLP(fees
, ammPoolSnapshot
, tokenMap
, idIdx
, slippageTolerance?
): Object
Name | Type | Default value |
---|---|---|
fees |
LoopringMap <OffchainFeeInfo > |
undefined |
ammPoolSnapshot |
AmmPoolSnapshot |
undefined |
tokenMap |
LoopringMap <TokenInfo > |
undefined |
idIdx |
LoopringMap <string > |
undefined |
slippageTolerance |
string |
"0.001" |
Object
Name | Type |
---|---|
feeLp |
string |
feeLpVal |
string |
feeLpWithSlippage |
string |
miniFeeLpWithSlippageVal |
string |
▸ makeExitAmmPoolMini(rawVal
, ammPoolSnapshot
, tokenMap
, idIdx
, RatioDecimal?
): Object
Name | Type | Default value |
---|---|---|
rawVal |
string |
undefined |
ammPoolSnapshot |
AmmPoolSnapshot |
undefined |
tokenMap |
LoopringMap <TokenInfo > |
undefined |
idIdx |
LoopringMap <string > |
undefined |
RatioDecimal |
number |
10 |
Object
Name | Type |
---|---|
miniLpVal |
string |
miniLpVol |
string |
▸ makeExitAmmPoolRequest2(rawVal
, slippageTolerance
, owner
, fees
, ammPoolSnapshot
, tokenMap
, idIdx
, offchainId?
, minDecimal?
): Object
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 |
minDecimal |
number |
10 |
Object
Name | Type |
---|---|
ratio |
string |
request |
ExitAmmPoolRequest |
volA |
string |
volA_show |
string |
volB |
string |
volB_show |
string |
▸ makeJoinAmmPoolRequest(rawVal
, isAtoB
, slippageTolerance
, owner
, fees
, ammPoolSnapshot
, tokenMap
, idIdx
, coinAOffchainId?
, coinBOffchainId?
, rawValMatchForRawVal?
): Object
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 |
Object
Name | Type |
---|---|
request |
JoinAmmPoolRequest |
▸ makeMarket<R
>(raw_data
): TOKENMAPLIST
Name |
---|
R |
Name | Type |
---|---|
raw_data |
TokenInfo [] |
▸ makeMarkets<R
>(raw_data
, url?
): Object
Name |
---|
R |
Name | Type | Default value |
---|---|---|
raw_data |
any |
undefined |
url |
string |
LOOPRING_URLs.GET_MARKETS |
Object
Name | Type |
---|---|
marketArr |
string [] |
marketArrStr |
string |
markets |
LoopringMap <MarketInfo > |
pairs |
LoopringMap <TokenRelatedInfo > |
tokenArr |
string [] |
tokenArrStr |
string |
▸ mykeyWalletValid(web3
, account
, msg
, sig
): Promise
<unknown
>
Name | Type |
---|---|
web3 |
any |
account |
string |
msg |
string |
sig |
any |
Promise
<unknown
>
▸ numberWithCommas(number
): any
Returns a number with commas as thousands separators
Name | Type | Description |
---|---|---|
number |
any |
number |
any
▸ padLeftEven(hex
): any
Name | Type |
---|---|
hex |
any |
any
▸ personalSign(web3
, account
, pwd
, msg
, walletType
, chainId
, accountId?
, counterFactualInfo?
, isMobile?
): Promise
<unknown
>
Name | Type |
---|---|
web3 |
any |
account |
undefined | string |
pwd |
string |
msg |
string |
walletType |
ConnectorNames |
chainId |
ChainId |
accountId? |
number |
counterFactualInfo? |
CounterFactualInfo |
isMobile? |
boolean |
Promise
<unknown
>
▸ recoverSignType(web3
, account
, msg
, sig
): ""
| "03"
Name | Type |
---|---|
web3 |
any |
account |
string |
msg |
string |
sig |
string |
""
| "03"
▸ sendRawTx(web3
, from
, to
, value
, data
, chainId
, nonce
, gasPrice
, gasLimit
, sendByMetaMask?
): Promise
<any
>
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 |
Promise
<any
>
▸ sendTransaction(web3
, tx
): Promise
<any
>
description
Sends ethereum tx through MetaMask
Name | Type |
---|---|
web3 |
any |
tx |
any |
Promise
<any
>
▸ sign(web3
, account
, pwd
, hash
): Promise
<unknown
>
description
sign hash
Name | Type |
---|---|
web3 |
any |
account |
string |
pwd |
string |
hash |
string |
Promise
<unknown
>
▸ signEip712(web3
, account
, method
, params
): Promise
<any
>
description
sign EIP712
Name | Type |
---|---|
web3 |
any |
account |
string |
method |
string |
params |
any |
Promise
<any
>
▸ signEip712WalletConnect(web3
, account
, typedData
): Promise
<any
>
Name | Type |
---|---|
web3 |
any |
account |
string |
typedData |
any |
Promise
<any
>
▸ 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
Name | Type |
---|---|
web3 |
any |
account |
string |
rawTx |
any |
chainId |
ChainId |
Promise
<{ error
: undefined
= response.error; rawTx
: any
= jsonTx; result
: string
} | { error
: any
= response.error; rawTx
: undefined
= jsonTx; result
: undefined
}>
▸ 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 }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
NFTMintRequestV3 |
chainId |
ChainId |
walletType |
ConnectorNames |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ signNFTMintWithDataStructureForContract(web3
, owner
, bodyParams
, chainId
, accountId
, counterFactualInfo?
): Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
NFTMintRequestV3 |
chainId |
ChainId |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ 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 }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
NFTMintRequestV3 |
chainId |
ChainId |
walletType |
ConnectorNames |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ signNFTTransferWithDataStructureForContract(web3
, owner
, bodyParams
, chainId
, accountId
, counterFactualInfo?
): Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
OriginNFTTransferRequestV3 |
chainId |
ChainId |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ 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 }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
OriginNFTTransferRequestV3 |
chainId |
ChainId |
walletType |
ConnectorNames |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ 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 }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
NFTWithdrawRequestV3 |
chainId |
ChainId |
walletType |
ConnectorNames |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ signNFTWithdrawWithDataStructureForContract(web3
, owner
, bodyParams
, chainId
, accountId
, counterFactualInfo?
): Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
NFTWithdrawRequestV3 |
chainId |
ChainId |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ 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 }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
NFTWithdrawRequestV3 |
chainId |
ChainId |
walletType |
ConnectorNames |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ signOffchainWithdrawWithDataStructure(web3
, owner
, bodyParams
, chainId
, accountId
, counterFactualInfo?
): Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
OffChainWithdrawalRequestV3 |
chainId |
ChainId |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ signOffchainWithdrawWithDataStructureForContract(web3
, owner
, bodyParams
, chainId
, accountId
, counterFactualInfo?
): Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
OffChainWithdrawalRequestV3 |
chainId |
ChainId |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ 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 }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
OffChainWithdrawalRequestV3 |
chainId |
ChainId |
walletType |
ConnectorNames |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ 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 }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
OriginNFTTransferRequestV3 |
chainId |
ChainId |
walletType |
ConnectorNames |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ 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 }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
OriginTransferRequestV3 |
chainId |
ChainId |
walletType |
ConnectorNames |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ signTransferWithDataStructureForContract(web3
, owner
, bodyParams
, chainId
, accountId
, counterFactualInfo?
): Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
OriginTransferRequestV3 |
chainId |
ChainId |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ 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 }>
Name | Type |
---|---|
web3 |
default |
owner |
string |
bodyParams |
OriginTransferRequestV3 |
chainId |
ChainId |
walletType |
ConnectorNames |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ signUpdateAccountWithDataStructure(web3
, bodyParams
, chainId
, walletType
, accountId
, counterFactualInfo?
): Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
Name | Type |
---|---|
web3 |
default |
bodyParams |
UpdateAccountRequestV3 |
chainId |
ChainId |
walletType |
ConnectorNames |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ signUpdateAccountWithDataStructureForContract(web3
, bodyParams
, chainId
, accountId
, counterFactualInfo?
): Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
Name | Type |
---|---|
web3 |
default |
bodyParams |
UpdateAccountRequestV3 |
chainId |
ChainId |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ signUpdateAccountWithoutDataStructure(web3
, bodyParams
, chainId
, walletType
, accountId
, counterFactualInfo?
): Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
Name | Type |
---|---|
web3 |
default |
bodyParams |
UpdateAccountRequestV3 |
chainId |
ChainId |
walletType |
ConnectorNames |
accountId |
number |
counterFactualInfo? |
CounterFactualInfo |
Promise
<{ counterFactualInfo
: undefined
= signature.counterFactualInfo; ecdsaSig
: any
= response.result } | { counterFactualInfo
: any
= signature.counterFactualInfo; ecdsaSig
: any
= signature.sig }>
▸ sleep(milliseconds
): Promise
<unknown
>
Name | Type |
---|---|
milliseconds |
number |
Promise
<unknown
>
▸ sortObjDictionary(obj
): Map
<string
, any
>
Name | Type |
---|---|
obj |
Object |
Map
<string
, any
>
▸ toBN(mixed
): BN
Name | Type | Description |
---|---|---|
mixed |
any |
number | BigNumber | BN | Buffer | string |
BN
▸ toBig(mixed
): BigNumber
Name | Type | Description |
---|---|---|
mixed |
string | number | Buffer | Uint8Array | BigNumber | BN |
number | BigNumber | BN | Buffer | string | Uint8Array |
BigNumber
▸ toBuffer(mixed
): Buffer
| Uint8Array
Name | Type | Description |
---|---|---|
mixed |
any |
Buffer|number|string (hex string must be with ‘0x’ prefix) |
Buffer
| Uint8Array
▸ toFixed(number
, precision
, ceil
): string
Returns number in string with a given precision
Name | Type | Description |
---|---|---|
number |
any |
number | BigNumber |
precision |
any |
number |
ceil |
any |
bool round up |
string
▸ toGWEI(value
): BigNumber
Name | Type | Description |
---|---|---|
value |
any |
number | BigNumber | Buffer | string |
BigNumber
▸ toHex(mixed
): string
Name | Type | Description |
---|---|---|
mixed |
string | number | Buffer | Uint8Array | BigNumber | BN |
number | BigNumber | BN | Buffer | string | Uint8Array |
string
▸ toNumber(mixed
): number
Name | Type | Description |
---|---|---|
mixed |
string | number | Buffer | Uint8Array | BigNumber | BN |
number | BigNumber | BN | Buffer | string | Uint8Array |
number
▸ toWEI(tokens
, symbol
, value
, rm?
): string
Name | Type | Default value |
---|---|---|
tokens |
any |
undefined |
symbol |
any |
undefined |
value |
any |
undefined |
rm |
any |
undefined |
string
▸ updatePriceImpact_new(reverseIn
, reverseOut
, amountS
, sellDecimal
, amountBOut
, buyDecimal
, feeBips
, takerFee
, isAtoB
, isReversed
, exceedDepth
, depth
): string
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 |
string
▸ verifyEdDSASig(hash
, input
): Boolean
Name | Type |
---|---|
hash |
string |
input |
Object |
input.Rx |
string |
input.Ry |
string |
input.s |
string |
Boolean
▸ zeroPad(num
, places
): Buffer
| Uint8Array
Name | Type | Description |
---|---|---|
num |
any |
number|string (hex string must be with ‘0x’ prefix) |
places |
any |
number of zeros to pad |
Buffer
| Uint8Array