Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@azuro-org/toolkit
Advanced tools
This package provides helpers to develop an app using Azuro Protocol.
npm i --save @azuro-org/toolkit
aggregateOutcomesByMarkets.ts
This helper function allows you to aggregate outcomes that are obtained from conditions by markets. This function takes an array of conditions and groups outcomes by their market key. It then sorts the outcomes within each market group and returns an array of market objects, each containing an array of outcomes.
Here is an example of how you can use it:
query Game($id: String!) {
game(id: $id) {
liquidityPool {
address
}
conditions {
conditionId
coreAddress
outcomes {
outcomeId
}
}
}
}
type Conditions = {
conditionId: string
coreAddress: string
outcomes: {
outcomeId: string
}
}
aggregateOutcomesByMarkets({
lpAddress: game.liquidityPool.lpAddress,
conditions: game.conditions,
dictionaries, // **
})
The result will be of type
type Outcome = {
selectionName: string
conditionId: string
outcomeId: string
lpAddress: string
coreAddress: string
}
type OutcomesByMarkets = {
marketName: string
outcomes: Outcome[][] // *
}[]
*
returned outcomes
are wrapped with additional array Outcome[][]
**
dictionaries
contain a set of texts for each outcome ID used in Azuro. These texts can be used to display outcomes
in a user-friendly way and provide more context about what the outcome represents. Dictionaries are an important
component of Azuro's infrastructure as they allow for standardized and consistent outcomes across all markets and events.
Read more about dictionaries.
You can pass additional data in outcomes if required, the helper will add it to outcomes in the result:
query Game($id: String!) {
game(id: $id) {
...
conditions {
...
outcomes {
...
odds
}
}
}
}
type MyOutcome = {
outcomeId: string
odds: string
}
aggregateOutcomesByMarkets<MyOutcome>(...)
The result will be of type
type Outcome = {
selectionName: string
conditionId: string
outcomeId: string
lpAddress: string
coreAddress: string
odds: string
}
type OutcomesByMarkets = {
marketName: string
outcomes: Outcome[][]
}[]
FAQs
Set of helpers to work with Azuro protocol
The npm package @azuro-org/toolkit receives a total of 130 weekly downloads. As such, @azuro-org/toolkit popularity was classified as not popular.
We found that @azuro-org/toolkit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.