Skip to content

Post upgrade: Cannot read properties of undefined (reading 'minUTxOValue') #35

@34r7h

Description

@34r7h

Hi I just updated the cardano node 1.33.1 and wallet-js.

I'm getting an error from Seed.getMinUtxoValueWithAssets() when building a tx to send an asset. Checked that the holding address has the token

TypeError: Cannot read properties of undefined (reading 'minUTxOValue') 1|index | at Function.Seed.getMinUtxoValueWithAssets (/home/34r7h/cardano-api-server/node_modules/cardano-wallet-js/dist/utils.js:607:147) 1|index | at /home/34r7h/cardano-api-server/index.js:444:40 1|index | at /home/34r7h/cardano-api-server/index.js:472:19 1|index | at processTicksAndRejections (node:internal/process/task_queues:96:5) 1|index | }

(async () => {
                    let address = thisdata.selleraddress
                    let addresses = [new AddressWallet(thisdata.holdingaddress)]
                    let asset = new AssetWallet(thisdata.policy, thisdata.name, 1);
                    let assets = {}
                    assets[thisdata.holdingaddress] = [asset];
                    let minUtxo = Seed.getMinUtxoValueWithAssets([asset], cardanoconfig)
                    let meta = [thisdata.xmbl];
                    let coinSelection = await w.getCoinSelection(addresses, [minUtxo], meta, assets);
                    coinSelection.outputs[0].address = address
                    console.log(JSON.stringify(coinSelection, null, 2));
                    let info = await api.networkinfo().then(x => x)
                    let ttl = info.node_tip.absolute_slot_number * 12000;
                    const emsg = fs.readFileSync(`./crypto.hash`, { encoding: 'utf8', flag: 'r' })
                    let phrase = api.decryptphrase(emsg, thisdata.secret)
                    let rootKey = Seed.deriveRootKey(phrase);
                    let signingKeys = coinSelection.inputs.map(i => {
                        let privateKey = Seed.deriveKey(rootKey, i.derivation_path).to_raw_key();
                        return privateKey;
                    });
                    let metadata = Seed.buildTransactionMetadata(meta);
                    let txBuild = Seed.buildTransaction(coinSelection, ttl, { metadata: metadata, config: cconfig });
                    let txBody = Seed.sign(txBuild, signingKeys, metadata);
                    let signed = Buffer.from(txBody.to_bytes()).toString('hex');
                    return signed
                })

Did I miss an upgrade requirement/change? Please lmk how to troubleshoot.

btw, nice effort on multisigs!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions