Closed kadiemq closed 1 year ago
Can you add provider.on("debug", console.log)
? It looks like the backend is not returning a valid response?
Can you add
provider.on("debug", console.log)
? It looks like the backend is not returning a valid response?
I get this log:
Before Approve
{
action: 'request',
request: {
method: 'eth_subscribe',
params: [ 'logs', [Object] ],
id: 1,
jsonrpc: '2.0'
},
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { <pending> },
_maxInternalBlockNumber: -1024,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 0,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: false,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 0,
_receiver: null,
_sender: null,
_socket: null,
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: [ClientRequest],
[Symbol(kCapture)]: false
},
_requests: { '1': [Object], '2': [Object] },
_subs: {},
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { <pending> }
}
}
{
action: 'request',
request: { method: 'eth_chainId', params: [], id: 2, jsonrpc: '2.0' },
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { <pending> },
_maxInternalBlockNumber: -1024,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 0,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: false,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 0,
_receiver: null,
_sender: null,
_socket: null,
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: [ClientRequest],
[Symbol(kCapture)]: false
},
_requests: { '1': [Object], '2': [Object] },
_subs: {},
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { <pending> }
}
}
{
action: 'response',
request: {
method: 'eth_subscribe',
params: [ 'logs', [Object] ],
id: 1,
jsonrpc: '2.0'
},
response: '0x408ebf6d27b4764250ac8dbc176f8be6',
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { <pending> },
_maxInternalBlockNumber: -1024,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 0,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '2': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { <pending> }
}
}
{
action: 'response',
request: { method: 'eth_chainId', params: [], id: 2, jsonrpc: '2.0' },
response: '0x38',
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { [Object] },
_maxInternalBlockNumber: -1024,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 0,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '3': [Object], '4': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { [Object] },
_network: {
name: 'bnb',
chainId: 56,
ensAddress: null,
_defaultProvider: null
}
}
}
{
action: 'request',
request: { method: 'eth_gasPrice', params: [], id: 3, jsonrpc: '2.0' },
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { [Object] },
_maxInternalBlockNumber: -1024,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 0,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '3': [Object], '4': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { [Object] },
_network: {
name: 'bnb',
chainId: 56,
ensAddress: null,
_defaultProvider: null
}
}
}
{
action: 'request',
request: {
method: 'eth_getBlockByNumber',
params: [ 'latest', false ],
id: 4,
jsonrpc: '2.0'
},
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { [Object] },
_maxInternalBlockNumber: -1024,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 0,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '3': [Object], '4': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { [Object] },
_network: {
name: 'bnb',
chainId: 56,
ensAddress: null,
_defaultProvider: null
}
}
}
{
action: 'response',
request: { method: 'eth_gasPrice', params: [], id: 3, jsonrpc: '2.0' },
response: '0x12a05f200',
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { [Object] },
_maxInternalBlockNumber: -1024,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 0,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '4': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { [Object] },
_network: {
name: 'bnb',
chainId: 56,
ensAddress: null,
_defaultProvider: null
}
}
}
{
action: 'response',
request: {
method: 'eth_getBlockByNumber',
params: [ 'latest', false ],
id: 4,
jsonrpc: '2.0'
},
response: {
extraData: '0xd883010105846765746888676f312e31362e37856c696e7578000000c3167bdf9e31bdead72aefb316bfa08205732b38232d5541ce3704ce6bd8e9aeec1f787151982f9d4dd3f1cba0eef1ccc1ecbb340f99b70d4d47214b9fd10012ec2bded301',
gasLimit: '0x4c24cbd',
gasUsed: '0x1d6ee9e',
hash: '0x61d1166094ed6600c8f0d618622cbe1656edc123df72d8500aa3e9d807022c18',
logsBloom: '0x1e2ada546e7ddd3a327e9c11c7fd7c79633a465ebe11531f4f95b7f8d2645d70fba7bcbacebe5fb377ec77bcd59e7bee6bffa6aa07dfc2775fdffa66392879b757769dbabb77be7a7fdf432dd67dab6ef9d703ba3fc35eafe3af2b7ddfddfadcdae9d635163ef89bb6cf37b91c00eb5fea5ff9fbfefcb6ffc53a7932f4dd3b
cdb322fc77eb548f4409d1ef0e5dd6a32e927615ddf31f9fb9bbb33dffda2cd8fbabbef4ead167e2f152fa64b86a37a792ce3df2327cc8ff8caeaab9ed95c7c6f6e77dd7f7a06aadc653967bd4ee2ef636bf5cdedbedff3fd9a505a6cbd9efe3de7d7c3f4f333dc4f7ab29f7196e6db88564dffdda7cfafe75b6bfbfe4fffdbf33',
parentHash: '0x9c6eff150edb03ec50a877256744b86458ab0da14dcdcc74b556a5a0a4c336d3',
size: '0x13ab4',
stateRoot: '0xe3536427c57b973af07c14d4f71b305f7ac6028dde442e1cc238248e7b2757df',
totalDifficulty: '0x1a347d5',
transactions: [
'0xc8c6b1263604245e841978bb54f0f6797b3f3e132247473311a8c301a6e0de91',
'0x9a45d2eeebb4346882c98335c81472428986c6d6ada9ddda46dfacb2d5051621',
'0xdf3a94854f7832093b6d55f5d84109391586251a055e66eadedeae5d738393ab',
'0x8799ff441048806659289e3d2581cb293d404dc9d43ff4c8a398c8a79e56619d',
'0x33480fcf462b310996fa9cd9c14a91c96c783863ba3c798fda14a7fc876dbf27',
'0x6c62a5602a20b95f256f9568dd62ade119bed6f67ce93c2632b42ea175a0eacf',
'0x289aef1198b710ff600cb603f83630c06668d520ac7da64e6f86563915d26aac',
'0x3f663bb4a87ea1a78b37dc4df60a1f9175fe0cd2c9e02740f39a227aceb7e01a',
'0x97c66d86bcb5cf581c0b0ca994fff3f539827efba33cd04763e12c426013ae37',
'0x252c5a529718b46b36c364680e1b42447535656975ac19cadded5054e90a7704',
'0xc5591f35457b68045182b54c598192011773746c6bd0f2e38921994f53557bc5',
'0xb9943c82d4ff67c6630ecd8092a38c36f3560f29621f40fc63e0870b676fc81f',
'0x5a4de4562756f9306d5c114f3286a76f3e3650f972d9992fb376ee25c9f938ed',
'0xcf7dff8a9e5e8f905f9e5a6b3b38dd9ca000c38825aee3cb18b3ef25955df91e',
'0x5f4ccd021606340f6c74019d8fe21ea913cf95acd80e157503f03c1179c5d939',
'0xcb0130948f65ae24ec1e6a18db07581bc5eb58d93b6cdabbd84360aecd600ba3',
'0xa1c0d85352bffa0c9d57b4a940cee955758cc67d76794ef69b726c8e26120899',
'0x7113fae96e512244fb53b1e1ecf3e73cd28b2021c2ac1f2bfde7dcf5fb5b989e',
'0xb46eef3d634c120de694bccee2b6a28e2944f4921a1f40ef7722ca70ce6592e6',
'0xfa01bc22cbab5c4bb0d4055782e5969b277df134cb7234b67d726e18470057ec',
'0x00c05048233bab01108377f5533fcf8f8665ca3c838ac4243ecb7f8da8a06b3c',
'0x9d2577daf895fd84034204a2f1f70995c0fb827665f219471c0d34a7cf668022',
'0xd1cbfb1b6a146cbb816fbcbb119ee2d18d0b84dd52b5f48bd2e2a3548d56d483',
'0x08ed22fc075a227dad54c7f3a8ee59b90589ad1127848033b68bc5fa10f0c143',
'0x77309f0949dfbe841b493d6f0f57ae8134a0f58b87ae236b008c3470430ff73d',
'0x96283e06be3f8cd93b020f0c5c34080195e5b708320a6a3c8421c1a9880509d4',
'0xcbd7386514951bc09c1efa8490f4a6ec87be74ed21d45d5dcc2c22f0d0bb18c7',
'0xc47bad744d6b5faddb00808bd93e5b4d9f3859dd056f22347304ad1261602e6b',
'0x9680eb9a9cc00b5fed7919fd6f24faacd1a17cb4d108e7c01dde5ef363d87341',
'0x64f3f128d0ffd7b4f69dbea4928935f0528e124b067324380536208d3c41022c',
'0xd2d1a99c13f42df8091a198620ea460cfd8a4bf261219a9f05e4910957176f90',
'0x04d223c0584df3e59ef09727bdc6497eff6f77bfff9e842961468e12206bcde1',
'0xc0b5079745fd81657675ac766026028714899ca7fd11b5ee97a67282034ac9fa',
'0x70d74f0db06add02fe649734d90db5d7fd37b08e6d49dd1abb22f3e25de3e9d8',
'0xae87caf1c6ce95a86c8037cbd2fe844ac3792592f0b0776974b45b589ee9625b',
'0x234e1d7e097673af7790f396e85e1e05863119648c08a1543a4cd631b852a45f',
'0xc7f8902c551c16f489773439bb66ba59fbd25c82ed262a08ec1490b688ae0109',
'0x7fcf1373fa24f543bdf94e55cd7e063c3bfa6694b3f5e9f3c64360a576f0f0f2',
'0xef44267dda263ebe88f3bb525d61be88f42b9a84a1512d7a23ef7e040d310a68',
'0x61c1281ac50587564a3be5548e0463d02abab15350ba0a73d424d545e6894cb2',
'0xad2561c11d5862dde580c7c5711163f56461f5bff48e7c55edbf89b373865479',
'0xe267cc42d2593c3c53320aebf671f53a73fab4fda2727f4c9bcbd8ff1ec4c5db',
'0x0903a352e1d8aa31fa70d8fef662426c639d64efa0391344ff3e7c3a918fec8a',
'0x0860832bcebf846673e80363ad3aa2d5ddf54488c73d4c7261a41b13a94a0c1e',
'0x4a87ae8a82985803f7edf0667a4291f5ed91af5dad155abd5f812f44a66f2247',
'0xd51bb4083c34e955332f6c71d065b63789f103527468bab504093c33a9ea8e1c',
'0xf857087fc761527d88f0b928188844ce9be85cfef5093fb4af648e65b51e226f',
'0x28b7c7b295b18673d6da7744bb9e8ce615a811ab9a715e962bb1651e8dfea7dc',
'0xcaa05d233e51201e923a969147a625b6889a70bd6706599d7889e38ce3719bb3',
'0x60ee73799133b1c462e9e295d3d57e125ac09a54b9661c8565556ba554758583',
'0x73e37e0f6d4d43ac4a06dfb5663971428addf320dcca1708df99d5d5f8c3cc76',
'0xe5f831e1827dc678e6652a540fcfb5baf1a18b14e16ad6ca579658fe23054b09',
'0x26072e954b78d873578617d8211455cbbdc83694429947b5cd0bb883f0712958',
'0x4e279ad55bd05f3aaf320cf5247c987e1055b046732f7bda966c6fe4e56a649b',
'0x8cc89ab9db98ad8f0b081a8a0ac85365411ced1a19c376fe410d5000eab33da3',
'0xcfcd1d21562cc6948670ab3ca6baae2f3b11af1744c01abe063522db95c3f1dd',
'0x1f10d994840ff43760330862c528e8aadb21ffe7cf7191e23823c00e0a5228f1',
'0xb8482e746bc4383109a3abeb7976107f2a91c377245bc0ca878bfb9f620fe987',
'0x6e83fcec80ba1c611bc6a1a541dbf5ab29687f9034692c22e77b99a46df70513',
'0xc2c358b9392ca79906515c19ba0d9872bb7e61d3d11cff5cc7124fa0febda8aa',
'0xeb6e4676cd5d3ba0bc8d908eb35745ff359b0a1f2685bee732a1e3c42ae26fee',
'0x9d8a5b9fafd5df765c24f59a63a29eaeb05e000dc424418ce36c46b3961d8695',
'0xf74077b0719da846dae366d9d85c73ed2053c68c0987045bd7dc21f479b2c3bd',
'0x5097a105b604f193b32ba32e0226df8245e70716d9f7a36b58c28a66f0181562',
'0x5530aa2213183130de7ac281081bcf78b0f4c1b287c6d0765b93faacf91b71f6',
'0x5ea9babe21a21c988bcd516e9bba5a0acb2dfaded8209eb8a6462da539f85668',
'0xaa90f118d9c1c3389e7abb1f35d0fe46fe40ce1ca9c5bce928815ed8360f3112',
'0x535be08904609a468310659d06a1f7e2f76e28083ffd19714034a60747874e5a',
'0xc0cd8fb57d796e47ecc66aa453ea53f520509aab6936f7ced1d11b441dab2a9f',
'0x17848062437b4cbc26ac2635a750a9485cf3bf92261c31732184314c30b538c3',
'0xc7ae707219db5518662f69640842049a97495426846a2153de3b403bc714f590',
'0xf713f0e5d4f0fc37dee8ce9abbef6c6a4149c1ba0fee79033d7a0aa0e954105e',
'0x33046f0c3b59b0de2421a035dc063c18f379c5f5c6606918a4aef1a6715c0a6f',
'0x597a3e3616cd0bb424764ac4007f85ee80983e9d0f145aa17bf6316cfad43cbf',
'0xbcc14169767c5930e1b1c468551abd2cd9139a087666f8541c142a578401cbcd',
'0xedf128d450e9d77f58f1ce167989813d393ae79fc8935eb0510628ce914e8dc4',
'0xe37c7664aaa062d51e20733a901d15d4960821cc3b0f2ab78234f8a88f9de3b9',
'0x8367ec379b441a69b0e8b40266b39eb91d20f9f0c0d6b620af54be41723c882a',
'0xa68f4c786ff98430cb9edf0436d42ade12a2852ddcd73d43f0023a8978429c20',
'0x3fbd019c78cee5ada96a8121c58eb84d42d79d10e5ec5811305cd8bcab5c625e',
'0x8bb67bf5d729a943c5bccf9134a797bd872673e83488f77e9bd9b7075bc99d38',
'0x2089240cd56f3b1f7ec57dc602cf51f79f10b328b9ee9332addde53f0a817933',
'0xa7af105db6d13b5df28a49ed983beb7c58093ac9dfd6f747274cc73ee04445ac',
'0xa80597cd4bd8c666279fc52fb8d8b0d31c943061c24030810d559e7a302ba49f',
'0xb413430e0271a138f11d53219e50fda3b9dc987cee267ea81136e540edf84a37',
'0x557d2ea60686290cb1b292ffef1f9fd116e92ac522b4af88fd9a1b03be604d83',
'0x9c4a47ef0c7032a46e78be463d298ce37911ebcfda3a92dee32b73325ec66ce9',
'0x421acc81e56ed39900042f84c51a19e4500b2600c0600a36ce004f82ca761dd0',
'0x44334cc011cce327e3079c004308c0f51b898a0bb885f1a4d471d6a5146fa73a',
'0x7eb30c4768e5b9d3eacd1fbd2ada2dd67bc3199aa95c8c5196b4daf9e862891a',
'0x4227bf8a2430fff5d6795fc5de35d4fa97812b869d99c017b9c03ff649000276',
'0xc8fa1e11975f262e7a28ba5fb448504a210d0f7a42992d53b664d3b6f93b81b6',
'0x431c8768a7f5a2b037e059a432c50b316ee8d8714778abb1869e10e01c5abb52',
'0xeb3134d488e783e516b195114ef7ad8a27b019df29378e4e6351dcb943ef5142',
'0x7224d7a908067a62d7cf11e0a71fa24558123740d34c1aefd1380485c697935b',
'0xd8c1f9e19cc5778f9a9a8eecd5604249cdaf5c6fed241a727379410288256bd9',
'0x8b4485e713bd201731c1b014ce90d1a0843170bde4e0ef6e7d199d486ddbfef1',
'0x0f8dfb99ac5d06dd6ff94c27ac40a35d7026cb0e15c57b533c63b5f879925c01',
'0x1f09be7681d24e286b956d0421ff56ee29beee3f0ff842fe1d5c4aa1b36648c7',
'0xc073b3644533d49733fec1bc6331214b22d7aee4e83c976ffc02a79cbb2c543e',
... 172 more items
],
difficulty: '0x2',
nonce: '0x0000000000000000',
number: '0xd312e2',
sha3Uncles: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',
timestamp: '0x61c9556f',
transactionsRoot: '0x82c5f4b78560dc7ceb0cd8b96686987f2df162fdde5f1c9dbeb0c12f28f13a15',
miner: '0xee226379db83cffc681495730c11fdde79ba4c0c',
mixHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
receiptsRoot: '0xa7d91a8429774b9cabbffd0029c892ddabff1900732acb5fbc5865e8cf5a5736',
uncles: []
},
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { [Object] },
_maxInternalBlockNumber: -1024,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 0,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '5': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { [Object] },
_network: {
name: 'bnb',
chainId: 56,
ensAddress: null,
_defaultProvider: null
}
}
}
{
action: 'request',
request: {
method: 'eth_getTransactionCount',
params: [ '0x160817834861b200832e5c0f241ecc92b4820d03', 'pending' ],
id: 5,
jsonrpc: '2.0'
},
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { [Object] },
_maxInternalBlockNumber: -1024,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 0,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '5': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { [Object] },
_network: {
name: 'bnb',
chainId: 56,
ensAddress: null,
_defaultProvider: null
}
}
}
{
action: 'response',
request: {
method: 'eth_getTransactionCount',
params: [ '0x160817834861b200832e5c0f241ecc92b4820d03', 'pending' ],
id: 5,
jsonrpc: '2.0'
},
response: '0x2f',
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { [Object] },
_maxInternalBlockNumber: -1024,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 0,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '6': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { [Object] },
_network: {
name: 'bnb',
chainId: 56,
ensAddress: null,
_defaultProvider: null
},
_internalBlockNumber: Promise { <pending> }
}
}
{
action: 'request',
request: { method: 'eth_blockNumber', params: [], id: 6, jsonrpc: '2.0' },
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { [Object] },
_maxInternalBlockNumber: -1024,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 0,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '6': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { [Object] },
_network: {
name: 'bnb',
chainId: 56,
ensAddress: null,
_defaultProvider: null
},
_internalBlockNumber: Promise { <pending> }
}
}
{
action: 'response',
request: { method: 'eth_blockNumber', params: [], id: 6, jsonrpc: '2.0' },
response: '0xd312e2',
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { [Object] },
_maxInternalBlockNumber: 13832930,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 1640584571648,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '7': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { [Object] },
_network: {
name: 'bnb',
chainId: 56,
ensAddress: null,
_defaultProvider: null
},
_internalBlockNumber: Promise { [Object] },
_fastBlockNumber: 13832930,
_fastBlockNumberPromise: Promise { 13832930 }
}
}
{
action: 'request',
request: {
method: 'eth_sendRawTransaction',
params: [
'0xf8ab2f85012a05f20083027a8d94bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c80b844095ea7b300000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e000000000000000000000000000000000000000000000000002386f26fc100008193a01cadd281db5149f5ac48db76fb9e23ff3f60e06afe89a64
38c1132f49a9f95eda04efc6c57985cf203d6e3f5fc083411ab2456b2aa7cb988e6b34531e6b07f8e4b'
],
id: 7,
jsonrpc: '2.0'
},
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { [Object] },
_maxInternalBlockNumber: 13832930,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 1640584571648,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '7': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { [Object] },
_network: {
name: 'bnb',
chainId: 56,
ensAddress: null,
_defaultProvider: null
},
_internalBlockNumber: Promise { [Object] },
_fastBlockNumber: 13832930,
_fastBlockNumberPromise: Promise { 13832930 }
}
}
After Approve
{
action: 'response',
request: {
method: 'eth_sendRawTransaction',
params: [
'0xf8ab2f85012a05f20083027a8d94bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c80b844095ea7b300000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e000000000000000000000000000000000000000000000000002386f26fc100008193a01cadd281db5149f5ac48db76fb9e23ff3f60e06afe89a64
38c1132f49a9f95eda04efc6c57985cf203d6e3f5fc083411ab2456b2aa7cb988e6b34531e6b07f8e4b'
],
id: 7,
jsonrpc: '2.0'
},
response: '0x402e75e5ff1591960de38e4aaceaf307c5208718507254d6dddf99863704f0f2',
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { [Object] },
_maxInternalBlockNumber: 13832930,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 1640584571648,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '8': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { [Object] },
_network: {
name: 'bnb',
chainId: 56,
ensAddress: null,
_defaultProvider: null
},
_internalBlockNumber: Promise { [Object] },
_fastBlockNumber: 13832930,
_fastBlockNumberPromise: Promise { 13832930 }
}
}
{
action: 'request',
request: {
method: 'eth_getTransactionReceipt',
params: [
'0x402e75e5ff1591960de38e4aaceaf307c5208718507254d6dddf99863704f0f2'
],
id: 8,
jsonrpc: '2.0'
},
provider: WebSocketProvider {
_isProvider: true,
_events: [ [Event], [Event] ],
_emitted: { block: -2 },
formatter: Formatter { formats: [Object] },
anyNetwork: false,
_networkPromise: Promise { [Object] },
_maxInternalBlockNumber: 13832930,
_lastBlockNumber: -2,
_pollingInterval: -1,
_fastQueryDate: 1640584571648,
connection: {
url: 'wss://apis-sj.ankr.com/......'
},
_nextId: 42,
_wsReady: true,
_websocket: WebSocket {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: '',
_closeTimer: null,
_extensions: {},
_protocol: '',
_readyState: 1,
_receiver: [Receiver],
_sender: [Sender],
_socket: [TLSSocket],
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'wss://apis-sj.ankr.com/......',
_req: null,
[Symbol(kCapture)]: false
},
_requests: { '8': [Object] },
_subs: { '0x408ebf6d27b4764250ac8dbc176f8be6': [Object] },
_subIds: {
'filter:0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73:0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9': [Promise]
},
_eventLoopCache: { detectNetwork: null },
_detectNetwork: Promise { [Object] },
_network: {
name: 'bnb',
chainId: 56,
ensAddress: null,
_defaultProvider: null
},
_internalBlockNumber: Promise { [Object] },
_fastBlockNumber: 13832930,
_fastBlockNumberPromise: Promise { 13832930 }
}
}
undefined:1
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at WebSocketProvider._this._websocket.onmessage (C:\Users\Kadiem Alqazzaz\Desktop\psbot\node_modules\@ethersproject\providers\lib\websocket-provider.js:106:31)
at WebSocket.onMessage (C:\Users\Kadiem Alqazzaz\Desktop\psbot\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:375:28)
at Receiver.receiverOnMessage (C:\Users\Kadiem Alqazzaz\Desktop\psbot\node_modules\ws\lib\websocket.js:834:20)
at Receiver.emit (events.js:375:28)
at Receiver.dataMessage (C:\Users\Kadiem Alqazzaz\Desktop\psbot\node_modules\ws\lib\receiver.js:437:14)
at Receiver.getData (C:\Users\Kadiem Alqazzaz\Desktop\psbot\node_modules\ws\lib\receiver.js:367:17)
at Receiver.startLoop (C:\Users\Kadiem Alqazzaz\Desktop\psbot\node_modules\ws\lib\receiver.js:143:22)
at Receiver._write (C:\Users\Kadiem Alqazzaz\Desktop\psbot\node_modules\ws\lib\receiver.js:78:10)
I also get this error sometimes.
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Socket.<anonymous> (C:\Users\Rad\Desktop\Forward\node_modules\@ethersproject\providers\lib\ipc-provider.js:59:34)
at Socket.emit (node:events:402:35)
at endReadableNT (node:internal/streams/readable:1343:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
It looks like the backend is not returning a valid response?
Could you elaborate on what you mean by backend is not returning a valid response, I only sometimes have the error? Am I missing something when I am executing with my provider?
same issue with ankr web socket
For anyone looking for a temporary fix, it looks like it's an Ankr problem from my testing. I haven't had that problem at all using Moralis
Closing this as it seems to have been an issue with the backend, not ethers. If not, please re-open or comment.
Thanks! :)
I'm getting this error: