aion-web3-avm-contract
Advanced tools
Comparing version 1.2.6-beta.2 to 1.2.6-beta.4
{ | ||
"name": "aion-web3-avm-contract", | ||
"namespace": "aion", | ||
"version": "1.2.6-beta.2", | ||
"version": "1.2.6-beta.4", | ||
"description": "Web3 module for using the abi to use AVM Contracts", | ||
@@ -11,3 +11,3 @@ "repository": "https://github.com/aionnetwork/aion_web3/tree/avm-support-update/packages/web3-avm-contract", | ||
"aion-lib": "1.1.4", | ||
"aion-web3-avm-abi": "1.2.6-beta.2", | ||
"aion-web3-avm-abi": "1.2.6-beta.4", | ||
"aion-web3-utils": "1.1.4", | ||
@@ -18,3 +18,3 @@ "bn.js": "^4.11.8", | ||
}, | ||
"gitHead": "26d0739d1a736a34a936744d12da2ec2a668dfd7" | ||
"gitHead": "4b48e2dd4a8acc1ef30c0b2fd2f1a08fea0f9c6b" | ||
} |
103
src/index.js
@@ -23,6 +23,8 @@ /* | ||
*/ | ||
/** | ||
* | ||
* @namespace AVM-Contract | ||
*/ | ||
* | ||
* @namespace web3-avm-contract | ||
* | ||
*/ | ||
@@ -102,2 +104,10 @@ | ||
/** | ||
*@method sendTransaction | ||
*@memberof AVM-Contract | ||
*@desc signs and send a transaction | ||
*@param {object} txObject - similar to what would be passed to send/call | ||
* | ||
*@return {int} value | ||
*/ | ||
this.send = async(methodName, inputTypes, inputValues,address,contract) => { | ||
@@ -120,7 +130,11 @@ let contr = new Contract(); | ||
/** | ||
*@desc signs and send a transaction | ||
*@param accepts a transaction data object | ||
*@return returns the transaction data or false on error | ||
**/ | ||
*@method sendTransaction | ||
*@memberof AVM-Contract | ||
*@desc signs and send a transaction | ||
*@param {object} txObject - similar to what would be passed to send/call | ||
* | ||
*@return {int} value | ||
*/ | ||
@@ -155,6 +169,9 @@ this.sendTransaction = async (txObject) => { | ||
/** | ||
*@desc makes a call | ||
*@param accepts a transaction data object and return type | ||
*@return if return type is not null return the decoded data else return true or false if there is an error | ||
**/ | ||
*@method call | ||
*@memberof AVM-Contract | ||
*@desc makes a call | ||
*@param {object} txObject - similar to what would be passed to send/call | ||
*@param {object} txObject - similar to what would be passed to send/call | ||
*@return {int} value | ||
*/ | ||
@@ -429,3 +446,2 @@ this.call = async (txObject,returnType=null) => { | ||
//define call functions | ||
//console.log("fn: ",fn); | ||
Object.defineProperty(obj.avmMethod, fn.name,{ | ||
@@ -606,2 +622,9 @@ value: function(){ | ||
// Defines the Arguments of a AVM Contract's Initializer | ||
/** | ||
*@desc Converts the Jar into a JarPath to be Encoded for Initialization | ||
*@method args | ||
*@memberof AVM-Contract | ||
*@param {object} jar - path to jar file | ||
*@return {object} value -returns file stream | ||
*/ | ||
args(types, values) { | ||
@@ -622,2 +645,9 @@ | ||
// Initialize | ||
/** | ||
*@desc Converts the Jar into a JarPath to be Encoded for Initialization | ||
*@method init | ||
*@memberof AVM-Contract | ||
*@param {object} jar - path to jar file | ||
*@return {object} value -returns file stream | ||
*/ | ||
init() { | ||
@@ -633,3 +663,10 @@ if(this._jarPath === null) { throw new Error('requires a jarFile to be set first through the deploy method'); } | ||
// Initialize & Send | ||
async initSend() { | ||
/** | ||
*@desc Converts the Jar into a JarPath to be Encoded for Initialization | ||
*@method initSend | ||
*@memberof AVM-Contract | ||
*@param {object} jar - path to jar file | ||
*@return {object} value -returns file stream | ||
*/ | ||
async initSend() { | ||
if(this._jarPath === null) { throw new Error('requires a jarFile to be set first through the deploy method'); } | ||
@@ -649,3 +686,2 @@ if(this._argsData === null) { this._argsData = this._abi.encode([], []); } | ||
console.log("Deploying AVM Contract..."); | ||
return await this.sendTransaction(txObject); | ||
@@ -656,2 +692,9 @@ //return this._initializer; | ||
// Sets the Method you wish to Call | ||
/** | ||
*@desc Converts the Jar into a JarPath to be Encoded for Initialization | ||
*@method method | ||
*@memberof AVM-Contract | ||
*@param {object} jar - path to jar file | ||
*@return {object} value -returns file stream | ||
*/ | ||
method(method) { | ||
@@ -663,2 +706,10 @@ this._method = method; | ||
// Sets the Params of the Method you wish to Call | ||
/** | ||
*@desc Converts the Jar into a JarPath to be Encoded for Initialization | ||
*@method inputs | ||
*@memberof AVM-Contract | ||
*@param {object} jar - path to jar file | ||
*@return {object} value -returns file stream | ||
*/ | ||
inputs(types, values) { | ||
@@ -676,2 +727,10 @@ if(this._method === null) { | ||
// Encodes the Method Call | ||
/** | ||
*@desc Converts the Jar into a JarPath to be Encoded for Initialization | ||
*@method encode | ||
*@memberof AVM-Contract | ||
*@param {object} jar - path to jar file | ||
*@return {object} value -returns file stream | ||
*/ | ||
encode() { | ||
@@ -685,2 +744,9 @@ if(this._method === null) { | ||
// Decodes some data returned for a Method | ||
/** | ||
*@desc Converts the Jar into a JarPath to be Encoded for Initialization | ||
*@method decode | ||
*@memberof AVM-Contract | ||
*@param {object} jar - path to jar file | ||
*@return {object} value -returns file stream | ||
*/ | ||
decode(type, data) { | ||
@@ -691,2 +757,9 @@ return this._abi.decode(type, data); | ||
// | ||
/** | ||
*@desc Converts the Jar into a JarPath to be Encoded for Initialization | ||
*@method Interface | ||
*@memberof AVM-Contract | ||
*@param {object} jar - path to jar file | ||
*@return {object} value -returns file stream | ||
*/ | ||
Interface(abi) { | ||
@@ -783,4 +856,2 @@ var abi = this._abi.AvmInterface(abi); | ||
var subOptions = this._generateEventOptions.apply(this, arguments); | ||
//console.log("subOptions.params: ",subOptions.params); | ||
//console.log("subOptions.event: ",subOptions.event); | ||
var getPastLogs = new Method({ | ||
@@ -787,0 +858,0 @@ name: 'getPastLogs', |
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
66916
836
+ Addedaion-web3-avm-abi@1.2.6-beta.4(transitive)
- Removedaion-web3-avm-abi@1.2.6-beta.2(transitive)