(self, data, bid)
return res
Send the transmission order

        Args:
            data : Data as bytes array to broadcast over satellite
            bid  : Bid in msats

        Returns:
            Dictionary with order metadata
Send the transmission order
Send the transmission order
def send(self, data, bid):
        """Send the transmission order

        Args:
            data : Data as bytes array to broadcast over satellite
            bid  : Bid in msats

        Returns:
            Dictionary with order metadata

        """
        assert (isinstance(data, bytes))

        # Post request to the API
        r = requests.post(self.server + '/order',
                          data={'bid': bid},
                          files={'file': data},
                          cert=(self.tls_cert, self.tls_key))

        # In case of failure, check the API error message
        if (r.status_code != requests.codes.ok
                and r.headers['content-type'] == "application/json"):
            self._print_errors(r)

        # Raise error if response status indicates failure
        r.raise_for_status()

        # Save the UUID and authentication token from the response
        res = r.json()
        self.uuid = res['uuid']
        self.auth_token = res['auth_token']

        # Print the response
        logger.debug("API Response:")
        logger.debug(json.dumps(res, indent=4, sort_keys=True))

        logger.info("Data successfully queued for transmission\n")
        print("--\nUUID:\n%s" % (res["uuid"]))
        print("--\nAuthentication Token:\n%s" % (res["auth_token"]))

        if ("lightning_invoice" in res):
            print("--\nAmount Due:\n%s millisatoshis\n" %
                  (res["lightning_invoice"]["msatoshi"]))
            print("--\nLightning Invoice Number:\n%s" %
                  (res["lightning_invoice"]["payreq"]))

        return res
def send ( self , data , bid ) : assert ( isinstance ( data , bytes ) ) # Post request to the API r = requests . post ( self . server + '/order' , data = { 'bid' : bid } , files = { 'file' : data } , cert = ( self . tls_cert , self . tls_key ) ) # In case of failure, check the API error message if ( r . status_code != requests . codes . ok and r . headers [ 'content-type' ] == "application/json" ) : self . _print_errors ( r ) # Raise error if response status indicates failure r . raise_for_status ( ) # Save the UUID and authentication token from the response res = r . json ( ) self . uuid = res [ 'uuid' ] self . auth_token = res [ 'auth_token' ] # Print the response logger . debug ( "API Response:" ) logger . debug ( json . dumps ( res , indent = 4 , sort_keys = True ) ) logger . info ( "Data successfully queued for transmission\n" ) print ( "--\nUUID:\n%s" % ( res [ "uuid" ] ) ) print ( "--\nAuthentication Token:\n%s" % ( res [ "auth_token" ] ) ) if ( "lightning_invoice" in res ) : print ( "--\nAmount Due:\n%s millisatoshis\n" % ( res [ "lightning_invoice" ] [ "msatoshi" ] ) ) print ( "--\nLightning Invoice Number:\n%s" % ( res [ "lightning_invoice" ] [ "payreq" ] ) ) return res