Skip to main content

A Python client for accessing PancakeSwap Lottery smart contract information through Web3.py

Project description

PancakeSwap Lottery - Web3 client

A Python client for accessing PancakeSwap Lottery smart contract information through Web3.py.

Install

$ pip install pancakeswap-lottery

Documentation

from pancakeswap_lottery import Lottery

lottery = Lottery()

Realtime data

get_issue_index

>>> lottery.get_issue_index()
435

get_total_amount (Prize pool)

>>> lottery.get_total_amount()
34977.25

get_allocation (Prize pool allocation)

>>> lottery.get_allocation()
{'1': 50, '2': 20, '3': 10}

get_total_addresses

>>> lottery.get_total_addresses()
200

get_drawed

>>> lottery.get_drawed()
False

get_drawing_phase

>>> lottery.get_drawing_phase()
False

get_last_timestamp

>>> lottery.get_last_timestamp(epoch=False)
2021-03-27 11:38:49

Historical data (using issue index)

get_total_rewards (Prize pool)

>>> lottery.get_total_rewards(432)
51384.125

get_history_numbers

>>> lottery.get_history_numbers(432)
[2, 13, 7, 3]

get_history_amount (Numers of tickets matched)

>>> lottery.get_history_amount(432)
{'4': 1, '3': 34, '2': 718}

get_matching_reward_amount

>>> lottery.get_matching_reward_amount(432, 3)
34

Historical data (using tokenid)

get_lottery_numbers

>>> lottery.get_lottery_numbers(1328060)
[11, 5, 14, 6]

get_reward_view

>>> lottery.get_reward_view(1328060)
0

Lottery metadata

get_max_number

>>> lottery.get_max_number()
14

get_min_price

>>> lottery.get_min_price()
1

Other

get_cake (CAKE contract address)

>>> lottery.get_cake()
0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82

get_lotteryNFT (PLT-token contract address)

>>> lottery.get_lotteryNFT()
0x5e74094Cd416f55179DBd0E45b1a8ED030e396A1

get_balance_of(address)

>>> lottery.get_balance_of("0xc13456A34305e9265E907F70f76B1BA6E2055c8B")
2673

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

pancakeswap-lottery-0.1.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

pancakeswap_lottery-0.1.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file pancakeswap-lottery-0.1.1.tar.gz.

File metadata

  • Download URL: pancakeswap-lottery-0.1.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.8.5 Linux/4.15.0-122-generic

File hashes

Hashes for pancakeswap-lottery-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3f6252c48a3f9ecc7e3a61e76de273b0ace3b18a58149f05cceba3d4024f72e6
MD5 a02f3aed4f6755faa6ab6d2233f0394e
BLAKE2b-256 ff25c38b78da67203ad43d179c807e5c9bb9fda4de95379a77bc4c3b91b0af0d

See more details on using hashes here.

File details

Details for the file pancakeswap_lottery-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pancakeswap_lottery-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.8.5 Linux/4.15.0-122-generic

File hashes

Hashes for pancakeswap_lottery-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 48b2ce6da12c0a483e4e95aff4087c573ab7e9076b450ffa9d3a44adbbdf7fb3
MD5 e6e743888598d4dcb1c144c869b7cab7
BLAKE2b-256 7bba4454744ff16a0a37f6a030dd86e589eced496f826502a733cd558e46b25f

See more details on using hashes here.

Supported by

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