File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1414
1515from .proto .injective .auction .v1beta1 import tx_pb2 as injective_auction_tx_pb
1616
17+ from .proto .injective .peggy .v1 import msgs_pb2 as injective_peggy_tx_pb
18+
1719from .constant import Denom
1820from .utils import *
1921
@@ -432,6 +434,27 @@ def MsgRevoke(
432434 msg_type_url = msg_type
433435 )
434436
437+ def MsgSendToEth (
438+ self ,
439+ denom : str ,
440+ sender : str ,
441+ eth_dest : str ,
442+ amount : float ,
443+ bridge_fee : float
444+ ):
445+
446+ peggy_denom , decimals = Denom .load_peggy_denom (self .network , denom )
447+ be_amount = amount_to_backend (amount , decimals )
448+ be_bridge_fee = amount_to_backend (bridge_fee , decimals )
449+ print ("Loaded withdrawal symbol {} ({}) with decimals = {}" .format (denom , peggy_denom , decimals ))
450+
451+ return injective_peggy_tx_pb .MsgSendToEth (
452+ sender = sender ,
453+ eth_dest = eth_dest ,
454+ amount = self .Coin (amount = be_amount , denom = peggy_denom ),
455+ bridge_fee = self .Coin (amount = be_bridge_fee , denom = peggy_denom )
456+ )
457+
435458 # data field format: [request-msg-header][raw-byte-msg-response]
436459 # you need to figure out this magic prefix number to trim request-msg-header off the data
437460 # this method handles only exchange responses
You can’t perform that action at this time.
0 commit comments