@cryptorubic/web3 0.7.19 → 0.8.0

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.
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@cryptorubic/web3",
3
- "version": "0.7.19",
3
+ "version": "0.8.0",
4
4
  "dependencies": {
5
5
  "tslib": "^2.3.0",
6
6
  "bignumber.js": "9.1.2",
7
- "@cryptorubic/core": "0.7.19",
7
+ "@cryptorubic/core": "0.8.0",
8
8
  "viem": "^2.19.1",
9
9
  "web3-utils": "^4.3.1",
10
10
  "@ton/ton": "^15.1.0",
11
11
  "@solana/web3.js": "1.95.3",
12
12
  "@solflare-wallet/utl-sdk": "^1.4.0",
13
13
  "@ethersproject/bignumber": "^5.7.0",
14
- "@cryptorubic/tron-types": "0.7.19",
14
+ "@cryptorubic/tron-types": "0.8.0",
15
15
  "bitcoin-address-validation": "^2.2.3",
16
16
  "axios": "0.27.2",
17
17
  "crc-32": "^1.2.2",
@@ -2,4 +2,5 @@ import { CommonWeb3Pure } from './common-web3-pure';
2
2
  export declare class SolanaWeb3Pure extends CommonWeb3Pure {
3
3
  readonly nativeTokenAddress = "So11111111111111111111111111111111111111111";
4
4
  constructor();
5
+ isAddressCorrect(address: string): Promise<boolean>;
5
6
  }
@@ -7,9 +7,15 @@ class SolanaWeb3Pure extends common_web3_pure_1.CommonWeb3Pure {
7
7
  constructor() {
8
8
  super({
9
9
  cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.SOLANA,
10
- regex: /^0[xX][a-fA-F0-9]{64}$/
10
+ regex: /^(?!.*([1-9A-HJ-NP-Za-km-z])\1{31,43}$)[1-9A-HJ-NP-Za-km-z]{32,44}$/
11
11
  });
12
12
  this.nativeTokenAddress = 'So11111111111111111111111111111111111111111';
13
13
  }
14
+ async isAddressCorrect(address) {
15
+ if (this.regEx) {
16
+ return this.regEx.test(address);
17
+ }
18
+ throw new Error(`Validation function is not implemented for ${this.constructor.name}`);
19
+ }
14
20
  }
15
21
  exports.SolanaWeb3Pure = SolanaWeb3Pure;
@@ -1,4 +1,5 @@
1
1
  import { CommonWeb3Pure } from './common-web3-pure';
2
2
  export declare class TonWeb3Pure extends CommonWeb3Pure {
3
3
  constructor();
4
+ isAddressCorrect(address: string): Promise<boolean>;
4
5
  }
@@ -8,5 +8,11 @@ class TonWeb3Pure extends common_web3_pure_1.CommonWeb3Pure {
8
8
  regex: /^(EQ|UQ)[0-9a-zA-Z-_!]{46}$/
9
9
  });
10
10
  }
11
+ async isAddressCorrect(address) {
12
+ if (this.regEx) {
13
+ return this.regEx.test(address);
14
+ }
15
+ throw new Error(`Validation function is not implemented for ${this.constructor.name}`);
16
+ }
11
17
  }
12
18
  exports.TonWeb3Pure = TonWeb3Pure;