Skip to content

Commit ebea693

Browse files
nachoiacovinoarcoravenjnsdls
authored
Add engine dashboard (#1815)
* feat: Add Engine tab to dashboard * A lot of stuff? Config done * Backend wallets table * Add import/create backend wallet capabilities * Update margin * Filter txns by chain id * Add balance check * Fix build * Add functions * Only show remove config if not on local * whoops * Add tracking for set wallet config * Try again * Update schema for txns * Update design, save URL in local storage * Add trailing slash always * Always simplify url * Auth works * Add admin grant/revoke * Reshuffle stuff * Add access tokens capabilities * Add webhooks capabilities * General updates * Add local config * Renaming and moving stuff around * Hide tab --------- Co-authored-by: Phillip Ho <[email protected]> Co-authored-by: Jonas Daniels <[email protected]>
1 parent 2af15ef commit ebea693

33 files changed

+4504
-364
lines changed

@3rdweb-sdk/react/cache-keys.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,28 @@ export const embeddedWalletsKeys = {
4444
[...embeddedWalletsKeys.wallet(walletAddress), clientId] as const,
4545
};
4646

47+
export const engineKeys = {
48+
all: ["engine"] as const,
49+
backendWallets: (instance: string) =>
50+
[...engineKeys.all, instance, "backendWallets"] as const,
51+
transactions: (instance: string) =>
52+
[...engineKeys.all, instance, "transactions"] as const,
53+
permissions: (instance: string) =>
54+
[...engineKeys.all, instance, "permissions"] as const,
55+
accessTokens: (instance: string) =>
56+
[...engineKeys.all, instance, "accessTokens"] as const,
57+
webhooks: (instance: string) =>
58+
[...engineKeys.all, instance, "webhooks"] as const,
59+
webhookEventTypes: (instance: string) =>
60+
[...engineKeys.all, instance, "webhookEventTypes"] as const,
61+
walletConfig: (instance: string) =>
62+
[...engineKeys.all, instance, "walletConfig"] as const,
63+
backendWallet: (address: string, chainId: number) =>
64+
["backendWallet", address, chainId] as const,
65+
backendWalletBalance: (address: string, chainId: number) =>
66+
[...engineKeys.backendWallet(address, chainId), "balance"] as const,
67+
};
68+
4769
export const contractKeys = {
4870
all: ["contract"] as const,
4971
lists: () => [...contractKeys.all, "list"] as const,

@3rdweb-sdk/react/components/connect-wallet/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ export const CustomConnectWallet: React.FC<ConnectWalletProps> = ({ auth }) => {
2727

2828
return (
2929
<ConnectWallet
30-
auth={auth}
30+
auth={{
31+
onLogin(token) {
32+
localStorage.setItem("engine-auth", token);
33+
},
34+
onLogout() {
35+
localStorage.removeItem("engine-auth");
36+
},
37+
...auth,
38+
}}
3139
theme={colorMode}
3240
welcomeScreen={() => {
3341
return <ConnectWalletWelcomeScreen theme={colorMode} />;

0 commit comments

Comments
 (0)