Skip to main content

Streamlit component that allows you to connect to Pera Wallet.

Project description

pera_wallet

Streamlit component that allows you to Streamlit component that allows you to connect to Pera Wallet.

Installation instructions

pip install pera-wallet

Usage instructions

import streamlit as st
from pera_wallet import pera_wallet

if "account" not in st.session_state:
    st.session_state.account = None

if "transaction_id" not in st.session_state:
    st.session_state.transaction_id = None

NETWORK = "testnet"

st.title("Chat")


def account():
    with st.expander("Account", expanded=True):
        # Add msgpack-encoded transactions to sign, if needed
        transactions_to_sign = []

        wallet = pera_wallet(
            network=NETWORK,
            transactions_to_sign=transactions_to_sign,
            key="pera_wallet",
        )
        if wallet is not None:
            st.session_state.account, st.session_state.transaction_id = wallet

        st.caption(
            f"Connected address: {st.session_state.account}"
            if st.session_state.account
            else "Connect your wallet to begin."
        )
        if st.session_state.transaction_id:
            st.caption(
                f"View your transaction on [lora](https://lora.algokit.io/{NETWORK}/transaction/{st.session_state.transaction_id}) the explorer 🥳"
            )


account()

if not st.session_state.account:
    st.stop()

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

pera_wallet-0.0.4.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pera_wallet-0.0.4-py3-none-any.whl (3.6 MB view details)

Uploaded Python 3

File details

Details for the file pera_wallet-0.0.4.tar.gz.

File metadata

  • Download URL: pera_wallet-0.0.4.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for pera_wallet-0.0.4.tar.gz
Algorithm Hash digest
SHA256 aa6cba9170d3e0bc90fdb7f8aacfb1896f913ecd1ce063a656b4ce0f0bcffd87
MD5 c23ae423b925a1f77265bfa6df85a896
BLAKE2b-256 c9809e7b7c3a0e1664d75c5c7336ebb33bfbf1c804043abed08ff73bd75a1b8f

See more details on using hashes here.

File details

Details for the file pera_wallet-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pera_wallet-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for pera_wallet-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1ca38f3d20c9afb5a0e8eb633f380c15989aacab6f1462db7652777e9896113b
MD5 2ffb069865b0d9c6ba09ccf4b72a4467
BLAKE2b-256 8badb188463a2cda5451bf5ffb76091de194d1724d27d7155c483adf0aa66eb0

See more details on using hashes here.

Supported by

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