-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fix/change-limit-when-pool-change
- Loading branch information
Showing
8 changed files
with
25 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 |
---|---|---|
@@ -1,16 +1,11 @@ | ||
/** | ||
* Validates if is possible Cardano mainnet or testnet address. | ||
* We leave the address validation to the Banxa API, this is a simple check to avoid basic mistakes. | ||
* Banxa referal link doesn't work with testnet addreses or byron addresses. | ||
* @param {string} address - The Cardano address to validate. | ||
* @returns {boolean} - Returns true if the address looks like a Cardano address. | ||
*/ | ||
export function banxaIsPossibleCardanoAddress(address: string) { | ||
const byronRegex = /^[Ae2][0-9A-Za-z]{57,58}$/ | ||
const shelleyRegex = /^(addr1)[0-9a-z]+$/ | ||
const shelleyTestnetRegex = /^(addr_test1)[0-9a-z]+$/ | ||
return ( | ||
byronRegex.test(address) || | ||
shelleyRegex.test(address) || | ||
shelleyTestnetRegex.test(address) | ||
) | ||
return shelleyRegex.test(address) | ||
} |