Published 15 February 2019

SmartContractsListGetResult SmartContractsListGet(1:Address deployer)

Description

Description

 

Getting a list of smart contracts by the address from which the smart contracts are located.

The field deployer is transcoded: if the length of the address string is 64 characters, then recode from the 16th representation to the string, otherwise - calculate the public key hash by a smart contract using the blake2 algorithm.
Update the caches of the smart contract:
Get the hash of the last block.
Set the current hash variable to the hash of the last block.
While the current hash variable is not equal to the hash value of the last block scanned by the smart contract:
Load the block with the current hash into the pool.
For all transactions, retrieve a smart contract.

Fill the class structures from the smart contract. If the current transaction is deploying a smart contract, then save the transaction identifier, the sender, the recipient in the cache, otherwise - save the address and the identifier of the smart contract.
Move the current hash variable to the previous block.
Set the hash value of the last block scanned by the smart contract to the hash of the last block.
By the array of transaction identifiers placed from the addresses, extract the smart contracts and put them into the result structure.
Set the result status - SUCCESS.

Parameters

Parameters

// Wallet or smart contract address

typedef binary Address

Return

Return

struct SmartContractsListGetResult

{

   1: general.APIResponse status

   2: i32 count

   3: list<SmartContract> smartContractsList

}

Description of the returned structures and typedefs

Description of the returned structures and typedefs

struct APIResponse

{

// 0 for success, 1 for failure, 2 for not being implemented (currently unused)

   1: i8 code

// Explanation

   2: string message

}

Votes 0, average rating 0

Contents