Skip to content

Adapters

Thomas edited this page May 18, 2018 · 12 revisions

NOTE: Due to the nature of our development cycle, this page may be out of date. Please see our official Adapters documentation for up the most up to date documentation.

Bridge

The adapter is in charge of speaking with External Adapters.

Parameters

  • url: takes a string containing the location of the external adapter. Bridge can create pending task runs, and resume them via PUT requests to /runs/:RUN_ID.

EthBytes32

The adapter formats its input into a string and then converts it into Solidity's bytes32 format.

Parameters

None taken.

EthInt256

  • The adapter formats its input into an integer and then converts it into Solidity's int256 format.

Parameters

None taken.

EthTx

The adapter takes the input given as places it into the data field of the transaction. It then signs an Ethereum transaction and broadcasts it to the network. The task is only completed once the transaction's confirmations equal the ETH_MIN_CONFIRMATIONS amount.

If the transaction does not confirm by the time ETH_GAS_BUMP_THRESHOLD number of blocks have passed since initially broadcasting, then it bumps the gas price of the transaction by ETH_GAS_BUMP_WEI.

Parameters

  • address is the address of the Ethereum account which the transaction will be sent to.
  • functionSelector(optional) is the function selector of the contract which the transaction will invoke. functionSelector is placed before dataPrefix and the adapter's input in the data field of the transaction.
  • dataPrefix(optional) is data which will be prepended before the adapter's input, but after the functionSelector in the transaction's data field.

EthUint256

  • The adapter formats its input into an integer and then converts it into Solidity's uint256 format.

Parameters

None taken.

HttpGet

The adapter will report the body of a successful GET request to the specified url, or return an error if the response status code is greater than or equal to 399.

Parameters

  • url: takes a string containing the URL to make a GET request to.

HttpPost

The adapter will report the body of a successful GET request to the specified url, or return an error if the response status code is greater than or equal to 399.

Parameters

  • url: takes a string containing the URL to make a POST request to.

JsonParse

The adapter walks the path specified and returns the result found at that result.

Parameters

  • path: takes an array of strings, each string being the next key to parse out in the JSON object.

Multiply

The adapter parses the input into a float and then multiplies it by the times field.

Parameters

  • times is the number to multiply the input by.

NoOp

The adapter performs no operations, simply passing the input on as output. Commonly used for testing.

Parameters

None taken.

NoOpPend

The adapter performs no operations, and marks its task run pending. Commonly used for testing.

Parameters

None taken.