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

[GSW-2040] social login wallet #599

Open
wants to merge 90 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
ed18378
chore: [GSW-2040] Install @adena-wallet/sdk for social-login-provider
tfrg Dec 27, 2024
3f6ce6d
feat: [GSW-2040] SocialWallet Login drafts
tfrg Dec 27, 2024
98fedb3
feat: [GSW-2040] WalletConnectModal UI
tfrg Dec 28, 2024
c29423b
feat: [GSW-2040] SocialWalletClient
tfrg Dec 29, 2024
4fd7689
feat: [GSW-2040] Social Wallet account link
tfrg Dec 30, 2024
5c12650
feat: [GSW-2040] Initialising WalletClient
tfrg Dec 31, 2024
adfa37d
feat: [GSW-2040] Email Validation UI
tfrg Jan 5, 2025
756b7ec
feat: [GSW-2040] Add UI (WalletConnect)
tfrg Jan 5, 2025
12a9810
feat: [GSW-2040] Connecting Modal
tfrg Jan 5, 2025
fd6f81f
feat: [GSW-2040] Conditional rendering socialwallet info
tfrg Jan 5, 2025
64c132e
fix: [GSW-2040] Refreshing causes wallet-client to be initialized
tfrg Jan 5, 2025
3b35119
feat: [GSW-2040] Approve Transaction Modal
tfrg Jan 8, 2025
3ecb3e6
test: [GSW-2040] Update Test Code
tfrg Jan 8, 2025
e94f8c4
feat: [GSW-2040] Improve ApproveTransaction Modal
tfrg Jan 8, 2025
367d323
fix: [GSW-2040] SocialWallet Default Chain RPC URL, WalletClient han…
tfrg Jan 10, 2025
76bad0f
feat: [GSW-2040] No Account handling
tfrg Jan 10, 2025
b49410e
chore: Update version @adena-wallet/sdk
tfrg Jan 10, 2025
3390784
feat: [GSW-2040] Google Client
tfrg Jan 10, 2025
3ff925c
feat: [GSW-2040] SendTransaction
tfrg Jan 11, 2025
08bf689
feat: [GSW-2040] Validate email entry forms
tfrg Jan 11, 2025
ccfc3a7
feat: [GSW-2040] SendTransaction
tfrg Jan 11, 2025
1c96944
feat: [GSW-2040] Open ApproveTransactionModal (Social_Wallet)
tfrg Jan 12, 2025
fb5d2fd
fix: [GSW-2040] Improve UX logic (transaction-send-process)
tfrg Jan 12, 2025
e540714
refactor: [GSW-2040] Improve code architecture
tfrg Jan 12, 2025
e953ef9
feat: [GSW-2040] Transaction Message
tfrg Jan 13, 2025
367f852
feat: [GSW-2040] Apply a higher-order function to all transactions
tfrg Jan 13, 2025
c86a0b0
fix: [GSW-2040] Resolve provider persistence
tfrg Jan 13, 2025
f213e32
fix: [GSW-2040] Handling wallet state synchronization on page refresh
tfrg Jan 14, 2025
ba5abfa
fix: [GSW-2040] Implement wallet auto-reconnection mechanism
tfrg Jan 14, 2025
460bc25
feat: [GSW-2040] Update ApproveTransactionModal function signature
tfrg Jan 15, 2025
06f87db
refactor: [GSW-2040] Transaction Utils
tfrg Jan 15, 2025
506967e
refactor: [GSW-2040] Transaction EventBus
tfrg Jan 15, 2025
dbf5657
refactor: [GSW-2040] Improve naming consistency for transaction-related
tfrg Jan 15, 2025
0817253
feat: [GSW-2040] Update TxApprovalModal Data
tfrg Jan 15, 2025
eb375b7
feat: [GSW-2040] memo handling
tfrg Jan 15, 2025
612698a
feat: [GSW-2040] Ability to update memo in transaction messages
tfrg Jan 16, 2025
32cadd2
feat: [GSW-2040] Bring memo update functionality to all transactional…
tfrg Jan 16, 2025
e999efa
refactor: [GSW-2040] Type stability (createDocument)
tfrg Jan 16, 2025
7c3517d
feat: [GSW-2040] Modal after social login
tfrg Jan 16, 2025
8f1fa60
fix: [GSW-2040] Dark/Light mode color
tfrg Jan 16, 2025
45224eb
fix: [GSW-2040] Mobile UI
tfrg Jan 16, 2025
7308545
fix: [GSW-2040] UI
tfrg Jan 16, 2025
cfe213f
fix: [GSW-2040] Mobile UI
tfrg Jan 16, 2025
a725ac9
feat: [GSW-2040] SocialWallet Guide Tooltip (Mobile)
tfrg Jan 16, 2025
4a685dc
fix: [GSW-2040] HeaderMenu Icon Mobile
tfrg Jan 17, 2025
2acfd27
fix: [GSW-2040] UI
tfrg Jan 17, 2025
f76d978
fix: [GSW-2040] Light mode UI
tfrg Jan 17, 2025
42b7be7
fix: [GSW-2040] ConnectedSocialLogin Modal UI
tfrg Jan 17, 2025
b31dfca
fix: [GSW-2040] Mobile UI
tfrg Jan 17, 2025
cfea83c
fix: [GSW-2040] icon colorToken
tfrg Jan 17, 2025
a8be9f8
fix: [GSW-2040] Connected Modal(Mobile)
tfrg Jan 17, 2025
e5daedc
fix: [GSW-2040] Mobile WalletType Logo
tfrg Jan 17, 2025
bef0c3d
feat: [GSW-2040] Transaction Rejected handling
tfrg Jan 17, 2025
73d4536
fix: [GSW-2040] TransactionApprovalModal MaxHeight
tfrg Jan 17, 2025
e9bcab6
fix: [GSW-2040] Connected Warning Modal text
tfrg Jan 17, 2025
5c1f09e
feat: [GSW-2040] Connecting Timeout
tfrg Jan 17, 2025
1885a0b
fix: [GSW-2040] Mobile UI
tfrg Jan 17, 2025
1c59864
fix: [GSW-2040] Improve ConnectError modal Appear
tfrg Jan 17, 2025
028c546
feat: [GSW-2040] Handling previous login history
tfrg Jan 17, 2025
0186f73
feat: [GSW-2040] Handling previous login history
tfrg Jan 17, 2025
eadbe0b
feat: [GSW-2040] Handling previous login history
tfrg Jan 17, 2025
e5a685f
fix: [GSW-2040] Timeout modal
tfrg Jan 17, 2025
24a76ef
fix: [GSW-2040] Resolve UI flickering issue
tfrg Jan 18, 2025
32fbeed
feat: [GSW-2040] If the domain is invalid, raise a warning
tfrg Jan 20, 2025
068644c
feat: [GSW-2040] feat: [GSW-2040] If the domain is invalid, disabled …
tfrg Jan 20, 2025
5fcc12f
feat: [GSW-2040] AutoDisconnect when session expired
tfrg Jan 20, 2025
396db51
feat: [GSW-2040] Mobile Tooltip in Wallet page
tfrg Jan 20, 2025
3a8cf84
fix: [GSW-2040] Invalid Domain UI
tfrg Jan 20, 2025
a443fe1
feat: [GSW-2040] TransactionApprovalModal UI
tfrg Jan 21, 2025
6bdb325
feat: [GSW-2040] Add page visibility detection for mobile auto-discon…
tfrg Jan 22, 2025
e4644a5
feat: [GSW-2040] Implement background activity check for mobile auto-…
tfrg Jan 22, 2025
6c59987
chore: bump adena-sdk v0.0.5
jinoosss Jan 22, 2025
5cfaa7c
chore: [GSW-2040] packager dependency issue
tfrg Jan 22, 2025
e4e3cb9
feat: [GSW-2040] UserEmail
tfrg Jan 22, 2025
2ef3e97
fix: [GSW-2040] UserEmail UI
tfrg Jan 22, 2025
c2ccb0a
fix: [GSW-2040] Email UI
tfrg Jan 22, 2025
d76576e
feat: [GSW-2040] storage improve
tfrg Jan 22, 2025
ba3202d
feat: [GSW-2040] Session Expired logout
tfrg Jan 22, 2025
2440f86
feat: [GSW-2040] Session Expired logout
tfrg Jan 22, 2025
0014e0d
feat: [GSW-2040] Session Expired logout
tfrg Jan 22, 2025
5147e45
fix: [GSW-2040] Tx
tfrg Jan 22, 2025
9199a2b
chore: [GSW-2040] Update @adena-wallet/sdk v0.0.6
tfrg Jan 23, 2025
cdeeec9
feat: [GSW-2040] Implements Email Passwordless
tfrg Jan 23, 2025
c724f37
fix: [GSW-2040] Email UI, Update AccountInfoModel
tfrg Jan 23, 2025
53414c1
fix: [GSW-2040] Timeout Logout error
tfrg Jan 23, 2025
f07a933
feat: [GSW-2040] Handling prev login session data
tfrg Jan 23, 2025
920ef68
fix: [GSW-2040] Improve UI for TranasctionApprovalModal
tfrg Jan 23, 2025
c971da1
fix: [GSW-2040] UI
tfrg Jan 24, 2025
c5d0623
fix: [GSW-2040] UI
tfrg Jan 24, 2025
0ea5df6
fix: [GSW-2040] UI
tfrg Jan 24, 2025
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ compressionLevel: mixed
enableGlobalCache: false

yarnPath: .yarn/releases/yarn-4.1.0.cjs

packageExtensions:
"@gnolang/tm2-js-client@*":
dependencies:
"@bufbuild/protobuf": "*"
10 changes: 9 additions & 1 deletion packages/web/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ NEXT_PUBLIC_UMAMI_SCRIPT_URL=""
NEXT_PUBLIC_UMAMI_WEBSITE_ID=""

# I18N Config
I18NEXUS_API_KEY=""
I18NEXUS_API_KEY=""

# Social Wallet Config
NEXT_PUBLIC_SOCIAL_WALLET_WEB3AUTH_CLIENT_ID=""
NEXT_PUBLIC_SOCIAL_WALLET_AUTH_CLIENT_ID=""
NEXT_PUBLIC_SOCIAL_WALLET_AUTH_DOMAIN=""
NEXT_PUBLIC_SOCIAL_WALLET_GOOGLE_VERIFIER=""
NEXT_PUBLIC_SOCIAL_WALLET_TWITTER_VERIFIER=""
NEXT_PUBLIC_SOCIAL_WALLET_EMAIL_VERIFIER=""
5 changes: 4 additions & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
"build-storybook": "build-storybook"
},
"dependencies": {
"@adena-wallet/sdk": "^0.0.6",
"@bufbuild/protobuf": "^2.2.3",
"@emotion/css": "11.10.6",
"@emotion/react": "11.10.6",
"@emotion/styled": "11.10.6",
"@floating-ui/react": "0.21.1",
"@gnolang/gno-js-client": "1.3.0",
"@gnolang/gno-js-client": "1.3.2",
"@gnolang/tm2-js-client": "1.2.4",
"@hookform/resolvers": "3.3.2",
"@tanstack/react-query": "4.26.1",
"axios": "1.3.4",
Expand Down
31 changes: 17 additions & 14 deletions packages/web/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import GnoswapModalProvider from "@providers/gnoswap-modal-provider/GnoswapModal
import GnoswapServiceProvider from "@providers/gnoswap-service-provider/GnoswapServiceProvider";
import GnoswapThemeProvider from "@providers/gnoswap-theme-provider/GnoswapThemeProvider";
import SnackbarProvider from "@providers/snackbar-provider/SnackbarProvider";
import SocialWalletProvider from "@providers/social-wallet-provider";

import nextI18nextConfig from "next-i18next.config";
import Custom500 from "./500";
Expand Down Expand Up @@ -60,20 +61,22 @@ function App({ Component, pageProps }: AppProps) {
<Hydrate state={pageProps.dehydratedState}>
<JotaiProvider>
<GnoswapServiceProvider>
<GnoswapThemeProvider>
<BackgroundContainer>
<SnackbarProvider>
<ScrollTopWrapper>
<ErrorBoundary fallback={<Custom500 />}>
<Component {...pageProps} />
</ErrorBoundary>
</ScrollTopWrapper>
<GnoswapModalProvider selector={"portal-root"}>
<ModalContainer />
</GnoswapModalProvider>
</SnackbarProvider>
</BackgroundContainer>
</GnoswapThemeProvider>
<SocialWalletProvider>
<GnoswapThemeProvider>
<BackgroundContainer>
<SnackbarProvider>
<ScrollTopWrapper>
<ErrorBoundary fallback={<Custom500 />}>
<Component {...pageProps} />
</ErrorBoundary>
</ScrollTopWrapper>
<GnoswapModalProvider selector={"portal-root"}>
<ModalContainer />
</GnoswapModalProvider>
</SnackbarProvider>
</BackgroundContainer>
</GnoswapThemeProvider>
</SocialWalletProvider>
</GnoswapServiceProvider>
</JotaiProvider>
</Hydrate>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createTimeout } from "@common/utils/client-util";
import { DEFAULT_GAS_WANTED } from "@common/values";
import { WalletType } from "src/types/wallet.types";
import {
AccountInfo,
SendTransactionRequestParam,
Expand Down Expand Up @@ -40,6 +41,10 @@ export class AdenaClient implements WalletClient {
return this.adena !== null;
};

public getWalletType(): WalletType {
return "ADENA";
}

public async getAddress(): Promise<string | null> {
if (!this.address) {
return this.getAccount().then(account => account.data?.address || null);
Expand Down Expand Up @@ -115,4 +120,9 @@ export class AdenaClient implements WalletClient {
public addNetwork = (network: AddNetworkRequestParam): Promise<WalletResponse<AddNetworkResponse>> => {
return createTimeout(this.getAdena().AddNetwork(network));
};

public async disconnect(): Promise<void> {
this.adena = null;
this.address = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,18 @@ export interface AccountInfo {
accountNumber: number;
sequence: number;
chainId: string;
email?: string;
}

export const DEFAULT_ACCOUNT_INFO: AccountInfo = {
address: "",
coins: "0ugnot",
chainId: "",
status: "IN_ACTIVE",
publicKey: {
"@type": "",
value: "",
},
accountNumber: 0,
sequence: 0,
};
56 changes: 56 additions & 0 deletions packages/web/src/common/clients/wallet-client/social/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { SocialEmailPasswordlessConfigure, SocialGoogleConfigure, SocialTwitterConfigure } from "@adena-wallet/sdk";

import {
DEFAULT_CHAIN_ID,
DEFAULT_CHAIN_RPC_URL,
SOCIAL_WALLET_AUTH_CLIENT_ID,
SOCIAL_WALLET_AUTH_DOMAIN,
SOCIAL_WALLET_EMAIL_VERIFIER,
SOCIAL_WALLET_GOOGLE_CLIENT_ID,
SOCIAL_WALLET_GOOGLE_VERIFIER,
SOCIAL_WALLET_TWITTER_VERIFIER,
SOCIAL_WALLET_WEB3AUTH_CLIENT_ID,
} from "@constants/environment.constant";
import { SocialLoginType } from "src/types/wallet.types";

const baseConfig = {
chainId: DEFAULT_CHAIN_ID,
name: "Adena Wallet",
rpcTarget: DEFAULT_CHAIN_RPC_URL,
network: "testnet" as const,
clientId: SOCIAL_WALLET_WEB3AUTH_CLIENT_ID,
authClientId: SOCIAL_WALLET_AUTH_CLIENT_ID,
addressPrefix: "g",
};

export const getSocialWalletConfig = (
type: SocialLoginType,
email?: string,
): SocialGoogleConfigure | SocialTwitterConfigure | SocialEmailPasswordlessConfigure => {
switch (type) {
case "google":
return {
...baseConfig,
storageKey: "session",
verifier: SOCIAL_WALLET_GOOGLE_VERIFIER,
googleClientId: SOCIAL_WALLET_GOOGLE_CLIENT_ID,
};
case "email":
return {
...baseConfig,
email: email?.toLowerCase() || "",
storageKey: "session",
verifier: SOCIAL_WALLET_EMAIL_VERIFIER,
domain: SOCIAL_WALLET_AUTH_DOMAIN,
};
case "twitter":
return {
...baseConfig,
storageKey: "session",
verifier: SOCIAL_WALLET_TWITTER_VERIFIER,
domain: SOCIAL_WALLET_AUTH_DOMAIN,
};
default:
throw new Error("Unsupported social login type");
}
};
Loading
Loading