Пример #1
0
def send_zero_fee_trx(address_to,  amount):
    dashd = DashdApi.from_dash_conf(DashConfig.get_default_dash_conf())

    unspent = dashd.get_unspent_amount()
    if len(unspent) == 0:
        raise Exception("No unspent inputs")
    address_from = unspent[0]["address"]
    tx_in = unspent[0]["txid"]
    vin = unspent[0]["vout"]
    full_amount = float(unspent[0]["amount"])
    change = full_amount - amount
    raw_trx = dashd.create_raw_trx(tx_in, vin, amount, address_to, change, address_from)
    signed = dashd.sign_raw_trx(raw_trx)
    tx_id = dashd.send_raw_trx(signed)

    print tx_id
Пример #2
0
def instant_send_block():
    dashd = DashdApi.from_dash_conf(DashConfig.get_default_dash_conf())

    for i in range(0, 3):
        tx_id = dashd.instant_send("ye5F5rfx44YqvqCpVvi1SfFS4dvqaqyuDr", 0.1)
        print(tx_id)
Пример #3
0
 def from_dash_conf(self, dash_dot_conf):
     from dash_config import DashConfig
     config = DashConfig(DashConfig.get_default_dash_conf())
     creds = config.get_rpc_creds()
     return self(**creds)