essential-eth 0.10.3 → 0.11.1
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/index.cjs +2024 -0
- package/dist/index.d.cts +330 -0
- package/dist/index.d.ts +330 -0
- package/dist/index.js +1952 -0
- package/package.json +14 -15
- package/readme.md +2 -2
- package/dist/cjs/classes/Contract.d.ts +0 -81
- package/dist/cjs/classes/Contract.js +0 -139
- package/dist/cjs/classes/test/Contract/crv-abi.d.ts +0 -2
- package/dist/cjs/classes/test/Contract/crv-abi.js +0 -413
- package/dist/cjs/classes/test/Contract/ens-abi.d.ts +0 -2
- package/dist/cjs/classes/test/Contract/ens-abi.js +0 -453
- package/dist/cjs/classes/test/Contract/fei-abi.d.ts +0 -2
- package/dist/cjs/classes/test/Contract/fei-abi.js +0 -526
- package/dist/cjs/classes/test/Contract/foo-abi.d.ts +0 -2
- package/dist/cjs/classes/test/Contract/foo-abi.js +0 -42
- package/dist/cjs/classes/test/Contract/jokerrace-abi.d.ts +0 -2
- package/dist/cjs/classes/test/Contract/jokerrace-abi.js +0 -22
- package/dist/cjs/classes/test/Contract/uniswap-abi.d.ts +0 -2
- package/dist/cjs/classes/test/Contract/uniswap-abi.js +0 -121
- package/dist/cjs/classes/utils/clean-block.d.ts +0 -120
- package/dist/cjs/classes/utils/clean-block.js +0 -160
- package/dist/cjs/classes/utils/clean-log.d.ts +0 -9
- package/dist/cjs/classes/utils/clean-log.js +0 -39
- package/dist/cjs/classes/utils/clean-transaction-receipt.d.ts +0 -14
- package/dist/cjs/classes/utils/clean-transaction-receipt.js +0 -53
- package/dist/cjs/classes/utils/clean-transaction.d.ts +0 -14
- package/dist/cjs/classes/utils/clean-transaction.js +0 -54
- package/dist/cjs/classes/utils/encode-decode-transaction.d.ts +0 -16
- package/dist/cjs/classes/utils/encode-decode-transaction.js +0 -185
- package/dist/cjs/classes/utils/fetchers.d.ts +0 -53
- package/dist/cjs/classes/utils/fetchers.js +0 -85
- package/dist/cjs/classes/utils/hex-to-decimal.d.ts +0 -18
- package/dist/cjs/classes/utils/hex-to-decimal.js +0 -24
- package/dist/cjs/classes/utils/prepare-transaction.d.ts +0 -6
- package/dist/cjs/classes/utils/prepare-transaction.js +0 -47
- package/dist/cjs/index.d.ts +0 -24
- package/dist/cjs/index.js +0 -58
- package/dist/cjs/index.umd.js +0 -2
- package/dist/cjs/index.umd.js.map +0 -1
- package/dist/cjs/logger/logger.d.ts +0 -11
- package/dist/cjs/logger/logger.js +0 -37
- package/dist/cjs/logger/package-version.d.ts +0 -1
- package/dist/cjs/logger/package-version.js +0 -5
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/providers/AlchemyProvider.d.ts +0 -4
- package/dist/cjs/providers/AlchemyProvider.js +0 -11
- package/dist/cjs/providers/BaseProvider.d.ts +0 -374
- package/dist/cjs/providers/BaseProvider.js +0 -514
- package/dist/cjs/providers/FallthroughProvider.d.ts +0 -24
- package/dist/cjs/providers/FallthroughProvider.js +0 -74
- package/dist/cjs/providers/JsonRpcProvider.d.ts +0 -33
- package/dist/cjs/providers/JsonRpcProvider.js +0 -46
- package/dist/cjs/providers/test/json-rpc-provider/get-logs/mocks.d.ts +0 -14
- package/dist/cjs/providers/test/json-rpc-provider/get-logs/mocks.js +0 -152
- package/dist/cjs/providers/test/mock-of.d.ts +0 -8
- package/dist/cjs/providers/test/mock-of.js +0 -12
- package/dist/cjs/providers/test/rpc-urls.d.ts +0 -12
- package/dist/cjs/providers/test/rpc-urls.js +0 -27
- package/dist/cjs/providers/utils/chains-info.d.ts +0 -24
- package/dist/cjs/providers/utils/chains-info.js +0 -71
- package/dist/cjs/shared/tiny-big/helpers.d.ts +0 -17
- package/dist/cjs/shared/tiny-big/helpers.js +0 -97
- package/dist/cjs/shared/tiny-big/tiny-big.d.ts +0 -58
- package/dist/cjs/shared/tiny-big/tiny-big.js +0 -101
- package/dist/cjs/shared/validate-type.d.ts +0 -3
- package/dist/cjs/shared/validate-type.js +0 -9
- package/dist/cjs/types/Block.types.d.ts +0 -41
- package/dist/cjs/types/Block.types.js +0 -2
- package/dist/cjs/types/Contract.types.d.ts +0 -24
- package/dist/cjs/types/Contract.types.js +0 -2
- package/dist/cjs/types/FeeData.types.d.ts +0 -7
- package/dist/cjs/types/FeeData.types.js +0 -2
- package/dist/cjs/types/Filter.types.d.ts +0 -16
- package/dist/cjs/types/Filter.types.js +0 -2
- package/dist/cjs/types/Network.types.d.ts +0 -8
- package/dist/cjs/types/Network.types.js +0 -2
- package/dist/cjs/types/Transaction.types.d.ts +0 -123
- package/dist/cjs/types/Transaction.types.js +0 -2
- package/dist/cjs/utils/bytes.d.ts +0 -289
- package/dist/cjs/utils/bytes.js +0 -711
- package/dist/cjs/utils/compute-address.d.ts +0 -17
- package/dist/cjs/utils/compute-address.js +0 -34
- package/dist/cjs/utils/compute-public-key.d.ts +0 -18
- package/dist/cjs/utils/compute-public-key.js +0 -26
- package/dist/cjs/utils/ether-to-gwei.d.ts +0 -27
- package/dist/cjs/utils/ether-to-gwei.js +0 -35
- package/dist/cjs/utils/ether-to-wei.d.ts +0 -27
- package/dist/cjs/utils/ether-to-wei.js +0 -35
- package/dist/cjs/utils/gwei-to-ether.d.ts +0 -27
- package/dist/cjs/utils/gwei-to-ether.js +0 -35
- package/dist/cjs/utils/hash-message.d.ts +0 -14
- package/dist/cjs/utils/hash-message.js +0 -30
- package/dist/cjs/utils/is-address.d.ts +0 -24
- package/dist/cjs/utils/is-address.js +0 -39
- package/dist/cjs/utils/keccak256.d.ts +0 -16
- package/dist/cjs/utils/keccak256.js +0 -31
- package/dist/cjs/utils/solidity-keccak256.d.ts +0 -39
- package/dist/cjs/utils/solidity-keccak256.js +0 -138
- package/dist/cjs/utils/split-signature.d.ts +0 -24
- package/dist/cjs/utils/split-signature.js +0 -163
- package/dist/cjs/utils/to-checksum-address.d.ts +0 -17
- package/dist/cjs/utils/to-checksum-address.js +0 -46
- package/dist/cjs/utils/to-utf8-bytes.d.ts +0 -15
- package/dist/cjs/utils/to-utf8-bytes.js +0 -21
- package/dist/cjs/utils/wei-to-ether.d.ts +0 -27
- package/dist/cjs/utils/wei-to-ether.js +0 -45
- package/dist/esm/classes/Contract.d.ts +0 -11
- package/dist/esm/classes/Contract.js +0 -58
- package/dist/esm/classes/test/Contract/crv-abi.d.ts +0 -2
- package/dist/esm/classes/test/Contract/crv-abi.js +0 -395
- package/dist/esm/classes/test/Contract/ens-abi.d.ts +0 -2
- package/dist/esm/classes/test/Contract/ens-abi.js +0 -435
- package/dist/esm/classes/test/Contract/fei-abi.d.ts +0 -2
- package/dist/esm/classes/test/Contract/fei-abi.js +0 -521
- package/dist/esm/classes/test/Contract/foo-abi.d.ts +0 -2
- package/dist/esm/classes/test/Contract/foo-abi.js +0 -33
- package/dist/esm/classes/test/Contract/jokerrace-abi.d.ts +0 -2
- package/dist/esm/classes/test/Contract/jokerrace-abi.js +0 -18
- package/dist/esm/classes/test/Contract/uniswap-abi.d.ts +0 -2
- package/dist/esm/classes/test/Contract/uniswap-abi.js +0 -116
- package/dist/esm/classes/utils/clean-block.d.ts +0 -2
- package/dist/esm/classes/utils/clean-block.js +0 -35
- package/dist/esm/classes/utils/clean-log.d.ts +0 -2
- package/dist/esm/classes/utils/clean-log.js +0 -28
- package/dist/esm/classes/utils/clean-transaction-receipt.d.ts +0 -2
- package/dist/esm/classes/utils/clean-transaction-receipt.js +0 -37
- package/dist/esm/classes/utils/clean-transaction.d.ts +0 -2
- package/dist/esm/classes/utils/clean-transaction.js +0 -36
- package/dist/esm/classes/utils/encode-decode-transaction.d.ts +0 -4
- package/dist/esm/classes/utils/encode-decode-transaction.js +0 -143
- package/dist/esm/classes/utils/fetchers.d.ts +0 -15
- package/dist/esm/classes/utils/fetchers.js +0 -37
- package/dist/esm/classes/utils/hex-to-decimal.d.ts +0 -1
- package/dist/esm/classes/utils/hex-to-decimal.js +0 -3
- package/dist/esm/classes/utils/prepare-transaction.d.ts +0 -2
- package/dist/esm/classes/utils/prepare-transaction.js +0 -36
- package/dist/esm/index.d.ts +0 -24
- package/dist/esm/index.js +0 -19
- package/dist/esm/logger/logger.d.ts +0 -11
- package/dist/esm/logger/logger.js +0 -34
- package/dist/esm/logger/package-version.d.ts +0 -1
- package/dist/esm/logger/package-version.js +0 -1
- package/dist/esm/providers/AlchemyProvider.d.ts +0 -4
- package/dist/esm/providers/AlchemyProvider.js +0 -7
- package/dist/esm/providers/BaseProvider.d.ts +0 -26
- package/dist/esm/providers/BaseProvider.js +0 -137
- package/dist/esm/providers/FallthroughProvider.d.ts +0 -11
- package/dist/esm/providers/FallthroughProvider.js +0 -50
- package/dist/esm/providers/JsonRpcProvider.d.ts +0 -7
- package/dist/esm/providers/JsonRpcProvider.js +0 -15
- package/dist/esm/providers/test/json-rpc-provider/get-logs/mocks.d.ts +0 -14
- package/dist/esm/providers/test/json-rpc-provider/get-logs/mocks.js +0 -142
- package/dist/esm/providers/test/mock-of.d.ts +0 -1
- package/dist/esm/providers/test/mock-of.js +0 -1
- package/dist/esm/providers/test/rpc-urls.d.ts +0 -12
- package/dist/esm/providers/test/rpc-urls.js +0 -21
- package/dist/esm/providers/utils/chains-info.d.ts +0 -24
- package/dist/esm/providers/utils/chains-info.js +0 -67
- package/dist/esm/shared/tiny-big/helpers.d.ts +0 -1
- package/dist/esm/shared/tiny-big/helpers.js +0 -58
- package/dist/esm/shared/tiny-big/tiny-big.d.ts +0 -10
- package/dist/esm/shared/tiny-big/tiny-big.js +0 -45
- package/dist/esm/shared/validate-type.d.ts +0 -3
- package/dist/esm/shared/validate-type.js +0 -5
- package/dist/esm/types/Block.types.d.ts +0 -40
- package/dist/esm/types/Block.types.js +0 -1
- package/dist/esm/types/Contract.types.d.ts +0 -24
- package/dist/esm/types/Contract.types.js +0 -1
- package/dist/esm/types/FeeData.types.d.ts +0 -7
- package/dist/esm/types/FeeData.types.js +0 -1
- package/dist/esm/types/Filter.types.d.ts +0 -12
- package/dist/esm/types/Filter.types.js +0 -1
- package/dist/esm/types/Network.types.d.ts +0 -5
- package/dist/esm/types/Network.types.js +0 -1
- package/dist/esm/types/Transaction.types.d.ts +0 -113
- package/dist/esm/types/Transaction.types.js +0 -1
- package/dist/esm/utils/bytes.d.ts +0 -40
- package/dist/esm/utils/bytes.js +0 -245
- package/dist/esm/utils/compute-address.d.ts +0 -1
- package/dist/esm/utils/compute-address.js +0 -12
- package/dist/esm/utils/compute-public-key.d.ts +0 -2
- package/dist/esm/utils/compute-public-key.js +0 -6
- package/dist/esm/utils/ether-to-gwei.d.ts +0 -3
- package/dist/esm/utils/ether-to-gwei.js +0 -7
- package/dist/esm/utils/ether-to-wei.d.ts +0 -3
- package/dist/esm/utils/ether-to-wei.js +0 -7
- package/dist/esm/utils/gwei-to-ether.d.ts +0 -3
- package/dist/esm/utils/gwei-to-ether.js +0 -7
- package/dist/esm/utils/hash-message.d.ts +0 -2
- package/dist/esm/utils/hash-message.js +0 -14
- package/dist/esm/utils/is-address.d.ts +0 -1
- package/dist/esm/utils/is-address.js +0 -12
- package/dist/esm/utils/keccak256.d.ts +0 -2
- package/dist/esm/utils/keccak256.js +0 -13
- package/dist/esm/utils/solidity-keccak256.d.ts +0 -2
- package/dist/esm/utils/solidity-keccak256.js +0 -85
- package/dist/esm/utils/split-signature.d.ts +0 -2
- package/dist/esm/utils/split-signature.js +0 -126
- package/dist/esm/utils/to-checksum-address.d.ts +0 -1
- package/dist/esm/utils/to-checksum-address.js +0 -25
- package/dist/esm/utils/to-utf8-bytes.d.ts +0 -1
- package/dist/esm/utils/to-utf8-bytes.js +0 -3
- package/dist/esm/utils/wei-to-ether.d.ts +0 -3
- package/dist/esm/utils/wei-to-ether.js +0 -16
|
@@ -1,41 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,16 +0,0 @@
|
|
|
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,123 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
export type Bytes = ArrayLike<number>;
|
|
2
|
-
/**
|
|
3
|
-
* @example
|
|
4
|
-
* [1,2,3]
|
|
5
|
-
* @example
|
|
6
|
-
* 0x123
|
|
7
|
-
* @example
|
|
8
|
-
* '0x123'
|
|
9
|
-
*/
|
|
10
|
-
export type BytesLike = Bytes | string;
|
|
11
|
-
export type BytesLikeWithNumber = BytesLike | number;
|
|
12
|
-
export interface DataOptions {
|
|
13
|
-
allowMissingPrefix?: boolean;
|
|
14
|
-
hexPad?: 'left' | 'right' | null;
|
|
15
|
-
}
|
|
16
|
-
export interface Hexable {
|
|
17
|
-
toHexString(): string;
|
|
18
|
-
}
|
|
19
|
-
export type SignatureLike = {
|
|
20
|
-
r: string;
|
|
21
|
-
s?: string;
|
|
22
|
-
_vs?: string;
|
|
23
|
-
recoveryParam?: number;
|
|
24
|
-
v?: number;
|
|
25
|
-
} | BytesLike;
|
|
26
|
-
export interface Signature {
|
|
27
|
-
r: string;
|
|
28
|
-
s: string;
|
|
29
|
-
_vs: string;
|
|
30
|
-
recoveryParam: number;
|
|
31
|
-
v: number;
|
|
32
|
-
yParityAndS: string;
|
|
33
|
-
compact: string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Returns true if and only if value is a valid [Bytes](#bytes) or DataHexString
|
|
37
|
-
* Same as [`ethers.utils.isBytesLike`](https://docs.ethers.io/v5/api/utils/bytes/#utils-isBytesLike)
|
|
38
|
-
*
|
|
39
|
-
* @param value the value to check whether or not it matches BytesLike
|
|
40
|
-
* @returns whether or not the value matches BytesLike
|
|
41
|
-
* @example
|
|
42
|
-
* ```javascript
|
|
43
|
-
* isBytesLike([1,2,3]);
|
|
44
|
-
* // true
|
|
45
|
-
* ```
|
|
46
|
-
* @example
|
|
47
|
-
* ```javascript
|
|
48
|
-
* isBytesLike(false);
|
|
49
|
-
* // false
|
|
50
|
-
* ```
|
|
51
|
-
* @example
|
|
52
|
-
* ```javascript
|
|
53
|
-
* isBytesLike(new Uint8Array(1));
|
|
54
|
-
* // true
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export declare function isBytesLike(value: any): value is BytesLike;
|
|
58
|
-
/**
|
|
59
|
-
* Returns true if and only if value is a valid [Bytes](#bytes)
|
|
60
|
-
* Same as [`ethers.utils.isBytes`](https://docs.ethers.io/v5/api/utils/bytes/#utils-isBytes)
|
|
61
|
-
*
|
|
62
|
-
* @param value the value to check whether or not it matches Bytes
|
|
63
|
-
* @returns whether or not the value matches Bytes
|
|
64
|
-
* @example
|
|
65
|
-
* ```javascript
|
|
66
|
-
* isBytes([1,2,3]);
|
|
67
|
-
* // true
|
|
68
|
-
* ```
|
|
69
|
-
* @example
|
|
70
|
-
* ```javascript
|
|
71
|
-
* isBytes(false);
|
|
72
|
-
* // false
|
|
73
|
-
* ```
|
|
74
|
-
* @example
|
|
75
|
-
* ```javascript
|
|
76
|
-
* isBytes(new Uint8Array(1));
|
|
77
|
-
* // true
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
export declare function isBytes(value: any): value is Bytes;
|
|
81
|
-
/**
|
|
82
|
-
* Converts DataHexStringOrArrayish to a Uint8Array
|
|
83
|
-
* Same as [`ethers.utils.arrayify`](https://docs.ethers.io/v5/api/utils/bytes/#utils-arrayify)
|
|
84
|
-
*
|
|
85
|
-
* @param value the value to convert to a Uint8Array
|
|
86
|
-
* @param options options to use when converting the value to a Uint8Array
|
|
87
|
-
* @returns the value represented as a Uint8Array
|
|
88
|
-
* @example
|
|
89
|
-
* ```javascript
|
|
90
|
-
* arrayify(1);
|
|
91
|
-
* // Uint8Array(1) [ 1 ]
|
|
92
|
-
* ```
|
|
93
|
-
* @example
|
|
94
|
-
* ```javascript
|
|
95
|
-
* arrayify(0x1234);
|
|
96
|
-
* // Uint8Array(2) [ 18, 52 ]
|
|
97
|
-
* ```
|
|
98
|
-
* @example
|
|
99
|
-
* ```javascript
|
|
100
|
-
* arrayify('0x1', { hexPad: 'right' });
|
|
101
|
-
* // Uint8Array(1) [ 16 ]
|
|
102
|
-
* ```
|
|
103
|
-
*/
|
|
104
|
-
export declare function arrayify(value: BytesLike | Hexable | number, options?: DataOptions): Uint8Array;
|
|
105
|
-
/**
|
|
106
|
-
* Concatenates all the BytesLike in arrayOfBytesLike into a single Uint8Array.
|
|
107
|
-
* Same as [`ethers.utils.concat`](https://docs.ethers.io/v5/api/utils/bytes/#utils-concat)
|
|
108
|
-
*
|
|
109
|
-
* @param arrayOfBytesLike the array of {@link BytesLike} to concatenate together
|
|
110
|
-
* @returns a concatenated Uint8Array
|
|
111
|
-
* @example
|
|
112
|
-
* ```javascript
|
|
113
|
-
* concat([0, 1]);
|
|
114
|
-
* // Uint8Array(2) [ 0, 1 ]
|
|
115
|
-
* ```
|
|
116
|
-
*/
|
|
117
|
-
export declare function concat(arrayOfBytesLike: ReadonlyArray<BytesLikeWithNumber>): Uint8Array;
|
|
118
|
-
/**
|
|
119
|
-
* Strips leading zeros from a BytesLike object
|
|
120
|
-
*
|
|
121
|
-
* @param value the value to strip leading zeros from
|
|
122
|
-
* @returns value without leading zeroes, expressed as a Uint8Array
|
|
123
|
-
* @example
|
|
124
|
-
* ```javascript
|
|
125
|
-
* stripZeros('0x00002834');
|
|
126
|
-
* // Uint8Array { [Iterator] 0: 40, 1: 52 }
|
|
127
|
-
* // Equivalent to '0x2834'
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
export declare function stripZeros(value: BytesLike): Uint8Array;
|
|
131
|
-
/**
|
|
132
|
-
* Pads the beginning of a {@link BytesLike} with zeros so it's the specified length as a Uint8Array
|
|
133
|
-
*
|
|
134
|
-
* @param value the value to pad
|
|
135
|
-
* @param length the desired length of the value
|
|
136
|
-
* @returns the value padded with zeros to the specified length
|
|
137
|
-
* @example
|
|
138
|
-
* ```javascript
|
|
139
|
-
* zeroPad('0x039284');
|
|
140
|
-
* // Uint8Array { [Iterator] 0: 0, 1: 0, 2: 0, 3: 3, 4: 146, 5: 132 }
|
|
141
|
-
* // Equivalent to 0x000000039284
|
|
142
|
-
* ```
|
|
143
|
-
* @example
|
|
144
|
-
* ```javascript
|
|
145
|
-
* zeroPad([39, 25, 103, 45], 5);
|
|
146
|
-
* // Uint8Array { [Iterator] 0: 0, 1: 39, 2: 25, 3: 103, 4: 45 }
|
|
147
|
-
* ```
|
|
148
|
-
*/
|
|
149
|
-
export declare function zeroPad(value: BytesLike, length: number): Uint8Array;
|
|
150
|
-
/**
|
|
151
|
-
* Returns true if and only if object is a valid hex string.
|
|
152
|
-
* If length is specified and object is not a valid DataHexString of length bytes, an InvalidArgument error is thrown.
|
|
153
|
-
* Same as [`ethers.utils.isHexString`](https://docs.ethers.io/v5/api/utils/bytes/#utils-isHexString)
|
|
154
|
-
*
|
|
155
|
-
* @param value the value to check whether or not it's a hex string
|
|
156
|
-
* @param length a length of bytes that the value should be equal to
|
|
157
|
-
* @returns whether the value is a valid hex string (and optionally, whether it matches the length specified)
|
|
158
|
-
* @example
|
|
159
|
-
* ```javascript
|
|
160
|
-
* isHexString('0x4924');
|
|
161
|
-
* // true
|
|
162
|
-
* ```
|
|
163
|
-
* @example
|
|
164
|
-
* ```javascript
|
|
165
|
-
* isHexString('0x4924', 4);
|
|
166
|
-
* // false
|
|
167
|
-
* // length of 4 in bytes would mean a hex string with 8 characters
|
|
168
|
-
* ```
|
|
169
|
-
*/
|
|
170
|
-
export declare function isHexString(value: any, length?: number): boolean;
|
|
171
|
-
/**
|
|
172
|
-
* Converts a value into a hex string
|
|
173
|
-
*
|
|
174
|
-
* @param value the value to convert
|
|
175
|
-
* @param options options to use when converting the value to a hex string
|
|
176
|
-
* @returns the value represented as a hex string
|
|
177
|
-
* @example
|
|
178
|
-
* ```javascript
|
|
179
|
-
* hexlify(4);
|
|
180
|
-
* // '0x04'
|
|
181
|
-
* ```
|
|
182
|
-
* @example
|
|
183
|
-
* ```javascript
|
|
184
|
-
* hexlify(14);
|
|
185
|
-
* // '0x0e'
|
|
186
|
-
* ```
|
|
187
|
-
*/
|
|
188
|
-
export declare function hexlify(value: BytesLike | Hexable | number | bigint, options?: DataOptions): string;
|
|
189
|
-
/**
|
|
190
|
-
* Gets the length of data represented as a hex string
|
|
191
|
-
*
|
|
192
|
-
* @param data the data to check the length of
|
|
193
|
-
* @returns the length of the data
|
|
194
|
-
* @example
|
|
195
|
-
* ```javascript
|
|
196
|
-
* hexDataLength([2, 4, 0, 1]);
|
|
197
|
-
* // 4
|
|
198
|
-
* ```
|
|
199
|
-
* @example
|
|
200
|
-
* ```javascript
|
|
201
|
-
* hexDataLength('0x3925');
|
|
202
|
-
* // 2
|
|
203
|
-
* ```
|
|
204
|
-
*/
|
|
205
|
-
export declare function hexDataLength(data: BytesLike): number | null;
|
|
206
|
-
/**
|
|
207
|
-
* Slices a {@link BytesLike} to extract a certain part of the input
|
|
208
|
-
*
|
|
209
|
-
* @param data the data to slice from
|
|
210
|
-
* @param offset the index to start extraction at
|
|
211
|
-
* @param endOffset the index to end extraction at
|
|
212
|
-
* @returns the extracted data as a hex string
|
|
213
|
-
* @example
|
|
214
|
-
* ```javascript
|
|
215
|
-
* hexDataSlice([20, 6, 48], 0, 2);
|
|
216
|
-
* // '0x1406'
|
|
217
|
-
* ```
|
|
218
|
-
*/
|
|
219
|
-
export declare function hexDataSlice(data: BytesLikeWithNumber, offset: number, endOffset?: number): string;
|
|
220
|
-
/**
|
|
221
|
-
* Concatenates values together into one hex string
|
|
222
|
-
*
|
|
223
|
-
* @param items the items to concatenate together
|
|
224
|
-
* @returns a single hex string including all of the items to be concatenated
|
|
225
|
-
* @example
|
|
226
|
-
* ```javascript
|
|
227
|
-
* hexConcat([[2, 4, 0, 1], 9, '0x2934', '0x3947']);
|
|
228
|
-
* // '0x020400010929343947'
|
|
229
|
-
* ```
|
|
230
|
-
*/
|
|
231
|
-
export declare function hexConcat(items: ReadonlyArray<BytesLike>): string;
|
|
232
|
-
/**
|
|
233
|
-
* Converts a number of different types into a hex string
|
|
234
|
-
*
|
|
235
|
-
* @param value the value to convert into a hex string
|
|
236
|
-
* @returns the value represented as a hex string
|
|
237
|
-
* @example
|
|
238
|
-
* ```javascript
|
|
239
|
-
* hexValue(39);
|
|
240
|
-
* // '0x27'
|
|
241
|
-
* ```
|
|
242
|
-
* @example
|
|
243
|
-
* ```javascript
|
|
244
|
-
* hexValue([9, 4, 19, 4]);
|
|
245
|
-
* // '0x9041304'
|
|
246
|
-
* ```
|
|
247
|
-
*/
|
|
248
|
-
export declare function hexValue(value: BytesLike | Hexable | number | bigint): string;
|
|
249
|
-
/**
|
|
250
|
-
* Strips the leading zeros from a value and returns it as a hex string
|
|
251
|
-
*
|
|
252
|
-
* @param value the value to strip zeros from
|
|
253
|
-
* @returns a hex string representation of the value, without leading zeros
|
|
254
|
-
* @example
|
|
255
|
-
* ```javascript
|
|
256
|
-
* hexStripZeros([0,0,0,48]);
|
|
257
|
-
* // '0x30'
|
|
258
|
-
* ```
|
|
259
|
-
*/
|
|
260
|
-
export declare function hexStripZeros(value: BytesLike): string;
|
|
261
|
-
/**
|
|
262
|
-
* Returns a hex string padded to a specified length of bytes.
|
|
263
|
-
*
|
|
264
|
-
* Similar to ["hexZeroPad" in ethers.js](https://docs.ethers.io/v5/api/utils/bytes/#utils-hexZeroPad)
|
|
265
|
-
*
|
|
266
|
-
* Differs from ["padLeft" in web3.js](https://web3js.readthedocs.io/en/v1.7.1/web3-utils.html#padleft) because web3 counts by characters, not bytes.
|
|
267
|
-
*
|
|
268
|
-
* @param value A hex-string, hex-number, or decimal number (auto-converts to base-16) to be padded
|
|
269
|
-
* @param length The final length in bytes
|
|
270
|
-
* @returns A hex string padded to the specified length
|
|
271
|
-
* @throws If the value is not a hex string or number
|
|
272
|
-
* @throws If the value is longer than the length
|
|
273
|
-
* @example
|
|
274
|
-
* ```javascript
|
|
275
|
-
* hexZeroPad('0x60', 2);
|
|
276
|
-
* // '0x0060'
|
|
277
|
-
* ```
|
|
278
|
-
* @example
|
|
279
|
-
* ```javascript
|
|
280
|
-
* hexZeroPad(0x60, 3);
|
|
281
|
-
* // '0x000060'
|
|
282
|
-
* ```
|
|
283
|
-
* @example
|
|
284
|
-
* ```javascript
|
|
285
|
-
* hexZeroPad('12345', 1);
|
|
286
|
-
* // Throws
|
|
287
|
-
* ```
|
|
288
|
-
*/
|
|
289
|
-
export declare function hexZeroPad(value: BytesLikeWithNumber, length: number): string;
|