@asyncswap/eth-rpc 0.4.0 → 0.4.2

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 CHANGED
@@ -1,5 +1,32 @@
1
1
  # @asyncswap/eth-rpc
2
2
 
3
+ ## 0.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 9512db5: update documentation
8
+ - Updated dependencies [9512db5]
9
+ - @asyncswap/jsonrpc@0.4.2
10
+
11
+ ## 0.5.1
12
+
13
+ ### Patch Changes
14
+
15
+ - 2598f09: updates docs
16
+
17
+ ## 0.5.0
18
+
19
+ ### Minor Changes
20
+
21
+ - fd79ea3: updates api for eth-client and adds flasbots methods and headers
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [43de065]
26
+ - Updated dependencies [7e8300c]
27
+ - Updated dependencies [7126afa]
28
+ - @asyncswap/jsonrpc@0.5.0
29
+
3
30
  ## 0.3.0
4
31
 
5
32
  ### Minor Changes
package/README.md CHANGED
@@ -1,18 +1,18 @@
1
1
  # eth-rpc
2
2
 
3
- ## `@asyncswap/eth-rpc`
3
+ A comprehensive TypeScript client for Ethereum execution and engine APIs.
4
4
 
5
- A complete library for ethereum rpc clients apis.
5
+ ## Installation
6
6
 
7
- ```sh
7
+ ```bash
8
8
  bun add @asyncswap/eth-rpc
9
9
  ```
10
10
 
11
- ## Usage
11
+ ## Quick Start
12
12
 
13
- ### Ethereum Execution Client Api
13
+ ### Execution API Client
14
14
 
15
- ```ts
15
+ ```typescript
16
16
  import { EthExecutionClient } from '@asyncswap/eth-rpc';
17
17
 
18
18
  const url = 'http://localhost:8545'
@@ -22,37 +22,48 @@ const balance = await eth.eth_getBalance(
22
22
  "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
23
23
  "latest"
24
24
  );
25
- console.log('Balance:', balance);
25
+ console.log("Balance:", balance);
26
+ eth.eth_getTransactionCount("0x34", "safe");
26
27
  ```
27
28
 
28
- ### Ethereum Engine Api
29
+ ### Engine API Client
29
30
 
30
- ```ts
31
- import { EngineExecutionClient } from "@asyncswap/eth-rpc";
31
+ ```typescript
32
+ import { EngineExecutionClient } from '@asyncswap/eth-rpc';
32
33
 
33
- const engineUrl = "https://localhost:8551";
34
+ const engineUrl = 'https://localhost:8551';
34
35
  const engine = new EngineExecutionClient(engineUrl, process.env.JWT_TOKEN!);
35
36
  const payload = engine.engine_getPayloadV1("0x1");
36
37
 
37
38
  console.log(payload);
39
+
40
+ import { EthFlashbotsClient } from '@asyncswap/eth-rpc';
41
+
42
+ const rpc = 'https://relay.flashbots.net';
43
+ const client = new EthFlashbotsClient(rpc);
44
+ ```
45
+
46
+ ## Error Handling
47
+
48
+ All methods return typed responses. Handle errors appropriately:
49
+
50
+ ```typescript
51
+ try {
52
+ const balance = await client.eth_getBalance(address, 'latest');
53
+ console.log('Balance:', balance);
54
+ } catch (error) {
55
+ console.error('RPC Error:', error);
56
+ }
38
57
  ```
39
58
 
40
- ## Builtin flashbots MEV rpc methods
41
-
42
- - [x] eth_sendBundle
43
- - [x] mev_sendBundle
44
- - [x] eth_callBundle
45
- - [x] eth_cancelBundle
46
- - [x] mev_simBundle
47
- - [x] eth_sendPrivateTransaction
48
- - [x] eth_sendPrivateRawTransaction
49
- - [x] eth_cancelPrivateTransaction
50
- - [x] flashbots_getFeeRefundTotalsByRecipient
51
- - [x] flashbots_getFeeRefundsByRecipient
52
- - [x] flashbots_getFeeRefundsByBundle
53
- - [x] flashbots_getFeeRefundsByBlock
54
- - [x] flashbots_setFeeRefundRecipient
55
- - [x] buildernet_getDelayedRefunds
56
- - [x] buildernet_getDelayedRefundTotalsByRecipient
57
- - [x] flashbots_getMevRefundTotalByRecipient
58
- - [x] flashbots_getMevRefundTotalBySender
59
+ ## Type Safety
60
+
61
+ Full TypeScript support with comprehensive type definitions for all RPC methods and responses.
62
+
63
+ ## Dependencies
64
+
65
+ - `@asyncswap/jsonrpc` - JSON-RPC 2.0 client/server implementation
66
+
67
+ ## License
68
+
69
+ MIT
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.0",
5
+ "version": "0.4.2",
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.0"
44
+ "@asyncswap/jsonrpc": "^0.4.2"
45
45
  }
46
46
  }
@@ -19,6 +19,7 @@ declare global {
19
19
  flashbots_getMevRefundTotalByRecipient = "flashbots_getMevRefundTotalByRecipient",
20
20
  flashbots_getMevRefundTotalBySender = "flashbots_getMevRefundTotalBySender",
21
21
  }
22
+
22
23
  export enum BuilderNetMethods {
23
24
  eth_sendBundle = "eth_sendBundle",
24
25
  eth_sendRawTransaction = "eth_sendRawTransaction",