
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
@azuro-org/dictionaries
Advanced tools
CLI and set of helpers to work with Azuro protocol dictionaries
This package provides 2 features: CLI to download dictionaries; helpers to work with dictionaries.
npm i --save @azuro-org/dictionaries
All dictionaries stored in public repository. For ease of use, the dictionaries have a version and file format.
It's easy to download dictionary files with CLI. In your package.json add script:
"scripts": {
"get-dicts": "dictionaries -o {OUTPUT_DIR} -v {VERSION} -t {FILES_TYPE}"
}
VERSION
is the version of downloaded dictionaries. Find the version you need here.OUTPUT_DIR
is the directory where to put downloaded files.FILES_TYPE
is the extension of downloaded files. Accepts ts
, js
, maps
, arrays
. maps
and arrays
are
json files with different output format.@azuro-org/dictionaries -o ./dist -v 2.0.0 -t ts # will download v2.0.0 typescript files to ./dist directory
import { getMarketKey, getMarketName, getMarketDescription, assembleMarketName, assembleSelectionName } from '@azuro-org/dictionaries'
import { getMarketKey } from '@azuro-org/dictionaries'
import dictionaries from './path-to-downloaded-dictionaries'
const outcomeId = 1
const marketKey = getMarketKey(outcomeId, dictionaries)
getMarketKey(outcomeId, dictionaries)
returns the string key marketId-gamePeriodId-gameTypeId[-teamPlayerId]
built from the dictionaries related to passed outcomeId
.
In the example above the result is 1-1-1
.
There are two dictionary files marketNames.js
and marketDescriptions.js
. marketKey
is used to receive market name
and description for specific outcome ID.
import dictionaries from './path-to-downloaded-dictionaries'
dictionaries.marketNames['1-1-1'] // "Full Time Result"
dictionaries.marketDescriptions['1-1-1'] // "You predict the result..."
!!! Note that there are no texts for each outcomeId
!!!
marketNames[marketKey]
and marketDescriptions[marketKey]
may return undefined
. For marketName
generation there
is other helper assembleMarketName
. It generates human readable market name based on outcome marketId
, gamePeriodId
,
gameTypeId
, teamPlayerId
.
import { getMarketKey, assembleMarketName } from '@azuro-org/dictionaries'
import dictionaries from './path-to-downloaded-dictionaries'
const outcomeId = 42
const marketKey = getMarketKey(outcomeId, dictionaries)
let marketName = dictionaries[marketKey] // undefined
if (!marketName) {
marketName = assembleMarketName(outcomeId, dictionaries) // "Whole game - Winner of match Goal"
}
There are additional 2 sugar helpers:
import { getMarketName } from '@azuro-org/dictionaries'
import dictionaries from './path-to-downloaded-dictionaries'
getMarketName(1, dictionaries) // "Full Time Result"
getMarketName(42, dictionaries) // "Whole game - Winner of match Goal"
import { getMarketDescription } from '@azuro-org/dictionaries'
import dictionaries from './path-to-downloaded-dictionaries'
getMarketDescription(1, dictionaries) // "You predict the result..."
getMarketDescription(42, dictionaries) // undefined. Note that there is no `assemblyMarketDescription` helper.
import { assembleSelectionName } from '@azuro-org/dictionaries'
import dictionaries from './dist'
const outcomeId = 1
const selectionName = assembleSelectionName(outcomeId, dictionaries) // "Yes"
const outcomeId = 4
const selectionName = assembleSelectionName(outcomeId, dictionaries) // "Team 2 (4.5)"
FAQs
CLI and set of helpers to work with Azuro protocol dictionaries
We found that @azuro-org/dictionaries demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.