# TypeScript SDK

**URL:** https://forum.fuel.network/c/typescript-sdk/10.md

[Latest](https://forum.fuel.network/latest.md) · [Categories](https://forum.fuel.network/categories.md) · [Tags](https://forum.fuel.network/tags.md)

---

## [About the TypeScript SDK category](https://forum.fuel.network/t/about-the-typescript-sdk-category/50)

<div class="topic-metadata">

**Author:** [@camiinthisthang.sway](https://forum.fuel.network/u/camiinthisthang.sway)\
**Replies:** 0

</div>

(Replace this first paragraph with a brief description of your new category. This guidance will appear in the category selection area, so try to keep it below 200 characters.) Use the following paragraphs for a longer d…

---

## [Getting error while calling sender.transfer](https://forum.fuel.network/t/getting-error-while-calling-sender-transfer/9254)

<div class="topic-metadata">

**Author:** [@Prasanth](https://forum.fuel.network/u/Prasanth)\
**Replies:** 11\
**Last updated:** [July 18, 2025, 1:27pm UTC](https://forum.fuel.network/t/getting-error-while-calling-sender-transfer/9254 "2025-07-18T13:27:46Z")

</div>

ts-sdk version: ^0.101.0 Fuel-core : 0.43.1 CODE: let provider = new Provider(this.config.rpcUrl); const sender = Wallet.fromPrivateKey(fromAccount.data.privateKey, provider); response = await sender.batchTransfer(\[…

---

## [Retrieving All Emitted Events from a Contract Using its ABI](https://forum.fuel.network/t/retrieving-all-emitted-events-from-a-contract-using-its-abi/9056)

<div class="topic-metadata">

**Author:** [@nerses](https://forum.fuel.network/u/nerses)\
**Replies:** 2\
**Last updated:** [April 18, 2025, 12:00pm UTC](https://forum.fuel.network/t/retrieving-all-emitted-events-from-a-contract-using-its-abi/9056 "2025-04-18T12:00:33Z")

</div>

I have the ABI of the contract and need to retrieve all past events efficiently. I’m looking for the best practice or recommended approach that ensures performance and reliability. I would appreciate guidance on the opt…

---

## [Getting error while using "mira-dex-ts" SDK](https://forum.fuel.network/t/getting-error-while-using-mira-dex-ts-sdk/8884)

<div class="topic-metadata">

**Author:** [@bobby-lync](https://forum.fuel.network/u/bobby-lync)\
**Replies:** 1\
**Last updated:** [March 19, 2025, 10:14am UTC](https://forum.fuel.network/t/getting-error-while-using-mira-dex-ts-sdk/8884 "2025-03-19T10:14:18Z")

</div>

I am getting an error when using “mira-dex-ts” sdk in my NodeJs project - Error: Directory import 'C:\\Users\\HP\\Desktop\\Trading-BOT\\node\_modules\\mira-dex-ts\\dist\\sdk' is not supported resolving ES modules imported from C…

---

## [Issue with Fuel wallet connector packages when using with NextJs 15](https://forum.fuel.network/t/issue-with-fuel-wallet-connector-packages-when-using-with-nextjs-15/8501)

<div class="topic-metadata">

**Author:** [@bobby-lync](https://forum.fuel.network/u/bobby-lync)\
**Replies:** 3\
**Last updated:** [February 13, 2025, 5:13pm UTC](https://forum.fuel.network/t/issue-with-fuel-wallet-connector-packages-when-using-with-nextjs-15/8501 "2025-02-13T17:13:17Z")

</div>

I was trying to integrate Fuel’s official wallet connectors packages in my NextJs 15 Dapp. But the packages are not working as expected. The problems I am facing are - The switch network is not working automatically fr…

---

## [How to correctly make a contract call?](https://forum.fuel.network/t/how-to-correctly-make-a-contract-call/8336)

<div class="topic-metadata">

**Author:** [@Logique](https://forum.fuel.network/u/Logique)\
**Replies:** 16\
**Last updated:** [February 10, 2025, 11:10am UTC](https://forum.fuel.network/t/how-to-correctly-make-a-contract-call/8336 "2025-02-10T11:10:37Z")

</div>

I am a new to Sway and the Fuel Ecosystem, and I am trying to test a contract. I went through the TS-SDK and this is how I am doing it: htlcFUEL.account = bob; htlcFUEL.account = bob; const initiateResponse = await htl…

---

## [How to Debug Intermittent Contract Revert (Panic) in Smart Contract Transaction?](https://forum.fuel.network/t/how-to-debug-intermittent-contract-revert-panic-in-smart-contract-transaction/8366)

<div class="topic-metadata">

**Author:** [@nerses](https://forum.fuel.network/u/nerses)\
**Replies:** 1\
**Last updated:** [January 30, 2025, 6:40pm UTC](https://forum.fuel.network/t/how-to-debug-intermittent-contract-revert-panic-in-smart-contract-transaction/8366 "2025-01-30T18:40:55Z")

</div>

I have a smart contract with a simple purpose. It has a function that takes an id and an address as input, performs checks based on the id, and then transfers funds to the specified address. However, for one of the tran…

---

## [Log type with logId 'xxxxx' doesnt't exist in the ABI](https://forum.fuel.network/t/log-type-with-logid-xxxxx-doesntt-exist-in-the-abi/8276)

<div class="topic-metadata">

**Author:** [@doronumakun](https://forum.fuel.network/u/doronumakun)\
**Replies:** 1\
**Last updated:** [January 28, 2025, 8:49am UTC](https://forum.fuel.network/t/log-type-with-logid-xxxxx-doesntt-exist-in-the-abi/8276 "2025-01-28T08:49:10Z")

</div>

I know already exist similar question, but let me ask it because I can’t solve it. I ran the script below and it worked fine. However, as soon as I perform a SUPPLY or BORROW on that account, I get the title error. No…

---

## [Log type with logId '10098701174489624218' doesn't exist in the ABI](https://forum.fuel.network/t/log-type-with-logid-10098701174489624218-doesnt-exist-in-the-abi/8257)

<div class="topic-metadata">

**Author:** [@etherhood](https://forum.fuel.network/u/etherhood)\
**Replies:** 3\
**Last updated:** [January 23, 2025, 7:06pm UTC](https://forum.fuel.network/t/log-type-with-logid-10098701174489624218-doesnt-exist-in-the-abi/8257 "2025-01-23T19:06:12Z")

</div>

I am trying to call a script on fuel and pass it some tokens as well. But I am getting this error, even when I don’t have any log in script. const scriptInstance = new MyScript(wallet); const tx = await scriptInsta…

---

## [Transferring funds from wallet to wallet](https://forum.fuel.network/t/transferring-funds-from-wallet-to-wallet/8236)

<div class="topic-metadata">

**Author:** [@Antik21](https://forum.fuel.network/u/Antik21)\
**Replies:** 2\
**Last updated:** [January 22, 2025, 5:40pm UTC](https://forum.fuel.network/t/transferring-funds-from-wallet-to-wallet/8236 "2025-01-22T17:40:18Z")

</div>

Good day, I implemented a function to send a specified amount of funds from one wallet to another. I added the calculation of fees and gas. Everything worked well when I sent the entire wallet balance. However, when I…

---

## [Running a testnode with the TS SDK in a nodejs environment](https://forum.fuel.network/t/running-a-testnode-with-the-ts-sdk-in-a-nodejs-environment/8176)

<div class="topic-metadata">

**Author:** [@paulman176](https://forum.fuel.network/u/paulman176)\
**Replies:** 1\
**Last updated:** [January 21, 2025, 9:30am UTC](https://forum.fuel.network/t/running-a-testnode-with-the-ts-sdk-in-a-nodejs-environment/8176 "2025-01-21T09:30:10Z")

</div>

Hey guys i dont know if this is the correct environment but we are working on a new protocol that we are going to release and we need our own fuel node. I tried spinning up my own test node and put it inside a VM (in a n…

---

## [ES Module problem](https://forum.fuel.network/t/es-module-problem/7994)

<div class="topic-metadata">

**Author:** [@miguel](https://forum.fuel.network/u/miguel)\
**Replies:** 7\
**Last updated:** [January 13, 2025, 10:51am UTC](https://forum.fuel.network/t/es-module-problem/7994 "2025-01-13T10:51:16Z")

</div>

When I ran pnpm build, I got an error like this: file:///home/miguel/w/fuels-ts/templates/vite/tailwind.config.js:2 module.exports = { ^ ReferenceError: module is not defined

---

## [Transaction Fails with "Not Enough Funds" Error Despite Sufficient User Balance](https://forum.fuel.network/t/transaction-fails-with-not-enough-funds-error-despite-sufficient-user-balance/7381)

<div class="topic-metadata">

**Author:** [@jitendra-lync](https://forum.fuel.network/u/jitendra-lync)\
**Replies:** 8\
**Last updated:** [January 13, 2025, 10:44am UTC](https://forum.fuel.network/t/transaction-fails-with-not-enough-funds-error-despite-sufficient-user-balance/7381 "2025-01-13T10:44:52Z")

</div>

I am encountering an issue while interacting with a deployed contract on the Fuel Network. The problem arises intermittently: the transaction fails with the following error message: “\_FuelError: The account(s) sending …

---

## [How to swap tokens via miraAmm?](https://forum.fuel.network/t/how-to-swap-tokens-via-miraamm/7440)

<div class="topic-metadata">

**Author:** [@wwwwww](https://forum.fuel.network/u/wwwwww)\
**Replies:** 5\
**Last updated:** [January 11, 2025, 8:34am UTC](https://forum.fuel.network/t/how-to-swap-tokens-via-miraamm/7440 "2025-01-11T08:34:49Z")

</div>

I tried to implement a token swap based on the example on github, but the transaction was never uploaded to the blockchain. No errors were reported during the execution. here is the code import { Account, Provider, Wal…

---

## [FuelError: Method not implemented](https://forum.fuel.network/t/fuelerror-method-not-implemented/7546)

<div class="topic-metadata">

**Author:** [@chappie1998](https://forum.fuel.network/u/chappie1998)\
**Replies:** 2\
**Last updated:** [December 21, 2024, 10:59am UTC](https://forum.fuel.network/t/fuelerror-method-not-implemented/7546 "2024-12-21T10:59:57Z")

</div>

I am trying to interact with this predicate using TS SDK RECEIVER: Address = Address::from(0x0101010101010101010101010101010101010101010101010101010101010101), } fn main() -\> bool { // return true; // The s…

---

## [How to Retrieve Transaction ID Before Sending Transaction Without await on a Deployed Fuel Contract?](https://forum.fuel.network/t/how-to-retrieve-transaction-id-before-sending-transaction-without-await-on-a-deployed-fuel-contract/7373)

<div class="topic-metadata">

**Author:** [@jitendra-lync](https://forum.fuel.network/u/jitendra-lync)\
**Replies:** 1\
**Last updated:** [December 17, 2024, 9:03am UTC](https://forum.fuel.network/t/how-to-retrieve-transaction-id-before-sending-transaction-without-await-on-a-deployed-fuel-contract/7373 "2024-12-17T09:03:30Z")

</div>

I am working on a Fuel blockchain project where I need to send transactions to an already deployed contract. My goal is to retrieve the Transaction ID before the transaction is sent, without using await. This is to check…

---

## [Not able to generate the typegen types](https://forum.fuel.network/t/not-able-to-generate-the-typegen-types/7325)

<div class="topic-metadata">

**Author:** [@lokesh-lync](https://forum.fuel.network/u/lokesh-lync)\
**Replies:** 6\
**Last updated:** [December 12, 2024, 7:54am UTC](https://forum.fuel.network/t/not-able-to-generate-the-typegen-types/7325 "2024-12-12T07:54:48Z")

</div>

When I run the command: pnpm fuels typegen -i ./out/release/LyncIgnite-abi.json -o ./typegen I get this: using deprecated parameters for the initialization function; pass a single object instead error: Cannot read pro…

---

## [Fuels-ts uses 4 queries to fulfill one \`get\` request](https://forum.fuel.network/t/fuels-ts-uses-4-queries-to-fulfill-one-get-request/7041)

<div class="topic-metadata">

**Author:** [@diyahir](https://forum.fuel.network/u/diyahir)\
**Replies:** 8\
**Last updated:** [November 22, 2024, 3:05pm UTC](https://forum.fuel.network/t/fuels-ts-uses-4-queries-to-fulfill-one-get-request/7041 "2024-11-22T15:05:01Z")

</div>

Each ‘get’ query starts with getConsensusParametersVersion getChainAndNodeInfo estimateGasPrice dryRun This is causing a ton of strain on the RPC

---

## [Switch providers at run time for Ethereum Wallet connector?](https://forum.fuel.network/t/switch-providers-at-run-time-for-ethereum-wallet-connector/6996)

<div class="topic-metadata">

**Author:** [@diyahir](https://forum.fuel.network/u/diyahir)\
**Replies:** 2\
**Last updated:** [November 18, 2024, 12:19pm UTC](https://forum.fuel.network/t/switch-providers-at-run-time-for-ethereum-wallet-connector/6996 "2024-11-18T12:19:32Z")

</div>

I would like to be able to switch from testnet and mainnet providers while using the ethereum wallet connector. It looks like you have to define which provider to use at runtime, and it doesn’t matter if you specify the…

---

## [Error.ts:35 FuelError: Invalid struct Vec. Field "buf" not present](https://forum.fuel.network/t/error-ts-35-fuelerror-invalid-struct-vec-field-buf-not-present/6941)

<div class="topic-metadata">

**Author:** [@GeraB](https://forum.fuel.network/u/GeraB)\
**Replies:** 18\
**Last updated:** [November 11, 2024, 4:32am UTC](https://forum.fuel.network/t/error-ts-35-fuelerror-invalid-struct-vec-field-buf-not-present/6941 "2024-11-11T04:32:50Z")

</div>

Hi people! When executing a function I get this error error.ts:35 FuelError: Invalid struct Vec. Field "buf" not present. According to ABI, these are the parameter types is\_whitelisted: InvokeFunction\< \[ …

---

## [How to add a message input to TransactionRequestLike](https://forum.fuel.network/t/how-to-add-a-message-input-to-transactionrequestlike/6949)

<div class="topic-metadata">

**Author:** [@Antony](https://forum.fuel.network/u/Antony)\
**Replies:** 3\
**Last updated:** [October 31, 2024, 1:44pm UTC](https://forum.fuel.network/t/how-to-add-a-message-input-to-transactionrequestlike/6949 "2024-10-31T13:44:23Z")

</div>

Hi All, In typescript and working with the FuelConnector, one of the parameters the FuelConnector sendTransaction() function takes is a TransactionRequestLike. sendTransaction(address: string, transaction: Transactio…

---

## [Supported fuel-core version: 0.39.0](https://forum.fuel.network/t/supported-fuel-core-version-0-39-0/6943)

<div class="topic-metadata">

**Author:** [@kotok88](https://forum.fuel.network/u/kotok88)\
**Replies:** 3\
**Last updated:** [October 31, 2024, 1:41pm UTC](https://forum.fuel.network/t/supported-fuel-core-version-0-39-0/6943 "2024-10-31T13:41:18Z")

</div>

Hello guys i try to use TypeScript SDK and have this error : The Fuel Node that you are trying to connect to is using fuel-core version 0.40.0, which is not supported by the version of the TS SDK that you are using. T…

---

## [How to sign not string message?](https://forum.fuel.network/t/how-to-sign-not-string-message/6815)

<div class="topic-metadata">

**Author:** [@nerses](https://forum.fuel.network/u/nerses)\
**Replies:** 3\
**Last updated:** [October 30, 2024, 9:34am UTC](https://forum.fuel.network/t/how-to-sign-not-string-message/6815 "2024-10-30T09:34:26Z")

</div>

I use type script SDK to sign message off chain, but function signMessage accepts only string type data I need to sign Uint8Array.I cant change signing message type from Uint8Array as in smart contract I handle with dat…

---

## [When using mnemonics to create multiple wallets, what are the rules for derivation paths?](https://forum.fuel.network/t/when-using-mnemonics-to-create-multiple-wallets-what-are-the-rules-for-derivation-paths/6850)

<div class="topic-metadata">

**Author:** [@jumper](https://forum.fuel.network/u/jumper)\
**Replies:** 2\
**Last updated:** [October 22, 2024, 4:38am UTC](https://forum.fuel.network/t/when-using-mnemonics-to-create-multiple-wallets-what-are-the-rules-for-derivation-paths/6850 "2024-10-22T04:38:43Z")

</div>

When I use the TS SDK to derive multiple wallets with a mnemonic word, the result is different from the address derived from fuel wallet using the same mnemonic word. Even if I use the derivation path recommended in the …

---

## [Rate limit issue](https://forum.fuel.network/t/rate-limit-issue/6846)

<div class="topic-metadata">

**Author:** [@DevilAsap](https://forum.fuel.network/u/DevilAsap)\
**Replies:** 4\
**Last updated:** [October 21, 2024, 6:19pm UTC](https://forum.fuel.network/t/rate-limit-issue/6846 "2024-10-21T18:19:16Z")

</div>

I am getting rate limit issues while Fetching metadata info from smart contract using provider for Listed NFT’s and collections for nft marketplace site Access to fetch at 'https://testnet.fuel.network/v1/graphql' from …

---

## [BUG on pnpm fuels typegen for NextJS / npm install](https://forum.fuel.network/t/bug-on-pnpm-fuels-typegen-for-nextjs-npm-install/6794)

<div class="topic-metadata">

**Author:** [@eesheng](https://forum.fuel.network/u/eesheng)\
**Replies:** 3\
**Last updated:** [October 15, 2024, 9:28am UTC](https://forum.fuel.network/t/bug-on-pnpm-fuels-typegen-for-nextjs-npm-install/6794 "2024-10-15T09:28:17Z")

</div>

When you create a NextJS Frontend project, pnpm fuels typegen -i ./abis/\*-abi.json -o ./types to be more specificpnpm fuels typegen doesn’t work and leads to the following Error: ERR\_PNPM\_RECURSIVE\_EXEC\_FIRST\_FAIL not…

---

## [Why do contract IDs vary from forc to forc version?](https://forum.fuel.network/t/why-do-contract-ids-vary-from-forc-to-forc-version/6827)

<div class="topic-metadata">

**Author:** [@xpluscal](https://forum.fuel.network/u/xpluscal)\
**Replies:** 6\
**Last updated:** [October 15, 2024, 6:10am UTC](https://forum.fuel.network/t/why-do-contract-ids-vary-from-forc-to-forc-version/6827 "2024-10-15T06:10:42Z")

</div>

This is something that has haunted me forever: ContractIDs seem to vary depending on which forc version they were built with. Is that correct? Meaning that if e.g. your sway toolchain differs from your frontend toolch…

---

## [Issue with compiler "Immediate12TooLarge"](https://forum.fuel.network/t/issue-with-compiler-immediate12toolarge/6676)

<div class="topic-metadata">

**Author:** [@xpluscal](https://forum.fuel.network/u/xpluscal)\
**Replies:** 13\
**Last updated:** [October 15, 2024, 5:27am UTC](https://forum.fuel.network/t/issue-with-compiler-immediate12toolarge/6676 "2024-10-15T05:27:58Z")

</div>

When running fuels builld, getting this error: Too many arguments, cannot handle.: Immediate12TooLarge { val: 4335, span: Span { src (ptr): 0x60000237c260, source\_id: None, start: 0, end: 0, as\_str(): “” } } We have ma…

---

## [How to Sign a Message in TypeScript for Sway Smart Contract Verification?](https://forum.fuel.network/t/how-to-sign-a-message-in-typescript-for-sway-smart-contract-verification/6809)

<div class="topic-metadata">

**Author:** [@nerses](https://forum.fuel.network/u/nerses)\
**Replies:** 14\
**Last updated:** [October 12, 2024, 2:54pm UTC](https://forum.fuel.network/t/how-to-sign-a-message-in-typescript-for-sway-smart-contract-verification/6809 "2024-10-12T14:54:15Z")

</div>

I’m working on a Sway contract that hashes a message with sha256 for verification. The message is structured like this: rust Copy code let message: AddLockMessage = AddLockMessage { Id: Id, hashlock: hashlock,…

---

## [Read Configurable Constants](https://forum.fuel.network/t/read-configurable-constants/6811)

<div class="topic-metadata">

**Author:** [@xpluscal](https://forum.fuel.network/u/xpluscal)\
**Replies:** 7\
**Last updated:** [October 10, 2024, 2:32am UTC](https://forum.fuel.network/t/read-configurable-constants/6811 "2024-10-10T02:32:21Z")

</div>

Is there a way to read the Configurable Constants from a contract using typescript or do those need to be made specifically available in a function? Thanks!

[Next page](https://forum.fuel.network/c/typescript-sdk/10.md?page=1)
