ContractCall()

Summary

RouteTypeExample
/contract/contractcallPOSThttp://rest.creditsenterprise.com/api/contract/contractcall

Description

Executes smart contract and actually forms a transaction to be executed, that’s why the output is the same with calling the method TransactionExec(). From the user point of view it looks like a selection of a smart contract, its methods, specifying parameters for selected methods. This is the work for front-end developer. The RESTful API has only the function to pack all of this information in a transaction and output an array of data for signature.

Request

Request Structure

JSON
Copy

Request Parameters

MethodApi: string value - it’s vital to specify the API method to pack the transaction: "SmartDeploy", "SmartMethodExecute";

PublicKey: string_value - sender public key in base58

ReceiverPublicKey: string_value - recipient public key (in this case, smart contract public key in base58 will be generated automatically)

Amount: decimal - transaction amount as a decimal or integer number. This field is not required to deploy or initiate the smart contract

Fee: decimal - maximum fee approved by the user as a decimal or integer number

Method: string_value - Name of the invoked smart contract method

Args: string_value - arguments for smart contract execution in base58 separate by base58

UserData: string_value - data the user sent with the transaction including the data about deployment and initiation of a smart contract

TransactionSignature: string_value - transaction signature in base58

Response

Response Structure

string: transaction_id - transaction number containing new state -> in TransactionExec()

string: commission: - fee for the execution

JSON
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard