0.4.8 • Published 5 years ago

evm-engine-lib v0.4.8

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

EVM Engine Lib

EVM Engine JavaScript monorepo

This is the EVM Engine JavaScript library, which allows you to do the following:

  • Creat accounts
  • Send transactions
  • Deploy contracts
  • Interact with contracts

Installing the library

To install the TangleID library and its dependencies, you can use one of the following options:

Install using npm:

npm install evm-engine-lib

or using yarn:

yarn add evm-engine-lib

Getting started

To connect to a local EVM-Lite node, do the following:

import { composeAPI } from '@v860117/evm-engine-lib'

const APIHost = 'localhost';
const APIPort = 8080;
const defaultAddress = '0X0000000000000000000000000000000000000000';

const engineAPI = composeAPI(APIHost, APIPort, defaultAddress);

API Reference

.composeAPI(APIHost, APIPort, defaultAddress)

.createAccount(password, value)

.fetchAccount(address)

.transfer(keystore, password, address, value)

.deployContract(keystore, password, contract, name, version, parameters)

.interactContract(keystore, password, address, abi, method, parameters, value)

.createAccount(password, value)

NameTypeDefaultDescription
passwordstringpasswordOptional. Password of the account.
valuenumber0Optional. Initial value of the account.

.fetchAccount(address)

NameTypeDescription
addressstringaddress of the account.

.transfer(keystore, password, address, value)

NameTypeDescription
addressstringAddress of the sender.
passwordstringPassword of the sender account, it will be used for decrpyting the keystore.
keystoreJSONKey store of the sender account.
valuenumberValue of currency that will be tranfer from sender account to receiver account.

.deployContract(keystore, password, contract, name, version, parameters)

NameTypeDescription
keystorestringKey store of the contract owner.
passwordstringPassword of the contract owner.
contractstringA contract is written in Solidity language.
namestringContract name.
versionstringSolc version.
parametersArrayParameters of the method that will be used for method arguments.

.interactContract(keystore, password, address, abi, method, parameters, value)

NameTypeDescription
addressstringAddress of the deployed contract
keystoreJSONKey store of the user.
passwordstringPassword of the user.
contractstringA contract written in Solidity language.
methodstringMethod name of the smart contract.
parametersArrayParameters of the method that will be used for method arguments.

Contributing

Bootstrap your environments

  1. Clone this repository.
$ git clone https://github.com/mushroom0117/EVM-Engine-Lib.git
  1. Install the dependency packages.
$ yarn run init

Running tests

$ yarn test

Licensing

EVM Engine Lib is freely redistributable under the MIT License. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

0.4.8

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago