Skip to main content

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

Release files for pancakeswap-lottery 0.1.1

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

Source distribution (sdist)

Source distribution for pancakeswap-lottery 0.1.1
File Size Uploaded
pancakeswap-lottery-0.1.1.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pancakeswap-lottery 0.1.1
File Interpreter ABI Platform
pancakeswap_lottery-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / pancakeswap-lottery-0.1.1.tar.gz

Download URL pancakeswap-lottery-0.1.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3f6252c48a3f9ecc7e3a61e76de273b0ace3b18a58149f05cceba3d4024f72e6
BLAKE2b-256 checksum
How to use checksums
ff25c38b78da67203ad43d179c807e5c9bb9fda4de95379a77bc4c3b91b0af0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.8.5 Linux/4.15.0-122-generic

Release files / pancakeswap_lottery-0.1.1-py3-none-any.whl

Download URL pancakeswap_lottery-0.1.1-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48b2ce6da12c0a483e4e95aff4087c573ab7e9076b450ffa9d3a44adbbdf7fb3
BLAKE2b-256 checksum
How to use checksums
7bba4454744ff16a0a37f6a030dd86e589eced496f826502a733cd558e46b25f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.8.5 Linux/4.15.0-122-generic

Release history Release notifications | RSS feed

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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