CompactData
CompactData is used to save gas on get, set rates operations. Instead of sending the whole buy, sell rates every time, only the different is sent if possible. The compact rate is calculated by following formula:
compact = ((rate / base) - 1) * 1000
Constructor Summary
Public Constructor | ||
public |
constructor(rate: BigNumber, base: BigNumber) Create a new CompactData instance. |
Member Summary
Public Members | ||
public get |
base: * |
|
public set |
|
|
public get |
compact: * |
|
public set |
|
|
public get |
|
|
public set |
|
Private Members | ||
private |
_base: * |
|
private |
_compact: * |
|
private |
|
Public Constructors
public constructor(rate: BigNumber, base: BigNumber) source
Create a new CompactData instance.
Params:
Name | Type | Attribute | Description |
rate | BigNumber | the total rate |
|
base | BigNumber | the base to generate compact data |