@asyncswap/eth-rpc 0.4.12 → 0.4.14
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/README.md +6 -6
- package/dist/base.d.ts +13 -0
- package/dist/base.d.ts.map +1 -0
- package/dist/base.js +36 -0
- package/dist/base.js.map +1 -0
- package/dist/engine-api.d.ts +13 -0
- package/dist/engine-api.d.ts.map +1 -0
- package/dist/engine-api.js +10 -0
- package/dist/engine-api.js.map +1 -0
- package/dist/eth-api.d.ts +7 -0
- package/dist/eth-api.d.ts.map +1 -0
- package/dist/eth-api.js +7 -0
- package/dist/eth-api.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/mev-api.d.ts +13 -0
- package/dist/mev-api.d.ts.map +1 -0
- package/dist/mev-api.js +7 -0
- package/dist/mev-api.js.map +1 -0
- package/package.json +8 -3
- package/src/eth-api.ts +3 -13
- package/src/index.ts +1 -0
- package/CHANGELOG.md +0 -177
- package/example.ts +0 -10
- package/src/types/base.d.ts +0 -23
- package/src/types/block.d.ts +0 -46
- package/src/types/client.d.ts +0 -11
- package/src/types/debug/methods.d.ts +0 -11
- package/src/types/eth/methods.d.ts +0 -108
- package/src/types/execute.d.ts +0 -85
- package/src/types/feeHistory.d.ts +0 -18
- package/src/types/filter.d.ts +0 -20
- package/src/types/receit.d.ts +0 -36
- package/src/types/state.d.ts +0 -19
- package/src/types/transaction.d.ts +0 -149
- package/src/types/withdraw.d.ts +0 -11
- package/tsconfig.json +0 -33
package/README.md
CHANGED
|
@@ -13,14 +13,14 @@ bun add @asyncswap/eth-rpc
|
|
|
13
13
|
### Execution API Client
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
import { ExecutionClient } from
|
|
17
|
-
|
|
18
|
-
const url = 'http://localhost:8545'
|
|
19
|
-
const eth = new ExecutionClient(url);
|
|
16
|
+
import { ExecutionClient } from "@asyncswap/eth-rpc";
|
|
17
|
+
import type { ExecutionClientRpc } from "@asyncswap/eth-rpc";
|
|
20
18
|
|
|
19
|
+
const url = "http://localhost:8545";
|
|
20
|
+
const eth = new ExecutionClient(url) as ExecutionClientRpc;
|
|
21
21
|
const balance = await eth.eth_getBalance(
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
|
23
|
+
"latest",
|
|
24
24
|
);
|
|
25
25
|
console.log("Balance:", balance);
|
|
26
26
|
eth.eth_getTransactionCount("0x34", "safe");
|
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JsonRpcClient } from "@asyncswap/jsonrpc";
|
|
2
|
+
export type RpcMethodSpec = {
|
|
3
|
+
params: readonly unknown[];
|
|
4
|
+
result: unknown;
|
|
5
|
+
};
|
|
6
|
+
export type RpcSpecBase = Record<string, RpcMethodSpec>;
|
|
7
|
+
export declare abstract class BaseClient<MethodsSpec extends RpcSpecBase> {
|
|
8
|
+
rpc: JsonRpcClient<MethodsSpec>;
|
|
9
|
+
protected headers: Record<string, string>;
|
|
10
|
+
constructor(url: string);
|
|
11
|
+
setHeaders(headers: Record<string, string>): this;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG;IAC3B,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAExD,8BAAsB,UAAU,CAAC,WAAW,SAAS,WAAW;IAC/D,GAAG,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAChC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;gBAEnC,GAAG,EAAE,MAAM;IA8BvB,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAM1C"}
|
package/dist/base.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { JsonRpcClient } from "@asyncswap/jsonrpc";
|
|
2
|
+
export class BaseClient {
|
|
3
|
+
rpc;
|
|
4
|
+
headers = {};
|
|
5
|
+
constructor(url) {
|
|
6
|
+
this.rpc = new JsonRpcClient(url);
|
|
7
|
+
return new Proxy(this, {
|
|
8
|
+
get: (target, prop, receiver) => {
|
|
9
|
+
// let real properties / methods through
|
|
10
|
+
if (prop in target) {
|
|
11
|
+
const value = Reflect.get(target, prop, receiver);
|
|
12
|
+
if (typeof value === "function") {
|
|
13
|
+
return (...args) => {
|
|
14
|
+
const result = value.apply(target, args);
|
|
15
|
+
// if method returns target, return proxy instead
|
|
16
|
+
return result === target ? receiver : result;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
// dynamic rpc
|
|
22
|
+
if (typeof prop !== "string")
|
|
23
|
+
return undefined;
|
|
24
|
+
const method = prop;
|
|
25
|
+
return (...params) => this.rpc.call(this.rpc.buildRequest(method, params), this.headers);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
setHeaders(headers) {
|
|
30
|
+
this.headers = {
|
|
31
|
+
...headers,
|
|
32
|
+
};
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=base.js.map
|
package/dist/base.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQnD,MAAM,OAAgB,UAAU;IAC/B,GAAG,CAA6B;IACtB,OAAO,GAA2B,EAAE,CAAC;IAE/C,YAAY,GAAW;QACtB,IAAI,CAAC,GAAG,GAAG,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;QAElC,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;YACtB,GAAG,EAAE,CAAC,MAAY,EAAE,IAAqB,EAAE,QAAQ,EAAE,EAAE;gBACtD,wCAAwC;gBACxC,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;oBACpB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;oBAClD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;wBACjC,OAAO,CAAC,GAAG,IAAW,EAAE,EAAE;4BACzB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;4BACzC,iDAAiD;4BACjD,OAAO,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;wBAC9C,CAAC,CAAC;oBACH,CAAC;oBACD,OAAO,KAAK,CAAC;gBACd,CAAC;gBACD,cAAc;gBACd,IAAI,OAAO,IAAI,KAAK,QAAQ;oBAAE,OAAO,SAAS,CAAC;gBAE/C,MAAM,MAAM,GAAG,IAAyB,CAAC;gBAEzC,OAAO,CACN,GAAG,MAA4C,EACR,EAAE,CACzC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACrE,CAAC;SACD,CAAC,CAAC;IACJ,CAAC;IAED,UAAU,CAAC,OAA+B;QACzC,IAAI,CAAC,OAAO,GAAG;YACd,GAAG,OAAO;SACV,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseClient } from "./base";
|
|
2
|
+
export declare class EngineExecutionClient extends BaseClient<EngineMethodsSpec> {
|
|
3
|
+
constructor(url: string, jwt_token: string);
|
|
4
|
+
}
|
|
5
|
+
export type EngineRpcMethods<T extends Record<string, {
|
|
6
|
+
params: unknown[];
|
|
7
|
+
result: unknown;
|
|
8
|
+
}>> = {
|
|
9
|
+
[K in keyof T]: (...params: T[K]["params"]) => Promise<T[K]["result"]>;
|
|
10
|
+
};
|
|
11
|
+
export interface EngineExecutionClient extends EngineRpcMethods<EngineMethodsSpec> {
|
|
12
|
+
}
|
|
13
|
+
//# 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,MAAM,QAAQ,CAAC;AAEpC,qBAAa,qBAAsB,SAAQ,UAAU,CAAC,iBAAiB,CAAC;gBAC3D,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAM1C;AAED,MAAM,MAAM,gBAAgB,CAC3B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,IAC7D;KACD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;CACtE,CAAC;AAEH,MAAM,WAAW,qBAChB,SAAQ,gBAAgB,CAAC,iBAAiB,CAAC;CAAI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-api.js","sourceRoot":"","sources":["../src/engine-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,OAAO,qBAAsB,SAAQ,UAA6B;IACvE,YAAY,GAAW,EAAE,SAAiB;QACzC,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,OAAO,GAAG;YACd,aAAa,EAAE,UAAU,SAAS,EAAE;SACpC,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EthMethodsSpec } from "@asyncswap/eth-types";
|
|
2
|
+
import { BaseClient, type RpcSpec } from "@asyncswap/jsonrpc";
|
|
3
|
+
export declare class ExecutionClient extends BaseClient<EthMethodsSpec> {
|
|
4
|
+
constructor(url: string);
|
|
5
|
+
}
|
|
6
|
+
export type ExecutionClientRpc = ExecutionClient & RpcSpec<EthMethodsSpec>;
|
|
7
|
+
//# sourceMappingURL=eth-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eth-api.d.ts","sourceRoot":"","sources":["../src/eth-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE9D,qBAAa,eAAgB,SAAQ,UAAU,CAAC,cAAc,CAAC;gBAClD,GAAG,EAAE,MAAM;CAGvB;AAED,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC"}
|
package/dist/eth-api.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eth-api.js","sourceRoot":"","sources":["../src/eth-api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAgB,MAAM,oBAAoB,CAAC;AAE9D,MAAM,OAAO,eAAgB,SAAQ,UAA0B;IAC9D,YAAY,GAAW;QACtB,KAAK,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;CACD"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseClient } from "./base";
|
|
2
|
+
export declare class FlashbotsClient extends BaseClient<FlashbotsMethodsSpec> {
|
|
3
|
+
constructor(url: string);
|
|
4
|
+
}
|
|
5
|
+
export type FlashbotsRpcMethods<T extends Record<string, {
|
|
6
|
+
params: unknown[];
|
|
7
|
+
result: unknown;
|
|
8
|
+
}>> = {
|
|
9
|
+
[M in keyof T]: (...params: T[M]["params"]) => Promise<T[M]["result"]>;
|
|
10
|
+
};
|
|
11
|
+
export interface FlashbotsClient extends FlashbotsRpcMethods<FlashbotsMethodsSpec> {
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=mev-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mev-api.d.ts","sourceRoot":"","sources":["../src/mev-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,qBAAa,eAAgB,SAAQ,UAAU,CAAC,oBAAoB,CAAC;gBACxD,GAAG,EAAE,MAAM;CAKvB;AAED,MAAM,MAAM,mBAAmB,CAC9B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,IAC7D;KACD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;CACtE,CAAC;AACH,MAAM,WAAW,eAChB,SAAQ,mBAAmB,CAAC,oBAAoB,CAAC;CAAI"}
|
package/dist/mev-api.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mev-api.js","sourceRoot":"","sources":["../src/mev-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,OAAO,eAAgB,SAAQ,UAAgC;IACpE,YAAY,GAAW;QACtB,KAAK,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;CAGD"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@asyncswap/eth-rpc",
|
|
3
3
|
"description": "A library for ethereum execution clients apis.",
|
|
4
4
|
"author": "Meek Msaki",
|
|
5
|
-
"version": "0.4.
|
|
5
|
+
"version": "0.4.14",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
"engine-api",
|
|
16
16
|
"execution-apis"
|
|
17
17
|
],
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"src"
|
|
21
|
+
],
|
|
18
22
|
"homepage": "https://github.com/asyncswap/eth-libs/tree/main/packages/eth-rpc",
|
|
19
23
|
"repository": {
|
|
20
24
|
"type": "git",
|
|
@@ -34,12 +38,13 @@
|
|
|
34
38
|
"format": "bun biome format --write"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
|
-
"@types/bun": "latest"
|
|
41
|
+
"@types/bun": "latest",
|
|
42
|
+
"@asyncswap/eth-types": "^0.0.1"
|
|
38
43
|
},
|
|
39
44
|
"peerDependencies": {
|
|
40
45
|
"typescript": "^5"
|
|
41
46
|
},
|
|
42
47
|
"dependencies": {
|
|
43
|
-
"@asyncswap/jsonrpc": "^0.4.
|
|
48
|
+
"@asyncswap/jsonrpc": "^0.4.13"
|
|
44
49
|
}
|
|
45
50
|
}
|
package/src/eth-api.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { EthMethodsSpec } from "@asyncswap/eth-types";
|
|
2
|
+
import { BaseClient, type RpcSpec } from "@asyncswap/jsonrpc";
|
|
2
3
|
|
|
3
4
|
export class ExecutionClient extends BaseClient<EthMethodsSpec> {
|
|
4
5
|
constructor(url: string) {
|
|
@@ -6,15 +7,4 @@ export class ExecutionClient extends BaseClient<EthMethodsSpec> {
|
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
export type
|
|
10
|
-
MethodsSpec extends Record<
|
|
11
|
-
string,
|
|
12
|
-
{ params: readonly unknown[]; result: unknown }
|
|
13
|
-
>,
|
|
14
|
-
> = {
|
|
15
|
-
[Method in keyof MethodsSpec]: (
|
|
16
|
-
...params: MethodsSpec[Method]["params"]
|
|
17
|
-
) => Promise<MethodsSpec[Method]["result"]>;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export interface ExecutionClient extends EthRpcMethods<EthMethodsSpec> { }
|
|
10
|
+
export type ExecutionClientRpc = ExecutionClient & RpcSpec<EthMethodsSpec>;
|
package/src/index.ts
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
# @asyncswap/eth-rpc
|
|
2
|
-
|
|
3
|
-
## 0.4.12
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- 2f7dece: fixes build
|
|
8
|
-
- Updated dependencies [2f7dece]
|
|
9
|
-
- @asyncswap/jsonrpc@0.4.11
|
|
10
|
-
|
|
11
|
-
## 0.4.11
|
|
12
|
-
|
|
13
|
-
### Patch Changes
|
|
14
|
-
|
|
15
|
-
- 69a2d7e: patch types updates
|
|
16
|
-
- Updated dependencies [69a2d7e]
|
|
17
|
-
- @asyncswap/jsonrpc@0.4.10
|
|
18
|
-
|
|
19
|
-
## 0.4.10
|
|
20
|
-
|
|
21
|
-
### Patch Changes
|
|
22
|
-
|
|
23
|
-
- dc792b1: (refactor): change to `withHeaders` option and update BaseClient source
|
|
24
|
-
- Updated dependencies [dc792b1]
|
|
25
|
-
- @asyncswap/jsonrpc@0.4.9
|
|
26
|
-
|
|
27
|
-
## 0.4.9
|
|
28
|
-
|
|
29
|
-
### Patch Changes
|
|
30
|
-
|
|
31
|
-
- e9fc1df: remove biome dep
|
|
32
|
-
- Updated dependencies [e9fc1df]
|
|
33
|
-
- @asyncswap/jsonrpc@0.4.8
|
|
34
|
-
|
|
35
|
-
## 0.4.8
|
|
36
|
-
|
|
37
|
-
### Patch Changes
|
|
38
|
-
|
|
39
|
-
- cad9042: minimal eth rpc client
|
|
40
|
-
|
|
41
|
-
- ported engine api to different package
|
|
42
|
-
|
|
43
|
-
## 0.4.7
|
|
44
|
-
|
|
45
|
-
### Patch Changes
|
|
46
|
-
|
|
47
|
-
- ff4e035: fix base client proxy
|
|
48
|
-
|
|
49
|
-
```ts
|
|
50
|
-
setHeaders(...) {
|
|
51
|
-
this.headers = ...
|
|
52
|
-
return this; // ❌ returns the *target*
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
The correct fix: return the receiver / proxy, not this
|
|
57
|
-
|
|
58
|
-
You already have access to the proxy inside the get trap via receiver.
|
|
59
|
-
|
|
60
|
-
So you must bind methods so that they return the proxy.
|
|
61
|
-
|
|
62
|
-
- setHeaders() mutates the target
|
|
63
|
-
- returns receiver (the proxy)
|
|
64
|
-
- chaining continues in proxy-land
|
|
65
|
-
- RPC methods remain visible
|
|
66
|
-
|
|
67
|
-
## 0.4.6
|
|
68
|
-
|
|
69
|
-
### Patch Changes
|
|
70
|
-
|
|
71
|
-
- 3d6ec6e: add clinet version spec
|
|
72
|
-
|
|
73
|
-
## 0.4.5
|
|
74
|
-
|
|
75
|
-
### Patch Changes
|
|
76
|
-
|
|
77
|
-
- 0d1be5d: upgrade with parameter typing
|
|
78
|
-
- Updated dependencies [882f94f]
|
|
79
|
-
- @asyncswap/jsonrpc@0.4.7
|
|
80
|
-
|
|
81
|
-
## 0.4.4
|
|
82
|
-
|
|
83
|
-
### Patch Changes
|
|
84
|
-
|
|
85
|
-
- b2b631f: deprecated `EthExecutionClien` use `ExecutionClient`
|
|
86
|
-
- Updated dependencies [f7d28d9]
|
|
87
|
-
- @asyncswap/jsonrpc@0.4.4
|
|
88
|
-
|
|
89
|
-
## 0.4.3
|
|
90
|
-
|
|
91
|
-
### Patch Changes
|
|
92
|
-
|
|
93
|
-
- 7ae86a0: new refactor on methods as data
|
|
94
|
-
- Updated dependencies [40a79dc]
|
|
95
|
-
- @asyncswap/jsonrpc@0.4.3
|
|
96
|
-
|
|
97
|
-
## 0.4.2
|
|
98
|
-
|
|
99
|
-
### Patch Changes
|
|
100
|
-
|
|
101
|
-
- 9512db5: update documentation
|
|
102
|
-
- Updated dependencies [9512db5]
|
|
103
|
-
- @asyncswap/jsonrpc@0.4.2
|
|
104
|
-
|
|
105
|
-
## 0.4.1
|
|
106
|
-
|
|
107
|
-
### Patch Changes
|
|
108
|
-
|
|
109
|
-
- 2598f09: updates docs
|
|
110
|
-
|
|
111
|
-
## 0.4.0
|
|
112
|
-
|
|
113
|
-
### Minor Changes
|
|
114
|
-
|
|
115
|
-
- fd79ea3: updates api for eth-client and adds flasbots methods and headers
|
|
116
|
-
|
|
117
|
-
### Patch Changes
|
|
118
|
-
|
|
119
|
-
- Updated dependencies [43de065]
|
|
120
|
-
- Updated dependencies [7e8300c]
|
|
121
|
-
- Updated dependencies [7126afa]
|
|
122
|
-
- @asyncswap/jsonrpc@0.5.0
|
|
123
|
-
|
|
124
|
-
## 0.3.0
|
|
125
|
-
|
|
126
|
-
### Minor Changes
|
|
127
|
-
|
|
128
|
-
- d2562a2: implemented execution apis methods
|
|
129
|
-
|
|
130
|
-
eth/transation
|
|
131
|
-
|
|
132
|
-
- eth_getTransactionByHash
|
|
133
|
-
- eth_getTransactionByBlockHashAndIndex
|
|
134
|
-
- eth_getTransactionReceipt
|
|
135
|
-
|
|
136
|
-
eth/submit
|
|
137
|
-
|
|
138
|
-
- eth_sendTransaction
|
|
139
|
-
- eth_sendRawTransaction
|
|
140
|
-
|
|
141
|
-
eth/state
|
|
142
|
-
|
|
143
|
-
- eth_getBalance
|
|
144
|
-
- eth_getStorageAt
|
|
145
|
-
- eth_getTransactionCount
|
|
146
|
-
- eth_getCode
|
|
147
|
-
- eth_getProof
|
|
148
|
-
|
|
149
|
-
eth/sign
|
|
150
|
-
|
|
151
|
-
- eth_sign
|
|
152
|
-
- eth_signTransaction
|
|
153
|
-
|
|
154
|
-
eth/filter
|
|
155
|
-
|
|
156
|
-
- eth_newFilter
|
|
157
|
-
- eth_newBlockFilter
|
|
158
|
-
- eth_newPendingTransactionFilter
|
|
159
|
-
- eth_uninstallFilter
|
|
160
|
-
- eth_getFilterChanges
|
|
161
|
-
- eth_getFilterLogs
|
|
162
|
-
- eth_getLogs
|
|
163
|
-
|
|
164
|
-
- dc1718c: refactor of types dir to global types
|
|
165
|
-
|
|
166
|
-
### Patch Changes
|
|
167
|
-
|
|
168
|
-
- e3ac747: patch
|
|
169
|
-
- a9d1a29: add biome formatting
|
|
170
|
-
- Updated dependencies [dc1718c]
|
|
171
|
-
- Updated dependencies [e15733c]
|
|
172
|
-
- Updated dependencies [e3ac747]
|
|
173
|
-
- Updated dependencies [abddcdc]
|
|
174
|
-
- Updated dependencies [00ba692]
|
|
175
|
-
- Updated dependencies [07dc4e5]
|
|
176
|
-
- Updated dependencies [ded3e6b]
|
|
177
|
-
- @asyncswap/jsonrpc@0.3.0
|
package/example.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ExecutionClient } from "./src";
|
|
2
|
-
|
|
3
|
-
const url = "http://localhost:8545";
|
|
4
|
-
const eth = new ExecutionClient(url);
|
|
5
|
-
const balance = await eth.eth_getBalance(
|
|
6
|
-
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
|
7
|
-
"latest",
|
|
8
|
-
);
|
|
9
|
-
console.log("Balance:", balance);
|
|
10
|
-
eth.eth_getTransactionCount("0x34", "safe");
|
package/src/types/base.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
// base.yaml
|
|
3
|
-
export type Hex = `0x${string}`;
|
|
4
|
-
export type Address = `0x${string}`;
|
|
5
|
-
export type Addresses = Address[];
|
|
6
|
-
export type Byte = Hex;
|
|
7
|
-
export type Bytes = Hex;
|
|
8
|
-
export type Bytes32 = Hex;
|
|
9
|
-
export type Bytes8 = Hex;
|
|
10
|
-
export type Bytes48 = Hex;
|
|
11
|
-
export type Bytes96 = Hex;
|
|
12
|
-
export type Bytes256 = Hex;
|
|
13
|
-
export type Bytes65 = Hex;
|
|
14
|
-
export type Ratio = number;
|
|
15
|
-
export type Uint = Hex;
|
|
16
|
-
export type Uint64 = Hex;
|
|
17
|
-
export type Uint256 = Hex;
|
|
18
|
-
export type UintDecimal = string; // e.g '1'
|
|
19
|
-
export type Hash32 = Hex;
|
|
20
|
-
export type NotFound = null;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { };
|
package/src/types/block.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
// block.yaml
|
|
3
|
-
export type BlockTag =
|
|
4
|
-
| "earliest"
|
|
5
|
-
| "finalized"
|
|
6
|
-
| "safe"
|
|
7
|
-
| "latest"
|
|
8
|
-
| "pending";
|
|
9
|
-
export type BlockNumberOrTag = Hex | BlockTag;
|
|
10
|
-
export type BlockNumberOrTagOrHash = BlockNumberOrTag | Hex;
|
|
11
|
-
export interface Block {
|
|
12
|
-
hash: Hash32;
|
|
13
|
-
parentHash: Hash32;
|
|
14
|
-
sha3Uncles: Hash32;
|
|
15
|
-
miner: Address;
|
|
16
|
-
stateRoot: Hash32;
|
|
17
|
-
transactionsRoot: Hash32;
|
|
18
|
-
receiptsRoot: Hash32;
|
|
19
|
-
logsBloom: Bytes256;
|
|
20
|
-
number: Uint;
|
|
21
|
-
gasLimit: Uint;
|
|
22
|
-
gasUsed: Uint;
|
|
23
|
-
timestamp: Uint;
|
|
24
|
-
extraData: Bytes;
|
|
25
|
-
mixHash: Hash32;
|
|
26
|
-
nonce: Bytes8;
|
|
27
|
-
size: Uint;
|
|
28
|
-
transactions: Hash32[] | TransactionInfo[];
|
|
29
|
-
uncles: Hash32[];
|
|
30
|
-
requestedHash?: Hash32;
|
|
31
|
-
baseFeePerGas?: Uint;
|
|
32
|
-
withdrawalsRoot?: Hash32;
|
|
33
|
-
blobGasUsed?: Uint;
|
|
34
|
-
excessBlobGas?: Uint;
|
|
35
|
-
parentBeaconBlockRoot?: Hash32;
|
|
36
|
-
withdrawals?: Withdrawal[];
|
|
37
|
-
difficulty?: Uint;
|
|
38
|
-
}
|
|
39
|
-
export interface BadBlock {
|
|
40
|
-
block: Block;
|
|
41
|
-
hash: Hash32;
|
|
42
|
-
rlp: Bytes;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { };
|
package/src/types/client.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
export type DebugMethods = {
|
|
3
|
-
debug_getRawHeader: { params: [BlockNumberOrTag]; result: Bytes };
|
|
4
|
-
debug_getRawBlock: { params: [BlockNumberOrTag]; result: Bytes };
|
|
5
|
-
debug_getRawTransaction: { params: [Hash32]; result: Bytes };
|
|
6
|
-
debug_getRawReceipts: { params: [BlockNumberOrTag]; result: Bytes[] };
|
|
7
|
-
debug_getBadBlocks: { params: []; result: BadBlock[] };
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { };
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
export type EthMethodsSpec = {
|
|
3
|
-
eth_getTransactionByHash: {
|
|
4
|
-
params: [Hash32];
|
|
5
|
-
result: NotFound | TransactionInfo;
|
|
6
|
-
};
|
|
7
|
-
eth_getTransactionByBlockHashAndIndex: {
|
|
8
|
-
params: [Hash32, Uint];
|
|
9
|
-
result: NotFound | TransactionInfo;
|
|
10
|
-
};
|
|
11
|
-
eth_getTransactionReceipt: {
|
|
12
|
-
params: [Hash32];
|
|
13
|
-
result: NotFound | ReceiptInfo;
|
|
14
|
-
};
|
|
15
|
-
// eth/submit
|
|
16
|
-
eth_sendTransaction: { params: [GenericTransaction]; result: Hash32 };
|
|
17
|
-
eth_sendRawTransaction: { params: [Bytes]; result: Hash32 };
|
|
18
|
-
// eth/state
|
|
19
|
-
eth_getBalance: {
|
|
20
|
-
params: [Address, BlockNumberOrTagOrHash];
|
|
21
|
-
result: Uint;
|
|
22
|
-
};
|
|
23
|
-
eth_getStorageAt: {
|
|
24
|
-
params: [Address, Bytes32, BlockNumberOrTagOrHash];
|
|
25
|
-
result: Bytes;
|
|
26
|
-
};
|
|
27
|
-
eth_getTransactionCount: {
|
|
28
|
-
params: [Address, BlockNumberOrTagOrHash];
|
|
29
|
-
result: Uint;
|
|
30
|
-
};
|
|
31
|
-
eth_getCode: {
|
|
32
|
-
params: [Address, BlockNumberOrTagOrHash];
|
|
33
|
-
result: Bytes;
|
|
34
|
-
};
|
|
35
|
-
eth_getProof: {
|
|
36
|
-
params: [Address, Bytes32[], BlockNumberOrTagOrHash];
|
|
37
|
-
result: AccountProof;
|
|
38
|
-
};
|
|
39
|
-
// eth/sign
|
|
40
|
-
eth_sign: { params: [Address, Bytes]; result: Bytes65 };
|
|
41
|
-
eth_signTransaction: { params: [GenericTransaction]; result: Bytes };
|
|
42
|
-
// eth/filter
|
|
43
|
-
eth_newFilter: { params: [Filter]; result: Uint };
|
|
44
|
-
eth_newBlockFilter: { params: []; result: Uint };
|
|
45
|
-
eth_newPendingTransactionFilter: { params: []; result: Uint };
|
|
46
|
-
eth_uninstallFilter: { params: []; result: Uint };
|
|
47
|
-
eth_getFilterChanges: { params: []; result: FilterResults };
|
|
48
|
-
eth_getFilterLogs: { params: [Uint]; result: FilterResults };
|
|
49
|
-
eth_getLogs: { params: [Filter]; result: FilterResults };
|
|
50
|
-
// eth/feeMarket
|
|
51
|
-
eth_gasPrice: { params: []; result: Uint };
|
|
52
|
-
eth_blobBaseFee: { params: []; result: Uint };
|
|
53
|
-
eth_maxPriorityFeePerGas: { params: []; result: Uint };
|
|
54
|
-
eth_feeHistory: {
|
|
55
|
-
params: [Uint, BlockNumberOrTag, number[]];
|
|
56
|
-
result: FeeHistoryResults;
|
|
57
|
-
};
|
|
58
|
-
// eth/execute
|
|
59
|
-
eth_call: {
|
|
60
|
-
params: [GenericTransaction, BlockNumberOrTagOrHash];
|
|
61
|
-
result: Bytes;
|
|
62
|
-
};
|
|
63
|
-
eth_estimateGas: {
|
|
64
|
-
params: [GenericTransaction, BlockNumberOrTag];
|
|
65
|
-
result: Uint;
|
|
66
|
-
};
|
|
67
|
-
eth_createAccessList: {
|
|
68
|
-
params: [GenericTransaction, BlockNumberOrTag];
|
|
69
|
-
result: AccessListResult;
|
|
70
|
-
};
|
|
71
|
-
eth_simulateV1: {
|
|
72
|
-
params: [EthSimulatePayload, BlockNumberOrTagOrHash];
|
|
73
|
-
result: EthSimulateResult;
|
|
74
|
-
};
|
|
75
|
-
// eth/client
|
|
76
|
-
eth_chainId: { params: []; result: Uint };
|
|
77
|
-
eth_syncing: { params: []; result: SyncingStatus };
|
|
78
|
-
eth_coinbase: { params: []; result: Address };
|
|
79
|
-
eth_accounts: { params: []; result: Addresses };
|
|
80
|
-
eth_blockNumber: { params: []; result: Uint };
|
|
81
|
-
net_version: { params: []; result: UintDecimal };
|
|
82
|
-
// eth/block
|
|
83
|
-
eth_getBlockByHash: { params: [Hash32, boolean]; result: NotFound | Block };
|
|
84
|
-
eth_getBlockByNumber: {
|
|
85
|
-
params: [BlockNumberOrTag, boolean];
|
|
86
|
-
result: NotFound | Block;
|
|
87
|
-
};
|
|
88
|
-
eth_getBlockTransactionCountByHash: {
|
|
89
|
-
params: [Hash32];
|
|
90
|
-
result: NotFound | Uint;
|
|
91
|
-
};
|
|
92
|
-
eth_getBlockTransactionCountByNumber: {
|
|
93
|
-
params: [BlockNumberOrTag];
|
|
94
|
-
result: NotFound | Uint;
|
|
95
|
-
};
|
|
96
|
-
eth_getUncleCountByBlockHash: { params: [Hash32]; result: NotFound | Uint };
|
|
97
|
-
eth_getUncleCountByBlockNumber: {
|
|
98
|
-
params: [BlockNumberOrTag];
|
|
99
|
-
result: NotFound | Uint;
|
|
100
|
-
};
|
|
101
|
-
eth_getBlockReceipts: {
|
|
102
|
-
params: [BlockNumberOrTagOrHash];
|
|
103
|
-
result: NotFound | ReceiptInfo[];
|
|
104
|
-
};
|
|
105
|
-
} & DebugMethods;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export { };
|
package/src/types/execute.d.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
// execute.yaml
|
|
3
|
-
export interface EthSimulatePayload {
|
|
4
|
-
blockStateCalls: BlockStateCall[];
|
|
5
|
-
traceTransfers?: boolean;
|
|
6
|
-
validation?: boolean;
|
|
7
|
-
returnFullTransactions?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface BlockStateCall {
|
|
10
|
-
blockOverrides?: BlockOverrides;
|
|
11
|
-
stateOverrides?: StateOverrides;
|
|
12
|
-
calls?: GenericCallTransaction[];
|
|
13
|
-
}
|
|
14
|
-
export interface BlockOverrides {
|
|
15
|
-
number?: Uint64;
|
|
16
|
-
prevRandao?: Uint256;
|
|
17
|
-
time?: Uint64;
|
|
18
|
-
gasLimit?: Uint64;
|
|
19
|
-
feeRecipient?: Address;
|
|
20
|
-
baseFeePerGas?: Uint256;
|
|
21
|
-
withdrawals?: Withdrawal[];
|
|
22
|
-
blobBaseFee?: Uint64;
|
|
23
|
-
}
|
|
24
|
-
export type StateOverrides = Record<Address, AccountOverride>;
|
|
25
|
-
export interface GenericCallTransaction {
|
|
26
|
-
type?: "0x0" | "0x1" | "0x2" | "0x3";
|
|
27
|
-
to?: Address | null;
|
|
28
|
-
from?: Address;
|
|
29
|
-
value?: Uint;
|
|
30
|
-
nonce?: Uint;
|
|
31
|
-
gas?: Uint;
|
|
32
|
-
input?: Bytes;
|
|
33
|
-
gasPrice?: Uint;
|
|
34
|
-
maxPriorityFeePerGas?: Uint;
|
|
35
|
-
maxFeePerGas?: Uint;
|
|
36
|
-
maxFeePerBlobGas?: Uint;
|
|
37
|
-
accessList?: AccessListEntry[];
|
|
38
|
-
blobVersionedHashes?: Hash32[];
|
|
39
|
-
authorizationList?: AuthorizationList;
|
|
40
|
-
}
|
|
41
|
-
export type AccountOverride = AccountOverrideState | AccountOverrideStateDiff;
|
|
42
|
-
export interface AccountOverrideState {
|
|
43
|
-
state: AccountStorage;
|
|
44
|
-
nonce?: Uint64;
|
|
45
|
-
balance?: Uint256;
|
|
46
|
-
code?: Bytes;
|
|
47
|
-
movePrecompileToAddress?: Address;
|
|
48
|
-
}
|
|
49
|
-
export interface AccountOverrideStateDiff {
|
|
50
|
-
stateDiff: AccountStorage;
|
|
51
|
-
nonce?: Uint64;
|
|
52
|
-
balance?: Uint256;
|
|
53
|
-
code?: Bytes;
|
|
54
|
-
movePrecompileToAddress?: Address;
|
|
55
|
-
}
|
|
56
|
-
export type AccountStorage = Record<Bytes32, Hash32>;
|
|
57
|
-
export type EthSimulateResult = EthSimulateBlockResultSingleSuccess[];
|
|
58
|
-
|
|
59
|
-
export type EthSimulateBlockResultSingleSuccess = {
|
|
60
|
-
calls: CallResults;
|
|
61
|
-
} & Block;
|
|
62
|
-
export type CallResults = CallResultFailure | CallResultSuccess;
|
|
63
|
-
export interface CallResultFailure {
|
|
64
|
-
status: "0x0";
|
|
65
|
-
returnData: Bytes;
|
|
66
|
-
gasUsed: Uint64;
|
|
67
|
-
error: EXECUTION_REVERTED_ERROR | VM_EXECUTION_ERROR;
|
|
68
|
-
}
|
|
69
|
-
export type EXECUTION_REVERTED_ERROR = {
|
|
70
|
-
code: -32000;
|
|
71
|
-
message: "execution reverted.";
|
|
72
|
-
};
|
|
73
|
-
export type VM_EXECUTION_ERROR = {
|
|
74
|
-
code: -32015;
|
|
75
|
-
message: "vm execution error.";
|
|
76
|
-
};
|
|
77
|
-
export interface CallResultSuccess {
|
|
78
|
-
status: "0x1";
|
|
79
|
-
returnData: Bytes;
|
|
80
|
-
gasUsed: Uint64;
|
|
81
|
-
logs: Log[];
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export { };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
// misc
|
|
3
|
-
export interface FeeHistoryResults {
|
|
4
|
-
oldestBlock: Uint;
|
|
5
|
-
baseFeePerGas: Uint[];
|
|
6
|
-
baseFeePerBlobGas?: Uint[];
|
|
7
|
-
gasUsedRatio: Ratio[];
|
|
8
|
-
blobGasUsedRatio?: Ratio[];
|
|
9
|
-
reward?: Uint[][];
|
|
10
|
-
}
|
|
11
|
-
export interface AccessListResult {
|
|
12
|
-
accessList?: AccessListEntry[];
|
|
13
|
-
error?: string;
|
|
14
|
-
gasUsed?: Uint;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { };
|
package/src/types/filter.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
// filter.yaml
|
|
3
|
-
export type FilterResults = Hash32[] | Log[];
|
|
4
|
-
export type FilterTopic = Bytes32 | Bytes32[];
|
|
5
|
-
export type FilterTopics = FilterTopic | null;
|
|
6
|
-
export type Filter = FilterByBlockRange | FilterByBlockHash;
|
|
7
|
-
export interface FilterByBlockRange {
|
|
8
|
-
fromBlock?: Uint;
|
|
9
|
-
toBlock?: Uint;
|
|
10
|
-
address?: null | Address | Addresses;
|
|
11
|
-
topics?: FilterTopics;
|
|
12
|
-
}
|
|
13
|
-
export interface FilterByBlockHash {
|
|
14
|
-
blockHash: Hash32;
|
|
15
|
-
address?: Address | Addresses | null;
|
|
16
|
-
topics?: FilterTopics;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { };
|
package/src/types/receit.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
// receipt.yaml
|
|
3
|
-
export interface Log {
|
|
4
|
-
transactionHash: Hash32;
|
|
5
|
-
removed?: boolean;
|
|
6
|
-
logIndex?: Uint;
|
|
7
|
-
transactionIndex?: Uint;
|
|
8
|
-
blockHash?: Hash32;
|
|
9
|
-
blockNumber?: Uint;
|
|
10
|
-
blockTimestamp?: Uint;
|
|
11
|
-
address?: Address;
|
|
12
|
-
data?: Bytes;
|
|
13
|
-
topics?: Bytes32[];
|
|
14
|
-
}
|
|
15
|
-
export interface ReceiptInfo {
|
|
16
|
-
type?: Byte;
|
|
17
|
-
transactionHash: Hash32;
|
|
18
|
-
transactionIndex: Uint;
|
|
19
|
-
blockHash: Byte;
|
|
20
|
-
blockNumber: Uint;
|
|
21
|
-
from: Address;
|
|
22
|
-
to?: Address | null;
|
|
23
|
-
cumulativeGasUsed: Uint;
|
|
24
|
-
gasUsed: Uint;
|
|
25
|
-
blobGasUsed?: Uint;
|
|
26
|
-
contractAddress?: Address | null;
|
|
27
|
-
logs: Log[];
|
|
28
|
-
logsBloom: Bytes256;
|
|
29
|
-
root?: Hash32;
|
|
30
|
-
status?: Uint;
|
|
31
|
-
effectiveGasPrice: Uint;
|
|
32
|
-
blobGasPrice?: Uint;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { };
|
package/src/types/state.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
// state.yaml
|
|
3
|
-
export interface AccountProof {
|
|
4
|
-
address: Address;
|
|
5
|
-
accountProof: Bytes;
|
|
6
|
-
balance: Uint256;
|
|
7
|
-
codeHash: Hash32;
|
|
8
|
-
nonce: Uint64;
|
|
9
|
-
storageHash: Hash32;
|
|
10
|
-
storageProof: StorageProof;
|
|
11
|
-
}
|
|
12
|
-
export interface StorageProof {
|
|
13
|
-
key: Bytes32;
|
|
14
|
-
value: Uint256;
|
|
15
|
-
proof: Bytes;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { };
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
// transaction.yaml
|
|
3
|
-
export interface AccessListEntry {
|
|
4
|
-
address: Address;
|
|
5
|
-
storageKeys: Hash32[];
|
|
6
|
-
}
|
|
7
|
-
export type TransactionUnsigned =
|
|
8
|
-
| TransactionLegacyUnsigned
|
|
9
|
-
| Transaction2930Unsigned
|
|
10
|
-
| Transaction1559Unsigned
|
|
11
|
-
| Transaction4844Unsigned
|
|
12
|
-
| Transaction7702Unsigned;
|
|
13
|
-
|
|
14
|
-
export interface TransactionLegacyUnsigned {
|
|
15
|
-
type: "0x0";
|
|
16
|
-
nonce: Uint;
|
|
17
|
-
to?: Address | null;
|
|
18
|
-
gas: Uint;
|
|
19
|
-
value: Uint;
|
|
20
|
-
input: Bytes;
|
|
21
|
-
gasPrice: Uint;
|
|
22
|
-
chainId?: Uint;
|
|
23
|
-
}
|
|
24
|
-
export interface Transaction2930Unsigned {
|
|
25
|
-
type: "0x1";
|
|
26
|
-
nonce: Uint;
|
|
27
|
-
to?: Address | null;
|
|
28
|
-
gas: Uint;
|
|
29
|
-
value: Uint;
|
|
30
|
-
input: Bytes;
|
|
31
|
-
gasPrice: Uint;
|
|
32
|
-
chainId: Uint;
|
|
33
|
-
accessList: AccessListEntry[];
|
|
34
|
-
}
|
|
35
|
-
export interface Transaction1559Unsigned {
|
|
36
|
-
type: "0x2";
|
|
37
|
-
nonce: Uint;
|
|
38
|
-
to?: Address | null;
|
|
39
|
-
gas: Uint;
|
|
40
|
-
value: Uint;
|
|
41
|
-
input: Bytes;
|
|
42
|
-
gasPrice: Uint;
|
|
43
|
-
maxFeePerGas: Uint;
|
|
44
|
-
maxPriorityFeePerGas: Uint;
|
|
45
|
-
accessList: AccessListEntry[];
|
|
46
|
-
chainId: Uint;
|
|
47
|
-
}
|
|
48
|
-
export interface Transaction4844Unsigned {
|
|
49
|
-
type: "0x3";
|
|
50
|
-
nonce: Uint;
|
|
51
|
-
to: Address;
|
|
52
|
-
gas: Uint;
|
|
53
|
-
value: Uint;
|
|
54
|
-
input: Bytes;
|
|
55
|
-
gasPrice?: Uint;
|
|
56
|
-
maxFeePerGas: Uint;
|
|
57
|
-
maxPriorityFeePerGas: Uint;
|
|
58
|
-
maxFeePerBlobGas: Uint;
|
|
59
|
-
accessList: AccessListEntry[];
|
|
60
|
-
blobVersionedHashes: Hash32[];
|
|
61
|
-
chainId: Uint;
|
|
62
|
-
}
|
|
63
|
-
export interface Transaction7702Unsigned {
|
|
64
|
-
type: "0x4";
|
|
65
|
-
nonce: Uint;
|
|
66
|
-
to: Address;
|
|
67
|
-
gas: Uint;
|
|
68
|
-
value: Uint;
|
|
69
|
-
input: Bytes;
|
|
70
|
-
maxPriorityFeePerGas: Uint;
|
|
71
|
-
maxFeePerGas: Uint;
|
|
72
|
-
gasPrice?: Uint;
|
|
73
|
-
accessList: AccessListEntry[];
|
|
74
|
-
chainId: Uint;
|
|
75
|
-
authorizationList: AuthorizationList;
|
|
76
|
-
}
|
|
77
|
-
export interface AuthorizationListEntry {
|
|
78
|
-
chainId: Uint;
|
|
79
|
-
nonce: Uint;
|
|
80
|
-
address: Address;
|
|
81
|
-
yParity: Byte;
|
|
82
|
-
r: Uint256;
|
|
83
|
-
s: Uint256;
|
|
84
|
-
}
|
|
85
|
-
export type AuthorizationList = AuthorizationListEntry[];
|
|
86
|
-
|
|
87
|
-
export type TransactionLegacySigned = {
|
|
88
|
-
v: Byte;
|
|
89
|
-
r: Uint;
|
|
90
|
-
s: Uint;
|
|
91
|
-
} & TransactionLegacyUnsigned;
|
|
92
|
-
export type Transaction2930Signed = {
|
|
93
|
-
yParity: Bytes;
|
|
94
|
-
r: Uint;
|
|
95
|
-
s: Uint;
|
|
96
|
-
v?: Byte;
|
|
97
|
-
} & Transaction2930Unsigned;
|
|
98
|
-
export type Transaction1559Signed = {
|
|
99
|
-
yParity: Bytes;
|
|
100
|
-
r: Uint;
|
|
101
|
-
s: Uint;
|
|
102
|
-
v?: Byte;
|
|
103
|
-
} & Transaction1559Unsigned;
|
|
104
|
-
export type Transaction4844Signed = {
|
|
105
|
-
yParity: Byte;
|
|
106
|
-
r: Uint;
|
|
107
|
-
s: Uint;
|
|
108
|
-
v?: Byte;
|
|
109
|
-
} & Transaction4844Unsigned;
|
|
110
|
-
export type Transaction7702Signed = {
|
|
111
|
-
yParity: Byte;
|
|
112
|
-
r: Uint;
|
|
113
|
-
s: Uint;
|
|
114
|
-
v?: Byte;
|
|
115
|
-
} & Transaction7702Unsigned;
|
|
116
|
-
export type TransactionSigned =
|
|
117
|
-
| TransactionLegacySigned
|
|
118
|
-
| Transaction2930Signed
|
|
119
|
-
| Transaction1559Signed
|
|
120
|
-
| Transaction4844Signed
|
|
121
|
-
| Transaction7702Signed;
|
|
122
|
-
export type TransactionInfo = {
|
|
123
|
-
blockHash: Hash32;
|
|
124
|
-
blockNumber: Uint;
|
|
125
|
-
from: Address;
|
|
126
|
-
hash: Hash32;
|
|
127
|
-
transactionIndex: Uint;
|
|
128
|
-
} & TransactionSigned;
|
|
129
|
-
export interface GenericTransaction {
|
|
130
|
-
type?: "0x0" | "0x1" | "0x2" | "0x3";
|
|
131
|
-
to?: Address | null;
|
|
132
|
-
from?: Address;
|
|
133
|
-
value?: Uint;
|
|
134
|
-
nonce?: Uint;
|
|
135
|
-
gas?: Uint;
|
|
136
|
-
input?: Bytes;
|
|
137
|
-
gasPrice?: Uint;
|
|
138
|
-
maxPriorityFeePerGas?: Uint;
|
|
139
|
-
maxFeePerGas?: Uint;
|
|
140
|
-
maxFeePerBlobGas?: Uint;
|
|
141
|
-
accessList?: AccessListEntry[];
|
|
142
|
-
blobVersionedHashes?: Hash32[];
|
|
143
|
-
blobs?: Bytes[];
|
|
144
|
-
chainId?: Uint;
|
|
145
|
-
authorizationList?: AuthorizationList;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export { };
|
package/src/types/withdraw.d.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Environment setup & latest features
|
|
4
|
-
"lib": ["ESNext"],
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"module": "Preserve",
|
|
7
|
-
"moduleDetection": "force",
|
|
8
|
-
"jsx": "react-jsx",
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
// Bundler mode
|
|
11
|
-
"sourceMap": true,
|
|
12
|
-
"declaration": true,
|
|
13
|
-
"declarationMap": true,
|
|
14
|
-
"moduleResolution": "bundler",
|
|
15
|
-
"outDir": "dist",
|
|
16
|
-
"rootDir": "src",
|
|
17
|
-
"allowImportingTsExtensions": false,
|
|
18
|
-
"verbatimModuleSyntax": true,
|
|
19
|
-
"noEmit": false,
|
|
20
|
-
// Best practices
|
|
21
|
-
"strict": true,
|
|
22
|
-
"skipLibCheck": true,
|
|
23
|
-
"noFallthroughCasesInSwitch": true,
|
|
24
|
-
"noUncheckedIndexedAccess": true,
|
|
25
|
-
"noImplicitOverride": true,
|
|
26
|
-
// Some stricter flags (disabled by default)
|
|
27
|
-
"noUnusedLocals": false,
|
|
28
|
-
"noUnusedParameters": false,
|
|
29
|
-
"noPropertyAccessFromIndexSignature": false
|
|
30
|
-
},
|
|
31
|
-
"include": ["src/**/*"],
|
|
32
|
-
"exclude": ["example.ts"]
|
|
33
|
-
}
|