Gas exhausted issue.
Hello,
I'm preparing Wallet for tezos. I want to sign a transaction and broadcast it over the network. Here's my code:
const privateKeyToAddress = async (privateKey) => {
await libsodium.ready;
return sotez.crypto.extractKeys(privateKey);
};
const balanceOf = async (privateKey) => {
await libsodium.ready;
return sotez.rpc.getBalance( (await privateKeyToAddress(privateKey) ).pkh );
};
const transfer = async (privateKey, destinationAddress, amount, fee = 0.05) => {
await libsodium.ready;
const keys = await privateKeyToAddress(privateKey);
try {
const data = await sotez.rpc.transfer({
from: keys.pkh,
keys: keys,
to: destinationAddress,
amount: 1,
fee: 0,
});
return data;
} catch(e) {
console.log(e);
}
};
sotez is connected to my tezos testnet node. When I check my balance it's over 13500000000 testnet tezos. But when I try to sign such transaction:
{ kind: 'transaction',
fee: '0',
gas_limit: '200',
storage_limit: '0',
amount: '1000000',
destination: 'KT18anbnNivMsLkrCmLn8t1wUAxXQRd3tt7k' }
I'm getting proto.003-PsddFKi3.gas_exhausted.operation
error. Is it related to my node, or am I missing something?
Edited by Mateusz Fejczaruk