Skip to content

Export missing network-specific types #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install dependencies
run: pnpm install --strict-peer-dependencies=false --no-frozen-lockfile
- name: Run build
run: pnpm build --filter=!./examples/cli --filter=!./examples/cli-js
run: pnpm build --filter=!./examples/cli-drizzle --filter=!./examples/cli-instrumentation --filter=!./examples/cli-js
- name: Set git credentials
run: |
git config user.name "Capy Bot"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "beaconchain: export missing types",
"packageName": "@apibara/beaconchain",
"email": "[email protected]",
"dependentChangeType": "patch"
}
7 changes: 7 additions & 0 deletions change/@apibara-evm-328b69a1-8d4e-47f7-b745-df6e9cfaa69a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "evm: export missing types",
"packageName": "@apibara/evm",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "starknet: export missing types",
"packageName": "@apibara/starknet",
"email": "[email protected]",
"dependentChangeType": "patch"
}
4 changes: 4 additions & 0 deletions packages/beaconchain/src/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export const Validator = Schema.Struct({
withdrawableEpoch: Schema.BigIntFromSelf,
});

export type Validator = typeof Validator.Type;

export const Blob = Schema.Struct({
filterIds: Schema.Array(Schema.Number),
blobIndex: Schema.Number,
Expand All @@ -61,6 +63,8 @@ export const Blob = Schema.Struct({
transactionHash: B256,
});

export type Blob = typeof Blob.Type;

export const Signature = Schema.Struct({
r: Schema.optional(U256),
s: Schema.optional(U256),
Expand Down
2 changes: 2 additions & 0 deletions packages/beaconchain/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export const ValidatorStatus = Schema.transform(
},
);

export type ValidatorStatus = typeof ValidatorStatus.Type;

const _B384 = Schema.TemplateLiteral(Schema.Literal("0x"), Schema.String);
const B384Proto = Schema.Struct({
x0: Schema.BigIntFromSelf,
Expand Down
12 changes: 12 additions & 0 deletions packages/evm/src/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const Bloom = Schema.transform(
},
);

export type Bloom = typeof Bloom.Type;

export const TransactionStatus = Schema.transform(
Schema.Enums(proto.data.TransactionStatus),
Schema.Literal("unknown", "succeeded", "reverted"),
Expand Down Expand Up @@ -78,18 +80,24 @@ export const Withdrawal = Schema.Struct({
amount: Schema.BigIntFromSelf,
});

export type Withdrawal = typeof Withdrawal.Type;

export const AccessListItem = Schema.Struct({
address: Address,
storageKeys: Schema.Array(B256),
});

export type AccessListItem = typeof AccessListItem.Type;

export const Signature = Schema.Struct({
r: U256,
s: U256,
v: U256,
YParity: Schema.optional(Schema.Boolean),
});

export type Signature = typeof Signature.Type;

export const Transaction = Schema.Struct({
filterIds: Schema.Array(Schema.Number),
transactionIndex: Schema.Number,
Expand All @@ -112,6 +120,8 @@ export const Transaction = Schema.Struct({
transactionStatus: TransactionStatus,
});

export type Transaction = typeof Transaction.Type;

export const TransactionReceipt = Schema.Struct({
filterIds: Schema.Array(Schema.Number),
transactionIndex: Schema.Number,
Expand All @@ -129,6 +139,8 @@ export const TransactionReceipt = Schema.Struct({
transactionStatus: TransactionStatus,
});

export type TransactionReceipt = typeof TransactionReceipt.Type;

export const Log = Schema.Struct({
filterIds: Schema.Array(Schema.Number),
address: Address,
Expand Down
6 changes: 6 additions & 0 deletions packages/evm/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export const B256 = Schema.transform(B256Proto, _B256, {
},
});

export type B256 = typeof B256.Type;

export const b256ToProto = Schema.encodeSync(B256);
export const b256FromProto = Schema.decodeSync(B256);

Expand Down Expand Up @@ -92,6 +94,8 @@ export const U256 = Schema.transform(U256Proto, Schema.BigIntFromSelf, {
},
});

export type U256 = typeof U256.Type;

export const u256ToProto = Schema.encodeSync(U256);
export const u256FromProto = Schema.decodeSync(U256);

Expand All @@ -113,5 +117,7 @@ export const U128 = Schema.transform(U128Proto, Schema.BigIntFromSelf, {
},
});

export type U128 = typeof U128.Type;

export const u128ToProto = Schema.encodeSync(U128);
export const u128FromProto = Schema.decodeSync(U128);
2 changes: 2 additions & 0 deletions packages/evm/src/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ export const Topic = Schema.transform(
},
);

export type Topic = typeof Topic.Type;

export const LogFilter = Schema.Struct({
id: Schema.optional(Schema.Number),
address: Schema.optional(Address),
Expand Down
Loading