@apibara/starknet 2.1.0-beta.22 → 2.1.0-beta.24
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 +638 -768
- package/dist/index.d.cts +4999 -4862
- package/dist/index.d.mts +4999 -4862
- package/dist/index.d.ts +4999 -4862
- package/dist/index.mjs +639 -761
- package/dist/parser.d.cts +3 -3
- package/dist/parser.d.mts +3 -3
- package/dist/parser.d.ts +3 -3
- package/dist/shared/starknet.e649ecb1.d.cts +40 -0
- package/dist/shared/starknet.e649ecb1.d.mts +40 -0
- package/dist/shared/starknet.e649ecb1.d.ts +40 -0
- package/package.json +2 -3
- package/src/block.ts +827 -565
- package/src/common.ts +20 -35
- package/src/filter.ts +235 -268
- package/dist/shared/starknet.2b19268a.d.cts +0 -32
- package/dist/shared/starknet.2b19268a.d.mts +0 -32
- package/dist/shared/starknet.2b19268a.d.ts +0 -32
- package/src/common.test.ts +0 -21
- package/src/filter.test.ts +0 -832
- package/src/helpers.ts +0 -8
- package/src/parser.test.ts +0 -169
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as _effect_schema_AST from '@effect/schema/AST';
|
|
2
|
-
import { Schema } from '@effect/schema';
|
|
3
|
-
|
|
4
|
-
/** Wire representation of `FieldElement`. */
|
|
5
|
-
declare const FieldElementProto: Schema.Struct<{
|
|
6
|
-
x0: typeof Schema.BigIntFromSelf;
|
|
7
|
-
x1: typeof Schema.BigIntFromSelf;
|
|
8
|
-
x2: typeof Schema.BigIntFromSelf;
|
|
9
|
-
x3: typeof Schema.BigIntFromSelf;
|
|
10
|
-
}>;
|
|
11
|
-
/** Field element. */
|
|
12
|
-
declare const FieldElement: Schema.transform<Schema.Struct<{
|
|
13
|
-
x0: typeof Schema.BigIntFromSelf;
|
|
14
|
-
x1: typeof Schema.BigIntFromSelf;
|
|
15
|
-
x2: typeof Schema.BigIntFromSelf;
|
|
16
|
-
x3: typeof Schema.BigIntFromSelf;
|
|
17
|
-
}>, Schema.SchemaClass<`0x${string}`, `0x${string}`, never>>;
|
|
18
|
-
type FieldElement = Schema.Schema.Type<typeof FieldElement>;
|
|
19
|
-
declare const feltToProto: (a: `0x${string}`, overrideOptions?: _effect_schema_AST.ParseOptions) => {
|
|
20
|
-
readonly x0: bigint;
|
|
21
|
-
readonly x1: bigint;
|
|
22
|
-
readonly x2: bigint;
|
|
23
|
-
readonly x3: bigint;
|
|
24
|
-
};
|
|
25
|
-
declare const feltFromProto: (i: {
|
|
26
|
-
readonly x0: bigint;
|
|
27
|
-
readonly x1: bigint;
|
|
28
|
-
readonly x2: bigint;
|
|
29
|
-
readonly x3: bigint;
|
|
30
|
-
}, overrideOptions?: _effect_schema_AST.ParseOptions) => `0x${string}`;
|
|
31
|
-
|
|
32
|
-
export { FieldElement as F, FieldElementProto as a, feltFromProto as b, feltToProto as f };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as _effect_schema_AST from '@effect/schema/AST';
|
|
2
|
-
import { Schema } from '@effect/schema';
|
|
3
|
-
|
|
4
|
-
/** Wire representation of `FieldElement`. */
|
|
5
|
-
declare const FieldElementProto: Schema.Struct<{
|
|
6
|
-
x0: typeof Schema.BigIntFromSelf;
|
|
7
|
-
x1: typeof Schema.BigIntFromSelf;
|
|
8
|
-
x2: typeof Schema.BigIntFromSelf;
|
|
9
|
-
x3: typeof Schema.BigIntFromSelf;
|
|
10
|
-
}>;
|
|
11
|
-
/** Field element. */
|
|
12
|
-
declare const FieldElement: Schema.transform<Schema.Struct<{
|
|
13
|
-
x0: typeof Schema.BigIntFromSelf;
|
|
14
|
-
x1: typeof Schema.BigIntFromSelf;
|
|
15
|
-
x2: typeof Schema.BigIntFromSelf;
|
|
16
|
-
x3: typeof Schema.BigIntFromSelf;
|
|
17
|
-
}>, Schema.SchemaClass<`0x${string}`, `0x${string}`, never>>;
|
|
18
|
-
type FieldElement = Schema.Schema.Type<typeof FieldElement>;
|
|
19
|
-
declare const feltToProto: (a: `0x${string}`, overrideOptions?: _effect_schema_AST.ParseOptions) => {
|
|
20
|
-
readonly x0: bigint;
|
|
21
|
-
readonly x1: bigint;
|
|
22
|
-
readonly x2: bigint;
|
|
23
|
-
readonly x3: bigint;
|
|
24
|
-
};
|
|
25
|
-
declare const feltFromProto: (i: {
|
|
26
|
-
readonly x0: bigint;
|
|
27
|
-
readonly x1: bigint;
|
|
28
|
-
readonly x2: bigint;
|
|
29
|
-
readonly x3: bigint;
|
|
30
|
-
}, overrideOptions?: _effect_schema_AST.ParseOptions) => `0x${string}`;
|
|
31
|
-
|
|
32
|
-
export { FieldElement as F, FieldElementProto as a, feltFromProto as b, feltToProto as f };
|
package/src/common.test.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
|
|
3
|
-
import { pad } from "viem";
|
|
4
|
-
|
|
5
|
-
import { feltFromProto, feltToProto } from "./common";
|
|
6
|
-
|
|
7
|
-
describe("FieldElement", () => {
|
|
8
|
-
it("should convert to and from proto", () => {
|
|
9
|
-
const felt = "0xcafe0000cafe";
|
|
10
|
-
|
|
11
|
-
const message = feltToProto(felt);
|
|
12
|
-
|
|
13
|
-
expect(message.x0).toBeDefined();
|
|
14
|
-
expect(message.x1).toBeDefined();
|
|
15
|
-
expect(message.x2).toBeDefined();
|
|
16
|
-
expect(message.x3).toBeDefined();
|
|
17
|
-
|
|
18
|
-
const back = feltFromProto(message);
|
|
19
|
-
expect(back).toEqual(pad(felt, { size: 32 }));
|
|
20
|
-
});
|
|
21
|
-
});
|