Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Solana and WalletConnect Web3Modal conflicts #164

Merged
merged 27 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
644fe99
feat: get evm address from a wallet connect connector instance
arthurgeron Jul 18, 2024
e7a27c7
chore: improve clarity in changeset
arthurgeron Jul 18, 2024
e9d7b7e
Merge branch 'main' into ag/feat/wallet-connect-predicate-to-account-…
arthurgeron Jul 19, 2024
b26d25c
chore: update changeset patch instruction
arthurgeron Jul 19, 2024
50e689d
chore: update wording in changeset
arthurgeron Jul 19, 2024
bc0a18d
chore: release pr tag
arthurgeron Jul 19, 2024
09745db
feat: update wagmi and wagmi connectors
arthurgeron Jul 19, 2024
eb23b2a
chore: make currentEvmAccount synchronous
arthurgeron Jul 22, 2024
69c7fba
feat: static instance of web3modal config
arthurgeron Jul 23, 2024
d7372dc
refactor: web3modal to be instantiated only once for both solana and …
arthurgeron Jul 23, 2024
78610e9
feat: enforce predicate initialization
arthurgeron Jul 23, 2024
be9fb32
feat: enforce provider defined during ping on Solana Connector
arthurgeron Jul 24, 2024
a4363d2
chore: generate new test release
arthurgeron Jul 24, 2024
416c423
fix: create solana web3modal dynamically
arthurgeron Jul 25, 2024
4fce9e3
feat: reinstantiate web3modal on wallet connect
arthurgeron Jul 25, 2024
612a79c
fix: referencing wrong wagmi config instance
arthurgeron Jul 25, 2024
638ec30
fix: solana connector parsing evm address from wallet connect
arthurgeron Jul 25, 2024
4591a26
feat: ensure correct web3 state is applied to current modal
arthurgeron Jul 25, 2024
7db678a
chore: update changeset
arthurgeron Jul 25, 2024
31d3c5c
chore: disable test release
arthurgeron Jul 25, 2024
ba9789e
feat: close web3modal if connection already active
arthurgeron Jul 25, 2024
5cdaaee
chore: enable test release
arthurgeron Jul 25, 2024
ccb958d
chore: disable test release
arthurgeron Jul 25, 2024
ae2d2c7
feat: connect to persisted connection asap
arthurgeron Jul 25, 2024
1c47832
chore: enable test release
arthurgeron Jul 25, 2024
aabaafe
chore: disable test release
arthurgeron Jul 25, 2024
4682a43
chore: update changeset
arthurgeron Jul 26, 2024
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
7 changes: 7 additions & 0 deletions .changeset/eight-bears-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@fuel-connectors/walletconnect-connector": patch
---

Wallet Connect Connector will inherently return a predicate address, instead of the actual account, due to the bridge it does between networks.
Added a method to retrieve the actual account address that originated the predicate, allowing validation of whether a predicate originated from a specific EVM address.
arthurgeron marked this conversation as resolved.
Show resolved Hide resolved

5 changes: 5 additions & 0 deletions .changeset/fuel-labs-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuels/connectors": patch
---

incremental
arthurgeron marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ export class WalletConnectConnector extends FuelConnector {
});
}

async currentEvmAccount(): Promise<string | null> {
if (!(await this.isConnected())) {
throw Error('No connected accounts');
}
const ethAccount = getAccount(this.wagmiConfig).address || null;

return ethAccount;
}

async setupPredicate(): Promise<PredicateAccount> {
if (this.customPredicate?.abi && this.customPredicate?.bytecode) {
this.predicateAccount = new PredicateAccount(this.customPredicate);
Expand Down
Loading