dragonchain/lib/dto/bnb.py
def _build_transaction_msg(self, raw_transaction: Dict[str, Any]) -> Dict:
        """Build a formatted transaction for this network from the base parameters
        Args:
            amount (int): amount of token in transaction
            to_address (str): hex of the address to send to
            symbol (str, optional): the exchange symbol for the token (defaults to 'BNB')
            memo (str, optional): string of data to publish in the transaction (defaults to '')
        Returns:
            dict of the constructed transaction
        """
        amount = raw_transaction["amount"]
        if amount <= 0:
            raise exceptions.BadRequest("[BINANCE] Amount in transaction cannot be less than or equal to 0.")

        symbol = raw_transaction.get("symbol") or "BNB"
        memo = raw_transaction.get("memo") or ""

        inputs = {"address": self.address, "coins": [{"amount": amount, "denom": symbol}]}
        outputs = {"address": raw_transaction["to_address"], "coins": [{"amount": amount, "denom": symbol}]}
        response = self._fetch_account()
        transaction_data = {
            "account_number": response["account_number"],
            "sequence": response["sequence"],
            "from": self.address,
            "msgs": [{"type": "cosmos-sdk/Send", "inputs": [inputs], "outputs": [outputs]}],
            "memo": memo,
        }
        return transaction_data
Build a formatted transaction for this network from the base parameters
        Args:
            amount (int): amount of token in transaction
            to_address (str): hex of the address to send to
            symbol (str, optional): the exchange symbol for the token (defaults to 'BNB')
            memo (str, optional): string of data to publish in the transaction (defaults to '')
        Returns:
            dict of the constructed transaction
        
Build a formatted transaction for this network from the base parameters
Build a formatted transaction for this network from the base parameters
def _build_transaction_msg(self, raw_transaction: Dict[str, Any]) -> Dict:
        amount = raw_transaction["amount"]
        if amount <= 0:
            raise exceptions.BadRequest("[BINANCE] Amount in transaction cannot be less than or equal to 0.")
        symbol = raw_transaction.get("symbol") or "BNB"
        memo = raw_transaction.get("memo") or ""
        inputs = {"address": self.address, "coins": [{"amount": amount, "denom": symbol}]}
        outputs = {"address": raw_transaction["to_address"], "coins": [{"amount": amount, "denom": symbol}]}
        response = self._fetch_account()
        transaction_data = {
            "account_number": response["account_number"],
            "sequence": response["sequence"],
            "from": self.address,
            "msgs": [{"type": "cosmos-sdk/Send", "inputs": [inputs], "outputs": [outputs]}],
            "memo": memo,
        }
        return transaction_data
def _build_transaction_msg ( self , raw_transaction : Dict [ str , Any ] ) -> Dict : amount = raw_transaction [ "amount" ] if amount <= 0 : raise exceptions . BadRequest ( "[BINANCE] Amount in transaction cannot be less than or equal to 0." ) symbol = raw_transaction . get ( "symbol" ) or "BNB" memo = raw_transaction . get ( "memo" ) or "" inputs = { "address" : self . address , "coins" : [ { "amount" : amount , "denom" : symbol } ] } outputs = { "address" : raw_transaction [ "to_address" ] , "coins" : [ { "amount" : amount , "denom" : symbol } ] } response = self . _fetch_account ( ) transaction_data = { "account_number" : response [ "account_number" ] , "sequence" : response [ "sequence" ] , "from" : self . address , "msgs" : [ { "type" : "cosmos-sdk/Send" , "inputs" : [ inputs ] , "outputs" : [ outputs ] } ] , "memo" : memo , } return transaction_data
Build a formatted transaction for this network from the base parameters
Build a formatted transaction for this network from the base parameters
"""Build a formatted transaction for this network from the base parameters
        Args:
            amount (int): amount of token in transaction
            to_address (str): hex of the address to send to
            symbol (str, optional): the exchange symbol for the token (defaults to 'BNB')
            memo (str, optional): string of data to publish in the transaction (defaults to '')
        Returns:
            dict of the constructed transaction
        """
dict of the constructed transaction
dict of the constructed transaction
self
raw_transaction
Dict[str, Any]
amount
amount of token in transaction
amount of token in transaction
to_address
hex of the address to send to
hex of the address to send to
symbol
the exchange symbol for the token (defaults to 'BNB')
the exchange symbol for the token ( defaults to ' BNB ' )
memo
string of data to publish in the transaction (defaults to '')
string of data to publish in the transaction ( defaults to ' ' )