Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
intervalId = null,
gasProvided = (_.isObject(payload.params[0]) && payload.params[0].gas) ? payload.params[0].gas : null,
isContractDeployment = _.isObject(payload.params[0]) &&
payload.params[0].data &&
payload.params[0].from &&
!payload.params[0].to;
// add custom send Methods
var _ethereumCalls = [
new Method({
name: 'getTransactionReceipt',
call: 'eth_getTransactionReceipt',
params: 1,
inputFormatter: [null],
outputFormatter: formatters.outputTransactionReceiptFormatter
}),
new Method({
name: 'getCode',
call: 'eth_getCode',
params: 2,
inputFormatter: [formatters.inputAddressFormatter, formatters.inputDefaultBlockNumberFormatter]
}),
new Subscriptions({
name: 'subscribe',
type: 'eth',
subscriptions: {
'newBlockHeaders': {
subscriptionName: 'newHeads', // replace subscription with this name
params: 0,
outputFormatter: formatters.outputBlockFormatter
}
export const getAbi = {
name: 'getAbi',
call: 'getAbi',
params: 2,
inputFormatter: [
formatters.inputAddressFormatter,
formatters.inputDefaultBlockNumberFormatter
],
outputFormatter: outputFormatter.outputAbiFormatter
}
export const getTransactionReceipt = {
name: 'getTransactionReceipt',
call: 'getTransactionReceipt',
params: 1,
outputFormatter: formatters.outputTransactionReceiptFormatter
}
export const getCode = {
name: 'getCode',
call: 'getCode',
params: 2,
inputFormatter: [
formatters.inputAddressFormatter,
formatters.inputDefaultBlockNumberFormatter
]
}
export const getAccounts = {
name: 'getAccounts',
call: 'accounts',
params: 0,
};
exports.getAbi = {
name: 'getAbi',
call: 'getAbi',
params: 2,
inputFormatter: [
formatters.inputAddressFormatter,
formatters.inputDefaultBlockNumberFormatter
],
outputFormatter: outputFormatter.outputAbiFormatter
};
exports.getTransactionReceipt = {
name: 'getTransactionReceipt',
call: 'getTransactionReceipt',
params: 1,
outputFormatter: formatters.outputTransactionReceiptFormatter
};
exports.getCode = {
name: 'getCode',
call: 'getCode',
params: 2,
inputFormatter: [
formatters.inputAddressFormatter,
formatters.inputDefaultBlockNumberFormatter
]
};
exports.getAccounts = {
name: 'getAccounts',
call: 'accounts',
params: 0,
outputFormatter: utils.toChecksumAddress
};