Skip to content

Error: expected instance of TransactionBuilderConfig #260

@jjfluid

Description

@jjfluid

Just trying to run a simple example using the following code using latest version of lucid installed yesterday, running on windows with Node.js v20.9.0:

const lucid = await Lucid.new();
const privateKey = lucid.utils.generatePrivateKey(); // Bech32 encoded private key
console.log(privateKey);
lucid.selectWalletFromPrivateKey(privateKey);
const address = await lucid.wallet.address(); // Bech32 address
console.log(address);

const tx = await lucid.newTx()      
.payToAddress("addr1xxzvcf02fs5e282qk3pmjkau2emtcsj5wrukxak3np90n2evjel5h55fgjcxgchp830r7h2l5msrlpt8262r3nvr8eksg6pw3p", {lovelace: 40000000n})
        .complete();
const signedTx = await tx.sign().complete();
const txHash = await signedTx.submit();

Getting the following output / error:

lake need such rude tongue visa skate extend kite apple access flip dutch gas remain
ed25519_sk1r304rc6vqm676w7h8k40lfpxghe3zwt5fmjw2csfr9erfv04tllqwkh2dr
addr1v9jdqluacqluflyth86t07egva3vha6r8sj77x98e99hc5sa0gd3z
C:\Users\Justin\dev\fluidefi\crypto-network-examples\node_modules\lucid-cardano\esm\src\core\libs\cardano_multiplatform_lib\nodejs\cardano_multiplatform_lib.generated.js:232
    throw new Error(`expected instance of ${klass.name}`);
          ^

Error: expected instance of TransactionBuilderConfig
    at _assertClass (C:\Users\Justin\dev\fluidefi\crypto-network-examples\node_modules\lucid-cardano\esm\src\core\libs\cardano_multiplatform_lib\nodejs\cardano_multiplatform_lib.generated.js:232:11)
    at TransactionBuilder.new (C:\Users\Justin\dev\fluidefi\crypto-network-examples\node_modules\lucid-cardano\esm\src\core\libs\cardano_multiplatform_lib\nodejs\cardano_multiplatform_lib.generated.js:22132:5)
    at new Tx (file:///C:/Users/Justin/dev/fluidefi/crypto-network-examples/node_modules/lucid-cardano/esm/src/lucid/tx.js:28:50)
    at Lucid.newTx (file:///C:/Users/Justin/dev/fluidefi/crypto-network-examples/node_modules/lucid-cardano/esm/src/lucid/lucid.js:102:16)
    at C:\Users\Justin\dev\fluidefi\crypto-network-examples\src\09-cardano\transactions.js:17:28

Looks like its failing an assertion check for class type. Seems to be logic running under the hood. Please let me know if I'm doing something wrong. New to Lucid and Cardano dev in general.

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