Example #1
0
def get_key(u, p, a, pp, win, state, pool):
    global window, uname, pwd, worker_state_active, address, passphrase
    window = win
    uname = u
    pwd = p
    worker_state_active = state
    threadpool = pool
    address = a
    passphrase = pp

    if address[0] == 'P':
        window.lineEdit_8.setText(
            'Could not retrieve private key for multisig address.')
        return
    else:
        window.lineEdit_8.setText('Retrieving key...')
        # Pass the function to execute
        if not worker_state_active['GET_PRIV_KEY']:
            worker_state_active['GET_PRIV_KEY'] = True
            worker = rpcworker.Worker(
                get_private_key, uname,
                pwd)  # Any other args, kwargs are passed to the run function
            worker.signals.result.connect(print_result)
            worker.signals.finished.connect(thread_complete)
            worker.signals.progress.connect(progress_fn)

            # Execute
            threadpool.start(worker)
def create(u, p, win, ac, aa, pp, state, pool):

    global window, uname, pwd, worker_state_active, passphrase, required_sigs, threadpool, addr_arr, pub_keys
    window = win
    uname = u
    pwd = p
    worker_state_active = state
    threadpool = pool
    passphrase = pp
    addr_arr = aa
    pub_keys = " '["
    required_sigs = str(ac)

    pub_keys = " '["
    for index, item in enumerate(addr_arr):
        key = item
        pub_keys += '"' + key + '"'
        if index != len(addr_arr) - 1:
            pub_keys += ','
    pub_keys += "]'"

    # Pass the function to execute
    if not worker_state_active['GET_MULTI_ADDR']:
        worker_state_active['GET_MULTI_ADDR'] = True
        worker = rpcworker.Worker(new_multisig, uname, pwd, required_sigs,
                                  pub_keys, passphrase)
        worker.signals.result.connect(print_result)
        worker.signals.finished.connect(thread_complete)
        worker.signals.progress.connect(progress_fn)

        # Execute
        threadpool.start(worker)
Example #3
0
def invoke_thread(uname, pwd, threadpool):
    worker = rpcworker.Worker(get_all_addresses, uname, pwd)
    worker.signals.result.connect(print_addresses)
    worker.signals.finished.connect(thread_complete)
    worker.signals.progress.connect(progress_fn)
    # Execute
    threadpool.start(worker)
Example #4
0
def execute(u, p, win, state, pool):
    global window, uname, pwd, worker_state_active, address
    window = win
    uname = u
    pwd = p
    worker_state_active = state
    threadpool = pool

    if not worker_state_active['RESYNC']:
        worker_state_active['RESYNC'] = True
        worker = rpcworker.Worker(resync, uname, pwd)
        worker.signals.result.connect(print_result)
        worker.signals.finished.connect(thread_complete)
        worker.signals.progress.connect(progress_fn)

        # Execute
        threadpool.start(worker)
def history(u, p, pg, win, state, pool):
    global window, uname, pwd, worker_state_active, page
    window = win
    uname = u
    pwd = p
    worker_state_active = state
    threadpool = pool
    page = pg

    # Pass the function to execute
    if not worker_state_active['TRANS']:
        worker_state_active['TRANS'] = True
        worker = rpcworker.Worker(get_history, uname, pwd)
        worker.signals.result.connect(print_result)
        worker.signals.finished.connect(thread_complete)
        worker.signals.progress.connect(progress_fn)
        threadpool.start(worker)
Example #6
0
def change(u, p, op, np, win, state, pool):
    global window, uname, pwd, worker_state_active, old_pwd, new_pwd
    uname  = u
    pwd = p
    worker_state_active = state
    threadpool = pool
    old_pwd = op
    new_pwd = np
    window = win

    # Pass the function to execute
    if not worker_state_active['PASS_CHNG']:
        worker_state_active['PASS_CHNG'] = True
        worker = rpcworker.Worker(change_pass, uname, pwd) # Any other args, kwargs are passed to the run function
        worker.signals.result.connect(print_result)
        worker.signals.finished.connect(thread_complete)
        worker.signals.progress.connect(progress_fn)
        threadpool.start(worker)
Example #7
0
def execute(u, p, win, state, pool, pp, f, t):
    global uname, pwd, window, worker_state_active, threadpool, fr, to, passphrase
    window = win
    uname = u
    pwd = p
    worker_state_active = state
    fr = f
    to = t
    threadpool = pool
    passphrase = pp

    if not worker_state_active['FOLD_WALLET']:
        worker_state_active['FOLD_WALLET'] = True

        worker = rpcworker.Worker(fold_it)
        worker.signals.result.connect(fold_response)
        worker.signals.finished.connect(thread_complete)
        worker.signals.progress.connect(progress_fn)
        threadpool.start(worker)
Example #8
0
def all_keys(u, p, k, pp, win, state, pool):
    global window, uname, pwd, worker_state_active, keys, passphrase
    window = win
    uname = u
    pwd = p
    worker_state_active = state
    threadpool = pool
    keys = k
    passphrase = pp

    window.import_text.clear()
    window.import_text.setPlainText('Importing ...')

    if not worker_state_active['IMP_PRIV_KEY']:
        worker_state_active['IMP_PRIV_KEY'] = True
        worker = rpcworker.Worker(ingest_keys, uname, pwd)
        worker.signals.result.connect(print_result)
        worker.signals.finished.connect(thread_complete)
        #worker.signals.progress.connect(progress_fn)
        threadpool.start(worker)
Example #9
0
def get_balance_thd(u, p, win, state, pool):
    global window, uname, pwd, worker_state_active
    window = win
    uname = u
    pwd = p
    worker_state_active = state
    threadpool = pool

    # Pass the function to execute
    if not worker_state_active['GET_BALANCE']:
        worker_state_active['GET_BALANCE'] = True
        worker = rpcworker.Worker(
            get_balance, uname,
            pwd)  # Any other args, kwargs are passed to the run function
        worker.signals.result.connect(print_result)
        worker.signals.finished.connect(thread_complete)
        worker.signals.progress.connect(progress_fn)

        # Execute
        threadpool.start(worker)
Example #10
0
def get_key(u, p, a, win, state, pool):
    global window, uname, pwd, worker_state_active, address
    window = win
    uname  = u
    pwd = p
    worker_state_active = state
    threadpool = pool
    address = a

    window.pk_line.setText('Retrieving key...')
    # Pass the function to execute
    if not worker_state_active['GET_PUB_KEY']:
        worker_state_active['GET_PUB_KEY'] = True
        worker = rpcworker.Worker(get_public_key, uname, pwd) # Any other args, kwargs are passed to the run function
        worker.signals.result.connect(print_result)
        worker.signals.finished.connect(thread_complete)
        worker.signals.progress.connect(progress_fn)

        # Execute
        threadpool.start(worker)
Example #11
0
def fee(u, p, win, fee, state, pool):
    global window, uname, pwd, worker_state_active, threadpool
    window = win
    uname  = u
    pwd = p
    threadpool = pool
    worker_state_active = state
    window.lineEdit_6.clear()
    window.lineEdit_6.setText('Retrieving fee...')

    # Pass the function to execute
    if not worker_state_active['EST']:
        worker_state_active['EST'] = True
        worker = rpcworker.Worker(get_est, uname, pwd) # Any other args, kwargs are passed to the run function
        worker.signals.result.connect(print_result)
        worker.signals.finished.connect(thread_complete)
        worker.signals.progress.connect(progress_fn)

        # Execute
        threadpool.start(worker)
Example #12
0
def get_balance_thd(u, p, win, state, pool):
    global window, uname, pwd, worker_state_active
    window = win
    uname = u
    pwd = p
    worker_state_active = state
    threadpool = pool

    # Pass the function to execute
    if not worker_state_active['GET_BALANCE']:
        window.balance_amount.setText(
            _translate("MainWindow", "Calculating..."))
        worker_state_active['GET_BALANCE'] = True
        worker = rpcworker.Worker(get_balance, uname, pwd)
        worker.signals.result.connect(print_result)
        worker.signals.finished.connect(thread_complete)
        worker.signals.progress.connect(progress_fn)

        # Execute
        threadpool.start(worker)
Example #13
0
def history(u, p, pg, win, state, pool):
    global window, uname, pwd, worker_state_active, page
    window = win
    uname  = u
    pwd = p
    worker_state_active = state
    threadpool = pool
    page = pg

    # Pass the function to execute
    if not worker_state_active['TRANS']:
        worker_state_active['TRANS'] = True
        window.trns_status.setStyleSheet("QLabel {font: 16pt Bold Italic 'Gill Sans';}")
        window.trns_status.setText('Loading...')
        window.trns_status.show()
        window.load_trns_btn.setEnabled(False)
        worker = rpcworker.Worker(get_history, uname, pwd)
        worker.signals.result.connect(print_result)
        worker.signals.finished.connect(thread_complete)
        worker.signals.progress.connect(progress_fn)
        threadpool.start(worker)