You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/subgraph-manifest.md
+25
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,7 @@ The `mapping` field may be one of the following supported mapping manifests:
74
74
|**event**|*String*| An identifier for an event that will be handled in the mapping script. For Ethereum contracts, this must be the full event signature to distinguish from events that may share the same name. No alias types can be used. For example, uint will not work, uint256 must be used.|
75
75
|**handler**|*String*| The name of an exported function in the mapping script that should handle the specified event. |
76
76
|**topic0**| optional *String*| A `0x` prefixed hex string. If provided, events whose topic0 is equal to this value will be processed by the given handler. When topic0 is provided, _only_ the topic0 value will be matched, and not the hash of the event signature. This is useful for processing anonymous events in Solidity, which can have their topic0 set to anything. By default, topic0 is equal to the hash of the event signature. |
77
+
|**calls**| optional [*CallDecl*](#153-declaring-calls)| A list of predeclared `eth_calls` that will be made before running the handler |
77
78
78
79
#### 1.5.2.3 CallHandler
79
80
@@ -95,6 +96,30 @@ The `mapping` field may be one of the following supported mapping manifests:
95
96
| --- | --- | --- |
96
97
|**kind**|*String*| The selected block handler filter. Only option for now: `call`: This will only run the handler if the block contains at least one call to the data source contract. |
97
98
99
+
### 1.5.3 Declaring calls
100
+
101
+
_Available from spec version 1.2.0_
102
+
103
+
Declared calls are performed in parallel before the handler is run and can
104
+
greatly speed up syncing. Mappings access the call results simply by using
105
+
`ethereum.call` from the mappings. The **calls** are a map of key value pairs:
106
+
107
+
| Field | Type | Description |
108
+
| --- | --- | --- |
109
+
|**label**|*String*| A label for the call for error messages etc. |
110
+
|**call**|*String*| See below |
111
+
112
+
Each call is of the form `<ABI>[<address>].<function>(<args>)`:
113
+
114
+
| Field | Type | Description |
115
+
| --- | --- | --- |
116
+
|**ABI**|*String*| The name of an ABI from the `abis` section |
117
+
|**address**|*Expr*| The address of a contract that follows the `ABI`|
118
+
|**function**|*String*| The name of a view function in the contract |
119
+
|**args**|*[Expr]*| The arguments to pass to the function |
120
+
121
+
The `Expr` can be either `event.address` or `event.params.<name>`.
122
+
98
123
## 1.6 Path
99
124
A path has one field `path`, which either refers to a path of a file on the local dev machine or an [IPLD link](https://github.com/ipld/specs/).
0 commit comments