pythonWalver Python SDK Documentation

The Walver SDKarrow-up-right provides a convenient way to interact with the Walver API from your Python applications. It offers both synchronous and asynchronous clients for creating and managing wallet verification links.

Installation

Install the SDK using pip:

pip install walver-sdk

Configuration

API Key

You can provide your API key in two ways:

  1. Pass it directly when initializing the client:

    from walver_sdk import Walver
    
    walver = Walver(api_key="your-api-key")
  2. Set it as an environment variable in your .env file:

    WALVER_API_KEY=your-api-key
    from walver_sdk import Walver
    
    walver = Walver()  # Will use the API key from .env

Base URL

By default, the client uses https://walver.io/. You can change this by passing the base_url parameter:

Timeout

The default timeout is 10 seconds. You can change this by passing the timeout parameter:

Synchronous Client

The Walver class provides synchronous methods for interacting with the API.

Creating a Verification

Parameters

Parameter
Type
Required
Description

id

string

Yes

A unique identifier for the verification

service_name

string

Yes

The name of your service (shown to users)

chain

string

Yes

The blockchain to use (e.g., "solana", "ethereum")

internal_id

string

No

An optional internal ID for your reference

webhook

string

No

URL to call when verification is complete

expiration

string/datetime

No

When the verification link expires

secret

string

No

A secret key for webhook security

redirect_url

string

No

URL to redirect after verification

one_time

boolean

No

If true, the link can only be used once

folder_id

string

No

ID of a folder to associate with

custom_fields

list

No

List of custom fields to collect

token_gate

boolean

No

Enable token gating

token_address

string

No

Token address for gating (required if token_gate=True)

token_amount

number

No

Minimum token amount (required if token_gate=True)

is_nft

boolean

No

Whether the token is an NFT

force_email_verification

boolean

No

Require email verification via OTP

force_telegram_verification

boolean

No

Require Telegram verification

force_twitter_verification

boolean

No

Require Twitter verification

force_discord_verification

boolean

No

Require Discord verification

Managing Folders

Creating a Folder

Getting All Folders

Getting a Specific Folder

Getting Verifications in a Folder

Managing API Keys

Creating an API Key

Getting All API Keys

Deleting an API Key

Asynchronous Client

The AsyncWalver class provides asynchronous methods for interacting with the API.

The async client provides the same methods as the synchronous client, but with async/await syntax.

Error Handling

The SDK raises exceptions for various error conditions:

Common exceptions:

  • ValueError: Raised for client-side validation errors

  • requests.HTTPError: Raised for server-side errors

  • requests.Timeout: Raised when the request times out

Custom Field Types

When creating verifications, you can specify various types of custom fields:

Type
Description

text

Simple text input

email

Email address with validation

url

URL with validation

twitter

Twitter handle

telegram

Telegram username

discord

Discord username

number

Numeric input with validation

date

Date input with validation

wallet

Wallet address with validation

Example:

Token Gating

You can create token-gated verifications by setting the token_gate parameter to True and providing the required token information:

Complete Examples

Basic Verification

Token-Gated Verification with Email

Folder Management

Last updated