@feelyourprotocol/util 8141.0.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/LICENSE +373 -0
- package/README.md +297 -0
- package/dist/cjs/account.d.ts +165 -0
- package/dist/cjs/account.d.ts.map +1 -0
- package/dist/cjs/account.js +530 -0
- package/dist/cjs/account.js.map +1 -0
- package/dist/cjs/address.d.ts +67 -0
- package/dist/cjs/address.d.ts.map +1 -0
- package/dist/cjs/address.js +136 -0
- package/dist/cjs/address.js.map +1 -0
- package/dist/cjs/authorization.d.ts +41 -0
- package/dist/cjs/authorization.d.ts.map +1 -0
- package/dist/cjs/authorization.js +135 -0
- package/dist/cjs/authorization.js.map +1 -0
- package/dist/cjs/bal.d.ts +129 -0
- package/dist/cjs/bal.d.ts.map +1 -0
- package/dist/cjs/bal.js +529 -0
- package/dist/cjs/bal.js.map +1 -0
- package/dist/cjs/binaryTree.d.ts +148 -0
- package/dist/cjs/binaryTree.d.ts.map +1 -0
- package/dist/cjs/binaryTree.js +240 -0
- package/dist/cjs/binaryTree.js.map +1 -0
- package/dist/cjs/blobs.d.ts +76 -0
- package/dist/cjs/blobs.d.ts.map +1 -0
- package/dist/cjs/blobs.js +175 -0
- package/dist/cjs/blobs.js.map +1 -0
- package/dist/cjs/bytes.d.ts +291 -0
- package/dist/cjs/bytes.d.ts.map +1 -0
- package/dist/cjs/bytes.js +606 -0
- package/dist/cjs/bytes.js.map +1 -0
- package/dist/cjs/constants.d.ts +91 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +97 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/db.d.ts +65 -0
- package/dist/cjs/db.d.ts.map +1 -0
- package/dist/cjs/db.js +14 -0
- package/dist/cjs/db.js.map +1 -0
- package/dist/cjs/env.d.ts +9 -0
- package/dist/cjs/env.d.ts.map +1 -0
- package/dist/cjs/env.js +13 -0
- package/dist/cjs/env.js.map +1 -0
- package/dist/cjs/errors.d.ts +3 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/errors.js +19 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/helpers.d.ts +21 -0
- package/dist/cjs/helpers.d.ts.map +1 -0
- package/dist/cjs/helpers.js +50 -0
- package/dist/cjs/helpers.js.map +1 -0
- package/dist/cjs/index.d.ts +67 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +93 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/internal.d.ts +72 -0
- package/dist/cjs/internal.d.ts.map +1 -0
- package/dist/cjs/internal.js +182 -0
- package/dist/cjs/internal.js.map +1 -0
- package/dist/cjs/kzg.d.ts +14 -0
- package/dist/cjs/kzg.d.ts.map +1 -0
- package/dist/cjs/kzg.js +3 -0
- package/dist/cjs/kzg.js.map +1 -0
- package/dist/cjs/lock.d.ts +15 -0
- package/dist/cjs/lock.d.ts.map +1 -0
- package/dist/cjs/lock.js +45 -0
- package/dist/cjs/lock.js.map +1 -0
- package/dist/cjs/mapDB.d.ts +17 -0
- package/dist/cjs/mapDB.d.ts.map +1 -0
- package/dist/cjs/mapDB.js +46 -0
- package/dist/cjs/mapDB.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/provider.d.ts +46 -0
- package/dist/cjs/provider.d.ts.map +1 -0
- package/dist/cjs/provider.js +84 -0
- package/dist/cjs/provider.js.map +1 -0
- package/dist/cjs/request.d.ts +20 -0
- package/dist/cjs/request.d.ts.map +1 -0
- package/dist/cjs/request.js +35 -0
- package/dist/cjs/request.js.map +1 -0
- package/dist/cjs/signature.d.ts +47 -0
- package/dist/cjs/signature.d.ts.map +1 -0
- package/dist/cjs/signature.js +147 -0
- package/dist/cjs/signature.js.map +1 -0
- package/dist/cjs/tasks.d.ts +32 -0
- package/dist/cjs/tasks.d.ts.map +1 -0
- package/dist/cjs/tasks.js +51 -0
- package/dist/cjs/tasks.js.map +1 -0
- package/dist/cjs/types.d.ts +64 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +78 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/units.d.ts +22 -0
- package/dist/cjs/units.d.ts.map +1 -0
- package/dist/cjs/units.js +51 -0
- package/dist/cjs/units.js.map +1 -0
- package/dist/cjs/withdrawal.d.ts +72 -0
- package/dist/cjs/withdrawal.d.ts.map +1 -0
- package/dist/cjs/withdrawal.js +93 -0
- package/dist/cjs/withdrawal.js.map +1 -0
- package/dist/esm/account.d.ts +165 -0
- package/dist/esm/account.d.ts.map +1 -0
- package/dist/esm/account.js +505 -0
- package/dist/esm/account.js.map +1 -0
- package/dist/esm/address.d.ts +67 -0
- package/dist/esm/address.d.ts.map +1 -0
- package/dist/esm/address.js +125 -0
- package/dist/esm/address.js.map +1 -0
- package/dist/esm/authorization.d.ts +41 -0
- package/dist/esm/authorization.d.ts.map +1 -0
- package/dist/esm/authorization.js +126 -0
- package/dist/esm/authorization.js.map +1 -0
- package/dist/esm/bal.d.ts +129 -0
- package/dist/esm/bal.d.ts.map +1 -0
- package/dist/esm/bal.js +522 -0
- package/dist/esm/bal.js.map +1 -0
- package/dist/esm/binaryTree.d.ts +148 -0
- package/dist/esm/binaryTree.d.ts.map +1 -0
- package/dist/esm/binaryTree.js +226 -0
- package/dist/esm/binaryTree.js.map +1 -0
- package/dist/esm/blobs.d.ts +76 -0
- package/dist/esm/blobs.d.ts.map +1 -0
- package/dist/esm/blobs.js +163 -0
- package/dist/esm/blobs.js.map +1 -0
- package/dist/esm/bytes.d.ts +291 -0
- package/dist/esm/bytes.d.ts.map +1 -0
- package/dist/esm/bytes.js +562 -0
- package/dist/esm/bytes.js.map +1 -0
- package/dist/esm/constants.d.ts +91 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +94 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/db.d.ts +65 -0
- package/dist/esm/db.d.ts.map +1 -0
- package/dist/esm/db.js +11 -0
- package/dist/esm/db.js.map +1 -0
- package/dist/esm/env.d.ts +9 -0
- package/dist/esm/env.d.ts.map +1 -0
- package/dist/esm/env.js +9 -0
- package/dist/esm/env.js.map +1 -0
- package/dist/esm/errors.d.ts +3 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/errors.js +14 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/helpers.d.ts +21 -0
- package/dist/esm/helpers.d.ts.map +1 -0
- package/dist/esm/helpers.js +43 -0
- package/dist/esm/helpers.js.map +1 -0
- package/dist/esm/index.d.ts +67 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +67 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal.d.ts +72 -0
- package/dist/esm/internal.d.ts.map +1 -0
- package/dist/esm/internal.js +170 -0
- package/dist/esm/internal.js.map +1 -0
- package/dist/esm/kzg.d.ts +14 -0
- package/dist/esm/kzg.d.ts.map +1 -0
- package/dist/esm/kzg.js +2 -0
- package/dist/esm/kzg.js.map +1 -0
- package/dist/esm/lock.d.ts +15 -0
- package/dist/esm/lock.d.ts.map +1 -0
- package/dist/esm/lock.js +41 -0
- package/dist/esm/lock.js.map +1 -0
- package/dist/esm/mapDB.d.ts +17 -0
- package/dist/esm/mapDB.d.ts.map +1 -0
- package/dist/esm/mapDB.js +42 -0
- package/dist/esm/mapDB.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/provider.d.ts +46 -0
- package/dist/esm/provider.d.ts.map +1 -0
- package/dist/esm/provider.js +79 -0
- package/dist/esm/provider.js.map +1 -0
- package/dist/esm/request.d.ts +20 -0
- package/dist/esm/request.d.ts.map +1 -0
- package/dist/esm/request.js +30 -0
- package/dist/esm/request.js.map +1 -0
- package/dist/esm/signature.d.ts +47 -0
- package/dist/esm/signature.d.ts.map +1 -0
- package/dist/esm/signature.js +137 -0
- package/dist/esm/signature.js.map +1 -0
- package/dist/esm/tasks.d.ts +32 -0
- package/dist/esm/tasks.d.ts.map +1 -0
- package/dist/esm/tasks.js +47 -0
- package/dist/esm/tasks.js.map +1 -0
- package/dist/esm/types.d.ts +64 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +71 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/units.d.ts +22 -0
- package/dist/esm/units.d.ts.map +1 -0
- package/dist/esm/units.js +46 -0
- package/dist/esm/units.js.map +1 -0
- package/dist/esm/withdrawal.d.ts +72 -0
- package/dist/esm/withdrawal.d.ts.map +1 -0
- package/dist/esm/withdrawal.js +86 -0
- package/dist/esm/withdrawal.js.map +1 -0
- package/dist/tsconfig.prod.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.prod.esm.tsbuildinfo +1 -0
- package/package.json +116 -0
- package/src/account.ts +630 -0
- package/src/address.ts +158 -0
- package/src/authorization.ts +180 -0
- package/src/bal.ts +761 -0
- package/src/binaryTree.ts +353 -0
- package/src/blobs.ts +209 -0
- package/src/bytes.ts +659 -0
- package/src/constants.ts +125 -0
- package/src/db.ts +86 -0
- package/src/env.ts +9 -0
- package/src/errors.ts +28 -0
- package/src/helpers.ts +46 -0
- package/src/index.ts +88 -0
- package/src/internal.ts +212 -0
- package/src/kzg.ts +24 -0
- package/src/lock.ts +42 -0
- package/src/mapDB.ts +57 -0
- package/src/provider.ts +109 -0
- package/src/request.ts +48 -0
- package/src/signature.ts +202 -0
- package/src/tasks.ts +59 -0
- package/src/types.ts +177 -0
- package/src/units.ts +56 -0
- package/src/withdrawal.ts +133 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { PrefixedHexString } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a boolean on whether or not the the input starts with '0x' and matches the optional length
|
|
4
|
+
* @param {string} value the string input value
|
|
5
|
+
* @param {number|undefined} length the optional length of the hex string in bytes
|
|
6
|
+
* @returns {boolean} Whether or not the string is a valid PrefixedHexString matching the optional length
|
|
7
|
+
*/
|
|
8
|
+
export declare function isHexString(value: string, length?: number): value is PrefixedHexString;
|
|
9
|
+
/**
|
|
10
|
+
* Removes '0x' from a given `String` if present
|
|
11
|
+
* @param str the string value
|
|
12
|
+
* @returns the string without 0x prefix
|
|
13
|
+
*/
|
|
14
|
+
export declare const stripHexPrefix: (str: string) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Pads a `String` to have an even length
|
|
17
|
+
* @param value
|
|
18
|
+
* @return output
|
|
19
|
+
*/
|
|
20
|
+
export declare function padToEven(value: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Get the binary size of a string
|
|
23
|
+
* @param str
|
|
24
|
+
* @returns the number of bytes contained within the string
|
|
25
|
+
*/
|
|
26
|
+
export declare function getBinarySize(str: string): number;
|
|
27
|
+
/**
|
|
28
|
+
* Returns TRUE if the first specified array contains all elements
|
|
29
|
+
* from the second one. FALSE otherwise.
|
|
30
|
+
*
|
|
31
|
+
* @param superset
|
|
32
|
+
* @param subset
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
export declare function arrayContainsArray(superset: unknown[], subset: unknown[], some?: boolean): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Should be called to get ascii from its hex representation
|
|
38
|
+
*
|
|
39
|
+
* @param string in hex
|
|
40
|
+
* @returns ascii string representation of hex value
|
|
41
|
+
*/
|
|
42
|
+
export declare function toAscii(hex: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Should be called to get hex representation (prefixed by 0x) of utf8 string.
|
|
45
|
+
* Strips leading and trailing 0's.
|
|
46
|
+
*
|
|
47
|
+
* @param string
|
|
48
|
+
* @param optional padding
|
|
49
|
+
* @returns hex representation of input string
|
|
50
|
+
*/
|
|
51
|
+
export declare function fromUtf8(stringValue: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Should be called to get hex representation (prefixed by 0x) of ascii string
|
|
54
|
+
*
|
|
55
|
+
* @param string
|
|
56
|
+
* @param optional padding
|
|
57
|
+
* @returns hex representation of input string
|
|
58
|
+
*/
|
|
59
|
+
export declare function fromAscii(stringValue: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Returns the keys from an array of objects.
|
|
62
|
+
* @example
|
|
63
|
+
* ```js
|
|
64
|
+
* getKeys([{a: '1', b: '2'}, {a: '3', b: '4'}], 'a') => ['1', '3']
|
|
65
|
+
*````
|
|
66
|
+
* @param params
|
|
67
|
+
* @param key
|
|
68
|
+
* @param allowEmpty
|
|
69
|
+
* @returns output just a simple array of output keys
|
|
70
|
+
*/
|
|
71
|
+
export declare function getKeys(params: Record<string, string>[], key: string, allowEmpty?: boolean): string[];
|
|
72
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,IAAI,iBAAiB,CAMtF;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,MAO5C,CAAA;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAY/C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,UAQxC;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,OAAO,EAAE,EACnB,MAAM,EAAE,OAAO,EAAE,EACjB,IAAI,CAAC,EAAE,OAAO,GACb,OAAO,CAaT;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAa3C;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,MAAM,UAM3C;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,UAS5C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,YA2B1F"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
The MIT License
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2016 Nick Dodson. nickdodson.com
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
THE SOFTWARE
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.stripHexPrefix = void 0;
|
|
27
|
+
exports.isHexString = isHexString;
|
|
28
|
+
exports.padToEven = padToEven;
|
|
29
|
+
exports.getBinarySize = getBinarySize;
|
|
30
|
+
exports.arrayContainsArray = arrayContainsArray;
|
|
31
|
+
exports.toAscii = toAscii;
|
|
32
|
+
exports.fromUtf8 = fromUtf8;
|
|
33
|
+
exports.fromAscii = fromAscii;
|
|
34
|
+
exports.getKeys = getKeys;
|
|
35
|
+
const bytes_ts_1 = require("./bytes.js");
|
|
36
|
+
const errors_ts_1 = require("./errors.js");
|
|
37
|
+
/**
|
|
38
|
+
* Returns a boolean on whether or not the the input starts with '0x' and matches the optional length
|
|
39
|
+
* @param {string} value the string input value
|
|
40
|
+
* @param {number|undefined} length the optional length of the hex string in bytes
|
|
41
|
+
* @returns {boolean} Whether or not the string is a valid PrefixedHexString matching the optional length
|
|
42
|
+
*/
|
|
43
|
+
function isHexString(value, length) {
|
|
44
|
+
if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/))
|
|
45
|
+
return false;
|
|
46
|
+
if (typeof length !== 'undefined' && length > 0 && value.length !== 2 + 2 * length)
|
|
47
|
+
return false;
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Removes '0x' from a given `String` if present
|
|
52
|
+
* @param str the string value
|
|
53
|
+
* @returns the string without 0x prefix
|
|
54
|
+
*/
|
|
55
|
+
const stripHexPrefix = (str) => {
|
|
56
|
+
if (typeof str !== 'string')
|
|
57
|
+
throw (0, errors_ts_1.EthereumJSErrorWithoutCode)(`[stripHexPrefix] input must be type 'string', received ${typeof str}`);
|
|
58
|
+
return isHexString(str) ? str.slice(2) : str;
|
|
59
|
+
};
|
|
60
|
+
exports.stripHexPrefix = stripHexPrefix;
|
|
61
|
+
/**
|
|
62
|
+
* Pads a `String` to have an even length
|
|
63
|
+
* @param value
|
|
64
|
+
* @return output
|
|
65
|
+
*/
|
|
66
|
+
function padToEven(value) {
|
|
67
|
+
let a = value;
|
|
68
|
+
if (typeof a !== 'string') {
|
|
69
|
+
throw (0, errors_ts_1.EthereumJSErrorWithoutCode)(`[padToEven] value must be type 'string', received ${typeof a}`);
|
|
70
|
+
}
|
|
71
|
+
if (a.length % 2)
|
|
72
|
+
a = `0${a}`;
|
|
73
|
+
return a;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get the binary size of a string
|
|
77
|
+
* @param str
|
|
78
|
+
* @returns the number of bytes contained within the string
|
|
79
|
+
*/
|
|
80
|
+
function getBinarySize(str) {
|
|
81
|
+
if (typeof str !== 'string') {
|
|
82
|
+
throw (0, errors_ts_1.EthereumJSErrorWithoutCode)(`[getBinarySize] method requires input type 'string', received ${typeof str}`);
|
|
83
|
+
}
|
|
84
|
+
return (0, bytes_ts_1.utf8ToBytes)(str).byteLength;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Returns TRUE if the first specified array contains all elements
|
|
88
|
+
* from the second one. FALSE otherwise.
|
|
89
|
+
*
|
|
90
|
+
* @param superset
|
|
91
|
+
* @param subset
|
|
92
|
+
*
|
|
93
|
+
*/
|
|
94
|
+
function arrayContainsArray(superset, subset, some) {
|
|
95
|
+
if (Array.isArray(superset) !== true) {
|
|
96
|
+
throw (0, errors_ts_1.EthereumJSErrorWithoutCode)(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof superset}'`);
|
|
97
|
+
}
|
|
98
|
+
if (Array.isArray(subset) !== true) {
|
|
99
|
+
throw (0, errors_ts_1.EthereumJSErrorWithoutCode)(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof subset}'`);
|
|
100
|
+
}
|
|
101
|
+
return subset[some === true ? 'some' : 'every']((value) => superset.indexOf(value) >= 0);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Should be called to get ascii from its hex representation
|
|
105
|
+
*
|
|
106
|
+
* @param string in hex
|
|
107
|
+
* @returns ascii string representation of hex value
|
|
108
|
+
*/
|
|
109
|
+
function toAscii(hex) {
|
|
110
|
+
let str = '';
|
|
111
|
+
let i = 0;
|
|
112
|
+
const l = hex.length;
|
|
113
|
+
if (hex.substring(0, 2) === '0x')
|
|
114
|
+
i = 2;
|
|
115
|
+
for (; i < l; i += 2) {
|
|
116
|
+
const code = parseInt(hex.substr(i, 2), 16);
|
|
117
|
+
str += String.fromCharCode(code);
|
|
118
|
+
}
|
|
119
|
+
return str;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Should be called to get hex representation (prefixed by 0x) of utf8 string.
|
|
123
|
+
* Strips leading and trailing 0's.
|
|
124
|
+
*
|
|
125
|
+
* @param string
|
|
126
|
+
* @param optional padding
|
|
127
|
+
* @returns hex representation of input string
|
|
128
|
+
*/
|
|
129
|
+
function fromUtf8(stringValue) {
|
|
130
|
+
const str = (0, bytes_ts_1.utf8ToBytes)(stringValue);
|
|
131
|
+
// Using deprecated bytesToUnprefixedHex for performance: we're building a hex string with 0x prefix,
|
|
132
|
+
// so using bytesToUnprefixedHex avoids creating an intermediate prefixed string and then stripping it.
|
|
133
|
+
return `0x${padToEven((0, bytes_ts_1.bytesToUnprefixedHex)(str)).replace(/^0+|0+$/g, '')}`;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Should be called to get hex representation (prefixed by 0x) of ascii string
|
|
137
|
+
*
|
|
138
|
+
* @param string
|
|
139
|
+
* @param optional padding
|
|
140
|
+
* @returns hex representation of input string
|
|
141
|
+
*/
|
|
142
|
+
function fromAscii(stringValue) {
|
|
143
|
+
let hex = '';
|
|
144
|
+
for (let i = 0; i < stringValue.length; i++) {
|
|
145
|
+
const code = stringValue.charCodeAt(i);
|
|
146
|
+
const n = code.toString(16);
|
|
147
|
+
hex += n.length < 2 ? `0${n}` : n;
|
|
148
|
+
}
|
|
149
|
+
return `0x${hex}`;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Returns the keys from an array of objects.
|
|
153
|
+
* @example
|
|
154
|
+
* ```js
|
|
155
|
+
* getKeys([{a: '1', b: '2'}, {a: '3', b: '4'}], 'a') => ['1', '3']
|
|
156
|
+
*````
|
|
157
|
+
* @param params
|
|
158
|
+
* @param key
|
|
159
|
+
* @param allowEmpty
|
|
160
|
+
* @returns output just a simple array of output keys
|
|
161
|
+
*/
|
|
162
|
+
function getKeys(params, key, allowEmpty) {
|
|
163
|
+
if (!Array.isArray(params)) {
|
|
164
|
+
throw (0, errors_ts_1.EthereumJSErrorWithoutCode)(`[getKeys] method expects input 'params' to be an array, got ${typeof params}`);
|
|
165
|
+
}
|
|
166
|
+
if (typeof key !== 'string') {
|
|
167
|
+
throw (0, errors_ts_1.EthereumJSErrorWithoutCode)(`[getKeys] method expects input 'key' to be type 'string', got ${typeof params}`);
|
|
168
|
+
}
|
|
169
|
+
const result = [];
|
|
170
|
+
for (let i = 0; i < params.length; i++) {
|
|
171
|
+
let value = params[i][key];
|
|
172
|
+
if (allowEmpty === true && !value) {
|
|
173
|
+
value = '';
|
|
174
|
+
}
|
|
175
|
+
else if (typeof value !== 'string') {
|
|
176
|
+
throw (0, errors_ts_1.EthereumJSErrorWithoutCode)(`invalid abi - expected type 'string', received ${typeof value}`);
|
|
177
|
+
}
|
|
178
|
+
result.push(value);
|
|
179
|
+
}
|
|
180
|
+
return result;
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAaH,kCAMC;AAqBD,8BAYC;AAOD,sCAQC;AAUD,gDAiBC;AAQD,0BAaC;AAUD,4BAMC;AASD,8BASC;AAaD,0BA2BC;AA3LD,yCAA8D;AAC9D,2CAAwD;AAIxD;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,KAAa,EAAE,MAAe;IACxD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,kBA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YAClC,KAAK,GAAG,EAAE,CAAA;QACZ,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACrC,MAAM,IAAA,sCAA0B,EAC9B,kDAAkD,OAAO,KAAK,EAAE,CACjE,CAAA;QACH,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACpB,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for an externally provided kzg library used when creating blob transactions
|
|
3
|
+
*/
|
|
4
|
+
export interface KZG {
|
|
5
|
+
blobToKzgCommitment(blob: string): string;
|
|
6
|
+
computeBlobProof(blob: string, commitment: string): string;
|
|
7
|
+
verifyProof(polynomialKZG: string, z: string, y: string, KZGProof: string): boolean;
|
|
8
|
+
verifyBlobProofBatch(blobs: string[], expectedKZGCommitments: string[], KZGProofs: string[]): boolean;
|
|
9
|
+
computeCells(blob: string): string[];
|
|
10
|
+
computeCellsAndProofs(blob: string): [string[], string[]];
|
|
11
|
+
recoverCellsAndProofs(indices: number[], cells: string[]): [string[], string[]];
|
|
12
|
+
verifyCellKzgProofBatch(commitments: string[], indices: number[], cells: string[], proofs: string[]): boolean;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=kzg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kzg.d.ts","sourceRoot":"","sources":["../../src/kzg.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,GAAG;IAElB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACzC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1D,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;IACnF,oBAAoB,CAClB,KAAK,EAAE,MAAM,EAAE,EACf,sBAAsB,EAAE,MAAM,EAAE,EAChC,SAAS,EAAE,MAAM,EAAE,GAClB,OAAO,CAAA;IAEV,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACpC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;IACzD,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;IAC/E,uBAAuB,CACrB,WAAW,EAAE,MAAM,EAAE,EACrB,OAAO,EAAE,MAAM,EAAE,EACjB,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAA;CACX"}
|
package/dist/cjs/kzg.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kzg.js","sourceRoot":"","sources":["../../src/kzg.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class Lock {
|
|
2
|
+
private permits;
|
|
3
|
+
private promiseResolverQueue;
|
|
4
|
+
/**
|
|
5
|
+
* Returns a promise used to wait for a permit to become available. This method should be awaited on.
|
|
6
|
+
* @returns A promise that gets resolved when execution is allowed to proceed.
|
|
7
|
+
*/
|
|
8
|
+
acquire(): Promise<boolean>;
|
|
9
|
+
/**
|
|
10
|
+
* Increases the number of permits by one. If there are other functions waiting, one of them will
|
|
11
|
+
* continue to execute in a future iteration of the event loop.
|
|
12
|
+
*/
|
|
13
|
+
release(): void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/lock.ts"],"names":[],"mappings":"AACA,qBAAa,IAAI;IACf,OAAO,CAAC,OAAO,CAAY;IAC3B,OAAO,CAAC,oBAAoB,CAAkC;IAE9D;;;OAGG;IACU,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAWxC;;;OAGG;IACI,OAAO,IAAI,IAAI;CAiBvB"}
|
package/dist/cjs/lock.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Lock = void 0;
|
|
4
|
+
// Based on https://github.com/jsoendermann/semaphore-async-await/blob/master/src/Semaphore.ts
|
|
5
|
+
class Lock {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.permits = 1;
|
|
8
|
+
this.promiseResolverQueue = [];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Returns a promise used to wait for a permit to become available. This method should be awaited on.
|
|
12
|
+
* @returns A promise that gets resolved when execution is allowed to proceed.
|
|
13
|
+
*/
|
|
14
|
+
async acquire() {
|
|
15
|
+
if (this.permits > 0) {
|
|
16
|
+
this.permits -= 1;
|
|
17
|
+
return Promise.resolve(true);
|
|
18
|
+
}
|
|
19
|
+
// If there is no permit available, we return a promise that resolves once the semaphore gets
|
|
20
|
+
// signaled enough times that permits is equal to one.
|
|
21
|
+
return new Promise((resolver) => this.promiseResolverQueue.push(resolver));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Increases the number of permits by one. If there are other functions waiting, one of them will
|
|
25
|
+
* continue to execute in a future iteration of the event loop.
|
|
26
|
+
*/
|
|
27
|
+
release() {
|
|
28
|
+
this.permits += 1;
|
|
29
|
+
if (this.permits > 1 && this.promiseResolverQueue.length > 0) {
|
|
30
|
+
// eslint-disable-next-line no-console
|
|
31
|
+
console.warn('Lock.permits should never be > 0 when there is someone waiting.');
|
|
32
|
+
}
|
|
33
|
+
else if (this.permits === 1 && this.promiseResolverQueue.length > 0) {
|
|
34
|
+
// If there is someone else waiting, immediately consume the permit that was released
|
|
35
|
+
// at the beginning of this function and let the waiting function resume.
|
|
36
|
+
this.permits -= 1;
|
|
37
|
+
const nextResolver = this.promiseResolverQueue.shift();
|
|
38
|
+
if (nextResolver) {
|
|
39
|
+
nextResolver(true);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.Lock = Lock;
|
|
45
|
+
//# sourceMappingURL=lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../src/lock.ts"],"names":[],"mappings":";;;AAAA,8FAA8F;AAC9F,MAAa,IAAI;IAAjB;QACU,YAAO,GAAW,CAAC,CAAA;QACnB,yBAAoB,GAAgC,EAAE,CAAA;IAsChE,CAAC;IApCC;;;OAGG;IACI,KAAK,CAAC,OAAO;QAClB,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,OAAO,IAAI,CAAC,CAAA;YACjB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC9B,CAAC;QAED,6FAA6F;QAC7F,sDAAsD;QACtD,OAAO,IAAI,OAAO,CAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAA;IACrF,CAAC;IAED;;;OAGG;IACI,OAAO;QACZ,IAAI,CAAC,OAAO,IAAI,CAAC,CAAA;QAEjB,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,IAAI,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7D,sCAAsC;YACtC,OAAO,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAA;QACjF,CAAC;aAAM,IAAI,IAAI,CAAC,OAAO,KAAK,CAAC,IAAI,IAAI,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtE,qFAAqF;YACrF,yEAAyE;YACzE,IAAI,CAAC,OAAO,IAAI,CAAC,CAAA;YAEjB,MAAM,YAAY,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAA;YACtD,IAAI,YAAY,EAAE,CAAC;gBACjB,YAAY,CAAC,IAAI,CAAC,CAAA;YACpB,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAxCD,oBAwCC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BatchDBOp, DB, DBObject } from './db.ts';
|
|
2
|
+
export declare class MapDB<TKey extends Uint8Array | string | number, TValue extends Uint8Array | string | DBObject> implements DB<TKey, TValue> {
|
|
3
|
+
_database: Map<TKey, TValue>;
|
|
4
|
+
constructor(database?: Map<TKey, TValue>);
|
|
5
|
+
get(key: TKey): Promise<TValue | undefined>;
|
|
6
|
+
put(key: TKey, val: TValue): Promise<void>;
|
|
7
|
+
del(key: TKey): Promise<void>;
|
|
8
|
+
batch(opStack: BatchDBOp<TKey, TValue>[]): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Note that the returned shallow copy will share the underlying database with the original
|
|
11
|
+
*
|
|
12
|
+
* @returns DB
|
|
13
|
+
*/
|
|
14
|
+
shallowCopy(): DB<TKey, TValue>;
|
|
15
|
+
open(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=mapDB.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapDB.d.ts","sourceRoot":"","sources":["../../src/mapDB.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEtD,qBAAa,KAAK,CAChB,IAAI,SAAS,UAAU,GAAG,MAAM,GAAG,MAAM,EACzC,MAAM,SAAS,UAAU,GAAG,MAAM,GAAG,QAAQ,CAC7C,YAAW,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;IAE3B,SAAS,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;gBAEhB,QAAQ,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC;IAIlC,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAK3C,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM1C,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAM7B,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAY9D;;;;OAIG;IACH,WAAW,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;IAI/B,IAAI;CAGL"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MapDB = void 0;
|
|
4
|
+
const bytes_ts_1 = require("./bytes.js");
|
|
5
|
+
class MapDB {
|
|
6
|
+
constructor(database) {
|
|
7
|
+
this._database = database ?? new Map();
|
|
8
|
+
}
|
|
9
|
+
async get(key) {
|
|
10
|
+
const dbKey = key instanceof Uint8Array ? (0, bytes_ts_1.bytesToUnprefixedHex)(key) : key.toString();
|
|
11
|
+
return this._database.get(dbKey);
|
|
12
|
+
}
|
|
13
|
+
async put(key, val) {
|
|
14
|
+
// Using deprecated bytesToUnprefixedHex for performance: used as Map keys (string encoding).
|
|
15
|
+
const dbKey = key instanceof Uint8Array ? (0, bytes_ts_1.bytesToUnprefixedHex)(key) : key.toString();
|
|
16
|
+
this._database.set(dbKey, val);
|
|
17
|
+
}
|
|
18
|
+
async del(key) {
|
|
19
|
+
// Using deprecated bytesToUnprefixedHex for performance: used as Map keys (string encoding).
|
|
20
|
+
const dbKey = key instanceof Uint8Array ? (0, bytes_ts_1.bytesToUnprefixedHex)(key) : key.toString();
|
|
21
|
+
this._database.delete(dbKey);
|
|
22
|
+
}
|
|
23
|
+
async batch(opStack) {
|
|
24
|
+
for (const op of opStack) {
|
|
25
|
+
if (op.type === 'del') {
|
|
26
|
+
await this.del(op.key);
|
|
27
|
+
}
|
|
28
|
+
if (op.type === 'put') {
|
|
29
|
+
await this.put(op.key, op.value);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Note that the returned shallow copy will share the underlying database with the original
|
|
35
|
+
*
|
|
36
|
+
* @returns DB
|
|
37
|
+
*/
|
|
38
|
+
shallowCopy() {
|
|
39
|
+
return new MapDB(this._database);
|
|
40
|
+
}
|
|
41
|
+
open() {
|
|
42
|
+
return Promise.resolve();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.MapDB = MapDB;
|
|
46
|
+
//# sourceMappingURL=mapDB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapDB.js","sourceRoot":"","sources":["../../src/mapDB.ts"],"names":[],"mappings":";;;AAAA,yCAAiD;AAIjD,MAAa,KAAK;IAOhB,YAAY,QAA4B;QACtC,IAAI,CAAC,SAAS,GAAG,QAAQ,IAAI,IAAI,GAAG,EAAgB,CAAA;IACtD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAS;QACjB,MAAM,KAAK,GAAG,GAAG,YAAY,UAAU,CAAC,CAAC,CAAC,IAAA,+BAAoB,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;QACpF,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAa,CAAC,CAAA;IAC1C,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAS,EAAE,GAAW;QAC9B,6FAA6F;QAC7F,MAAM,KAAK,GAAG,GAAG,YAAY,UAAU,CAAC,CAAC,CAAC,IAAA,+BAAoB,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;QACpF,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAa,EAAE,GAAG,CAAC,CAAA;IACxC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAS;QACjB,6FAA6F;QAC7F,MAAM,KAAK,GAAG,GAAG,YAAY,UAAU,CAAC,CAAC,CAAC,IAAA,+BAAoB,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;QACpF,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAa,CAAC,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAAkC;QAC5C,KAAK,MAAM,EAAE,IAAI,OAAO,EAAE,CAAC;YACzB,IAAI,EAAE,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;gBACtB,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;YACxB,CAAC;YAED,IAAI,EAAE,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;gBACtB,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;YAClC,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,WAAW;QACT,OAAO,IAAI,KAAK,CAAe,IAAI,CAAC,SAAS,CAAC,CAAA;IAChD,CAAC;IAED,IAAI;QACF,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;CACF;AApDD,sBAoDC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
type rpcParams = {
|
|
2
|
+
method: string;
|
|
3
|
+
params: (string | string[] | boolean | number)[];
|
|
4
|
+
};
|
|
5
|
+
export type FetchFromProviderOptions = {
|
|
6
|
+
/** Request timeout in milliseconds (default: 60000) */
|
|
7
|
+
timeout?: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Makes a simple RPC call to a remote Ethereum JSON-RPC provider and passes through the response.
|
|
11
|
+
* No parameter or response validation is done.
|
|
12
|
+
*
|
|
13
|
+
* @param url the URL for the JSON RPC provider
|
|
14
|
+
* @param params the parameters for the JSON-RPC method - refer to
|
|
15
|
+
* https://ethereum.org/en/developers/docs/apis/json-rpc/ for details on RPC methods
|
|
16
|
+
* @param options optional settings (e.g. timeout)
|
|
17
|
+
* @returns the `result` field from the JSON-RPC response
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const provider = 'https://mainnet.infura.io/v3/...'
|
|
21
|
+
* const params = {
|
|
22
|
+
* method: 'eth_getBlockByNumber',
|
|
23
|
+
* params: ['latest', false],
|
|
24
|
+
* }
|
|
25
|
+
* const block = await fetchFromProvider(provider, params)
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const fetchFromProvider: (url: string, params: rpcParams, options?: FetchFromProviderOptions) => Promise<any>;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param provider a URL string or {@link EthersProvider}
|
|
32
|
+
* @returns the extracted URL string for the JSON-RPC Provider
|
|
33
|
+
*/
|
|
34
|
+
export declare const getProvider: (provider: string | EthersProvider) => string;
|
|
35
|
+
/**
|
|
36
|
+
* A partial interface for an `ethers` `JSONRPCProvider`
|
|
37
|
+
* We only use the url string since we do raw `fetch` calls to
|
|
38
|
+
* retrieve the necessary data
|
|
39
|
+
*/
|
|
40
|
+
export interface EthersProvider {
|
|
41
|
+
_getConnection: () => {
|
|
42
|
+
url: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":"AAEA,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,GAAG,MAAM,CAAC,EAAE,CAAA;CACjD,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,GAC5B,KAAK,MAAM,EACX,QAAQ,SAAS,EACjB,UAAU,wBAAwB,iBAgDnC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,GAAG,cAAc,WAQ5D,CAAA;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM;QACpB,GAAG,EAAE,MAAM,CAAA;KACZ,CAAA;CACF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProvider = exports.fetchFromProvider = void 0;
|
|
4
|
+
const errors_ts_1 = require("./errors.js");
|
|
5
|
+
/**
|
|
6
|
+
* Makes a simple RPC call to a remote Ethereum JSON-RPC provider and passes through the response.
|
|
7
|
+
* No parameter or response validation is done.
|
|
8
|
+
*
|
|
9
|
+
* @param url the URL for the JSON RPC provider
|
|
10
|
+
* @param params the parameters for the JSON-RPC method - refer to
|
|
11
|
+
* https://ethereum.org/en/developers/docs/apis/json-rpc/ for details on RPC methods
|
|
12
|
+
* @param options optional settings (e.g. timeout)
|
|
13
|
+
* @returns the `result` field from the JSON-RPC response
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const provider = 'https://mainnet.infura.io/v3/...'
|
|
17
|
+
* const params = {
|
|
18
|
+
* method: 'eth_getBlockByNumber',
|
|
19
|
+
* params: ['latest', false],
|
|
20
|
+
* }
|
|
21
|
+
* const block = await fetchFromProvider(provider, params)
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
const fetchFromProvider = async (url, params, options) => {
|
|
25
|
+
const timeout = options?.timeout ?? 60000;
|
|
26
|
+
const data = JSON.stringify({
|
|
27
|
+
method: params.method,
|
|
28
|
+
params: params.params,
|
|
29
|
+
jsonrpc: '2.0',
|
|
30
|
+
id: 1,
|
|
31
|
+
});
|
|
32
|
+
let signal;
|
|
33
|
+
let timer;
|
|
34
|
+
if (typeof AbortSignal.timeout === 'function') {
|
|
35
|
+
signal = AbortSignal.timeout(timeout);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const controller = new AbortController();
|
|
39
|
+
signal = controller.signal;
|
|
40
|
+
timer = setTimeout(() => controller.abort(), timeout);
|
|
41
|
+
}
|
|
42
|
+
const res = await fetch(url, {
|
|
43
|
+
headers: {
|
|
44
|
+
'content-type': 'application/json',
|
|
45
|
+
},
|
|
46
|
+
method: 'POST',
|
|
47
|
+
body: data,
|
|
48
|
+
signal,
|
|
49
|
+
}).finally(() => {
|
|
50
|
+
if (timer !== undefined)
|
|
51
|
+
clearTimeout(timer);
|
|
52
|
+
});
|
|
53
|
+
if (!res.ok) {
|
|
54
|
+
throw (0, errors_ts_1.EthereumJSErrorWithoutCode)(`JSONRPCError: ${JSON.stringify({
|
|
55
|
+
method: params.method,
|
|
56
|
+
status: res.status,
|
|
57
|
+
message: await res.text().catch(() => {
|
|
58
|
+
return 'Could not parse error message likely because of a network error';
|
|
59
|
+
}),
|
|
60
|
+
}, null, 2)}`);
|
|
61
|
+
}
|
|
62
|
+
const json = await res.json();
|
|
63
|
+
// TODO we should check json.error here
|
|
64
|
+
return json.result;
|
|
65
|
+
};
|
|
66
|
+
exports.fetchFromProvider = fetchFromProvider;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @param provider a URL string or {@link EthersProvider}
|
|
70
|
+
* @returns the extracted URL string for the JSON-RPC Provider
|
|
71
|
+
*/
|
|
72
|
+
const getProvider = (provider) => {
|
|
73
|
+
if (typeof provider === 'string') {
|
|
74
|
+
return provider;
|
|
75
|
+
}
|
|
76
|
+
else if (typeof provider === 'object' && provider._getConnection !== undefined) {
|
|
77
|
+
return provider._getConnection().url;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
throw (0, errors_ts_1.EthereumJSErrorWithoutCode)('Must provide valid provider URL or Web3Provider');
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
exports.getProvider = getProvider;
|
|
84
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":";;;AAAA,2CAAwD;AAYxD;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,iBAAiB,GAAG,KAAK,EACpC,GAAW,EACX,MAAiB,EACjB,OAAkC,EAClC,EAAE;IACF,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,KAAM,CAAA;IAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,KAAK;QACd,EAAE,EAAE,CAAC;KACN,CAAC,CAAA;IAEF,IAAI,MAAmB,CAAA;IACvB,IAAI,KAAgD,CAAA;IACpD,IAAI,OAAO,WAAW,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;QAC9C,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACvC,CAAC;SAAM,CAAC;QACN,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAA;QACxC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;QAC1B,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,CAAA;IACvD,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAC3B,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB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estBytes = Uint8Array;
|
|
3
|
+
export type CLRequestType = (typeof CLRequestType)[keyof typeof CLRequestType];
|
|
4
|
+
export declare const CLRequestType: {
|
|
5
|
+
readonly Deposit: 0;
|
|
6
|
+
readonly Withdrawal: 1;
|
|
7
|
+
readonly Consolidation: 2;
|
|
8
|
+
};
|
|
9
|
+
export interface RequestJSON {
|
|
10
|
+
type: PrefixedHexString;
|
|
11
|
+
data: PrefixedHexString;
|
|
12
|
+
}
|
|
13
|
+
export declare class CLRequest<T extends CLRequestType> {
|
|
14
|
+
readonly bytes: Uint8Array;
|
|
15
|
+
get type(): T;
|
|
16
|
+
get data(): Uint8Array<ArrayBufferLike>;
|
|
17
|
+
constructor(requestType: T, requestData: Uint8Array);
|
|
18
|
+
}
|
|
19
|
+
export declare function createCLRequest(bytes: Uint8Array): CLRequest<CLRequestType>;
|
|
20
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/request.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,MAAM,MAAM,YAAY,GAAG,UAAU,CAAA;AAErC,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAA;AAE9E,eAAO,MAAM,aAAa;;;;CAIhB,CAAA;AAEV,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,iBAAiB,CAAA;IACvB,IAAI,EAAE,iBAAiB,CAAA;CACxB;AAED,qBAAa,SAAS,CAAC,CAAC,SAAS,aAAa;IAE5C,SAAgB,KAAK,EAAE,UAAU,CAAA;IAEjC,IAAI,IAAI,IACkB,CAAC,CAC1B;IAED,IAAI,IAAI,gCAEP;gBAEW,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,UAAU;CAGpD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC,aAAa,CAAC,CAW3E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLRequest = exports.CLRequestType = void 0;
|
|
4
|
+
exports.createCLRequest = createCLRequest;
|
|
5
|
+
const bytes_ts_1 = require("./bytes.js");
|
|
6
|
+
exports.CLRequestType = {
|
|
7
|
+
Deposit: 0,
|
|
8
|
+
Withdrawal: 1,
|
|
9
|
+
Consolidation: 2,
|
|
10
|
+
};
|
|
11
|
+
class CLRequest {
|
|
12
|
+
get type() {
|
|
13
|
+
return this.bytes[0];
|
|
14
|
+
}
|
|
15
|
+
get data() {
|
|
16
|
+
return this.bytes.subarray(1);
|
|
17
|
+
}
|
|
18
|
+
constructor(requestType, requestData) {
|
|
19
|
+
this.bytes = (0, bytes_ts_1.concatBytes)(new Uint8Array([requestType]), requestData);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.CLRequest = CLRequest;
|
|
23
|
+
function createCLRequest(bytes) {
|
|
24
|
+
switch (bytes[0]) {
|
|
25
|
+
case exports.CLRequestType.Deposit:
|
|
26
|
+
return new CLRequest(exports.CLRequestType.Deposit, bytes.subarray(1));
|
|
27
|
+
case exports.CLRequestType.Withdrawal:
|
|
28
|
+
return new CLRequest(exports.CLRequestType.Withdrawal, bytes.subarray(1));
|
|
29
|
+
case exports.CLRequestType.Consolidation:
|
|
30
|
+
return new CLRequest(exports.CLRequestType.Consolidation, bytes.subarray(1));
|
|
31
|
+
default:
|
|
32
|
+
throw Error(`Invalid request type=${bytes[0]}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/request.ts"],"names":[],"mappings":";;;AAoCA,0CAWC;AA/CD,yCAAwC;AAQ3B,QAAA,aAAa,GAAG;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