-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from FuelLabs/ci/update-19-7-2024-12-6-46
chore: update docs
- Loading branch information
Showing
2 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,92 @@ | ||
# TypeScript SDK Migrations Guide | ||
## July 11, 2024 | ||
|
||
Release [v0.92.0](https://github.com/FuelLabs/fuels-ts/releases/tag/v0.92.0) | ||
|
||
## Features | ||
### [#2692 - Implement non-blocking contract call](https://github.com/FuelLabs/fuels-ts/pull/2692) | ||
|
||
The `call` method in the `BaseInvocationScope` class no longer waits for transaction execution, making it non-blocking. This change affects how transaction responses are handled. | ||
|
||
```ts | ||
// before | ||
const { logs, value, transactionResult } = await contract.functions.xyz().call() | ||
``` | ||
|
||
```ts | ||
// after | ||
const { transactionId, waitForResult } = await contract.functions.xyz().call(); | ||
|
||
const { logs, value, transactionResult } = await waitForResult(); | ||
``` | ||
### [#2597 - Made `deployContract` a non-blocking call](https://github.com/FuelLabs/fuels-ts/pull/2597) | ||
|
||
The `deployContract` method no longer returns the contract instance directly. Instead, it returns an object containing the `transactionId` , the `contractId`, and a `waitForResult` function. | ||
|
||
```ts | ||
// before | ||
const factory = new ContractFactory(contractByteCode, contractAbi, wallet); | ||
|
||
const contract = await factory.deployContract(); | ||
|
||
const { value } = await contract.functions.xyz().call(); | ||
``` | ||
|
||
```ts | ||
// after | ||
const factory = new ContractFactory(contractByteCode, contractAbi, wallet); | ||
|
||
const { waitForResult, transactionId, contractId } = await factory.deployContract(); | ||
|
||
const { contract, transactionResult } = await waitForResult(); | ||
|
||
const { value } = await contract.functions.xyz().call(); | ||
``` | ||
### [#2408 - Implement pagination for `Account` methods](https://github.com/FuelLabs/fuels-ts/pull/2408) | ||
|
||
```ts | ||
// before | ||
const coins = await myWallet.getCoins(baseAssetId); | ||
const messages = await myWallet.getMessages(); | ||
const balances = await myWallet.getBalances(); | ||
const blocks = await provider.getBlocks(); | ||
|
||
// after | ||
const { coins, pageInfo } = await myWallet.getCoins(baseAssetId); | ||
const { messages, pageInfo } = await myWallet.getMessages(); | ||
const { balances } = await myWallet.getBalances(); | ||
const { blocks, pageInfo } = await provider.getBlocks(); | ||
|
||
/* | ||
The `pageInfo` object contains cursor pagination information one | ||
can use to fetch subsequent pages selectively and on demand. | ||
*/ | ||
``` | ||
|
||
## Fixes | ||
### [#2718 - `launchNode.cleanup` not killing node in last test of test group](https://github.com/FuelLabs/fuels-ts/pull/2718) | ||
|
||
The `killNode` and `KillNodeParams` functionality has been internalized and the method and interface have been deleted so they're no longer exported. It's marked as a breaking change for pedantic reasons and there shouldn't really be any affected users given that they kill nodes via `cleanup` which is unchanged, so no migration notes are necessary. | ||
|
||
## Chores | ||
### [#2652 - Remove `InvocationResult` from `program` package](https://github.com/FuelLabs/fuels-ts/pull/2652) | ||
|
||
The classes `FunctionInvocationResult`, `InvocationCallResult`, and `InvocationResult` have been removed. This change will not affect most users as the response for a contract call or script call remains the same; only the type name has changed. | ||
|
||
```ts | ||
// before | ||
const callResult: FunctionInvocationResult = await contract.functions.xyz().call() | ||
|
||
const dryRunResult: InvocationCallResult = await contract.functions.xyz().get() | ||
const dryRunResult: InvocationCallResult = await contract.functions.xyz().dryRun() | ||
const dryRunResult: InvocationCallResult = await contract.functions.xyz().simulate() | ||
|
||
|
||
// after | ||
const callResult: FunctionResult = await contract.functions.xyz().call() | ||
|
||
const dryRunResult: DryRunResult = await contract.functions.xyz().get() | ||
const dryRunResult: DryRunResult = await contract.functions.xyz().dryRun() | ||
const dryRunResult: DryRunResult = await contract.functions.xyz().simulate() | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
"default": { | ||
"sway": "v0.62.0", | ||
"rust": "v0.62.0", | ||
"ts": "v0.91.0" | ||
"ts": "v0.92.0" | ||
} | ||
} |