diff --git a/.changeset/old-boxes-cheat.md b/.changeset/old-boxes-cheat.md new file mode 100644 index 000000000..a03b3cada --- /dev/null +++ b/.changeset/old-boxes-cheat.md @@ -0,0 +1,7 @@ +--- +"@fuel-wallet/connections": minor +"@fuel-wallet/types": minor +"fuels-wallet": minor +--- + +feat: update wallet to the latest fuel core (0.26.0) diff --git a/.changeset/stupid-flowers-provide.md b/.changeset/stupid-flowers-provide.md new file mode 100644 index 000000000..e140a6941 --- /dev/null +++ b/.changeset/stupid-flowers-provide.md @@ -0,0 +1,5 @@ +--- +"fuels-wallet": minor +--- + +feat: add custom network fees, offering options like regular, fast and custom tip. \ No newline at end of file diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index 185a0de9c..79a689afa 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -28,12 +28,10 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Start Test Node - run: pnpm node:up:test - - - name: Graphql Codegen - run: pnpm codegen:app - env: - NODE_ENV: test + run: pnpm node:up + + - name: Generate .env + run: cp packages/app/.env.example packages/app/.env # Unit tests running with JEST - name: Find PR number @@ -64,7 +62,7 @@ jobs: base-coverage-file: ${{ env.COVERAGE_FILE }} - name: Stop Test Node - run: pnpm node:clean:test + run: pnpm node:clean tests-e2e: name: E2E Tests @@ -81,20 +79,17 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Start Test Node - run: pnpm node:up:test - - - name: Graphql Codegen - run: pnpm codegen:app - env: - NODE_ENV: test + run: pnpm node:up + + - name: Generate .env + run: cp packages/app/.env.example packages/app/.env - name: Build Application - run: pnpm build:test + run: pnpm build:app env: ## increase node.js m memory limit for building ## with sourcemaps NODE_OPTIONS: "--max-old-space-size=4096" - NODE_ENV: test # E2E tests running with Playwright - name: Install Playwright Browsers @@ -113,60 +108,66 @@ jobs: retention-days: 30 - name: Stop Test Node - run: pnpm node:clean:test + run: pnpm node:clean - tests-e2e-contracts: - name: E2E Contract Tests - runs-on: buildjet-4vcpu-ubuntu-2204 - steps: - - uses: actions/checkout@v3 - - uses: FuelLabs/github-actions/setups/node@master - with: - node-version: 18.14.1 - pnpm-version: 8.15.7 - - uses: FuelLabs/github-actions/setups/docker@master - with: - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Run PNPM install - id: pnpm-cache - run: - pnpm recursive install --frozen-lockfile - - - name: Start Test Node - run: pnpm node:up:test - - - name: Build Application - run: pnpm build:all - env: - ## increase node.js m memory limit for building - ## with sourcemaps - NODE_OPTIONS: "--max-old-space-size=4096" - NODE_ENV: test - - - name: Build & Deploy Contracts - run: pnpm deploy:contracts - working-directory: ./packages/e2e-contract-tests - - # E2E tests running with Playwright - - name: Install Playwright Browsers - run: npx playwright install --with-deps chromium - - - name: Run E2E Contract Tests - run: xvfb-run --auto-servernum -- pnpm test:e2e:contracts - env: - NODE_ENV: test - - - uses: actions/upload-artifact@v4 - if: always() - with: - name: playwright-report - path: | - packages/app/playwright-report/ - packages/app/playwright-html/ - retention-days: 30 - - - name: Stop Test Node - run: pnpm node:clean:test + # tests-e2e-contracts: + # name: E2E Contract Tests + # runs-on: buildjet-4vcpu-ubuntu-2204 + # steps: + # - uses: actions/checkout@v3 + # - uses: FuelLabs/github-actions/setups/node@master + # with: + # node-version: 18.14.1 + # pnpm-version: 8.15.7 + # - uses: FuelLabs/github-actions/setups/docker@master + # with: + # username: ${{ github.repository_owner }} + # password: ${{ secrets.GITHUB_TOKEN }} + + # - name: Run PNPM install + # id: pnpm-cache + # run: + # pnpm recursive install --frozen-lockfile + + # - name: Start Test Node + # run: pnpm node:up + + # - name: Generate .env app + # run: cp packages/app/.env.example packages/app/.env + + # - name: Generate .env e2e-contracts + # run: cp packages/e2e-contract-tests/.env.example packages/e2e-contract-tests/.env + + # - name: Build Application + # run: pnpm build:all + # env: + # ## increase node.js m memory limit for building + # ## with sourcemaps + # NODE_OPTIONS: "--max-old-space-size=4096" + # NODE_ENV: test + + # - name: Build & Deploy Contracts + # run: pnpm deploy:contracts + # working-directory: ./packages/e2e-contract-tests + + # # E2E tests running with Playwright + # - name: Install Playwright Browsers + # run: npx playwright install --with-deps chromium + + # - name: Run E2E Contract Tests + # run: xvfb-run --auto-servernum -- pnpm test:e2e:contracts + # env: + # NODE_ENV: test + + # - uses: actions/upload-artifact@v4 + # if: always() + # with: + # name: playwright-report + # path: | + # packages/app/playwright-report/ + # packages/app/playwright-html/ + # retention-days: 30 + + # - name: Stop Test Node + # run: pnpm node:clean diff --git a/Forc.toml b/Forc.toml new file mode 100644 index 000000000..b8627b951 --- /dev/null +++ b/Forc.toml @@ -0,0 +1,4 @@ +[workspace] +members = [ + "packages/e2e-contract-tests/contracts/custom_asset" +] diff --git a/biome.json b/biome.json index f04cc5028..8de5bcd2a 100644 --- a/biome.json +++ b/biome.json @@ -48,7 +48,7 @@ "**/build", "**/dist", "**/dist-crx", - "**/contracts", + "**/contracts/**", "pnpm-lock.yaml" ] } diff --git a/docker/.env.test b/docker/.env.test deleted file mode 100644 index 8c8b4d428..000000000 --- a/docker/.env.test +++ /dev/null @@ -1,6 +0,0 @@ -PROJECT=fuels-wallet-test -MIN_GAS_PRICE=1 -WALLET_SECRET=0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298 -DISPENSE_AMOUNT=500000000 -FUEL_CORE_PORT=4001 -FUEL_FAUCET_PORT=4041 diff --git a/docker/Makefile b/docker/Makefile index b4bd2a1f1..3f02f4e59 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -1,17 +1,8 @@ up: docker compose -p dev --env-file .env up -d --build -up-test: - docker compose -p test --env-file .env.test up -d --build - down: docker compose -p dev stop -down-test: - docker compose -p test stop - clean: docker compose -p dev down --rmi local -v --remove-orphans - -clean-test: - docker compose -p test down --rmi local -v --remove-orphans diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 49723b50e..f03f878a8 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -16,7 +16,7 @@ services: volumes: - fuel-core-db:/mnt/db healthcheck: - test: curl --fail http://localhost:4000/health || exit 1 + test: curl --fail http://localhost:4000/v1/health || exit 1 interval: 1s timeout: 5s retries: 20 @@ -30,8 +30,8 @@ services: MIN_GAS_PRICE: ${MIN_GAS_PRICE} WALLET_SECRET_KEY: ${WALLET_SECRET} DISPENSE_AMOUNT: ${DISPENSE_AMOUNT} - FUEL_NODE_URL: http://${PROJECT:-fuel-node}_fuel-core:4000/graphql - image: ghcr.io/fuellabs/faucet:v0.6.2 + FUEL_NODE_URL: http://${PROJECT:-fuel-node}_fuel-core:4000/v1/graphql + image: ghcr.io/fuellabs/faucet:v0.7.2 ports: - '${FUEL_FAUCET_PORT:-4040}:3000' links: diff --git a/docker/fuel-core/Dockerfile b/docker/fuel-core/Dockerfile index 94310a552..f048630ec 100644 --- a/docker/fuel-core/Dockerfile +++ b/docker/fuel-core/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/fuellabs/fuel-core:v0.22.0 +FROM ghcr.io/fuellabs/fuel-core:v0.26.0 ENV MIN_GAS_PRICE="${MIN_GAS_PRICE}" ENV CONSENSUS_KEY="${CONSENSUS_KEY}" @@ -11,7 +11,7 @@ RUN apt install curl -y WORKDIR /root/ -COPY chainConfig.json . +COPY config ./config COPY run.sh . EXPOSE ${PORT} diff --git a/docker/fuel-core/chainConfig.json b/docker/fuel-core/chainConfig.json deleted file mode 100644 index d3b1d5268..000000000 --- a/docker/fuel-core/chainConfig.json +++ /dev/null @@ -1,212 +0,0 @@ -{ - "chain_name": "local_testnet", - "consensus": { - "PoA": { - "signing_key": "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d" - } - }, - "parent_network": { - "type": "LocalTest" - }, - "block_gas_limit": 5000000000, - "consensus_parameters": { - "tx_params": { - "max_inputs": 255, - "max_outputs": 255, - "max_witnesses": 255, - "max_gas_per_tx": 10000000, - "max_size": 17825792 - }, - "predicate_params": { - "max_predicate_length": 1048576, - "max_predicate_data_length": 1048576, - "max_gas_per_predicate": 10000000, - "max_message_data_length": 1048576 - }, - "script_params": { - "max_script_length": 1048576, - "max_script_data_length": 1048576 - }, - "contract_params": { - "contract_max_size": 16777216, - "max_storage_slots": 255 - }, - "fee_params": { - "gas_price_factor": 92, - "gas_per_byte": 4 - } - }, - "gas_costs": { - "add": 1, - "addi": 1, - "aloc": 1, - "and": 1, - "andi": 1, - "bal": 13, - "bhei": 1, - "bhsh": 1, - "burn": 132, - "cb": 1, - "cfei": 1, - "cfsi": 1, - "croo": 16, - "div": 1, - "divi": 1, - "ecr1": 3000, - "eck1": 951, - "ed19": 3000, - "eq": 1, - "exp": 1, - "expi": 1, - "flag": 1, - "gm": 1, - "gt": 1, - "gtf": 1, - "ji": 1, - "jmp": 1, - "jne": 1, - "jnei": 1, - "jnzi": 1, - "jmpf": 1, - "jmpb": 1, - "jnzf": 1, - "jnzb": 1, - "jnef": 1, - "jneb": 1, - "k256": 11, - "lb": 1, - "log": 9, - "lt": 1, - "lw": 1, - "mcpi": 33, - "mint": 135, - "mlog": 1, - "modOp": 1, - "modi": 1, - "moveOp": 1, - "movi": 1, - "mroo": 2, - "mul": 1, - "muli": 1, - "mldv": 1, - "noop": 1, - "not": 1, - "or": 1, - "ori": 1, - "ret": 13, - "rvrt": 13, - "s256": 2, - "sb": 1, - "scwq": 13, - "sll": 1, - "slli": 1, - "srl": 1, - "srli": 1, - "srw": 12, - "sub": 1, - "subi": 1, - "sw": 1, - "sww": 43, - "swwq": 44, - "time": 1, - "tr": 105, - "tro": 60, - "wdcm": 1, - "wqcm": 1, - "wdop": 1, - "wqop": 1, - "wdml": 1, - "wqml": 1, - "wddv": 1, - "wqdv": 2, - "wdmd": 3, - "wqmd": 4, - "wdam": 2, - "wqam": 3, - "wdmm": 3, - "wqmm": 3, - "xor": 1, - "xori": 1, - "call": { - "base": 144, - "dep_per_unit": 214 - }, - "ccp": { - "base": 15, - "dep_per_unit": 103 - }, - "csiz": { - "base": 17, - "dep_per_unit": 790 - }, - "ldc": { - "base": 15, - "dep_per_unit": 272 - }, - "logd": { - "base": 26, - "dep_per_unit": 64 - }, - "mcl": { - "base": 1, - "dep_per_unit": 3333 - }, - "mcli": { - "base": 1, - "dep_per_unit": 3333 - }, - "mcp": { - "base": 1, - "dep_per_unit": 2000 - }, - "meq": { - "base": 1, - "dep_per_unit": 2500 - }, - "retd": { - "base": 29, - "dep_per_unit": 62 - }, - "smo": { - "base": 209, - "dep_per_unit": 55 - }, - "srwq": { - "base": 47, - "dep_per_unit": 5 - } - }, - "wallet": { - "address": "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d", - "privateKey": "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298" - }, - "initial_state": { - "coins": [ - { - "owner": "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d", - "amount": "0xFFFFFFFFFFFFFFFF", - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "owner": "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d", - "amount": "0xFFFFFFFFFFFFFFFF", - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - { - "owner": "0x6684dd7bb61364e1ac458e9241f969178c4a2e302bbc23e143c49d8b6dba701a", - "amount": "0x00000000FFFFFFFF", - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "owner": "0xc8e615a4089466174459ef19cfd257d2e17adfabff3b8f219dbb5fb4eca87c50", - "amount": "0x00000000FFFFFFFF", - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - { - "owner": "0x92dffc873b56f219329ed03bb69bebe8c3d8b041088574882f7a6404f02e2f28", - "amount": "0x00000000FFFFFFFF", - "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - ] - } -} diff --git a/docker/fuel-core/config/chainConfig.json b/docker/fuel-core/config/chainConfig.json new file mode 100644 index 000000000..81083c094 --- /dev/null +++ b/docker/fuel-core/config/chainConfig.json @@ -0,0 +1,271 @@ +{ + "chain_name": "local_testnet", + "consensus_parameters": { + "V1": { + "tx_params": { + "V1": { + "max_inputs": 255, + "max_outputs": 255, + "max_witnesses": 255, + "max_gas_per_tx": 30000000, + "max_size": 112640, + "max_bytecode_subsections": 256 + } + }, + "predicate_params": { + "V1": { + "max_predicate_length": 102400, + "max_predicate_data_length": 102400, + "max_message_data_length": 102400, + "max_gas_per_predicate": 30000000 + } + }, + "script_params": { + "V1": { + "max_script_length": 102400, + "max_script_data_length": 102400 + } + }, + "contract_params": { + "V1": { + "contract_max_size": 102400, + "max_storage_slots": 1760 + } + }, + "fee_params": { + "V1": { + "gas_price_factor": 92, + "gas_per_byte": 63 + } + }, + "chain_id": 0, + "gas_costs": { + "V1": { + "add": 2, + "addi": 2, + "aloc": 1, + "and": 2, + "andi": 2, + "bal": 366, + "bhei": 2, + "bhsh": 2, + "burn": 33949, + "cb": 2, + "cfei": 2, + "cfsi": 2, + "div": 2, + "divi": 2, + "eck1": 3347, + "ecr1": 46165, + "ed19": 4210, + "eq": 2, + "exp": 2, + "expi": 2, + "flag": 1, + "gm": 2, + "gt": 2, + "gtf": 16, + "ji": 2, + "jmp": 2, + "jne": 2, + "jnei": 2, + "jnzi": 2, + "jmpf": 2, + "jmpb": 2, + "jnzf": 2, + "jnzb": 2, + "jnef": 2, + "jneb": 2, + "lb": 2, + "log": 754, + "lt": 2, + "lw": 2, + "mint": 35718, + "mlog": 2, + "mod": 2, + "modi": 2, + "move": 2, + "movi": 2, + "mroo": 5, + "mul": 2, + "muli": 2, + "mldv": 4, + "noop": 1, + "not": 2, + "or": 2, + "ori": 2, + "poph": 3, + "popl": 3, + "pshh": 4, + "pshl": 4, + "ret_contract": 733, + "rvrt_contract": 722, + "sb": 2, + "sll": 2, + "slli": 2, + "srl": 2, + "srli": 2, + "srw": 253, + "sub": 2, + "subi": 2, + "sw": 2, + "sww": 29053, + "time": 79, + "tr": 46242, + "tro": 33251, + "wdcm": 3, + "wqcm": 3, + "wdop": 3, + "wqop": 3, + "wdml": 3, + "wqml": 4, + "wddv": 5, + "wqdv": 7, + "wdmd": 11, + "wqmd": 18, + "wdam": 9, + "wqam": 12, + "wdmm": 11, + "wqmm": 11, + "xor": 2, + "xori": 2, + "call": { + "LightOperation": { + "base": 21687, + "units_per_gas": 4 + } + }, + "ccp": { + "LightOperation": { + "base": 59, + "units_per_gas": 20 + } + }, + "croo": { + "LightOperation": { + "base": 1, + "units_per_gas": 1 + } + }, + "csiz": { + "LightOperation": { + "base": 59, + "units_per_gas": 195 + } + }, + "k256": { + "LightOperation": { + "base": 282, + "units_per_gas": 3 + } + }, + "ldc": { + "LightOperation": { + "base": 45, + "units_per_gas": 65 + } + }, + "logd": { + "LightOperation": { + "base": 1134, + "units_per_gas": 2 + } + }, + "mcl": { + "LightOperation": { + "base": 3, + "units_per_gas": 523 + } + }, + "mcli": { + "LightOperation": { + "base": 3, + "units_per_gas": 526 + } + }, + "mcp": { + "LightOperation": { + "base": 3, + "units_per_gas": 448 + } + }, + "mcpi": { + "LightOperation": { + "base": 7, + "units_per_gas": 585 + } + }, + "meq": { + "LightOperation": { + "base": 11, + "units_per_gas": 1097 + } + }, + "retd_contract": { + "LightOperation": { + "base": 1086, + "units_per_gas": 2 + } + }, + "s256": { + "LightOperation": { + "base": 45, + "units_per_gas": 3 + } + }, + "scwq": { + "HeavyOperation": { + "base": 30375, + "gas_per_unit": 28628 + } + }, + "smo": { + "LightOperation": { + "base": 64196, + "units_per_gas": 1 + } + }, + "srwq": { + "HeavyOperation": { + "base": 262, + "gas_per_unit": 249 + } + }, + "swwq": { + "HeavyOperation": { + "base": 28484, + "gas_per_unit": 26613 + } + }, + "contract_root": { + "LightOperation": { + "base": 45, + "units_per_gas": 1 + } + }, + "state_root": { + "HeavyOperation": { + "base": 350, + "gas_per_unit": 176 + } + }, + "new_storage_per_byte": 63, + "vm_initialization": { + "LightOperation": { + "base": 1645, + "units_per_gas": 14 + } + } + } + }, + "base_asset_id": "0000000000000000000000000000000000000000000000000000000000000000", + "block_gas_limit": 30000000, + "privileged_address": "0000000000000000000000000000000000000000000000000000000000000000" + } + }, + "consensus": { + "PoA": { + "signing_key": "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d" + } + } +} diff --git a/docker/fuel-core/accounts.json b/docker/fuel-core/config/faucets.json similarity index 100% rename from docker/fuel-core/accounts.json rename to docker/fuel-core/config/faucets.json diff --git a/docker/fuel-core/config/metadata.json b/docker/fuel-core/config/metadata.json new file mode 100644 index 000000000..ae0a1bf75 --- /dev/null +++ b/docker/fuel-core/config/metadata.json @@ -0,0 +1,8 @@ +{ + "chain_config": "chainConfig.json", + "table_encoding": { + "Json": { + "filepath": "stateConfig.json" + } + } +} diff --git a/docker/fuel-core/config/stateConfig.json b/docker/fuel-core/config/stateConfig.json new file mode 100644 index 000000000..1025822d7 --- /dev/null +++ b/docker/fuel-core/config/stateConfig.json @@ -0,0 +1,53 @@ +{ + "coins": [ + { + "tx_id": "0x260eabfd50937e92939fd92687e9302a72e91c5065f64f853f2ccbe02396fe09d665", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d", + "amount": 18446744073709551615, + "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "tx_id": "0x2a757c2317236f7883ac9bbbf7d402f034e0b725c544ef1c8725b1d2bd960f8c690f", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "0x6684dd7bb61364e1ac458e9241f969178c4a2e302bbc23e143c49d8b6dba701a", + "amount": 18446744073709551615, + "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "tx_id": "0x634ef6cda00bac63992bbde80c6d694d484d58025a5ca0c9c848f0d35a5a3eee74b2", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "0xc8e615a4089466174459ef19cfd257d2e17adfabff3b8f219dbb5fb4eca87c50", + "amount": 18446744073709551615, + "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "tx_id": "0xd3543bb1da137a7987a96a1bb71681fdd195ff25318c0d4a923aa30eb27ffa80bc7b", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "0x92dffc873b56f219329ed03bb69bebe8c3d8b041088574882f7a6404f02e2f28", + "amount": 18446744073709551615, + "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "tx_id": "0x00000000000000000000000000000000000000000000000000000000000000000001", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d", + "amount": 18446744073709551615, + "asset_id": "0x0000000000000000000000000000000000000000000000000000000000000001" + } + ], + "messages": [], + "contracts": [], + "block_height": 0, + "da_block_height": 0 +} diff --git a/docker/fuel-core/config/state_transition_bytecode.wasm b/docker/fuel-core/config/state_transition_bytecode.wasm new file mode 100644 index 000000000..e69de29bb diff --git a/docker/fuel-core/run.sh b/docker/fuel-core/run.sh index 9dbb11922..9fcabf874 100644 --- a/docker/fuel-core/run.sh +++ b/docker/fuel-core/run.sh @@ -1,14 +1,14 @@ #!/bin/bash -# Change the network name -sed -i "s/local_testnet/$NETWORK_NAME/g" ./chainConfig.json - # Start the Fuel Core node /root/fuel-core run \ --ip 0.0.0.0 \ --port 4000 \ --db-path ./mnt/db/ \ - --utxo-validation \ - --min-gas-price ${MIN_GAS_PRICE} \ --consensus-key ${CONSENSUS_KEY} \ - --chain ./chainConfig.json + --snapshot config \ + --poa-instant true \ + --vm-backtrace \ + --min-gas-price ${MIN_GAS_PRICE} \ + --utxo-validation \ + --debug diff --git a/examples/cra-dapp/package.json b/examples/cra-dapp/package.json index db7291a95..44280c735 100644 --- a/examples/cra-dapp/package.json +++ b/examples/cra-dapp/package.json @@ -7,10 +7,10 @@ "start": "vite" }, "dependencies": { - "@fuels/connectors": "0.1.1", - "@fuels/react": "0.18.0", + "@fuels/connectors": "0.4.0", + "@fuels/react": "0.19.0", "@tanstack/react-query": "5.28.4", - "fuels": "0.79.0", + "fuels": "0.84.0", "react": "18.2.0", "react-dom": "18.2.0" }, diff --git a/examples/cra-dapp/src/App.tsx b/examples/cra-dapp/src/App.tsx index 68d6b36bc..d4367af2c 100644 --- a/examples/cra-dapp/src/App.tsx +++ b/examples/cra-dapp/src/App.tsx @@ -1,18 +1,25 @@ import { + useAccount, useAccounts, useConnectUI, useDisconnect, + useFuel, useIsConnected, + useWallet, } from '@fuels/react'; + +import { bn } from 'fuels'; import './App.css'; function App() { - const { connect, error, isError, theme, setTheme, isConnecting } = - useConnectUI(); + const { connect, error, isError, theme, isConnecting } = useConnectUI(); + + const { fuel } = useFuel(); const { disconnect } = useDisconnect(); const { isConnected } = useIsConnected(); + const { wallet } = useWallet(); + const { account } = useAccount(); const { accounts } = useAccounts(); - const lightTheme = theme === 'light'; return (
{error?.message}