Skip to main content

Crypto Wallet RPC client for Flask, based on the Python module slick-bitcoinrpc

Project description

Flask-Wallet-RPC is a Crypto Wallet RPC client extension for Flask, based on the Python module slick-bitcoinrpc. Connects to the RPC server of your wallet.

Installation

Install the extension with one of the following commands:

$ easy_install Flask-Walet-RPC

or alternatively if you have pip installed:

$ pip install Flask-Wallet-RPC

Example 1

from flask import Flask
from flask_wallet_rpc import Walletrpc, wallet

app = Flask(__name__)
app.config.from_pyfile('mysettings.cfg')
w = Walletrpc(app)

@app.route('/')
def main():
    return wallet.getwalletinfo()

Example 2

from flask import Flask
from flask_wallet_rpc import Walletrpc, wallet

rpc = Walletrpc()

def create_app('the-config.cfg'):
    rpc.init_app(app)

Then in your blueprint.

from yourapp import wallet
bp = Blueprint('name_of_bp', __name__)

@bp.route('/')
def index():
    return wallet.getwalletinfo()

Configuration

In your flask app config add:

WALLET_RPC_URL = "http://%s:%s@127.0.0.1:8332"%("Rpcuser", "Rpcpassword")

Replace Rpcuser and Rpcpassword with your wallets RPC info.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-Wallet-RPC-0.1.2.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

Flask_Wallet_RPC-0.1.2-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page