essential-eth 0.9.2-beta.2 → 0.9.2-beta.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/dist/cjs/classes/Contract.d.ts +81 -11
- package/dist/cjs/classes/test/Contract/crv-abi.d.ts +2 -2
- package/dist/cjs/classes/test/Contract/ens-abi.d.ts +2 -2
- package/dist/cjs/classes/test/Contract/fei-abi.d.ts +2 -2
- package/dist/cjs/classes/test/Contract/foo-abi.d.ts +2 -2
- package/dist/cjs/classes/test/Contract/uniswap-abi.d.ts +2 -2
- package/dist/cjs/classes/utils/clean-block.d.ts +120 -2
- package/dist/cjs/classes/utils/clean-log.d.ts +9 -2
- package/dist/cjs/classes/utils/clean-transaction-receipt.d.ts +14 -2
- package/dist/cjs/classes/utils/clean-transaction.d.ts +14 -2
- package/dist/cjs/classes/utils/encode-decode-transaction.d.ts +16 -4
- package/dist/cjs/classes/utils/fetchers.d.ts +53 -15
- package/dist/cjs/classes/utils/hex-to-decimal.d.ts +18 -1
- package/dist/cjs/classes/utils/prepare-transaction.d.ts +6 -2
- package/dist/cjs/index.d.ts +24 -25
- package/dist/cjs/index.js +21 -19
- package/dist/cjs/logger/logger.d.ts +11 -11
- package/dist/cjs/logger/package-version.d.ts +1 -1
- package/dist/cjs/logger/package-version.js +1 -1
- package/dist/cjs/providers/AlchemyProvider.d.ts +4 -4
- package/dist/cjs/providers/BaseProvider.d.ts +374 -26
- package/dist/cjs/providers/FallthroughProvider.d.ts +24 -11
- package/dist/cjs/providers/JsonRpcProvider.d.ts +33 -7
- package/dist/cjs/providers/test/json-rpc-provider/get-logs/mocks.d.ts +14 -14
- package/dist/cjs/providers/test/mock-of.d.ts +9 -2
- package/dist/cjs/providers/test/rpc-urls.d.ts +12 -12
- package/dist/cjs/providers/utils/chains-info.d.ts +24 -24
- package/dist/cjs/shared/tiny-big/helpers.d.ts +17 -1
- package/dist/cjs/shared/tiny-big/tiny-big.d.ts +58 -10
- package/dist/cjs/shared/validate-type.d.ts +3 -3
- package/dist/cjs/types/Block.types.d.ts +41 -40
- package/dist/cjs/types/Contract.types.d.ts +24 -24
- package/dist/cjs/types/FeeData.types.d.ts +7 -7
- package/dist/cjs/types/Filter.types.d.ts +16 -12
- package/dist/cjs/types/Network.types.d.ts +8 -5
- package/dist/cjs/types/Transaction.types.d.ts +123 -113
- package/dist/cjs/utils/bytes.d.ts +289 -40
- package/dist/cjs/utils/compute-address.d.ts +17 -1
- package/dist/cjs/utils/compute-public-key.d.ts +18 -2
- package/dist/cjs/utils/ether-to-gwei.d.ts +27 -3
- package/dist/cjs/utils/ether-to-wei.d.ts +27 -3
- package/dist/cjs/utils/gwei-to-ether.d.ts +27 -3
- package/dist/cjs/utils/hash-message.d.ts +14 -2
- package/dist/cjs/utils/is-address.d.ts +24 -1
- package/dist/cjs/utils/keccak256.d.ts +16 -2
- package/dist/cjs/utils/solidity-keccak256.d.ts +39 -2
- package/dist/cjs/utils/split-signature.d.ts +24 -2
- package/dist/cjs/utils/to-checksum-address.d.ts +17 -1
- package/dist/cjs/utils/to-utf8-bytes.d.ts +15 -1
- package/dist/cjs/utils/wei-to-ether.d.ts +27 -3
- package/dist/esm/classes/Contract.d.ts +11 -11
- package/dist/esm/classes/test/Contract/crv-abi.d.ts +2 -2
- package/dist/esm/classes/test/Contract/ens-abi.d.ts +2 -2
- package/dist/esm/classes/test/Contract/fei-abi.d.ts +2 -2
- package/dist/esm/classes/test/Contract/foo-abi.d.ts +2 -2
- package/dist/esm/classes/test/Contract/uniswap-abi.d.ts +2 -2
- package/dist/esm/classes/utils/clean-block.d.ts +2 -2
- package/dist/esm/classes/utils/clean-log.d.ts +2 -2
- package/dist/esm/classes/utils/clean-transaction-receipt.d.ts +2 -2
- package/dist/esm/classes/utils/clean-transaction.d.ts +2 -2
- package/dist/esm/classes/utils/encode-decode-transaction.d.ts +4 -4
- package/dist/esm/classes/utils/fetchers.d.ts +15 -15
- package/dist/esm/classes/utils/hex-to-decimal.d.ts +1 -1
- package/dist/esm/classes/utils/prepare-transaction.d.ts +2 -2
- package/dist/esm/index.d.ts +24 -25
- package/dist/esm/index.js +3 -4
- package/dist/esm/logger/logger.d.ts +11 -11
- package/dist/esm/logger/package-version.d.ts +1 -1
- package/dist/esm/logger/package-version.js +1 -1
- package/dist/esm/providers/AlchemyProvider.d.ts +4 -4
- package/dist/esm/providers/BaseProvider.d.ts +26 -26
- package/dist/esm/providers/FallthroughProvider.d.ts +11 -11
- package/dist/esm/providers/JsonRpcProvider.d.ts +7 -7
- package/dist/esm/providers/test/json-rpc-provider/get-logs/mocks.d.ts +14 -14
- package/dist/esm/providers/test/mock-of.d.ts +2 -2
- package/dist/esm/providers/test/rpc-urls.d.ts +12 -12
- package/dist/esm/providers/utils/chains-info.d.ts +24 -24
- package/dist/esm/shared/tiny-big/helpers.d.ts +1 -1
- package/dist/esm/shared/tiny-big/tiny-big.d.ts +10 -10
- package/dist/esm/shared/validate-type.d.ts +3 -3
- package/dist/esm/types/Block.types.d.ts +40 -40
- package/dist/esm/types/Contract.types.d.ts +24 -24
- package/dist/esm/types/FeeData.types.d.ts +7 -7
- package/dist/esm/types/Filter.types.d.ts +12 -12
- package/dist/esm/types/Network.types.d.ts +5 -5
- package/dist/esm/types/Transaction.types.d.ts +113 -113
- package/dist/esm/utils/bytes.d.ts +40 -40
- package/dist/esm/utils/compute-address.d.ts +1 -1
- package/dist/esm/utils/compute-public-key.d.ts +2 -2
- package/dist/esm/utils/ether-to-gwei.d.ts +3 -3
- package/dist/esm/utils/ether-to-wei.d.ts +3 -3
- package/dist/esm/utils/gwei-to-ether.d.ts +3 -3
- package/dist/esm/utils/hash-message.d.ts +2 -2
- package/dist/esm/utils/is-address.d.ts +1 -1
- package/dist/esm/utils/keccak256.d.ts +2 -2
- package/dist/esm/utils/solidity-keccak256.d.ts +2 -2
- package/dist/esm/utils/split-signature.d.ts +2 -2
- package/dist/esm/utils/to-checksum-address.d.ts +1 -1
- package/dist/esm/utils/to-utf8-bytes.d.ts +1 -1
- package/dist/esm/utils/wei-to-ether.d.ts +3 -3
- package/dist/{cjs/index.umd.js → essential-eth.umd.js} +2 -2
- package/dist/essential-eth.umd.js.map +1 -0
- package/package.json +8 -9
- package/readme.md +1 -1
- package/dist/cjs/index.umd.js.map +0 -1
|
@@ -1,10 +1,58 @@
|
|
|
1
|
-
import Big from 'big.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import Big from 'big.js';
|
|
2
|
+
/**
|
|
3
|
+
* A wrapper around [big.js](https://github.com/MikeMcl/big.js) which expands scientific notation and creates a "toHexString" function.
|
|
4
|
+
* This is the return type of every operation on ether, wei, etc.
|
|
5
|
+
*/
|
|
6
|
+
export declare class TinyBig extends Big {
|
|
7
|
+
constructor(value: string | number | TinyBig | Big);
|
|
8
|
+
/**
|
|
9
|
+
* Used anytime you're passing in "value" to ethers or web3
|
|
10
|
+
* For now, TypeScript will complain that `TinyBig` is not a `BigNumberish`. You can // @ts-ignore or call this
|
|
11
|
+
*
|
|
12
|
+
* @returns the TinyBig represented as a hex string
|
|
13
|
+
* @example
|
|
14
|
+
* ```javascript
|
|
15
|
+
* tinyBig(293).toHexString();
|
|
16
|
+
* // '0x125'
|
|
17
|
+
* ```
|
|
18
|
+
* @example
|
|
19
|
+
* ```javascript
|
|
20
|
+
* tinyBig(681365874).toHexString();
|
|
21
|
+
* // '0x289cd172'
|
|
22
|
+
*/
|
|
23
|
+
toHexString(): string;
|
|
24
|
+
toNumber(): number;
|
|
25
|
+
toString(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Eithers pads or shortens a string to a specified length
|
|
28
|
+
*
|
|
29
|
+
* @param str the string to pad or chop
|
|
30
|
+
* @param padChar the character to pad the string with
|
|
31
|
+
* @param length the desired length of the given string
|
|
32
|
+
* @returns a string of the desired length, either padded with the specified padChar or with the beginning of the string chopped off
|
|
33
|
+
* @example
|
|
34
|
+
* ```javascript
|
|
35
|
+
* padAndChop('essential-eth', 'a', 8);
|
|
36
|
+
* // 'tial-eth'
|
|
37
|
+
* ```
|
|
38
|
+
* @example
|
|
39
|
+
* ```javascript
|
|
40
|
+
* padAndChop('essential-eth', 'A', 20);
|
|
41
|
+
* // 'AAAAAAAessential-eth'
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
private padAndChop;
|
|
45
|
+
toTwos(bitCount: number): Big;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Helper factory function so that you don't have to type "new" when instantiating a new TinyBig
|
|
49
|
+
*
|
|
50
|
+
* @param value the value to initiate the TinyBig with
|
|
51
|
+
* @returns an initiated {@link TinyBig}
|
|
52
|
+
* @example
|
|
53
|
+
* ```javascript
|
|
54
|
+
* tinyBig(10).times(3).toNumber()
|
|
55
|
+
* // 30
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function tinyBig(value: string | number | TinyBig | Big): TinyBig;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
type JSPrimitiveTypes = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function';
|
|
2
|
-
export declare const validateType: (value: unknown, allowedTypes: JSPrimitiveTypes[]) => void;
|
|
3
|
-
export {};
|
|
1
|
+
type JSPrimitiveTypes = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function';
|
|
2
|
+
export declare const validateType: (value: unknown, allowedTypes: JSPrimitiveTypes[]) => void;
|
|
3
|
+
export {};
|
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
import type { TinyBig } from './../shared/tiny-big/tiny-big';
|
|
2
|
-
import type { BlockTransactionResponse, RPCTransaction } from './Transaction.types';
|
|
3
|
-
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
4
|
-
export type BlockResponse = Modify<RPCBlock, {
|
|
5
|
-
baseFeePerGas: TinyBig;
|
|
6
|
-
difficulty: TinyBig;
|
|
7
|
-
gasLimit: TinyBig;
|
|
8
|
-
gasUsed: TinyBig;
|
|
9
|
-
nonce: TinyBig;
|
|
10
|
-
number: number;
|
|
11
|
-
size: TinyBig;
|
|
12
|
-
timestamp: TinyBig;
|
|
13
|
-
totalDifficulty: TinyBig;
|
|
14
|
-
transactions: Array<string | BlockTransactionResponse>;
|
|
15
|
-
}>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export
|
|
1
|
+
import type { TinyBig } from './../shared/tiny-big/tiny-big';
|
|
2
|
+
import type { BlockTransactionResponse, RPCTransaction } from './Transaction.types';
|
|
3
|
+
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
4
|
+
export type BlockResponse = Modify<RPCBlock, {
|
|
5
|
+
baseFeePerGas: TinyBig;
|
|
6
|
+
difficulty: TinyBig;
|
|
7
|
+
gasLimit: TinyBig;
|
|
8
|
+
gasUsed: TinyBig;
|
|
9
|
+
nonce: TinyBig;
|
|
10
|
+
number: number;
|
|
11
|
+
size: TinyBig;
|
|
12
|
+
timestamp: TinyBig;
|
|
13
|
+
totalDifficulty: TinyBig;
|
|
14
|
+
transactions: Array<string | BlockTransactionResponse>;
|
|
15
|
+
}>;
|
|
16
|
+
/** Exact response from backend */
|
|
17
|
+
export interface RPCBlock {
|
|
18
|
+
baseFeePerGas: string;
|
|
19
|
+
difficulty: string;
|
|
20
|
+
extraData: string;
|
|
21
|
+
gasLimit: string;
|
|
22
|
+
gasUsed: string;
|
|
23
|
+
hash: string;
|
|
24
|
+
logsBloom: string;
|
|
25
|
+
miner: string;
|
|
26
|
+
mixHash: string;
|
|
27
|
+
nonce: string;
|
|
28
|
+
number: string;
|
|
29
|
+
parentHash: string;
|
|
30
|
+
receiptsRoot: string;
|
|
31
|
+
sha3Uncles: string;
|
|
32
|
+
size: string;
|
|
33
|
+
stateRoot: string;
|
|
34
|
+
timestamp: string;
|
|
35
|
+
totalDifficulty: string;
|
|
36
|
+
transactions: Array<string | RPCTransaction>;
|
|
37
|
+
transactionsRoot: string;
|
|
38
|
+
uncles: Array<string>;
|
|
39
|
+
}
|
|
40
|
+
export type BlockTag = 'latest' | 'earliest' | 'pending' | number | string;
|
|
41
|
+
export {};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export type ContractTypes = 'bool' | 'bytes1' | 'bytes2' | 'bytes3' | 'bytes4' | 'bytes5' | 'bytes6' | 'bytes7' | 'bytes8' | 'bytes9' | 'bytes10' | 'bytes11' | 'bytes12' | 'bytes13' | 'bytes14' | 'bytes15' | 'bytes16' | 'bytes17' | 'bytes18' | 'bytes19' | 'bytes20' | 'bytes21' | 'bytes22' | 'bytes23' | 'bytes24' | 'bytes25' | 'bytes26' | 'bytes27' | 'bytes28' | 'bytes29' | 'bytes30' | 'bytes31' | 'bytes32' | 'bytes32[]' | 'address' | 'address payable' | 'address[4]' | 'address[100]' | 'uint256' | 'uint256[100]' | 'uint8' | 'uint32' | string;
|
|
2
|
-
export type ContractInterface = JSONABI;
|
|
3
|
-
export type ContractFunction<T = any> = (...args: Array<any>) => Promise<T>;
|
|
4
|
-
export interface JSONABIArgument {
|
|
5
|
-
anonymous?: false;
|
|
6
|
-
inputs: {
|
|
7
|
-
internalType?: ContractTypes | string;
|
|
8
|
-
name: string;
|
|
9
|
-
type: ContractTypes;
|
|
10
|
-
indexed?: boolean;
|
|
11
|
-
}[];
|
|
12
|
-
name?: string;
|
|
13
|
-
outputs?: {
|
|
14
|
-
internalType?: ContractTypes | string;
|
|
15
|
-
name: string;
|
|
16
|
-
type: ContractTypes;
|
|
17
|
-
}[];
|
|
18
|
-
stateMutability?: 'view' | 'nonpayable' | string;
|
|
19
|
-
type: 'function' | 'event' | 'constructor' | 'error' | 'fallback';
|
|
20
|
-
gas?: number;
|
|
21
|
-
constant?: boolean;
|
|
22
|
-
payable?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export type JSONABI = JSONABIArgument[];
|
|
1
|
+
export type ContractTypes = 'bool' | 'bytes1' | 'bytes2' | 'bytes3' | 'bytes4' | 'bytes5' | 'bytes6' | 'bytes7' | 'bytes8' | 'bytes9' | 'bytes10' | 'bytes11' | 'bytes12' | 'bytes13' | 'bytes14' | 'bytes15' | 'bytes16' | 'bytes17' | 'bytes18' | 'bytes19' | 'bytes20' | 'bytes21' | 'bytes22' | 'bytes23' | 'bytes24' | 'bytes25' | 'bytes26' | 'bytes27' | 'bytes28' | 'bytes29' | 'bytes30' | 'bytes31' | 'bytes32' | 'bytes32[]' | 'address' | 'address payable' | 'address[4]' | 'address[100]' | 'uint256' | 'uint256[100]' | 'uint8' | 'uint32' | string;
|
|
2
|
+
export type ContractInterface = JSONABI;
|
|
3
|
+
export type ContractFunction<T = any> = (...args: Array<any>) => Promise<T>;
|
|
4
|
+
export interface JSONABIArgument {
|
|
5
|
+
anonymous?: false;
|
|
6
|
+
inputs: {
|
|
7
|
+
internalType?: ContractTypes | string;
|
|
8
|
+
name: string;
|
|
9
|
+
type: ContractTypes;
|
|
10
|
+
indexed?: boolean;
|
|
11
|
+
}[];
|
|
12
|
+
name?: string;
|
|
13
|
+
outputs?: {
|
|
14
|
+
internalType?: ContractTypes | string;
|
|
15
|
+
name: string;
|
|
16
|
+
type: ContractTypes;
|
|
17
|
+
}[];
|
|
18
|
+
stateMutability?: 'view' | 'nonpayable' | string;
|
|
19
|
+
type: 'function' | 'event' | 'constructor' | 'error' | 'fallback';
|
|
20
|
+
gas?: number;
|
|
21
|
+
constant?: boolean;
|
|
22
|
+
payable?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export type JSONABI = JSONABIArgument[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { TinyBig } from '../shared/tiny-big/tiny-big';
|
|
2
|
-
export interface FeeData {
|
|
3
|
-
gasPrice: TinyBig;
|
|
4
|
-
lastBaseFeePerGas: TinyBig | null;
|
|
5
|
-
maxFeePerGas: TinyBig | null;
|
|
6
|
-
maxPriorityFeePerGas: TinyBig | null;
|
|
7
|
-
}
|
|
1
|
+
import type { TinyBig } from '../shared/tiny-big/tiny-big';
|
|
2
|
+
export interface FeeData {
|
|
3
|
+
gasPrice: TinyBig;
|
|
4
|
+
lastBaseFeePerGas: TinyBig | null;
|
|
5
|
+
maxFeePerGas: TinyBig | null;
|
|
6
|
+
maxPriorityFeePerGas: TinyBig | null;
|
|
7
|
+
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import type { BlockTag } from './Block.types';
|
|
2
|
-
export interface EventFilter {
|
|
3
|
-
address?: string;
|
|
4
|
-
topics?: Array<string | Array<string> | null>;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export interface
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import type { BlockTag } from './Block.types';
|
|
2
|
+
export interface EventFilter {
|
|
3
|
+
address?: string;
|
|
4
|
+
topics?: Array<string | Array<string> | null>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @param fromBlock block as starting point for range, inclusive
|
|
8
|
+
* @param toBlock block as ending point for range, inclusive
|
|
9
|
+
*/
|
|
10
|
+
export interface Filter extends EventFilter {
|
|
11
|
+
fromBlock?: BlockTag;
|
|
12
|
+
toBlock?: BlockTag;
|
|
13
|
+
}
|
|
14
|
+
export interface FilterByBlockHash extends EventFilter {
|
|
15
|
+
blockHash?: string;
|
|
16
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A trimmed version of https://chainid.network/chains.json
|
|
3
|
+
*/
|
|
4
|
+
export interface Network {
|
|
5
|
+
chainId: number;
|
|
6
|
+
ensAddress: string | null;
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
@@ -1,113 +1,123 @@
|
|
|
1
|
-
import type Big from 'big.js';
|
|
2
|
-
import type { TinyBig } from '../shared/tiny-big/tiny-big';
|
|
3
|
-
import type { BytesLike } from './../utils/bytes';
|
|
4
|
-
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
5
|
-
export interface RPCTransaction extends RPCBlockTransaction {
|
|
6
|
-
maxFeePerGas: string;
|
|
7
|
-
maxPriorityFeePerGas: string;
|
|
8
|
-
}
|
|
9
|
-
export type TransactionResponse = Modify<RPCTransaction, {
|
|
10
|
-
blockNumber: number;
|
|
11
|
-
chainId: number;
|
|
12
|
-
gas: TinyBig;
|
|
13
|
-
gasLimit: TinyBig;
|
|
14
|
-
gasPrice: TinyBig;
|
|
15
|
-
nonce: TinyBig;
|
|
16
|
-
transactionIndex: number;
|
|
17
|
-
type: number;
|
|
18
|
-
v: number;
|
|
19
|
-
value: TinyBig;
|
|
20
|
-
} & {
|
|
21
|
-
maxFeePerGas: TinyBig;
|
|
22
|
-
maxPriorityFeePerGas: TinyBig;
|
|
23
|
-
confirmations: number;
|
|
24
|
-
}>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
1
|
+
import type Big from 'big.js';
|
|
2
|
+
import type { TinyBig } from '../shared/tiny-big/tiny-big';
|
|
3
|
+
import type { BytesLike } from './../utils/bytes';
|
|
4
|
+
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
5
|
+
export interface RPCTransaction extends RPCBlockTransaction {
|
|
6
|
+
maxFeePerGas: string;
|
|
7
|
+
maxPriorityFeePerGas: string;
|
|
8
|
+
}
|
|
9
|
+
export type TransactionResponse = Modify<RPCTransaction, {
|
|
10
|
+
blockNumber: number;
|
|
11
|
+
chainId: number;
|
|
12
|
+
gas: TinyBig;
|
|
13
|
+
gasLimit: TinyBig;
|
|
14
|
+
gasPrice: TinyBig;
|
|
15
|
+
nonce: TinyBig;
|
|
16
|
+
transactionIndex: number;
|
|
17
|
+
type: number;
|
|
18
|
+
v: number;
|
|
19
|
+
value: TinyBig;
|
|
20
|
+
} & {
|
|
21
|
+
maxFeePerGas: TinyBig;
|
|
22
|
+
maxPriorityFeePerGas: TinyBig;
|
|
23
|
+
confirmations: number;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Type that contains information from the receipt of a transaction
|
|
27
|
+
*
|
|
28
|
+
* * Similar to [`Type TransactionReceipt on ethers.providers`](https://docs.ethers.io/v5/api/providers/types/#providers-TransactionReceipt)
|
|
29
|
+
*/
|
|
30
|
+
export type TransactionReceipt = Modify<RPCTransactionReceipt, {
|
|
31
|
+
blockNumber: number;
|
|
32
|
+
cumulativeGasUsed: TinyBig;
|
|
33
|
+
effectiveGasPrice: TinyBig;
|
|
34
|
+
gasUsed: TinyBig;
|
|
35
|
+
logs: Array<Log>;
|
|
36
|
+
status: number;
|
|
37
|
+
transactionIndex: number;
|
|
38
|
+
type: number;
|
|
39
|
+
} & {
|
|
40
|
+
byzantium: boolean;
|
|
41
|
+
confirmations: number;
|
|
42
|
+
}>;
|
|
43
|
+
export interface RPCTransactionRequest {
|
|
44
|
+
from?: string;
|
|
45
|
+
to: string;
|
|
46
|
+
gas?: string;
|
|
47
|
+
gasPrice?: string;
|
|
48
|
+
value?: string;
|
|
49
|
+
data?: BytesLike;
|
|
50
|
+
nonce?: string;
|
|
51
|
+
maxPriorityFeePerGas?: string;
|
|
52
|
+
maxFeePerGas?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface TransactionRequest {
|
|
55
|
+
to?: string;
|
|
56
|
+
from?: string;
|
|
57
|
+
nonce?: TinyBig | string | Big | number;
|
|
58
|
+
gas?: TinyBig | number | Big | string;
|
|
59
|
+
gasPrice?: TinyBig | Big | string | number;
|
|
60
|
+
data?: BytesLike;
|
|
61
|
+
value?: TinyBig | string | Big | number;
|
|
62
|
+
chainId?: number;
|
|
63
|
+
type?: number;
|
|
64
|
+
maxPriorityFeePerGas?: TinyBig | string | Big | number;
|
|
65
|
+
maxFeePerGas?: TinyBig | string | Big | number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Type for the logs that are included in transaction receipts
|
|
69
|
+
* Similar to [`Type Log on ethers.providers`](https://docs.ethers.io/v5/api/providers/types/#providers-Log)
|
|
70
|
+
*/
|
|
71
|
+
export type Log = Modify<RPCLog, {
|
|
72
|
+
blockNumber: number;
|
|
73
|
+
logIndex: number;
|
|
74
|
+
transactionIndex: number;
|
|
75
|
+
}>;
|
|
76
|
+
export type BlockTransactionResponse = Omit<TransactionResponse, 'maxFeePerGas' | 'maxPriorityFeePerGas'>;
|
|
77
|
+
/** What JSONRPC responds with in getBlock transaction array */
|
|
78
|
+
export interface RPCBlockTransaction {
|
|
79
|
+
blockHash: string;
|
|
80
|
+
blockNumber: string;
|
|
81
|
+
chainId: string;
|
|
82
|
+
from: string;
|
|
83
|
+
gas: string;
|
|
84
|
+
gasPrice: string;
|
|
85
|
+
hash: string;
|
|
86
|
+
input: string;
|
|
87
|
+
nonce: string;
|
|
88
|
+
r: string;
|
|
89
|
+
s: string;
|
|
90
|
+
to: string;
|
|
91
|
+
transactionIndex: string;
|
|
92
|
+
type: string;
|
|
93
|
+
v: string;
|
|
94
|
+
value: string;
|
|
95
|
+
}
|
|
96
|
+
export interface RPCTransactionReceipt {
|
|
97
|
+
blockHash: string;
|
|
98
|
+
blockNumber: string;
|
|
99
|
+
contractAddress: string;
|
|
100
|
+
cumulativeGasUsed: string;
|
|
101
|
+
effectiveGasPrice: string;
|
|
102
|
+
from: string;
|
|
103
|
+
gasUsed: string;
|
|
104
|
+
logs: Array<RPCLog>;
|
|
105
|
+
logsBloom: string;
|
|
106
|
+
status: string;
|
|
107
|
+
to: string;
|
|
108
|
+
transactionHash: string;
|
|
109
|
+
transactionIndex: string;
|
|
110
|
+
type: string;
|
|
111
|
+
}
|
|
112
|
+
export interface RPCLog {
|
|
113
|
+
address: string;
|
|
114
|
+
blockHash: string;
|
|
115
|
+
blockNumber: string;
|
|
116
|
+
data: string;
|
|
117
|
+
logIndex: string;
|
|
118
|
+
removed?: boolean;
|
|
119
|
+
topics: Array<string>;
|
|
120
|
+
transactionHash: string;
|
|
121
|
+
transactionIndex: string;
|
|
122
|
+
}
|
|
123
|
+
export {};
|