@apibara/starknet 2.1.0-beta.35 → 2.1.0-beta.36
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/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +8 -1
- package/dist/index.mjs.map +1 -1
- package/dist/parser.cjs +33 -0
- package/dist/parser.cjs.map +1 -1
- package/dist/parser.d.cts +5 -1
- package/dist/parser.d.mts +5 -1
- package/dist/parser.d.ts +5 -1
- package/dist/parser.mjs +33 -1
- package/dist/parser.mjs.map +1 -1
- package/package.json +2 -3
- package/src/abi.ts +6 -0
- package/src/event.ts +6 -0
- package/src/parser.ts +68 -1
package/dist/index.cjs
CHANGED
|
@@ -8342,6 +8342,7 @@ const PrimitiveTypeParsers = {
|
|
|
8342
8342
|
"core::integer::u64": parser.parseU64,
|
|
8343
8343
|
"core::integer::u128": parser.parseU128,
|
|
8344
8344
|
"core::integer::u256": parser.parseU256,
|
|
8345
|
+
"core::bytes_31::bytes31": parser.parseBytes31,
|
|
8345
8346
|
"core::starknet::contract_address::ContractAddress": parser.parseContractAddress
|
|
8346
8347
|
};
|
|
8347
8348
|
function isPrimitiveType(type) {
|
|
@@ -8368,6 +8369,9 @@ function getOptionType(type) {
|
|
|
8368
8369
|
function isEmptyType(type) {
|
|
8369
8370
|
return type === "()";
|
|
8370
8371
|
}
|
|
8372
|
+
function isByteArray(type) {
|
|
8373
|
+
return type === "core::byte_array::ByteArray";
|
|
8374
|
+
}
|
|
8371
8375
|
|
|
8372
8376
|
function isEventAbi(item) {
|
|
8373
8377
|
return item.type === "event";
|
|
@@ -8527,6 +8531,9 @@ function compileTypeParser(abi, type) {
|
|
|
8527
8531
|
if (isEmptyType(type)) {
|
|
8528
8532
|
return parser.parseEmpty;
|
|
8529
8533
|
}
|
|
8534
|
+
if (isByteArray(type)) {
|
|
8535
|
+
return parser.parseByteArray;
|
|
8536
|
+
}
|
|
8530
8537
|
const typeAbi = abi.find((item) => item.name === type);
|
|
8531
8538
|
if (!typeAbi) {
|
|
8532
8539
|
throw new DecodeEventError(`Type ${type} not found in ABI`);
|