ContractExecutionDto

Data structure for performing a contract call on a blockchain

Signature:

{
  walletId! : string;
  to! : string;
  secretType! : SecretType;
  functionName! : string;
  value! : BigDecimal;
  inputs! : [ {
    type! : string;
    value! : string;
  } ],
  chainSpecificFields! :  Object;
}

๐Ÿ“˜

The chainSpecificFields depend on the chain uses to execute the smart contract call. For an overview of the available fields take a look at Contract calls in the Deep dive section.

Parameters:

ParameterRequiredTypeDescription
walletIdTrueStringID of the wallet one wants to sign with.
toTrueStringDestination address of the transaction.
secretTypeTrueSecretTypeChain the transaction will be executed on.
valueTrueNumberThe amount that will be sent with the contract execution. Value will be passed as-is. This means that for example in Etheruem the value is in WEI
functionNameTrueStringName of the function on the contract that needs to be executed
inputs[]TrueArrayArray of inputs needed to execute the function
inputs[].typeTrueStringType of the input parameter (ex. uint256)
inputs[].valueTrueStringValue of the input parameter. Needs to be passed as a string value, will be parsed by Venly
chainSpecificFieldsTrueObjectFields that contain chain specific values. For possible values, please see chain specific fields documentation.

Example:

{
  "walletId" : "adc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "secretType" : "ETHEREUM",
  "functionName" : "transfer",
  "value" : 0,
  "inputs" : [ {
    "type" : "address",
    "value" : "0x80cbb6c4342948e5be81987dce8251dbedd69138"
  }, {
    "type" : "uint256",
    "value" : 73680000
  } ],
  "chainSpecificFields" : {
    "gasLimit" : "300000"
  }
}

Function Types

๐Ÿ“˜