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:
Name | Type | Description |
---|---|---|
asset | string | Name of the asset as string (e.g. "ether". |
nominalAmount | string | The nominal amount (e.g. ether amount). |
token? | Token | Optional 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
Name | Type | Description |
---|---|---|
asset | string | - |
ledger | string |
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:
Name | Type | Description |
---|---|---|
order | Order | The 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:
Name | Type | Description |
---|---|---|
order | Order |
Returns: string