forked from ethers-io/ethers.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed commonjs imports missing types (ethers-io#3703).
- Loading branch information
1 parent
d5c210d
commit c3a4468
Showing
169 changed files
with
7,721 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
export type TestBlockchainNetwork = "mainnet" | "goerli"; | ||
export interface TestBlockchainAddress { | ||
test: string; | ||
address: string; | ||
code?: string; | ||
nonce?: number; | ||
name?: string; | ||
balance?: bigint; | ||
storage?: Record<string, string>; | ||
} | ||
export interface TestBlockchainBlock { | ||
test: string; | ||
hash: string; | ||
parentHash: string; | ||
number: number; | ||
timestamp: number; | ||
nonce: string; | ||
difficulty: bigint; | ||
gasLimit: bigint; | ||
gasUsed: bigint; | ||
miner: string; | ||
extraData: string; | ||
transactions: Array<string>; | ||
baseFeePerGas?: bigint; | ||
} | ||
export interface TestBlockchainTransaction { | ||
test: string; | ||
hash: string; | ||
blockHash: string; | ||
blockNumber: number; | ||
type: number; | ||
from: string; | ||
gasPrice: bigint; | ||
gasLimit: bigint; | ||
to: string; | ||
value: bigint; | ||
nonce: number; | ||
data: string; | ||
signature: { | ||
r: string; | ||
s: string; | ||
yParity: 0 | 1; | ||
v: number; | ||
networkV: null | bigint; | ||
}; | ||
creates: null | string; | ||
chainId: bigint; | ||
accessList?: Array<Record<string, Array<string>>>; | ||
maxPriorityFeePerGas?: bigint; | ||
maxFeePerGas?: bigint; | ||
} | ||
export interface TestBlockchainReceipt { | ||
test: string; | ||
blockHash: string; | ||
blockNumber: number; | ||
type: number; | ||
contractAddress: null | string; | ||
cumulativeGasUsed: bigint; | ||
from: string; | ||
gasUsed: bigint; | ||
gasPrice: bigint; | ||
logs: Array<{ | ||
address: string; | ||
blockHash: string; | ||
blockNumber: number; | ||
data: string; | ||
index: number; | ||
topics: Array<string>; | ||
transactionHash: string; | ||
transactionIndex: number; | ||
}>; | ||
logsBloom: string; | ||
root: null | string; | ||
status: null | number; | ||
to: string; | ||
hash: string; | ||
index: number; | ||
} | ||
export declare const testAddress: Record<TestBlockchainNetwork, Array<TestBlockchainAddress>>; | ||
export declare const testBlock: Record<TestBlockchainNetwork, Array<TestBlockchainBlock>>; | ||
export declare const testTransaction: Record<TestBlockchainNetwork, Array<TestBlockchainTransaction>>; | ||
export declare const testReceipt: Record<TestBlockchainNetwork, Array<TestBlockchainReceipt>>; | ||
export declare const networkNames: Array<TestBlockchainNetwork>; | ||
export declare function networkFeatureAtBlock(feature: string, block: number): boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { AbstractProvider } from "../index.js"; | ||
export declare function setupProviders(): void; | ||
export declare const providerNames: readonly string[]; | ||
export declare function getProviderNetworks(provider: string): Array<string>; | ||
export declare function getProvider(provider: string, network: string): null | AbstractProvider; | ||
export declare function checkProvider(provider: string, network: string): boolean; | ||
export declare function connect(network: string): AbstractProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export type TestCaseBadString = { | ||
name: string; | ||
bytes: Uint8Array; | ||
ignore: string; | ||
replace: string; | ||
error: string; | ||
}; | ||
export type TestCaseCodePoints = { | ||
name: string; | ||
text: string; | ||
codepoints: Array<number>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
declare global { | ||
class TextDecoder { | ||
decode(data: Uint8Array): string; | ||
} | ||
} | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
export type TestCaseAbiVerbose = { | ||
type: "address" | "hexstring" | "number" | "string"; | ||
value: string; | ||
} | { | ||
type: "boolean"; | ||
value: boolean; | ||
} | { | ||
type: "array"; | ||
value: Array<TestCaseAbiVerbose>; | ||
} | { | ||
type: "object"; | ||
value: Array<TestCaseAbiVerbose>; | ||
}; | ||
export interface TestCaseAbi { | ||
name: string; | ||
type: string; | ||
value: any; | ||
verbose: TestCaseAbiVerbose; | ||
bytecode: string; | ||
encoded: string; | ||
} | ||
export interface TestCaseAccount { | ||
name: string; | ||
privateKey: string; | ||
address: string; | ||
icap: string; | ||
} | ||
export type TestCaseCreate = { | ||
sender: string; | ||
creates: Array<{ | ||
name: string; | ||
nonce: number; | ||
address: string; | ||
}>; | ||
}; | ||
export type TestCaseCreate2 = { | ||
sender: string; | ||
creates: Array<{ | ||
name: string; | ||
salt: string; | ||
initCode: string; | ||
initCodeHash: string; | ||
address: string; | ||
}>; | ||
}; | ||
export interface TestCaseHash { | ||
name: string; | ||
data: string; | ||
sha256: string; | ||
sha512: string; | ||
ripemd160: string; | ||
keccak256: string; | ||
} | ||
export interface TestCasePbkdf { | ||
name: string; | ||
password: string; | ||
salt: string; | ||
dkLen: number; | ||
pbkdf2: { | ||
iterations: number; | ||
algorithm: "sha256" | "sha512"; | ||
key: string; | ||
}; | ||
scrypt: { | ||
N: number; | ||
r: number; | ||
p: number; | ||
key: string; | ||
}; | ||
} | ||
export interface TestCaseHmac { | ||
name: string; | ||
data: string; | ||
key: string; | ||
algorithm: "sha256" | "sha512"; | ||
hmac: string; | ||
} | ||
export interface TestCaseHash { | ||
name: string; | ||
data: string; | ||
sha256: string; | ||
sha512: string; | ||
ripemd160: string; | ||
keccak256: string; | ||
} | ||
export interface TestCaseNamehash { | ||
name: string; | ||
ensName: string; | ||
error?: string; | ||
namehash?: string; | ||
} | ||
export interface TestCaseTypedDataDomain { | ||
name?: string; | ||
version?: string; | ||
chainId?: number; | ||
verifyingContract?: string; | ||
salt?: string; | ||
} | ||
export interface TestCaseTypedDataType { | ||
name: string; | ||
type: string; | ||
} | ||
export interface TestCaseTypedData { | ||
name: string; | ||
domain: TestCaseTypedDataDomain; | ||
primaryType: string; | ||
types: Record<string, Array<TestCaseTypedDataType>>; | ||
data: any; | ||
encoded: string; | ||
digest: string; | ||
privateKey?: string; | ||
signature?: string; | ||
} | ||
export interface TestCaseSolidityHash { | ||
name: string; | ||
types: Array<string>; | ||
keccak256: string; | ||
ripemd160: string; | ||
sha256: string; | ||
values: Array<any>; | ||
} | ||
export interface TestCaseUnit { | ||
name: string; | ||
wei: string; | ||
ethers: string; | ||
ether_format: string; | ||
kwei?: string; | ||
mwei?: string; | ||
gwei?: string; | ||
szabo?: string; | ||
finney?: string; | ||
finney_format?: string; | ||
szabo_format?: string; | ||
gwei_format?: string; | ||
mwei_format?: string; | ||
kwei_format?: string; | ||
} | ||
export type NestedHexString = string | Array<string | NestedHexString>; | ||
export interface TestCaseRlp { | ||
name: string; | ||
encoded: string; | ||
decoded: NestedHexString; | ||
} | ||
export interface TestCaseTransactionTx { | ||
to?: string; | ||
nonce?: number; | ||
gasLimit?: string; | ||
gasPrice?: string; | ||
maxFeePerGas?: string; | ||
maxPriorityFeePerGas?: string; | ||
data?: string; | ||
value?: string; | ||
accessList?: Array<{ | ||
address: string; | ||
storageKeys: Array<string>; | ||
}>; | ||
chainId?: string; | ||
} | ||
export interface TestCaseTransactionSig { | ||
r: string; | ||
s: string; | ||
v: string; | ||
} | ||
export interface TestCaseTransaction { | ||
name: string; | ||
transaction: TestCaseTransactionTx; | ||
privateKey: string; | ||
unsignedLegacy: string; | ||
signedLegacy: string; | ||
unsignedEip155: string; | ||
signedEip155: string; | ||
unsignedBerlin: string; | ||
signedBerlin: string; | ||
unsignedLondon: string; | ||
signedLondon: string; | ||
signatureLegacy: TestCaseTransactionSig; | ||
signatureEip155: TestCaseTransactionSig; | ||
signatureBerlin: TestCaseTransactionSig; | ||
signatureLondon: TestCaseTransactionSig; | ||
} | ||
export interface TestCaseMnemonicNode { | ||
path: string; | ||
chainCode: string; | ||
depth: number; | ||
index: number; | ||
parentFingerprint: string; | ||
fingerprint: string; | ||
publicKey: string; | ||
privateKey: string; | ||
xpriv: string; | ||
xpub: string; | ||
} | ||
export interface TestCaseMnemonic { | ||
name: string; | ||
phrase: string; | ||
phraseHash: string; | ||
password: string; | ||
locale: string; | ||
entropy: string; | ||
seed: string; | ||
nodes: Array<TestCaseMnemonicNode>; | ||
} | ||
export interface TestCaseWallet { | ||
name: string; | ||
filename: string; | ||
type: string; | ||
address: string; | ||
password: string; | ||
content: string; | ||
} | ||
export interface TestCaseWordlist { | ||
name: string; | ||
filename: string; | ||
locale: string; | ||
content: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export declare function loadTests<T>(tag: string): Array<T>; | ||
export declare function log(context: any, text: string): void; | ||
export declare function stall(duration: number): Promise<void>; | ||
export interface MochaRunnable { | ||
timeout: (value: number) => void; | ||
skip: () => void; | ||
} | ||
export declare function retryIt(name: string, func: (this: MochaRunnable) => Promise<void>): Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const version: string; |
Oops, something went wrong.