Wallet API
Set Broadcast Strategy

Set Broadcast Strategy#

Set the order of transaction broadcasting and the number of retries in case of failure.

You can set a global strategy or a single-chain strategy. The single-chain strategy takes precedence over the global strategy.

Request Path#

POST https://www.okx.com/api/wallet/pre-transaction/set-strategy

Request Parameters#

ParameterTypeRequiredDescription
chainIndexStringNoUnique identifier for the chain
broadcastStrategyStringYes0: Direct broadcast
1: Strict nonce order broadcast
Default is direct broadcast
retryStrategyStringYes0: No retry
1: Few retries, suitable for scenarios like web3 needing quick user response
2: Multiple timed retries, suitable for single transactions in exchanges
Default is few retries

Request Example#

shell
curl --location --request POST 'https://www.okx.com/api/v5/wallet/pre-transaction/set-strategy' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
--data-raw '{
        "chainIndex": 1,
        "broadcastStrategy": "0"
        "retryStrategy": "0"
}'

Response Example#

200
{
        "code": "0", 
        "data": [],
        "msg": "success"
}