Emurgo / cardano-serialization-lib

This is a library, written in Rust, for serialization & deserialization of data structures used in Cardano's Haskell implementation of Alonzo along with useful utility functions.
Other
231 stars 125 forks source link

i am getting this error BlockfrostServerError:Invalid address for this network or malformed address format #606

Closed ghost closed 1 year ago

ghost commented 1 year ago

/home/hari/Documents/cardano-prac/Rosalind/node_modules/@blockfrost/blockfrost-js/lib/utils/errors.js:60
            errorInstance = new BlockfrostServerError({ ...responseBody, url });
                            ^

BlockfrostServerError: Invalid address for this network or malformed address format.
    at handleError (/home/hari/Documents/cardano-prac/Rosalind/node_modules/@blockfrost/blockfrost-js/lib/utils/errors.js:60:29)
    at /home/hari/Documents/cardano-prac/Rosalind/node_modules/@blockfrost/blockfrost-js/lib/endpoints/api/addresses/index.js:78:59
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  status_code: 400,
  error: 'Bad Request',
  url: 'https://cardano-preprod.blockfrost.io/api/v0/addresses/addr1q8fvgtajwpzvccdfxu5fjrmnh2rzyh46w7e5xn0yya5znvpcjn3zsax2qzsw24nppdmh78s7mknhulz8gu30tfy37flqnpr0rm/utxos?page=8&count=100&order=asc'
}```

I am trying to send 2 ada from addr1q8fvgtajwpzvccdfxu5fjrmnh2rzyh46w7e5xn0yya5znvpcjn3zsax2qzsw24nppdmh78s7mknhulz8gu30tfy37flqnpr0rm address to addr_test1qzjeazrvkpc3twtg9xu7na0dw5zshqwwh354gmh0626gv4r9vh67k4754l9ugvw5uex30x4u6lyfvr0a34vynjmk2nzq7hqhjn address
lisicky commented 1 year ago

Hi @hariaccubits ! Unfortunately I don't know how the error from Blockfrom connected with the CSL without any additional context. I guess it's better to ask blockfrost about the error. But if CSL produces incorrect cbor I need a code example with explanation where CSL makes incorrect data.

iftieaq commented 1 year ago

From your error snippet

 error: 'Bad Request',
  url: 'https://cardano-preprod.blockfrost.io/api/v0/addresses/addr1q8fvgtajwpzvccdfxu5fjrmnh2rzyh46w7e5xn0yya5znvpcjn3zsax2qzsw24nppdmh78s7mknhulz8gu30tfy37flqnpr0rm/utxos?page=8&count=100&order=asc'

It seems you are trying to connect to preprod network but the address UTXO you are querying is a mainnet address. This is why blockfrost is throwing 404 error as the mainnet address couldn't be found in the preprod testnet.

addr1q8fvgtajwpzvccdfxu5fjrmnh2rzyh46w7e5xn0yya5znvpcjn3zsax2qzsw24nppdmh78s7mknhulz8gu30tfy37flqnpr0rm

Either switch to mainnet API if you are attempting the transaction in mainnet or try using the testnet wallet address.

lisicky commented 1 year ago

Not a CSL issue. I'm closing it.