Error message. Transaction failed. Endpoints

Hello there. I am using 0x for swapping my Binance token to other respected tokens. I got the required data from the 0X API but every time it’s showing that the transaction reverted without reason error by the EVM.

These are the logs while transaction -

signed {
messageHash: ‘0x6fd9e426b7c085a740b261c4fc606e88767c4819150a169a028079024923afaa’,
v: ‘0x94’,
r: ‘0xdbdb5aab20584e6a4e65ec3153894222a44df0f7b661dab19c6b6b1cb3c2519a’,
s: ‘0x3210e091a62ec3f92d22bda0cbd995b193eab36a97e95b157e76f6808257739f’,
rawTransaction: ‘0xf901900f85012a05f2008301b19894def1c0ded9bec7f1a1670819833240f027b25eff80b90128c43c9ef60000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000000074127b3f0acb0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000067b198a69f8cdab39524a00554c3dd50b6ba7fec000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c869584cd000000000000000000000000100000000000000000000000000000000000001100000000000000000000000000000000000000000000008b4acceaa96180dd9a8194a0dbdb5aab20584e6a4e65ec3153894222a44df0f7b661dab19c6b6b1cb3c2519aa03210e091a62ec3f92d22bda0cbd995b193eab36a97e95b157e76f6808257739f’,
transactionHash: ‘0x76be9ab418105941a6cc1dd41829c4658278a469edd1c0dd84349fb574e92ec8’
}
sendSignedTransaction data 0x76be9ab418105941a6cc1dd41829c4658278a469edd1c0dd84349fb574e92ec8
swap error because of : Error: Transaction has been reverted by the EVM:
{
“blockHash”: “0x6475ed2252aab3ed3aa2f91aa81ea9f2833c68fa1182beee3b4c76fb83a0fcfa”,
“blockNumber”: 12297880,
“contractAddress”: null,
“cumulativeGasUsed”: 54244448,
“from”: “0xa859d1f24f27b550bf4ba3b54d15d88d51df5018”,
“gasUsed”: 32362,
“logs”: [],
“logsBloom”: “0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000”,
“status”: false,
“to”: “0xdef1c0ded9bec7f1a1670819833240f027b25eff”,
“transactionHash”: “0x76be9ab418105941a6cc1dd41829c4658278a469edd1c0dd84349fb574e92ec8”,
“transactionIndex”: 298,
“type”: “0x0”
}
at Object.TransactionError (/node_modules/web3-core-helpers/lib/errors.js:87:21)
at Object.TransactionRevertedWithoutReasonError (/node_modules/web3-core-helpers/lib/errors.js:98:21)
at /node_modules/web3-core-method/lib/index.js:393:57
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
receipt: {
blockHash: ‘0x6475ed2252aab3ed3aa2f91aa81ea9f2833c68fa1182beee3b4c76fb83a0fcfa’,
blockNumber: 12297880,
contractAddress: null,
cumulativeGasUsed: 54244448,
from: ‘0xa859d1f24f27b550bf4ba3b54d15d88d51df5018’,
gasUsed: 32362,
logs: [],
logsBloom: ‘0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000’,
status: false,
to: ‘0xdef1c0ded9bec7f1a1670819833240f027b25eff’,
transactionHash: ‘0x76be9ab418105941a6cc1dd41829c4658278a469edd1c0dd84349fb574e92ec8’,
transactionIndex: 298,
type: ‘0x0’
}
}

This is our token -

JS -

const response = await fetch(https://bsc.api.0x.org/swap/v1/quote?buyToken=0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c&sellToken=0x67B198A69F8cdAb39524a00554c3DD50B6bA7feC&sellAmount=10000000000000000 );
const jsn = await response.json();

const account = web3.eth.accounts.privateKeyToAccount(
  'privatekey'
);

const signed = await account.signTransaction(jsn);
console.log('signed', signed);
const swap = await web3.eth.sendSignedTransaction(
  signed.rawTransaction,
  async (err, data) => {
    if (err) {
      console.error('sendSignedTransaction error', err);
    } else {
      console.error('sendSignedTransaction data', data);
    }
  }
);

This forum is for governance and research topics only.

For technical support visit https://ethereum.stackexchange.com/ , register (optional but recommended), and ask your question. You must tag ‘0x’ so we’re properly notified.

Posts asking for technical support will be deleted.