Skip to content

Commit

Permalink
Merge pull request #13 from FuelLabs/ci/update-19-7-2024-12-6-46
Browse files Browse the repository at this point in the history
chore: update docs
  • Loading branch information
calldelegation authored Jul 19, 2024
2 parents e5b0e23 + 0e50b56 commit bcbe30a
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 1 deletion.
91 changes: 91 additions & 0 deletions docs/src/migrations/typescript-sdk.md
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()
```

2 changes: 1 addition & 1 deletion src/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"default": {
"sway": "v0.62.0",
"rust": "v0.62.0",
"ts": "v0.91.0"
"ts": "v0.92.0"
}
}

0 comments on commit bcbe30a

Please sign in to comment.