admin: updated dist files
This commit is contained in:
parent
06aa30363f
commit
dced2b7dac
10
CHANGELOG.md
10
CHANGELOG.md
@ -3,6 +3,16 @@ Change Log
|
||||
|
||||
This change log is maintained by `src.ts/_admin/update-changelog.ts` but may also be manually updated.
|
||||
|
||||
ethers/v6.1.0 (2023-03-03 18:23)
|
||||
--------------------------------
|
||||
|
||||
- Added missing exports ([#3734](https://github.com/ethers-io/ethers.js/issues/3734); [06aa303](https://github.com/ethers-io/ethers.js/commit/06aa30363f88144db672376d39012d7fe3f86c33)).
|
||||
- Allow null values for TypedData domain ([#3623](https://github.com/ethers-io/ethers.js/issues/3623); [a32af3a](https://github.com/ethers-io/ethers.js/commit/a32af3adc104c4b07a45097a4a3725a4ce9e0be6)).
|
||||
- Added listAccounts to JsonRpcProvider ([#3778](https://github.com/ethers-io/ethers.js/issues/3778); [287d94f](https://github.com/ethers-io/ethers.js/commit/287d94fc454d03f1b3086ea98745131cdf40129a)).
|
||||
- Allow BigInt for blockTag ([#3780](https://github.com/ethers-io/ethers.js/issues/3780); [fe1f04c](https://github.com/ethers-io/ethers.js/commit/fe1f04c6e5fb4254a100f492d7dcbdc3cf19a446)).
|
||||
- Fixed typo in error messages ([#3822](https://github.com/ethers-io/ethers.js/issues/3822), [#3824](https://github.com/ethers-io/ethers.js/issues/3824); [f1a810d](https://github.com/ethers-io/ethers.js/commit/f1a810dcb56df54b1e1567f2a59c73500619472f)).
|
||||
- Re-adding definition files to require exports ([#3703](https://github.com/ethers-io/ethers.js/issues/3703); [76fab92](https://github.com/ethers-io/ethers.js/commit/76fab923da33e71e6bb751bb0b5e3ba3faa27ab2)).
|
||||
|
||||
ethers/v6.0.8 (2023-02-23 06:30)
|
||||
--------------------------------
|
||||
|
||||
|
58
dist/ethers.js
vendored
58
dist/ethers.js
vendored
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
const version = "6.0.8";
|
||||
const version = "6.1.0";
|
||||
|
||||
/**
|
||||
* Property helper functions.
|
||||
@ -6213,7 +6213,7 @@ class Signature {
|
||||
const v = Signature.getNormalizedV(bytes[64]);
|
||||
return new Signature(_guard$3, r, hexlify(s), v);
|
||||
}
|
||||
assertError(false, "invlaid raw signature length");
|
||||
assertError(false, "invalid raw signature length");
|
||||
}
|
||||
if (sig instanceof Signature) {
|
||||
return sig.clone();
|
||||
@ -6591,7 +6591,7 @@ function getAddress(address) {
|
||||
/**
|
||||
* The [ICAP Address format](link-icap) format is an early checksum
|
||||
* format which attempts to be compatible with the banking
|
||||
* industry [IBAN format](link-wiki-iban] for bank accounts.
|
||||
* industry [IBAN format](link-wiki-iban) for bank accounts.
|
||||
*
|
||||
* It is no longer common or a recommended format.
|
||||
*
|
||||
@ -9688,6 +9688,9 @@ class TypedDataEncoder {
|
||||
static hashDomain(domain) {
|
||||
const domainFields = [];
|
||||
for (const name in domain) {
|
||||
if (domain[name] == null) {
|
||||
continue;
|
||||
}
|
||||
const type = domainFieldTypes[name];
|
||||
assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain);
|
||||
domainFields.push({ name, type });
|
||||
@ -9711,6 +9714,12 @@ class TypedDataEncoder {
|
||||
static async resolveNames(domain, types, value, resolveName) {
|
||||
// Make a copy to isolate it from the object passed in
|
||||
domain = Object.assign({}, domain);
|
||||
// Allow passing null to ignore value
|
||||
for (const key in domain) {
|
||||
if (domain[key] == null) {
|
||||
delete domain[key];
|
||||
}
|
||||
}
|
||||
// Look up all ENS names
|
||||
const ensCache = {};
|
||||
// Do we need to look up the domain's verifyingContract?
|
||||
@ -10300,7 +10309,7 @@ class ParamType {
|
||||
walk(value, process) {
|
||||
if (this.isArray()) {
|
||||
if (!Array.isArray(value)) {
|
||||
throw new Error("invlaid array value");
|
||||
throw new Error("invalid array value");
|
||||
}
|
||||
if (this.arrayLength !== -1 && value.length !== this.arrayLength) {
|
||||
throw new Error("array is wrong length");
|
||||
@ -10310,7 +10319,7 @@ class ParamType {
|
||||
}
|
||||
if (this.isTuple()) {
|
||||
if (!Array.isArray(value)) {
|
||||
throw new Error("invlaid tuple value");
|
||||
throw new Error("invalid tuple value");
|
||||
}
|
||||
if (value.length !== this.components.length) {
|
||||
throw new Error("array is wrong length");
|
||||
@ -10323,7 +10332,7 @@ class ParamType {
|
||||
#walkAsync(promises, value, process, setValue) {
|
||||
if (this.isArray()) {
|
||||
if (!Array.isArray(value)) {
|
||||
throw new Error("invlaid array value");
|
||||
throw new Error("invalid array value");
|
||||
}
|
||||
if (this.arrayLength !== -1 && value.length !== this.arrayLength) {
|
||||
throw new Error("array is wrong length");
|
||||
@ -10347,7 +10356,7 @@ class ParamType {
|
||||
}
|
||||
else {
|
||||
if (value == null || typeof (value) !== "object") {
|
||||
throw new Error("invlaid tuple value");
|
||||
throw new Error("invalid tuple value");
|
||||
}
|
||||
result = components.map((param) => {
|
||||
if (!param.name) {
|
||||
@ -10987,7 +10996,7 @@ class StructFragment extends NamedFragment {
|
||||
|
||||
/**
|
||||
* When sending values to or receiving values from a [[Contract]], the
|
||||
* data is generally encoded using the [ABI standard](solc-abi-standard).
|
||||
* data is generally encoded using the [ABI standard](link-solc-abi).
|
||||
*
|
||||
* The AbiCoder provides a utility to encode values to ABI data and
|
||||
* decode values from ABI data.
|
||||
@ -15531,6 +15540,9 @@ class AbstractProvider {
|
||||
}
|
||||
return toQuantity(blockTag);
|
||||
}
|
||||
if (typeof (blockTag) === "bigint") {
|
||||
blockTag = getNumber(blockTag, "blockTag");
|
||||
}
|
||||
if (typeof (blockTag) === "number") {
|
||||
if (blockTag >= 0) {
|
||||
return toQuantity(blockTag);
|
||||
@ -17477,6 +17489,10 @@ class JsonRpcApiProvider extends AbstractProvider {
|
||||
}
|
||||
throw new Error("invalid account");
|
||||
}
|
||||
async listAccounts() {
|
||||
const accounts = await this.send("eth_accounts", []);
|
||||
return accounts.map((a) => new JsonRpcSigner(this, a));
|
||||
}
|
||||
}
|
||||
class JsonRpcApiPollingProvider extends JsonRpcApiProvider {
|
||||
#pollingInterval;
|
||||
@ -21968,9 +21984,13 @@ var ethers = /*#__PURE__*/Object.freeze({
|
||||
ErrorFragment: ErrorFragment,
|
||||
EventFragment: EventFragment,
|
||||
Fragment: Fragment,
|
||||
FallbackFragment: FallbackFragment,
|
||||
FunctionFragment: FunctionFragment,
|
||||
NamedFragment: NamedFragment,
|
||||
ParamType: ParamType,
|
||||
StructFragment: StructFragment,
|
||||
checkResultErrors: checkResultErrors,
|
||||
ErrorDescription: ErrorDescription,
|
||||
Indexed: Indexed,
|
||||
Interface: Interface,
|
||||
LogDescription: LogDescription,
|
||||
@ -21999,6 +22019,7 @@ var ethers = /*#__PURE__*/Object.freeze({
|
||||
ContractEventPayload: ContractEventPayload,
|
||||
ContractTransactionReceipt: ContractTransactionReceipt,
|
||||
ContractTransactionResponse: ContractTransactionResponse,
|
||||
ContractUnknownEventPayload: ContractUnknownEventPayload,
|
||||
EventLog: EventLog,
|
||||
computeHmac: computeHmac,
|
||||
randomBytes: randomBytes,
|
||||
@ -22043,6 +22064,7 @@ var ethers = /*#__PURE__*/Object.freeze({
|
||||
CloudflareProvider: CloudflareProvider,
|
||||
EtherscanProvider: EtherscanProvider,
|
||||
InfuraProvider: InfuraProvider,
|
||||
InfuraWebSocketProvider: InfuraWebSocketProvider,
|
||||
PocketProvider: PocketProvider,
|
||||
QuickNodeProvider: QuickNodeProvider,
|
||||
IpcSocketProvider: IpcSocketProvider,
|
||||
@ -22050,6 +22072,18 @@ var ethers = /*#__PURE__*/Object.freeze({
|
||||
WebSocketProvider: WebSocketProvider,
|
||||
EnsResolver: EnsResolver,
|
||||
Network: Network,
|
||||
EnsPlugin: EnsPlugin,
|
||||
EtherscanPlugin: EtherscanPlugin,
|
||||
FeeDataNetworkPlugin: FeeDataNetworkPlugin,
|
||||
GasCostPlugin: GasCostPlugin,
|
||||
NetworkPlugin: NetworkPlugin,
|
||||
SocketBlockSubscriber: SocketBlockSubscriber,
|
||||
SocketEventSubscriber: SocketEventSubscriber,
|
||||
SocketPendingSubscriber: SocketPendingSubscriber,
|
||||
SocketSubscriber: SocketSubscriber,
|
||||
UnmanagedSubscriber: UnmanagedSubscriber,
|
||||
copyRequest: copyRequest,
|
||||
showThrottleMessage: showThrottleMessage,
|
||||
accessListify: accessListify,
|
||||
computeAddress: computeAddress,
|
||||
recoverAddress: recoverAddress,
|
||||
@ -22070,6 +22104,7 @@ var ethers = /*#__PURE__*/Object.freeze({
|
||||
zeroPadBytes: zeroPadBytes,
|
||||
zeroPadValue: zeroPadValue,
|
||||
defineProperties: defineProperties,
|
||||
resolveProperties: resolveProperties,
|
||||
assert: assert$1,
|
||||
assertArgument: assertArgument,
|
||||
assertArgumentCount: assertArgumentCount,
|
||||
@ -22078,6 +22113,7 @@ var ethers = /*#__PURE__*/Object.freeze({
|
||||
makeError: makeError,
|
||||
isCallException: isCallException,
|
||||
isError: isError,
|
||||
EventPayload: EventPayload,
|
||||
FetchRequest: FetchRequest,
|
||||
FetchResponse: FetchResponse,
|
||||
FetchCancelSignal: FetchCancelSignal,
|
||||
@ -22103,6 +22139,7 @@ var ethers = /*#__PURE__*/Object.freeze({
|
||||
Utf8ErrorFuncs: Utf8ErrorFuncs,
|
||||
decodeRlp: decodeRlp,
|
||||
encodeRlp: encodeRlp,
|
||||
uuidV4: uuidV4,
|
||||
Mnemonic: Mnemonic,
|
||||
BaseWallet: BaseWallet,
|
||||
HDNodeWallet: HDNodeWallet,
|
||||
@ -22120,7 +22157,8 @@ var ethers = /*#__PURE__*/Object.freeze({
|
||||
Wordlist: Wordlist,
|
||||
LangEn: LangEn,
|
||||
WordlistOwl: WordlistOwl,
|
||||
WordlistOwlA: WordlistOwlA
|
||||
WordlistOwlA: WordlistOwlA,
|
||||
wordlists: wordlists
|
||||
});
|
||||
|
||||
/**
|
||||
@ -22131,5 +22169,5 @@ var ethers = /*#__PURE__*/Object.freeze({
|
||||
* @_navTitle: API
|
||||
*/
|
||||
|
||||
export { AbiCoder, AbstractProvider, AbstractSigner, AlchemyProvider, AnkrProvider, BaseContract, BaseWallet, Block, BrowserProvider, CloudflareProvider, ConstructorFragment, Contract, ContractEventPayload, ContractFactory, ContractTransactionReceipt, ContractTransactionResponse, EnsResolver, ErrorFragment, EtherSymbol, EtherscanProvider, EventFragment, EventLog, FallbackProvider, FeeData, FetchCancelSignal, FetchRequest, FetchResponse, FixedNumber, Fragment, FunctionFragment, HDNodeVoidWallet, HDNodeWallet, Indexed, InfuraProvider, Interface, IpcSocketProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, LangEn, Log, LogDescription, MaxInt256, MaxUint256, MessagePrefix, MinInt256, Mnemonic, N$1 as N, Network, NonceManager, ParamType, PocketProvider, QuickNodeProvider, Result, Signature, SigningKey, SocketProvider, Transaction, TransactionDescription, TransactionReceipt, TransactionResponse, Typed, TypedDataEncoder, Utf8ErrorFuncs, VoidSigner, Wallet, WebSocketProvider, WeiPerEther, Wordlist, WordlistOwl, WordlistOwlA, ZeroAddress, ZeroHash, accessListify, assert$1 as assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, checkResultErrors, computeAddress, computeHmac, concat, dataLength, dataSlice, decodeBase58, decodeBase64, decodeBytes32String, decodeRlp, decryptCrowdsaleJson, decryptKeystoreJson, decryptKeystoreJsonSync, defaultPath, defineProperties, dnsEncode, encodeBase58, encodeBase64, encodeBytes32String, encodeRlp, encryptKeystoreJson, encryptKeystoreJsonSync, ensNormalize, ethers, formatEther, formatUnits, fromTwos, getAccountPath, getAddress, getBigInt, getBytes, getBytesCopy, getCreate2Address, getCreateAddress, getDefaultProvider, getIcapAddress, getNumber, getUint, hashMessage, hexlify, id, isAddress, isAddressable, isBytesLike, isCallException, isCrowdsaleJson, isError, isHexString, isKeystoreJson, isValidName, keccak256, lock, makeError, mask, namehash, parseEther, parseUnits, pbkdf2, randomBytes, recoverAddress, resolveAddress, ripemd160, scrypt, scryptSync, sha256, sha512, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, stripZerosLeft, toBeArray, toBeHex, toBigInt, toNumber, toQuantity, toTwos, toUtf8Bytes, toUtf8CodePoints, toUtf8String, verifyMessage, version, zeroPadBytes, zeroPadValue };
|
||||
export { AbiCoder, AbstractProvider, AbstractSigner, AlchemyProvider, AnkrProvider, BaseContract, BaseWallet, Block, BrowserProvider, CloudflareProvider, ConstructorFragment, Contract, ContractEventPayload, ContractFactory, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EnsPlugin, EnsResolver, ErrorDescription, ErrorFragment, EtherSymbol, EtherscanPlugin, EtherscanProvider, EventFragment, EventLog, EventPayload, FallbackFragment, FallbackProvider, FeeData, FeeDataNetworkPlugin, FetchCancelSignal, FetchRequest, FetchResponse, FixedNumber, Fragment, FunctionFragment, GasCostPlugin, HDNodeVoidWallet, HDNodeWallet, Indexed, InfuraProvider, InfuraWebSocketProvider, Interface, IpcSocketProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, LangEn, Log, LogDescription, MaxInt256, MaxUint256, MessagePrefix, MinInt256, Mnemonic, N$1 as N, NamedFragment, Network, NetworkPlugin, NonceManager, ParamType, PocketProvider, QuickNodeProvider, Result, Signature, SigningKey, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketProvider, SocketSubscriber, StructFragment, Transaction, TransactionDescription, TransactionReceipt, TransactionResponse, Typed, TypedDataEncoder, UnmanagedSubscriber, Utf8ErrorFuncs, VoidSigner, Wallet, WebSocketProvider, WeiPerEther, Wordlist, WordlistOwl, WordlistOwlA, ZeroAddress, ZeroHash, accessListify, assert$1 as assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, checkResultErrors, computeAddress, computeHmac, concat, copyRequest, dataLength, dataSlice, decodeBase58, decodeBase64, decodeBytes32String, decodeRlp, decryptCrowdsaleJson, decryptKeystoreJson, decryptKeystoreJsonSync, defaultPath, defineProperties, dnsEncode, encodeBase58, encodeBase64, encodeBytes32String, encodeRlp, encryptKeystoreJson, encryptKeystoreJsonSync, ensNormalize, ethers, formatEther, formatUnits, fromTwos, getAccountPath, getAddress, getBigInt, getBytes, getBytesCopy, getCreate2Address, getCreateAddress, getDefaultProvider, getIcapAddress, getNumber, getUint, hashMessage, hexlify, id, isAddress, isAddressable, isBytesLike, isCallException, isCrowdsaleJson, isError, isHexString, isKeystoreJson, isValidName, keccak256, lock, makeError, mask, namehash, parseEther, parseUnits, pbkdf2, randomBytes, recoverAddress, resolveAddress, resolveProperties, ripemd160, scrypt, scryptSync, sha256, sha512, showThrottleMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, stripZerosLeft, toBeArray, toBeHex, toBigInt, toNumber, toQuantity, toTwos, toUtf8Bytes, toUtf8CodePoints, toUtf8String, uuidV4, verifyMessage, version, wordlists, zeroPadBytes, zeroPadValue };
|
||||
//# sourceMappingURL=ethers.js.map
|
||||
|
2
dist/ethers.js.map
vendored
2
dist/ethers.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.min.js
vendored
2
dist/ethers.min.js
vendored
File diff suppressed because one or more lines are too long
78
dist/ethers.umd.js
vendored
78
dist/ethers.umd.js
vendored
@ -8,7 +8,7 @@
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
const version = "6.0.8";
|
||||
const version = "6.1.0";
|
||||
|
||||
/**
|
||||
* Property helper functions.
|
||||
@ -6219,7 +6219,7 @@
|
||||
const v = Signature.getNormalizedV(bytes[64]);
|
||||
return new Signature(_guard$3, r, hexlify(s), v);
|
||||
}
|
||||
assertError(false, "invlaid raw signature length");
|
||||
assertError(false, "invalid raw signature length");
|
||||
}
|
||||
if (sig instanceof Signature) {
|
||||
return sig.clone();
|
||||
@ -6597,7 +6597,7 @@
|
||||
/**
|
||||
* The [ICAP Address format](link-icap) format is an early checksum
|
||||
* format which attempts to be compatible with the banking
|
||||
* industry [IBAN format](link-wiki-iban] for bank accounts.
|
||||
* industry [IBAN format](link-wiki-iban) for bank accounts.
|
||||
*
|
||||
* It is no longer common or a recommended format.
|
||||
*
|
||||
@ -9694,6 +9694,9 @@
|
||||
static hashDomain(domain) {
|
||||
const domainFields = [];
|
||||
for (const name in domain) {
|
||||
if (domain[name] == null) {
|
||||
continue;
|
||||
}
|
||||
const type = domainFieldTypes[name];
|
||||
assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain);
|
||||
domainFields.push({ name, type });
|
||||
@ -9717,6 +9720,12 @@
|
||||
static async resolveNames(domain, types, value, resolveName) {
|
||||
// Make a copy to isolate it from the object passed in
|
||||
domain = Object.assign({}, domain);
|
||||
// Allow passing null to ignore value
|
||||
for (const key in domain) {
|
||||
if (domain[key] == null) {
|
||||
delete domain[key];
|
||||
}
|
||||
}
|
||||
// Look up all ENS names
|
||||
const ensCache = {};
|
||||
// Do we need to look up the domain's verifyingContract?
|
||||
@ -10306,7 +10315,7 @@
|
||||
walk(value, process) {
|
||||
if (this.isArray()) {
|
||||
if (!Array.isArray(value)) {
|
||||
throw new Error("invlaid array value");
|
||||
throw new Error("invalid array value");
|
||||
}
|
||||
if (this.arrayLength !== -1 && value.length !== this.arrayLength) {
|
||||
throw new Error("array is wrong length");
|
||||
@ -10316,7 +10325,7 @@
|
||||
}
|
||||
if (this.isTuple()) {
|
||||
if (!Array.isArray(value)) {
|
||||
throw new Error("invlaid tuple value");
|
||||
throw new Error("invalid tuple value");
|
||||
}
|
||||
if (value.length !== this.components.length) {
|
||||
throw new Error("array is wrong length");
|
||||
@ -10329,7 +10338,7 @@
|
||||
#walkAsync(promises, value, process, setValue) {
|
||||
if (this.isArray()) {
|
||||
if (!Array.isArray(value)) {
|
||||
throw new Error("invlaid array value");
|
||||
throw new Error("invalid array value");
|
||||
}
|
||||
if (this.arrayLength !== -1 && value.length !== this.arrayLength) {
|
||||
throw new Error("array is wrong length");
|
||||
@ -10353,7 +10362,7 @@
|
||||
}
|
||||
else {
|
||||
if (value == null || typeof (value) !== "object") {
|
||||
throw new Error("invlaid tuple value");
|
||||
throw new Error("invalid tuple value");
|
||||
}
|
||||
result = components.map((param) => {
|
||||
if (!param.name) {
|
||||
@ -10993,7 +11002,7 @@
|
||||
|
||||
/**
|
||||
* When sending values to or receiving values from a [[Contract]], the
|
||||
* data is generally encoded using the [ABI standard](solc-abi-standard).
|
||||
* data is generally encoded using the [ABI standard](link-solc-abi).
|
||||
*
|
||||
* The AbiCoder provides a utility to encode values to ABI data and
|
||||
* decode values from ABI data.
|
||||
@ -15537,6 +15546,9 @@
|
||||
}
|
||||
return toQuantity(blockTag);
|
||||
}
|
||||
if (typeof (blockTag) === "bigint") {
|
||||
blockTag = getNumber(blockTag, "blockTag");
|
||||
}
|
||||
if (typeof (blockTag) === "number") {
|
||||
if (blockTag >= 0) {
|
||||
return toQuantity(blockTag);
|
||||
@ -17483,6 +17495,10 @@
|
||||
}
|
||||
throw new Error("invalid account");
|
||||
}
|
||||
async listAccounts() {
|
||||
const accounts = await this.send("eth_accounts", []);
|
||||
return accounts.map((a) => new JsonRpcSigner(this, a));
|
||||
}
|
||||
}
|
||||
class JsonRpcApiPollingProvider extends JsonRpcApiProvider {
|
||||
#pollingInterval;
|
||||
@ -21974,9 +21990,13 @@
|
||||
ErrorFragment: ErrorFragment,
|
||||
EventFragment: EventFragment,
|
||||
Fragment: Fragment,
|
||||
FallbackFragment: FallbackFragment,
|
||||
FunctionFragment: FunctionFragment,
|
||||
NamedFragment: NamedFragment,
|
||||
ParamType: ParamType,
|
||||
StructFragment: StructFragment,
|
||||
checkResultErrors: checkResultErrors,
|
||||
ErrorDescription: ErrorDescription,
|
||||
Indexed: Indexed,
|
||||
Interface: Interface,
|
||||
LogDescription: LogDescription,
|
||||
@ -22005,6 +22025,7 @@
|
||||
ContractEventPayload: ContractEventPayload,
|
||||
ContractTransactionReceipt: ContractTransactionReceipt,
|
||||
ContractTransactionResponse: ContractTransactionResponse,
|
||||
ContractUnknownEventPayload: ContractUnknownEventPayload,
|
||||
EventLog: EventLog,
|
||||
computeHmac: computeHmac,
|
||||
randomBytes: randomBytes,
|
||||
@ -22049,6 +22070,7 @@
|
||||
CloudflareProvider: CloudflareProvider,
|
||||
EtherscanProvider: EtherscanProvider,
|
||||
InfuraProvider: InfuraProvider,
|
||||
InfuraWebSocketProvider: InfuraWebSocketProvider,
|
||||
PocketProvider: PocketProvider,
|
||||
QuickNodeProvider: QuickNodeProvider,
|
||||
IpcSocketProvider: IpcSocketProvider,
|
||||
@ -22056,6 +22078,18 @@
|
||||
WebSocketProvider: WebSocketProvider,
|
||||
EnsResolver: EnsResolver,
|
||||
Network: Network,
|
||||
EnsPlugin: EnsPlugin,
|
||||
EtherscanPlugin: EtherscanPlugin,
|
||||
FeeDataNetworkPlugin: FeeDataNetworkPlugin,
|
||||
GasCostPlugin: GasCostPlugin,
|
||||
NetworkPlugin: NetworkPlugin,
|
||||
SocketBlockSubscriber: SocketBlockSubscriber,
|
||||
SocketEventSubscriber: SocketEventSubscriber,
|
||||
SocketPendingSubscriber: SocketPendingSubscriber,
|
||||
SocketSubscriber: SocketSubscriber,
|
||||
UnmanagedSubscriber: UnmanagedSubscriber,
|
||||
copyRequest: copyRequest,
|
||||
showThrottleMessage: showThrottleMessage,
|
||||
accessListify: accessListify,
|
||||
computeAddress: computeAddress,
|
||||
recoverAddress: recoverAddress,
|
||||
@ -22076,6 +22110,7 @@
|
||||
zeroPadBytes: zeroPadBytes,
|
||||
zeroPadValue: zeroPadValue,
|
||||
defineProperties: defineProperties,
|
||||
resolveProperties: resolveProperties,
|
||||
assert: assert$1,
|
||||
assertArgument: assertArgument,
|
||||
assertArgumentCount: assertArgumentCount,
|
||||
@ -22084,6 +22119,7 @@
|
||||
makeError: makeError,
|
||||
isCallException: isCallException,
|
||||
isError: isError,
|
||||
EventPayload: EventPayload,
|
||||
FetchRequest: FetchRequest,
|
||||
FetchResponse: FetchResponse,
|
||||
FetchCancelSignal: FetchCancelSignal,
|
||||
@ -22109,6 +22145,7 @@
|
||||
Utf8ErrorFuncs: Utf8ErrorFuncs,
|
||||
decodeRlp: decodeRlp,
|
||||
encodeRlp: encodeRlp,
|
||||
uuidV4: uuidV4,
|
||||
Mnemonic: Mnemonic,
|
||||
BaseWallet: BaseWallet,
|
||||
HDNodeWallet: HDNodeWallet,
|
||||
@ -22126,7 +22163,8 @@
|
||||
Wordlist: Wordlist,
|
||||
LangEn: LangEn,
|
||||
WordlistOwl: WordlistOwl,
|
||||
WordlistOwlA: WordlistOwlA
|
||||
WordlistOwlA: WordlistOwlA,
|
||||
wordlists: wordlists
|
||||
});
|
||||
|
||||
/**
|
||||
@ -22153,24 +22191,33 @@
|
||||
exports.ContractFactory = ContractFactory;
|
||||
exports.ContractTransactionReceipt = ContractTransactionReceipt;
|
||||
exports.ContractTransactionResponse = ContractTransactionResponse;
|
||||
exports.ContractUnknownEventPayload = ContractUnknownEventPayload;
|
||||
exports.EnsPlugin = EnsPlugin;
|
||||
exports.EnsResolver = EnsResolver;
|
||||
exports.ErrorDescription = ErrorDescription;
|
||||
exports.ErrorFragment = ErrorFragment;
|
||||
exports.EtherSymbol = EtherSymbol;
|
||||
exports.EtherscanPlugin = EtherscanPlugin;
|
||||
exports.EtherscanProvider = EtherscanProvider;
|
||||
exports.EventFragment = EventFragment;
|
||||
exports.EventLog = EventLog;
|
||||
exports.EventPayload = EventPayload;
|
||||
exports.FallbackFragment = FallbackFragment;
|
||||
exports.FallbackProvider = FallbackProvider;
|
||||
exports.FeeData = FeeData;
|
||||
exports.FeeDataNetworkPlugin = FeeDataNetworkPlugin;
|
||||
exports.FetchCancelSignal = FetchCancelSignal;
|
||||
exports.FetchRequest = FetchRequest;
|
||||
exports.FetchResponse = FetchResponse;
|
||||
exports.FixedNumber = FixedNumber;
|
||||
exports.Fragment = Fragment;
|
||||
exports.FunctionFragment = FunctionFragment;
|
||||
exports.GasCostPlugin = GasCostPlugin;
|
||||
exports.HDNodeVoidWallet = HDNodeVoidWallet;
|
||||
exports.HDNodeWallet = HDNodeWallet;
|
||||
exports.Indexed = Indexed;
|
||||
exports.InfuraProvider = InfuraProvider;
|
||||
exports.InfuraWebSocketProvider = InfuraWebSocketProvider;
|
||||
exports.Interface = Interface;
|
||||
exports.IpcSocketProvider = IpcSocketProvider;
|
||||
exports.JsonRpcApiProvider = JsonRpcApiProvider;
|
||||
@ -22185,7 +22232,9 @@
|
||||
exports.MinInt256 = MinInt256;
|
||||
exports.Mnemonic = Mnemonic;
|
||||
exports.N = N$1;
|
||||
exports.NamedFragment = NamedFragment;
|
||||
exports.Network = Network;
|
||||
exports.NetworkPlugin = NetworkPlugin;
|
||||
exports.NonceManager = NonceManager;
|
||||
exports.ParamType = ParamType;
|
||||
exports.PocketProvider = PocketProvider;
|
||||
@ -22193,13 +22242,19 @@
|
||||
exports.Result = Result;
|
||||
exports.Signature = Signature;
|
||||
exports.SigningKey = SigningKey;
|
||||
exports.SocketBlockSubscriber = SocketBlockSubscriber;
|
||||
exports.SocketEventSubscriber = SocketEventSubscriber;
|
||||
exports.SocketPendingSubscriber = SocketPendingSubscriber;
|
||||
exports.SocketProvider = SocketProvider;
|
||||
exports.SocketSubscriber = SocketSubscriber;
|
||||
exports.StructFragment = StructFragment;
|
||||
exports.Transaction = Transaction;
|
||||
exports.TransactionDescription = TransactionDescription;
|
||||
exports.TransactionReceipt = TransactionReceipt;
|
||||
exports.TransactionResponse = TransactionResponse;
|
||||
exports.Typed = Typed;
|
||||
exports.TypedDataEncoder = TypedDataEncoder;
|
||||
exports.UnmanagedSubscriber = UnmanagedSubscriber;
|
||||
exports.Utf8ErrorFuncs = Utf8ErrorFuncs;
|
||||
exports.VoidSigner = VoidSigner;
|
||||
exports.Wallet = Wallet;
|
||||
@ -22220,6 +22275,7 @@
|
||||
exports.computeAddress = computeAddress;
|
||||
exports.computeHmac = computeHmac;
|
||||
exports.concat = concat;
|
||||
exports.copyRequest = copyRequest;
|
||||
exports.dataLength = dataLength;
|
||||
exports.dataSlice = dataSlice;
|
||||
exports.decodeBase58 = decodeBase58;
|
||||
@ -22277,11 +22333,13 @@
|
||||
exports.randomBytes = randomBytes;
|
||||
exports.recoverAddress = recoverAddress;
|
||||
exports.resolveAddress = resolveAddress;
|
||||
exports.resolveProperties = resolveProperties;
|
||||
exports.ripemd160 = ripemd160;
|
||||
exports.scrypt = scrypt;
|
||||
exports.scryptSync = scryptSync;
|
||||
exports.sha256 = sha256;
|
||||
exports.sha512 = sha512;
|
||||
exports.showThrottleMessage = showThrottleMessage;
|
||||
exports.solidityPacked = solidityPacked;
|
||||
exports.solidityPackedKeccak256 = solidityPackedKeccak256;
|
||||
exports.solidityPackedSha256 = solidityPackedSha256;
|
||||
@ -22295,8 +22353,10 @@
|
||||
exports.toUtf8Bytes = toUtf8Bytes;
|
||||
exports.toUtf8CodePoints = toUtf8CodePoints;
|
||||
exports.toUtf8String = toUtf8String;
|
||||
exports.uuidV4 = uuidV4;
|
||||
exports.verifyMessage = verifyMessage;
|
||||
exports.version = version;
|
||||
exports.wordlists = wordlists;
|
||||
exports.zeroPadBytes = zeroPadBytes;
|
||||
exports.zeroPadValue = zeroPadValue;
|
||||
|
||||
|
2
dist/ethers.umd.js.map
vendored
2
dist/ethers.umd.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.umd.min.js
vendored
2
dist/ethers.umd.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/wordlists-extra.js
vendored
2
dist/wordlists-extra.js
vendored
@ -149,7 +149,7 @@ const u64 = {
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
const version = "6.0.8";
|
||||
const version = "6.1.0";
|
||||
|
||||
/**
|
||||
* Property helper functions.
|
||||
|
2
dist/wordlists-extra.js.map
vendored
2
dist/wordlists-extra.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/wordlists-extra.min.js
vendored
2
dist/wordlists-extra.min.js
vendored
File diff suppressed because one or more lines are too long
84
lib.commonjs/_tests/blockchain-data.d.ts
vendored
Normal file
84
lib.commonjs/_tests/blockchain-data.d.ts
vendored
Normal file
@ -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;
|
7
lib.commonjs/_tests/create-provider.d.ts
vendored
Normal file
7
lib.commonjs/_tests/create-provider.d.ts
vendored
Normal file
@ -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;
|
1
lib.commonjs/_tests/test-abi.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-abi.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-address.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-address.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-contract.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-contract.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-crypto-algoswap.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-crypto-algoswap.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-crypto.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-crypto.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-hash-typeddata.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-hash-typeddata.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-hash.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-hash.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-providers-avatar.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-providers-avatar.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-providers-ccip.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-providers-ccip.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-providers-data.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-providers-data.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-providers-errors.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-providers-errors.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-providers-extra.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-providers-extra.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-providers-send.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-providers-send.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-providers-wildcard.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-providers-wildcard.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-rlp.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-rlp.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-transaction.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-transaction.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-utils-maths.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-utils-maths.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-utils-misc.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-utils-misc.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-utils-units.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-utils-units.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
12
lib.commonjs/_tests/test-utils-utf8.d.ts
vendored
Normal file
12
lib.commonjs/_tests/test-utils-utf8.d.ts
vendored
Normal file
@ -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>;
|
||||
};
|
6
lib.commonjs/_tests/test-wallet-hd.d.ts
vendored
Normal file
6
lib.commonjs/_tests/test-wallet-hd.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
declare global {
|
||||
class TextDecoder {
|
||||
decode(data: Uint8Array): string;
|
||||
}
|
||||
}
|
||||
export {};
|
1
lib.commonjs/_tests/test-wallet-json.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-wallet-json.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-wallet-mnemonic.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-wallet-mnemonic.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-wallet.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-wallet.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1
lib.commonjs/_tests/test-wordlists.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-wordlists.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
216
lib.commonjs/_tests/types.d.ts
vendored
Normal file
216
lib.commonjs/_tests/types.d.ts
vendored
Normal file
@ -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;
|
||||
}
|
8
lib.commonjs/_tests/utils.d.ts
vendored
Normal file
8
lib.commonjs/_tests/utils.d.ts
vendored
Normal file
@ -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>;
|
4
lib.commonjs/_version.d.ts
vendored
Normal file
4
lib.commonjs/_version.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
export declare const version: string;
|
@ -5,5 +5,5 @@ exports.version = void 0;
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
exports.version = "6.0.8";
|
||||
exports.version = "6.1.0";
|
||||
//# sourceMappingURL=_version.js.map
|
58
lib.commonjs/abi/abi-coder.d.ts
vendored
Normal file
58
lib.commonjs/abi/abi-coder.d.ts
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* When sending values to or receiving values from a [[Contract]], the
|
||||
* data is generally encoded using the [ABI standard](link-solc-abi).
|
||||
*
|
||||
* The AbiCoder provides a utility to encode values to ABI data and
|
||||
* decode values from ABI data.
|
||||
*
|
||||
* Most of the time, developers should favour the [[Contract]] class,
|
||||
* which further abstracts a lot of the finer details of ABI data.
|
||||
*
|
||||
* @_section api/abi/abi-coder:ABI Encoding
|
||||
*/
|
||||
import { Result } from "./coders/abstract-coder.js";
|
||||
import { ParamType } from "./fragments.js";
|
||||
import type { BytesLike, CallExceptionAction, CallExceptionError } from "../utils/index.js";
|
||||
/**
|
||||
* About AbiCoder
|
||||
*/
|
||||
export declare class AbiCoder {
|
||||
#private;
|
||||
/**
|
||||
* Get the default values for the given %%types%%.
|
||||
*
|
||||
* For example, a ``uint`` is by default ``0`` and ``bool``
|
||||
* is by default ``false``.
|
||||
*/
|
||||
getDefaultValue(types: ReadonlyArray<string | ParamType>): Result;
|
||||
/**
|
||||
* Encode the %%values%% as the %%types%% into ABI data.
|
||||
*
|
||||
* @returns DataHexstring
|
||||
*/
|
||||
encode(types: ReadonlyArray<string | ParamType>, values: ReadonlyArray<any>): string;
|
||||
/**
|
||||
* Decode the ABI %%data%% as the %%types%% into values.
|
||||
*
|
||||
* If %%loose%% decoding is enabled, then strict padding is
|
||||
* not enforced. Some older versions of Solidity incorrectly
|
||||
* padded event data emitted from ``external`` functions.
|
||||
*/
|
||||
decode(types: ReadonlyArray<string | ParamType>, data: BytesLike, loose?: boolean): Result;
|
||||
/**
|
||||
* Returns the shared singleton instance of a default [[AbiCoder]].
|
||||
*
|
||||
* On the first call, the instance is created internally.
|
||||
*/
|
||||
static defaultAbiCoder(): AbiCoder;
|
||||
/**
|
||||
* Returns an ethers-compatible [[CallExceptionError]] Error for the given
|
||||
* result %%data%% for the [[CallExceptionAction]] %%action%% against
|
||||
* the Transaction %%tx%%.
|
||||
*/
|
||||
static getBuiltinCallException(action: CallExceptionAction, tx: {
|
||||
to?: null | string;
|
||||
from?: null | string;
|
||||
data?: string;
|
||||
}, data: null | BytesLike): CallExceptionError;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
/**
|
||||
* When sending values to or receiving values from a [[Contract]], the
|
||||
* data is generally encoded using the [ABI standard](solc-abi-standard).
|
||||
* data is generally encoded using the [ABI standard](link-solc-abi).
|
||||
*
|
||||
* The AbiCoder provides a utility to encode values to ABI data and
|
||||
* decode values from ABI data.
|
||||
|
14
lib.commonjs/abi/bytes32.d.ts
vendored
Normal file
14
lib.commonjs/abi/bytes32.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* About bytes32 strings...
|
||||
*
|
||||
* @_docloc: api/utils:Bytes32 Strings
|
||||
*/
|
||||
import type { BytesLike } from "../utils/index.js";
|
||||
/**
|
||||
* Encodes %%text%% as a Bytes32 string.
|
||||
*/
|
||||
export declare function encodeBytes32String(text: string): string;
|
||||
/**
|
||||
* Encodes the Bytes32-encoded %%bytes%% into a string.
|
||||
*/
|
||||
export declare function decodeBytes32String(_bytes: BytesLike): string;
|
116
lib.commonjs/abi/coders/abstract-coder.d.ts
vendored
Normal file
116
lib.commonjs/abi/coders/abstract-coder.d.ts
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
import type { BigNumberish, BytesLike } from "../../utils/index.js";
|
||||
/**
|
||||
* @_ignore:
|
||||
*/
|
||||
export declare const WordSize: number;
|
||||
/**
|
||||
* A [[Result]] is a sub-class of Array, which allows accessing any
|
||||
* of its values either positionally by its index or, if keys are
|
||||
* provided by its name.
|
||||
*
|
||||
* @_docloc: api/abi
|
||||
*/
|
||||
export declare class Result extends Array<any> {
|
||||
#private;
|
||||
[K: string | number]: any;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
constructor(...args: Array<any>);
|
||||
/**
|
||||
* Returns the Result as a normal Array.
|
||||
*
|
||||
* This will throw if there are any outstanding deferred
|
||||
* errors.
|
||||
*/
|
||||
toArray(): Array<any>;
|
||||
/**
|
||||
* Returns the Result as an Object with each name-value pair.
|
||||
*
|
||||
* This will throw if any value is unnamed, or if there are
|
||||
* any outstanding deferred errors.
|
||||
*/
|
||||
toObject(): Record<string, any>;
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
slice(start?: number | undefined, end?: number | undefined): Result;
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
filter(callback: (el: any, index: number, array: Result) => boolean, thisArg?: any): Result;
|
||||
/**
|
||||
* Returns the value for %%name%%.
|
||||
*
|
||||
* Since it is possible to have a key whose name conflicts with
|
||||
* a method on a [[Result]] or its superclass Array, or any
|
||||
* JavaScript keyword, this ensures all named values are still
|
||||
* accessible by name.
|
||||
*/
|
||||
getValue(name: string): any;
|
||||
/**
|
||||
* Creates a new [[Result]] for %%items%% with each entry
|
||||
* also accessible by its corresponding name in %%keys%%.
|
||||
*/
|
||||
static fromItems(items: Array<any>, keys?: Array<null | string>): Result;
|
||||
}
|
||||
/**
|
||||
* Returns all errors found in a [[Result]].
|
||||
*
|
||||
* Since certain errors encountered when creating a [[Result]] do
|
||||
* not impact the ability to continue parsing data, they are
|
||||
* deferred until they are actually accessed. Hence a faulty string
|
||||
* in an Event that is never used does not impact the program flow.
|
||||
*
|
||||
* However, sometimes it may be useful to access, identify or
|
||||
* validate correctness of a [[Result]].
|
||||
*
|
||||
* @_docloc api/abi
|
||||
*/
|
||||
export declare function checkResultErrors(result: Result): Array<{
|
||||
path: Array<string | number>;
|
||||
error: Error;
|
||||
}>;
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare abstract class Coder {
|
||||
readonly name: string;
|
||||
readonly type: string;
|
||||
readonly localName: string;
|
||||
readonly dynamic: boolean;
|
||||
constructor(name: string, type: string, localName: string, dynamic: boolean);
|
||||
_throwError(message: string, value: any): never;
|
||||
abstract encode(writer: Writer, value: any): number;
|
||||
abstract decode(reader: Reader): any;
|
||||
abstract defaultValue(): any;
|
||||
}
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class Writer {
|
||||
#private;
|
||||
constructor();
|
||||
get data(): string;
|
||||
get length(): number;
|
||||
appendWriter(writer: Writer): number;
|
||||
writeBytes(value: BytesLike): number;
|
||||
writeValue(value: BigNumberish): number;
|
||||
writeUpdatableValue(): (value: BigNumberish) => void;
|
||||
}
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class Reader {
|
||||
#private;
|
||||
readonly allowLoose: boolean;
|
||||
constructor(data: BytesLike, allowLoose?: boolean);
|
||||
get data(): string;
|
||||
get dataLength(): number;
|
||||
get consumed(): number;
|
||||
get bytes(): Uint8Array;
|
||||
subReader(offset: number): Reader;
|
||||
readBytes(length: number, loose?: boolean): Uint8Array;
|
||||
readValue(): bigint;
|
||||
readIndex(): number;
|
||||
}
|
12
lib.commonjs/abi/coders/address.d.ts
vendored
Normal file
12
lib.commonjs/abi/coders/address.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import { Typed } from "../typed.js";
|
||||
import { Coder } from "./abstract-coder.js";
|
||||
import type { Reader, Writer } from "./abstract-coder.js";
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class AddressCoder extends Coder {
|
||||
constructor(localName: string);
|
||||
defaultValue(): string;
|
||||
encode(writer: Writer, _value: string | Typed): number;
|
||||
decode(reader: Reader): any;
|
||||
}
|
14
lib.commonjs/abi/coders/anonymous.d.ts
vendored
Normal file
14
lib.commonjs/abi/coders/anonymous.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { Coder } from "./abstract-coder.js";
|
||||
import type { Reader, Writer } from "./abstract-coder.js";
|
||||
/**
|
||||
* Clones the functionality of an existing Coder, but without a localName
|
||||
*
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class AnonymousCoder extends Coder {
|
||||
private coder;
|
||||
constructor(coder: Coder);
|
||||
defaultValue(): any;
|
||||
encode(writer: Writer, value: any): number;
|
||||
decode(reader: Reader): any;
|
||||
}
|
24
lib.commonjs/abi/coders/array.d.ts
vendored
Normal file
24
lib.commonjs/abi/coders/array.d.ts
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
import { Typed } from "../typed.js";
|
||||
import { Coder, Result, Writer } from "./abstract-coder.js";
|
||||
import type { Reader } from "./abstract-coder.js";
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare function pack(writer: Writer, coders: ReadonlyArray<Coder>, values: Array<any> | {
|
||||
[name: string]: any;
|
||||
}): number;
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare function unpack(reader: Reader, coders: ReadonlyArray<Coder>): Result;
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class ArrayCoder extends Coder {
|
||||
readonly coder: Coder;
|
||||
readonly length: number;
|
||||
constructor(coder: Coder, length: number, localName: string);
|
||||
defaultValue(): Array<any>;
|
||||
encode(writer: Writer, _value: Array<any> | Typed): number;
|
||||
decode(reader: Reader): any;
|
||||
}
|
12
lib.commonjs/abi/coders/boolean.d.ts
vendored
Normal file
12
lib.commonjs/abi/coders/boolean.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import { Typed } from "../typed.js";
|
||||
import { Coder } from "./abstract-coder.js";
|
||||
import type { Reader, Writer } from "./abstract-coder.js";
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class BooleanCoder extends Coder {
|
||||
constructor(localName: string);
|
||||
defaultValue(): boolean;
|
||||
encode(writer: Writer, _value: boolean | Typed): number;
|
||||
decode(reader: Reader): any;
|
||||
}
|
18
lib.commonjs/abi/coders/bytes.d.ts
vendored
Normal file
18
lib.commonjs/abi/coders/bytes.d.ts
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
import { Coder } from "./abstract-coder.js";
|
||||
import type { Reader, Writer } from "./abstract-coder.js";
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class DynamicBytesCoder extends Coder {
|
||||
constructor(type: string, localName: string);
|
||||
defaultValue(): string;
|
||||
encode(writer: Writer, value: any): number;
|
||||
decode(reader: Reader): any;
|
||||
}
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class BytesCoder extends DynamicBytesCoder {
|
||||
constructor(localName: string);
|
||||
decode(reader: Reader): any;
|
||||
}
|
14
lib.commonjs/abi/coders/fixed-bytes.d.ts
vendored
Normal file
14
lib.commonjs/abi/coders/fixed-bytes.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { Typed } from "../typed.js";
|
||||
import { Coder } from "./abstract-coder.js";
|
||||
import type { BytesLike } from "../../utils/index.js";
|
||||
import type { Reader, Writer } from "./abstract-coder.js";
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class FixedBytesCoder extends Coder {
|
||||
readonly size: number;
|
||||
constructor(size: number, localName: string);
|
||||
defaultValue(): string;
|
||||
encode(writer: Writer, _value: BytesLike | Typed): number;
|
||||
decode(reader: Reader): any;
|
||||
}
|
11
lib.commonjs/abi/coders/null.d.ts
vendored
Normal file
11
lib.commonjs/abi/coders/null.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import { Coder } from "./abstract-coder.js";
|
||||
import type { Reader, Writer } from "./abstract-coder.js";
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class NullCoder extends Coder {
|
||||
constructor(localName: string);
|
||||
defaultValue(): null;
|
||||
encode(writer: Writer, value: any): number;
|
||||
decode(reader: Reader): any;
|
||||
}
|
15
lib.commonjs/abi/coders/number.d.ts
vendored
Normal file
15
lib.commonjs/abi/coders/number.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
import { Typed } from "../typed.js";
|
||||
import { Coder } from "./abstract-coder.js";
|
||||
import type { BigNumberish } from "../../utils/index.js";
|
||||
import type { Reader, Writer } from "./abstract-coder.js";
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class NumberCoder extends Coder {
|
||||
readonly size: number;
|
||||
readonly signed: boolean;
|
||||
constructor(size: number, signed: boolean, localName: string);
|
||||
defaultValue(): number;
|
||||
encode(writer: Writer, _value: BigNumberish | Typed): number;
|
||||
decode(reader: Reader): any;
|
||||
}
|
12
lib.commonjs/abi/coders/string.d.ts
vendored
Normal file
12
lib.commonjs/abi/coders/string.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import { Typed } from "../typed.js";
|
||||
import { DynamicBytesCoder } from "./bytes.js";
|
||||
import type { Reader, Writer } from "./abstract-coder.js";
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class StringCoder extends DynamicBytesCoder {
|
||||
constructor(localName: string);
|
||||
defaultValue(): string;
|
||||
encode(writer: Writer, _value: string | Typed): number;
|
||||
decode(reader: Reader): any;
|
||||
}
|
15
lib.commonjs/abi/coders/tuple.d.ts
vendored
Normal file
15
lib.commonjs/abi/coders/tuple.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
import { Typed } from "../typed.js";
|
||||
import { Coder } from "./abstract-coder.js";
|
||||
import type { Reader, Writer } from "./abstract-coder.js";
|
||||
/**
|
||||
* @_ignore
|
||||
*/
|
||||
export declare class TupleCoder extends Coder {
|
||||
readonly coders: ReadonlyArray<Coder>;
|
||||
constructor(coders: Array<Coder>, localName: string);
|
||||
defaultValue(): any;
|
||||
encode(writer: Writer, _value: Array<any> | {
|
||||
[name: string]: any;
|
||||
} | Typed): number;
|
||||
decode(reader: Reader): any;
|
||||
}
|
371
lib.commonjs/abi/fragments.d.ts
vendored
Normal file
371
lib.commonjs/abi/fragments.d.ts
vendored
Normal file
@ -0,0 +1,371 @@
|
||||
/**
|
||||
* About frgaments...
|
||||
*
|
||||
* @_subsection api/abi/abi-coder:Fragments [about-fragments]
|
||||
*/
|
||||
/**
|
||||
* A type description in a JSON API.
|
||||
*/
|
||||
export interface JsonFragmentType {
|
||||
/**
|
||||
* The parameter name.
|
||||
*/
|
||||
readonly name?: string;
|
||||
/**
|
||||
* If the parameter is indexed.
|
||||
*/
|
||||
readonly indexed?: boolean;
|
||||
/**
|
||||
* The type of the parameter.
|
||||
*/
|
||||
readonly type?: string;
|
||||
/**
|
||||
* The internal Solidity type.
|
||||
*/
|
||||
readonly internalType?: string;
|
||||
/**
|
||||
* The components for a tuple.
|
||||
*/
|
||||
readonly components?: ReadonlyArray<JsonFragmentType>;
|
||||
}
|
||||
/**
|
||||
* A fragment for a method, event or error in a JSON API.
|
||||
*/
|
||||
export interface JsonFragment {
|
||||
/**
|
||||
* The name of the error, event, function, etc.
|
||||
*/
|
||||
readonly name?: string;
|
||||
/**
|
||||
* The type of the fragment (e.g. ``event``, ``"function"``, etc.)
|
||||
*/
|
||||
readonly type?: string;
|
||||
/**
|
||||
* If the event is anonymous.
|
||||
*/
|
||||
readonly anonymous?: boolean;
|
||||
/**
|
||||
* If the function is payable.
|
||||
*/
|
||||
readonly payable?: boolean;
|
||||
/**
|
||||
* If the function is constant.
|
||||
*/
|
||||
readonly constant?: boolean;
|
||||
/**
|
||||
* The mutability state of the function.
|
||||
*/
|
||||
readonly stateMutability?: string;
|
||||
/**
|
||||
* The input parameters.
|
||||
*/
|
||||
readonly inputs?: ReadonlyArray<JsonFragmentType>;
|
||||
/**
|
||||
* The output parameters.
|
||||
*/
|
||||
readonly outputs?: ReadonlyArray<JsonFragmentType>;
|
||||
/**
|
||||
* The gas limit to use when sending a transaction for this function.
|
||||
*/
|
||||
readonly gas?: string;
|
||||
}
|
||||
/**
|
||||
* The format to serialize the output as.
|
||||
*/
|
||||
export type FormatType = "sighash" | "minimal" | "full" | "json";
|
||||
/**
|
||||
* When [walking](ParamType-walk) a [[ParamType]], this is called
|
||||
* on each component.
|
||||
*/
|
||||
export type ParamTypeWalkFunc = (type: string, value: any) => any;
|
||||
/**
|
||||
* When [walking asynchronously](ParamType-walkAsync) a [[ParamType]],
|
||||
* this is called on each component.
|
||||
*/
|
||||
export type ParamTypeWalkAsyncFunc = (type: string, value: any) => any | Promise<any>;
|
||||
/**
|
||||
* Each input and output of a [[Fragment]] is an Array of **PAramType**.
|
||||
*/
|
||||
export declare class ParamType {
|
||||
#private;
|
||||
/**
|
||||
* The local name of the parameter (or ``""`` if unbound)
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``,
|
||||
* ``"uint256[3][]"``)
|
||||
*/
|
||||
readonly type: string;
|
||||
/**
|
||||
* The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``)
|
||||
*/
|
||||
readonly baseType: string;
|
||||
/**
|
||||
* True if the parameters is indexed.
|
||||
*
|
||||
* For non-indexable types this is ``null``.
|
||||
*/
|
||||
readonly indexed: null | boolean;
|
||||
/**
|
||||
* The components for the tuple.
|
||||
*
|
||||
* For non-tuple types this is ``null``.
|
||||
*/
|
||||
readonly components: null | ReadonlyArray<ParamType>;
|
||||
/**
|
||||
* The array length, or ``-1`` for dynamic-lengthed arrays.
|
||||
*
|
||||
* For non-array types this is ``null``.
|
||||
*/
|
||||
readonly arrayLength: null | number;
|
||||
/**
|
||||
* The type of each child in the array.
|
||||
*
|
||||
* For non-array types this is ``null``.
|
||||
*/
|
||||
readonly arrayChildren: null | ParamType;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
constructor(guard: any, name: string, type: string, baseType: string, indexed: null | boolean, components: null | ReadonlyArray<ParamType>, arrayLength: null | number, arrayChildren: null | ParamType);
|
||||
/**
|
||||
* Return a string representation of this type.
|
||||
*
|
||||
* For example,
|
||||
*
|
||||
* ``sighash" => "(uint256,address)"``
|
||||
*
|
||||
* ``"minimal" => "tuple(uint256,address) indexed"``
|
||||
*
|
||||
* ``"full" => "tuple(uint256 foo, address bar) indexed baz"``
|
||||
*/
|
||||
format(format?: FormatType): string;
|
||||
/**
|
||||
* Returns true if %%this%% is an Array type.
|
||||
*
|
||||
* This provides a type gaurd ensuring that [[arrayChildren]]
|
||||
* and [[arrayLength]] are non-null.
|
||||
*/
|
||||
isArray(): this is (ParamType & {
|
||||
arrayChildren: ParamType;
|
||||
arrayLength: number;
|
||||
});
|
||||
/**
|
||||
* Returns true if %%this%% is a Tuple type.
|
||||
*
|
||||
* This provides a type gaurd ensuring that [[components]]
|
||||
* is non-null.
|
||||
*/
|
||||
isTuple(): this is (ParamType & {
|
||||
components: ReadonlyArray<ParamType>;
|
||||
});
|
||||
/**
|
||||
* Returns true if %%this%% is an Indexable type.
|
||||
*
|
||||
* This provides a type gaurd ensuring that [[indexed]]
|
||||
* is non-null.
|
||||
*/
|
||||
isIndexable(): this is (ParamType & {
|
||||
indexed: boolean;
|
||||
});
|
||||
/**
|
||||
* Walks the **ParamType** with %%value%%, calling %%process%%
|
||||
* on each type, destructing the %%value%% recursively.
|
||||
*/
|
||||
walk(value: any, process: ParamTypeWalkFunc): any;
|
||||
/**
|
||||
* Walks the **ParamType** with %%value%%, asynchronously calling
|
||||
* %%process%% on each type, destructing the %%value%% recursively.
|
||||
*
|
||||
* This can be used to resolve ENS naes by walking and resolving each
|
||||
* ``"address"`` type.
|
||||
*/
|
||||
walkAsync(value: any, process: ParamTypeWalkAsyncFunc): Promise<any>;
|
||||
/**
|
||||
* Creates a new **ParamType** for %%obj%%.
|
||||
*
|
||||
* If %%allowIndexed%% then the ``indexed`` keyword is permitted,
|
||||
* otherwise the ``indexed`` keyword will throw an error.
|
||||
*/
|
||||
static from(obj: any, allowIndexed?: boolean): ParamType;
|
||||
/**
|
||||
* Returns true if %%value%% is a **ParamType**.
|
||||
*/
|
||||
static isParamType(value: any): value is ParamType;
|
||||
}
|
||||
/**
|
||||
* The type of a [[Fragment]].
|
||||
*/
|
||||
export type FragmentType = "constructor" | "error" | "event" | "fallback" | "function" | "struct";
|
||||
/**
|
||||
* An abstract class to represent An individual fragment from a parse ABI.
|
||||
*/
|
||||
export declare abstract class Fragment {
|
||||
/**
|
||||
* The type of the fragment.
|
||||
*/
|
||||
readonly type: FragmentType;
|
||||
/**
|
||||
* The inputs for the fragment.
|
||||
*/
|
||||
readonly inputs: ReadonlyArray<ParamType>;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
constructor(guard: any, type: FragmentType, inputs: ReadonlyArray<ParamType>);
|
||||
/**
|
||||
* Returns a string representation of this fragment.
|
||||
*/
|
||||
abstract format(format?: FormatType): string;
|
||||
/**
|
||||
* Creates a new **Fragment** for %%obj%%, wich can be any supported
|
||||
* ABI frgament type.
|
||||
*/
|
||||
static from(obj: any): Fragment;
|
||||
/**
|
||||
* Returns true if %%value%% is a [[ConstructorFragment]].
|
||||
*/
|
||||
static isConstructor(value: any): value is ConstructorFragment;
|
||||
/**
|
||||
* Returns true if %%value%% is an [[ErrorFragment]].
|
||||
*/
|
||||
static isError(value: any): value is ErrorFragment;
|
||||
/**
|
||||
* Returns true if %%value%% is an [[EventFragment]].
|
||||
*/
|
||||
static isEvent(value: any): value is EventFragment;
|
||||
/**
|
||||
* Returns true if %%value%% is a [[FunctionFragment]].
|
||||
*/
|
||||
static isFunction(value: any): value is FunctionFragment;
|
||||
/**
|
||||
* Returns true if %%value%% is a [[StructFragment]].
|
||||
*/
|
||||
static isStruct(value: any): value is StructFragment;
|
||||
}
|
||||
/**
|
||||
* An abstract class to represent An individual fragment
|
||||
* which has a name from a parse ABI.
|
||||
*/
|
||||
export declare abstract class NamedFragment extends Fragment {
|
||||
/**
|
||||
* The name of the fragment.
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
constructor(guard: any, type: FragmentType, name: string, inputs: ReadonlyArray<ParamType>);
|
||||
}
|
||||
/**
|
||||
* A Fragment which represents a //Custom Error//.
|
||||
*/
|
||||
export declare class ErrorFragment extends NamedFragment {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
constructor(guard: any, name: string, inputs: ReadonlyArray<ParamType>);
|
||||
/**
|
||||
* The Custom Error selector.
|
||||
*/
|
||||
get selector(): string;
|
||||
format(format?: FormatType): string;
|
||||
static from(obj: any): ErrorFragment;
|
||||
static isFragment(value: any): value is ErrorFragment;
|
||||
}
|
||||
/**
|
||||
* A Fragment which represents an Event.
|
||||
*/
|
||||
export declare class EventFragment extends NamedFragment {
|
||||
readonly anonymous: boolean;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
constructor(guard: any, name: string, inputs: ReadonlyArray<ParamType>, anonymous: boolean);
|
||||
/**
|
||||
* The Event topic hash.
|
||||
*/
|
||||
get topicHash(): string;
|
||||
format(format?: FormatType): string;
|
||||
static getTopicHash(name: string, params?: Array<any>): string;
|
||||
static from(obj: any): EventFragment;
|
||||
static isFragment(value: any): value is EventFragment;
|
||||
}
|
||||
/**
|
||||
* A Fragment which represents a constructor.
|
||||
*/
|
||||
export declare class ConstructorFragment extends Fragment {
|
||||
readonly payable: boolean;
|
||||
readonly gas: null | bigint;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
constructor(guard: any, type: FragmentType, inputs: ReadonlyArray<ParamType>, payable: boolean, gas: null | bigint);
|
||||
format(format?: FormatType): string;
|
||||
static from(obj: any): ConstructorFragment;
|
||||
static isFragment(value: any): value is ConstructorFragment;
|
||||
}
|
||||
/**
|
||||
* A Fragment which represents a method.
|
||||
*/
|
||||
export declare class FallbackFragment extends Fragment {
|
||||
/**
|
||||
* If the function can be sent value during invocation.
|
||||
*/
|
||||
readonly payable: boolean;
|
||||
constructor(guard: any, inputs: ReadonlyArray<ParamType>, payable: boolean);
|
||||
format(format?: FormatType): string;
|
||||
static from(obj: any): FallbackFragment;
|
||||
static isFragment(value: any): value is FallbackFragment;
|
||||
}
|
||||
/**
|
||||
* A Fragment which represents a method.
|
||||
*/
|
||||
export declare class FunctionFragment extends NamedFragment {
|
||||
/**
|
||||
* If the function is constant (e.g. ``pure`` or ``view`` functions).
|
||||
*/
|
||||
readonly constant: boolean;
|
||||
/**
|
||||
* The returned types for the result of calling this function.
|
||||
*/
|
||||
readonly outputs: ReadonlyArray<ParamType>;
|
||||
/**
|
||||
* The state mutability (e.g. ``payable``, ``nonpayable``, ``view``
|
||||
* or ``pure``)
|
||||
*/
|
||||
readonly stateMutability: "payable" | "nonpayable" | "view" | "pure";
|
||||
/**
|
||||
* If the function can be sent value during invocation.
|
||||
*/
|
||||
readonly payable: boolean;
|
||||
/**
|
||||
* The amount of gas to send when calling this function
|
||||
*/
|
||||
readonly gas: null | bigint;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
constructor(guard: any, name: string, stateMutability: "payable" | "nonpayable" | "view" | "pure", inputs: ReadonlyArray<ParamType>, outputs: ReadonlyArray<ParamType>, gas: null | bigint);
|
||||
/**
|
||||
* The Function selector.
|
||||
*/
|
||||
get selector(): string;
|
||||
format(format?: FormatType): string;
|
||||
static getSelector(name: string, params?: Array<any>): string;
|
||||
static from(obj: any): FunctionFragment;
|
||||
static isFragment(value: any): value is FunctionFragment;
|
||||
}
|
||||
/**
|
||||
* A Fragment which represents a structure.
|
||||
*/
|
||||
export declare class StructFragment extends NamedFragment {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
constructor(guard: any, name: string, inputs: ReadonlyArray<ParamType>);
|
||||
format(): string;
|
||||
static from(obj: any): StructFragment;
|
||||
static isFragment(value: any): value is FunctionFragment;
|
||||
}
|
@ -506,7 +506,7 @@ class ParamType {
|
||||
walk(value, process) {
|
||||
if (this.isArray()) {
|
||||
if (!Array.isArray(value)) {
|
||||
throw new Error("invlaid array value");
|
||||
throw new Error("invalid array value");
|
||||
}
|
||||
if (this.arrayLength !== -1 && value.length !== this.arrayLength) {
|
||||
throw new Error("array is wrong length");
|
||||
@ -516,7 +516,7 @@ class ParamType {
|
||||
}
|
||||
if (this.isTuple()) {
|
||||
if (!Array.isArray(value)) {
|
||||
throw new Error("invlaid tuple value");
|
||||
throw new Error("invalid tuple value");
|
||||
}
|
||||
if (value.length !== this.components.length) {
|
||||
throw new Error("array is wrong length");
|
||||
@ -529,7 +529,7 @@ class ParamType {
|
||||
#walkAsync(promises, value, process, setValue) {
|
||||
if (this.isArray()) {
|
||||
if (!Array.isArray(value)) {
|
||||
throw new Error("invlaid array value");
|
||||
throw new Error("invalid array value");
|
||||
}
|
||||
if (this.arrayLength !== -1 && value.length !== this.arrayLength) {
|
||||
throw new Error("array is wrong length");
|
||||
@ -553,7 +553,7 @@ class ParamType {
|
||||
}
|
||||
else {
|
||||
if (value == null || typeof (value) !== "object") {
|
||||
throw new Error("invlaid tuple value");
|
||||
throw new Error("invalid tuple value");
|
||||
}
|
||||
result = components.map((param) => {
|
||||
if (!param.name) {
|
||||
|
13
lib.commonjs/abi/index.d.ts
vendored
Normal file
13
lib.commonjs/abi/index.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Explain about ABI here...
|
||||
*
|
||||
* @_section api/abi:Application Binary Interface [about-abi]
|
||||
* @_navTitle: ABI
|
||||
*/
|
||||
export { AbiCoder } from "./abi-coder.js";
|
||||
export { decodeBytes32String, encodeBytes32String } from "./bytes32.js";
|
||||
export { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, NamedFragment, ParamType, StructFragment, } from "./fragments.js";
|
||||
export { checkResultErrors, Indexed, Interface, ErrorDescription, LogDescription, TransactionDescription, Result } from "./interface.js";
|
||||
export { Typed } from "./typed.js";
|
||||
export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, ParamTypeWalkAsyncFunc, ParamTypeWalkFunc } from "./fragments.js";
|
||||
export type { InterfaceAbi, } from "./interface.js";
|
253
lib.commonjs/abi/interface.d.ts
vendored
Normal file
253
lib.commonjs/abi/interface.d.ts
vendored
Normal file
@ -0,0 +1,253 @@
|
||||
/**
|
||||
* About Interface
|
||||
*
|
||||
* @_subsection api/abi:Interfaces [interfaces]
|
||||
*/
|
||||
import { AbiCoder } from "./abi-coder.js";
|
||||
import { checkResultErrors, Result } from "./coders/abstract-coder.js";
|
||||
import { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, ParamType } from "./fragments.js";
|
||||
import { Typed } from "./typed.js";
|
||||
import type { BigNumberish, BytesLike, CallExceptionError, CallExceptionTransaction } from "../utils/index.js";
|
||||
import type { JsonFragment } from "./fragments.js";
|
||||
export { checkResultErrors, Result };
|
||||
export declare class LogDescription {
|
||||
readonly fragment: EventFragment;
|
||||
readonly name: string;
|
||||
readonly signature: string;
|
||||
readonly topic: string;
|
||||
readonly args: Result;
|
||||
constructor(fragment: EventFragment, topic: string, args: Result);
|
||||
}
|
||||
export declare class TransactionDescription {
|
||||
readonly fragment: FunctionFragment;
|
||||
readonly name: string;
|
||||
readonly args: Result;
|
||||
readonly signature: string;
|
||||
readonly selector: string;
|
||||
readonly value: bigint;
|
||||
constructor(fragment: FunctionFragment, selector: string, args: Result, value: bigint);
|
||||
}
|
||||
export declare class ErrorDescription {
|
||||
readonly fragment: ErrorFragment;
|
||||
readonly name: string;
|
||||
readonly args: Result;
|
||||
readonly signature: string;
|
||||
readonly selector: string;
|
||||
constructor(fragment: ErrorFragment, selector: string, args: Result);
|
||||
}
|
||||
export declare class Indexed {
|
||||
readonly hash: null | string;
|
||||
readonly _isIndexed: boolean;
|
||||
static isIndexed(value: any): value is Indexed;
|
||||
constructor(hash: null | string);
|
||||
}
|
||||
/**
|
||||
* @TODO
|
||||
*/
|
||||
export type InterfaceAbi = string | ReadonlyArray<Fragment | JsonFragment | string>;
|
||||
/**
|
||||
* An Interface abstracts many of the low-level details for
|
||||
* encoding and decoding the data on the blockchain.
|
||||
*
|
||||
* An ABI provides information on how to encode data to send to
|
||||
* a Contract, how to decode the results and events and how to
|
||||
* interpret revert errors.
|
||||
*
|
||||
* The ABI can be specified by [any supported format](InterfaceAbi).
|
||||
*/
|
||||
export declare class Interface {
|
||||
#private;
|
||||
/**
|
||||
* All the Contract ABI members (i.e. methods, events, errors, etc).
|
||||
*/
|
||||
readonly fragments: ReadonlyArray<Fragment>;
|
||||
/**
|
||||
* The Contract constructor.
|
||||
*/
|
||||
readonly deploy: ConstructorFragment;
|
||||
/**
|
||||
* The Fallback method, if any.
|
||||
*/
|
||||
readonly fallback: null | FallbackFragment;
|
||||
/**
|
||||
* If receiving ether is supported.
|
||||
*/
|
||||
readonly receive: boolean;
|
||||
/**
|
||||
* Create a new Interface for the %%fragments%%.
|
||||
*/
|
||||
constructor(fragments: InterfaceAbi);
|
||||
/**
|
||||
* Returns the entire Human-Readable ABI, as an array of
|
||||
* signatures, optionally as %%minimal%% strings, which
|
||||
* removes parameter names and unneceesary spaces.
|
||||
*/
|
||||
format(minimal?: boolean): Array<string>;
|
||||
/**
|
||||
* Return the JSON-encoded ABI. This is the format Solidiy
|
||||
* returns.
|
||||
*/
|
||||
formatJson(): string;
|
||||
/**
|
||||
* The ABI coder that will be used to encode and decode binary
|
||||
* data.
|
||||
*/
|
||||
getAbiCoder(): AbiCoder;
|
||||
/**
|
||||
* Get the function name for %%key%%, which may be a function selector,
|
||||
* function name or function signature that belongs to the ABI.
|
||||
*/
|
||||
getFunctionName(key: string): string;
|
||||
/**
|
||||
* Get the [[FunctionFragment]] for %%key%%, which may be a function
|
||||
* selector, function name or function signature that belongs to the ABI.
|
||||
*
|
||||
* If %%values%% is provided, it will use the Typed API to handle
|
||||
* ambiguous cases where multiple functions match by name.
|
||||
*
|
||||
* If the %%key%% and %%values%% do not refine to a single function in
|
||||
* the ABI, this will throw.
|
||||
*/
|
||||
getFunction(key: string, values?: Array<any | Typed>): null | FunctionFragment;
|
||||
/**
|
||||
* Iterate over all functions, calling %%callback%%, sorted by their name.
|
||||
*/
|
||||
forEachFunction(callback: (func: FunctionFragment, index: number) => void): void;
|
||||
/**
|
||||
* Get the event name for %%key%%, which may be a topic hash,
|
||||
* event name or event signature that belongs to the ABI.
|
||||
*/
|
||||
getEventName(key: string): string;
|
||||
/**
|
||||
* Get the [[EventFragment]] for %%key%%, which may be a topic hash,
|
||||
* event name or event signature that belongs to the ABI.
|
||||
*
|
||||
* If %%values%% is provided, it will use the Typed API to handle
|
||||
* ambiguous cases where multiple events match by name.
|
||||
*
|
||||
* If the %%key%% and %%values%% do not refine to a single event in
|
||||
* the ABI, this will throw.
|
||||
*/
|
||||
getEvent(key: string, values?: Array<any | Typed>): null | EventFragment;
|
||||
/**
|
||||
* Iterate over all events, calling %%callback%%, sorted by their name.
|
||||
*/
|
||||
forEachEvent(callback: (func: EventFragment, index: number) => void): void;
|
||||
/**
|
||||
* Get the [[ErrorFragment]] for %%key%%, which may be an error
|
||||
* selector, error name or error signature that belongs to the ABI.
|
||||
*
|
||||
* If %%values%% is provided, it will use the Typed API to handle
|
||||
* ambiguous cases where multiple errors match by name.
|
||||
*
|
||||
* If the %%key%% and %%values%% do not refine to a single error in
|
||||
* the ABI, this will throw.
|
||||
*/
|
||||
getError(key: string, values?: Array<any | Typed>): null | ErrorFragment;
|
||||
/**
|
||||
* Iterate over all errors, calling %%callback%%, sorted by their name.
|
||||
*/
|
||||
forEachError(callback: (func: ErrorFragment, index: number) => void): void;
|
||||
_decodeParams(params: ReadonlyArray<ParamType>, data: BytesLike): Result;
|
||||
_encodeParams(params: ReadonlyArray<ParamType>, values: ReadonlyArray<any>): string;
|
||||
/**
|
||||
* Encodes a ``tx.data`` object for deploying the Contract with
|
||||
* the %%values%% as the constructor arguments.
|
||||
*/
|
||||
encodeDeploy(values?: ReadonlyArray<any>): string;
|
||||
/**
|
||||
* Decodes the result %%data%% (e.g. from an ``eth_call``) for the
|
||||
* specified error (see [[getError]] for valid values for
|
||||
* %%key%%).
|
||||
*
|
||||
* Most developers should prefer the [[parseCallResult]] method instead,
|
||||
* which will automatically detect a ``CALL_EXCEPTION`` and throw the
|
||||
* corresponding error.
|
||||
*/
|
||||
decodeErrorResult(fragment: ErrorFragment | string, data: BytesLike): Result;
|
||||
/**
|
||||
* Encodes the transaction revert data for a call result that
|
||||
* reverted from the the Contract with the sepcified %%error%%
|
||||
* (see [[getError]] for valid values for %%fragment%%) with the %%values%%.
|
||||
*
|
||||
* This is generally not used by most developers, unless trying to mock
|
||||
* a result from a Contract.
|
||||
*/
|
||||
encodeErrorResult(fragment: ErrorFragment | string, values?: ReadonlyArray<any>): string;
|
||||
/**
|
||||
* Decodes the %%data%% from a transaction ``tx.data`` for
|
||||
* the function specified (see [[getFunction]] for valid values
|
||||
* for %%fragment%%).
|
||||
*
|
||||
* Most developers should prefer the [[parseTransaction]] method
|
||||
* instead, which will automatically detect the fragment.
|
||||
*/
|
||||
decodeFunctionData(fragment: FunctionFragment | string, data: BytesLike): Result;
|
||||
/**
|
||||
* Encodes the ``tx.data`` for a transaction that calls the function
|
||||
* specified (see [[getFunction]] for valid values for %%fragment%%) with
|
||||
* the %%values%%.
|
||||
*/
|
||||
encodeFunctionData(fragment: FunctionFragment | string, values?: ReadonlyArray<any>): string;
|
||||
/**
|
||||
* Decodes the result %%data%% (e.g. from an ``eth_call``) for the
|
||||
* specified function (see [[getFunction]] for valid values for
|
||||
* %%key%%).
|
||||
*
|
||||
* Most developers should prefer the [[parseCallResult]] method instead,
|
||||
* which will automatically detect a ``CALL_EXCEPTION`` and throw the
|
||||
* corresponding error.
|
||||
*/
|
||||
decodeFunctionResult(fragment: FunctionFragment | string, data: BytesLike): Result;
|
||||
makeError(_data: BytesLike, tx: CallExceptionTransaction): CallExceptionError;
|
||||
/**
|
||||
* Encodes the result data (e.g. from an ``eth_call``) for the
|
||||
* specified function (see [[getFunction]] for valid values
|
||||
* for %%fragment%%) with %%values%%.
|
||||
*
|
||||
* This is generally not used by most developers, unless trying to mock
|
||||
* a result from a Contract.
|
||||
*/
|
||||
encodeFunctionResult(fragment: FunctionFragment | string, values?: ReadonlyArray<any>): string;
|
||||
encodeFilterTopics(fragment: EventFragment | string, values: ReadonlyArray<any>): Array<null | string | Array<string>>;
|
||||
encodeEventLog(fragment: EventFragment | string, values: ReadonlyArray<any>): {
|
||||
data: string;
|
||||
topics: Array<string>;
|
||||
};
|
||||
decodeEventLog(fragment: EventFragment | string, data: BytesLike, topics?: ReadonlyArray<string>): Result;
|
||||
/**
|
||||
* Parses a transaction, finding the matching function and extracts
|
||||
* the parameter values along with other useful function details.
|
||||
*
|
||||
* If the matching function cannot be found, return null.
|
||||
*/
|
||||
parseTransaction(tx: {
|
||||
data: string;
|
||||
value?: BigNumberish;
|
||||
}): null | TransactionDescription;
|
||||
parseCallResult(data: BytesLike): Result;
|
||||
/**
|
||||
* Parses a receipt log, finding the matching event and extracts
|
||||
* the parameter values along with other useful event details.
|
||||
*
|
||||
* If the matching event cannot be found, returns null.
|
||||
*/
|
||||
parseLog(log: {
|
||||
topics: Array<string>;
|
||||
data: string;
|
||||
}): null | LogDescription;
|
||||
/**
|
||||
* Parses a revert data, finding the matching error and extracts
|
||||
* the parameter values along with other useful error details.
|
||||
*
|
||||
* If the matching event cannot be found, returns null.
|
||||
*/
|
||||
parseError(data: BytesLike): null | ErrorDescription;
|
||||
/**
|
||||
* Creates a new [[Interface]] from the ABI %%value%%.
|
||||
*
|
||||
* The %%value%% may be provided as an existing [[Interface]] object,
|
||||
* a JSON-encoded ABI or any Human-Readable ABI format.
|
||||
*/
|
||||
static from(value: InterfaceAbi | Interface): Interface;
|
||||
}
|
162
lib.commonjs/abi/typed.d.ts
vendored
Normal file
162
lib.commonjs/abi/typed.d.ts
vendored
Normal file
@ -0,0 +1,162 @@
|
||||
/**
|
||||
* About typed...
|
||||
*
|
||||
* @_subsection: api/abi:Typed Values
|
||||
*/
|
||||
import type { Addressable } from "../address/index.js";
|
||||
import type { BigNumberish, BytesLike } from "../utils/index.js";
|
||||
import type { Result } from "./coders/abstract-coder.js";
|
||||
export interface TypedNumber extends Typed {
|
||||
value: number;
|
||||
defaultValue(): number;
|
||||
minValue(): number;
|
||||
maxValue(): number;
|
||||
}
|
||||
export interface TypedBigInt extends Typed {
|
||||
value: bigint;
|
||||
defaultValue(): bigint;
|
||||
minValue(): bigint;
|
||||
maxValue(): bigint;
|
||||
}
|
||||
export interface TypedData extends Typed {
|
||||
value: string;
|
||||
defaultValue(): string;
|
||||
}
|
||||
export interface TypedString extends Typed {
|
||||
value: string;
|
||||
defaultValue(): string;
|
||||
}
|
||||
export declare class Typed {
|
||||
#private;
|
||||
readonly type: string;
|
||||
readonly value: any;
|
||||
readonly _typedSymbol: Symbol;
|
||||
constructor(gaurd: any, type: string, value: any, options?: any);
|
||||
format(): string;
|
||||
defaultValue(): string | number | bigint | Result;
|
||||
minValue(): string | number | bigint;
|
||||
maxValue(): string | number | bigint;
|
||||
isBigInt(): this is TypedBigInt;
|
||||
isData(): this is TypedData;
|
||||
isString(): this is TypedString;
|
||||
get tupleName(): null | string;
|
||||
get arrayLength(): null | number;
|
||||
static from(type: string, value: any): Typed;
|
||||
static uint8(v: BigNumberish): Typed;
|
||||
static uint16(v: BigNumberish): Typed;
|
||||
static uint24(v: BigNumberish): Typed;
|
||||
static uint32(v: BigNumberish): Typed;
|
||||
static uint40(v: BigNumberish): Typed;
|
||||
static uint48(v: BigNumberish): Typed;
|
||||
static uint56(v: BigNumberish): Typed;
|
||||
static uint64(v: BigNumberish): Typed;
|
||||
static uint72(v: BigNumberish): Typed;
|
||||
static uint80(v: BigNumberish): Typed;
|
||||
static uint88(v: BigNumberish): Typed;
|
||||
static uint96(v: BigNumberish): Typed;
|
||||
static uint104(v: BigNumberish): Typed;
|
||||
static uint112(v: BigNumberish): Typed;
|
||||
static uint120(v: BigNumberish): Typed;
|
||||
static uint128(v: BigNumberish): Typed;
|
||||
static uint136(v: BigNumberish): Typed;
|
||||
static uint144(v: BigNumberish): Typed;
|
||||
static uint152(v: BigNumberish): Typed;
|
||||
static uint160(v: BigNumberish): Typed;
|
||||
static uint168(v: BigNumberish): Typed;
|
||||
static uint176(v: BigNumberish): Typed;
|
||||
static uint184(v: BigNumberish): Typed;
|
||||
static uint192(v: BigNumberish): Typed;
|
||||
static uint200(v: BigNumberish): Typed;
|
||||
static uint208(v: BigNumberish): Typed;
|
||||
static uint216(v: BigNumberish): Typed;
|
||||
static uint224(v: BigNumberish): Typed;
|
||||
static uint232(v: BigNumberish): Typed;
|
||||
static uint240(v: BigNumberish): Typed;
|
||||
static uint248(v: BigNumberish): Typed;
|
||||
static uint256(v: BigNumberish): Typed;
|
||||
static uint(v: BigNumberish): Typed;
|
||||
static int8(v: BigNumberish): Typed;
|
||||
static int16(v: BigNumberish): Typed;
|
||||
static int24(v: BigNumberish): Typed;
|
||||
static int32(v: BigNumberish): Typed;
|
||||
static int40(v: BigNumberish): Typed;
|
||||
static int48(v: BigNumberish): Typed;
|
||||
static int56(v: BigNumberish): Typed;
|
||||
static int64(v: BigNumberish): Typed;
|
||||
static int72(v: BigNumberish): Typed;
|
||||
static int80(v: BigNumberish): Typed;
|
||||
static int88(v: BigNumberish): Typed;
|
||||
static int96(v: BigNumberish): Typed;
|
||||
static int104(v: BigNumberish): Typed;
|
||||
static int112(v: BigNumberish): Typed;
|
||||
static int120(v: BigNumberish): Typed;
|
||||
static int128(v: BigNumberish): Typed;
|
||||
static int136(v: BigNumberish): Typed;
|
||||
static int144(v: BigNumberish): Typed;
|
||||
static int152(v: BigNumberish): Typed;
|
||||
static int160(v: BigNumberish): Typed;
|
||||
static int168(v: BigNumberish): Typed;
|
||||
static int176(v: BigNumberish): Typed;
|
||||
static int184(v: BigNumberish): Typed;
|
||||
static int192(v: BigNumberish): Typed;
|
||||
static int200(v: BigNumberish): Typed;
|
||||
static int208(v: BigNumberish): Typed;
|
||||
static int216(v: BigNumberish): Typed;
|
||||
static int224(v: BigNumberish): Typed;
|
||||
static int232(v: BigNumberish): Typed;
|
||||
static int240(v: BigNumberish): Typed;
|
||||
static int248(v: BigNumberish): Typed;
|
||||
static int256(v: BigNumberish): Typed;
|
||||
static int(v: BigNumberish): Typed;
|
||||
static bytes1(v: BytesLike): Typed;
|
||||
static bytes2(v: BytesLike): Typed;
|
||||
static bytes3(v: BytesLike): Typed;
|
||||
static bytes4(v: BytesLike): Typed;
|
||||
static bytes5(v: BytesLike): Typed;
|
||||
static bytes6(v: BytesLike): Typed;
|
||||
static bytes7(v: BytesLike): Typed;
|
||||
static bytes8(v: BytesLike): Typed;
|
||||
static bytes9(v: BytesLike): Typed;
|
||||
static bytes10(v: BytesLike): Typed;
|
||||
static bytes11(v: BytesLike): Typed;
|
||||
static bytes12(v: BytesLike): Typed;
|
||||
static bytes13(v: BytesLike): Typed;
|
||||
static bytes14(v: BytesLike): Typed;
|
||||
static bytes15(v: BytesLike): Typed;
|
||||
static bytes16(v: BytesLike): Typed;
|
||||
static bytes17(v: BytesLike): Typed;
|
||||
static bytes18(v: BytesLike): Typed;
|
||||
static bytes19(v: BytesLike): Typed;
|
||||
static bytes20(v: BytesLike): Typed;
|
||||
static bytes21(v: BytesLike): Typed;
|
||||
static bytes22(v: BytesLike): Typed;
|
||||
static bytes23(v: BytesLike): Typed;
|
||||
static bytes24(v: BytesLike): Typed;
|
||||
static bytes25(v: BytesLike): Typed;
|
||||
static bytes26(v: BytesLike): Typed;
|
||||
static bytes27(v: BytesLike): Typed;
|
||||
static bytes28(v: BytesLike): Typed;
|
||||
static bytes29(v: BytesLike): Typed;
|
||||
static bytes30(v: BytesLike): Typed;
|
||||
static bytes31(v: BytesLike): Typed;
|
||||
static bytes32(v: BytesLike): Typed;
|
||||
static address(v: string | Addressable): Typed;
|
||||
static bool(v: any): Typed;
|
||||
static bytes(v: BytesLike): Typed;
|
||||
static string(v: string): Typed;
|
||||
static array(v: Array<any | Typed>, dynamic?: null | boolean): Typed;
|
||||
static tuple(v: Array<any | Typed> | Record<string, any | Typed>, name?: string): Typed;
|
||||
static overrides(v: Record<string, any>): Typed;
|
||||
/**
|
||||
* Returns true only if %%value%% is a [[Typed]] instance.
|
||||
*/
|
||||
static isTyped(value: any): value is Typed;
|
||||
/**
|
||||
* If the value is a [[Typed]] instance, validates the underlying value
|
||||
* and returns it, otherwise returns value directly.
|
||||
*
|
||||
* This is useful for functions that with to accept either a [[Typed]]
|
||||
* object or values.
|
||||
*/
|
||||
static dereference<T>(value: Typed | T, type: string): T;
|
||||
}
|
55
lib.commonjs/address/address.d.ts
vendored
Normal file
55
lib.commonjs/address/address.d.ts
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Returns a normalized and checksumed address for %%address%%.
|
||||
* This accepts non-checksum addresses, checksum addresses and
|
||||
* [[getIcapAddress]] formats.
|
||||
*
|
||||
* The checksum in Ethereum uses the capitalization (upper-case
|
||||
* vs lower-case) of the characters within an address to encode
|
||||
* its checksum, which offers, on average, a checksum of 15-bits.
|
||||
*
|
||||
* If %%address%% contains both upper-case and lower-case, it is
|
||||
* assumed to already be a checksum address and its checksum is
|
||||
* validated, and if the address fails its expected checksum an
|
||||
* error is thrown.
|
||||
*
|
||||
* If you wish the checksum of %%address%% to be ignore, it should
|
||||
* be converted to lower-case (i.e. ``.toLowercase()``) before
|
||||
* being passed in. This should be a very rare situation though,
|
||||
* that you wish to bypass the safegaurds in place to protect
|
||||
* against an address that has been incorrectly copied from another
|
||||
* source.
|
||||
*
|
||||
* @example:
|
||||
* // Adds the checksum (via upper-casing specific letters)
|
||||
* getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72")
|
||||
* //_result:
|
||||
*
|
||||
* // Converts ICAP address and adds checksum
|
||||
* getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36");
|
||||
* //_result:
|
||||
*
|
||||
* // Throws an error if an address contains mixed case,
|
||||
* // but the checksum fails
|
||||
* getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72")
|
||||
* //_error:
|
||||
*/
|
||||
export declare function getAddress(address: string): string;
|
||||
/**
|
||||
* The [ICAP Address format](link-icap) format is an early checksum
|
||||
* format which attempts to be compatible with the banking
|
||||
* industry [IBAN format](link-wiki-iban) for bank accounts.
|
||||
*
|
||||
* It is no longer common or a recommended format.
|
||||
*
|
||||
* @example:
|
||||
* getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72");
|
||||
* //_result:
|
||||
*
|
||||
* getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36");
|
||||
* //_result:
|
||||
*
|
||||
* // Throws an error if the ICAP checksum is wrong
|
||||
* getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37");
|
||||
* //_error:
|
||||
*/
|
||||
export declare function getIcapAddress(address: string): string;
|
@ -134,7 +134,7 @@ exports.getAddress = getAddress;
|
||||
/**
|
||||
* The [ICAP Address format](link-icap) format is an early checksum
|
||||
* format which attempts to be compatible with the banking
|
||||
* industry [IBAN format](link-wiki-iban] for bank accounts.
|
||||
* industry [IBAN format](link-wiki-iban) for bank accounts.
|
||||
*
|
||||
* It is no longer common or a recommended format.
|
||||
*
|
||||
|
80
lib.commonjs/address/checks.d.ts
vendored
Normal file
80
lib.commonjs/address/checks.d.ts
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
import type { Addressable, AddressLike, NameResolver } from "./index.js";
|
||||
/**
|
||||
* Returns true if %%value%% is an object which implements the
|
||||
* [[Addressable]] interface.
|
||||
*
|
||||
* @example:
|
||||
* // Wallets and AbstractSigner sub-classes
|
||||
* isAddressable(Wallet.createRandom())
|
||||
* //_result:
|
||||
*
|
||||
* // Contracts
|
||||
* contract = new Contract("dai.tokens.ethers.eth", [ ], provider)
|
||||
* isAddressable(contract)
|
||||
* //_result:
|
||||
*/
|
||||
export declare function isAddressable(value: any): value is Addressable;
|
||||
/**
|
||||
* Returns true if %%value%% is a valid address.
|
||||
*
|
||||
* @example:
|
||||
* // Valid address
|
||||
* isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72")
|
||||
* //_result:
|
||||
*
|
||||
* // Valid ICAP address
|
||||
* isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36")
|
||||
* //_result:
|
||||
*
|
||||
* // Invalid checksum
|
||||
* isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72")
|
||||
* //_result:
|
||||
*
|
||||
* // Invalid ICAP checksum
|
||||
* isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72")
|
||||
* //_result:
|
||||
*
|
||||
* // Not an address (an ENS name requires a provided and an
|
||||
* // asynchronous API to access)
|
||||
* isAddress("ricmoo.eth")
|
||||
* //_result:
|
||||
*/
|
||||
export declare function isAddress(value: any): value is string;
|
||||
/**
|
||||
* Resolves to an address for the %%target%%, which may be any
|
||||
* supported address type, an [[Addressable]] or a Promise which
|
||||
* resolves to an address.
|
||||
*
|
||||
* If an ENS name is provided, but that name has not been correctly
|
||||
* configured a [[UnconfiguredNameError]] is thrown.
|
||||
*
|
||||
* @example:
|
||||
* addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F"
|
||||
*
|
||||
* // Addresses are return synchronously
|
||||
* resolveAddress(addr, provider)
|
||||
* //_result:
|
||||
*
|
||||
* // Address promises are resolved asynchronously
|
||||
* resolveAddress(Promise.resolve(addr))
|
||||
* //_result:
|
||||
*
|
||||
* // ENS names are resolved asynchronously
|
||||
* resolveAddress("dai.tokens.ethers.eth", provider)
|
||||
* //_result:
|
||||
*
|
||||
* // Addressable objects are resolved asynchronously
|
||||
* contract = new Contract(addr, [ ])
|
||||
* resolveAddress(contract, provider)
|
||||
* //_result:
|
||||
*
|
||||
* // Unconfigured ENS names reject
|
||||
* resolveAddress("nothing-here.ricmoo.eth", provider)
|
||||
* //_error:
|
||||
*
|
||||
* // ENS names require a NameResolver object passed in
|
||||
* // (notice the provider was omitted)
|
||||
* resolveAddress("nothing-here.ricmoo.eth")
|
||||
* //_error:
|
||||
*/
|
||||
export declare function resolveAddress(target: AddressLike, resolver?: null | NameResolver): string | Promise<string>;
|
47
lib.commonjs/address/contract-address.d.ts
vendored
Normal file
47
lib.commonjs/address/contract-address.d.ts
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
import type { BigNumberish, BytesLike } from "../utils/index.js";
|
||||
/**
|
||||
* Returns the address that would result from a ``CREATE`` for %%tx%%.
|
||||
*
|
||||
* This can be used to compute the address a contract will be
|
||||
* deployed to by an EOA when sending a deployment transaction (i.e.
|
||||
* when the ``to`` address is ``null``).
|
||||
*
|
||||
* This can also be used to compute the address a contract will be
|
||||
* deployed to by a contract, by using the contract's address as the
|
||||
* ``to`` and the contract's nonce.
|
||||
*
|
||||
* @example
|
||||
* from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72";
|
||||
* nonce = 5;
|
||||
*
|
||||
* getCreateAddress({ from, nonce });
|
||||
* //_result:
|
||||
*/
|
||||
export declare function getCreateAddress(tx: {
|
||||
from: string;
|
||||
nonce: BigNumberish;
|
||||
}): string;
|
||||
/**
|
||||
* Returns the address that would result from a ``CREATE2`` operation
|
||||
* with the given %%from%%, %%salt%% and %%initCodeHash%%.
|
||||
*
|
||||
* To compute the %%initCodeHash%% from a contract's init code, use
|
||||
* the [[keccak256]] function.
|
||||
*
|
||||
* For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]].
|
||||
*
|
||||
* @example
|
||||
* // The address of the contract
|
||||
* from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"
|
||||
*
|
||||
* // The salt
|
||||
* salt = id("HelloWorld")
|
||||
*
|
||||
* // The hash of the initCode
|
||||
* initCode = "0x6394198df16000526103ff60206004601c335afa6040516060f3";
|
||||
* initCodeHash = keccak256(initCode)
|
||||
*
|
||||
* getCreate2Address(from, salt, initCodeHash)
|
||||
* //_result:
|
||||
*/
|
||||
export declare function getCreate2Address(_from: string, _salt: BytesLike, _initCodeHash: BytesLike): string;
|
48
lib.commonjs/address/index.d.ts
vendored
Normal file
48
lib.commonjs/address/index.d.ts
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Addresses are a fundamental part of interacting with Ethereum. They
|
||||
* represent the gloabal identity of Externally Owned Accounts (accounts
|
||||
* backed by a private key) and contracts.
|
||||
*
|
||||
* The Ethereum Naming Service (ENS) provides an interconnected ecosystem
|
||||
* of contracts, standards and libraries which enable looking up an
|
||||
* address for an ENS name.
|
||||
*
|
||||
* These functions help convert between various formats, validate
|
||||
* addresses and safely resolve ENS names.
|
||||
*
|
||||
* @_section: api/address:Addresses [about-addresses]
|
||||
*/
|
||||
/**
|
||||
* An interface for objects which have an address, and can
|
||||
* resolve it asyncronously.
|
||||
*
|
||||
* This allows objects such as [[Signer]] or [[Contract]] to
|
||||
* be used most places an address can be, for example getting
|
||||
* the [balance](Provider-getBalance).
|
||||
*/
|
||||
export interface Addressable {
|
||||
/**
|
||||
* Get the object address.
|
||||
*/
|
||||
getAddress(): Promise<string>;
|
||||
}
|
||||
/**
|
||||
* Anything that can be used to return or resolve an address.
|
||||
*/
|
||||
export type AddressLike = string | Promise<string> | Addressable;
|
||||
/**
|
||||
* An interface for any object which can resolve an ENS name.
|
||||
*/
|
||||
export interface NameResolver {
|
||||
/**
|
||||
* Resolve to the address for the ENS %%name%%.
|
||||
*
|
||||
* Resolves to ``null`` if the name is unconfigued. Use
|
||||
* [[resolveAddress]] (passing this object as %%resolver%%) to
|
||||
* throw for names that are unconfigured.
|
||||
*/
|
||||
resolveName(name: string): Promise<null | string>;
|
||||
}
|
||||
export { getAddress, getIcapAddress } from "./address.js";
|
||||
export { getCreateAddress, getCreate2Address } from "./contract-address.js";
|
||||
export { isAddressable, isAddress, resolveAddress } from "./checks.js";
|
6
lib.commonjs/constants/addresses.d.ts
vendored
Normal file
6
lib.commonjs/constants/addresses.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/**
|
||||
* A constant for the zero address.
|
||||
*
|
||||
* (**i.e.** ``"0x0000000000000000000000000000000000000000"``)
|
||||
*/
|
||||
export declare const ZeroAddress: string;
|
6
lib.commonjs/constants/hashes.d.ts
vendored
Normal file
6
lib.commonjs/constants/hashes.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/**
|
||||
* A constant for the zero hash.
|
||||
*
|
||||
* (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``)
|
||||
*/
|
||||
export declare const ZeroHash: string;
|
9
lib.commonjs/constants/index.d.ts
vendored
Normal file
9
lib.commonjs/constants/index.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Some common constants useful for Ethereum.
|
||||
*
|
||||
* @_section: api/constants: Constants [about-constants]
|
||||
*/
|
||||
export { ZeroAddress } from "./addresses.js";
|
||||
export { ZeroHash } from "./hashes.js";
|
||||
export { N, WeiPerEther, MaxUint256, MinInt256, MaxInt256 } from "./numbers.js";
|
||||
export { EtherSymbol, MessagePrefix } from "./strings.js";
|
30
lib.commonjs/constants/numbers.d.ts
vendored
Normal file
30
lib.commonjs/constants/numbers.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* A constant for the order N for the secp256k1 curve.
|
||||
*
|
||||
* (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)
|
||||
*/
|
||||
export declare const N: bigint;
|
||||
/**
|
||||
* A constant for the number of wei in a single ether.
|
||||
*
|
||||
* (**i.e.** ``1000000000000000000n``)
|
||||
*/
|
||||
export declare const WeiPerEther: bigint;
|
||||
/**
|
||||
* A constant for the maximum value for a ``uint256``.
|
||||
*
|
||||
* (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)
|
||||
*/
|
||||
export declare const MaxUint256: bigint;
|
||||
/**
|
||||
* A constant for the minimum value for an ``int256``.
|
||||
*
|
||||
* (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)
|
||||
*/
|
||||
export declare const MinInt256: bigint;
|
||||
/**
|
||||
* A constant for the maximum value for an ``int256``.
|
||||
*
|
||||
* (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)
|
||||
*/
|
||||
export declare const MaxInt256: bigint;
|
12
lib.commonjs/constants/strings.d.ts
vendored
Normal file
12
lib.commonjs/constants/strings.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
/**
|
||||
* A constant for the ether symbol (normalized using NFKC).
|
||||
*
|
||||
* (**i.e.** ``"\\u039e"``)
|
||||
*/
|
||||
export declare const EtherSymbol: string;
|
||||
/**
|
||||
* A constant for the [[link-eip-191]] personal message prefix.
|
||||
*
|
||||
* (**i.e.** ``"\\x19Ethereum Signed Message:\\n"``)
|
||||
*/
|
||||
export declare const MessagePrefix: string;
|
58
lib.commonjs/contract/contract.d.ts
vendored
Normal file
58
lib.commonjs/contract/contract.d.ts
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
import { Interface } from "../abi/index.js";
|
||||
import { Log, TransactionResponse } from "../providers/provider.js";
|
||||
import { ContractTransactionResponse, EventLog } from "./wrappers.js";
|
||||
import type { EventFragment, FunctionFragment, InterfaceAbi, ParamType } from "../abi/index.js";
|
||||
import type { Addressable } from "../address/index.js";
|
||||
import type { EventEmitterable, Listener } from "../utils/index.js";
|
||||
import type { BlockTag, ContractRunner, TransactionRequest } from "../providers/index.js";
|
||||
import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction } from "./types.js";
|
||||
/**
|
||||
* @_ignore:
|
||||
*/
|
||||
export declare function copyOverrides<O extends string = "data" | "to">(arg: any, allowed?: Array<string>): Promise<Omit<ContractTransaction, O>>;
|
||||
/**
|
||||
* @_ignore:
|
||||
*/
|
||||
export declare function resolveArgs(_runner: null | ContractRunner, inputs: ReadonlyArray<ParamType>, args: Array<any>): Promise<Array<any>>;
|
||||
declare class WrappedFallback {
|
||||
readonly _contract: BaseContract;
|
||||
constructor(contract: BaseContract);
|
||||
populateTransaction(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransaction>;
|
||||
staticCall(overrides?: Omit<TransactionRequest, "to">): Promise<string>;
|
||||
send(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse>;
|
||||
estimateGas(overrides?: Omit<TransactionRequest, "to">): Promise<bigint>;
|
||||
}
|
||||
declare const internal: unique symbol;
|
||||
export declare class BaseContract implements Addressable, EventEmitterable<ContractEventName> {
|
||||
readonly target: string | Addressable;
|
||||
readonly interface: Interface;
|
||||
readonly runner: null | ContractRunner;
|
||||
readonly filters: Record<string, ContractEvent>;
|
||||
readonly [internal]: any;
|
||||
readonly fallback: null | WrappedFallback;
|
||||
constructor(target: string | Addressable, abi: Interface | InterfaceAbi, runner?: null | ContractRunner, _deployTx?: null | TransactionResponse);
|
||||
connect(runner: null | ContractRunner): BaseContract;
|
||||
getAddress(): Promise<string>;
|
||||
getDeployedCode(): Promise<null | string>;
|
||||
waitForDeployment(): Promise<this>;
|
||||
deploymentTransaction(): null | ContractTransactionResponse;
|
||||
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
|
||||
getEvent(key: string | EventFragment): ContractEvent;
|
||||
queryTransaction(hash: string): Promise<Array<EventLog>>;
|
||||
queryFilter(event: ContractEventName, fromBlock?: BlockTag, toBlock?: BlockTag): Promise<Array<EventLog | Log>>;
|
||||
on(event: ContractEventName, listener: Listener): Promise<this>;
|
||||
once(event: ContractEventName, listener: Listener): Promise<this>;
|
||||
emit(event: ContractEventName, ...args: Array<any>): Promise<boolean>;
|
||||
listenerCount(event?: ContractEventName): Promise<number>;
|
||||
listeners(event?: ContractEventName): Promise<Array<Listener>>;
|
||||
off(event: ContractEventName, listener?: Listener): Promise<this>;
|
||||
removeAllListeners(event?: ContractEventName): Promise<this>;
|
||||
addListener(event: ContractEventName, listener: Listener): Promise<this>;
|
||||
removeListener(event: ContractEventName, listener: Listener): Promise<this>;
|
||||
static buildClass<T = ContractInterface>(abi: InterfaceAbi): new (target: string, runner?: null | ContractRunner) => BaseContract & Omit<T, keyof BaseContract>;
|
||||
static from<T = ContractInterface>(target: string, abi: InterfaceAbi, runner?: null | ContractRunner): BaseContract & Omit<T, keyof BaseContract>;
|
||||
}
|
||||
declare const Contract_base: new (target: string, abi: InterfaceAbi, runner?: ContractRunner | null | undefined) => BaseContract & Omit<ContractInterface, keyof BaseContract>;
|
||||
export declare class Contract extends Contract_base {
|
||||
}
|
||||
export {};
|
21
lib.commonjs/contract/factory.d.ts
vendored
Normal file
21
lib.commonjs/contract/factory.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
import { Interface } from "../abi/index.js";
|
||||
import { BaseContract } from "./contract.js";
|
||||
import type { InterfaceAbi } from "../abi/index.js";
|
||||
import type { ContractRunner } from "../providers/index.js";
|
||||
import type { BytesLike } from "../utils/index.js";
|
||||
import type { ContractInterface, ContractMethodArgs, ContractDeployTransaction } from "./types.js";
|
||||
import type { ContractTransactionResponse } from "./wrappers.js";
|
||||
export declare class ContractFactory<A extends Array<any> = Array<any>, I = BaseContract> {
|
||||
readonly interface: Interface;
|
||||
readonly bytecode: string;
|
||||
readonly runner: null | ContractRunner;
|
||||
constructor(abi: Interface | InterfaceAbi, bytecode: BytesLike | {
|
||||
object: string;
|
||||
}, runner?: null | ContractRunner);
|
||||
getDeployTransaction(...args: ContractMethodArgs<A>): Promise<ContractDeployTransaction>;
|
||||
deploy(...args: ContractMethodArgs<A>): Promise<BaseContract & {
|
||||
deploymentTransaction(): ContractTransactionResponse;
|
||||
} & Omit<I, keyof BaseContract>>;
|
||||
connect(runner: null | ContractRunner): ContractFactory<A, I>;
|
||||
static fromSolidity<A extends Array<any> = Array<any>, I = ContractInterface>(output: any, runner?: ContractRunner): ContractFactory<A, I>;
|
||||
}
|
9
lib.commonjs/contract/index.d.ts
vendored
Normal file
9
lib.commonjs/contract/index.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* About contracts...
|
||||
*
|
||||
* @_section: api/contract:Contracts [about-contracts]
|
||||
*/
|
||||
export { BaseContract, Contract } from "./contract.js";
|
||||
export { ContractFactory } from "./factory.js";
|
||||
export { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, } from "./wrappers.js";
|
||||
export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides } from "./types.js";
|
48
lib.commonjs/contract/types.d.ts
vendored
Normal file
48
lib.commonjs/contract/types.d.ts
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
import type { EventFragment, FunctionFragment, Result, Typed } from "../abi/index.js";
|
||||
import type { TransactionRequest, PreparedTransactionRequest, TopicFilter } from "../providers/index.js";
|
||||
import type { ContractTransactionResponse } from "./wrappers.js";
|
||||
export type ContractEventName = string | ContractEvent | TopicFilter | DeferredTopicFilter;
|
||||
export interface ContractInterface {
|
||||
[name: string]: BaseContractMethod;
|
||||
}
|
||||
export interface DeferredTopicFilter {
|
||||
getTopicFilter(): Promise<TopicFilter>;
|
||||
fragment: EventFragment;
|
||||
}
|
||||
export interface ContractTransaction extends PreparedTransactionRequest {
|
||||
to: string;
|
||||
data: string;
|
||||
from?: string;
|
||||
}
|
||||
export interface ContractDeployTransaction extends Omit<ContractTransaction, "to"> {
|
||||
}
|
||||
export interface Overrides extends Omit<TransactionRequest, "to" | "data"> {
|
||||
}
|
||||
export type PostfixOverrides<A extends Array<any>> = A | [...A, Overrides];
|
||||
export type ContractMethodArgs<A extends Array<any>> = PostfixOverrides<{
|
||||
[I in keyof A]-?: A[I] | Typed;
|
||||
}>;
|
||||
export interface BaseContractMethod<A extends Array<any> = Array<any>, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> {
|
||||
(...args: ContractMethodArgs<A>): Promise<D>;
|
||||
name: string;
|
||||
fragment: FunctionFragment;
|
||||
getFragment(...args: ContractMethodArgs<A>): FunctionFragment;
|
||||
populateTransaction(...args: ContractMethodArgs<A>): Promise<ContractTransaction>;
|
||||
staticCall(...args: ContractMethodArgs<A>): Promise<R>;
|
||||
send(...args: ContractMethodArgs<A>): Promise<ContractTransactionResponse>;
|
||||
estimateGas(...args: ContractMethodArgs<A>): Promise<bigint>;
|
||||
staticCallResult(...args: ContractMethodArgs<A>): Promise<Result>;
|
||||
}
|
||||
export interface ContractMethod<A extends Array<any> = Array<any>, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> extends BaseContractMethod<A, R, D> {
|
||||
}
|
||||
export interface ConstantContractMethod<A extends Array<any>, R = any> extends ContractMethod<A, R, R> {
|
||||
}
|
||||
export type ContractEventArgs<A extends Array<any>> = {
|
||||
[I in keyof A]?: A[I] | Typed | null;
|
||||
};
|
||||
export interface ContractEvent<A extends Array<any> = Array<any>> {
|
||||
(...args: ContractEventArgs<A>): DeferredTopicFilter;
|
||||
name: string;
|
||||
fragment: EventFragment;
|
||||
getFragment(...args: ContractEventArgs<A>): EventFragment;
|
||||
}
|
40
lib.commonjs/contract/wrappers.d.ts
vendored
Normal file
40
lib.commonjs/contract/wrappers.d.ts
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
import { Block, Log, TransactionReceipt, TransactionResponse } from "../providers/provider.js";
|
||||
import { EventPayload } from "../utils/index.js";
|
||||
import type { EventFragment, Interface, Result } from "../abi/index.js";
|
||||
import type { Listener } from "../utils/index.js";
|
||||
import type { Provider } from "../providers/index.js";
|
||||
import type { BaseContract } from "./contract.js";
|
||||
import type { ContractEventName } from "./types.js";
|
||||
export declare class EventLog extends Log {
|
||||
readonly interface: Interface;
|
||||
readonly fragment: EventFragment;
|
||||
readonly args: Result;
|
||||
constructor(log: Log, iface: Interface, fragment: EventFragment);
|
||||
get eventName(): string;
|
||||
get eventSignature(): string;
|
||||
}
|
||||
export declare class ContractTransactionReceipt extends TransactionReceipt {
|
||||
#private;
|
||||
constructor(iface: Interface, provider: Provider, tx: TransactionReceipt);
|
||||
get logs(): Array<EventLog | Log>;
|
||||
}
|
||||
export declare class ContractTransactionResponse extends TransactionResponse {
|
||||
#private;
|
||||
constructor(iface: Interface, provider: Provider, tx: TransactionResponse);
|
||||
wait(confirms?: number): Promise<null | ContractTransactionReceipt>;
|
||||
}
|
||||
export declare class ContractUnknownEventPayload extends EventPayload<ContractEventName> {
|
||||
readonly log: Log;
|
||||
constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, log: Log);
|
||||
getBlock(): Promise<Block>;
|
||||
getTransaction(): Promise<TransactionResponse>;
|
||||
getTransactionReceipt(): Promise<TransactionReceipt>;
|
||||
}
|
||||
export declare class ContractEventPayload extends ContractUnknownEventPayload {
|
||||
readonly fragment: EventFragment;
|
||||
readonly log: EventLog;
|
||||
readonly args: Result;
|
||||
constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, fragment: EventFragment, _log: Log);
|
||||
get eventName(): string;
|
||||
get eventSignature(): string;
|
||||
}
|
14
lib.commonjs/crypto/crypto-browser.d.ts
vendored
Normal file
14
lib.commonjs/crypto/crypto-browser.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
declare global {
|
||||
interface Window {
|
||||
}
|
||||
const window: Window;
|
||||
const self: Window;
|
||||
}
|
||||
export interface CryptoHasher {
|
||||
update(data: Uint8Array): CryptoHasher;
|
||||
digest(): Uint8Array;
|
||||
}
|
||||
export declare function createHash(algo: string): CryptoHasher;
|
||||
export declare function createHmac(_algo: string, key: Uint8Array): CryptoHasher;
|
||||
export declare function pbkdf2Sync(password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, _algo: "sha256" | "sha512"): Uint8Array;
|
||||
export declare function randomBytes(length: number): Uint8Array;
|
1
lib.commonjs/crypto/crypto.d.ts
vendored
Normal file
1
lib.commonjs/crypto/crypto.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export { createHash, createHmac, pbkdf2Sync, randomBytes } from "crypto";
|
24
lib.commonjs/crypto/hmac.d.ts
vendored
Normal file
24
lib.commonjs/crypto/hmac.d.ts
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
import type { BytesLike } from "../utils/index.js";
|
||||
/**
|
||||
* Return the HMAC for %%data%% using the %%key%% key with the underlying
|
||||
* %%algo%% used for compression.
|
||||
*
|
||||
* @example:
|
||||
* key = id("some-secret")
|
||||
*
|
||||
* // Compute the HMAC
|
||||
* computeHmac("sha256", key, "0x1337")
|
||||
* //_result:
|
||||
*
|
||||
* // To compute the HMAC of UTF-8 data, the data must be
|
||||
* // converted to UTF-8 bytes
|
||||
* computeHmac("sha256", key, toUtf8Bytes("Hello World"))
|
||||
* //_result:
|
||||
*
|
||||
*/
|
||||
export declare function computeHmac(algorithm: "sha256" | "sha512", _key: BytesLike, _data: BytesLike): string;
|
||||
export declare namespace computeHmac {
|
||||
var _: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike;
|
||||
var lock: () => void;
|
||||
var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void;
|
||||
}
|
20
lib.commonjs/crypto/index.d.ts
vendored
Normal file
20
lib.commonjs/crypto/index.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/**
|
||||
* A fundamental building block of Ethereum is the underlying
|
||||
* cryptographic primitives.
|
||||
*
|
||||
* @_section: api/crypto:Cryptographic Functions [about-crypto]
|
||||
*/
|
||||
import { computeHmac } from "./hmac.js";
|
||||
import { keccak256 } from "./keccak.js";
|
||||
import { ripemd160 } from "./ripemd160.js";
|
||||
import { pbkdf2 } from "./pbkdf2.js";
|
||||
import { randomBytes } from "./random.js";
|
||||
import { scrypt, scryptSync } from "./scrypt.js";
|
||||
import { sha256, sha512 } from "./sha2.js";
|
||||
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync };
|
||||
export { SigningKey } from "./signing-key.js";
|
||||
export { Signature } from "./signature.js";
|
||||
declare function lock(): void;
|
||||
export { lock };
|
||||
export type { ProgressCallback } from "./scrypt.js";
|
||||
export type { SignatureLike } from "./signature.js";
|
34
lib.commonjs/crypto/keccak.d.ts
vendored
Normal file
34
lib.commonjs/crypto/keccak.d.ts
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Cryptographic hashing functions
|
||||
*
|
||||
* @_subsection: api/crypto:Hash Functions [about-crypto-hashing]
|
||||
*/
|
||||
import type { BytesLike } from "../utils/index.js";
|
||||
/**
|
||||
* Compute the cryptographic KECCAK256 hash of %%data%%.
|
||||
*
|
||||
* The %%data%% **must** be a data representation, to compute the
|
||||
* hash of UTF-8 data use the [[id]] function.
|
||||
*
|
||||
* @returns DataHexstring
|
||||
* @example:
|
||||
* keccak256("0x")
|
||||
* //_result:
|
||||
*
|
||||
* keccak256("0x1337")
|
||||
* //_result:
|
||||
*
|
||||
* keccak256(new Uint8Array([ 0x13, 0x37 ]))
|
||||
* //_result:
|
||||
*
|
||||
* // Strings are assumed to be DataHexString, otherwise it will
|
||||
* // throw. To hash UTF-8 data, see the note above.
|
||||
* keccak256("Hello World")
|
||||
* //_error:
|
||||
*/
|
||||
export declare function keccak256(_data: BytesLike): string;
|
||||
export declare namespace keccak256 {
|
||||
var _: (data: Uint8Array) => Uint8Array;
|
||||
var lock: () => void;
|
||||
var register: (func: (data: Uint8Array) => BytesLike) => void;
|
||||
}
|
34
lib.commonjs/crypto/pbkdf2.d.ts
vendored
Normal file
34
lib.commonjs/crypto/pbkdf2.d.ts
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
/**
|
||||
* A **Password-Based Key-Derivation Function** is designed to create
|
||||
* a sequence of bytes suitible as a **key** from a human-rememberable
|
||||
* password.
|
||||
*
|
||||
* @_subsection: api/crypto:Passwords [about-pbkdf]
|
||||
*/
|
||||
import type { BytesLike } from "../utils/index.js";
|
||||
/**
|
||||
* Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using
|
||||
* the %%salt%% and using %%iterations%% of %%algo%%.
|
||||
*
|
||||
* This PBKDF is outdated and should not be used in new projects, but is
|
||||
* required to decrypt older files.
|
||||
*
|
||||
* @example:
|
||||
* // The password must be converted to bytes, and it is generally
|
||||
* // best practices to ensure the string has been normalized. Many
|
||||
* // formats explicitly indicate the normalization form to use.
|
||||
* password = "hello"
|
||||
* passwordBytes = toUtf8Bytes(password, "NFKC")
|
||||
*
|
||||
* salt = id("some-salt")
|
||||
*
|
||||
* // Compute the PBKDF2
|
||||
* pbkdf2(passwordBytes, salt, 1024, 16, "sha256")
|
||||
* //_result:
|
||||
*/
|
||||
export declare function pbkdf2(_password: BytesLike, _salt: BytesLike, iterations: number, keylen: number, algo: "sha256" | "sha512"): string;
|
||||
export declare namespace pbkdf2 {
|
||||
var _: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike;
|
||||
var lock: () => void;
|
||||
var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void;
|
||||
}
|
13
lib.commonjs/crypto/random.d.ts
vendored
Normal file
13
lib.commonjs/crypto/random.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Return %%length%% bytes of cryptographically secure random data.
|
||||
*
|
||||
* @example:
|
||||
* randomBytes(8)
|
||||
* //_result:
|
||||
*/
|
||||
export declare function randomBytes(length: number): Uint8Array;
|
||||
export declare namespace randomBytes {
|
||||
var _: (length: number) => Uint8Array;
|
||||
var lock: () => void;
|
||||
var register: (func: (length: number) => Uint8Array) => void;
|
||||
}
|
24
lib.commonjs/crypto/ripemd160.d.ts
vendored
Normal file
24
lib.commonjs/crypto/ripemd160.d.ts
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
import type { BytesLike } from "../utils/index.js";
|
||||
/**
|
||||
* Compute the cryptographic RIPEMD-160 hash of %%data%%.
|
||||
*
|
||||
* @_docloc: api/crypto:Hash Functions
|
||||
* @returns DataHexstring
|
||||
*
|
||||
* @example:
|
||||
* ripemd160("0x")
|
||||
* //_result:
|
||||
*
|
||||
* ripemd160("0x1337")
|
||||
* //_result:
|
||||
*
|
||||
* ripemd160(new Uint8Array([ 0x13, 0x37 ]))
|
||||
* //_result:
|
||||
*
|
||||
*/
|
||||
export declare function ripemd160(_data: BytesLike): string;
|
||||
export declare namespace ripemd160 {
|
||||
var _: (data: Uint8Array) => Uint8Array;
|
||||
var lock: () => void;
|
||||
var register: (func: (data: Uint8Array) => BytesLike) => void;
|
||||
}
|
81
lib.commonjs/crypto/scrypt.d.ts
vendored
Normal file
81
lib.commonjs/crypto/scrypt.d.ts
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
import type { BytesLike } from "../utils/index.js";
|
||||
/**
|
||||
* A callback during long-running operations to update any
|
||||
* UI or provide programatic access to the progress.
|
||||
*
|
||||
* The %%percent%% is a value between ``0`` and ``1``.
|
||||
*
|
||||
* @_docloc: api/crypto:Passwords
|
||||
*/
|
||||
export type ProgressCallback = (percent: number) => void;
|
||||
/**
|
||||
* The [[link-wiki-scrypt]] uses a memory and cpu hard method of
|
||||
* derivation to increase the resource cost to brute-force a password
|
||||
* for a given key.
|
||||
*
|
||||
* This means this algorithm is intentionally slow, and can be tuned to
|
||||
* become slower. As computation and memory speed improve over time,
|
||||
* increasing the difficulty maintains the cost of an attacker.
|
||||
*
|
||||
* For example, if a target time of 5 seconds is used, a legitimate user
|
||||
* which knows their password requires only 5 seconds to unlock their
|
||||
* account. A 6 character password has 68 billion possibilities, which
|
||||
* would require an attacker to invest over 10,000 years of CPU time. This
|
||||
* is of course a crude example (as password generally aren't random),
|
||||
* but demonstrates to value of imposing large costs to decryption.
|
||||
*
|
||||
* For this reason, if building a UI which involved decrypting or
|
||||
* encrypting datsa using scrypt, it is recommended to use a
|
||||
* [[ProgressCallback]] (as event short periods can seem lik an eternity
|
||||
* if the UI freezes). Including the phrase //"decrypting"// in the UI
|
||||
* can also help, assuring the user their waiting is for a good reason.
|
||||
*
|
||||
* @_docloc: api/crypto:Passwords
|
||||
*
|
||||
* @example:
|
||||
* // The password must be converted to bytes, and it is generally
|
||||
* // best practices to ensure the string has been normalized. Many
|
||||
* // formats explicitly indicate the normalization form to use.
|
||||
* password = "hello"
|
||||
* passwordBytes = toUtf8Bytes(password, "NFKC")
|
||||
*
|
||||
* salt = id("some-salt")
|
||||
*
|
||||
* // Compute the scrypt
|
||||
* scrypt(passwordBytes, salt, 1024, 8, 1, 16)
|
||||
* //_result:
|
||||
*/
|
||||
export declare function scrypt(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback): Promise<string>;
|
||||
export declare namespace scrypt {
|
||||
var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback | undefined) => Promise<Uint8Array>;
|
||||
var lock: () => void;
|
||||
var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback | undefined) => Promise<BytesLike>) => void;
|
||||
}
|
||||
/**
|
||||
* Provides a synchronous variant of [[scrypt]].
|
||||
*
|
||||
* This will completely lock up and freeze the UI in a browser and will
|
||||
* prevent any event loop from progressing. For this reason, it is
|
||||
* preferred to use the [async variant](scrypt).
|
||||
*
|
||||
* @_docloc: api/crypto:Passwords
|
||||
*
|
||||
* @example:
|
||||
* // The password must be converted to bytes, and it is generally
|
||||
* // best practices to ensure the string has been normalized. Many
|
||||
* // formats explicitly indicate the normalization form to use.
|
||||
* password = "hello"
|
||||
* passwordBytes = toUtf8Bytes(password, "NFKC")
|
||||
*
|
||||
* salt = id("some-salt")
|
||||
*
|
||||
* // Compute the scrypt
|
||||
* scryptSync(passwordBytes, salt, 1024, 8, 1, 16)
|
||||
* //_result:
|
||||
*/
|
||||
export declare function scryptSync(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number): string;
|
||||
export declare namespace scryptSync {
|
||||
var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array;
|
||||
var lock: () => void;
|
||||
var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void;
|
||||
}
|
46
lib.commonjs/crypto/sha2.d.ts
vendored
Normal file
46
lib.commonjs/crypto/sha2.d.ts
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
import type { BytesLike } from "../utils/index.js";
|
||||
/**
|
||||
* Compute the cryptographic SHA2-256 hash of %%data%%.
|
||||
*
|
||||
* @_docloc: api/crypto:Hash Functions
|
||||
* @returns DataHexstring
|
||||
*
|
||||
* @example:
|
||||
* sha256("0x")
|
||||
* //_result:
|
||||
*
|
||||
* sha256("0x1337")
|
||||
* //_result:
|
||||
*
|
||||
* sha256(new Uint8Array([ 0x13, 0x37 ]))
|
||||
* //_result:
|
||||
*
|
||||
*/
|
||||
export declare function sha256(_data: BytesLike): string;
|
||||
export declare namespace sha256 {
|
||||
var _: (data: Uint8Array) => Uint8Array;
|
||||
var lock: () => void;
|
||||
var register: (func: (data: Uint8Array) => BytesLike) => void;
|
||||
}
|
||||
/**
|
||||
* Compute the cryptographic SHA2-512 hash of %%data%%.
|
||||
*
|
||||
* @_docloc: api/crypto:Hash Functions
|
||||
* @returns DataHexstring
|
||||
*
|
||||
* @example:
|
||||
* sha512("0x")
|
||||
* //_result:
|
||||
*
|
||||
* sha512("0x1337")
|
||||
* //_result:
|
||||
*
|
||||
* sha512(new Uint8Array([ 0x13, 0x37 ]))
|
||||
* //_result:
|
||||
*/
|
||||
export declare function sha512(_data: BytesLike): string;
|
||||
export declare namespace sha512 {
|
||||
var _: (data: Uint8Array) => Uint8Array;
|
||||
var lock: () => void;
|
||||
var register: (func: (data: Uint8Array) => BytesLike) => void;
|
||||
}
|
157
lib.commonjs/crypto/signature.d.ts
vendored
Normal file
157
lib.commonjs/crypto/signature.d.ts
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
import type { BigNumberish, BytesLike } from "../utils/index.js";
|
||||
/**
|
||||
* A SignatureLike
|
||||
*
|
||||
* @_docloc: api/crypto:Signing
|
||||
*/
|
||||
export type SignatureLike = Signature | string | {
|
||||
r: string;
|
||||
s: string;
|
||||
v: BigNumberish;
|
||||
yParity?: 0 | 1;
|
||||
yParityAndS?: string;
|
||||
} | {
|
||||
r: string;
|
||||
yParityAndS: string;
|
||||
yParity?: 0 | 1;
|
||||
s?: string;
|
||||
v?: number;
|
||||
} | {
|
||||
r: string;
|
||||
s: string;
|
||||
yParity: 0 | 1;
|
||||
v?: BigNumberish;
|
||||
yParityAndS?: string;
|
||||
};
|
||||
/**
|
||||
* A Signature @TODO
|
||||
*
|
||||
*
|
||||
* @_docloc: api/crypto:Signing
|
||||
*/
|
||||
export declare class Signature {
|
||||
#private;
|
||||
/**
|
||||
* The ``r`` value for a signautre.
|
||||
*
|
||||
* This represents the ``x`` coordinate of a "reference" or
|
||||
* challenge point, from which the ``y`` can be computed.
|
||||
*/
|
||||
get r(): string;
|
||||
set r(value: BytesLike);
|
||||
/**
|
||||
* The ``s`` value for a signature.
|
||||
*/
|
||||
get s(): string;
|
||||
set s(_value: BytesLike);
|
||||
/**
|
||||
* The ``v`` value for a signature.
|
||||
*
|
||||
* Since a given ``x`` value for ``r`` has two possible values for
|
||||
* its correspondin ``y``, the ``v`` indicates which of the two ``y``
|
||||
* values to use.
|
||||
*
|
||||
* It is normalized to the values ``27`` or ``28`` for legacy
|
||||
* purposes.
|
||||
*/
|
||||
get v(): 27 | 28;
|
||||
set v(value: BigNumberish);
|
||||
/**
|
||||
* The EIP-155 ``v`` for legacy transactions. For non-legacy
|
||||
* transactions, this value is ``null``.
|
||||
*/
|
||||
get networkV(): null | bigint;
|
||||
/**
|
||||
* The chain ID for EIP-155 legacy transactions. For non-legacy
|
||||
* transactions, this value is ``null``.
|
||||
*/
|
||||
get legacyChainId(): null | bigint;
|
||||
/**
|
||||
* The ``yParity`` for the signature.
|
||||
*
|
||||
* See ``v`` for more details on how this value is used.
|
||||
*/
|
||||
get yParity(): 0 | 1;
|
||||
/**
|
||||
* The [[link-eip-2098]] compact representation of the ``yParity``
|
||||
* and ``s`` compacted into a single ``bytes32``.
|
||||
*/
|
||||
get yParityAndS(): string;
|
||||
/**
|
||||
* The [[link-eip-2098]] compact representation.
|
||||
*/
|
||||
get compactSerialized(): string;
|
||||
/**
|
||||
* The serialized representation.
|
||||
*/
|
||||
get serialized(): string;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
constructor(guard: any, r: string, s: string, v: 27 | 28);
|
||||
/**
|
||||
* Returns a new identical [[Signature]].
|
||||
*/
|
||||
clone(): Signature;
|
||||
/**
|
||||
* Returns a representation that is compatible with ``JSON.stringify``.
|
||||
*/
|
||||
toJSON(): any;
|
||||
/**
|
||||
* Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.
|
||||
*
|
||||
* @example:
|
||||
* Signature.getChainId(45)
|
||||
* //_result:
|
||||
*
|
||||
* Signature.getChainId(46)
|
||||
* //_result:
|
||||
*/
|
||||
static getChainId(v: BigNumberish): bigint;
|
||||
/**
|
||||
* Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.
|
||||
*
|
||||
* Legacy transactions which use [[link-eip-155]] hijack the ``v``
|
||||
* property to include the chain ID.
|
||||
*
|
||||
* @example:
|
||||
* Signature.getChainIdV(5, 27)
|
||||
* //_result:
|
||||
*
|
||||
* Signature.getChainIdV(5, 28)
|
||||
* //_result:
|
||||
*
|
||||
*/
|
||||
static getChainIdV(chainId: BigNumberish, v: 27 | 28): bigint;
|
||||
/**
|
||||
* Compute the normalized legacy transaction ``v`` from a ``yParirty``,
|
||||
* a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.
|
||||
*
|
||||
* @example:
|
||||
* // The values 0 and 1 imply v is actually yParity
|
||||
* Signature.getNormalizedV(0)
|
||||
* //_result:
|
||||
*
|
||||
* // Legacy non-EIP-1559 transaction (i.e. 27 or 28)
|
||||
* Signature.getNormalizedV(27)
|
||||
* //_result:
|
||||
*
|
||||
* // Legacy EIP-155 transaction (i.e. >= 35)
|
||||
* Signature.getNormalizedV(46)
|
||||
* //_result:
|
||||
*
|
||||
* // Invalid values throw
|
||||
* Signature.getNormalizedV(5)
|
||||
* //_error:
|
||||
*/
|
||||
static getNormalizedV(v: BigNumberish): 27 | 28;
|
||||
/**
|
||||
* Creates a new [[Signature]].
|
||||
*
|
||||
* If no %%sig%% is provided, a new [[Signature]] is created
|
||||
* with default values.
|
||||
*
|
||||
* If %%sig%% is a string, it is parsed.
|
||||
*/
|
||||
static from(sig?: SignatureLike): Signature;
|
||||
}
|
@ -246,7 +246,7 @@ class Signature {
|
||||
const v = Signature.getNormalizedV(bytes[64]);
|
||||
return new Signature(_guard, r, (0, index_js_2.hexlify)(s), v);
|
||||
}
|
||||
assertError(false, "invlaid raw signature length");
|
||||
assertError(false, "invalid raw signature length");
|
||||
}
|
||||
if (sig instanceof Signature) {
|
||||
return sig.clone();
|
||||
|
121
lib.commonjs/crypto/signing-key.d.ts
vendored
Normal file
121
lib.commonjs/crypto/signing-key.d.ts
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
/**
|
||||
* Add details about signing here.
|
||||
*
|
||||
* @_subsection: api/crypto:Signing [about-signing]
|
||||
*/
|
||||
import { Signature } from "./signature.js";
|
||||
import type { BytesLike } from "../utils/index.js";
|
||||
import type { SignatureLike } from "./index.js";
|
||||
/**
|
||||
* A **SigningKey** provides high-level access to the elliptic curve
|
||||
* cryptography (ECC) operations and key management.
|
||||
*/
|
||||
export declare class SigningKey {
|
||||
#private;
|
||||
/**
|
||||
* Creates a new **SigningKey** for %%privateKey%%.
|
||||
*/
|
||||
constructor(privateKey: BytesLike);
|
||||
/**
|
||||
* The private key.
|
||||
*/
|
||||
get privateKey(): string;
|
||||
/**
|
||||
* The uncompressed public key.
|
||||
*
|
||||
* This will always begin with the prefix ``0x04`` and be 132
|
||||
* characters long (the ``0x`` prefix and 130 hexadecimal nibbles).
|
||||
*/
|
||||
get publicKey(): string;
|
||||
/**
|
||||
* The compressed public key.
|
||||
*
|
||||
* This will always begin with either the prefix ``0x02`` or ``0x03``
|
||||
* and be 68 characters long (the ``0x`` prefix and 33 hexadecimal
|
||||
* nibbles)
|
||||
*/
|
||||
get compressedPublicKey(): string;
|
||||
/**
|
||||
* Return the signature of the signed %%digest%%.
|
||||
*/
|
||||
sign(digest: BytesLike): Signature;
|
||||
/**
|
||||
* Returns the [[link-wiki-ecdh]] shared secret between this
|
||||
* private key and the %%other%% key.
|
||||
*
|
||||
* The %%other%% key may be any type of key, a raw public key,
|
||||
* a compressed/uncompressed pubic key or aprivate key.
|
||||
*
|
||||
* Best practice is usually to use a cryptographic hash on the
|
||||
* returned value before using it as a symetric secret.
|
||||
*
|
||||
* @example:
|
||||
* sign1 = new SigningKey(id("some-secret-1"))
|
||||
* sign2 = new SigningKey(id("some-secret-2"))
|
||||
*
|
||||
* // Notice that privA.computeSharedSecret(pubB)...
|
||||
* sign1.computeSharedSecret(sign2.publicKey)
|
||||
* //_result:
|
||||
*
|
||||
* // ...is equal to privB.computeSharedSecret(pubA).
|
||||
* sign2.computeSharedSecret(sign1.publicKey)
|
||||
* //_result:
|
||||
*/
|
||||
computeSharedSecret(other: BytesLike): string;
|
||||
/**
|
||||
* Compute the public key for %%key%%, optionally %%compressed%%.
|
||||
*
|
||||
* The %%key%% may be any type of key, a raw public key, a
|
||||
* compressed/uncompressed public key or private key.
|
||||
*
|
||||
* @example:
|
||||
* sign = new SigningKey(id("some-secret"));
|
||||
*
|
||||
* // Compute the uncompressed public key for a private key
|
||||
* SigningKey.computePublicKey(sign.privateKey)
|
||||
* //_result:
|
||||
*
|
||||
* // Compute the compressed public key for a private key
|
||||
* SigningKey.computePublicKey(sign.privateKey, true)
|
||||
* //_result:
|
||||
*
|
||||
* // Compute the uncompressed public key
|
||||
* SigningKey.computePublicKey(sign.publicKey, false);
|
||||
* //_result:
|
||||
*
|
||||
* // Compute the Compressed a public key
|
||||
* SigningKey.computePublicKey(sign.publicKey, true);
|
||||
* //_result:
|
||||
*/
|
||||
static computePublicKey(key: BytesLike, compressed?: boolean): string;
|
||||
/**
|
||||
* Returns the public key for the private key which produced the
|
||||
* %%signature%% for the given %%digest%%.
|
||||
*
|
||||
* @example:
|
||||
* key = new SigningKey(id("some-secret"))
|
||||
* digest = id("hello world")
|
||||
* sig = key.sign(digest)
|
||||
*
|
||||
* // Notice the signer public key...
|
||||
* key.publicKey
|
||||
* //_result:
|
||||
*
|
||||
* // ...is equal to the recovered public key
|
||||
* SigningKey.recoverPublicKey(digest, sig)
|
||||
* //_result:
|
||||
*
|
||||
*/
|
||||
static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string;
|
||||
/**
|
||||
* Returns the point resulting from adding the ellipic curve points
|
||||
* %%p0%% and %%p1%%.
|
||||
*
|
||||
* This is not a common function most developers should require, but
|
||||
* can be useful for certain privacy-specific techniques.
|
||||
*
|
||||
* For example, it is used by [[HDNodeWallet]] to compute child
|
||||
* addresses from parent public keys and chain codes.
|
||||
*/
|
||||
static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string;
|
||||
}
|
21
lib.commonjs/ethers.d.ts
vendored
Normal file
21
lib.commonjs/ethers.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
export { version } from "./_version.js";
|
||||
export { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from "./abi/index.js";
|
||||
export { getAddress, getIcapAddress, getCreateAddress, getCreate2Address, isAddressable, isAddress, resolveAddress } from "./address/index.js";
|
||||
export { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, EtherSymbol, MessagePrefix } from "./constants/index.js";
|
||||
export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, } from "./contract/index.js";
|
||||
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js";
|
||||
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder } from "./hash/index.js";
|
||||
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js";
|
||||
export { accessListify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js";
|
||||
export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from "./utils/index.js";
|
||||
export { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPath, getAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js";
|
||||
export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists } from "./wordlists/index.js";
|
||||
export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, InterfaceAbi, ParamTypeWalkFunc, ParamTypeWalkAsyncFunc } from "./abi/index.js";
|
||||
export type { Addressable, AddressLike, NameResolver } from "./address/index.js";
|
||||
export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides } from "./contract/index.js";
|
||||
export type { ProgressCallback, SignatureLike } from "./crypto/index.js";
|
||||
export type { TypedDataDomain, TypedDataField } from "./hash/index.js";
|
||||
export type { Provider, Signer, AbstractProviderPlugin, BlockParams, BlockTag, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, EventFilter, Filter, FilterByBlockHash, GasCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike } from "./providers/index.js";
|
||||
export type { AccessList, AccessListish, AccessListEntry, TransactionLike } from "./transaction/index.js";
|
||||
export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedEthersError, CallExceptionAction, CallExceptionTransaction, EventEmitterable, Listener } from "./utils/index.js";
|
||||
export type { CrowdsaleAccount, KeystoreAccount, EncryptOptions } from "./wallet/index.js";
|
@ -2,10 +2,10 @@
|
||||
/////////////////////////////
|
||||
//
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.lock = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = exports.EventLog = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.MessagePrefix = exports.EtherSymbol = exports.ZeroHash = exports.N = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.ZeroAddress = exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = exports.Typed = exports.TransactionDescription = exports.Result = exports.LogDescription = exports.Interface = exports.Indexed = exports.checkResultErrors = exports.ParamType = exports.FunctionFragment = exports.Fragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.AbiCoder = exports.encodeBytes32String = exports.decodeBytes32String = exports.version = void 0;
|
||||
exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.Network = exports.EnsResolver = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraProvider = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.VoidSigner = exports.NonceManager = exports.AbstractSigner = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.getDefaultProvider = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = exports.SigningKey = exports.Signature = void 0;
|
||||
exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = exports.toNumber = exports.toBeHex = exports.toBigInt = exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = void 0;
|
||||
exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = void 0;
|
||||
exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = exports.EventLog = exports.ContractUnknownEventPayload = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.MessagePrefix = exports.EtherSymbol = exports.ZeroHash = exports.N = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.ZeroAddress = exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = exports.Typed = exports.TransactionDescription = exports.Result = exports.LogDescription = exports.Interface = exports.Indexed = exports.ErrorDescription = exports.checkResultErrors = exports.StructFragment = exports.ParamType = exports.NamedFragment = exports.FunctionFragment = exports.FallbackFragment = exports.Fragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.AbiCoder = exports.encodeBytes32String = exports.decodeBytes32String = exports.version = void 0;
|
||||
exports.GasCostPlugin = exports.FeeDataNetworkPlugin = exports.EtherscanPlugin = exports.EnsPlugin = exports.Network = exports.EnsResolver = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.VoidSigner = exports.NonceManager = exports.AbstractSigner = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.getDefaultProvider = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = exports.SigningKey = exports.Signature = exports.lock = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = void 0;
|
||||
exports.toQuantity = exports.toNumber = exports.toBeHex = exports.toBigInt = exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.resolveProperties = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.showThrottleMessage = exports.copyRequest = exports.UnmanagedSubscriber = exports.SocketSubscriber = exports.SocketPendingSubscriber = exports.SocketEventSubscriber = exports.SocketBlockSubscriber = exports.NetworkPlugin = void 0;
|
||||
exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.uuidV4 = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = void 0;
|
||||
var _version_js_1 = require("./_version.js");
|
||||
Object.defineProperty(exports, "version", { enumerable: true, get: function () { return _version_js_1.version; } });
|
||||
var index_js_1 = require("./abi/index.js");
|
||||
@ -16,9 +16,13 @@ Object.defineProperty(exports, "ConstructorFragment", { enumerable: true, get: f
|
||||
Object.defineProperty(exports, "ErrorFragment", { enumerable: true, get: function () { return index_js_1.ErrorFragment; } });
|
||||
Object.defineProperty(exports, "EventFragment", { enumerable: true, get: function () { return index_js_1.EventFragment; } });
|
||||
Object.defineProperty(exports, "Fragment", { enumerable: true, get: function () { return index_js_1.Fragment; } });
|
||||
Object.defineProperty(exports, "FallbackFragment", { enumerable: true, get: function () { return index_js_1.FallbackFragment; } });
|
||||
Object.defineProperty(exports, "FunctionFragment", { enumerable: true, get: function () { return index_js_1.FunctionFragment; } });
|
||||
Object.defineProperty(exports, "NamedFragment", { enumerable: true, get: function () { return index_js_1.NamedFragment; } });
|
||||
Object.defineProperty(exports, "ParamType", { enumerable: true, get: function () { return index_js_1.ParamType; } });
|
||||
Object.defineProperty(exports, "StructFragment", { enumerable: true, get: function () { return index_js_1.StructFragment; } });
|
||||
Object.defineProperty(exports, "checkResultErrors", { enumerable: true, get: function () { return index_js_1.checkResultErrors; } });
|
||||
Object.defineProperty(exports, "ErrorDescription", { enumerable: true, get: function () { return index_js_1.ErrorDescription; } });
|
||||
Object.defineProperty(exports, "Indexed", { enumerable: true, get: function () { return index_js_1.Indexed; } });
|
||||
Object.defineProperty(exports, "Interface", { enumerable: true, get: function () { return index_js_1.Interface; } });
|
||||
Object.defineProperty(exports, "LogDescription", { enumerable: true, get: function () { return index_js_1.LogDescription; } });
|
||||
@ -50,6 +54,7 @@ Object.defineProperty(exports, "ContractFactory", { enumerable: true, get: funct
|
||||
Object.defineProperty(exports, "ContractEventPayload", { enumerable: true, get: function () { return index_js_4.ContractEventPayload; } });
|
||||
Object.defineProperty(exports, "ContractTransactionReceipt", { enumerable: true, get: function () { return index_js_4.ContractTransactionReceipt; } });
|
||||
Object.defineProperty(exports, "ContractTransactionResponse", { enumerable: true, get: function () { return index_js_4.ContractTransactionResponse; } });
|
||||
Object.defineProperty(exports, "ContractUnknownEventPayload", { enumerable: true, get: function () { return index_js_4.ContractUnknownEventPayload; } });
|
||||
Object.defineProperty(exports, "EventLog", { enumerable: true, get: function () { return index_js_4.EventLog; } });
|
||||
var index_js_5 = require("./crypto/index.js");
|
||||
Object.defineProperty(exports, "computeHmac", { enumerable: true, get: function () { return index_js_5.computeHmac; } });
|
||||
@ -97,6 +102,7 @@ Object.defineProperty(exports, "AnkrProvider", { enumerable: true, get: function
|
||||
Object.defineProperty(exports, "CloudflareProvider", { enumerable: true, get: function () { return index_js_7.CloudflareProvider; } });
|
||||
Object.defineProperty(exports, "EtherscanProvider", { enumerable: true, get: function () { return index_js_7.EtherscanProvider; } });
|
||||
Object.defineProperty(exports, "InfuraProvider", { enumerable: true, get: function () { return index_js_7.InfuraProvider; } });
|
||||
Object.defineProperty(exports, "InfuraWebSocketProvider", { enumerable: true, get: function () { return index_js_7.InfuraWebSocketProvider; } });
|
||||
Object.defineProperty(exports, "PocketProvider", { enumerable: true, get: function () { return index_js_7.PocketProvider; } });
|
||||
Object.defineProperty(exports, "QuickNodeProvider", { enumerable: true, get: function () { return index_js_7.QuickNodeProvider; } });
|
||||
Object.defineProperty(exports, "IpcSocketProvider", { enumerable: true, get: function () { return index_js_7.IpcSocketProvider; } });
|
||||
@ -104,6 +110,18 @@ Object.defineProperty(exports, "SocketProvider", { enumerable: true, get: functi
|
||||
Object.defineProperty(exports, "WebSocketProvider", { enumerable: true, get: function () { return index_js_7.WebSocketProvider; } });
|
||||
Object.defineProperty(exports, "EnsResolver", { enumerable: true, get: function () { return index_js_7.EnsResolver; } });
|
||||
Object.defineProperty(exports, "Network", { enumerable: true, get: function () { return index_js_7.Network; } });
|
||||
Object.defineProperty(exports, "EnsPlugin", { enumerable: true, get: function () { return index_js_7.EnsPlugin; } });
|
||||
Object.defineProperty(exports, "EtherscanPlugin", { enumerable: true, get: function () { return index_js_7.EtherscanPlugin; } });
|
||||
Object.defineProperty(exports, "FeeDataNetworkPlugin", { enumerable: true, get: function () { return index_js_7.FeeDataNetworkPlugin; } });
|
||||
Object.defineProperty(exports, "GasCostPlugin", { enumerable: true, get: function () { return index_js_7.GasCostPlugin; } });
|
||||
Object.defineProperty(exports, "NetworkPlugin", { enumerable: true, get: function () { return index_js_7.NetworkPlugin; } });
|
||||
Object.defineProperty(exports, "SocketBlockSubscriber", { enumerable: true, get: function () { return index_js_7.SocketBlockSubscriber; } });
|
||||
Object.defineProperty(exports, "SocketEventSubscriber", { enumerable: true, get: function () { return index_js_7.SocketEventSubscriber; } });
|
||||
Object.defineProperty(exports, "SocketPendingSubscriber", { enumerable: true, get: function () { return index_js_7.SocketPendingSubscriber; } });
|
||||
Object.defineProperty(exports, "SocketSubscriber", { enumerable: true, get: function () { return index_js_7.SocketSubscriber; } });
|
||||
Object.defineProperty(exports, "UnmanagedSubscriber", { enumerable: true, get: function () { return index_js_7.UnmanagedSubscriber; } });
|
||||
Object.defineProperty(exports, "copyRequest", { enumerable: true, get: function () { return index_js_7.copyRequest; } });
|
||||
Object.defineProperty(exports, "showThrottleMessage", { enumerable: true, get: function () { return index_js_7.showThrottleMessage; } });
|
||||
var index_js_8 = require("./transaction/index.js");
|
||||
Object.defineProperty(exports, "accessListify", { enumerable: true, get: function () { return index_js_8.accessListify; } });
|
||||
Object.defineProperty(exports, "computeAddress", { enumerable: true, get: function () { return index_js_8.computeAddress; } });
|
||||
@ -126,6 +144,7 @@ Object.defineProperty(exports, "stripZerosLeft", { enumerable: true, get: functi
|
||||
Object.defineProperty(exports, "zeroPadBytes", { enumerable: true, get: function () { return index_js_9.zeroPadBytes; } });
|
||||
Object.defineProperty(exports, "zeroPadValue", { enumerable: true, get: function () { return index_js_9.zeroPadValue; } });
|
||||
Object.defineProperty(exports, "defineProperties", { enumerable: true, get: function () { return index_js_9.defineProperties; } });
|
||||
Object.defineProperty(exports, "resolveProperties", { enumerable: true, get: function () { return index_js_9.resolveProperties; } });
|
||||
Object.defineProperty(exports, "assert", { enumerable: true, get: function () { return index_js_9.assert; } });
|
||||
Object.defineProperty(exports, "assertArgument", { enumerable: true, get: function () { return index_js_9.assertArgument; } });
|
||||
Object.defineProperty(exports, "assertArgumentCount", { enumerable: true, get: function () { return index_js_9.assertArgumentCount; } });
|
||||
@ -134,6 +153,7 @@ Object.defineProperty(exports, "assertPrivate", { enumerable: true, get: functio
|
||||
Object.defineProperty(exports, "makeError", { enumerable: true, get: function () { return index_js_9.makeError; } });
|
||||
Object.defineProperty(exports, "isCallException", { enumerable: true, get: function () { return index_js_9.isCallException; } });
|
||||
Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return index_js_9.isError; } });
|
||||
Object.defineProperty(exports, "EventPayload", { enumerable: true, get: function () { return index_js_9.EventPayload; } });
|
||||
Object.defineProperty(exports, "FetchRequest", { enumerable: true, get: function () { return index_js_9.FetchRequest; } });
|
||||
Object.defineProperty(exports, "FetchResponse", { enumerable: true, get: function () { return index_js_9.FetchResponse; } });
|
||||
Object.defineProperty(exports, "FetchCancelSignal", { enumerable: true, get: function () { return index_js_9.FetchCancelSignal; } });
|
||||
@ -159,6 +179,7 @@ Object.defineProperty(exports, "toUtf8String", { enumerable: true, get: function
|
||||
Object.defineProperty(exports, "Utf8ErrorFuncs", { enumerable: true, get: function () { return index_js_9.Utf8ErrorFuncs; } });
|
||||
Object.defineProperty(exports, "decodeRlp", { enumerable: true, get: function () { return index_js_9.decodeRlp; } });
|
||||
Object.defineProperty(exports, "encodeRlp", { enumerable: true, get: function () { return index_js_9.encodeRlp; } });
|
||||
Object.defineProperty(exports, "uuidV4", { enumerable: true, get: function () { return index_js_9.uuidV4; } });
|
||||
var index_js_10 = require("./wallet/index.js");
|
||||
Object.defineProperty(exports, "Mnemonic", { enumerable: true, get: function () { return index_js_10.Mnemonic; } });
|
||||
Object.defineProperty(exports, "BaseWallet", { enumerable: true, get: function () { return index_js_10.BaseWallet; } });
|
||||
@ -179,4 +200,5 @@ Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function ()
|
||||
Object.defineProperty(exports, "LangEn", { enumerable: true, get: function () { return index_js_11.LangEn; } });
|
||||
Object.defineProperty(exports, "WordlistOwl", { enumerable: true, get: function () { return index_js_11.WordlistOwl; } });
|
||||
Object.defineProperty(exports, "WordlistOwlA", { enumerable: true, get: function () { return index_js_11.WordlistOwlA; } });
|
||||
Object.defineProperty(exports, "wordlists", { enumerable: true, get: function () { return index_js_11.wordlists; } });
|
||||
//# sourceMappingURL=ethers.js.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"ethers.js","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":"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"}
|
||||
{"version":3,"file":"ethers.js","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":"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"}
|
12
lib.commonjs/hash/id.d.ts
vendored
Normal file
12
lib.commonjs/hash/id.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
/**
|
||||
* A simple hashing function which operates on UTF-8 strings to
|
||||
* compute an 32-byte irentifier.
|
||||
*
|
||||
* This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes
|
||||
* the [[keccak256]].
|
||||
*
|
||||
* @example:
|
||||
* id("hello world")
|
||||
* //_result:
|
||||
*/
|
||||
export declare function id(value: string): string;
|
11
lib.commonjs/hash/index.d.ts
vendored
Normal file
11
lib.commonjs/hash/index.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* About hashing here...
|
||||
*
|
||||
* @_section: api/hashing:Hashing Utilities [about-hashing]
|
||||
*/
|
||||
export { id } from "./id.js";
|
||||
export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js";
|
||||
export { hashMessage, verifyMessage } from "./message.js";
|
||||
export { solidityPacked, solidityPackedKeccak256, solidityPackedSha256 } from "./solidity.js";
|
||||
export { TypedDataEncoder } from "./typed-data.js";
|
||||
export type { TypedDataDomain, TypedDataField } from "./typed-data.js";
|
31
lib.commonjs/hash/message.d.ts
vendored
Normal file
31
lib.commonjs/hash/message.d.ts
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
import type { SignatureLike } from "../crypto/index.js";
|
||||
/**
|
||||
* Computes the [[link-eip-191]] personal-sign message digest to sign.
|
||||
*
|
||||
* This prefixes the message with [[MessagePrefix]] and the decimal length
|
||||
* of %%message%% and computes the [[keccak256]] digest.
|
||||
*
|
||||
* If %%message%% is a string, it is converted to its UTF-8 bytes
|
||||
* first. To compute the digest of a [[DataHexString]], it must be converted
|
||||
* to [bytes](getBytes).
|
||||
*
|
||||
* @example:
|
||||
* hashMessage("Hello World")
|
||||
* //_result:
|
||||
*
|
||||
* // Hashes the SIX (6) string characters, i.e.
|
||||
* // [ "0", "x", "4", "2", "4", "3" ]
|
||||
* hashMessage("0x4243")
|
||||
* //_result:
|
||||
*
|
||||
* // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...
|
||||
* hashMessage(getBytes("0x4243"))
|
||||
* //_result:
|
||||
*
|
||||
* // ...which is equal to using data
|
||||
* hashMessage(new Uint8Array([ 0x42, 0x43 ]))
|
||||
* //_result:
|
||||
*
|
||||
*/
|
||||
export declare function hashMessage(message: Uint8Array | string): string;
|
||||
export declare function verifyMessage(message: Uint8Array | string, sig: SignatureLike): string;
|
19
lib.commonjs/hash/namehash.d.ts
vendored
Normal file
19
lib.commonjs/hash/namehash.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Returns the ENS %%name%% normalized.
|
||||
*/
|
||||
export declare function ensNormalize(name: string): string;
|
||||
/**
|
||||
* Returns ``true`` if %%name%% is a valid ENS name.
|
||||
*/
|
||||
export declare function isValidName(name: string): name is string;
|
||||
/**
|
||||
* Returns the [[link-namehash]] for %%name%%.
|
||||
*/
|
||||
export declare function namehash(name: string): string;
|
||||
/**
|
||||
* Returns the DNS encoded %%name%%.
|
||||
*
|
||||
* This is used for various parts of ENS name resolution, such
|
||||
* as the wildcard resolution.
|
||||
*/
|
||||
export declare function dnsEncode(name: string): string;
|
30
lib.commonjs/hash/solidity.d.ts
vendored
Normal file
30
lib.commonjs/hash/solidity.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Computes the [[link-solc-packed]] representation of %%values%%
|
||||
* respectively to their %%types%%.
|
||||
*
|
||||
* @example:
|
||||
* addr = "0x8ba1f109551bd432803012645ac136ddd64dba72"
|
||||
* solidityPacked([ "address", "uint" ], [ addr, 45 ]);
|
||||
* //_result:
|
||||
*/
|
||||
export declare function solidityPacked(types: ReadonlyArray<string>, values: ReadonlyArray<any>): string;
|
||||
/**
|
||||
* Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%%
|
||||
* respectively to their %%types%%.
|
||||
*
|
||||
* @example:
|
||||
* addr = "0x8ba1f109551bd432803012645ac136ddd64dba72"
|
||||
* solidityPackedKeccak256([ "address", "uint" ], [ addr, 45 ]);
|
||||
* //_result:
|
||||
*/
|
||||
export declare function solidityPackedKeccak256(types: ReadonlyArray<string>, values: ReadonlyArray<any>): string;
|
||||
/**
|
||||
* Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%
|
||||
* respectively to their %%types%%.
|
||||
*
|
||||
* @example:
|
||||
* addr = "0x8ba1f109551bd432803012645ac136ddd64dba72"
|
||||
* solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]);
|
||||
* //_result:
|
||||
*/
|
||||
export declare function solidityPackedSha256(types: ReadonlyArray<string>, values: ReadonlyArray<any>): string;
|
37
lib.commonjs/hash/typed-data.d.ts
vendored
Normal file
37
lib.commonjs/hash/typed-data.d.ts
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
import type { BigNumberish, BytesLike } from "../utils/index.js";
|
||||
export interface TypedDataDomain {
|
||||
name?: null | string;
|
||||
version?: null | string;
|
||||
chainId?: null | BigNumberish;
|
||||
verifyingContract?: null | string;
|
||||
salt?: null | BytesLike;
|
||||
}
|
||||
export interface TypedDataField {
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
export declare class TypedDataEncoder {
|
||||
#private;
|
||||
readonly primaryType: string;
|
||||
get types(): Record<string, Array<TypedDataField>>;
|
||||
constructor(types: Record<string, Array<TypedDataField>>);
|
||||
getEncoder(type: string): (value: any) => string;
|
||||
encodeType(name: string): string;
|
||||
encodeData(type: string, value: any): string;
|
||||
hashStruct(name: string, value: Record<string, any>): string;
|
||||
encode(value: Record<string, any>): string;
|
||||
hash(value: Record<string, any>): string;
|
||||
_visit(type: string, value: any, callback: (type: string, data: any) => any): any;
|
||||
visit(value: Record<string, any>, callback: (type: string, data: any) => any): any;
|
||||
static from(types: Record<string, Array<TypedDataField>>): TypedDataEncoder;
|
||||
static getPrimaryType(types: Record<string, Array<TypedDataField>>): string;
|
||||
static hashStruct(name: string, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): string;
|
||||
static hashDomain(domain: TypedDataDomain): string;
|
||||
static encode(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): string;
|
||||
static hash(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): string;
|
||||
static resolveNames(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>, resolveName: (name: string) => Promise<string>): Promise<{
|
||||
domain: TypedDataDomain;
|
||||
value: any;
|
||||
}>;
|
||||
static getPayload(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): any;
|
||||
}
|
@ -285,6 +285,9 @@ class TypedDataEncoder {
|
||||
static hashDomain(domain) {
|
||||
const domainFields = [];
|
||||
for (const name in domain) {
|
||||
if (domain[name] == null) {
|
||||
continue;
|
||||
}
|
||||
const type = domainFieldTypes[name];
|
||||
(0, index_js_3.assertArgument)(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain);
|
||||
domainFields.push({ name, type });
|
||||
@ -308,6 +311,12 @@ class TypedDataEncoder {
|
||||
static async resolveNames(domain, types, value, resolveName) {
|
||||
// Make a copy to isolate it from the object passed in
|
||||
domain = Object.assign({}, domain);
|
||||
// Allow passing null to ignore value
|
||||
for (const key in domain) {
|
||||
if (domain[key] == null) {
|
||||
delete domain[key];
|
||||
}
|
||||
}
|
||||
// Look up all ENS names
|
||||
const ensCache = {};
|
||||
// Do we need to look up the domain's verifyingContract?
|
||||
|
File diff suppressed because one or more lines are too long
10
lib.commonjs/index.d.ts
vendored
Normal file
10
lib.commonjs/index.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/**
|
||||
* The Application Programming Interface (API) is the collection of
|
||||
* functions, classes and types offered by the Ethers library.
|
||||
*
|
||||
* @_section: api:Application Programming Interface [about-api]
|
||||
* @_navTitle: API
|
||||
*/
|
||||
import * as ethers from "./ethers.js";
|
||||
export { ethers };
|
||||
export * from "./ethers.js";
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user