How to use the web3-eth-contract.accounts function in web3-eth-contract

To help you get started, we’ve selected a few web3-eth-contract examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github citahub / cita-sdk-js / packages / cita-sdk / src / contract / index.ts View on Github external
return receipt
          },
          contractDeployFormatter: (receipt: any) => {
            const newContract = ctx._parent.clone()
            newContract.options.address = receipt.contractAddress
            return newContract
          }
        }

        const sendTransaction = new Method({
          name: 'sendTransaction',
          call: Action.SEND_TRANSACTION,
          params: 1,
          inputFormatter: [sign],
          requestManager: ctx._parent._requestManager,
          accounts: Contract.accounts, // is eth.accounts (necessary for wallet signing)
          defaultAccount: ctx._parent.defaultAccount,
          defaultBlock: ctx._parent.defaultBlock,
          extraFormatters: extraFormatters
        }).createFunction()

        return sendTransaction(args.options, args.callback)
    }
  }
}
github citahub / cita-sdk-js / packages / cita-sdk / src / contract / index.ts View on Github external
const sign = (_tx: any) => {
  const tx = addPrivateKeyFrom(Contract.accounts.wallet)(_tx)
  return signer(tx)
}
Contract.prototype._executeMethod = function _executeMethod() {
github citahub / cita-sdk-js / packages / cita-sdk / lib / contract / index.js View on Github external
}
                        return receipt;
                    },
                    contractDeployFormatter: (receipt) => {
                        const newContract = ctx._parent.clone();
                        newContract.options.address = receipt.contractAddress;
                        return newContract;
                    }
                };
                const sendTransaction = new Method({
                    name: 'sendTransaction',
                    call: Action.SEND_TRANSACTION,
                    params: 1,
                    inputFormatter: [sign],
                    requestManager: ctx._parent._requestManager,
                    accounts: Contract.accounts,
                    defaultAccount: ctx._parent.defaultAccount,
                    defaultBlock: ctx._parent.defaultBlock,
                    extraFormatters: extraFormatters
                }).createFunction();
                return sendTransaction(args.options, args.callback);
        }
    }
};
Contract.prototype._on = function () {
github citahub / cita-sdk-js / packages / cita-sdk / lib / contract / index.js View on Github external
const sign = (_tx) => {
    const tx = addPrivateKey_1.default(Contract.accounts.wallet)(_tx);
    return cita_signer_1.default(tx);
};
Contract.prototype._executeMethod = function _executeMethod() {

web3-eth-contract

Web3 module to interact with Ethereum smart contracts.

LGPL-3.0
Latest version published 11 days ago

Package Health Score

79 / 100
Full package analysis

Similar packages