-
Notifications
You must be signed in to change notification settings - Fork 0
/
floor-price-job.toml
24 lines (22 loc) · 1.86 KB
/
floor-price-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
type = "directrequest"
schemaVersion = 1
name = "Aurum-Job3"
maxTaskDuration = "0s"
contractAddress = "0x01FeDA43882AB7d1f3fcB79ae8e4EF90BE2ab1a0"
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)"]
fetch [type="bridge" name="aurum-bridge2" requestData="{\\"id\\": $(jobSpec.externalJobID), \\"data\\": { \\"tokenAddress\\": $(decode_cbor.tokenAddress)}}"]
parse [type="jsonparse" path="openSea,floorPrice" data="$(fetch)"]
multiply [type="multiply" input="$(parse)" times="$(decode_cbor.times)"]
encode_data [type="ethabiencode" abi="(bytes32 requestId, address tokenAddress, uint256 floorPrice)" data="{ \\"requestId\\": $(decode_log.requestId), \\"tokenAddress\\": $(decode_cbor.tokenAddress), \\"floorPrice\\": $(multiply)}"]
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="0x01FeDA43882AB7d1f3fcB79ae8e4EF90BE2ab1a0" data="$(encode_tx)"]
decode_log -> decode_cbor -> fetch -> parse -> multiply -> encode_data -> encode_tx -> submit_tx
"""