From a2ed5c4ecbe29b44dc5b21f4f365ac2cfdface8a Mon Sep 17 00:00:00 2001 From: Balaji Shetty Pachai <32358081+balajipachai@users.noreply.github.com> Date: Sun, 19 Jul 2020 01:53:20 +0530 Subject: [PATCH] Update getting_started.md Added comments and required explanation which helps in implementing the example as easy as possible. --- docs/getting_started.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index ebcd28a..9b3c2a3 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -77,16 +77,19 @@ const in3 = new In3Client({ chainId : 'mainnet' }) +const myTokenContract = in3.eth.contractAt(myContractABI, myContractDeployedAddress); + // use the API to call a function.. const myBalance = await in3.eth.callFn(myTokenContract, 'balanceOf(address):uint', myAccount) -// ot to send a transaction.. +// or to send a transaction.. +// the to field has to be an address, in this case it would the myTokenContract address const receipt = await in3.eth.sendTransaction({ - to : myTokenContract, + to : myTokenContract._address, // Once you get the contract instance, then the address is availabe at contractInstance._address key method : 'transfer(address,uint256)', args : [target,amount], confirmations: 2, - pk : myKey + pk : myKey // Private Key of the account through which transaction has to be sent }) ...