Skip to content

Commit

Permalink
added proper user input decimal handling for osmosis MsgWithdrawPosition
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Jan 15, 2025
1 parent dc22c18 commit d698534
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -905,15 +905,15 @@ export const MsgWithdrawPosition = {
message.sender = object.sender;
}
if (object.liquidity_amount !== undefined && object.liquidity_amount !== null) {
message.liquidityAmount = object.liquidity_amount;
message.liquidityAmount = Decimal.fromAtomics(object.liquidity_amount, 18).toString();
}
return message;
},
toAmino(message: MsgWithdrawPosition, useInterfaces: boolean = false): MsgWithdrawPositionAmino {
const obj: any = {};
obj.position_id = message.positionId ? message.positionId.toString() : undefined;
obj.sender = message.sender;
obj.liquidity_amount = message.liquidityAmount;
obj.liquidity_amount = Decimal.fromUserInput(message.liquidityAmount, 18).atomics;
return obj;
},
fromAminoMsg(object: MsgWithdrawPositionAminoMsg): MsgWithdrawPosition {
Expand Down

0 comments on commit d698534

Please sign in to comment.