将交易广播到链上。
POST https://www.okx.com/api/v5/wallet/pre-transaction/broadcast-transaction
Parameter | Type | Required | Description |
---|---|---|---|
signedTx | String | Yes | 完成签名的交易字符串 |
chainIndex | String | Yes | 链唯一标识, e.g. ETH=3 详情见 链的唯一标识整理 |
accountId | String | 可选 | 钱包账户Id,地址或账户 ID 需要必填一项。后续可用于查看账户下发的交易 |
address | String | 可选 | 地址,地址或账户 ID 需要必填一项。后续可用于查看账户下发的交易 |
Parameter | Type | Description |
---|---|---|
orderId | String | 交易唯一标识 |
curl --location --request POST 'https://www.okx.com/api/v5/wallet/pre-transaction/broadcast-transaction' \
--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 '{
"accountId": "5f45a951-4a8b-4cd9-b20a-3b337b71efcc",
"chainIndex": "1",
"address": "0x238193be9e80e68eace3588b45d8cf4a7eae0fa3",
"signedTx": "0x02f8720182029f8411e1a3008504bbe2e94682520894d73c5e36d47eed32f0327f9d3f04b49384e90fab85e8d4a5100080c080a0ba380a9be31efabc4c8cfccbb555f8af3c21073d6eca01f180ebebb8942c6f30a0779e6e16a504c413cb9902ceb33ab7e89a533bc13b74477dfa6b6c76dc41fac2"
}'
{
"code": "0",
"data": [
{
"orderId": "0e1d79837afce1e149b6ab54b6e2edce8130c3f8"
}
],
"msg": ""
}