admin: updated dist files

This commit is contained in:
Richard Moore 2023-02-12 22:14:26 -05:00
parent 6372a46b1b
commit 9b508a4656
140 changed files with 512 additions and 409 deletions

177
dist/ethers.js vendored
View File

@ -1,4 +1,4 @@
const version = "6.0.2"; const version = "6.0.3";
/** /**
* Property helper functions. * Property helper functions.
@ -411,7 +411,7 @@ function zeroPad(data, length, left) {
* Return the [[DataHexString]] of %%data%% padded on the **left** * Return the [[DataHexString]] of %%data%% padded on the **left**
* to %%length%% bytes. * to %%length%% bytes.
* *
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is
* thrown. * thrown.
* *
* This pads data the same as **values** are in Solidity * This pads data the same as **values** are in Solidity
@ -424,7 +424,7 @@ function zeroPadValue(data, length) {
* Return the [[DataHexString]] of %%data%% padded on the **right** * Return the [[DataHexString]] of %%data%% padded on the **right**
* to %%length%% bytes. * to %%length%% bytes.
* *
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is
* thrown. * thrown.
* *
* This pads data the same as **bytes** are in Solidity * This pads data the same as **bytes** are in Solidity
@ -497,7 +497,7 @@ function mask(_value, _bits) {
return value & ((BN_1$5 << bits) - BN_1$5); return value & ((BN_1$5 << bits) - BN_1$5);
} }
/** /**
* Gets a [[BigInt]] from %%value%%. If it is an invalid value for * Gets a BigInt from %%value%%. If it is an invalid value for
* a BigInt, then an ArgumentError will be thrown for %%name%%. * a BigInt, then an ArgumentError will be thrown for %%name%%.
*/ */
function getBigInt(value, name) { function getBigInt(value, name) {
@ -795,7 +795,21 @@ function replaceFunc(reason, offset, bytes, output, badCodepoint) {
// Otherwise, process as if ignoring errors // Otherwise, process as if ignoring errors
return ignoreFunc(reason, offset, bytes, output, badCodepoint); return ignoreFunc(reason, offset, bytes, output, badCodepoint);
} }
// Common error handing strategies /**
* A handful of popular, built-in UTF-8 error handling strategies.
*
* **``"error"``** - throws on ANY illegal UTF-8 sequence or
* non-canonical (overlong) codepoints (this is the default)
*
* **``"ignore"``** - silently drops any illegal UTF-8 sequence
* and accepts non-canonical (overlong) codepoints
*
* **``"replace"``** - replace any illegal UTF-8 sequence with the
* UTF-8 replacement character (i.e. `\ufffd`) and accepts
* non-canonical (overlong) codepoints
*
* @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc>
*/
const Utf8ErrorFuncs = Object.freeze({ const Utf8ErrorFuncs = Object.freeze({
error: errorFunc, error: errorFunc,
ignore: ignoreFunc, ignore: ignoreFunc,
@ -942,7 +956,7 @@ function _toUtf8String(codePoints) {
* *
* When %%onError%% function is specified, it is called on UTF-8 * When %%onError%% function is specified, it is called on UTF-8
* errors allowing recovery using the [[Utf8ErrorFunc]] API. * errors allowing recovery using the [[Utf8ErrorFunc]] API.
* (default: [error](Utf8ErrorFuncs-error)) * (default: [error](Utf8ErrorFuncs))
*/ */
function toUtf8String(bytes, onError) { function toUtf8String(bytes, onError) {
return _toUtf8String(getUtf8CodePoints(bytes, onError)); return _toUtf8String(getUtf8CodePoints(bytes, onError));
@ -2462,7 +2476,7 @@ function formatUnits(value, unit) {
return FixedNumber.fromValue(value, decimals, { decimals }).toString(); return FixedNumber.fromValue(value, decimals, { decimals }).toString();
} }
/** /**
* Converts the //decimal string// %%value%% to a [[BigInt]], assuming * Converts the //decimal string// %%value%% to a BigInt, assuming
* %%unit%% decimal places. The %%unit%% may the number of decimal places * %%unit%% decimal places. The %%unit%% may the number of decimal places
* or the name of a unit (e.g. ``"gwei"`` for 9 decimal places). * or the name of a unit (e.g. ``"gwei"`` for 9 decimal places).
*/ */
@ -2486,7 +2500,7 @@ function formatEther(wei) {
return formatUnits(wei, 18); return formatUnits(wei, 18);
} }
/** /**
* Converts the //decimal string// %%ether%% to a [[BigInt]], using 18 * Converts the //decimal string// %%ether%% to a BigInt, using 18
* decimal places. * decimal places.
*/ */
function parseEther(ether) { function parseEther(ether) {
@ -2527,7 +2541,7 @@ function uuidV4(randomBytes) {
* Ethereum and to simplify the library, without increasing * Ethereum and to simplify the library, without increasing
* the library dependencies for simple functions. * the library dependencies for simple functions.
* *
* @_section api/utils:Utilities [utils] * @_section api/utils:Utilities [about-utils]
*/ */
/** /**
@ -5932,7 +5946,7 @@ const MessagePrefix = "\x19Ethereum Signed Message:\n";
/** /**
* Some common constants useful for Ethereum. * Some common constants useful for Ethereum.
* *
* @_section: api/constants: Constants [constants] * @_section: api/constants: Constants [about-constants]
*/ */
// Constants // Constants
@ -5948,6 +5962,9 @@ function toUint256(value) {
} }
/** /**
* A Signature @TODO * A Signature @TODO
*
*
* @_docloc: api/crypto:Signing
*/ */
class Signature { class Signature {
#r; #r;
@ -6231,6 +6248,11 @@ class Signature {
} }
} }
/**
* Add details about signing here.
*
* @_subsection: api/crypto:Signing [about-signing]
*/
//const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); //const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
// Make noble-secp256k1 sync // Make noble-secp256k1 sync
utils.hmacSha256Sync = function (key, ...messages) { utils.hmacSha256Sync = function (key, ...messages) {
@ -6402,7 +6424,7 @@ class SigningKey {
* A fundamental building block of Ethereum is the underlying * A fundamental building block of Ethereum is the underlying
* cryptographic primitives. * cryptographic primitives.
* *
* @_section: api/crypto:Cryptographic Functions [crypto] * @_section: api/crypto:Cryptographic Functions [about-crypto]
*/ */
null; null;
function lock() { function lock() {
@ -6762,7 +6784,7 @@ function resolveAddress(target, resolver) {
* These functions help convert between various formats, validate * These functions help convert between various formats, validate
* addresses and safely resolve ENS names. * addresses and safely resolve ENS names.
* *
* @_section: api/address:Addresses [addresses] * @_section: api/address:Addresses [about-addresses]
*/ */
null; null;
@ -9218,7 +9240,7 @@ class Transaction {
/** /**
* Transactions.. * Transactions..
* *
* @_section api/transaction:Transactions [transactions] * @_section api/transaction:Transactions [about-transactions]
*/ */
null; null;
@ -9751,13 +9773,13 @@ class TypedDataEncoder {
/** /**
* About hashing here... * About hashing here...
* *
* @_section: api/hashing:Hashing Utilities [hashing] * @_section: api/hashing:Hashing Utilities [about-hashing]
*/ */
/** /**
* About frgaments... * About frgaments...
* *
* @_subsection api/abi/abi-coder:Fragments * @_subsection api/abi/abi-coder:Fragments [about-fragments]
*/ */
; ;
// [ "a", "b" ] => { "a": 1, "b": 1 } // [ "a", "b" ] => { "a": 1, "b": 1 }
@ -10109,26 +10131,25 @@ class ParamType {
/** /**
* True if the parameters is indexed. * True if the parameters is indexed.
* *
* For non-indexable types (see [[ParamType_isIndexable]]) this * For non-indexable types this is ``null``.
* is ``null``.
*/ */
indexed; indexed;
/** /**
* The components for the tuple. * The components for the tuple.
* *
* For non-tuple types (see [[ParamType_isTuple]]) this is ``null``. * For non-tuple types this is ``null``.
*/ */
components; components;
/** /**
* The array length, or ``-1`` for dynamic-lengthed arrays. * The array length, or ``-1`` for dynamic-lengthed arrays.
* *
* For non-array types (see [[ParamType_isArray]]) this is ``null``. * For non-array types this is ``null``.
*/ */
arrayLength; arrayLength;
/** /**
* The type of each child in the array. * The type of each child in the array.
* *
* For non-array types (see [[ParamType_isArray]]) this is ``null``. * For non-array types this is ``null``.
*/ */
arrayChildren; arrayChildren;
/** /**
@ -11117,7 +11138,7 @@ class AbiCoder {
return defaultCoder; return defaultCoder;
} }
/** /**
* Returns an ethers-compatible [[CALL_EXCEPTION]] Error for the given * Returns an ethers-compatible [[CallExceptionError]] Error for the given
* result %%data%% for the [[CallExceptionAction]] %%action%% against * result %%data%% for the [[CallExceptionAction]] %%action%% against
* the Transaction %%tx%%. * the Transaction %%tx%%.
*/ */
@ -11721,7 +11742,7 @@ getSelector(fragment: ErrorFragment | FunctionFragment): string {
* specified error (see [[getError]] for valid values for * specified error (see [[getError]] for valid values for
* %%key%%). * %%key%%).
* *
* Most developers should prefer the [[parseResult]] method instead, * Most developers should prefer the [[parseCallResult]] method instead,
* which will automatically detect a ``CALL_EXCEPTION`` and throw the * which will automatically detect a ``CALL_EXCEPTION`` and throw the
* corresponding error. * corresponding error.
*/ */
@ -11791,7 +11812,7 @@ getSelector(fragment: ErrorFragment | FunctionFragment): string {
* specified function (see [[getFunction]] for valid values for * specified function (see [[getFunction]] for valid values for
* %%key%%). * %%key%%).
* *
* Most developers should prefer the [[parseResult]] method instead, * Most developers should prefer the [[parseCallResult]] method instead,
* which will automatically detect a ``CALL_EXCEPTION`` and throw the * which will automatically detect a ``CALL_EXCEPTION`` and throw the
* corresponding error. * corresponding error.
*/ */
@ -12140,7 +12161,7 @@ getSelector(fragment: ErrorFragment | FunctionFragment): string {
/** /**
* Explain about ABI here... * Explain about ABI here...
* *
* @_section api/abi:Application Binary Interface [abi] * @_section api/abi:Application Binary Interface [about-abi]
* @_navTitle: ABI * @_navTitle: ABI
*/ */
@ -13489,7 +13510,7 @@ async function _emit(contract, event, args, payloadFunc) {
} }
const count = sub.listeners.length; const count = sub.listeners.length;
sub.listeners = sub.listeners.filter(({ listener, once }) => { sub.listeners = sub.listeners.filter(({ listener, once }) => {
const passArgs = args.slice(); const passArgs = Array.from(args);
if (payloadFunc) { if (payloadFunc) {
passArgs.push(payloadFunc(once ? null : listener)); passArgs.push(payloadFunc(once ? null : listener));
} }
@ -13875,7 +13896,7 @@ class ContractFactory {
/** /**
* About contracts... * About contracts...
* *
* @_section: api/contract:Contracts [contracts] * @_section: api/contract:Contracts [about-contracts]
*/ */
/** /**
@ -14486,7 +14507,7 @@ const _formatTransactionReceipt = object({
cumulativeGasUsed: getBigInt, cumulativeGasUsed: getBigInt,
effectiveGasPrice: allowNull(getBigInt), effectiveGasPrice: allowNull(getBigInt),
status: allowNull(getNumber), status: allowNull(getNumber),
type: getNumber type: allowNull(getNumber, 0)
}, { }, {
effectiveGasPrice: ["gasPrice"], effectiveGasPrice: ["gasPrice"],
hash: ["transactionHash"], hash: ["transactionHash"],
@ -16619,11 +16640,24 @@ class FilterIdSubscriber {
} }
async #poll(blockNumber) { async #poll(blockNumber) {
try { try {
// Subscribe if necessary
if (this.#filterIdPromise == null) { if (this.#filterIdPromise == null) {
this.#filterIdPromise = this._subscribe(this.#provider); this.#filterIdPromise = this._subscribe(this.#provider);
} }
const filterId = await this.#filterIdPromise; // Get the Filter ID
let filterId = null;
try {
filterId = await this.#filterIdPromise;
}
catch (error) {
if (!isError(error, "UNSUPPORTED_OPERATION") || error.operation !== "eth_newFilter") {
throw error;
}
}
// The backend does not support Filter ID; downgrade to
// polling
if (filterId == null) { if (filterId == null) {
this.#filterIdPromise = null;
this.#provider._recoverSubscriber(this, this._recover(this.#provider)); this.#provider._recoverSubscriber(this, this._recover(this.#provider));
return; return;
} }
@ -17127,6 +17161,9 @@ class JsonRpcApiProvider extends AbstractProvider {
return new FilterIdPendingSubscriber(this); return new FilterIdPendingSubscriber(this);
} }
if (sub.type === "event") { if (sub.type === "event") {
if (this._getOption("polling")) {
return new PollingEventSubscriber(this, sub.filter);
}
return new FilterIdEventSubscriber(this, sub.filter); return new FilterIdEventSubscriber(this, sub.filter);
} }
// Orphaned Logs are handled automatically, by the filter, since // Orphaned Logs are handled automatically, by the filter, since
@ -17282,74 +17319,6 @@ class JsonRpcApiProvider extends AbstractProvider {
const e = AbiCoder.getBuiltinCallException((method === "eth_call") ? "call" : "estimateGas", (payload.params[0]), (result ? result.data : null)); const e = AbiCoder.getBuiltinCallException((method === "eth_call") ? "call" : "estimateGas", (payload.params[0]), (result ? result.data : null));
e.info = { error, payload }; e.info = { error, payload };
return e; return e;
/*
let message = "missing revert data during JSON-RPC call";
const action = <"call" | "estimateGas" | "unknown">(({ eth_call: "call", eth_estimateGas: "estimateGas" })[method] || "unknown");
let data: null | string = null;
let reason: null | string = null;
const transaction = <{ from: string, to: string, data: string }>((<any>payload).params[0]);
const invocation = null;
let revert: null | { signature: string, name: string, args: Array<any> } = null;
if (result) {
// @TODO: Extract errorSignature, errorName, errorArgs, reason if
// it is Error(string) or Panic(uint25)
message = "execution reverted during JSON-RPC call";
data = result.data;
let bytes = getBytes(data);
if (bytes.length % 32 !== 4) {
message += " (could not parse reason; invalid data length)";
} else if (data.substring(0, 10) === "0x08c379a0") {
// Error(string)
try {
if (bytes.length < 68) { throw new Error("bad length"); }
bytes = bytes.slice(4);
const pointer = getNumber(hexlify(bytes.slice(0, 32)));
bytes = bytes.slice(pointer);
if (bytes.length < 32) { throw new Error("overrun"); }
const length = getNumber(hexlify(bytes.slice(0, 32)));
bytes = bytes.slice(32);
if (bytes.length < length) { throw new Error("overrun"); }
reason = toUtf8String(bytes.slice(0, length));
revert = {
signature: "Error(string)",
name: "Error",
args: [ reason ]
};
message += `: ${ JSON.stringify(reason) }`;
} catch (error) {
console.log(error);
message += " (could not parse reason; invalid data length)";
}
} else if (data.substring(0, 10) === "0x4e487b71") {
// Panic(uint256)
try {
if (bytes.length !== 36) { throw new Error("bad length"); }
const arg = getNumber(hexlify(bytes.slice(4)));
revert = {
signature: "Panic(uint256)",
name: "Panic",
args: [ arg ]
};
reason = `Panic due to ${ PanicReasons.get(Number(arg)) || "UNKNOWN" }(${ arg })`;
message += `: ${ reason }`;
} catch (error) {
console.log(error);
message += " (could not parse panic reason)";
}
}
}
return makeError(message, "CALL_EXCEPTION", {
action, data, reason, transaction, invocation, revert,
info: { payload, error }
});
*/
} }
// Only estimateGas and call can return arbitrary contract-defined text, so now we // Only estimateGas and call can return arbitrary contract-defined text, so now we
// we can process text safely. // we can process text safely.
@ -17374,7 +17343,7 @@ class JsonRpcApiProvider extends AbstractProvider {
const transaction = (payload.params[0]); const transaction = (payload.params[0]);
if (message.match(/insufficient funds|base fee exceeds gas limit/i)) { if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {
return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", {
transaction transaction, info: { error }
}); });
} }
if (message.match(/nonce/i) && message.match(/too low/i)) { if (message.match(/nonce/i) && message.match(/too low/i)) {
@ -17392,7 +17361,7 @@ class JsonRpcApiProvider extends AbstractProvider {
} }
if (message.match(/the method .* does not exist/i)) { if (message.match(/the method .* does not exist/i)) {
return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { return makeError("unsupported operation", "UNSUPPORTED_OPERATION", {
operation: payload.method operation: payload.method, info: { error }
}); });
} }
return makeError("could not coalesce error", "UNKNOWN_ERROR", { error }); return makeError("could not coalesce error", "UNKNOWN_ERROR", { error });
@ -19740,7 +19709,7 @@ const IpcSocketProvider = undefined;
/** /**
* About providers. * About providers.
* *
* @_section: api/providers:Providers [providers] * @_section: api/providers:Providers [about-providers]
*/ */
/** /**
@ -19895,7 +19864,7 @@ function decodeOwl(data) {
/** /**
* A Wordlist represents a collection of language-specific * A Wordlist represents a collection of language-specific
* words used to encode and devoce [[BIP-39]] encoded data * words used to encode and devoce [[link-bip-39]] encoded data
* by mapping words to 11-bit values and vice versa. * by mapping words to 11-bit values and vice versa.
*/ */
class Wordlist { class Wordlist {
@ -20086,7 +20055,7 @@ function entropyToMnemonic(entropy, wordlist) {
} }
const _guard$1 = {}; const _guard$1 = {};
/** /**
* A **Mnemonic** wraps all properties required to compute [[link-bip39]] * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]
* seeds and convert between phrases and entropy. * seeds and convert between phrases and entropy.
*/ */
class Mnemonic { class Mnemonic {
@ -20166,7 +20135,7 @@ class Mnemonic {
return mnemonicToEntropy(phrase, wordlist); return mnemonicToEntropy(phrase, wordlist);
} }
/** /**
* Returns true if %%phrase%% is a valid [[link-bip39]] phrase. * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.
* *
* This checks all the provided words belong to the %%wordlist%%, * This checks all the provided words belong to the %%wordlist%%,
* that the length is valid and the checksum is correct. * that the length is valid and the checksum is correct.
@ -21828,7 +21797,7 @@ class Wallet extends BaseWallet {
* low-level details of how an HD wallets are derived, exported * low-level details of how an HD wallets are derived, exported
* or imported. * or imported.
* *
* @_section: api/wallet:Wallets [wallets] * @_section: api/wallet:Wallets [about-wallets]
*/ */
const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";
@ -21933,7 +21902,7 @@ const wordlists = {
* languages, but for maximal compatibility, the * languages, but for maximal compatibility, the
* [English Wordlist](LangEn) is recommended. * [English Wordlist](LangEn) is recommended.
* *
* @_section: api/wordlists:Wordlists [wordlists] * @_section: api/wordlists:Wordlists [about-wordlists]
*/ */
///////////////////////////// /////////////////////////////

2
dist/ethers.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/ethers.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -145,7 +145,7 @@ const u64 = {
add, add3L, add3H, add4L, add4H, add5H, add5L, add, add3L, add3H, add4L, add4H, add5H, add5L,
}; };
const version = "6.0.2"; const version = "6.0.3";
/** /**
* Property helper functions. * Property helper functions.
@ -426,7 +426,21 @@ function replaceFunc(reason, offset, bytes, output, badCodepoint) {
// Otherwise, process as if ignoring errors // Otherwise, process as if ignoring errors
return ignoreFunc(reason, offset, bytes); return ignoreFunc(reason, offset, bytes);
} }
// Common error handing strategies /**
* A handful of popular, built-in UTF-8 error handling strategies.
*
* **``"error"``** - throws on ANY illegal UTF-8 sequence or
* non-canonical (overlong) codepoints (this is the default)
*
* **``"ignore"``** - silently drops any illegal UTF-8 sequence
* and accepts non-canonical (overlong) codepoints
*
* **``"replace"``** - replace any illegal UTF-8 sequence with the
* UTF-8 replacement character (i.e. `\ufffd`) and accepts
* non-canonical (overlong) codepoints
*
* @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc>
*/
const Utf8ErrorFuncs = Object.freeze({ const Utf8ErrorFuncs = Object.freeze({
error: errorFunc, error: errorFunc,
ignore: ignoreFunc, ignore: ignoreFunc,
@ -571,7 +585,7 @@ function _toUtf8String(codePoints) {
* *
* When %%onError%% function is specified, it is called on UTF-8 * When %%onError%% function is specified, it is called on UTF-8
* errors allowing recovery using the [[Utf8ErrorFunc]] API. * errors allowing recovery using the [[Utf8ErrorFunc]] API.
* (default: [error](Utf8ErrorFuncs-error)) * (default: [error](Utf8ErrorFuncs))
*/ */
function toUtf8String(bytes, onError) { function toUtf8String(bytes, onError) {
return _toUtf8String(getUtf8CodePoints(bytes, onError)); return _toUtf8String(getUtf8CodePoints(bytes, onError));
@ -897,7 +911,7 @@ function decodeOwl(data) {
/** /**
* A Wordlist represents a collection of language-specific * A Wordlist represents a collection of language-specific
* words used to encode and devoce [[BIP-39]] encoded data * words used to encode and devoce [[link-bip-39]] encoded data
* by mapping words to 11-bit values and vice versa. * by mapping words to 11-bit values and vice versa.
*/ */
class Wordlist { class Wordlist {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0; exports.version = void 0;
exports.version = "6.0.2"; exports.version = "6.0.3";
//# sourceMappingURL=_version.js.map //# sourceMappingURL=_version.js.map

View File

@ -46,7 +46,7 @@ export declare class AbiCoder {
*/ */
static defaultAbiCoder(): AbiCoder; static defaultAbiCoder(): AbiCoder;
/** /**
* Returns an ethers-compatible [[CALL_EXCEPTION]] Error for the given * Returns an ethers-compatible [[CallExceptionError]] Error for the given
* result %%data%% for the [[CallExceptionAction]] %%action%% against * result %%data%% for the [[CallExceptionAction]] %%action%% against
* the Transaction %%tx%%. * the Transaction %%tx%%.
*/ */

View File

@ -190,7 +190,7 @@ class AbiCoder {
return defaultCoder; return defaultCoder;
} }
/** /**
* Returns an ethers-compatible [[CALL_EXCEPTION]] Error for the given * Returns an ethers-compatible [[CallExceptionError]] Error for the given
* result %%data%% for the [[CallExceptionAction]] %%action%% against * result %%data%% for the [[CallExceptionAction]] %%action%% against
* the Transaction %%tx%%. * the Transaction %%tx%%.
*/ */

View File

@ -1,7 +1,7 @@
/** /**
* About frgaments... * About frgaments...
* *
* @_subsection api/abi/abi-coder:Fragments * @_subsection api/abi/abi-coder:Fragments [about-fragments]
*/ */
/** /**
* A type description in a JSON API. * A type description in a JSON API.
@ -104,26 +104,25 @@ export declare class ParamType {
/** /**
* True if the parameters is indexed. * True if the parameters is indexed.
* *
* For non-indexable types (see [[ParamType_isIndexable]]) this * For non-indexable types this is ``null``.
* is ``null``.
*/ */
readonly indexed: null | boolean; readonly indexed: null | boolean;
/** /**
* The components for the tuple. * The components for the tuple.
* *
* For non-tuple types (see [[ParamType_isTuple]]) this is ``null``. * For non-tuple types this is ``null``.
*/ */
readonly components: null | ReadonlyArray<ParamType>; readonly components: null | ReadonlyArray<ParamType>;
/** /**
* The array length, or ``-1`` for dynamic-lengthed arrays. * The array length, or ``-1`` for dynamic-lengthed arrays.
* *
* For non-array types (see [[ParamType_isArray]]) this is ``null``. * For non-array types this is ``null``.
*/ */
readonly arrayLength: null | number; readonly arrayLength: null | number;
/** /**
* The type of each child in the array. * The type of each child in the array.
* *
* For non-array types (see [[ParamType_isArray]]) this is ``null``. * For non-array types this is ``null``.
*/ */
readonly arrayChildren: null | ParamType; readonly arrayChildren: null | ParamType;
/** /**

View File

@ -2,7 +2,7 @@
/** /**
* About frgaments... * About frgaments...
* *
* @_subsection api/abi/abi-coder:Fragments * @_subsection api/abi/abi-coder:Fragments [about-fragments]
*/ */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.StructFragment = exports.FunctionFragment = exports.FallbackFragment = exports.ConstructorFragment = exports.EventFragment = exports.ErrorFragment = exports.NamedFragment = exports.Fragment = exports.ParamType = void 0; exports.StructFragment = exports.FunctionFragment = exports.FallbackFragment = exports.ConstructorFragment = exports.EventFragment = exports.ErrorFragment = exports.NamedFragment = exports.Fragment = exports.ParamType = void 0;
@ -358,26 +358,25 @@ class ParamType {
/** /**
* True if the parameters is indexed. * True if the parameters is indexed.
* *
* For non-indexable types (see [[ParamType_isIndexable]]) this * For non-indexable types this is ``null``.
* is ``null``.
*/ */
indexed; indexed;
/** /**
* The components for the tuple. * The components for the tuple.
* *
* For non-tuple types (see [[ParamType_isTuple]]) this is ``null``. * For non-tuple types this is ``null``.
*/ */
components; components;
/** /**
* The array length, or ``-1`` for dynamic-lengthed arrays. * The array length, or ``-1`` for dynamic-lengthed arrays.
* *
* For non-array types (see [[ParamType_isArray]]) this is ``null``. * For non-array types this is ``null``.
*/ */
arrayLength; arrayLength;
/** /**
* The type of each child in the array. * The type of each child in the array.
* *
* For non-array types (see [[ParamType_isArray]]) this is ``null``. * For non-array types this is ``null``.
*/ */
arrayChildren; arrayChildren;
/** /**

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/** /**
* Explain about ABI here... * Explain about ABI here...
* *
* @_section api/abi:Application Binary Interface [abi] * @_section api/abi:Application Binary Interface [about-abi]
* @_navTitle: ABI * @_navTitle: ABI
*/ */
export { AbiCoder } from "./abi-coder.js"; export { AbiCoder } from "./abi-coder.js";

View File

@ -2,7 +2,7 @@
/** /**
* Explain about ABI here... * Explain about ABI here...
* *
* @_section api/abi:Application Binary Interface [abi] * @_section api/abi:Application Binary Interface [about-abi]
* @_navTitle: ABI * @_navTitle: ABI
*/ */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -160,7 +160,7 @@ export declare class Interface {
* specified error (see [[getError]] for valid values for * specified error (see [[getError]] for valid values for
* %%key%%). * %%key%%).
* *
* Most developers should prefer the [[parseResult]] method instead, * Most developers should prefer the [[parseCallResult]] method instead,
* which will automatically detect a ``CALL_EXCEPTION`` and throw the * which will automatically detect a ``CALL_EXCEPTION`` and throw the
* corresponding error. * corresponding error.
*/ */
@ -194,7 +194,7 @@ export declare class Interface {
* specified function (see [[getFunction]] for valid values for * specified function (see [[getFunction]] for valid values for
* %%key%%). * %%key%%).
* *
* Most developers should prefer the [[parseResult]] method instead, * Most developers should prefer the [[parseCallResult]] method instead,
* which will automatically detect a ``CALL_EXCEPTION`` and throw the * which will automatically detect a ``CALL_EXCEPTION`` and throw the
* corresponding error. * corresponding error.
*/ */

View File

@ -570,7 +570,7 @@ getSelector(fragment: ErrorFragment | FunctionFragment): string {
* specified error (see [[getError]] for valid values for * specified error (see [[getError]] for valid values for
* %%key%%). * %%key%%).
* *
* Most developers should prefer the [[parseResult]] method instead, * Most developers should prefer the [[parseCallResult]] method instead,
* which will automatically detect a ``CALL_EXCEPTION`` and throw the * which will automatically detect a ``CALL_EXCEPTION`` and throw the
* corresponding error. * corresponding error.
*/ */
@ -640,7 +640,7 @@ getSelector(fragment: ErrorFragment | FunctionFragment): string {
* specified function (see [[getFunction]] for valid values for * specified function (see [[getFunction]] for valid values for
* %%key%%). * %%key%%).
* *
* Most developers should prefer the [[parseResult]] method instead, * Most developers should prefer the [[parseCallResult]] method instead,
* which will automatically detect a ``CALL_EXCEPTION`` and throw the * which will automatically detect a ``CALL_EXCEPTION`` and throw the
* corresponding error. * corresponding error.
*/ */

View File

@ -10,7 +10,7 @@
* These functions help convert between various formats, validate * These functions help convert between various formats, validate
* addresses and safely resolve ENS names. * addresses and safely resolve ENS names.
* *
* @_section: api/address:Addresses [addresses] * @_section: api/address:Addresses [about-addresses]
*/ */
/** /**
* An interface for objects which have an address, and can * An interface for objects which have an address, and can

View File

@ -11,7 +11,7 @@
* These functions help convert between various formats, validate * These functions help convert between various formats, validate
* addresses and safely resolve ENS names. * addresses and safely resolve ENS names.
* *
* @_section: api/address:Addresses [addresses] * @_section: api/address:Addresses [about-addresses]
*/ */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = void 0; exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = void 0;

View File

@ -1,7 +1,7 @@
/** /**
* Some common constants useful for Ethereum. * Some common constants useful for Ethereum.
* *
* @_section: api/constants: Constants [constants] * @_section: api/constants: Constants [about-constants]
*/ */
export { ZeroAddress } from "./addresses.js"; export { ZeroAddress } from "./addresses.js";
export { ZeroHash } from "./hashes.js"; export { ZeroHash } from "./hashes.js";

View File

@ -2,7 +2,7 @@
/** /**
* Some common constants useful for Ethereum. * Some common constants useful for Ethereum.
* *
* @_section: api/constants: Constants [constants] * @_section: api/constants: Constants [about-constants]
*/ */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.MessagePrefix = exports.EtherSymbol = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.N = exports.ZeroHash = exports.ZeroAddress = void 0; exports.MessagePrefix = exports.EtherSymbol = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.N = exports.ZeroHash = exports.ZeroAddress = void 0;

View File

@ -457,7 +457,7 @@ async function _emit(contract, event, args, payloadFunc) {
} }
const count = sub.listeners.length; const count = sub.listeners.length;
sub.listeners = sub.listeners.filter(({ listener, once }) => { sub.listeners = sub.listeners.filter(({ listener, once }) => {
const passArgs = args.slice(); const passArgs = Array.from(args);
if (payloadFunc) { if (payloadFunc) {
passArgs.push(payloadFunc(once ? null : listener)); passArgs.push(payloadFunc(once ? null : listener));
} }

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/** /**
* About contracts... * About contracts...
* *
* @_section: api/contract:Contracts [contracts] * @_section: api/contract:Contracts [about-contracts]
*/ */
export { BaseContract, Contract } from "./contract.js"; export { BaseContract, Contract } from "./contract.js";
export { ContractFactory } from "./factory.js"; export { ContractFactory } from "./factory.js";

View File

@ -4,7 +4,7 @@ exports.EventLog = exports.ContractTransactionResponse = exports.ContractTransac
/** /**
* About contracts... * About contracts...
* *
* @_section: api/contract:Contracts [contracts] * @_section: api/contract:Contracts [about-contracts]
*/ */
var contract_js_1 = require("./contract.js"); var contract_js_1 = require("./contract.js");
Object.defineProperty(exports, "BaseContract", { enumerable: true, get: function () { return contract_js_1.BaseContract; } }); Object.defineProperty(exports, "BaseContract", { enumerable: true, get: function () { return contract_js_1.BaseContract; } });

View File

@ -2,7 +2,7 @@
* A fundamental building block of Ethereum is the underlying * A fundamental building block of Ethereum is the underlying
* cryptographic primitives. * cryptographic primitives.
* *
* @_section: api/crypto:Cryptographic Functions [crypto] * @_section: api/crypto:Cryptographic Functions [about-crypto]
*/ */
import { computeHmac } from "./hmac.js"; import { computeHmac } from "./hmac.js";
import { keccak256 } from "./keccak.js"; import { keccak256 } from "./keccak.js";

View File

@ -3,7 +3,7 @@
* A fundamental building block of Ethereum is the underlying * A fundamental building block of Ethereum is the underlying
* cryptographic primitives. * cryptographic primitives.
* *
* @_section: api/crypto:Cryptographic Functions [crypto] * @_section: api/crypto:Cryptographic Functions [about-crypto]
*/ */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.lock = exports.Signature = exports.SigningKey = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = void 0; exports.lock = exports.Signature = exports.SigningKey = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = void 0;

View File

@ -4,6 +4,8 @@ import type { BytesLike } from "../utils/index.js";
* UI or provide programatic access to the progress. * UI or provide programatic access to the progress.
* *
* The %%percent%% is a value between ``0`` and ``1``. * The %%percent%% is a value between ``0`` and ``1``.
*
* @_docloc: api/crypto:Passwords
*/ */
export type ProgressCallback = (percent: number) => void; export type ProgressCallback = (percent: number) => void;
/** /**

View File

@ -1 +1 @@
{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":";;;AAAA,iDAAwF;AAExF,gDAA2D;AAa3D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EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KAAE;IACzD,aAAa,GAAG,IAAI,CAAC;AACzB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,UAAU,CAAC,OAAkB,EAAE,KAAgB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa;IAC3G,MAAM,MAAM,GAAG,IAAA,mBAAQ,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3C,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAC,EAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACzD,CAAC;AAJD,gCAIC;AACD,UAAU,CAAC,CAAC,GAAG,WAAW,CAAC;AAC3B,UAAU,CAAC,IAAI,GAAG,cAAmB,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACzD,UAAU,CAAC,QAAQ,GAAG,UAAS,IAAyG;IACpI,IAAI,UAAU,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KAAE;IAC5D,YAAY,GAAG,IAAI,CAAC;AACxB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC"}

View File

@ -1,4 +1,9 @@
import type { BigNumberish, BytesLike } from "../utils/index.js"; import type { BigNumberish, BytesLike } from "../utils/index.js";
/**
* A SignatureLike
*
* @_docloc: api/crypto:Signing
*/
export type SignatureLike = Signature | string | { export type SignatureLike = Signature | string | {
r: string; r: string;
s: string; s: string;
@ -20,6 +25,9 @@ export type SignatureLike = Signature | string | {
}; };
/** /**
* A Signature @TODO * A Signature @TODO
*
*
* @_docloc: api/crypto:Signing
*/ */
export declare class Signature { export declare class Signature {
#private; #private;

View File

@ -16,6 +16,9 @@ function toUint256(value) {
} }
/** /**
* A Signature @TODO * A Signature @TODO
*
*
* @_docloc: api/crypto:Signing
*/ */
class Signature { class Signature {
#r; #r;

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,8 @@
/**
* Add details about signing here.
*
* @_subsection: api/crypto:Signing [about-signing]
*/
import { Signature } from "./signature.js"; import { Signature } from "./signature.js";
import type { BytesLike } from "../utils/index.js"; import type { BytesLike } from "../utils/index.js";
import type { SignatureLike } from "./index.js"; import type { SignatureLike } from "./index.js";

View File

@ -1,4 +1,9 @@
"use strict"; "use strict";
/**
* Add details about signing here.
*
* @_subsection: api/crypto:Signing [about-signing]
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k); var desc = Object.getOwnPropertyDescriptor(m, k);

View File

@ -1 +1 @@
{"version":3,"file":"signing-key.js","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4DAA8C;AAE9C,gDAG2B;AAE3B,uCAAwC;AACxC,iDAA2C;AAO3C,yFAAyF;AAEzF,4BAA4B;AAC5B,SAAS,CAAC,KAAK,CAAC,cAAc,GAAG,UAAS,GAAe,EAAE,GAAG,QAA2B;IACrF,OAAO,IAAA,mBAAQ,EAAC,IAAA,qBAAW,EAAC,QAAQ,EAAE,GAAG,EAAE,IAAA,iBAAM,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC,CAAA;AAED;;;GAGG;AACH,MAAa,UAAU;IACnB,WAAW,CAAS;IAEpB;;OAEG;IACH,YAAY,UAAqB;QAC7B,IAAA,yBAAc,EAAC,IAAA,qBAAU,EAAC,UAAU,CAAC,KAAK,EAAE,EA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AM,IAAI,IAAI,EAAE;YAAE,OAAO,IAAA,kBAAO,EAAC,MAAM,CAAC,CAAC;SAAE;QAE/C,IAAA,yBAAc,EAAC,KAAK,EAAE,8BAA8B,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IAClF,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,EAAa,EAAE,EAAa,EAAE,UAAoB;QAC/D,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QACnF,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QACnF,OAAO,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IACpD,CAAC;CACJ;AA3KD,gCA2KC"}

View File

@ -1,7 +1,7 @@
/** /**
* About hashing here... * About hashing here...
* *
* @_section: api/hashing:Hashing Utilities [hashing] * @_section: api/hashing:Hashing Utilities [about-hashing]
*/ */
export { id } from "./id.js"; export { id } from "./id.js";
export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js"; export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js";

View File

@ -2,7 +2,7 @@
/** /**
* About hashing here... * About hashing here...
* *
* @_section: api/hashing:Hashing Utilities [hashing] * @_section: api/hashing:Hashing Utilities [about-hashing]
*/ */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = void 0; exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = void 0;

View File

@ -161,7 +161,7 @@ const _formatTransactionReceipt = object({
cumulativeGasUsed: index_js_4.getBigInt, cumulativeGasUsed: index_js_4.getBigInt,
effectiveGasPrice: allowNull(index_js_4.getBigInt), effectiveGasPrice: allowNull(index_js_4.getBigInt),
status: allowNull(index_js_4.getNumber), status: allowNull(index_js_4.getNumber),
type: index_js_4.getNumber type: allowNull(index_js_4.getNumber, 0)
}, { }, {
effectiveGasPrice: ["gasPrice"], effectiveGasPrice: ["gasPrice"],
hash: ["transactionHash"], hash: ["transactionHash"],

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/** /**
* About providers. * About providers.
* *
* @_section: api/providers:Providers [providers] * @_section: api/providers:Providers [about-providers]
*/ */
export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js";
export { AbstractSigner, VoidSigner, } from "./abstract-signer.js"; export { AbstractSigner, VoidSigner, } from "./abstract-signer.js";

View File

@ -2,7 +2,7 @@
/** /**
* About providers. * About providers.
* *
* @_section: api/providers:Providers [providers] * @_section: api/providers:Providers [about-providers]
*/ */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.SocketEventSubscriber = exports.SocketPendingSubscriber = exports.SocketBlockSubscriber = exports.SocketSubscriber = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanPlugin = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.copyRequest = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.FeeDataNetworkPlugin = exports.EnsPlugin = exports.GasCostPlugin = exports.NetworkPlugin = exports.NonceManager = exports.Network = exports.EnsResolver = exports.getDefaultProvider = exports.showThrottleMessage = exports.VoidSigner = exports.AbstractSigner = exports.UnmanagedSubscriber = exports.AbstractProvider = void 0; exports.SocketEventSubscriber = exports.SocketPendingSubscriber = exports.SocketBlockSubscriber = exports.SocketSubscriber = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanPlugin = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.copyRequest = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.FeeDataNetworkPlugin = exports.EnsPlugin = exports.GasCostPlugin = exports.NetworkPlugin = exports.NonceManager = exports.Network = exports.EnsResolver = exports.getDefaultProvider = exports.showThrottleMessage = exports.VoidSigner = exports.AbstractSigner = exports.UnmanagedSubscriber = exports.AbstractProvider = void 0;

View File

@ -18,6 +18,7 @@ const abstract_provider_js_1 = require("./abstract-provider.js");
const abstract_signer_js_1 = require("./abstract-signer.js"); const abstract_signer_js_1 = require("./abstract-signer.js");
const network_js_1 = require("./network.js"); const network_js_1 = require("./network.js");
const subscriber_filterid_js_1 = require("./subscriber-filterid.js"); const subscriber_filterid_js_1 = require("./subscriber-filterid.js");
const subscriber_polling_js_1 = require("./subscriber-polling.js");
const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g);
//const Methods = "getAddress,then".split(/,/g); //const Methods = "getAddress,then".split(/,/g);
function deepCopy(value) { function deepCopy(value) {
@ -423,6 +424,9 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
return new subscriber_filterid_js_1.FilterIdPendingSubscriber(this); return new subscriber_filterid_js_1.FilterIdPendingSubscriber(this);
} }
if (sub.type === "event") { if (sub.type === "event") {
if (this._getOption("polling")) {
return new subscriber_polling_js_1.PollingEventSubscriber(this, sub.filter);
}
return new subscriber_filterid_js_1.FilterIdEventSubscriber(this, sub.filter); return new subscriber_filterid_js_1.FilterIdEventSubscriber(this, sub.filter);
} }
// Orphaned Logs are handled automatically, by the filter, since // Orphaned Logs are handled automatically, by the filter, since
@ -578,74 +582,6 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
const e = index_js_1.AbiCoder.getBuiltinCallException((method === "eth_call") ? "call" : "estimateGas", (payload.params[0]), (result ? result.data : null)); const e = index_js_1.AbiCoder.getBuiltinCallException((method === "eth_call") ? "call" : "estimateGas", (payload.params[0]), (result ? result.data : null));
e.info = { error, payload }; e.info = { error, payload };
return e; return e;
/*
let message = "missing revert data during JSON-RPC call";
const action = <"call" | "estimateGas" | "unknown">(({ eth_call: "call", eth_estimateGas: "estimateGas" })[method] || "unknown");
let data: null | string = null;
let reason: null | string = null;
const transaction = <{ from: string, to: string, data: string }>((<any>payload).params[0]);
const invocation = null;
let revert: null | { signature: string, name: string, args: Array<any> } = null;
if (result) {
// @TODO: Extract errorSignature, errorName, errorArgs, reason if
// it is Error(string) or Panic(uint25)
message = "execution reverted during JSON-RPC call";
data = result.data;
let bytes = getBytes(data);
if (bytes.length % 32 !== 4) {
message += " (could not parse reason; invalid data length)";
} else if (data.substring(0, 10) === "0x08c379a0") {
// Error(string)
try {
if (bytes.length < 68) { throw new Error("bad length"); }
bytes = bytes.slice(4);
const pointer = getNumber(hexlify(bytes.slice(0, 32)));
bytes = bytes.slice(pointer);
if (bytes.length < 32) { throw new Error("overrun"); }
const length = getNumber(hexlify(bytes.slice(0, 32)));
bytes = bytes.slice(32);
if (bytes.length < length) { throw new Error("overrun"); }
reason = toUtf8String(bytes.slice(0, length));
revert = {
signature: "Error(string)",
name: "Error",
args: [ reason ]
};
message += `: ${ JSON.stringify(reason) }`;
} catch (error) {
console.log(error);
message += " (could not parse reason; invalid data length)";
}
} else if (data.substring(0, 10) === "0x4e487b71") {
// Panic(uint256)
try {
if (bytes.length !== 36) { throw new Error("bad length"); }
const arg = getNumber(hexlify(bytes.slice(4)));
revert = {
signature: "Panic(uint256)",
name: "Panic",
args: [ arg ]
};
reason = `Panic due to ${ PanicReasons.get(Number(arg)) || "UNKNOWN" }(${ arg })`;
message += `: ${ reason }`;
} catch (error) {
console.log(error);
message += " (could not parse panic reason)";
}
}
}
return makeError(message, "CALL_EXCEPTION", {
action, data, reason, transaction, invocation, revert,
info: { payload, error }
});
*/
} }
// Only estimateGas and call can return arbitrary contract-defined text, so now we // Only estimateGas and call can return arbitrary contract-defined text, so now we
// we can process text safely. // we can process text safely.
@ -670,7 +606,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
const transaction = (payload.params[0]); const transaction = (payload.params[0]);
if (message.match(/insufficient funds|base fee exceeds gas limit/i)) { if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {
return (0, index_js_5.makeError)("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { return (0, index_js_5.makeError)("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", {
transaction transaction, info: { error }
}); });
} }
if (message.match(/nonce/i) && message.match(/too low/i)) { if (message.match(/nonce/i) && message.match(/too low/i)) {
@ -688,7 +624,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
} }
if (message.match(/the method .* does not exist/i)) { if (message.match(/the method .* does not exist/i)) {
return (0, index_js_5.makeError)("unsupported operation", "UNSUPPORTED_OPERATION", { return (0, index_js_5.makeError)("unsupported operation", "UNSUPPORTED_OPERATION", {
operation: payload.method operation: payload.method, info: { error }
}); });
} }
return (0, index_js_5.makeError)("could not coalesce error", "UNKNOWN_ERROR", { error }); return (0, index_js_5.makeError)("could not coalesce error", "UNKNOWN_ERROR", { error });

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.FilterIdPendingSubscriber = exports.FilterIdEventSubscriber = exports.FilterIdSubscriber = void 0; exports.FilterIdPendingSubscriber = exports.FilterIdEventSubscriber = exports.FilterIdSubscriber = void 0;
const index_js_1 = require("../utils/index.js");
const subscriber_polling_js_1 = require("./subscriber-polling.js"); const subscriber_polling_js_1 = require("./subscriber-polling.js");
function copy(obj) { function copy(obj) {
return JSON.parse(JSON.stringify(obj)); return JSON.parse(JSON.stringify(obj));
@ -41,11 +42,24 @@ class FilterIdSubscriber {
} }
async #poll(blockNumber) { async #poll(blockNumber) {
try { try {
// Subscribe if necessary
if (this.#filterIdPromise == null) { if (this.#filterIdPromise == null) {
this.#filterIdPromise = this._subscribe(this.#provider); this.#filterIdPromise = this._subscribe(this.#provider);
} }
const filterId = await this.#filterIdPromise; // Get the Filter ID
let filterId = null;
try {
filterId = await this.#filterIdPromise;
}
catch (error) {
if (!(0, index_js_1.isError)(error, "UNSUPPORTED_OPERATION") || error.operation !== "eth_newFilter") {
throw error;
}
}
// The backend does not support Filter ID; downgrade to
// polling
if (filterId == null) { if (filterId == null) {
this.#filterIdPromise = null;
this.#provider._recoverSubscriber(this, this._recover(this.#provider)); this.#provider._recoverSubscriber(this, this._recover(this.#provider));
return; return;
} }

View File

@ -1 +1 @@
{"version":3,"file":"subscriber-filterid.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":";;;AAAA,mEAAiE;AAQjE,SAAS,IAAI,CAAC,GAAQ;IAClB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAa,kBAAkB;IAC3B,SAAS,CAAqB;IAE9B,g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B;QAChE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;SACpC;IACL,CAAC;CACJ;AAVD,8DAUC"}

View File

@ -1,7 +1,7 @@
/** /**
* Transactions.. * Transactions..
* *
* @_section api/transaction:Transactions [transactions] * @_section api/transaction:Transactions [about-transactions]
*/ */
/** /**
* A single [[AccessList]] entry of storage keys (slots) for an address. * A single [[AccessList]] entry of storage keys (slots) for an address.

View File

@ -2,7 +2,7 @@
/** /**
* Transactions.. * Transactions..
* *
* @_section api/transaction:Transactions [transactions] * @_section api/transaction:Transactions [about-transactions]
*/ */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = void 0; exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = void 0;

View File

@ -1,9 +1,39 @@
import type { BytesLike } from "./data.js"; import type { BytesLike } from "./data.js";
/** /**
* Decodes the base-64 encoded %%value%%. * Decodes the base-64 encoded %%value%%.
*
* @example:
* // The decoded value is always binary data...
* result = decodeBase64("SGVsbG8gV29ybGQhIQ==")
* //_result:
*
* // ...use toUtf8String to convert it to a string.
* toUtf8String(result)
* //_result:
*
* // Decoding binary data
* decodeBase64("EjQ=")
* //_result:
*/ */
export declare function decodeBase64(value: string): Uint8Array; export declare function decodeBase64(value: string): Uint8Array;
/** /**
* Encodes %%data%% as a base-64 encoded string. * Encodes %%data%% as a base-64 encoded string.
*
* @example:
* // Encoding binary data as a hexstring
* encodeBase64("0x1234")
* //_result:
*
* // Encoding binary data as a Uint8Array
* encodeBase64(new Uint8Array([ 0x12, 0x34 ]))
* //_result:
*
* // The input MUST be data...
* encodeBase64("Hello World!!")
* //_error:
*
* // ...use toUtf8Bytes for this.
* encodeBase64(toUtf8Bytes("Hello World!!"))
* //_result:
*/ */
export declare function encodeBase64(data: BytesLike): string; export declare function encodeBase64(data: BytesLike): string;

View File

@ -12,6 +12,19 @@ exports.encodeBase64 = exports.decodeBase64 = void 0;
const data_js_1 = require("./data.js"); const data_js_1 = require("./data.js");
/** /**
* Decodes the base-64 encoded %%value%%. * Decodes the base-64 encoded %%value%%.
*
* @example:
* // The decoded value is always binary data...
* result = decodeBase64("SGVsbG8gV29ybGQhIQ==")
* //_result:
*
* // ...use toUtf8String to convert it to a string.
* toUtf8String(result)
* //_result:
*
* // Decoding binary data
* decodeBase64("EjQ=")
* //_result:
*/ */
function decodeBase64(value) { function decodeBase64(value) {
return (0, data_js_1.getBytesCopy)(Buffer.from(value, "base64")); return (0, data_js_1.getBytesCopy)(Buffer.from(value, "base64"));
@ -20,6 +33,23 @@ exports.decodeBase64 = decodeBase64;
; ;
/** /**
* Encodes %%data%% as a base-64 encoded string. * Encodes %%data%% as a base-64 encoded string.
*
* @example:
* // Encoding binary data as a hexstring
* encodeBase64("0x1234")
* //_result:
*
* // Encoding binary data as a Uint8Array
* encodeBase64(new Uint8Array([ 0x12, 0x34 ]))
* //_result:
*
* // The input MUST be data...
* encodeBase64("Hello World!!")
* //_error:
*
* // ...use toUtf8Bytes for this.
* encodeBase64(toUtf8Bytes("Hello World!!"))
* //_result:
*/ */
function encodeBase64(data) { function encodeBase64(data) {
return Buffer.from((0, data_js_1.getBytes)(data)).toString("base64"); return Buffer.from((0, data_js_1.getBytes)(data)).toString("base64");

View File

@ -1 +1 @@
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,uCAAmD;AAKnD;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAa;IACtC,OAAO,IAAA,sBAAY,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC;AAFD,oCAEC;AAAA,CAAC;AAEF;;GAEG;AACH,SAAgB,YAAY,CAAC,IAAe;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAFD,oCAEC"} {"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,uCAAmD;AAKnD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,YAAY,CAAC,KAAa;IACtC,OAAO,IAAA,sBAAY,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC;AAFD,oCAEC;AAAA,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,YAAY,CAAC,IAAe;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAFD,oCAEC"}

View File

@ -72,7 +72,7 @@ export declare function stripZerosLeft(data: BytesLike): string;
* Return the [[DataHexString]] of %%data%% padded on the **left** * Return the [[DataHexString]] of %%data%% padded on the **left**
* to %%length%% bytes. * to %%length%% bytes.
* *
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is
* thrown. * thrown.
* *
* This pads data the same as **values** are in Solidity * This pads data the same as **values** are in Solidity
@ -83,7 +83,7 @@ export declare function zeroPadValue(data: BytesLike, length: number): string;
* Return the [[DataHexString]] of %%data%% padded on the **right** * Return the [[DataHexString]] of %%data%% padded on the **right**
* to %%length%% bytes. * to %%length%% bytes.
* *
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is
* thrown. * thrown.
* *
* This pads data the same as **bytes** are in Solidity * This pads data the same as **bytes** are in Solidity

View File

@ -157,7 +157,7 @@ function zeroPad(data, length, left) {
* Return the [[DataHexString]] of %%data%% padded on the **left** * Return the [[DataHexString]] of %%data%% padded on the **left**
* to %%length%% bytes. * to %%length%% bytes.
* *
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is
* thrown. * thrown.
* *
* This pads data the same as **values** are in Solidity * This pads data the same as **values** are in Solidity
@ -171,7 +171,7 @@ exports.zeroPadValue = zeroPadValue;
* Return the [[DataHexString]] of %%data%% padded on the **right** * Return the [[DataHexString]] of %%data%% padded on the **right**
* to %%length%% bytes. * to %%length%% bytes.
* *
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is
* thrown. * thrown.
* *
* This pads data the same as **bytes** are in Solidity * This pads data the same as **bytes** are in Solidity

View File

@ -3,7 +3,7 @@
* Ethereum and to simplify the library, without increasing * Ethereum and to simplify the library, without increasing
* the library dependencies for simple functions. * the library dependencies for simple functions.
* *
* @_section api/utils:Utilities [utils] * @_section api/utils:Utilities [about-utils]
*/ */
export { decodeBase58, encodeBase58 } from "./base58.js"; export { decodeBase58, encodeBase58 } from "./base58.js";
export { decodeBase64, encodeBase64 } from "./base64.js"; export { decodeBase64, encodeBase64 } from "./base64.js";

View File

@ -4,7 +4,7 @@
* Ethereum and to simplify the library, without increasing * Ethereum and to simplify the library, without increasing
* the library dependencies for simple functions. * the library dependencies for simple functions.
* *
* @_section api/utils:Utilities [utils] * @_section api/utils:Utilities [about-utils]
*/ */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.encodeRlp = exports.decodeRlp = exports.defineProperties = exports.resolveProperties = exports.toQuantity = exports.toBeArray = exports.toBeHex = exports.toNumber = exports.toBigInt = exports.getUint = exports.getNumber = exports.getBigInt = exports.mask = exports.toTwos = exports.fromTwos = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.makeError = exports.assertNormalize = exports.assertPrivate = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.isError = exports.isCallException = exports.zeroPadBytes = exports.zeroPadValue = exports.stripZerosLeft = exports.dataSlice = exports.dataLength = exports.concat = exports.hexlify = exports.isBytesLike = exports.isHexString = exports.getBytesCopy = exports.getBytes = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = void 0; exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.encodeRlp = exports.decodeRlp = exports.defineProperties = exports.resolveProperties = exports.toQuantity = exports.toBeArray = exports.toBeHex = exports.toNumber = exports.toBigInt = exports.getUint = exports.getNumber = exports.getBigInt = exports.mask = exports.toTwos = exports.fromTwos = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.makeError = exports.assertNormalize = exports.assertPrivate = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.isError = exports.isCallException = exports.zeroPadBytes = exports.zeroPadValue = exports.stripZerosLeft = exports.dataSlice = exports.dataLength = exports.concat = exports.hexlify = exports.isBytesLike = exports.isHexString = exports.getBytesCopy = exports.getBytes = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = void 0;

View File

@ -26,7 +26,7 @@ export declare function toTwos(_value: BigNumberish, _width: Numeric): bigint;
*/ */
export declare function mask(_value: BigNumberish, _bits: Numeric): bigint; export declare function mask(_value: BigNumberish, _bits: Numeric): bigint;
/** /**
* Gets a [[BigInt]] from %%value%%. If it is an invalid value for * Gets a BigInt from %%value%%. If it is an invalid value for
* a BigInt, then an ArgumentError will be thrown for %%name%%. * a BigInt, then an ArgumentError will be thrown for %%name%%.
*/ */
export declare function getBigInt(value: BigNumberish, name?: string): bigint; export declare function getBigInt(value: BigNumberish, name?: string): bigint;

View File

@ -69,7 +69,7 @@ function mask(_value, _bits) {
} }
exports.mask = mask; exports.mask = mask;
/** /**
* Gets a [[BigInt]] from %%value%%. If it is an invalid value for * Gets a BigInt from %%value%%. If it is an invalid value for
* a BigInt, then an ArgumentError will be thrown for %%name%%. * a BigInt, then an ArgumentError will be thrown for %%name%%.
*/ */
function getBigInt(value, name) { function getBigInt(value, name) {

View File

@ -7,7 +7,7 @@ import type { BigNumberish, Numeric } from "../utils/index.js";
*/ */
export declare function formatUnits(value: BigNumberish, unit?: string | Numeric): string; export declare function formatUnits(value: BigNumberish, unit?: string | Numeric): string;
/** /**
* Converts the //decimal string// %%value%% to a [[BigInt]], assuming * Converts the //decimal string// %%value%% to a BigInt, assuming
* %%unit%% decimal places. The %%unit%% may the number of decimal places * %%unit%% decimal places. The %%unit%% may the number of decimal places
* or the name of a unit (e.g. ``"gwei"`` for 9 decimal places). * or the name of a unit (e.g. ``"gwei"`` for 9 decimal places).
*/ */
@ -17,7 +17,7 @@ export declare function parseUnits(value: string, unit?: string | Numeric): bigi
*/ */
export declare function formatEther(wei: BigNumberish): string; export declare function formatEther(wei: BigNumberish): string;
/** /**
* Converts the //decimal string// %%ether%% to a [[BigInt]], using 18 * Converts the //decimal string// %%ether%% to a BigInt, using 18
* decimal places. * decimal places.
*/ */
export declare function parseEther(ether: string): bigint; export declare function parseEther(ether: string): bigint;

View File

@ -54,7 +54,7 @@ function formatUnits(value, unit) {
} }
exports.formatUnits = formatUnits; exports.formatUnits = formatUnits;
/** /**
* Converts the //decimal string// %%value%% to a [[BigInt]], assuming * Converts the //decimal string// %%value%% to a BigInt, assuming
* %%unit%% decimal places. The %%unit%% may the number of decimal places * %%unit%% decimal places. The %%unit%% may the number of decimal places
* or the name of a unit (e.g. ``"gwei"`` for 9 decimal places). * or the name of a unit (e.g. ``"gwei"`` for 9 decimal places).
*/ */
@ -80,7 +80,7 @@ function formatEther(wei) {
} }
exports.formatEther = formatEther; exports.formatEther = formatEther;
/** /**
* Converts the //decimal string// %%ether%% to a [[BigInt]], using 18 * Converts the //decimal string// %%ether%% to a BigInt, using 18
* decimal places. * decimal places.
*/ */
function parseEther(ether) { function parseEther(ether) {

View File

@ -57,6 +57,21 @@ export type Utf8ErrorReason = "UNEXPECTED_CONTINUE" | "BAD_PREFIX" | "OVERRUN" |
* when control resumes to the FSM. * when control resumes to the FSM.
*/ */
export type Utf8ErrorFunc = (reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array<number>, badCodepoint?: number) => number; export type Utf8ErrorFunc = (reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array<number>, badCodepoint?: number) => number;
/**
* A handful of popular, built-in UTF-8 error handling strategies.
*
* **``"error"``** - throws on ANY illegal UTF-8 sequence or
* non-canonical (overlong) codepoints (this is the default)
*
* **``"ignore"``** - silently drops any illegal UTF-8 sequence
* and accepts non-canonical (overlong) codepoints
*
* **``"replace"``** - replace any illegal UTF-8 sequence with the
* UTF-8 replacement character (i.e. `\ufffd`) and accepts
* non-canonical (overlong) codepoints
*
* @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc>
*/
export declare const Utf8ErrorFuncs: Readonly<Record<"error" | "ignore" | "replace", Utf8ErrorFunc>>; export declare const Utf8ErrorFuncs: Readonly<Record<"error" | "ignore" | "replace", Utf8ErrorFunc>>;
/** /**
* Returns the UTF-8 byte representation of %%str%%. * Returns the UTF-8 byte representation of %%str%%.
@ -69,7 +84,7 @@ export declare function toUtf8Bytes(str: string, form?: UnicodeNormalizationForm
* *
* When %%onError%% function is specified, it is called on UTF-8 * When %%onError%% function is specified, it is called on UTF-8
* errors allowing recovery using the [[Utf8ErrorFunc]] API. * errors allowing recovery using the [[Utf8ErrorFunc]] API.
* (default: [error](Utf8ErrorFuncs-error)) * (default: [error](Utf8ErrorFuncs))
*/ */
export declare function toUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc): string; export declare function toUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc): string;
/** /**

View File

@ -46,7 +46,21 @@ function replaceFunc(reason, offset, bytes, output, badCodepoint) {
// Otherwise, process as if ignoring errors // Otherwise, process as if ignoring errors
return ignoreFunc(reason, offset, bytes, output, badCodepoint); return ignoreFunc(reason, offset, bytes, output, badCodepoint);
} }
// Common error handing strategies /**
* A handful of popular, built-in UTF-8 error handling strategies.
*
* **``"error"``** - throws on ANY illegal UTF-8 sequence or
* non-canonical (overlong) codepoints (this is the default)
*
* **``"ignore"``** - silently drops any illegal UTF-8 sequence
* and accepts non-canonical (overlong) codepoints
*
* **``"replace"``** - replace any illegal UTF-8 sequence with the
* UTF-8 replacement character (i.e. `\ufffd`) and accepts
* non-canonical (overlong) codepoints
*
* @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc>
*/
exports.Utf8ErrorFuncs = Object.freeze({ exports.Utf8ErrorFuncs = Object.freeze({
error: errorFunc, error: errorFunc,
ignore: ignoreFunc, ignore: ignoreFunc,
@ -194,7 +208,7 @@ function _toUtf8String(codePoints) {
* *
* When %%onError%% function is specified, it is called on UTF-8 * When %%onError%% function is specified, it is called on UTF-8
* errors allowing recovery using the [[Utf8ErrorFunc]] API. * errors allowing recovery using the [[Utf8ErrorFunc]] API.
* (default: [error](Utf8ErrorFuncs-error)) * (default: [error](Utf8ErrorFuncs))
*/ */
function toUtf8String(bytes, onError) { function toUtf8String(bytes, onError) {
return _toUtf8String(getUtf8CodePoints(bytes, onError)); return _toUtf8String(getUtf8CodePoints(bytes, onError));

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@
* low-level details of how an HD wallets are derived, exported * low-level details of how an HD wallets are derived, exported
* or imported. * or imported.
* *
* @_section: api/wallet:Wallets [wallets] * @_section: api/wallet:Wallets [about-wallets]
*/ */
export { BaseWallet } from "./base-wallet.js"; export { BaseWallet } from "./base-wallet.js";
export { defaultPath, getAccountPath, HDNodeWallet, HDNodeVoidWallet, } from "./hdwallet.js"; export { defaultPath, getAccountPath, HDNodeWallet, HDNodeVoidWallet, } from "./hdwallet.js";

View File

@ -15,7 +15,7 @@
* low-level details of how an HD wallets are derived, exported * low-level details of how an HD wallets are derived, exported
* or imported. * or imported.
* *
* @_section: api/wallet:Wallets [wallets] * @_section: api/wallet:Wallets [about-wallets]
*/ */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.Wallet = exports.Mnemonic = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.isKeystoreJson = exports.decryptCrowdsaleJson = exports.isCrowdsaleJson = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.getAccountPath = exports.defaultPath = exports.BaseWallet = void 0; exports.Wallet = exports.Mnemonic = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.isKeystoreJson = exports.decryptCrowdsaleJson = exports.isCrowdsaleJson = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.getAccountPath = exports.defaultPath = exports.BaseWallet = void 0;

View File

@ -1,7 +1,7 @@
import type { BytesLike } from "../utils/index.js"; import type { BytesLike } from "../utils/index.js";
import type { Wordlist } from "../wordlists/index.js"; import type { Wordlist } from "../wordlists/index.js";
/** /**
* A **Mnemonic** wraps all properties required to compute [[link-bip39]] * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]
* seeds and convert between phrases and entropy. * seeds and convert between phrases and entropy.
*/ */
export declare class Mnemonic { export declare class Mnemonic {
@ -55,7 +55,7 @@ export declare class Mnemonic {
*/ */
static phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string; static phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string;
/** /**
* Returns true if %%phrase%% is a valid [[link-bip39]] phrase. * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.
* *
* This checks all the provided words belong to the %%wordlist%%, * This checks all the provided words belong to the %%wordlist%%,
* that the length is valid and the checksum is correct. * that the length is valid and the checksum is correct.

View File

@ -71,7 +71,7 @@ function entropyToMnemonic(entropy, wordlist) {
} }
const _guard = {}; const _guard = {};
/** /**
* A **Mnemonic** wraps all properties required to compute [[link-bip39]] * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]
* seeds and convert between phrases and entropy. * seeds and convert between phrases and entropy.
*/ */
class Mnemonic { class Mnemonic {
@ -151,7 +151,7 @@ class Mnemonic {
return mnemonicToEntropy(phrase, wordlist); return mnemonicToEntropy(phrase, wordlist);
} }
/** /**
* Returns true if %%phrase%% is a valid [[link-bip39]] phrase. * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.
* *
* This checks all the provided words belong to the %%wordlist%%, * This checks all the provided words belong to the %%wordlist%%,
* that the length is valid and the checksum is correct. * that the length is valid and the checksum is correct.

View File

@ -15,7 +15,7 @@
* languages, but for maximal compatibility, the * languages, but for maximal compatibility, the
* [English Wordlist](LangEn) is recommended. * [English Wordlist](LangEn) is recommended.
* *
* @_section: api/wordlists:Wordlists [wordlists] * @_section: api/wordlists:Wordlists [about-wordlists]
*/ */
export { Wordlist } from "./wordlist.js"; export { Wordlist } from "./wordlist.js";
export { LangEn } from "./lang-en.js"; export { LangEn } from "./lang-en.js";

View File

@ -18,7 +18,7 @@ exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn
* languages, but for maximal compatibility, the * languages, but for maximal compatibility, the
* [English Wordlist](LangEn) is recommended. * [English Wordlist](LangEn) is recommended.
* *
* @_section: api/wordlists:Wordlists [wordlists] * @_section: api/wordlists:Wordlists [about-wordlists]
*/ */
var wordlist_js_1 = require("./wordlist.js"); var wordlist_js_1 = require("./wordlist.js");
Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function () { return wordlist_js_1.Wordlist; } }); Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function () { return wordlist_js_1.Wordlist; } });

View File

@ -1,6 +1,6 @@
/** /**
* A Wordlist represents a collection of language-specific * A Wordlist represents a collection of language-specific
* words used to encode and devoce [[BIP-39]] encoded data * words used to encode and devoce [[link-bip-39]] encoded data
* by mapping words to 11-bit values and vice versa. * by mapping words to 11-bit values and vice versa.
*/ */
export declare abstract class Wordlist { export declare abstract class Wordlist {

View File

@ -4,7 +4,7 @@ exports.Wordlist = void 0;
const index_js_1 = require("../utils/index.js"); const index_js_1 = require("../utils/index.js");
/** /**
* A Wordlist represents a collection of language-specific * A Wordlist represents a collection of language-specific
* words used to encode and devoce [[BIP-39]] encoded data * words used to encode and devoce [[link-bip-39]] encoded data
* by mapping words to 11-bit values and vice versa. * by mapping words to 11-bit values and vice versa.
*/ */
class Wordlist { class Wordlist {

View File

@ -1,2 +1,2 @@
export const version = "6.0.2"; export const version = "6.0.3";
//# sourceMappingURL=_version.js.map //# sourceMappingURL=_version.js.map

View File

@ -187,7 +187,7 @@ export class AbiCoder {
return defaultCoder; return defaultCoder;
} }
/** /**
* Returns an ethers-compatible [[CALL_EXCEPTION]] Error for the given * Returns an ethers-compatible [[CallExceptionError]] Error for the given
* result %%data%% for the [[CallExceptionAction]] %%action%% against * result %%data%% for the [[CallExceptionAction]] %%action%% against
* the Transaction %%tx%%. * the Transaction %%tx%%.
*/ */

View File

@ -1,7 +1,7 @@
/** /**
* About frgaments... * About frgaments...
* *
* @_subsection api/abi/abi-coder:Fragments * @_subsection api/abi/abi-coder:Fragments [about-fragments]
*/ */
import { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument } from "../utils/index.js"; import { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument } from "../utils/index.js";
import { id } from "../hash/index.js"; import { id } from "../hash/index.js";
@ -355,26 +355,25 @@ export class ParamType {
/** /**
* True if the parameters is indexed. * True if the parameters is indexed.
* *
* For non-indexable types (see [[ParamType_isIndexable]]) this * For non-indexable types this is ``null``.
* is ``null``.
*/ */
indexed; indexed;
/** /**
* The components for the tuple. * The components for the tuple.
* *
* For non-tuple types (see [[ParamType_isTuple]]) this is ``null``. * For non-tuple types this is ``null``.
*/ */
components; components;
/** /**
* The array length, or ``-1`` for dynamic-lengthed arrays. * The array length, or ``-1`` for dynamic-lengthed arrays.
* *
* For non-array types (see [[ParamType_isArray]]) this is ``null``. * For non-array types this is ``null``.
*/ */
arrayLength; arrayLength;
/** /**
* The type of each child in the array. * The type of each child in the array.
* *
* For non-array types (see [[ParamType_isArray]]) this is ``null``. * For non-array types this is ``null``.
*/ */
arrayChildren; arrayChildren;
/** /**

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/** /**
* Explain about ABI here... * Explain about ABI here...
* *
* @_section api/abi:Application Binary Interface [abi] * @_section api/abi:Application Binary Interface [about-abi]
* @_navTitle: ABI * @_navTitle: ABI
*/ */
////// //////

View File

@ -562,7 +562,7 @@ getSelector(fragment: ErrorFragment | FunctionFragment): string {
* specified error (see [[getError]] for valid values for * specified error (see [[getError]] for valid values for
* %%key%%). * %%key%%).
* *
* Most developers should prefer the [[parseResult]] method instead, * Most developers should prefer the [[parseCallResult]] method instead,
* which will automatically detect a ``CALL_EXCEPTION`` and throw the * which will automatically detect a ``CALL_EXCEPTION`` and throw the
* corresponding error. * corresponding error.
*/ */
@ -632,7 +632,7 @@ getSelector(fragment: ErrorFragment | FunctionFragment): string {
* specified function (see [[getFunction]] for valid values for * specified function (see [[getFunction]] for valid values for
* %%key%%). * %%key%%).
* *
* Most developers should prefer the [[parseResult]] method instead, * Most developers should prefer the [[parseCallResult]] method instead,
* which will automatically detect a ``CALL_EXCEPTION`` and throw the * which will automatically detect a ``CALL_EXCEPTION`` and throw the
* corresponding error. * corresponding error.
*/ */

View File

@ -10,7 +10,7 @@
* These functions help convert between various formats, validate * These functions help convert between various formats, validate
* addresses and safely resolve ENS names. * addresses and safely resolve ENS names.
* *
* @_section: api/address:Addresses [addresses] * @_section: api/address:Addresses [about-addresses]
*/ */
null; null;
export { getAddress, getIcapAddress } from "./address.js"; export { getAddress, getIcapAddress } from "./address.js";

View File

@ -1,7 +1,7 @@
/** /**
* Some common constants useful for Ethereum. * Some common constants useful for Ethereum.
* *
* @_section: api/constants: Constants [constants] * @_section: api/constants: Constants [about-constants]
*/ */
export { ZeroAddress } from "./addresses.js"; export { ZeroAddress } from "./addresses.js";
export { ZeroHash } from "./hashes.js"; export { ZeroHash } from "./hashes.js";

View File

@ -452,7 +452,7 @@ async function _emit(contract, event, args, payloadFunc) {
} }
const count = sub.listeners.length; const count = sub.listeners.length;
sub.listeners = sub.listeners.filter(({ listener, once }) => { sub.listeners = sub.listeners.filter(({ listener, once }) => {
const passArgs = args.slice(); const passArgs = Array.from(args);
if (payloadFunc) { if (payloadFunc) {
passArgs.push(payloadFunc(once ? null : listener)); passArgs.push(payloadFunc(once ? null : listener));
} }

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/** /**
* About contracts... * About contracts...
* *
* @_section: api/contract:Contracts [contracts] * @_section: api/contract:Contracts [about-contracts]
*/ */
export { BaseContract, Contract } from "./contract.js"; export { BaseContract, Contract } from "./contract.js";
export { ContractFactory } from "./factory.js"; export { ContractFactory } from "./factory.js";

View File

@ -2,7 +2,7 @@
* A fundamental building block of Ethereum is the underlying * A fundamental building block of Ethereum is the underlying
* cryptographic primitives. * cryptographic primitives.
* *
* @_section: api/crypto:Cryptographic Functions [crypto] * @_section: api/crypto:Cryptographic Functions [about-crypto]
*/ */
null; null;
// We import all these so we can export lock() // We import all these so we can export lock()

View File

@ -1 +1 @@
{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,WAAW,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExF,OAAO,EAAE,QAAQ,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAa3D,IAAI,UAAU,GAAG,KAAK,EAAE,WAAW,GAAG,KAAK,CAAC;AAE5C,MAAM,YAAY,GAAG,KAAK,WAAU,MAAkB,EAAE,IAAgB,EAAE,CAAS,EAAE,CAA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AAA;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,UAAU,CAAC,OAAkB,EAAE,KAAgB,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa;IAC3G,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3C,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACzD,CAAC;AACD,UAAU,CAAC,CAAC,GAAG,WAAW,CAAC;AAC3B,UAAU,CAAC,IAAI,GAAG,cAAmB,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AACzD,UAAU,CAAC,QAAQ,GAAG,UAAS,IAAyG;IACpI,IAAI,UAAU,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KAAE;IAC5D,YAAY,GAAG,IAAI,CAAC;AACxB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC"}

View File

@ -13,6 +13,9 @@ function toUint256(value) {
} }
/** /**
* A Signature @TODO * A Signature @TODO
*
*
* @_docloc: api/crypto:Signing
*/ */
export class Signature { export class Signature {
#r; #r;

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,8 @@
/**
* Add details about signing here.
*
* @_subsection: api/crypto:Signing [about-signing]
*/
import * as secp256k1 from "@noble/secp256k1"; import * as secp256k1 from "@noble/secp256k1";
import { concat, dataLength, getBytes, getBytesCopy, hexlify, toBeHex, assertArgument } from "../utils/index.js"; import { concat, dataLength, getBytes, getBytesCopy, hexlify, toBeHex, assertArgument } from "../utils/index.js";
import { computeHmac } from "./hmac.js"; import { computeHmac } from "./hmac.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ACJ"}

View File

@ -1,7 +1,7 @@
/** /**
* About hashing here... * About hashing here...
* *
* @_section: api/hashing:Hashing Utilities [hashing] * @_section: api/hashing:Hashing Utilities [about-hashing]
*/ */
export { id } from "./id.js"; export { id } from "./id.js";
export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js"; export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js";

View File

@ -148,7 +148,7 @@ const _formatTransactionReceipt = object({
cumulativeGasUsed: getBigInt, cumulativeGasUsed: getBigInt,
effectiveGasPrice: allowNull(getBigInt), effectiveGasPrice: allowNull(getBigInt),
status: allowNull(getNumber), status: allowNull(getNumber),
type: getNumber type: allowNull(getNumber, 0)
}, { }, {
effectiveGasPrice: ["gasPrice"], effectiveGasPrice: ["gasPrice"],
hash: ["transactionHash"], hash: ["transactionHash"],

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/** /**
* About providers. * About providers.
* *
* @_section: api/providers:Providers [providers] * @_section: api/providers:Providers [about-providers]
*/ */
export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js";
export { AbstractSigner, VoidSigner, } from "./abstract-signer.js"; export { AbstractSigner, VoidSigner, } from "./abstract-signer.js";

View File

@ -15,6 +15,7 @@ import { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js";
import { AbstractSigner } from "./abstract-signer.js"; import { AbstractSigner } from "./abstract-signer.js";
import { Network } from "./network.js"; import { Network } from "./network.js";
import { FilterIdEventSubscriber, FilterIdPendingSubscriber } from "./subscriber-filterid.js"; import { FilterIdEventSubscriber, FilterIdPendingSubscriber } from "./subscriber-filterid.js";
import { PollingEventSubscriber } from "./subscriber-polling.js";
const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g);
//const Methods = "getAddress,then".split(/,/g); //const Methods = "getAddress,then".split(/,/g);
function deepCopy(value) { function deepCopy(value) {
@ -419,6 +420,9 @@ export class JsonRpcApiProvider extends AbstractProvider {
return new FilterIdPendingSubscriber(this); return new FilterIdPendingSubscriber(this);
} }
if (sub.type === "event") { if (sub.type === "event") {
if (this._getOption("polling")) {
return new PollingEventSubscriber(this, sub.filter);
}
return new FilterIdEventSubscriber(this, sub.filter); return new FilterIdEventSubscriber(this, sub.filter);
} }
// Orphaned Logs are handled automatically, by the filter, since // Orphaned Logs are handled automatically, by the filter, since
@ -574,74 +578,6 @@ export class JsonRpcApiProvider extends AbstractProvider {
const e = AbiCoder.getBuiltinCallException((method === "eth_call") ? "call" : "estimateGas", (payload.params[0]), (result ? result.data : null)); const e = AbiCoder.getBuiltinCallException((method === "eth_call") ? "call" : "estimateGas", (payload.params[0]), (result ? result.data : null));
e.info = { error, payload }; e.info = { error, payload };
return e; return e;
/*
let message = "missing revert data during JSON-RPC call";
const action = <"call" | "estimateGas" | "unknown">(({ eth_call: "call", eth_estimateGas: "estimateGas" })[method] || "unknown");
let data: null | string = null;
let reason: null | string = null;
const transaction = <{ from: string, to: string, data: string }>((<any>payload).params[0]);
const invocation = null;
let revert: null | { signature: string, name: string, args: Array<any> } = null;
if (result) {
// @TODO: Extract errorSignature, errorName, errorArgs, reason if
// it is Error(string) or Panic(uint25)
message = "execution reverted during JSON-RPC call";
data = result.data;
let bytes = getBytes(data);
if (bytes.length % 32 !== 4) {
message += " (could not parse reason; invalid data length)";
} else if (data.substring(0, 10) === "0x08c379a0") {
// Error(string)
try {
if (bytes.length < 68) { throw new Error("bad length"); }
bytes = bytes.slice(4);
const pointer = getNumber(hexlify(bytes.slice(0, 32)));
bytes = bytes.slice(pointer);
if (bytes.length < 32) { throw new Error("overrun"); }
const length = getNumber(hexlify(bytes.slice(0, 32)));
bytes = bytes.slice(32);
if (bytes.length < length) { throw new Error("overrun"); }
reason = toUtf8String(bytes.slice(0, length));
revert = {
signature: "Error(string)",
name: "Error",
args: [ reason ]
};
message += `: ${ JSON.stringify(reason) }`;
} catch (error) {
console.log(error);
message += " (could not parse reason; invalid data length)";
}
} else if (data.substring(0, 10) === "0x4e487b71") {
// Panic(uint256)
try {
if (bytes.length !== 36) { throw new Error("bad length"); }
const arg = getNumber(hexlify(bytes.slice(4)));
revert = {
signature: "Panic(uint256)",
name: "Panic",
args: [ arg ]
};
reason = `Panic due to ${ PanicReasons.get(Number(arg)) || "UNKNOWN" }(${ arg })`;
message += `: ${ reason }`;
} catch (error) {
console.log(error);
message += " (could not parse panic reason)";
}
}
}
return makeError(message, "CALL_EXCEPTION", {
action, data, reason, transaction, invocation, revert,
info: { payload, error }
});
*/
} }
// Only estimateGas and call can return arbitrary contract-defined text, so now we // Only estimateGas and call can return arbitrary contract-defined text, so now we
// we can process text safely. // we can process text safely.
@ -666,7 +602,7 @@ export class JsonRpcApiProvider extends AbstractProvider {
const transaction = (payload.params[0]); const transaction = (payload.params[0]);
if (message.match(/insufficient funds|base fee exceeds gas limit/i)) { if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {
return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", {
transaction transaction, info: { error }
}); });
} }
if (message.match(/nonce/i) && message.match(/too low/i)) { if (message.match(/nonce/i) && message.match(/too low/i)) {
@ -684,7 +620,7 @@ export class JsonRpcApiProvider extends AbstractProvider {
} }
if (message.match(/the method .* does not exist/i)) { if (message.match(/the method .* does not exist/i)) {
return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { return makeError("unsupported operation", "UNSUPPORTED_OPERATION", {
operation: payload.method operation: payload.method, info: { error }
}); });
} }
return makeError("could not coalesce error", "UNKNOWN_ERROR", { error }); return makeError("could not coalesce error", "UNKNOWN_ERROR", { error });

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,4 @@
import { isError } from "../utils/index.js";
import { PollingEventSubscriber } from "./subscriber-polling.js"; import { PollingEventSubscriber } from "./subscriber-polling.js";
function copy(obj) { function copy(obj) {
return JSON.parse(JSON.stringify(obj)); return JSON.parse(JSON.stringify(obj));
@ -38,11 +39,24 @@ export class FilterIdSubscriber {
} }
async #poll(blockNumber) { async #poll(blockNumber) {
try { try {
// Subscribe if necessary
if (this.#filterIdPromise == null) { if (this.#filterIdPromise == null) {
this.#filterIdPromise = this._subscribe(this.#provider); this.#filterIdPromise = this._subscribe(this.#provider);
} }
const filterId = await this.#filterIdPromise; // Get the Filter ID
let filterId = null;
try {
filterId = await this.#filterIdPromise;
}
catch (error) {
if (!isError(error, "UNSUPPORTED_OPERATION") || error.operation !== "eth_newFilter") {
throw error;
}
}
// The backend does not support Filter ID; downgrade to
// polling
if (filterId == null) { if (filterId == null) {
this.#filterIdPromise = null;
this.#provider._recoverSubscriber(this, this._recover(this.#provider)); this.#provider._recoverSubscriber(this, this._recover(this.#provider));
return; return;
} }

View File

@ -1 +1 @@
{"version":3,"file":"subscriber-filterid.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAQjE,SAAS,IAAI,CAAC,GAAQ;IAClB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,kBAAkB;IAC3B,SAAS,CAAqB;IAE9B,gBAAgB,CAAyB;IACzC,OAAO,CAA+B;IAEtC,QAAQ,CAAU;IAElB,QAAQ,CAAiB;IAEzB,MAAM,CAAU;IAEhB,YAAY,QAA4B;QACpC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,CAAC,QA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E,MAAmB;QACzD,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED,QAAQ,CAAC,QAA0B;QAC/B,OAAO,IAAI,sBAAsB,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAA4B;QACzC,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,CAAE,IAAI,CAAC,MAAM,CAAE,CAAC,CAAC;QACvE,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA4B,EAAE,OAAmB;QAChE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC5E;IACL,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,OAAO,yBAA0B,SAAQ,kBAAkB;IAC7D,KAAK,CAAC,UAAU,CAAC,QAA4B;QACzC,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAG,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA4B,EAAE,OAAmB;QAChE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;SACpC;IACL,CAAC;CACJ"}

View File

@ -1,7 +1,7 @@
/** /**
* Transactions.. * Transactions..
* *
* @_section api/transaction:Transactions [transactions] * @_section api/transaction:Transactions [about-transactions]
*/ */
null; null;
export { accessListify } from "./accesslist.js"; export { accessListify } from "./accesslist.js";

View File

@ -9,6 +9,19 @@
import { getBytes, getBytesCopy } from "./data.js"; import { getBytes, getBytesCopy } from "./data.js";
/** /**
* Decodes the base-64 encoded %%value%%. * Decodes the base-64 encoded %%value%%.
*
* @example:
* // The decoded value is always binary data...
* result = decodeBase64("SGVsbG8gV29ybGQhIQ==")
* //_result:
*
* // ...use toUtf8String to convert it to a string.
* toUtf8String(result)
* //_result:
*
* // Decoding binary data
* decodeBase64("EjQ=")
* //_result:
*/ */
export function decodeBase64(value) { export function decodeBase64(value) {
return getBytesCopy(Buffer.from(value, "base64")); return getBytesCopy(Buffer.from(value, "base64"));
@ -16,6 +29,23 @@ export function decodeBase64(value) {
; ;
/** /**
* Encodes %%data%% as a base-64 encoded string. * Encodes %%data%% as a base-64 encoded string.
*
* @example:
* // Encoding binary data as a hexstring
* encodeBase64("0x1234")
* //_result:
*
* // Encoding binary data as a Uint8Array
* encodeBase64(new Uint8Array([ 0x12, 0x34 ]))
* //_result:
*
* // The input MUST be data...
* encodeBase64("Hello World!!")
* //_error:
*
* // ...use toUtf8Bytes for this.
* encodeBase64(toUtf8Bytes("Hello World!!"))
* //_result:
*/ */
export function encodeBase64(data) { export function encodeBase64(data) {
return Buffer.from(getBytes(data)).toString("base64"); return Buffer.from(getBytes(data)).toString("base64");

View File

@ -1 +1 @@
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAKnD;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACtC,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC;AAAA,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAe;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC"} {"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAKnD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACtC,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC;AAAA,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,YAAY,CAAC,IAAe;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC"}

View File

@ -145,7 +145,7 @@ function zeroPad(data, length, left) {
* Return the [[DataHexString]] of %%data%% padded on the **left** * Return the [[DataHexString]] of %%data%% padded on the **left**
* to %%length%% bytes. * to %%length%% bytes.
* *
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is
* thrown. * thrown.
* *
* This pads data the same as **values** are in Solidity * This pads data the same as **values** are in Solidity
@ -158,7 +158,7 @@ export function zeroPadValue(data, length) {
* Return the [[DataHexString]] of %%data%% padded on the **right** * Return the [[DataHexString]] of %%data%% padded on the **right**
* to %%length%% bytes. * to %%length%% bytes.
* *
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is
* thrown. * thrown.
* *
* This pads data the same as **bytes** are in Solidity * This pads data the same as **bytes** are in Solidity

View File

@ -3,7 +3,7 @@
* Ethereum and to simplify the library, without increasing * Ethereum and to simplify the library, without increasing
* the library dependencies for simple functions. * the library dependencies for simple functions.
* *
* @_section api/utils:Utilities [utils] * @_section api/utils:Utilities [about-utils]
*/ */
export { decodeBase58, encodeBase58 } from "./base58.js"; export { decodeBase58, encodeBase58 } from "./base58.js";
export { decodeBase64, encodeBase64 } from "./base64.js"; export { decodeBase64, encodeBase64 } from "./base64.js";

View File

@ -63,7 +63,7 @@ export function mask(_value, _bits) {
return value & ((BN_1 << bits) - BN_1); return value & ((BN_1 << bits) - BN_1);
} }
/** /**
* Gets a [[BigInt]] from %%value%%. If it is an invalid value for * Gets a BigInt from %%value%%. If it is an invalid value for
* a BigInt, then an ArgumentError will be thrown for %%name%%. * a BigInt, then an ArgumentError will be thrown for %%name%%.
*/ */
export function getBigInt(value, name) { export function getBigInt(value, name) {

View File

@ -50,7 +50,7 @@ export function formatUnits(value, unit) {
return FixedNumber.fromValue(value, decimals, { decimals }).toString(); return FixedNumber.fromValue(value, decimals, { decimals }).toString();
} }
/** /**
* Converts the //decimal string// %%value%% to a [[BigInt]], assuming * Converts the //decimal string// %%value%% to a BigInt, assuming
* %%unit%% decimal places. The %%unit%% may the number of decimal places * %%unit%% decimal places. The %%unit%% may the number of decimal places
* or the name of a unit (e.g. ``"gwei"`` for 9 decimal places). * or the name of a unit (e.g. ``"gwei"`` for 9 decimal places).
*/ */
@ -74,7 +74,7 @@ export function formatEther(wei) {
return formatUnits(wei, 18); return formatUnits(wei, 18);
} }
/** /**
* Converts the //decimal string// %%ether%% to a [[BigInt]], using 18 * Converts the //decimal string// %%ether%% to a BigInt, using 18
* decimal places. * decimal places.
*/ */
export function parseEther(ether) { export function parseEther(ether) {

Some files were not shown because too many files have changed in this diff Show More