-
Notifications
You must be signed in to change notification settings - Fork 50
feat: Validate signatures in Solana connector #502
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
39cc082
feat: enhance SolanaConnector with signature validation and local sto…
nelitow 1afd433
refactor: streamline signature validation process in SolanaConnector
nelitow 39fa3c1
refactor: streamline signature validation process in SolanaConnector
nelitow 0f19445
Merge branch 'nj/feat/presign-on-solana' of https://github.com/FuelLa…
nelitow 5d98780
Create polite-foxes-wonder.md
nelitow d021348
Revert "Create polite-foxes-wonder.md"
nelitow 160de04
Reapply "Create polite-foxes-wonder.md"
nelitow a3c23b3
refactor: enhance signature validation in SolanaConnector
nelitow 3f07a5c
fix: improve signature verification in SolanaConnector
nelitow d90ec5f
feat: implement direct signature validation in SolanaConnector
nelitow 13d0706
chore: update package dependencies in package.json and pnpm-lock.yaml
nelitow e024648
Merge branch 'main' into nj/feat/presign-on-solana
nelitow 49db893
audit: large fixes
nelitow 8c47148
audit
nelitow 15a1da0
Update polite-foxes-wonder.md
nelitow 30988ac
Merge branch 'main' into nj/feat/presign-on-solana
nelitow e470da0
pnpm lock
nelitow 013dce3
chore: downgrade fuels package version to 0.100.0 across multiple pac…
nelitow e20926b
use package from main
nelitow d0a587a
Merge branch 'main' into nj/feat/presign-on-solana
nelitow 2bd5e6e
feat: Add SignatureError component and update routing for error handling
nelitow e05591d
refactor: Standardize import statements and update type definition in…
nelitow baf8721
chore: Remove jsdom test environment configuration from Vite config f…
nelitow d31a4c6
Revert "chore: Remove jsdom test environment configuration from Vite …
nelitow 64f9fcf
revert
nelitow 8cd44c9
refactor: Update CopyIcon component to use camelCase for SVG attributes
nelitow b512fe7
feat: Enhance SolanaConnector with signature validation and connectio…
nelitow e43294d
chore: clean pr
nelitow 60aaeb1
refactor: Simplify signature validation logic in SolanaConnector
nelitow bb2c238
fix: Add delay before creating web3Modal to improve connection reliab…
nelitow 7c5d2cf
fix: Remove unnecessary delay in web3Modal connection process
nelitow 8ca85e5
chore
LuizAsFight File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,5 @@ | ||
--- | ||
"@fuel-connectors/solana-connector": minor | ||
--- | ||
|
||
feat: Added signature validation for the Solana Connector. |
This file contains hidden or 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 hidden or 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,24 @@ | ||
import type { SvgIconProps } from '../types'; | ||
|
||
export function ErrorIcon({ size = 24, theme = 'light' }: SvgIconProps) { | ||
const color = theme === 'light' ? '#f25a68' : '#ff6b7a'; | ||
|
||
return ( | ||
<svg | ||
width={size} | ||
height={size} | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
aria-label="Error Icon" | ||
role="img" | ||
> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM11 17V15H13V17H11ZM11 7V13H13V7H11Z" | ||
fill={color} | ||
/> | ||
</svg> | ||
); | ||
} |
This file contains hidden or 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 hidden or 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
65 changes: 65 additions & 0 deletions
65
packages/react/src/ui/Connect/components/SignatureError/SignatureError.tsx
This file contains hidden or 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,65 @@ | ||
import * as Dialog from '@radix-ui/react-dialog'; | ||
import { ErrorIcon } from '../../../../icons/ErrorIcon'; | ||
import { useConnectUI } from '../../../../providers/FuelUIProvider'; | ||
import { | ||
BackIcon, | ||
CloseIcon, | ||
DialogHeader, | ||
DialogMain, | ||
DialogTitle, | ||
Divider, | ||
} from '../../styles'; | ||
import { | ||
ConnectorButton, | ||
ConnectorButtonPrimary, | ||
ConnectorContent, | ||
ConnectorDescription, | ||
ConnectorImage, | ||
ConnectorTitle, | ||
} from '../Connector/styles'; | ||
import { DialogContent } from '../Core/DialogContent'; | ||
import { DialogFuel } from '../Core/DialogFuel'; | ||
|
||
type SignatureErrorProps = { | ||
theme: 'dark' | 'light'; | ||
}; | ||
|
||
export function SignatureError({ theme }: SignatureErrorProps) { | ||
const { cancel } = useConnectUI(); | ||
|
||
return ( | ||
<DialogFuel open={true} theme={theme} onOpenChange={() => cancel()}> | ||
<DialogContent data-connector={true}> | ||
<DialogHeader> | ||
<BackIcon size={32} data-connector={false} /> | ||
<DialogTitle>Signature Error</DialogTitle> | ||
<Dialog.Close asChild> | ||
<CloseIcon size={32} onClick={() => cancel()} /> | ||
</Dialog.Close> | ||
</DialogHeader> | ||
<Divider /> | ||
<DialogMain> | ||
<div> | ||
<ConnectorImage> | ||
<ErrorIcon size={100} theme={theme} /> | ||
</ConnectorImage> | ||
<ConnectorContent> | ||
<ConnectorTitle>Failed to Sign Message</ConnectorTitle> | ||
<ConnectorDescription> | ||
If you are using a Ledger device, please check the | ||
troubleshooting guide below. | ||
</ConnectorDescription> | ||
</ConnectorContent> | ||
<ConnectorButtonPrimary | ||
href="https://docs.fuel.network/guides/fuel-connectors/solana-ledger-connection" | ||
target="_blank" | ||
> | ||
View Troubleshooting Guide | ||
</ConnectorButtonPrimary> | ||
<ConnectorButton onClick={() => cancel()}>Close</ConnectorButton> | ||
</div> | ||
</DialogMain> | ||
</DialogContent> | ||
</DialogFuel> | ||
); | ||
} |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.