Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@api3/airnode-abi
Advanced tools
@airnode/airnode-abi
@api3/airnode-abi
Encoding and decoding utilities intended for use with Airnode
Airnode-ABI provides a unique way to encode and decode parameters. Parameters are provided with encoding types, names and values. The types are shortened and grouped with a version as the "header". The name/value pairs are then grouped and encoded as the rest of the body.
An advantage of encoding parameters this way is that parameters can be decoded natively using the language(s) of the specific blockchain. In the case of EVM blockchains, this means that parameters can be encoded as well as decoded in Solidity (or Vyper), without any additional requirements.
You can find additional documentation in the Airnode ABI specifications
You can install with either npm or Yarn
# npm
npm install --save @airnode/airnode-abi
# Yarn
yarn add @airnode/airnode-abi
encode
accepts an array of objects with the following required keys:
type
- The full list of accepted types can be found in the specifications
name
value
It is important to note that numeric values (int256
and uint256
) should be submitted as strings in order to preserve precision.
import { encode } from '@airnode/airnode-abi';
const parameters = [
{ type: 'bytes32', name: 'from', value: 'ETH' },
{ type: 'uint256', name: 'amount', value: '100000' },
];
const encodedData = encode(parameters);
console.log(encodedData);
// '0x...'
Decoding returns an object where the keys are the "names" and the values are the "values" from the initial encoding.
It is important to note that int256
and uint256
will be decoded back to strings.
import { decode } from '@airnode/airnode-abi';
const encodedData = '0x...';
const decoded = decode(encodedData);
console.log(decoded);
// { from: 'ETH', amount: ethers.BigNumber.from('100000') }
FAQs
> Encoding and decoding utilities for Airnode according to the > [Airnode ABI specifications](https://docs.api3.org/reference/airnode/latest/specifications/airnode-abi.html)
The npm package @api3/airnode-abi receives a total of 644 weekly downloads. As such, @api3/airnode-abi popularity was classified as not popular.
We found that @api3/airnode-abi 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.