web3ibn 4.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,365 @@
1
+ "use strict";
2
+ /*
3
+ This file is part of web3.js.
4
+
5
+ web3.js is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU Lesser General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ web3.js is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU Lesser General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public License
16
+ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.Iban = void 0;
20
+ const web3_utils_1 = require("web3-utils");
21
+ const web3_validator_1 = require("web3-validator");
22
+ const web3_errors_1 = require("web3-errors");
23
+ /**
24
+ * Converts Ethereum addresses to IBAN or BBAN addresses and vice versa.
25
+ */
26
+ class Iban {
27
+ /**
28
+ * Construct a direct or indirect IBAN that has conversion methods and validity checks.
29
+ * If the provided string was not of either the length of a direct IBAN (34 or 35),
30
+ * nor the length of an indirect IBAN (20), an Error will be thrown ('Invalid IBAN was provided').
31
+ *
32
+ * @param iban - a Direct or an Indirect IBAN
33
+ * @returns - Iban instance
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const iban = new web3.eth.Iban("XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS");
38
+ * > Iban { _iban: 'XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS' }
39
+ * ```
40
+ */
41
+ constructor(iban) {
42
+ /**
43
+ * This method should be used to create the equivalent ethereum address for the early provided Direct IBAN address.
44
+ * If the provided string was not a direct IBAN (has the length of 34 or 35), an Error will be thrown:
45
+ * ('Iban is indirect and cannot be converted. Must be length of 34 or 35').
46
+ * Note: this is also available as a static method.
47
+ *
48
+ * @return the equivalent ethereum address
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * const iban = new web3.eth.Iban("XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS");
53
+ * iban.toAddress();
54
+ * > "0x00c5496aEe77C1bA1f0854206A26DdA82a81D6D8"
55
+ * ```
56
+ */
57
+ this.toAddress = () => {
58
+ if (this.isDirect()) {
59
+ // check if Iban can be converted to an address
60
+ const base36 = this._iban.slice(4);
61
+ const parsedBigInt = Iban._parseInt(base36, 36); // convert the base36 string to a bigint
62
+ const paddedBigInt = (0, web3_utils_1.leftPad)(parsedBigInt, 40);
63
+ return (0, web3_utils_1.toChecksumAddress)(paddedBigInt);
64
+ }
65
+ throw new Error('Iban is indirect and cannot be converted. Must be length of 34 or 35');
66
+ };
67
+ if (Iban.isIndirect(iban) || Iban.isDirect(iban)) {
68
+ this._iban = iban;
69
+ }
70
+ else {
71
+ throw new Error('Invalid IBAN was provided');
72
+ }
73
+ }
74
+ /**
75
+ * A static method that checks if an IBAN is Direct.
76
+ * It actually check the length of the provided variable and, only if it is 34 or 35, it returns true.
77
+ * Note: this is also available as a method at an Iban instance.
78
+ * @param iban - an IBAN to be checked
79
+ * @returns - `true` if the provided `iban` is a Direct IBAN, and `false` otherwise.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * web3.eth.Iban.isDirect("XE81ETHXREGGAVOFYORK");
84
+ * > false
85
+ * ```
86
+ */
87
+ static isDirect(iban) {
88
+ return iban.length === 34 || iban.length === 35;
89
+ }
90
+ /**
91
+ * An instance method that checks if iban number is Direct.
92
+ * It actually check the length of the provided variable and, only if it is 34 or 35, it returns true.
93
+ * Note: this is also available as a static method.
94
+ * @param iban - an IBAN to be checked
95
+ * @returns - `true` if the provided `iban` is a Direct IBAN, and `false` otherwise.
96
+ *
97
+ * @example
98
+ * ```ts
99
+ * const iban = new web3.eth.Iban("XE81ETHXREGGAVOFYORK");
100
+ * iban.isDirect();
101
+ * > false
102
+ * ```
103
+ */
104
+ isDirect() {
105
+ return Iban.isDirect(this._iban);
106
+ }
107
+ /**
108
+ * A static method that checks if an IBAN is Indirect.
109
+ * It actually check the length of the provided variable and, only if it is 20, it returns true.
110
+ * Note: this is also available as a method at an Iban instance.
111
+ * @param iban - an IBAN to be checked
112
+ * @returns - `true` if the provided `iban` is an Indirect IBAN, and `false` otherwise.
113
+ *
114
+ * @example
115
+ * ```ts
116
+ * web3.eth.Iban.isIndirect("XE81ETHXREGGAVOFYORK");
117
+ * > true
118
+ * ```
119
+ */
120
+ static isIndirect(iban) {
121
+ return iban.length === 20;
122
+ }
123
+ /**
124
+ * check if iban number if indirect
125
+ * It actually check the length of the provided variable and, only if it is 20, it returns true.
126
+ * Note: this is also available as a static method.
127
+ * @param iban - an IBAN to be checked
128
+ * @returns - `true` if the provided `iban` is an Indirect IBAN, and `false` otherwise.
129
+ *
130
+ * @example
131
+ * ```ts
132
+ * const iban = new web3.eth.Iban("XE81ETHXREGGAVOFYORK");
133
+ * iban.isIndirect();
134
+ * > true
135
+ * ```
136
+ */
137
+ isIndirect() {
138
+ return Iban.isIndirect(this._iban);
139
+ }
140
+ /**
141
+ * This method could be used to check if a given string is valid IBAN object.
142
+ * Note: this is also available as a method at an Iban instance.
143
+ *
144
+ * @param iban - a string to be checked if it is in IBAN
145
+ * @returns - true if it is valid IBAN
146
+ *
147
+ * @example
148
+ * ```ts
149
+ * web3.eth.Iban.isValid("XE81ETHXREGGAVOFYORK");
150
+ * > true
151
+ *
152
+ * web3.eth.Iban.isValid("XE82ETHXREGGAVOFYORK");
153
+ * > false // because the checksum is incorrect
154
+ * ```
155
+ */
156
+ static isValid(iban) {
157
+ return (/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(iban) &&
158
+ Iban._mod9710(Iban._iso13616Prepare(iban)) === 1);
159
+ }
160
+ /**
161
+ * Should be called to check if the early provided IBAN is correct.
162
+ * Note: this is also available as a static method.
163
+ *
164
+ * @example
165
+ * ```ts
166
+ * const iban = new web3.eth.Iban("XE81ETHXREGGAVOFYORK");
167
+ * iban.isValid();
168
+ * > true
169
+ *
170
+ * const iban = new web3.eth.Iban("XE82ETHXREGGAVOFYORK");
171
+ * iban.isValid();
172
+ * > false // because the checksum is incorrect
173
+ * ```
174
+ */
175
+ isValid() {
176
+ return Iban.isValid(this._iban);
177
+ }
178
+ /**
179
+ * Convert the passed BBAN to an IBAN for this country specification.
180
+ * Please note that <i>"generation of the IBAN shall be the exclusive responsibility of the bank/branch servicing the account"</i>.
181
+ * This method implements the preferred algorithm described in http://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits
182
+ *
183
+ * @param bban - the BBAN to convert to IBAN
184
+ * @returns an Iban class instance that holds the equivalent IBAN
185
+ *
186
+ * @example
187
+ * ```ts
188
+ * web3.eth.Iban.fromBban('ETHXREGGAVOFYORK');
189
+ * > Iban {_iban: "XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS"}
190
+ * ```
191
+ */
192
+ static fromBban(bban) {
193
+ const countryCode = 'XE';
194
+ const remainder = this._mod9710(this._iso13616Prepare(`${countryCode}00${bban}`));
195
+ const checkDigit = `0${(98 - remainder).toString()}`.slice(-2);
196
+ return new Iban(`${countryCode}${checkDigit}${bban}`);
197
+ }
198
+ /**
199
+ * Should be used to create IBAN object for given institution and identifier
200
+ *
201
+ * @param options - an object holds the `institution` and the `identifier` which will be composed to create an `Iban` object from.
202
+ * @returns an Iban class instance that holds the equivalent IBAN
203
+ *
204
+ * @example
205
+ * ```ts
206
+ * web3.eth.Iban.createIndirect({
207
+ * institution: "XREG",
208
+ * identifier: "GAVOFYORK"
209
+ * });
210
+ * > Iban {_iban: "XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS"}
211
+ * ```
212
+ */
213
+ static createIndirect(options) {
214
+ return Iban.fromBban(`ETH${options.institution}${options.identifier}`);
215
+ }
216
+ /**
217
+ * This method should be used to create iban object from an Ethereum address.
218
+ *
219
+ * @param address - an Ethereum address
220
+ * @returns an Iban class instance that holds the equivalent IBAN
221
+ *
222
+ * @example
223
+ * ```ts
224
+ * web3.eth.Iban.fromAddress("0x00c5496aEe77C1bA1f0854206A26DdA82a81D6D8");
225
+ * > Iban {_iban: "XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS"}
226
+ * ```
227
+ */
228
+ static fromAddress(address) {
229
+ if (!(0, web3_validator_1.isAddress)(address)) {
230
+ throw new web3_errors_1.InvalidAddressError(address);
231
+ }
232
+ const num = BigInt((0, web3_utils_1.hexToNumber)(address));
233
+ const base36 = num.toString(36);
234
+ const padded = (0, web3_utils_1.leftPad)(base36, 15);
235
+ return Iban.fromBban(padded.toUpperCase());
236
+ }
237
+ /**
238
+ * This method should be used to create IBAN address from an Ethereum address
239
+ *
240
+ * @param address - an Ethereum address
241
+ * @return the equivalent IBAN address
242
+ *
243
+ * @example
244
+ * ```ts
245
+ * web3.eth.Iban.toIban("0x00c5496aEe77C1bA1f0854206A26DdA82a81D6D8");
246
+ * > "XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS"
247
+ * ```
248
+ */
249
+ static toIban(address) {
250
+ return Iban.fromAddress(address).toString();
251
+ }
252
+ /**
253
+ * Should be called to get client identifier within institution
254
+ *
255
+ * @return the client of the IBAN instance.
256
+ *
257
+ * @example
258
+ * ```ts
259
+ * const iban = new web3.eth.Iban("XE81ETHXREGGAVOFYORK");
260
+ * iban.client();
261
+ * > 'GAVOFYORK'
262
+ * ```
263
+ */
264
+ client() {
265
+ return this.isIndirect() ? this._iban.slice(11) : '';
266
+ }
267
+ /**
268
+ * Returns the IBAN checksum of the early provided IBAN
269
+ *
270
+ * @example
271
+ * ```ts
272
+ * const iban = new web3.eth.Iban("XE81ETHXREGGAVOFYORK");
273
+ * iban.checksum();
274
+ * > "81"
275
+ * ```
276
+ *
277
+ */
278
+ checksum() {
279
+ return this._iban.slice(2, 4);
280
+ }
281
+ /**
282
+ * Returns institution identifier from the early provided IBAN
283
+ *
284
+ * @example
285
+ * ```ts
286
+ * const iban = new web3.eth.Iban("XE81ETHXREGGAVOFYORK");
287
+ * iban.institution();
288
+ * > 'XREG'
289
+ * ```
290
+ */
291
+ institution() {
292
+ return this.isIndirect() ? this._iban.slice(7, 11) : '';
293
+ }
294
+ /**
295
+ * Simply returns the early provided IBAN
296
+ *
297
+ * @example
298
+ * ```ts
299
+ * const iban = new web3.eth.Iban('XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS');
300
+ * iban.toString();
301
+ * > 'XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS'
302
+ * ```
303
+ */
304
+ toString() {
305
+ return this._iban;
306
+ }
307
+ }
308
+ exports.Iban = Iban;
309
+ /**
310
+ * Prepare an IBAN for mod 97 computation by moving the first 4 chars to the end and transforming the letters to
311
+ * numbers (A = 10, B = 11, ..., Z = 35), as specified in ISO13616.
312
+ */
313
+ Iban._iso13616Prepare = (iban) => {
314
+ const A = 'A'.charCodeAt(0);
315
+ const Z = 'Z'.charCodeAt(0);
316
+ const upperIban = iban.toUpperCase();
317
+ const modifiedIban = `${upperIban.slice(4)}${upperIban.slice(0, 4)}`;
318
+ return modifiedIban
319
+ .split('')
320
+ .map(n => {
321
+ const code = n.charCodeAt(0);
322
+ if (code >= A && code <= Z) {
323
+ // A = 10, B = 11, ... Z = 35
324
+ return code - A + 10;
325
+ }
326
+ return n;
327
+ })
328
+ .join('');
329
+ };
330
+ /**
331
+ * return the bigint of the given string with the specified base
332
+ */
333
+ Iban._parseInt = (str, base) => [...str].reduce((acc, curr) => BigInt(parseInt(curr, base)) + BigInt(base) * acc, BigInt(0));
334
+ /**
335
+ * Calculates the MOD 97 10 of the passed IBAN as specified in ISO7064.
336
+ */
337
+ Iban._mod9710 = (iban) => {
338
+ let remainder = iban;
339
+ let block;
340
+ while (remainder.length > 2) {
341
+ block = remainder.slice(0, 9);
342
+ remainder = `${(parseInt(block, 10) % 97).toString()}${remainder.slice(block.length)}`;
343
+ }
344
+ return parseInt(remainder, 10) % 97;
345
+ };
346
+ /**
347
+ * This method should be used to create an ethereum address from a Direct IBAN address.
348
+ * If the provided string was not a direct IBAN (has the length of 34 or 35), an Error will be thrown:
349
+ * ('Iban is indirect and cannot be converted. Must be length of 34 or 35').
350
+ * Note: this is also available as a method at an Iban instance.
351
+ *
352
+ * @param iban - a Direct IBAN address
353
+ * @return the equivalent ethereum address
354
+ *
355
+ * @example
356
+ * ```ts
357
+ * web3.eth.Iban.toAddress("XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS");
358
+ * > "0x00c5496aEe77C1bA1f0854206A26DdA82a81D6D8"
359
+ * ```
360
+ */
361
+ Iban.toAddress = (iban) => {
362
+ const ibanObject = new Iban(iban);
363
+ return ibanObject.toAddress();
364
+ };
365
+ //# sourceMappingURL=iban.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iban.js","sourceRoot":"","sources":["../../src/iban.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;EAeE;;;AAGF,2CAAqE;AACrE,mDAA2C;AAC3C,6CAAkD;AAGlD;;GAEG;AACH,MAAa,IAAI;IAmKhB;;;;;;;;;;;;;OAaG;IACH,YAAmB,IAAY;QA6F/B;;;;;;;;;;;;;;WAcG;QACI,cAAS,GAAG,GAAc,EAAE;YAClC,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE;gBACpB,+CAA+C;gBAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACnC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,wCAAwC;gBACzF,MAAM,YAAY,GAAG,IAAA,oBAAO,EAAC,YAAY,EAAE,EAAE,CAAC,CAAC;gBAC/C,OAAO,IAAA,8BAAiB,EAAC,YAAY,CAAC,CAAC;aACvC;YACD,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;QACzF,CAAC,CAAC;QApHD,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,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C,GAAG,GAAG,CAAC,CAAC,MAAM,CACd,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,EAChE,MAAM,CAAC,CAAC,CAAC,CACT,CAAC;AAEH;;GAEG;AACqB,aAAQ,GAAG,CAAC,IAAY,EAAU,EAAE;IAC3D,IAAI,SAAS,GAAG,IAAI,CAAC;IACrB,IAAI,KAAK,CAAC;IAEV,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;QAC5B,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9B,SAAS,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;KACvF;IAED,OAAO,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;AACrC,CAAC,CAAC;AAyMF;;;;;;;;;;;;;;GAcG;AACW,cAAS,GAAG,CAAC,IAAY,EAAa,EAAE;IACrD,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,UAAU,CAAC,SAAS,EAAE,CAAC;AAC/B,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Iban } from './iban.js';
2
+ export * from './iban.js';
3
+ export * from './types.js';
4
+ export default Iban;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ /*
3
+ This file is part of web3.js.
4
+
5
+ web3.js is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU Lesser General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ web3.js is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU Lesser General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public License
16
+ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ var desc = Object.getOwnPropertyDescriptor(m, k);
21
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
22
+ desc = { enumerable: true, get: function() { return m[k]; } };
23
+ }
24
+ Object.defineProperty(o, k2, desc);
25
+ }) : (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ o[k2] = m[k];
28
+ }));
29
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
30
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
31
+ };
32
+ Object.defineProperty(exports, "__esModule", { value: true });
33
+ const iban_js_1 = require("./iban.js");
34
+ __exportStar(require("./iban.js"), exports);
35
+ __exportStar(require("./types.js"), exports);
36
+ exports.default = iban_js_1.Iban;
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;EAeE;;;;;;;;;;;;;;;;AAEF,uCAAiC;AAEjC,4CAA0B;AAC1B,6CAA2B;AAE3B,kBAAe,cAAI,CAAC"}
@@ -0,0 +1 @@
1
+ {"type": "commonjs"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * An object that could hold the components for an Indirect IBAN (BBAN)
3
+ */
4
+ export declare type IbanOptions = {
5
+ institution: string;
6
+ identifier: string;
7
+ };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /*
3
+ This file is part of web3.js.
4
+
5
+ web3.js is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU Lesser General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ web3.js is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU Lesser General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public License
16
+ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;EAeE"}