Solidity SDK
npm install @reactor-network/sdk-solidityThe Solidity SDK exposes the developer-facing subset of Reactor’s EVM contracts. Administrative and protocol-operator functions are intentionally omitted.
import {IReactorGateway} from "@reactor-network/sdk-solidity/contracts/interfaces/IReactorGateway.sol";
import {IReactorFeeManager} from "@reactor-network/sdk-solidity/contracts/interfaces/IReactorFeeManager.sol";
import {IReactorHelper} from "@reactor-network/sdk-solidity/contracts/interfaces/IReactorHelper.sol";Calculate, encode, and send
function requestRandomNumbers(
address gatewayAddress,
address helperAddress,
string calldata destinationAddress,
uint256 count
) external payable {
IReactorGateway gateway = IReactorGateway(gatewayAddress);
IReactorHelper helper = IReactorHelper(helperAddress);
bytes memory payload = helper.encodeGenerateRandomNumbersRequestAndStringParameters(
count,
new string[](0),
new string[](0)
);
address paymentToken = address(0);
uint256 fee = IReactorFeeManager(gateway.feeManager()).getSendFee(
"base",
"generate_random_numbers",
address(this),
paymentToken,
payload.length
);
require(msg.value >= fee, "insufficient fee");
gateway.send{value: msg.value}(
paymentToken,
"base",
destinationAddress,
"generate_random_numbers",
payload,
true
);
}Use the current addresses from Contract Addresses.
Action payloads
chain_message:encodePayloadAndReactorParametersorencodePayloadAndStringParameters; decode with the matching payload decoder.web_message:encodeWebRequestFromReactorWebRequest,encodeWebRequestAndReactorParameters, or the string-array form; decode requests and(uint256 statusCode,string body,string[] headerNames,string[] headerValues)responses with the matching helpers.generate_random_numbers: encode a positiveuint256withencodeGenerateRandomNumbersRequestAndReactorParametersor the string-array form; decode requests asuint256and responses asuint256[].
The outer Reactor parameter envelope is always abi.encode(bytes payload, string[] names, string[] values). Web headers are stored as parameters with a header. name prefix.
Deliberately small surface
IReactorGateway exposes only feeManager() and payable send(...). IReactorFeeManager exposes only read-only pricing/configuration getters. IReactorHelper exposes pure ABI utilities. The package does not expose executable callbacks, execution/retry operations, pause controls, withdrawals, role management, setters, or token enable/disable methods.
See the Gateway, Fee Manager, and Helper references.