admin: updated dist files
This commit is contained in:
parent
7d3af512c7
commit
e03390130c
14
CHANGELOG.md
14
CHANGELOG.md
@ -3,6 +3,20 @@ Change Log
|
||||
|
||||
This change log is maintained by `src.ts/_admin/update-changelog.ts` but may also be manually updated.
|
||||
|
||||
ethers/v6.2.0 (2023-03-20 12:51)
|
||||
--------------------------------
|
||||
|
||||
- Remove use of Function sub-class to address unsafe-eval issues ([#3749](https://github.com/ethers-io/ethers.js/issues/3749), [#3763](https://github.com/ethers-io/ethers.js/issues/3763); [7d3af51](https://github.com/ethers-io/ethers.js/commit/7d3af512c75b4c24027ec2daef1e9f4c1064194a)).
|
||||
- tests: added contract integration tests and llocal Geth ([5318b93](https://github.com/ethers-io/ethers.js/commit/5318b939fdfe8f58cdea4bdff7923f18afbea3a2)).
|
||||
- Added verifyTypedData utility (reported on Farcaster) ([f06a445](https://github.com/ethers-io/ethers.js/commit/f06a445247f3b294f9fc805cc8fe0752accb8edc)).
|
||||
- Removed stray logging in IpcProvider ([#3908](https://github.com/ethers-io/ethers.js/issues/3908), [#3909](https://github.com/ethers-io/ethers.js/issues/3909); [e11d4c1](https://github.com/ethers-io/ethers.js/commit/e11d4c1c20cc5b6fd5803cf9636c4f5bc082dab7)).
|
||||
- Fixed legacy serialization for implicit chainId transactions ([#3898](https://github.com/ethers-io/ethers.js/issues/3898), [#3899](https://github.com/ethers-io/ethers.js/issues/3899); [fcf6c8f](https://github.com/ethers-io/ethers.js/commit/fcf6c8fcee95ec412aaafba8ec84d5049b077a4e)).
|
||||
- Fix Webpack issue (reported on discord) ([3ad4273](https://github.com/ethers-io/ethers.js/commit/3ad4273b8b714bff344ccbfb1eb71ed8a8b7cfa4)).
|
||||
- Fix some bundlers which cannot handle recursive pkg.exports ([#3848](https://github.com/ethers-io/ethers.js/issues/3848); [6315e78](https://github.com/ethers-io/ethers.js/commit/6315e78ea32147653b72ca06f6800f3e2df6ffbf)).
|
||||
- Fixed typo in signature.s error ([#3891](https://github.com/ethers-io/ethers.js/issues/3891); [47ef3eb](https://github.com/ethers-io/ethers.js/commit/47ef3ebde37bfa0c015c258c3d8a6800d751e147)).
|
||||
- Fixed stray unreachable code ([#3890](https://github.com/ethers-io/ethers.js/issues/3890); [c220fe2](https://github.com/ethers-io/ethers.js/commit/c220fe2ea747ccc80cd3c4020e0278e3daf3c4fc)).
|
||||
- Move all wrapping to proper _wrap functions ([#3818](https://github.com/ethers-io/ethers.js/issues/3818); [02a0aad](https://github.com/ethers-io/ethers.js/commit/02a0aad61212c35e8d2723a8ae589989b97dae3e)).
|
||||
|
||||
ethers/v6.1.0 (2023-03-07 02:10)
|
||||
--------------------------------
|
||||
|
||||
|
817
dist/ethers.js
vendored
817
dist/ethers.js
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.js.map
vendored
2
dist/ethers.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.min.js
vendored
2
dist/ethers.min.js
vendored
File diff suppressed because one or more lines are too long
816
dist/ethers.umd.js
vendored
816
dist/ethers.umd.js
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.umd.js.map
vendored
2
dist/ethers.umd.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.umd.min.js
vendored
2
dist/ethers.umd.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/wordlists-extra.js
vendored
2
dist/wordlists-extra.js
vendored
@ -149,7 +149,7 @@ const u64 = {
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
const version = "6.1.0";
|
||||
const version = "6.2.0";
|
||||
|
||||
/**
|
||||
* Property helper functions.
|
||||
|
2
dist/wordlists-extra.js.map
vendored
2
dist/wordlists-extra.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/wordlists-extra.min.js
vendored
2
dist/wordlists-extra.min.js
vendored
File diff suppressed because one or more lines are too long
1
lib.commonjs/_tests/test-contract-integ.d.ts
vendored
Normal file
1
lib.commonjs/_tests/test-contract-integ.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
80
lib.commonjs/_tests/test-contract-integ.js
Normal file
80
lib.commonjs/_tests/test-contract-integ.js
Normal file
@ -0,0 +1,80 @@
|
||||
"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 index_js_1 = require("../index.js");
|
||||
describe("Tests contract integration", function () {
|
||||
const provider = new index_js_1.ethers.JsonRpcProvider("http:/\/127.0.0.1:8545");
|
||||
const abi = [
|
||||
"constructor(address owner, uint maxSupply)",
|
||||
"function mint(address target) returns (bool minted)",
|
||||
"function totalSupply() view returns (uint supply)",
|
||||
"function balanceOf(address target) view returns (uint balance)",
|
||||
"event Minted(address target)"
|
||||
];
|
||||
let address = null;
|
||||
it("deploys a contract", async function () {
|
||||
this.timeout(10000);
|
||||
const bytecode = "0x60c060405234801561001057600080fd5b506040516105863803806105868339818101604052810190610032919061010e565b8173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508060a08181525050505061014e565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a58261007a565b9050919050565b6100b58161009a565b81146100c057600080fd5b50565b6000815190506100d2816100ac565b92915050565b6000819050919050565b6100eb816100d8565b81146100f657600080fd5b50565b600081519050610108816100e2565b92915050565b6000806040838503121561012557610124610075565b5b6000610133858286016100c3565b9250506020610144858286016100f9565b9150509250929050565b60805160a051610414610172600039600060fa0152600061021f01526104146000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806318160ddd146100515780636a6278421461006f57806370a082311461009f5780638da5cb5b146100cf575b600080fd5b6100596100ed565b604051610066919061025c565b60405180910390f35b610089600480360381019061008491906102da565b6100f6565b6040516100969190610322565b60405180910390f35b6100b960048036038101906100b491906102da565b6101d2565b6040516100c6919061025c565b60405180910390f35b6100d761021b565b6040516100e4919061034c565b60405180910390f35b60008054905090565b60007f00000000000000000000000000000000000000000000000000000000000000006000541061012657600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061017690610396565b919050555060008081548092919061018d90610396565b91905055507f90ddedd5a25821bba11fbb98de02ec1f75c1be90ae147d6450ce873e7b78b5d8826040516101c1919061034c565b60405180910390a160019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f0000000000000000000000000000000000000000000000000000000000000000905090565b6000819050919050565b61025681610243565b82525050565b6000602082019050610271600083018461024d565b92915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006102a78261027c565b9050919050565b6102b78161029c565b81146102c257600080fd5b50565b6000813590506102d4816102ae565b92915050565b6000602082840312156102f0576102ef610277565b5b60006102fe848285016102c5565b91505092915050565b60008115159050919050565b61031c81610307565b82525050565b60006020820190506103376000830184610313565b92915050565b6103468161029c565b82525050565b6000602082019050610361600083018461033d565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006103a182610243565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036103d3576103d2610367565b5b60018201905091905056fea26469706673582212200a979ea2bfdf429b5546fa25906c9d20a3d67ef5fbe531f31d2cc83533e3239564736f6c63430008120033";
|
||||
const signer = await provider.getSigner(0);
|
||||
const factory = new index_js_1.ethers.ContractFactory(abi, bytecode, signer);
|
||||
const contract = await factory.deploy(signer, 100);
|
||||
address = await contract.getAddress();
|
||||
await contract.waitForDeployment();
|
||||
const deployed = await provider.getCode(address);
|
||||
assert_1.default.ok(deployed != "0x", "has bytescode");
|
||||
});
|
||||
it("runs contract operations", async function () {
|
||||
this.timeout(10000);
|
||||
assert_1.default.ok(address != null);
|
||||
const signer = await provider.getSigner(0);
|
||||
const CustomContract = index_js_1.ethers.BaseContract.buildClass(abi);
|
||||
const contract = new CustomContract(address, signer); //ethers.Contract.from<ContractAbi>(address, abi, signer);
|
||||
// Test implicit staticCall (i.e. view/pure)
|
||||
{
|
||||
const supply0 = await contract.totalSupply();
|
||||
assert_1.default.equal(supply0, BigInt(0), "initial supply 0; default");
|
||||
}
|
||||
// Test explicit staticCall
|
||||
{
|
||||
const supply0 = await contract.totalSupply.staticCall();
|
||||
assert_1.default.equal(supply0, BigInt(0), "initial supply 0; staticCall");
|
||||
}
|
||||
// Test staticCallResult (positional and named)
|
||||
{
|
||||
const supply0 = await contract.totalSupply.staticCallResult();
|
||||
assert_1.default.equal(supply0[0], BigInt(0), "initial supply 0; staticCallResult");
|
||||
assert_1.default.equal(supply0.supply, BigInt(0), "initial supply 0; staticCallResult");
|
||||
}
|
||||
// Test populateTransaction
|
||||
const txInfo = await contract.mint.populateTransaction(signer);
|
||||
assert_1.default.equal(txInfo.to, address, "populateTransaction.to");
|
||||
const txInfoData = index_js_1.ethers.hexlify(index_js_1.ethers.concat([
|
||||
"0x6a627842",
|
||||
index_js_1.ethers.zeroPadValue(await signer.getAddress(), 32)
|
||||
]));
|
||||
assert_1.default.equal(txInfo.data, txInfoData, "populateTransaction.data");
|
||||
// Test minting (default)
|
||||
const tx = await contract.mint(signer);
|
||||
const receipt = await tx.wait();
|
||||
assert_1.default.ok(receipt, "receipt");
|
||||
// Check the receipt has parsed the events
|
||||
assert_1.default.equal(receipt.logs.length, 1, "logs.length");
|
||||
assert_1.default.ok(receipt instanceof index_js_1.ethers.ContractTransactionReceipt, "receipt typeof");
|
||||
assert_1.default.ok(receipt.logs[0] instanceof index_js_1.ethers.EventLog, "receipt.log typeof");
|
||||
assert_1.default.equal(receipt.logs[0].fragment && receipt.logs[0].fragment.name, "Minted", "logs[0].fragment.name");
|
||||
assert_1.default.equal(receipt.logs[0].args[0], await signer.getAddress(), "logs[0].args[0]");
|
||||
assert_1.default.equal(receipt.logs[0].args.target, await signer.getAddress(), "logs[0].args.target");
|
||||
// Check the state has been adjusted
|
||||
assert_1.default.equal(await contract.totalSupply(), BigInt(1), "initial supply 1; default");
|
||||
assert_1.default.equal(await contract.balanceOf(signer), BigInt(1), "balanceOf(signer)");
|
||||
// Test minting (explicit)
|
||||
const tx2 = await contract.mint.send(signer);
|
||||
await tx2.wait();
|
||||
// Check the state has been adjusted
|
||||
assert_1.default.equal(await contract.totalSupply(), BigInt(2), "initial supply 2; default");
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=test-contract-integ.js.map
|
1
lib.commonjs/_tests/test-contract-integ.js.map
Normal file
1
lib.commonjs/_tests/test-contract-integ.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"test-contract-integ.js","sourceRoot":"","sources":["../../src.ts/_tests/test-contract-integ.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAG5B,0CAAqC;AAQrC,QAAQ,CAAC,4BAA4B,EAAE;IACnC,MAAM,QAAQ,GAAG,IAAI,iBAAM,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC;IAEtE,MAAM,GAAG,GAAG;QACR,4CAA4C;QAC5C,qDAAqD;QACrD,mDAAmD;QACnD,gEAAgE;QAChE,8BAA8B;KACjC,CAAC;IAEF,IAAI,OAAO,GAAkB,IAAI,CAAC;IAElC,EAAE,CAAC,oBAAoB,EAAE,KAAK;QAC1B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEpB,MAAM,QAAQ,GAAG,gxFAAgxF,CAAC;QAClyF,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAE3C,MAAM,OAAO,GAAG,IAAI,iBAAM,CAAC,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAElE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACnD,OAAO,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;QAEtC,MAAM,QAAQ,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AE,uBAAuB,CAAC,CAAC;QAC3G,gBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,iBAAiB,CAAC,CAAC;QACpF,gBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,qBAAqB,CAAC,CAAC;QAE5F,oCAAoC;QACpC,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC;QACnF,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;QAE/E,0BAA0B;QAC1B,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAEjB,oCAAoC;QACpC,gBAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
@ -5,5 +5,5 @@ exports.version = void 0;
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
exports.version = "6.1.0";
|
||||
exports.version = "6.2.0";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -57,7 +57,6 @@ class TokenString {
|
||||
linkBack: (t.linkBack - from),
|
||||
linkNext: (t.linkNext - from),
|
||||
}));
|
||||
return t;
|
||||
}));
|
||||
}
|
||||
// Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens
|
||||
|
File diff suppressed because one or more lines are too long
12
lib.commonjs/contract/contract.d.ts
vendored
12
lib.commonjs/contract/contract.d.ts
vendored
@ -4,8 +4,8 @@ import { ContractTransactionResponse, EventLog } from "./wrappers.js";
|
||||
import type { EventFragment, FunctionFragment, InterfaceAbi, ParamType } from "../abi/index.js";
|
||||
import type { Addressable } from "../address/index.js";
|
||||
import type { EventEmitterable, Listener } from "../utils/index.js";
|
||||
import type { BlockTag, ContractRunner, TransactionRequest } from "../providers/index.js";
|
||||
import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction } from "./types.js";
|
||||
import type { BlockTag, ContractRunner } from "../providers/index.js";
|
||||
import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction, WrappedFallback } from "./types.js";
|
||||
/**
|
||||
* @_ignore:
|
||||
*/
|
||||
@ -14,14 +14,6 @@ export declare function copyOverrides<O extends string = "data" | "to">(arg: any
|
||||
* @_ignore:
|
||||
*/
|
||||
export declare function resolveArgs(_runner: null | ContractRunner, inputs: ReadonlyArray<ParamType>, args: Array<any>): Promise<Array<any>>;
|
||||
declare class WrappedFallback {
|
||||
readonly _contract: BaseContract;
|
||||
constructor(contract: BaseContract);
|
||||
populateTransaction(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransaction>;
|
||||
staticCall(overrides?: Omit<TransactionRequest, "to">): Promise<string>;
|
||||
send(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse>;
|
||||
estimateGas(overrides?: Omit<TransactionRequest, "to">): Promise<bigint>;
|
||||
}
|
||||
declare const internal: unique symbol;
|
||||
export declare class BaseContract implements Addressable, EventEmitterable<ContractEventName> {
|
||||
readonly target: string | Addressable;
|
||||
|
@ -58,9 +58,6 @@ class PreparedTopicFilter {
|
||||
// D = The type the default call will return (i.e. R for view/pure,
|
||||
// TransactionResponse otherwise)
|
||||
//export interface ContractMethod<A extends Array<any> = Array<any>, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {
|
||||
function _WrappedMethodBase() {
|
||||
return Function;
|
||||
}
|
||||
function getRunner(value, feature) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
@ -112,98 +109,142 @@ async function resolveArgs(_runner, inputs, args) {
|
||||
}));
|
||||
}
|
||||
exports.resolveArgs = resolveArgs;
|
||||
class WrappedFallback {
|
||||
_contract;
|
||||
constructor(contract) {
|
||||
(0, index_js_3.defineProperties)(this, { _contract: contract });
|
||||
const proxy = new Proxy(this, {
|
||||
// Perform send when called
|
||||
apply: async (target, thisArg, args) => {
|
||||
return await target.send(...args);
|
||||
},
|
||||
});
|
||||
return proxy;
|
||||
}
|
||||
async populateTransaction(overrides) {
|
||||
function buildWrappedFallback(contract) {
|
||||
const populateTransaction = async function (overrides) {
|
||||
// If an overrides was passed in, copy it and normalize the values
|
||||
const tx = (await copyOverrides(overrides, ["data"]));
|
||||
tx.to = await this._contract.getAddress();
|
||||
const iface = this._contract.interface;
|
||||
tx.to = await contract.getAddress();
|
||||
const iface = contract.interface;
|
||||
// Only allow payable contracts to set non-zero value
|
||||
const payable = iface.receive || (iface.fallback && iface.fallback.payable);
|
||||
(0, index_js_3.assertArgument)(payable || (tx.value || BN_0) === BN_0, "cannot send value to non-payable contract", "overrides.value", tx.value);
|
||||
// Only allow fallback contracts to set non-empty data
|
||||
(0, index_js_3.assertArgument)(iface.fallback || (tx.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", tx.data);
|
||||
return tx;
|
||||
}
|
||||
async staticCall(overrides) {
|
||||
const runner = getRunner(this._contract.runner, "call");
|
||||
};
|
||||
const staticCall = async function (overrides) {
|
||||
const runner = getRunner(contract.runner, "call");
|
||||
(0, index_js_3.assert)(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
|
||||
const tx = await this.populateTransaction(overrides);
|
||||
const tx = await populateTransaction(overrides);
|
||||
try {
|
||||
return await runner.call(tx);
|
||||
}
|
||||
catch (error) {
|
||||
if ((0, index_js_3.isCallException)(error) && error.data) {
|
||||
throw contract.interface.makeError(error.data, tx);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
const send = async function (overrides) {
|
||||
const runner = contract.runner;
|
||||
(0, index_js_3.assert)(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
|
||||
const tx = await runner.sendTransaction(await populateTransaction(overrides));
|
||||
const provider = getProvider(contract.runner);
|
||||
// @TODO: the provider can be null; make a custom dummy provider that will throw a
|
||||
// meaningful error
|
||||
return new wrappers_js_1.ContractTransactionResponse(contract.interface, provider, tx);
|
||||
};
|
||||
const estimateGas = async function (overrides) {
|
||||
const runner = getRunner(contract.runner, "estimateGas");
|
||||
(0, index_js_3.assert)(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
|
||||
return await runner.estimateGas(await populateTransaction(overrides));
|
||||
};
|
||||
const method = async (overrides) => {
|
||||
return await send(overrides);
|
||||
};
|
||||
(0, index_js_3.defineProperties)(method, {
|
||||
_contract: contract,
|
||||
estimateGas,
|
||||
populateTransaction,
|
||||
send, staticCall
|
||||
});
|
||||
return method;
|
||||
}
|
||||
/*
|
||||
class WrappedFallback {
|
||||
|
||||
constructor (contract: BaseContract) {
|
||||
defineProperties<WrappedFallback>(this, { _contract: contract });
|
||||
|
||||
const proxy = new Proxy(this, {
|
||||
// Perform send when called
|
||||
apply: async (target, thisArg, args: Array<any>) => {
|
||||
return await target.send(...args);
|
||||
},
|
||||
});
|
||||
|
||||
return proxy;
|
||||
}
|
||||
|
||||
async populateTransaction(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransaction> {
|
||||
// If an overrides was passed in, copy it and normalize the values
|
||||
|
||||
const tx: ContractTransaction = <any>(await copyOverrides<"data">(overrides, [ "data" ]));
|
||||
tx.to = await this._contract.getAddress();
|
||||
|
||||
const iface = this._contract.interface;
|
||||
|
||||
// Only allow payable contracts to set non-zero value
|
||||
const payable = iface.receive || (iface.fallback && iface.fallback.payable);
|
||||
assertArgument(payable || (tx.value || BN_0) === BN_0,
|
||||
"cannot send value to non-payable contract", "overrides.value", tx.value);
|
||||
|
||||
// Only allow fallback contracts to set non-empty data
|
||||
assertArgument(iface.fallback || (tx.data || "0x") === "0x",
|
||||
"cannot send data to receive-only contract", "overrides.data", tx.data);
|
||||
|
||||
return tx;
|
||||
}
|
||||
|
||||
async staticCall(overrides?: Omit<TransactionRequest, "to">): Promise<string> {
|
||||
const runner = getRunner(this._contract.runner, "call");
|
||||
assert(canCall(runner), "contract runner does not support calling",
|
||||
"UNSUPPORTED_OPERATION", { operation: "call" });
|
||||
|
||||
const tx = await this.populateTransaction(overrides);
|
||||
|
||||
try {
|
||||
return await runner.call(tx);
|
||||
} catch (error: any) {
|
||||
if (isCallException(error) && error.data) {
|
||||
throw this._contract.interface.makeError(error.data, tx);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
async send(overrides) {
|
||||
|
||||
async send(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse> {
|
||||
const runner = this._contract.runner;
|
||||
(0, index_js_3.assert)(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
|
||||
assert(canSend(runner), "contract runner does not support sending transactions",
|
||||
"UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
|
||||
|
||||
const tx = await runner.sendTransaction(await this.populateTransaction(overrides));
|
||||
const provider = getProvider(this._contract.runner);
|
||||
// @TODO: the provider can be null; make a custom dummy provider that will throw a
|
||||
// meaningful error
|
||||
return new wrappers_js_1.ContractTransactionResponse(this._contract.interface, provider, tx);
|
||||
return new ContractTransactionResponse(this._contract.interface, <Provider>provider, tx);
|
||||
}
|
||||
async estimateGas(overrides) {
|
||||
|
||||
async estimateGas(overrides?: Omit<TransactionRequest, "to">): Promise<bigint> {
|
||||
const runner = getRunner(this._contract.runner, "estimateGas");
|
||||
(0, index_js_3.assert)(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
|
||||
assert(canEstimate(runner), "contract runner does not support gas estimation",
|
||||
"UNSUPPORTED_OPERATION", { operation: "estimateGas" });
|
||||
|
||||
return await runner.estimateGas(await this.populateTransaction(overrides));
|
||||
}
|
||||
}
|
||||
class WrappedMethod extends _WrappedMethodBase() {
|
||||
name = ""; // Investigate!
|
||||
_contract;
|
||||
_key;
|
||||
constructor(contract, key) {
|
||||
super();
|
||||
(0, index_js_3.defineProperties)(this, {
|
||||
name: contract.interface.getFunctionName(key),
|
||||
_contract: contract, _key: key
|
||||
});
|
||||
const proxy = new Proxy(this, {
|
||||
// Perform the default operation for this fragment type
|
||||
apply: async (target, thisArg, args) => {
|
||||
const fragment = target.getFragment(...args);
|
||||
if (fragment.constant) {
|
||||
return await target.staticCall(...args);
|
||||
}
|
||||
return await target.send(...args);
|
||||
},
|
||||
});
|
||||
return proxy;
|
||||
}
|
||||
// Only works on non-ambiguous keys (refined fragment is always non-ambiguous)
|
||||
get fragment() {
|
||||
const fragment = this._contract.interface.getFunction(this._key);
|
||||
*/
|
||||
function buildWrappedMethod(contract, key) {
|
||||
const getFragment = function (...args) {
|
||||
const fragment = contract.interface.getFunction(key, args);
|
||||
(0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fragment"
|
||||
});
|
||||
return fragment;
|
||||
}
|
||||
getFragment(...args) {
|
||||
const fragment = this._contract.interface.getFunction(this._key, args);
|
||||
(0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fragment"
|
||||
});
|
||||
return fragment;
|
||||
}
|
||||
async populateTransaction(...args) {
|
||||
const fragment = this.getFragment(...args);
|
||||
};
|
||||
const populateTransaction = async function (...args) {
|
||||
const fragment = getFragment(...args);
|
||||
// If an overrides was passed in, copy it and normalize the values
|
||||
let overrides = {};
|
||||
if (fragment.inputs.length + 1 === args.length) {
|
||||
@ -212,88 +253,109 @@ class WrappedMethod extends _WrappedMethodBase() {
|
||||
if (fragment.inputs.length !== args.length) {
|
||||
throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");
|
||||
}
|
||||
const resolvedArgs = await resolveArgs(this._contract.runner, fragment.inputs, args);
|
||||
const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);
|
||||
return Object.assign({}, overrides, await (0, index_js_3.resolveProperties)({
|
||||
to: this._contract.getAddress(),
|
||||
data: this._contract.interface.encodeFunctionData(fragment, resolvedArgs)
|
||||
to: contract.getAddress(),
|
||||
data: contract.interface.encodeFunctionData(fragment, resolvedArgs)
|
||||
}));
|
||||
}
|
||||
async staticCall(...args) {
|
||||
const result = await this.staticCallResult(...args);
|
||||
};
|
||||
const staticCall = async function (...args) {
|
||||
const result = await staticCallResult(...args);
|
||||
if (result.length === 1) {
|
||||
return result[0];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
async send(...args) {
|
||||
const runner = this._contract.runner;
|
||||
};
|
||||
const send = async function (...args) {
|
||||
const runner = contract.runner;
|
||||
(0, index_js_3.assert)(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
|
||||
const tx = await runner.sendTransaction(await this.populateTransaction(...args));
|
||||
const provider = getProvider(this._contract.runner);
|
||||
const tx = await runner.sendTransaction(await populateTransaction(...args));
|
||||
const provider = getProvider(contract.runner);
|
||||
// @TODO: the provider can be null; make a custom dummy provider that will throw a
|
||||
// meaningful error
|
||||
return new wrappers_js_1.ContractTransactionResponse(this._contract.interface, provider, tx);
|
||||
}
|
||||
async estimateGas(...args) {
|
||||
const runner = getRunner(this._contract.runner, "estimateGas");
|
||||
return new wrappers_js_1.ContractTransactionResponse(contract.interface, provider, tx);
|
||||
};
|
||||
const estimateGas = async function (...args) {
|
||||
const runner = getRunner(contract.runner, "estimateGas");
|
||||
(0, index_js_3.assert)(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
|
||||
return await runner.estimateGas(await this.populateTransaction(...args));
|
||||
}
|
||||
async staticCallResult(...args) {
|
||||
const runner = getRunner(this._contract.runner, "call");
|
||||
return await runner.estimateGas(await populateTransaction(...args));
|
||||
};
|
||||
const staticCallResult = async function (...args) {
|
||||
const runner = getRunner(contract.runner, "call");
|
||||
(0, index_js_3.assert)(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
|
||||
const tx = await this.populateTransaction(...args);
|
||||
const tx = await populateTransaction(...args);
|
||||
let result = "0x";
|
||||
try {
|
||||
result = await runner.call(tx);
|
||||
}
|
||||
catch (error) {
|
||||
if ((0, index_js_3.isCallException)(error) && error.data) {
|
||||
throw this._contract.interface.makeError(error.data, tx);
|
||||
throw contract.interface.makeError(error.data, tx);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
const fragment = this.getFragment(...args);
|
||||
return this._contract.interface.decodeFunctionResult(fragment, result);
|
||||
}
|
||||
const fragment = getFragment(...args);
|
||||
return contract.interface.decodeFunctionResult(fragment, result);
|
||||
};
|
||||
const method = async (...args) => {
|
||||
const fragment = getFragment(...args);
|
||||
if (fragment.constant) {
|
||||
return await staticCall(...args);
|
||||
}
|
||||
return await send(...args);
|
||||
};
|
||||
(0, index_js_3.defineProperties)(method, {
|
||||
name: contract.interface.getFunctionName(key),
|
||||
_contract: contract, _key: key,
|
||||
getFragment,
|
||||
estimateGas,
|
||||
populateTransaction,
|
||||
send, staticCall, staticCallResult,
|
||||
});
|
||||
// Only works on non-ambiguous keys (refined fragment is always non-ambiguous)
|
||||
Object.defineProperty(method, "fragment", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
get: () => {
|
||||
const fragment = contract.interface.getFunction(key);
|
||||
(0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fragment"
|
||||
});
|
||||
return fragment;
|
||||
}
|
||||
});
|
||||
return method;
|
||||
}
|
||||
function _WrappedEventBase() {
|
||||
return Function;
|
||||
}
|
||||
class WrappedEvent extends _WrappedEventBase() {
|
||||
name = ""; // @TODO: investigate
|
||||
_contract;
|
||||
_key;
|
||||
constructor(contract, key) {
|
||||
super();
|
||||
(0, index_js_3.defineProperties)(this, {
|
||||
name: contract.interface.getEventName(key),
|
||||
_contract: contract, _key: key
|
||||
});
|
||||
return new Proxy(this, {
|
||||
// Perform the default operation for this fragment type
|
||||
apply: (target, thisArg, args) => {
|
||||
return new PreparedTopicFilter(contract, target.getFragment(...args), args);
|
||||
},
|
||||
});
|
||||
}
|
||||
// Only works on non-ambiguous keys
|
||||
get fragment() {
|
||||
const fragment = this._contract.interface.getEvent(this._key);
|
||||
function buildWrappedEvent(contract, key) {
|
||||
const getFragment = function (...args) {
|
||||
const fragment = contract.interface.getEvent(key, args);
|
||||
(0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fragment"
|
||||
});
|
||||
return fragment;
|
||||
}
|
||||
getFragment(...args) {
|
||||
const fragment = this._contract.interface.getEvent(this._key, args);
|
||||
(0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fragment"
|
||||
});
|
||||
return fragment;
|
||||
}
|
||||
};
|
||||
const method = async function (...args) {
|
||||
return new PreparedTopicFilter(contract, getFragment(...args), args);
|
||||
};
|
||||
(0, index_js_3.defineProperties)(method, {
|
||||
name: contract.interface.getEventName(key),
|
||||
_contract: contract, _key: key,
|
||||
getFragment
|
||||
});
|
||||
// Only works on non-ambiguous keys (refined fragment is always non-ambiguous)
|
||||
Object.defineProperty(method, "fragment", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
get: () => {
|
||||
const fragment = contract.interface.getEvent(key);
|
||||
(0, index_js_3.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fragment"
|
||||
});
|
||||
return fragment;
|
||||
}
|
||||
});
|
||||
return method;
|
||||
}
|
||||
;
|
||||
// The combination of TypeScrype, Private Fields and Proxies makes
|
||||
// the world go boom; so we hide variables with some trickery keeping
|
||||
// a symbol attached to each BaseContract which its sub-class (even
|
||||
@ -553,7 +615,7 @@ class BaseContract {
|
||||
});
|
||||
(0, index_js_3.defineProperties)(this, { filters });
|
||||
(0, index_js_3.defineProperties)(this, {
|
||||
fallback: ((iface.receive || iface.fallback) ? (new WrappedFallback(this)) : null)
|
||||
fallback: ((iface.receive || iface.fallback) ? (buildWrappedFallback(this)) : null)
|
||||
});
|
||||
// Return a Proxy that will respond to functions
|
||||
return new Proxy(this, {
|
||||
@ -621,13 +683,14 @@ class BaseContract {
|
||||
if (typeof (key) !== "string") {
|
||||
key = key.format();
|
||||
}
|
||||
return (new WrappedMethod(this, key));
|
||||
const func = buildWrappedMethod(this, key);
|
||||
return func;
|
||||
}
|
||||
getEvent(key) {
|
||||
if (typeof (key) !== "string") {
|
||||
key = key.format();
|
||||
}
|
||||
return (new WrappedEvent(this, key));
|
||||
return buildWrappedEvent(this, key);
|
||||
}
|
||||
async queryTransaction(hash) {
|
||||
// Is this useful?
|
||||
|
File diff suppressed because one or more lines are too long
2
lib.commonjs/contract/index.d.ts
vendored
2
lib.commonjs/contract/index.d.ts
vendored
@ -6,4 +6,4 @@
|
||||
export { BaseContract, Contract } from "./contract.js";
|
||||
export { ContractFactory } from "./factory.js";
|
||||
export { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, } from "./wrappers.js";
|
||||
export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides } from "./types.js";
|
||||
export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, WrappedFallback } from "./types.js";
|
||||
|
7
lib.commonjs/contract/types.d.ts
vendored
7
lib.commonjs/contract/types.d.ts
vendored
@ -46,3 +46,10 @@ export interface ContractEvent<A extends Array<any> = Array<any>> {
|
||||
fragment: EventFragment;
|
||||
getFragment(...args: ContractEventArgs<A>): EventFragment;
|
||||
}
|
||||
export interface WrappedFallback {
|
||||
(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse>;
|
||||
populateTransaction(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransaction>;
|
||||
staticCall(overrides?: Omit<TransactionRequest, "to">): Promise<string>;
|
||||
send(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse>;
|
||||
estimateGas(overrides?: Omit<TransactionRequest, "to">): Promise<bigint>;
|
||||
}
|
||||
|
@ -19,16 +19,16 @@ class EventLog extends provider_js_1.Log {
|
||||
}
|
||||
exports.EventLog = EventLog;
|
||||
class ContractTransactionReceipt extends provider_js_1.TransactionReceipt {
|
||||
#interface;
|
||||
#iface;
|
||||
constructor(iface, provider, tx) {
|
||||
super(tx, provider);
|
||||
this.#interface = iface;
|
||||
this.#iface = iface;
|
||||
}
|
||||
get logs() {
|
||||
return super.logs.map((log) => {
|
||||
const fragment = log.topics.length ? this.#interface.getEvent(log.topics[0]) : null;
|
||||
const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null;
|
||||
if (fragment) {
|
||||
return new EventLog(log, this.#interface, fragment);
|
||||
return new EventLog(log, this.#iface, fragment);
|
||||
}
|
||||
else {
|
||||
return log;
|
||||
@ -38,17 +38,17 @@ class ContractTransactionReceipt extends provider_js_1.TransactionReceipt {
|
||||
}
|
||||
exports.ContractTransactionReceipt = ContractTransactionReceipt;
|
||||
class ContractTransactionResponse extends provider_js_1.TransactionResponse {
|
||||
#interface;
|
||||
#iface;
|
||||
constructor(iface, provider, tx) {
|
||||
super(tx, provider);
|
||||
this.#interface = iface;
|
||||
this.#iface = iface;
|
||||
}
|
||||
async wait(confirms) {
|
||||
const receipt = await super.wait();
|
||||
if (receipt == null) {
|
||||
return null;
|
||||
}
|
||||
return new ContractTransactionReceipt(this.#interface, this.provider, receipt);
|
||||
return new ContractTransactionReceipt(this.#iface, this.provider, receipt);
|
||||
}
|
||||
}
|
||||
exports.ContractTransactionResponse = ContractTransactionResponse;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,yBAAyB;AACzB,0DAEkC;AAClC,gDAAmE;AAYnE,MAAa,QAAS,SAAQ,iBAAG;IACpB,SAAS,CAAa;IACtB,QAAQ,CAAiB;IACzB,IAAI,CAAU;IAEvB,YAAY,GAAQ,EAAE,KAAgB,EAAE,QAAuB;QAC3D,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAClE,IAAA,2BAAgB,EAAW,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,SAAS,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACtD,IAAI,cAAc,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CAClE;AAbD,4BAaC;AAED,MAAa,0BAA2B,SAAQ,gCAAkB;IACrD,UAAU,CAAY;IAE/B,YAAY,KAAgB,EAAE,QAAkB,EAAE,EAAsB;QACpE,KAAK,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,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QACpF,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzF,IAAA,2BAAgB,EAAuB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAClC,CAAC;CACJ;AAnBD,oDAmBC"}
|
@ -41,7 +41,7 @@ class Signature {
|
||||
*/
|
||||
get s() { return this.#s; }
|
||||
set s(_value) {
|
||||
(0, index_js_2.assertArgument)((0, index_js_2.dataLength)(_value) === 32, "invalid r", "value", _value);
|
||||
(0, index_js_2.assertArgument)((0, index_js_2.dataLength)(_value) === 32, "invalid s", "value", _value);
|
||||
const value = (0, index_js_2.hexlify)(_value);
|
||||
(0, index_js_2.assertArgument)(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value);
|
||||
this.#s = value;
|
||||
|
@ -178,10 +178,8 @@ class SigningKey {
|
||||
const sig = signature_js_1.Signature.from(signature);
|
||||
const der = secp256k1.Signature.fromCompact((0, index_js_1.getBytesCopy)((0, index_js_1.concat)([sig.r, sig.s]))).toDERRawBytes();
|
||||
const pubKey = secp256k1.recoverPublicKey((0, index_js_1.getBytesCopy)(digest), der, sig.yParity);
|
||||
if (pubKey != null) {
|
||||
return (0, index_js_1.hexlify)(pubKey);
|
||||
}
|
||||
(0, index_js_1.assertArgument)(false, "invalid signautre for digest", "signature", signature);
|
||||
(0, index_js_1.assertArgument)(pubKey != null, "invalid signautre for digest", "signature", signature);
|
||||
return (0, index_js_1.hexlify)(pubKey);
|
||||
}
|
||||
/**
|
||||
* Returns the point resulting from adding the ellipic curve points
|
||||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,CAAC;CACJ;AA3KD,gCA2KC"}
|
4
lib.commonjs/ethers.d.ts
vendored
4
lib.commonjs/ethers.d.ts
vendored
@ -4,7 +4,7 @@ export { getAddress, getIcapAddress, getCreateAddress, getCreate2Address, isAddr
|
||||
export { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, EtherSymbol, MessagePrefix } from "./constants/index.js";
|
||||
export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, } from "./contract/index.js";
|
||||
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js";
|
||||
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder } from "./hash/index.js";
|
||||
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from "./hash/index.js";
|
||||
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js";
|
||||
export { accessListify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js";
|
||||
export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from "./utils/index.js";
|
||||
@ -12,7 +12,7 @@ export { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPa
|
||||
export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists } from "./wordlists/index.js";
|
||||
export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, InterfaceAbi, ParamTypeWalkFunc, ParamTypeWalkAsyncFunc } from "./abi/index.js";
|
||||
export type { Addressable, AddressLike, NameResolver } from "./address/index.js";
|
||||
export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides } from "./contract/index.js";
|
||||
export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides, WrappedFallback } from "./contract/index.js";
|
||||
export type { ProgressCallback, SignatureLike } from "./crypto/index.js";
|
||||
export type { TypedDataDomain, TypedDataField } from "./hash/index.js";
|
||||
export type { Provider, Signer, AbstractProviderPlugin, BlockParams, BlockTag, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, EventFilter, Filter, FilterByBlockHash, GasCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike } from "./providers/index.js";
|
||||
|
@ -3,9 +3,9 @@
|
||||
//
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = exports.EventLog = exports.ContractUnknownEventPayload = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.MessagePrefix = exports.EtherSymbol = exports.ZeroHash = exports.N = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.ZeroAddress = exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = exports.Typed = exports.TransactionDescription = exports.Result = exports.LogDescription = exports.Interface = exports.Indexed = exports.ErrorDescription = exports.checkResultErrors = exports.StructFragment = exports.ParamType = exports.NamedFragment = exports.FunctionFragment = exports.FallbackFragment = exports.Fragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.AbiCoder = exports.encodeBytes32String = exports.decodeBytes32String = exports.version = void 0;
|
||||
exports.GasCostPlugin = exports.FeeDataNetworkPlugin = exports.EtherscanPlugin = exports.EnsPlugin = exports.Network = exports.EnsResolver = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.VoidSigner = exports.NonceManager = exports.AbstractSigner = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.getDefaultProvider = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = exports.SigningKey = exports.Signature = exports.lock = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = void 0;
|
||||
exports.toQuantity = exports.toNumber = exports.toBeHex = exports.toBigInt = exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.resolveProperties = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.showThrottleMessage = exports.copyRequest = exports.UnmanagedSubscriber = exports.SocketSubscriber = exports.SocketPendingSubscriber = exports.SocketEventSubscriber = exports.SocketBlockSubscriber = exports.NetworkPlugin = void 0;
|
||||
exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.uuidV4 = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = void 0;
|
||||
exports.FeeDataNetworkPlugin = exports.EtherscanPlugin = exports.EnsPlugin = exports.Network = exports.EnsResolver = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.EtherscanProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.VoidSigner = exports.NonceManager = exports.AbstractSigner = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.getDefaultProvider = exports.verifyTypedData = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = exports.SigningKey = exports.Signature = exports.lock = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = void 0;
|
||||
exports.toNumber = exports.toBeHex = exports.toBigInt = exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.resolveProperties = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.showThrottleMessage = exports.copyRequest = exports.UnmanagedSubscriber = exports.SocketSubscriber = exports.SocketPendingSubscriber = exports.SocketEventSubscriber = exports.SocketBlockSubscriber = exports.NetworkPlugin = exports.GasCostPlugin = void 0;
|
||||
exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.uuidV4 = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = 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");
|
||||
@ -81,6 +81,7 @@ 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; } });
|
||||
Object.defineProperty(exports, "verifyTypedData", { enumerable: true, get: function () { return index_js_6.verifyTypedData; } });
|
||||
var index_js_7 = require("./providers/index.js");
|
||||
Object.defineProperty(exports, "getDefaultProvider", { enumerable: true, get: function () { return index_js_7.getDefaultProvider; } });
|
||||
Object.defineProperty(exports, "Block", { enumerable: true, get: function () { return index_js_7.Block; } });
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AAAE,2GAAA,cAAc,OAAA;AAE/B,iHAAA,oBAAoB,OAAA;AAAE,oHAAA,uBAAuB,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAClE,gHAAA,mBAAmB,OAAA;AAAE,oHAAA,uBAAuB,OAAA;AAGhD,kDAE8B;AAD1B,qGAAA,QAAQ,OAAA;AAAE,mGAAA,MAAM,OAAA;AAAE,wGAAA,WAAW,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,sGAAA,SAAS,OAAA"}
|
2
lib.commonjs/hash/index.d.ts
vendored
2
lib.commonjs/hash/index.d.ts
vendored
@ -7,5 +7,5 @@ export { id } from "./id.js";
|
||||
export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js";
|
||||
export { hashMessage, verifyMessage } from "./message.js";
|
||||
export { solidityPacked, solidityPackedKeccak256, solidityPackedSha256 } from "./solidity.js";
|
||||
export { TypedDataEncoder } from "./typed-data.js";
|
||||
export { TypedDataEncoder, verifyTypedData } from "./typed-data.js";
|
||||
export type { TypedDataDomain, TypedDataField } from "./typed-data.js";
|
||||
|
@ -5,7 +5,7 @@
|
||||
* @_section: api/hashing:Hashing Utilities [about-hashing]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = void 0;
|
||||
exports.verifyTypedData = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = void 0;
|
||||
var id_js_1 = require("./id.js");
|
||||
Object.defineProperty(exports, "id", { enumerable: true, get: function () { return id_js_1.id; } });
|
||||
var namehash_js_1 = require("./namehash.js");
|
||||
@ -22,4 +22,5 @@ Object.defineProperty(exports, "solidityPackedKeccak256", { enumerable: true, ge
|
||||
Object.defineProperty(exports, "solidityPackedSha256", { enumerable: true, get: function () { return solidity_js_1.solidityPackedSha256; } });
|
||||
var typed_data_js_1 = require("./typed-data.js");
|
||||
Object.defineProperty(exports, "TypedDataEncoder", { enumerable: true, get: function () { return typed_data_js_1.TypedDataEncoder; } });
|
||||
Object.defineProperty(exports, "verifyTypedData", { enumerable: true, get: function () { return typed_data_js_1.verifyTypedData; } });
|
||||
//# sourceMappingURL=index.js.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iCAA4B;AAAnB,2FAAA,EAAE,OAAA;AACX,6CAA+E;AAAtE,2GAAA,YAAY,OAAA;AAAE,0GAAA,WAAW,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAAE,wGAAA,SAAS,OAAA;AACvD,2CAA0D;AAAjD,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA;AACnC,6CAEuB;AADnB,6GAAA,cAAc,OAAA;AAAE,sHAAA,uBAAuB,OAAA;AAAE,mHAAA,oBAAoB,OAAA;AAEjE,iDAAmD;AAA1C,iHAAA,gBAAgB,OAAA"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iCAA4B;AAAnB,2FAAA,EAAE,OAAA;AACX,6CAA+E;AAAtE,2GAAA,YAAY,OAAA;AAAE,0GAAA,WAAW,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAAE,wGAAA,SAAS,OAAA;AACvD,2CAA0D;AAAjD,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA;AACnC,6CAEuB;AADnB,6GAAA,cAAc,OAAA;AAAE,sHAAA,uBAAuB,OAAA;AAAE,mHAAA,oBAAoB,OAAA;AAEjE,iDAAoE;AAA3D,iHAAA,gBAAgB,OAAA;AAAE,gHAAA,eAAe,OAAA"}
|
5
lib.commonjs/hash/typed-data.d.ts
vendored
5
lib.commonjs/hash/typed-data.d.ts
vendored
@ -1,3 +1,4 @@
|
||||
import type { SignatureLike } from "../crypto/index.js";
|
||||
import type { BigNumberish, BytesLike } from "../utils/index.js";
|
||||
export interface TypedDataDomain {
|
||||
name?: null | string;
|
||||
@ -35,3 +36,7 @@ export declare class TypedDataEncoder {
|
||||
}>;
|
||||
static getPayload(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): any;
|
||||
}
|
||||
/**
|
||||
* Compute the address used to sign the typed data for the %%signature%%.
|
||||
*/
|
||||
export declare function verifyTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>, signature: SignatureLike): string;
|
||||
|
@ -1,10 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TypedDataEncoder = void 0;
|
||||
exports.verifyTypedData = exports.TypedDataEncoder = void 0;
|
||||
//import { TypedDataDomain, TypedDataField } from "@ethersproject/providerabstract-signer";
|
||||
const index_js_1 = require("../address/index.js");
|
||||
const index_js_2 = require("../crypto/index.js");
|
||||
const index_js_3 = require("../utils/index.js");
|
||||
const index_js_3 = require("../transaction/index.js");
|
||||
const index_js_4 = require("../utils/index.js");
|
||||
const id_js_1 = require("./id.js");
|
||||
const padding = new Uint8Array(32);
|
||||
padding.fill(0);
|
||||
@ -15,15 +16,15 @@ const BN_MAX_UINT256 = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffff
|
||||
;
|
||||
;
|
||||
function hexPadRight(value) {
|
||||
const bytes = (0, index_js_3.getBytes)(value);
|
||||
const bytes = (0, index_js_4.getBytes)(value);
|
||||
const padOffset = bytes.length % 32;
|
||||
if (padOffset) {
|
||||
return (0, index_js_3.concat)([bytes, padding.slice(padOffset)]);
|
||||
return (0, index_js_4.concat)([bytes, padding.slice(padOffset)]);
|
||||
}
|
||||
return (0, index_js_3.hexlify)(bytes);
|
||||
return (0, index_js_4.hexlify)(bytes);
|
||||
}
|
||||
const hexTrue = (0, index_js_3.toBeHex)(BN_1, 32);
|
||||
const hexFalse = (0, index_js_3.toBeHex)(BN_0, 32);
|
||||
const hexTrue = (0, index_js_4.toBeHex)(BN_1, 32);
|
||||
const hexFalse = (0, index_js_4.toBeHex)(BN_0, 32);
|
||||
const domainFieldTypes = {
|
||||
name: "string",
|
||||
version: "string",
|
||||
@ -36,7 +37,7 @@ const domainFieldNames = [
|
||||
];
|
||||
function checkString(key) {
|
||||
return function (value) {
|
||||
(0, index_js_3.assertArgument)(typeof (value) === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);
|
||||
(0, index_js_4.assertArgument)(typeof (value) === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);
|
||||
return value;
|
||||
};
|
||||
}
|
||||
@ -44,19 +45,19 @@ const domainChecks = {
|
||||
name: checkString("name"),
|
||||
version: checkString("version"),
|
||||
chainId: function (value) {
|
||||
return (0, index_js_3.getBigInt)(value, "domain.chainId");
|
||||
return (0, index_js_4.getBigInt)(value, "domain.chainId");
|
||||
},
|
||||
verifyingContract: function (value) {
|
||||
try {
|
||||
return (0, index_js_1.getAddress)(value).toLowerCase();
|
||||
}
|
||||
catch (error) { }
|
||||
(0, index_js_3.assertArgument)(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
|
||||
(0, index_js_4.assertArgument)(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
|
||||
},
|
||||
salt: function (value) {
|
||||
const bytes = (0, index_js_3.getBytes)(value, "domain.salt");
|
||||
(0, index_js_3.assertArgument)(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value);
|
||||
return (0, index_js_3.hexlify)(bytes);
|
||||
const bytes = (0, index_js_4.getBytes)(value, "domain.salt");
|
||||
(0, index_js_4.assertArgument)(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value);
|
||||
return (0, index_js_4.hexlify)(bytes);
|
||||
}
|
||||
};
|
||||
function getBaseEncoder(type) {
|
||||
@ -66,13 +67,13 @@ function getBaseEncoder(type) {
|
||||
if (match) {
|
||||
const signed = (match[1] === "");
|
||||
const width = parseInt(match[2] || "256");
|
||||
(0, index_js_3.assertArgument)(width % 8 === 0 && width !== 0 && width <= 256 && (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type);
|
||||
const boundsUpper = (0, index_js_3.mask)(BN_MAX_UINT256, signed ? (width - 1) : width);
|
||||
(0, index_js_4.assertArgument)(width % 8 === 0 && width !== 0 && width <= 256 && (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type);
|
||||
const boundsUpper = (0, index_js_4.mask)(BN_MAX_UINT256, signed ? (width - 1) : width);
|
||||
const boundsLower = signed ? ((boundsUpper + BN_1) * BN__1) : BN_0;
|
||||
return function (_value) {
|
||||
const value = (0, index_js_3.getBigInt)(_value, "value");
|
||||
(0, index_js_3.assertArgument)(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value);
|
||||
return (0, index_js_3.toBeHex)((0, index_js_3.toTwos)(value, 256), 32);
|
||||
const value = (0, index_js_4.getBigInt)(_value, "value");
|
||||
(0, index_js_4.assertArgument)(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value);
|
||||
return (0, index_js_4.toBeHex)((0, index_js_4.toTwos)(value, 256), 32);
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -81,17 +82,17 @@ function getBaseEncoder(type) {
|
||||
const match = type.match(/^bytes(\d+)$/);
|
||||
if (match) {
|
||||
const width = parseInt(match[1]);
|
||||
(0, index_js_3.assertArgument)(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type);
|
||||
(0, index_js_4.assertArgument)(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type);
|
||||
return function (value) {
|
||||
const bytes = (0, index_js_3.getBytes)(value);
|
||||
(0, index_js_3.assertArgument)(bytes.length === width, `invalid length for ${type}`, "value", value);
|
||||
const bytes = (0, index_js_4.getBytes)(value);
|
||||
(0, index_js_4.assertArgument)(bytes.length === width, `invalid length for ${type}`, "value", value);
|
||||
return hexPadRight(value);
|
||||
};
|
||||
}
|
||||
}
|
||||
switch (type) {
|
||||
case "address": return function (value) {
|
||||
return (0, index_js_3.zeroPadValue)((0, index_js_1.getAddress)(value), 32);
|
||||
return (0, index_js_4.zeroPadValue)((0, index_js_1.getAddress)(value), 32);
|
||||
};
|
||||
case "bool": return function (value) {
|
||||
return ((!value) ? hexFalse : hexTrue);
|
||||
@ -135,17 +136,17 @@ class TypedDataEncoder {
|
||||
const uniqueNames = new Set();
|
||||
for (const field of types[name]) {
|
||||
// Check each field has a unique name
|
||||
(0, index_js_3.assertArgument)(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types);
|
||||
(0, index_js_4.assertArgument)(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types);
|
||||
uniqueNames.add(field.name);
|
||||
// Get the base type (drop any array specifiers)
|
||||
const baseType = (field.type.match(/^([^\x5b]*)(\x5b|$)/))[1] || null;
|
||||
(0, index_js_3.assertArgument)(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types);
|
||||
(0, index_js_4.assertArgument)(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types);
|
||||
// Is this a base encoding type?
|
||||
const encoder = getBaseEncoder(baseType);
|
||||
if (encoder) {
|
||||
continue;
|
||||
}
|
||||
(0, index_js_3.assertArgument)(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types);
|
||||
(0, index_js_4.assertArgument)(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types);
|
||||
// Add linkage
|
||||
parents.get(baseType).push(name);
|
||||
links.get(name).add(baseType);
|
||||
@ -153,12 +154,12 @@ class TypedDataEncoder {
|
||||
}
|
||||
// Deduce the primary type
|
||||
const primaryTypes = Array.from(parents.keys()).filter((n) => (parents.get(n).length === 0));
|
||||
(0, index_js_3.assertArgument)(primaryTypes.length !== 0, "missing primary type", "types", types);
|
||||
(0, index_js_3.assertArgument)(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(", ")}`, "types", types);
|
||||
(0, index_js_3.defineProperties)(this, { primaryType: primaryTypes[0] });
|
||||
(0, index_js_4.assertArgument)(primaryTypes.length !== 0, "missing primary type", "types", types);
|
||||
(0, index_js_4.assertArgument)(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(", ")}`, "types", types);
|
||||
(0, index_js_4.defineProperties)(this, { primaryType: primaryTypes[0] });
|
||||
// Check for circular type references
|
||||
function checkCircular(type, found) {
|
||||
(0, index_js_3.assertArgument)(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types);
|
||||
(0, index_js_4.assertArgument)(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types);
|
||||
found.add(type);
|
||||
for (const child of links.get(type)) {
|
||||
if (!parents.has(child)) {
|
||||
@ -203,12 +204,12 @@ class TypedDataEncoder {
|
||||
const subtype = match[1];
|
||||
const subEncoder = this.getEncoder(subtype);
|
||||
return (value) => {
|
||||
(0, index_js_3.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
|
||||
(0, index_js_4.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
|
||||
let result = value.map(subEncoder);
|
||||
if (this.#fullTypes.has(subtype)) {
|
||||
result = result.map(index_js_2.keccak256);
|
||||
}
|
||||
return (0, index_js_2.keccak256)((0, index_js_3.concat)(result));
|
||||
return (0, index_js_2.keccak256)((0, index_js_4.concat)(result));
|
||||
};
|
||||
}
|
||||
// Struct
|
||||
@ -224,14 +225,14 @@ class TypedDataEncoder {
|
||||
return result;
|
||||
});
|
||||
values.unshift(encodedType);
|
||||
return (0, index_js_3.concat)(values);
|
||||
return (0, index_js_4.concat)(values);
|
||||
};
|
||||
}
|
||||
(0, index_js_3.assertArgument)(false, `unknown type: ${type}`, "type", type);
|
||||
(0, index_js_4.assertArgument)(false, `unknown type: ${type}`, "type", type);
|
||||
}
|
||||
encodeType(name) {
|
||||
const result = this.#fullTypes.get(name);
|
||||
(0, index_js_3.assertArgument)(result, `unknown type: ${JSON.stringify(name)}`, "name", name);
|
||||
(0, index_js_4.assertArgument)(result, `unknown type: ${JSON.stringify(name)}`, "name", name);
|
||||
return result;
|
||||
}
|
||||
encodeData(type, value) {
|
||||
@ -257,7 +258,7 @@ class TypedDataEncoder {
|
||||
// Array
|
||||
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
|
||||
if (match) {
|
||||
(0, index_js_3.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
|
||||
(0, index_js_4.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
|
||||
return value.map((v) => this._visit(match[1], v, callback));
|
||||
}
|
||||
// Struct
|
||||
@ -268,7 +269,7 @@ class TypedDataEncoder {
|
||||
return accum;
|
||||
}, {});
|
||||
}
|
||||
(0, index_js_3.assertArgument)(false, `unknown type: ${type}`, "type", type);
|
||||
(0, index_js_4.assertArgument)(false, `unknown type: ${type}`, "type", type);
|
||||
}
|
||||
visit(value, callback) {
|
||||
return this._visit(this.primaryType, value, callback);
|
||||
@ -289,7 +290,7 @@ class TypedDataEncoder {
|
||||
continue;
|
||||
}
|
||||
const type = domainFieldTypes[name];
|
||||
(0, index_js_3.assertArgument)(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain);
|
||||
(0, index_js_4.assertArgument)(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain);
|
||||
domainFields.push({ name, type });
|
||||
}
|
||||
domainFields.sort((a, b) => {
|
||||
@ -298,7 +299,7 @@ class TypedDataEncoder {
|
||||
return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain);
|
||||
}
|
||||
static encode(domain, types, value) {
|
||||
return (0, index_js_3.concat)([
|
||||
return (0, index_js_4.concat)([
|
||||
"0x1901",
|
||||
TypedDataEncoder.hashDomain(domain),
|
||||
TypedDataEncoder.from(types).hash(value)
|
||||
@ -320,14 +321,14 @@ class TypedDataEncoder {
|
||||
// Look up all ENS names
|
||||
const ensCache = {};
|
||||
// Do we need to look up the domain's verifyingContract?
|
||||
if (domain.verifyingContract && !(0, index_js_3.isHexString)(domain.verifyingContract, 20)) {
|
||||
if (domain.verifyingContract && !(0, index_js_4.isHexString)(domain.verifyingContract, 20)) {
|
||||
ensCache[domain.verifyingContract] = "0x";
|
||||
}
|
||||
// We are going to use the encoder to visit all the base values
|
||||
const encoder = TypedDataEncoder.from(types);
|
||||
// Get a list of all the addresses
|
||||
encoder.visit(value, (type, value) => {
|
||||
if (type === "address" && !(0, index_js_3.isHexString)(value, 20)) {
|
||||
if (type === "address" && !(0, index_js_4.isHexString)(value, 20)) {
|
||||
ensCache[value] = "0x";
|
||||
}
|
||||
return value;
|
||||
@ -365,7 +366,7 @@ class TypedDataEncoder {
|
||||
});
|
||||
const encoder = TypedDataEncoder.from(types);
|
||||
const typesWithDomain = Object.assign({}, types);
|
||||
(0, index_js_3.assertArgument)(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types);
|
||||
(0, index_js_4.assertArgument)(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types);
|
||||
typesWithDomain.EIP712Domain = domainTypes;
|
||||
// Validate the data structures and types
|
||||
encoder.encode(value);
|
||||
@ -376,11 +377,11 @@ class TypedDataEncoder {
|
||||
message: encoder.visit(value, (type, value) => {
|
||||
// bytes
|
||||
if (type.match(/^bytes(\d*)/)) {
|
||||
return (0, index_js_3.hexlify)((0, index_js_3.getBytes)(value));
|
||||
return (0, index_js_4.hexlify)((0, index_js_4.getBytes)(value));
|
||||
}
|
||||
// uint or int
|
||||
if (type.match(/^u?int/)) {
|
||||
return (0, index_js_3.getBigInt)(value).toString();
|
||||
return (0, index_js_4.getBigInt)(value).toString();
|
||||
}
|
||||
switch (type) {
|
||||
case "address":
|
||||
@ -388,13 +389,20 @@ class TypedDataEncoder {
|
||||
case "bool":
|
||||
return !!value;
|
||||
case "string":
|
||||
(0, index_js_3.assertArgument)(typeof (value) === "string", "invalid string", "value", value);
|
||||
(0, index_js_4.assertArgument)(typeof (value) === "string", "invalid string", "value", value);
|
||||
return value;
|
||||
}
|
||||
(0, index_js_3.assertArgument)(false, "unsupported type", "type", type);
|
||||
(0, index_js_4.assertArgument)(false, "unsupported type", "type", type);
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.TypedDataEncoder = TypedDataEncoder;
|
||||
/**
|
||||
* Compute the address used to sign the typed data for the %%signature%%.
|
||||
*/
|
||||
function verifyTypedData(domain, types, value, signature) {
|
||||
return (0, index_js_3.recoverAddress)(TypedDataEncoder.hash(domain, types, value), signature);
|
||||
}
|
||||
exports.verifyTypedData = verifyTypedData;
|
||||
//# sourceMappingURL=typed-data.js.map
|
File diff suppressed because one or more lines are too long
@ -266,7 +266,7 @@ class AbstractProvider {
|
||||
return new provider_js_1.TransactionReceipt((0, format_js_1.formatTransactionReceipt)(value), this);
|
||||
}
|
||||
_wrapTransactionResponse(tx, network) {
|
||||
return new provider_js_1.TransactionResponse(tx, this);
|
||||
return new provider_js_1.TransactionResponse((0, format_js_1.formatTransactionResponse)(tx), this);
|
||||
}
|
||||
_detectNetwork() {
|
||||
(0, index_js_6.assert)(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", {
|
||||
@ -644,7 +644,7 @@ class AbstractProvider {
|
||||
if (params == null) {
|
||||
return null;
|
||||
}
|
||||
return this._wrapBlock((0, format_js_1.formatBlock)(params), network);
|
||||
return this._wrapBlock(params, network);
|
||||
}
|
||||
async getTransaction(hash) {
|
||||
const { network, params } = await (0, index_js_6.resolveProperties)({
|
||||
@ -654,7 +654,7 @@ class AbstractProvider {
|
||||
if (params == null) {
|
||||
return null;
|
||||
}
|
||||
return this._wrapTransactionResponse((0, format_js_1.formatTransactionResponse)(params), network);
|
||||
return this._wrapTransactionResponse(params, network);
|
||||
}
|
||||
async getTransactionReceipt(hash) {
|
||||
const { network, params } = await (0, index_js_6.resolveProperties)({
|
||||
@ -673,7 +673,7 @@ class AbstractProvider {
|
||||
}
|
||||
params.effectiveGasPrice = tx.gasPrice;
|
||||
}
|
||||
return this._wrapTransactionReceipt((0, format_js_1.formatTransactionReceipt)(params), network);
|
||||
return this._wrapTransactionReceipt(params, network);
|
||||
}
|
||||
async getTransactionResult(hash) {
|
||||
const { result } = await (0, index_js_6.resolveProperties)({
|
||||
@ -695,7 +695,7 @@ class AbstractProvider {
|
||||
network: this.getNetwork(),
|
||||
params: this.#perform({ method: "getLogs", filter })
|
||||
});
|
||||
return params.map((p) => this._wrapLog((0, format_js_1.formatLog)(p), network));
|
||||
return params.map((p) => this._wrapLog(p, network));
|
||||
}
|
||||
// ENS
|
||||
_getProvider(chainId) {
|
||||
|
File diff suppressed because one or more lines are too long
4
lib.commonjs/providers/ens-resolver.d.ts
vendored
4
lib.commonjs/providers/ens-resolver.d.ts
vendored
@ -61,7 +61,7 @@ export declare class EnsResolver {
|
||||
*/
|
||||
address: string;
|
||||
/**
|
||||
* The name this resovler was resolved against.
|
||||
* The name this resolver was resolved against.
|
||||
*/
|
||||
name: string;
|
||||
constructor(provider: AbstractProvider, address: string, name: string);
|
||||
@ -75,7 +75,7 @@ export declare class EnsResolver {
|
||||
*/
|
||||
getAddress(coinType?: number): Promise<null | string>;
|
||||
/**
|
||||
* Resovles to the EIP-643 text record for %%key%%, or ``null``
|
||||
* Resolves to the EIP-643 text record for %%key%%, or ``null``
|
||||
* if unconfigured.
|
||||
*/
|
||||
getText(key: string): Promise<null | string>;
|
||||
|
@ -79,7 +79,7 @@ class EnsResolver {
|
||||
*/
|
||||
address;
|
||||
/**
|
||||
* The name this resovler was resolved against.
|
||||
* The name this resolver was resolved against.
|
||||
*/
|
||||
name;
|
||||
// For EIP-2544 names, the ancestor that provided the resolver
|
||||
@ -208,7 +208,7 @@ class EnsResolver {
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Resovles to the EIP-643 text record for %%key%%, or ``null``
|
||||
* Resolves to the EIP-643 text record for %%key%%, or ``null``
|
||||
* if unconfigured.
|
||||
*/
|
||||
async getText(key) {
|
||||
|
@ -54,7 +54,6 @@ class IpcSocketProvider extends provider_socket_js_1.SocketProvider {
|
||||
super.destroy();
|
||||
}
|
||||
async _write(message) {
|
||||
console.log(">>>", message);
|
||||
this.socket.write(message);
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-ipcsocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";;;AACA,6BAA8B;AAC9B,6DAAsD;AAMtD,yEAAyE;AACzE,0CAA0C;AAC1C,SAAS,WAAW,CAAC,IAAY;IAC7B,MAAM,QAAQ,GAAkB,EAAG,CAAC;IAEpC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,OAAO,IAAI,EAAE;QACT,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE;YAAE,MAAM;SAAE;QACzB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9D,SAAS,GAAG,EAAE,GAAG,CAAC,CAAC;KACtB;IAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;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,CAAC;QAElB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QACxB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;CACJ;AA5CD,8CA4CC"}
|
177
lib.commonjs/providers/provider.d.ts
vendored
177
lib.commonjs/providers/provider.d.ts
vendored
@ -83,6 +83,13 @@ export interface PreparedTransactionRequest {
|
||||
enableCcipRead?: boolean;
|
||||
}
|
||||
export declare function copyRequest(req: TransactionRequest): PreparedTransactionRequest;
|
||||
/**
|
||||
* An Interface to indicate a [[Block]] has been included in the
|
||||
* blockchain. This asserts a Type Guard that necessary properties
|
||||
* are non-null.
|
||||
*
|
||||
* Before a block is included, it is a //pending// block.
|
||||
*/
|
||||
export interface MinedBlock extends Block {
|
||||
readonly number: number;
|
||||
readonly hash: string;
|
||||
@ -266,46 +273,200 @@ export interface MinedTransactionResponse extends TransactionResponse {
|
||||
}
|
||||
export declare class TransactionResponse implements TransactionLike<string>, TransactionResponseParams {
|
||||
#private;
|
||||
/**
|
||||
* The provider this is connected to, which will influence how its
|
||||
* methods will resolve its async inspection methods.
|
||||
*/
|
||||
readonly provider: Provider;
|
||||
/**
|
||||
* The block number of the block that this transaction was included in.
|
||||
*
|
||||
* This is ``null`` for pending transactions.
|
||||
*/
|
||||
readonly blockNumber: null | number;
|
||||
/**
|
||||
* The blockHash of the block that this transaction was included in.
|
||||
*
|
||||
* This is ``null`` for pending transactions.
|
||||
*/
|
||||
readonly blockHash: null | string;
|
||||
/**
|
||||
* The index within the block that this transaction resides at.
|
||||
*/
|
||||
readonly index: number;
|
||||
/**
|
||||
* The transaction hash.
|
||||
*/
|
||||
readonly hash: string;
|
||||
/**
|
||||
* The [[link-eip-2718]] transaction envelope type. This is
|
||||
* ``0`` for legacy transactions types.
|
||||
*/
|
||||
readonly type: number;
|
||||
/**
|
||||
* The receiver of this transaction.
|
||||
*
|
||||
* If ``null``, then the transaction is an initcode transaction.
|
||||
* This means the result of executing the [[data]] will be deployed
|
||||
* as a new contract on chain (assuming it does not revert) and the
|
||||
* address may be computed using [[getCreateAddress]].
|
||||
*/
|
||||
readonly to: null | string;
|
||||
/**
|
||||
* The sender of this transaction. It is implicitly computed
|
||||
* from the transaction pre-image hash (as the digest) and the
|
||||
* [[signature]] using ecrecover.
|
||||
*/
|
||||
readonly from: string;
|
||||
/**
|
||||
* The nonce, which is used to prevent replay attacks and offer
|
||||
* a method to ensure transactions from a given sender are explicitly
|
||||
* ordered.
|
||||
*
|
||||
* When sending a transaction, this must be equal to the number of
|
||||
* transactions ever sent by [[from]].
|
||||
*/
|
||||
readonly nonce: number;
|
||||
/**
|
||||
* The maximum units of gas this transaction can consume. If execution
|
||||
* exceeds this, the entries transaction is reverted and the sender
|
||||
* is charged for the full amount, despite not state changes being made.
|
||||
*/
|
||||
readonly gasLimit: bigint;
|
||||
/**
|
||||
* The gas price can have various values, depending on the network.
|
||||
*
|
||||
* In modern networks, for transactions that are included this is
|
||||
* the //effective gas price// (the fee per gas that was actually
|
||||
* charged), while for transactions that have not been included yet
|
||||
* is the [[maxFeePerGas]].
|
||||
*
|
||||
* For legacy transactions, or transactions on legacy networks, this
|
||||
* is the fee that will be charged per unit of gas the transaction
|
||||
* consumes.
|
||||
*/
|
||||
readonly gasPrice: bigint;
|
||||
/**
|
||||
* The maximum priority fee (per unit of gas) to allow a
|
||||
* validator to charge the sender. This is inclusive of the
|
||||
* [[maxFeeFeePerGas]].
|
||||
*/
|
||||
readonly maxPriorityFeePerGas: null | bigint;
|
||||
/**
|
||||
* The maximum fee (per unit of gas) to allow this transaction
|
||||
* to charge the sender.
|
||||
*/
|
||||
readonly maxFeePerGas: null | bigint;
|
||||
/**
|
||||
* The data.
|
||||
*/
|
||||
readonly data: string;
|
||||
/**
|
||||
* The value, in wei. Use [[formatEther]] to format this value
|
||||
* as ether.
|
||||
*/
|
||||
readonly value: bigint;
|
||||
/**
|
||||
* The chain ID.
|
||||
*/
|
||||
readonly chainId: bigint;
|
||||
/**
|
||||
* The signature.
|
||||
*/
|
||||
readonly signature: Signature;
|
||||
/**
|
||||
* The [[link-eip-2930]] access list for transaction types that
|
||||
* support it, otherwise ``null``.
|
||||
*/
|
||||
readonly accessList: null | AccessList;
|
||||
/**
|
||||
* Create a new TransactionResponse with %%tx%% parameters
|
||||
* connected to %%provider%%.
|
||||
*/
|
||||
constructor(tx: TransactionResponseParams, provider: Provider);
|
||||
/**
|
||||
* Returns a JSON representation of this transaction.
|
||||
*/
|
||||
toJSON(): any;
|
||||
/**
|
||||
* Resolves to the Block that this transaction was included in.
|
||||
*
|
||||
* This will return null if the transaction has not been included yet.
|
||||
*/
|
||||
getBlock(): Promise<null | Block>;
|
||||
/**
|
||||
* Resolves to this transaction being re-requested from the
|
||||
* provider. This can be used if you have an unmined transaction
|
||||
* and wish to get an up-to-date populated instance.
|
||||
*/
|
||||
getTransaction(): Promise<null | TransactionResponse>;
|
||||
/**
|
||||
* Resolves once this transaction has been mined and has
|
||||
* %%confirms%% blocks including it (default: ``1``) with an
|
||||
* optional %%timeout%%.
|
||||
*
|
||||
* This can resolve to ``null`` only if %%confirms%% is ``0``
|
||||
* and the transaction has not been mined, otherwise this will
|
||||
* wait until enough confirmations have completed.
|
||||
*/
|
||||
wait(_confirms?: number, _timeout?: number): Promise<null | TransactionReceipt>;
|
||||
/**
|
||||
* Returns ``true`` if this transaction has been included.
|
||||
*
|
||||
* This is effective only as of the time the TransactionResponse
|
||||
* was instantiated. To get up-to-date information, use
|
||||
* [[getTransaction]].
|
||||
*
|
||||
* This provides a Type Guard that this transaction will have
|
||||
* non-null property values for properties that are null for
|
||||
* unmined transactions.
|
||||
*/
|
||||
isMined(): this is MinedTransactionResponse;
|
||||
/**
|
||||
* Returns true if the transaction is a legacy (i.e. ``type == 0``)
|
||||
* transaction.
|
||||
*
|
||||
* This provides a Type Guard that this transaction will have
|
||||
* the ``null``-ness for hardfork-specific properties set correctly.
|
||||
*/
|
||||
isLegacy(): this is (TransactionResponse & {
|
||||
accessList: null;
|
||||
maxFeePerGas: null;
|
||||
maxPriorityFeePerGas: null;
|
||||
});
|
||||
/**
|
||||
* Returns true if the transaction is a Berlin (i.e. ``type == 1``)
|
||||
* transaction. See [[link-eip-2070]].
|
||||
*
|
||||
* This provides a Type Guard that this transaction will have
|
||||
* the ``null``-ness for hardfork-specific properties set correctly.
|
||||
*/
|
||||
isBerlin(): this is (TransactionResponse & {
|
||||
accessList: AccessList;
|
||||
maxFeePerGas: null;
|
||||
maxPriorityFeePerGas: null;
|
||||
});
|
||||
/**
|
||||
* Returns true if the transaction is a London (i.e. ``type == 2``)
|
||||
* transaction. See [[link-eip-1559]].
|
||||
*
|
||||
* This provides a Type Guard that this transaction will have
|
||||
* the ``null``-ness for hardfork-specific properties set correctly.
|
||||
*/
|
||||
isLondon(): this is (TransactionResponse & {
|
||||
accessList: AccessList;
|
||||
maxFeePerGas: bigint;
|
||||
maxPriorityFeePerGas: bigint;
|
||||
});
|
||||
/**
|
||||
* Returns a filter which can be used to listen for orphan events
|
||||
* that evict this transaction.
|
||||
*/
|
||||
removedEvent(): OrphanFilter;
|
||||
/**
|
||||
* Returns a filter which can be used to listen for orphan events
|
||||
* that re-order this event against %%other%%.
|
||||
*/
|
||||
reorderedEvent(other?: TransactionResponse): OrphanFilter;
|
||||
/**
|
||||
* Returns a new TransactionResponse instance which has the ability to
|
||||
@ -318,6 +479,13 @@ export declare class TransactionResponse implements TransactionLike<string>, Tra
|
||||
*/
|
||||
replaceableTransaction(startBlock: number): TransactionResponse;
|
||||
}
|
||||
/**
|
||||
* An Orphan Filter allows detecting when an orphan block has
|
||||
* resulted in dropping a block or transaction or has resulted
|
||||
* in transactions changing order.
|
||||
*
|
||||
* Not currently fully supported.
|
||||
*/
|
||||
export type OrphanFilter = {
|
||||
orphan: "drop-block";
|
||||
hash: string;
|
||||
@ -358,6 +526,15 @@ export type OrphanFilter = {
|
||||
index: number;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* A **TopicFilter** provides a struture to define bloom-filter
|
||||
* queries.
|
||||
*
|
||||
* Each field that is ``null`` matches **any** value, a field that is
|
||||
* a ``string`` must match exactly that value and and ``array`` is
|
||||
* effectively an ``OR``-ed set, where any one of those values must
|
||||
* match.
|
||||
*/
|
||||
export type TopicFilter = Array<null | string | Array<string>>;
|
||||
export interface EventFilter {
|
||||
address?: AddressLike | Array<AddressLike>;
|
||||
|
@ -543,25 +543,117 @@ export type ReplacementDetectionSetup = {
|
||||
};
|
||||
*/
|
||||
class TransactionResponse {
|
||||
/**
|
||||
* The provider this is connected to, which will influence how its
|
||||
* methods will resolve its async inspection methods.
|
||||
*/
|
||||
provider;
|
||||
/**
|
||||
* The block number of the block that this transaction was included in.
|
||||
*
|
||||
* This is ``null`` for pending transactions.
|
||||
*/
|
||||
blockNumber;
|
||||
/**
|
||||
* The blockHash of the block that this transaction was included in.
|
||||
*
|
||||
* This is ``null`` for pending transactions.
|
||||
*/
|
||||
blockHash;
|
||||
/**
|
||||
* The index within the block that this transaction resides at.
|
||||
*/
|
||||
index;
|
||||
/**
|
||||
* The transaction hash.
|
||||
*/
|
||||
hash;
|
||||
/**
|
||||
* The [[link-eip-2718]] transaction envelope type. This is
|
||||
* ``0`` for legacy transactions types.
|
||||
*/
|
||||
type;
|
||||
/**
|
||||
* The receiver of this transaction.
|
||||
*
|
||||
* If ``null``, then the transaction is an initcode transaction.
|
||||
* This means the result of executing the [[data]] will be deployed
|
||||
* as a new contract on chain (assuming it does not revert) and the
|
||||
* address may be computed using [[getCreateAddress]].
|
||||
*/
|
||||
to;
|
||||
/**
|
||||
* The sender of this transaction. It is implicitly computed
|
||||
* from the transaction pre-image hash (as the digest) and the
|
||||
* [[signature]] using ecrecover.
|
||||
*/
|
||||
from;
|
||||
/**
|
||||
* The nonce, which is used to prevent replay attacks and offer
|
||||
* a method to ensure transactions from a given sender are explicitly
|
||||
* ordered.
|
||||
*
|
||||
* When sending a transaction, this must be equal to the number of
|
||||
* transactions ever sent by [[from]].
|
||||
*/
|
||||
nonce;
|
||||
/**
|
||||
* The maximum units of gas this transaction can consume. If execution
|
||||
* exceeds this, the entries transaction is reverted and the sender
|
||||
* is charged for the full amount, despite not state changes being made.
|
||||
*/
|
||||
gasLimit;
|
||||
/**
|
||||
* The gas price can have various values, depending on the network.
|
||||
*
|
||||
* In modern networks, for transactions that are included this is
|
||||
* the //effective gas price// (the fee per gas that was actually
|
||||
* charged), while for transactions that have not been included yet
|
||||
* is the [[maxFeePerGas]].
|
||||
*
|
||||
* For legacy transactions, or transactions on legacy networks, this
|
||||
* is the fee that will be charged per unit of gas the transaction
|
||||
* consumes.
|
||||
*/
|
||||
gasPrice;
|
||||
/**
|
||||
* The maximum priority fee (per unit of gas) to allow a
|
||||
* validator to charge the sender. This is inclusive of the
|
||||
* [[maxFeeFeePerGas]].
|
||||
*/
|
||||
maxPriorityFeePerGas;
|
||||
/**
|
||||
* The maximum fee (per unit of gas) to allow this transaction
|
||||
* to charge the sender.
|
||||
*/
|
||||
maxFeePerGas;
|
||||
/**
|
||||
* The data.
|
||||
*/
|
||||
data;
|
||||
/**
|
||||
* The value, in wei. Use [[formatEther]] to format this value
|
||||
* as ether.
|
||||
*/
|
||||
value;
|
||||
/**
|
||||
* The chain ID.
|
||||
*/
|
||||
chainId;
|
||||
/**
|
||||
* The signature.
|
||||
*/
|
||||
signature;
|
||||
/**
|
||||
* The [[link-eip-2930]] access list for transaction types that
|
||||
* support it, otherwise ``null``.
|
||||
*/
|
||||
accessList;
|
||||
#startBlock;
|
||||
/**
|
||||
* Create a new TransactionResponse with %%tx%% parameters
|
||||
* connected to %%provider%%.
|
||||
*/
|
||||
constructor(tx, provider) {
|
||||
this.provider = provider;
|
||||
this.blockNumber = (tx.blockNumber != null) ? tx.blockNumber : null;
|
||||
@ -583,6 +675,9 @@ class TransactionResponse {
|
||||
this.accessList = (tx.accessList != null) ? tx.accessList : null;
|
||||
this.#startBlock = -1;
|
||||
}
|
||||
/**
|
||||
* Returns a JSON representation of this transaction.
|
||||
*/
|
||||
toJSON() {
|
||||
const { blockNumber, blockHash, index, hash, type, to, from, nonce, data, signature, accessList } = this;
|
||||
return {
|
||||
@ -599,6 +694,11 @@ class TransactionResponse {
|
||||
value: toJson(this.value),
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Resolves to the Block that this transaction was included in.
|
||||
*
|
||||
* This will return null if the transaction has not been included yet.
|
||||
*/
|
||||
async getBlock() {
|
||||
let blockNumber = this.blockNumber;
|
||||
if (blockNumber == null) {
|
||||
@ -616,9 +716,23 @@ class TransactionResponse {
|
||||
}
|
||||
return block;
|
||||
}
|
||||
/**
|
||||
* Resolves to this transaction being re-requested from the
|
||||
* provider. This can be used if you have an unmined transaction
|
||||
* and wish to get an up-to-date populated instance.
|
||||
*/
|
||||
async getTransaction() {
|
||||
return this.provider.getTransaction(this.hash);
|
||||
}
|
||||
/**
|
||||
* Resolves once this transaction has been mined and has
|
||||
* %%confirms%% blocks including it (default: ``1``) with an
|
||||
* optional %%timeout%%.
|
||||
*
|
||||
* This can resolve to ``null`` only if %%confirms%% is ``0``
|
||||
* and the transaction has not been mined, otherwise this will
|
||||
* wait until enough confirmations have completed.
|
||||
*/
|
||||
async wait(_confirms, _timeout) {
|
||||
const confirms = (_confirms == null) ? 1 : _confirms;
|
||||
const timeout = (_timeout == null) ? 0 : _timeout;
|
||||
@ -773,22 +887,62 @@ class TransactionResponse {
|
||||
});
|
||||
return await waiter;
|
||||
}
|
||||
/**
|
||||
* Returns ``true`` if this transaction has been included.
|
||||
*
|
||||
* This is effective only as of the time the TransactionResponse
|
||||
* was instantiated. To get up-to-date information, use
|
||||
* [[getTransaction]].
|
||||
*
|
||||
* This provides a Type Guard that this transaction will have
|
||||
* non-null property values for properties that are null for
|
||||
* unmined transactions.
|
||||
*/
|
||||
isMined() {
|
||||
return (this.blockHash != null);
|
||||
}
|
||||
/**
|
||||
* Returns true if the transaction is a legacy (i.e. ``type == 0``)
|
||||
* transaction.
|
||||
*
|
||||
* This provides a Type Guard that this transaction will have
|
||||
* the ``null``-ness for hardfork-specific properties set correctly.
|
||||
*/
|
||||
isLegacy() {
|
||||
return (this.type === 0);
|
||||
}
|
||||
/**
|
||||
* Returns true if the transaction is a Berlin (i.e. ``type == 1``)
|
||||
* transaction. See [[link-eip-2070]].
|
||||
*
|
||||
* This provides a Type Guard that this transaction will have
|
||||
* the ``null``-ness for hardfork-specific properties set correctly.
|
||||
*/
|
||||
isBerlin() {
|
||||
return (this.type === 1);
|
||||
}
|
||||
/**
|
||||
* Returns true if the transaction is a London (i.e. ``type == 2``)
|
||||
* transaction. See [[link-eip-1559]].
|
||||
*
|
||||
* This provides a Type Guard that this transaction will have
|
||||
* the ``null``-ness for hardfork-specific properties set correctly.
|
||||
*/
|
||||
isLondon() {
|
||||
return (this.type === 2);
|
||||
}
|
||||
/**
|
||||
* Returns a filter which can be used to listen for orphan events
|
||||
* that evict this transaction.
|
||||
*/
|
||||
removedEvent() {
|
||||
(0, index_js_1.assert)(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" });
|
||||
return createRemovedTransactionFilter(this);
|
||||
}
|
||||
/**
|
||||
* Returns a filter which can be used to listen for orphan events
|
||||
* that re-order this event against %%other%%.
|
||||
*/
|
||||
reorderedEvent(other) {
|
||||
(0, index_js_1.assert)(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" });
|
||||
(0, index_js_1.assert)(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" });
|
||||
|
File diff suppressed because one or more lines are too long
@ -101,16 +101,16 @@ function _serializeLegacy(tx, sig) {
|
||||
(tx.data || "0x"),
|
||||
];
|
||||
let chainId = BN_0;
|
||||
if (tx.chainId != null) {
|
||||
if (tx.chainId != BN_0) {
|
||||
// A chainId was provided; if non-zero we'll use EIP-155
|
||||
chainId = (0, index_js_3.getBigInt)(tx.chainId, "tx.chainId");
|
||||
// We have a chainId in the tx and an EIP-155 v in the signature,
|
||||
// make sure they agree with each other
|
||||
(0, index_js_3.assertArgument)(!sig || sig.networkV == null || sig.legacyChainId === chainId, "tx.chainId/sig.v mismatch", "sig", sig);
|
||||
}
|
||||
else if (sig) {
|
||||
// No chainId provided, but the signature is signing with EIP-155; derive chainId
|
||||
const legacy = sig.legacyChainId;
|
||||
else if (tx.signature) {
|
||||
// No explicit chainId, but EIP-155 have a derived implicit chainId
|
||||
const legacy = tx.signature.legacyChainId;
|
||||
if (legacy != null) {
|
||||
chainId = legacy;
|
||||
}
|
||||
@ -125,7 +125,10 @@ function _serializeLegacy(tx, sig) {
|
||||
}
|
||||
return (0, index_js_3.encodeRlp)(fields);
|
||||
}
|
||||
// We pushed a chainId and null r, s on for hashing only; remove those
|
||||
// @TODO: We should probably check that tx.signature, chainId, and sig
|
||||
// match but that logic could break existing code, so schedule
|
||||
// this for the next major bump.
|
||||
// Compute the EIP-155 v
|
||||
let v = BigInt(27 + sig.yParity);
|
||||
if (chainId !== BN_0) {
|
||||
v = index_js_2.Signature.getChainIdV(chainId, sig.v);
|
||||
@ -133,6 +136,7 @@ function _serializeLegacy(tx, sig) {
|
||||
else if (BigInt(sig.v) !== v) {
|
||||
(0, index_js_3.assertArgument)(false, "tx.chainId/sig.v mismatch", "sig", sig);
|
||||
}
|
||||
// Add the signature
|
||||
fields.push((0, index_js_3.toBeArray)(v));
|
||||
fields.push((0, index_js_3.toBeArray)(sig.r));
|
||||
fields.push((0, index_js_3.toBeArray)(sig.s));
|
||||
|
File diff suppressed because one or more lines are too long
2
lib.commonjs/utils/fetch.d.ts
vendored
2
lib.commonjs/utils/fetch.d.ts
vendored
@ -178,7 +178,7 @@ export declare class FetchRequest implements Iterable<[key: string, value: strin
|
||||
* Create a new FetchRequest instance with default values.
|
||||
*
|
||||
* Once created, each property may be set before issuing a
|
||||
* ``.send()`` to make teh request.
|
||||
* ``.send()`` to make the request.
|
||||
*/
|
||||
constructor(url: string);
|
||||
toString(): string;
|
||||
|
@ -355,7 +355,7 @@ class FetchRequest {
|
||||
* Create a new FetchRequest instance with default values.
|
||||
*
|
||||
* Once created, each property may be set before issuing a
|
||||
* ``.send()`` to make teh request.
|
||||
* ``.send()`` to make the request.
|
||||
*/
|
||||
constructor(url) {
|
||||
this.#url = String(url);
|
||||
|
38
lib.esm/_admin/create-release.js
Normal file
38
lib.esm/_admin/create-release.js
Normal file
@ -0,0 +1,38 @@
|
||||
import { getChanges } from "./utils/changelog.js";
|
||||
import { getDateTime } from "./utils/date.js";
|
||||
import { resolve } from "./utils/path.js";
|
||||
import { run } from "./utils/run.js";
|
||||
import { getVersions } from "./utils/npm.js";
|
||||
const version = process.argv[2] || null;
|
||||
(async function () {
|
||||
// Get the change from the CHANGELOG
|
||||
const changes = getChanges();
|
||||
const change = version ? changes.filter((c) => (c.version === version))[0] : changes.shift();
|
||||
if (change == null) {
|
||||
throw new Error(`version not found: ${version}`);
|
||||
}
|
||||
console.log(change);
|
||||
// Find the gitHead and release date
|
||||
const versions = await getVersions("ethers");
|
||||
const ver = versions.filter((c) => (c.version === change.version))[0];
|
||||
if (ver == null) {
|
||||
throw new Error(`no npm version found: ${change.version}`);
|
||||
}
|
||||
console.log(ver);
|
||||
const title = `${change.title.split("(")[0].trim()} (${getDateTime(new Date(ver.date))})`;
|
||||
const args = [
|
||||
"release", "create", `v${change.version}`,
|
||||
// "--draft", // DEBUGGING
|
||||
"--title", title,
|
||||
"--target", ver.gitHead,
|
||||
"--notes", change.body.join("\n"),
|
||||
];
|
||||
console.log(args);
|
||||
const result = await run("gh", args, resolve("."));
|
||||
console.log("Published");
|
||||
console.log(`See: ${(result.stdout || "").trim()}`);
|
||||
})().catch((e) => {
|
||||
console.log("ERROR");
|
||||
console.log(e);
|
||||
});
|
||||
//# sourceMappingURL=create-release.js.map
|
1
lib.esm/_admin/create-release.js.map
Normal file
1
lib.esm/_admin/create-release.js.map
Normal file
@ -0,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AClF,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAEjB,MAAM,KAAK,GAAG,GAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAG,KAAM,WAAW,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAG,GAAG,CAAC;IAE/F,MAAM,IAAI,GAAG;QACT,SAAS,EAAE,QAAQ,EAAE,IAAK,MAAM,CAAC,OAAQ,EAAE;QACnD,iCAAiC;QACzB,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,GAAG,CAAC,OAAO;QACvB,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;KACpC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClB,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACzB,OAAO,CAAC,GAAG,CAAC,QAAS,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAG,EAAE,CAAC,CAAC;AAC1D,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
|
@ -3,6 +3,7 @@ import { getLogs } from "./utils/git.js";
|
||||
import { loadJson } from "./utils/json.js";
|
||||
import { resolve } from "./utils/path.js";
|
||||
import { getVersions } from "./utils/npm.js";
|
||||
import { getDateTime } from "./utils/date.js";
|
||||
function repeat(c, length) {
|
||||
if (c.length === 0) {
|
||||
throw new Error("too short");
|
||||
@ -12,26 +13,6 @@ function repeat(c, length) {
|
||||
}
|
||||
return c.substring(0, length);
|
||||
}
|
||||
function zpad(value, length) {
|
||||
if (length == null) {
|
||||
length = 2;
|
||||
}
|
||||
const str = String(value);
|
||||
return repeat("0", length - str.length) + str;
|
||||
}
|
||||
function getDate(date) {
|
||||
return [
|
||||
date.getFullYear(),
|
||||
zpad(date.getMonth() + 1),
|
||||
zpad(date.getDate())
|
||||
].join("-");
|
||||
}
|
||||
export function getDateTime(date) {
|
||||
return getDate(date) + " " + [
|
||||
zpad(date.getHours()),
|
||||
zpad(date.getMinutes() + 1)
|
||||
].join(":");
|
||||
}
|
||||
async function getChanges(tag0, tag1) {
|
||||
const result = [];
|
||||
const logs = await getLogs(null, { tag0, tag1 });
|
||||
|
File diff suppressed because one or more lines are too long
23
lib.esm/_admin/utils/changelog.js
Normal file
23
lib.esm/_admin/utils/changelog.js
Normal file
@ -0,0 +1,23 @@
|
||||
import fs from "fs";
|
||||
import { resolve } from "./path.js";
|
||||
export function getChanges() {
|
||||
const changes = [
|
||||
{ title: "", version: "null", body: [] }
|
||||
];
|
||||
const content = fs.readFileSync(resolve("CHANGELOG.md")).toString();
|
||||
for (const line of content.split("\n")) {
|
||||
let match = line.match(/^ethers\/v(\S+)\s/);
|
||||
if (match) {
|
||||
changes.push({ version: match[1], title: line.trim(), body: [] });
|
||||
}
|
||||
else {
|
||||
const l = line.trim();
|
||||
if (l && !l.match(/^-+$/)) {
|
||||
changes[changes.length - 1].body.push(l);
|
||||
}
|
||||
}
|
||||
}
|
||||
changes.shift();
|
||||
return changes;
|
||||
}
|
||||
//# sourceMappingURL=changelog.js.map
|
1
lib.esm/_admin/utils/changelog.js.map
Normal file
1
lib.esm/_admin/utils/changelog.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../../src.ts/_admin/utils/changelog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,MAAM,UAAU,UAAU;IACtB,MAAM,OAAO,GAAyB;QAClC,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAG,EAAE;KAC5C,CAAC;IAEF,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IACpE,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;QACpC,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC5C,IAAI,KAAK,EAAE;YACP,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,EAAG,EAAE,CAAC,CAAC;SACtE;aAAM;YACH,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;YACtB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;gBACvB,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aAC5C;SACJ;KACJ;IAED,OAAO,CAAC,KAAK,EAAE,CAAC;IAEhB,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
30
lib.esm/_admin/utils/date.js
Normal file
30
lib.esm/_admin/utils/date.js
Normal file
@ -0,0 +1,30 @@
|
||||
function repeat(c, length) {
|
||||
if (c.length === 0) {
|
||||
throw new Error("too short");
|
||||
}
|
||||
while (c.length < length) {
|
||||
c += c;
|
||||
}
|
||||
return c.substring(0, length);
|
||||
}
|
||||
function zpad(value, length) {
|
||||
if (length == null) {
|
||||
length = 2;
|
||||
}
|
||||
const str = String(value);
|
||||
return repeat("0", length - str.length) + str;
|
||||
}
|
||||
function getDate(date) {
|
||||
return [
|
||||
date.getFullYear(),
|
||||
zpad(date.getMonth() + 1),
|
||||
zpad(date.getDate())
|
||||
].join("-");
|
||||
}
|
||||
export function getDateTime(date) {
|
||||
return getDate(date) + " " + [
|
||||
zpad(date.getHours()),
|
||||
zpad(date.getMinutes() + 1)
|
||||
].join(":");
|
||||
}
|
||||
//# sourceMappingURL=date.js.map
|
1
lib.esm/_admin/utils/date.js.map
Normal file
1
lib.esm/_admin/utils/date.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../../src.ts/_admin/utils/date.ts"],"names":[],"mappings":"AACA,SAAS,MAAM,CAAC,CAAS,EAAE,MAAc;IACrC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;KAAE;IACrD,OAAM,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE;QAAE,CAAC,IAAI,CAAC,CAAC;KAAE;IACpC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,IAAI,CAAC,KAAa,EAAE,MAAe;IACxC,IAAI,MAAM,IAAI,IAAI,EAAE;QAAE,MAAM,GAAG,CAAC,CAAC;KAAE;IACnC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,OAAO,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAClD,CAAC;AAED,SAAS,OAAO,CAAC,IAAU;IACvB,OAAO;QACH,IAAI,CAAC,WAAW,EAAE;QAClB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;KACvB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAU;IAClC,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG;QACzB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;KAC9B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChB,CAAC"}
|
75
lib.esm/_tests/test-contract-integ.js
Normal file
75
lib.esm/_tests/test-contract-integ.js
Normal file
@ -0,0 +1,75 @@
|
||||
import assert from "assert";
|
||||
import { ethers } from "../index.js";
|
||||
describe("Tests contract integration", function () {
|
||||
const provider = new ethers.JsonRpcProvider("http:/\/127.0.0.1:8545");
|
||||
const abi = [
|
||||
"constructor(address owner, uint maxSupply)",
|
||||
"function mint(address target) returns (bool minted)",
|
||||
"function totalSupply() view returns (uint supply)",
|
||||
"function balanceOf(address target) view returns (uint balance)",
|
||||
"event Minted(address target)"
|
||||
];
|
||||
let address = null;
|
||||
it("deploys a contract", async function () {
|
||||
this.timeout(10000);
|
||||
const bytecode = "0x60c060405234801561001057600080fd5b506040516105863803806105868339818101604052810190610032919061010e565b8173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508060a08181525050505061014e565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a58261007a565b9050919050565b6100b58161009a565b81146100c057600080fd5b50565b6000815190506100d2816100ac565b92915050565b6000819050919050565b6100eb816100d8565b81146100f657600080fd5b50565b600081519050610108816100e2565b92915050565b6000806040838503121561012557610124610075565b5b6000610133858286016100c3565b9250506020610144858286016100f9565b9150509250929050565b60805160a051610414610172600039600060fa0152600061021f01526104146000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806318160ddd146100515780636a6278421461006f57806370a082311461009f5780638da5cb5b146100cf575b600080fd5b6100596100ed565b604051610066919061025c565b60405180910390f35b610089600480360381019061008491906102da565b6100f6565b6040516100969190610322565b60405180910390f35b6100b960048036038101906100b491906102da565b6101d2565b6040516100c6919061025c565b60405180910390f35b6100d761021b565b6040516100e4919061034c565b60405180910390f35b60008054905090565b60007f00000000000000000000000000000000000000000000000000000000000000006000541061012657600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061017690610396565b919050555060008081548092919061018d90610396565b91905055507f90ddedd5a25821bba11fbb98de02ec1f75c1be90ae147d6450ce873e7b78b5d8826040516101c1919061034c565b60405180910390a160019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60007f0000000000000000000000000000000000000000000000000000000000000000905090565b6000819050919050565b61025681610243565b82525050565b6000602082019050610271600083018461024d565b92915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006102a78261027c565b9050919050565b6102b78161029c565b81146102c257600080fd5b50565b6000813590506102d4816102ae565b92915050565b6000602082840312156102f0576102ef610277565b5b60006102fe848285016102c5565b91505092915050565b60008115159050919050565b61031c81610307565b82525050565b60006020820190506103376000830184610313565b92915050565b6103468161029c565b82525050565b6000602082019050610361600083018461033d565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006103a182610243565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036103d3576103d2610367565b5b60018201905091905056fea26469706673582212200a979ea2bfdf429b5546fa25906c9d20a3d67ef5fbe531f31d2cc83533e3239564736f6c63430008120033";
|
||||
const signer = await provider.getSigner(0);
|
||||
const factory = new ethers.ContractFactory(abi, bytecode, signer);
|
||||
const contract = await factory.deploy(signer, 100);
|
||||
address = await contract.getAddress();
|
||||
await contract.waitForDeployment();
|
||||
const deployed = await provider.getCode(address);
|
||||
assert.ok(deployed != "0x", "has bytescode");
|
||||
});
|
||||
it("runs contract operations", async function () {
|
||||
this.timeout(10000);
|
||||
assert.ok(address != null);
|
||||
const signer = await provider.getSigner(0);
|
||||
const CustomContract = ethers.BaseContract.buildClass(abi);
|
||||
const contract = new CustomContract(address, signer); //ethers.Contract.from<ContractAbi>(address, abi, signer);
|
||||
// Test implicit staticCall (i.e. view/pure)
|
||||
{
|
||||
const supply0 = await contract.totalSupply();
|
||||
assert.equal(supply0, BigInt(0), "initial supply 0; default");
|
||||
}
|
||||
// Test explicit staticCall
|
||||
{
|
||||
const supply0 = await contract.totalSupply.staticCall();
|
||||
assert.equal(supply0, BigInt(0), "initial supply 0; staticCall");
|
||||
}
|
||||
// Test staticCallResult (positional and named)
|
||||
{
|
||||
const supply0 = await contract.totalSupply.staticCallResult();
|
||||
assert.equal(supply0[0], BigInt(0), "initial supply 0; staticCallResult");
|
||||
assert.equal(supply0.supply, BigInt(0), "initial supply 0; staticCallResult");
|
||||
}
|
||||
// Test populateTransaction
|
||||
const txInfo = await contract.mint.populateTransaction(signer);
|
||||
assert.equal(txInfo.to, address, "populateTransaction.to");
|
||||
const txInfoData = ethers.hexlify(ethers.concat([
|
||||
"0x6a627842",
|
||||
ethers.zeroPadValue(await signer.getAddress(), 32)
|
||||
]));
|
||||
assert.equal(txInfo.data, txInfoData, "populateTransaction.data");
|
||||
// Test minting (default)
|
||||
const tx = await contract.mint(signer);
|
||||
const receipt = await tx.wait();
|
||||
assert.ok(receipt, "receipt");
|
||||
// Check the receipt has parsed the events
|
||||
assert.equal(receipt.logs.length, 1, "logs.length");
|
||||
assert.ok(receipt instanceof ethers.ContractTransactionReceipt, "receipt typeof");
|
||||
assert.ok(receipt.logs[0] instanceof ethers.EventLog, "receipt.log typeof");
|
||||
assert.equal(receipt.logs[0].fragment && receipt.logs[0].fragment.name, "Minted", "logs[0].fragment.name");
|
||||
assert.equal(receipt.logs[0].args[0], await signer.getAddress(), "logs[0].args[0]");
|
||||
assert.equal(receipt.logs[0].args.target, await signer.getAddress(), "logs[0].args.target");
|
||||
// Check the state has been adjusted
|
||||
assert.equal(await contract.totalSupply(), BigInt(1), "initial supply 1; default");
|
||||
assert.equal(await contract.balanceOf(signer), BigInt(1), "balanceOf(signer)");
|
||||
// Test minting (explicit)
|
||||
const tx2 = await contract.mint.send(signer);
|
||||
await tx2.wait();
|
||||
// Check the state has been adjusted
|
||||
assert.equal(await contract.totalSupply(), BigInt(2), "initial supply 2; default");
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=test-contract-integ.js.map
|
1
lib.esm/_tests/test-contract-integ.js.map
Normal file
1
lib.esm/_tests/test-contract-integ.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"test-contract-integ.js","sourceRoot":"","sources":["../../src.ts/_tests/test-contract-integ.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQrC,QAAQ,CAAC,4BAA4B,EAAE;IACnC,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC;IAEtE,MAAM,GAAG,GAAG;QACR,4CAA4C;QAC5C,qDAAqD;QACrD,mDAAmD;QACnD,gEAAgE;QAChE,8BAA8B;KACjC,CAAC;IAEF,IAAI,OAAO,GAAkB,IAAI,CAAC;IAElC,EAAE,CAAC,oBAAoB,EAAE,KAAK;QAC1B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEpB,MAAM,QAAQ,GAAG,gxFAAgxF,CAAC;QAClyF,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAE3C,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAElE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACnD,OAAO,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;QAEtC,MAAM,QAAQ,CAAC,iBAAiB,EAAE,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KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,iBAAiB,CAAC,CAAC;QACpF,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,qBAAqB,CAAC,CAAC;QAE5F,oCAAoC;QACpC,MAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC;QACnF,MAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;QAE/E,0BAA0B;QAC1B,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAEjB,oCAAoC;QACpC,MAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
@ -2,5 +2,5 @@
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
export const version = "6.1.0";
|
||||
export const version = "6.2.0";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -54,7 +54,6 @@ class TokenString {
|
||||
linkBack: (t.linkBack - from),
|
||||
linkNext: (t.linkNext - from),
|
||||
}));
|
||||
return t;
|
||||
}));
|
||||
}
|
||||
// Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens
|
||||
|
File diff suppressed because one or more lines are too long
@ -55,9 +55,6 @@ class PreparedTopicFilter {
|
||||
// D = The type the default call will return (i.e. R for view/pure,
|
||||
// TransactionResponse otherwise)
|
||||
//export interface ContractMethod<A extends Array<any> = Array<any>, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {
|
||||
function _WrappedMethodBase() {
|
||||
return Function;
|
||||
}
|
||||
function getRunner(value, feature) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
@ -107,98 +104,142 @@ export async function resolveArgs(_runner, inputs, args) {
|
||||
});
|
||||
}));
|
||||
}
|
||||
class WrappedFallback {
|
||||
_contract;
|
||||
constructor(contract) {
|
||||
defineProperties(this, { _contract: contract });
|
||||
const proxy = new Proxy(this, {
|
||||
// Perform send when called
|
||||
apply: async (target, thisArg, args) => {
|
||||
return await target.send(...args);
|
||||
},
|
||||
});
|
||||
return proxy;
|
||||
}
|
||||
async populateTransaction(overrides) {
|
||||
function buildWrappedFallback(contract) {
|
||||
const populateTransaction = async function (overrides) {
|
||||
// If an overrides was passed in, copy it and normalize the values
|
||||
const tx = (await copyOverrides(overrides, ["data"]));
|
||||
tx.to = await this._contract.getAddress();
|
||||
const iface = this._contract.interface;
|
||||
tx.to = await contract.getAddress();
|
||||
const iface = contract.interface;
|
||||
// Only allow payable contracts to set non-zero value
|
||||
const payable = iface.receive || (iface.fallback && iface.fallback.payable);
|
||||
assertArgument(payable || (tx.value || BN_0) === BN_0, "cannot send value to non-payable contract", "overrides.value", tx.value);
|
||||
// Only allow fallback contracts to set non-empty data
|
||||
assertArgument(iface.fallback || (tx.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", tx.data);
|
||||
return tx;
|
||||
}
|
||||
async staticCall(overrides) {
|
||||
const runner = getRunner(this._contract.runner, "call");
|
||||
};
|
||||
const staticCall = async function (overrides) {
|
||||
const runner = getRunner(contract.runner, "call");
|
||||
assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
|
||||
const tx = await this.populateTransaction(overrides);
|
||||
const tx = await populateTransaction(overrides);
|
||||
try {
|
||||
return await runner.call(tx);
|
||||
}
|
||||
catch (error) {
|
||||
if (isCallException(error) && error.data) {
|
||||
throw contract.interface.makeError(error.data, tx);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
const send = async function (overrides) {
|
||||
const runner = contract.runner;
|
||||
assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
|
||||
const tx = await runner.sendTransaction(await populateTransaction(overrides));
|
||||
const provider = getProvider(contract.runner);
|
||||
// @TODO: the provider can be null; make a custom dummy provider that will throw a
|
||||
// meaningful error
|
||||
return new ContractTransactionResponse(contract.interface, provider, tx);
|
||||
};
|
||||
const estimateGas = async function (overrides) {
|
||||
const runner = getRunner(contract.runner, "estimateGas");
|
||||
assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
|
||||
return await runner.estimateGas(await populateTransaction(overrides));
|
||||
};
|
||||
const method = async (overrides) => {
|
||||
return await send(overrides);
|
||||
};
|
||||
defineProperties(method, {
|
||||
_contract: contract,
|
||||
estimateGas,
|
||||
populateTransaction,
|
||||
send, staticCall
|
||||
});
|
||||
return method;
|
||||
}
|
||||
/*
|
||||
class WrappedFallback {
|
||||
|
||||
constructor (contract: BaseContract) {
|
||||
defineProperties<WrappedFallback>(this, { _contract: contract });
|
||||
|
||||
const proxy = new Proxy(this, {
|
||||
// Perform send when called
|
||||
apply: async (target, thisArg, args: Array<any>) => {
|
||||
return await target.send(...args);
|
||||
},
|
||||
});
|
||||
|
||||
return proxy;
|
||||
}
|
||||
|
||||
async populateTransaction(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransaction> {
|
||||
// If an overrides was passed in, copy it and normalize the values
|
||||
|
||||
const tx: ContractTransaction = <any>(await copyOverrides<"data">(overrides, [ "data" ]));
|
||||
tx.to = await this._contract.getAddress();
|
||||
|
||||
const iface = this._contract.interface;
|
||||
|
||||
// Only allow payable contracts to set non-zero value
|
||||
const payable = iface.receive || (iface.fallback && iface.fallback.payable);
|
||||
assertArgument(payable || (tx.value || BN_0) === BN_0,
|
||||
"cannot send value to non-payable contract", "overrides.value", tx.value);
|
||||
|
||||
// Only allow fallback contracts to set non-empty data
|
||||
assertArgument(iface.fallback || (tx.data || "0x") === "0x",
|
||||
"cannot send data to receive-only contract", "overrides.data", tx.data);
|
||||
|
||||
return tx;
|
||||
}
|
||||
|
||||
async staticCall(overrides?: Omit<TransactionRequest, "to">): Promise<string> {
|
||||
const runner = getRunner(this._contract.runner, "call");
|
||||
assert(canCall(runner), "contract runner does not support calling",
|
||||
"UNSUPPORTED_OPERATION", { operation: "call" });
|
||||
|
||||
const tx = await this.populateTransaction(overrides);
|
||||
|
||||
try {
|
||||
return await runner.call(tx);
|
||||
} catch (error: any) {
|
||||
if (isCallException(error) && error.data) {
|
||||
throw this._contract.interface.makeError(error.data, tx);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
async send(overrides) {
|
||||
|
||||
async send(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse> {
|
||||
const runner = this._contract.runner;
|
||||
assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
|
||||
assert(canSend(runner), "contract runner does not support sending transactions",
|
||||
"UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
|
||||
|
||||
const tx = await runner.sendTransaction(await this.populateTransaction(overrides));
|
||||
const provider = getProvider(this._contract.runner);
|
||||
// @TODO: the provider can be null; make a custom dummy provider that will throw a
|
||||
// meaningful error
|
||||
return new ContractTransactionResponse(this._contract.interface, provider, tx);
|
||||
return new ContractTransactionResponse(this._contract.interface, <Provider>provider, tx);
|
||||
}
|
||||
async estimateGas(overrides) {
|
||||
|
||||
async estimateGas(overrides?: Omit<TransactionRequest, "to">): Promise<bigint> {
|
||||
const runner = getRunner(this._contract.runner, "estimateGas");
|
||||
assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
|
||||
assert(canEstimate(runner), "contract runner does not support gas estimation",
|
||||
"UNSUPPORTED_OPERATION", { operation: "estimateGas" });
|
||||
|
||||
return await runner.estimateGas(await this.populateTransaction(overrides));
|
||||
}
|
||||
}
|
||||
class WrappedMethod extends _WrappedMethodBase() {
|
||||
name = ""; // Investigate!
|
||||
_contract;
|
||||
_key;
|
||||
constructor(contract, key) {
|
||||
super();
|
||||
defineProperties(this, {
|
||||
name: contract.interface.getFunctionName(key),
|
||||
_contract: contract, _key: key
|
||||
});
|
||||
const proxy = new Proxy(this, {
|
||||
// Perform the default operation for this fragment type
|
||||
apply: async (target, thisArg, args) => {
|
||||
const fragment = target.getFragment(...args);
|
||||
if (fragment.constant) {
|
||||
return await target.staticCall(...args);
|
||||
}
|
||||
return await target.send(...args);
|
||||
},
|
||||
});
|
||||
return proxy;
|
||||
}
|
||||
// Only works on non-ambiguous keys (refined fragment is always non-ambiguous)
|
||||
get fragment() {
|
||||
const fragment = this._contract.interface.getFunction(this._key);
|
||||
*/
|
||||
function buildWrappedMethod(contract, key) {
|
||||
const getFragment = function (...args) {
|
||||
const fragment = contract.interface.getFunction(key, args);
|
||||
assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fragment"
|
||||
});
|
||||
return fragment;
|
||||
}
|
||||
getFragment(...args) {
|
||||
const fragment = this._contract.interface.getFunction(this._key, args);
|
||||
assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fragment"
|
||||
});
|
||||
return fragment;
|
||||
}
|
||||
async populateTransaction(...args) {
|
||||
const fragment = this.getFragment(...args);
|
||||
};
|
||||
const populateTransaction = async function (...args) {
|
||||
const fragment = getFragment(...args);
|
||||
// If an overrides was passed in, copy it and normalize the values
|
||||
let overrides = {};
|
||||
if (fragment.inputs.length + 1 === args.length) {
|
||||
@ -207,88 +248,109 @@ class WrappedMethod extends _WrappedMethodBase() {
|
||||
if (fragment.inputs.length !== args.length) {
|
||||
throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");
|
||||
}
|
||||
const resolvedArgs = await resolveArgs(this._contract.runner, fragment.inputs, args);
|
||||
const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);
|
||||
return Object.assign({}, overrides, await resolveProperties({
|
||||
to: this._contract.getAddress(),
|
||||
data: this._contract.interface.encodeFunctionData(fragment, resolvedArgs)
|
||||
to: contract.getAddress(),
|
||||
data: contract.interface.encodeFunctionData(fragment, resolvedArgs)
|
||||
}));
|
||||
}
|
||||
async staticCall(...args) {
|
||||
const result = await this.staticCallResult(...args);
|
||||
};
|
||||
const staticCall = async function (...args) {
|
||||
const result = await staticCallResult(...args);
|
||||
if (result.length === 1) {
|
||||
return result[0];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
async send(...args) {
|
||||
const runner = this._contract.runner;
|
||||
};
|
||||
const send = async function (...args) {
|
||||
const runner = contract.runner;
|
||||
assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
|
||||
const tx = await runner.sendTransaction(await this.populateTransaction(...args));
|
||||
const provider = getProvider(this._contract.runner);
|
||||
const tx = await runner.sendTransaction(await populateTransaction(...args));
|
||||
const provider = getProvider(contract.runner);
|
||||
// @TODO: the provider can be null; make a custom dummy provider that will throw a
|
||||
// meaningful error
|
||||
return new ContractTransactionResponse(this._contract.interface, provider, tx);
|
||||
}
|
||||
async estimateGas(...args) {
|
||||
const runner = getRunner(this._contract.runner, "estimateGas");
|
||||
return new ContractTransactionResponse(contract.interface, provider, tx);
|
||||
};
|
||||
const estimateGas = async function (...args) {
|
||||
const runner = getRunner(contract.runner, "estimateGas");
|
||||
assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
|
||||
return await runner.estimateGas(await this.populateTransaction(...args));
|
||||
}
|
||||
async staticCallResult(...args) {
|
||||
const runner = getRunner(this._contract.runner, "call");
|
||||
return await runner.estimateGas(await populateTransaction(...args));
|
||||
};
|
||||
const staticCallResult = async function (...args) {
|
||||
const runner = getRunner(contract.runner, "call");
|
||||
assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
|
||||
const tx = await this.populateTransaction(...args);
|
||||
const tx = await populateTransaction(...args);
|
||||
let result = "0x";
|
||||
try {
|
||||
result = await runner.call(tx);
|
||||
}
|
||||
catch (error) {
|
||||
if (isCallException(error) && error.data) {
|
||||
throw this._contract.interface.makeError(error.data, tx);
|
||||
throw contract.interface.makeError(error.data, tx);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
const fragment = this.getFragment(...args);
|
||||
return this._contract.interface.decodeFunctionResult(fragment, result);
|
||||
}
|
||||
const fragment = getFragment(...args);
|
||||
return contract.interface.decodeFunctionResult(fragment, result);
|
||||
};
|
||||
const method = async (...args) => {
|
||||
const fragment = getFragment(...args);
|
||||
if (fragment.constant) {
|
||||
return await staticCall(...args);
|
||||
}
|
||||
return await send(...args);
|
||||
};
|
||||
defineProperties(method, {
|
||||
name: contract.interface.getFunctionName(key),
|
||||
_contract: contract, _key: key,
|
||||
getFragment,
|
||||
estimateGas,
|
||||
populateTransaction,
|
||||
send, staticCall, staticCallResult,
|
||||
});
|
||||
// Only works on non-ambiguous keys (refined fragment is always non-ambiguous)
|
||||
Object.defineProperty(method, "fragment", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
get: () => {
|
||||
const fragment = contract.interface.getFunction(key);
|
||||
assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fragment"
|
||||
});
|
||||
return fragment;
|
||||
}
|
||||
});
|
||||
return method;
|
||||
}
|
||||
function _WrappedEventBase() {
|
||||
return Function;
|
||||
}
|
||||
class WrappedEvent extends _WrappedEventBase() {
|
||||
name = ""; // @TODO: investigate
|
||||
_contract;
|
||||
_key;
|
||||
constructor(contract, key) {
|
||||
super();
|
||||
defineProperties(this, {
|
||||
name: contract.interface.getEventName(key),
|
||||
_contract: contract, _key: key
|
||||
});
|
||||
return new Proxy(this, {
|
||||
// Perform the default operation for this fragment type
|
||||
apply: (target, thisArg, args) => {
|
||||
return new PreparedTopicFilter(contract, target.getFragment(...args), args);
|
||||
},
|
||||
});
|
||||
}
|
||||
// Only works on non-ambiguous keys
|
||||
get fragment() {
|
||||
const fragment = this._contract.interface.getEvent(this._key);
|
||||
function buildWrappedEvent(contract, key) {
|
||||
const getFragment = function (...args) {
|
||||
const fragment = contract.interface.getEvent(key, args);
|
||||
assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fragment"
|
||||
});
|
||||
return fragment;
|
||||
}
|
||||
getFragment(...args) {
|
||||
const fragment = this._contract.interface.getEvent(this._key, args);
|
||||
assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fragment"
|
||||
});
|
||||
return fragment;
|
||||
}
|
||||
};
|
||||
const method = async function (...args) {
|
||||
return new PreparedTopicFilter(contract, getFragment(...args), args);
|
||||
};
|
||||
defineProperties(method, {
|
||||
name: contract.interface.getEventName(key),
|
||||
_contract: contract, _key: key,
|
||||
getFragment
|
||||
});
|
||||
// Only works on non-ambiguous keys (refined fragment is always non-ambiguous)
|
||||
Object.defineProperty(method, "fragment", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
get: () => {
|
||||
const fragment = contract.interface.getEvent(key);
|
||||
assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
|
||||
operation: "fragment"
|
||||
});
|
||||
return fragment;
|
||||
}
|
||||
});
|
||||
return method;
|
||||
}
|
||||
;
|
||||
// The combination of TypeScrype, Private Fields and Proxies makes
|
||||
// the world go boom; so we hide variables with some trickery keeping
|
||||
// a symbol attached to each BaseContract which its sub-class (even
|
||||
@ -548,7 +610,7 @@ export class BaseContract {
|
||||
});
|
||||
defineProperties(this, { filters });
|
||||
defineProperties(this, {
|
||||
fallback: ((iface.receive || iface.fallback) ? (new WrappedFallback(this)) : null)
|
||||
fallback: ((iface.receive || iface.fallback) ? (buildWrappedFallback(this)) : null)
|
||||
});
|
||||
// Return a Proxy that will respond to functions
|
||||
return new Proxy(this, {
|
||||
@ -616,13 +678,14 @@ export class BaseContract {
|
||||
if (typeof (key) !== "string") {
|
||||
key = key.format();
|
||||
}
|
||||
return (new WrappedMethod(this, key));
|
||||
const func = buildWrappedMethod(this, key);
|
||||
return func;
|
||||
}
|
||||
getEvent(key) {
|
||||
if (typeof (key) !== "string") {
|
||||
key = key.format();
|
||||
}
|
||||
return (new WrappedEvent(this, key));
|
||||
return buildWrappedEvent(this, key);
|
||||
}
|
||||
async queryTransaction(hash) {
|
||||
// Is this useful?
|
||||
|
File diff suppressed because one or more lines are too long
@ -15,16 +15,16 @@ export class EventLog extends Log {
|
||||
get eventSignature() { return this.fragment.format(); }
|
||||
}
|
||||
export class ContractTransactionReceipt extends TransactionReceipt {
|
||||
#interface;
|
||||
#iface;
|
||||
constructor(iface, provider, tx) {
|
||||
super(tx, provider);
|
||||
this.#interface = iface;
|
||||
this.#iface = iface;
|
||||
}
|
||||
get logs() {
|
||||
return super.logs.map((log) => {
|
||||
const fragment = log.topics.length ? this.#interface.getEvent(log.topics[0]) : null;
|
||||
const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null;
|
||||
if (fragment) {
|
||||
return new EventLog(log, this.#interface, fragment);
|
||||
return new EventLog(log, this.#iface, fragment);
|
||||
}
|
||||
else {
|
||||
return log;
|
||||
@ -33,17 +33,17 @@ export class ContractTransactionReceipt extends TransactionReceipt {
|
||||
}
|
||||
}
|
||||
export class ContractTransactionResponse extends TransactionResponse {
|
||||
#interface;
|
||||
#iface;
|
||||
constructor(iface, provider, tx) {
|
||||
super(tx, provider);
|
||||
this.#interface = iface;
|
||||
this.#iface = iface;
|
||||
}
|
||||
async wait(confirms) {
|
||||
const receipt = await super.wait();
|
||||
if (receipt == null) {
|
||||
return null;
|
||||
}
|
||||
return new ContractTransactionReceipt(this.#interface, this.provider, receipt);
|
||||
return new ContractTransactionReceipt(this.#iface, this.provider, receipt);
|
||||
}
|
||||
}
|
||||
export class ContractUnknownEventPayload extends EventPayload {
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,yBAAyB;AACzB,OAAO,EACI,GAAG,EAAE,kBAAkB,EAAE,mBAAmB,EACtD,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAYnE,MAAM,OAAO,QAAS,SAAQ,GAAG;IACpB,SAAS,CAAa;IACtB,QAAQ,CAAiB;IACzB,IAAI,CAAU;IAEvB,YAAY,GAAQ,EAAE,KAAgB,EAAE,QAAuB;QAC3D,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAClE,gBAAgB,CAAW,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,SAAS,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACtD,IAAI,cAAc,KAAa,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CAClE;AAED,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IACrD,UAAU,CAAY;IAE/B,YAAY,KAAgB,EAAE,QAAkB,EAAE,EAAsB;QACpE,KAAK,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,KAAK,CAAC,IAAI,CAA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EAAE,QAAQ,CAAC,CAAC,CAAC;QACpF,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzF,gBAAgB,CAAuB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAClC,CAAC;CACJ"}
|
@ -38,7 +38,7 @@ export class Signature {
|
||||
*/
|
||||
get s() { return this.#s; }
|
||||
set s(_value) {
|
||||
assertArgument(dataLength(_value) === 32, "invalid r", "value", _value);
|
||||
assertArgument(dataLength(_value) === 32, "invalid s", "value", _value);
|
||||
const value = hexlify(_value);
|
||||
assertArgument(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value);
|
||||
this.#s = value;
|
||||
|
@ -152,10 +152,8 @@ export class SigningKey {
|
||||
const sig = Signature.from(signature);
|
||||
const der = secp256k1.Signature.fromCompact(getBytesCopy(concat([sig.r, sig.s]))).toDERRawBytes();
|
||||
const pubKey = secp256k1.recoverPublicKey(getBytesCopy(digest), der, sig.yParity);
|
||||
if (pubKey != null) {
|
||||
return hexlify(pubKey);
|
||||
}
|
||||
assertArgument(false, "invalid signautre for digest", "signature", signature);
|
||||
assertArgument(pubKey != null, "invalid signautre for digest", "signature", signature);
|
||||
return hexlify(pubKey);
|
||||
}
|
||||
/**
|
||||
* Returns the point resulting from adding the ellipic curve points
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"signing-key.js","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,SAAS,MAAM,kBAA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efix } from "./constants/index.js";
|
||||
export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, } from "./contract/index.js";
|
||||
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js";
|
||||
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder } from "./hash/index.js";
|
||||
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from "./hash/index.js";
|
||||
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js";
|
||||
export { accessListify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js";
|
||||
export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from "./utils/index.js";
|
||||
|
@ -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,mBAAmB,EAExC,QAAQ,EACR,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAEzI,iBAAiB,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,sBAAsB,EACvG,KAAK,GACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,iBAAiB,EACnC,aAAa,EAAE,SAAS,EAAE,cAAc,EAC3C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,WAAW,EACX,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAChD,QAAQ,EACR,WAAW,EAAE,aAAa,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,YAAY,EAAE,QAAQ,EACtB,eAAe,EACf,oBAAoB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,QAAQ,GACvH,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,MAAM,EAAE,MAAM,EACd,MAAM,EACN,MAAM,EAAE,UAAU,EAClB,IAAI,EACJ,SAAS,EAAE,UAAU,EACxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,EAAE,EACF,YAAY,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,CAAC;AAEhC,OAAO,EACH,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAC9D,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EACpE,gBAAgB,EAAE,iBAAiB,EACnC,MAAM,EAAE,cAAc,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAC3E,SAAS,EACT,eAAe,EAAE,OAAO,EACxB,YAAY,EACZ,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAC9C,WAAW,EACX,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EACjF,QAAQ,EAAE,MAAM,EAAE,IAAI,EACtB,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAChD,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAC3C,cAAc,EACd,SAAS,EAAE,SAAS,EACpB,MAAM,GACT,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACH,QAAQ,EACR,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAC1C,MAAM,EAEN,WAAW,EAEX,cAAc,EACd,eAAe,EAAE,cAAc,EAE/B,oBAAoB,EAAE,uBAAuB,EAAE,mBAAmB,EAClE,mBAAmB,EAAE,uBAAuB,GAC/C,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EACzD,MAAM,sBAAsB,CAAC"}
|
@ -7,5 +7,5 @@ export { id } from "./id.js";
|
||||
export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js";
|
||||
export { hashMessage, verifyMessage } from "./message.js";
|
||||
export { solidityPacked, solidityPackedKeccak256, solidityPackedSha256 } from "./solidity.js";
|
||||
export { TypedDataEncoder } from "./typed-data.js";
|
||||
export { TypedDataEncoder, verifyTypedData } from "./typed-data.js";
|
||||
//# sourceMappingURL=index.js.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACH,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAChE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACH,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAChE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|
@ -1,6 +1,7 @@
|
||||
//import { TypedDataDomain, TypedDataField } from "@ethersproject/providerabstract-signer";
|
||||
import { getAddress } from "../address/index.js";
|
||||
import { keccak256 } from "../crypto/index.js";
|
||||
import { recoverAddress } from "../transaction/index.js";
|
||||
import { concat, defineProperties, getBigInt, getBytes, hexlify, isHexString, mask, toBeHex, toTwos, zeroPadValue, assertArgument } from "../utils/index.js";
|
||||
import { id } from "./id.js";
|
||||
const padding = new Uint8Array(32);
|
||||
@ -393,4 +394,10 @@ export class TypedDataEncoder {
|
||||
};
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Compute the address used to sign the typed data for the %%signature%%.
|
||||
*/
|
||||
export function verifyTypedData(domain, types, value, signature) {
|
||||
return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature);
|
||||
}
|
||||
//# sourceMappingURL=typed-data.js.map
|
File diff suppressed because one or more lines are too long
@ -262,7 +262,7 @@ export class AbstractProvider {
|
||||
return new TransactionReceipt(formatTransactionReceipt(value), this);
|
||||
}
|
||||
_wrapTransactionResponse(tx, network) {
|
||||
return new TransactionResponse(tx, this);
|
||||
return new TransactionResponse(formatTransactionResponse(tx), this);
|
||||
}
|
||||
_detectNetwork() {
|
||||
assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", {
|
||||
@ -640,7 +640,7 @@ export class AbstractProvider {
|
||||
if (params == null) {
|
||||
return null;
|
||||
}
|
||||
return this._wrapBlock(formatBlock(params), network);
|
||||
return this._wrapBlock(params, network);
|
||||
}
|
||||
async getTransaction(hash) {
|
||||
const { network, params } = await resolveProperties({
|
||||
@ -650,7 +650,7 @@ export class AbstractProvider {
|
||||
if (params == null) {
|
||||
return null;
|
||||
}
|
||||
return this._wrapTransactionResponse(formatTransactionResponse(params), network);
|
||||
return this._wrapTransactionResponse(params, network);
|
||||
}
|
||||
async getTransactionReceipt(hash) {
|
||||
const { network, params } = await resolveProperties({
|
||||
@ -669,7 +669,7 @@ export class AbstractProvider {
|
||||
}
|
||||
params.effectiveGasPrice = tx.gasPrice;
|
||||
}
|
||||
return this._wrapTransactionReceipt(formatTransactionReceipt(params), network);
|
||||
return this._wrapTransactionReceipt(params, network);
|
||||
}
|
||||
async getTransactionResult(hash) {
|
||||
const { result } = await resolveProperties({
|
||||
@ -691,7 +691,7 @@ export class AbstractProvider {
|
||||
network: this.getNetwork(),
|
||||
params: this.#perform({ method: "getLogs", filter })
|
||||
});
|
||||
return params.map((p) => this._wrapLog(formatLog(p), network));
|
||||
return params.map((p) => this._wrapLog(p, network));
|
||||
}
|
||||
// ENS
|
||||
_getProvider(chainId) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -74,7 +74,7 @@ export class EnsResolver {
|
||||
*/
|
||||
address;
|
||||
/**
|
||||
* The name this resovler was resolved against.
|
||||
* The name this resolver was resolved against.
|
||||
*/
|
||||
name;
|
||||
// For EIP-2544 names, the ancestor that provided the resolver
|
||||
@ -203,7 +203,7 @@ export class EnsResolver {
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Resovles to the EIP-643 text record for %%key%%, or ``null``
|
||||
* Resolves to the EIP-643 text record for %%key%%, or ``null``
|
||||
* if unconfigured.
|
||||
*/
|
||||
async getText(key) {
|
||||
|
@ -51,7 +51,6 @@ export class IpcSocketProvider extends SocketProvider {
|
||||
super.destroy();
|
||||
}
|
||||
async _write(message) {
|
||||
console.log(">>>", message);
|
||||
this.socket.write(message);
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-ipcsocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAMtD,yEAAyE;AACzE,0CAA0C;AAC1C,SAAS,WAAW,CAAC,IAAY;IAC7B,MAAM,QAAQ,GAAkB,EAAG,CAAC;IAEpC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,OAAO,IAAI,EAAE;QACT,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE;YAAE,MAAM;SAAE;QACzB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9D,SAAS,GAAG,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,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,OAAO;QACH,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QAElB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QACxB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;CACJ"}
|
@ -535,25 +535,117 @@ export type ReplacementDetectionSetup = {
|
||||
};
|
||||
*/
|
||||
export class TransactionResponse {
|
||||
/**
|
||||
* The provider this is connected to, which will influence how its
|
||||
* methods will resolve its async inspection methods.
|
||||
*/
|
||||
provider;
|
||||
/**
|
||||
* The block number of the block that this transaction was included in.
|
||||
*
|
||||
* This is ``null`` for pending transactions.
|
||||
*/
|
||||
blockNumber;
|
||||
/**
|
||||
* The blockHash of the block that this transaction was included in.
|
||||
*
|
||||
* This is ``null`` for pending transactions.
|
||||
*/
|
||||
blockHash;
|
||||
/**
|
||||
* The index within the block that this transaction resides at.
|
||||
*/
|
||||
index;
|
||||
/**
|
||||
* The transaction hash.
|
||||
*/
|
||||
hash;
|
||||
/**
|
||||
* The [[link-eip-2718]] transaction envelope type. This is
|
||||
* ``0`` for legacy transactions types.
|
||||
*/
|
||||
type;
|
||||
/**
|
||||
* The receiver of this transaction.
|
||||
*
|
||||
* If ``null``, then the transaction is an initcode transaction.
|
||||
* This means the result of executing the [[data]] will be deployed
|
||||
* as a new contract on chain (assuming it does not revert) and the
|
||||
* address may be computed using [[getCreateAddress]].
|
||||
*/
|
||||
to;
|
||||
/**
|
||||
* The sender of this transaction. It is implicitly computed
|
||||
* from the transaction pre-image hash (as the digest) and the
|
||||
* [[signature]] using ecrecover.
|
||||
*/
|
||||
from;
|
||||
/**
|
||||
* The nonce, which is used to prevent replay attacks and offer
|
||||
* a method to ensure transactions from a given sender are explicitly
|
||||
* ordered.
|
||||
*
|
||||
* When sending a transaction, this must be equal to the number of
|
||||
* transactions ever sent by [[from]].
|
||||
*/
|
||||
nonce;
|
||||
/**
|
||||
* The maximum units of gas this transaction can consume. If execution
|
||||
* exceeds this, the entries transaction is reverted and the sender
|
||||
* is charged for the full amount, despite not state changes being made.
|
||||
*/
|
||||
gasLimit;
|
||||
/**
|
||||
* The gas price can have various values, depending on the network.
|
||||
*
|
||||
* In modern networks, for transactions that are included this is
|
||||
* the //effective gas price// (the fee per gas that was actually
|
||||
* charged), while for transactions that have not been included yet
|
||||
* is the [[maxFeePerGas]].
|
||||
*
|
||||
* For legacy transactions, or transactions on legacy networks, this
|
||||
* is the fee that will be charged per unit of gas the transaction
|
||||
* consumes.
|
||||
*/
|
||||
gasPrice;
|
||||
/**
|
||||
* The maximum priority fee (per unit of gas) to allow a
|
||||
* validator to charge the sender. This is inclusive of the
|
||||
* [[maxFeeFeePerGas]].
|
||||
*/
|
||||
maxPriorityFeePerGas;
|
||||
/**
|
||||
* The maximum fee (per unit of gas) to allow this transaction
|
||||
* to charge the sender.
|
||||
*/
|
||||
maxFeePerGas;
|
||||
/**
|
||||
* The data.
|
||||
*/
|
||||
data;
|
||||
/**
|
||||
* The value, in wei. Use [[formatEther]] to format this value
|
||||
* as ether.
|
||||
*/
|
||||
value;
|
||||
/**
|
||||
* The chain ID.
|
||||
*/
|
||||
chainId;
|
||||
/**
|
||||
* The signature.
|
||||
*/
|
||||
signature;
|
||||
/**
|
||||
* The [[link-eip-2930]] access list for transaction types that
|
||||
* support it, otherwise ``null``.
|
||||
*/
|
||||
accessList;
|
||||
#startBlock;
|
||||
/**
|
||||
* Create a new TransactionResponse with %%tx%% parameters
|
||||
* connected to %%provider%%.
|
||||
*/
|
||||
constructor(tx, provider) {
|
||||
this.provider = provider;
|
||||
this.blockNumber = (tx.blockNumber != null) ? tx.blockNumber : null;
|
||||
@ -575,6 +667,9 @@ export class TransactionResponse {
|
||||
this.accessList = (tx.accessList != null) ? tx.accessList : null;
|
||||
this.#startBlock = -1;
|
||||
}
|
||||
/**
|
||||
* Returns a JSON representation of this transaction.
|
||||
*/
|
||||
toJSON() {
|
||||
const { blockNumber, blockHash, index, hash, type, to, from, nonce, data, signature, accessList } = this;
|
||||
return {
|
||||
@ -591,6 +686,11 @@ export class TransactionResponse {
|
||||
value: toJson(this.value),
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Resolves to the Block that this transaction was included in.
|
||||
*
|
||||
* This will return null if the transaction has not been included yet.
|
||||
*/
|
||||
async getBlock() {
|
||||
let blockNumber = this.blockNumber;
|
||||
if (blockNumber == null) {
|
||||
@ -608,9 +708,23 @@ export class TransactionResponse {
|
||||
}
|
||||
return block;
|
||||
}
|
||||
/**
|
||||
* Resolves to this transaction being re-requested from the
|
||||
* provider. This can be used if you have an unmined transaction
|
||||
* and wish to get an up-to-date populated instance.
|
||||
*/
|
||||
async getTransaction() {
|
||||
return this.provider.getTransaction(this.hash);
|
||||
}
|
||||
/**
|
||||
* Resolves once this transaction has been mined and has
|
||||
* %%confirms%% blocks including it (default: ``1``) with an
|
||||
* optional %%timeout%%.
|
||||
*
|
||||
* This can resolve to ``null`` only if %%confirms%% is ``0``
|
||||
* and the transaction has not been mined, otherwise this will
|
||||
* wait until enough confirmations have completed.
|
||||
*/
|
||||
async wait(_confirms, _timeout) {
|
||||
const confirms = (_confirms == null) ? 1 : _confirms;
|
||||
const timeout = (_timeout == null) ? 0 : _timeout;
|
||||
@ -765,22 +879,62 @@ export class TransactionResponse {
|
||||
});
|
||||
return await waiter;
|
||||
}
|
||||
/**
|
||||
* Returns ``true`` if this transaction has been included.
|
||||
*
|
||||
* This is effective only as of the time the TransactionResponse
|
||||
* was instantiated. To get up-to-date information, use
|
||||
* [[getTransaction]].
|
||||
*
|
||||
* This provides a Type Guard that this transaction will have
|
||||
* non-null property values for properties that are null for
|
||||
* unmined transactions.
|
||||
*/
|
||||
isMined() {
|
||||
return (this.blockHash != null);
|
||||
}
|
||||
/**
|
||||
* Returns true if the transaction is a legacy (i.e. ``type == 0``)
|
||||
* transaction.
|
||||
*
|
||||
* This provides a Type Guard that this transaction will have
|
||||
* the ``null``-ness for hardfork-specific properties set correctly.
|
||||
*/
|
||||
isLegacy() {
|
||||
return (this.type === 0);
|
||||
}
|
||||
/**
|
||||
* Returns true if the transaction is a Berlin (i.e. ``type == 1``)
|
||||
* transaction. See [[link-eip-2070]].
|
||||
*
|
||||
* This provides a Type Guard that this transaction will have
|
||||
* the ``null``-ness for hardfork-specific properties set correctly.
|
||||
*/
|
||||
isBerlin() {
|
||||
return (this.type === 1);
|
||||
}
|
||||
/**
|
||||
* Returns true if the transaction is a London (i.e. ``type == 2``)
|
||||
* transaction. See [[link-eip-1559]].
|
||||
*
|
||||
* This provides a Type Guard that this transaction will have
|
||||
* the ``null``-ness for hardfork-specific properties set correctly.
|
||||
*/
|
||||
isLondon() {
|
||||
return (this.type === 2);
|
||||
}
|
||||
/**
|
||||
* Returns a filter which can be used to listen for orphan events
|
||||
* that evict this transaction.
|
||||
*/
|
||||
removedEvent() {
|
||||
assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" });
|
||||
return createRemovedTransactionFilter(this);
|
||||
}
|
||||
/**
|
||||
* Returns a filter which can be used to listen for orphan events
|
||||
* that re-order this event against %%other%%.
|
||||
*/
|
||||
reorderedEvent(other) {
|
||||
assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" });
|
||||
assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" });
|
||||
|
File diff suppressed because one or more lines are too long
@ -98,16 +98,16 @@ function _serializeLegacy(tx, sig) {
|
||||
(tx.data || "0x"),
|
||||
];
|
||||
let chainId = BN_0;
|
||||
if (tx.chainId != null) {
|
||||
if (tx.chainId != BN_0) {
|
||||
// A chainId was provided; if non-zero we'll use EIP-155
|
||||
chainId = getBigInt(tx.chainId, "tx.chainId");
|
||||
// We have a chainId in the tx and an EIP-155 v in the signature,
|
||||
// make sure they agree with each other
|
||||
assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId, "tx.chainId/sig.v mismatch", "sig", sig);
|
||||
}
|
||||
else if (sig) {
|
||||
// No chainId provided, but the signature is signing with EIP-155; derive chainId
|
||||
const legacy = sig.legacyChainId;
|
||||
else if (tx.signature) {
|
||||
// No explicit chainId, but EIP-155 have a derived implicit chainId
|
||||
const legacy = tx.signature.legacyChainId;
|
||||
if (legacy != null) {
|
||||
chainId = legacy;
|
||||
}
|
||||
@ -122,7 +122,10 @@ function _serializeLegacy(tx, sig) {
|
||||
}
|
||||
return encodeRlp(fields);
|
||||
}
|
||||
// We pushed a chainId and null r, s on for hashing only; remove those
|
||||
// @TODO: We should probably check that tx.signature, chainId, and sig
|
||||
// match but that logic could break existing code, so schedule
|
||||
// this for the next major bump.
|
||||
// Compute the EIP-155 v
|
||||
let v = BigInt(27 + sig.yParity);
|
||||
if (chainId !== BN_0) {
|
||||
v = Signature.getChainIdV(chainId, sig.v);
|
||||
@ -130,6 +133,7 @@ function _serializeLegacy(tx, sig) {
|
||||
else if (BigInt(sig.v) !== v) {
|
||||
assertArgument(false, "tx.chainId/sig.v mismatch", "sig", sig);
|
||||
}
|
||||
// Add the signature
|
||||
fields.push(toBeArray(v));
|
||||
fields.push(toBeArray(sig.r));
|
||||
fields.push(toBeArray(sig.s));
|
||||
|
File diff suppressed because one or more lines are too long
@ -351,7 +351,7 @@ export class FetchRequest {
|
||||
* Create a new FetchRequest instance with default values.
|
||||
*
|
||||
* Once created, each property may be set before issuing a
|
||||
* ``.send()`` to make teh request.
|
||||
* ``.send()`` to make the request.
|
||||
*/
|
||||
constructor(url) {
|
||||
this.#url = String(url);
|
||||
|
18
package-lock.json
generated
18
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "ethers",
|
||||
"version": "6.0.0",
|
||||
"version": "6.1.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ethers",
|
||||
"version": "6.0.0",
|
||||
"version": "6.1.0",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
@ -19,7 +19,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@adraffy/ens-normalize": "1.8.9",
|
||||
"@adraffy/ens-normalize": "1.9.0",
|
||||
"@noble/hashes": "1.1.2",
|
||||
"@noble/secp256k1": "1.7.1",
|
||||
"aes-js": "4.0.0-beta.3",
|
||||
@ -42,9 +42,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@adraffy/ens-normalize": {
|
||||
"version": "1.8.9",
|
||||
"resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.8.9.tgz",
|
||||
"integrity": "sha512-93OmGCV0vO8+JQ3FHG+gZk/MPHzzMPDRiCiFcCQNTCnHaaxsacO3ScTPGlu2wX2dOtgfalbchPcw1cOYYjHCYQ=="
|
||||
"version": "1.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.9.0.tgz",
|
||||
"integrity": "sha512-iowxq3U30sghZotgl4s/oJRci6WPBfNO5YYgk2cIOMCHr3LeGPcsZjCEr+33Q4N+oV3OABDAtA+pyvWjbvBifQ=="
|
||||
},
|
||||
"node_modules/@bcoe/v8-coverage": {
|
||||
"version": "0.2.3",
|
||||
@ -1575,9 +1575,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@adraffy/ens-normalize": {
|
||||
"version": "1.8.9",
|
||||
"resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.8.9.tgz",
|
||||
"integrity": "sha512-93OmGCV0vO8+JQ3FHG+gZk/MPHzzMPDRiCiFcCQNTCnHaaxsacO3ScTPGlu2wX2dOtgfalbchPcw1cOYYjHCYQ=="
|
||||
"version": "1.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.9.0.tgz",
|
||||
"integrity": "sha512-iowxq3U30sghZotgl4s/oJRci6WPBfNO5YYgk2cIOMCHr3LeGPcsZjCEr+33Q4N+oV3OABDAtA+pyvWjbvBifQ=="
|
||||
},
|
||||
"@bcoe/v8-coverage": {
|
||||
"version": "0.2.3",
|
||||
|
@ -9,7 +9,7 @@
|
||||
"./lib.esm/wordlists/wordlists.js": "./lib.esm/wordlists/wordlists-browser.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@adraffy/ens-normalize": "1.8.9",
|
||||
"@adraffy/ens-normalize": "1.9.0",
|
||||
"@noble/hashes": "1.1.2",
|
||||
"@noble/secp256k1": "1.7.1",
|
||||
"aes-js": "4.0.0-beta.3",
|
||||
@ -104,7 +104,7 @@
|
||||
"url": "https://www.buymeacoffee.com/ricmoo"
|
||||
}
|
||||
],
|
||||
"gitHead": "5f2678fb059d643638b9cc1dc59cbfc61ce7a7b8",
|
||||
"gitHead": "7d3af512c75b4c24027ec2daef1e9f4c1064194a",
|
||||
"homepage": "https://ethers.org",
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
@ -144,5 +144,5 @@
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"types": "./types/index.d.ts",
|
||||
"version": "6.1.0"
|
||||
"version": "6.2.0"
|
||||
}
|
||||
|
@ -3,4 +3,4 @@
|
||||
/**
|
||||
* The current version of Ethers.
|
||||
*/
|
||||
export const version: string = "6.1.0";
|
||||
export const version: string = "6.2.0";
|
||||
|
File diff suppressed because one or more lines are too long
12
types/contract/contract.d.ts
vendored
12
types/contract/contract.d.ts
vendored
@ -4,8 +4,8 @@ import { ContractTransactionResponse, EventLog } from "./wrappers.js";
|
||||
import type { EventFragment, FunctionFragment, InterfaceAbi, ParamType } from "../abi/index.js";
|
||||
import type { Addressable } from "../address/index.js";
|
||||
import type { EventEmitterable, Listener } from "../utils/index.js";
|
||||
import type { BlockTag, ContractRunner, TransactionRequest } from "../providers/index.js";
|
||||
import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction } from "./types.js";
|
||||
import type { BlockTag, ContractRunner } from "../providers/index.js";
|
||||
import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction, WrappedFallback } from "./types.js";
|
||||
/**
|
||||
* @_ignore:
|
||||
*/
|
||||
@ -14,14 +14,6 @@ export declare function copyOverrides<O extends string = "data" | "to">(arg: any
|
||||
* @_ignore:
|
||||
*/
|
||||
export declare function resolveArgs(_runner: null | ContractRunner, inputs: ReadonlyArray<ParamType>, args: Array<any>): Promise<Array<any>>;
|
||||
declare class WrappedFallback {
|
||||
readonly _contract: BaseContract;
|
||||
constructor(contract: BaseContract);
|
||||
populateTransaction(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransaction>;
|
||||
staticCall(overrides?: Omit<TransactionRequest, "to">): Promise<string>;
|
||||
send(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse>;
|
||||
estimateGas(overrides?: Omit<TransactionRequest, "to">): Promise<bigint>;
|
||||
}
|
||||
declare const internal: unique symbol;
|
||||
export declare class BaseContract implements Addressable, EventEmitterable<ContractEventName> {
|
||||
readonly target: string | Addressable;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAInD,OAAO,EAAe,GAAG,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAMjF,OAAO,EAEH,2BAA2B,EAC3B,QAAQ,EACX,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAU,MAAM,iBAAiB,CAAC;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KA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AAI,GAAG,cAAc,GAAG,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;CAKpJ;;AAMD,qBAAa,QAAS,SAAQ,aAAe;CAAI"}
|
2
types/contract/index.d.ts
vendored
2
types/contract/index.d.ts
vendored
@ -6,5 +6,5 @@
|
||||
export { BaseContract, Contract } from "./contract.js";
|
||||
export { ContractFactory } from "./factory.js";
|
||||
export { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, } from "./wrappers.js";
|
||||
export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides } from "./types.js";
|
||||
export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, WrappedFallback } from "./types.js";
|
||||
//# sourceMappingURL=index.d.ts.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACH,YAAY,EAAE,QAAQ,EACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,eAAe,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACH,oBAAoB,EAAE,2BAA2B,EACjD,0BAA0B,EAAE,2BAA2B,EACvD,QAAQ,GACX,MAAM,eAAe,CAAC;AAEvB,YAAY,EACR,kBAAkB,EAAE,sBAAsB,EAC1C,gBAAgB,EAChB,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,EACnD,yBAAyB,EACzB,iBAAiB,EAAE,cAAc,EAAE,kBAAkB,EAAE,mBAAmB,EAC1E,mBAAmB,EAAE,SAAS,EACjC,MAAM,YAAY,CAAC"}
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACH,YAAY,EAAE,QAAQ,EACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,eAAe,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACH,oBAAoB,EAAE,2BAA2B,EACjD,0BAA0B,EAAE,2BAA2B,EACvD,QAAQ,GACX,MAAM,eAAe,CAAC;AAEvB,YAAY,EACR,kBAAkB,EAAE,sBAAsB,EAC1C,gBAAgB,EAChB,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,EACnD,yBAAyB,EACzB,iBAAiB,EAAE,cAAc,EAAE,kBAAkB,EAAE,mBAAmB,EAC1E,mBAAmB,EAAE,SAAS,EAC9B,eAAe,EAClB,MAAM,YAAY,CAAC"}
|
7
types/contract/types.d.ts
vendored
7
types/contract/types.d.ts
vendored
@ -46,4 +46,11 @@ export interface ContractEvent<A extends Array<any> = Array<any>> {
|
||||
fragment: EventFragment;
|
||||
getFragment(...args: ContractEventArgs<A>): EventFragment;
|
||||
}
|
||||
export interface WrappedFallback {
|
||||
(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse>;
|
||||
populateTransaction(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransaction>;
|
||||
staticCall(overrides?: Omit<TransactionRequest, "to">): Promise<string>;
|
||||
send(overrides?: Omit<TransactionRequest, "to">): Promise<ContractTransactionResponse>;
|
||||
estimateGas(overrides?: Omit<TransactionRequest, "to">): Promise<bigint>;
|
||||
}
|
||||
//# sourceMappingURL=types.d.ts.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/contract/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EACjD,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACR,kBAAkB,EAAE,0BAA0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C,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC9F,UAAU,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACvF,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5E"}
|
4
types/ethers.d.ts
vendored
4
types/ethers.d.ts
vendored
@ -4,7 +4,7 @@ export { getAddress, getIcapAddress, getCreateAddress, getCreate2Address, isAddr
|
||||
export { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, EtherSymbol, MessagePrefix } from "./constants/index.js";
|
||||
export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, } from "./contract/index.js";
|
||||
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js";
|
||||
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder } from "./hash/index.js";
|
||||
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from "./hash/index.js";
|
||||
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from "./providers/index.js";
|
||||
export { accessListify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js";
|
||||
export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from "./utils/index.js";
|
||||
@ -12,7 +12,7 @@ export { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPa
|
||||
export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists } from "./wordlists/index.js";
|
||||
export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, InterfaceAbi, ParamTypeWalkFunc, ParamTypeWalkAsyncFunc } from "./abi/index.js";
|
||||
export type { Addressable, AddressLike, NameResolver } from "./address/index.js";
|
||||
export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides } from "./contract/index.js";
|
||||
export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides, WrappedFallback } from "./contract/index.js";
|
||||
export type { ProgressCallback, SignatureLike } from "./crypto/index.js";
|
||||
export type { TypedDataDomain, TypedDataField } from "./hash/index.js";
|
||||
export type { Provider, Signer, AbstractProviderPlugin, BlockParams, BlockTag, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, EventFilter, Filter, FilterByBlockHash, GasCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike } from "./providers/index.js";
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"ethers.d.ts","sourceRoot":"","sources":["../src.ts/ethers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EACH,mBAAmB,EAAE,mBAAmB,EAExC,QAAQ,EACR,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAEzI,iBAAiB,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,sBAAsB,EACvG,KAAK,GACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,iBAAiB,EACnC,aAAa,EAAE,SAAS,EAAE,cAAc,EAC3C,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,WAAW,EACX,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAChD,QAAQ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E,wBAAwB,EAC7C,gBAAgB,EAAE,QAAQ,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACR,gBAAgB,EAAE,eAAe,EAAE,cAAc,EACpD,MAAM,mBAAmB,CAAC"}
|
2
types/hash/index.d.ts
vendored
2
types/hash/index.d.ts
vendored
@ -7,6 +7,6 @@ export { id } from "./id.js";
|
||||
export { ensNormalize, isValidName, namehash, dnsEncode } from "./namehash.js";
|
||||
export { hashMessage, verifyMessage } from "./message.js";
|
||||
export { solidityPacked, solidityPackedKeccak256, solidityPackedSha256 } from "./solidity.js";
|
||||
export { TypedDataEncoder } from "./typed-data.js";
|
||||
export { TypedDataEncoder, verifyTypedData } from "./typed-data.js";
|
||||
export type { TypedDataDomain, TypedDataField } from "./typed-data.js";
|
||||
//# sourceMappingURL=index.d.ts.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACH,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAChE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACH,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAChE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEpE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
5
types/hash/typed-data.d.ts
vendored
5
types/hash/typed-data.d.ts
vendored
@ -1,3 +1,4 @@
|
||||
import type { SignatureLike } from "../crypto/index.js";
|
||||
import type { BigNumberish, BytesLike } from "../utils/index.js";
|
||||
export interface TypedDataDomain {
|
||||
name?: null | string;
|
||||
@ -35,4 +36,8 @@ export declare class TypedDataEncoder {
|
||||
}>;
|
||||
static getPayload(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): any;
|
||||
}
|
||||
/**
|
||||
* Compute the address used to sign the typed data for the %%signature%%.
|
||||
*/
|
||||
export declare function verifyTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>, signature: SignatureLike): string;
|
||||
//# sourceMappingURL=typed-data.d.ts.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"typed-data.d.ts","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWjE,MAAM,WAAW,eAAe;IAC5B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAC9B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC3B,IAAI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