Skip to main content

What is HD Merchant Wallet ?

It is a simple lightweight tool for receiving cryptocurrency payment, generating hd cryptocurrency wallet addresses and verifying payment made to an address. You can receive cryptocurrency payment easily in any python script or web app in just 3 simple steps. It perfectly works with electrum wallet so you can receive payment with this tool and spend your coins with electrum wallet.

Installation

pip install merchant-wallet

Running

  • Get your master public key from a local or personal wallet e.g Electrum.
  • Generate addresses with this script, addresses will correspond with addresses on your electrum wallet, so you can easily spend your coins.
  • Give address for payment and verify transaction using this tool.

Accept Bitcoin on a website In 3 Steps

      from merchant_wallet.backends.btc import BitcoinBackend
      
      
      btc = BitcoinBackend('master_public_key_gotten_from_an_offline_wallet')
      
      btc.generate_new_address(index=0) #index=0 will give the first address displayed on your electrum wallet, increase index to get more addresses as displayed on your wallet
      
      btc.confirm_address_payment(
        address="1Ge6rDuyCdYVGhXZjcK4251q67GXMKx6xK", total_crypto_amount=0.01, confirmation_number=3
      )#Confirm payment on the address with the specified confirmation and amount it will return a tuple of transaction status and value of transaction
      
      #Returned values
      #Unconfirmed payment -> (UNCONFIRMED_ADDRESS_BALANCE, transaction_hash)
      #Confirmed payment -> (CONFIRMED_ADDRESS_BALANCE, sent_value)
      #Underpaid payment -> (UNDERPAID_ADDRESS_BALANCE, remaining value)
      #No transaction -> (NO_HASH_ADDRESS_BALANCE, None )
      btc.confirm_address_payment(
        address="1Ge6rDuyCdYVGhXZjcK4251q67GXMKx6xK", total_crypto_amount=0.01, confirmation_number=5000, tx_hash='hash_returned_when_transaction_was_unconfirmed'
      )

Note

This tool depends on blockcypher for verifying blockchain transactions and uses forex-python tool for calculating crypto prices

Helper methods

  • bitcoin.convert_to_fiat( amount, currency)
  • bitcoin.convert_from_fiat(amount, currency)
  • Check tests for more

Todo

  • Add more crypto currency support
  • Add support for local private blockchain service e.g bitcoind

LICENSE

MIT

Metadata

Release files for merchant-wallet 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for merchant-wallet 0.1.2
File Size Uploaded Provenance
merchant_wallet-0.1.2.tar.gz 6.4 kB Without provenance Details

Release files / merchant_wallet-0.1.2.tar.gz

Download URL merchant_wallet-0.1.2.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9336b3fea9bbf271f88eacb22c43ea4e3ecc4646b339773abd93a08cf702afb4
BLAKE2b-256 checksum
How to use checksums
df55304aba07a6494b970c034376856386fd68fdf6051f035ef7f4b72a2157f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.5

Security for merchant-wallet 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page