Skip to content

Commit 5d63fbf

Browse files
authored
Fix solana wallet send button (#4)
* Add support for solana wallet validation * updated readme to reflect changes * revert readme format change * revert readme format change * feedback
1 parent 2377617 commit 5d63fbf

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- [Setup](#setup)
2121
- [Using another chain](#using-another-chain)
2222
- [Using in production](#using-in-production)
23-
- [Enabling Withdrawals](#enabling-withdrawals)
23+
- [Enabling Withdrawals](#enabling-withdrawals)
2424

2525
## Introduction
2626

@@ -38,6 +38,7 @@ Create your own Fintech app in minutes using **[Crossmint](https://crossmint.com
3838
- Leverage more than +200 onchain tools integrating [GOAT](https://github.com/goat-sdk/goat)
3939

4040
**Coming soon**
41+
4142
- Currency conversion
4243
- Earn interest on your USDC
4344
- Issue a debit card linked to your wallet
@@ -52,7 +53,6 @@ Easily deploy the template to Vercel with the button below. You will need to set
5253

5354
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FCrossmint%2Ffintech-starter-app&env=NEXT_PUBLIC_CROSSMINT_CLIENT_API_KEY)
5455

55-
5656
## Setup
5757

5858
1. Clone the repository and navigate to the project folder:
@@ -114,8 +114,6 @@ NEXT_PUBLIC_CHAIN_ID=solana
114114
NEXT_PUBLIC_USDC_MINT=your_USDC_mint
115115
```
116116

117-
3. If using a network that is not EVM, update the `isValidAddress` function in `lib/utils.ts` to check the address format for the chain you want to use.
118-
119117
## Using in production
120118

121119
This starter app is designed for rapid prototyping and testing in a staging environment. To move to production you'll need to:
@@ -127,8 +125,8 @@ This starter app is designed for rapid prototyping and testing in a staging envi
127125
4. Customize your email template for login and signup in the [Crossmint console](https://www.crossmint.com/console) under the Settings tab in the Branding section.
128126
5. For using onramp in production reach out to us on [Telegram](https://t.me/fintechstarterapp).
129127

130-
131128
### Enabling Withdrawals
129+
132130
Withdrawals are powered by [Coinbase](https://www.coinbase.com/en-es/developer-platform) and only work in production. For enabling withdrawals you'll need to:
133131

134132
1. [Create a Coinbase developer account](https://www.coinbase.com/en-es/developer-platform)

lib/utils.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ export function cn(...inputs: ClassValue[]) {
55
return twMerge(clsx(inputs));
66
}
77

8-
export function isValidAddress(address: string): boolean {
8+
export function isValidEvmAddress(address: string): boolean {
99
return /^0x[a-fA-F0-9]{40}$/.test(address);
1010
}
1111

12+
export function isValidSolanaAddress(address: string): boolean {
13+
return /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(address);
14+
}
15+
16+
export function isValidAddress(address: string): boolean {
17+
return isValidEvmAddress(address) || isValidSolanaAddress(address);
18+
}
19+
1220
export function isEmail(email: string) {
1321
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1422
return emailRegex.test(email);

0 commit comments

Comments
 (0)