Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: expected instance of TransactionBuilderConfig #260

Open
jjfluid opened this issue Sep 21, 2024 · 0 comments
Open

Error: expected instance of TransactionBuilderConfig #260

jjfluid opened this issue Sep 21, 2024 · 0 comments

Comments

@jjfluid
Copy link

jjfluid commented Sep 21, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant