Skip to content

Commit 68df54a

Browse files
authored
chore!: remove BaseInvocationScope.getTransactionId() (#3864)
1 parent e91eb6c commit 68df54a

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

.changeset/bumpy-states-do.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@fuel-ts/program": minor
3+
---
4+
5+
chore!: remove `BaseInvocationScope.getTransactionId()`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Preparing a Script Transaction
22

3-
Akin to Contracts, we can configure the [call parameters](../contracts/call-parameters.md) and [transaction parameters](../transactions/adding-parameters.md) for Scripts, as well as retrieve the entire transaction request or transaction ID prior to submission.
3+
Akin to Contracts, we can configure the [call parameters](../contracts/call-parameters.md) and [transaction parameters](../transactions/adding-parameters.md) for Scripts, as well as retrieve the entire transaction request prior to submission.
44

55
<<< @./snippets/script-with-configurable.ts#preparing-scripts{ts:line-numbers}

apps/docs/src/guide/scripts/snippets/script-with-configurable.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ tx.callParams({ gasLimit: 7500 });
4040
const txRequest = await tx.getTransactionRequest();
4141

4242
// Get the transaction ID
43-
const txId = await tx.getTransactionId();
43+
const chainId = await provider.getChainId();
44+
const txId = txRequest.getTransactionId(chainId);
4445

4546
// Retrieve the value of the call and the actual gas used
4647
const { waitForResult: waitForActualGasUsed } = await tx.call();

packages/program/src/functions/base-invocation-scope.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -624,19 +624,6 @@ export class BaseInvocationScope<TReturn = any> {
624624
return provider;
625625
}
626626

627-
/**
628-
* Obtains the ID of a transaction.
629-
*
630-
* @param chainId - the chainId to use to hash the transaction with
631-
* @returns the ID of the transaction.
632-
*/
633-
async getTransactionId(chainId?: number): Promise<string> {
634-
const chainIdToHash = chainId ?? (await this.getProvider().getChainId());
635-
636-
const transactionRequest = await this.getTransactionRequest();
637-
return transactionRequest.getTransactionId(chainIdToHash);
638-
}
639-
640627
/**
641628
* In case the gasLimit is *not* set by the user, this method sets a default value.
642629
*/

0 commit comments

Comments
 (0)