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.
POST https://www.okx.com/api/wallet/pre-transaction/set-strategy
Parameter | Type | Required | Description |
---|---|---|---|
chainIndex | String | No | Unique identifier for the chain |
broadcastStrategy | String | Yes | 0 : Direct broadcast 1 : Strict nonce order broadcast Default is direct broadcast |
retryStrategy | String | Yes | 0 : 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 |
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"
}'
{
"code": "0",
"data": [],
"msg": "success"
}