tatumio / tatum-js

🚀 Tatum SDK: A 💪 powerful, 🌟 feature-rich TypeScript/JavaScript 📚 library that streamlines the 🛠️ development of 🌐 blockchain applications.
https://docs.tatum.io
MIT License
360 stars 110 forks source link

Issue #1082 is still not solved #1086

Closed WeMakeBest closed 3 months ago

WeMakeBest commented 5 months ago

Follow up on issue #1082

317705188-9b66a265-7dce-454e-ad39-830deda18064

I'm still getting the same issue I have tried reinstalling the "@tatumio/tatum" and "@tatumio/evm-wallet-provider"

rostislavjadavan commented 3 months ago

Hi,

I have slightly modified your code, and this should work:

import { TatumSDK, Network } from "@tatumio/tatum";
import { EvmWalletProvider } from "@tatumio/evm-wallet-provider";

async function bsc() {
    const tatumSdk = await TatumSDK.init({
        network: Network.BINANCE_SMART_CHAIN_TESTNET,
        apiKey: { v4: "YOUR_API_KEY" },
        configureWalletProviders: [EvmWalletProvider],
    });

    const payload = {
        privateKey: "YOUR_PRIVATE_KEY",
        to: "TO",
        value: "0.1",
        maxPriorityFeePerGas: "10",
        maxFeePerGas: "10",
    };

    console.log(tatumSdk.walletProvider);

    const txHash = await tatumSdk.walletProvider
        .use(EvmWalletProvider)
        .signAndBroadcast(payload);

    console.log(txHash);
    await tatumSdk.destroy();
}

bsc();

Let me know if it works for you!

WeMakeBest commented 3 months ago

Thank you for your help 👍 It's working fine now