Error while trying to broadcast transaction approve in BSC

Hello,

I have an issue with broadcasting transaction approve request in BSC network.

I am trying to use your code sample to run a swap in BSC - Quick start | 1inch Network
However, the issue occurs at broadCastRawTransaction function which is run after buildTxForApproveTradeWithRouter function.

buildTxForApproveTradeWithRouter returns the transaction object:
Debugger attached.
Allowance: 0
Transaction for approve: {
transaction: {
data: ‘0x095ea7b30000000000000000000000001111111254fb6c44bac0bed2854e76f90643097dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff’,
gasPrice: ‘15000000000’,
to: ‘0x111111111117dc0aa78b770fa6a738034120c302’,
value: ‘0’
},
gas: 53000

The object is passed to broadCastRawTransaction and it is used in its fetch request:
let result = await fetch(broadcastApiUrl, {

    method: 'post',

    body: JSON.stringify({rawTransaction}),

    headers: {'Content-Type': 'application/json'}

})

let json = await result.json();

it returns “Internal Server Error” 500 error message. I am using https://tx-gateway.1inch.io/v1.1/56/broadcast’ as a broadcastApiUrl.

Can you please advise how this can be fixed?

resolved that issue, no need to look into it. thanks.

1 Like