@asyncswap/eth-rpc 0.4.3 → 0.4.4
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/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/example.ts +3 -6
- package/package.json +2 -2
- package/src/eth-api.ts +8 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -13,10 +13,10 @@ bun add @asyncswap/eth-rpc
|
|
|
13
13
|
### Execution API Client
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
import {
|
|
16
|
+
import { ExecutionClient } from '@asyncswap/eth-rpc';
|
|
17
17
|
|
|
18
18
|
const url = 'http://localhost:8545'
|
|
19
|
-
const eth = new
|
|
19
|
+
const eth = new ExecutionClient(url);
|
|
20
20
|
|
|
21
21
|
const balance = await eth.eth_getBalance(
|
|
22
22
|
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
package/example.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExecutionClient } from "./src";
|
|
2
2
|
|
|
3
3
|
const url = "http://localhost:8545";
|
|
4
|
-
const eth = new
|
|
5
|
-
|
|
4
|
+
const eth = new ExecutionClient(url);
|
|
6
5
|
const balance = await eth.eth_getBalance(
|
|
7
6
|
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
|
8
7
|
"latest",
|
|
@@ -14,7 +13,7 @@ import { EngineExecutionClient } from "./src";
|
|
|
14
13
|
|
|
15
14
|
const engineUrl = "https://localhost:8551";
|
|
16
15
|
const engine = new EngineExecutionClient(engineUrl, process.env.JWT_TOKEN!);
|
|
17
|
-
const payload = engine.engine_getPayloadV1("0x1");
|
|
16
|
+
const payload = await engine.engine_getPayloadV1("0x1");
|
|
18
17
|
|
|
19
18
|
console.log(payload);
|
|
20
19
|
|
|
@@ -22,5 +21,3 @@ import { FlashbotsClient } from "./src";
|
|
|
22
21
|
|
|
23
22
|
const rpc = "https://relay.flashbots.net";
|
|
24
23
|
const client = new FlashbotsClient(rpc);
|
|
25
|
-
const body = client.rpc.buildRequest("eth_sendBundle", []);
|
|
26
|
-
client.eth_accounts();
|
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.4",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -41,6 +41,6 @@
|
|
|
41
41
|
"typescript": "^5"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@asyncswap/jsonrpc": "^0.4.
|
|
44
|
+
"@asyncswap/jsonrpc": "^0.4.4"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/src/eth-api.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type EthRpcMethods<
|
|
|
6
6
|
[K in keyof T]: (...params: T[K]["params"]) => Promise<T[K]["result"]>;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export class
|
|
9
|
+
export class ExecutionClient {
|
|
10
10
|
rpc: JsonRpcClient;
|
|
11
11
|
headers: Record<string, string> = {};
|
|
12
12
|
|
|
@@ -30,4 +30,10 @@ export class EthExecutionClient {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export interface
|
|
33
|
+
export interface ExecutionClient extends EthRpcMethods<EthMethodsSpec> { }
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Use `ExecutionClient` instead.
|
|
37
|
+
* This method will be removed in v0.5.0.
|
|
38
|
+
*/
|
|
39
|
+
export class EthExecutionClient extends ExecutionClient { }
|