I am working on an app, I am using Nami wallet and cardano-serialization-lib.
When I query UTxO and decode it using cardano-serialization-lib
, I get an object with only attribute is something called "ptr", ptr is a number I was expecting an actual UTxO... I want to know how can I get the UTXO because I want it for using it inside a policy script.
Edit:
Extended explanation: I run the following comands in my browser:
window.cardano.enable();
window.cardano.getUtxos();
I get this :
Promise {<pending>}[[Prototype]]: Promise[[PromiseState]]: "fulfilled"[[PromiseResult]]: Array(1)0: "82825820eef507b798abbb8a1360efbd113f51eda22e2fbaae3cc32c78724c8644c164a40082583900756e62ff9667b187209b6fe1b577061491cf6f93a81e1f91741e2e3accb864ae67087f69bbd9ab74f71781d13ae40aab86e1de30ca7e21171a1dcd6500"length: 1[[Prototype]]: Array(0)
when i decode it using the library in NodeJS with the following script:
const S = require("./node_modules/@emurgo/cardano-serialization-lib-nodejs/cardano_serialization_lib.js");
const _Buffer = require("buffer/").Buffer;
const rawUtxo =
"82825820eef507b798abbb8a1360efbd113f51eda22e2fbaae3cc32c78724c8644c164a40082583900756e62ff9667b187209b6fe1b577061491cf6f93a81e1f91741e2e3accb864ae67087f69bbd9ab74f71781d13ae40aab86e1de30ca7e21171a1dcd6500";
const utxos = S.TransactionUnspentOutput.from_bytes(
_Buffer.from(rawUtxo, "hex")
);
console.log(utxos);
I get this:
TransactionUnspentOutput { ptr: 1179656 },