@asyncswap/eth-rpc 0.4.1 → 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 +8 -0
- package/README.md +34 -112
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# eth-rpc
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A comprehensive TypeScript client for Ethereum execution and engine APIs.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```bash
|
|
8
8
|
bun add @asyncswap/eth-rpc
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Quick Start
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### Execution API Client
|
|
14
14
|
|
|
15
|
-
```
|
|
15
|
+
```typescript
|
|
16
16
|
import { EthExecutionClient } from '@asyncswap/eth-rpc';
|
|
17
17
|
|
|
18
18
|
const url = 'http://localhost:8545'
|
|
@@ -24,7 +24,11 @@ const balance = await eth.eth_getBalance(
|
|
|
24
24
|
);
|
|
25
25
|
console.log("Balance:", balance);
|
|
26
26
|
eth.eth_getTransactionCount("0x34", "safe");
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Engine API Client
|
|
27
30
|
|
|
31
|
+
```typescript
|
|
28
32
|
import { EngineExecutionClient } from '@asyncswap/eth-rpc';
|
|
29
33
|
|
|
30
34
|
const engineUrl = 'https://localhost:8551';
|
|
@@ -39,109 +43,27 @@ const rpc = 'https://relay.flashbots.net';
|
|
|
39
43
|
const client = new EthFlashbotsClient(rpc);
|
|
40
44
|
```
|
|
41
45
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- [x] eth_getFilterLogs
|
|
67
|
-
- [x] eth_getLogs
|
|
68
|
-
- [x] eth/feeMarket
|
|
69
|
-
- [x] eth_gasPrice
|
|
70
|
-
- [x] eth_blobBaseFee
|
|
71
|
-
- [x] eth_maxPriorityFeePerGas
|
|
72
|
-
- [x] eth_feeHistory
|
|
73
|
-
- [x] eth/execute
|
|
74
|
-
- [x] eth_call
|
|
75
|
-
- [x] eth_estimateGas
|
|
76
|
-
- [x] eth_createAccessList
|
|
77
|
-
- [x] eth_simulateV1
|
|
78
|
-
- [x] eth/client
|
|
79
|
-
- [x] eth_chainId
|
|
80
|
-
- [x] eth_syncing
|
|
81
|
-
- [x] eth_coinbase
|
|
82
|
-
- [x] eth_accounts
|
|
83
|
-
- [x] eth_blockNumber
|
|
84
|
-
- [x] net_version
|
|
85
|
-
- [x] eth/block
|
|
86
|
-
- [x] eth_getBlockByHash
|
|
87
|
-
- [x] eth_getBlockByNumber
|
|
88
|
-
- [x] eth_getBlockTransactionCountByHash
|
|
89
|
-
- [x] eth_getBlockTransactionCountByNumber
|
|
90
|
-
- [x] eth_getUncleCountByBlockHash
|
|
91
|
-
- [x] eth_getUncleCountByBlockNumber
|
|
92
|
-
- [x] eth_getBlockReceipts
|
|
93
|
-
- [x] debug
|
|
94
|
-
- [x] debug_getRawHeader = "debug_getRawHeader",
|
|
95
|
-
- [x] debug_getRawBlock = "debug_getRawBlock",
|
|
96
|
-
- [x] debug_getRawTransaction = "debug_getRawTransaction",
|
|
97
|
-
- [x] debug_getRawReceipts = "debug_getRawReceipts",
|
|
98
|
-
- [x] debug_getBadBlocks = "debug_getBadBlocks",
|
|
99
|
-
|
|
100
|
-
### Builtin flashbots MEV rpc methods
|
|
101
|
-
|
|
102
|
-
- [x] eth_sendBundle
|
|
103
|
-
- [x] mev_sendBundle
|
|
104
|
-
- [x] eth_callBundle
|
|
105
|
-
- [x] eth_cancelBundle
|
|
106
|
-
- [x] mev_simBundle
|
|
107
|
-
- [x] eth_sendPrivateTransaction
|
|
108
|
-
- [x] eth_sendPrivateRawTransaction
|
|
109
|
-
- [x] eth_cancelPrivateTransaction
|
|
110
|
-
- [x] flashbots_getFeeRefundTotalsByRecipient
|
|
111
|
-
- [x] flashbots_getFeeRefundsByRecipient
|
|
112
|
-
- [x] flashbots_getFeeRefundsByBundle
|
|
113
|
-
- [x] flashbots_getFeeRefundsByBlock
|
|
114
|
-
- [x] flashbots_setFeeRefundRecipient
|
|
115
|
-
- [x] buildernet_getDelayedRefunds
|
|
116
|
-
- [x] buildernet_getDelayedRefundTotalsByRecipient
|
|
117
|
-
- [x] flashbots_getMevRefundTotalByRecipient
|
|
118
|
-
- [x] flashbots_getMevRefundTotalBySender
|
|
119
|
-
|
|
120
|
-
### Engine RPC Methods Implemented
|
|
121
|
-
|
|
122
|
-
- [x] engine/blob
|
|
123
|
-
- [x] engine_getBlobsV1
|
|
124
|
-
- [x] engine_getBlobsV2
|
|
125
|
-
- [x] engine_getBlobsV3
|
|
126
|
-
- [x] engine/capabilities
|
|
127
|
-
- [x] engine_exchangeCapabilities
|
|
128
|
-
- [x] engine/forkchoice
|
|
129
|
-
- [x] engine_forkchoiceUpdatedV1
|
|
130
|
-
- [x] engine_forkchoiceUpdatedV2
|
|
131
|
-
- [x] engine_forkchoiceUpdatedV3
|
|
132
|
-
- [x] engine/payload
|
|
133
|
-
- [x] engine_newPayloadV1
|
|
134
|
-
- [x] engine_newPayloadV2
|
|
135
|
-
- [x] engine_newPayloadV3
|
|
136
|
-
- [x] engine_newPayloadV4
|
|
137
|
-
- [x] engine_getPayloadV1
|
|
138
|
-
- [x] engine_getPayloadV2
|
|
139
|
-
- [x] engine_getPayloadV3
|
|
140
|
-
- [x] engine_getPayloadV4
|
|
141
|
-
- [x] engine_getPayloadV5
|
|
142
|
-
- [x] engine_getPayloadBodiesByHashV1
|
|
143
|
-
- [x] engine_getPayloadBodiesByRangeV1
|
|
144
|
-
- [x] engine_newPayloadV5
|
|
145
|
-
- [x] engine_getPayloadV6
|
|
146
|
-
- [x] engine/transition-configuration
|
|
147
|
-
- [x] engine_exchangeTransitionConfigurationV1
|
|
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
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
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.
|
|
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.
|
|
44
|
+
"@asyncswap/jsonrpc": "^0.4.2"
|
|
45
45
|
}
|
|
46
46
|
}
|