viem 2.3.1 → 2.4.1
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/CHANGELOG.md +17 -0
- package/_cjs/chains/definitions/blastSepolia.js +26 -0
- package/_cjs/chains/definitions/blastSepolia.js.map +1 -0
- package/_cjs/chains/index.js +6 -4
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js +18 -10
- package/_cjs/index.js.map +1 -1
- package/_cjs/utils/abi/decodeErrorResult.js +2 -2
- package/_cjs/utils/abi/decodeErrorResult.js.map +1 -1
- package/_cjs/utils/abi/decodeEventLog.js +2 -2
- package/_cjs/utils/abi/decodeEventLog.js.map +1 -1
- package/_cjs/utils/abi/decodeFunctionData.js +2 -2
- package/_cjs/utils/abi/decodeFunctionData.js.map +1 -1
- package/_cjs/utils/abi/encodeErrorResult.js +2 -2
- package/_cjs/utils/abi/encodeErrorResult.js.map +1 -1
- package/_cjs/utils/abi/encodeEventTopics.js +2 -2
- package/_cjs/utils/abi/encodeEventTopics.js.map +1 -1
- package/_cjs/utils/abi/encodeFunctionData.js +2 -2
- package/_cjs/utils/abi/encodeFunctionData.js.map +1 -1
- package/_cjs/utils/abi/getAbiItem.js +4 -4
- package/_cjs/utils/abi/getAbiItem.js.map +1 -1
- package/_cjs/utils/hash/hashSignature.js +11 -0
- package/_cjs/utils/hash/hashSignature.js.map +1 -0
- package/_cjs/utils/hash/toEventHash.js +6 -0
- package/_cjs/utils/hash/toEventHash.js.map +1 -0
- package/_cjs/utils/hash/toEventSelector.js +6 -0
- package/_cjs/utils/hash/toEventSelector.js.map +1 -0
- package/_cjs/utils/hash/toEventSignature.js +6 -0
- package/_cjs/utils/hash/toEventSignature.js.map +1 -0
- package/_cjs/utils/hash/toFunctionHash.js +6 -0
- package/_cjs/utils/hash/toFunctionHash.js.map +1 -0
- package/_cjs/utils/hash/toFunctionSelector.js +8 -0
- package/_cjs/utils/hash/toFunctionSelector.js.map +1 -0
- package/_cjs/utils/hash/toFunctionSignature.js +6 -0
- package/_cjs/utils/hash/toFunctionSignature.js.map +1 -0
- package/_cjs/utils/hash/toSignature.js +15 -0
- package/_cjs/utils/hash/toSignature.js.map +1 -0
- package/_cjs/utils/hash/toSignatureHash.js +10 -0
- package/_cjs/utils/hash/toSignatureHash.js.map +1 -0
- package/_cjs/utils/index.js +18 -6
- package/_cjs/utils/index.js.map +1 -1
- package/_esm/chains/definitions/blastSepolia.js +23 -0
- package/_esm/chains/definitions/blastSepolia.js.map +1 -0
- package/_esm/chains/index.js +1 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js +14 -4
- package/_esm/index.js.map +1 -1
- package/_esm/utils/abi/decodeErrorResult.js +2 -2
- package/_esm/utils/abi/decodeErrorResult.js.map +1 -1
- package/_esm/utils/abi/decodeEventLog.js +2 -2
- package/_esm/utils/abi/decodeEventLog.js.map +1 -1
- package/_esm/utils/abi/decodeFunctionData.js +2 -2
- package/_esm/utils/abi/decodeFunctionData.js.map +1 -1
- package/_esm/utils/abi/encodeErrorResult.js +2 -2
- package/_esm/utils/abi/encodeErrorResult.js.map +1 -1
- package/_esm/utils/abi/encodeEventTopics.js +2 -2
- package/_esm/utils/abi/encodeEventTopics.js.map +1 -1
- package/_esm/utils/abi/encodeFunctionData.js +2 -2
- package/_esm/utils/abi/encodeFunctionData.js.map +1 -1
- package/_esm/utils/abi/getAbiItem.js +4 -4
- package/_esm/utils/abi/getAbiItem.js.map +1 -1
- package/_esm/utils/hash/hashSignature.js +7 -0
- package/_esm/utils/hash/hashSignature.js.map +1 -0
- package/_esm/utils/hash/toEventHash.js +2 -0
- package/_esm/utils/hash/toEventHash.js.map +1 -0
- package/_esm/utils/hash/toEventSelector.js +10 -0
- package/_esm/utils/hash/toEventSelector.js.map +1 -0
- package/_esm/utils/hash/toEventSignature.js +2 -0
- package/_esm/utils/hash/toEventSignature.js.map +1 -0
- package/_esm/utils/hash/toFunctionHash.js +2 -0
- package/_esm/utils/hash/toFunctionHash.js.map +1 -0
- package/_esm/utils/hash/toFunctionSelector.js +11 -0
- package/_esm/utils/hash/toFunctionSelector.js.map +1 -0
- package/_esm/utils/hash/toFunctionSignature.js +2 -0
- package/_esm/utils/hash/toFunctionSignature.js.map +1 -0
- package/_esm/utils/hash/toSignature.js +28 -0
- package/_esm/utils/hash/toSignature.js.map +1 -0
- package/_esm/utils/hash/toSignatureHash.js +9 -0
- package/_esm/utils/hash/toSignatureHash.js.map +1 -0
- package/_esm/utils/index.js +14 -2
- package/_esm/utils/index.js.map +1 -1
- package/_types/chains/definitions/blastSepolia.d.ts +34 -0
- package/_types/chains/definitions/blastSepolia.d.ts.map +1 -0
- package/_types/chains/index.d.ts +1 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +22 -4
- package/_types/index.d.ts.map +1 -1
- package/_types/utils/abi/decodeErrorResult.d.ts +2 -2
- package/_types/utils/abi/decodeErrorResult.d.ts.map +1 -1
- package/_types/utils/abi/decodeEventLog.d.ts +2 -2
- package/_types/utils/abi/decodeEventLog.d.ts.map +1 -1
- package/_types/utils/abi/decodeFunctionData.d.ts +2 -2
- package/_types/utils/abi/decodeFunctionData.d.ts.map +1 -1
- package/_types/utils/abi/encodeErrorResult.d.ts +2 -2
- package/_types/utils/abi/encodeErrorResult.d.ts.map +1 -1
- package/_types/utils/abi/encodeEventTopics.d.ts +2 -2
- package/_types/utils/abi/encodeEventTopics.d.ts.map +1 -1
- package/_types/utils/abi/encodeFunctionData.d.ts +2 -2
- package/_types/utils/abi/encodeFunctionData.d.ts.map +1 -1
- package/_types/utils/abi/getAbiItem.d.ts +2 -2
- package/_types/utils/abi/getAbiItem.d.ts.map +1 -1
- package/_types/utils/hash/hashSignature.d.ts +6 -0
- package/_types/utils/hash/hashSignature.d.ts.map +1 -0
- package/_types/utils/hash/toEventHash.d.ts +2 -0
- package/_types/utils/hash/toEventHash.d.ts.map +1 -0
- package/_types/utils/hash/toEventSelector.d.ts +12 -0
- package/_types/utils/hash/toEventSelector.d.ts.map +1 -0
- package/_types/utils/hash/toEventSignature.d.ts +2 -0
- package/_types/utils/hash/toEventSignature.d.ts.map +1 -0
- package/_types/utils/hash/toFunctionHash.d.ts +2 -0
- package/_types/utils/hash/toFunctionHash.d.ts.map +1 -0
- package/_types/utils/hash/toFunctionSelector.d.ts +14 -0
- package/_types/utils/hash/toFunctionSelector.d.ts.map +1 -0
- package/_types/utils/hash/toFunctionSignature.d.ts +2 -0
- package/_types/utils/hash/toFunctionSignature.d.ts.map +1 -0
- package/_types/utils/hash/toSignature.d.ts +23 -0
- package/_types/utils/hash/toSignature.d.ts.map +1 -0
- package/_types/utils/hash/toSignatureHash.d.ts +10 -0
- package/_types/utils/hash/toSignatureHash.d.ts.map +1 -0
- package/_types/utils/index.d.ts +22 -2
- package/_types/utils/index.d.ts.map +1 -1
- package/chains/definitions/blastSepolia.ts +23 -0
- package/chains/index.ts +1 -0
- package/errors/version.ts +1 -1
- package/index.ts +39 -15
- package/package.json +1 -1
- package/utils/abi/decodeErrorResult.ts +5 -5
- package/utils/abi/decodeEventLog.ts +5 -5
- package/utils/abi/decodeFunctionData.ts +5 -5
- package/utils/abi/encodeErrorResult.ts +5 -5
- package/utils/abi/encodeEventTopics.ts +6 -6
- package/utils/abi/encodeFunctionData.ts +5 -5
- package/utils/abi/getAbiItem.ts +8 -8
- package/utils/hash/{getEventSelector.ts → hashSignature.ts} +5 -6
- package/utils/hash/toEventHash.ts +4 -0
- package/utils/hash/toEventSelector.ts +16 -0
- package/utils/hash/toEventSignature.ts +4 -0
- package/utils/hash/toFunctionHash.ts +4 -0
- package/utils/hash/toFunctionSelector.ts +23 -0
- package/utils/hash/toFunctionSignature.ts +4 -0
- package/utils/hash/toSignature.ts +34 -0
- package/utils/hash/toSignatureHash.ts +17 -0
- package/utils/index.ts +39 -7
- package/_cjs/utils/hash/getEventSelector.js +0 -10
- package/_cjs/utils/hash/getEventSelector.js.map +0 -1
- package/_cjs/utils/hash/getEventSignature.js +0 -9
- package/_cjs/utils/hash/getEventSignature.js.map +0 -1
- package/_cjs/utils/hash/getFunctionSelector.js +0 -11
- package/_cjs/utils/hash/getFunctionSelector.js.map +0 -1
- package/_cjs/utils/hash/getFunctionSignature.js +0 -15
- package/_cjs/utils/hash/getFunctionSignature.js.map +0 -1
- package/_cjs/utils/hash/hashFunction.js +0 -17
- package/_cjs/utils/hash/hashFunction.js.map +0 -1
- package/_esm/utils/hash/getEventSelector.js +0 -6
- package/_esm/utils/hash/getEventSelector.js.map +0 -1
- package/_esm/utils/hash/getEventSignature.js +0 -5
- package/_esm/utils/hash/getEventSignature.js.map +0 -1
- package/_esm/utils/hash/getFunctionSelector.js +0 -7
- package/_esm/utils/hash/getFunctionSelector.js.map +0 -1
- package/_esm/utils/hash/getFunctionSignature.js +0 -11
- package/_esm/utils/hash/getFunctionSignature.js.map +0 -1
- package/_esm/utils/hash/hashFunction.js +0 -12
- package/_esm/utils/hash/hashFunction.js.map +0 -1
- package/_types/utils/hash/getEventSelector.d.ts +0 -7
- package/_types/utils/hash/getEventSelector.d.ts.map +0 -1
- package/_types/utils/hash/getEventSignature.d.ts +0 -6
- package/_types/utils/hash/getEventSignature.d.ts.map +0 -1
- package/_types/utils/hash/getFunctionSelector.d.ts +0 -9
- package/_types/utils/hash/getFunctionSelector.d.ts.map +0 -1
- package/_types/utils/hash/getFunctionSignature.d.ts +0 -6
- package/_types/utils/hash/getFunctionSignature.d.ts.map +0 -1
- package/_types/utils/hash/hashFunction.d.ts +0 -11
- package/_types/utils/hash/hashFunction.d.ts.map +0 -1
- package/utils/hash/getEventSignature.ts +0 -15
- package/utils/hash/getFunctionSelector.ts +0 -22
- package/utils/hash/getFunctionSignature.ts +0 -19
- package/utils/hash/hashFunction.ts +0 -35
package/utils/index.ts
CHANGED
@@ -342,13 +342,45 @@ export {
|
|
342
342
|
defineFormatter,
|
343
343
|
} from './formatters/formatter.js'
|
344
344
|
export {
|
345
|
-
type
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
} from './hash/
|
345
|
+
type ToEventSelectorErrorType,
|
346
|
+
toEventSelector,
|
347
|
+
/** @deprecated use `ToEventSelectorErrorType`. */
|
348
|
+
type ToEventSelectorErrorType as GetEventSelectorErrorType,
|
349
|
+
/** @deprecated use `toEventSelector`. */
|
350
|
+
toEventSelector as getEventSelector,
|
351
|
+
} from './hash/toEventSelector.js'
|
352
|
+
export {
|
353
|
+
type ToFunctionSelectorErrorType,
|
354
|
+
toFunctionSelector,
|
355
|
+
/** @deprecated use `ToFunctionSelectorErrorType`. */
|
356
|
+
type ToFunctionSelectorErrorType as GetFunctionSelectorErrorType,
|
357
|
+
/** @deprecated use `toFunctionSelector`. */
|
358
|
+
toFunctionSelector as getFunctionSelector,
|
359
|
+
} from './hash/toFunctionSelector.js'
|
360
|
+
export {
|
361
|
+
type ToEventSignatureErrorType,
|
362
|
+
toEventSignature,
|
363
|
+
/** @deprecated use `ToEventSignatureErrorType`. */
|
364
|
+
type ToEventSignatureErrorType as GetEventSignatureErrorType,
|
365
|
+
/** @deprecated use `toEventSignature`. */
|
366
|
+
toEventSignature as getEventSignature,
|
367
|
+
} from './hash/toEventSignature.js'
|
368
|
+
export {
|
369
|
+
type ToFunctionSignatureErrorType,
|
370
|
+
toFunctionSignature,
|
371
|
+
/** @deprecated use `ToFunctionSignatureErrorType`. */
|
372
|
+
type ToFunctionSignatureErrorType as GetFunctionSignatureErrorType,
|
373
|
+
/** @deprecated use `toFunctionSignature`. */
|
374
|
+
toFunctionSignature as getFunctionSignature,
|
375
|
+
} from './hash/toFunctionSignature.js'
|
376
|
+
export {
|
377
|
+
type ToEventHashErrorType,
|
378
|
+
toEventHash,
|
379
|
+
} from './hash/toEventHash.js'
|
380
|
+
export {
|
381
|
+
type ToFunctionHashErrorType,
|
382
|
+
toFunctionHash,
|
383
|
+
} from './hash/toFunctionHash.js'
|
352
384
|
export { type IsHashErrorType, isHash } from './hash/isHash.js'
|
353
385
|
export { type Keccak256ErrorType, keccak256 } from './hash/keccak256.js'
|
354
386
|
export { type Sha256ErrorType, sha256 } from './hash/sha256.js'
|
@@ -1,10 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getEventSelector = void 0;
|
4
|
-
const toBytes_js_1 = require("../encoding/toBytes.js");
|
5
|
-
const getEventSignature_js_1 = require("./getEventSignature.js");
|
6
|
-
const keccak256_js_1 = require("./keccak256.js");
|
7
|
-
const hash = (value) => (0, keccak256_js_1.keccak256)((0, toBytes_js_1.toBytes)(value));
|
8
|
-
const getEventSelector = (fn) => hash((0, getEventSignature_js_1.getEventSignature)(fn));
|
9
|
-
exports.getEventSelector = getEventSelector;
|
10
|
-
//# sourceMappingURL=getEventSelector.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getEventSelector.js","sourceRoot":"","sources":["../../../utils/hash/getEventSelector.ts"],"names":[],"mappings":";;;AAGA,uDAAuE;AACvE,iEAA0D;AAC1D,iDAAmE;AAEnE,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAA,wBAAS,EAAC,IAAA,oBAAO,EAAC,KAAK,CAAC,CAAC,CAAA;AAOlD,MAAM,gBAAgB,GAAG,CAAC,EAAqB,EAAE,EAAE,CACxD,IAAI,CAAC,IAAA,wCAAiB,EAAC,EAAE,CAAC,CAAC,CAAA;AADhB,QAAA,gBAAgB,oBACA"}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getEventSignature = void 0;
|
4
|
-
const getFunctionSignature_js_1 = require("./getFunctionSignature.js");
|
5
|
-
const getEventSignature = (fn) => {
|
6
|
-
return (0, getFunctionSignature_js_1.getFunctionSignature)(fn);
|
7
|
-
};
|
8
|
-
exports.getEventSignature = getEventSignature;
|
9
|
-
//# sourceMappingURL=getEventSignature.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getEventSignature.js","sourceRoot":"","sources":["../../../utils/hash/getEventSignature.ts"],"names":[],"mappings":";;;AAGA,uEAGkC;AAM3B,MAAM,iBAAiB,GAAG,CAAC,EAAqB,EAAE,EAAE;IACzD,OAAO,IAAA,8CAAoB,EAAC,EAAuB,CAAC,CAAA;AACtD,CAAC,CAAA;AAFY,QAAA,iBAAiB,qBAE7B"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getFunctionSelector = void 0;
|
4
|
-
const slice_js_1 = require("../data/slice.js");
|
5
|
-
const toBytes_js_1 = require("../encoding/toBytes.js");
|
6
|
-
const getFunctionSignature_js_1 = require("./getFunctionSignature.js");
|
7
|
-
const keccak256_js_1 = require("./keccak256.js");
|
8
|
-
const hash = (value) => (0, keccak256_js_1.keccak256)((0, toBytes_js_1.toBytes)(value));
|
9
|
-
const getFunctionSelector = (fn) => (0, slice_js_1.slice)(hash((0, getFunctionSignature_js_1.getFunctionSignature)(fn)), 0, 4);
|
10
|
-
exports.getFunctionSelector = getFunctionSelector;
|
11
|
-
//# sourceMappingURL=getFunctionSelector.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getFunctionSelector.js","sourceRoot":"","sources":["../../../utils/hash/getFunctionSelector.ts"],"names":[],"mappings":";;;AAGA,+CAA6D;AAC7D,uDAAuE;AACvE,uEAGkC;AAClC,iDAAmE;AAEnE,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAA,wBAAS,EAAC,IAAA,oBAAO,EAAC,KAAK,CAAC,CAAC,CAAA;AASlD,MAAM,mBAAmB,GAAG,CAAC,EAAwB,EAAE,EAAE,CAC9D,IAAA,gBAAK,EAAC,IAAI,CAAC,IAAA,8CAAoB,EAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AADhC,QAAA,mBAAmB,uBACa"}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getFunctionSignature = void 0;
|
4
|
-
const abitype_1 = require("abitype");
|
5
|
-
const normalizeSignature_js_1 = require("./normalizeSignature.js");
|
6
|
-
const getFunctionSignature = (fn_) => {
|
7
|
-
const fn = (() => {
|
8
|
-
if (typeof fn_ === 'string')
|
9
|
-
return fn_;
|
10
|
-
return (0, abitype_1.formatAbiItem)(fn_);
|
11
|
-
})();
|
12
|
-
return (0, normalizeSignature_js_1.normalizeSignature)(fn);
|
13
|
-
};
|
14
|
-
exports.getFunctionSignature = getFunctionSignature;
|
15
|
-
//# sourceMappingURL=getFunctionSignature.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getFunctionSignature.js","sourceRoot":"","sources":["../../../utils/hash/getFunctionSignature.ts"],"names":[],"mappings":";;;AAAA,qCAAyD;AAGzD,mEAGgC;AAMzB,MAAM,oBAAoB,GAAG,CAAC,GAAyB,EAAE,EAAE;IAChE,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE;QACf,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,OAAO,GAAG,CAAA;QACvC,OAAO,IAAA,uBAAa,EAAC,GAAG,CAAC,CAAA;IAC3B,CAAC,CAAC,EAAE,CAAA;IACJ,OAAO,IAAA,0CAAkB,EAAC,EAAE,CAAC,CAAA;AAC/B,CAAC,CAAA;AANY,QAAA,oBAAoB,wBAMhC"}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.hashAbiItem = exports.hashFunction = void 0;
|
4
|
-
const formatAbiItem_js_1 = require("../abi/formatAbiItem.js");
|
5
|
-
const toBytes_js_1 = require("../encoding/toBytes.js");
|
6
|
-
const getFunctionSignature_js_1 = require("./getFunctionSignature.js");
|
7
|
-
const keccak256_js_1 = require("./keccak256.js");
|
8
|
-
const hash = (value) => (0, keccak256_js_1.keccak256)((0, toBytes_js_1.toBytes)(value));
|
9
|
-
function hashFunction(def) {
|
10
|
-
return hash((0, getFunctionSignature_js_1.getFunctionSignature)(def));
|
11
|
-
}
|
12
|
-
exports.hashFunction = hashFunction;
|
13
|
-
function hashAbiItem(abiItem) {
|
14
|
-
return hash((0, formatAbiItem_js_1.formatAbiItem)(abiItem));
|
15
|
-
}
|
16
|
-
exports.hashAbiItem = hashAbiItem;
|
17
|
-
//# sourceMappingURL=hashFunction.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"hashFunction.js","sourceRoot":"","sources":["../../../utils/hash/hashFunction.ts"],"names":[],"mappings":";;;AACA,8DAGgC;AAChC,uDAAuE;AAGvE,uEAGkC;AAClC,iDAAmE;AAEnE,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAA,wBAAS,EAAC,IAAA,oBAAO,EAAC,KAAK,CAAC,CAAC,CAAA;AAQzD,SAAgB,YAAY,CAAC,GAAW;IACtC,OAAO,IAAI,CAAC,IAAA,8CAAoB,EAAC,GAAG,CAAC,CAAC,CAAA;AACxC,CAAC;AAFD,oCAEC;AAQD,SAAgB,WAAW,CAAC,OAA+B;IACzD,OAAO,IAAI,CAAC,IAAA,gCAAa,EAAC,OAAO,CAAC,CAAC,CAAA;AACrC,CAAC;AAFD,kCAEC"}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { toBytes } from '../encoding/toBytes.js';
|
2
|
-
import { getEventSignature } from './getEventSignature.js';
|
3
|
-
import { keccak256 } from './keccak256.js';
|
4
|
-
const hash = (value) => keccak256(toBytes(value));
|
5
|
-
export const getEventSelector = (fn) => hash(getEventSignature(fn));
|
6
|
-
//# sourceMappingURL=getEventSelector.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getEventSelector.js","sourceRoot":"","sources":["../../../utils/hash/getEventSelector.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAA2B,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAEnE,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;AAOzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAqB,EAAE,EAAE,CACxD,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getEventSignature.js","sourceRoot":"","sources":["../../../utils/hash/getEventSignature.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,oBAAoB,GACrB,MAAM,2BAA2B,CAAA;AAMlC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAqB,EAAE,EAAE;IACzD,OAAO,oBAAoB,CAAC,EAAuB,CAAC,CAAA;AACtD,CAAC,CAAA"}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { slice } from '../data/slice.js';
|
2
|
-
import { toBytes } from '../encoding/toBytes.js';
|
3
|
-
import { getFunctionSignature, } from './getFunctionSignature.js';
|
4
|
-
import { keccak256 } from './keccak256.js';
|
5
|
-
const hash = (value) => keccak256(toBytes(value));
|
6
|
-
export const getFunctionSelector = (fn) => slice(hash(getFunctionSignature(fn)), 0, 4);
|
7
|
-
//# sourceMappingURL=getFunctionSelector.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getFunctionSelector.js","sourceRoot":"","sources":["../../../utils/hash/getFunctionSelector.ts"],"names":[],"mappings":"AAGA,OAAO,EAAuB,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,EAAyB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACvE,OAAO,EAEL,oBAAoB,GACrB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAA2B,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAEnE,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;AASzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAwB,EAAE,EAAE,CAC9D,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { formatAbiItem } from 'abitype';
|
2
|
-
import { normalizeSignature, } from './normalizeSignature.js';
|
3
|
-
export const getFunctionSignature = (fn_) => {
|
4
|
-
const fn = (() => {
|
5
|
-
if (typeof fn_ === 'string')
|
6
|
-
return fn_;
|
7
|
-
return formatAbiItem(fn_);
|
8
|
-
})();
|
9
|
-
return normalizeSignature(fn);
|
10
|
-
};
|
11
|
-
//# sourceMappingURL=getFunctionSignature.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getFunctionSignature.js","sourceRoot":"","sources":["../../../utils/hash/getFunctionSignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,SAAS,CAAA;AAGzD,OAAO,EAEL,kBAAkB,GACnB,MAAM,yBAAyB,CAAA;AAMhC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAyB,EAAE,EAAE;IAChE,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE;QACf,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,OAAO,GAAG,CAAA;QACvC,OAAO,aAAa,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC,CAAC,EAAE,CAAA;IACJ,OAAO,kBAAkB,CAAC,EAAE,CAAC,CAAA;AAC/B,CAAC,CAAA"}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { formatAbiItem, } from '../abi/formatAbiItem.js';
|
2
|
-
import { toBytes } from '../encoding/toBytes.js';
|
3
|
-
import { getFunctionSignature, } from './getFunctionSignature.js';
|
4
|
-
import { keccak256 } from './keccak256.js';
|
5
|
-
const hash = (value) => keccak256(toBytes(value));
|
6
|
-
export function hashFunction(def) {
|
7
|
-
return hash(getFunctionSignature(def));
|
8
|
-
}
|
9
|
-
export function hashAbiItem(abiItem) {
|
10
|
-
return hash(formatAbiItem(abiItem));
|
11
|
-
}
|
12
|
-
//# sourceMappingURL=hashFunction.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"hashFunction.js","sourceRoot":"","sources":["../../../utils/hash/hashFunction.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,aAAa,GACd,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAyB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAGvE,OAAO,EAEL,oBAAoB,GACrB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAA2B,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAEnE,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;AAQzD,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAA;AACxC,CAAC;AAQD,MAAM,UAAU,WAAW,CAAC,OAA+B;IACzD,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAA;AACrC,CAAC"}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import type { AbiEvent } from 'abitype';
|
2
|
-
import type { ErrorType } from '../../errors/utils.js';
|
3
|
-
import { type ToBytesErrorType } from '../encoding/toBytes.js';
|
4
|
-
import { type Keccak256ErrorType } from './keccak256.js';
|
5
|
-
export type GetEventSelectorErrorType = Keccak256ErrorType | ToBytesErrorType | ErrorType;
|
6
|
-
export declare const getEventSelector: (fn: string | AbiEvent) => `0x${string}`;
|
7
|
-
//# sourceMappingURL=getEventSelector.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getEventSelector.d.ts","sourceRoot":"","sources":["../../../utils/hash/getEventSelector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,wBAAwB,CAAA;AAEvE,OAAO,EAAE,KAAK,kBAAkB,EAAa,MAAM,gBAAgB,CAAA;AAInE,MAAM,MAAM,yBAAyB,GACjC,kBAAkB,GAClB,gBAAgB,GAChB,SAAS,CAAA;AAEb,eAAO,MAAM,gBAAgB,OAAQ,MAAM,GAAG,QAAQ,kBACzB,CAAA"}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { AbiEvent } from 'abitype';
|
2
|
-
import type { ErrorType } from '../../errors/utils.js';
|
3
|
-
import { type GetFunctionSignatureErrorType } from './getFunctionSignature.js';
|
4
|
-
export type GetEventSignatureErrorType = GetFunctionSignatureErrorType | ErrorType;
|
5
|
-
export declare const getEventSignature: (fn: string | AbiEvent) => string;
|
6
|
-
//# sourceMappingURL=getEventSignature.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getEventSignature.d.ts","sourceRoot":"","sources":["../../../utils/hash/getEventSignature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EACL,KAAK,6BAA6B,EAEnC,MAAM,2BAA2B,CAAA;AAElC,MAAM,MAAM,0BAA0B,GAClC,6BAA6B,GAC7B,SAAS,CAAA;AAEb,eAAO,MAAM,iBAAiB,OAAQ,MAAM,GAAG,QAAQ,WAEtD,CAAA"}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import type { AbiFunction } from 'abitype';
|
2
|
-
import type { ErrorType } from '../../errors/utils.js';
|
3
|
-
import { type SliceErrorType } from '../data/slice.js';
|
4
|
-
import { type ToBytesErrorType } from '../encoding/toBytes.js';
|
5
|
-
import { type GetFunctionSignatureErrorType } from './getFunctionSignature.js';
|
6
|
-
import { type Keccak256ErrorType } from './keccak256.js';
|
7
|
-
export type GetFunctionSelectorErrorType = GetFunctionSignatureErrorType | Keccak256ErrorType | SliceErrorType | ToBytesErrorType | ErrorType;
|
8
|
-
export declare const getFunctionSelector: (fn: string | AbiFunction) => `0x${string}`;
|
9
|
-
//# sourceMappingURL=getFunctionSelector.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getFunctionSelector.d.ts","sourceRoot":"","sources":["../../../utils/hash/getFunctionSelector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,KAAK,cAAc,EAAS,MAAM,kBAAkB,CAAA;AAC7D,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,wBAAwB,CAAA;AACvE,OAAO,EACL,KAAK,6BAA6B,EAEnC,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,KAAK,kBAAkB,EAAa,MAAM,gBAAgB,CAAA;AAInE,MAAM,MAAM,4BAA4B,GACpC,6BAA6B,GAC7B,kBAAkB,GAClB,cAAc,GACd,gBAAgB,GAChB,SAAS,CAAA;AAEb,eAAO,MAAM,mBAAmB,OAAQ,MAAM,GAAG,WAAW,kBACf,CAAA"}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { type AbiFunction } from 'abitype';
|
2
|
-
import type { ErrorType } from '../../errors/utils.js';
|
3
|
-
import { type NormalizeSignatureErrorType } from './normalizeSignature.js';
|
4
|
-
export type GetFunctionSignatureErrorType = NormalizeSignatureErrorType | ErrorType;
|
5
|
-
export declare const getFunctionSignature: (fn_: string | AbiFunction) => string;
|
6
|
-
//# sourceMappingURL=getFunctionSignature.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getFunctionSignature.d.ts","sourceRoot":"","sources":["../../../utils/hash/getFunctionSignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAiB,MAAM,SAAS,CAAA;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,yBAAyB,CAAA;AAEhC,MAAM,MAAM,6BAA6B,GACrC,2BAA2B,GAC3B,SAAS,CAAA;AAEb,eAAO,MAAM,oBAAoB,QAAS,MAAM,GAAG,WAAW,WAM7D,CAAA"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import type { AbiEvent, AbiFunction } from 'abitype';
|
2
|
-
import { type FormatAbiItemErrorType } from '../abi/formatAbiItem.js';
|
3
|
-
import { type ToBytesErrorType } from '../encoding/toBytes.js';
|
4
|
-
import type { ErrorType } from '../../errors/utils.js';
|
5
|
-
import { type GetFunctionSignatureErrorType } from './getFunctionSignature.js';
|
6
|
-
import { type Keccak256ErrorType } from './keccak256.js';
|
7
|
-
export type HashFunctionErrorType = Keccak256ErrorType | ToBytesErrorType | GetFunctionSignatureErrorType | ErrorType;
|
8
|
-
export declare function hashFunction(def: string): `0x${string}`;
|
9
|
-
export type HashAbiItemErrorType = Keccak256ErrorType | ToBytesErrorType | FormatAbiItemErrorType | ErrorType;
|
10
|
-
export declare function hashAbiItem(abiItem: AbiFunction | AbiEvent): `0x${string}`;
|
11
|
-
//# sourceMappingURL=hashFunction.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"hashFunction.d.ts","sourceRoot":"","sources":["../../../utils/hash/hashFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,wBAAwB,CAAA;AAEvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EACL,KAAK,6BAA6B,EAEnC,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,KAAK,kBAAkB,EAAa,MAAM,gBAAgB,CAAA;AAInE,MAAM,MAAM,qBAAqB,GAC7B,kBAAkB,GAClB,gBAAgB,GAChB,6BAA6B,GAC7B,SAAS,CAAA;AAEb,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,iBAEvC;AAED,MAAM,MAAM,oBAAoB,GAC5B,kBAAkB,GAClB,gBAAgB,GAChB,sBAAsB,GACtB,SAAS,CAAA;AAEb,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,QAAQ,iBAE1D"}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import type { AbiEvent, AbiFunction } from 'abitype'
|
2
|
-
|
3
|
-
import type { ErrorType } from '../../errors/utils.js'
|
4
|
-
import {
|
5
|
-
type GetFunctionSignatureErrorType,
|
6
|
-
getFunctionSignature,
|
7
|
-
} from './getFunctionSignature.js'
|
8
|
-
|
9
|
-
export type GetEventSignatureErrorType =
|
10
|
-
| GetFunctionSignatureErrorType
|
11
|
-
| ErrorType
|
12
|
-
|
13
|
-
export const getEventSignature = (fn: string | AbiEvent) => {
|
14
|
-
return getFunctionSignature(fn as {} as AbiFunction)
|
15
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import type { AbiFunction } from 'abitype'
|
2
|
-
|
3
|
-
import type { ErrorType } from '../../errors/utils.js'
|
4
|
-
import { type SliceErrorType, slice } from '../data/slice.js'
|
5
|
-
import { type ToBytesErrorType, toBytes } from '../encoding/toBytes.js'
|
6
|
-
import {
|
7
|
-
type GetFunctionSignatureErrorType,
|
8
|
-
getFunctionSignature,
|
9
|
-
} from './getFunctionSignature.js'
|
10
|
-
import { type Keccak256ErrorType, keccak256 } from './keccak256.js'
|
11
|
-
|
12
|
-
const hash = (value: string) => keccak256(toBytes(value))
|
13
|
-
|
14
|
-
export type GetFunctionSelectorErrorType =
|
15
|
-
| GetFunctionSignatureErrorType
|
16
|
-
| Keccak256ErrorType
|
17
|
-
| SliceErrorType
|
18
|
-
| ToBytesErrorType
|
19
|
-
| ErrorType
|
20
|
-
|
21
|
-
export const getFunctionSelector = (fn: string | AbiFunction) =>
|
22
|
-
slice(hash(getFunctionSignature(fn)), 0, 4)
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { type AbiFunction, formatAbiItem } from 'abitype'
|
2
|
-
|
3
|
-
import type { ErrorType } from '../../errors/utils.js'
|
4
|
-
import {
|
5
|
-
type NormalizeSignatureErrorType,
|
6
|
-
normalizeSignature,
|
7
|
-
} from './normalizeSignature.js'
|
8
|
-
|
9
|
-
export type GetFunctionSignatureErrorType =
|
10
|
-
| NormalizeSignatureErrorType
|
11
|
-
| ErrorType
|
12
|
-
|
13
|
-
export const getFunctionSignature = (fn_: string | AbiFunction) => {
|
14
|
-
const fn = (() => {
|
15
|
-
if (typeof fn_ === 'string') return fn_
|
16
|
-
return formatAbiItem(fn_)
|
17
|
-
})()
|
18
|
-
return normalizeSignature(fn)
|
19
|
-
}
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import type { AbiEvent, AbiFunction } from 'abitype'
|
2
|
-
import {
|
3
|
-
type FormatAbiItemErrorType,
|
4
|
-
formatAbiItem,
|
5
|
-
} from '../abi/formatAbiItem.js'
|
6
|
-
import { type ToBytesErrorType, toBytes } from '../encoding/toBytes.js'
|
7
|
-
|
8
|
-
import type { ErrorType } from '../../errors/utils.js'
|
9
|
-
import {
|
10
|
-
type GetFunctionSignatureErrorType,
|
11
|
-
getFunctionSignature,
|
12
|
-
} from './getFunctionSignature.js'
|
13
|
-
import { type Keccak256ErrorType, keccak256 } from './keccak256.js'
|
14
|
-
|
15
|
-
const hash = (value: string) => keccak256(toBytes(value))
|
16
|
-
|
17
|
-
export type HashFunctionErrorType =
|
18
|
-
| Keccak256ErrorType
|
19
|
-
| ToBytesErrorType
|
20
|
-
| GetFunctionSignatureErrorType
|
21
|
-
| ErrorType
|
22
|
-
|
23
|
-
export function hashFunction(def: string) {
|
24
|
-
return hash(getFunctionSignature(def))
|
25
|
-
}
|
26
|
-
|
27
|
-
export type HashAbiItemErrorType =
|
28
|
-
| Keccak256ErrorType
|
29
|
-
| ToBytesErrorType
|
30
|
-
| FormatAbiItemErrorType
|
31
|
-
| ErrorType
|
32
|
-
|
33
|
-
export function hashAbiItem(abiItem: AbiFunction | AbiEvent) {
|
34
|
-
return hash(formatAbiItem(abiItem))
|
35
|
-
}
|