Smart contract
This section contains a description of methods for working with smart contracts of the SWT platform
SmartContractGet()
returns the smart contract code to its address
SmartContractGetResult SmartContractGet(1:general.Address address)
SmartContractsListGet()
returns a list of smart contracts according to the list of the deployer starting with offset in the amount of limit
SmartContractsListGetResult SmartContractsListGet(1:general.Address deployer, 2:i64 offset, 3:i64 limit)
SmartContractAddressesListGet()
returns a list of addresses of smart contracts of the deployer
SmartContractAddressesListGetResult SmartContractAddressesListGet(1:general.Address deployer)
// Blocks till obsolete
is not the last block in chain.
PoolHash WaitForBlock(1:PoolHash obsolete)
// Blocks till there are transactions arrived to smart_address
// not yet reported by this method in current node's process lifetime.
TransactionId WaitForSmartTransaction(1:general.Address smart_public)
SmartContractsAllListGet()
Returns all smart contracts in the system
SmartContractsListGetResult SmartContractsAllListGet(1:i64 offset, 2:i64 limit)
Required parameters:
int64 offset - offset from the end of the list
int64 limit - number of smart contracts returned
Return value:
struct SmartContractsListGetResult
{
1: general.APIResponse status - response status message describing the problem, if any
2: i32 count - smart-contracts count
3: list smartContractsList - list of smart-contracts
},
where
struct SmartContract
{
1: required general.Address address
2: general.Address deployer
3: SmartContractDeploy smartContractDeploy
4: binary objectState
5: Time createTime
6: i32 transactionsCount
}
TransactionsStateGet()
returns the state of a smart contract after a transaction with id
TransactionsStateGetResult TransactionsStateGet(1:general.Address address, 2:list id)
ContractAllMethodsGet()
returns all smart contract methods
ContractAllMethodsGetResult ContractAllMethodsGet(1: list<general.ByteCodeObject> byteCodeObjects)
SmartMethodParamsGet()
returns all parameters of a smart contract
SmartMethodParamsGetResult SmartMethodParamsGet(1:general.Address address, 2:TransactionInnerId id)
SmartContractDataGet()
get smart contract code
SmartContractDataResult SmartContractDataGet(1:general.Address address)
SmartContractCompile()
returns the result of compiling a smart contract
SmartContractCompileResult SmartContractCompile(1:string sourceCode)
Last updated