Skip to content

Commit c565a1f

Browse files
committed
chore: fix MsgExternalTransfer
1 parent a88ad2a commit c565a1f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

examples/chain_client/30_ExternalTransfer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def main() -> None:
4444
source_subaccount_id=subaccount_id,
4545
destination_subaccount_id=dest_subaccount_id,
4646
amount=100,
47-
denom="inj"
47+
denom="INJ"
4848
)
4949

5050
# build sim tx

pyinjective/composer.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,12 +603,19 @@ def MsgExternalTransfer(
603603
amount: int,
604604
denom: str,
605605
):
606+
peggy_denom, decimals = Denom.load_peggy_denom(self.network, denom)
607+
be_amount = amount_to_backend(amount, decimals)
608+
logging.debug(
609+
"Loaded send symbol {} ({}) with decimals = {}".format(
610+
denom, peggy_denom, decimals
611+
)
612+
)
606613

607614
return injective_exchange_tx_pb.MsgExternalTransfer(
608615
sender=sender,
609616
source_subaccount_id=source_subaccount_id,
610617
destination_subaccount_id=destination_subaccount_id,
611-
amount=self.Coin(amount=amount, denom=denom),
618+
amount=self.Coin(amount=be_amount, denom=peggy_denom),
612619
)
613620

614621
def MsgBid(self, sender: str, bid_amount: float, round: float):

0 commit comments

Comments
 (0)