npm install @twetch/bsvabi```
npm i @twetch/bsvabi
`javascript
const BSVABI = require('@twetch/bsvabi');
const abiSchema = ...;
const twetchAbi = new BSVABI(abiSchema);
// build from either arguments or tx
twetchABI.action('post').fromArgs([...]);
twetchABI.action('post').fromTX(rawtx);
// Get the data array for a twetch Post
twetchABI.action('post').fromArgs(['hello world', ...]).toArray(); // returns ['19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAut', 'hello world', ...]
// Get the object for a twetch Post
twetchABI.action('post').fromArgs(['hello world', ...]).toObject(); // returns { bNamespace: '19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAut', bContent: 'hello world', ... }
``
Response:
- the BSVABI instance w/ the action selected
Response:
- this BSVABI instance, but now validated. Errors thrown if validation fails
Response:
- this BSVABI instance, but now validated. Errors thrown if validation fails