Skip to content

Log in & claim a Digital Identity

Reads (prices, quotes, balances) work without any of this. Trading requires two things: an authenticated session, and a KYC-verified Digital Identity (DID) minted to your wallet.

Log in

from primedelta import PrimeDelta

pd = PrimeDelta(private_key="0x…", web3_provider_url=RPC, network="testnet")
pd.login()          # signs a SIWE message with your signer
pd.logged_in()      # -> True

login() takes no arguments — it fetches a nonce, signs a Sign-In-With-Ethereum message, and posts it. By default the client re-logs in automatically if the session expires (auto_relogin=True).

Reuse a session instead of logging in every run:

cookies = pd.export_session()
# later, on a fresh client:
pd.import_session(cookies)

Check where you stand

status = pd.get_account_status()
print(status)

AccountStatus moves through these states:

State Meaning
NOT_VERIFIED KYC not started
PENDING KYC under review
VERIFIED KYC passed — ready to mint a DID
DID_MINTED DID minted — you can trade

Verify (KYC)

If you're not VERIFIED yet, open the verification flow:

print(pd.verification_url())   # the KYC URL
pd.open_verification_page()    # opens it in a browser

Complete KYC there; the status becomes VERIFIED once it's approved.

Claim the DID

Once VERIFIED, mint the on-chain identity:

tx = pd.claim_digital_identity()   # returns a tx hash; status -> DID_MINTED
  • Calling it before you're VERIFIED raises AccountNotVerified.
  • Calling it again after it's minted raises DigitalIdentityAlreadyClaimed.

Confirm on-chain

pd.did_token_id()   # the DID token id (None if not minted)
pd.is_valid()       # DID is valid on-chain
pd.is_pro()         # pro flag

Every swap and liquidity add checks that your status is DID_MINTED first — if it isn't, the call raises before touching the chain.


Ready to trade → Place a swap