@effect-blockchain/evm 0.2.0 → 0.4.0
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 +79 -1
- package/dist/EvmFeeHistory.d.ts +26 -0
- package/dist/EvmFeeHistory.d.ts.map +1 -0
- package/dist/EvmFeeHistory.js +25 -0
- package/dist/EvmFeeHistory.js.map +1 -0
- package/dist/EvmIndexer.d.ts +47 -9
- package/dist/EvmIndexer.d.ts.map +1 -1
- package/dist/EvmIndexer.js +95 -36
- package/dist/EvmIndexer.js.map +1 -1
- package/dist/EvmNetwork.d.ts.map +1 -1
- package/dist/EvmNetwork.js +8 -6
- package/dist/EvmNetwork.js.map +1 -1
- package/dist/EvmRelayer.d.ts +256 -0
- package/dist/EvmRelayer.d.ts.map +1 -0
- package/dist/EvmRelayer.js +330 -0
- package/dist/EvmRelayer.js.map +1 -0
- package/dist/EvmRpc.d.ts +88 -8
- package/dist/EvmRpc.d.ts.map +1 -1
- package/dist/EvmRpc.js +30 -9
- package/dist/EvmRpc.js.map +1 -1
- package/dist/EvmSigner.d.ts +78 -0
- package/dist/EvmSigner.d.ts.map +1 -0
- package/dist/EvmSigner.js +96 -0
- package/dist/EvmSigner.js.map +1 -0
- package/dist/EvmTransaction.d.ts +65 -0
- package/dist/EvmTransaction.d.ts.map +1 -0
- package/dist/EvmTransaction.js +60 -0
- package/dist/EvmTransaction.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/rpcMethods.js +57 -5
- package/dist/internal/rpcMethods.js.map +1 -1
- package/package.json +2 -2
- package/src/EvmFeeHistory.ts +28 -0
- package/src/EvmIndexer.ts +142 -49
- package/src/EvmNetwork.ts +8 -6
- package/src/EvmRelayer.ts +425 -0
- package/src/EvmRpc.ts +106 -9
- package/src/EvmSigner.ts +128 -0
- package/src/EvmTransaction.ts +64 -0
- package/src/index.ts +20 -0
- package/src/internal/rpcMethods.ts +67 -6
package/dist/EvmRpc.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* are safe. Methods are named after the JSON-RPC method without its namespace (`eth_getLogs` is `getLogs`).
|
|
2
|
+
* The EVM JSON-RPC methods over an ordered list of endpoints with fallback, one request per call. Methods are named
|
|
3
|
+
* after the JSON-RPC method without its namespace (`eth_getLogs` is `getLogs`). The fallback rules and the error
|
|
4
|
+
* reasons are described in
|
|
5
|
+
* [Concepts](https://github.com/spiko-tech/effect-blockchain/blob/main/docs/concepts.md#endpoint-fallback).
|
|
7
6
|
*
|
|
8
7
|
* @example
|
|
9
8
|
* ```ts
|
|
@@ -39,9 +38,12 @@ import type * as Redacted from "effect/Redacted";
|
|
|
39
38
|
import * as Schema from "effect/Schema";
|
|
40
39
|
import type { EvmAddress } from "./EvmAddress.ts";
|
|
41
40
|
import type { EvmBlock } from "./EvmBlock.ts";
|
|
41
|
+
import type { EvmFeeHistory } from "./EvmFeeHistory.ts";
|
|
42
42
|
import type { EvmHexData } from "./EvmHexData.ts";
|
|
43
43
|
import type { EvmLog } from "./EvmLog.ts";
|
|
44
44
|
import * as EvmNetwork from "./EvmNetwork.ts";
|
|
45
|
+
import type { EvmTransaction, EvmTransactionReceipt } from "./EvmTransaction.ts";
|
|
46
|
+
import type { EvmTransactionHash } from "./EvmTransactionHash.ts";
|
|
45
47
|
/**
|
|
46
48
|
* A JSON-RPC endpoint. The `name` is shown in errors and spans, the `url` is never logged.
|
|
47
49
|
*
|
|
@@ -60,9 +62,7 @@ declare const EvmRpcError_base: Schema.Class<EvmRpcError, Schema.TaggedStruct<"E
|
|
|
60
62
|
readonly cause: Schema.Defect;
|
|
61
63
|
}>, import("effect/Cause").YieldableError>;
|
|
62
64
|
/**
|
|
63
|
-
* A failed call
|
|
64
|
-
* HTTP status as `code`, and a `cause` without the endpoint URL. After several endpoints, the error is the last one
|
|
65
|
-
* and `cause` is an `AggregateError` of each endpoint's error, in order.
|
|
65
|
+
* A failed call, with a {@link JsonRpc.Reason} as `reason`.
|
|
66
66
|
*
|
|
67
67
|
* On EVM, `Unavailable` includes the codes -32005, -32603, -32007, -1 and 429, `InvalidResponse` a log outside the
|
|
68
68
|
* `getLogs` filter, and `Lagging` a head below the requested block.
|
|
@@ -89,6 +89,13 @@ export interface EvmLogsFilter {
|
|
|
89
89
|
readonly toBlock: bigint;
|
|
90
90
|
readonly topics?: ReadonlyArray<EvmHexData | ReadonlyArray<EvmHexData> | null> | undefined;
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* The block a state read is made at: `latest` is the head, `pending` adds the transactions of the node's pool.
|
|
94
|
+
*
|
|
95
|
+
* @since 0.3.0
|
|
96
|
+
* @category models
|
|
97
|
+
*/
|
|
98
|
+
export type EvmBlockTag = "latest" | "pending";
|
|
92
99
|
declare const EvmRpc_base: Context.ServiceClass<EvmRpc, "@effect-blockchain/evm/EvmRpc", {
|
|
93
100
|
readonly network: EvmNetwork.EvmNetwork;
|
|
94
101
|
/** `eth_chainId`, verified against `network` once per endpoint then served from that check. */
|
|
@@ -104,12 +111,85 @@ declare const EvmRpc_base: Context.ServiceClass<EvmRpc, "@effect-blockchain/evm/
|
|
|
104
111
|
readonly getBlockByNumber: (options: {
|
|
105
112
|
readonly blockNumber: bigint;
|
|
106
113
|
}) => Effect.Effect<EvmBlock, EvmRpcError>;
|
|
114
|
+
/**
|
|
115
|
+
* `eth_getBalance`: the balance of `address` in wei at the end of `blockNumber`, only answered by an endpoint whose
|
|
116
|
+
* head has reached `blockNumber`. A block older than the endpoint's state history needs an archive endpoint: pruned
|
|
117
|
+
* nodes answer with provider-specific codes (-32000, -32602, -32603), which fall back but never map to `Pruned`.
|
|
118
|
+
*
|
|
119
|
+
* @since 0.3.0
|
|
120
|
+
*/
|
|
121
|
+
readonly getBalance: (options: {
|
|
122
|
+
readonly address: EvmAddress;
|
|
123
|
+
readonly blockNumber: bigint;
|
|
124
|
+
}) => Effect.Effect<bigint, EvmRpcError>;
|
|
107
125
|
/**
|
|
108
126
|
* `eth_getLogs`, only answered by an endpoint whose head has reached `toBlock`. Logs are returned in chain order:
|
|
109
127
|
* sorted by block then log index. A removed, pending or out-of-filter log fails with `InvalidResponse`. An empty
|
|
110
128
|
* range returns `[]`.
|
|
111
129
|
*/
|
|
112
130
|
readonly getLogs: (filter: EvmLogsFilter) => Effect.Effect<ReadonlyArray<EvmLog>, EvmRpcError>;
|
|
131
|
+
/**
|
|
132
|
+
* `eth_getTransactionByHash`: the transaction, pending or included, or `null` when the answering endpoint does not
|
|
133
|
+
* know it. `null` does not fall back: an endpoint behind the head or with another pool answers it too.
|
|
134
|
+
*
|
|
135
|
+
* @since 0.3.0
|
|
136
|
+
*/
|
|
137
|
+
readonly getTransactionByHash: (options: {
|
|
138
|
+
readonly hash: EvmTransactionHash;
|
|
139
|
+
}) => Effect.Effect<EvmTransaction | null, EvmRpcError>;
|
|
140
|
+
/**
|
|
141
|
+
* `eth_getTransactionReceipt`: the receipt, or `null` until the answering endpoint has the transaction in a block.
|
|
142
|
+
* `null` does not fall back.
|
|
143
|
+
*
|
|
144
|
+
* @since 0.3.0
|
|
145
|
+
*/
|
|
146
|
+
readonly getTransactionReceipt: (options: {
|
|
147
|
+
readonly hash: EvmTransactionHash;
|
|
148
|
+
}) => Effect.Effect<EvmTransactionReceipt | null, EvmRpcError>;
|
|
149
|
+
/**
|
|
150
|
+
* `eth_sendRawTransaction`: submits a signed transaction and returns its hash. A retry or a fallback sends the same
|
|
151
|
+
* bytes, so it never creates a second transaction, but a node that already has them refuses the second copy. A
|
|
152
|
+
* refusal (`already known`, `nonce too low`, `replacement transaction underpriced`, `insufficient funds`...) is
|
|
153
|
+
* `Rejected`, with the node's message in `cause`.
|
|
154
|
+
*
|
|
155
|
+
* @since 0.3.0
|
|
156
|
+
*/
|
|
157
|
+
readonly sendRawTransaction: (options: {
|
|
158
|
+
readonly signed: EvmHexData;
|
|
159
|
+
}) => Effect.Effect<EvmTransactionHash, EvmRpcError>;
|
|
160
|
+
/**
|
|
161
|
+
* `eth_getTransactionCount`: the number of transactions sent by `address` at `blockTag`, which is the nonce of its
|
|
162
|
+
* next one. `pending` counts the transactions of the answering node's pool, which differs between nodes.
|
|
163
|
+
*
|
|
164
|
+
* @since 0.3.0
|
|
165
|
+
*/
|
|
166
|
+
readonly getTransactionCount: (options: {
|
|
167
|
+
readonly address: EvmAddress;
|
|
168
|
+
readonly blockTag: EvmBlockTag;
|
|
169
|
+
}) => Effect.Effect<bigint, EvmRpcError>;
|
|
170
|
+
/**
|
|
171
|
+
* `eth_estimateGas`: the gas a call from `from` to `to` needs at the head. A call that reverts is `Rejected`, with
|
|
172
|
+
* the node's message in `cause`.
|
|
173
|
+
*
|
|
174
|
+
* @since 0.3.0
|
|
175
|
+
*/
|
|
176
|
+
readonly estimateGas: (options: {
|
|
177
|
+
readonly from: EvmAddress;
|
|
178
|
+
readonly to: EvmAddress;
|
|
179
|
+
readonly value?: bigint | undefined;
|
|
180
|
+
readonly data?: EvmHexData | undefined;
|
|
181
|
+
}) => Effect.Effect<bigint, EvmRpcError>;
|
|
182
|
+
/**
|
|
183
|
+
* `eth_feeHistory`: the fees of the `blockCount` blocks ending at `newestBlock`, with the priority fees at
|
|
184
|
+
* `rewardPercentiles` (each between 0 and 100, in ascending order). A node may return fewer blocks.
|
|
185
|
+
*
|
|
186
|
+
* @since 0.3.0
|
|
187
|
+
*/
|
|
188
|
+
readonly feeHistory: (options: {
|
|
189
|
+
readonly blockCount: number;
|
|
190
|
+
readonly newestBlock: EvmBlockTag;
|
|
191
|
+
readonly rewardPercentiles: ReadonlyArray<number>;
|
|
192
|
+
}) => Effect.Effect<EvmFeeHistory, EvmRpcError>;
|
|
113
193
|
}>;
|
|
114
194
|
/**
|
|
115
195
|
* @since 0.1.0
|
package/dist/EvmRpc.d.ts.map
CHAN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AAa,EAAE,WAAW,CAAC;;AA/FjD;;;GAGG;AACH,qBAAa,MAAO,SAAQ,WA4FS;CAAG;AAaxC;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,YAAa;IAC7B,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,UAAU,CAAA;IACvC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,qBAAqB,CAAC,cAAc,CAAC,CAAA;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAA;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAA;CACjD,KAAG,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAiHjD,CAAA;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,YACb,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAChD,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,UAAU,CACP,CAAA"}
|
package/dist/EvmRpc.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* are safe. Methods are named after the JSON-RPC method without its namespace (`eth_getLogs` is `getLogs`).
|
|
2
|
+
* The EVM JSON-RPC methods over an ordered list of endpoints with fallback, one request per call. Methods are named
|
|
3
|
+
* after the JSON-RPC method without its namespace (`eth_getLogs` is `getLogs`). The fallback rules and the error
|
|
4
|
+
* reasons are described in
|
|
5
|
+
* [Concepts](https://github.com/spiko-tech/effect-blockchain/blob/main/docs/concepts.md#endpoint-fallback).
|
|
7
6
|
*
|
|
8
7
|
* @example
|
|
9
8
|
* ```ts
|
|
@@ -40,9 +39,7 @@ import * as Schema from "effect/Schema";
|
|
|
40
39
|
import * as EvmNetwork from "./EvmNetwork.js";
|
|
41
40
|
import * as RpcMethods from "./internal/rpcMethods.js";
|
|
42
41
|
/**
|
|
43
|
-
* A failed call
|
|
44
|
-
* HTTP status as `code`, and a `cause` without the endpoint URL. After several endpoints, the error is the last one
|
|
45
|
-
* and `cause` is an `AggregateError` of each endpoint's error, in order.
|
|
42
|
+
* A failed call, with a {@link JsonRpc.Reason} as `reason`.
|
|
46
43
|
*
|
|
47
44
|
* On EVM, `Unavailable` includes the codes -32005, -32603, -32007, -1 and 429, `InvalidResponse` a log outside the
|
|
48
45
|
* `getLogs` filter, and `Lagging` a head below the requested block.
|
|
@@ -143,6 +140,7 @@ export const layer = options => Layer.effect(EvmRpc, Effect.gen(function* () {
|
|
|
143
140
|
...log
|
|
144
141
|
}) => log), byBlockThenIndex);
|
|
145
142
|
});
|
|
143
|
+
const callOn = (method, params) => rpc.withFallback(endpoint => rpc.call(endpoint, method, params));
|
|
146
144
|
return EvmRpc.of({
|
|
147
145
|
network,
|
|
148
146
|
chainId: rpc.withFallback(rpc.checkNetwork),
|
|
@@ -150,7 +148,30 @@ export const layer = options => Layer.effect(EvmRpc, Effect.gen(function* () {
|
|
|
150
148
|
getBlockByNumber: ({
|
|
151
149
|
blockNumber
|
|
152
150
|
}) => rpc.withFallback(endpoint => getBlockByNumberOn(endpoint, blockNumber)),
|
|
153
|
-
|
|
151
|
+
getBalance: ({
|
|
152
|
+
address,
|
|
153
|
+
blockNumber
|
|
154
|
+
}) => rpc.withFallback(endpoint => rpc.requireHead(endpoint, RpcMethods.getBalance.name, blockNumber, blockNumberOn(endpoint)).pipe(Effect.andThen(rpc.call(endpoint, RpcMethods.getBalance, [address, blockNumber])))),
|
|
155
|
+
getLogs: filter => filter.fromBlock > filter.toBlock ? Effect.succeed([]) : rpc.withFallback(endpoint => getLogsOn(endpoint, filter)),
|
|
156
|
+
getTransactionByHash: ({
|
|
157
|
+
hash
|
|
158
|
+
}) => callOn(RpcMethods.getTransactionByHash, [hash]),
|
|
159
|
+
getTransactionReceipt: ({
|
|
160
|
+
hash
|
|
161
|
+
}) => callOn(RpcMethods.getTransactionReceipt, [hash]),
|
|
162
|
+
sendRawTransaction: ({
|
|
163
|
+
signed
|
|
164
|
+
}) => callOn(RpcMethods.sendRawTransaction, [signed]),
|
|
165
|
+
getTransactionCount: ({
|
|
166
|
+
address,
|
|
167
|
+
blockTag
|
|
168
|
+
}) => callOn(RpcMethods.getTransactionCount, [address, blockTag]),
|
|
169
|
+
estimateGas: call => callOn(RpcMethods.estimateGas, [call]),
|
|
170
|
+
feeHistory: ({
|
|
171
|
+
blockCount,
|
|
172
|
+
newestBlock,
|
|
173
|
+
rewardPercentiles
|
|
174
|
+
}) => callOn(RpcMethods.feeHistory, [blockCount, newestBlock, rewardPercentiles])
|
|
154
175
|
});
|
|
155
176
|
}));
|
|
156
177
|
/**
|
package/dist/EvmRpc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvmRpc.js","names":[],"sources":["../src/EvmRpc.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"EvmRpc.js","names":[],"sources":["../src/EvmRpc.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,OAAO,KAAK,OAAO,MAAM,iCAAiC;AAC1D,OAAO,KAAK,GAAG,MAAM,cAAc;AACnC,OAAO,KAAK,OAAO,MAAM,eAAe;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe;AACvC,OAAO,KAAK,OAAO,MAAM,gBAAgB;AAEzC,OAAO,KAAK,MAAM,MAAM,eAAe;AAEvC,OAAO,KAAK,KAAK,MAAM,cAAc;AACrC,OAAO,KAAK,KAAK,MAAM,cAAc;AAErC,OAAO,KAAK,GAAG,MAAM,YAAY;AACjC,OAAO,KAA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C,mBAAmB,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3G,WAAW,EAAG,IAAI,IAAK,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC;IAC7D,UAAU,EAAE,CAAC;MAAE,UAAU;MAAE,WAAW;MAAE;IAAiB,CAAE,KACzD,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,iBAAiB,CAAC;GAC7E,CAAC;AACJ,CAAC,CAAC,CACH;AAEH;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAM,WAAW,GACtB,OAAiD,IAEjD,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signers of EIP-1559 transactions: a private key held in memory, or a custody API that only signs a hash. The
|
|
3
|
+
* reason a signer receives the whole transaction is described in
|
|
4
|
+
* [Concepts](https://github.com/spiko-tech/effect-blockchain/blob/main/docs/concepts.md#signers).
|
|
5
|
+
*
|
|
6
|
+
* @since 0.3.0
|
|
7
|
+
*/
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import * as Redacted from "effect/Redacted";
|
|
10
|
+
import * as Schema from "effect/Schema";
|
|
11
|
+
import { EvmAddress } from "./EvmAddress.ts";
|
|
12
|
+
import { EvmHexData } from "./EvmHexData.ts";
|
|
13
|
+
import type { EvmChainId } from "./EvmNetwork.ts";
|
|
14
|
+
declare const EvmSignerError_base: Schema.Class<EvmSignerError, Schema.TaggedStruct<"EvmSignerError", {
|
|
15
|
+
readonly cause: Schema.Defect;
|
|
16
|
+
}>, import("effect/Cause").YieldableError>;
|
|
17
|
+
/**
|
|
18
|
+
* A signature could not be produced: `cause` is the signer's own failure, or why its signature was refused. It never
|
|
19
|
+
* holds a private key.
|
|
20
|
+
*
|
|
21
|
+
* @since 0.3.0
|
|
22
|
+
* @category errors
|
|
23
|
+
*/
|
|
24
|
+
export declare class EvmSignerError extends EvmSignerError_base {
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* An EIP-1559 transaction before its signature. `value` (default 0), `maxFeePerGas` and `maxPriorityFeePerGas` are in
|
|
28
|
+
* wei, `data` defaults to `0x`.
|
|
29
|
+
*
|
|
30
|
+
* @since 0.3.0
|
|
31
|
+
* @category models
|
|
32
|
+
*/
|
|
33
|
+
export interface EvmUnsignedTransaction {
|
|
34
|
+
readonly chainId: EvmChainId;
|
|
35
|
+
readonly nonce: bigint;
|
|
36
|
+
readonly to: EvmAddress;
|
|
37
|
+
readonly value?: bigint | undefined;
|
|
38
|
+
readonly data?: EvmHexData | undefined;
|
|
39
|
+
readonly gas: bigint;
|
|
40
|
+
readonly maxFeePerGas: bigint;
|
|
41
|
+
readonly maxPriorityFeePerGas: bigint;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Signs transactions sent from `address`. `signTransaction` returns the signed transaction, serialized as
|
|
45
|
+
* `eth_sendRawTransaction` takes it.
|
|
46
|
+
*
|
|
47
|
+
* @since 0.3.0
|
|
48
|
+
* @category models
|
|
49
|
+
*/
|
|
50
|
+
export interface EvmSigner {
|
|
51
|
+
readonly address: EvmAddress;
|
|
52
|
+
readonly signTransaction: (transaction: EvmUnsignedTransaction) => Effect.Effect<EvmHexData, EvmSignerError>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A signer holding a secp256k1 private key (32 bytes, 0x-prefixed hex) in memory. An invalid key fails with an
|
|
56
|
+
* {@link EvmSignerError} that does not repeat it.
|
|
57
|
+
*
|
|
58
|
+
* @since 0.3.0
|
|
59
|
+
* @category constructors
|
|
60
|
+
*/
|
|
61
|
+
export declare const fromPrivateKey: (options: {
|
|
62
|
+
readonly key: Redacted.Redacted<string>;
|
|
63
|
+
}) => Effect.Effect<EvmSigner, EvmSignerError>;
|
|
64
|
+
/**
|
|
65
|
+
* A signer for a key held elsewhere (a custody API, an HSM) that only signs a 32-byte hash. `signHash` receives the
|
|
66
|
+
* keccak256 of the unsigned EIP-1559 serialization and returns the 65-byte signature `r || s || v`, `v` being 0, 1, 27
|
|
67
|
+
* or 28. A failure of `signHash`, a malformed signature or one that does not recover to `address` fails with an
|
|
68
|
+
* {@link EvmSignerError}.
|
|
69
|
+
*
|
|
70
|
+
* @since 0.3.0
|
|
71
|
+
* @category constructors
|
|
72
|
+
*/
|
|
73
|
+
export declare const fromHashSigner: <E>(options: {
|
|
74
|
+
readonly address: EvmAddress;
|
|
75
|
+
readonly signHash: (hash: EvmHexData) => Effect.Effect<EvmHexData, E>;
|
|
76
|
+
}) => EvmSigner;
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=EvmSigner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EvmSigner.d.ts","sourceRoot":"","sources":["../src/EvmSigner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;;;;AAEjD;;;;;;GAMG;AACH,qBAAa,cAAe,SAAQ,mBAElC;CAAG;AAEL;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAA;CACtC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;IAC5B,QAAQ,CAAC,eAAe,EAAE,CAAC,WAAW,EAAE,sBAAsB,KAAK,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,cAAc,CAAC,CAAA;CAC7G;AAgBD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,YAAa;IACtC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;CACxC,KAAG,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,cAAc,CAerC,CAAA;AAEN;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,WAAW;IACzC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAA;CACtE,KAAG,SAkBF,CAAA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signers of EIP-1559 transactions: a private key held in memory, or a custody API that only signs a hash. The
|
|
3
|
+
* reason a signer receives the whole transaction is described in
|
|
4
|
+
* [Concepts](https://github.com/spiko-tech/effect-blockchain/blob/main/docs/concepts.md#signers).
|
|
5
|
+
*
|
|
6
|
+
* @since 0.3.0
|
|
7
|
+
*/
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import * as Redacted from "effect/Redacted";
|
|
10
|
+
import * as Schema from "effect/Schema";
|
|
11
|
+
import { isHex, keccak256, parseSignature, recoverTransactionAddress, serializeTransaction } from "viem";
|
|
12
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
13
|
+
import { EvmAddress } from "./EvmAddress.js";
|
|
14
|
+
import { EvmHexData } from "./EvmHexData.js";
|
|
15
|
+
/**
|
|
16
|
+
* A signature could not be produced: `cause` is the signer's own failure, or why its signature was refused. It never
|
|
17
|
+
* holds a private key.
|
|
18
|
+
*
|
|
19
|
+
* @since 0.3.0
|
|
20
|
+
* @category errors
|
|
21
|
+
*/
|
|
22
|
+
export class EvmSignerError extends /*#__PURE__*/Schema.TaggedError()("EvmSignerError", {
|
|
23
|
+
cause: /*#__PURE__*/Schema.Defect()
|
|
24
|
+
}) {}
|
|
25
|
+
const toError = cause => new EvmSignerError({
|
|
26
|
+
cause
|
|
27
|
+
});
|
|
28
|
+
const serializable = transaction => ({
|
|
29
|
+
type: "eip1559",
|
|
30
|
+
chainId: transaction.chainId,
|
|
31
|
+
nonce: Number(transaction.nonce),
|
|
32
|
+
to: transaction.to,
|
|
33
|
+
value: transaction.value ?? BigInt(0),
|
|
34
|
+
data: transaction.data ?? "0x",
|
|
35
|
+
gas: transaction.gas,
|
|
36
|
+
maxFeePerGas: transaction.maxFeePerGas,
|
|
37
|
+
maxPriorityFeePerGas: transaction.maxPriorityFeePerGas
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* A signer holding a secp256k1 private key (32 bytes, 0x-prefixed hex) in memory. An invalid key fails with an
|
|
41
|
+
* {@link EvmSignerError} that does not repeat it.
|
|
42
|
+
*
|
|
43
|
+
* @since 0.3.0
|
|
44
|
+
* @category constructors
|
|
45
|
+
*/
|
|
46
|
+
export const fromPrivateKey = options => Effect.try({
|
|
47
|
+
try: () => {
|
|
48
|
+
const value = Redacted.value(options.key);
|
|
49
|
+
if (!isHex(value)) throw new Error("not hex");
|
|
50
|
+
return privateKeyToAccount(value);
|
|
51
|
+
},
|
|
52
|
+
// the thrown error can quote the key
|
|
53
|
+
catch: () => new EvmSignerError({
|
|
54
|
+
cause: new Error("invalid private key")
|
|
55
|
+
})
|
|
56
|
+
}).pipe(Effect.map(account => ({
|
|
57
|
+
address: Schema.decodeSync(EvmAddress)(account.address),
|
|
58
|
+
signTransaction: transaction => Effect.tryPromise({
|
|
59
|
+
try: () => account.signTransaction(serializable(transaction)),
|
|
60
|
+
catch: toError
|
|
61
|
+
}).pipe(Effect.map(signed => EvmHexData.make(signed)))
|
|
62
|
+
})));
|
|
63
|
+
/**
|
|
64
|
+
* A signer for a key held elsewhere (a custody API, an HSM) that only signs a 32-byte hash. `signHash` receives the
|
|
65
|
+
* keccak256 of the unsigned EIP-1559 serialization and returns the 65-byte signature `r || s || v`, `v` being 0, 1, 27
|
|
66
|
+
* or 28. A failure of `signHash`, a malformed signature or one that does not recover to `address` fails with an
|
|
67
|
+
* {@link EvmSignerError}.
|
|
68
|
+
*
|
|
69
|
+
* @since 0.3.0
|
|
70
|
+
* @category constructors
|
|
71
|
+
*/
|
|
72
|
+
export const fromHashSigner = options => ({
|
|
73
|
+
address: options.address,
|
|
74
|
+
signTransaction: Effect.fnUntraced(function* (transaction) {
|
|
75
|
+
const unsigned = serializable(transaction);
|
|
76
|
+
const hash = yield* Effect.try({
|
|
77
|
+
try: () => keccak256(serializeTransaction(unsigned)),
|
|
78
|
+
catch: toError
|
|
79
|
+
});
|
|
80
|
+
const signature = yield* Effect.mapError(options.signHash(EvmHexData.make(hash)), toError);
|
|
81
|
+
return yield* Effect.tryPromise({
|
|
82
|
+
try: async () => {
|
|
83
|
+
const signed = serializeTransaction(unsigned, parseSignature(signature));
|
|
84
|
+
const signer = await recoverTransactionAddress({
|
|
85
|
+
serializedTransaction: signed
|
|
86
|
+
});
|
|
87
|
+
if (signer.toLowerCase() !== options.address) {
|
|
88
|
+
throw new Error(`signed by ${signer}, expected ${options.address}`);
|
|
89
|
+
}
|
|
90
|
+
return EvmHexData.make(signed);
|
|
91
|
+
},
|
|
92
|
+
catch: toError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AC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC;IAC1F,OAAO,OAAO,MAAM,CAAC,UAAU,CAAC;MAC9B,GAAG,EAAE,YAAW;QACd,MAAM,MAAM,GAAG,oBAAoB,CAAC,QAAQ,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;QACxE,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAAC;UAAE,qBAAqB,EAAE;QAAM,CAAE,CAAC;QACjF,IAAI,MAAM,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE;UAC5C,MAAM,IAAI,KAAK,CAAC,aAAa,MAAM,cAAc,OAAO,CAAC,OAAO,EAAE,CAAC;QACrE;QACA,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;MAChC,CAAC;MACD,KAAK,EAAE;KACR,CAAC;EACJ,CAAC;CACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EVM transactions and their receipts, as returned by `eth_getTransactionByHash` and `eth_getTransactionReceipt`.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.3.0
|
|
5
|
+
*/
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
/**
|
|
8
|
+
* A transaction known to a node, decoded from the raw JSON-RPC transaction. `blockNumber`, `blockHash` and
|
|
9
|
+
* `transactionIndex` are `null` while it is pending, `to` is `null` for a contract creation. Every other field (the
|
|
10
|
+
* fee fields, which depend on the transaction type, and the signature) is ignored.
|
|
11
|
+
*
|
|
12
|
+
* @since 0.3.0
|
|
13
|
+
* @category schemas
|
|
14
|
+
*/
|
|
15
|
+
export declare const EvmTransaction: Schema.Struct<{
|
|
16
|
+
readonly hash: Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmTransactionHash">;
|
|
17
|
+
readonly from: Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmAddress">;
|
|
18
|
+
readonly to: Schema.NullOr<Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmAddress">>;
|
|
19
|
+
readonly nonce: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
20
|
+
readonly value: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
21
|
+
readonly input: Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmHexData">;
|
|
22
|
+
readonly gas: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
23
|
+
readonly blockNumber: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.String, never, never>>;
|
|
24
|
+
readonly blockHash: Schema.NullOr<Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmHexData">>;
|
|
25
|
+
readonly transactionIndex: Schema.NullOr<Schema.decodeTo<Schema.Int, Schema.String, never, never>>;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* @since 0.3.0
|
|
29
|
+
* @category models
|
|
30
|
+
*/
|
|
31
|
+
export type EvmTransaction = typeof EvmTransaction.Type;
|
|
32
|
+
/**
|
|
33
|
+
* The receipt of a transaction included in a block. `status` is 1 for a success and 0 for a revert, and
|
|
34
|
+
* `effectiveGasPrice` is in wei per gas. A receipt older than the Byzantium fork has no `status` and does not decode.
|
|
35
|
+
*
|
|
36
|
+
* @since 0.3.0
|
|
37
|
+
* @category schemas
|
|
38
|
+
*/
|
|
39
|
+
export declare const EvmTransactionReceipt: Schema.Struct<{
|
|
40
|
+
readonly transactionHash: Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmTransactionHash">;
|
|
41
|
+
readonly transactionIndex: Schema.decodeTo<Schema.Int, Schema.String, never, never>;
|
|
42
|
+
readonly blockNumber: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
43
|
+
readonly blockHash: Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmHexData">;
|
|
44
|
+
readonly from: Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmAddress">;
|
|
45
|
+
readonly to: Schema.NullOr<Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmAddress">>;
|
|
46
|
+
readonly status: Schema.decodeTo<Schema.Int, Schema.String, never, never>;
|
|
47
|
+
readonly gasUsed: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
48
|
+
readonly effectiveGasPrice: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
49
|
+
readonly logs: Schema.$Array<Schema.Struct<{
|
|
50
|
+
readonly address: Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmAddress">;
|
|
51
|
+
readonly topics: Schema.$Array<Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmHexData">>;
|
|
52
|
+
readonly data: Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmHexData">;
|
|
53
|
+
readonly blockNumber: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
54
|
+
readonly blockHash: Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmHexData">;
|
|
55
|
+
readonly transactionHash: Schema.brand<Schema.refine<`0x${string}`, Schema.decodeTo<Schema.String, Schema.String, never, never>>, "EvmTransactionHash">;
|
|
56
|
+
readonly transactionIndex: Schema.decodeTo<Schema.Int, Schema.String, never, never>;
|
|
57
|
+
readonly logIndex: Schema.decodeTo<Schema.Int, Schema.String, never, never>;
|
|
58
|
+
}>>;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* @since 0.3.0
|
|
62
|
+
* @category models
|
|
63
|
+
*/
|
|
64
|
+
export type EvmTransactionReceipt = typeof EvmTransactionReceipt.Type;
|
|
65
|
+
//# sourceMappingURL=EvmTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EvmTransaction.d.ts","sourceRoot":"","sources":["../src/EvmTransaction.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAOvC;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;EAW4C,CAAA;AAEvE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;EAWoD,CAAA;AAEtF;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAC,IAAI,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EVM transactions and their receipts, as returned by `eth_getTransactionByHash` and `eth_getTransactionReceipt`.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.3.0
|
|
5
|
+
*/
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import { EvmAddress } from "./EvmAddress.js";
|
|
8
|
+
import { EvmHexData } from "./EvmHexData.js";
|
|
9
|
+
import { EvmLog } from "./EvmLog.js";
|
|
10
|
+
import { EvmTransactionHash } from "./EvmTransactionHash.js";
|
|
11
|
+
import { IntFromHex, QuantityFromHex } from "./internal/QuantityFromHex.js";
|
|
12
|
+
/**
|
|
13
|
+
* A transaction known to a node, decoded from the raw JSON-RPC transaction. `blockNumber`, `blockHash` and
|
|
14
|
+
* `transactionIndex` are `null` while it is pending, `to` is `null` for a contract creation. Every other field (the
|
|
15
|
+
* fee fields, which depend on the transaction type, and the signature) is ignored.
|
|
16
|
+
*
|
|
17
|
+
* @since 0.3.0
|
|
18
|
+
* @category schemas
|
|
19
|
+
*/
|
|
20
|
+
export const EvmTransaction = /*#__PURE__*/Schema.Struct({
|
|
21
|
+
hash: EvmTransactionHash,
|
|
22
|
+
from: EvmAddress,
|
|
23
|
+
to: Schema.NullOr(EvmAddress),
|
|
24
|
+
nonce: QuantityFromHex,
|
|
25
|
+
value: QuantityFromHex,
|
|
26
|
+
input: EvmHexData,
|
|
27
|
+
gas: QuantityFromHex,
|
|
28
|
+
blockNumber: Schema.NullOr(QuantityFromHex),
|
|
29
|
+
blockHash: Schema.NullOr(EvmHexData),
|
|
30
|
+
transactionIndex: Schema.NullOr(IntFromHex)
|
|
31
|
+
}).annotate({
|
|
32
|
+
identifier: "EvmTransaction",
|
|
33
|
+
title: "EVM transaction"
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* The receipt of a transaction included in a block. `status` is 1 for a success and 0 for a revert, and
|
|
37
|
+
* `effectiveGasPrice` is in wei per gas. A receipt older than the Byzantium fork has no `status` and does not decode.
|
|
38
|
+
*
|
|
39
|
+
* @since 0.3.0
|
|
40
|
+
* @category schemas
|
|
41
|
+
*/
|
|
42
|
+
export const EvmTransactionReceipt = /*#__PURE__*/Schema.Struct({
|
|
43
|
+
transactionHash: EvmTransactionHash,
|
|
44
|
+
transactionIndex: IntFromHex,
|
|
45
|
+
blockNumber: QuantityFromHex,
|
|
46
|
+
blockHash: EvmHexData,
|
|
47
|
+
from: EvmAddress,
|
|
48
|
+
to: Schema.NullOr(EvmAddress),
|
|
49
|
+
status: IntFromHex.check(Schema.isBetween({
|
|
50
|
+
minimum: 0,
|
|
51
|
+
maximum: 1
|
|
52
|
+
})),
|
|
53
|
+
gasUsed: QuantityFromHex,
|
|
54
|
+
effectiveGasPrice: QuantityFromHex,
|
|
55
|
+
logs: Schema.Array(EvmLog)
|
|
56
|
+
}).annotate({
|
|
57
|
+
identifier: "EvmTransactionReceipt",
|
|
58
|
+
title: "EVM transaction receipt"
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=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AAE,OAAO,EAAE;EAAC,CAAE,CAAC,CAAC;EACtE,OAAO,EAAE,eAAe;EACxB,iBAAiB,EAAE,eAAe;EAClC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;CAC1B,CAAC,CAAC,QAAQ,CAAC;EAAE,UAAU,EAAE,uBAAuB;EAAE,KAAK,EAAE;AAAyB,CAAE,CAAC","ignoreList":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ export * as EvmAddress from "./EvmAddress.ts";
|
|
|
9
9
|
* @since 0.1.0
|
|
10
10
|
*/
|
|
11
11
|
export * as EvmBlock from "./EvmBlock.ts";
|
|
12
|
+
/**
|
|
13
|
+
* @since 0.3.0
|
|
14
|
+
*/
|
|
15
|
+
export * as EvmFeeHistory from "./EvmFeeHistory.ts";
|
|
12
16
|
/**
|
|
13
17
|
* @since 0.1.0
|
|
14
18
|
*/
|
|
@@ -25,10 +29,22 @@ export * as EvmLog from "./EvmLog.ts";
|
|
|
25
29
|
* @since 0.1.0
|
|
26
30
|
*/
|
|
27
31
|
export * as EvmNetwork from "./EvmNetwork.ts";
|
|
32
|
+
/**
|
|
33
|
+
* @since 0.3.0
|
|
34
|
+
*/
|
|
35
|
+
export * as EvmRelayer from "./EvmRelayer.ts";
|
|
28
36
|
/**
|
|
29
37
|
* @since 0.1.0
|
|
30
38
|
*/
|
|
31
39
|
export * as EvmRpc from "./EvmRpc.ts";
|
|
40
|
+
/**
|
|
41
|
+
* @since 0.3.0
|
|
42
|
+
*/
|
|
43
|
+
export * as EvmSigner from "./EvmSigner.ts";
|
|
44
|
+
/**
|
|
45
|
+
* @since 0.3.0
|
|
46
|
+
*/
|
|
47
|
+
export * as EvmTransaction from "./EvmTransaction.ts";
|
|
32
48
|
/**
|
|
33
49
|
* @since 0.1.0
|
|
34
50
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/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kBAAkB,MAAM,yBAAyB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,10 @@ export * as EvmAddress from "./EvmAddress.js";
|
|
|
10
10
|
* @since 0.1.0
|
|
11
11
|
*/
|
|
12
12
|
export * as EvmBlock from "./EvmBlock.js";
|
|
13
|
+
/**
|
|
14
|
+
* @since 0.3.0
|
|
15
|
+
*/
|
|
16
|
+
export * as EvmFeeHistory from "./EvmFeeHistory.js";
|
|
13
17
|
/**
|
|
14
18
|
* @since 0.1.0
|
|
15
19
|
*/
|
|
@@ -26,10 +30,22 @@ export * as EvmLog from "./EvmLog.js";
|
|
|
26
30
|
* @since 0.1.0
|
|
27
31
|
*/
|
|
28
32
|
export * as EvmNetwork from "./EvmNetwork.js";
|
|
33
|
+
/**
|
|
34
|
+
* @since 0.3.0
|
|
35
|
+
*/
|
|
36
|
+
export * as EvmRelayer from "./EvmRelayer.js";
|
|
29
37
|
/**
|
|
30
38
|
* @since 0.1.0
|
|
31
39
|
*/
|
|
32
40
|
export * as EvmRpc from "./EvmRpc.js";
|
|
41
|
+
/**
|
|
42
|
+
* @since 0.3.0
|
|
43
|
+
*/
|
|
44
|
+
export * as EvmSigner from "./EvmSigner.js";
|
|
45
|
+
/**
|
|
46
|
+
* @since 0.3.0
|
|
47
|
+
*/
|
|
48
|
+
export * as EvmTransaction from "./EvmTransaction.js";
|
|
33
49
|
/**
|
|
34
50
|
* @since 0.1.0
|
|
35
51
|
*/
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;AAGA,OAAO,KAAK,UAAU,MAAM,iBAAiB;AAE7C;;;AAGA,OAAO,KAAK,QAAQ,MAAM,eAAe;AAEzC;;;AAGA,OAAO,KAAK,UAAU,MAAM,iBAAiB;AAE7C;;;AAGA,OAAO,KAAK,UAAU,MAAM,iBAAiB;AAE7C;;;AAGA,OAAO,KAAK,MAAM,MAAM,aAAa;AAErC;;;AAGA,OAAO,KAAK,UAAU,MAAM,iBAAiB;AAE7C;;;AAGA,OAAO,KAAK,MAAM,MAAM,aAAa;AAErC;;;AAGA,OAAO,KAAK,kBAAkB,MAAM,yBAAyB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;AAGA,OAAO,KAAK,UAAU,MAAM,iBAAiB;AAE7C;;;AAGA,OAAO,KAAK,QAAQ,MAAM,eAAe;AAEzC;;;AAGA,OAAO,KAAK,aAAa,MAAM,oBAAoB;AAEnD;;;AAGA,OAAO,KAAK,UAAU,MAAM,iBAAiB;AAE7C;;;AAGA,OAAO,KAAK,UAAU,MAAM,iBAAiB;AAE7C;;;AAGA,OAAO,KAAK,MAAM,MAAM,aAAa;AAErC;;;AAGA,OAAO,KAAK,UAAU,MAAM,iBAAiB;AAE7C;;;AAGA,OAAO,KAAK,UAAU,MAAM,iBAAiB;AAE7C;;;AAGA,OAAO,KAAK,MAAM,MAAM,aAAa;AAErC;;;AAGA,OAAO,KAAK,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAK,cAAc,MAAM,qBAAqB;AAErD;;;AAGA,OAAO,KAAK,kBAAkB,MAAM,yBAAyB","ignoreList":[]}
|