@asyncswap/engine-rpc 0.0.7 → 0.0.9

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.
Files changed (56) hide show
  1. package/README.md +5 -5
  2. package/dist/engine-api.d.ts +7 -0
  3. package/dist/engine-api.d.ts.map +1 -0
  4. package/dist/engine-api.js +10 -0
  5. package/dist/engine-api.js.map +1 -0
  6. package/dist/index.d.ts +4 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +4 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/types/blob.d.ts +10 -0
  11. package/dist/types/blob.d.ts.map +1 -0
  12. package/dist/types/blob.js +1 -0
  13. package/dist/types/blob.js.map +1 -0
  14. package/dist/types/forkchoice.d.ts +30 -0
  15. package/dist/types/forkchoice.d.ts.map +1 -0
  16. package/dist/types/forkchoice.js +1 -0
  17. package/dist/types/forkchoice.js.map +1 -0
  18. package/dist/types/identification.d.ts +8 -0
  19. package/dist/types/identification.d.ts.map +1 -0
  20. package/dist/types/identification.js +1 -0
  21. package/dist/types/identification.js.map +1 -0
  22. package/dist/types/index.d.ts +7 -0
  23. package/dist/types/index.d.ts.map +1 -0
  24. package/dist/types/index.js +7 -0
  25. package/dist/types/index.js.map +1 -0
  26. package/dist/types/methods.d.ts +159 -0
  27. package/dist/types/methods.d.ts.map +1 -0
  28. package/dist/types/methods.js +1 -0
  29. package/dist/types/methods.js.map +1 -0
  30. package/dist/types/payload.d.ts +116 -0
  31. package/dist/types/payload.d.ts.map +1 -0
  32. package/dist/types/payload.js +9 -0
  33. package/dist/types/payload.js.map +1 -0
  34. package/dist/types/transition-configuration.d.ts +7 -0
  35. package/dist/types/transition-configuration.d.ts.map +1 -0
  36. package/dist/types/transition-configuration.js +1 -0
  37. package/dist/types/transition-configuration.js.map +1 -0
  38. package/package.json +8 -3
  39. package/src/engine-api.ts +4 -15
  40. package/src/index.ts +2 -0
  41. package/src/types/blob.ts +9 -0
  42. package/src/types/forkchoice.ts +36 -0
  43. package/src/types/identification.ts +20 -0
  44. package/src/types/index.ts +6 -0
  45. package/src/types/methods.ts +166 -0
  46. package/src/types/payload.ts +126 -0
  47. package/src/types/transition-configuration.ts +7 -0
  48. package/CHANGELOG.md +0 -57
  49. package/example.ts +0 -6
  50. package/src/types/blob.d.ts +0 -12
  51. package/src/types/forkchoice.d.ts +0 -32
  52. package/src/types/identification.d.ts +0 -24
  53. package/src/types/methods.d.ts +0 -130
  54. package/src/types/payload.d.ts +0 -121
  55. package/src/types/transition-configuration.d.ts +0 -10
  56. package/tsconfig.json +0 -33
package/README.md CHANGED
@@ -13,12 +13,12 @@ bun add @asyncswap/engine-rpc
13
13
  ### Engine API Client
14
14
 
15
15
  ```typescript
16
- import { EngineExecutionClient } from '@asyncswap/engine-rpc';
17
-
18
- const engineUrl = 'http://localhost:8551';
19
- const engine = new EngineExecutionClient(engineUrl, process.env.JWT_TOKEN!);
20
- const payload = await engine.engine_getPayloadV1("0x1");
16
+ import { EngineClient } from "@asyncswap/engine-rpc";
17
+ import type { EngineRpc } from "@asyncswap/engine-rpc";
21
18
 
19
+ const engineUrl = "http://localhost:8551";
20
+ const engine = new EngineClient(engineUrl, process.env.JWT_TOKEN!) as EngineRpc;
21
+ const payload = await engine.eth_chainId();
22
22
  console.log(payload);
23
23
  ```
24
24
 
@@ -0,0 +1,7 @@
1
+ import { BaseClient, type RpcSpec } from "@asyncswap/jsonrpc";
2
+ import type { EngineMethodsSpec } from "./types";
3
+ export declare class EngineClient extends BaseClient<EngineMethodsSpec> {
4
+ constructor(url: string, jwt_token: string);
5
+ }
6
+ export type EngineRpc = EngineClient & RpcSpec<EngineMethodsSpec>;
7
+ //# sourceMappingURL=engine-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-api.d.ts","sourceRoot":"","sources":["../src/engine-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,qBAAa,YAAa,SAAQ,UAAU,CAAC,iBAAiB,CAAC;gBACjD,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAM3C;AAED,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { BaseClient } from "@asyncswap/jsonrpc";
2
+ export class EngineClient extends BaseClient {
3
+ constructor(url, jwt_token) {
4
+ super(url);
5
+ this.headers = {
6
+ Authorization: `Bearer ${jwt_token}`,
7
+ };
8
+ }
9
+ }
10
+ //# sourceMappingURL=engine-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-api.js","sourceRoot":"","sources":["../src/engine-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgB,MAAM,oBAAoB,CAAC;AAG9D,MAAM,OAAO,YAAa,SAAQ,UAA6B;IAC7D,YAAY,GAAW,EAAE,SAAiB;QACxC,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,OAAO,GAAG;YACb,aAAa,EAAE,UAAU,SAAS,EAAE;SACrC,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ export * from "@asyncswap/eth-types";
2
+ export * from "./engine-api";
3
+ export * from "./types";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from "@asyncswap/eth-types";
2
+ export * from "./engine-api";
3
+ export * from "./types";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Bytes, Bytes48 } from "@asyncswap/eth-types";
2
+ export interface BlobAndProofV1 {
3
+ blob: Bytes;
4
+ proof: Bytes48;
5
+ }
6
+ export interface BlobAndProofV2 {
7
+ blob: Bytes;
8
+ proofs: Bytes48[];
9
+ }
10
+ //# sourceMappingURL=blob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob.d.ts","sourceRoot":"","sources":["../../src/types/blob.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC3D,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;CACf;AACD,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,KAAK,CAAC;IACZ,MAAM,EAAE,OAAO,EAAE,CAAC;CAClB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=blob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob.js","sourceRoot":"","sources":["../../src/types/blob.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import type { Address, Bytes8, Bytes32, Hash32, Uint64 } from "@asyncswap/eth-types";
2
+ import type { RestrictedPayloadStatusV1, WithdrawalV1 } from "./payload";
3
+ export interface ForkchoiceStateV1 {
4
+ headBlockHash: Hash32;
5
+ safeBlockHash: Hash32;
6
+ finalizedBlockHash: Hash32;
7
+ }
8
+ export interface ForkchoiceUpdatedResponseV1 {
9
+ payloadStatus: RestrictedPayloadStatusV1;
10
+ payloadId?: Bytes8;
11
+ }
12
+ export interface PayloadAttributesV1 {
13
+ timestamp: Uint64;
14
+ prevRandao: Bytes32;
15
+ suggestedFeeRecipient: Address;
16
+ }
17
+ export interface PayloadAttributesV2 {
18
+ timestamp: Uint64;
19
+ prevRandao: Bytes32;
20
+ suggestedFeeRecipient: Address;
21
+ withdrawals: WithdrawalV1[];
22
+ }
23
+ export interface PayloadAttributesV3 {
24
+ timestamp: Uint64;
25
+ prevRandao: Bytes32;
26
+ suggestedFeeRecipient: Address;
27
+ withdrawals: WithdrawalV1[];
28
+ parentBeaconBlockRoot: Hash32;
29
+ }
30
+ //# sourceMappingURL=forkchoice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forkchoice.d.ts","sourceRoot":"","sources":["../../src/types/forkchoice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,OAAO,EACP,MAAM,EACN,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzE,MAAM,WAAW,iBAAiB;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC3B;AACD,MAAM,WAAW,2BAA2B;IAC3C,aAAa,EAAE,yBAAyB,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,mBAAmB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,qBAAqB,EAAE,OAAO,CAAC;CAC/B;AACD,MAAM,WAAW,mBAAmB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,YAAY,EAAE,CAAC;CAC5B;AACD,MAAM,WAAW,mBAAmB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,YAAY,EAAE,CAAC;IAC5B,qBAAqB,EAAE,MAAM,CAAC;CAC9B"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=forkchoice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forkchoice.js","sourceRoot":"","sources":["../../src/types/forkchoice.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export type ClientVersionV1 = {
2
+ code: ClientCode;
3
+ name: string;
4
+ varsion: string;
5
+ commit: string;
6
+ };
7
+ export type ClientCode = "BU" | "EJ" | "EG" | "GE" | "GR" | "LH" | "LS" | "NM" | "NB" | "TE" | "TK" | "PM" | "RH";
8
+ //# sourceMappingURL=identification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identification.d.ts","sourceRoot":"","sources":["../../src/types/identification.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AACF,MAAM,MAAM,UAAU,GACnB,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=identification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identification.js","sourceRoot":"","sources":["../../src/types/identification.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export * from "./blob";
2
+ export * from "./forkchoice";
3
+ export * from "./identification";
4
+ export * from "./methods";
5
+ export * from "./payload";
6
+ export * from "./transition-configuration";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from "./blob";
2
+ export * from "./forkchoice";
3
+ export * from "./identification";
4
+ export * from "./methods";
5
+ export * from "./payload";
6
+ export * from "./transition-configuration";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,159 @@
1
+ import type { Address, Block, BlockNumberOrTag, BlockNumberOrTagOrHash, Bytes, Bytes8, Filter, FilterResults, GenericTransaction, Hash32, NotFound, SyncingStatus, Uint, Uint64, Uint256 } from "@asyncswap/eth-types";
2
+ import type { BlobAndProofV1, BlobAndProofV2 } from "./blob";
3
+ import type { ForkchoiceStateV1, ForkchoiceUpdatedResponseV1, PayloadAttributesV1, PayloadAttributesV2, PayloadAttributesV3 } from "./forkchoice";
4
+ import type { ClientVersionV1 } from "./identification";
5
+ import type { BlobsBundleV1, BlobsBundleV2, ExecutionPayloadBodyV1, ExecutionPayloadV1, ExecutionPayloadV2, ExecutionPayloadV3, ExecutionPayloadV4, PayloadStatusNoInvalidBlockHash, PayloadStatusV1 } from "./payload";
6
+ import type { TransitionConfigurationV1 } from "./transition-configuration";
7
+ export type EngineMethodsSpec = {
8
+ engine_getClientVersionV1: {
9
+ params: [ClientVersionV1];
10
+ result: ClientVersionV1[];
11
+ };
12
+ eth_blockNumber: {
13
+ params: [];
14
+ result: Uint;
15
+ };
16
+ eth_call: {
17
+ params: [GenericTransaction, BlockNumberOrTagOrHash];
18
+ result: Bytes;
19
+ };
20
+ eth_chainId: {
21
+ params: [];
22
+ result: Uint;
23
+ };
24
+ eth_getCode: {
25
+ params: [Address, BlockNumberOrTagOrHash];
26
+ result: Bytes;
27
+ };
28
+ eth_getBlockByHash: {
29
+ params: [Hash32, boolean];
30
+ result: NotFound | Block;
31
+ };
32
+ eth_getBlockByNumber: {
33
+ params: [BlockNumberOrTag, boolean];
34
+ result: NotFound | Block;
35
+ };
36
+ eth_getLogs: {
37
+ params: [Filter];
38
+ result: FilterResults;
39
+ };
40
+ eth_sendRawTransaction: {
41
+ params: [Bytes];
42
+ result: Hash32;
43
+ };
44
+ eth_syncing: {
45
+ params: [];
46
+ result: SyncingStatus;
47
+ };
48
+ engine_getBlobsV1: {
49
+ params: [Hash32[]];
50
+ result: BlobAndProofV1[];
51
+ };
52
+ engine_getBlobsV2: {
53
+ params: [Hash32[]];
54
+ result: BlobAndProofV2[];
55
+ };
56
+ engine_getBlobsV3: {
57
+ params: [Hash32[]];
58
+ result: Array<BlobAndProofV2[] | null> | null;
59
+ };
60
+ engine_exchangeCapabilities: {
61
+ params: [string[]];
62
+ result: string[];
63
+ };
64
+ engine_forkchoiceUpdatedV1: {
65
+ params: [ForkchoiceStateV1, PayloadAttributesV1];
66
+ result: ForkchoiceUpdatedResponseV1;
67
+ };
68
+ engine_forkchoiceUpdatedV2: {
69
+ params: [ForkchoiceStateV1, PayloadAttributesV2];
70
+ result: ForkchoiceUpdatedResponseV1;
71
+ };
72
+ engine_forkchoiceUpdatedV3: {
73
+ params: [ForkchoiceStateV1, PayloadAttributesV3];
74
+ result: ForkchoiceUpdatedResponseV1;
75
+ };
76
+ engine_newPayloadV1: {
77
+ params: [ExecutionPayloadV1];
78
+ result: PayloadStatusV1;
79
+ };
80
+ engine_newPayloadV2: {
81
+ params: [ExecutionPayloadV1 | ExecutionPayloadV2];
82
+ result: PayloadStatusNoInvalidBlockHash;
83
+ };
84
+ engine_newPayloadV3: {
85
+ params: [ExecutionPayloadV3, Hash32[], Hash32];
86
+ result: PayloadStatusNoInvalidBlockHash;
87
+ };
88
+ engine_newPayloadV4: {
89
+ params: [ExecutionPayloadV3, Hash32[], Hash32, Bytes[]];
90
+ result: PayloadStatusNoInvalidBlockHash;
91
+ };
92
+ engine_getPayloadV1: {
93
+ params: [Bytes8];
94
+ result: ExecutionPayloadV1;
95
+ };
96
+ engine_getPayloadV2: {
97
+ params: [Bytes8];
98
+ result: {
99
+ executionPayload: ExecutionPayloadV1 | ExecutionPayloadV2;
100
+ blockValue: Uint256;
101
+ };
102
+ };
103
+ engine_getPayloadV3: {
104
+ params: [Bytes8];
105
+ result: {
106
+ executionPayload: ExecutionPayloadV3;
107
+ blockValue: Uint256;
108
+ blobsBundle: BlobsBundleV1;
109
+ shouldOverrideBuilder: boolean;
110
+ };
111
+ };
112
+ engine_getPayloadV4: {
113
+ params: [Bytes8];
114
+ result: {
115
+ executionPayload: ExecutionPayloadV3;
116
+ blockValue: Uint256;
117
+ blobsBundle: BlobsBundleV1;
118
+ shouldOverrideBuilder: boolean;
119
+ executionRequests: Bytes[];
120
+ };
121
+ };
122
+ engine_getPayloadV5: {
123
+ params: [Bytes8];
124
+ result: {
125
+ executionPayload: ExecutionPayloadV3;
126
+ blockValue: Uint256;
127
+ blobsBundle: BlobsBundleV2;
128
+ shouldOverrideBuilder: boolean;
129
+ executionRequests: Bytes[];
130
+ };
131
+ };
132
+ engine_getPayloadBodiesByHashV1: {
133
+ params: [Hash32[]];
134
+ result: ExecutionPayloadBodyV1[];
135
+ };
136
+ engine_getPayloadBodiesByRangeV1: {
137
+ params: [Uint64, Uint64];
138
+ result: ExecutionPayloadBodyV1[];
139
+ };
140
+ engine_newPayloadV5: {
141
+ params: [ExecutionPayloadV4, Hash32[], Hash32, Bytes[]];
142
+ result: PayloadStatusNoInvalidBlockHash;
143
+ };
144
+ engine_getPayloadV6: {
145
+ params: [Bytes8];
146
+ result: {
147
+ executionPayload: ExecutionPayloadV4;
148
+ blockValue: Uint256;
149
+ blobsBundle: BlobsBundleV2;
150
+ shouldOverrideBuilder: boolean;
151
+ executionRequests: Bytes[];
152
+ };
153
+ };
154
+ engine_exchangeTransitionConfigurationV1: {
155
+ params: [TransitionConfigurationV1];
156
+ result: TransitionConfigurationV1;
157
+ };
158
+ };
159
+ //# sourceMappingURL=methods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../src/types/methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,OAAO,EACP,KAAK,EACL,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,kBAAkB,EAClB,MAAM,EACN,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,MAAM,EACN,OAAO,EACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,KAAK,EACX,iBAAiB,EACjB,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EACX,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,+BAA+B,EAC/B,eAAe,EACf,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE5E,MAAM,MAAM,iBAAiB,GAAG;IAE/B,yBAAyB,EAAE;QAC1B,MAAM,EAAE,CAAC,eAAe,CAAC,CAAC;QAC1B,MAAM,EAAE,eAAe,EAAE,CAAC;KAC1B,CAAC;IAEF,eAAe,EAAE;QAAE,MAAM,EAAE,EAAE,CAAC;QAAC,MAAM,EAAE,IAAI,CAAA;KAAE,CAAC;IAC9C,QAAQ,EAAE;QACT,MAAM,EAAE,CAAC,kBAA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AC;KACxC,CAAC;IACF,mBAAmB,EAAE;QACpB,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC;QACjB,MAAM,EAAE;YACP,gBAAgB,EAAE,kBAAkB,CAAC;YACrC,UAAU,EAAE,OAAO,CAAC;YACpB,WAAW,EAAE,aAAa,CAAC;YAC3B,qBAAqB,EAAE,OAAO,CAAC;YAC/B,iBAAiB,EAAE,KAAK,EAAE,CAAC;SAC3B,CAAC;KACF,CAAC;IAEF,wCAAwC,EAAE;QACzC,MAAM,EAAE,CAAC,yBAAyB,CAAC,CAAC;QACpC,MAAM,EAAE,yBAAyB,CAAC;KAClC,CAAC;CACF,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=methods.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"methods.js","sourceRoot":"","sources":["../../src/types/methods.ts"],"names":[],"mappings":""}
@@ -0,0 +1,116 @@
1
+ import type { Address, Bytes, Bytes32, Bytes48, Bytes256, Hash32, Uint64 } from "@asyncswap/eth-types";
2
+ export declare enum PAYLOAD_STATUS {
3
+ VALID = "VALID",
4
+ INVALID = "INVALID",
5
+ SYNCING = "SYNCING",
6
+ ACCEPTED = "ACCEPTED",
7
+ INVALID_BLOCK_HASH = "INVALID_BLOCK_HASH"
8
+ }
9
+ export interface PayloadStatusV1 {
10
+ status: PAYLOAD_STATUS;
11
+ latestValidHash?: Hash32;
12
+ validationError?: string;
13
+ }
14
+ export interface RestrictedPayloadStatusV1 {
15
+ status: PAYLOAD_STATUS.VALID | PAYLOAD_STATUS.INVALID | PAYLOAD_STATUS.SYNCING;
16
+ latestValidHash: Hash32;
17
+ validationError: string;
18
+ }
19
+ export interface PayloadStatusNoInvalidBlockHash {
20
+ status: Exclude<PAYLOAD_STATUS, PAYLOAD_STATUS.INVALID_BLOCK_HASH>;
21
+ latestValidHash: Hash32;
22
+ validationError: string;
23
+ }
24
+ export interface ExecutionPayloadV1 {
25
+ parentHash: Hash32;
26
+ feeRecipient: Address;
27
+ stateRoot: Bytes32;
28
+ receiptsRoot: Bytes32;
29
+ logsBloom: Bytes256;
30
+ prevRandao: Bytes32;
31
+ blockNumber: Uint64;
32
+ gasLimit: Uint64;
33
+ gasUsed: Uint64;
34
+ timestamp: Uint64;
35
+ extraData: Bytes32;
36
+ baseFeePerGas: Uint64;
37
+ blockHash: Hash32;
38
+ transactions: Bytes[];
39
+ }
40
+ export interface WithdrawalV1 {
41
+ index: Uint64;
42
+ validatorIndex: Uint64;
43
+ address: Address;
44
+ amount: Uint64;
45
+ }
46
+ export interface ExecutionPayloadV2 {
47
+ parentHash: Hash32;
48
+ feeRecipient: Address;
49
+ stateRoot: Bytes32;
50
+ receiptsRoot: Bytes32;
51
+ logsBloom: Bytes256;
52
+ prevRandao: Bytes32;
53
+ blockNumber: Uint64;
54
+ gasLimit: Uint64;
55
+ gasUsed: Uint64;
56
+ timestamp: Uint64;
57
+ extraData: Bytes32;
58
+ baseFeePerGas: Uint64;
59
+ blockHash: Hash32;
60
+ transactions: Bytes[];
61
+ withdrawals: WithdrawalV1[];
62
+ }
63
+ export interface ExecutionPayloadV3 {
64
+ parentHash: Hash32;
65
+ feeRecipient: Address;
66
+ stateRoot: Bytes32;
67
+ receiptsRoot: Bytes32;
68
+ logsBloom: Bytes256;
69
+ prevRandao: Bytes32;
70
+ blockNumber: Uint64;
71
+ gasLimit: Uint64;
72
+ gasUsed: Uint64;
73
+ timestamp: Uint64;
74
+ extraData: Bytes32;
75
+ baseFeePerGas: Uint64;
76
+ blockHash: Hash32;
77
+ transactions: Bytes[];
78
+ withdrawals: WithdrawalV1[];
79
+ blobGasUsed: Uint64;
80
+ excessBlobGas: Uint64;
81
+ }
82
+ export interface ExecutionPayloadV4 {
83
+ parentHash: Hash32;
84
+ feeRecipient: Address;
85
+ stateRoot: Bytes32;
86
+ receiptsRoot: Bytes32;
87
+ logsBloom: Bytes256;
88
+ prevRandao: Bytes32;
89
+ blockNumber: Uint64;
90
+ gasLimit: Uint64;
91
+ gasUsed: Uint64;
92
+ timestamp: Uint64;
93
+ extraData: Bytes32;
94
+ baseFeePerGas: Uint64;
95
+ blockHash: Hash32;
96
+ transactions: Bytes[];
97
+ withdrawals: WithdrawalV1[];
98
+ blobGasUsed: Uint64;
99
+ excessBlobGas: Uint64;
100
+ blockAccessList: Bytes;
101
+ }
102
+ export interface ExecutionPayloadBodyV1 {
103
+ transactions: Bytes[];
104
+ withdrawals?: WithdrawalV1[];
105
+ }
106
+ export interface BlobsBundleV1 {
107
+ commitments: Bytes48[];
108
+ proofs: Bytes48[];
109
+ blobs: Bytes[];
110
+ }
111
+ export interface BlobsBundleV2 {
112
+ commitments: Bytes48[];
113
+ proofs: Bytes48[];
114
+ blobs: Bytes[];
115
+ }
116
+ //# sourceMappingURL=payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/types/payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,OAAO,EACP,KAAK,EACL,OAAO,EACP,OAAO,EACP,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,sBAAsB,CAAC;AAC9B,oBAAY,cAAc;IACzB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,kBAAkB,uBAAuB;CACzC;AACD,MAAM,WAAW,eAAe;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AACD,MAAM,WAAW,yBAAyB;IACzC,MAAM,EACJ,cAAc,CAAC,KAAK,GACpB,cAAc,CAAC,OAAO,GACtB,cAAc,CAAC,OAAO,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACxB;AACD,MAAM,WAAW,+BAA+B;IAC/C,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACnE,e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,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,KAAK,EAAE,KAAK,EAAE,CAAC;CACf;AACD,MAAM,WAAW,aAAa;IAC7B,WAAW,EAAE,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,KAAK,EAAE,KAAK,EAAE,CAAC;CACf"}
@@ -0,0 +1,9 @@
1
+ export var PAYLOAD_STATUS;
2
+ (function (PAYLOAD_STATUS) {
3
+ PAYLOAD_STATUS["VALID"] = "VALID";
4
+ PAYLOAD_STATUS["INVALID"] = "INVALID";
5
+ PAYLOAD_STATUS["SYNCING"] = "SYNCING";
6
+ PAYLOAD_STATUS["ACCEPTED"] = "ACCEPTED";
7
+ PAYLOAD_STATUS["INVALID_BLOCK_HASH"] = "INVALID_BLOCK_HASH";
8
+ })(PAYLOAD_STATUS || (PAYLOAD_STATUS = {}));
9
+ //# sourceMappingURL=payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../src/types/payload.ts"],"names":[],"mappings":"AASA,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACzB,iCAAe,CAAA;IACf,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;IACrB,2DAAyC,CAAA;AAC1C,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB"}
@@ -0,0 +1,7 @@
1
+ import type { Hash32, Uint64, Uint256 } from "@asyncswap/eth-types";
2
+ export interface TransitionConfigurationV1 {
3
+ terminalTotalDifficulty: Uint256;
4
+ terminalBlockHash: Hash32;
5
+ terminalBlockNumber: Uint64;
6
+ }
7
+ //# sourceMappingURL=transition-configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transition-configuration.d.ts","sourceRoot":"","sources":["../../src/types/transition-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpE,MAAM,WAAW,yBAAyB;IACzC,uBAAuB,EAAE,OAAO,CAAC;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=transition-configuration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transition-configuration.js","sourceRoot":"","sources":["../../src/types/transition-configuration.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@asyncswap/engine-rpc",
3
3
  "description": "A library for Ethereum engine api JSON-RPC spec.",
4
4
  "author": "Meek Msaki",
5
- "version": "0.0.7",
5
+ "version": "0.0.9",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
@@ -14,6 +14,10 @@
14
14
  "execution-client",
15
15
  "json-rpc"
16
16
  ],
17
+ "files": [
18
+ "dist",
19
+ "src"
20
+ ],
17
21
  "homepage": "https://github.com/asyncswap/eth-libs/tree/main/packages/engine-rpc",
18
22
  "repository": {
19
23
  "type": "git",
@@ -33,12 +37,13 @@
33
37
  "format": "bun biome format --write"
34
38
  },
35
39
  "devDependencies": {
36
- "@types/bun": "latest"
40
+ "@types/bun": "latest",
41
+ "@asyncswap/eth-types": "^0.0.1"
37
42
  },
38
43
  "peerDependencies": {
39
44
  "typescript": "^5"
40
45
  },
41
46
  "dependencies": {
42
- "@asyncswap/jsonrpc": "^0.4.11"
47
+ "@asyncswap/jsonrpc": "^0.4.13"
43
48
  }
44
49
  }
package/src/engine-api.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { BaseClient } from "@asyncswap/jsonrpc";
1
+ import { BaseClient, type RpcSpec } from "@asyncswap/jsonrpc";
2
+ import type { EngineMethodsSpec } from "./types";
2
3
 
3
- export class EngineExecutionClient extends BaseClient<EngineMethodsSpec> {
4
+ export class EngineClient extends BaseClient<EngineMethodsSpec> {
4
5
  constructor(url: string, jwt_token: string) {
5
6
  super(url);
6
7
  this.headers = {
@@ -9,16 +10,4 @@ export class EngineExecutionClient extends BaseClient<EngineMethodsSpec> {
9
10
  }
10
11
  }
11
12
 
12
- export type EngineRpcMethods<
13
- MethodsSpec extends Record<
14
- string,
15
- { params: readonly unknown[]; result: unknown }
16
- >,
17
- > = {
18
- [Method in keyof MethodsSpec]: (
19
- ...params: MethodsSpec[Method]["params"]
20
- ) => Promise<MethodsSpec[Method]["result"]>;
21
- };
22
-
23
- export interface EngineExecutionClient
24
- extends EngineRpcMethods<EngineMethodsSpec> { }
13
+ export type EngineRpc = EngineClient & RpcSpec<EngineMethodsSpec>;
package/src/index.ts CHANGED
@@ -1 +1,3 @@
1
+ export * from "@asyncswap/eth-types";
1
2
  export * from "./engine-api";
3
+ export * from "./types";
@@ -0,0 +1,9 @@
1
+ import type { Bytes, Bytes48 } from "@asyncswap/eth-types";
2
+ export interface BlobAndProofV1 {
3
+ blob: Bytes;
4
+ proof: Bytes48;
5
+ }
6
+ export interface BlobAndProofV2 {
7
+ blob: Bytes;
8
+ proofs: Bytes48[];
9
+ }
@@ -0,0 +1,36 @@
1
+ import type {
2
+ Address,
3
+ Bytes8,
4
+ Bytes32,
5
+ Hash32,
6
+ Uint64,
7
+ } from "@asyncswap/eth-types";
8
+ import type { RestrictedPayloadStatusV1, WithdrawalV1 } from "./payload";
9
+ // forkchoice
10
+ export interface ForkchoiceStateV1 {
11
+ headBlockHash: Hash32;
12
+ safeBlockHash: Hash32;
13
+ finalizedBlockHash: Hash32;
14
+ }
15
+ export interface ForkchoiceUpdatedResponseV1 {
16
+ payloadStatus: RestrictedPayloadStatusV1;
17
+ payloadId?: Bytes8;
18
+ }
19
+ export interface PayloadAttributesV1 {
20
+ timestamp: Uint64;
21
+ prevRandao: Bytes32;
22
+ suggestedFeeRecipient: Address;
23
+ }
24
+ export interface PayloadAttributesV2 {
25
+ timestamp: Uint64;
26
+ prevRandao: Bytes32;
27
+ suggestedFeeRecipient: Address;
28
+ withdrawals: WithdrawalV1[];
29
+ }
30
+ export interface PayloadAttributesV3 {
31
+ timestamp: Uint64;
32
+ prevRandao: Bytes32;
33
+ suggestedFeeRecipient: Address;
34
+ withdrawals: WithdrawalV1[];
35
+ parentBeaconBlockRoot: Hash32;
36
+ }
@@ -0,0 +1,20 @@
1
+ export type ClientVersionV1 = {
2
+ code: ClientCode;
3
+ name: string;
4
+ varsion: string;
5
+ commit: string;
6
+ };
7
+ export type ClientCode =
8
+ | "BU" // besu
9
+ | "EJ" // ethereumJs
10
+ | "EG" // erigon
11
+ | "GE" // go-ethereum
12
+ | "GR" // gradine
13
+ | "LH" // lighthouse
14
+ | "LS" // lodestar
15
+ | "NM" // nethermind
16
+ | "NB" // nimbus
17
+ | "TE" // thin-execution
18
+ | "TK" // teku
19
+ | "PM" // prysm
20
+ | "RH"; // reth