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

feat: connection modal improvements #277

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
951921e
feat: add request validation
luizstacio Sep 22, 2024
ea70c25
chore: add changesetts
luizstacio Sep 22, 2024
055811c
feat: add connecting screen
luizstacio Sep 22, 2024
85b0b46
chore: update fuels
arthurgeron Sep 22, 2024
59386bf
feat: mark connectors as external or native
arthurgeron Sep 22, 2024
42f5d09
feat: add error and installed dialog states
arthurgeron Sep 23, 2024
5044224
feat: control install connection error and installed flows clearly
arthurgeron Sep 23, 2024
f703570
refactor: centralize connector dialog routes in a single ocmponent
arthurgeron Sep 23, 2024
34ef1a7
chore: changeset
arthurgeron Sep 23, 2024
0807768
feat: only succeed when detected as installed
arthurgeron Sep 23, 2024
f132bcb
feat: dialog succeed on installed
arthurgeron Sep 23, 2024
67c1cec
feat: clear error state when selecting a new connector
arthurgeron Sep 23, 2024
f75136b
revert: fuel ui provider property rename
arthurgeron Sep 23, 2024
cf70548
feat: clear error when going back
arthurgeron Sep 23, 2024
8e427a5
feat: handle error and connecting states gracefully
arthurgeron Sep 23, 2024
7c1ab9e
fix: trying install while already installed
arthurgeron Sep 23, 2024
387fd3d
feat: connect after install
arthurgeron Sep 23, 2024
1e17bb5
fix: install page not opening
arthurgeron Sep 23, 2024
f927bfc
feat: close on external connector
arthurgeron Sep 23, 2024
d82fef6
feat: improve strings and messages
arthurgeron Sep 23, 2024
9844571
feat: display error messages
arthurgeron Sep 23, 2024
b0caf8a
feat: add helper message
arthurgeron Sep 23, 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
17 changes: 17 additions & 0 deletions .changeset/poor-ravens-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@fuel-connectors/burner-wallet-connector": patch
"@fuel-connectors/fuel-development-wallet": patch
"@fuel-connectors/walletconnect-connector": patch
"@fuel-connectors/solana-connector": patch
"@fuel-connectors/evm-predicates": patch
"@fuel-connectors/evm-connector": patch
"@fuel-connectors/fuelet-wallet": patch
"@fuel-connectors/fuel-wallet": patch
"@fuels/connectors": patch
"@fuel-connectors/bako-safe": patch
"@fuel-connectors/common": patch
"@fuels/react": patch
"docs": patch
---

Updated Fuel SDK
5 changes: 5 additions & 0 deletions .changeset/strange-horses-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-connectors/walletconnect-connector": minor
---

Request message signature to validate access before connecting to applications
6 changes: 6 additions & 0 deletions .changeset/swift-socks-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@fuel-connectors/fuel-development-wallet": patch
"@fuel-connectors/fuel-wallet": patch
---

Restart JSONRPC client before ping when not installed
5 changes: 5 additions & 0 deletions .changeset/tender-dolphins-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuels/react": minor
---

Connection modal improvements
3 changes: 3 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
},
"complexity": {
"noForEach": "off"
},
"suspicious": {
"noAsyncPromiseExecutor": "off"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@playwright/test": "1.46.1",
"@types/node": "20.12.11",
"dotenv": "16.4.5",
"fuels": "0.93.0"
"fuels": "pr-3201"
},
"engines": {
"node": ">=18",
Expand Down
2 changes: 1 addition & 1 deletion examples/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@wagmi/connectors": "5.1.7",
"@wagmi/core": "2.13.4",
"clsx": "2.1.1",
"fuels": "0.94.6",
"fuels": "pr-3201",
"react": "18.3.1",
"react-dom": "18.3.1"
},
Expand Down
6 changes: 3 additions & 3 deletions examples/react-app/src/components/balance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ const BalanceSkeleton = () => (
);

export default function Balance({ isSigning }: Props) {
const { refetchWallet, balance, address } = useWallet();
const { refetchBalance, balance, address } = useWallet();

useEffect(() => {
const interval = setInterval(() => refetchWallet(), 5000);
const interval = setInterval(() => refetchBalance(), 5000);
return () => clearInterval(interval);
}, [refetchWallet]);
}, [refetchBalance]);

return (
<Feature title="Balance">
Expand Down
1 change: 1 addition & 0 deletions examples/react-app/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<FuelProvider
ui={true}
theme="dark"
fuelConfig={{
connectors: defaultConnectors({
Expand Down
2 changes: 1 addition & 1 deletion examples/react-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@fuels/react": "workspace:*",
"@tanstack/react-query": "5.35.1",
"@wagmi/connectors": "5.1.7",
"fuels": "0.94.6",
"fuels": "pr-3201",
"next": "14.2.3",
"react": "18.3.1",
"react-dom": "18.3.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/bako-safe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"socket.io-client": "4.7.2"
},
"peerDependencies": {
"fuels": ">=0.94.6",
"fuels": ">=pr-3201",
"socket.io-client": "4.7.2"
},
"devDependencies": {
"fuels": "0.94.6",
"fuels": "pr-3201",
"tsup": "8.0.2",
"typescript": "5.4.2",
"undici": "6.9.0"
Expand Down
1 change: 1 addition & 0 deletions packages/bako-safe/src/BakoSafeConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class BakoSafeConnector extends FuelConnector {
};
installed = true;
connected = false;
external = false;

events = {
...BakoSafeConnectorEvents,
Expand Down
4 changes: 2 additions & 2 deletions packages/burner-wallet-connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"test": "vitest"
},
"peerDependencies": {
"fuels": ">=0.94.6"
"fuels": ">=pr-3201"
},
"devDependencies": {
"fuels": "0.94.6",
"fuels": "pr-3201",
"jsdom": "24.0.0",
"tsup": "8.0.2",
"typescript": "5.4.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class BurnerWalletConnector extends FuelConnector {

connected = false;
installed = true;
external = false;

events = FuelConnectorEventTypes;

Expand Down
4 changes: 2 additions & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"test": "vitest"
},
"peerDependencies": {
"fuels": ">=0.94.6"
"fuels": ">=pr-3201"
},
"dependencies": {
"@ethersproject/bytes": "5.7.0",
Expand All @@ -37,7 +37,7 @@
},
"devDependencies": {
"@types/memoizee": "0.4.11",
"fuels": "0.94.6",
"fuels": "pr-3201",
"terser": "5.31.0",
"tsup": "8.0.2",
"typescript": "5.4.5",
Expand Down
3 changes: 1 addition & 2 deletions packages/common/src/PredicateConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ import {
FuelConnectorEventTypes,
type JsonAbi,
type Network,
OutputType,
type SelectNetworkArguments,
type TransactionRequestLike,
TransactionResponse,
type Version,
ZeroBytes32,
bn,
Expand All @@ -35,6 +33,7 @@ import type {
export abstract class PredicateConnector extends FuelConnector {
public connected = false;
public installed = false;
external = true;
public events = FuelConnectorEventTypes;
protected predicateAddress!: string;
protected customPredicate: Maybe<PredicateConfig>;
Expand Down
4 changes: 2 additions & 2 deletions packages/connectors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ts:check": "tsc --noEmit"
},
"peerDependencies": {
"fuels": ">=0.94.6"
"fuels": ">=pr-3201"
},
"dependencies": {
"@ethereumjs/util": "9.0.3",
Expand All @@ -42,7 +42,7 @@
"@fuel-connectors/fuelet-wallet": "workspace:*",
"@fuel-connectors/solana-connector": "workspace:*",
"@fuel-connectors/walletconnect-connector": "workspace:*",
"fuels": "0.94.6",
"fuels": "pr-3201",
"terser": "5.31.0",
"tsup": "8.0.2",
"typescript": "5.4.5"
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dependencies": {
"@fuel-ts/errors": "0.93.0",
"@fuel-ts/versions": "0.93.0",
"fuels": "0.94.6",
"fuels": "pr-3201",
"typedoc-plugin-markdown": "^3.15.3"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/evm-connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"test": "vitest"
},
"peerDependencies": {
"fuels": ">=0.94.6"
"fuels": ">=pr-3201"
},
"dependencies": {
"@ethereumjs/util": "9.0.3",
Expand All @@ -31,7 +31,7 @@
"@fuel-connectors/common": "workspace:*",
"@fuel-connectors/evm-predicates": "workspace:*",
"@types/memoizee": "0.4.11",
"fuels": "0.94.6",
"fuels": "pr-3201",
"jsdom": "24.0.0",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",
Expand Down
5 changes: 5 additions & 0 deletions packages/evm-connector/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ export interface EIP1193Provider extends EventEmitter {
params?: unknown[];
}): Promise<unknown | unknown[]>;
}

export interface SignatureData {
message: string;
signature: string;
}
4 changes: 2 additions & 2 deletions packages/evm-predicates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"ts:check": "tsc --noEmit"
},
"peerDependencies": {
"fuels": ">=0.94.0"
"fuels": ">=pr-3201"
},
"devDependencies": {
"@fuel-connectors/common": "workspace:*",
"fuels": "0.94.4",
"fuels": "pr-3201",
"tsx": "4.9.3",
"typescript": "5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/fuel-development-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"test": "vitest"
},
"peerDependencies": {
"fuels": ">=0.94.6"
"fuels": ">=pr-3201"
},
"devDependencies": {
"@fuel-connectors/fuel-wallet": "workspace:*",
"fuels": "0.94.6",
"fuels": "pr-3201",
"tsup": "8.0.2",
"typescript": "5.4.5",
"undici": "6.16.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/fuel-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"test": "vitest"
},
"peerDependencies": {
"fuels": ">=0.94.6"
"fuels": ">=pr-3201"
},
"dependencies": {
"json-rpc-2.0": "1.7.0"
},
"devDependencies": {
"events": "3.3.0",
"fuels": "0.94.6",
"fuels": "pr-3201",
"tsup": "8.0.2",
"typescript": "5.4.5",
"undici": "6.16.0",
Expand Down
1 change: 1 addition & 0 deletions packages/fuel-wallet/src/FuelWalletConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class FuelWalletConnector extends FuelConnector {
name = '';
connected = false;
installed = false;
external = false;
events = FuelConnectorEventTypes;
metadata: ConnectorMetadata = {
image: '/connectors/fuel-wallet.svg',
Expand Down
4 changes: 2 additions & 2 deletions packages/fuelet-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"test": "vitest"
},
"peerDependencies": {
"fuels": ">=0.94.6"
"fuels": ">=pr-3201"
},
"devDependencies": {
"@fuel-connectors/fuel-wallet": "workspace:*",
"fuels": "0.94.6",
"fuels": "pr-3201",
"tsup": "8.0.2",
"typescript": "5.4.5",
"undici": "6.16.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"peerDependencies": {
"@tanstack/react-query": ">=5.0.0",
"fuels": ">=0.94.6",
"fuels": ">=pr-3201",
"react": ">=18.0.0"
},
"dependencies": {
Expand All @@ -38,7 +38,7 @@
"@tanstack/react-query": "5.35.1",
"@types/react": "18.3.1",
"compare-versions": "6.1.0",
"fuels": "0.94.6",
"fuels": "pr-3201",
"react": "18.3.1",
"styled-components": "6.1.12",
"tsup": "7.3.0",
Expand Down
Loading
Loading