@azuro-org/toolkit
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -1,2 +0,1 @@ | ||
import { type Dictionaries } from '@azuro-org/dictionaries'; | ||
type Outcome<T> = T & { | ||
@@ -24,5 +23,4 @@ conditionId: string; | ||
}[]; | ||
dictionaries: Dictionaries; | ||
}; | ||
export default function aggregateOutcomesByMarkets<T extends {}>(props: Props): FinalMarket<T>[]; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import {getMarketKey,getMarketName,getSelectionName}from'@azuro-org/dictionaries';/****************************************************************************** | ||
import {getMarketKey,getMarketName,getSelectionName,dictionaries}from'@azuro-org/dictionaries';/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
@@ -38,3 +38,3 @@ | ||
}function aggregateOutcomesByMarkets(props) { | ||
var lpAddress = props.lpAddress, conditions = props.conditions, dictionaries = props.dictionaries; | ||
var lpAddress = props.lpAddress, conditions = props.conditions; | ||
var marketsMap = {}; | ||
@@ -46,6 +46,6 @@ conditions.forEach(function (_a) { | ||
// we are using the same key format that was discussed earlier | ||
var marketKey = getMarketKey({ outcomeId: outcomeId, dictionaries: dictionaries }); | ||
var marketKey = getMarketKey(outcomeId); | ||
// we are obtaining the human-readable names of each market and the corresponding outcome selections | ||
var marketName = getMarketName({ outcomeId: outcomeId, dictionaries: dictionaries }); | ||
var selectionName = getSelectionName({ outcomeId: outcomeId, dictionaries: dictionaries }); | ||
var marketName = getMarketName({ outcomeId: outcomeId }); | ||
var selectionName = getSelectionName({ outcomeId: outcomeId }); | ||
var outcome = __assign({ conditionId: conditionId, outcomeId: outcomeId, lpAddress: lpAddress, coreAddress: coreAddress, selectionName: selectionName }, rest); | ||
@@ -52,0 +52,0 @@ if (!marketsMap[marketKey]) { |
@@ -1,2 +0,1 @@ | ||
import { type Dictionaries } from '@azuro-org/dictionaries'; | ||
type Outcome<T> = T & { | ||
@@ -24,5 +23,4 @@ conditionId: string; | ||
}[]; | ||
dictionaries: Dictionaries; | ||
}; | ||
export default function aggregateOutcomesByMarkets<T extends {}>(props: Props): FinalMarket<T>[]; | ||
export {}; |
@@ -38,3 +38,3 @@ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var dictionaries=require('@azuro-org/dictionaries');/****************************************************************************** | ||
}function aggregateOutcomesByMarkets(props) { | ||
var lpAddress = props.lpAddress, conditions = props.conditions, dictionaries$1 = props.dictionaries; | ||
var lpAddress = props.lpAddress, conditions = props.conditions; | ||
var marketsMap = {}; | ||
@@ -46,6 +46,6 @@ conditions.forEach(function (_a) { | ||
// we are using the same key format that was discussed earlier | ||
var marketKey = dictionaries.getMarketKey({ outcomeId: outcomeId, dictionaries: dictionaries$1 }); | ||
var marketKey = dictionaries.getMarketKey(outcomeId); | ||
// we are obtaining the human-readable names of each market and the corresponding outcome selections | ||
var marketName = dictionaries.getMarketName({ outcomeId: outcomeId, dictionaries: dictionaries$1 }); | ||
var selectionName = dictionaries.getSelectionName({ outcomeId: outcomeId, dictionaries: dictionaries$1 }); | ||
var marketName = dictionaries.getMarketName({ outcomeId: outcomeId }); | ||
var selectionName = dictionaries.getSelectionName({ outcomeId: outcomeId }); | ||
var outcome = __assign({ conditionId: conditionId, outcomeId: outcomeId, lpAddress: lpAddress, coreAddress: coreAddress, selectionName: selectionName }, rest); | ||
@@ -71,4 +71,4 @@ if (!marketsMap[marketKey]) { | ||
outcomes.sort(function (a, b) { | ||
var left = dictionaries$1.outcomes[a.outcomeId].selectionId; | ||
var right = dictionaries$1.outcomes[b.outcomeId].selectionId; | ||
var left = dictionaries.dictionaries.outcomes[a.outcomeId].selectionId; | ||
var right = dictionaries.dictionaries.outcomes[b.outcomeId].selectionId; | ||
return left - right; | ||
@@ -75,0 +75,0 @@ }); |
{ | ||
"name": "@azuro-org/toolkit", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Set of helpers to work with Azuro protocol", | ||
@@ -30,3 +30,3 @@ "module": "dist/index.es.js", | ||
"peerDependencies": { | ||
"@azuro-org/dictionaries": "^2.0.2" | ||
"@azuro-org/dictionaries": "^3.0.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16346
279