@riocrypto/common 1.0.579 → 1.0.580

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,10 +5,13 @@ const crypto_1 = require("../types/crypto");
5
5
  const isValidCryptoAddress = (address, crypto) => {
6
6
  const bitcoinPattern = /^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$/;
7
7
  const ethereumPattern = /^0x[a-fA-F0-9]{40}$/;
8
+ const solanaPattern = /^([1-9A-HJ-NP-Za-km-z]{32,44})$/;
8
9
  switch (crypto) {
9
10
  // case Crypto.BTC:
10
11
  // return bitcoinPattern.test(address);
11
- case crypto_1.Crypto.ETH || crypto_1.Crypto.USDC || crypto_1.Crypto.USDCPolygon || crypto_1.Crypto.USDCSolana:
12
+ case crypto_1.Crypto.SOL:
13
+ return solanaPattern.test(address);
14
+ case crypto_1.Crypto.ETH || crypto_1.Crypto.USDC || crypto_1.Crypto.USDCPolygon:
12
15
  return ethereumPattern.test(address);
13
16
  default:
14
17
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.579",
3
+ "version": "1.0.580",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",