Exemplo n.º 1
0
 def get_URI(self):
     from electrum.util import create_bip21_uri
     amount = self.amount
     if amount:
         a, u = self.amount.split()
         assert u == self.app.base_unit
         amount = Decimal(a) * pow(10, self.app.decimal_point())
     return create_bip21_uri(self.address, amount, self.message)
Exemplo n.º 2
0
 def get_URI(self):
     from electrum.util import create_bip21_uri
     amount = self.screen.amount
     if amount:
         a, u = self.screen.amount.split()
         assert u == self.app.base_unit
         amount = Decimal(a) * pow(10, self.app.decimal_point())
     return create_bip21_uri(self.screen.address, amount, self.screen.message)
Exemplo n.º 3
0
    def create_bip21_uri(self, address, satoshis, message, timestamp, expiry):
        extra_params = {}
        if expiry:
            extra_params['time'] = str(timestamp)
            extra_params['exp'] = str(expiry)

        return create_bip21_uri(address,
                                satoshis.satsInt,
                                message,
                                extra_query_params=extra_params)
Exemplo n.º 4
0
 def get_bip21_URI(self, lightning=None):
     from electrum.util import create_bip21_uri
     addr = self.get_address()
     amount = self.get_amount_sat()
     if amount is not None:
         amount = int(amount)
     message = self.message
     extra = {}
     if self.time and self.exp:
         extra['time'] = str(self.time)
         extra['exp'] = str(self.exp)
     # only if we can receive
     if lightning:
         extra['lightning'] = lightning
     if not addr and lightning:
         return "bitcoin:?lightning="+lightning
     uri = create_bip21_uri(addr, amount, message, extra_query_params=extra)
     return str(uri)
Exemplo n.º 5
0
 def get_URI(self):
     from electrum.util import create_bip21_uri
     amount = self.app.get_amount(self.amount)
     return create_bip21_uri(self.address, amount, self.message)