示例#1
0
 async def submit_tx(self,
                     tx: EncodedTx,
                     signature: Optional[TxEthSignature],
                     fast_processing: bool = False) -> str:
     signature = signature.dict() if signature is not None else None
     return await self.provider.request(
         "tx_submit", [tx.dict(), signature, fast_processing])
示例#2
0
 async def submit_tx(self, tx: EncodedTx, signature: Union[Optional[TxEthSignature], List[Optional[TxEthSignature]]],
                     fast_processing: bool = False) -> Transaction:
     if isinstance(signature, List):
         signature = [s.dict() if s is not None else None for s in signature]
     else:
         signature = signature.dict() if signature is not None else None
     trans_id = await self.provider.request("tx_submit",
                                            [tx.dict(), signature, fast_processing])
     return Transaction.build_transaction(self, trans_id)
示例#3
0
 def sign_tx(self, tx: EncodedTx) -> TxEthSignature:
     message = tx.human_readable_message()
     return self.sign(message.encode())
示例#4
0
 def sign_tx(self, message: EncodedTx) -> TxSignature:
     signature = self.library.sign(self.private_key,
                                   message.encoded_message())
     return TxSignature(signature=signature, public_key=self.public_key)