Skip to main content

Blockchain transaction functions

Helps to send the blockchain tractions.

MBCOMPOSE(address, contract, method, from, signer, value, ...args)

Compose an unsigned transaction to call a smart contract function.

Parameters

  • address Ethereum address or label.
  • contract Smart contract label, must be associated with the address.
  • method Smart contract function name.
  • from From address.
  • signer (Optional) Signer address. Defaults to the 'from' address.
  • value (Optional) Value for amount of ETH sent.
  • args (Optional) Arguments to pass to the function.

Return

An unsigned transaction, suitable for signing and submitting to the blockchain.

Example

=MBCOMPOSE("multibaasfaucet", "multibaasfaucet", "deposit", "0xA616eEd6aD7A0cF5d2388301a710c273ca955e05", "0xA616eEd6aD7A0cF5d2388301a710c273ca955e05", 100000000000000000) in the cell. The structure of the return value is as follows:

{
"from": "0xA616eEd6aD7A0cF5d2388301a710c273ca955e05",
"to": "0x317570b8c43feCaDb8Ebaf765044Ad9626F4848e",
"value": "100000000000000000",
"gas": 22774,
"gasPrice": "20000000000",
"data": "0xd0e30db0",
"nonce": 6,
"hash": "0x72f0a63bc24503d1b71e93729c7787891633aa192dadb999f87b0f343a8ecbf4"
}

MBPOSTTEMPLATE(numberOfArgs)

Create a template to be used with calling a smart contract method (function) that will write to the blockchain.

Parameters

  • numberOfArgs (Optional) Number of arguments (parameters) to pass to the method (function). Default is 0.

Return

A two dimensional array that can be used as the starting point for calling a smart contract method.

Example

=MBPOSTTEMPLATE(1) in the cell. The structure of the return value is as follows:

addresscontractmethodfromsignerinput0txHash (output)

MBTX(hash, headers)

Retrieve the details of a blockchain transaction.

Parameters

  • hash Transaction hash.
  • headers (Optional) Include column headers. TRUE/FALSE, defaults to TRUE.

Return

Transaction details.

Example

=MBTX("0xfe9e4b800d14c36f2e8c26ab44ffcfcbf55ac71d6f0d5f2ac95b3d63c7f71569") in the cell. The structure of the return value is as follows:

isPendingnoncegasPricegastovalueinputvrshash
FALSE4220000000000227740xe9f2e2b0105b683b436fd0d7a2895be25c310af71E+180xd0e30db00xf0742a460xf7d63ad5985bfcc8f1764198a32d7e1800e852b2408068b0904187c3e3b3c4dc0x290fae6d05ef9007ce21f8144629edbd7ebf23a1205a3b4a74a3746c6737132c0xfe9e4b800d14c36f2e8c26ab44ffcfcbf55ac71d6f0d5f2ac95b3d63c7f71569