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

New Solana Provider using secure-background/client for web & xnfts #4213

Merged
merged 53 commits into from
Jun 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
01e8ca2
add madlads.com to wl
ph101pp May 29, 2023
ad21075
restructure secure-background
ph101pp May 31, 2023
de7d81a
Fully typed Client-Server requests
ph101pp Jun 1, 2023
6031406
setup secure background channels
ph101pp Jun 2, 2023
3feef39
End to end working message signing through new client and secure-back…
ph101pp Jun 2, 2023
e7bf3f4
Working Content->background->UI->background->Content message passing
ph101pp Jun 3, 2023
3f66501
Merge branch 'master' into philipp/secure-background-core
ph101pp Jun 3, 2023
628783f
Split secure-background & secure-client
ph101pp Jun 5, 2023
43e5777
secure-background/clients exports
ph101pp Jun 5, 2023
f3a2067
Merge branch 'master' into philipp/secure-background-core
ph101pp Jun 12, 2023
b39e392
Clarify Transport From/To naming + correctly close Popup after openin…
ph101pp Jun 12, 2023
9db8ad6
Add ExtensionTransports and solidify Error handling
ph101pp Jun 12, 2023
52bc4e9
UnlockKeyring event + new extension message passing
ph101pp Jun 13, 2023
58f0627
Combine SecureUI and SecureBackground events + add transports to recoil
ph101pp Jun 14, 2023
130e5e0
fix build:fresh
ph101pp Jun 14, 2023
012469b
Merge branch 'master' into philipp/secure-background-core
ph101pp Jun 14, 2023
2c3899b
Add secure-client to dockerfiles
ph101pp Jun 14, 2023
c568de2
Add request.origin
ph101pp Jun 14, 2023
fba97dc
Add tamagui to secure-client & fix circular dependencies
ph101pp Jun 14, 2023
1211ec8
fix devmode transport issues
ph101pp Jun 14, 2023
020b803
Working confirmation prompt
ph101pp Jun 14, 2023
c454070
Merge branch 'master' into philipp/secure-background-core
ph101pp Jun 14, 2023
0fa5d19
Create RequestResponder
ph101pp Jun 14, 2023
ceb43e6
e2e solana signMessage w/o unlock & approve origin
ph101pp Jun 15, 2023
6c8dd99
SecureStore refactor
ph101pp Jun 15, 2023
1cfaae7
Merge branch 'master' into philipp/secure-background-core
ph101pp Jun 15, 2023
667e604
Remove secure-client import from solana provider for merge
ph101pp Jun 15, 2023
f583a4b
Lock down deprecated and private methods in SecureStore
ph101pp Jun 15, 2023
a3a1828
Clean up KeyringStoreState enum and move it to secure-background/types
ph101pp Jun 16, 2023
da8c40d
Merge branch 'master' into philipp/secure-background-core-rebased
ph101pp Jun 16, 2023
f2eb471
Lock down deprecated and private methods in SecureStore
ph101pp Jun 15, 2023
74a62ac
Clean up KeyringStoreState enum and move it to secure-background/types
ph101pp Jun 16, 2023
814cd95
Fetch user data from secureUI
ph101pp Jun 16, 2023
7ee9262
move origin from clients to transport.
ph101pp Jun 16, 2023
03f078a
Setup SecureUI request subscription & queue
ph101pp Jun 16, 2023
6d4757f
Fix import issue.
ph101pp Jun 18, 2023
3743f79
cleanup
ph101pp Jun 18, 2023
9c0494f
animation improvement
ph101pp Jun 19, 2023
470cbb3
Sign Message request with forced unlock
ph101pp Jun 20, 2023
4ccf122
Solana provider connect
ph101pp Jun 21, 2023
d9846b5
Approve Origin Request
ph101pp Jun 21, 2023
971eaa5
Add solana disconnect
ph101pp Jun 21, 2023
3b6e71e
solana send & sendAndConfirm transaction
ph101pp Jun 22, 2023
e5a9bf7
Fix xnft connection -> use "enhanced" background connection
ph101pp Jun 22, 2023
c7400a2
Emit keyring unlocked event
ph101pp Jun 22, 2023
fa3febb
Use default Connection for backend/solana-connect and properly reset …
ph101pp Jun 22, 2023
fcbce99
Solana SignAllTransactions
ph101pp Jun 22, 2023
ad3b594
new NotificationsClient
ph101pp Jun 22, 2023
fbf638e
Cleanup and logging
ph101pp Jun 22, 2023
5654918
Merge branch 'master' into philipp/secure-background-ui
ph101pp Jun 22, 2023
339afe1
separate extension & secureUI origins
ph101pp Jun 22, 2023
a88f75d
Cleanup + disable new provider
ph101pp Jun 22, 2023
c055135
remove console.log
ph101pp Jun 22, 2023
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
Prev Previous commit
Next Next commit
Use default Connection for backend/solana-connect and properly reset …
…onUnlock
  • Loading branch information
ph101pp committed Jun 22, 2023
commit fa3febb23e400db96256dcc4f1b8c1ab55e4260c
7 changes: 6 additions & 1 deletion packages/background/src/backend/solana-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
Blockchain,
confirmTransaction,
customSplTokenAccounts,
DEFAULT_SOLANA_CLUSTER,
fetchSplMetadataUri,
getLogger,
NOTIFICATION_BLOCKCHAIN_KEYRING_CREATED,
Expand Down Expand Up @@ -110,9 +111,12 @@ export function start(events: EventEmitter): SolanaConnectionBackend {
return b;
}

const defaultSolanaUrl =
process.env.DEFAULT_SOLANA_CONNECTION_URL || DEFAULT_SOLANA_CLUSTER;

export class SolanaConnectionBackend {
private cache = new Map<string, CachedValue<any>>();
private connection?: Connection;
private connection?: Connection = new Connection(defaultSolanaUrl);
private url?: string;
private pollIntervals: Array<any>;
private events: EventEmitter;
Expand Down Expand Up @@ -184,6 +188,7 @@ export class SolanaConnectionBackend {
};

const handleKeyringStoreLocked = (_notif: Notification) => {
this.connection = new Connection(defaultSolanaUrl);
this.stopPolling();
};

Expand Down