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:

eventName alias index aggregator alias index aggregator rule operator value
LogDeposited(address,uint256) sender 0 amount 1

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:

amount sender
1000000000000000000000000000 0x89d048be68575f2b56a999ba24faacabd1b919fb
1000000000000000000 0xa616eed6ad7a0cf5d2388301a710c273ca955e05
1000000000000000000 0xbac1cd4051c378bf900087ccc445d7e7d02ad745

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:

event description inputs
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:

triggeredAt eventName eventDef eventInput0 eventInput1 eventIndexInLog eventContractAddressLabel eventContractAddress eventContractName txFrom txData txHash txIndexInBlock txBlockHash txBlockNumber txContractAddressLabel txContractAddress txContractName fnName fnDef
6/19/2020 LogDeposited LogDeposited(address sender,uint256) amount 0xA616eEd6aD7A0cF5d2388301a710c273ca955e05 1000000000000000000 0 multibaasfaucet 0xe9f2E2B0105B683b436Fd0d7A2895BE25c310Af7 MultiBaasFaucet 0xA616eEd6aD7A0cF5d2388301a710c273ca955e05 0xd0e30db0 0x937f1d11da26d7350e66691bd1e8669961d3cb4727978fd6213265b504174fbf 0 0x611df11ac2d2e8a2da1e305817f1342bed60667c7d1a7292f6da09e7f4a1cc66 149 multibaasfaucet 0xe9f2E2B0105B683b436Fd0d7A2895BE25c310Af7 MultiBaasFaucet deposit deposit()

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:

amount sender
1000000000000000000 0xa616eed6ad7a0cf5d2388301a710c273ca955e05
1000000000000000000 0xbac1cd4051c378bf900087ccc445d7e7d02ad745
Copyright © Curvegrid 2022. All right reserved.