-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample_job.toml
29 lines (27 loc) · 1.78 KB
/
example_job.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
type = "directrequest"
schemaVersion = 1
name = "example_chainlink"
maxTaskDuration = "0s"
contractAddress = "0xF1a252307Ff9F3fbB9598c9a181385122948b8Ae"
evmChainID = "5"
minContractPaymentLinkJuels = "0"
observationSource = """
decode_log [type=ethabidecodelog
abi="OracleRequest(bytes32 indexed specId, address requester, bytes32 requestId, uint256 payment, address callbackAddr, bytes4 callbackFunctionId, uint256 cancelExpiration, uint256 dataVersion, bytes data)"
data="$(jobRun.logData)"
topics="$(jobRun.logTopics)"]
decode_cbor [type=cborparse data="$(decode_log.data)"]
ds [type="bridge"
name="chainlink_example"
requestData="{\\"id\\": $(jobSpec.externalJobID), \\"data\\": {\\"block_num\\": $(decode_cbor.block_num)}}"
allowUnrestrictedNetworkAccess=true
]
parse [type=jsonparse path="data" data="$(ds)"]
encode_data [type="ethabiencode" abi="(bytes32 requestId, uint256 _timeSince)" data="{ \\"requestId\\": $(decode_log.requestId), \\"_timeSince\\": $(parse.duration)}"]
encode_tx [type="ethabiencode"
abi="fulfillOracleRequest2(bytes32 requestId, uint256 payment, address callbackAddress, bytes4 callbackFunctionId, uint256 expiration, bytes calldata data)"
data="{\\"requestId\\": $(decode_log.requestId), \\"payment\\": $(decode_log.payment), \\"callbackAddress\\": $(decode_log.callbackAddr), \\"callbackFunctionId\\": $(decode_log.callbackFunctionId), \\"expiration\\": $(decode_log.cancelExpiration), \\"data\\": $(encode_data)}"
]
submit_tx [type="ethtx" to="0xF1a252307Ff9F3fbB9598c9a181385122948b8Ae" data="$(encode_tx)"]
decode_log -> decode_cbor -> ds -> parse -> encode_data -> encode_tx -> submit_tx
"""