admin: update dist files
This commit is contained in:
parent
f8cd9c9eaf
commit
67d2af809e
545
dist/ethers.js
vendored
545
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
2
dist/wordlists-extra.js
vendored
2
dist/wordlists-extra.js
vendored
@ -145,7 +145,7 @@ const u64 = {
|
||||
add, add3L, add3H, add4L, add4H, add5H, add5L,
|
||||
};
|
||||
|
||||
const version = "6.0.0-beta-exports.14";
|
||||
const version = "6.0.0-beta-exports.15";
|
||||
|
||||
/**
|
||||
* 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
@ -10,9 +10,7 @@ const utils_js_1 = require("./utils.js");
|
||||
describe("Tests Namehash", function () {
|
||||
const tests = (0, utils_js_1.loadTests)("namehash");
|
||||
for (const test of tests) {
|
||||
if (test.error) {
|
||||
}
|
||||
else {
|
||||
if (!test.error) {
|
||||
it(`hashes ENS name: ${JSON.stringify(test.name)}`, function () {
|
||||
const actual = (0, index_js_1.namehash)(test.ensName);
|
||||
assert_1.default.equal(actual, test.namehash, "namehash");
|
||||
@ -23,6 +21,23 @@ describe("Tests Namehash", function () {
|
||||
});
|
||||
}
|
||||
}
|
||||
for (const test of tests) {
|
||||
if (test.error) {
|
||||
it(`correctly fails to hash ENS name: ${test.error} ${JSON.stringify(test.name)}`, function () {
|
||||
assert_1.default.throws(function () {
|
||||
const actual = (0, index_js_1.namehash)(test.ensName);
|
||||
console.log("Failed to throw", actual);
|
||||
}, (error) => {
|
||||
return ((0, index_js_1.isError)(error, "INVALID_ARGUMENT") &&
|
||||
error.argument === "name" && error.value === test.ensName);
|
||||
});
|
||||
// The empty string is not a valid ENS name
|
||||
if (test.ensName) {
|
||||
assert_1.default.ok(!(0, index_js_1.isValidName)(test.ensName), "!isValidName");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
/*
|
||||
describe("Tests Bad ENS Names", function() {
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"test-hash.js","sourceRoot":"","sources":["../../src.ts/_tests/test-hash.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,0CAKqB;AAErB,yCAAsC;AAKtC,iEAAiE;AAEjE,QAAQ,CAAC,gBAAgB,EAAE;IACvB,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAmB,UAAU,CAAC,CAAC;IACtD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,IAAI,IAAI,CAAC,KAAK,EAAE;SACf;aAAM;YACH,EAAE,CAAC,oBAAqB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAE,EAAE,EAAE;gBAClD,MAAM,MAAM,GAAG,IAAA,mBAAQ,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAEtC,gBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;gBAEhD,2CAA2C;gBAC3C,IAAI,IAAI,CAAC,OAAO,EAAE;oBACd,gBAAM,CAAC,EAAE,CAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC;iBACvD;YACL,CAAC,CAAC,CAAC;SACN;KACJ;AACL,CAAC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuFE;AAEF,QAAQ,CAAC,oCAAoC,EAAE;IAC3C,MAAM,KAAK,GAAG;QACV;YACI,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,aAAa;YACtB,IAAI,EAAE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AE,CAAE,OAAO,CAAE,EAAE,MAAM,EAAE,CAAE,CAAC,CAAE,EAAE;QACrC,EAAE,KAAK,EAAE,CAAE,QAAQ,CAAE,EAAE,MAAM,EAAE,CAAE,IAAI,CAAE,EAAE;QACzC,EAAE,KAAK,EAAE,CAAE,OAAO,CAAE,EAAE,MAAM,EAAE,CAAE,KAAK,CAAE,EAAE;KAC5C,CAAC;IAEF,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,QAAQ,EAAE;QACtC,EAAE,CAAC,iCAAiC,EAAE;YAClC,gBAAM,CAAC,MAAM,CAAC;gBACV,MAAM,MAAM,GAAG,IAAA,yBAAc,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACxB,CAAC,EAAE,UAAU,KAAK;gBACd,OAAO,CAAC,IAAA,kBAAO,EAAC,KAAK,EAAE,kBAAkB,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC;YAC7E,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;KACN;AACL,CAAC,CAAC,CAAC"}
|
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = "6.0.0-beta-exports.14";
|
||||
exports.version = "6.0.0-beta-exports.15";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -3,9 +3,9 @@
|
||||
//
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.lock = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.randomBytes = exports.computeHmac = exports.EventLog = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.MessagePrefix = exports.EtherSymbol = exports.ZeroHash = exports.N = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.ZeroAddress = exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreate2Address = exports.getCreateAddress = exports.getIcapAddress = exports.getAddress = exports.Typed = exports.TransactionDescription = exports.Result = exports.LogDescription = exports.Interface = exports.Indexed = exports.checkResultErrors = exports.ParamType = exports.FunctionFragment = exports.Fragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.AbiCoder = exports.encodeBytes32String = exports.decodeBytes32String = exports.version = void 0;
|
||||
exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.Network = exports.EnsResolver = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = 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.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.id = exports.SigningKey = exports.Signature = void 0;
|
||||
exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = exports.toNumber = exports.toBeHex = exports.toBigInt = exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = void 0;
|
||||
exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = void 0;
|
||||
exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.Network = exports.EnsResolver = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = 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.AbstractSigner = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.getDefaultProvider = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = exports.SigningKey = exports.Signature = void 0;
|
||||
exports.isKeystoreJson = exports.isCrowdsaleJson = exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeVoidWallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = exports.toNumber = exports.toBeHex = exports.toBigInt = exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = void 0;
|
||||
exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = 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");
|
||||
@ -66,6 +66,7 @@ Object.defineProperty(exports, "Signature", { enumerable: true, get: function ()
|
||||
Object.defineProperty(exports, "SigningKey", { enumerable: true, get: function () { return index_js_5.SigningKey; } });
|
||||
var index_js_6 = require("./hash/index.js");
|
||||
Object.defineProperty(exports, "id", { enumerable: true, get: function () { return index_js_6.id; } });
|
||||
Object.defineProperty(exports, "ensNormalize", { enumerable: true, get: function () { return index_js_6.ensNormalize; } });
|
||||
Object.defineProperty(exports, "isValidName", { enumerable: true, get: function () { return index_js_6.isValidName; } });
|
||||
Object.defineProperty(exports, "namehash", { enumerable: true, get: function () { return index_js_6.namehash; } });
|
||||
Object.defineProperty(exports, "dnsEncode", { enumerable: true, get: function () { return index_js_6.dnsEncode; } });
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"ethers.js","sourceRoot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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"}
|
@ -5,10 +5,11 @@
|
||||
* @_section: api/hashing:Hashing Utilities [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.id = void 0;
|
||||
exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPackedKeccak256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = exports.id = void 0;
|
||||
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");
|
||||
Object.defineProperty(exports, "ensNormalize", { enumerable: true, get: function () { return namehash_js_1.ensNormalize; } });
|
||||
Object.defineProperty(exports, "isValidName", { enumerable: true, get: function () { return namehash_js_1.isValidName; } });
|
||||
Object.defineProperty(exports, "namehash", { enumerable: true, get: function () { return namehash_js_1.namehash; } });
|
||||
Object.defineProperty(exports, "dnsEncode", { enumerable: true, get: function () { return namehash_js_1.dnsEncode; } });
|
||||
|
@ -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,6CAAiE;AAAxD,0GAAA,WAAW,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAAE,wGAAA,SAAS,OAAA;AACzC,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,iDAAmD;AAA1C,iHAAA,gBAAgB,OAAA"}
|
@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.dnsEncode = exports.namehash = exports.isValidName = exports.ensNormalize = void 0;
|
||||
const index_js_1 = require("../crypto/index.js");
|
||||
const index_js_2 = require("../utils/index.js");
|
||||
const ens_normalize_1 = require("@adraffy/ens-normalize");
|
||||
const xnf_1 = require("@adraffy/ens-normalize/xnf");
|
||||
const Zeros = new Uint8Array(32);
|
||||
Zeros.fill(0);
|
||||
function checkComponent(comp) {
|
||||
@ -11,7 +11,7 @@ function checkComponent(comp) {
|
||||
return comp;
|
||||
}
|
||||
function ensNameSplit(name) {
|
||||
const bytes = (0, index_js_2.toUtf8Bytes)((0, ens_normalize_1.ens_normalize)(name));
|
||||
const bytes = (0, index_js_2.toUtf8Bytes)(ensNormalize(name));
|
||||
const comps = [];
|
||||
if (name.length === 0) {
|
||||
return comps;
|
||||
@ -30,10 +30,21 @@ function ensNameSplit(name) {
|
||||
comps.push(checkComponent(bytes.slice(last)));
|
||||
return comps;
|
||||
}
|
||||
/**
|
||||
* Returns the ENS %%name%% normalized.
|
||||
*/
|
||||
function ensNormalize(name) {
|
||||
return ensNameSplit(name).map((comp) => (0, index_js_2.toUtf8String)(comp)).join(".");
|
||||
try {
|
||||
return (0, xnf_1.ens_normalize)(name);
|
||||
}
|
||||
catch (error) {
|
||||
(0, index_js_2.assertArgument)(false, `invalid ENS name (${error.message})`, "name", name);
|
||||
}
|
||||
}
|
||||
exports.ensNormalize = ensNormalize;
|
||||
/**
|
||||
* Returns ``true`` if %%name%% is a valid ENS name.
|
||||
*/
|
||||
function isValidName(name) {
|
||||
try {
|
||||
return (ensNameSplit(name).length !== 0);
|
||||
@ -42,6 +53,9 @@ function isValidName(name) {
|
||||
return false;
|
||||
}
|
||||
exports.isValidName = isValidName;
|
||||
/**
|
||||
* Returns the [[link-namehash]] for %%name%%.
|
||||
*/
|
||||
function namehash(name) {
|
||||
(0, index_js_2.assertArgument)(typeof (name) === "string", "invalid ENS name; not a string", "name", name);
|
||||
let result = Zeros;
|
||||
@ -52,6 +66,12 @@ function namehash(name) {
|
||||
return (0, index_js_2.hexlify)(result);
|
||||
}
|
||||
exports.namehash = namehash;
|
||||
/**
|
||||
* Returns the DNS encoded %%name%%.
|
||||
*
|
||||
* This is used for various parts of ENS name resolution, such
|
||||
* as the wildcard resolution.
|
||||
*/
|
||||
function dnsEncode(name) {
|
||||
return (0, index_js_2.hexlify)((0, index_js_2.concat)(ensNameSplit(name).map((comp) => {
|
||||
// DNS does not allow components over 63 bytes in length
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"namehash.js","sourceRoot":"","sources":["../../src.ts/hash/namehash.ts"],"names":[],"mappings":";;;AACA,iDAA+C;AAC/C,gDAE2B;AAG3B,0DAAuD;AAEvD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACjC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEd,SAAS,cAAc,CAAC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C,IAAA,iBAAM,EAAC,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAClD,wDAAwD;QACxD,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE,EAAE;YAClB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;SACzE;QAED,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC9C,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACnB,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC;IAEjB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;AAChB,CAAC;AAbD,8BAaC"}
|
@ -1114,13 +1114,13 @@ function parseOffchainLookup(data) {
|
||||
const result = {
|
||||
sender: "", urls: [], calldata: "", selector: "", extraData: "", errorArgs: []
|
||||
};
|
||||
if ((0, index_js_3.dataLength)(data) < 5 * 32) {
|
||||
throw new Error("insufficient OffchainLookup data");
|
||||
}
|
||||
(0, index_js_3.assert)((0, index_js_3.dataLength)(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", {
|
||||
reason: "insufficient OffchainLookup data"
|
||||
});
|
||||
const sender = (0, index_js_3.dataSlice)(data, 0, 32);
|
||||
if ((0, index_js_3.dataSlice)(sender, 0, 12) !== (0, index_js_3.dataSlice)(zeros, 0, 12)) {
|
||||
throw new Error("corrupt OffchainLookup sender");
|
||||
}
|
||||
(0, index_js_3.assert)((0, index_js_3.dataSlice)(sender, 0, 12) === (0, index_js_3.dataSlice)(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", {
|
||||
reason: "corrupt OffchainLookup sender"
|
||||
});
|
||||
result.sender = (0, index_js_3.dataSlice)(sender, 12);
|
||||
// Read the URLs from the response
|
||||
try {
|
||||
@ -1138,7 +1138,9 @@ function parseOffchainLookup(data) {
|
||||
result.urls = urls;
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error("corrupt OffchainLookup urls");
|
||||
(0, index_js_3.assert)(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", {
|
||||
reason: "corrupt OffchainLookup urls"
|
||||
});
|
||||
}
|
||||
// Get the CCIP calldata to forward
|
||||
try {
|
||||
@ -1149,12 +1151,14 @@ function parseOffchainLookup(data) {
|
||||
result.calldata = calldata;
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error("corrupt OffchainLookup calldata");
|
||||
(0, index_js_3.assert)(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", {
|
||||
reason: "corrupt OffchainLookup calldata"
|
||||
});
|
||||
}
|
||||
// Get the callbackSelector (bytes4)
|
||||
if ((0, index_js_3.dataSlice)(data, 100, 128) !== (0, index_js_3.dataSlice)(zeros, 0, 28)) {
|
||||
throw new Error("corrupt OffchainLookup callbaackSelector");
|
||||
}
|
||||
(0, index_js_3.assert)((0, index_js_3.dataSlice)(data, 100, 128) === (0, index_js_3.dataSlice)(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", {
|
||||
reason: "corrupt OffchainLookup callbaackSelector"
|
||||
});
|
||||
result.selector = (0, index_js_3.dataSlice)(data, 96, 100);
|
||||
// Get the extra data to send back to the contract as context
|
||||
try {
|
||||
@ -1165,7 +1169,9 @@ function parseOffchainLookup(data) {
|
||||
result.extraData = extraData;
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error("corrupt OffchainLookup extraData");
|
||||
(0, index_js_3.assert)(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", {
|
||||
reason: "corrupt OffchainLookup extraData"
|
||||
});
|
||||
}
|
||||
result.errorArgs = "sender,urls,calldata,selector,extraData".split(/,/).map((k) => result[k]);
|
||||
return result;
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AlchemyProvider = void 0;
|
||||
/**
|
||||
* About Alchemy
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]
|
||||
*/
|
||||
const index_js_1 = require("../utils/index.js");
|
||||
const community_js_1 = require("./community.js");
|
||||
const network_js_1 = require("./network.js");
|
||||
@ -28,7 +33,13 @@ function getHost(name) {
|
||||
(0, index_js_1.assertArgument)(false, "unsupported network", "network", name);
|
||||
}
|
||||
/**
|
||||
* The AlchemyProvider is backed by the [[alchemyapu]] API.
|
||||
* The **AlchemyProvider** connects to the [[link-alchemy]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* By default, a highly-throttled API key is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-alchemy-signup).
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty
|
||||
*/
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-alchemy.js","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":";;;AACA,gDAG2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAOxD,MAAM,aAAa,GAAG,kCAAkC,CAAA;AAExD,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,2BAA2B,CAAC;QACvC,KAAK,QAAQ;YACT,OAAO,0BAA0B,CAAC;QAEtC,KAAK,UAAU;YACX,OAAO,2BAA2B,CAAC;QACvC,KAAK,iBAAiB;YAClB,OAAO,0BAA0B,CAAC;QACtC,KAAK,OAAO;YACR,OAAO,+BAA+B,CAAC;QAC3C,KAAK,UAAU;YACX,OAAO,8BAA8B,CAAC;QAC1C,KAAK,UAAU;YACX,OAAO,2BAA2B,CAAC;QACvC,KAAK,iBAAiB;YAClB,OAAO,0BAA0B,CAAC;KACzC;IAED,I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* [[link-ankr]] provides a third-party service for connecting to
|
||||
* various blockchains over JSON-RPC.
|
||||
*
|
||||
* **Supported Networks**
|
||||
*
|
||||
* - Ethereum Mainnet (``mainnet``)
|
||||
* - Goerli Testnet (``goerli``)
|
||||
* - Polygon (``matic``)
|
||||
* - Arbitrum (``arbitrum``)
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:Ankr [providers-ankr]
|
||||
*/
|
||||
const index_js_1 = require("../utils/index.js");
|
||||
const community_js_1 = require("./community.js");
|
||||
const network_js_1 = require("./network.js");
|
||||
@ -20,12 +33,25 @@ function getHost(name) {
|
||||
(0, index_js_1.assertArgument)(false, "unsupported network", "network", name);
|
||||
}
|
||||
/**
|
||||
* About Ankr...
|
||||
* The **AnkrProvider** connects to the [[link-ankr]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty
|
||||
* By default, a highly-throttled API key is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-ankr-signup).
|
||||
*/
|
||||
class AnkrProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
|
||||
/**
|
||||
* The API key for the Ankr connection.
|
||||
*/
|
||||
apiKey;
|
||||
/**
|
||||
* Create a new **AnkrProvider**.
|
||||
*
|
||||
* By default connecting to ``mainnet`` with a highly throttled
|
||||
* API key.
|
||||
*/
|
||||
constructor(_network, apiKey) {
|
||||
if (_network == null) {
|
||||
_network = "mainnet";
|
||||
@ -47,6 +73,10 @@ class AnkrProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
|
||||
catch (error) { }
|
||||
return super._getProvider(chainId);
|
||||
}
|
||||
/**
|
||||
* Returns a prepared request for connecting to %%network%% with
|
||||
* %%apiKey%%.
|
||||
*/
|
||||
static getRequest(network, apiKey) {
|
||||
if (apiKey == null) {
|
||||
apiKey = defaultApiKey;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-ankr.js","s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O,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,MAAsB;QACtD,IAAI,MAAM,IAAI,IAAI,EAAE;YAAE,MAAM,GAAG,aAAa,CAAC;SAAE;QAE/C,MAAM,OAAO,GAAG,IAAI,uBAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,IAAK,MAAO,EAAE,CAAC,CAAC;QACpF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,MAAM,KAAK,aAAa,EAAE;YAC1B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,IAAA,kCAAmB,EAAC,cAAc,CAAC,CAAC;gBACpC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,WAAW,CAAC,OAAuB,EAAE,KAAmB;QACpD,IAAI,OAAO,CAAC,MAAM,KAAK,wBAAwB,EAAE;YAC7C,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,+CAA+C,EAAE;gBACjG,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,qCAAqC,CAAC;aAC/D;SACJ;QAED,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC;IAC3C,CAAC;CACJ;AAnED,oCAmEC"}
|
@ -1,13 +1,16 @@
|
||||
"use strict";
|
||||
/**
|
||||
* About Cloudflare
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CloudflareProvider = void 0;
|
||||
const index_js_1 = require("../utils/index.js");
|
||||
const network_js_1 = require("./network.js");
|
||||
const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js");
|
||||
/**
|
||||
* Aboud Cloudflare...
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty
|
||||
* About Cloudflare...
|
||||
*/
|
||||
class CloudflareProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
|
||||
constructor(_network) {
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":";;;AAAA,gDAAmD;AAEnD,6CAAuC;AACvC,+DAAwD;AAIxD;;;;GAIG;AACH,MAAa,kBAAmB,SAAQ,qCAAe;IACnD,YAAY,QAAqB;QAC7B,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,SAAS,CAAC;SAAE;QAC/C,MAAM,OAAO,GAAG,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAA,yBAAc,EAAC,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QACvF,KAAK,CAAC,8BAA8B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ;AAPD,gDAOC"}
|
||||
{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,gDAAmD;AAEnD,6CAAuC;AACvC,+DAAwD;AAIxD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,qCAAe;IACnD,YAAY,QAAqB;QAC7B,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,SAAS,CAAC;SAAE;QAC/C,MAAM,OAAO,GAAG,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAA,yBAAc,EAAC,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QACvF,KAAK,CAAC,8BAA8B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ;AAPD,gDAOC"}
|
@ -11,44 +11,69 @@ const community_js_1 = require("./community.js");
|
||||
const THROTTLE = 2000;
|
||||
const EtherscanPluginId = "org.ethers.plugins.Etherscan";
|
||||
/**
|
||||
* Aboud Cloudflare...
|
||||
* A Network can include an **EtherscanPlugin** to provide
|
||||
* a custom base URL.
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty:Etherscan
|
||||
*/
|
||||
class EtherscanPlugin extends plugins_network_js_1.NetworkPlugin {
|
||||
/**
|
||||
* The Etherscan API base URL.
|
||||
*/
|
||||
baseUrl;
|
||||
communityApiKey;
|
||||
constructor(baseUrl, communityApiKey) {
|
||||
/**
|
||||
* Creates a new **EtherscanProvider** which will use
|
||||
* %%baseUrl%%.
|
||||
*/
|
||||
constructor(baseUrl) {
|
||||
super(EtherscanPluginId);
|
||||
//if (communityApiKey == null) { communityApiKey = null; }
|
||||
(0, index_js_3.defineProperties)(this, { baseUrl, communityApiKey });
|
||||
(0, index_js_3.defineProperties)(this, { baseUrl });
|
||||
}
|
||||
clone() {
|
||||
return new EtherscanPlugin(this.baseUrl, this.communityApiKey);
|
||||
return new EtherscanPlugin(this.baseUrl);
|
||||
}
|
||||
}
|
||||
exports.EtherscanPlugin = EtherscanPlugin;
|
||||
let nextId = 1;
|
||||
/**
|
||||
* Aboud Etherscan...
|
||||
* The **EtherscanBaseProvider** is the super-class of
|
||||
* [[EtherscanProvider]], which should generally be used instead.
|
||||
*
|
||||
* Since the **EtherscanProvider** includes additional code for
|
||||
* [[Contract]] access, in //rare cases// that contracts are not
|
||||
* used, this class can reduce code size.
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty:Etherscan
|
||||
*/
|
||||
class BaseEtherscanProvider extends abstract_provider_js_1.AbstractProvider {
|
||||
/**
|
||||
* The connected network.
|
||||
*/
|
||||
network;
|
||||
/**
|
||||
* The API key or null if using the community provided bandwidth.
|
||||
*/
|
||||
apiKey;
|
||||
#plugin;
|
||||
constructor(_network, apiKey) {
|
||||
/**
|
||||
* Creates a new **EtherscanBaseProvider**.
|
||||
*/
|
||||
constructor(_network, _apiKey) {
|
||||
const apiKey = (_apiKey != null) ? _apiKey : null;
|
||||
super();
|
||||
const network = network_js_1.Network.from(_network);
|
||||
this.#plugin = network.getPlugin(EtherscanPluginId);
|
||||
if (apiKey == null && this.#plugin) {
|
||||
apiKey = this.#plugin.communityApiKey;
|
||||
}
|
||||
(0, index_js_3.defineProperties)(this, { apiKey, network });
|
||||
// Test that the network is supported by Etherscan
|
||||
this.getBaseUrl();
|
||||
}
|
||||
/**
|
||||
* Returns the base URL.
|
||||
*
|
||||
* If an [[EtherscanPlugin]] is configured on the
|
||||
* [[EtherscanBaseProvider_network]], returns the plugin's
|
||||
* baseUrl.
|
||||
*/
|
||||
getBaseUrl() {
|
||||
if (this.#plugin) {
|
||||
return this.#plugin.baseUrl;
|
||||
@ -76,6 +101,9 @@ class BaseEtherscanProvider extends abstract_provider_js_1.AbstractProvider {
|
||||
}
|
||||
(0, index_js_3.assertArgument)(false, "unsupported network", "network", this.network);
|
||||
}
|
||||
/**
|
||||
* Returns the URL for the %%module%% and %%params%%.
|
||||
*/
|
||||
getUrl(module, params) {
|
||||
const query = Object.keys(params).reduce((accum, key) => {
|
||||
const value = params[key];
|
||||
@ -87,9 +115,15 @@ class BaseEtherscanProvider extends abstract_provider_js_1.AbstractProvider {
|
||||
const apiKey = ((this.apiKey) ? `&apikey=${this.apiKey}` : "");
|
||||
return `${this.getBaseUrl()}/api?module=${module}${query}${apiKey}`;
|
||||
}
|
||||
/**
|
||||
* Returns the URL for using POST requests.
|
||||
*/
|
||||
getPostUrl() {
|
||||
return `${this.getBaseUrl()}/api`;
|
||||
}
|
||||
/**
|
||||
* Returns the parameters for using POST requests.
|
||||
*/
|
||||
getPostData(module, params) {
|
||||
params.module = module;
|
||||
params.apikey = this.apiKey;
|
||||
@ -98,6 +132,11 @@ class BaseEtherscanProvider extends abstract_provider_js_1.AbstractProvider {
|
||||
async detectNetwork() {
|
||||
return this.network;
|
||||
}
|
||||
/**
|
||||
* Resolves to the result of calling %%module%% with %%params%%.
|
||||
*
|
||||
* If %%post%%, the request is made as a POST request.
|
||||
*/
|
||||
async fetch(module, params, post) {
|
||||
const id = nextId++;
|
||||
const url = (post ? this.getPostUrl() : this.getUrl(module, params));
|
||||
@ -172,7 +211,9 @@ class BaseEtherscanProvider extends abstract_provider_js_1.AbstractProvider {
|
||||
return result.result;
|
||||
}
|
||||
}
|
||||
// The transaction has already been sanitized by the calls in Provider
|
||||
/**
|
||||
* Returns %%transaction%% normalized for the Etherscan API.
|
||||
*/
|
||||
_getTransactionPostData(transaction) {
|
||||
const result = {};
|
||||
for (let key in transaction) {
|
||||
@ -199,6 +240,9 @@ class BaseEtherscanProvider extends abstract_provider_js_1.AbstractProvider {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Throws the normalized Etherscan error.
|
||||
*/
|
||||
_checkError(req, error, transaction) {
|
||||
// Pull any message out if, possible
|
||||
let message = "";
|
||||
@ -408,6 +452,11 @@ class BaseEtherscanProvider extends abstract_provider_js_1.AbstractProvider {
|
||||
async getNetwork() {
|
||||
return this.network;
|
||||
}
|
||||
/**
|
||||
* Resolves to the current price of ether.
|
||||
*
|
||||
* This returns ``0`` on any network other than ``mainnet``.
|
||||
*/
|
||||
async getEtherPrice() {
|
||||
if (this.network.name !== "mainnet") {
|
||||
return 0.0;
|
||||
@ -415,10 +464,6 @@ class BaseEtherscanProvider extends abstract_provider_js_1.AbstractProvider {
|
||||
return parseFloat((await this.fetch("stats", { action: "ethprice" })).ethusd);
|
||||
}
|
||||
isCommunityResource() {
|
||||
const plugin = this.network.getPlugin(EtherscanPluginId);
|
||||
if (plugin) {
|
||||
return (plugin.communityApiKey === this.apiKey);
|
||||
}
|
||||
return (this.apiKey == null);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,8 +1,22 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Aboud Etherscan...
|
||||
* [[link-etherscan]] provides a third-party service for connecting to
|
||||
* various blockchains over a combination of JSON-RPC and custom API
|
||||
* endpoints.
|
||||
*
|
||||
* @_subsection api/providers/thirdparty:Etherscan [etherscan]
|
||||
* **Supported Networks**
|
||||
*
|
||||
* - Ethereum Mainnet (``mainnet``)
|
||||
* - Goerli Testnet (``goerli``)
|
||||
* - Sepolia Testnet (``sepolia``)
|
||||
* - Arbitrum (``arbitrum``)
|
||||
* - Arbitrum Goerli Testnet (``arbitrum-goerli``)
|
||||
* - Optimism (``optimism``)
|
||||
* - Optimism Goerli Testnet (``optimism-goerli``)
|
||||
* - Polygon (``matic``)
|
||||
* - Polygon Mumbai Testnet (``maticmum``)
|
||||
*
|
||||
* @_subsection api/providers/thirdparty:Etherscan [providers-etherscan]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.EtherscanProvider = void 0;
|
||||
@ -12,9 +26,19 @@ function isPromise(value) {
|
||||
return (value && typeof (value.then) === "function");
|
||||
}
|
||||
/**
|
||||
* Aboud EtherscanProvider...
|
||||
* The **EtherscanProvider** connects to the [[link-etherscan]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* By default, requests are highly-throttled, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-etherscan-signup).
|
||||
*/
|
||||
class EtherscanProvider extends provider_etherscan_base_js_1.BaseEtherscanProvider {
|
||||
/**
|
||||
* Resolves to a [Contract]] for %%address%%, using the
|
||||
* Etherscan API to retreive the Contract ABI.
|
||||
*/
|
||||
async getContract(_address) {
|
||||
let address = this._getAddress(_address);
|
||||
if (isPromise(address)) {
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-etherscan.js","sourceRoot":"","sources":["../../src.ts/providers/provider-etherscan.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6EAAqE;AACrE,mDAAgD;AAEhD,SAAS,SAAS,CAAU,KAAU;IAClC,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAa,iBAAkB,SAAQ,kDAAqB;IACxD,KAAK,CAAC,WAAW,CAAC,QAAgB;QAC9B,IAAI,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE;YAAE,OAAO,GAAG,MAAM,OAAO,CAAC;SAAE;QAEpD,IAAI;YACA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;YACzE,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC7B,OAAO,IAAI,mBAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;SAC3C;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CACJ;AAbD,8CAaC"}
|
||||
{"version":3,"file":"provider-etherscan.js","sourceRoot":"","sources":["../../src.ts/providers/provider-etherscan.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,6EAAqE;AACrE,mDAAgD;AAEhD,SAAS,SAAS,CAAU,KAAU;IAClC,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAa,iBAAkB,SAAQ,kDAAqB;IAExD;;;OAGG;IACH,KAAK,CAAC,WAAW,CAAC,QAAgB;QAC9B,IAAI,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE;YAAE,OAAO,GAAG,MAAM,OAAO,CAAC;SAAE;QAEpD,IAAI;YACA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;YACzE,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC7B,OAAO,IAAI,mBAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;SAC3C;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CACJ;AAlBD,8CAkBC"}
|
@ -2,9 +2,22 @@
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.InfuraProvider = exports.InfuraWebSocketProvider = void 0;
|
||||
/**
|
||||
* About INFURA
|
||||
* [[link-infura]] provides a third-party service for connecting to
|
||||
* various blockchains over JSON-RPC.
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:INFURA [infura]
|
||||
* **Supported Networks**
|
||||
*
|
||||
* - Ethereum Mainnet (``mainnet``)
|
||||
* - Goerli Testnet (``goerli``)
|
||||
* - Sepolia Testnet (``sepolia``)
|
||||
* - Arbitrum (``arbitrum``)
|
||||
* - Arbitrum Goerli Testnet (``arbitrum-goerli``)
|
||||
* - Optimism (``optimism``)
|
||||
* - Optimism Goerli Testnet (``optimism-goerli``)
|
||||
* - Polygon (``matic``)
|
||||
* - Polygon Mumbai Testnet (``maticmum``)
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:INFURA [providers-infura]
|
||||
*/
|
||||
const index_js_1 = require("../utils/index.js");
|
||||
const community_js_1 = require("./community.js");
|
||||
@ -36,11 +49,29 @@ function getHost(name) {
|
||||
(0, index_js_1.assertArgument)(false, "unsupported network", "network", name);
|
||||
}
|
||||
/**
|
||||
* INFURA...
|
||||
* The **InfuraWebSocketProvider** connects to the [[link-infura]]
|
||||
* WebSocket end-points.
|
||||
*
|
||||
* By default, a highly-throttled API key is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-infura-signup).
|
||||
*/
|
||||
class InfuraWebSocketProvider extends provider_websocket_js_1.WebSocketProvider {
|
||||
/**
|
||||
* The Project ID for the INFURA connection.
|
||||
*/
|
||||
projectId;
|
||||
/**
|
||||
* The Project Secret.
|
||||
*
|
||||
* If null, no authenticated requests are made. This should not
|
||||
* be used outside of private contexts.
|
||||
*/
|
||||
projectSecret;
|
||||
/**
|
||||
* Creates a new **InfuraWebSocketProvider**.
|
||||
*/
|
||||
constructor(network, projectId) {
|
||||
const provider = new InfuraProvider(network, projectId);
|
||||
const req = provider._getConnection();
|
||||
@ -58,11 +89,29 @@ class InfuraWebSocketProvider extends provider_websocket_js_1.WebSocketProvider
|
||||
}
|
||||
exports.InfuraWebSocketProvider = InfuraWebSocketProvider;
|
||||
/**
|
||||
* Aboud Cloudflare...
|
||||
* The **InfuraProvider** connects to the [[link-infura]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* By default, a highly-throttled API key is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-infura-signup).
|
||||
*/
|
||||
class InfuraProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
|
||||
/**
|
||||
* The Project ID for the INFURA connection.
|
||||
*/
|
||||
projectId;
|
||||
/**
|
||||
* The Project Secret.
|
||||
*
|
||||
* If null, no authenticated requests are made. This should not
|
||||
* be used outside of private contexts.
|
||||
*/
|
||||
projectSecret;
|
||||
/**
|
||||
* Creates a new **InfuraProvider**.
|
||||
*/
|
||||
constructor(_network, projectId, projectSecret) {
|
||||
if (_network == null) {
|
||||
_network = "mainnet";
|
||||
@ -88,9 +137,16 @@ class InfuraProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
|
||||
isCommunityResource() {
|
||||
return (this.projectId === defaultProjectId);
|
||||
}
|
||||
/**
|
||||
* Creates a new **InfuraWebSocketProvider**.
|
||||
*/
|
||||
static getWebSocketProvider(network, projectId) {
|
||||
return new InfuraWebSocketProvider(network, projectId);
|
||||
}
|
||||
/**
|
||||
* Returns a prepared request for connecting to %%network%%
|
||||
* with %%projectId%% and %%projectSecret%%.
|
||||
*/
|
||||
static getRequest(network, projectId, projectSecret) {
|
||||
if (projectId == null) {
|
||||
projectId = defaultProjectId;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,gDAE2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AACxD,mEAA4D;AAO5D,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAE5D,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAC/B,KAAK,QAAQ;YACT,OAAO,kBAAkB,CAAC;QAC9B,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAE/B,KAAK,UAAU;YACX,OAAO,4BAA4B,CAAC;QACxC,KAAK,iBAAiB;YAClB,OAAO,2BAA2B,CAAC;QACvC,KAAK,OAAO;YACR,OAAO,2BAA2B,CAAC;QACvC,KAAK,UAAU;YACX,OAAO,0BAA0B,CAAC;QACtC,KAAK,UAAU;YACX,OAAO,4BAA4B,CAAC;QACxC,KAAK,iBAAiB;YAClB,OAAO,2BAA2B,CAAC;KAC1C;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClE,C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AO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,IAAA,kCAAmB,EAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAhDD,wCAgDC"}
|
||||
{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,gDAE2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AACxD,mEAA4D;AAO5D,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAE5D,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAC/B,KAAK,QAAQ;YACT,OAAO,kBAAkB,CAAC;QAC9B,KAAK,SAAS;YACV,OAAO,mBAAmB,CAAC;QAE/B,KAAK,UAAU;YACX,OAAO,4BAA4B,CAAC;QACxC,KAAK,iBAAiB;YAClB,OAAO,2BAA2B,CAAC;QACvC,KAAK,OAAO;YACR,OAAO,2BAA2B,CAAC;QACvC,KAAK,UAAU;YACX,OAAO,0BAA0B,CAAC;QACtC,KAAK,UAAU;YACX,OAAO,4BAA4B,CAAC;QACxC,KAAK,iBAAiB;YAClB,OAAO,2BAA2B,CAAC;KAC1C;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAa,uBAAwB,SAAQ,yCAAiB;IAE1D;;OAEG;IACM,SAAS,CAAU;IAE5B;;;;;OAKG;IACM,aAAa,CAAiB;IAEvC;;OAEG;IACH,YAAY,OAAoB,EAAE,SAAkB;QAChD,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,OAA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B,EAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AApED,wCAoEC"}
|
@ -1,11 +1,23 @@
|
||||
"use strict";
|
||||
/**
|
||||
* [[link-quicknode]] provides a third-party service for connecting to
|
||||
* various blockchains over JSON-RPC.
|
||||
*
|
||||
* **Supported Networks**
|
||||
*
|
||||
* - Ethereum Mainnet (``mainnet``)
|
||||
* - Goerli Testnet (``goerli``)
|
||||
* - Arbitrum (``arbitrum``)
|
||||
* - Arbitrum Goerli Testnet (``arbitrum-goerli``)
|
||||
* - Optimism (``optimism``)
|
||||
* - Optimism Goerli Testnet (``optimism-goerli``)
|
||||
* - Polygon (``matic``)
|
||||
* - Polygon Mumbai Testnet (``maticmum``)
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.QuickNodeProvider = void 0;
|
||||
/**
|
||||
* About Quicknode
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:QuickNode [backend-quicknode]
|
||||
*/
|
||||
const index_js_1 = require("../utils/index.js");
|
||||
const community_js_1 = require("./community.js");
|
||||
const network_js_1 = require("./network.js");
|
||||
@ -35,10 +47,22 @@ function getHost(name) {
|
||||
(0, index_js_1.assertArgument)(false, "unsupported network", "network", name);
|
||||
}
|
||||
/**
|
||||
* About QuickNode
|
||||
* The **QuickNodeProvider** connects to the [[link-quicknode]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* By default, a highly-throttled API token is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-quicknode).
|
||||
*/
|
||||
class QuickNodeProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
|
||||
/**
|
||||
* The API token.
|
||||
*/
|
||||
token;
|
||||
/**
|
||||
* Creates a new **QuickNodeProvider**.
|
||||
*/
|
||||
constructor(_network, token) {
|
||||
if (_network == null) {
|
||||
_network = "mainnet";
|
||||
@ -61,6 +85,10 @@ class QuickNodeProvider extends provider_jsonrpc_js_1.JsonRpcProvider {
|
||||
isCommunityResource() {
|
||||
return (this.token === defaultToken);
|
||||
}
|
||||
/**
|
||||
* Returns a new request prepared for %%network%% and the
|
||||
* %%token%%.
|
||||
*/
|
||||
static getRequest(network, token) {
|
||||
if (token == null) {
|
||||
token = defaultToken;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-quicknode.js","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,gDAE2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAOxD,MAAM,YAAY,GAAG,0CAA0C,CAAC;AAEhE,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,qBAAqB,CAAC;QACjC,KAAK,QAAQ;YACT,OAAO,qCAAqC,CAAC;QACjD,iBAAiB;QACjB,iCAAiC;QAEjC,KAAK,UAAU;YACX,OAAO,sCAAsC,CAAC;QAClD,KAAK,iBAAiB;YAClB,OAAO,qCAAqC,CAAC;QACjD,KAAK,OAAO;YACR,OAAO,2BAA2B,CAAC;QACvC,KAAK,UAAU;YACX,OAAO,mCAAmC,CAAC;QAC/C,KAAK,UAAU;YACX,OAAO,8BAA8B,CAAC;QAC1C,KAAK,iBAAiB;YAClB,OAAO,qCAAqC,CAAC;KACpD;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAGD;;GAEG;AACH,MAAa,iBAAkB,SAAQ,qCAAe;IACzC,KAAK,CAAU;IAExB,YAAY,QAAqB,EAAE,KAAqB;QACpD,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAA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OAAO,CAAC;IACnB,CAAC;CACJ;AAzCD,8CAyCC"}
|
||||
{"version":3,"file":"provider-quicknode.js","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,gDAE2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAOxD,MAAM,YAAY,GAAG,0CAA0C,CAAC;AAEhE,SAAS,OAAO,CAAC,IAAY;IACzB,QAAO,IAAI,EAAE;QACT,KAAK,SAAS;YACV,OAAO,qBAAqB,CAAC;QACjC,KAAK,QAAQ;YACT,OAAO,qCAAqC,CAAC;QACjD,iBAAiB;QACjB,iCAAiC;QAEjC,KAAK,UAAU;YACX,OAAO,sCAAsC,CAAC;QAClD,KAAK,iBAAiB;YAClB,OAAO,qCAAqC,CAAC;QACjD,KAAK,OAAO;YACR,OAAO,2BAA2B,CAAC;QACvC,KAAK,UAAU;YACX,OAAO,mCAAmC,CAAC;QAC/C,KAAK,UAAU;YACX,OAAO,8BAA8B,CAAC;QAC1C,KAAK,iBAAiB;YAClB,OAAO,qCAAqC,CAAC;KACpD;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAGD;;;;;;;;GAQG;AACH,MAAa,iBAAkB,SAAQ,qCAAe;IAClD;;OAEG;IACM,KAAK,CAAU;IAExB;;OAEG;IACH,YAAY,QAAqB,EAAE,KAAqB;QACpD,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,SAAS,CAAC;SAAE;QAC/C,MAAM,OAAO,GAAG,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,KAAK,IAAI,IAAI,EAAE;YAAE,KAAK,GAAG,YAAY,CAAC;SAAE;QAE5C,MAAM,OAAO,GAAG,iBAAiB,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC7D,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;QAEpD,IAAA,2BAAgB,EAAoB,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,YAAY,CAAC,OAAe;QACxB,IAAI;YACA,OAAO,IAAI,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;SACrD;QAAC,OAAO,KAAK,EAAE,GAAG;QACnB,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,KAAqB;QACrD,IAAI,KAAK,IAAI,IAAI,EAAE;YAAE,KAAK,GAAG,YAAY,CAAC;SAAE;QAE5C,MAAM,OAAO,GAAG,IAAI,uBAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,IAAK,KAAM,EAAE,CAAC,CAAC;QACnF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,mEAAmE;QAEnE,IAAI,KAAK,KAAK,YAAY,EAAE;YACxB,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,IAAA,kCAAmB,EAAC,mBAAmB,CAAC,CAAC;gBACzC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAnDD,8CAmDC"}
|
@ -3,6 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.recoverAddress = exports.computeAddress = void 0;
|
||||
const index_js_1 = require("../address/index.js");
|
||||
const index_js_2 = require("../crypto/index.js");
|
||||
/**
|
||||
* Returns the address for the %%key%%.
|
||||
*
|
||||
* The key may be any standard form of public key or a private key.
|
||||
*/
|
||||
function computeAddress(key) {
|
||||
let pubkey;
|
||||
if (typeof (key) === "string") {
|
||||
@ -14,6 +19,10 @@ function computeAddress(key) {
|
||||
return (0, index_js_1.getAddress)((0, index_js_2.keccak256)("0x" + pubkey.substring(4)).substring(26));
|
||||
}
|
||||
exports.computeAddress = computeAddress;
|
||||
/**
|
||||
* Returns the recovered address for the private key that was
|
||||
* used to sign %%digest%% that resulted in %%signature%%.
|
||||
*/
|
||||
function recoverAddress(digest, signature) {
|
||||
return computeAddress(index_js_2.SigningKey.recoverPublicKey(digest, signature));
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,iDAA2D;AAK3D,SAAgB,cAAc,CAAC,GAAwB;IACnD,IAAI,MAAc,CAAC;IACnB,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;QAC1B,MAAM,GAAG,qBAAU,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACpD;SAAM;QACH,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC;KAC1B;IACD,OAAO,IAAA,qBAAU,EAAC,IAAA,oBAAS,EAAC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC;AARD,wCAQC;AAED,SAAgB,cAAc,CAAC,MAAiB,EAAE,SAAwB;IACtE,OAAO,cAAc,CAAC,qBAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAC1E,CAAC;AAFD,wCAEC"}
|
||||
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,iDAA2D;AAK3D;;;;GAIG;AACH,SAAgB,cAAc,CAAC,GAAwB;IACnD,IAAI,MAAc,CAAC;IACnB,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;QAC1B,MAAM,GAAG,qBAAU,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACpD;SAAM;QACH,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC;KAC1B;IACD,OAAO,IAAA,qBAAU,EAAC,IAAA,oBAAS,EAAC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC;AARD,wCAQC;AAED;;;GAGG;AACH,SAAgB,cAAc,CAAC,MAAiB,EAAE,SAAwB;IACtE,OAAO,cAAc,CAAC,qBAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAC1E,CAAC;AAFD,wCAEC"}
|
File diff suppressed because one or more lines are too long
@ -7,14 +7,32 @@ exports.EventPayload = void 0;
|
||||
* @_section api/utils/events:Events [about-events]
|
||||
*/
|
||||
const properties_js_1 = require("./properties.js");
|
||||
/**
|
||||
* When an [[EventEmitterable]] triggers a [[Listener]], the
|
||||
* callback always ahas one additional argument passed, which is
|
||||
* an **EventPayload**.
|
||||
*/
|
||||
class EventPayload {
|
||||
/**
|
||||
* The event filter.
|
||||
*/
|
||||
filter;
|
||||
/**
|
||||
* The **EventEmitterable**.
|
||||
*/
|
||||
emitter;
|
||||
#listener;
|
||||
/**
|
||||
* Create a new **EventPayload** for %%emitter%% with
|
||||
* the %%listener%% and for %%filter%%.
|
||||
*/
|
||||
constructor(emitter, listener, filter) {
|
||||
this.#listener = listener;
|
||||
(0, properties_js_1.defineProperties)(this, { emitter, filter });
|
||||
}
|
||||
/**
|
||||
* Unregister the triggered listener for future events.
|
||||
*/
|
||||
async removeListener() {
|
||||
if (this.#listener == null) {
|
||||
return;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,mDAAmD;AAoBnD,MAAa,YAAY;IACZ,MAAM,CAAK;IAEX,OAAO,CAAuB;IAC9B,SAAS,CAAkB;IAEpC,YAAY,OAA4B,EAAE,QAAyB,EAAE,MAAS;QAC1E,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAA,gCAAgB,EAAoB,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,cAAc;QAChB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YAAE,OAAO;SAAE;QACvC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACJ;AAfD,oCAeC"}
|
||||
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,mDAAmD;AA+DnD;;;;GAIG;AACH,MAAa,YAAY;IACrB;;OAEG;IACM,MAAM,CAAK;IAEpB;;OAEG;IACM,OAAO,CAAuB;IAE9B,SAAS,CAAkB;IAEpC;;;OAGG;IACH,YAAY,OAA4B,EAAE,QAAyB,EAAE,MAAS;QAC1E,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAA,gCAAgB,EAAoB,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QAChB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YAAE,OAAO;SAAE;QACvC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACJ;AA7BD,oCA6BC"}
|
@ -5,9 +5,7 @@ import { loadTests } from "./utils.js";
|
||||
describe("Tests Namehash", function () {
|
||||
const tests = loadTests("namehash");
|
||||
for (const test of tests) {
|
||||
if (test.error) {
|
||||
}
|
||||
else {
|
||||
if (!test.error) {
|
||||
it(`hashes ENS name: ${JSON.stringify(test.name)}`, function () {
|
||||
const actual = namehash(test.ensName);
|
||||
assert.equal(actual, test.namehash, "namehash");
|
||||
@ -18,6 +16,23 @@ describe("Tests Namehash", function () {
|
||||
});
|
||||
}
|
||||
}
|
||||
for (const test of tests) {
|
||||
if (test.error) {
|
||||
it(`correctly fails to hash ENS name: ${test.error} ${JSON.stringify(test.name)}`, function () {
|
||||
assert.throws(function () {
|
||||
const actual = namehash(test.ensName);
|
||||
console.log("Failed to throw", actual);
|
||||
}, (error) => {
|
||||
return (isError(error, "INVALID_ARGUMENT") &&
|
||||
error.argument === "name" && error.value === test.ensName);
|
||||
});
|
||||
// The empty string is not a valid ENS name
|
||||
if (test.ensName) {
|
||||
assert.ok(!isValidName(test.ensName), "!isValidName");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
/*
|
||||
describe("Tests Bad ENS Names", function() {
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"test-hash.js","sourceRoot":"","sources":["../../src.ts/_tests/test-hash.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EACH,WAAW,EACX,QAAQ,EAAE,WAAW,EACrB,cAAc,EAAE,uBAAuB,EAAE,oBAAoB,EAC7D,OAAO,EACV,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAKtC,iEAAiE;AAEjE,QAAQ,CAAC,gBAAgB,EAAE;IACvB,MAAM,KAAK,GAAG,SAAS,CAAmB,UAAU,CAAC,CAAC;IACtD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,IAAI,IAAI,CAAC,KAAK,EAAE;S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AC;YACxB,CAAC,EAAE,UAAU,KAAK;gBACd,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,kBAAkB,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC;YAC7E,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;KACN;AACL,CAAC,CAAC,CAAC"}
|
@ -1,2 +1,2 @@
|
||||
export const version = "6.0.0-beta-exports.14";
|
||||
export const version = "6.0.0-beta-exports.15";
|
||||
//# sourceMappingURL=_version.js.map
|
@ -6,7 +6,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, EventLog, } from "./contract/index.js";
|
||||
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js";
|
||||
export { id, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder } from "./hash/index.js";
|
||||
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder } from "./hash/index.js";
|
||||
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, QuickNodeProvider,
|
||||
//PocketProvider } from "./provider-pocket.js";
|
||||
IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network } from "./providers/index.js";
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"ethers.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AAe,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,EAC9C,MAAM,sBAAsB,CAAC"}
|
@ -4,7 +4,7 @@
|
||||
* @_section: api/hashing:Hashing Utilities [hashing]
|
||||
*/
|
||||
export { id } from "./id.js";
|
||||
export { isValidName, namehash, dnsEncode } from "./namehash.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";
|
||||
|
@ -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,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACjE,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,MAAM,iBAAiB,CAAC"}
|
@ -1,6 +1,6 @@
|
||||
import { keccak256 } from "../crypto/index.js";
|
||||
import { concat, hexlify, assertArgument, toUtf8Bytes, toUtf8String } from "../utils/index.js";
|
||||
import { ens_normalize } from "@adraffy/ens-normalize";
|
||||
import { concat, hexlify, assertArgument, toUtf8Bytes } from "../utils/index.js";
|
||||
import { ens_normalize } from "@adraffy/ens-normalize/xnf";
|
||||
const Zeros = new Uint8Array(32);
|
||||
Zeros.fill(0);
|
||||
function checkComponent(comp) {
|
||||
@ -8,7 +8,7 @@ function checkComponent(comp) {
|
||||
return comp;
|
||||
}
|
||||
function ensNameSplit(name) {
|
||||
const bytes = toUtf8Bytes(ens_normalize(name));
|
||||
const bytes = toUtf8Bytes(ensNormalize(name));
|
||||
const comps = [];
|
||||
if (name.length === 0) {
|
||||
return comps;
|
||||
@ -27,9 +27,20 @@ function ensNameSplit(name) {
|
||||
comps.push(checkComponent(bytes.slice(last)));
|
||||
return comps;
|
||||
}
|
||||
/**
|
||||
* Returns the ENS %%name%% normalized.
|
||||
*/
|
||||
export function ensNormalize(name) {
|
||||
return ensNameSplit(name).map((comp) => toUtf8String(comp)).join(".");
|
||||
try {
|
||||
return ens_normalize(name);
|
||||
}
|
||||
catch (error) {
|
||||
assertArgument(false, `invalid ENS name (${error.message})`, "name", name);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns ``true`` if %%name%% is a valid ENS name.
|
||||
*/
|
||||
export function isValidName(name) {
|
||||
try {
|
||||
return (ensNameSplit(name).length !== 0);
|
||||
@ -37,6 +48,9 @@ export function isValidName(name) {
|
||||
catch (error) { }
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Returns the [[link-namehash]] for %%name%%.
|
||||
*/
|
||||
export function namehash(name) {
|
||||
assertArgument(typeof (name) === "string", "invalid ENS name; not a string", "name", name);
|
||||
let result = Zeros;
|
||||
@ -46,6 +60,12 @@ export function namehash(name) {
|
||||
}
|
||||
return hexlify(result);
|
||||
}
|
||||
/**
|
||||
* Returns the DNS encoded %%name%%.
|
||||
*
|
||||
* This is used for various parts of ENS name resolution, such
|
||||
* as the wildcard resolution.
|
||||
*/
|
||||
export function dnsEncode(name) {
|
||||
return hexlify(concat(ensNameSplit(name).map((comp) => {
|
||||
// DNS does not allow components over 63 bytes in length
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"namehash.js","sourceRoot":"","sources":["../../src.ts/hash/namehash.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACH,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAC7D,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACjC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEd,SAAS,cAAc,CAAC,IAAgB;IACpC,cAAc,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,mCAAmC,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IACpF,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAC9B,MAAM,KAAK,GAAG,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAsB,EAAG,CAAC;IAErC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;KAAE;IAExC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,CAAC,GAAG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raData: "", errorArgs: []
|
||||
};
|
||||
if (dataLength(data) < 5 * 32) {
|
||||
throw new Error("insufficient OffchainLookup data");
|
||||
}
|
||||
assert(dataLength(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", {
|
||||
reason: "insufficient OffchainLookup data"
|
||||
});
|
||||
const sender = dataSlice(data, 0, 32);
|
||||
if (dataSlice(sender, 0, 12) !== dataSlice(zeros, 0, 12)) {
|
||||
throw new Error("corrupt OffchainLookup sender");
|
||||
}
|
||||
assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", {
|
||||
reason: "corrupt OffchainLookup sender"
|
||||
});
|
||||
result.sender = dataSlice(sender, 12);
|
||||
// Read the URLs from the response
|
||||
try {
|
||||
@ -1133,7 +1133,9 @@ function parseOffchainLookup(data) {
|
||||
result.urls = urls;
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error("corrupt OffchainLookup urls");
|
||||
assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", {
|
||||
reason: "corrupt OffchainLookup urls"
|
||||
});
|
||||
}
|
||||
// Get the CCIP calldata to forward
|
||||
try {
|
||||
@ -1144,12 +1146,14 @@ function parseOffchainLookup(data) {
|
||||
result.calldata = calldata;
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error("corrupt OffchainLookup calldata");
|
||||
assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", {
|
||||
reason: "corrupt OffchainLookup calldata"
|
||||
});
|
||||
}
|
||||
// Get the callbackSelector (bytes4)
|
||||
if (dataSlice(data, 100, 128) !== dataSlice(zeros, 0, 28)) {
|
||||
throw new Error("corrupt OffchainLookup callbaackSelector");
|
||||
}
|
||||
assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", {
|
||||
reason: "corrupt OffchainLookup callbaackSelector"
|
||||
});
|
||||
result.selector = dataSlice(data, 96, 100);
|
||||
// Get the extra data to send back to the contract as context
|
||||
try {
|
||||
@ -1160,7 +1164,9 @@ function parseOffchainLookup(data) {
|
||||
result.extraData = extraData;
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error("corrupt OffchainLookup extraData");
|
||||
assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", {
|
||||
reason: "corrupt OffchainLookup extraData"
|
||||
});
|
||||
}
|
||||
result.errorArgs = "sender,urls,calldata,selector,extraData".split(/,/).map((k) => result[k]);
|
||||
return result;
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* About Alchemy
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]
|
||||
*/
|
||||
import { defineProperties, resolveProperties, assert, assertArgument, FetchRequest } from "../utils/index.js";
|
||||
import { showThrottleMessage } from "./community.js";
|
||||
import { Network } from "./network.js";
|
||||
@ -25,7 +30,13 @@ function getHost(name) {
|
||||
assertArgument(false, "unsupported network", "network", name);
|
||||
}
|
||||
/**
|
||||
* The AlchemyProvider is backed by the [[alchemyapu]] API.
|
||||
* The **AlchemyProvider** connects to the [[link-alchemy]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* By default, a highly-throttled API key is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-alchemy-signup).
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty
|
||||
*/
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-alchemy.js","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AACA,OAAO,EACH,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,EAAE,cAAc,EAC3D,YAAY,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,M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OAAgB,EAAE,MAAe;QAC/C,IAAI,MAAM,IAAI,IAAI,EAAE;YAAE,MAAM,GAAG,aAAa,CAAC;SAAE;QAE/C,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,OAAQ,MAAO,EAAE,CAAC,CAAC;QACvF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,MAAM,KAAK,aAAa,EAAE;YAC1B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBAC/B,OAAO,IAAI,CAAC;YAChB,CAAC,CAAA;SACJ;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"}
|
@ -1,3 +1,16 @@
|
||||
/**
|
||||
* [[link-ankr]] provides a third-party service for connecting to
|
||||
* various blockchains over JSON-RPC.
|
||||
*
|
||||
* **Supported Networks**
|
||||
*
|
||||
* - Ethereum Mainnet (``mainnet``)
|
||||
* - Goerli Testnet (``goerli``)
|
||||
* - Polygon (``matic``)
|
||||
* - Arbitrum (``arbitrum``)
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:Ankr [providers-ankr]
|
||||
*/
|
||||
import { defineProperties, FetchRequest, assertArgument } from "../utils/index.js";
|
||||
import { showThrottleMessage } from "./community.js";
|
||||
import { Network } from "./network.js";
|
||||
@ -17,12 +30,25 @@ function getHost(name) {
|
||||
assertArgument(false, "unsupported network", "network", name);
|
||||
}
|
||||
/**
|
||||
* About Ankr...
|
||||
* The **AnkrProvider** connects to the [[link-ankr]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty
|
||||
* By default, a highly-throttled API key is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-ankr-signup).
|
||||
*/
|
||||
export class AnkrProvider extends JsonRpcProvider {
|
||||
/**
|
||||
* The API key for the Ankr connection.
|
||||
*/
|
||||
apiKey;
|
||||
/**
|
||||
* Create a new **AnkrProvider**.
|
||||
*
|
||||
* By default connecting to ``mainnet`` with a highly throttled
|
||||
* API key.
|
||||
*/
|
||||
constructor(_network, apiKey) {
|
||||
if (_network == null) {
|
||||
_network = "mainnet";
|
||||
@ -44,6 +70,10 @@ export class AnkrProvider extends JsonRpcProvider {
|
||||
catch (error) { }
|
||||
return super._getProvider(chainId);
|
||||
}
|
||||
/**
|
||||
* Returns a prepared request for connecting to %%network%% with
|
||||
* %%apiKey%%.
|
||||
*/
|
||||
static getRequest(network, apiKey) {
|
||||
if (apiKey == null) {
|
||||
apiKey = defaultApiKey;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-ankr.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAAE,YAAY,EAAE,cAAc,EACjD,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOxD,MAAM,aAAa,GAAG,kEAAkE,CAAC;AAEzF,SAAS,OAAO,CAAC,IAAY;IACzB,QAAQ,IAAI,EAAE;QACV,KAAK,SAAS;YACV,OAAO,kBAAkB,CAAC;QAC9B,KAAK,QAAQ;YACT,OAAO,yBAAyB,CAAC;QACrC,KAAK,OAAO;YACR,OAAO,sBAAsB,CAAC;QAClC,KAAK,UAAU;YACX,OAAO,uBAAuB,CAAC;KACtC;IAED,cAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAGD;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,eAAe;IACpC,MAAM,CAAU;I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AE,OAAO,EAAE,EAAE;gBACrD,mBAAmB,CAAC,cAAc,CAAC,CAAC;gBACpC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,WAAW,CAAC,OAAuB,EAAE,KAAmB;QACpD,IAAI,OAAO,CAAC,MAAM,KAAK,wBAAwB,EAAE;YAC7C,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,+CAA+C,EAAE;gBACjG,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,qCAAqC,CAAC;aAC/D;SACJ;QAED,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC;IAC3C,CAAC;CACJ"}
|
@ -1,10 +1,13 @@
|
||||
/**
|
||||
* About Cloudflare
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]
|
||||
*/
|
||||
import { assertArgument } from "../utils/index.js";
|
||||
import { Network } from "./network.js";
|
||||
import { JsonRpcProvider } from "./provider-jsonrpc.js";
|
||||
/**
|
||||
* Aboud Cloudflare...
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty
|
||||
* About Cloudflare...
|
||||
*/
|
||||
export class CloudflareProvider extends JsonRpcProvider {
|
||||
constructor(_network) {
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IACnD,YAAY,QAAqB;QAC7B,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,SAAS,CAAC;SAAE;QAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,cAAc,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QACvF,KAAK,CAAC,8BAA8B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ"}
|
||||
{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IACnD,YAAY,QAAqB;QAC7B,IAAI,QAAQ,IAAI,IAAI,EAAE;YAAE,QAAQ,GAAG,SAAS,CAAC;SAAE;QAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,cAAc,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QACvF,KAAK,CAAC,8BAA8B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ"}
|
@ -8,43 +8,68 @@ import { showThrottleMessage } from "./community.js";
|
||||
const THROTTLE = 2000;
|
||||
const EtherscanPluginId = "org.ethers.plugins.Etherscan";
|
||||
/**
|
||||
* Aboud Cloudflare...
|
||||
* A Network can include an **EtherscanPlugin** to provide
|
||||
* a custom base URL.
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty:Etherscan
|
||||
*/
|
||||
export class EtherscanPlugin extends NetworkPlugin {
|
||||
/**
|
||||
* The Etherscan API base URL.
|
||||
*/
|
||||
baseUrl;
|
||||
communityApiKey;
|
||||
constructor(baseUrl, communityApiKey) {
|
||||
/**
|
||||
* Creates a new **EtherscanProvider** which will use
|
||||
* %%baseUrl%%.
|
||||
*/
|
||||
constructor(baseUrl) {
|
||||
super(EtherscanPluginId);
|
||||
//if (communityApiKey == null) { communityApiKey = null; }
|
||||
defineProperties(this, { baseUrl, communityApiKey });
|
||||
defineProperties(this, { baseUrl });
|
||||
}
|
||||
clone() {
|
||||
return new EtherscanPlugin(this.baseUrl, this.communityApiKey);
|
||||
return new EtherscanPlugin(this.baseUrl);
|
||||
}
|
||||
}
|
||||
let nextId = 1;
|
||||
/**
|
||||
* Aboud Etherscan...
|
||||
* The **EtherscanBaseProvider** is the super-class of
|
||||
* [[EtherscanProvider]], which should generally be used instead.
|
||||
*
|
||||
* Since the **EtherscanProvider** includes additional code for
|
||||
* [[Contract]] access, in //rare cases// that contracts are not
|
||||
* used, this class can reduce code size.
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty:Etherscan
|
||||
*/
|
||||
export class BaseEtherscanProvider extends AbstractProvider {
|
||||
/**
|
||||
* The connected network.
|
||||
*/
|
||||
network;
|
||||
/**
|
||||
* The API key or null if using the community provided bandwidth.
|
||||
*/
|
||||
apiKey;
|
||||
#plugin;
|
||||
constructor(_network, apiKey) {
|
||||
/**
|
||||
* Creates a new **EtherscanBaseProvider**.
|
||||
*/
|
||||
constructor(_network, _apiKey) {
|
||||
const apiKey = (_apiKey != null) ? _apiKey : null;
|
||||
super();
|
||||
const network = Network.from(_network);
|
||||
this.#plugin = network.getPlugin(EtherscanPluginId);
|
||||
if (apiKey == null && this.#plugin) {
|
||||
apiKey = this.#plugin.communityApiKey;
|
||||
}
|
||||
defineProperties(this, { apiKey, network });
|
||||
// Test that the network is supported by Etherscan
|
||||
this.getBaseUrl();
|
||||
}
|
||||
/**
|
||||
* Returns the base URL.
|
||||
*
|
||||
* If an [[EtherscanPlugin]] is configured on the
|
||||
* [[EtherscanBaseProvider_network]], returns the plugin's
|
||||
* baseUrl.
|
||||
*/
|
||||
getBaseUrl() {
|
||||
if (this.#plugin) {
|
||||
return this.#plugin.baseUrl;
|
||||
@ -72,6 +97,9 @@ export class BaseEtherscanProvider extends AbstractProvider {
|
||||
}
|
||||
assertArgument(false, "unsupported network", "network", this.network);
|
||||
}
|
||||
/**
|
||||
* Returns the URL for the %%module%% and %%params%%.
|
||||
*/
|
||||
getUrl(module, params) {
|
||||
const query = Object.keys(params).reduce((accum, key) => {
|
||||
const value = params[key];
|
||||
@ -83,9 +111,15 @@ export class BaseEtherscanProvider extends AbstractProvider {
|
||||
const apiKey = ((this.apiKey) ? `&apikey=${this.apiKey}` : "");
|
||||
return `${this.getBaseUrl()}/api?module=${module}${query}${apiKey}`;
|
||||
}
|
||||
/**
|
||||
* Returns the URL for using POST requests.
|
||||
*/
|
||||
getPostUrl() {
|
||||
return `${this.getBaseUrl()}/api`;
|
||||
}
|
||||
/**
|
||||
* Returns the parameters for using POST requests.
|
||||
*/
|
||||
getPostData(module, params) {
|
||||
params.module = module;
|
||||
params.apikey = this.apiKey;
|
||||
@ -94,6 +128,11 @@ export class BaseEtherscanProvider extends AbstractProvider {
|
||||
async detectNetwork() {
|
||||
return this.network;
|
||||
}
|
||||
/**
|
||||
* Resolves to the result of calling %%module%% with %%params%%.
|
||||
*
|
||||
* If %%post%%, the request is made as a POST request.
|
||||
*/
|
||||
async fetch(module, params, post) {
|
||||
const id = nextId++;
|
||||
const url = (post ? this.getPostUrl() : this.getUrl(module, params));
|
||||
@ -168,7 +207,9 @@ export class BaseEtherscanProvider extends AbstractProvider {
|
||||
return result.result;
|
||||
}
|
||||
}
|
||||
// The transaction has already been sanitized by the calls in Provider
|
||||
/**
|
||||
* Returns %%transaction%% normalized for the Etherscan API.
|
||||
*/
|
||||
_getTransactionPostData(transaction) {
|
||||
const result = {};
|
||||
for (let key in transaction) {
|
||||
@ -195,6 +236,9 @@ export class BaseEtherscanProvider extends AbstractProvider {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Throws the normalized Etherscan error.
|
||||
*/
|
||||
_checkError(req, error, transaction) {
|
||||
// Pull any message out if, possible
|
||||
let message = "";
|
||||
@ -404,6 +448,11 @@ export class BaseEtherscanProvider extends AbstractProvider {
|
||||
async getNetwork() {
|
||||
return this.network;
|
||||
}
|
||||
/**
|
||||
* Resolves to the current price of ether.
|
||||
*
|
||||
* This returns ``0`` on any network other than ``mainnet``.
|
||||
*/
|
||||
async getEtherPrice() {
|
||||
if (this.network.name !== "mainnet") {
|
||||
return 0.0;
|
||||
@ -411,10 +460,6 @@ export class BaseEtherscanProvider extends AbstractProvider {
|
||||
return parseFloat((await this.fetch("stats", { action: "ethprice" })).ethusd);
|
||||
}
|
||||
isCommunityResource() {
|
||||
const plugin = this.network.getPlugin(EtherscanPluginId);
|
||||
if (plugin) {
|
||||
return (plugin.communityApiKey === this.apiKey);
|
||||
}
|
||||
return (this.apiKey == null);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,7 +1,21 @@
|
||||
/**
|
||||
* Aboud Etherscan...
|
||||
* [[link-etherscan]] provides a third-party service for connecting to
|
||||
* various blockchains over a combination of JSON-RPC and custom API
|
||||
* endpoints.
|
||||
*
|
||||
* @_subsection api/providers/thirdparty:Etherscan [etherscan]
|
||||
* **Supported Networks**
|
||||
*
|
||||
* - Ethereum Mainnet (``mainnet``)
|
||||
* - Goerli Testnet (``goerli``)
|
||||
* - Sepolia Testnet (``sepolia``)
|
||||
* - Arbitrum (``arbitrum``)
|
||||
* - Arbitrum Goerli Testnet (``arbitrum-goerli``)
|
||||
* - Optimism (``optimism``)
|
||||
* - Optimism Goerli Testnet (``optimism-goerli``)
|
||||
* - Polygon (``matic``)
|
||||
* - Polygon Mumbai Testnet (``maticmum``)
|
||||
*
|
||||
* @_subsection api/providers/thirdparty:Etherscan [providers-etherscan]
|
||||
*/
|
||||
import { BaseEtherscanProvider } from "./provider-etherscan-base.js";
|
||||
import { Contract } from "../contract/index.js";
|
||||
@ -9,9 +23,19 @@ function isPromise(value) {
|
||||
return (value && typeof (value.then) === "function");
|
||||
}
|
||||
/**
|
||||
* Aboud EtherscanProvider...
|
||||
* The **EtherscanProvider** connects to the [[link-etherscan]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* By default, requests are highly-throttled, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-etherscan-signup).
|
||||
*/
|
||||
export class EtherscanProvider extends BaseEtherscanProvider {
|
||||
/**
|
||||
* Resolves to a [Contract]] for %%address%%, using the
|
||||
* Etherscan API to retreive the Contract ABI.
|
||||
*/
|
||||
async getContract(_address) {
|
||||
let address = this._getAddress(_address);
|
||||
if (isPromise(address)) {
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-etherscan.js","sourceRoot":"","sources":["../../src.ts/providers/provider-etherscan.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,SAAS,SAAS,CAAU,KAAU;IAClC,OAAO,CAAC,KAAK,IAAI,OAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,qBAAqB;IACxD,KAAK,CAAC,WAAW,CAAC,QAAgB;QAC9B,IAAI,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE;YAAE,OAAO,GAAG,MAAM,OA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E,GAAG,EAAE,IAAI,CAAC,CAAC;SAC3C;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CACJ"}
|
@ -1,7 +1,20 @@
|
||||
/**
|
||||
* About INFURA
|
||||
* [[link-infura]] provides a third-party service for connecting to
|
||||
* various blockchains over JSON-RPC.
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:INFURA [infura]
|
||||
* **Supported Networks**
|
||||
*
|
||||
* - Ethereum Mainnet (``mainnet``)
|
||||
* - Goerli Testnet (``goerli``)
|
||||
* - Sepolia Testnet (``sepolia``)
|
||||
* - Arbitrum (``arbitrum``)
|
||||
* - Arbitrum Goerli Testnet (``arbitrum-goerli``)
|
||||
* - Optimism (``optimism``)
|
||||
* - Optimism Goerli Testnet (``optimism-goerli``)
|
||||
* - Polygon (``matic``)
|
||||
* - Polygon Mumbai Testnet (``maticmum``)
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:INFURA [providers-infura]
|
||||
*/
|
||||
import { defineProperties, FetchRequest, assert, assertArgument } from "../utils/index.js";
|
||||
import { showThrottleMessage } from "./community.js";
|
||||
@ -33,11 +46,29 @@ function getHost(name) {
|
||||
assertArgument(false, "unsupported network", "network", name);
|
||||
}
|
||||
/**
|
||||
* INFURA...
|
||||
* The **InfuraWebSocketProvider** connects to the [[link-infura]]
|
||||
* WebSocket end-points.
|
||||
*
|
||||
* By default, a highly-throttled API key is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-infura-signup).
|
||||
*/
|
||||
export class InfuraWebSocketProvider extends WebSocketProvider {
|
||||
/**
|
||||
* The Project ID for the INFURA connection.
|
||||
*/
|
||||
projectId;
|
||||
/**
|
||||
* The Project Secret.
|
||||
*
|
||||
* If null, no authenticated requests are made. This should not
|
||||
* be used outside of private contexts.
|
||||
*/
|
||||
projectSecret;
|
||||
/**
|
||||
* Creates a new **InfuraWebSocketProvider**.
|
||||
*/
|
||||
constructor(network, projectId) {
|
||||
const provider = new InfuraProvider(network, projectId);
|
||||
const req = provider._getConnection();
|
||||
@ -54,11 +85,29 @@ export class InfuraWebSocketProvider extends WebSocketProvider {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Aboud Cloudflare...
|
||||
* The **InfuraProvider** connects to the [[link-infura]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* By default, a highly-throttled API key is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-infura-signup).
|
||||
*/
|
||||
export class InfuraProvider extends JsonRpcProvider {
|
||||
/**
|
||||
* The Project ID for the INFURA connection.
|
||||
*/
|
||||
projectId;
|
||||
/**
|
||||
* The Project Secret.
|
||||
*
|
||||
* If null, no authenticated requests are made. This should not
|
||||
* be used outside of private contexts.
|
||||
*/
|
||||
projectSecret;
|
||||
/**
|
||||
* Creates a new **InfuraProvider**.
|
||||
*/
|
||||
constructor(_network, projectId, projectSecret) {
|
||||
if (_network == null) {
|
||||
_network = "mainnet";
|
||||
@ -84,9 +133,16 @@ export class InfuraProvider extends JsonRpcProvider {
|
||||
isCommunityResource() {
|
||||
return (this.projectId === defaultProjectId);
|
||||
}
|
||||
/**
|
||||
* Creates a new **InfuraWebSocketProvider**.
|
||||
*/
|
||||
static getWebSocketProvider(network, projectId) {
|
||||
return new InfuraWebSocketProvider(network, projectId);
|
||||
}
|
||||
/**
|
||||
* Returns a prepared request for connecting to %%network%%
|
||||
* with %%projectId%% and %%projectSecret%%.
|
||||
*/
|
||||
static getRequest(network, projectId, projectSecret) {
|
||||
if (projectId == null) {
|
||||
projectId = defaultProjectId;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACH,gBAAgB,EAAE,YAAY,EAAE,MAAM,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C,aAAa,CAAC,CAAC;SAC1E;QAAC,OAAO,KAAK,EAAE,GAAG;QACnB,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,IAAI,CAAC,SAAS,KAAK,gBAAgB,CAAC,CAAC;IACjD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAoB,EAAE,SAAkB;QAChE,OAAO,IAAI,uBAAuB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,SAAyB,EAAE,aAA6B;QACxF,IAAI,SAAS,IAAI,IAAI,EAAE;YAAE,SAAS,GAAG,gBAAgB,CAAC;SAAE;QACxD,IAAI,aAAa,IAAI,IAAI,EAAE;YAAE,aAAa,GAAG,IAAI,CAAC;SAAE;QAEpD,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,OAAQ,SAAU,EAAE,CAAC,CAAC;QAC1F,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,IAAI,aAAa,EAAE;YAAE,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;SAAE;QAEjE,IAAI,SAAS,KAAK,gBAAgB,EAAE;YAChC,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"}
|
@ -1,7 +1,19 @@
|
||||
/**
|
||||
* About Quicknode
|
||||
* [[link-quicknode]] provides a third-party service for connecting to
|
||||
* various blockchains over JSON-RPC.
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:QuickNode [backend-quicknode]
|
||||
* **Supported Networks**
|
||||
*
|
||||
* - Ethereum Mainnet (``mainnet``)
|
||||
* - Goerli Testnet (``goerli``)
|
||||
* - Arbitrum (``arbitrum``)
|
||||
* - Arbitrum Goerli Testnet (``arbitrum-goerli``)
|
||||
* - Optimism (``optimism``)
|
||||
* - Optimism Goerli Testnet (``optimism-goerli``)
|
||||
* - Polygon (``matic``)
|
||||
* - Polygon Mumbai Testnet (``maticmum``)
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]
|
||||
*/
|
||||
import { defineProperties, FetchRequest, assertArgument } from "../utils/index.js";
|
||||
import { showThrottleMessage } from "./community.js";
|
||||
@ -32,10 +44,22 @@ function getHost(name) {
|
||||
assertArgument(false, "unsupported network", "network", name);
|
||||
}
|
||||
/**
|
||||
* About QuickNode
|
||||
* The **QuickNodeProvider** connects to the [[link-quicknode]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* By default, a highly-throttled API token is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-quicknode).
|
||||
*/
|
||||
export class QuickNodeProvider extends JsonRpcProvider {
|
||||
/**
|
||||
* The API token.
|
||||
*/
|
||||
token;
|
||||
/**
|
||||
* Creates a new **QuickNodeProvider**.
|
||||
*/
|
||||
constructor(_network, token) {
|
||||
if (_network == null) {
|
||||
_network = "mainnet";
|
||||
@ -58,6 +82,10 @@ export class QuickNodeProvider extends JsonRpcProvider {
|
||||
isCommunityResource() {
|
||||
return (this.token === defaultToken);
|
||||
}
|
||||
/**
|
||||
* Returns a new request prepared for %%network%% and the
|
||||
* %%token%%.
|
||||
*/
|
||||
static getRequest(network, token) {
|
||||
if (token == null) {
|
||||
token = defaultToken;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-quicknode.js","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;GA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,CAAC,CAAC;IACzD,CAAC;IAED,YAAY,CAAC,OAAe;QACxB,IAAI;YACA,OAAO,IAAI,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;SACrD;QAAC,OAAO,KAAK,EAAE,GAAG;QACnB,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,KAAqB;QACrD,IAAI,KAAK,IAAI,IAAI,EAAE;YAAE,KAAK,GAAG,YAAY,CAAC;SAAE;QAE5C,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,YAAa,OAAO,CAAC,OAAO,CAAC,IAAI,CAAE,IAAK,KAAM,EAAE,CAAC,CAAC;QACnF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,mEAAmE;QAEnE,IAAI,KAAK,KAAK,YAAY,EAAE;YACxB,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACrD,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;gBACzC,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"}
|
@ -1,5 +1,10 @@
|
||||
import { getAddress } from "../address/index.js";
|
||||
import { keccak256, SigningKey } from "../crypto/index.js";
|
||||
/**
|
||||
* Returns the address for the %%key%%.
|
||||
*
|
||||
* The key may be any standard form of public key or a private key.
|
||||
*/
|
||||
export function computeAddress(key) {
|
||||
let pubkey;
|
||||
if (typeof (key) === "string") {
|
||||
@ -10,6 +15,10 @@ export function computeAddress(key) {
|
||||
}
|
||||
return getAddress(keccak256("0x" + pubkey.substring(4)).substring(26));
|
||||
}
|
||||
/**
|
||||
* Returns the recovered address for the private key that was
|
||||
* used to sign %%digest%% that resulted in %%signature%%.
|
||||
*/
|
||||
export function recoverAddress(digest, signature) {
|
||||
return computeAddress(SigningKey.recoverPublicKey(digest, signature));
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAK3D,MAAM,UAAU,cAAc,CAAC,GAAwB;IACnD,IAAI,MAAc,CAAC;IACnB,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;QAC1B,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACpD;SAAM;QACH,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC;KAC1B;IACD,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAiB,EAAE,SAAwB;IACtE,OAAO,cAAc,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
||||
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAK3D;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,GAAwB;IACnD,IAAI,MAAc,CAAC;IACnB,IAAI,OAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;QAC1B,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACpD;SAAM;QACH,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC;KAC1B;IACD,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAiB,EAAE,SAAwB;IACtE,OAAO,cAAc,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
File diff suppressed because one or more lines are too long
@ -4,14 +4,32 @@
|
||||
* @_section api/utils/events:Events [about-events]
|
||||
*/
|
||||
import { defineProperties } from "./properties.js";
|
||||
/**
|
||||
* When an [[EventEmitterable]] triggers a [[Listener]], the
|
||||
* callback always ahas one additional argument passed, which is
|
||||
* an **EventPayload**.
|
||||
*/
|
||||
export class EventPayload {
|
||||
/**
|
||||
* The event filter.
|
||||
*/
|
||||
filter;
|
||||
/**
|
||||
* The **EventEmitterable**.
|
||||
*/
|
||||
emitter;
|
||||
#listener;
|
||||
/**
|
||||
* Create a new **EventPayload** for %%emitter%% with
|
||||
* the %%listener%% and for %%filter%%.
|
||||
*/
|
||||
constructor(emitter, listener, filter) {
|
||||
this.#listener = listener;
|
||||
defineProperties(this, { emitter, filter });
|
||||
}
|
||||
/**
|
||||
* Unregister the triggered listener for future events.
|
||||
*/
|
||||
async removeListener() {
|
||||
if (this.#listener == null) {
|
||||
return;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAoBnD,MAAM,OAAO,YAAY;IACZ,MAAM,CAAK;IAEX,OAAO,CAAuB;IAC9B,SAAS,CAAkB;IAEpC,YAAY,OAA4B,EAAE,QAAyB,EAAE,MAAS;QAC1E,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,gBAAgB,CAAoB,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,cAAc;QAChB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YAAE,OAAO;SAAE;QACvC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACJ"}
|
||||
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AA+DnD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACrB;;OAEG;IACM,MAAM,CAAK;IAEpB;;OAEG;IACM,OAAO,CAAuB;IAE9B,SAAS,CAAkB;IAEpC;;;OAGG;IACH,YAAY,OAA4B,EAAE,QAAyB,EAAE,MAAS;QAC1E,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,gBAAgB,CAAoB,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QAChB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YAAE,OAAO;SAAE;QACvC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACJ"}
|
@ -96,7 +96,7 @@
|
||||
"types": "./types/wordlistsindex.d.ts"
|
||||
}
|
||||
},
|
||||
"gitHead": "80c84b07090708a848d753006fdac66a10a37d9c",
|
||||
"gitHead": "f8cd9c9eafc3839849da73b1467f8b4b5133a2fe",
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"ethers",
|
||||
|
2
types/ethers.d.ts
vendored
2
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, EventLog, } from "./contract/index.js";
|
||||
export { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from "./crypto/index.js";
|
||||
export { id, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder } from "./hash/index.js";
|
||||
export { id, ensNormalize, isValidName, namehash, dnsEncode, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder } from "./hash/index.js";
|
||||
export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network } from "./providers/index.js";
|
||||
export { accessListify, computeAddress, recoverAddress, Transaction } from "./transaction/index.js";
|
||||
export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, 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 } from "./utils/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,SAAS,EAExF,iBAAiB,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,sBAAsB,EACrF,KAAK,GACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,iBAAiB,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,QAAQ,GAC1F,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,WAAW,EAAE,QAAQ,EAAE,SAAS,EAChC,WAAW,EAAE,aAAa,EAC1B,cAAc,EAAE,uBAAuB,EAAE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Y,EAAE,cAAc,EAAE,kBAAkB,EAC3E,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,uBAAuB,EACtF,kBAAkB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,kBAAkB,EACjF,2BAA2B,EAAE,wBAAwB,EAAE,qBAAqB,EAC5E,mBAAmB,EACnB,gBAAgB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACR,eAAe,EAAE,cAAc,EAClC,MAAM,mBAAmB,CAAC"}
|
2
types/hash/index.d.ts
vendored
2
types/hash/index.d.ts
vendored
@ -4,7 +4,7 @@
|
||||
* @_section: api/hashing:Hashing Utilities [hashing]
|
||||
*/
|
||||
export { id } from "./id.js";
|
||||
export { isValidName, namehash, dnsEncode } from "./namehash.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";
|
||||
|
@ -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,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACjE,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,MAAM,iBAAiB,CAAC;AAEnD,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
15
types/hash/namehash.d.ts
vendored
15
types/hash/namehash.d.ts
vendored
@ -1,5 +1,20 @@
|
||||
/**
|
||||
* Returns the ENS %%name%% normalized.
|
||||
*/
|
||||
export declare function ensNormalize(name: string): string;
|
||||
/**
|
||||
* Returns ``true`` if %%name%% is a valid ENS name.
|
||||
*/
|
||||
export declare function isValidName(name: string): name is string;
|
||||
/**
|
||||
* Returns the [[link-namehash]] for %%name%%.
|
||||
*/
|
||||
export declare function namehash(name: string): string;
|
||||
/**
|
||||
* Returns the DNS encoded %%name%%.
|
||||
*
|
||||
* This is used for various parts of ENS name resolution, such
|
||||
* as the wildcard resolution.
|
||||
*/
|
||||
export declare function dnsEncode(name: string): string;
|
||||
//# sourceMappingURL=namehash.d.ts.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"namehash.d.ts","sourceRoot":"","sources":["../../src.ts/hash/namehash.ts"],"names":[],"mappings":"AAyCA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,MAAM,CAKxD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAW7C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAa9C"}
|
||||
{"version":3,"file":"namehash.d.ts","sourceRoot":"","sources":["../../src.ts/hash/namehash.ts"],"names":[],"mappings":"AAyCA;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,MAAM,CAKxD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAW7C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAa9C"}
|
13
types/providers/provider-alchemy.d.ts
vendored
13
types/providers/provider-alchemy.d.ts
vendored
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* About Alchemy
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]
|
||||
*/
|
||||
import { FetchRequest } from "../utils/index.js";
|
||||
import { Network } from "./network.js";
|
||||
import { JsonRpcProvider } from "./provider-jsonrpc.js";
|
||||
@ -5,7 +10,13 @@ import type { AbstractProvider, PerformActionRequest } from "./abstract-provider
|
||||
import type { CommunityResourcable } from "./community.js";
|
||||
import type { Networkish } from "./network.js";
|
||||
/**
|
||||
* The AlchemyProvider is backed by the [[alchemyapu]] API.
|
||||
* The **AlchemyProvider** connects to the [[link-alchemy]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* By default, a highly-throttled API key is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-alchemy-signup).
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty
|
||||
*/
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-alchemy.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,YAAY,EACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAA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,MAAM,EAAG,MAAM,CAAC;gBAEb,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAWzD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAOzC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IAmCvD,mBAAmB,IAAI,OAAO;IAI9B,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY;CAerE"}
|
34
types/providers/provider-ankr.d.ts
vendored
34
types/providers/provider-ankr.d.ts
vendored
@ -1,3 +1,16 @@
|
||||
/**
|
||||
* [[link-ankr]] provides a third-party service for connecting to
|
||||
* various blockchains over JSON-RPC.
|
||||
*
|
||||
* **Supported Networks**
|
||||
*
|
||||
* - Ethereum Mainnet (``mainnet``)
|
||||
* - Goerli Testnet (``goerli``)
|
||||
* - Polygon (``matic``)
|
||||
* - Arbitrum (``arbitrum``)
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:Ankr [providers-ankr]
|
||||
*/
|
||||
import { FetchRequest } from "../utils/index.js";
|
||||
import { AbstractProvider } from "./abstract-provider.js";
|
||||
import { Network } from "./network.js";
|
||||
@ -6,14 +19,31 @@ import type { CommunityResourcable } from "./community.js";
|
||||
import type { Networkish } from "./network.js";
|
||||
import type { JsonRpcError, JsonRpcPayload } from "./provider-jsonrpc.js";
|
||||
/**
|
||||
* About Ankr...
|
||||
* The **AnkrProvider** connects to the [[link-ankr]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty
|
||||
* By default, a highly-throttled API key is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-ankr-signup).
|
||||
*/
|
||||
export declare class AnkrProvider extends JsonRpcProvider implements CommunityResourcable {
|
||||
/**
|
||||
* The API key for the Ankr connection.
|
||||
*/
|
||||
readonly apiKey: string;
|
||||
/**
|
||||
* Create a new **AnkrProvider**.
|
||||
*
|
||||
* By default connecting to ``mainnet`` with a highly throttled
|
||||
* API key.
|
||||
*/
|
||||
constructor(_network?: Networkish, apiKey?: null | string);
|
||||
_getProvider(chainId: number): AbstractProvider;
|
||||
/**
|
||||
* Returns a prepared request for connecting to %%network%% with
|
||||
* %%apiKey%%.
|
||||
*/
|
||||
static getRequest(network: Network, apiKey?: null | string): FetchRequest;
|
||||
getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error;
|
||||
isCommunityResource(): boolean;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAqB1E;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,eAAgB,YAAW,oBAAoB;IAC7E,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAczD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;IAgBzE,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK;IAUhE,mBAAmB,IAAI,OAAO;CAGjC"}
|
||||
{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAqB1E;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,eAAgB,YAAW,oBAAoB;IAE7E;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;;;OAKG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAczD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;IAgBzE,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK;IAUhE,mBAAmB,IAAI,OAAO;CAGjC"}
|
9
types/providers/provider-cloudflare.d.ts
vendored
9
types/providers/provider-cloudflare.d.ts
vendored
@ -1,9 +1,12 @@
|
||||
/**
|
||||
* About Cloudflare
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]
|
||||
*/
|
||||
import { JsonRpcProvider } from "./provider-jsonrpc.js";
|
||||
import type { Networkish } from "./network.js";
|
||||
/**
|
||||
* Aboud Cloudflare...
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty
|
||||
* About Cloudflare...
|
||||
*/
|
||||
export declare class CloudflareProvider extends JsonRpcProvider {
|
||||
constructor(_network?: Networkish);
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;gBACvC,QAAQ,CAAC,EAAE,UAAU;CAMpC"}
|
||||
{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;gBACvC,QAAQ,CAAC,EAAE,UAAU;CAMpC"}
|
69
types/providers/provider-etherscan-base.d.ts
vendored
69
types/providers/provider-etherscan-base.d.ts
vendored
@ -5,7 +5,9 @@ import { PerformActionRequest } from "./abstract-provider.js";
|
||||
import type { Networkish } from "./network.js";
|
||||
import type { TransactionRequest } from "./provider.js";
|
||||
/**
|
||||
* Aboud Etherscan Debug...
|
||||
* When subscribing to the ``"debug"`` event on an Etherscan-based
|
||||
* provider, the events receive a **DebugEventEtherscanProvider**
|
||||
* payload.
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty:Etherscan
|
||||
*/
|
||||
@ -24,37 +26,90 @@ export declare type DebugEventEtherscanProvider = {
|
||||
error: any;
|
||||
};
|
||||
/**
|
||||
* Aboud Cloudflare...
|
||||
* A Network can include an **EtherscanPlugin** to provide
|
||||
* a custom base URL.
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty:Etherscan
|
||||
*/
|
||||
export declare class EtherscanPlugin extends NetworkPlugin {
|
||||
/**
|
||||
* The Etherscan API base URL.
|
||||
*/
|
||||
readonly baseUrl: string;
|
||||
readonly communityApiKey: string;
|
||||
constructor(baseUrl: string, communityApiKey: string);
|
||||
/**
|
||||
* Creates a new **EtherscanProvider** which will use
|
||||
* %%baseUrl%%.
|
||||
*/
|
||||
constructor(baseUrl: string);
|
||||
clone(): EtherscanPlugin;
|
||||
}
|
||||
/**
|
||||
* Aboud Etherscan...
|
||||
* The **EtherscanBaseProvider** is the super-class of
|
||||
* [[EtherscanProvider]], which should generally be used instead.
|
||||
*
|
||||
* Since the **EtherscanProvider** includes additional code for
|
||||
* [[Contract]] access, in //rare cases// that contracts are not
|
||||
* used, this class can reduce code size.
|
||||
*
|
||||
* @_docloc: api/providers/thirdparty:Etherscan
|
||||
*/
|
||||
export declare class BaseEtherscanProvider extends AbstractProvider {
|
||||
#private;
|
||||
/**
|
||||
* The connected network.
|
||||
*/
|
||||
readonly network: Network;
|
||||
readonly apiKey: string;
|
||||
constructor(_network?: Networkish, apiKey?: string);
|
||||
/**
|
||||
* The API key or null if using the community provided bandwidth.
|
||||
*/
|
||||
readonly apiKey: null | string;
|
||||
/**
|
||||
* Creates a new **EtherscanBaseProvider**.
|
||||
*/
|
||||
constructor(_network?: Networkish, _apiKey?: string);
|
||||
/**
|
||||
* Returns the base URL.
|
||||
*
|
||||
* If an [[EtherscanPlugin]] is configured on the
|
||||
* [[EtherscanBaseProvider_network]], returns the plugin's
|
||||
* baseUrl.
|
||||
*/
|
||||
getBaseUrl(): string;
|
||||
/**
|
||||
* Returns the URL for the %%module%% and %%params%%.
|
||||
*/
|
||||
getUrl(module: string, params: Record<string, string>): string;
|
||||
/**
|
||||
* Returns the URL for using POST requests.
|
||||
*/
|
||||
getPostUrl(): string;
|
||||
/**
|
||||
* Returns the parameters for using POST requests.
|
||||
*/
|
||||
getPostData(module: string, params: Record<string, any>): Record<string, any>;
|
||||
detectNetwork(): Promise<Network>;
|
||||
/**
|
||||
* Resolves to the result of calling %%module%% with %%params%%.
|
||||
*
|
||||
* If %%post%%, the request is made as a POST request.
|
||||
*/
|
||||
fetch(module: string, params: Record<string, any>, post?: boolean): Promise<any>;
|
||||
/**
|
||||
* Returns %%transaction%% normalized for the Etherscan API.
|
||||
*/
|
||||
_getTransactionPostData(transaction: TransactionRequest): Record<string, string>;
|
||||
/**
|
||||
* Throws the normalized Etherscan error.
|
||||
*/
|
||||
_checkError(req: PerformActionRequest, error: Error, transaction: any): never;
|
||||
_detectNetwork(): Promise<Network>;
|
||||
_perform(req: PerformActionRequest): Promise<any>;
|
||||
getNetwork(): Promise<Network>;
|
||||
/**
|
||||
* Resolves to the current price of ether.
|
||||
*
|
||||
* This returns ``0`` on any network other than ``mainnet``.
|
||||
*/
|
||||
getEtherPrice(): Promise<number>;
|
||||
isCommunityResource(): boolean;
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-etherscan-base.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-etherscan-base.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAIxD;;;;GAIG;AACH,oBAAY,2BAA2B,GAAG;IACtC,MAAM,EAAE,aAAa,CAAC;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c,IAAI,OAAO,CAAC,OAAO,CAAC;IAIlC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IAiKjD,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAIpC;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAKtC,mBAAmB,IAAI,OAAO;CAGjC"}
|
30
types/providers/provider-etherscan.d.ts
vendored
30
types/providers/provider-etherscan.d.ts
vendored
@ -1,14 +1,38 @@
|
||||
/**
|
||||
* Aboud Etherscan...
|
||||
* [[link-etherscan]] provides a third-party service for connecting to
|
||||
* various blockchains over a combination of JSON-RPC and custom API
|
||||
* endpoints.
|
||||
*
|
||||
* @_subsection api/providers/thirdparty:Etherscan [etherscan]
|
||||
* **Supported Networks**
|
||||
*
|
||||
* - Ethereum Mainnet (``mainnet``)
|
||||
* - Goerli Testnet (``goerli``)
|
||||
* - Sepolia Testnet (``sepolia``)
|
||||
* - Arbitrum (``arbitrum``)
|
||||
* - Arbitrum Goerli Testnet (``arbitrum-goerli``)
|
||||
* - Optimism (``optimism``)
|
||||
* - Optimism Goerli Testnet (``optimism-goerli``)
|
||||
* - Polygon (``matic``)
|
||||
* - Polygon Mumbai Testnet (``maticmum``)
|
||||
*
|
||||
* @_subsection api/providers/thirdparty:Etherscan [providers-etherscan]
|
||||
*/
|
||||
import { BaseEtherscanProvider } from "./provider-etherscan-base.js";
|
||||
import { Contract } from "../contract/index.js";
|
||||
/**
|
||||
* Aboud EtherscanProvider...
|
||||
* The **EtherscanProvider** connects to the [[link-etherscan]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* By default, requests are highly-throttled, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-etherscan-signup).
|
||||
*/
|
||||
export declare class EtherscanProvider extends BaseEtherscanProvider {
|
||||
/**
|
||||
* Resolves to a [Contract]] for %%address%%, using the
|
||||
* Etherscan API to retreive the Contract ABI.
|
||||
*/
|
||||
getContract(_address: string): Promise<null | Contract>;
|
||||
}
|
||||
//# sourceMappingURL=provider-etherscan.d.ts.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-etherscan.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-etherscan.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAMhD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,qBAAqB;IAClD,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC;CAYhE"}
|
||||
{"version":3,"file":"provider-etherscan.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-etherscan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAMhD;;;;;;;;GAQG;AACH,qBAAa,iBAAkB,SAAQ,qBAAqB;IAExD;;;OAGG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC;CAYhE"}
|
64
types/providers/provider-infura.d.ts
vendored
64
types/providers/provider-infura.d.ts
vendored
@ -1,7 +1,20 @@
|
||||
/**
|
||||
* About INFURA
|
||||
* [[link-infura]] provides a third-party service for connecting to
|
||||
* various blockchains over JSON-RPC.
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:INFURA [infura]
|
||||
* **Supported Networks**
|
||||
*
|
||||
* - Ethereum Mainnet (``mainnet``)
|
||||
* - Goerli Testnet (``goerli``)
|
||||
* - Sepolia Testnet (``sepolia``)
|
||||
* - Arbitrum (``arbitrum``)
|
||||
* - Arbitrum Goerli Testnet (``arbitrum-goerli``)
|
||||
* - Optimism (``optimism``)
|
||||
* - Optimism Goerli Testnet (``optimism-goerli``)
|
||||
* - Polygon (``matic``)
|
||||
* - Polygon Mumbai Testnet (``maticmum``)
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:INFURA [providers-infura]
|
||||
*/
|
||||
import { FetchRequest } from "../utils/index.js";
|
||||
import { Network } from "./network.js";
|
||||
@ -11,24 +24,67 @@ import type { AbstractProvider } from "./abstract-provider.js";
|
||||
import type { CommunityResourcable } from "./community.js";
|
||||
import type { Networkish } from "./network.js";
|
||||
/**
|
||||
* INFURA...
|
||||
* The **InfuraWebSocketProvider** connects to the [[link-infura]]
|
||||
* WebSocket end-points.
|
||||
*
|
||||
* By default, a highly-throttled API key is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-infura-signup).
|
||||
*/
|
||||
export declare class InfuraWebSocketProvider extends WebSocketProvider implements CommunityResourcable {
|
||||
/**
|
||||
* The Project ID for the INFURA connection.
|
||||
*/
|
||||
readonly projectId: string;
|
||||
/**
|
||||
* The Project Secret.
|
||||
*
|
||||
* If null, no authenticated requests are made. This should not
|
||||
* be used outside of private contexts.
|
||||
*/
|
||||
readonly projectSecret: null | string;
|
||||
/**
|
||||
* Creates a new **InfuraWebSocketProvider**.
|
||||
*/
|
||||
constructor(network?: Networkish, projectId?: string);
|
||||
isCommunityResource(): boolean;
|
||||
}
|
||||
/**
|
||||
* Aboud Cloudflare...
|
||||
* The **InfuraProvider** connects to the [[link-infura]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* By default, a highly-throttled API key is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-infura-signup).
|
||||
*/
|
||||
export declare class InfuraProvider extends JsonRpcProvider implements CommunityResourcable {
|
||||
/**
|
||||
* The Project ID for the INFURA connection.
|
||||
*/
|
||||
readonly projectId: string;
|
||||
/**
|
||||
* The Project Secret.
|
||||
*
|
||||
* If null, no authenticated requests are made. This should not
|
||||
* be used outside of private contexts.
|
||||
*/
|
||||
readonly projectSecret: null | string;
|
||||
/**
|
||||
* Creates a new **InfuraProvider**.
|
||||
*/
|
||||
constructor(_network?: Networkish, projectId?: null | string, projectSecret?: null | string);
|
||||
_getProvider(chainId: number): AbstractProvider;
|
||||
isCommunityResource(): boolean;
|
||||
/**
|
||||
* Creates a new **InfuraWebSocketProvider**.
|
||||
*/
|
||||
static getWebSocketProvider(network?: Networkish, projectId?: string): InfuraWebSocketProvider;
|
||||
/**
|
||||
* Returns a prepared request for connecting to %%network%%
|
||||
* with %%projectId%% and %%projectSecret%%.
|
||||
*/
|
||||
static getRequest(network: Network, projectId?: null | string, projectSecret?: null | string): FetchRequest;
|
||||
}
|
||||
//# sourceMappingURL=provider-infura.d.ts.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA+B/C;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,iBAAkB,YAAW,oBAAoB;IAC1F,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;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ACH,qBAAa,uBAAwB,SAAQ,iBAAkB,YAAW,oBAAoB;IAE1F;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;gBACS,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM;IAgBpD,mBAAmB,IAAI,OAAO;CAGjC;AAED;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,eAAgB,YAAW,oBAAoB;IAC/E;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM;IAY3F,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,mBAAmB,IAAI,OAAO;IAI9B;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,uBAAuB;IAI9F;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;CAiB9G"}
|
34
types/providers/provider-quicknode.d.ts
vendored
34
types/providers/provider-quicknode.d.ts
vendored
@ -1,7 +1,19 @@
|
||||
/**
|
||||
* About Quicknode
|
||||
* [[link-quicknode]] provides a third-party service for connecting to
|
||||
* various blockchains over JSON-RPC.
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:QuickNode [backend-quicknode]
|
||||
* **Supported Networks**
|
||||
*
|
||||
* - Ethereum Mainnet (``mainnet``)
|
||||
* - Goerli Testnet (``goerli``)
|
||||
* - Arbitrum (``arbitrum``)
|
||||
* - Arbitrum Goerli Testnet (``arbitrum-goerli``)
|
||||
* - Optimism (``optimism``)
|
||||
* - Optimism Goerli Testnet (``optimism-goerli``)
|
||||
* - Polygon (``matic``)
|
||||
* - Polygon Mumbai Testnet (``maticmum``)
|
||||
*
|
||||
* @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]
|
||||
*/
|
||||
import { FetchRequest } from "../utils/index.js";
|
||||
import { Network } from "./network.js";
|
||||
@ -10,13 +22,29 @@ import type { AbstractProvider } from "./abstract-provider.js";
|
||||
import type { CommunityResourcable } from "./community.js";
|
||||
import type { Networkish } from "./network.js";
|
||||
/**
|
||||
* About QuickNode
|
||||
* The **QuickNodeProvider** connects to the [[link-quicknode]]
|
||||
* JSON-RPC end-points.
|
||||
*
|
||||
* By default, a highly-throttled API token is used, which is
|
||||
* appropriate for quick prototypes and simple scripts. To
|
||||
* gain access to an increased rate-limit, it is highly
|
||||
* recommended to [sign up here](link-quicknode).
|
||||
*/
|
||||
export declare class QuickNodeProvider extends JsonRpcProvider implements CommunityResourcable {
|
||||
/**
|
||||
* The API token.
|
||||
*/
|
||||
readonly token: string;
|
||||
/**
|
||||
* Creates a new **QuickNodeProvider**.
|
||||
*/
|
||||
constructor(_network?: Networkish, token?: null | string);
|
||||
_getProvider(chainId: number): AbstractProvider;
|
||||
isCommunityResource(): boolean;
|
||||
/**
|
||||
* Returns a new request prepared for %%network%% and the
|
||||
* %%token%%.
|
||||
*/
|
||||
static getRequest(network: Network, token?: null | string): FetchRequest;
|
||||
}
|
||||
//# sourceMappingURL=provider-quicknode.d.ts.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"provider-quicknode.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACe,YAAY,EACjC,MAAM,mBAAmB,CAAC;AAG3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gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM;IAWxD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO/C,mBAAmB,IAAI,OAAO;IAI9B;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;CAgB3E"}
|
9
types/transaction/address.d.ts
vendored
9
types/transaction/address.d.ts
vendored
@ -1,6 +1,15 @@
|
||||
import { SigningKey } from "../crypto/index.js";
|
||||
import type { SignatureLike } from "../crypto/index.js";
|
||||
import type { BytesLike } from "../utils/index.js";
|
||||
/**
|
||||
* Returns the address for the %%key%%.
|
||||
*
|
||||
* The key may be any standard form of public key or a private key.
|
||||
*/
|
||||
export declare function computeAddress(key: string | SigningKey): string;
|
||||
/**
|
||||
* Returns the recovered address for the private key that was
|
||||
* used to sign %%digest%% that resulted in %%signature%%.
|
||||
*/
|
||||
export declare function recoverAddress(digest: BytesLike, signature: SignatureLike): string;
|
||||
//# sourceMappingURL=address.d.ts.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAQ/D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAElF"}
|
||||
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAQ/D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAElF"}
|
111
types/utils/errors.d.ts
vendored
111
types/utils/errors.d.ts
vendored
@ -17,9 +17,24 @@ export declare type ErrorInfo<T> = Omit<T, "code" | "name" | "message">;
|
||||
* _property: ``"NOT_IMPLEMENTED"``
|
||||
*/
|
||||
export declare type ErrorCode = "UNKNOWN_ERROR" | "NOT_IMPLEMENTED" | "UNSUPPORTED_OPERATION" | "NETWORK_ERROR" | "SERVER_ERROR" | "TIMEOUT" | "BAD_DATA" | "CANCELLED" | "BUFFER_OVERRUN" | "NUMERIC_FAULT" | "INVALID_ARGUMENT" | "MISSING_ARGUMENT" | "UNEXPECTED_ARGUMENT" | "VALUE_MISMATCH" | "CALL_EXCEPTION" | "INSUFFICIENT_FUNDS" | "NONCE_EXPIRED" | "REPLACEMENT_UNDERPRICED" | "TRANSACTION_REPLACED" | "UNCONFIGURED_NAME" | "OFFCHAIN_FAULT" | "ACTION_REJECTED";
|
||||
/**
|
||||
* All errors in Ethers include properties to assist in
|
||||
* machine-readable errors.
|
||||
*/
|
||||
export interface EthersError<T extends ErrorCode = ErrorCode> extends Error {
|
||||
/**
|
||||
* The string error code.
|
||||
*/
|
||||
code: ErrorCode;
|
||||
/**
|
||||
* Additional info regarding the error that may be useful.
|
||||
*
|
||||
* This is generally helpful mostly for human-based debugging.
|
||||
*/
|
||||
info?: Record<string, any>;
|
||||
/**
|
||||
* Any related error.
|
||||
*/
|
||||
error?: Error;
|
||||
}
|
||||
/**
|
||||
@ -167,54 +182,150 @@ export interface InvalidArgumentError extends EthersError<"INVALID_ARGUMENT"> {
|
||||
value: any;
|
||||
info?: Record<string, any>;
|
||||
}
|
||||
/**
|
||||
* This Error indicates there were too few arguments were provided.
|
||||
*/
|
||||
export interface MissingArgumentError extends EthersError<"MISSING_ARGUMENT"> {
|
||||
/**
|
||||
* The number of arguments received.
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* The number of arguments expected.
|
||||
*/
|
||||
expectedCount: number;
|
||||
}
|
||||
/**
|
||||
* This Error indicates too many arguments were provided.
|
||||
*/
|
||||
export interface UnexpectedArgumentError extends EthersError<"UNEXPECTED_ARGUMENT"> {
|
||||
/**
|
||||
* The number of arguments received.
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* The number of arguments expected.
|
||||
*/
|
||||
expectedCount: number;
|
||||
}
|
||||
/**
|
||||
* The action that resulted in the error.
|
||||
*/
|
||||
export declare type CallExceptionAction = "call" | "estimateGas" | "getTransactionResult" | "unknown";
|
||||
/**
|
||||
* The related transaction that caused the error.
|
||||
*/
|
||||
export declare type CallExceptionTransaction = {
|
||||
to: null | string;
|
||||
from?: string;
|
||||
data: string;
|
||||
};
|
||||
/**
|
||||
* This **Error** indicates a transaction reverted.
|
||||
*/
|
||||
export interface CallExceptionError extends EthersError<"CALL_EXCEPTION"> {
|
||||
/**
|
||||
* The action being performed when the revert was encountered.
|
||||
*/
|
||||
action: CallExceptionAction;
|
||||
/**
|
||||
* The revert data returned.
|
||||
*/
|
||||
data: null | string;
|
||||
/**
|
||||
* A human-readable representation of data, if possible.
|
||||
*/
|
||||
reason: null | string;
|
||||
/**
|
||||
* The transaction that triggered the exception.
|
||||
*/
|
||||
transaction: CallExceptionTransaction;
|
||||
/**
|
||||
* The contract invocation details, if available.
|
||||
*/
|
||||
invocation: null | {
|
||||
method: string;
|
||||
signature: string;
|
||||
args: Array<any>;
|
||||
};
|
||||
/**
|
||||
* The built-in or custom revert error, if available
|
||||
*/
|
||||
revert: null | {
|
||||
signature: string;
|
||||
name: string;
|
||||
args: Array<any>;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* The sending account has insufficient funds to cover the
|
||||
* entire transaction cost.
|
||||
*/
|
||||
export interface InsufficientFundsError extends EthersError<"INSUFFICIENT_FUNDS"> {
|
||||
/**
|
||||
* The transaction.
|
||||
*/
|
||||
transaction: TransactionRequest;
|
||||
}
|
||||
/**
|
||||
* The sending account has already used this nonce in a
|
||||
* transaction that has been included.
|
||||
*/
|
||||
export interface NonceExpiredError extends EthersError<"NONCE_EXPIRED"> {
|
||||
/**
|
||||
* The transaction.
|
||||
*/
|
||||
transaction: TransactionRequest;
|
||||
}
|
||||
/**
|
||||
* A CCIP-read exception, which cannot be recovered from or
|
||||
* be further processed.
|
||||
*/
|
||||
export interface OffchainFaultError extends EthersError<"OFFCHAIN_FAULT"> {
|
||||
/**
|
||||
* The transaction.
|
||||
*/
|
||||
transaction?: TransactionRequest;
|
||||
/**
|
||||
* The reason the CCIP-read failed.
|
||||
*/
|
||||
reason: string;
|
||||
}
|
||||
/**
|
||||
* An attempt was made to replace a transaction, but with an
|
||||
* insufficient additional fee to afford evicting the old
|
||||
* transaction from the memory pool.
|
||||
*/
|
||||
export interface ReplacementUnderpricedError extends EthersError<"REPLACEMENT_UNDERPRICED"> {
|
||||
/**
|
||||
* The transaction.
|
||||
*/
|
||||
transaction: TransactionRequest;
|
||||
}
|
||||
/**
|
||||
* A pending transaction was replaced by another.
|
||||
*/
|
||||
export interface TransactionReplacedError extends EthersError<"TRANSACTION_REPLACED"> {
|
||||
/**
|
||||
* If the transaction was cancelled, such that the original
|
||||
* effects of the transaction cannot be assured.
|
||||
*/
|
||||
cancelled: boolean;
|
||||
/**
|
||||
* The reason the transaction was replaced.
|
||||
*/
|
||||
reason: "repriced" | "cancelled" | "replaced";
|
||||
/**
|
||||
* The hash of the replaced transaction.
|
||||
*/
|
||||
hash: string;
|
||||
/**
|
||||
* The transaction that replaced the transaction.
|
||||
*/
|
||||
replacement: TransactionResponse;
|
||||
/**
|
||||
* The receipt of the transaction that replace the transaction.
|
||||
*/
|
||||
receipt: TransactionReceipt;
|
||||
}
|
||||
/**
|
||||
|
File diff suppressed because one or more lines are too long
57
types/utils/events.d.ts
vendored
57
types/utils/events.d.ts
vendored
@ -1,20 +1,77 @@
|
||||
/**
|
||||
* A callback function called when a an event is triggered.
|
||||
*/
|
||||
export declare type Listener = (...args: Array<any>) => void;
|
||||
/**
|
||||
* An **EventEmitterable** behaves similar to an EventEmitter
|
||||
* except provides async access to its methods.
|
||||
*
|
||||
* An EventEmitter implements the observer pattern.
|
||||
*/
|
||||
export interface EventEmitterable<T> {
|
||||
/**
|
||||
* Registers a %%listener%% that is called whenever the
|
||||
* %%event%% occurs until unregistered.
|
||||
*/
|
||||
on(event: T, listener: Listener): Promise<this>;
|
||||
/**
|
||||
* Registers a %%listener%% that is called the next time
|
||||
* %%event%% occurs.
|
||||
*/
|
||||
once(event: T, listener: Listener): Promise<this>;
|
||||
/**
|
||||
* Triggers each listener for %%event%% with the %%args%%.
|
||||
*/
|
||||
emit(event: T, ...args: Array<any>): Promise<boolean>;
|
||||
/**
|
||||
* Resolves to the number of listeners for %%event%%.
|
||||
*/
|
||||
listenerCount(event?: T): Promise<number>;
|
||||
/**
|
||||
* Resolves to the listeners for %%event%%.
|
||||
*/
|
||||
listeners(event?: T): Promise<Array<Listener>>;
|
||||
/**
|
||||
* Unregister the %%listener%% for %%event%%. If %%listener%%
|
||||
* is unspecified, all listeners are unregistered.
|
||||
*/
|
||||
off(event: T, listener?: Listener): Promise<this>;
|
||||
/**
|
||||
* Unregister all listeners for %%event%%.
|
||||
*/
|
||||
removeAllListeners(event?: T): Promise<this>;
|
||||
/**
|
||||
* Alias for [[on]].
|
||||
*/
|
||||
addListener(event: T, listener: Listener): Promise<this>;
|
||||
/**
|
||||
* Alias for [[off]].
|
||||
*/
|
||||
removeListener(event: T, listener: Listener): Promise<this>;
|
||||
}
|
||||
/**
|
||||
* When an [[EventEmitterable]] triggers a [[Listener]], the
|
||||
* callback always ahas one additional argument passed, which is
|
||||
* an **EventPayload**.
|
||||
*/
|
||||
export declare class EventPayload<T> {
|
||||
#private;
|
||||
/**
|
||||
* The event filter.
|
||||
*/
|
||||
readonly filter: T;
|
||||
/**
|
||||
* The **EventEmitterable**.
|
||||
*/
|
||||
readonly emitter: EventEmitterable<T>;
|
||||
/**
|
||||
* Create a new **EventPayload** for %%emitter%% with
|
||||
* the %%listener%% and for %%filter%%.
|
||||
*/
|
||||
constructor(emitter: EventEmitterable<T>, listener: null | Listener, filter: T);
|
||||
/**
|
||||
* Unregister the triggered listener for future events.
|
||||
*/
|
||||
removeListener(): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=events.d.ts.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAOA,oBAAY,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAErD,MAAM,WAAW,gBAAgB,CAAC,CAAC;IAC/B,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtD,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/C,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CA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