-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade fuels-ts to 0.83 (#72)
Fixes #71 - Upgrade fuels-ts to 0.83 - Fix error on sequential builds in `test-utils` leading to failure to overwrite type declarations <img width="1523" alt="Screenshot 2024-04-30 at 10 25 52" src="https://github.com/FuelLabs/fuels-npm-packs/assets/3487334/4d5bbb77-e6d8-413c-bf94-b9def8177fe6"> --------- Co-authored-by: LuizAsFight <felipebolsonigomes@gmail.com>
- Loading branch information
1 parent
9e789fc
commit 753b7e9
Showing
12 changed files
with
4,803 additions
and
6,811 deletions.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@fuels/playwright-utils': minor | ||
'@fuels/react': minor | ||
--- | ||
|
||
Upgrade to testnet (fuel-core 0.26.0 + fuels-ts 0.84.0) |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@fuels/playwright-utils': minor | ||
'@fuels/react': minor | ||
--- | ||
|
||
Upgraded fuels-ts to new minor 0.83.0 |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Release to @pr-<number> tag on npm | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release-pr: | ||
name: 'Release PR to npm' | ||
runs-on: buildjet-4vcpu-ubuntu-2204 | ||
# comment out if:false to enable release PR to npm | ||
if: false | ||
permissions: write-all | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# need this to get full git-history/clone in order to build changelogs and check changesets | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- uses: FuelLabs/github-actions/setups/node@master | ||
with: | ||
pnpm-version: 8.x.x | ||
- uses: FuelLabs/github-actions/setups/npm@master | ||
with: | ||
npm-token: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Release to @pr-${{ github.event.pull_request.number }} tag on npm | ||
id: release | ||
run: | | ||
pnpm changeset:next | ||
git add .changeset/fuel-labs-ci.md | ||
pnpm changeset version --snapshot pr-${{ env.PR_NUMBER }} | ||
changetsets=$(pnpm changeset publish --tag pr-${{ env.PR_NUMBER }}) | ||
published_version=$(echo "$changetsets" | grep -oP '@\K([0-9]+\.){2}[0-9]+-pr-${{ env.PR_NUMBER }}-\d+' | head -1) | ||
echo "published_version=$published_version" >> $GITHUB_OUTPUT | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
|
||
- uses: mshick/add-pr-comment@v2 | ||
with: | ||
message: | | ||
This PR is published in NPM with version **${{ steps.release.outputs.published_version }}** | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
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
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
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
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,25 +1,22 @@ | ||
import type { BN } from 'fuels'; | ||
import { Address, BaseAssetId, Wallet, Provider, bn } from 'fuels'; | ||
|
||
type SeedWalletOptions = { | ||
gasPrice?: number; | ||
}; | ||
import type { BN, TxParamsType } from 'fuels'; | ||
import { Address, Wallet, Provider, bn } from 'fuels'; | ||
|
||
export async function seedWallet( | ||
address: string, | ||
amount: BN, | ||
fuelProviderUrl: string, | ||
genesisSecret: string, | ||
options: SeedWalletOptions = {}, | ||
options: TxParamsType = {}, | ||
) { | ||
const fuelProvider = await Provider.create(fuelProviderUrl); | ||
const { minGasPrice } = await fuelProvider.getGasConfig(); | ||
const baseAssetId = fuelProvider.getBaseAssetId(); | ||
const genesisWallet = Wallet.fromPrivateKey(genesisSecret!, fuelProvider); | ||
const parameters: TxParamsType = { gasLimit: bn(100_000), ...options }; | ||
const response = await genesisWallet.transfer( | ||
Address.fromString(address), | ||
amount, | ||
BaseAssetId, | ||
{ gasPrice: minGasPrice, gasLimit: bn(100_000), ...options }, | ||
baseAssetId, | ||
parameters, | ||
); | ||
await response.wait(); | ||
} |
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
Oops, something went wrong.