Params

Array with parameters for Smart Contract function call

Options:

  • name (string) - Function parameter name
  • type (string) - Function parameter type
  • value (string) - Function parameter value
  • variable (string) - Variable name, if variable has been added
  • valueFromTx (number) - Index of the FCT transaction, from which current FCT has to take the value from.

Example with ERC20 Transfer

// Example for transfer(to address, amount uint256)
// Params for transfer ERC20 function (send 5 tokens)
const params = [
{ name: "to", type: "address", value: "0x0388aedc924a373b28562884458f51dec5dbacbd" },
{ name: "amount", type: "uint256", value: "5000000000000000000" }
]
// Example for transfer(to address, amount uint256)
// Params for transfer ERC20 function (send 5 tokens)
// Using variable "account address"
const params = [
{ name: "to", type: "address", variable: "account address" },
{ name: "amount", type: "uint256", value: "5000000000000000000" }
]
// Example for transfer(to address, amount uint256)
// "amount" value is taken from the FCT at the position of 0
const params = [
{ name: "to", type: "address", value: "0x0388aedc924a373b28562884458f51dec5dbacbd" },
{ name: "amount", type: "uint256", valueFromTx: 0 }
]