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:
Check where you stand¶
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:
Complete KYC there; the status becomes VERIFIED once it's approved.
Claim the DID¶
Once VERIFIED, mint the on-chain identity:
- Calling it before you're
VERIFIEDraisesAccountNotVerified. - 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