示例#1
0
def get_balance(details=False):
    wallet = Wallet(
        JSONRPCWallet(
            host=settings.RPC_WALLET_HOST,
            port=settings.RPC_WALLET_PORT,
            user=settings.RPC_WALLET_USER,
            password=settings.RPC_WALLET_PASSWORD,
            timeout=settings.RPC_WALLET_REQUESTS_TIMEOUT,
        ))
    return wallet.balances()
示例#2
0
def test_1():
    InitLoggingSetting()

    logging.info("trx scanner starting ...")

    rpc = JSONRPCWalletEx(protocol='http',
                          host='192.168.10.160',
                          port=38089,
                          verify_ssl_certs=False,
                          timeout=60)

    wallet = Wallet(backend=rpc)

    print(wallet.view_key())

    # watch-only 不能获取,  否则抛异常
    # print(wallet.seed())

    #如果是观察钱包, 需要导入 key-image  才能确定哪些余额是可用的
    print(wallet.balances())

    # pprint(rpc.incoming_transfers( account_index=2 ))

    #
    # filter = {
    #     'tx_ids' : None,
    #     'unconfirmed': None,
    #     'payment_ids': None,
    #     'min_height': 0,
    #     'max_height': None
    # }
    #
    # filter = PaymentFilter( **filter )
    #
    # # filter = object.__dict__.update(filter)
    #
    #
    # ret = wallet._backend.transfers_in(0, filter)

    res = rpc.get_deposit_txs()

    #获取子地址
    print(wallet.get_address(0, 1))

    pass