4.9.0 • Published 3 years ago
@cityofzion/neon-nep9 v4.9.0
neon-nep9
Overview
Neon-NEP9 plugin. Adds the package nep9
into neon-core
.
- Ability to parse an NEP9 compliant string into an easily consumable intent object
Installation
yarn i @cityofzion/neon-nep9 @cityofzion/neon-core
const neonCore = require("@cityofzion/neon-core");
const nep9Plugin = require("@cityofzion/neon-nep9");
const neonJs = nep9Plugin(neonCore);
module.exports = neonJs;
API
parse
takes in a complete NEP9 URI string and returns an intent object:
import { nep9 } from "neonJs";
const intent = parse(
"neo:AeNkbJdiMx49kBStQdDih7BzfDwyTNVRfb?asset=gas&amount=123.456"
);
The intent will look like:
{
address: "AeNkbJdiMx49kBStQdDih7BzfDwyTNVRfb",
attributes:[], // defaults to empty array
asset: "602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7", // May be undefined
amount: 123.456 // May be undefined
}
- Known ASCII attributes (remarks and descriptions) are URI-decoded and transformed into hexstrings automatically.
- Assets
neo
andgas
are automatically transformed into their respective assetIds. - Runtime validation such as address and contract verifications are not performed during parsing.
4.9.0
3 years ago
5.0.0-next.8
3 years ago
5.0.0-next.7
3 years ago
5.0.0-next.6
3 years ago
5.0.0-next.5
3 years ago
4.8.2
4 years ago
4.8.1
4 years ago
5.0.0-next.4
4 years ago
5.0.0-next.3
4 years ago
4.8.0
4 years ago
4.7.2
4 years ago
5.0.0-next.2
4 years ago
5.0.0-next.0
5 years ago
4.7.1
5 years ago
4.7.0
5 years ago
4.6.0
5 years ago
4.5.2
5 years ago
4.5.0
5 years ago
4.4.0
5 years ago
4.3.2
5 years ago
4.3.1
5 years ago
4.3.0
5 years ago
4.2.0
5 years ago
4.1.3
6 years ago
4.1.2
6 years ago
4.1.0
6 years ago