Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
Decentralized Exchanges (DEX)
Prediction Markets
Securities and Futures
On-chain & Custom

Sets a node dedicated solely to broadcasting transactions. Once set, requests such as reading data, querying the nonce, and estimating gas still use the node configured for the exchange object, while signed transactions are sent only to this node. This feature is suitable for private transaction channels such as Flashbots Protect and MEV Blocker, and prevents transactions from being front-run or sandwich-attacked after entering the public mempool.

exchange.IO(k)
exchange.IO(k, url)

Examples

Send transactions through MEV Blocker.

javascript
function main() { // Read requests still go through the node configured for the exchange object; signed // transactions are sent only to MEV Blocker var old = exchange.IO("sendBase", "https://rpc.mevblocker.io") Log("Previous send node:", old, "Current send node:", exchange.IO("sendBase")) // Subsequent transactions are all sent through the private channel, for example: // var txHash = exchange.IO("api", "eth", "send", toAddress, value) // Pass an empty string to clear the setting and restore sending from the configured node exchange.IO("sendBase", "") }

Returns

TypeDescription

string

Returns the send node address in effect before the setting; returns an empty string if it was not previously set.

Arguments

NameTypeRequiredDescription

k

string

Yes

Function of the exchange.IO() function. When set to sendBase, it indicates that the function is used to set the node for broadcasting transactions.

url

string

No

JSON-RPC address of the node (supports the http or https protocol), for example "https://rpc.mevblocker.io" or "https://rpc.flashbots.net". Passing an empty string clears the setting and restores sending transactions through the node configured for the exchange object; when this parameter is not passed, only the current setting is queried.

See Also

Remarks

Transactions sent through a private channel are not counted in the pending count of public nodes; when sending transactions consecutively, the local nonce record ensures that the nonce is not reused. For details, see exchange.IO("nonce", ...).

Requests sent to this node do not carry the authentication information (ApiKey) of the node configured for the exchange object.

It affects transactions sent by exchange.IO("api", ...) (transfers and contract writes) and the replacement transactions of exchange.IO("speedUp", ...) and exchange.IO("cancelTx", ...); nothing is sent with dryRun.

Currently only Ethereum (EVM) chains are supported; on TRON the call returns a null value with the error in GetLastError().