order detail foldout
This commit is contained in:
@@ -6,6 +6,9 @@ export function encodeIEE754(value) {
|
||||
}
|
||||
|
||||
|
||||
export function decodeIEE754(buffer) {
|
||||
return new DataView(buffer).getFloat32(0, false);
|
||||
export function decodeIEE754(value) {
|
||||
const buffer = new ArrayBuffer(4);
|
||||
const view = new DataView(buffer);
|
||||
view.setUint32(0, value, false)
|
||||
return view.getFloat32(0, false)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {uint32max, uint64max} from "@/misc.js";
|
||||
import {encodeIEE754} from "@/blockchain/common.js";
|
||||
import {decodeIEE754, encodeIEE754} from "@/blockchain/common.js";
|
||||
|
||||
export const MAX_FRACTION = 65535;
|
||||
export const NO_CHAIN = uint64max;
|
||||
@@ -177,6 +177,10 @@ export function parseTranche(tranche) {
|
||||
maxIntercept,
|
||||
maxSlope,
|
||||
] = tranche
|
||||
minIntercept = decodeIEE754(minIntercept)
|
||||
minSlope = decodeIEE754(minSlope)
|
||||
maxIntercept = decodeIEE754(maxIntercept)
|
||||
maxSlope = decodeIEE754(maxSlope)
|
||||
return {
|
||||
fraction, startTimeIsRelative, endTimeIsRelative, minIsBarrier, maxIsBarrier, marketOrder,
|
||||
startTime, endTime, minIntercept, minSlope, maxIntercept, maxSlope,
|
||||
|
||||
Reference in New Issue
Block a user