Skip to content

Commit d54df06

Browse files
Merge pull request #135 from InjectiveLabs/f/fix_msg_external_transfer
F/fix msg external transfer
2 parents a88ad2a + 61c93ad commit d54df06

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,14 @@ Note that the [sync client](https://github.com/InjectiveLabs/sdk-python/blob/mas
7878

7979

8080
### Changelogs
81+
**0.5.7.5**
82+
* Fix MsgExternalTransfer
83+
8184
**0.5.7.4**
8285
* Refactor fetch_metadata script to use K8S
8386
* Refactor testnet network config to K8S
84-
* Removed print logs and standardized logging to info
85-
* Added support for custom cookie in client initialization
87+
* Remove print logs and standardized logging to info
88+
* Print support for custom cookie in client initialization
8689

8790
**0.5.7.3**
8891
* Add multi-subaccount and multi-market support in TradesRequest

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):

pyinjective/constant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def local(cls):
135135
lcd_endpoint='http://localhost:10337',
136136
grpc_endpoint='localhost:9900',
137137
grpc_exchange_endpoint='localhost:9910',
138-
chain_id='injective-777',
138+
chain_id='injective-1',
139139
fee_denom='inj',
140140
env='local'
141141
)

0 commit comments

Comments
 (0)