Documentation ¶
Overview ¶
Package adapters contain the core adapters used by the Chainlink node.
HTTPGet ¶
The HTTPGet adapter is used to grab the JSON data from the given URL.
{ "type": "HTTPGet", "url": "https://some-api-example.net/api" }
HTTPPost ¶
Sends a POST request to the specified URL and will return the response.
{ "type": "HTTPPost", "url": "https://weiwatchers.com/api" }
JSONParse ¶
The JSONParse adapter will obtain the value(s) for the given field(s).
{ "type": "JSONParse", "path": ["someField"] }
EthBytes32 ¶
The EthBytes32 adapter will take the given values and format them for the Ethereum blockhain.
{ "type": "EthBytes32" }
EthTx ¶
The EthTx adapter will write the data to the given address and functionSelector.
{ "type": "EthTx", "address": "0x0000000000000000000000000000000000000000", "functionSelector": "0xffffffff" }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
The Adapter interface applies to all core adapters. Each implementation must return a RunResult.
type Bridge ¶
type Bridge struct {
models.BridgeType
}
Bridge adapter is responsible for connecting the task pipeline to external adapters, allowing for custom computations to be executed and included in runs.
func (*Bridge) Perform ¶
Perform sends a POST request containing the JSON of the input RunResult to the external adapter specified in the BridgeType. It records the RunResult returned to it, and optionally marks the RunResult pending.
If the Perform is resumed with a pending RunResult, the RunResult is marked not pending and the RunResult is returned.
type EthBytes32 ¶
type EthBytes32 struct{}
EthBytes32 holds no fields.
func (*EthBytes32) Perform ¶
Perform returns the hex value of the first 32 bytes of a string so that it is in the proper format to be written to the blockchain.
For example, after converting the string "123.99" to hex for the blockchain, it would be: "0x000000000000000000000000000000000000000000000000000000000000007b"
type EthTx ¶
type EthTx struct { Address common.Address `json:"address"` FunctionSelector models.FunctionSelector `json:"functionSelector"` DataPrefix hexutil.Bytes `json:"dataPrefix"` }
EthTx holds the Address to send the result to and the FunctionSelector to execute.
type EthUint256 ¶
type EthUint256 struct{}
EthUint256 holds no fields.
func (*EthUint256) Perform ¶
Perform returns the hex value of a given string so that it is in the proper format to be written to the blockchain.
For example, after converting the string "16800.00" to hex for the blockchain, it would be: "0x31363830302e3030000000000000000000000000000000000000000000000000"
type HTTPPost ¶
HTTPPost requires a URL which is used for a POST request when the adapter is called.
type JSONParse ¶
type JSONParse struct {
Path []string `json:"path"`
}
JSONParse holds a path to the desired field in a JSON object, made up of an array of strings.
type Multiplier ¶
type Multiplier float64
Multiplier represents the number to multiply by in Multiply adapter.
func (*Multiplier) UnmarshalJSON ¶
func (m *Multiplier) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Multiply ¶
type Multiply struct {
Times Multiplier `json:"times"`
}
Multiply holds the a number to multiply the given value by.