Version: 0.14.1

negotiation/order

Index

Interfaces

Variables

Functions

Variables

Const BITCOIN_DECIMALS

BITCOIN_DECIMALS: 8 = 8

Defined in src/negotiation/order.ts:85


Const ETHER_DECIMALS

ETHER_DECIMALS: 18 = 18

Defined in src/negotiation/order.ts:86

Functions

fromNominal

fromNominal(asset: string, nominalAmount: string, token?: Token): BigNumber | undefined

Defined in src/negotiation/order.ts:96

Convert from nominal amount to underlying base unit of an asset, e.g. convert Ether to Wei.

Parameters:

NameTypeDescription
assetstringName of the asset as string (e.g. "ether".
nominalAmountstringThe nominal amount (e.g. ether amount).
token?TokenOptional parameter for converting ERC20 tokens according to defined Token.decimals.

Returns: BigNumber | undefined

The base unit amount of the asset (e.g. amount in wei).


isNative

isNative(__namedParameters: object): boolean

Defined in src/negotiation/order.ts:78

Helper function to check if an asset is native (e.g. ether is on Ethereum but erc20 is not). according to the given asset and ledger string.

Parameters:

__namedParameters: object

NameTypeDescription
assetstring-
ledgerstring

Returns: boolean


isOrderValid

isOrderValid(order: Order): boolean

Defined in src/negotiation/order.ts:34

Validates that all fields of an Order are set correctly.

Parameters:

NameTypeDescription
orderOrderThe Order to be validated.

Returns: boolean

True if all fields of the Order are set correctl, false otherwise.


toTradingPair

toTradingPair(order: Order): string

Defined in src/negotiation/order.ts:60

Convert the bid and ask OrderAsset to the trading-pair string, e.g. ethereum-ether-bitcoin-bitcoin.

Parameters:

NameTypeDescription
orderOrder

Returns: string