aion-web3-avm-abi
Advanced tools
Comparing version 1.2.6-beta.2 to 1.2.6-beta.4
{ | ||
"name": "aion-web3-avm-abi", | ||
"namespace": "aion", | ||
"version": "1.2.6-beta.2", | ||
"version": "1.2.6-beta.4", | ||
"description": "Web3 module encode and decode AVM in/output.", | ||
@@ -16,3 +16,3 @@ "repository": "https://github.com/aionnetwork/aion_web3/tree/avm-support-update/packages/web3-avm-abi", | ||
}, | ||
"gitHead": "26d0739d1a736a34a936744d12da2ec2a668dfd7" | ||
"gitHead": "4b48e2dd4a8acc1ef30c0b2fd2f1a08fea0f9c6b" | ||
} |
"use strict"; | ||
/** | ||
*@module abi-errors | ||
*@memberof avm-abi | ||
* | ||
*/ | ||
@@ -6,0 +6,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
/** | ||
*@module coder-utils | ||
*@module AVM coder-utils | ||
*/ | ||
@@ -8,2 +8,9 @@ var BN = require('bn.js'); | ||
/** | ||
* | ||
*@function getAddress | ||
*@desc Gets the right Coder based on the Param passed | ||
*@param {string} val - string value. | ||
* | ||
*/ | ||
function getAddress(val) { | ||
@@ -10,0 +17,0 @@ return aionLib.accounts.createChecksumAddress(val); |
@@ -23,2 +23,6 @@ /* | ||
*/ | ||
/** | ||
*@module AVM-coder | ||
* | ||
*/ | ||
@@ -544,3 +548,7 @@ "use strict" | ||
let bytes = utils.arrayify(utils.bigNumberify(value)); | ||
writer.writeByte(this.tag); | ||
if(array){ | ||
writer.writeByte(0x23); | ||
}else{ | ||
writer.writeByte(this.tag); | ||
} | ||
writer.writeByte(bytes.length); | ||
@@ -547,0 +555,0 @@ writer.writeBytes(bytes); |
@@ -1,2 +0,2 @@ | ||
/* | ||
/** | ||
* Copyright (c) 2017-2018 Aion foundation. | ||
@@ -23,6 +23,7 @@ * | ||
*/ | ||
/** | ||
* | ||
* @namespace avm-abi | ||
* @memberof Avm | ||
*@namespace web3-avm-abi | ||
* | ||
*/ | ||
@@ -35,2 +36,7 @@ | ||
let ABI = require('./interface'); | ||
/** | ||
*@class | ||
*this is the main ABICoder class | ||
*/ | ||
class ABICoder { | ||
@@ -43,3 +49,11 @@ | ||
// Gets the right Coder based on the Param passed | ||
/** | ||
* | ||
*@method getCoder | ||
*@desc Gets the right Coder based on the Param passed | ||
*@memberof AVM-abi | ||
*@param {string} param - string value of code type. | ||
* | ||
*/ | ||
getCoder(param) { | ||
@@ -60,3 +74,2 @@ let comps = param.trim().split(" ").map((comp) => comp.trim()); | ||
} | ||
// Switch statement to find all the different types of coders | ||
@@ -119,3 +132,10 @@ switch (param.toLowerCase()) { | ||
// Creates a new Instance of a Reader | ||
/** | ||
*@desc Creates a new Instance of a Reader | ||
*@method getReader | ||
*@memberof AVM-abi | ||
*@param {string} param - string value of code type. | ||
* | ||
*/ | ||
getReader(data) { | ||
@@ -126,2 +146,9 @@ return new codec.Reader(data); | ||
// Creates a new Instance of a Writer | ||
/** | ||
*@desc Creates a new Instance of a Writer | ||
*@method getWriter | ||
*@memberof AVM-abi | ||
* | ||
* | ||
*/ | ||
getWriter() { | ||
@@ -131,2 +158,10 @@ return new codec.Writer(); | ||
/** | ||
*@desc Creates the deploy data for a contract | ||
*@method readyDeploy | ||
*@memberof AVM-abi | ||
*@param {string} jarPath - path to jar file. | ||
*@param {string} encodedArgs - encoded deploy arguments. | ||
* | ||
*/ | ||
readyDeploy(jarPath, encodedArgs) { | ||
@@ -153,2 +188,10 @@ // Converts the jarfile into Bytes | ||
// Encodes Data Types and their Values which are to be used in a Method | ||
/** | ||
*@desc Encodes data based on type | ||
*@method encode | ||
*@memberof AVM-abi | ||
*@param {array} types - types of data to be encoded. | ||
*@param {array} values - values to be encoded. | ||
* | ||
*/ | ||
encode(types, values) { | ||
@@ -173,2 +216,11 @@ | ||
// Encodes Specifically for a Method Call | ||
/** | ||
*@desc Encodes Specifically for a Method Call | ||
*@function encodeMethod | ||
*@memberof AVM-abi | ||
*@param {string} method- method to be encoded. | ||
*@param {array} types - types of data to be encoded. | ||
*@param {array} values - values to be encoded. | ||
* | ||
*/ | ||
encodeMethod(method, types, values) { | ||
@@ -186,2 +238,10 @@ let sigWriter = this.getWriter(); | ||
// Decodes the AVM Contract Data based on the Data itself and the Type of Data expected | ||
/** | ||
*@desc Decodes the AVM Contract Data based on the Data itself and the Type of Data expected | ||
*@function decode | ||
*@memberof AVM-abi | ||
*@param {string} type - type of data to be decoded. | ||
*@param {string} data - data to be decoded. | ||
* | ||
*/ | ||
decode(type, data) { | ||
@@ -196,3 +256,10 @@ let reader = this.getReader(utils.arrayify(data)); | ||
// | ||
/** | ||
*@desc Creates an ABI interface object | ||
*@method AvmInterface | ||
*@memberof AVM-abi | ||
*@param {string} abi - abi definition of a contract in string. | ||
* | ||
* | ||
*/ | ||
AvmInterface(abi){ | ||
@@ -205,7 +272,8 @@ return ABI.Interface.fromString(abi); | ||
* | ||
* @method getEvents | ||
* @param {Object} inputs | ||
* @param {String} data | ||
* @param {Array} topics | ||
* @return {Array} byte array | ||
*@method getEvents | ||
*@memberof AVM-abi | ||
*@param {Object} inputs | ||
*@param {String} data | ||
*@param {Array} topics | ||
*@return {Array} byte array | ||
*/ | ||
@@ -212,0 +280,0 @@ getEvents(inputs, data, topics) { |
@@ -0,1 +1,5 @@ | ||
/** | ||
*@module AVM-Interface | ||
* | ||
*/ | ||
"use strict"; | ||
@@ -2,0 +6,0 @@ var __importStar = (this && this.__importStar) || function (mod) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88400
1533