Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
78c453f
wip: setup to develop bako integration
guimroque Jul 25, 2025
ba0eea9
wip: send tx
guimroque Jul 30, 2025
5d1da83
wip: send tx
guimroque Jul 30, 2025
f659021
wip: send tx
guimroque Jul 30, 2025
c2e7dd8
wip: extends base class
guimroque Aug 4, 2025
a971bec
wip: extends base class
guimroque Aug 4, 2025
2e84641
wip: connector auth
guimroque Aug 4, 2025
aa3b64b
wip: connector auth
guimroque Aug 4, 2025
f8ad57b
wip: test setup
guimroque Aug 14, 2025
f7be2a4
wip: add signature and implement sdk with recover existents predicate…
guimroque Aug 23, 2025
b4e3328
refactor: organize classes and folders
guimroque Aug 26, 2025
adf803c
chore: optimize image
guimroque Aug 26, 2025
046f572
chore: optimize image
guimroque Aug 26, 2025
5f71e88
chore: remove unused folders to build
guimroque Aug 26, 2025
159a694
chore: send correct auth
guimroque Aug 26, 2025
17e8fff
chore: send correct auth
guimroque Aug 26, 2025
d1b8711
chore: send correct auth
guimroque Aug 26, 2025
d4e4e11
chore: disconnect inprovement
guimroque Aug 26, 2025
445c2c1
chore: disconnect inprovement
guimroque Aug 26, 2025
7f2232e
chore: disconnect inprovement
guimroque Aug 26, 2025
5e0a326
chore: add references
guimroque Sep 8, 2025
4466b59
fix: allow users to reconnect after refuse to sign or close the signa…
RafaDev95 Sep 10, 2025
c6ab063
chore: improve error message
RafaDev95 Sep 10, 2025
3052001
chore: standarize wallet address with uppercase and lowercase caracte…
RafaDev95 Sep 11, 2025
af35ae3
chore: integrate complete version of wallet connect with predicate co…
RafaDev95 Sep 12, 2025
9eb5368
chore: use predicate versions from bakosafe sdk
RafaDev95 Sep 12, 2025
9b083e9
chore: remove unnused files and folder
RafaDev95 Sep 15, 2025
e9fad7c
chore: remove unnused methods from walletconnec and filter predicate …
RafaDev95 Sep 18, 2025
1f7c316
chore: remove use of predicate factory from predicateconnector and us…
RafaDev95 Sep 18, 2025
89b5dd6
chore: use predicate address in the metadata to be displayed in the d…
RafaDev95 Sep 19, 2025
349bc0e
chore: use getlatestpredicateversion from bakosafe
RafaDev95 Sep 19, 2025
befcd09
chore: remove unnused method
RafaDev95 Sep 19, 2025
10f0216
chore: use legacyconnector from sdk to get vauls balance based on the…
RafaDev95 Sep 19, 2025
dc62228
refactor: simplify logic to get predicate versions metadata
RafaDev95 Sep 19, 2025
67eb163
refactor: remove eth asset id constant and improve logic to get vault…
RafaDev95 Sep 19, 2025
c2f4f85
fix: config to create vault and getsmartdefault predicator method
RafaDev95 Sep 19, 2025
37568de
chore: test commit
pedroanastacio Sep 22, 2025
d294e9c
chore: remove comment
pedroanastacio Sep 22, 2025
7bd1c89
Revert "chore: remove unused folders to build"
pedroanastacio Sep 22, 2025
e21de61
Merge pull request #11 from infinitybase/p2/fix/preview-link-adjustments
pedroanastacio Sep 22, 2025
0edc62d
fix: adjust packagejson bakosafe version
RafaDev95 Sep 22, 2025
427ea3e
Merge branch 'main' into rf/fix/bakosafe-connector-evm
RafaDev95 Sep 22, 2025
a9bd687
chore: adjust bako server url
RafaDev95 Sep 22, 2025
06696b6
chore: update bakosafe sdk version
RafaDev95 Sep 22, 2025
33183a8
chore: add logs to help debug a problem
RafaDev95 Sep 22, 2025
d575233
fix: commented out logic related to old account validation and remove…
RafaDev95 Sep 22, 2025
bee03a8
chore: use changeaccount from bakosafe provider and update bakosafe v…
RafaDev95 Sep 23, 2025
c050715
chore: add pnpm-lock
RafaDev95 Sep 23, 2025
2c06a75
fix: improve logic to validate when user is connected or not
RafaDev95 Sep 23, 2025
034cc1e
chore: change account
guimroque Sep 23, 2025
10f7137
feat: add bako predicate connector package
pedroanastacio Sep 23, 2025
3d933ea
chore: list by predicate address
guimroque Sep 23, 2025
f35aba6
chore: list by predicate address
guimroque Sep 23, 2025
e699e33
fix: fix bako predicate connector build error
pedroanastacio Sep 23, 2025
be773d8
feat: wallet connector extends bako predicate connector
pedroanastacio Sep 23, 2025
8b8dc03
fix: adjust select predicate version
RafaDev95 Sep 24, 2025
0862344
Merge branch 'rf/fix/bakosafe-connector-evm' into p2/feat/bako-predic…
pedroanastacio Sep 24, 2025
3aef496
fix: pass correct origin to connectdapp
RafaDev95 Sep 24, 2025
949c441
chore: list by predicate address
pedroanastacio Sep 24, 2025
92fe7a8
fix: throw errors as expected by tests
pedroanastacio Sep 24, 2025
e1d2b5a
fix: dont disconnect the user if the he reject to sign the message
RafaDev95 Sep 24, 2025
eda7a5d
fix: throws an error if there is no account connected
pedroanastacio Sep 24, 2025
07b4482
Merge branch 'rf/fix/bakosafe-connector-evm' into p2/feat/bako-predic…
pedroanastacio Sep 24, 2025
e48960a
fix: pass correct origin to connectdapp
pedroanastacio Sep 24, 2025
c97daab
fix: dont disconnect the user if the he reject to sign the message
pedroanastacio Sep 24, 2025
aeffeec
chore: bakosafe update package
guimroque Sep 24, 2025
37b0f28
chore: bakosafe update package
guimroque Sep 24, 2025
cd1e56e
Revert "chore: optimize image"
pedroanastacio Sep 24, 2025
7267cef
chore: update lock file
pedroanastacio Sep 24, 2025
4514530
wip: react app pointing to packages
pedroanastacio Sep 24, 2025
f8555d5
wip: encode txID
guimroque Sep 24, 2025
a8a946a
fix: add encode for latest version and adjust bako encode
RafaDev95 Sep 24, 2025
1a84023
Merge branch 'rf/fix/bakosafe-connector-evm' into p2/feat/bako-predic…
pedroanastacio Sep 25, 2025
06cbf70
chore: bakosafe update package
pedroanastacio Sep 25, 2025
e3bbbb2
fix: display predicate addresses with lower and uppercase on select d…
RafaDev95 Sep 25, 2025
556c870
fix: adjusts param type and throws an error as expected
pedroanastacio Sep 25, 2025
9c02c72
Merge branch 'rf/fix/bakosafe-connector-evm' into p2/feat/bako-predic…
pedroanastacio Sep 25, 2025
593bdaf
refactor: remove harcoded local storage related logic and add a class…
RafaDev95 Sep 25, 2025
786a4bd
refactor: adjusts setupPredicate() tests according to new implementation
pedroanastacio Sep 26, 2025
3930668
chore: use encodetxid logic from sdk
RafaDev95 Sep 26, 2025
63f4f6a
chore: bako version upgrde
guimroque Sep 26, 2025
0964cb6
wip: add tests to bako predicate connector
pedroanastacio Sep 26, 2025
ae030aa
Merge pull request #13 from infinitybase/rf/fix/bakosafe-connector-ev…
guimroque Sep 30, 2025
859e9e4
chore: bako version upgrde
guimroque Sep 30, 2025
7b0db8a
chore: package lock
guimroque Sep 30, 2025
6637998
Merge pull request #14 from infinitybase/rf/fix/bakosafe-connector-evm
guimroque Sep 30, 2025
b347145
feat: update bakosafe version and use encodedTxId
guimroque Oct 2, 2025
1af8e3a
fix: complete build
guimroque Oct 2, 2025
9a512f4
chore: restore react-app
guimroque Oct 3, 2025
6b837e9
fix: build packages
guimroque Oct 3, 2025
83f3e4b
Merge remote-tracking branch 'fuel_upstream/main' into p2/feat/bako-p…
pedroanastacio Oct 6, 2025
81f522a
fix: throws an error if there is no account connected
pedroanastacio Oct 6, 2025
fd6613b
refactor: remove unnecessary function mock
pedroanastacio Oct 6, 2025
0912f73
fix: accept hash predicate as undefined
pedroanastacio Oct 6, 2025
3851bd2
feat: add mock address for testing
pedroanastacio Oct 6, 2025
9d04211
chore: remove comment
pedroanastacio Oct 6, 2025
d1b1ec9
chore: remove logs
pedroanastacio Oct 6, 2025
56f6eb2
chore: remove comment and unnused import
pedroanastacio Oct 6, 2025
94273cd
chore: remove logs
pedroanastacio Oct 6, 2025
eff6942
chore: remove unnused imports
pedroanastacio Oct 7, 2025
be4f2ee
chore: remove comments
pedroanastacio Oct 7, 2025
099c2d9
chore: remove comments
pedroanastacio Oct 7, 2025
792ea37
chore: remove comment and empty lines
pedroanastacio Oct 7, 2025
75092c5
chore: remove comments
pedroanastacio Oct 7, 2025
b1db5c6
chore: remove unnecessary comments and translate comments and log mes…
pedroanastacio Oct 7, 2025
ad1f20f
chore: translate log message
pedroanastacio Oct 7, 2025
8ebe22b
chore: remove unnecessary scripts
pedroanastacio Oct 7, 2025
4ef3251
chore: remove comment
pedroanastacio Oct 7, 2025
52f6abd
refactor: remove launch test node settings
pedroanastacio Oct 7, 2025
97310b8
refactor: use spy to mock function
pedroanastacio Oct 7, 2025
bd89755
feat: update bakosafe sdk version
pedroanastacio Oct 16, 2025
f9177e3
refactor: move constant to a separate file
pedroanastacio Oct 17, 2025
25caf9e
fix: clear method only removes items related to the storage of the ba…
pedroanastacio Oct 17, 2025
0e525a0
refactor: move constants related to window to constants file
pedroanastacio Oct 17, 2025
e80c068
refactor: remove unused storage property
pedroanastacio Oct 17, 2025
a114c0d
refactor: move constants related to socket to constants file
pedroanastacio Oct 17, 2025
5789de4
feat(connector): auto-create predicate in API when switching versions
guimroque Dec 22, 2025
eaa7869
feat(predicate-connector): auto-create predicate when switching versions
guimroque Dec 22, 2025
d3256ce
feat(predicate-connector): auto-detect configurable format based on v…
guimroque Dec 22, 2025
2d1c2b8
refactor(predicate-connector): standardize code style and improve sto…
guimroque Dec 22, 2025
bd360a3
fix(predicate-connector): clear storage when switching EVM accounts
guimroque Dec 22, 2025
2086a20
chore: merge upstream/main and resolve lock file conflicts
guimroque Jan 5, 2026
c770910
chore: add changeset for bako predicate connector integration
guimroque Jan 5, 2026
51f86ce
fix: add overrides for js-yaml and uglify-js security vulnerabilities
guimroque Jan 5, 2026
aae35b0
fix: add security overrides for remaining vulnerabilities with availa…
guimroque Jan 5, 2026
cb720f9
fix: update bako-predicate-connector fuels peer dependency to 0.102.0
guimroque Jan 5, 2026
559fd84
fix: pin js-yaml to 3.14.2 to maintain compatibility with changeset
guimroque Jan 5, 2026
22927d9
fix: pin vite to 5.4.21 to maintain compatibility with vitest
guimroque Jan 5, 2026
ba3d107
fix(ci): resolve Next.js 16 Turbopack and Bash compatibility issues
guimroque Jan 6, 2026
be8df0a
fix(ci): correct SCRIPT_DIR path in deployCI.sh
guimroque Jan 6, 2026
5d20494
chore: update tsconfig for Next.js 16 Turbopack compatibility
guimroque Jan 6, 2026
58219eb
fix(ci): update Playwright version to match pnpm override
guimroque Jan 6, 2026
131fc14
fix(ci): install both Playwright versions for Synpress and E2E tests
guimroque Jan 6, 2026
aec0c4e
fix: use consistent HASH_PREDICATE default for deterministic addresses
guimroque Jan 7, 2026
e352bc9
feat(bako-predicate-connector): update bakosafe to 0.6.0 and use Bako…
guimroque Jan 7, 2026
658998a
chore(deps): update bakosafe to 0.6.0 in connectors and walletconnect
guimroque Jan 7, 2026
24f5464
feat(social-connector): add social login connector via Privy
guimroque Jan 6, 2026
9384946
fix(social-connector): improve Privy signing with embedded wallet pro…
guimroque Jan 6, 2026
abd903e
chore(social-connector): update bakosafe to 0.6.0
guimroque Jan 7, 2026
87d923b
fix: pin next.js and wagmi versions to fix build compatibility
guimroque Jan 7, 2026
7fcc5d9
fix: add @privy-io/react-auth dependency to react-app example
guimroque Jan 7, 2026
a7b6521
fix: remove Google login option from Privy modal
guimroque Jan 7, 2026
719111c
feat: skip signature approval prompt for embedded wallet transactions
guimroque Jan 7, 2026
757ed02
fix: remove Google from Social Login options
guimroque Jan 7, 2026
42598aa
fix: add dependencies to useEffect to prevent infinite loop
guimroque Jan 7, 2026
56a668e
feat(social-connector): add headless email login with OTP flow
guimroque Jan 7, 2026
78a9c09
feat(social-connector): skip version selection and improve disconnect…
guimroque Jan 7, 2026
cba2305
feat(react): skip predicate address disclaimer for social connector
guimroque Jan 7, 2026
4851ee4
fix(social-connector): improve wallet detection and disconnect cleanup
guimroque Jan 7, 2026
f6dfac6
feat(social-connector): add manual embedded wallet creation for edge …
guimroque Jan 7, 2026
272c769
fix(social-connector): improve session handling for email switching
guimroque Jan 8, 2026
ad7f43e
refactor: remove redundant _configProviders delegation
guimroque Jan 12, 2026
5b80773
refactor: centralize getPredicateVersions in bako-predicate-connector
guimroque Jan 12, 2026
718a88e
refactor(social-connector): remove debug console.log statements
guimroque Jan 12, 2026
932b933
refactor(social-connector): remove redundant localStorage cleanup
guimroque Jan 12, 2026
7f27ecb
refactor(social-connector): extract waitFor helper to reduce duplication
guimroque Jan 12, 2026
4c5cf26
refactor: centralize configuration constants and disable socket client
guimroque Jan 12, 2026
00807fc
fix(social-connector): restore localStorage cleanup on disconnect
guimroque Jan 12, 2026
4d0cf14
fix(social-connector): improve connection persistence on page reload
guimroque Jan 12, 2026
2e70004
fix(social-connector): resolve autoconnect race condition on page reload
guimroque Jan 12, 2026
9b57fa1
feat(react): enable Social Login connector on mobile
guimroque Jan 12, 2026
153131e
fix:clear session state to enforce EVM signature on login
GabrielTozatti Jan 20, 2026
e928545
refactor: add privy generic types and zero-config to social login
pedroanastacio Jan 27, 2026
d000741
chore: remove unnecessary installed lib
pedroanastacio Jan 28, 2026
eb00edd
chore: adjust bako safe config urls
pedroanastacio Jan 28, 2026
60f2c93
Merge pull request #21 from infinitybase/tzt/fix/bako-predicate-conne…
pedroanastacio Jan 30, 2026
6a60fcf
fix(bako-predicate-connector): create vault with unique name
pedroanastacio Jan 30, 2026
2c7d232
fix(bako-predicate-connector): change pedicate name prefix and guaran…
pedroanastacio Feb 2, 2026
0b67415
refactor(bako-predicate-connector): changes default predicate constan…
pedroanastacio Feb 2, 2026
49622da
fix(bako-predicate-connector): creates predicate on bako api only if …
pedroanastacio Feb 2, 2026
1593e4e
fix(bako-predicate-connector): updates js docs with the correct patte…
pedroanastacio Feb 2, 2026
22998b7
fix(social-connector-tests): awaits disconnect to test listener
pedroanastacio Feb 2, 2026
428503c
fix(social-connector-tests): restore globals after tests
pedroanastacio Feb 2, 2026
4fd7375
fix(social-connector): fix fuel hooks provider render
pedroanastacio Feb 2, 2026
6f9a143
chore(social-connector): adds blank line
pedroanastacio Feb 2, 2026
f344246
refactor(social-connector): removes unnecessary validation
pedroanastacio Feb 2, 2026
220e4eb
fix(evm-connector): fix lint error
pedroanastacio Feb 2, 2026
6f1115a
refactor(fuels-react): changes privy events watcher file name
pedroanastacio Feb 3, 2026
0430e81
chore(fuels-react): remove unecessary js docs
pedroanastacio Feb 3, 2026
0d3ec8e
fix(social-connector): prevents to show actions disabled after discon…
pedroanastacio Feb 5, 2026
71e2be8
refactor(fuels-react): adds defensive check to fuel instead of connec…
pedroanastacio Feb 5, 2026
3abac0f
Merge pull request #22 from infinitybase/p2/refactor/simplify-social-…
pedroanastacio Feb 5, 2026
1867971
Merge pull request #23 from infinitybase/p2/fix/select-predicate-vers…
pedroanastacio Feb 5, 2026
88aa0c8
Merge pull request #24 from infinitybase/p2/fix/connect-button-state
pedroanastacio Feb 5, 2026
c62cc52
fix(fuels-react): hides login with email when social login is disabled
pedroanastacio Feb 5, 2026
b93ae67
Merge pull request #25 from infinitybase/p2/fix/hide-login-with-email…
pedroanastacio Feb 9, 2026
9eb007c
chore(docs): adds changeset
pedroanastacio Feb 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/bako-predicate-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@fuel-connectors/bako-predicate-connector": minor
"@fuel-connectors/walletconnect-connector": minor
---

feat: Add Bako predicate connector integration for EVM wallets

- Add new `@fuel-connectors/bako-predicate-connector` package that manages predicate versions and communicates with Bako servers
- Update `walletconnect-connector` to extend from the new bako predicate connector
- Enable EVM connector wallets to be accessed through the Bako interface
- Add backward compatibility support for legacy predicates
14 changes: 14 additions & 0 deletions .changeset/privy-provider-refactor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@fuels/react": minor
"@fuel-connectors/common": patch
---

refactor: Move Privy provider to @fuels/react package

- Add `PrivyInternalProvider` component for managing Privy app initialization and configuration
- Add `PrivyEventsWatcher` component for monitoring Privy authentication state changes
- Implement `PrivyAuthObserver` for subscribing to Privy login/logout events
- Add Privy type definitions and configuration constants to `@fuels/react`
- Export Privy types from `@fuel-connectors/common`: `PrivyAuthEventTypes` enum and `IPrivyAuthObserver` interface
- Simplify `FuelProvider` to conditionally render Privy providers based on `socialLogin` configuration
- Improve provider hierarchy and separation of concerns
13 changes: 13 additions & 0 deletions .changeset/social-connector-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@fuel-connectors/social-connector": minor
"@fuels/connectors": patch
"@fuels/react": minor
---

feat: Add social login connector via Privy

- Add new `@fuel-connectors/social-connector` package for social authentication (Google/Email) via Privy
- Extends `PredicateConnector` from `bako-predicate-connector` to leverage Bako Safe integration
- Export `SocialConnector` and types from `@fuels/connectors` bundle
- Move Privy provider configuration to `@fuels/react` package with `PrivyInternalProvider` and `PrivyEventsWatcher` utilities
- Add Privy as a peer dependency in `@fuels/react`
8 changes: 6 additions & 2 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,14 @@ jobs:
run: pnpm build:connectors

- name: Install Playwright Dependencies
run: pnpm dlx playwright@1.48.2 install-deps
run: |
pnpm dlx playwright@1.48.2 install-deps
pnpm dlx playwright@1.57.0 install-deps

- name: Install Chromium
run: pnpm dlx playwright@1.48.2 install chromium
run: |
pnpm dlx playwright@1.48.2 install chromium
pnpm dlx playwright@1.57.0 install chromium

- name: Build Synpress cache
run: xvfb-run pnpm setup:synpress
Expand Down
7 changes: 6 additions & 1 deletion Forc.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[[package]]
name = "core"
source = "path+from-root-6A8836696D55BC6E"

[[package]]
name = "counter"
source = "member"
Expand Down Expand Up @@ -29,7 +33,8 @@ dependencies = ["std"]

[[package]]
name = "std"
source = "git+https://github.com/fuellabs/sway?tag=v0.68.1#7e1bc152face6f1ae20b4274d98446100920e573"
source = "git+https://github.com/fuellabs/sway?tag=v0.66.5#94a066652468b4afa3bd396dacef482ed590976b"
dependencies = ["core"]

[[package]]
name = "sway_libs"
Expand Down
2 changes: 2 additions & 0 deletions e2e-tests/react-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev -p 3002",
"build": "next build",
"start": "next start"
},
"dependencies": {
Expand All @@ -18,6 +19,7 @@
"clsx": "2.1.1",
"connectkit": "1.8.2",
"next": "14.2.26",
"viem": "2.20.1",
"wagmi": "2.12.7"
},
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions e2e-tests/react-next/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import { defaultConnectors } from '@fuels/connectors';
import { FuelProvider } from '@fuels/react';
import { coinbaseWallet, walletConnect } from '@wagmi/connectors';
Expand All @@ -17,7 +18,10 @@ import COUNTER_CONTRACT_ID_TESTNET from 'react-app/src/types/contract-ids-testne
const CHAIN_ID_NAME = process.env
.NEXT_PUBLIC_CHAIN_ID_NAME as keyof typeof CHAIN_IDS.fuel;
const CHAIN_ID = CHAIN_IDS.fuel[CHAIN_ID_NAME] || 0;
const PROVIDER_URL = process.env.NEXT_PUBLIC_PROVIDER_URL;
// Use a fallback for build time when env vars are not available
const PROVIDER_URL =
process.env.NEXT_PUBLIC_PROVIDER_URL ||
'https://testnet.fuel.network/v1/graphql';

const CUSTOM_TRANSFER_AMOUNT = process.env.NEXT_PUBLIC_CUSTOM_TRANSFER_AMOUNT;
const FALLBACK_TRANSFER_AMOUNT =
Expand All @@ -30,10 +34,6 @@ const CUSTOM_ASSET_ID = process.env.NEXT_PUBLIC_CUSTOM_ASSET_ID ?? undefined;
const CUSTOM_ASSET_SYMBOL =
process.env.NEXT_PUBLIC_CUSTOM_ASSET_SYMBOL ?? 'ETH';

if (!PROVIDER_URL) {
throw new Error(`PROVIDER_URL is not set: ${PROVIDER_URL}`);
}

function getContractId() {
switch (CHAIN_ID_NAME) {
case 'mainnet':
Expand Down
8 changes: 7 additions & 1 deletion e2e-tests/react-next/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion e2e-tests/runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"start:react-next": "pnpm --filter @e2e-tests/react-next dev",
"start:servers": "pnpm run start:react-app & pnpm run start:react-next",
"deploy:contracts": "sh ./scripts/deployLocal.sh",
"deploy:contracts:ci": "sh ./scripts/deployCI.sh",
"deploy:contracts:ci": "bash ./scripts/deployCI.sh",
"setup:synpress": "synpress examples/synpress/metamask && synpress --phantom examples/synpress/phantom"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/runner/scripts/deployCI.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Get the directory where the script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

echo "Build contracts"
pnpm fuels build
Expand Down
32 changes: 17 additions & 15 deletions examples/react-app/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { counter as COUNTER_CONTRACT_ID_LOCAL } from './types/contract-ids-local.json';
import { counter as COUNTER_CONTRACT_ID_MAINNET } from './types/contract-ids-mainnet.json';
import { counter as COUNTER_CONTRACT_ID_TESTNET } from './types/contract-ids-testnet.json';

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
Expand Down Expand Up @@ -80,16 +77,6 @@ const NETWORKS: NetworkConfig[] = [
},
];

const FUEL_CONFIG: FuelConfig = {
connectors: defaultConnectors({
devMode: true,
wcProjectId: WC_PROJECT_ID,
ethWagmiConfig: wagmiConfig,
chainId: CHAIN_ID,
fuelProvider: new Provider(PROVIDER_URL),
}),
};

const config: Config = {
explorerUrl: EXPLORER_URL,
providerUrl: PROVIDER_URL,
Expand All @@ -100,10 +87,26 @@ const config: Config = {
assetSymbol: CUSTOM_ASSET_SYMBOL,
};

// Create fuel config with all connectors
const fuelConfig: FuelConfig = {
connectors: defaultConnectors({
devMode: true,
wcProjectId: WC_PROJECT_ID,
ethWagmiConfig: wagmiConfig,
chainId: CHAIN_ID,
fuelProvider: new Provider(PROVIDER_URL),
}),
};

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<FuelProvider theme="dark" networks={NETWORKS} fuelConfig={FUEL_CONFIG}>
<FuelProvider
theme="dark"
networks={NETWORKS}
fuelConfig={fuelConfig}
socialLogin
>
<ConfigProvider config={config}>
<Toast.Provider>
<App />
Expand All @@ -115,7 +118,6 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
</ConfigProvider>
<ScreenSizeIndicator />
</FuelProvider>

{isDev && <ReactQueryDevtools initialIsOpen={false} />}
</QueryClientProvider>
</React.StrictMode>,
Expand Down
7 changes: 6 additions & 1 deletion examples/react-next/src/components/FuelProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ export const FuelProviders = ({ children }: { children: React.ReactNode }) => {
>
Switch theme {theme}
</button>
<FuelProvider theme={theme} fuelConfig={FUEL_CONFIG} networks={NETWORKS}>
<FuelProvider
theme={theme}
fuelConfig={FUEL_CONFIG}
networks={NETWORKS}
socialLogin
>
{children}
</FuelProvider>
</>
Expand Down
8 changes: 7 additions & 1 deletion examples/react-next/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
},
"target": "ES2017"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": ["node_modules"]
}
19 changes: 17 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@
},
"packageManager": "pnpm@9.5.0",
"pnpm": {
"peerDependencyRules": {
"allowedVersions": {
"@wagmi/connectors": "5.1.7"
}
},
"overrides": {
"js-yaml@<3.14.2": "3.14.2",
"uglify-js@<2.6.0": ">=2.6.0",
"braces@<3.0.3": ">=3.0.3",
"ws@>=8.0.0 <8.17.1": ">=8.17.1",
"ws@>=7.0.0 <7.5.10": ">=7.5.10",
Expand All @@ -80,8 +87,16 @@
"@babel/runtime@<7.26.10": ">=7.26.10",
"@babel/helpers@<7.26.10": ">=7.26.10",
"image-size@<1.2.1": ">=1.2.1",
"vite@>=5.0.0 <5.4.18": ">=5.4.18",
"form-data@>=4.0.0 <4.0.4": ">=4.0.4"
"vite@>=5.0.0 <=5.4.20": "5.4.21",
"form-data@>=4.0.0 <4.0.4": ">=4.0.4",
"next@>=13.0.0 <14.2.35": "14.2.35",
"axios@>=1.0.0 <1.12.0": ">=1.12.0",
"glob@>=10.2.0 <10.5.0": ">=10.5.0",
"playwright@<1.55.1": ">=1.55.1",
"@metamask/sdk@>=0.16.0 <=0.33.0": ">=0.33.1",
"@metamask/sdk-communication-layer@>=0.16.0 <=0.33.0": ">=0.33.1",
"wagmi": "2.12.7",
"@wagmi/connectors": "5.1.7"
}
}
}
42 changes: 42 additions & 0 deletions packages/bako-predicate-connector/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "@fuel-connectors/bako-predicate-connector",
"version": "0.44.1",
"private": true,
"files": ["dist"],
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}
},
"scripts": {
"build": "tsup --dts",
"build:watch": "tsup --watch --dts",
"ts:check": "tsc --noEmit",
"test": "vitest"
},
"peerDependencies": {
"fuels": "0.102.0"
},
"dependencies": {
"@ethersproject/bytes": "5.7.0",
"@solana/web3.js": "1.93.2",
"bakosafe": "0.6.0",
"bs58": "6.0.0",
"memoizee": "0.4.15",
"socket.io-client": "4.7.2",
"tweetnacl": "1.0.3",
"viem": "2.20.1"
},
"devDependencies": {
"@types/memoizee": "0.4.11",
"terser": "5.31.0",
"tsup": "8.0.2",
"typescript": "5.4.5",
"vitest": "2.1.9"
}
}
68 changes: 68 additions & 0 deletions packages/bako-predicate-connector/src/FakeAccount.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { Keypair } from '@solana/web3.js';
import nacl from 'tweetnacl';
import { type PrivateKeyAccount, privateKeyToAccount } from 'viem/accounts';
import type { Hash, Option } from './types';

export interface FakeAccount {
generate: () => void;
getAddress: () => Option<string, Hash>;
getRawAddress: () => Uint8Array;
signMessage: (
message: Option<string, Uint8Array, Hash>,
) => Promise<Option<string, Uint8Array, Hash>>;
}

export class EthereumFakeAccount implements FakeAccount {
private account!: PrivateKeyAccount;
constructor() {
this.generate();
}

generate = (): void => {
this.account = privateKeyToAccount(
'0x0000000000000000000000000000000000000000000000000000000000000001',
);
};

getAddress = (): Option<string, Hash> => this.account.address;
getRawAddress = (): Uint8Array =>
Buffer.from(this.account.address.slice(2), 'hex');

signMessage = (
message: Option<string, Uint8Array, Hash>,
): Promise<Option<string, Uint8Array, Hash>> => {
return this.account.signMessage({
message: message as string,
});
};
}

export class SolanaFakeAccount implements FakeAccount {
private keypair!: Keypair;
constructor() {
this.generate();
}

generate = (): void => {
this.keypair = Keypair.generate();
};

getAddress = (): Option<string, Hash> => this.keypair.publicKey.toString();
getRawAddress = (): Uint8Array => this.keypair.publicKey.toBytes();

private getSmallTxId = (
message: Option<string, Uint8Array, Hash>,
): Uint8Array => {
const txIdNo0x = message.slice(2);
const idBytes = `${txIdNo0x.slice(0, 16)}${txIdNo0x.slice(-16)}`;
return new TextEncoder().encode(idBytes);
};

signMessage = (
message: Option<string, Uint8Array, Hash>,
): Promise<Option<string, Uint8Array, Hash>> => {
return Promise.resolve(
nacl.sign.detached(this.getSmallTxId(message), this.keypair.secretKey),
);
};
}
Loading