diff --git a/src/blockchain/orderlib.js b/src/blockchain/orderlib.js index f1966e9..3126467 100644 --- a/src/blockchain/orderlib.js +++ b/src/blockchain/orderlib.js @@ -90,10 +90,12 @@ export function newTranche({ maxIntercept = encodeIEE754(maxIntercept) maxSlope = encodeIEE754(maxSlope) } + const minLine = {intercept: minIntercept, slope: minSlope} + const maxLine = {intercept: maxIntercept, slope: maxSlope} return { fraction: Math.min(MAX_FRACTION, Math.round(fraction)), marketOrder, startTimeIsRelative, startTime, endTimeIsRelative, endTime, - minIsBarrier, minIntercept, minSlope, maxIsBarrier, maxIntercept, maxSlope, + minIsBarrier, minLine, maxIsBarrier, maxLine, minIsRatio, maxIsRatio, _reserved7: false, rateLimitFraction, rateLimitPeriod, } } @@ -137,22 +139,24 @@ export function parseOrderStatus(chainId, status) { ocoGroup, filledIn, filledOut, - trancheFilledIn, - trancheFilledOut, - trancheActivationTime, + trancheStatus, ] = status order = parseOrder(order) filledIn = BigInt(filledIn) filledOut = BigInt(filledOut) - trancheFilledIn = trancheFilledIn.map((f)=>BigInt(f)) - trancheFilledOut = trancheFilledOut.map((f)=>BigInt(f)) - trancheActivationTime = trancheActivationTime.map((v)=>Number(v)) + trancheStatus = trancheStatus.map((obj)=>parseTrancheStatus(obj)) return { chainId, order, fillFeeHalfBps, state, startTime, startPrice, ocoGroup, - filledIn, filledOut, trancheFilledIn, trancheFilledOut, trancheActivationTime + filledIn, filledOut, trancheStatus, } } +function parseTrancheStatus(obj) { + let [filledIn, filledOut, activationTime, startTime, endTime,] = obj + filledIn = BigInt(filledIn) + filledOut = BigInt(filledOut) + return {filledIn, filledOut, activationTime, startTime, endTime} +} export function parseOrder(order) { let [ diff --git a/src/blockchain/wallet.js b/src/blockchain/wallet.js index 6fca4fd..d367b4c 100644 --- a/src/blockchain/wallet.js +++ b/src/blockchain/wallet.js @@ -276,7 +276,7 @@ export const PendingOrderState = { Sent: -102, // tx is awaiting blockchain mining } -const placementFeeSelector = 'placementFee((address,address,(uint8,uint24),uint256,uint256,bool,bool,uint64,(uint16,bool,bool,bool,bool,bool,bool,bool,bool,uint16,uint24,uint32,uint32,uint32,uint32,uint32,uint32)[]),(uint8,uint8,uint8,uint8,uint8))' +const placementFeeSelector = 'placementFee((address,address,(uint8,uint24),uint256,uint256,bool,bool,uint64,(uint16,bool,bool,bool,bool,bool,bool,bool,bool,uint16,uint24,uint32,uint32,(uint32,uint32),(uint32,uint32))[]),(uint8,uint8,uint8,uint8,uint8))' export async function placementFee(vault, order, window=300) { // If the fees are about to change within `window` seconds of now, we send the higher native amount of the two fees. diff --git a/src/common.js b/src/common.js index c47f5d5..7ecf8fd 100644 --- a/src/common.js +++ b/src/common.js @@ -124,6 +124,7 @@ export class AbiURLCache extends AsyncURLCache { const files = { // If a contract is in a file different than its name, put the exception here // 'IVaultLogic' : 'IVault', // for example + 'IVaultLogic' : 'IVault', // for example } export function abiPath(name) { diff --git a/src/components/Status.vue b/src/components/Status.vue index eafbd33..0ea5d44 100644 --- a/src/components/Status.vue +++ b/src/components/Status.vue @@ -102,8 +102,8 @@