With low level SDK get method is executed in 3 steps:
Download the latest Account State (BOC)
Encode message that calls the method
Execute the message locally on the downloaded state:
Here is the sample that executes the get method getTimestamp on the latest account's state.
account boc is downloaded with blockchain API
message that calls contract's function getTimestamp is encoded with encode_message function
message is executed on local TVM with run_tvm method
asyncfunctiongetAccount(address) { // `boc` or bag of cells - native blockchain data layout. Account's boc contains full account state (code and data) that
// we will need to execute get methods.constquery=` query { blockchain { account( address: "${address}" ) { info { balance(format: DEC) boc } } } }`const {result} =awaitclient.net.query({query})constinfo=result.data.blockchain.account.inforeturn info}asyncfunctionrunGetMethod(methodName, address, accountState) {// Execute the get method `getTimestamp` on the latest account's state// This can be managed in 3 steps:// 1. Download the latest Account State (BOC) // 2. Encode message// 3. Execute the message locally on the downloaded state// Encode the message with `getTimestamp` callconst { message } =awaitclient.abi.encode_message({// Define contract ABI in the Application// See more info about ABI type here:// https://github.com/everx-labs/ever-sdk/blob/master/docs/reference/types-and-methods/mod_abi.md#abi abi: { type:'Contract', value:HelloWallet.abi, }, address, call_set: { function_name: methodName, input: {}, }, signer: { type:'None' }, });// Execute `getTimestamp` get method (execute the message locally on TVM)// See more info about run_tvm method here:// https://github.com/everx-labs/ever-sdk/blob/master/docs/reference/types-and-methods/mod_tvm.md#run_tvmconsole.log('Run `getTimestamp` get method');constresponse=awaitclient.tvm.run_tvm({ message, account: accountState, abi: { type:'Contract', value:HelloWallet.abi, }, });returnresponse.decoded.output}