
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@ajna-finance/sdk
Advanced tools
A typescript SDK that can be used to create Dapps in Ajna ecosystem.
A typescript SDK that can be used to create Dapps and keepers in the Ajna ecosystem.
yarn install installs dependencies.yarn build builds the app at build, cleaning the folder first.To improve responsiveness, the SDK may raise an SdkException locally if it knows the transaction will not succeed with the current state. The SDK traps reverts to decode and and throw an exception revealing the reason. The SDK does not attempt to handle connectivity errors. As such, the consumer should assume all onchain calls could throw an exception.
Instructions assume basic knowledge of TypeScript, Ethers.js, and interacting with blockchains which use the Ethereum Virtual Machine (EVM).
Quantities and prices in Ajna are represented in WAD (18-decimal) precision. Ethers.js v5 models this using BigNumber. To convert to and from these scaled values, toWad and fromWad are provided. Do not explicitly multiply or divide by 10^18.
toWad allows conversions from both number and string values.
fromWad converts to string values, such that precision is not lost.
Price buckets in Ajna are identified by an integer bucket index, between 1 (highest price) and 7388 (lowest price). To convert to and from bucket indicies, priceToIndex and indexToPrice functions are provided. The SDK uses number type to model bucket indices.
Example scripts are provided in the examples/ directory.
To build documentation, run yarn document. HTML will be generated in the sdk-api/docs directory.
Unit tests run against a dockerized Ajna testnet. Addresses and keys in test configuration are publicly known. Do not attempt to use those addresses on a public network!
yarn test runs jest tests once.
yarn test:dev runs the jest tests in watch mode, waiting for file changes.
To pass parameters to jest, run using npx.
Note that test suites must be --runInBand because ganache requests to jump time, mine empty blocks, and reset to a checkpoint will impact unrelated tests. It also enables us to use the same account in multiple suites without worrying about nonce conflicts.
This package offers a facility to translate ABIs as compiled to a format consumable by Ethers.js. To use:
AJNA_ABIS environment var to the location where your compiler has generated the JSON ABI files. This assumes all ABIs reside in a single directory.yarn update-abis to overwrite current ABIs in src/abis.This facility was tested against brownie compilation output.
After updating ABIs, run yarn typechain-abis to generate typescript wrappers around contracts. Be sure to prettify generated code before committing.
After updating docker-compose.yml to point to a new testchain:
tests/test-constants.tstests/*.spec.ts).npm login or an npm token.yarn publish to release a new version adhering to SemVer 2.0.If you have suggestions for how SDK library boilerplate could be improved, or want to report a bug, open an issue! We'd love all and any contributions.
FAQs
A typescript SDK that can be used to create Dapps in Ajna ecosystem.
We found that @ajna-finance/sdk 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.