ブロックチェーンイベント関数
ブロックチェーンイベントから情報を取得するのに役立ちます。
MBCUSTOMQUERYTEMPLATE(numSelects, numFilters)
カスタム MultiBaas Event Query で使用するテンプレートを作成します。
パラメータ
numberOfSelects(オプション)作成する 'select' グループの数。デフォルトは 1。numberOfFilters(オプション)作成する 'filter' グループの数。デフォルトは 1。
戻り値
カスタム Event Query の開始点として使用できる 2 次元配列。
例
セルに =MBCUSTOMQUERYTEMPLATE(2, 0) と入力します。戻り値の構造は次のとおりです:
| eventName | alias | index | aggregator | alias | index | aggregator | rule | operator | value |
|---|---|---|---|---|---|---|---|---|---|
| LogDeposited(address,uint256) | sender | 0 | amount | 1 |
MBCUSTOMQUERY(events, groupBy, orderBy, limit, offset)
カスタム MultiBaas Event Query の結果を取得します。MBCUSTOMQUERYTEMPLATE を使用して便利なテンプレートを生成できます。
パラメータ
eventsイベント名、セレクター、フィルターの 2 次元配列。groupBy(オプション)グループ化するフィールド。orderBy(オプション)並べ替えるフィールド。limit(オプション)返す結果の数。offset(オプション)0 番目の結果から返すオフセット。
戻り値
Event Query の結果を含む 2 次元配列。
例
上記の MBCUSTOMQUERYTEMPLATE の例が B35:H36 にあるとします。
セルに =MBCUSTOMQUERY(B35:H36, "", "", 3, 0) と入力します。戻り値の構造は次のとおりです:
| amount | sender |
|---|---|
| 1000000000000000000000000000 | 0x89d048be68575f2b56a999ba24faacabd1b919fb |
| 1000000000000000000 | 0xa616eed6ad7a0cf5d2388301a710c273ca955e05 |
| 1000000000000000000 | 0xbac1cd4051c378bf900087ccc445d7e7d02ad745 |
MBEVENTLIST(contract, filter)
スマートコントラクトのイベントの詳細なリストを取得します。
パラメータ
contractスマートコントラクトラベル、アドレスに関連付けられている必要があります。filter(オプション)関数名をフィルタリングするための正規表現(regex)。
戻り値
スマートコントラクト関数とその入力および出力の配列。
例
セルに =MBEVENTLIST("multibaasfaucet") と入力します。戻り値の構造は次のとおりです:
| 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)
ブロックチェーンイベントを取得します。アドレスは MultiBaas の 1 つ以上のコントラクトに関連付けられている必要があります。
パラメータ
addressEthereum アドレスまたはラベル。limit(オプション)返す結果の数。offset(オプション)0 番目の結果から返すオフセット。
戻り値
イベントの 2 次元配列。
例
セルに =MBEVENTS("privatefaucet", 1, 2) と入力します。戻り値の構造は次のとおりです:
| 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)
MultiBaas Event Query の結果を取得します。
パラメータ
query結果を返す Event Query 名。limit(オプション)返す結果の数。offset(オプション)0 番目の結果から返すオフセット。
戻り値
Event Query の結果を含む 2 次元配列。
例
セルに =MBQUERY("Faucet", 2, 1) と入力します。戻り値の構造は次のとおりです:
| amount | sender |
|---|---|
| 1000000000000000000 | 0xa616eed6ad7a0cf5d2388301a710c273ca955e05 |
| 1000000000000000000 | 0xbac1cd4051c378bf900087ccc445d7e7d02ad745 |