@bitpay-labs/crypto-wallet-core 11.11.5 → 11.11.6
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 +9 -3
- package/ts_build/src/transactions/index.d.ts +1 -1
- package/ts_build/src/transactions/index.d.ts.map +1 -1
- package/ts_build/src/transactions/index.js.map +1 -1
- package/ts_build/src/types/derivation.d.ts +1 -0
- package/ts_build/src/types/derivation.d.ts.map +1 -1
- package/.mocharc.json +0 -6
- package/LICENSE +0 -21
- package/mcr.config.js +0 -17
- package/src/constants/address.ts +0 -7
- package/src/constants/algorithms.ts +0 -9
- package/src/constants/arc.ts +0 -4
- package/src/constants/chains.ts +0 -68
- package/src/constants/feeMinimums.ts +0 -23
- package/src/constants/index.ts +0 -40
- package/src/constants/tokens.ts +0 -233
- package/src/constants/units.ts +0 -311
- package/src/derivation/arb/index.ts +0 -3
- package/src/derivation/base/index.ts +0 -3
- package/src/derivation/bch/index.ts +0 -11
- package/src/derivation/btc/index.ts +0 -68
- package/src/derivation/doge/index.ts +0 -6
- package/src/derivation/eth/index.ts +0 -86
- package/src/derivation/index.ts +0 -140
- package/src/derivation/ltc/index.ts +0 -6
- package/src/derivation/matic/index.ts +0 -3
- package/src/derivation/op/index.ts +0 -3
- package/src/derivation/paths.ts +0 -45
- package/src/derivation/sol/index.ts +0 -81
- package/src/derivation/xrp/index.ts +0 -63
- package/src/index.ts +0 -48
- package/src/message/btc.ts +0 -28
- package/src/message/eth.ts +0 -47
- package/src/message/index.ts +0 -71
- package/src/message/sol.ts +0 -3
- package/src/message/xrp.ts +0 -4
- package/src/transactions/arb/index.ts +0 -14
- package/src/transactions/base/index.ts +0 -13
- package/src/transactions/bch/index.ts +0 -25
- package/src/transactions/btc/index.ts +0 -316
- package/src/transactions/doge/index.ts +0 -31
- package/src/transactions/erc20/abi.ts +0 -418
- package/src/transactions/erc20/index.ts +0 -57
- package/src/transactions/eth/index.ts +0 -192
- package/src/transactions/eth-multisig/abi.ts +0 -724
- package/src/transactions/eth-multisig/index.ts +0 -172
- package/src/transactions/index.ts +0 -85
- package/src/transactions/ltc/index.ts +0 -31
- package/src/transactions/matic/index.ts +0 -14
- package/src/transactions/matic-multisig/index.ts +0 -172
- package/src/transactions/op/index.ts +0 -14
- package/src/transactions/sol/index.ts +0 -306
- package/src/transactions/spl/index.ts +0 -192
- package/src/transactions/xrp/index.ts +0 -167
- package/src/types/derivation.ts +0 -34
- package/src/types/index.ts +0 -3
- package/src/types/message.ts +0 -15
- package/src/types/utils.ts +0 -1
- package/src/types/validation.ts +0 -4
- package/src/utils/bigint.ts +0 -238
- package/src/utils/index.ts +0 -188
- package/src/validation/arb/index.ts +0 -8
- package/src/validation/arc/index.ts +0 -8
- package/src/validation/base/index.ts +0 -8
- package/src/validation/bch/index.ts +0 -17
- package/src/validation/btc/index.ts +0 -17
- package/src/validation/doge/index.ts +0 -16
- package/src/validation/eth/index.ts +0 -29
- package/src/validation/index.ts +0 -45
- package/src/validation/ltc/index.ts +0 -16
- package/src/validation/matic/index.ts +0 -8
- package/src/validation/op/index.ts +0 -8
- package/src/validation/sol/index.ts +0 -34
- package/src/validation/xrp/index.ts +0 -50
- package/test/address.test.ts +0 -190
- package/test/bigint.test.ts +0 -373
- package/test/deriver.test.ts +0 -126
- package/test/transactions.test.ts +0 -2103
- package/test/utils.test.ts +0 -446
- package/test/validation.test.ts +0 -282
- package/tsconfig.json +0 -29
package/test/validation.test.ts
DELETED
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { expect } from 'chai';
|
|
3
|
-
import { Validation } from '../src';
|
|
4
|
-
|
|
5
|
-
describe('Address Validation', () => {
|
|
6
|
-
// BTC
|
|
7
|
-
const btcAddress = '1NuKwkDtCymgA1FNLUBaUWLD8s4kdKWvgn';
|
|
8
|
-
const btcTestAddress = 'mkUNMewkQsHKRcUvv5HLKbqmepCqNH8goc';
|
|
9
|
-
|
|
10
|
-
// BCH
|
|
11
|
-
const bchAddress = 'qr8uujscckc56ancdkmqnyyl2rx6pnp24gmdfrf8qd';
|
|
12
|
-
const bchTestLegacyAddress = 'mms6yCDGo3fDdapguTSMtCyF9XGfWJpD6H';
|
|
13
|
-
|
|
14
|
-
// DOGE
|
|
15
|
-
const dogeAddress = 'DQnSpKaUdXYZz8Q4WUBCdaGBSthiAJbWBr';
|
|
16
|
-
const dogeTestAddress = 'nY525SPsHXVopmUMm1JyReDEop45MSWc3D';
|
|
17
|
-
|
|
18
|
-
// LTC
|
|
19
|
-
const ltcAddress = 'LYgDcZ3oW3aZBhZUyiC84fb99hyUPVxLwB';
|
|
20
|
-
const ltcTestAddress = 'QhpBFbYvLG2bgCZ3D1ztGEUVqmcgY5vjVF';
|
|
21
|
-
|
|
22
|
-
// ETH
|
|
23
|
-
const ethAddress = '37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A';
|
|
24
|
-
const prefixEthAddress = '0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A';
|
|
25
|
-
|
|
26
|
-
// MATIC
|
|
27
|
-
const maticAddress = '37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A';
|
|
28
|
-
const prefixMaticAddress = '0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A';
|
|
29
|
-
|
|
30
|
-
// XRP
|
|
31
|
-
const xrpAddress = 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh';
|
|
32
|
-
|
|
33
|
-
// SOL
|
|
34
|
-
const solAddress = '7EWwMxKQa5Gru7oTcS1Wi3AaEgTfA6MU3z7MaLUT6hnD';
|
|
35
|
-
|
|
36
|
-
// Uri
|
|
37
|
-
const btcUri = 'bitcoin:1NuKwkDtCymgA1FNLUBaUWLD8s4kdKWvgn';
|
|
38
|
-
const bchUri = 'bitcoincash:pp8skudq3x5hzw8ew7vzsw8tn4k8wxsqsv0lt0mf3g';
|
|
39
|
-
const dogeUri = 'dogecoin:DQnSpKaUdXYZz8Q4WUBCdaGBSthiAJbWBr';
|
|
40
|
-
const ltcUri = 'litecoin:LYgDcZ3oW3aZBhZUyiC84fb99hyUPVxLwB';
|
|
41
|
-
const ethUri = 'ethereum:0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A';
|
|
42
|
-
const ethUriParams = 'ethereum:0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A?value=123&gasPrice=123&gas=123&gasLimit=123';
|
|
43
|
-
const ethUriSingleParam = 'ethereum:0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A?value=123';
|
|
44
|
-
const btcTestUri = 'bitcoin:mkUNMewkQsHKRcUvv5HLKbqmepCqNH8goc';
|
|
45
|
-
const bchTestUri = 'bchtest:qq083kgf3wjg7ya8nun36e8nf24g9xgvachahfnyle';
|
|
46
|
-
const dogeTestUri = 'dogecoin:mpz836YMHb7Ubjx4G2YnutwQRd1yz5ssNv';
|
|
47
|
-
const ltcTestUri = 'litecoin:QhpBFbYvLG2bgCZ3D1ztGEUVqmcgY5vjVF';
|
|
48
|
-
const xrpUri = 'ripple:rEqj9WKSH7wEkPvWf6b4gCi26Y3F7HbKUF';
|
|
49
|
-
const xrpUriParams = 'ripple:rEqj9WKSH7wEkPvWf6b4gCi26Y3F7HbKUF?amount=123456&dt=123456';
|
|
50
|
-
const xrpUriSingleParam = 'ripple:rEqj9WKSH7wEkPvWf6b4gCi26Y3F7HbKUF?amount=123456';
|
|
51
|
-
const maticUri = 'matic:0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A';
|
|
52
|
-
const maticUriParams = 'matic:0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A?value=123&gasPrice=123&gas=123&gasLimit=123';
|
|
53
|
-
const maticUriSingleParam = 'matic:0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A?value=123';
|
|
54
|
-
const solUri = 'solana:7EWwMxKQa5Gru7oTcS1Wi3AaEgTfA6MU3z7MaLUT6hnD';
|
|
55
|
-
|
|
56
|
-
// Invalid Address
|
|
57
|
-
const invalidBtcAddress = '1NuKwkDtCymgA1FNLUBaUWLD8s4kKWvgn';
|
|
58
|
-
const invalidBchAddress = 'r8uujscckc56ancdkmqnyyl2rx6pnp24gmdfrf8qd';
|
|
59
|
-
const invalidDogeAddress = 'DQnSpKaUdXYZz8Q4WUBCdaGBSthiAJbWB';
|
|
60
|
-
const invalidLtcAddress = 'LYgDcZ3oW3aZBhZUyiC84fb99hyUPVxLw';
|
|
61
|
-
const invalidEthAddress = '37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08';
|
|
62
|
-
const invalidXrpAddress = 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTH';
|
|
63
|
-
const invalidMaticAddress = '57d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08';
|
|
64
|
-
const invalidSolAddress = '7EWwMxKQa5Gru7oTcS1Wi3AaEgTfA6MU3z7MaLUT6hn0';
|
|
65
|
-
|
|
66
|
-
// Invalid Uri
|
|
67
|
-
const invalidEthPrefix = '0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A';
|
|
68
|
-
const invalidXrpPrefix = 'rEqj9WKSH7wEkPvWf6b4gCi26Y3F7HbKUF';
|
|
69
|
-
const invalidMaticPrefix = '0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A';
|
|
70
|
-
const invalidEthUriParams = 'ethereum:0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A?value=invalid&gasLimit=123&gas=123';
|
|
71
|
-
const invalidXrpUriParams = 'ripple:rEqj9WKSH7wEkPvWf6b4gCi26Y3F7HbKUF?amount=invalid&dt=123';
|
|
72
|
-
const invalidMaticUriParams = 'matic:0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A?value=invalid&gasLimit=123&gas=123';
|
|
73
|
-
const invalidSolUri = 'solana:7EWwMxKQa5Gru7oTcS1Wi3AaEgTfA6MU3z7MaLUT6hn0';
|
|
74
|
-
|
|
75
|
-
it('should be able to validate an BTC address', async () => {
|
|
76
|
-
const isValidAddress = await Validation.validateAddress('BTC', 'mainnet', btcAddress);
|
|
77
|
-
const isValidTestAddress = await Validation.validateAddress('BTC', 'testnet', btcTestAddress);
|
|
78
|
-
expect(isValidAddress).to.equal(true);
|
|
79
|
-
expect(isValidTestAddress).to.equal(true);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it('should be able to validate an BCH address', async () => {
|
|
83
|
-
const isValidAddress = await Validation.validateAddress('BCH', 'mainnet', bchAddress);
|
|
84
|
-
const isValidTestLegacyAddress = await Validation.validateAddress('BCH', 'testnet', bchTestLegacyAddress);
|
|
85
|
-
expect(isValidAddress).to.equal(true);
|
|
86
|
-
expect(isValidTestLegacyAddress).to.equal(true);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('should be able to validate an DOGE address', async () => {
|
|
90
|
-
const isValidAddress = await Validation.validateAddress('DOGE', 'mainnet', dogeAddress);
|
|
91
|
-
const isValidTestAddress = await Validation.validateAddress('DOGE', 'testnet', dogeTestAddress);
|
|
92
|
-
expect(isValidAddress).to.equal(true);
|
|
93
|
-
expect(isValidTestAddress).to.equal(true);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
it('should be able to validate an LTC address', async () => {
|
|
97
|
-
const isValidAddress = await Validation.validateAddress('LTC', 'mainnet', ltcAddress);
|
|
98
|
-
const isValidTestAddress = await Validation.validateAddress('LTC', 'testnet', ltcTestAddress);
|
|
99
|
-
expect(isValidAddress).to.equal(true);
|
|
100
|
-
expect(isValidTestAddress).to.equal(true);
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it('should be able to validate an ETH address', async () => {
|
|
104
|
-
const isValidAddress = await Validation.validateAddress('ETH', 'mainnet', ethAddress);
|
|
105
|
-
const isValidPrefixAddress = await Validation.validateAddress('ETH', 'mainnet', prefixEthAddress);
|
|
106
|
-
expect(isValidAddress).to.equal(true);
|
|
107
|
-
expect(isValidPrefixAddress).to.equal(true);
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
it('should be able to validate an XRP address', async () => {
|
|
111
|
-
const isValidAddress = await Validation.validateAddress('XRP', 'mainnet', xrpAddress);
|
|
112
|
-
expect(isValidAddress).to.equal(true);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
it('should be able to validate an MATIC address', async () => {
|
|
116
|
-
const isValidAddress = await Validation.validateAddress('MATIC', 'mainnet', maticAddress);
|
|
117
|
-
const isValidPrefixAddress = await Validation.validateAddress('MATIC', 'mainnet', prefixMaticAddress);
|
|
118
|
-
expect(isValidAddress).to.equal(true);
|
|
119
|
-
expect(isValidPrefixAddress).to.equal(true);
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
it('should be able to validate an BTC Uri', async () => {
|
|
123
|
-
const isValidUri = await Validation.validateUri('BTC', btcUri);
|
|
124
|
-
const isValidTestUri = await Validation.validateUri('BTC', btcTestUri);
|
|
125
|
-
expect(isValidUri).to.equal(true);
|
|
126
|
-
expect(isValidTestUri).to.equal(true);
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it('should be able to validate an BCH Uri', async () => {
|
|
130
|
-
const isValidUri = await Validation.validateUri('BCH', bchUri);
|
|
131
|
-
const isValidTestUri = await Validation.validateUri('BCH', bchTestUri);
|
|
132
|
-
expect(isValidUri).to.equal(true);
|
|
133
|
-
expect(isValidTestUri).to.equal(true);
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
it('should be able to validate an DOGE Uri', async () => {
|
|
137
|
-
const isValidUri = await Validation.validateUri('DOGE', dogeUri);
|
|
138
|
-
const isValidTestUri = await Validation.validateUri('DOGE', dogeTestUri);
|
|
139
|
-
expect(isValidUri).to.equal(true);
|
|
140
|
-
expect(isValidTestUri).to.equal(true);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
it('should be able to validate an LTC Uri', async () => {
|
|
144
|
-
const isValidUri = await Validation.validateUri('LTC', ltcUri);
|
|
145
|
-
const isValidTestUri = await Validation.validateUri('LTC', ltcTestUri);
|
|
146
|
-
expect(isValidUri).to.equal(true);
|
|
147
|
-
expect(isValidTestUri).to.equal(true);
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
it('should be able to validate an ETH Uri', async () => {
|
|
151
|
-
const isValidUri = await Validation.validateUri('ETH', ethUri);
|
|
152
|
-
const isValidUriParams = await Validation.validateUri('ETH', ethUriParams);
|
|
153
|
-
const isValidUriSingleParam = await Validation.validateUri('ETH', ethUriSingleParam);
|
|
154
|
-
expect(isValidUri).to.equal(true);
|
|
155
|
-
expect(isValidUriParams).to.equal(true);
|
|
156
|
-
expect(isValidUriSingleParam).to.equal(true);
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
it('should be able to validate an XRP Uri', async () => {
|
|
160
|
-
const isValidUri = await Validation.validateUri('XRP', xrpUri);
|
|
161
|
-
const isValidUriParams = await Validation.validateUri('XRP', xrpUriParams);
|
|
162
|
-
const isValidUriSingleParam = await Validation.validateUri('XRP', xrpUriSingleParam);
|
|
163
|
-
expect(isValidUri).to.equal(true);
|
|
164
|
-
expect(isValidUriParams).to.equal(true);
|
|
165
|
-
expect(isValidUriSingleParam).to.equal(true);
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
it('should be able to validate an MATIC Uri', async () => {
|
|
169
|
-
const isValidUri = await Validation.validateUri('MATIC', maticUri);
|
|
170
|
-
const isValidUriParams = await Validation.validateUri('MATIC', maticUriParams);
|
|
171
|
-
const isValidUriSingleParam = await Validation.validateUri('MATIC', maticUriSingleParam);
|
|
172
|
-
expect(isValidUri).to.equal(true);
|
|
173
|
-
expect(isValidUriParams).to.equal(true);
|
|
174
|
-
expect(isValidUriSingleParam).to.equal(true);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
it('should be able to invalidate an incorrect BTC address', async () => {
|
|
178
|
-
const inValidAddress = await Validation.validateAddress('BTC', 'mainnet', invalidBtcAddress);
|
|
179
|
-
expect(inValidAddress).to.equal(false);
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
it('should be able to invalidate an incorrect BCH address', async () => {
|
|
183
|
-
const inValidAddress = await Validation.validateAddress('BCH', 'mainnet', invalidBchAddress);
|
|
184
|
-
expect(inValidAddress).to.equal(false);
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
it('should be able to invalidate an incorrect DOGE address', async () => {
|
|
188
|
-
const inValidAddress = await Validation.validateAddress('DOGE', 'mainnet', invalidDogeAddress);
|
|
189
|
-
expect(inValidAddress).to.equal(false);
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
it('should be able to invalidate an incorrect LTC address', async () => {
|
|
193
|
-
const inValidAddress = await Validation.validateAddress('LTC', 'mainnet', invalidLtcAddress);
|
|
194
|
-
expect(inValidAddress).to.equal(false);
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
it('should be able to invalidate an incorrect ETH address', async () => {
|
|
198
|
-
const inValidAddress = await Validation.validateAddress('ETH', 'mainnet', invalidEthAddress);
|
|
199
|
-
expect(inValidAddress).to.equal(false);
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
it('should be able to invalidate an incorrect XRP address', async () => {
|
|
203
|
-
const inValidAddress = await Validation.validateAddress('XRP', 'mainnet', invalidXrpAddress);
|
|
204
|
-
expect(inValidAddress).to.equal(false);
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
it('should be able to invalidate an incorrect MATIC address', async () => {
|
|
208
|
-
const inValidAddress = await Validation.validateAddress('MATIC', 'mainnet', invalidMaticAddress);
|
|
209
|
-
expect(inValidAddress).to.equal(false);
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
it('should be able to invalidate incorrect ETH Uri params', async () => {
|
|
213
|
-
const inValidEthUri = await Validation.validateUri('ETH', invalidEthUriParams);
|
|
214
|
-
expect(inValidEthUri).to.equal(false);
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
it('should be able to invalidate ETH URI without ethereum prefix', async () => {
|
|
218
|
-
const inValidEthPrefix = await Validation.validateUri('ETH', invalidEthPrefix);
|
|
219
|
-
expect(inValidEthPrefix).to.equal(false);
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
it('should be able to invalidate incorrect XRP Uri params', async () => {
|
|
223
|
-
const inValidXrpUri = await Validation.validateUri('XRP', invalidXrpUriParams);
|
|
224
|
-
expect(inValidXrpUri).to.equal(false);
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
it('should be able to invalidate XRP URI without ripple prefix', async () => {
|
|
228
|
-
const inValidXrpPrefix = await Validation.validateUri('XRP', invalidXrpPrefix);
|
|
229
|
-
expect(inValidXrpPrefix).to.equal(false);
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
it('should be able to invalidate incorrect MATIC Uri params', async () => {
|
|
233
|
-
const inValidMaticUri = await Validation.validateUri('MATIC', invalidMaticUriParams);
|
|
234
|
-
expect(inValidMaticUri).to.equal(false);
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
it('should be able to invalidate MATIC URI without ethereum prefix', async () => {
|
|
238
|
-
const inValidMaticPrefix = await Validation.validateUri('MATIC', invalidMaticPrefix);
|
|
239
|
-
expect(inValidMaticPrefix).to.equal(false);
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
it('should validate ARC addresses', async () => {
|
|
243
|
-
const address = '37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A';
|
|
244
|
-
const prefixedAddress = `0x${address}`;
|
|
245
|
-
|
|
246
|
-
expect(await Validation.validateAddress('ARC', 'testnet', address)).to.equal(true);
|
|
247
|
-
expect(await Validation.validateAddress('ARC', 'testnet', prefixedAddress)).to.equal(true);
|
|
248
|
-
expect(await Validation.validateAddress('ARC', 'testnet', address.slice(1))).to.equal(false);
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
it('should validate ARC URIs', async () => {
|
|
252
|
-
const address = '0x37d7B3bBD88EFdE6a93cF74D2F5b0385D3E3B08A';
|
|
253
|
-
const uri = `arc:${address}`;
|
|
254
|
-
const uriParams = `${uri}?value=123&gasPrice=123&gas=123&gasLimit=123`;
|
|
255
|
-
|
|
256
|
-
expect(await Validation.validateUri('ARC', uri)).to.equal(true);
|
|
257
|
-
expect(await Validation.validateUri('ARC', uriParams)).to.equal(true);
|
|
258
|
-
expect(await Validation.validateUri('ARC', `${uri}?value=123`)).to.equal(true);
|
|
259
|
-
expect(await Validation.validateUri('ARC', address)).to.equal(false);
|
|
260
|
-
expect(await Validation.validateUri('ARC', `${uri}?value=invalid&gasLimit=123&gas=123`)).to.equal(false);
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
it('should be able to validate a SOL address', async () => {
|
|
264
|
-
const isValidAddress = await Validation.validateAddress('SOL', 'mainnet', solAddress);
|
|
265
|
-
expect(isValidAddress).to.equal(true);
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
it('should be able to invalidate an incorrect SOL address', async () => {
|
|
269
|
-
const isValidAddress = await Validation.validateAddress('SOL', 'mainnet', invalidSolAddress);
|
|
270
|
-
expect(isValidAddress).to.equal(false);
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
it('should be able to validate a SOL Uri', async () => {
|
|
274
|
-
const isValidUri = await Validation.validateUri('SOL', solUri);
|
|
275
|
-
expect(isValidUri).to.equal(true);
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
it('should be able to invalidate an incorrect SOL Uri', async () => {
|
|
279
|
-
const isValidUri = await Validation.validateUri('SOL', invalidSolUri);
|
|
280
|
-
expect(isValidUri).to.equal(false);
|
|
281
|
-
});
|
|
282
|
-
});
|
package/tsconfig.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"lib": ["ES2022", "DOM"],
|
|
4
|
-
"noImplicitAny": false,
|
|
5
|
-
"removeComments": true,
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"module": "commonjs",
|
|
9
|
-
"emitDecoratorMetadata": true,
|
|
10
|
-
"experimentalDecorators": true,
|
|
11
|
-
"moduleResolution": "node",
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"target": "ES2022",
|
|
14
|
-
"typeRoots": ["./node_modules/@types"],
|
|
15
|
-
"baseUrl": ".",
|
|
16
|
-
"paths": {
|
|
17
|
-
"*": ["*", "./src/*"]
|
|
18
|
-
},
|
|
19
|
-
"outDir": "ts_build",
|
|
20
|
-
"sourceMap": true
|
|
21
|
-
},
|
|
22
|
-
"include": [
|
|
23
|
-
"./src/**/*.ts",
|
|
24
|
-
"./test/**/*.ts"
|
|
25
|
-
],
|
|
26
|
-
"exclude": [
|
|
27
|
-
"node_modules"
|
|
28
|
-
]
|
|
29
|
-
}
|