Skip to content

Example javascript library which can be used to communicate with the Ethereum network via localnode, metamask or custom node URL.

License

Notifications You must be signed in to change notification settings

mimirblockchainsolutions/javascript-contract-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Javascript Contract Library

Example javascript library which can be used to communicate with the Ethereum network via localnode, metamask or custom node URL.

  1. Include script files web.min.js and contractInterface.js in HTML file.

  2. Call the ContractInterface contract function with the solidity-contract-function-name and arguments array.

        const contractInterface = new ContractInterface();
        
        contractInterface.contract('solidity_function_name', []).then((res) => {
            console.log(res);
        }, (err) => {
            console.log(err);
        });
        
        contractInterface.contract('solidity_function_name', ['one', 'two']).then((res) => {
            console.log(res);
        }, (err) => {
            console.log(err);
        });
    

*Note: In contractInterface.js change the contractAddress to your deployed contract address and abiAddress to your abi.json file location.

Libraries Used:

Web3.js

About

Example javascript library which can be used to communicate with the Ethereum network via localnode, metamask or custom node URL.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published