Skip to main content

Blockchain event functions

Helps to retrieve information from the blockchain event.

MBCUSTOMQUERYTEMPLATE(numSelects, numFilters)

Create a template to be used with a custom MultiBaas Event Query.

Parameters

  • numberOfSelects (Optional) Number of 'select' groups to create. Default is 1.
  • numberOfFilters (Optional) Number of 'filter' groups to create. Default is 1.

Return

A two dimensional array that can be used as the starting point for a custom Event Query.

Example

=MBCUSTOMQUERYTEMPLATE(2, 0) in the cell. The structure of the return value is as follows:

eventNamealiasindexaggregatoraliasindexaggregatorruleoperatorvalue
LogDeposited(address,uint256)sender0amount1

MBCUSTOMQUERY(events, groupBy, orderBy, limit, offset)

Retrieve the results of a custom MultiBaas Event Query. You can use MBCUSTOMQUERYTEMPLATE to generate a useful template.

Parameters

  • events Two dimensional array of event names, selectors and filters.
  • groupBy (Optional) Field to group by.
  • orderBy (Optional) Field to order by.
  • limit (Optional) Number of results to return.
  • offset (Optional) Offset from the 0th result to return.

Return

A two dimensional array with the results of the Event Query.

Example

Let's say the given B35:H36 consists of MBCUSTOMQUERYTEMPLATE example above.

=MBCUSTOMQUERY(B35:H36, "", "", 3, 0) in the cell. The structure of the return value is as follows:

amountsender
10000000000000000000000000000x89d048be68575f2b56a999ba24faacabd1b919fb
10000000000000000000xa616eed6ad7a0cf5d2388301a710c273ca955e05
10000000000000000000xbac1cd4051c378bf900087ccc445d7e7d02ad745

MBEVENTLIST(contract, filter)

Retrieve a detailed list of a smart contract's events.

Parameters

  • contract Smart contract label, must be associated with the address.
  • filter (Optional) Regular expression (regex) to filter function names on.

Return

Array of smart contract functions and their inputs and outputs.

Example

=MBEVENTLIST("multibaasfaucet") in the cell. The structure of the return value is as follows:

eventdescriptioninputs
LogCurrentOperatorRevoked"2 inputs: owner address operatorRevoked address"
LogDeposited"2 inputs: sender address amount uint256"
LogOperatorCandidateAccepted"1 input: candidateAccepted address"
LogOperatorCandidateRequested"2 inputs: owner address candidate address"
LogOperatorCandidateRevoked"1 input: candidateRevoked address"
LogOwnerCandidateAccepted"1 input: candidateAccepted address"
LogOwnerCandidateRequested"2 inputs: owner address candidate address"
LogOwnerCandidateRevoked"1 input: candidateRevoked address"
LogPaused"1 input: owner address"
LogSent"2 inputs: receiver address amount uint256"
LogUnpaused"1 input: owner address"
LogWithdrew"2 inputs: owner address amount uint256"

MBEVENTS(address, limit, offset)

Retrieve blockchain events. Address must be associated with one or more contracts in MultiBaas.

Parameters

  • address Ethereum address or label.
  • limit (Optional) Number of results to return.
  • offset (Optional) Offset from the 0th result to return.

Return

A two dimensional array of events.

Example

=MBEVENTS("privatefaucet", 1, 2) in the cell. The structure of the return value is as follows:

triggeredAteventNameeventDefeventInput0eventInput1eventIndexInLogeventContractAddressLabeleventContractAddresseventContractNametxFromtxDatatxHashtxIndexInBlocktxBlockHashtxBlockNumbertxContractAddressLabeltxContractAddresstxContractNamefnNamefnDef
6/19/2020LogDepositedLogDeposited(address sender,uint256) amount0xA616eEd6aD7A0cF5d2388301a710c273ca955e0510000000000000000000multibaasfaucet0xe9f2E2B0105B683b436Fd0d7A2895BE25c310Af7MultiBaasFaucet0xA616eEd6aD7A0cF5d2388301a710c273ca955e050xd0e30db00x937f1d11da26d7350e66691bd1e8669961d3cb4727978fd6213265b504174fbf00x611df11ac2d2e8a2da1e305817f1342bed60667c7d1a7292f6da09e7f4a1cc66149multibaasfaucet0xe9f2E2B0105B683b436Fd0d7A2895BE25c310Af7MultiBaasFaucetdepositdeposit()

MBQUERY(query, limit, offset)

Retrieve the results of a MultiBaas Event Query.

Parameters

  • query Event Query name to return results from.
  • limit (Optional) Number of results to return.
  • offset (Optional) Offset from the 0th result to return.

Return

A two dimensional array with the results of the Event Query.

Example

=MBQUERY("Faucet", 2, 1) in the cell. The structure of the return value is as follows:

amountsender
10000000000000000000xa616eed6ad7a0cf5d2388301a710c273ca955e05
10000000000000000000xbac1cd4051c378bf900087ccc445d7e7d02ad745