@ethersproject/contracts
Advanced tools
Comparing version 5.0.0-beta.142 to 5.0.0-beta.143
@@ -1,1 +0,1 @@ | ||
export declare const version = "contracts/5.0.0-beta.142"; | ||
export declare const version = "contracts/5.0.0-beta.143"; |
@@ -1,1 +0,1 @@ | ||
export const version = "contracts/5.0.0-beta.142"; | ||
export const version = "contracts/5.0.0-beta.143"; |
@@ -1,2 +0,2 @@ | ||
import { Fragment, Indexed, Interface, JsonFragment } from "@ethersproject/abi"; | ||
import { Fragment, Indexed, Interface, JsonFragment, Result } from "@ethersproject/abi"; | ||
import { Block, BlockTag, Listener, Log, Provider, TransactionReceipt, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider"; | ||
@@ -27,3 +27,3 @@ import { Signer } from "@ethersproject/abstract-signer"; | ||
eventSignature?: string; | ||
values?: Array<any>; | ||
args?: Result; | ||
decode?: (data: string, topics?: Array<string>) => any; | ||
@@ -30,0 +30,0 @@ removeListener: () => void; |
@@ -48,3 +48,3 @@ "use strict"; | ||
function runMethod(contract, functionName, options) { | ||
let method = contract.interface.functions[functionName]; | ||
const method = contract.interface.functions[functionName]; | ||
return function (...params) { | ||
@@ -140,3 +140,3 @@ let tx = {}; | ||
return contract.signer.sendTransaction(tx).then((tx) => { | ||
let wait = tx.wait.bind(tx); | ||
const wait = tx.wait.bind(tx); | ||
tx.wait = (confirmations) => { | ||
@@ -148,3 +148,3 @@ return wait(confirmations).then((receipt) => { | ||
if (parsed) { | ||
event.values = parsed.values; | ||
event.args = parsed.args; | ||
event.decode = (data, topics) => { | ||
@@ -211,5 +211,5 @@ return this.interface.decodeEventLog(parsed.eventFragment, data, topics); | ||
run(args) { | ||
let listenerCount = this.listenerCount(); | ||
const listenerCount = this.listenerCount(); | ||
this._listeners = this._listeners.filter((item) => { | ||
let argsCopy = args.slice(); | ||
const argsCopy = args.slice(); | ||
// Call the callback in the next event loop | ||
@@ -234,3 +234,3 @@ setTimeout(() => { | ||
constructor(address, contractInterface, fragment, topics) { | ||
let filter = { | ||
const filter = { | ||
address: address | ||
@@ -260,3 +260,3 @@ }; | ||
}; | ||
event.values = this.interface.decodeEventLog(this.fragment, event.data, event.topics); | ||
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics); | ||
} | ||
@@ -272,3 +272,3 @@ } | ||
super.prepareEvent(event); | ||
let parsed = this.interface.parseLog(event); | ||
const parsed = this.interface.parseLog(event); | ||
if (parsed) { | ||
@@ -280,3 +280,3 @@ event.event = parsed.name; | ||
}; | ||
event.values = parsed.values; | ||
event.args = parsed.args; | ||
} | ||
@@ -310,3 +310,3 @@ } | ||
Object.keys(this.interface.events).forEach((eventSignature) => { | ||
let event = this.interface.events[eventSignature]; | ||
const event = this.interface.events[eventSignature]; | ||
defineReadOnly(this.filters, eventSignature, (...args) => { | ||
@@ -360,3 +360,3 @@ return { | ||
// @TODO: This should take in fragment | ||
let run = runMethod(this, name, {}); | ||
const run = runMethod(this, name, {}); | ||
if (this[name] == null) { | ||
@@ -443,3 +443,3 @@ defineReadOnly(this, name, run); | ||
} | ||
let tx = shallowCopy(overrides || {}); | ||
const tx = shallowCopy(overrides || {}); | ||
["from", "to"].forEach(function (key) { | ||
@@ -461,3 +461,3 @@ if (tx[key] == null) { | ||
} | ||
let contract = new (this.constructor)(this.address, this.interface, signerOrProvider); | ||
const contract = new (this.constructor)(this.address, this.interface, signerOrProvider); | ||
if (this.deployTransaction) { | ||
@@ -493,3 +493,3 @@ defineReadOnly(contract, "deployTransaction", this.deployTransaction); | ||
} | ||
let fragment = this.interface.getEvent(eventName); | ||
const fragment = this.interface.getEvent(eventName); | ||
if (!fragment) { | ||
@@ -500,3 +500,3 @@ logger.throwArgumentError("unknown event - " + eventName, "eventName", eventName); | ||
} | ||
let filter = { | ||
const filter = { | ||
address: this.address | ||
@@ -508,3 +508,3 @@ }; | ||
if (eventName.topics[0]) { | ||
let fragment = this.interface.getEvent(eventName.topics[0]); | ||
const fragment = this.interface.getEvent(eventName.topics[0]); | ||
if (fragment) { | ||
@@ -523,3 +523,3 @@ return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics)); | ||
// If we have a poller for this, remove it | ||
let emit = this._wrappedEmits[runningEvent.tag]; | ||
const emit = this._wrappedEmits[runningEvent.tag]; | ||
if (emit) { | ||
@@ -531,3 +531,3 @@ this.provider.off(runningEvent.filter, emit); | ||
_wrapEvent(runningEvent, log, listener) { | ||
let event = deepCopy(log); | ||
const event = deepCopy(log); | ||
try { | ||
@@ -561,7 +561,7 @@ runningEvent.prepareEvent(event); | ||
if (!this._wrappedEmits[runningEvent.tag]) { | ||
let wrappedEmit = (log) => { | ||
let event = this._wrapEvent(runningEvent, log, listener); | ||
let values = (event.values || []); | ||
values.push(event); | ||
this.emit(runningEvent.filter, ...values); | ||
const wrappedEmit = (log) => { | ||
const event = this._wrapEvent(runningEvent, log, listener); | ||
const args = (event.args || []); | ||
args.push(event); | ||
this.emit(runningEvent.filter, ...args); | ||
}; | ||
@@ -576,4 +576,4 @@ this._wrappedEmits[runningEvent.tag] = wrappedEmit; | ||
queryFilter(event, fromBlockOrBlockhash, toBlock) { | ||
let runningEvent = this._getRunningEvent(event); | ||
let filter = shallowCopy(runningEvent.filter); | ||
const runningEvent = this._getRunningEvent(event); | ||
const filter = shallowCopy(runningEvent.filter); | ||
if (typeof (fromBlockOrBlockhash) === "string" && isHexString(fromBlockOrBlockhash, 32)) { | ||
@@ -605,4 +605,4 @@ if (toBlock != null) { | ||
} | ||
let runningEvent = this._getRunningEvent(eventName); | ||
let result = (runningEvent.run(args) > 0); | ||
const runningEvent = this._getRunningEvent(eventName); | ||
const result = (runningEvent.run(args) > 0); | ||
// May have drained all the "once" events; check for living events | ||
@@ -623,3 +623,3 @@ this._checkRunningEvents(runningEvent); | ||
if (eventName == null) { | ||
let result = []; | ||
const result = []; | ||
for (let tag in this._runningEvents) { | ||
@@ -639,4 +639,4 @@ this._runningEvents[tag].listeners().forEach((listener) => { | ||
if (eventName == null) { | ||
for (let tag in this._runningEvents) { | ||
let runningEvent = this._runningEvents[tag]; | ||
for (const tag in this._runningEvents) { | ||
const runningEvent = this._runningEvents[tag]; | ||
runningEvent.removeAllListeners(); | ||
@@ -648,3 +648,3 @@ this._checkRunningEvents(runningEvent); | ||
// Delete any listeners | ||
let runningEvent = this._getRunningEvent(eventName); | ||
const runningEvent = this._getRunningEvent(eventName); | ||
runningEvent.removeAllListeners(); | ||
@@ -658,3 +658,3 @@ this._checkRunningEvents(runningEvent); | ||
} | ||
let runningEvent = this._getRunningEvent(eventName); | ||
const runningEvent = this._getRunningEvent(eventName); | ||
runningEvent.removeListener(listener); | ||
@@ -706,3 +706,3 @@ this._checkRunningEvents(runningEvent); | ||
tx = shallowCopy(args.pop()); | ||
for (let key in tx) { | ||
for (const key in tx) { | ||
if (!allowedTransactionKeys[key]) { | ||
@@ -732,7 +732,7 @@ throw new Error("unknown transaction override " + key); | ||
// Get the deployment transaction (with optional overrides) | ||
let tx = this.getDeployTransaction(...args); | ||
const tx = this.getDeployTransaction(...args); | ||
// Send the deployment transaction | ||
return this.signer.sendTransaction(tx).then((tx) => { | ||
let address = (this.constructor).getContractAddress(tx); | ||
let contract = (this.constructor).getContract(address, this.interface, this.signer); | ||
const address = (this.constructor).getContractAddress(tx); | ||
const contract = (this.constructor).getContract(address, this.interface, this.signer); | ||
defineReadOnly(contract, "deployTransaction", tx); | ||
@@ -756,3 +756,3 @@ return contract; | ||
} | ||
let abi = compilerOutput.abi; | ||
const abi = compilerOutput.abi; | ||
let bytecode = null; | ||
@@ -759,0 +759,0 @@ if (compilerOutput.bytecode) { |
@@ -1,1 +0,1 @@ | ||
export declare const version = "contracts/5.0.0-beta.142"; | ||
export declare const version = "contracts/5.0.0-beta.143"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = "contracts/5.0.0-beta.142"; | ||
exports.version = "contracts/5.0.0-beta.143"; |
@@ -1,2 +0,2 @@ | ||
import { Fragment, Indexed, Interface, JsonFragment } from "@ethersproject/abi"; | ||
import { Fragment, Indexed, Interface, JsonFragment, Result } from "@ethersproject/abi"; | ||
import { Block, BlockTag, Listener, Log, Provider, TransactionReceipt, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider"; | ||
@@ -27,3 +27,3 @@ import { Signer } from "@ethersproject/abstract-signer"; | ||
eventSignature?: string; | ||
values?: Array<any>; | ||
args?: Result; | ||
decode?: (data: string, topics?: Array<string>) => any; | ||
@@ -30,0 +30,0 @@ removeListener: () => void; |
@@ -172,3 +172,3 @@ "use strict"; | ||
if (parsed) { | ||
event.values = parsed.values; | ||
event.args = parsed.args; | ||
event.decode = function (data, topics) { | ||
@@ -290,3 +290,3 @@ return _this.interface.decodeEventLog(parsed.eventFragment, data, topics); | ||
}; | ||
event.values = this.interface.decodeEventLog(this.fragment, event.data, event.topics); | ||
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics); | ||
}; | ||
@@ -313,3 +313,3 @@ return FragmentRunningEvent; | ||
}; | ||
event.values = parsed.values; | ||
event.args = parsed.args; | ||
} | ||
@@ -598,5 +598,5 @@ }; | ||
var event = _this._wrapEvent(runningEvent, log, listener); | ||
var values = (event.values || []); | ||
values.push(event); | ||
_this.emit.apply(_this, __spreadArrays([runningEvent.filter], values)); | ||
var args = (event.args || []); | ||
args.push(event); | ||
_this.emit.apply(_this, __spreadArrays([runningEvent.filter], args)); | ||
}; | ||
@@ -603,0 +603,0 @@ this._wrappedEmits[runningEvent.tag] = wrappedEmit; |
@@ -35,5 +35,5 @@ { | ||
}, | ||
"tarballHash": "0x0253325f52e33a166dd5df2cbc51da741c8810e1e96dccd867248a340596394d", | ||
"tarballHash": "0x1575cc0bacce759d5e730763cbed06758e26b771e9c031addb444c8fdd7580fd", | ||
"types": "./lib/index.d.ts", | ||
"version": "5.0.0-beta.142" | ||
"version": "5.0.0-beta.143" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82104