New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@arisensdk/rc-parse

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arisensdk/rc-parse

ARISEN Ricardian contract parser

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

ARISEN Ricardian contract parser

This library strips out the {{ param }} tags and replaces it with data from the transaction itself.

Installation

npm i -S @arisensdk/rc-parser 

Usage

const parser = require('@arisensdk/rc-parser');
 
from arisensdk signProvider ... signargs.transaction.actions.map(async action => {
    const abi = await eos.contract(contractAccountName);
    const data = abi.fc.fromBuffer(action.name, action.data);
    const actionAbi = abi.fc.abi.actions.find(fcAction => fcAction.name === action.name);
     
    
    const parsedRicardianContract = parser.parse(action.name, data, actionAbi.ricardian_contract);
     
    // Optional HTML formatting
    const htmlOptions = {h1:'b', h2:'div class="someclass"'};
    const parsedRicardianContract = parser.parse(action.name, data, ricardian, signer, true || htmlOptions);
}):

Or constitution:

const ricardian = systemAbi.abi.ricardian_clauses[0].body;
const parsedRicardianContract = parser.constitution(ricardian, 'testaccount', {h1:'h1'});

Examples results:

No HTML formatting

parser.parse('bidname', {bid: '3 RIX', bidder: 'testaccount', newname: 'somename'}, ricardian, 'testaccount');
# Action - "bidname"

## Description

The "bidname" action places a bid on a premium account name, in the knowledge that the high bid will purchase the name.

As an authorized party I "testaccount" wish to bid on behalf of "testaccount" the amount of "3 RIX" toward purchase of the account name "somename".

HTML formatting.

parser.parse('bidname', {bid: '3 RIX', bidder: 'testaccount', newname: 'somename'}, ricardian, 'testaccount', {h1:'b', h2:'i class="test"'});
<b>Action</b> - "bidname"<br><br><i class="test">Description</i><br><br>The "bidname" action places a bid on a premium account name, in the knowledge that the high bid will purchase the name.<br><br>As an authorized party I "testaccount" wish to bid on behalf of "testac
count" the amount of "3 RIX" toward purchase of the account name "somename".<br>

Keywords

ARISEN

FAQs

Package last updated on 20 Mar 2021

Did you know?

Socket

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.

Install

Related posts