Skip to content

Commit

Permalink
ci(changesets): versioning packages (#722)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jan 11, 2023
1 parent 5a08f80 commit 042ca47
Show file tree
Hide file tree
Showing 106 changed files with 1,017 additions and 556 deletions.
5 changes: 0 additions & 5 deletions .changeset/dirty-zoos-itch.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/four-gorillas-admire.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/fuzzy-swans-bake.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/pink-flowers-cough.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/poor-grapes-smile.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/short-feet-sell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yellow-pillows-burn.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/_data/versions.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated-file
fuels: 0.28.1
fuels: 0.29.0
fuel-core: 0.15.1
sway: 0.32.2
forc: 0.32.2
4 changes: 2 additions & 2 deletions docs/guide/contracts/call-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Here we set call params alongside [transaction parameters](./transaction-paramet
})
.call<BN>();
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/contract.test.ts#L261-L273)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/contract.test.ts#L259-L271)

---

Expand Down Expand Up @@ -80,7 +80,7 @@ Here we set call params as part of a [Multicall](./multicalls.md)
})
.call<[BN, BN, BN]>();
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/contract.test.ts#L278-L298)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/contract.test.ts#L276-L296)

---

2 changes: 1 addition & 1 deletion docs/guide/contracts/cost-estimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Below are examples that show how to get the estimated transaction cost from sing
]);
const transactionCost = await invocationScope.getTransactionCost();
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/contract.test.ts#L360-L370)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/contract.test.ts#L358-L368)

---

Expand Down
7 changes: 4 additions & 3 deletions docs/guide/contracts/deploying-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ If you are only interested in a single instance of your contract, then use `depl


```typescript
import { Provider, TestUtils, ContractFactory } from 'fuels';
import { Provider, ContractFactory } from 'fuels';
import { generateTestWallet } from '@fuel-ts/wallet/test-utils';
// basic setup
const provider = new Provider('http://127.0.0.1:4000/graphql');
const wallet = await TestUtils.generateTestWallet(provider, [[5_000_000, NativeAssetId]]);
const wallet = await generateTestWallet(provider, [[5_000_000, NativeAssetId]]);

// load the byteCode of the contract, generated from Sway source
const byteCode = readFileSync(
Expand All @@ -44,7 +45,7 @@ If you are only interested in a single instance of your contract, then use `depl
// send byteCode and ABI to ContractFactory to load
const factory = new ContractFactory(byteCode, abi, wallet);
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/contract-factory.test.ts#L9-L29)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/contract-factory.test.ts#L10-L31)

---

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/contracts/interacting-with-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you already have a deployed contract and want to call its methods using the S
const { value } = await providerContract.functions.counter().get();
expect(value.toHex()).toEqual(toHex(1300));
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/storage-test-contract.test.ts#L45-L50)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/storage-test-contract.test.ts#L46-L51)

---

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/contracts/multicalls.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Next, you provide the prepared calls to the `multiCall` method and optionally co


```typescript
const scope = contract.multiCall(calls).addContracts([otherContract.id]);
const scope = contract.multiCall(calls).addContracts([otherContract]);
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/contract.test.ts#L158-L160)

Expand Down
38 changes: 38 additions & 0 deletions docs/guide/contracts/read-only-calls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: "Read Only Calls"
parent: "Contracts"
grand_parent: "Guide"
nav_order: 2
---

[info]: this file is autogenerated


# Read-only calls

Sometimes you want to call a contract method that does not change the state of the blockchain. For instance, a method that only _reads_ a value from storage and returns it without making any changes to storage.

In this case, there is no need to create an actual blockchain transaction; you only want to read a value quickly.

You can do this with the SDK. Instead of `.call()`ing the method, use `.get()`:


```typescript
const contract = await setupContract();
const { value } = await contract.functions.echo_b256(contract.id.toB256()).get();
expect(value).toEqual(contract.id.toB256());
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/contract.test.ts#L677-L681)

---


`get()` doesn't take funding, as it is a read-only call that doesn't alter the chain state.

If you want to dry run a transaction call that takes funding without altering the chain state, use `dryRun()`.

## When to use `get()` vs `call()`

Anytime you want to call a method that does _not_ change the state of the blockchain, use `get()`. If you want to call a method that _does_ change the state of the blockchain, use `call()`.

`get()` is intended to be used only for read-only calls.
2 changes: 1 addition & 1 deletion docs/guide/contracts/variable-outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ With the SDK, you can call `transfer_coins_to_output` by chaining `append_variab
})
.call();
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/token-test-contract.test.ts#L45-L52)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/token-test-contract.test.ts#L46-L53)

---

Expand Down
12 changes: 6 additions & 6 deletions docs/guide/cookbook/deposit-and-withdraw.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ Next, let's setup a [`Wallet`](../wallets/index.md) and seed it with some coins.
const provider = new Provider('http://127.0.0.1:4000/graphql');
const PRIVATE_KEY = '0x862512a2363db2b3a375c0d4bbbd27172180d89f23f2e259bac850ab02619301';
const wallet = Wallet.fromPrivateKey(PRIVATE_KEY, provider);
await TestUtils.seedWallet(wallet, [{ assetId: NativeAssetId, amount: bn(100_000) }]);
await seedTestWallet(wallet, [{ assetId: NativeAssetId, amount: bn(100_000) }]);
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L434-L439)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L438-L443)

---

Expand Down Expand Up @@ -167,7 +167,7 @@ Let's now deploy both the contracts and set them up.
const liquidityPoolContractID = liquidityPoolContract.id;
await liquidityPoolContract.functions.set_base_token(tokenContractID).call();
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L441-L460)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L445-L464)

---

Expand All @@ -192,7 +192,7 @@ Next, let's mint some tokens and transfer them to our wallet.
})
.call();
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L463-L479)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L467-L483)

---

Expand All @@ -213,7 +213,7 @@ Now, let's deposit some tokens into the liquidity pool contract. Since we have t
})
.call();
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L482-L494)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L486-L498)

---

Expand All @@ -235,7 +235,7 @@ As a final demonstration, let's use all our liquidity asset balance to withdraw
})
.call();
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L501-L514)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L505-L518)

---

2 changes: 1 addition & 1 deletion docs/guide/predicates/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Similar to contracts, once you've written a predicate in Sway and compiled it wi
expect(predicate.address).toBeTruthy();
expect(predicate.bytes).toEqual(arrayify(testPredicateTrue));
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L331-L337)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L338-L344)

---

Expand Down
26 changes: 14 additions & 12 deletions docs/guide/predicates/send-and-spend-funds-from-predicates.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ Let's use the SDK to interact with the predicate. First, let's create three wall


```typescript
import { Provider, Wallet, TestUtils } from 'fuels';
import { Provider, Wallet } from 'fuels';
import { seedTestWallet } from '@fuel-ts/wallet/test-utils';
const provider = new Provider('http://127.0.0.1:4000/graphql');
// Setup a private key
const PRIVATE_KEY_1 = '0x862512a2363db2b3a375c0d4bbbd27172180d89f23f2e259bac850ab02619301';
Expand All @@ -68,7 +69,7 @@ Let's use the SDK to interact with the predicate. First, let's create three wall

const receiver = Wallet.generate({ provider });
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L341-L355)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L348-L363)

---

Expand All @@ -77,12 +78,13 @@ Next, let's add some coins to the wallets.


```typescript
import { Provider, Wallet, TestUtils } from 'fuels';
await TestUtils.seedWallet(wallet1, [{ assetId: NativeAssetId, amount: bn(100_000) }]);
await TestUtils.seedWallet(wallet2, [{ assetId: NativeAssetId, amount: bn(20_000) }]);
await TestUtils.seedWallet(wallet3, [{ assetId: NativeAssetId, amount: bn(30_000) }]);
import { Provider, Wallet } from 'fuels';
import { seedTestWallet } from '@fuel-ts/wallet/test-utils';
await seedTestWallet(wallet1, [{ assetId: NativeAssetId, amount: bn(100_000) }]);
await seedTestWallet(wallet2, [{ assetId: NativeAssetId, amount: bn(20_000) }]);
await seedTestWallet(wallet3, [{ assetId: NativeAssetId, amount: bn(30_000) }]);
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L357-L362)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L365-L371)

---

Expand All @@ -109,7 +111,7 @@ Now we can load the predicate binary, and prepare some transaction variables.
const assetId = NativeAssetId;
const initialPredicateBalance = await provider.getBalance(predicate.address, assetId);
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L364-L382)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L373-L391)

---

Expand All @@ -125,7 +127,7 @@ After the predicate address is generated we can send funds to it. Note that we a
// assert that predicate address now has the expected amount to predicate
expect(bn(predicateBalance)).toEqual(initialPredicateBalance.add(amountToPredicate));
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L384-L391)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L393-L400)

---

Expand All @@ -142,7 +144,7 @@ Alternatively, you can use `Wallet.submitPredicate` to setup a `Predicate` and u
initialPredicateBalance.add(amountToPredicate).add(200)
);
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L393-L401)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L402-L410)

---

Expand All @@ -158,7 +160,7 @@ To spend the funds that are now locked in this example's Predicate, we have to p

const signatures = [signature1, signature2, signature3];
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L403-L410)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L412-L419)

---

Expand All @@ -180,7 +182,7 @@ After generating the signatures, we can send a transaction to spend the predicat
// assert that predicate funds now belong to the receiver
expect(bn(receiverBalance)).toEqual(bn(updatedPredicateBalance));
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L412-L425)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L421-L434)

---

4 changes: 2 additions & 2 deletions docs/guide/providers/connecting-to-an-external-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ We can interact with the `Testnet` node by using the following example.
// validate address
expect(wallet.address).toEqual(signer.address);
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L243-L257)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L249-L263)

---

Expand Down Expand Up @@ -59,7 +59,7 @@ If you want to connect to another node just change the url or IP and port. For e
// validate address
expect(wallet.address).toEqual(signer.address);
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L261-L273)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L267-L279)

---

11 changes: 6 additions & 5 deletions docs/guide/providers/querying-the-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ This method returns all coins (of an optional given asset ID) from a wallet, inc


```typescript
import { Provider, TestUtils } from 'fuels';
import { Provider } from 'fuels';
import { generateTestWallet } from '@fuel-ts/wallet/test-utils';
const provider = new Provider('http://127.0.0.1:4000/graphql');
const assetIdA = '0x0101010101010101010101010101010101010101010101010101010101010101';

const wallet = await TestUtils.generateTestWallet(provider, [
const wallet = await generateTestWallet(provider, [
[42, NativeAssetId],
[100, assetIdA],
]);
Expand Down Expand Up @@ -63,7 +64,7 @@ This method returns all coins (of an optional given asset ID) from a wallet, inc
}),
]);
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L277-L310)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L283-L317)

---

Expand All @@ -81,7 +82,7 @@ The last argument says how much you want to spend. This method returns only spen
expect(spendableResources[0].amount).toEqual(bn(42));
expect(spendableResources[1].amount).toEqual(bn(100));
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L320-L327)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L327-L334)

---

Expand All @@ -98,7 +99,7 @@ Get all the spendable balances of all assets for an address. This is different f
{ assetId: assetIdA, amount: bn(100) },
]);
```
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L312-L318)
###### [see code in context](https://github.com/FuelLabs/fuels-ts/blob/master/packages/fuel-gauge/src/doc-examples.test.ts#L319-L325)

---

Loading

0 comments on commit 042ca47

Please sign in to comment.