admin: updated dist files

This commit is contained in:
Richard Moore 2022-09-29 22:57:27 -04:00
parent c1f86802fb
commit ad5b8da8bf
109 changed files with 2204 additions and 1027 deletions

683
dist/ethers.js vendored

@ -1,4 +1,4 @@
const version = "6.0.0-beta-exports.2";
const version = "6.0.0-beta-exports.3";
async function resolveProperties(value) {
const keys = Object.keys(value);
@ -10071,20 +10071,22 @@ const formatReceiptLog = object({
address: getAddress,
topics: arrayOf(formatHash),
data: formatData,
logIndex: getNumber,
index: getNumber,
blockHash: formatHash,
}, {
index: ["logIndex"]
});
const formatTransactionReceipt = object({
to: allowNull(getAddress, null),
from: allowNull(getAddress, null),
contractAddress: allowNull(getAddress, null),
transactionIndex: getNumber,
// should be allowNull(hash), but broken-EIP-658 support is handled in receipt
index: getNumber,
root: allowNull(hexlify),
gasUsed: getBigInt,
logsBloom: allowNull(formatData),
blockHash: formatHash,
transactionHash: formatHash,
hash: formatHash,
logs: arrayOf(formatReceiptLog),
blockNumber: getNumber,
confirmations: allowNull(getNumber, null),
@ -10093,7 +10095,9 @@ const formatTransactionReceipt = object({
status: allowNull(getNumber),
type: getNumber
}, {
effectiveGasPrice: ["gasPrice"]
effectiveGasPrice: ["gasPrice"],
hash: ["transactionHash"],
index: ["transactionIndex"],
});
function formatTransactionResponse(value) {
// Some clients (TestRPC) do strange things like return 0x0 for the
@ -10124,9 +10128,6 @@ function formatTransactionResponse(value) {
value: getBigInt,
nonce: getNumber,
data: formatData,
r: allowNull(formatUint256),
s: allowNull(formatUint256),
v: allowNull(getNumber),
creates: allowNull(getAddress, null),
chainId: allowNull(getBigInt, null)
}, {
@ -10140,7 +10141,16 @@ function formatTransactionResponse(value) {
// @TODO: Check fee data
// Add an access list to supported transaction types
if ((value.type === 1 || value.type === 2) && value.accessList == null) {
value.accessList = [];
result.accessList = [];
}
// Compute the signature
result.signature = Signature.from(value);
// Some backends omit ChainId on legacy transactions, but we can compute it
if (result.chainId == null) {
const chainId = result.signature.legacyChainId;
if (chainId != null) {
result.chainId = chainId;
}
}
// @TODO: check chainID
/*
@ -10427,7 +10437,7 @@ class Network {
static from(network) {
// Default network
if (network == null) {
return Network.from("homestead");
return Network.from("mainnet");
}
// Canonical name or chain ID
if (typeof (network) === "number") {
@ -10578,7 +10588,7 @@ class Block {
constructor(block, provider) {
this.#transactions = Object.freeze(block.transactions.map((tx) => {
if (typeof (tx) !== "string" && tx.provider !== provider) {
throw new Error("provider mismatch");
return (new TransactionResponse(tx, provider));
}
return tx;
}));
@ -10734,17 +10744,14 @@ class TransactionReceipt {
gasUsed;
cumulativeGasUsed;
gasPrice;
byzantium;
type;
//readonly byzantium!: boolean;
status;
root;
#logs;
constructor(tx, provider) {
this.#logs = Object.freeze(tx.logs.map((log) => {
if (provider !== log.provider) {
//return log.connect(provider);
throw new Error("provider mismatch");
}
return log;
return new Log(log, provider);
}));
defineProperties(this, {
provider,
@ -10759,7 +10766,8 @@ class TransactionReceipt {
gasUsed: tx.gasUsed,
cumulativeGasUsed: tx.cumulativeGasUsed,
gasPrice: (tx.effectiveGasPrice || tx.gasPrice),
byzantium: tx.byzantium,
type: tx.type,
//byzantium: tx.byzantium,
status: tx.status,
root: tx.root
});
@ -10769,10 +10777,13 @@ class TransactionReceipt {
// return new TransactionReceipt(this, provider);
//}
toJSON() {
const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, byzantium, status, root } = this;
const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,
status, root } = this;
return {
_type: "TransactionReceipt",
blockHash, blockNumber, byzantium, contractAddress,
blockHash, blockNumber,
//byzantium,
contractAddress,
cumulativeGasUsed: toJson(this.cumulativeGasUsed),
from,
gasPrice: toJson(this.gasPrice),
@ -11864,9 +11875,9 @@ class AbstractProvider {
async getCode(address, blockTag) {
return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag));
}
async getStorageAt(address, _position, blockTag) {
async getStorage(address, _position, blockTag) {
const position = getBigInt(_position, "position");
return hexlify(await this.#getAccountValue({ method: "getStorageAt", position }, address, blockTag));
return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag));
}
// Write
async broadcastTransaction(signedTx) {
@ -12639,7 +12650,7 @@ class BaseEtherscanProvider extends AbstractProvider {
return this.#plugin.baseUrl;
}
switch (this.network.name) {
case "homestead":
case "mainnet":
return "https:/\/api.etherscan.io";
case "ropsten":
return "https:/\/api-ropsten.etherscan.io";
@ -12889,7 +12900,7 @@ class BaseEtherscanProvider extends AbstractProvider {
address: req.address,
tag: req.blockTag
});
case "getStorageAt":
case "getStorage":
return this.fetch("proxy", {
action: "eth_getStorageAt",
address: req.address,
@ -13011,7 +13022,7 @@ class BaseEtherscanProvider extends AbstractProvider {
return this.network;
}
async getEtherPrice() {
if (this.network.name !== "homestead") {
if (this.network.name !== "mainnet") {
return 0.0;
}
return parseFloat((await this.fetch("stats", { action: "ethprice" })).ethusd);
@ -13058,7 +13069,7 @@ function injectCommonNetworks() {
});
}
}
registerEth("homestead", 1, { ensNetwork: 1, altNames: ["mainnet"] });
registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] });
registerEth("ropsten", 3, { ensNetwork: 3 });
registerEth("rinkeby", 4, { ensNetwork: 4 });
registerEth("goerli", 5, { ensNetwork: 5 });
@ -13151,7 +13162,7 @@ function normalize(provider, value, req) {
return getNumber(value).toString();
case "getCode":
return hexlify(value);
case "getStorageAt":
case "getStorage":
return hexlify(value);
case "getBlock":
if (req.includeTransactions) {
@ -13409,7 +13420,7 @@ class FallbackProvider extends AbstractProvider {
case "getBalance":
case "getTransactionCount":
case "getCode":
case "getStorageAt":
case "getStorage":
case "getTransaction":
case "getTransactionReceipt":
case "getLogs":
@ -13794,72 +13805,15 @@ class JsonRpcSigner extends AbstractSigner {
*/
class JsonRpcApiProvider extends AbstractProvider {
#options;
// The next ID to use for the JSON-RPC ID field
#nextId;
// Payloads are queued and triggered in batches using the drainTimer
#payloads;
#ready;
#starting;
#drainTimer;
#notReady;
#network;
constructor(network, options) {
super(network);
this.#ready = false;
this.#starting = null;
this.#nextId = 1;
this.#options = Object.assign({}, defaultOptions, options || {});
this.#payloads = [];
this.#drainTimer = null;
this.#network = null;
// This could be relaxed in the future to just check equivalent networks
const staticNetwork = this._getOption("staticNetwork");
if (staticNetwork) {
if (staticNetwork !== network) {
throwArgumentError("staticNetwork MUST match network object", "options", options);
}
this.#network = staticNetwork;
}
}
/**
* Returns the value associated with the option %%key%%.
*
* Sub-classes can use this to inquire about configuration options.
*/
_getOption(key) {
return this.#options[key];
}
get _network() {
if (!this.#network) {
throwError("network is not available yet", "NETWORK_ERROR");
}
return this.#network;
}
get ready() { return this.#ready; }
async _start() {
if (this.#ready) {
return;
}
if (this.#starting) {
return this.#starting;
}
this.#starting = (async () => {
// Bootstrap the network
if (this.#network == null) {
try {
this.#network = await this._detectNetwork();
}
catch (error) {
console.log("JsonRpcProvider failed to startup; retry in 1s");
await stall$2(1000);
this.#starting = null;
}
}
this.#ready = true;
this.#starting = null;
// Start dispatching requests
this.#scheduleDrain();
})();
}
#scheduleDrain() {
if (this.#drainTimer || !this.ready) {
if (this.#drainTimer) {
return;
}
// If we aren't using batching, no hard in sending it immeidately
@ -13916,31 +13870,46 @@ class JsonRpcApiProvider extends AbstractProvider {
}
}, stallTime);
}
/**
* Requests the %%method%% with %%params%% via the JSON-RPC protocol
* over the underlying channel. This can be used to call methods
* on the backend that do not have a high-level API within the Provider
* API.
*
* This method queues requests according to the batch constraints
* in the options, assigns the request a unique ID.
*
* **Do NOT override** this method in sub-classes; instead
* override [[_send]] or force the options values in the
* call to the constructor to modify this method's behavior.
*/
send(method, params) {
// @TODO: cache chainId?? purge on switch_networks
const id = this.#nextId++;
const promise = new Promise((resolve, reject) => {
this.#payloads.push({
resolve, reject,
payload: { method, params, id, jsonrpc: "2.0" }
constructor(network, options) {
super(network);
this.#nextId = 1;
this.#options = Object.assign({}, defaultOptions, options || {});
this.#payloads = [];
this.#drainTimer = null;
this.#network = null;
{
let resolve = null;
const promise = new Promise((_resolve) => {
resolve = _resolve;
});
});
// If there is not a pending drainTimer, set one
this.#scheduleDrain();
return promise;
this.#notReady = { promise, resolve };
}
// This could be relaxed in the future to just check equivalent networks
const staticNetwork = this._getOption("staticNetwork");
if (staticNetwork) {
if (staticNetwork !== network) {
throwArgumentError("staticNetwork MUST match network object", "options", options);
}
this.#network = staticNetwork;
}
}
/**
* Returns the value associated with the option %%key%%.
*
* Sub-classes can use this to inquire about configuration options.
*/
_getOption(key) {
return this.#options[key];
}
/**
* Gets the [[Network]] this provider has committed to. On each call, the network
* is detected, and if it has changed, the call will reject.
*/
get _network() {
if (!this.#network) {
throwError("network is not available yet", "NETWORK_ERROR");
}
return this.#network;
}
/**
* Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel.
@ -13953,44 +13922,40 @@ class JsonRpcApiProvider extends AbstractProvider {
});
}
/**
* Resolves to the [[Signer]] account for %%address%% managed by
* the client.
* Resolves to the non-normalized value by performing %%req%%.
*
* If the %%address%% is a number, it is used as an index in the
* the accounts from [[listAccounts]].
*
* This can only be used on clients which manage accounts (such as
* Geth with imported account or MetaMask).
*
* Throws if the account doesn't exist.
* Sub-classes may override this to modify behavior of actions,
* and should generally call ``super._perform`` as a fallback.
*/
async getSigner(address = 0) {
const accountsPromise = this.send("eth_accounts", []);
// Account index
if (typeof (address) === "number") {
const accounts = (await accountsPromise);
if (address > accounts.length) {
throw new Error("no such account");
}
return new JsonRpcSigner(this, accounts[address]);
}
const { accounts } = await resolveProperties({
network: this.getNetwork(),
accounts: accountsPromise
});
// Account address
address = getAddress(address);
for (const account of accounts) {
if (getAddress(account) === account) {
return new JsonRpcSigner(this, account);
async _perform(req) {
// Legacy networks do not like the type field being passed along (which
// is fair), so we delete type if it is 0 and a non-EIP-1559 network
if (req.method === "call" || req.method === "estimateGas") {
let tx = req.transaction;
if (tx && tx.type != null && getBigInt(tx.type)) {
// If there are no EIP-1559 properties, it might be non-EIP-a559
if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {
const feeData = await this.getFeeData();
if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {
// Network doesn't know about EIP-1559 (and hence type)
req = Object.assign({}, req, {
transaction: Object.assign({}, tx, { type: undefined })
});
}
}
}
}
throw new Error("invalid account");
const request = this.getRpcRequest(req);
if (request != null) {
return await this.send(request.method, request.args);
}
return super._perform(req);
}
/** Sub-classes can override this; it detects the *actual* network that
/** Sub-classes may override this; it detects the *actual* network that
* we are **currently** connected to.
*
* Keep in mind that [[send]] may only be used once [[ready]].
* Keep in mind that [[send]] may only be used once [[ready]], otherwise the
* _send primitive must be used instead.
*/
async _detectNetwork() {
const network = this._getOption("staticNetwork");
@ -14006,17 +13971,63 @@ class JsonRpcApiProvider extends AbstractProvider {
id: this.#nextId++, method: "eth_chainId", params: [], jsonrpc: "2.0"
};
this.emit("debug", { action: "sendRpcPayload", payload });
const result = (await this._send(payload))[0];
let result;
try {
result = (await this._send(payload))[0];
}
catch (error) {
this.emit("debug", { action: "receiveRpcError", error });
throw error;
}
this.emit("debug", { action: "receiveRpcResult", result });
if ("result" in result) {
return Network.from(getBigInt(result.result));
}
throw this.getRpcError(payload, result);
}
/**
* Sub-classes **MUST** call this. Until [[_start]] has been called, no calls
* will be passed to [[_send]] from [[send]]. If it is overridden, then
* ``super._start()`` **MUST** be called.
*
* Calling it multiple times is safe and has no effect.
*/
_start() {
if (this.#notReady == null || this.#notReady.resolve == null) {
return;
}
this.#notReady.resolve();
this.#notReady = null;
(async () => {
// Bootstrap the network
while (this.#network == null) {
try {
this.#network = await this._detectNetwork();
}
catch (error) {
console.log("JsonRpcProvider failed to startup; retry in 1s");
await stall$2(1000);
}
}
// Start dispatching requests
this.#scheduleDrain();
})();
}
/**
* Resolves once the [[_start]] has been called. This can be used in
* sub-classes to defer sending data until the connection has been
* established.
*/
async _waitUntilReady() {
if (this.#notReady == null) {
return;
}
return await this.#notReady.promise;
}
/**
* Return a Subscriber that will manage the %%sub%%.
*
* Sub-classes can override this to modify the behavior of
* Sub-classes may override this to modify the behavior of
* subscription management.
*/
_getSubscriber(sub) {
@ -14034,6 +14045,10 @@ class JsonRpcApiProvider extends AbstractProvider {
}
return super._getSubscriber(sub);
}
/**
* Returns true only if the [[_start]] has been called.
*/
get ready() { return this.#notReady == null; }
/**
* Returns %%tx%% as a normalized JSON-RPC transaction request,
* which has all values hexlified and any numeric values converted
@ -14092,7 +14107,7 @@ class JsonRpcApiProvider extends AbstractProvider {
method: "eth_getCode",
args: [getLowerCase(req.address), req.blockTag]
};
case "getStorageAt":
case "getStorage":
return {
method: "eth_getStorageAt",
args: [
@ -14209,34 +14224,65 @@ class JsonRpcApiProvider extends AbstractProvider {
return makeError("could not coalesce error", "UNKNOWN_ERROR", { error });
}
/**
* Resolves to the non-normalized value by performing %%req%%.
* Requests the %%method%% with %%params%% via the JSON-RPC protocol
* over the underlying channel. This can be used to call methods
* on the backend that do not have a high-level API within the Provider
* API.
*
* Sub-classes may override this to modify behavior of actions,
* and should generally call ``super._perform`` as a fallback.
* This method queues requests according to the batch constraints
* in the options, assigns the request a unique ID.
*
* **Do NOT override** this method in sub-classes; instead
* override [[_send]] or force the options values in the
* call to the constructor to modify this method's behavior.
*/
async _perform(req) {
// Legacy networks do not like the type field being passed along (which
// is fair), so we delete type if it is 0 and a non-EIP-1559 network
if (req.method === "call" || req.method === "estimateGas") {
let tx = req.transaction;
if (tx && tx.type != null && getBigInt(tx.type)) {
// If there are no EIP-1559 properties, it might be non-EIP-a559
if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {
const feeData = await this.getFeeData();
if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {
// Network doesn't know about EIP-1559 (and hence type)
req = Object.assign({}, req, {
transaction: Object.assign({}, tx, { type: undefined })
});
}
}
send(method, params) {
// @TODO: cache chainId?? purge on switch_networks
const id = this.#nextId++;
const promise = new Promise((resolve, reject) => {
this.#payloads.push({
resolve, reject,
payload: { method, params, id, jsonrpc: "2.0" }
});
});
// If there is not a pending drainTimer, set one
this.#scheduleDrain();
return promise;
}
/**
* Resolves to the [[Signer]] account for %%address%% managed by
* the client.
*
* If the %%address%% is a number, it is used as an index in the
* the accounts from [[listAccounts]].
*
* This can only be used on clients which manage accounts (such as
* Geth with imported account or MetaMask).
*
* Throws if the account doesn't exist.
*/
async getSigner(address = 0) {
const accountsPromise = this.send("eth_accounts", []);
// Account index
if (typeof (address) === "number") {
const accounts = (await accountsPromise);
if (address > accounts.length) {
throw new Error("no such account");
}
return new JsonRpcSigner(this, accounts[address]);
}
const { accounts } = await resolveProperties({
network: this.getNetwork(),
accounts: accountsPromise
});
// Account address
address = getAddress(address);
for (const account of accounts) {
if (getAddress(account) === account) {
return new JsonRpcSigner(this, account);
}
}
const request = this.getRpcRequest(req);
if (request != null) {
return await this.send(request.method, request.args);
}
return super._perform(req);
throw new Error("invalid account");
}
}
/**
@ -14263,16 +14309,19 @@ class JsonRpcProvider extends JsonRpcApiProvider {
}
this.#pollingInterval = 4000;
}
_getConnection() {
return this.#connect.clone();
}
async send(method, params) {
// All requests are over HTTP, so we can just start handling requests
// We do this here rather than the constructor so that we don't send any
// requests to the network until we absolutely have to.
// requests to the network (i.e. eth_chainId) until we absolutely have to.
await this._start();
return await super.send(method, params);
}
async _send(payload) {
// Configure a POST connection for the requested method
const request = this.#connect.clone();
const request = this._getConnection();
request.body = JSON.stringify(payload);
const response = await request.send();
response.assertOk();
@ -14356,7 +14405,7 @@ function spelunkMessage(value) {
const defaultApiKey$1 = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";
function getHost$2(name) {
switch (name) {
case "homestead":
case "mainnet":
return "eth-mainnet.alchemyapi.io";
case "ropsten":
return "eth-ropsten.alchemyapi.io";
@ -14383,7 +14432,7 @@ function getHost$2(name) {
}
class AlchemyProvider extends JsonRpcProvider {
apiKey;
constructor(_network = "homestead", apiKey) {
constructor(_network = "mainnet", apiKey) {
const network = Network.from(_network);
if (apiKey == null) {
apiKey = defaultApiKey$1;
@ -14447,7 +14496,7 @@ class AlchemyProvider extends JsonRpcProvider {
const defaultApiKey = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";
function getHost$1(name) {
switch (name) {
case "homestead":
case "mainnet":
return "rpc.ankr.com/eth";
case "ropsten":
return "rpc.ankr.com/eth_ropsten";
@ -14464,7 +14513,7 @@ function getHost$1(name) {
}
class AnkrProvider extends JsonRpcProvider {
apiKey;
constructor(_network = "homestead", apiKey) {
constructor(_network = "mainnet", apiKey) {
const network = Network.from(_network);
if (apiKey == null) {
apiKey = defaultApiKey;
@ -14502,9 +14551,9 @@ class AnkrProvider extends JsonRpcProvider {
}
class CloudflareProvider extends JsonRpcProvider {
constructor(_network = "homestead") {
constructor(_network = "mainnet") {
const network = Network.from(_network);
if (network.name !== "homestead") {
if (network.name !== "mainnet") {
return throwArgumentError("unsupported network", "network", _network);
}
super("https:/\/cloudflare-eth.com/", network, { staticNetwork: network });
@ -14531,82 +14580,20 @@ class EtherscanProvider extends BaseEtherscanProvider {
}
}
const defaultProjectId = "84842078b09946638c03157f83405213";
function getHost(name) {
switch (name) {
case "homestead":
return "mainnet.infura.io";
case "ropsten":
return "ropsten.infura.io";
case "rinkeby":
return "rinkeby.infura.io";
case "kovan":
return "kovan.infura.io";
case "goerli":
return "goerli.infura.io";
case "matic":
return "polygon-mainnet.infura.io";
case "maticmum":
return "polygon-mumbai.infura.io";
case "optimism":
return "optimism-mainnet.infura.io";
case "optimism-kovan":
return "optimism-kovan.infura.io";
case "arbitrum":
return "arbitrum-mainnet.infura.io";
case "arbitrum-rinkeby":
return "arbitrum-rinkeby.infura.io";
function getGlobal() {
if (typeof self !== 'undefined') {
return self;
}
return throwArgumentError("unsupported network", "network", name);
if (typeof window !== 'undefined') {
return window;
}
if (typeof global !== 'undefined') {
return global;
}
throw new Error('unable to locate global object');
}
class InfuraProvider extends JsonRpcProvider {
projectId;
projectSecret;
constructor(_network = "homestead", projectId, projectSecret) {
const network = Network.from(_network);
if (projectId == null) {
projectId = defaultProjectId;
}
if (projectSecret == null) {
projectSecret = null;
}
const request = InfuraProvider.getRequest(network, projectId, projectSecret);
super(request, network, { staticNetwork: network });
defineProperties(this, { projectId, projectSecret });
}
_getProvider(chainId) {
try {
return new InfuraProvider(chainId, this.projectId, this.projectSecret);
}
catch (error) { }
return super._getProvider(chainId);
}
static getRequest(network, projectId, projectSecret) {
if (projectId == null) {
projectId = defaultProjectId;
}
if (projectSecret == null) {
projectSecret = null;
}
const request = new FetchRequest(`https:/\/${getHost(network.name)}/v3/${projectId}`);
request.allowGzip = true;
if (projectSecret) {
request.setCredentials("", projectSecret);
}
if (projectId === defaultProjectId) {
request.retryFunc = async (request, response, attempt) => {
showThrottleMessage("InfuraProvider");
return true;
};
}
return request;
}
isCommunityResource() {
return (this.projectId === defaultProjectId);
}
}
const IpcSocketProvider = undefined;
;
const _WebSocket = getGlobal().WebSocket;
/**
* SocketProvider
@ -14765,9 +14752,13 @@ class SocketProvider extends JsonRpcApiProvider {
// WebSocket provider doesn't accept batches
assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload);
// @TODO: stringify payloads here and store to prevent mutations
// Prepare a promise to respond to
const promise = new Promise((resolve, reject) => {
this.#callbacks.set(payload.id, { payload, resolve, reject });
});
// Wait until the socket is connected before writing to it
await this._waitUntilReady();
// Write the request to the socket
await this._write(JSON.stringify(payload));
return [await promise];
}
@ -14795,17 +14786,19 @@ class SocketProvider extends JsonRpcApiProvider {
return;
}
this.#callbacks.delete(result.id);
if ("error" in result) {
const { message, code, data } = result.error;
const error = makeError(message || "unkonwn error", "SERVER_ERROR", {
request: `ws:${JSON.stringify(callback.payload)}`,
info: { code, data }
});
callback.reject(error);
}
else {
callback.resolve(result.result);
}
callback.resolve(result);
/*
if ("error" in result) {
const { message, code, data } = result.error;
const error = makeError(message || "unkonwn error", "SERVER_ERROR", {
request: `ws:${ JSON.stringify(callback.payload) }`,
info: { code, data }
});
callback.reject(error);
} else {
callback.resolve(result.result);
}
*/
}
else if (result.method === "eth_subscription") {
const filterId = result.params.subscription;
@ -14828,25 +14821,14 @@ class SocketProvider extends JsonRpcApiProvider {
}
}
function getGlobal() {
if (typeof self !== 'undefined') {
return self;
}
if (typeof window !== 'undefined') {
return window;
}
if (typeof global !== 'undefined') {
return global;
}
throw new Error('unable to locate global object');
}
;
const _WebSocket = getGlobal().WebSocket;
class WebSocketProvider extends SocketProvider {
url;
#websocket;
get websocket() { return this.#websocket; }
get websocket() {
if (this.#websocket == null) {
throw new Error("websocket closed");
}
return this.#websocket;
}
constructor(url, network) {
super(network);
if (typeof (url) === "string") {
@ -14871,8 +14853,117 @@ class WebSocketProvider extends SocketProvider {
async _write(message) {
this.websocket.send(message);
}
async destroy() {
if (this.#websocket == null) {
return;
}
this.#websocket.close();
this.#websocket = null;
}
}
const defaultProjectId = "84842078b09946638c03157f83405213";
function getHost(name) {
switch (name) {
case "mainnet":
return "mainnet.infura.io";
case "ropsten":
return "ropsten.infura.io";
case "rinkeby":
return "rinkeby.infura.io";
case "kovan":
return "kovan.infura.io";
case "goerli":
return "goerli.infura.io";
case "matic":
return "polygon-mainnet.infura.io";
case "maticmum":
return "polygon-mumbai.infura.io";
case "optimism":
return "optimism-mainnet.infura.io";
case "optimism-kovan":
return "optimism-kovan.infura.io";
case "arbitrum":
return "arbitrum-mainnet.infura.io";
case "arbitrum-rinkeby":
return "arbitrum-rinkeby.infura.io";
}
return throwArgumentError("unsupported network", "network", name);
}
class InfuraWebSocketProvider extends WebSocketProvider {
projectId;
projectSecret;
constructor(network, apiKey) {
const provider = new InfuraProvider(network, apiKey);
const req = provider._getConnection();
if (req.credentials) {
throwError("INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", {
operation: "InfuraProvider.getWebSocketProvider()"
});
}
const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/");
super(url, network);
defineProperties(this, {
projectId: provider.projectId,
projectSecret: provider.projectSecret
});
}
isCommunityResource() {
return (this.projectId === defaultProjectId);
}
}
class InfuraProvider extends JsonRpcProvider {
projectId;
projectSecret;
constructor(_network = "mainnet", projectId, projectSecret) {
const network = Network.from(_network);
if (projectId == null) {
projectId = defaultProjectId;
}
if (projectSecret == null) {
projectSecret = null;
}
const request = InfuraProvider.getRequest(network, projectId, projectSecret);
super(request, network, { staticNetwork: network });
defineProperties(this, { projectId, projectSecret });
}
_getProvider(chainId) {
try {
return new InfuraProvider(chainId, this.projectId, this.projectSecret);
}
catch (error) { }
return super._getProvider(chainId);
}
isCommunityResource() {
return (this.projectId === defaultProjectId);
}
static getWebSocketProvider(network, apiKey) {
return new InfuraWebSocketProvider(network, apiKey);
}
static getRequest(network, projectId, projectSecret) {
if (projectId == null) {
projectId = defaultProjectId;
}
if (projectSecret == null) {
projectSecret = null;
}
const request = new FetchRequest(`https:/\/${getHost(network.name)}/v3/${projectId}`);
request.allowGzip = true;
if (projectSecret) {
request.setCredentials("", projectSecret);
}
if (projectId === defaultProjectId) {
request.retryFunc = async (request, response, attempt) => {
showThrottleMessage("InfuraProvider");
return true;
};
}
return request;
}
}
const IpcSocketProvider = undefined;
/////
class EventLog extends Log {
@ -17499,6 +17590,20 @@ var ethers = /*#__PURE__*/Object.freeze({
solidityPackedKeccak256: solidityPackedKeccak256,
solidityPackedSha256: solidityPackedSha256,
TypedDataEncoder: TypedDataEncoder,
AbstractProvider: AbstractProvider,
FallbackProvider: FallbackProvider,
JsonRpcApiProvider: JsonRpcApiProvider,
JsonRpcProvider: JsonRpcProvider,
JsonRpcSigner: JsonRpcSigner,
AlchemyProvider: AlchemyProvider,
AnkrProvider: AnkrProvider,
CloudflareProvider: CloudflareProvider,
EtherscanProvider: EtherscanProvider,
InfuraProvider: InfuraProvider,
IpcSocketProvider: IpcSocketProvider,
SocketProvider: SocketProvider,
WebSocketProvider: WebSocketProvider,
Network: Network,
accessListify: accessListify,
computeAddress: computeAddress,
recoverAddress: recoverAddress,
@ -17574,21 +17679,7 @@ var ethers = /*#__PURE__*/Object.freeze({
LangEn: LangEn,
wordlists: wordlists,
WordlistOwl: WordlistOwl,
WordlistOwlA: WordlistOwlA,
AbstractProvider: AbstractProvider,
FallbackProvider: FallbackProvider,
JsonRpcApiProvider: JsonRpcApiProvider,
JsonRpcProvider: JsonRpcProvider,
JsonRpcSigner: JsonRpcSigner,
AlchemyProvider: AlchemyProvider,
AnkrProvider: AnkrProvider,
CloudflareProvider: CloudflareProvider,
EtherscanProvider: EtherscanProvider,
InfuraProvider: InfuraProvider,
IpcSocketProvider: IpcSocketProvider,
SocketProvider: SocketProvider,
WebSocketProvider: WebSocketProvider,
Network: Network
WordlistOwlA: WordlistOwlA
});
export { AbiCoder, AbstractProvider, AlchemyProvider, AnkrProvider, BaseContract, CloudflareProvider, ConstructorFragment, Contract, ContractEventPayload, ContractFactory, ContractTransactionReceipt, ContractTransactionResponse, ErrorFragment, EtherSymbol, EtherscanProvider, EventFragment, EventLog, FallbackProvider, FetchCancelSignal, FetchRequest, FetchResponse, FixedFormat, FixedNumber, Fragment, FunctionFragment, HDNodeVoidWallet, HDNodeWallet, HDNodeWalletManager, Indexed, InfuraProvider, Interface, IpcSocketProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, LangEn, LogDescription, MaxInt256, MaxUint256, MessagePrefix, MinInt256, Mnemonic, N$1 as N, NegativeOne, Network, One, ParamType, Result, Signature, SigningKey, SocketProvider, Transaction, TransactionDescription, Two, Typed, TypedDataEncoder, Utf8ErrorFuncs, Wallet, WebSocketProvider, WeiPerEther, Wordlist, WordlistOwl, WordlistOwlA, Zero, ZeroAddress, ZeroHash, _toEscapedUtf8String, accessListify, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, checkResultErrors, computeAddress, computeHmac, concat, dataLength, dataSlice, decodeBase58, decodeBase64, decodeRlp, decryptCrowdsaleJson, decryptKeystoreJson, decryptKeystoreJsonSync, defaultAbiCoder, defaultPath$1 as defaultPath, dnsEncode, encodeBase58, encodeBase64, encodeRlp, encryptKeystoreJson, ethers, formatBytes32String, formatEther, formatFixed, formatUnits, fromTwos, getAccountPath, getAddress, getBigInt, getBytes, getBytesCopy, getCreate2Address, getCreateAddress, getIcapAddress, getIpfsGatewayFunc, getNumber, hashMessage, hexlify, id, isBytesLike, isCallException, isCrowdsaleJson, isError, isHexString, isKeystoreJson, isValidName, keccak256, langEn, lock, makeError, mask, namehash, parseBytes32String, parseEther, parseFixed, parseUnits, pbkdf2, randomBytes, recoverAddress, ripemd160, scrypt, scryptSync, sha256, sha512, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, stripZerosLeft, throwArgumentError, throwError, toArray, toBigInt, toHex, toNumber, toQuantity, toTwos, toUtf8Bytes, toUtf8CodePoints, toUtf8String, version, wordlists, zeroPadBytes, zeroPadValue };

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

@ -145,7 +145,7 @@ const u64 = {
add, add3L, add3H, add4L, add4H, add5H, add5L,
};
const version = "6.0.0-beta-exports.2";
const version = "6.0.0-beta-exports.3";
function defineReadOnly(object, name, value) {
Object.defineProperty(object, name, {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,245 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.networkFeatureAtBlock = exports.networkNames = exports.testReceipt = exports.testTransaction = exports.testBlock = exports.testAddress = void 0;
;
exports.testAddress = {
mainnet: [
{
test: "old-account",
address: "0xAC1639CF97a3A46D431e6d1216f576622894cBB5",
balance: BigInt("4813414100000000"),
nonce: 3,
code: "0x"
}, {
test: "TheDAO-splitter-contract",
address: "0x3474627D4F63A678266BC17171D87f8570936622",
code: "0x606060405260e060020a60003504630b3ed5368114602e57806337b0574a14605257806356fa47f0146062575b005b602c6004356000546101009004600160a060020a03908116339091161460bb575b50565b60005460ff166060908152602090f35b602c60043560005460ff1615609657600160a060020a038116600034606082818181858883f193505050501515604f576002565b33600160a060020a0316600034606082818181858883f193505050501515604f576002565b600080546101009004600160a060020a03169082606082818181858883f193505050501515604f57600256",
storage: {
"0": "0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300"
}
}, {
test: "ricmoo.firefly.eth",
address: "0x8ba1f109551bD432803012645Ac136ddd64DBA72",
name: "ricmoo.firefly.eth"
},
],
goerli: []
};
exports.testBlock = {
mainnet: [
{
test: "old-homestead-block",
hash: "0x3d6122660cc824376f11ee842f83addc3525e2dd6756b9bcf0affa6aa88cf741",
parentHash: "0xb495a1d7e6663152ae92708da4843337b958146015a2802f4193a410044698c9",
number: 3,
timestamp: 1438270048,
nonce: "0x2e9344e0cbde83ce",
difficulty: BigInt(17154715646),
gasLimit: BigInt("0x1388"),
gasUsed: BigInt("0"),
miner: "0x5088D623ba0fcf0131E0897a91734A4D83596AA0",
extraData: "0x476574682f76312e302e302d66633739643332642f6c696e75782f676f312e34",
transactions: []
},
{
test: "london-block",
number: 14413999,
hash: "0x6c79356d40ebb6ed63dc19f5d407f8f1c876047b59dc1a4598cce0e64dcabec5",
parentHash: "0xbf09b0e215f247a5066d19ece5b4c66960771d45fae62985e8d751fb1adcfe2f",
timestamp: 1647654576,
nonce: "0xb4bc9979af5369fe",
difficulty: BigInt("12841513359509721"),
gasLimit: BigInt("30087914"),
gasUsed: BigInt("2008910"),
miner: "0x2A20380DcA5bC24D052acfbf79ba23e988ad0050",
extraData: "0x706f6f6c696e2e636f6d21f7092f019bb92a76",
baseFeePerGas: BigInt("40911884304"),
transactions: [
"0x1c3a398933db10634631f54b435c40c8805c13f12bbac7c3dab858ca44213fa2",
"0xd98947cbdd892cc7f679c903903e6d18a5c5afb19e94437beba79372ad71c347",
"0x4d66190deb55b5820cb0ce9adb972f646fa0f3e64eaeee674bbf3d054bf3d883",
"0x9db7bd5f4c91d6103c714bcbc35df3dc708daa668aaef7449b589dbd3be24dac",
"0x126a43ae4ade4b7fc5c8ac9ebd3dbcf7314f63c60f2804fb49aa25b5c7d80bb1",
"0x82a90aa4b3b1b7873b117c3ff1ca7165ae34b2fc0788cc0cbfd41805d588590d",
"0x7f694a6a9972457753ed3dec164f17272b1c8b1da4eab149df95e31a3e72f606",
"0xdce1cba1ff33f0c23881087d49de3b34fe84c8a6883f3edd75b04fc23e458aac",
"0xbe1c69f825279cebef42d1f0e07397dcddef7fb278b0195e295ede3e156836c4",
"0x1d2f007b3c0f894403973a30e5ffaa78589f873d963e9554c6bb1bd7a3127245",
"0x9c8c78191cf4ae9ae8eee1165153eabe24dbd8b9509b83d5f0caeea85251bb2f",
"0x42e956f4b3dd6535359b272a0d2dab995c364cb48baaf8d0a1981995f3f8c808",
"0xdc2c2e99393e24d5dc66e38665fa1d1ff007d92088ef3fd2549545fdbe862ef6",
"0xaad7be28fffd2e77e8e40bf57f2ac140aa8283ec93c7f3f61a82c79405602f53",
"0x4735f1421b7b30283e87e0799e82e54307d3e5ba14cd54ad8420b57577489a71",
"0x0b9d6aa23aa439b41e86595f2ad91f498adffa3e6e7cb26ac7d73252e59fd3de",
"0xcd93e19bd5d5c5a834fec613116fa01f46eddfd2faa20ef302271b874b9d812a",
"0x5bf1976574a637f5ac0b8bda1a792fa16cc7ce9624d32e9bd6bd9aa6a8f19d2f",
"0x2e778da4f66f10f7b681b605635c6599cdbeea167fc1c4396a097aef5d06de61",
"0xd5fd68eebc4c870ccda081786a74c75c250e9e2d8269b8935edb3adb11b80bb2",
"0x2aec42a11c1d8c1e5198d54aacbc6bebb09bcd5e78f6af81ea09d65c9064734a",
"0xbea2e364ea4959ec438d9ccc2d2f7120c7eaba3b177cc0d7df8ff65d866ef89f",
"0xf48bbb0f838353060da4126a555ce532abf497a9d1108001afffaac513a59ddf",
"0xf5664e4372cce62733a6610efb7701a4a0e552d81f8caa764d8474b3070c6617",
"0x9d3732ddbd20610008ff737da2f61120734a1cbfa864374bcbcf10051e6048cb",
"0xc4d0df5bc6fa51b34ac3c898866d779d4e51a6be4d13be1ec3084b7229b03b47",
"0x90c86ec98b8ad98049b4ee54cb3aa72c5ae743077b830e8a294aa5dc47a1fb18"
]
}
],
goerli: [],
};
exports.testTransaction = {
mainnet: [
{
test: "legacy",
hash: "0xccc90ab97a74c952fb3376c4a3efb566a58a10df62eb4d44a61e106fcf10ec61",
blockHash: "0x9653f180a5720f3634816eb945a6d722adee52cc47526f6357ac10adaf368135",
blockNumber: 4097745,
// index: 18,
type: 0,
from: "0x32DEF047DeFd076DB21A2D759aff2A591c972248",
gasPrice: BigInt("0x4a817c800"),
gasLimit: BigInt("0x3d090"),
to: "0x6fC21092DA55B392b045eD78F4732bff3C580e2c",
value: BigInt("0x186cc6acd4b0000"),
nonce: 0,
data: "0xf2c298be000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000067269636d6f6f0000000000000000000000000000000000000000000000000000",
signature: {
r: "0x1e5605197a03e3f0a168f14749168dfeefc44c9228312dacbffdcbbb13263265",
s: "0x269c3e5b3558267ad91b0a887d51f9f10098771c67b82ea6cb74f29638754f54",
yParity: 1,
v: 28,
networkV: BigInt(38),
},
creates: null,
chainId: BigInt(1)
},
{
test: "EIP-1559",
hash: "0x8ff41d0ba5d239acc8c123ff12451a2c15721c838f657e583d355999af4a4349",
blockHash: '0x9d4c3bef68e119841281105da96beb1c7252f357340d7a3355236b3332b197b0',
blockNumber: 12966000,
// index: 185,
type: 2,
from: '0x5afFBa12E9332bbc0E221c8E7BEf7CB7cfB3F281',
to: '0x2258CcD34ae29E6B199b6CD64eb2aEF157df7CdE',
gasLimit: BigInt("21000"),
nonce: 2,
data: '0x',
value: BigInt("1100000000000000"),
gasPrice: BigInt("70578812137"),
maxPriorityFeePerGas: BigInt("1000000000"),
maxFeePerGas: BigInt("131115411100"),
chainId: BigInt(1),
signature: {
r: "0xdd26e5478d0aa84e334a0393d335ab24b83de8ecae9290305f15ab884ded246c",
s: "0x6494b4f61b0d9a5a82ecb86d72b301f859f404f0bec9682bbfff619903ecfbe2",
yParity: 1,
v: 28,
networkV: null
},
creates: null,
accessList: []
}
],
goerli: []
};
exports.testReceipt = {
mainnet: [
{
test: "legacy",
//byzantium: false,
blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566",
blockNumber: 0x3c92b5,
type: 0,
contractAddress: null,
cumulativeGasUsed: BigInt(0x1cca2e),
from: "0x18C6045651826824FEBBD39d8560584078d1b247",
gasUsed: BigInt(0x14bb7),
gasPrice: BigInt(4100000000),
logs: [
{
address: "0x314159265dD8dbb310642f98f50C066173C1259b",
blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566",
blockNumber: 0x3c92b5,
data: "0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247",
index: 0x1a,
topics: [
"0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82",
"0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae",
"0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1"
],
transactionHash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616",
transactionIndex: 0x39,
},
{
address: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef",
blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566",
blockNumber: 0x3c92b5,
data: "0x000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000595a32ce",
index: 0x1b,
topics: [
"0x0f0c27adfd84b60b6f456b0e87cdccb1e5fb9603991588d87fa99f5b6b61e670",
"0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1",
"0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247"
],
transactionHash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616",
transactionIndex: 0x39,
}
],
logsBloom: "0x00000000000000040000000000100000010000000000000040000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200000010000000004000000000000000000000000000000000002000000000000000000000000400000000020000000000000000000000000000000000000004000000000000000000000000000000000000000000000000801000000000000000000000020000000000040000000040000000000000000002000000004000000000000000000000000000000000000000000000010000000000000000000000000000000000200000000000000000",
root: "0x9b550a9a640ce50331b64504ef87aaa7e2aaf97344acb6ff111f879b319d2590",
// Should be null for pre-byzantium, but some nodes have backfilled it
status: 1,
to: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef",
hash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616",
index: 0x39
}, {
test: "byzantium",
//byzantium: true,
blockHash: "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9",
blockNumber: 0x444f76,
type: 0,
contractAddress: null,
cumulativeGasUsed: BigInt(0x15bfe7),
from: "0x18C6045651826824FEBBD39d8560584078d1b247",
gasUsed: BigInt(0x1b968),
gasPrice: BigInt(1000000000),
logs: [
{
address: "0xb90E64082D00437e65A76d4c8187596BC213480a",
blockHash: "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9",
blockNumber: 0x444f76,
data: "0x",
index: 0x10,
topics: [
"0x748d071d1992ee1bfe7a39058114d0a50d5798fe8eb3a9bfb4687f024629a2ce",
"0x5574aa58f7191ccab6de6cf75fe2ea0484f010b852fdd8c6b7ae151d6c2f4b83"
],
transactionHash: "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac",
transactionIndex: 0x1e,
}
],
logsBloom: "0x00000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000800000000000000000800000000000000000000000000000000000000",
root: null,
status: 1,
to: "0xb90E64082D00437e65A76d4c8187596BC213480a",
hash: "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac",
index: 0x1e
}
],
goerli: []
};
exports.networkNames = [
"mainnet", "goerli"
];
function networkFeatureAtBlock(feature, block) {
switch (feature) {
case "byzantium":
return block >= 4370000;
default:
break;
}
throw new Error(`unknown feature: ${feature}`);
}
exports.networkFeatureAtBlock = networkFeatureAtBlock;
//# sourceMappingURL=blockchain-data.js.map

@ -0,0 +1 @@
{"version":3,"file":"blockchain-data.js","sourceRoot":"","sources":["../../src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":";;;AAuFC,CAAC;AAEW,QAAA,WAAW,GAAgE;IACpF,OAAO,EAAE;QACL;YACI,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,4CAA4C;YACrD,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC;YACnC,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,IAAI;SACb,EAAE;YACC,IAAI,EAAE,0BAA0B;YAChC,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,kdAAkd;YACxd,OAAO,EAAE;gBACL,GAAG,EAAE,oEAAoE;aAC5E;SACJ,EAAE;YACC,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,oBAAoB;SAC7B;KACJ;IACD,MAAM,EAAE,EACP;CACJ,CAAC;AAEW,QAAA,SAAS,GAA8D;IAChF,OAAO,EAAE;QACL;YACI,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,oEAAoE;YAC1E,UAAU,EAAE,oEAAoE;YAChF,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,UAAU;YACrB,KAAK,EAAE,oBAAoB;YAC3B,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC;YAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;YAC1B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC;YACpB,KAAK,EAAE,4CAA4C;YACnD,SAAS,EAAE,oEAAoE;YAC/E,YAAY,EAAE,EAAG;SACpB;QACD;YACI,IAAI,EAAE,cAAc;YACpB,M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,4CAA4C;oBACrD,SAAS,EAAE,oEAAoE;oBAC/E,WAAW,EAAE,QAAQ;oBACrB,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE;wBACJ,oEAAoE;wBACpE,oEAAoE;qBACvE;oBACD,eAAe,EAAE,oEAAoE;oBACrF,gBAAgB,EAAE,IAAI;iBACzB;aACJ;YACD,SAAS,EAAE,ogBAAogB;YAC/gB,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,CAAC;YACT,EAAE,EAAE,4CAA4C;YAChD,IAAI,EAAE,oEAAoE;YAC1E,KAAK,EAAE,IAAI;SACd;KACJ;IACD,MAAM,EAAE,EACP;CACJ,CAAC;AAEW,QAAA,YAAY,GAAiC;IACtD,SAAS,EAAE,QAAQ;CACtB,CAAC;AACF,SAAgB,qBAAqB,CAAC,OAAe,EAAE,KAAa;IAChE,QAAQ,OAAO,EAAE;QACb,KAAK,WAAW;YACZ,OAAO,KAAK,IAAI,OAAO,CAAC;QAC5B;YACI,MAAM;KACb;IACD,MAAM,IAAI,KAAK,CAAC,oBAAqB,OAAQ,EAAE,CAAC,CAAC;AACrD,CAAC;AARD,sDAQC"}

@ -1,9 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.connect = exports.getProvider = exports.getProviderNetworks = exports.providerNames = void 0;
exports.connect = exports.checkProvider = exports.getProvider = exports.getProviderNetworks = exports.providerNames = void 0;
const index_js_1 = require("../index.js");
;
const ethNetworks = ["default", "homestead", "rinkeby", "ropsten", "goerli"];
const ethNetworks = ["default", "mainnet", "rinkeby", "ropsten", "goerli"];
//const maticNetworks = [ "matic", "maticmum" ];
const ProviderCreators = [
{
@ -22,7 +22,7 @@ const ProviderCreators = [
},
{
name: "CloudflareProvider",
networks: ["default", "homestead"],
networks: ["default", "mainnet"],
create: function (network) {
return new index_js_1.CloudflareProvider(network);
}
@ -41,13 +41,20 @@ const ProviderCreators = [
return new index_js_1.InfuraProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1");
}
},
{
name: "InfuraWebsocketProvider",
networks: ethNetworks,
create: function (network) {
return index_js_1.InfuraProvider.getWebSocketProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1");
}
},
/*
{
name: "PocketProvider",
networks: ethNetworks,
create: function(network: string) {
const apiKeys: Record<string, string> = {
homestead: "6004bcd10040261633ade990",
mainnet: "6004bcd10040261633ade990",
ropsten: "6004bd4d0040261633ade991",
rinkeby: "6004bda20040261633ade994",
goerli: "6004bd860040261633ade992",
@ -56,25 +63,23 @@ const ProviderCreators = [
}
},
*/
{
name: "FallbackProvider",
networks: ethNetworks,
create: function (network) {
const providers = [];
for (const creator of ProviderCreators) {
if (creator.name === "FallbackProvider") {
continue;
}
if (creator.networks.indexOf(network) >= 0) {
const provider = creator.create(network);
if (provider) {
providers.push(provider);
/*
{
name: "FallbackProvider",
networks: ethNetworks,
create: function(network: string) {
const providers: Array<AbstractProvider> = [];
for (const creator of ProviderCreators) {
if (creator.name === "FallbackProvider") { continue; }
if (creator.networks.indexOf(network) >= 0) {
const provider = creator.create(network);
if (provider) { providers.push(provider); }
}
}
return new FallbackProvider(providers);
}
return new index_js_1.FallbackProvider(providers);
}
},
},
*/
];
exports.providerNames = Object.freeze(ProviderCreators.map((c) => (c.name)));
function getCreator(provider) {
@ -100,6 +105,11 @@ function getProvider(provider, network) {
return null;
}
exports.getProvider = getProvider;
function checkProvider(provider, network) {
const creator = getCreator(provider);
return (creator != null);
}
exports.checkProvider = checkProvider;
function connect(network) {
const provider = getProvider("InfuraProvider", network);
if (provider == null) {

@ -1 +1 @@
{"version":3,"file":"create-provider.js","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":";;;AAAA,0CASqB;AAQpB,CAAC;AAEF,MAAM,WAAW,GAAG,CAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAE,CAAC;AAC/E,gDAAgD;AAEhD,MAAM,gBAAgB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AAJD,kCAIC;AAED,SAAgB,aAAa,CAAC,QAAgB,EAAE,OAAe;IAC3D,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;AAC7B,CAAC;AAHD,sCAGC;AAED,SAAgB,OAAO,CAAC,OAAe;IACnC,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACxD,IAAI,QAAQ,IAAI,IAAI,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAyB,OAAQ,EAAE,CAAC,CAAC;KAAE;IAC/E,OAAO,QAAQ,CAAC;AACpB,CAAC;AAJD,0BAIC"}

@ -24,7 +24,7 @@ describe("Resolve ENS avatar", function () {
].forEach((test) => {
it(`Resolves avatar for ${test.title}`, async function () {
this.timeout(60000);
const provider = (0, create_provider_js_1.connect)("homestead");
const provider = (0, create_provider_js_1.connect)("mainnet");
const avatar = await provider.getAvatar(test.name);
assert_1.default.equal(avatar, test.value, "avatar url");
});

@ -1 +1 @@
{"version":3,"file":"test-providers-avatar.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-avatar.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,6DAA+C;AAE/C,QAAQ,CAAC,oBAAoB,EAAE;IAC3B;QACI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,owCAAowC,EAAE;QAC7zC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,8EAA8E,EAAE;QACvI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,qCAAqC,EAAE;KAC/F,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,EAAE,CAAC,uBAAwB,IAAI,CAAC,KAAM,EAAE,EAAE,KAAK;YAC3C,IAAI,CAAC,O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KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,qCAAqC,EAAE;KAC/F,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,EAAE,CAAC,uBAAwB,IAAI,CAAC,KAAM,EAAE,EAAE,KAAK;YAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,QAAQ,GAAG,IAAA,4BAAO,EAAC,SAAS,CAAC,CAAC;YACpC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnD,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH;QACI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,4IAA4I,EAAE;QACpM,iHAAiH;KAC5G,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,EAAE,CAAC,uBAAwB,IAAI,CAAC,KAAM,EAAE,EAAE,KAAK;YAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,QAAQ,GAAG,IAAA,4BAAO,EAAC,SAAS,CAAC,CAAC;YACpC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnD,gBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}

@ -0,0 +1,197 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const create_provider_js_1 = require("./create-provider.js");
const blockchain_data_js_1 = require("./blockchain-data.js");
function forEach(prefix, tests, func) {
for (const networkName of blockchain_data_js_1.networkNames) {
const networkTests = tests[networkName];
if (networkTests == null) {
continue;
}
for (const test of networkTests) {
for (const providerName of create_provider_js_1.providerNames) {
if (!(0, create_provider_js_1.checkProvider)(providerName, networkName)) {
continue;
}
// Let the testcase skip this by returning null
const testFunc = func(providerName, test);
if (testFunc == null) {
continue;
}
// Prepare the testcase
it(`${prefix}: ${providerName}:${networkName}.${test.test}`, async function () {
// Create a provider
const provider = (0, create_provider_js_1.getProvider)(providerName, networkName);
try {
assert_1.default.ok(provider != null, "missing provider");
await testFunc(provider);
}
catch (error) {
// Shutdown socket-based provider, otherwise its socket will prevent
// this process from exiting
if (provider.destroy) {
provider.destroy();
}
throw error;
}
// Shutdown socket-based provider, otherwise its socket will prevent
// this process from exiting
if (provider.destroy) {
provider.destroy();
}
});
}
}
}
}
describe("Test Provider Address operations", function () {
forEach("test getBalance(address)", blockchain_data_js_1.testAddress, (providerName, test) => {
if (test.balance == null) {
return null;
}
return async (provider) => {
assert_1.default.equal(await provider.getBalance(test.address), test.balance);
};
});
forEach("test getCode(address)", blockchain_data_js_1.testAddress, (providerName, test) => {
if (test.code == null) {
return null;
}
return async (provider) => {
assert_1.default.equal(await provider.getCode(test.address), test.code);
};
});
/*
forEach("test lookupAddress(address)", testAddress, (provider, test) => {
if (test.name == null) { return null; }
return async () => {
assert.equal(await provider.lookupAddress(test.address), test.name);
};
});
forEach("test resolveName(name)", testAddress, (provider, test) => {
if (test.name == null) { return null; }
return async () => {
assert.equal(await provider.lookupAddress(<string>(test.name)), test.address);
};
});
*/
forEach("test getStorage(address)", blockchain_data_js_1.testAddress, (providerName, test) => {
if (test.storage == null) {
return null;
}
return async (provider) => {
for (const key in test.storage) {
assert_1.default.equal(await provider.getStorage(test.address, key), test.storage[key]);
}
};
});
forEach("test getTransactionCount(address)", blockchain_data_js_1.testAddress, (providerName, test) => {
if (test.balance == null) {
return null;
}
return async (provider) => {
assert_1.default.equal(await provider.getTransactionCount(test.address), test.nonce);
};
});
});
function assertObj(prefix, actual, expected) {
assert_1.default.ok(actual != null, `${prefix} is null`);
for (const key in expected) {
if (expected[key] === undefined) {
continue;
}
assert_1.default.equal(actual[key], expected[key], `${prefix}.${key}`);
}
}
function assertBlock(actual, expected) {
// Check transactions
for (let i = 0; i < expected.transactions.length; i++) {
const expectedTx = expected.transactions[i];
if (typeof (expectedTx) === "string") {
assert_1.default.equal(actual.transactions[i], expectedTx, `block.transactions[${i}]`);
}
else {
throw new Error("@TODO");
}
}
// Remove the transactions and test keys
expected = Object.assign({}, expected, { transactions: undefined, test: undefined });
// Check remaining keys
assertObj("block", actual, expected);
}
function assertTransaction(actual, expected) {
// @TODO: Accesslist
// Check signature
assertObj("tx.signature", actual.signature, expected.signature);
// Remove the transactions and test keys
expected = Object.assign({}, expected, {
accessList: undefined,
signature: undefined,
test: undefined
});
// Check remaining keys
assertObj("tx", actual, expected);
}
function assertReceipt(actual, expected) {
// Check logs
for (let i = 0; i < expected.logs.length; i++) {
let expectedLog = expected.logs[i];
for (let j = 0; j < expectedLog.topics.length; j++) {
assert_1.default.equal(actual.logs[i].topics[j], expectedLog.topics[j], `receipt.logs[${i}].topics[${j}]`);
}
expectedLog = Object.assign({}, expectedLog, { topics: undefined });
assertObj(`receipt.log[${i}]`, actual.logs[i], expectedLog);
}
// Remove the transactions and test keys
expected = Object.assign({}, expected, { logs: undefined, test: undefined });
// In Byzantium, the root was dropped and the status was added
if ((0, blockchain_data_js_1.networkFeatureAtBlock)("byzantium", expected.blockNumber)) {
expected = Object.assign({}, expected, { root: undefined });
}
else {
expected = Object.assign({}, expected, { status: undefined });
}
// Check remaining keys
assertObj("receipt", actual, expected);
}
describe("Test Provider Block operations", function () {
forEach("test getBlock(blockHash)", blockchain_data_js_1.testBlock, (providerName, test) => {
// Etherscan does not support getting a block by blockhash
if (providerName === "EtherscanProvider") {
return null;
}
return async (provider) => {
assertBlock(await provider.getBlock(test.hash), test);
};
});
forEach("test getBlock(blockNumber)", blockchain_data_js_1.testBlock, (providerName, test) => {
return async (provider) => {
assertBlock(await provider.getBlock(test.number), test);
};
});
});
describe("Test Provider Transaction operations", function () {
forEach("test getTransaction(hash)", blockchain_data_js_1.testTransaction, (providerName, test) => {
return async (provider) => {
assertTransaction(await provider.getTransaction(test.hash), test);
};
});
forEach("test getTransactionReceipt(hash)", blockchain_data_js_1.testReceipt, (providerName, test) => {
return async (provider) => {
const receipt = await provider.getTransactionReceipt(test.hash);
assert_1.default.ok(receipt != null, "receipt != null");
// Cloudflare doesn't return the root in legacy receipts; but it isn't
// *actually* that important, so we'll give it a pass...
if (providerName === "CloudflareProvider") {
test = Object.assign({}, test, { root: undefined });
}
assertReceipt(receipt, test);
};
});
});
//# sourceMappingURL=test-providers-data.js.map

File diff suppressed because one or more lines are too long

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

@ -3,9 +3,9 @@
//
Object.defineProperty(exports, "__esModule", { value: true });
exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = exports.EventLog = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.MessagePrefix = exports.EtherSymbol = exports.ZeroHash = exports.N = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.Two = exports.One = exports.Zero = exports.NegativeOne = exports.ZeroAddress = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = exports.Typed = exports.TransactionDescription = exports.Result = exports.LogDescription = exports.Interface = exports.Indexed = exports.checkResultErrors = exports.ParamType = exports.FunctionFragment = exports.Fragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.defaultAbiCoder = exports.AbiCoder = exports.parseBytes32String = exports.formatBytes32String = exports.version = void 0;
exports.getBigInt = exports.parseFixed = exports.formatFixed = exports.FixedNumber = exports.FixedFormat = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.getIpfsGatewayFunc = exports.isError = exports.isCallException = exports.throwError = exports.throwArgumentError = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.id = exports.SigningKey = exports.Signature = exports.lock = exports.scryptSync = void 0;
exports.IpcSocketProvider = exports.InfuraProvider = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.WordlistOwlA = exports.WordlistOwl = exports.wordlists = exports.LangEn = exports.langEn = exports.Wordlist = exports.Wallet = exports.Mnemonic = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.isKeystoreJson = exports.decryptCrowdsaleJson = exports.isCrowdsaleJson = exports.HDNodeWalletManager = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.getAccountPath = exports.defaultPath = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports._toEscapedUtf8String = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = exports.toNumber = exports.toHex = exports.toBigInt = exports.toArray = exports.getNumber = void 0;
exports.Network = exports.WebSocketProvider = exports.SocketProvider = void 0;
exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.Network = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.InfuraProvider = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.id = exports.SigningKey = exports.Signature = exports.lock = exports.scryptSync = void 0;
exports.LangEn = exports.langEn = exports.Wordlist = exports.Wallet = exports.Mnemonic = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.isKeystoreJson = exports.decryptCrowdsaleJson = exports.isCrowdsaleJson = exports.HDNodeWalletManager = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.getAccountPath = exports.defaultPath = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports._toEscapedUtf8String = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = exports.toNumber = exports.toHex = exports.toBigInt = exports.toArray = exports.getNumber = exports.getBigInt = exports.parseFixed = exports.formatFixed = exports.FixedNumber = exports.FixedFormat = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.getIpfsGatewayFunc = exports.isError = exports.isCallException = exports.throwError = exports.throwArgumentError = exports.makeError = void 0;
exports.WordlistOwlA = exports.WordlistOwl = exports.wordlists = void 0;
var _version_js_1 = require("./_version.js");
Object.defineProperty(exports, "version", { enumerable: true, get: function () { return _version_js_1.version; } });
var index_js_1 = require("./abi/index.js");
@ -76,100 +76,100 @@ Object.defineProperty(exports, "solidityPacked", { enumerable: true, get: functi
Object.defineProperty(exports, "solidityPackedKeccak256", { enumerable: true, get: function () { return index_js_6.solidityPackedKeccak256; } });
Object.defineProperty(exports, "solidityPackedSha256", { enumerable: true, get: function () { return index_js_6.solidityPackedSha256; } });
Object.defineProperty(exports, "TypedDataEncoder", { enumerable: true, get: function () { return index_js_6.TypedDataEncoder; } });
var index_js_7 = require("./transaction/index.js");
Object.defineProperty(exports, "accessListify", { enumerable: true, get: function () { return index_js_7.accessListify; } });
Object.defineProperty(exports, "computeAddress", { enumerable: true, get: function () { return index_js_7.computeAddress; } });
Object.defineProperty(exports, "recoverAddress", { enumerable: true, get: function () { return index_js_7.recoverAddress; } });
Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return index_js_7.Transaction; } });
var index_js_8 = require("./utils/index.js");
Object.defineProperty(exports, "decodeBase58", { enumerable: true, get: function () { return index_js_8.decodeBase58; } });
Object.defineProperty(exports, "encodeBase58", { enumerable: true, get: function () { return index_js_8.encodeBase58; } });
Object.defineProperty(exports, "decodeBase64", { enumerable: true, get: function () { return index_js_8.decodeBase64; } });
Object.defineProperty(exports, "encodeBase64", { enumerable: true, get: function () { return index_js_8.encodeBase64; } });
Object.defineProperty(exports, "concat", { enumerable: true, get: function () { return index_js_8.concat; } });
Object.defineProperty(exports, "dataLength", { enumerable: true, get: function () { return index_js_8.dataLength; } });
Object.defineProperty(exports, "dataSlice", { enumerable: true, get: function () { return index_js_8.dataSlice; } });
Object.defineProperty(exports, "getBytes", { enumerable: true, get: function () { return index_js_8.getBytes; } });
Object.defineProperty(exports, "getBytesCopy", { enumerable: true, get: function () { return index_js_8.getBytesCopy; } });
Object.defineProperty(exports, "hexlify", { enumerable: true, get: function () { return index_js_8.hexlify; } });
Object.defineProperty(exports, "isHexString", { enumerable: true, get: function () { return index_js_8.isHexString; } });
Object.defineProperty(exports, "isBytesLike", { enumerable: true, get: function () { return index_js_8.isBytesLike; } });
Object.defineProperty(exports, "stripZerosLeft", { enumerable: true, get: function () { return index_js_8.stripZerosLeft; } });
Object.defineProperty(exports, "zeroPadBytes", { enumerable: true, get: function () { return index_js_8.zeroPadBytes; } });
Object.defineProperty(exports, "zeroPadValue", { enumerable: true, get: function () { return index_js_8.zeroPadValue; } });
Object.defineProperty(exports, "assertArgument", { enumerable: true, get: function () { return index_js_8.assertArgument; } });
Object.defineProperty(exports, "assertArgumentCount", { enumerable: true, get: function () { return index_js_8.assertArgumentCount; } });
Object.defineProperty(exports, "assertNormalize", { enumerable: true, get: function () { return index_js_8.assertNormalize; } });
Object.defineProperty(exports, "assertPrivate", { enumerable: true, get: function () { return index_js_8.assertPrivate; } });
Object.defineProperty(exports, "makeError", { enumerable: true, get: function () { return index_js_8.makeError; } });
Object.defineProperty(exports, "throwArgumentError", { enumerable: true, get: function () { return index_js_8.throwArgumentError; } });
Object.defineProperty(exports, "throwError", { enumerable: true, get: function () { return index_js_8.throwError; } });
Object.defineProperty(exports, "isCallException", { enumerable: true, get: function () { return index_js_8.isCallException; } });
Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return index_js_8.isError; } });
Object.defineProperty(exports, "getIpfsGatewayFunc", { enumerable: true, get: function () { return index_js_8.getIpfsGatewayFunc; } });
Object.defineProperty(exports, "FetchRequest", { enumerable: true, get: function () { return index_js_8.FetchRequest; } });
Object.defineProperty(exports, "FetchResponse", { enumerable: true, get: function () { return index_js_8.FetchResponse; } });
Object.defineProperty(exports, "FetchCancelSignal", { enumerable: true, get: function () { return index_js_8.FetchCancelSignal; } });
Object.defineProperty(exports, "FixedFormat", { enumerable: true, get: function () { return index_js_8.FixedFormat; } });
Object.defineProperty(exports, "FixedNumber", { enumerable: true, get: function () { return index_js_8.FixedNumber; } });
Object.defineProperty(exports, "formatFixed", { enumerable: true, get: function () { return index_js_8.formatFixed; } });
Object.defineProperty(exports, "parseFixed", { enumerable: true, get: function () { return index_js_8.parseFixed; } });
Object.defineProperty(exports, "getBigInt", { enumerable: true, get: function () { return index_js_8.getBigInt; } });
Object.defineProperty(exports, "getNumber", { enumerable: true, get: function () { return index_js_8.getNumber; } });
Object.defineProperty(exports, "toArray", { enumerable: true, get: function () { return index_js_8.toArray; } });
Object.defineProperty(exports, "toBigInt", { enumerable: true, get: function () { return index_js_8.toBigInt; } });
Object.defineProperty(exports, "toHex", { enumerable: true, get: function () { return index_js_8.toHex; } });
Object.defineProperty(exports, "toNumber", { enumerable: true, get: function () { return index_js_8.toNumber; } });
Object.defineProperty(exports, "toQuantity", { enumerable: true, get: function () { return index_js_8.toQuantity; } });
Object.defineProperty(exports, "fromTwos", { enumerable: true, get: function () { return index_js_8.fromTwos; } });
Object.defineProperty(exports, "toTwos", { enumerable: true, get: function () { return index_js_8.toTwos; } });
Object.defineProperty(exports, "mask", { enumerable: true, get: function () { return index_js_8.mask; } });
Object.defineProperty(exports, "formatEther", { enumerable: true, get: function () { return index_js_8.formatEther; } });
Object.defineProperty(exports, "parseEther", { enumerable: true, get: function () { return index_js_8.parseEther; } });
Object.defineProperty(exports, "formatUnits", { enumerable: true, get: function () { return index_js_8.formatUnits; } });
Object.defineProperty(exports, "parseUnits", { enumerable: true, get: function () { return index_js_8.parseUnits; } });
Object.defineProperty(exports, "_toEscapedUtf8String", { enumerable: true, get: function () { return index_js_8._toEscapedUtf8String; } });
Object.defineProperty(exports, "toUtf8Bytes", { enumerable: true, get: function () { return index_js_8.toUtf8Bytes; } });
Object.defineProperty(exports, "toUtf8CodePoints", { enumerable: true, get: function () { return index_js_8.toUtf8CodePoints; } });
Object.defineProperty(exports, "toUtf8String", { enumerable: true, get: function () { return index_js_8.toUtf8String; } });
Object.defineProperty(exports, "Utf8ErrorFuncs", { enumerable: true, get: function () { return index_js_8.Utf8ErrorFuncs; } });
Object.defineProperty(exports, "decodeRlp", { enumerable: true, get: function () { return index_js_8.decodeRlp; } });
Object.defineProperty(exports, "encodeRlp", { enumerable: true, get: function () { return index_js_8.encodeRlp; } });
var index_js_9 = require("./wallet/index.js");
Object.defineProperty(exports, "defaultPath", { enumerable: true, get: function () { return index_js_9.defaultPath; } });
Object.defineProperty(exports, "getAccountPath", { enumerable: true, get: function () { return index_js_9.getAccountPath; } });
Object.defineProperty(exports, "HDNodeWallet", { enumerable: true, get: function () { return index_js_9.HDNodeWallet; } });
Object.defineProperty(exports, "HDNodeVoidWallet", { enumerable: true, get: function () { return index_js_9.HDNodeVoidWallet; } });
Object.defineProperty(exports, "HDNodeWalletManager", { enumerable: true, get: function () { return index_js_9.HDNodeWalletManager; } });
Object.defineProperty(exports, "isCrowdsaleJson", { enumerable: true, get: function () { return index_js_9.isCrowdsaleJson; } });
Object.defineProperty(exports, "decryptCrowdsaleJson", { enumerable: true, get: function () { return index_js_9.decryptCrowdsaleJson; } });
Object.defineProperty(exports, "isKeystoreJson", { enumerable: true, get: function () { return index_js_9.isKeystoreJson; } });
Object.defineProperty(exports, "decryptKeystoreJsonSync", { enumerable: true, get: function () { return index_js_9.decryptKeystoreJsonSync; } });
Object.defineProperty(exports, "decryptKeystoreJson", { enumerable: true, get: function () { return index_js_9.decryptKeystoreJson; } });
Object.defineProperty(exports, "encryptKeystoreJson", { enumerable: true, get: function () { return index_js_9.encryptKeystoreJson; } });
Object.defineProperty(exports, "Mnemonic", { enumerable: true, get: function () { return index_js_9.Mnemonic; } });
Object.defineProperty(exports, "Wallet", { enumerable: true, get: function () { return index_js_9.Wallet; } });
var index_js_10 = require("./wordlists/index.js");
Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function () { return index_js_10.Wordlist; } });
Object.defineProperty(exports, "langEn", { enumerable: true, get: function () { return index_js_10.langEn; } });
Object.defineProperty(exports, "LangEn", { enumerable: true, get: function () { return index_js_10.LangEn; } });
Object.defineProperty(exports, "wordlists", { enumerable: true, get: function () { return index_js_10.wordlists; } });
Object.defineProperty(exports, "WordlistOwl", { enumerable: true, get: function () { return index_js_10.WordlistOwl; } });
Object.defineProperty(exports, "WordlistOwlA", { enumerable: true, get: function () { return index_js_10.WordlistOwlA; } });
var index_js_11 = require("./providers/index.js");
Object.defineProperty(exports, "AbstractProvider", { enumerable: true, get: function () { return index_js_11.AbstractProvider; } });
Object.defineProperty(exports, "FallbackProvider", { enumerable: true, get: function () { return index_js_11.FallbackProvider; } });
Object.defineProperty(exports, "JsonRpcApiProvider", { enumerable: true, get: function () { return index_js_11.JsonRpcApiProvider; } });
Object.defineProperty(exports, "JsonRpcProvider", { enumerable: true, get: function () { return index_js_11.JsonRpcProvider; } });
Object.defineProperty(exports, "JsonRpcSigner", { enumerable: true, get: function () { return index_js_11.JsonRpcSigner; } });
Object.defineProperty(exports, "AlchemyProvider", { enumerable: true, get: function () { return index_js_11.AlchemyProvider; } });
Object.defineProperty(exports, "AnkrProvider", { enumerable: true, get: function () { return index_js_11.AnkrProvider; } });
Object.defineProperty(exports, "CloudflareProvider", { enumerable: true, get: function () { return index_js_11.CloudflareProvider; } });
Object.defineProperty(exports, "EtherscanProvider", { enumerable: true, get: function () { return index_js_11.EtherscanProvider; } });
Object.defineProperty(exports, "InfuraProvider", { enumerable: true, get: function () { return index_js_11.InfuraProvider; } });
var index_js_7 = require("./providers/index.js");
Object.defineProperty(exports, "AbstractProvider", { enumerable: true, get: function () { return index_js_7.AbstractProvider; } });
Object.defineProperty(exports, "FallbackProvider", { enumerable: true, get: function () { return index_js_7.FallbackProvider; } });
Object.defineProperty(exports, "JsonRpcApiProvider", { enumerable: true, get: function () { return index_js_7.JsonRpcApiProvider; } });
Object.defineProperty(exports, "JsonRpcProvider", { enumerable: true, get: function () { return index_js_7.JsonRpcProvider; } });
Object.defineProperty(exports, "JsonRpcSigner", { enumerable: true, get: function () { return index_js_7.JsonRpcSigner; } });
Object.defineProperty(exports, "AlchemyProvider", { enumerable: true, get: function () { return index_js_7.AlchemyProvider; } });
Object.defineProperty(exports, "AnkrProvider", { enumerable: true, get: function () { return index_js_7.AnkrProvider; } });
Object.defineProperty(exports, "CloudflareProvider", { enumerable: true, get: function () { return index_js_7.CloudflareProvider; } });
Object.defineProperty(exports, "EtherscanProvider", { enumerable: true, get: function () { return index_js_7.EtherscanProvider; } });
Object.defineProperty(exports, "InfuraProvider", { enumerable: true, get: function () { return index_js_7.InfuraProvider; } });
//PocketProvider } from "./provider-pocket.js";
Object.defineProperty(exports, "IpcSocketProvider", { enumerable: true, get: function () { return index_js_11.IpcSocketProvider; } });
Object.defineProperty(exports, "SocketProvider", { enumerable: true, get: function () { return index_js_11.SocketProvider; } });
Object.defineProperty(exports, "WebSocketProvider", { enumerable: true, get: function () { return index_js_11.WebSocketProvider; } });
Object.defineProperty(exports, "Network", { enumerable: true, get: function () { return index_js_11.Network; } });
Object.defineProperty(exports, "IpcSocketProvider", { enumerable: true, get: function () { return index_js_7.IpcSocketProvider; } });
Object.defineProperty(exports, "SocketProvider", { enumerable: true, get: function () { return index_js_7.SocketProvider; } });
Object.defineProperty(exports, "WebSocketProvider", { enumerable: true, get: function () { return index_js_7.WebSocketProvider; } });
Object.defineProperty(exports, "Network", { enumerable: true, get: function () { return index_js_7.Network; } });
var index_js_8 = require("./transaction/index.js");
Object.defineProperty(exports, "accessListify", { enumerable: true, get: function () { return index_js_8.accessListify; } });
Object.defineProperty(exports, "computeAddress", { enumerable: true, get: function () { return index_js_8.computeAddress; } });
Object.defineProperty(exports, "recoverAddress", { enumerable: true, get: function () { return index_js_8.recoverAddress; } });
Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return index_js_8.Transaction; } });
var index_js_9 = require("./utils/index.js");
Object.defineProperty(exports, "decodeBase58", { enumerable: true, get: function () { return index_js_9.decodeBase58; } });
Object.defineProperty(exports, "encodeBase58", { enumerable: true, get: function () { return index_js_9.encodeBase58; } });
Object.defineProperty(exports, "decodeBase64", { enumerable: true, get: function () { return index_js_9.decodeBase64; } });
Object.defineProperty(exports, "encodeBase64", { enumerable: true, get: function () { return index_js_9.encodeBase64; } });
Object.defineProperty(exports, "concat", { enumerable: true, get: function () { return index_js_9.concat; } });
Object.defineProperty(exports, "dataLength", { enumerable: true, get: function () { return index_js_9.dataLength; } });
Object.defineProperty(exports, "dataSlice", { enumerable: true, get: function () { return index_js_9.dataSlice; } });
Object.defineProperty(exports, "getBytes", { enumerable: true, get: function () { return index_js_9.getBytes; } });
Object.defineProperty(exports, "getBytesCopy", { enumerable: true, get: function () { return index_js_9.getBytesCopy; } });
Object.defineProperty(exports, "hexlify", { enumerable: true, get: function () { return index_js_9.hexlify; } });
Object.defineProperty(exports, "isHexString", { enumerable: true, get: function () { return index_js_9.isHexString; } });
Object.defineProperty(exports, "isBytesLike", { enumerable: true, get: function () { return index_js_9.isBytesLike; } });
Object.defineProperty(exports, "stripZerosLeft", { enumerable: true, get: function () { return index_js_9.stripZerosLeft; } });
Object.defineProperty(exports, "zeroPadBytes", { enumerable: true, get: function () { return index_js_9.zeroPadBytes; } });
Object.defineProperty(exports, "zeroPadValue", { enumerable: true, get: function () { return index_js_9.zeroPadValue; } });
Object.defineProperty(exports, "assertArgument", { enumerable: true, get: function () { return index_js_9.assertArgument; } });
Object.defineProperty(exports, "assertArgumentCount", { enumerable: true, get: function () { return index_js_9.assertArgumentCount; } });
Object.defineProperty(exports, "assertNormalize", { enumerable: true, get: function () { return index_js_9.assertNormalize; } });
Object.defineProperty(exports, "assertPrivate", { enumerable: true, get: function () { return index_js_9.assertPrivate; } });
Object.defineProperty(exports, "makeError", { enumerable: true, get: function () { return index_js_9.makeError; } });
Object.defineProperty(exports, "throwArgumentError", { enumerable: true, get: function () { return index_js_9.throwArgumentError; } });
Object.defineProperty(exports, "throwError", { enumerable: true, get: function () { return index_js_9.throwError; } });
Object.defineProperty(exports, "isCallException", { enumerable: true, get: function () { return index_js_9.isCallException; } });
Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return index_js_9.isError; } });
Object.defineProperty(exports, "getIpfsGatewayFunc", { enumerable: true, get: function () { return index_js_9.getIpfsGatewayFunc; } });
Object.defineProperty(exports, "FetchRequest", { enumerable: true, get: function () { return index_js_9.FetchRequest; } });
Object.defineProperty(exports, "FetchResponse", { enumerable: true, get: function () { return index_js_9.FetchResponse; } });
Object.defineProperty(exports, "FetchCancelSignal", { enumerable: true, get: function () { return index_js_9.FetchCancelSignal; } });
Object.defineProperty(exports, "FixedFormat", { enumerable: true, get: function () { return index_js_9.FixedFormat; } });
Object.defineProperty(exports, "FixedNumber", { enumerable: true, get: function () { return index_js_9.FixedNumber; } });
Object.defineProperty(exports, "formatFixed", { enumerable: true, get: function () { return index_js_9.formatFixed; } });
Object.defineProperty(exports, "parseFixed", { enumerable: true, get: function () { return index_js_9.parseFixed; } });
Object.defineProperty(exports, "getBigInt", { enumerable: true, get: function () { return index_js_9.getBigInt; } });
Object.defineProperty(exports, "getNumber", { enumerable: true, get: function () { return index_js_9.getNumber; } });
Object.defineProperty(exports, "toArray", { enumerable: true, get: function () { return index_js_9.toArray; } });
Object.defineProperty(exports, "toBigInt", { enumerable: true, get: function () { return index_js_9.toBigInt; } });
Object.defineProperty(exports, "toHex", { enumerable: true, get: function () { return index_js_9.toHex; } });
Object.defineProperty(exports, "toNumber", { enumerable: true, get: function () { return index_js_9.toNumber; } });
Object.defineProperty(exports, "toQuantity", { enumerable: true, get: function () { return index_js_9.toQuantity; } });
Object.defineProperty(exports, "fromTwos", { enumerable: true, get: function () { return index_js_9.fromTwos; } });
Object.defineProperty(exports, "toTwos", { enumerable: true, get: function () { return index_js_9.toTwos; } });
Object.defineProperty(exports, "mask", { enumerable: true, get: function () { return index_js_9.mask; } });
Object.defineProperty(exports, "formatEther", { enumerable: true, get: function () { return index_js_9.formatEther; } });
Object.defineProperty(exports, "parseEther", { enumerable: true, get: function () { return index_js_9.parseEther; } });
Object.defineProperty(exports, "formatUnits", { enumerable: true, get: function () { return index_js_9.formatUnits; } });
Object.defineProperty(exports, "parseUnits", { enumerable: true, get: function () { return index_js_9.parseUnits; } });
Object.defineProperty(exports, "_toEscapedUtf8String", { enumerable: true, get: function () { return index_js_9._toEscapedUtf8String; } });
Object.defineProperty(exports, "toUtf8Bytes", { enumerable: true, get: function () { return index_js_9.toUtf8Bytes; } });
Object.defineProperty(exports, "toUtf8CodePoints", { enumerable: true, get: function () { return index_js_9.toUtf8CodePoints; } });
Object.defineProperty(exports, "toUtf8String", { enumerable: true, get: function () { return index_js_9.toUtf8String; } });
Object.defineProperty(exports, "Utf8ErrorFuncs", { enumerable: true, get: function () { return index_js_9.Utf8ErrorFuncs; } });
Object.defineProperty(exports, "decodeRlp", { enumerable: true, get: function () { return index_js_9.decodeRlp; } });
Object.defineProperty(exports, "encodeRlp", { enumerable: true, get: function () { return index_js_9.encodeRlp; } });
var index_js_10 = require("./wallet/index.js");
Object.defineProperty(exports, "defaultPath", { enumerable: true, get: function () { return index_js_10.defaultPath; } });
Object.defineProperty(exports, "getAccountPath", { enumerable: true, get: function () { return index_js_10.getAccountPath; } });
Object.defineProperty(exports, "HDNodeWallet", { enumerable: true, get: function () { return index_js_10.HDNodeWallet; } });
Object.defineProperty(exports, "HDNodeVoidWallet", { enumerable: true, get: function () { return index_js_10.HDNodeVoidWallet; } });
Object.defineProperty(exports, "HDNodeWalletManager", { enumerable: true, get: function () { return index_js_10.HDNodeWalletManager; } });
Object.defineProperty(exports, "isCrowdsaleJson", { enumerable: true, get: function () { return index_js_10.isCrowdsaleJson; } });
Object.defineProperty(exports, "decryptCrowdsaleJson", { enumerable: true, get: function () { return index_js_10.decryptCrowdsaleJson; } });
Object.defineProperty(exports, "isKeystoreJson", { enumerable: true, get: function () { return index_js_10.isKeystoreJson; } });
Object.defineProperty(exports, "decryptKeystoreJsonSync", { enumerable: true, get: function () { return index_js_10.decryptKeystoreJsonSync; } });
Object.defineProperty(exports, "decryptKeystoreJson", { enumerable: true, get: function () { return index_js_10.decryptKeystoreJson; } });
Object.defineProperty(exports, "encryptKeystoreJson", { enumerable: true, get: function () { return index_js_10.encryptKeystoreJson; } });
Object.defineProperty(exports, "Mnemonic", { enumerable: true, get: function () { return index_js_10.Mnemonic; } });
Object.defineProperty(exports, "Wallet", { enumerable: true, get: function () { return index_js_10.Wallet; } });
var index_js_11 = require("./wordlists/index.js");
Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function () { return index_js_11.Wordlist; } });
Object.defineProperty(exports, "langEn", { enumerable: true, get: function () { return index_js_11.langEn; } });
Object.defineProperty(exports, "LangEn", { enumerable: true, get: function () { return index_js_11.LangEn; } });
Object.defineProperty(exports, "wordlists", { enumerable: true, get: function () { return index_js_11.wordlists; } });
Object.defineProperty(exports, "WordlistOwl", { enumerable: true, get: function () { return index_js_11.WordlistOwl; } });
Object.defineProperty(exports, "WordlistOwlA", { enumerable: true, get: function () { return index_js_11.WordlistOwlA; } });
//# sourceMappingURL=ethers.js.map

@ -1 +1 @@
{"version":3,"file":"ethers.js","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":";AAEA,6BAA6B;AAC7B,EAAE;;;;;;AAEF,6CAAwC;AAA/B,sGAAA,OAAO,OAAA;AAEhB,2CAQwB;AAPpB,+GAAA,mBAAmB,OAAA;AAAE,8GAAA,kBAAkB,OAAA;AAEvC,oGAAA,QAAQ,OAAA;AAAE,2GAAA,eAAe,OAAA;AACzB,+GAAA,mBAAmB,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAAE,qGAAA,SAAS,OAAA;AAExF,6GAAA,iBAAiB,OAAA;AAAE,mGAAA,OAAO,OAAA;AAAE,qGAAA,SAAS,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,gBAAgB,OAAA;AAAE,wGAAA,YAAY,OAAA;AACjE,0GAAA,cAAc,OAAA;AACd,qGAAA,SAAS,OAAA;AAAE,qGAAA,SAAS,OAAA;AAGxB,+CAS2B;AARvB,wGAAA,WAAW,OAAA;AACX,2GAAA,cAAc,OAAA;AACd,yGAAA,YAAY,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AACnD,4GAAA,eAAe,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AACrC,2GAAA,cAAc,OAAA;AAAE,oHAAA,uBAAuB,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC5D,gHAAA,mBAAmB,OAAA;AACnB,qGAAA,QAAQ,OAAA;AACR,mGAAA,MAAM,OAAA;AAGV,kDAE8B;AAD1B,qGAAA,QAAQ,OAAA;AAAE,mGAAA,MAAM,OAAA;AAAE,mGAAA,MAAM,OAAA;AAAE,sGAAA,SAAS,OAAA;AAAE,wGAAA,WAAW,OAAA;AAAE,yGAAA,YAAY,OAAA"}

@ -584,9 +584,9 @@ class AbstractProvider {
async getCode(address, blockTag) {
return (0, index_js_2.hexlify)(await this.#getAccountValue({ method: "getCode" }, address, blockTag));
}
async getStorageAt(address, _position, blockTag) {
async getStorage(address, _position, blockTag) {
const position = (0, index_js_2.getBigInt)(_position, "position");
return (0, index_js_2.hexlify)(await this.#getAccountValue({ method: "getStorageAt", position }, address, blockTag));
return (0, index_js_2.hexlify)(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag));
}
// Write
async broadcastTransaction(signedTx) {

File diff suppressed because one or more lines are too long

@ -38,7 +38,7 @@ function injectCommonNetworks() {
});
}
}
registerEth("homestead", 1, { ensNetwork: 1, altNames: ["mainnet"] });
registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] });
registerEth("ropsten", 3, { ensNetwork: 3 });
registerEth("rinkeby", 4, { ensNetwork: 4 });
registerEth("goerli", 5, { ensNetwork: 5 });

@ -1 +1 @@
{"version":3,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QACnB,UAAU,EAAE,CAAC;QACb,SAAS,EAAE;YACP,MAAM,EAAE,oCAAoC;YAC5C,GAAG,EAAE,yBAAyB;SACjC;KACJ,CAAC,CAAC;IACH,WAAW,CAAC,MAAM,EAAE,EAAE,EAAE;QACpB,SAAS,EAAE;YACP,MAAM,EAAE,oCAAoC;YAC5C,GAAG,EAAE,iCAAiC;SACzC;KACJ,CAAC,CAAC;AACP,CAAC;AA9ED,oDA8EC;AAED,oBAAoB,EAAE,CAAC"}

@ -2,8 +2,9 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatTransactionResponse = exports.formatTransactionReceipt = exports.formatReceiptLog = exports.formatBlockWithTransactions = exports.formatBlock = exports.formatLog = exports.formatUint256 = exports.formatHash = exports.formatData = exports.formatBoolean = exports.object = exports.arrayOf = exports.allowNull = void 0;
const index_js_1 = require("../address/index.js");
const index_js_2 = require("../transaction/index.js");
const index_js_3 = require("../utils/index.js");
const index_js_2 = require("../crypto/index.js");
const index_js_3 = require("../transaction/index.js");
const index_js_4 = require("../utils/index.js");
const BN_0 = BigInt(0);
function allowNull(format, nullValue) {
return (function (value) {
@ -47,7 +48,7 @@ function object(format, altNames) {
}
catch (error) {
const message = (error instanceof Error) ? error.message : "not-an-error";
(0, index_js_3.throwError)(`invalid value for value.${key} (${message})`, "BAD_DATA", { value });
(0, index_js_4.throwError)(`invalid value for value.${key} (${message})`, "BAD_DATA", { value });
}
}
return result;
@ -63,40 +64,40 @@ function formatBoolean(value) {
case "false":
return false;
}
return (0, index_js_3.throwArgumentError)(`invalid boolean; ${JSON.stringify(value)}`, "value", value);
return (0, index_js_4.throwArgumentError)(`invalid boolean; ${JSON.stringify(value)}`, "value", value);
}
exports.formatBoolean = formatBoolean;
function formatData(value) {
if (!(0, index_js_3.isHexString)(value, true)) {
(0, index_js_3.throwArgumentError)("", "value", value);
if (!(0, index_js_4.isHexString)(value, true)) {
(0, index_js_4.throwArgumentError)("", "value", value);
}
return value;
}
exports.formatData = formatData;
function formatHash(value) {
if (!(0, index_js_3.isHexString)(value, 32)) {
(0, index_js_3.throwArgumentError)("", "value", value);
if (!(0, index_js_4.isHexString)(value, 32)) {
(0, index_js_4.throwArgumentError)("", "value", value);
}
return value;
}
exports.formatHash = formatHash;
function formatUint256(value) {
if (!(0, index_js_3.isHexString)(value)) {
if (!(0, index_js_4.isHexString)(value)) {
throw new Error("invalid uint256");
}
return (0, index_js_3.zeroPadValue)(value, 32);
return (0, index_js_4.zeroPadValue)(value, 32);
}
exports.formatUint256 = formatUint256;
exports.formatLog = object({
address: index_js_1.getAddress,
blockHash: formatHash,
blockNumber: index_js_3.getNumber,
blockNumber: index_js_4.getNumber,
data: formatData,
index: index_js_3.getNumber,
index: index_js_4.getNumber,
removed: formatBoolean,
topics: arrayOf(formatHash),
transactionHash: formatHash,
transactionIndex: index_js_3.getNumber,
transactionIndex: index_js_4.getNumber,
}, {
index: ["logIndex"]
});
@ -104,55 +105,59 @@ function _formatBlock(txFunc) {
return object({
hash: allowNull(formatHash),
parentHash: formatHash,
number: index_js_3.getNumber,
timestamp: index_js_3.getNumber,
number: index_js_4.getNumber,
timestamp: index_js_4.getNumber,
nonce: allowNull(formatData),
difficulty: index_js_3.getBigInt,
gasLimit: index_js_3.getBigInt,
gasUsed: index_js_3.getBigInt,
difficulty: index_js_4.getBigInt,
gasLimit: index_js_4.getBigInt,
gasUsed: index_js_4.getBigInt,
miner: allowNull(index_js_1.getAddress),
extraData: formatData,
transactions: arrayOf(txFunc),
baseFeePerGas: allowNull(index_js_3.getBigInt)
baseFeePerGas: allowNull(index_js_4.getBigInt)
});
}
exports.formatBlock = _formatBlock(formatHash);
exports.formatBlockWithTransactions = _formatBlock(formatTransactionResponse);
exports.formatReceiptLog = object({
transactionIndex: index_js_3.getNumber,
blockNumber: index_js_3.getNumber,
transactionIndex: index_js_4.getNumber,
blockNumber: index_js_4.getNumber,
transactionHash: formatHash,
address: index_js_1.getAddress,
topics: arrayOf(formatHash),
data: formatData,
logIndex: index_js_3.getNumber,
index: index_js_4.getNumber,
blockHash: formatHash,
}, {
index: ["logIndex"]
});
exports.formatTransactionReceipt = object({
to: allowNull(index_js_1.getAddress, null),
from: allowNull(index_js_1.getAddress, null),
contractAddress: allowNull(index_js_1.getAddress, null),
transactionIndex: index_js_3.getNumber,
// should be allowNull(hash), but broken-EIP-658 support is handled in receipt
root: allowNull(index_js_3.hexlify),
gasUsed: index_js_3.getBigInt,
index: index_js_4.getNumber,
root: allowNull(index_js_4.hexlify),
gasUsed: index_js_4.getBigInt,
logsBloom: allowNull(formatData),
blockHash: formatHash,
transactionHash: formatHash,
hash: formatHash,
logs: arrayOf(exports.formatReceiptLog),
blockNumber: index_js_3.getNumber,
confirmations: allowNull(index_js_3.getNumber, null),
cumulativeGasUsed: index_js_3.getBigInt,
effectiveGasPrice: allowNull(index_js_3.getBigInt),
status: allowNull(index_js_3.getNumber),
type: index_js_3.getNumber
blockNumber: index_js_4.getNumber,
confirmations: allowNull(index_js_4.getNumber, null),
cumulativeGasUsed: index_js_4.getBigInt,
effectiveGasPrice: allowNull(index_js_4.getBigInt),
status: allowNull(index_js_4.getNumber),
type: index_js_4.getNumber
}, {
effectiveGasPrice: ["gasPrice"]
effectiveGasPrice: ["gasPrice"],
hash: ["transactionHash"],
index: ["transactionIndex"],
});
function formatTransactionResponse(value) {
// Some clients (TestRPC) do strange things like return 0x0 for the
// 0 address; correct this to be a real address
if (value.to && (0, index_js_3.getBigInt)(value.to) === BN_0) {
if (value.to && (0, index_js_4.getBigInt)(value.to) === BN_0) {
value.to = "0x0000000000000000000000000000000000000000";
}
const result = object({
@ -161,28 +166,25 @@ function formatTransactionResponse(value) {
if (value === "0x" || value == null) {
return 0;
}
return (0, index_js_3.getNumber)(value);
return (0, index_js_4.getNumber)(value);
},
accessList: allowNull(index_js_2.accessListify, null),
accessList: allowNull(index_js_3.accessListify, null),
blockHash: allowNull(formatHash, null),
blockNumber: allowNull(index_js_3.getNumber, null),
transactionIndex: allowNull(index_js_3.getNumber, null),
confirmations: allowNull(index_js_3.getNumber, null),
blockNumber: allowNull(index_js_4.getNumber, null),
transactionIndex: allowNull(index_js_4.getNumber, null),
confirmations: allowNull(index_js_4.getNumber, null),
from: index_js_1.getAddress,
// either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set
gasPrice: allowNull(index_js_3.getBigInt),
maxPriorityFeePerGas: allowNull(index_js_3.getBigInt),
maxFeePerGas: allowNull(index_js_3.getBigInt),
gasLimit: index_js_3.getBigInt,
gasPrice: allowNull(index_js_4.getBigInt),
maxPriorityFeePerGas: allowNull(index_js_4.getBigInt),
maxFeePerGas: allowNull(index_js_4.getBigInt),
gasLimit: index_js_4.getBigInt,
to: allowNull(index_js_1.getAddress, null),
value: index_js_3.getBigInt,
nonce: index_js_3.getNumber,
value: index_js_4.getBigInt,
nonce: index_js_4.getNumber,
data: formatData,
r: allowNull(formatUint256),
s: allowNull(formatUint256),
v: allowNull(index_js_3.getNumber),
creates: allowNull(index_js_1.getAddress, null),
chainId: allowNull(index_js_3.getBigInt, null)
chainId: allowNull(index_js_4.getBigInt, null)
}, {
data: ["input"],
gasLimit: ["gas"]
@ -194,7 +196,16 @@ function formatTransactionResponse(value) {
// @TODO: Check fee data
// Add an access list to supported transaction types
if ((value.type === 1 || value.type === 2) && value.accessList == null) {
value.accessList = [];
result.accessList = [];
}
// Compute the signature
result.signature = index_js_2.Signature.from(value);
// Some backends omit ChainId on legacy transactions, but we can compute it
if (result.chainId == null) {
const chainId = result.signature.legacyChainId;
if (chainId != null) {
result.chainId = chainId;
}
}
// @TODO: check chainID
/*
@ -231,7 +242,7 @@ function formatTransactionResponse(value) {
}
*/
// 0x0000... should actually be null
if (result.blockHash && (0, index_js_3.getBigInt)(result.blockHash) === BN_0) {
if (result.blockHash && (0, index_js_4.getBigInt)(result.blockHash) === BN_0) {
result.blockHash = null;
}
return result;

File diff suppressed because one or more lines are too long

@ -134,7 +134,7 @@ class Network {
static from(network) {
// Default network
if (network == null) {
return Network.from("homestead");
return Network.from("mainnet");
}
// Canonical name or chain ID
if (typeof (network) === "number") {

@ -1 +1 @@
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":";;;AAAA,sDAAwD;AACxD,gDAE2B;AAE3B,6DAAgE;AAyBhE;;;;;;;;;;;;;;;;EAgBE;AAEF;;;;;;;;;;;;;EAaE;AAEF,uEAAuE;AACvE,sEAAsE;AACtE,uEAAuE;AACvE,uDAAuD;AACvD;;;;;;;;;;;;;;EAcE;AAEF,MAAM,QAAQ,GAAwC,IAAI,GAAG,EAAE,CAAC;AAEhE,2EAA2E;AAE3E,MAAa,OAAO;IAChB,MAAM,CAKJ;IAEF,YAAY,IAAY,EAAE,QAAsB;QAC5C,MAAM,OAAO,GAAG,IAAA,oBAAS,EAAC,QAAQ,CAAC,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC7C,CAAC;IAED,MAAM;QACF,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IACtD,CAAC;IAED,IAAI,IAAI,KAAa,OAAO,IAAA,mBAAQ,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAC5D,IAAI,IAAI,CAAC,KAAa,IAAI,IAAA,mBAAQ,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAEjE,IAAI,OAAO,KAAa,OAAO,IAAA,mBAAQ,EAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAClE,IAAI,OAAO,CAAC,KAAmB,IAAI,IAAA,mBAAQ,EAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,IAAA,oBAAS,EAAC,K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,0BAoJC"}

@ -8,7 +8,7 @@ const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js");
const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";
function getHost(name) {
switch (name) {
case "homestead":
case "mainnet":
return "eth-mainnet.alchemyapi.io";
case "ropsten":
return "eth-ropsten.alchemyapi.io";
@ -35,7 +35,7 @@ function getHost(name) {
}
class AlchemyProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
apiKey;
constructor(_network = "homestead", apiKey) {
constructor(_network = "mainnet", apiKey) {
const network = network_js_1.Network.from(_network);
if (apiKey == null) {
apiKey = defaultApiKey;

@ -1 +1 @@
{"version":3,"file":"provider-alchemy.js","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":";;;AACA,gDAE2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAOxD,MAAM,aAAa,GAAG,kCAAkC,CAAA;AAExD,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,WAAW;YACZ,OAAO,2BAA2B,CAAC;QACvC,KAAK,SAAS;YACV,OAAO,2BAA2B,CAAC;QACvC,KAAK,SAAS;YACV,OAAO,2BAA2B,CAAC;QACvC,KAAK,QAAQ;YACT,OAAO,0BAA0B,CAAC;QACtC,KAAK,OAAO;YACR,OAAO,yBAAyB,CAAC;QACrC,KAAK,OAAO;YACR,OAAO,+BAA+B,CAAC;QAC3C,KAAK,UAAU;YACX,OAAO,8BAA8B,CAAC;QAC1C,KAAK,UAAU;YACX,OAAO,2BAA2B,CAAC;QACvC,KAAK,kBAAkB;YACnB,OAAO,2BAA2B,CAAC;QACvC,KAAK,UAAU;YACX,OAAO,2BAA2B,CAAC;QACvC,KAAK,gBAAgB;YACjB,OAAO,yBAAyB,CAAC;KACxC;IAED,OAAO,IAAA,6BAAkB,EAAC,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AACtE,CAAC;AAED,MAA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AO,EAAE,CAAC,CAAC;QACvF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,MAAM,KAAK,aAAa,EAAE;YAC1B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,IAAA,kCAAmB,EAAC,SAAS,CAAC,CAAC;gBAC/B,OAAO,IAAI,CAAC;YAChB,CAAC,CAAA;SACJ;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AApED,0CAoEC"}

@ -8,7 +8,7 @@ const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js");
const defaultApiKey = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";
function getHost(name) {
switch (name) {
case "homestead":
case "mainnet":
return "rpc.ankr.com/eth";
case "ropsten":
return "rpc.ankr.com/eth_ropsten";
@ -25,7 +25,7 @@ function getHost(name) {
}
class AnkrProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
apiKey;
constructor(_network = "homestead", apiKey) {
constructor(_network = "mainnet", apiKey) {
const network = network_js_1.Network.from(_network);
if (apiKey == null) {
apiKey = defaultApiKey;

@ -1 +1 @@
{"version":3,"file":"provider-ankr.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":";;;AAAA,gDAE2B;AAG3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAMxD,MAAM,aAAa,GAAG,kEAAkE,CAAC;AAEzF,SAAS,OAAO,CAAC,IAAY;IACzB,QAAQ,IAAI,EAAE;QACV,KAAK,WAAW;YACZ,OAAO,kBAAkB,CAAC;QAC9B,KAAK,SAAS;YACV,OAAO,0BAA0B,CAAC;QACtC,KAAK,SAAS;YACV,OAAO,0BAA0B,CAAC;QACtC,KAAK,QAAQ;YACT,OAAO,yBAAyB,CAAC;QACrC,KAAK,OAAO;YACR,OAAO,sBAAsB,CAAC;QAClC,KAAK,UAAU;YACX,OAAO,uBAAuB,C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,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACzD,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAEjC,IAAA,2BAAgB,EAAe,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,YAAY,CAAC,OAAe;QACxB,IAAI;YACA,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SACjD;QAAC,OAAO,KAAK,EAAE,GAAG;QACnB,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,MAAsB;QACtD,IAAI,MAAM,IAAI,IAAI,EAAE;YAAE,MAAM,GAAG,aAAa,CAAC;SAAE;QAE/C,MAAM,OAAO,GAAG,IAAI,uBAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,IAAK,MAAO,EAAE,CAAC,CAAC;QACpF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,MAAM,KAAK,aAAa,EAAE;YAC1B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,IAAA,kCAAmB,EAAC,cAAc,CAAC,CAAC;gBACpC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC;IAC3C,CAAC;CACJ;AA1CD,oCA0CC"}

@ -5,9 +5,9 @@ const index_js_1 = require("../utils/index.js");
const network_js_1 = require("./network.js");
const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js");
class CloudflareProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
constructor(_network = "homestead") {
constructor(_network = "mainnet") {
const network = network_js_1.Network.from(_network);
if (network.name !== "homestead") {
if (network.name !== "mainnet") {
return (0, index_js_1.throwArgumentError)("unsupported network", "network", _network);
}
super("https:/\/cloudflare-eth.com/", network, { staticNetwork: network });

@ -1 +1 @@
{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":";;;AAAA,gDAAuD;AAEvD,6CAAuC;AACvC,+DAAwD;AAKxD,MAAa,kBAAmB,SAAQ,qCAAe;IACnD,YAAY,WAAuB,WAAW;QAC1C,MAAM,OAAO,GAAG,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,EAAE;YAC9B,OAAO,IAAA,6BAAkB,EAAC,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;SACzE;QACD,KAAK,CAAC,8BAA8B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ;AARD,gDAQC"}
{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":";;;AAAA,gDAAuD;AAEvD,6CAAuC;AACvC,+DAAwD;AAKxD,MAAa,kBAAmB,SAAQ,qCAAe;IACnD,YAAY,WAAuB,SAAS;QACxC,MAAM,OAAO,GAAG,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE;YAC5B,OAAO,IAAA,6BAAkB,EAAC,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;SACzE;QACD,KAAK,CAAC,8BAA8B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ;AARD,gDAQC"}

@ -43,7 +43,7 @@ class BaseEtherscanProvider extends abstract_provider_js_1.AbstractProvider {
return this.#plugin.baseUrl;
}
switch (this.network.name) {
case "homestead":
case "mainnet":
return "https:/\/api.etherscan.io";
case "ropsten":
return "https:/\/api-ropsten.etherscan.io";
@ -293,7 +293,7 @@ class BaseEtherscanProvider extends abstract_provider_js_1.AbstractProvider {
address: req.address,
tag: req.blockTag
});
case "getStorageAt":
case "getStorage":
return this.fetch("proxy", {
action: "eth_getStorageAt",
address: req.address,
@ -415,7 +415,7 @@ class BaseEtherscanProvider extends abstract_provider_js_1.AbstractProvider {
return this.network;
}
async getEtherPrice() {
if (this.network.name !== "homestead") {
if (this.network.name !== "mainnet") {
return 0.0;
}
return parseFloat((await this.fetch("stats", { action: "ethprice" })).ethusd);

File diff suppressed because one or more lines are too long

@ -58,7 +58,7 @@ function normalize(provider, value, req) {
return (0, index_js_1.getNumber)(value).toString();
case "getCode":
return (0, index_js_1.hexlify)(value);
case "getStorageAt":
case "getStorage":
return (0, index_js_1.hexlify)(value);
case "getBlock":
if (req.includeTransactions) {
@ -316,7 +316,7 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider {
case "getBalance":
case "getTransactionCount":
case "getCode":
case "getStorageAt":
case "getStorage":
case "getTransaction":
case "getTransactionReceipt":
case "getLogs":

File diff suppressed because one or more lines are too long

@ -1,14 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InfuraProvider = void 0;
exports.InfuraProvider = exports.InfuraWebSocketProvider = void 0;
const index_js_1 = require("../utils/index.js");
const community_js_1 = require("./community.js");
const network_js_1 = require("./network.js");
const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js");
const provider_websocket_js_1 = require("./provider-websocket.js");
const defaultProjectId = "84842078b09946638c03157f83405213";
function getHost(name) {
switch (name) {
case "homestead":
case "mainnet":
return "mainnet.infura.io";
case "ropsten":
return "ropsten.infura.io";
@ -33,10 +34,33 @@ function getHost(name) {
}
return (0, index_js_1.throwArgumentError)("unsupported network", "network", name);
}
class InfuraWebSocketProvider extends provider_websocket_js_1.WebSocketProvider {
projectId;
projectSecret;
constructor(network, apiKey) {
const provider = new InfuraProvider(network, apiKey);
const req = provider._getConnection();
if (req.credentials) {
(0, index_js_1.throwError)("INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", {
operation: "InfuraProvider.getWebSocketProvider()"
});
}
const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/");
super(url, network);
(0, index_js_1.defineProperties)(this, {
projectId: provider.projectId,
projectSecret: provider.projectSecret
});
}
isCommunityResource() {
return (this.projectId === defaultProjectId);
}
}
exports.InfuraWebSocketProvider = InfuraWebSocketProvider;
class InfuraProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
projectId;
projectSecret;
constructor(_network = "homestead", projectId, projectSecret) {
constructor(_network = "mainnet", projectId, projectSecret) {
const network = network_js_1.Network.from(_network);
if (projectId == null) {
projectId = defaultProjectId;
@ -55,6 +79,12 @@ class InfuraProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
catch (error) { }
return super._getProvider(chainId);
}
isCommunityResource() {
return (this.projectId === defaultProjectId);
}
static getWebSocketProvider(network, apiKey) {
return new InfuraWebSocketProvider(network, apiKey);
}
static getRequest(network, projectId, projectSecret) {
if (projectId == null) {
projectId = defaultProjectId;
@ -75,9 +105,6 @@ class InfuraProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
}
return request;
}
isCommunityResource() {
return (this.projectId === defaultProjectId);
}
}
exports.InfuraProvider = InfuraProvider;
//# sourceMappingURL=provider-infura.js.map

@ -1 +1 @@
{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":";;;AAAA,gDAE2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAOxD,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAE5D,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,WAAW;YACZ,OAAO,mBAAmB,CAAC;QAC/B,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;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B;QACxF,IAAI,SAAS,IAAI,IAAI,EAAE;YAAE,SAAS,GAAG,gBAAgB,CAAC;SAAE;QACxD,IAAI,aAAa,IAAI,IAAI,EAAE;YAAE,aAAa,GAAG,IAAI,CAAC;SAAE;QAEpD,MAAM,OAAO,GAAG,IAAI,uBAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,OAAQ,SAAU,EAAE,CAAC,CAAC;QAC1F,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,IAAI,aAAa,EAAE;YAAE,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;SAAE;QAEjE,IAAI,SAAS,KAAK,gBAAgB,EAAE;YAChC,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,IAAA,kCAAmB,EAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CAEJ;AAhDD,wCAgDC"}

@ -198,72 +198,15 @@ exports.JsonRpcSigner = JsonRpcSigner;
*/
class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
#options;
// The next ID to use for the JSON-RPC ID field
#nextId;
// Payloads are queued and triggered in batches using the drainTimer
#payloads;
#ready;
#starting;
#drainTimer;
#notReady;
#network;
constructor(network, options) {
super(network);
this.#ready = false;
this.#starting = null;
this.#nextId = 1;
this.#options = Object.assign({}, defaultOptions, options || {});
this.#payloads = [];
this.#drainTimer = null;
this.#network = null;
// This could be relaxed in the future to just check equivalent networks
const staticNetwork = this._getOption("staticNetwork");
if (staticNetwork) {
if (staticNetwork !== network) {
(0, index_js_4.throwArgumentError)("staticNetwork MUST match network object", "options", options);
}
this.#network = staticNetwork;
}
}
/**
* Returns the value associated with the option %%key%%.
*
* Sub-classes can use this to inquire about configuration options.
*/
_getOption(key) {
return this.#options[key];
}
get _network() {
if (!this.#network) {
(0, index_js_4.throwError)("network is not available yet", "NETWORK_ERROR");
}
return this.#network;
}
get ready() { return this.#ready; }
async _start() {
if (this.#ready) {
return;
}
if (this.#starting) {
return this.#starting;
}
this.#starting = (async () => {
// Bootstrap the network
if (this.#network == null) {
try {
this.#network = await this._detectNetwork();
}
catch (error) {
console.log("JsonRpcProvider failed to startup; retry in 1s");
await stall(1000);
this.#starting = null;
}
}
this.#ready = true;
this.#starting = null;
// Start dispatching requests
this.#scheduleDrain();
})();
}
#scheduleDrain() {
if (this.#drainTimer || !this.ready) {
if (this.#drainTimer) {
return;
}
// If we aren't using batching, no hard in sending it immeidately
@ -320,31 +263,46 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
}
}, stallTime);
}
/**
* Requests the %%method%% with %%params%% via the JSON-RPC protocol
* over the underlying channel. This can be used to call methods
* on the backend that do not have a high-level API within the Provider
* API.
*
* This method queues requests according to the batch constraints
* in the options, assigns the request a unique ID.
*
* **Do NOT override** this method in sub-classes; instead
* override [[_send]] or force the options values in the
* call to the constructor to modify this method's behavior.
*/
send(method, params) {
// @TODO: cache chainId?? purge on switch_networks
const id = this.#nextId++;
const promise = new Promise((resolve, reject) => {
this.#payloads.push({
resolve, reject,
payload: { method, params, id, jsonrpc: "2.0" }
constructor(network, options) {
super(network);
this.#nextId = 1;
this.#options = Object.assign({}, defaultOptions, options || {});
this.#payloads = [];
this.#drainTimer = null;
this.#network = null;
{
let resolve = null;
const promise = new Promise((_resolve) => {
resolve = _resolve;
});
});
// If there is not a pending drainTimer, set one
this.#scheduleDrain();
return promise;
this.#notReady = { promise, resolve };
}
// This could be relaxed in the future to just check equivalent networks
const staticNetwork = this._getOption("staticNetwork");
if (staticNetwork) {
if (staticNetwork !== network) {
(0, index_js_4.throwArgumentError)("staticNetwork MUST match network object", "options", options);
}
this.#network = staticNetwork;
}
}
/**
* Returns the value associated with the option %%key%%.
*
* Sub-classes can use this to inquire about configuration options.
*/
_getOption(key) {
return this.#options[key];
}
/**
* Gets the [[Network]] this provider has committed to. On each call, the network
* is detected, and if it has changed, the call will reject.
*/
get _network() {
if (!this.#network) {
(0, index_js_4.throwError)("network is not available yet", "NETWORK_ERROR");
}
return this.#network;
}
/**
* Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel.
@ -357,44 +315,40 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
});
}
/**
* Resolves to the [[Signer]] account for %%address%% managed by
* the client.
* Resolves to the non-normalized value by performing %%req%%.
*
* If the %%address%% is a number, it is used as an index in the
* the accounts from [[listAccounts]].
*
* This can only be used on clients which manage accounts (such as
* Geth with imported account or MetaMask).
*
* Throws if the account doesn't exist.
* Sub-classes may override this to modify behavior of actions,
* and should generally call ``super._perform`` as a fallback.
*/
async getSigner(address = 0) {
const accountsPromise = this.send("eth_accounts", []);
// Account index
if (typeof (address) === "number") {
const accounts = (await accountsPromise);
if (address > accounts.length) {
throw new Error("no such account");
}
return new JsonRpcSigner(this, accounts[address]);
}
const { accounts } = await (0, index_js_4.resolveProperties)({
network: this.getNetwork(),
accounts: accountsPromise
});
// Account address
address = (0, index_js_1.getAddress)(address);
for (const account of accounts) {
if ((0, index_js_1.getAddress)(account) === account) {
return new JsonRpcSigner(this, account);
async _perform(req) {
// Legacy networks do not like the type field being passed along (which
// is fair), so we delete type if it is 0 and a non-EIP-1559 network
if (req.method === "call" || req.method === "estimateGas") {
let tx = req.transaction;
if (tx && tx.type != null && (0, index_js_4.getBigInt)(tx.type)) {
// If there are no EIP-1559 properties, it might be non-EIP-a559
if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {
const feeData = await this.getFeeData();
if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {
// Network doesn't know about EIP-1559 (and hence type)
req = Object.assign({}, req, {
transaction: Object.assign({}, tx, { type: undefined })
});
}
}
}
}
throw new Error("invalid account");
const request = this.getRpcRequest(req);
if (request != null) {
return await this.send(request.method, request.args);
}
return super._perform(req);
}
/** Sub-classes can override this; it detects the *actual* network that
/** Sub-classes may override this; it detects the *actual* network that
* we are **currently** connected to.
*
* Keep in mind that [[send]] may only be used once [[ready]].
* Keep in mind that [[send]] may only be used once [[ready]], otherwise the
* _send primitive must be used instead.
*/
async _detectNetwork() {
const network = this._getOption("staticNetwork");
@ -410,17 +364,63 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
id: this.#nextId++, method: "eth_chainId", params: [], jsonrpc: "2.0"
};
this.emit("debug", { action: "sendRpcPayload", payload });
const result = (await this._send(payload))[0];
let result;
try {
result = (await this._send(payload))[0];
}
catch (error) {
this.emit("debug", { action: "receiveRpcError", error });
throw error;
}
this.emit("debug", { action: "receiveRpcResult", result });
if ("result" in result) {
return network_js_1.Network.from((0, index_js_4.getBigInt)(result.result));
}
throw this.getRpcError(payload, result);
}
/**
* Sub-classes **MUST** call this. Until [[_start]] has been called, no calls
* will be passed to [[_send]] from [[send]]. If it is overridden, then
* ``super._start()`` **MUST** be called.
*
* Calling it multiple times is safe and has no effect.
*/
_start() {
if (this.#notReady == null || this.#notReady.resolve == null) {
return;
}
this.#notReady.resolve();
this.#notReady = null;
(async () => {
// Bootstrap the network
while (this.#network == null) {
try {
this.#network = await this._detectNetwork();
}
catch (error) {
console.log("JsonRpcProvider failed to startup; retry in 1s");
await stall(1000);
}
}
// Start dispatching requests
this.#scheduleDrain();
})();
}
/**
* Resolves once the [[_start]] has been called. This can be used in
* sub-classes to defer sending data until the connection has been
* established.
*/
async _waitUntilReady() {
if (this.#notReady == null) {
return;
}
return await this.#notReady.promise;
}
/**
* Return a Subscriber that will manage the %%sub%%.
*
* Sub-classes can override this to modify the behavior of
* Sub-classes may override this to modify the behavior of
* subscription management.
*/
_getSubscriber(sub) {
@ -438,6 +438,10 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
}
return super._getSubscriber(sub);
}
/**
* Returns true only if the [[_start]] has been called.
*/
get ready() { return this.#notReady == null; }
/**
* Returns %%tx%% as a normalized JSON-RPC transaction request,
* which has all values hexlified and any numeric values converted
@ -496,7 +500,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
method: "eth_getCode",
args: [getLowerCase(req.address), req.blockTag]
};
case "getStorageAt":
case "getStorage":
return {
method: "eth_getStorageAt",
args: [
@ -613,34 +617,65 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider {
return (0, index_js_4.makeError)("could not coalesce error", "UNKNOWN_ERROR", { error });
}
/**
* Resolves to the non-normalized value by performing %%req%%.
* Requests the %%method%% with %%params%% via the JSON-RPC protocol
* over the underlying channel. This can be used to call methods
* on the backend that do not have a high-level API within the Provider
* API.
*
* Sub-classes may override this to modify behavior of actions,
* and should generally call ``super._perform`` as a fallback.
* This method queues requests according to the batch constraints
* in the options, assigns the request a unique ID.
*
* **Do NOT override** this method in sub-classes; instead
* override [[_send]] or force the options values in the
* call to the constructor to modify this method's behavior.
*/
async _perform(req) {
// Legacy networks do not like the type field being passed along (which
// is fair), so we delete type if it is 0 and a non-EIP-1559 network
if (req.method === "call" || req.method === "estimateGas") {
let tx = req.transaction;
if (tx && tx.type != null && (0, index_js_4.getBigInt)(tx.type)) {
// If there are no EIP-1559 properties, it might be non-EIP-a559
if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {
const feeData = await this.getFeeData();
if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {
// Network doesn't know about EIP-1559 (and hence type)
req = Object.assign({}, req, {
transaction: Object.assign({}, tx, { type: undefined })
});
}
}
send(method, params) {
// @TODO: cache chainId?? purge on switch_networks
const id = this.#nextId++;
const promise = new Promise((resolve, reject) => {
this.#payloads.push({
resolve, reject,
payload: { method, params, id, jsonrpc: "2.0" }
});
});
// If there is not a pending drainTimer, set one
this.#scheduleDrain();
return promise;
}
/**
* Resolves to the [[Signer]] account for %%address%% managed by
* the client.
*
* If the %%address%% is a number, it is used as an index in the
* the accounts from [[listAccounts]].
*
* This can only be used on clients which manage accounts (such as
* Geth with imported account or MetaMask).
*
* Throws if the account doesn't exist.
*/
async getSigner(address = 0) {
const accountsPromise = this.send("eth_accounts", []);
// Account index
if (typeof (address) === "number") {
const accounts = (await accountsPromise);
if (address > accounts.length) {
throw new Error("no such account");
}
return new JsonRpcSigner(this, accounts[address]);
}
const { accounts } = await (0, index_js_4.resolveProperties)({
network: this.getNetwork(),
accounts: accountsPromise
});
// Account address
address = (0, index_js_1.getAddress)(address);
for (const account of accounts) {
if ((0, index_js_1.getAddress)(account) === account) {
return new JsonRpcSigner(this, account);
}
}
const request = this.getRpcRequest(req);
if (request != null) {
return await this.send(request.method, request.args);
}
return super._perform(req);
throw new Error("invalid account");
}
}
exports.JsonRpcApiProvider = JsonRpcApiProvider;
@ -668,16 +703,19 @@ class JsonRpcProvider extends JsonRpcApiProvider {
}
this.#pollingInterval = 4000;
}
_getConnection() {
return this.#connect.clone();
}
async send(method, params) {
// All requests are over HTTP, so we can just start handling requests
// We do this here rather than the constructor so that we don't send any
// requests to the network until we absolutely have to.
// requests to the network (i.e. eth_chainId) until we absolutely have to.
await this._start();
return await super.send(method, params);
}
async _send(payload) {
// Configure a POST connection for the requested method
const request = this.#connect.clone();
const request = this._getConnection();
request.body = JSON.stringify(payload);
const response = await request.send();
response.assertOk();

File diff suppressed because one or more lines are too long

@ -165,9 +165,13 @@ class SocketProvider extends provider_jsonrpc_js_1.JsonRpcApiProvider {
// WebSocket provider doesn't accept batches
(0, index_js_1.assertArgument)(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload);
// @TODO: stringify payloads here and store to prevent mutations
// Prepare a promise to respond to
const promise = new Promise((resolve, reject) => {
this.#callbacks.set(payload.id, { payload, resolve, reject });
});
// Wait until the socket is connected before writing to it
await this._waitUntilReady();
// Write the request to the socket
await this._write(JSON.stringify(payload));
return [await promise];
}
@ -195,17 +199,19 @@ class SocketProvider extends provider_jsonrpc_js_1.JsonRpcApiProvider {
return;
}
this.#callbacks.delete(result.id);
if ("error" in result) {
const { message, code, data } = result.error;
const error = (0, index_js_1.makeError)(message || "unkonwn error", "SERVER_ERROR", {
request: `ws:${JSON.stringify(callback.payload)}`,
info: { code, data }
});
callback.reject(error);
}
else {
callback.resolve(result.result);
}
callback.resolve(result);
/*
if ("error" in result) {
const { message, code, data } = result.error;
const error = makeError(message || "unkonwn error", "SERVER_ERROR", {
request: `ws:${ JSON.stringify(callback.payload) }`,
info: { code, data }
});
callback.reject(error);
} else {
callback.resolve(result.result);
}
*/
}
else if (result.method === "eth_subscription") {
const filterId = result.params.subscription;

File diff suppressed because one or more lines are too long

@ -4,9 +4,13 @@ exports.WebSocketProvider = void 0;
const ws_js_1 = require("./ws.js"); /*-browser*/
const provider_socket_js_1 = require("./provider-socket.js");
class WebSocketProvider extends provider_socket_js_1.SocketProvider {
url;
#websocket;
get websocket() { return this.#websocket; }
get websocket() {
if (this.#websocket == null) {
throw new Error("websocket closed");
}
return this.#websocket;
}
constructor(url, network) {
super(network);
if (typeof (url) === "string") {
@ -31,6 +35,13 @@ class WebSocketProvider extends provider_socket_js_1.SocketProvider {
async _write(message) {
this.websocket.send(message);
}
async destroy() {
if (this.#websocket == null) {
return;
}
this.#websocket.close();
this.#websocket = null;
}
}
exports.WebSocketProvider = WebSocketProvider;
//# sourceMappingURL=provider-websocket.js.map

@ -1 +1 @@
{"version":3,"file":"provider-websocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":";;;AAEA,mCAAkD,CAAC,YAAY;AAE/D,6DAAsD;AAetD,MAAa,iBAAkB,SAAQ,mCAAc;IACjD,GAAG,CAAU;IAEb,UAAU,CAAgB;IAC1B,IAAI,SAAS,KAAoB,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAE1D,YAAY,GAA2B,EAAE,OAAoB;QACzD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;YAC1B,IAAI,CAAC,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SACzB;QAED,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE;YAC/B,IAAI;gBACA,MAAM,IAAI,CAAC,MAAM,EAAE,CAAA;aACtB;YAAC,OAAO,KAAK,EAAE;gBACZ,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;gBACxD,sCAAsC;aACzC;QACL,CAAC,CAAC;QAEF,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,CAAC,OAAyB,EAAE,EAAE;YACrD,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC,CAAC;IACN,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QACxB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,OAAO;QACT,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;YAAE,OAAO;SAAE;QACxC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IAC3B,CAAC;CACJ;AAtCD,8CAsCC"}

@ -101,7 +101,7 @@ class Block {
constructor(block, provider) {
this.#transactions = Object.freeze(block.transactions.map((tx) => {
if (typeof (tx) !== "string" && tx.provider !== provider) {
throw new Error("provider mismatch");
return (new TransactionResponse(tx, provider));
}
return tx;
}));
@ -259,17 +259,14 @@ class TransactionReceipt {
gasUsed;
cumulativeGasUsed;
gasPrice;
byzantium;
type;
//readonly byzantium!: boolean;
status;
root;
#logs;
constructor(tx, provider) {
this.#logs = Object.freeze(tx.logs.map((log) => {
if (provider !== log.provider) {
//return log.connect(provider);
throw new Error("provider mismatch");
}
return log;
return new Log(log, provider);
}));
(0, index_js_1.defineProperties)(this, {
provider,
@ -284,7 +281,8 @@ class TransactionReceipt {
gasUsed: tx.gasUsed,
cumulativeGasUsed: tx.cumulativeGasUsed,
gasPrice: (tx.effectiveGasPrice || tx.gasPrice),
byzantium: tx.byzantium,
type: tx.type,
//byzantium: tx.byzantium,
status: tx.status,
root: tx.root
});
@ -294,10 +292,13 @@ class TransactionReceipt {
// return new TransactionReceipt(this, provider);
//}
toJSON() {
const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, byzantium, status, root } = this;
const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,
status, root } = this;
return {
_type: "TransactionReceipt",
blockHash, blockNumber, byzantium, contractAddress,
blockHash, blockNumber,
//byzantium,
contractAddress,
cumulativeGasUsed: toJson(this.cumulativeGasUsed),
from,
gasPrice: toJson(this.gasPrice),

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
{"version":3,"file":"update-publish-properties.js","sourceRoot":"","sources":["../../src.ts/_admin/update-publish-properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGrC,MAAM,KAAK,GAAwB,EAAG,CAAC;AAEvC,KAAK,UAAU,aAAa,CAAC,IAAY;IACrC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;QACd,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,YAAY,CAAC,8BAA8B,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACpF,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CAAC,GAA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UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YACpD,IAAI,UAAU,IAAI,IAAI,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC/C,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;aAC1C;YACD,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,YAAY,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACpF;aAAM,IAAI,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACrE,0EAA0E;YAC1E,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;SACxD;KACJ;IACD,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAErC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}

@ -1,7 +0,0 @@
import { atomicWrite } from "./utils/fs.js";
import { resolve } from "./utils/path.js";
import { loadJson } from "./utils/json.js";
const version = loadJson(resolve("package.json")).version;
const content = `export const version = "${version}";\n`;
atomicWrite(resolve("src.ts/_version.ts"), content);
//# sourceMappingURL=update-version-const.js.map

@ -1 +0,0 @@
{"version":3,"file":"update-version-const.js","sourceRoot":"","sources":["../../src.ts/_admin/update-version-const.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC;AAE1D,MAAM,OAAO,GAAG,2BAA4B,OAAQ,MAAM,CAAC;AAC3D,WAAW,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC"}

@ -1,11 +1,9 @@
import fs from "fs";
import semver from "semver";
import { keccak256 } from "../crypto/index.js";
import { FetchRequest } from "../utils/index.js";
import { loadJson, saveJson } from "./utils/json.js";
import { atomicWrite } from "./utils/fs.js";
import { getGitTag } from "./utils/git.js";
import { loadJson, saveJson } from "./utils/json.js";
import { resolve } from "./utils/path.js";
import { run } from "./utils/run.js";
const cache = {};
async function getNpmPackage(name) {
if (!cache[name]) {
@ -15,34 +13,9 @@ async function getNpmPackage(name) {
}
return cache[name] || null;
}
function getPackList() {
const result = run("npm", ["pack", "--json", resolve("."), "--dry-run"]);
if (!result.ok) {
const error = new Error("failed to run npm pack");
error.result = result;
throw error;
}
return JSON.parse(result.stdout)[0].files.map((info) => info.path);
}
function computeTarballHash() {
// Sort the files to get a consistent hash
const files = getPackList();
files.sort();
const hashes = files.reduce((accum, filename) => {
let content = fs.readFileSync(resolve(filename));
// The package.json includes the hash, so we need to normalize it first
if (filename === "package.json") {
const info = JSON.parse(content.toString());
delete info.gitHead;
delete info.tarballHash;
content = Buffer.from(JSON.stringify(info, null, 2));
}
accum[filename] = keccak256(content);
return accum;
}, {});
return keccak256(Buffer.from("{" + files.map((filename) => {
return `${JSON.stringify(filename)}:"${hashes[filename]}"`;
}).join(",") + "}"));
function writeVersion(version) {
const content = `export const version = "${version}";\n`;
atomicWrite(resolve("src.ts/_version.ts"), content);
}
(async function () {
// Local pkg
@ -54,12 +27,12 @@ function computeTarballHash() {
const remoteVersion = remoteInfo["dist-tags"][tag];
// Remote pkg
const remotePkgInfo = remoteInfo.versions[remoteVersion];
// Compute the populated values
const tarballHash = computeTarballHash();
const remoteGitHead = remotePkgInfo.gitHead;
const gitHead = await getGitTag(resolve("."));
if (remotePkgInfo.tarballHash !== tarballHash) {
pkgInfo.tarballHash = tarballHash;
pkgInfo.gitHead = gitHead;
// There are new commits, not reflected in the package
// published on npm; update the gitHead and version
if (gitHead !== remoteGitHead) {
// Bump the version from the remote version
if (tag.indexOf("beta") >= 0) {
// Still a beta branch; advance the beta version
const prerelease = semver.prerelease(remoteVersion);
@ -72,9 +45,15 @@ function computeTarballHash() {
// If we want to bump the minor version, it was done explicitly in the pkg
pkgInfo.version = semver.inc(remoteVersion, "patch");
}
pkgInfo.gitHead = gitHead;
// Save the package.json
saveJson(pkgPath, pkgInfo, true);
// Save the src.ts/_version.ts
writeVersion(pkgInfo.version);
}
saveJson(pkgPath, pkgInfo, true);
})().catch((error) => {
console.log("ERROR");
console.log(error);
process.exit(1);
});
//# sourceMappingURL=update-publish-properties.js.map
//# sourceMappingURL=update-version.js.map

@ -0,0 +1 @@
{"version":3,"file":"update-version.js","sourceRoot":"","sources":["../../src.ts/_admin/update-version.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,MAAM,KAAK,GAAwB,EAAG,CAAC;AAEvC,KAAK,UAAU,aAAa,CAAC,IAAY;IACrC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;QACd,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,YAAY,CAAC,8BAA8B,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACpF,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,C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YAAY,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACpF;aAAM,IAAI,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACrE,0EAA0E;YAC1E,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;SACxD;QAED,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;QAE1B,wBAAwB;QACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAEjC,8BAA8B;QAC9B,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;KACjC;AAEL,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACjB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACnB,CAAC,CAAC,CAAC"}

@ -0,0 +1,241 @@
;
export const testAddress = {
mainnet: [
{
test: "old-account",
address: "0xAC1639CF97a3A46D431e6d1216f576622894cBB5",
balance: BigInt("4813414100000000"),
nonce: 3,
code: "0x"
}, {
test: "TheDAO-splitter-contract",
address: "0x3474627D4F63A678266BC17171D87f8570936622",
code: "0x606060405260e060020a60003504630b3ed5368114602e57806337b0574a14605257806356fa47f0146062575b005b602c6004356000546101009004600160a060020a03908116339091161460bb575b50565b60005460ff166060908152602090f35b602c60043560005460ff1615609657600160a060020a038116600034606082818181858883f193505050501515604f576002565b33600160a060020a0316600034606082818181858883f193505050501515604f576002565b600080546101009004600160a060020a03169082606082818181858883f193505050501515604f57600256",
storage: {
"0": "0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300"
}
}, {
test: "ricmoo.firefly.eth",
address: "0x8ba1f109551bD432803012645Ac136ddd64DBA72",
name: "ricmoo.firefly.eth"
},
],
goerli: []
};
export const testBlock = {
mainnet: [
{
test: "old-homestead-block",
hash: "0x3d6122660cc824376f11ee842f83addc3525e2dd6756b9bcf0affa6aa88cf741",
parentHash: "0xb495a1d7e6663152ae92708da4843337b958146015a2802f4193a410044698c9",
number: 3,
timestamp: 1438270048,
nonce: "0x2e9344e0cbde83ce",
difficulty: BigInt(17154715646),
gasLimit: BigInt("0x1388"),
gasUsed: BigInt("0"),
miner: "0x5088D623ba0fcf0131E0897a91734A4D83596AA0",
extraData: "0x476574682f76312e302e302d66633739643332642f6c696e75782f676f312e34",
transactions: []
},
{
test: "london-block",
number: 14413999,
hash: "0x6c79356d40ebb6ed63dc19f5d407f8f1c876047b59dc1a4598cce0e64dcabec5",
parentHash: "0xbf09b0e215f247a5066d19ece5b4c66960771d45fae62985e8d751fb1adcfe2f",
timestamp: 1647654576,
nonce: "0xb4bc9979af5369fe",
difficulty: BigInt("12841513359509721"),
gasLimit: BigInt("30087914"),
gasUsed: BigInt("2008910"),
miner: "0x2A20380DcA5bC24D052acfbf79ba23e988ad0050",
extraData: "0x706f6f6c696e2e636f6d21f7092f019bb92a76",
baseFeePerGas: BigInt("40911884304"),
transactions: [
"0x1c3a398933db10634631f54b435c40c8805c13f12bbac7c3dab858ca44213fa2",
"0xd98947cbdd892cc7f679c903903e6d18a5c5afb19e94437beba79372ad71c347",
"0x4d66190deb55b5820cb0ce9adb972f646fa0f3e64eaeee674bbf3d054bf3d883",
"0x9db7bd5f4c91d6103c714bcbc35df3dc708daa668aaef7449b589dbd3be24dac",
"0x126a43ae4ade4b7fc5c8ac9ebd3dbcf7314f63c60f2804fb49aa25b5c7d80bb1",
"0x82a90aa4b3b1b7873b117c3ff1ca7165ae34b2fc0788cc0cbfd41805d588590d",
"0x7f694a6a9972457753ed3dec164f17272b1c8b1da4eab149df95e31a3e72f606",
"0xdce1cba1ff33f0c23881087d49de3b34fe84c8a6883f3edd75b04fc23e458aac",
"0xbe1c69f825279cebef42d1f0e07397dcddef7fb278b0195e295ede3e156836c4",
"0x1d2f007b3c0f894403973a30e5ffaa78589f873d963e9554c6bb1bd7a3127245",
"0x9c8c78191cf4ae9ae8eee1165153eabe24dbd8b9509b83d5f0caeea85251bb2f",
"0x42e956f4b3dd6535359b272a0d2dab995c364cb48baaf8d0a1981995f3f8c808",
"0xdc2c2e99393e24d5dc66e38665fa1d1ff007d92088ef3fd2549545fdbe862ef6",
"0xaad7be28fffd2e77e8e40bf57f2ac140aa8283ec93c7f3f61a82c79405602f53",
"0x4735f1421b7b30283e87e0799e82e54307d3e5ba14cd54ad8420b57577489a71",
"0x0b9d6aa23aa439b41e86595f2ad91f498adffa3e6e7cb26ac7d73252e59fd3de",
"0xcd93e19bd5d5c5a834fec613116fa01f46eddfd2faa20ef302271b874b9d812a",
"0x5bf1976574a637f5ac0b8bda1a792fa16cc7ce9624d32e9bd6bd9aa6a8f19d2f",
"0x2e778da4f66f10f7b681b605635c6599cdbeea167fc1c4396a097aef5d06de61",
"0xd5fd68eebc4c870ccda081786a74c75c250e9e2d8269b8935edb3adb11b80bb2",
"0x2aec42a11c1d8c1e5198d54aacbc6bebb09bcd5e78f6af81ea09d65c9064734a",
"0xbea2e364ea4959ec438d9ccc2d2f7120c7eaba3b177cc0d7df8ff65d866ef89f",
"0xf48bbb0f838353060da4126a555ce532abf497a9d1108001afffaac513a59ddf",
"0xf5664e4372cce62733a6610efb7701a4a0e552d81f8caa764d8474b3070c6617",
"0x9d3732ddbd20610008ff737da2f61120734a1cbfa864374bcbcf10051e6048cb",
"0xc4d0df5bc6fa51b34ac3c898866d779d4e51a6be4d13be1ec3084b7229b03b47",
"0x90c86ec98b8ad98049b4ee54cb3aa72c5ae743077b830e8a294aa5dc47a1fb18"
]
}
],
goerli: [],
};
export const testTransaction = {
mainnet: [
{
test: "legacy",
hash: "0xccc90ab97a74c952fb3376c4a3efb566a58a10df62eb4d44a61e106fcf10ec61",
blockHash: "0x9653f180a5720f3634816eb945a6d722adee52cc47526f6357ac10adaf368135",
blockNumber: 4097745,
// index: 18,
type: 0,
from: "0x32DEF047DeFd076DB21A2D759aff2A591c972248",
gasPrice: BigInt("0x4a817c800"),
gasLimit: BigInt("0x3d090"),
to: "0x6fC21092DA55B392b045eD78F4732bff3C580e2c",
value: BigInt("0x186cc6acd4b0000"),
nonce: 0,
data: "0xf2c298be000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000067269636d6f6f0000000000000000000000000000000000000000000000000000",
signature: {
r: "0x1e5605197a03e3f0a168f14749168dfeefc44c9228312dacbffdcbbb13263265",
s: "0x269c3e5b3558267ad91b0a887d51f9f10098771c67b82ea6cb74f29638754f54",
yParity: 1,
v: 28,
networkV: BigInt(38),
},
creates: null,
chainId: BigInt(1)
},
{
test: "EIP-1559",
hash: "0x8ff41d0ba5d239acc8c123ff12451a2c15721c838f657e583d355999af4a4349",
blockHash: '0x9d4c3bef68e119841281105da96beb1c7252f357340d7a3355236b3332b197b0',
blockNumber: 12966000,
// index: 185,
type: 2,
from: '0x5afFBa12E9332bbc0E221c8E7BEf7CB7cfB3F281',
to: '0x2258CcD34ae29E6B199b6CD64eb2aEF157df7CdE',
gasLimit: BigInt("21000"),
nonce: 2,
data: '0x',
value: BigInt("1100000000000000"),
gasPrice: BigInt("70578812137"),
maxPriorityFeePerGas: BigInt("1000000000"),
maxFeePerGas: BigInt("131115411100"),
chainId: BigInt(1),
signature: {
r: "0xdd26e5478d0aa84e334a0393d335ab24b83de8ecae9290305f15ab884ded246c",
s: "0x6494b4f61b0d9a5a82ecb86d72b301f859f404f0bec9682bbfff619903ecfbe2",
yParity: 1,
v: 28,
networkV: null
},
creates: null,
accessList: []
}
],
goerli: []
};
export const testReceipt = {
mainnet: [
{
test: "legacy",
//byzantium: false,
blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566",
blockNumber: 0x3c92b5,
type: 0,
contractAddress: null,
cumulativeGasUsed: BigInt(0x1cca2e),
from: "0x18C6045651826824FEBBD39d8560584078d1b247",
gasUsed: BigInt(0x14bb7),
gasPrice: BigInt(4100000000),
logs: [
{
address: "0x314159265dD8dbb310642f98f50C066173C1259b",
blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566",
blockNumber: 0x3c92b5,
data: "0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247",
index: 0x1a,
topics: [
"0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82",
"0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae",
"0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1"
],
transactionHash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616",
transactionIndex: 0x39,
},
{
address: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef",
blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566",
blockNumber: 0x3c92b5,
data: "0x000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000595a32ce",
index: 0x1b,
topics: [
"0x0f0c27adfd84b60b6f456b0e87cdccb1e5fb9603991588d87fa99f5b6b61e670",
"0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1",
"0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247"
],
transactionHash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616",
transactionIndex: 0x39,
}
],
logsBloom: "0x00000000000000040000000000100000010000000000000040000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200000010000000004000000000000000000000000000000000002000000000000000000000000400000000020000000000000000000000000000000000000004000000000000000000000000000000000000000000000000801000000000000000000000020000000000040000000040000000000000000002000000004000000000000000000000000000000000000000000000010000000000000000000000000000000000200000000000000000",
root: "0x9b550a9a640ce50331b64504ef87aaa7e2aaf97344acb6ff111f879b319d2590",
// Should be null for pre-byzantium, but some nodes have backfilled it
status: 1,
to: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef",
hash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616",
index: 0x39
}, {
test: "byzantium",
//byzantium: true,
blockHash: "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9",
blockNumber: 0x444f76,
type: 0,
contractAddress: null,
cumulativeGasUsed: BigInt(0x15bfe7),
from: "0x18C6045651826824FEBBD39d8560584078d1b247",
gasUsed: BigInt(0x1b968),
gasPrice: BigInt(1000000000),
logs: [
{
address: "0xb90E64082D00437e65A76d4c8187596BC213480a",
blockHash: "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9",
blockNumber: 0x444f76,
data: "0x",
index: 0x10,
topics: [
"0x748d071d1992ee1bfe7a39058114d0a50d5798fe8eb3a9bfb4687f024629a2ce",
"0x5574aa58f7191ccab6de6cf75fe2ea0484f010b852fdd8c6b7ae151d6c2f4b83"
],
transactionHash: "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac",
transactionIndex: 0x1e,
}
],
logsBloom: "0x00000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000800000000000000000800000000000000000000000000000000000000",
root: null,
status: 1,
to: "0xb90E64082D00437e65A76d4c8187596BC213480a",
hash: "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac",
index: 0x1e
}
],
goerli: []
};
export const networkNames = [
"mainnet", "goerli"
];
export function networkFeatureAtBlock(feature, block) {
switch (feature) {
case "byzantium":
return block >= 4370000;
default:
break;
}
throw new Error(`unknown feature: ${feature}`);
}
//# sourceMappingURL=blockchain-data.js.map

@ -0,0 +1 @@
{"version":3,"file":"blockchain-data.js","sourceRoot":"","sources":["../../src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":"AAuFC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAgE;IACpF,OAAO,EAAE;QACL;YACI,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,4CAA4C;YACrD,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC;YACnC,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,IAAI;SACb,EAAE;YACC,IAAI,EAAE,0BAA0B;YAChC,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,kdAAkd;YACxd,OAAO,EAAE;gBACL,GAAG,EAAE,oEAAoE;aAC5E;SACJ,EAAE;YACC,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,oBAAoB;SAC7B;KACJ;IACD,MAAM,EAAE,EACP;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAA8D;IAChF,OAAO,EAAE;QACL;YACI,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,oEAAoE;YAC1E,UAAU,EAAE,oEAAoE;YAChF,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,UAAU;YACrB,KAAK,EAAE,oBAAoB;YAC3B,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC;YAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;YAC1B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC;YACpB,KAAK,EAAE,4CAA4C;YACnD,SAAS,EAAE,oEAAoE;YAC/E,YAAY,EAAE,EAAG;SACpB;QACD;YACI,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,oEAAoE;YAC1E,UAAU,EAAE,oEAAoE;YAChF,SAAS,EAAE,UAAU;YACrB,KAAK,EAAE,oBAAoB;YAC3B,UAAU,EAAE,MAAM,CAA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AAE;wBACJ,oEAAoE;wBACpE,oEAAoE;qBACvE;oBACD,eAAe,EAAE,oEAAoE;oBACrF,gBAAgB,EAAE,IAAI;iBACzB;aACJ;YACD,SAAS,EAAE,ogBAAogB;YAC/gB,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,CAAC;YACT,EAAE,EAAE,4CAA4C;YAChD,IAAI,EAAE,oEAAoE;YAC1E,KAAK,EAAE,IAAI;SACd;KACJ;IACD,MAAM,EAAE,EACP;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAiC;IACtD,SAAS,EAAE,QAAQ;CACtB,CAAC;AACF,MAAM,UAAU,qBAAqB,CAAC,OAAe,EAAE,KAAa;IAChE,QAAQ,OAAO,EAAE;QACb,KAAK,WAAW;YACZ,OAAO,KAAK,IAAI,OAAO,CAAC;QAC5B;YACI,MAAM;KACb;IACD,MAAM,IAAI,KAAK,CAAC,oBAAqB,OAAQ,EAAE,CAAC,CAAC;AACrD,CAAC"}

@ -1,8 +1,9 @@
import { AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider,
// PocketProvider,
FallbackProvider, } from "../index.js";
// FallbackProvider,
} from "../index.js";
;
const ethNetworks = ["default", "homestead", "rinkeby", "ropsten", "goerli"];
const ethNetworks = ["default", "mainnet", "rinkeby", "ropsten", "goerli"];
//const maticNetworks = [ "matic", "maticmum" ];
const ProviderCreators = [
{
@ -21,7 +22,7 @@ const ProviderCreators = [
},
{
name: "CloudflareProvider",
networks: ["default", "homestead"],
networks: ["default", "mainnet"],
create: function (network) {
return new CloudflareProvider(network);
}
@ -40,13 +41,20 @@ const ProviderCreators = [
return new InfuraProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1");
}
},
{
name: "InfuraWebsocketProvider",
networks: ethNetworks,
create: function (network) {
return InfuraProvider.getWebSocketProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1");
}
},
/*
{
name: "PocketProvider",
networks: ethNetworks,
create: function(network: string) {
const apiKeys: Record<string, string> = {
homestead: "6004bcd10040261633ade990",
mainnet: "6004bcd10040261633ade990",
ropsten: "6004bd4d0040261633ade991",
rinkeby: "6004bda20040261633ade994",
goerli: "6004bd860040261633ade992",
@ -55,25 +63,23 @@ const ProviderCreators = [
}
},
*/
{
name: "FallbackProvider",
networks: ethNetworks,
create: function (network) {
const providers = [];
for (const creator of ProviderCreators) {
if (creator.name === "FallbackProvider") {
continue;
}
if (creator.networks.indexOf(network) >= 0) {
const provider = creator.create(network);
if (provider) {
providers.push(provider);
/*
{
name: "FallbackProvider",
networks: ethNetworks,
create: function(network: string) {
const providers: Array<AbstractProvider> = [];
for (const creator of ProviderCreators) {
if (creator.name === "FallbackProvider") { continue; }
if (creator.networks.indexOf(network) >= 0) {
const provider = creator.create(network);
if (provider) { providers.push(provider); }
}
}
return new FallbackProvider(providers);
}
return new FallbackProvider(providers);
}
},
},
*/
];
export const providerNames = Object.freeze(ProviderCreators.map((c) => (c.name)));
function getCreator(provider) {
@ -97,6 +103,10 @@ export function getProvider(provider, network) {
}
return null;
}
export function checkProvider(provider, network) {
const creator = getCreator(provider);
return (creator != null);
}
export function connect(network) {
const provider = getProvider("InfuraProvider", network);
if (provider == null) {

@ -1 +1 @@
{"version":3,"file":"create-provider.js","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,cAAc;AAClB,qBAAqB;AAEjB,gBAAgB,GACnB,MAAM,aAAa,CAAC;AAQpB,CAAC;AAEF,MAAM,WAAW,GAAG,CAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAE,CAAC;AAC/E,gDAAgD;AAEhD,MAAM,gBAAgB,GAA2B;IAC7C;QACI,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAS,OAAe;YAC5B,OAAO,IAAI,eAAe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,CAAC,QAAgB,EAAE,OAAe;IAC3D,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,OAAe;IACnC,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACxD,IAAI,QAAQ,IAAI,IAAI,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAyB,OAAQ,EAAE,CAAC,CAAC;KAAE;IAC/E,OAAO,QAAQ,CAAC;AACpB,CAAC"}

@ -19,7 +19,7 @@ describe("Resolve ENS avatar", function () {
].forEach((test) => {
it(`Resolves avatar for ${test.title}`, async function () {
this.timeout(60000);
const provider = connect("homestead");
const provider = connect("mainnet");
const avatar = await provider.getAvatar(test.name);
assert.equal(avatar, test.value, "avatar url");
});

@ -1 +1 @@
{"version":3,"file":"test-providers-avatar.js","sourceRoot":"","sources":["../../src.ts/_tests/test-providers-avatar.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,QAAQ,CAAC,oBAAoB,EAAE;IAC3B;QACI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,owCAAowC,EAAE;QAC7zC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,8EAA8E,EAAE;QACvI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,qCAAqC,EAAE;KAC/F,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,EAAE,CAAC,uBAAwB,IAAI,CAAC,KAAM,EAAE,EAAE,KAAK;YAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB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AE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,qCAAqC,EAAE;KAC/F,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,EAAE,CAAC,uBAAwB,IAAI,CAAC,KAAM,EAAE,EAAE,KAAK;YAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;YACpC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH;QACI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,4IAA4I,EAAE;QACpM,iHAAiH;KAC5G,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,EAAE,CAAC,uBAAwB,IAAI,CAAC,KAAM,EAAE,EAAE,KAAK;YAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;YACpC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnD,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}

@ -0,0 +1,192 @@
import assert from "assert";
import { checkProvider, getProvider, providerNames } from "./create-provider.js";
import { networkFeatureAtBlock, networkNames, testAddress, testBlock, testReceipt, testTransaction } from "./blockchain-data.js";
function forEach(prefix, tests, func) {
for (const networkName of networkNames) {
const networkTests = tests[networkName];
if (networkTests == null) {
continue;
}
for (const test of networkTests) {
for (const providerName of providerNames) {
if (!checkProvider(providerName, networkName)) {
continue;
}
// Let the testcase skip this by returning null
const testFunc = func(providerName, test);
if (testFunc == null) {
continue;
}
// Prepare the testcase
it(`${prefix}: ${providerName}:${networkName}.${test.test}`, async function () {
// Create a provider
const provider = getProvider(providerName, networkName);
try {
assert.ok(provider != null, "missing provider");
await testFunc(provider);
}
catch (error) {
// Shutdown socket-based provider, otherwise its socket will prevent
// this process from exiting
if (provider.destroy) {
provider.destroy();
}
throw error;
}
// Shutdown socket-based provider, otherwise its socket will prevent
// this process from exiting
if (provider.destroy) {
provider.destroy();
}
});
}
}
}
}
describe("Test Provider Address operations", function () {
forEach("test getBalance(address)", testAddress, (providerName, test) => {
if (test.balance == null) {
return null;
}
return async (provider) => {
assert.equal(await provider.getBalance(test.address), test.balance);
};
});
forEach("test getCode(address)", testAddress, (providerName, test) => {
if (test.code == null) {
return null;
}
return async (provider) => {
assert.equal(await provider.getCode(test.address), test.code);
};
});
/*
forEach("test lookupAddress(address)", testAddress, (provider, test) => {
if (test.name == null) { return null; }
return async () => {
assert.equal(await provider.lookupAddress(test.address), test.name);
};
});
forEach("test resolveName(name)", testAddress, (provider, test) => {
if (test.name == null) { return null; }
return async () => {
assert.equal(await provider.lookupAddress(<string>(test.name)), test.address);
};
});
*/
forEach("test getStorage(address)", testAddress, (providerName, test) => {
if (test.storage == null) {
return null;
}
return async (provider) => {
for (const key in test.storage) {
assert.equal(await provider.getStorage(test.address, key), test.storage[key]);
}
};
});
forEach("test getTransactionCount(address)", testAddress, (providerName, test) => {
if (test.balance == null) {
return null;
}
return async (provider) => {
assert.equal(await provider.getTransactionCount(test.address), test.nonce);
};
});
});
function assertObj(prefix, actual, expected) {
assert.ok(actual != null, `${prefix} is null`);
for (const key in expected) {
if (expected[key] === undefined) {
continue;
}
assert.equal(actual[key], expected[key], `${prefix}.${key}`);
}
}
function assertBlock(actual, expected) {
// Check transactions
for (let i = 0; i < expected.transactions.length; i++) {
const expectedTx = expected.transactions[i];
if (typeof (expectedTx) === "string") {
assert.equal(actual.transactions[i], expectedTx, `block.transactions[${i}]`);
}
else {
throw new Error("@TODO");
}
}
// Remove the transactions and test keys
expected = Object.assign({}, expected, { transactions: undefined, test: undefined });
// Check remaining keys
assertObj("block", actual, expected);
}
function assertTransaction(actual, expected) {
// @TODO: Accesslist
// Check signature
assertObj("tx.signature", actual.signature, expected.signature);
// Remove the transactions and test keys
expected = Object.assign({}, expected, {
accessList: undefined,
signature: undefined,
test: undefined
});
// Check remaining keys
assertObj("tx", actual, expected);
}
function assertReceipt(actual, expected) {
// Check logs
for (let i = 0; i < expected.logs.length; i++) {
let expectedLog = expected.logs[i];
for (let j = 0; j < expectedLog.topics.length; j++) {
assert.equal(actual.logs[i].topics[j], expectedLog.topics[j], `receipt.logs[${i}].topics[${j}]`);
}
expectedLog = Object.assign({}, expectedLog, { topics: undefined });
assertObj(`receipt.log[${i}]`, actual.logs[i], expectedLog);
}
// Remove the transactions and test keys
expected = Object.assign({}, expected, { logs: undefined, test: undefined });
// In Byzantium, the root was dropped and the status was added
if (networkFeatureAtBlock("byzantium", expected.blockNumber)) {
expected = Object.assign({}, expected, { root: undefined });
}
else {
expected = Object.assign({}, expected, { status: undefined });
}
// Check remaining keys
assertObj("receipt", actual, expected);
}
describe("Test Provider Block operations", function () {
forEach("test getBlock(blockHash)", testBlock, (providerName, test) => {
// Etherscan does not support getting a block by blockhash
if (providerName === "EtherscanProvider") {
return null;
}
return async (provider) => {
assertBlock(await provider.getBlock(test.hash), test);
};
});
forEach("test getBlock(blockNumber)", testBlock, (providerName, test) => {
return async (provider) => {
assertBlock(await provider.getBlock(test.number), test);
};
});
});
describe("Test Provider Transaction operations", function () {
forEach("test getTransaction(hash)", testTransaction, (providerName, test) => {
return async (provider) => {
assertTransaction(await provider.getTransaction(test.hash), test);
};
});
forEach("test getTransactionReceipt(hash)", testReceipt, (providerName, test) => {
return async (provider) => {
const receipt = await provider.getTransactionReceipt(test.hash);
assert.ok(receipt != null, "receipt != null");
// Cloudflare doesn't return the root in legacy receipts; but it isn't
// *actually* that important, so we'll give it a pass...
if (providerName === "CloudflareProvider") {
test = Object.assign({}, test, { root: undefined });
}
assertReceipt(receipt, test);
};
});
});
//# sourceMappingURL=test-providers-data.js.map

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
export const version = "6.0.0-beta-exports.2";
export const version = "6.0.0-beta-exports.3";
//# sourceMappingURL=_version.js.map

@ -7,11 +7,11 @@ export { ZeroAddress, NegativeOne, Zero, One, Two, WeiPerEther, MaxUint256, MinI
export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, } from "./contract/index.js";
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js";
export { id, isValidName, namehash, dnsEncode, hashMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder } from "./hash/index.js";
export { AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider,
//PocketProvider } from "./provider-pocket.js";
IpcSocketProvider, SocketProvider, WebSocketProvider, Network } from "./providers/index.js";
export { accessListify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js";
export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, throwArgumentError, throwError, isCallException, isError, getIpfsGatewayFunc, FetchRequest, FetchResponse, FetchCancelSignal, FixedFormat, FixedNumber, formatFixed, parseFixed, getBigInt, getNumber, toArray, toBigInt, toHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp } from "./utils/index.js";
export { defaultPath, getAccountPath, HDNodeWallet, HDNodeVoidWallet, HDNodeWalletManager, isCrowdsaleJson, decryptCrowdsaleJson, isKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, Mnemonic, Wallet } from "./wallet/index.js";
export { Wordlist, langEn, LangEn, wordlists, WordlistOwl, WordlistOwlA } from "./wordlists/index.js";
export { AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider,
//PocketProvider } from "./provider-pocket.js";
IpcSocketProvider, SocketProvider, WebSocketProvider, Network } from "./providers/index.js";
//# sourceMappingURL=ethers.js.map

@ -1 +1 @@
{"version":3,"file":"ethers.js","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":"AAEA,6BAA6B;AAC7B,EAAE;AAEF,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EACH,mBAAmB,EAAE,kBAAkB,EAEvC,QAAQ,EAAE,eAAe,EACzB,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAExF,iBAAiB,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,sBAAsB,EACrF,KAAK,GACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,iBAAiB,EACtC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,WAAW,EACX,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAC7E,QAAQ,EACR,WAAW,EAAE,aAAa,EAC7B,MA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AAW,EAAE,UAAU,EACjD,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EACpE,QAAQ,EAAE,MAAM,EAAE,IAAI,EACtB,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAChD,oBAAoB,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EACjE,cAAc,EACd,SAAS,EAAE,SAAS,EACvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACH,WAAW,EACX,cAAc,EACd,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EACnD,eAAe,EAAE,oBAAoB,EACrC,cAAc,EAAE,uBAAuB,EAAE,mBAAmB,EAC5D,mBAAmB,EACnB,QAAQ,EACR,MAAM,EACT,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EACjE,MAAM,sBAAsB,CAAC"}

@ -580,9 +580,9 @@ export class AbstractProvider {
async getCode(address, blockTag) {
return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag));
}
async getStorageAt(address, _position, blockTag) {
async getStorage(address, _position, blockTag) {
const position = getBigInt(_position, "position");
return hexlify(await this.#getAccountValue({ method: "getStorageAt", position }, address, blockTag));
return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag));
}
// Write
async broadcastTransaction(signedTx) {

File diff suppressed because one or more lines are too long

@ -34,7 +34,7 @@ export function injectCommonNetworks() {
});
}
}
registerEth("homestead", 1, { ensNetwork: 1, altNames: ["mainnet"] });
registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] });
registerEth("ropsten", 3, { ensNetwork: 3 });
registerEth("rinkeby", 4, { ensNetwork: 4 });
registerEth("goerli", 5, { ensNetwork: 5 });

@ -1 +1 @@
{"version":3,"file":"common-networks.js","sourceRoot":"","sources":["../../src.ts/providers/common-networks.ts"],"names":[],"mappings":"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AM,EAAE,oCAAoC;YAC5C,GAAG,EAAE,uCAAuC;SAC/C;KACJ,CAAC,CAAC;IAEH,WAAW,CAAC,KAAK,EAAE,EAAE,EAAE;QACnB,UAAU,EAAE,CAAC;QACb,SAAS,EAAE;YACP,MAAM,EAAE,oCAAoC;YAC5C,GAAG,EAAE,yBAAyB;SACjC;KACJ,CAAC,CAAC;IACH,WAAW,CAAC,MAAM,EAAE,EAAE,EAAE;QACpB,SAAS,EAAE;YACP,MAAM,EAAE,oCAAoC;YAC5C,GAAG,EAAE,iCAAiC;SACzC;KACJ,CAAC,CAAC;AACP,CAAC;AAED,oBAAoB,EAAE,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,CAAC"}

@ -1,4 +1,5 @@
import { getAddress, getCreateAddress } from "../address/index.js";
import { Signature } from "../crypto/index.js";
import { accessListify } from "../transaction/index.js";
import { getBigInt, getNumber, hexlify, isHexString, zeroPadValue, throwArgumentError, throwError } from "../utils/index.js";
const BN_0 = BigInt(0);
@ -115,20 +116,22 @@ export const formatReceiptLog = object({
address: getAddress,
topics: arrayOf(formatHash),
data: formatData,
logIndex: getNumber,
index: getNumber,
blockHash: formatHash,
}, {
index: ["logIndex"]
});
export const formatTransactionReceipt = object({
to: allowNull(getAddress, null),
from: allowNull(getAddress, null),
contractAddress: allowNull(getAddress, null),
transactionIndex: getNumber,
// should be allowNull(hash), but broken-EIP-658 support is handled in receipt
index: getNumber,
root: allowNull(hexlify),
gasUsed: getBigInt,
logsBloom: allowNull(formatData),
blockHash: formatHash,
transactionHash: formatHash,
hash: formatHash,
logs: arrayOf(formatReceiptLog),
blockNumber: getNumber,
confirmations: allowNull(getNumber, null),
@ -137,7 +140,9 @@ export const formatTransactionReceipt = object({
status: allowNull(getNumber),
type: getNumber
}, {
effectiveGasPrice: ["gasPrice"]
effectiveGasPrice: ["gasPrice"],
hash: ["transactionHash"],
index: ["transactionIndex"],
});
export function formatTransactionResponse(value) {
// Some clients (TestRPC) do strange things like return 0x0 for the
@ -168,9 +173,6 @@ export function formatTransactionResponse(value) {
value: getBigInt,
nonce: getNumber,
data: formatData,
r: allowNull(formatUint256),
s: allowNull(formatUint256),
v: allowNull(getNumber),
creates: allowNull(getAddress, null),
chainId: allowNull(getBigInt, null)
}, {
@ -184,7 +186,16 @@ export function formatTransactionResponse(value) {
// @TODO: Check fee data
// Add an access list to supported transaction types
if ((value.type === 1 || value.type === 2) && value.accessList == null) {
value.accessList = [];
result.accessList = [];
}
// Compute the signature
result.signature = Signature.from(value);
// Some backends omit ChainId on legacy transactions, but we can compute it
if (result.chainId == null) {
const chainId = result.signature.legacyChainId;
if (chainId != null) {
result.chainId = chainId;
}
}
// @TODO: check chainID
/*

File diff suppressed because one or more lines are too long

@ -131,7 +131,7 @@ export class Network {
static from(network) {
// Default network
if (network == null) {
return Network.from("homestead");
return Network.from("mainnet");
}
// Canonical name or chain ID
if (typeof (network) === "number") {

@ -1 +1 @@
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACH,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EACpD,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAyBhE;;;;;;;;;;;;;;;;EAgBE;AAEF;;;;;;;;;;;;;EAaE;AAEF,uEAAuE;AACvE,sEAAsE;AACtE,uEAAuE;AACvE,uDAAuD;AACvD;;;;;;;;;;;;;;EAcE;AAEF,MAAM,QAAQ,GAAwC,IAAI,GAAG,EAAE,CAAC;AAEhE,2EAA2E;AAE3E,MAAM,OAAO,OAAO;IAChB,MAAM,CAKJ;IAEF,YAAY,IAAY,EAAE,QAAsB;QAC5C,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAE,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C,UAAU,CAAC,CAAC,CAAC;aAC5F;YAED,0CAA0C;YAC1C,2FAA2F;YAC3F,GAAG;YAEH,OAAO,MAAM,CAAC;SACjB;QAED,OAAO,kBAAkB,CAAC,iBAAiB,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAuC,EAAE,WAA0B;QAC/E,IAAI,OAAM,CAAC,aAAa,CAAC,KAAK,QAAQ,EAAE;YAAE,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;SAAE;QAClF,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC7C,IAAI,QAAQ,EAAE;YACV,kBAAkB,CAAC,2BAA4B,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAE,EAAE,EAAE,eAAe,EAAE,aAAa,CAAC,CAAC;SACpH;QACD,QAAQ,CAAC,GAAG,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAC7C,CAAC;CACJ"}

@ -5,7 +5,7 @@ import { JsonRpcProvider } from "./provider-jsonrpc.js";
const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";
function getHost(name) {
switch (name) {
case "homestead":
case "mainnet":
return "eth-mainnet.alchemyapi.io";
case "ropsten":
return "eth-ropsten.alchemyapi.io";
@ -32,7 +32,7 @@ function getHost(name) {
}
export class AlchemyProvider extends JsonRpcProvider {
apiKey;
constructor(_network = "homestead", apiKey) {
constructor(_network = "mainnet", apiKey) {
const network = Network.from(_network);
if (apiKey == null) {
apiKey = defaultApiKey;

@ -1 +1 @@
{"version":3,"file":"provider-alchemy.js","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AACA,OAAO,EACH,gBAAgB,EAAE,YAAY,EAAE,kBAAkB,EAAE,UAAU,EACjE,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EA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;CACJ"}

@ -5,7 +5,7 @@ import { JsonRpcProvider } from "./provider-jsonrpc.js";
const defaultApiKey = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";
function getHost(name) {
switch (name) {
case "homestead":
case "mainnet":
return "rpc.ankr.com/eth";
case "ropsten":
return "rpc.ankr.com/eth_ropsten";
@ -22,7 +22,7 @@ function getHost(name) {
}
export class AnkrProvider extends JsonRpcProvider {
apiKey;
constructor(_network = "homestead", apiKey) {
constructor(_network = "mainnet", apiKey) {
const network = Network.from(_network);
if (apiKey == null) {
apiKey = defaultApiKey;

@ -1 +1 @@
{"version":3,"file":"provider-ankr.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAAE,YAAY,EAAE,kBAAkB,EACrD,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMxD,MAAM,aAAa,GAAG,kEAAkE,CAAC;AAEzF,SAAS,OAAO,CAAC,IAAY;IACzB,QAAQ,IAAI,EAAE;QACV,KAAK,WAAW;YACZ,OAAO,kBAAkB,CAAC;QAC9B,KAAK,SAAS;YACV,OAAO,0BAA0B,CAAC;QACtC,KAAK,SAAS;YACV,OAAO,0BAA0B,CAAC;QACtC,KAAK,QAAQ;YACT,OAAO,yBAAyB,CAAC;QACrC,KAAK,OAAO;YACR,OAAO,sBAAsB,CAAC;QAClC,KAAK,UAAU;YACX,OAAO,uBAAuB,CAAC;KACtC;IACD,OAAO,kBAAkB,CAAC,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AACtE,CAAC;AAGD,MAAM,OAAO,YAAa,SAAQ,eAAe;IACpC,MAAM,CAAU;IAEzB,YAAY,WAAuB,WAAW,EAAE,MAAsB;Q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C,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAEjC,gBAAgB,CAAe,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,YAAY,CAAC,OAAe;QACxB,IAAI;YACA,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SACjD;QAAC,OAAO,KAAK,EAAE,GAAG;QACnB,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,MAAsB;QACtD,IAAI,MAAM,IAAI,IAAI,EAAE;YAAE,MAAM,GAAG,aAAa,CAAC;SAAE;QAE/C,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,IAAK,MAAO,EAAE,CAAC,CAAC;QACpF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,MAAM,KAAK,aAAa,EAAE;YAC1B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,mBAAmB,CAAC,cAAc,CAAC,CAAC;gBACpC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC;IAC3C,CAAC;CACJ"}

@ -2,9 +2,9 @@ import { throwArgumentError } from "../utils/index.js";
import { Network } from "./network.js";
import { JsonRpcProvider } from "./provider-jsonrpc.js";
export class CloudflareProvider extends JsonRpcProvider {
constructor(_network = "homestead") {
constructor(_network = "mainnet") {
const network = Network.from(_network);
if (network.name !== "homestead") {
if (network.name !== "mainnet") {
return throwArgumentError("unsupported network", "network", _network);
}
super("https:/\/cloudflare-eth.com/", network, { staticNetwork: network });

@ -1 +1 @@
{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKxD,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IACnD,YAAY,WAAuB,WAAW;QAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,EAAE;YAC9B,OAAO,kBAAkB,CAAC,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;SACzE;QACD,KAAK,CAAC,8BAA8B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ"}
{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKxD,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IACnD,YAAY,WAAuB,SAAS;QACxC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE;YAC5B,OAAO,kBAAkB,CAAC,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;SACzE;QACD,KAAK,CAAC,8BAA8B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ"}

@ -39,7 +39,7 @@ export class BaseEtherscanProvider extends AbstractProvider {
return this.#plugin.baseUrl;
}
switch (this.network.name) {
case "homestead":
case "mainnet":
return "https:/\/api.etherscan.io";
case "ropsten":
return "https:/\/api-ropsten.etherscan.io";
@ -289,7 +289,7 @@ export class BaseEtherscanProvider extends AbstractProvider {
address: req.address,
tag: req.blockTag
});
case "getStorageAt":
case "getStorage":
return this.fetch("proxy", {
action: "eth_getStorageAt",
address: req.address,
@ -411,7 +411,7 @@ export class BaseEtherscanProvider extends AbstractProvider {
return this.network;
}
async getEtherPrice() {
if (this.network.name !== "homestead") {
if (this.network.name !== "mainnet") {
return 0.0;
}
return parseFloat((await this.fetch("stats", { action: "ethprice" })).ethusd);

File diff suppressed because one or more lines are too long

@ -55,7 +55,7 @@ function normalize(provider, value, req) {
return getNumber(value).toString();
case "getCode":
return hexlify(value);
case "getStorageAt":
case "getStorage":
return hexlify(value);
case "getBlock":
if (req.includeTransactions) {
@ -313,7 +313,7 @@ export class FallbackProvider extends AbstractProvider {
case "getBalance":
case "getTransactionCount":
case "getCode":
case "getStorageAt":
case "getStorage":
case "getTransaction":
case "getTransactionReceipt":
case "getLogs":

File diff suppressed because one or more lines are too long

@ -1,11 +1,12 @@
import { defineProperties, FetchRequest, throwArgumentError } from "../utils/index.js";
import { defineProperties, FetchRequest, throwArgumentError, throwError } from "../utils/index.js";
import { showThrottleMessage } from "./community.js";
import { Network } from "./network.js";
import { JsonRpcProvider } from "./provider-jsonrpc.js";
import { WebSocketProvider } from "./provider-websocket.js";
const defaultProjectId = "84842078b09946638c03157f83405213";
function getHost(name) {
switch (name) {
case "homestead":
case "mainnet":
return "mainnet.infura.io";
case "ropsten":
return "ropsten.infura.io";
@ -30,10 +31,32 @@ function getHost(name) {
}
return throwArgumentError("unsupported network", "network", name);
}
export class InfuraWebSocketProvider extends WebSocketProvider {
projectId;
projectSecret;
constructor(network, apiKey) {
const provider = new InfuraProvider(network, apiKey);
const req = provider._getConnection();
if (req.credentials) {
throwError("INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", {
operation: "InfuraProvider.getWebSocketProvider()"
});
}
const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/");
super(url, network);
defineProperties(this, {
projectId: provider.projectId,
projectSecret: provider.projectSecret
});
}
isCommunityResource() {
return (this.projectId === defaultProjectId);
}
}
export class InfuraProvider extends JsonRpcProvider {
projectId;
projectSecret;
constructor(_network = "homestead", projectId, projectSecret) {
constructor(_network = "mainnet", projectId, projectSecret) {
const network = Network.from(_network);
if (projectId == null) {
projectId = defaultProjectId;
@ -52,6 +75,12 @@ export class InfuraProvider extends JsonRpcProvider {
catch (error) { }
return super._getProvider(chainId);
}
isCommunityResource() {
return (this.projectId === defaultProjectId);
}
static getWebSocketProvider(network, apiKey) {
return new InfuraWebSocketProvider(network, apiKey);
}
static getRequest(network, projectId, projectSecret) {
if (projectId == null) {
projectId = defaultProjectId;
@ -72,8 +101,5 @@ export class InfuraProvider extends JsonRpcProvider {
}
return request;
}
isCommunityResource() {
return (this.projectId === defaultProjectId);
}
}
//# sourceMappingURL=provider-infura.js.map

@ -1 +1 @@
{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAAE,YAAY,EAAE,kBAAkB,EACrD,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOxD,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAE5D,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,WAAW;YACZ,OAAO,mBAAmB,CAAC;QAC/B,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAC/B,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAC/B,KA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,OAAO,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,SAAyB,EAAE,aAA6B;QACxF,IAAI,SAAS,IAAI,IAAI,EAAE;YAAE,SAAS,GAAG,gBAAgB,CAAC;SAAE;QACxD,IAAI,aAAa,IAAI,IAAI,EAAE;YAAE,aAAa,GAAG,IAAI,CAAC;SAAE;QAEpD,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,OAAQ,SAAU,EAAE,CAAC,CAAC;QAC1F,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,IAAI,aAAa,EAAE;YAAE,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;SAAE;QAEjE,IAAI,SAAS,KAAK,gBAAgB,EAAE;YAChC,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CAEJ"}

@ -194,72 +194,15 @@ export class JsonRpcSigner extends AbstractSigner {
*/
export class JsonRpcApiProvider extends AbstractProvider {
#options;
// The next ID to use for the JSON-RPC ID field
#nextId;
// Payloads are queued and triggered in batches using the drainTimer
#payloads;
#ready;
#starting;
#drainTimer;
#notReady;
#network;
constructor(network, options) {
super(network);
this.#ready = false;
this.#starting = null;
this.#nextId = 1;
this.#options = Object.assign({}, defaultOptions, options || {});
this.#payloads = [];
this.#drainTimer = null;
this.#network = null;
// This could be relaxed in the future to just check equivalent networks
const staticNetwork = this._getOption("staticNetwork");
if (staticNetwork) {
if (staticNetwork !== network) {
throwArgumentError("staticNetwork MUST match network object", "options", options);
}
this.#network = staticNetwork;
}
}
/**
* Returns the value associated with the option %%key%%.
*
* Sub-classes can use this to inquire about configuration options.
*/
_getOption(key) {
return this.#options[key];
}
get _network() {
if (!this.#network) {
throwError("network is not available yet", "NETWORK_ERROR");
}
return this.#network;
}
get ready() { return this.#ready; }
async _start() {
if (this.#ready) {
return;
}
if (this.#starting) {
return this.#starting;
}
this.#starting = (async () => {
// Bootstrap the network
if (this.#network == null) {
try {
this.#network = await this._detectNetwork();
}
catch (error) {
console.log("JsonRpcProvider failed to startup; retry in 1s");
await stall(1000);
this.#starting = null;
}
}
this.#ready = true;
this.#starting = null;
// Start dispatching requests
this.#scheduleDrain();
})();
}
#scheduleDrain() {
if (this.#drainTimer || !this.ready) {
if (this.#drainTimer) {
return;
}
// If we aren't using batching, no hard in sending it immeidately
@ -316,31 +259,46 @@ export class JsonRpcApiProvider extends AbstractProvider {
}
}, stallTime);
}
/**
* Requests the %%method%% with %%params%% via the JSON-RPC protocol
* over the underlying channel. This can be used to call methods
* on the backend that do not have a high-level API within the Provider
* API.
*
* This method queues requests according to the batch constraints
* in the options, assigns the request a unique ID.
*
* **Do NOT override** this method in sub-classes; instead
* override [[_send]] or force the options values in the
* call to the constructor to modify this method's behavior.
*/
send(method, params) {
// @TODO: cache chainId?? purge on switch_networks
const id = this.#nextId++;
const promise = new Promise((resolve, reject) => {
this.#payloads.push({
resolve, reject,
payload: { method, params, id, jsonrpc: "2.0" }
constructor(network, options) {
super(network);
this.#nextId = 1;
this.#options = Object.assign({}, defaultOptions, options || {});
this.#payloads = [];
this.#drainTimer = null;
this.#network = null;
{
let resolve = null;
const promise = new Promise((_resolve) => {
resolve = _resolve;
});
});
// If there is not a pending drainTimer, set one
this.#scheduleDrain();
return promise;
this.#notReady = { promise, resolve };
}
// This could be relaxed in the future to just check equivalent networks
const staticNetwork = this._getOption("staticNetwork");
if (staticNetwork) {
if (staticNetwork !== network) {
throwArgumentError("staticNetwork MUST match network object", "options", options);
}
this.#network = staticNetwork;
}
}
/**
* Returns the value associated with the option %%key%%.
*
* Sub-classes can use this to inquire about configuration options.
*/
_getOption(key) {
return this.#options[key];
}
/**
* Gets the [[Network]] this provider has committed to. On each call, the network
* is detected, and if it has changed, the call will reject.
*/
get _network() {
if (!this.#network) {
throwError("network is not available yet", "NETWORK_ERROR");
}
return this.#network;
}
/**
* Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel.
@ -353,44 +311,40 @@ export class JsonRpcApiProvider extends AbstractProvider {
});
}
/**
* Resolves to the [[Signer]] account for %%address%% managed by
* the client.
* Resolves to the non-normalized value by performing %%req%%.
*
* If the %%address%% is a number, it is used as an index in the
* the accounts from [[listAccounts]].
*
* This can only be used on clients which manage accounts (such as
* Geth with imported account or MetaMask).
*
* Throws if the account doesn't exist.
* Sub-classes may override this to modify behavior of actions,
* and should generally call ``super._perform`` as a fallback.
*/
async getSigner(address = 0) {
const accountsPromise = this.send("eth_accounts", []);
// Account index
if (typeof (address) === "number") {
const accounts = (await accountsPromise);
if (address > accounts.length) {
throw new Error("no such account");
}
return new JsonRpcSigner(this, accounts[address]);
}
const { accounts } = await resolveProperties({
network: this.getNetwork(),
accounts: accountsPromise
});
// Account address
address = getAddress(address);
for (const account of accounts) {
if (getAddress(account) === account) {
return new JsonRpcSigner(this, account);
async _perform(req) {
// Legacy networks do not like the type field being passed along (which
// is fair), so we delete type if it is 0 and a non-EIP-1559 network
if (req.method === "call" || req.method === "estimateGas") {
let tx = req.transaction;
if (tx && tx.type != null && getBigInt(tx.type)) {
// If there are no EIP-1559 properties, it might be non-EIP-a559
if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {
const feeData = await this.getFeeData();
if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {
// Network doesn't know about EIP-1559 (and hence type)
req = Object.assign({}, req, {
transaction: Object.assign({}, tx, { type: undefined })
});
}
}
}
}
throw new Error("invalid account");
const request = this.getRpcRequest(req);
if (request != null) {
return await this.send(request.method, request.args);
}
return super._perform(req);
}
/** Sub-classes can override this; it detects the *actual* network that
/** Sub-classes may override this; it detects the *actual* network that
* we are **currently** connected to.
*
* Keep in mind that [[send]] may only be used once [[ready]].
* Keep in mind that [[send]] may only be used once [[ready]], otherwise the
* _send primitive must be used instead.
*/
async _detectNetwork() {
const network = this._getOption("staticNetwork");
@ -406,17 +360,63 @@ export class JsonRpcApiProvider extends AbstractProvider {
id: this.#nextId++, method: "eth_chainId", params: [], jsonrpc: "2.0"
};
this.emit("debug", { action: "sendRpcPayload", payload });
const result = (await this._send(payload))[0];
let result;
try {
result = (await this._send(payload))[0];
}
catch (error) {
this.emit("debug", { action: "receiveRpcError", error });
throw error;
}
this.emit("debug", { action: "receiveRpcResult", result });
if ("result" in result) {
return Network.from(getBigInt(result.result));
}
throw this.getRpcError(payload, result);
}
/**
* Sub-classes **MUST** call this. Until [[_start]] has been called, no calls
* will be passed to [[_send]] from [[send]]. If it is overridden, then
* ``super._start()`` **MUST** be called.
*
* Calling it multiple times is safe and has no effect.
*/
_start() {
if (this.#notReady == null || this.#notReady.resolve == null) {
return;
}
this.#notReady.resolve();
this.#notReady = null;
(async () => {
// Bootstrap the network
while (this.#network == null) {
try {
this.#network = await this._detectNetwork();
}
catch (error) {
console.log("JsonRpcProvider failed to startup; retry in 1s");
await stall(1000);
}
}
// Start dispatching requests
this.#scheduleDrain();
})();
}
/**
* Resolves once the [[_start]] has been called. This can be used in
* sub-classes to defer sending data until the connection has been
* established.
*/
async _waitUntilReady() {
if (this.#notReady == null) {
return;
}
return await this.#notReady.promise;
}
/**
* Return a Subscriber that will manage the %%sub%%.
*
* Sub-classes can override this to modify the behavior of
* Sub-classes may override this to modify the behavior of
* subscription management.
*/
_getSubscriber(sub) {
@ -434,6 +434,10 @@ export class JsonRpcApiProvider extends AbstractProvider {
}
return super._getSubscriber(sub);
}
/**
* Returns true only if the [[_start]] has been called.
*/
get ready() { return this.#notReady == null; }
/**
* Returns %%tx%% as a normalized JSON-RPC transaction request,
* which has all values hexlified and any numeric values converted
@ -492,7 +496,7 @@ export class JsonRpcApiProvider extends AbstractProvider {
method: "eth_getCode",
args: [getLowerCase(req.address), req.blockTag]
};
case "getStorageAt":
case "getStorage":
return {
method: "eth_getStorageAt",
args: [
@ -609,34 +613,65 @@ export class JsonRpcApiProvider extends AbstractProvider {
return makeError("could not coalesce error", "UNKNOWN_ERROR", { error });
}
/**
* Resolves to the non-normalized value by performing %%req%%.
* Requests the %%method%% with %%params%% via the JSON-RPC protocol
* over the underlying channel. This can be used to call methods
* on the backend that do not have a high-level API within the Provider
* API.
*
* Sub-classes may override this to modify behavior of actions,
* and should generally call ``super._perform`` as a fallback.
* This method queues requests according to the batch constraints
* in the options, assigns the request a unique ID.
*
* **Do NOT override** this method in sub-classes; instead
* override [[_send]] or force the options values in the
* call to the constructor to modify this method's behavior.
*/
async _perform(req) {
// Legacy networks do not like the type field being passed along (which
// is fair), so we delete type if it is 0 and a non-EIP-1559 network
if (req.method === "call" || req.method === "estimateGas") {
let tx = req.transaction;
if (tx && tx.type != null && getBigInt(tx.type)) {
// If there are no EIP-1559 properties, it might be non-EIP-a559
if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {
const feeData = await this.getFeeData();
if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {
// Network doesn't know about EIP-1559 (and hence type)
req = Object.assign({}, req, {
transaction: Object.assign({}, tx, { type: undefined })
});
}
}
send(method, params) {
// @TODO: cache chainId?? purge on switch_networks
const id = this.#nextId++;
const promise = new Promise((resolve, reject) => {
this.#payloads.push({
resolve, reject,
payload: { method, params, id, jsonrpc: "2.0" }
});
});
// If there is not a pending drainTimer, set one
this.#scheduleDrain();
return promise;
}
/**
* Resolves to the [[Signer]] account for %%address%% managed by
* the client.
*
* If the %%address%% is a number, it is used as an index in the
* the accounts from [[listAccounts]].
*
* This can only be used on clients which manage accounts (such as
* Geth with imported account or MetaMask).
*
* Throws if the account doesn't exist.
*/
async getSigner(address = 0) {
const accountsPromise = this.send("eth_accounts", []);
// Account index
if (typeof (address) === "number") {
const accounts = (await accountsPromise);
if (address > accounts.length) {
throw new Error("no such account");
}
return new JsonRpcSigner(this, accounts[address]);
}
const { accounts } = await resolveProperties({
network: this.getNetwork(),
accounts: accountsPromise
});
// Account address
address = getAddress(address);
for (const account of accounts) {
if (getAddress(account) === account) {
return new JsonRpcSigner(this, account);
}
}
const request = this.getRpcRequest(req);
if (request != null) {
return await this.send(request.method, request.args);
}
return super._perform(req);
throw new Error("invalid account");
}
}
/**
@ -663,16 +698,19 @@ export class JsonRpcProvider extends JsonRpcApiProvider {
}
this.#pollingInterval = 4000;
}
_getConnection() {
return this.#connect.clone();
}
async send(method, params) {
// All requests are over HTTP, so we can just start handling requests
// We do this here rather than the constructor so that we don't send any
// requests to the network until we absolutely have to.
// requests to the network (i.e. eth_chainId) until we absolutely have to.
await this._start();
return await super.send(method, params);
}
async _send(payload) {
// Configure a POST connection for the requested method
const request = this.#connect.clone();
const request = this._getConnection();
request.body = JSON.stringify(payload);
const response = await request.send();
response.assertOk();

File diff suppressed because one or more lines are too long

@ -9,7 +9,7 @@
* - a sub-class MUST call `_processMessage(string)` for each message
*/
import { UnmanagedSubscriber } from "./abstract-provider.js";
import { assertArgument, makeError, throwError } from "../utils/index.js";
import { assertArgument, throwError } from "../utils/index.js";
import { JsonRpcApiProvider } from "./provider-jsonrpc.js";
export class SocketSubscriber {
#provider;
@ -158,9 +158,13 @@ export class SocketProvider extends JsonRpcApiProvider {
// WebSocket provider doesn't accept batches
assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload);
// @TODO: stringify payloads here and store to prevent mutations
// Prepare a promise to respond to
const promise = new Promise((resolve, reject) => {
this.#callbacks.set(payload.id, { payload, resolve, reject });
});
// Wait until the socket is connected before writing to it
await this._waitUntilReady();
// Write the request to the socket
await this._write(JSON.stringify(payload));
return [await promise];
}
@ -188,17 +192,19 @@ export class SocketProvider extends JsonRpcApiProvider {
return;
}
this.#callbacks.delete(result.id);
if ("error" in result) {
const { message, code, data } = result.error;
const error = makeError(message || "unkonwn error", "SERVER_ERROR", {
request: `ws:${JSON.stringify(callback.payload)}`,
info: { code, data }
});
callback.reject(error);
}
else {
callback.resolve(result.result);
}
callback.resolve(result);
/*
if ("error" in result) {
const { message, code, data } = result.error;
const error = makeError(message || "unkonwn error", "SERVER_ERROR", {
request: `ws:${ JSON.stringify(callback.payload) }`,
info: { code, data }
});
callback.reject(error);
} else {
callback.resolve(result.result);
}
*/
}
else if (result.method === "eth_subscription") {
const filterId = result.params.subscription;

File diff suppressed because one or more lines are too long

@ -1,9 +1,13 @@
import { WebSocket as _WebSocket } from "./ws.js"; /*-browser*/
import { SocketProvider } from "./provider-socket.js";
export class WebSocketProvider extends SocketProvider {
url;
#websocket;
get websocket() { return this.#websocket; }
get websocket() {
if (this.#websocket == null) {
throw new Error("websocket closed");
}
return this.#websocket;
}
constructor(url, network) {
super(network);
if (typeof (url) === "string") {
@ -28,5 +32,12 @@ export class WebSocketProvider extends SocketProvider {
async _write(message) {
this.websocket.send(message);
}
async destroy() {
if (this.#websocket == null) {
return;
}
this.#websocket.close();
this.#websocket = null;
}
}
//# sourceMappingURL=provider-websocket.js.map

@ -1 +1 @@
{"version":3,"file":"provider-websocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC,CAAC,YAAY;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAetD,MAAM,OAAO,iBAAkB,SAAQ,cAAc;IACjD,GAAG,CAAU;IAEb,UAAU,CAAgB;IAC1B,IAAI,SAAS,KAAoB,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAE1D,YAAY,GAA2B,EAAE,OAAoB;QACzD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;YAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CA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AU,GAAG,GAAG,CAAC;SACzB;QAED,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE;YAC/B,IAAI;gBACA,MAAM,IAAI,CAAC,MAAM,EAAE,CAAA;aACtB;YAAC,OAAO,KAAK,EAAE;gBACZ,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;gBACxD,sCAAsC;aACzC;QACL,CAAC,CAAC;QAEF,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,CAAC,OAAyB,EAAE,EAAE;YACrD,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC,CAAC;IACN,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QACxB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,OAAO;QACT,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;YAAE,OAAO;SAAE;QACxC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IAC3B,CAAC;CACJ"}

@ -96,7 +96,7 @@ export class Block {
constructor(block, provider) {
this.#transactions = Object.freeze(block.transactions.map((tx) => {
if (typeof (tx) !== "string" && tx.provider !== provider) {
throw new Error("provider mismatch");
return (new TransactionResponse(tx, provider));
}
return tx;
}));
@ -252,17 +252,14 @@ export class TransactionReceipt {
gasUsed;
cumulativeGasUsed;
gasPrice;
byzantium;
type;
//readonly byzantium!: boolean;
status;
root;
#logs;
constructor(tx, provider) {
this.#logs = Object.freeze(tx.logs.map((log) => {
if (provider !== log.provider) {
//return log.connect(provider);
throw new Error("provider mismatch");
}
return log;
return new Log(log, provider);
}));
defineProperties(this, {
provider,
@ -277,7 +274,8 @@ export class TransactionReceipt {
gasUsed: tx.gasUsed,
cumulativeGasUsed: tx.cumulativeGasUsed,
gasPrice: (tx.effectiveGasPrice || tx.gasPrice),
byzantium: tx.byzantium,
type: tx.type,
//byzantium: tx.byzantium,
status: tx.status,
root: tx.root
});
@ -287,10 +285,13 @@ export class TransactionReceipt {
// return new TransactionReceipt(this, provider);
//}
toJSON() {
const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, byzantium, status, root } = this;
const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,
status, root } = this;
return {
_type: "TransactionReceipt",
blockHash, blockNumber, byzantium, contractAddress,
blockHash, blockNumber,
//byzantium,
contractAddress,
cumulativeGasUsed: toJson(this.cumulativeGasUsed),
from,
gasPrice: toJson(this.gasPrice),

File diff suppressed because one or more lines are too long

@ -104,7 +104,7 @@
"types": "./types/wordlistsindex.d.ts"
}
},
"gitHead": "4d435cd56e6dfeff4914e27fff0e9688d41c88b1",
"gitHead": "c1f86802fb0d7af9d01c7255d7d5c70d4b6390e1",
"keywords": [
"ethereum",
"ethers",
@ -129,7 +129,7 @@
"auto-build": "npm run build -- -w",
"build": "tsc --project tsconfig.esm.json",
"build-all": "npm run build && npm run build-commonjs && npm run build-types",
"build-clean": "npm run clean && npm run build-all && npm run _build-dist",
"build-clean": "npm run clean && npm run build && node lib.esm/_admin/update-version.js && npm run build-all && npm run _build-dist",
"build-commonjs": "tsc --project tsconfig.commonjs.json && cp ./package-commonjs.json ./lib.commonjs/package.json",
"build-dist": "npm run build && npm run _build-dist && npm run _dist-stats",
"build-docs": "echo 'foo'",
@ -138,12 +138,10 @@
"stats": "echo 'Dependencies' && npm ls --all --omit=dev",
"test": "mocha --reporter ./reporter.cjs ./lib.esm/_tests/test-*.js",
"test-commonjs": "mocha --reporter ./reporter.cjs ./lib.commonjs/_tests/test-*.js",
"test-coverage": "c8 -o output -r lcov -r text mocha --no-color --reporter ./reporter.cjs ./lib.esm/_tests/test-*.js | tee output/summary.txt",
"update-version": "node lib.esm/_admin/update-publish-properties.js"
"test-coverage": "c8 -o output -r lcov -r text mocha --no-color --reporter ./reporter.cjs ./lib.esm/_tests/test-*.js | tee output/summary.txt"
},
"sideEffects": false,
"tarballHash": "0x6d318afe16d51dd2db7d8f9079a6f542802f2b77edee675b7d46c2e02a054039",
"type": "module",
"types": "./types/index.d.ts",
"version": "6.0.0-beta-exports.2"
"version": "6.0.0-beta-exports.3"
}

@ -1 +1 @@
export const version = "6.0.0-beta-exports.2";
export const version = "6.0.0-beta-exports.3";

2
types/_version.d.ts vendored

@ -1,2 +1,2 @@
export declare const version = "6.0.0-beta-exports.1";
export declare const version = "6.0.0-beta-exports.3";
//# sourceMappingURL=_version.d.ts.map

3
types/ethers.d.ts vendored

@ -5,6 +5,7 @@ export { ZeroAddress, NegativeOne, Zero, One, Two, WeiPerEther, MaxUint256, MinI
export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, } from "./contract/index.js";
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js";
export { id, isValidName, namehash, dnsEncode, hashMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder } from "./hash/index.js";
export { AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, Network } from "./providers/index.js";
export { accessListify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js";
export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, throwArgumentError, throwError, isCallException, isError, getIpfsGatewayFunc, FetchRequest, FetchResponse, FetchCancelSignal, FixedFormat, FixedNumber, formatFixed, parseFixed, getBigInt, getNumber, toArray, toBigInt, toHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp } from "./utils/index.js";
export { defaultPath, getAccountPath, HDNodeWallet, HDNodeVoidWallet, HDNodeWalletManager, isCrowdsaleJson, decryptCrowdsaleJson, isKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, Mnemonic, Wallet } from "./wallet/index.js";
@ -14,7 +15,7 @@ export type { Addressable } from "./address/index.js";
export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides } from "./contract/index.js";
export type { ProgressCallback, SignatureLike } from "./crypto/index.js";
export type { TypedDataDomain, TypedDataField } from "./hash/index.js";
export { AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, Network } from "./providers/index.js";
export type { Provider } from "./providers/index.js";
export type { AccessList, AccessListish, AccessListSet, SignedTransaction, TransactionLike } from "./transaction/index.js";
export type { BytesLike, BigNumberish, Numeric, ErrorCode, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, UnpredictableGasLimitError, ActionRejectedError, CodedEthersError, } from "./utils/index.js";
export type { KeystoreAccountParams, KeystoreAccount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} | {
method: "getStorageAt";
method: "getStorage";
address: string;
position: bigint;
blockTag: BlockTag;
@ -138,7 +138,7 @@ export declare class AbstractProvider implements Provider {
getBalance(address: AddressLike, blockTag?: BlockTag): Promise<bigint>;
getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise<number>;
getCode(address: AddressLike, blockTag?: BlockTag): Promise<string>;
getStorageAt(address: AddressLike, _position: BigNumberish, blockTag?: BlockTag): Promise<string>;
getStorage(address: AddressLike, _position: BigNumberish, blockTag?: BlockTag): Promise<string>;
broadcastTransaction(signedTx: string): Promise<TransactionResponse>;
getBlock(block: BlockTag | string): Promise<null | Block<string>>;
getBlockWithTransactions(block: BlockTag | string): Promise<null | Block<TransactionResponse>>;

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAYA,oBAAY,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AAE7C,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,UAAU,CAKzE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAKtD;AAKD,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAwB/G;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAQjD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKhD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAK7C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAKhD;AAED,eAAO,MAAM,SAAS,YAYpB,CA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.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AACA,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAkC/C,qBAAa,eAAgB,SAAQ,eAAgB,YAAW,oBAAoB;IAChF,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,QAAQ,GAAE,UAAwB,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAUtE,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAOzC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IA6BvD,mBAAmB,IAAI,OAAO;IAI9B,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY;CAerE"}
{"version":3,"file":"provider-alchemy.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AACA,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAkC/C,qBAAa,eAAgB,SAAQ,eAAgB,YAAW,oBAAoB;IAChF,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,QAAQ,GAAE,UAAsB,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAUpE,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAOzC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IA6BvD,mBAAmB,IAAI,OAAO;IAI9B,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY;CAerE"}

@ -1 +1 @@
{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAwB/C,qBAAa,YAAa,SAAQ,eAAgB,YAAW,oBAAoB;IAC7E,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,QAAQ,GAAE,UAAwB,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAatE,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;IAgBzE,mBAAmB,IAAI,OAAO;CAGjC"}
{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAwB/C,qBAAa,YAAa,SAAQ,eAAgB,YAAW,oBAAoB;IAC7E,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,QAAQ,GAAE,UAAsB,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAapE,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;IAgBzE,mBAAmB,IAAI,OAAO;CAGjC"}

@ -1 +1 @@
{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,qBAAa,kBAAmB,SAAQ,eAAe;gBACvC,QAAQ,GAAE,UAAwB;CAOjD"}
{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,qBAAa,kBAAmB,SAAQ,eAAe;gBACvC,QAAQ,GAAE,UAAsB;CAO/C"}

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