I'm running parity with geth cli, invoked using the geth attach
command. I have a contract already deployed using new
call and stored in the object named trading
. This contract contains a function which accepts ethers and updates the contract state:
function buy (uint qty) payable {
if ( qty <= availableQty){
availableQty = availableQty - qty;
}
}
Earlier, while using the geth cli with Ethereum itself, I could easily call the buy
function via the command trading.buy.sendTransaction(10, {from:eth.accounts[0], value: 1000})
. Now however with parity, the same command returns the following error:
TypeError: 'XMLHttpRequest' is not a function
at web3.js:4231:23
at web3.js:4245:19
at web3.js:6020:18
at web3.js:4995:36
at web3.js:4055:16
at web3.js:4141:16
at <anonymous>:1:1
Is there a workaround for this, or an alternate means of calling payable contract functions?