Skip to main content

token-gate-ucashpay

Zero-dependency on-chain token-gating for U.CASH. Verify a wallet holds a minimum amount of UCASH (or any ERC-20, or the native coin) to gate access: memberships, premium tiers, content paywalls, role grants. No keys, no signing, just a read-only RPC balance check.

Install

pip install token-gate-ucashpay

From source: pip install git+https://github.com/UdotCASH/token-gate-ucashpay.

Installs a token-gate CLI: token-gate 0xWALLET 100 any returns PASS/FAIL (exit code 0/1). Python and JavaScript, zero dependencies.

Use it to:

  • Gate a Discord role, a membership, or a page by UCASH holdings.
  • Verify any ERC-20 (or native) balance on any EVM chain.
  • Tie into U.CASH's "verify holdings" premium tiers + custom-token gating.

UCASH gating

from token_gate import holds_ucash, holds_ucash_any_chain

ok, balance = holds_ucash("0xWALLET", 100, chain="ethereum")      # one chain
ok, balance, chain = holds_ucash_any_chain("0xWALLET", 100)        # ETH or Polygon or Base
if ok:
    grant_access()
const { holdsUcash, holdsUcashAnyChain } = require('./token-gate.js');
const { ok, balance } = await holdsUcash('0xWALLET', 100, 'base');
const { ok, chain } = await holdsUcashAnyChain('0xWALLET', 100);

CLI: python token_gate.py 0xWALLET 100 anyPASS/FAIL.

Any token / native

holds(rpc_url, wallet, min_amount, token_address="0xTOKEN", decimals=18)
holds(rpc_url, wallet, min_amount)  # native coin (ETH/MATIC/...), 18 decimals

UCASH contracts

Ethereum 0x92e52a1A235d9A103D970901066CE910AAceFD37, Polygon 0xA94880d3A4b39746E90Cdb57f8De3732c984DE14, Base 0x26cf750abAf38aF7109Effdbdf79bA50d2EE09A1 (8 decimals).

License

MIT.

Download files

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

Source Distribution

token_gate_ucashpay-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

token_gate_ucashpay-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file token_gate_ucashpay-0.1.0.tar.gz.

File metadata

  • Download URL: token_gate_ucashpay-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for token_gate_ucashpay-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9931813de0cd485b0be3b3896babbfa585c3a233eb99c6a3b7bc5372a384d56c
MD5 b65a5ee33eb8bff1c6324c1627eb9d58
BLAKE2b-256 9a481c97bbffab7b935ec54d51cafe9ea483ff2f25e908c30f15b1c69683da07

See more details on using hashes here.

File details

Details for the file token_gate_ucashpay-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for token_gate_ucashpay-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 240d545de12f91dcf8bdc666ad0812b020d633619e9961624a2f2a6b1e59242a
MD5 09a48c55ea3aa8b34440c26d8f24f0b5
BLAKE2b-256 fa32dfd9f11d62dcdd1715cfe94c50068e8142ce09fc409264a1d1968ed0ca36

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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