Inconsistent error with programmly generated wallets

Hello Klever Team,

I’ve encountered a strange issue where some wallets consistently throw exceptions when attempting to send a transaction. Interestingly, switching to another wallet resolves the problem immediately — everything starts working as expected.

Here’s an example of the error on testnet:

TypeError: fetch failed
    at node:internal/deps/undici/undici:15482:13
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async me.getNonce (/usr/src/app/node_modules/@klever/sdk-node/dist/cjs/index.js:17:26998)
    at async me.buildTransactionWithHash (/usr/src/app/node_modules/@klever/sdk-node/dist/cjs/index.js:17:27290)
    at async me.buildTransaction (/usr/src/app/node_modules/@klever/sdk-node/dist/cjs/index.js:17:27805)
"cause": {
  "errno": -3008,
  "code": "ENOTFOUND",
  "syscall": "getaddrinfo",
  "hostname": "node.mainnet.klever.finance"
},
"timestamp": "2025-06-18 13:48:02"

Wallet: klv1qau93vpvuktchsmj6m6c9p5yzrvrujcfyjumq2cp02hm5uxkvw6q2pke2n

Notably, the error references node.mainnet.klever.finance, even though I have explicitly configured everything to use testnet.klever.org.

And here’s a similar error on mainnet:

TypeError: fetch failed
    at node:internal/deps/undici/undici:13502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async me.getNonce (/usr/src/app/node_modules/@klever/sdk-node/dist/cjs/index.js:17:26998)
    at async me.buildTransactionWithHash (/usr/src/app/node_modules/@klever/sdk-node/dist/cjs/index.js:17:27290)
    at async me.buildTransaction (/usr/src/app/node_modules/@klever/sdk-node/dist/cjs/index.js:17:27805)
"cause": {
  "errno": -111,
  "code": "ECONNREFUSED",
  "syscall": "connect",
  "address": "127.0.0.1",
  "port": 443
},
"timestamp": "2025-06-18 14:50:50"

Wallets:
:cross_mark: klv1anagmyl8f020ejjgzxqrda2gvpfm27ezhsmugehw2n5jptxwr2vs5uuh7r (unsuccessful, throws error above)
:white_check_mark: klv1ysula058u2nytruhaumgkgqvuxh8mpas0zf8d8usm3dnkfslug7qc6fkxk (newly generated — worked fine in same runtime with the same token)

I am using node-sdk v2.4.0

Let me know if there’s any additional information I can provide to help track this down.

1 Like

Hello @shymelon,

The error you reported usually occurs when the address is not present on the blockchain:

"cause": {
  "errno": -3008,
  "code": "ENOTFOUND",
  "syscall": "getaddrinfo",
  "hostname": "node.mainnet.klever.finance"
},
"timestamp": "2025-06-18 13:48:02"

The hostname shown in the error is indeed incorrect . Even when using the testnet environment, the error message may still display the mainnet hostname. However, this does not impact the actual transaction creation. A fix will be included in an upcoming SDK version.

2 Likes