Skip to content

Commit

Permalink
Merge pull request #17 from RomarQ/master
Browse files Browse the repository at this point in the history
[Origination/Balance] - Fix origination balance
  • Loading branch information
serg-plusplus authored Jan 22, 2021
2 parents c84449f + a61dd4f commit 51a2623
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/taquito-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,22 @@ function assertConnected(perm: ThanosDAppPermission): asserts perm {

function formatOpParams(op: any) {
const { fee, gas_limit, storage_limit, ...rest } = op;
if (op.kind === "transaction") {
const { destination, amount, parameters, ...txRest } = rest;
return {
...txRest,
to: destination,
amount: +amount,
mutez: true,
parameter: parameters,
};
switch (op.kind) {
case "origination":
return {
...rest,
mutez: true, // The balance was already converted from Tez (ꜩ) to Mutez (uꜩ)
}
case "transaction":
const { destination, amount, parameters, ...txRest } = op;
return {
...txRest,
to: destination,
amount: +amount,
mutez: true,
parameter: parameters,
};
default:
return rest;
}
return rest;
}

0 comments on commit 51a2623

Please sign in to comment.