Leap Wallet Python API Docs | dltHub

Build a Leap Wallet-to-database pipeline in Python using dlt with AI Workbench support for Claude Code, Cursor, and Codex.

Last updated:

Leap Wallet is a browser/mobile wallet provider for Cosmos chains that injects a window.leap provider exposing connect and signer methods for dApps. The REST API base URL is `` and Authentication is handled via user consent through the browser/mobile wallet (window.leap.enable), not by API keys for the Connect provider..

dlt is an open-source Python library that handles authentication, pagination, and schema evolution automatically. dlthub provides AI context files that enable code assistants to generate production-ready pipelines. Install with uv pip install "dlt[workspace]" and start loading Leap Wallet data in under 10 minutes.


What data can I load from Leap Wallet?

Here are some of the endpoints you can load from Leap Wallet:

ResourceEndpointMethodData selectorDescription
provider_enablewindow.leap.enable(chainId)JS methodPrompts user to grant dApp permission to access Leap for given chain(s).
get_keywindow.leap.getKey(chainId)JS method (returns Promise)Returns a Key object: { name, algo, pubKey, address, bech32Address, isNanoLedger }.
get_supported_chainswindow.leap.getSupportedChains()JS method(top-level array)Returns an array of supported chain objects/ids.
get_offline_signer_accountsofflineSigner.getAccounts()JS method(top-level array)Returns an array of account objects (address/pubkey entries) from the offline signer.
sign_directwindow.leap.signDirect(chainId, signer, signDoc, options)JS methodSigns protobuf transactions (DirectSign) and returns DirectSignResponse.
sign_aminowindow.leap.signAmino(chainId, signer, signDoc, options)JS methodSigns Amino‑encoded StdSignDoc and returns AminoSignResponse.
sign_arbitrarywindow.leap.signArbitrary(chainId, signerAddress, data)JS methodReturns StdSignature for arbitrary data.
send_txwindow.leap.sendTx(chainId, tx, mode)JS methodDelegates transaction broadcasting to Leap’s configured LCD endpoints; returns transaction hash (or Uint8Array).
suggest_cw20window.leap.suggestCW20Token(chainId, contractAddress)JS methodSuggests a CW20 token to the wallet for user to add.
is_connectedwindow.leap.isConnected(chainId)JS methodReturns boolean indicating connection status.
disconnectwindow.leap.disconnect(chainId)JS methodDisconnects the dApp from the wallet (returns boolean).

How do I authenticate with the Leap Wallet API?

dApps request permission by calling window.leap.enable(chainId|[chainIds]) which opens the wallet UI for user approval; subsequent signing/broadcasting calls use the unlocked wallet and returned signer objects. No bearer/API token is required for the in-page provider.

1. Get your credentials

  1. Instruct users to install Leap Wallet (desktop extension or mobile app).
  2. From the dApp call window.leap.enable(chainId) (or an array of chainIds).
  3. The user approves the request in the Leap UI; the provider becomes available as window.leap.
  4. Use window.leap.getKey or window.leap.getOfflineSignerAuto to obtain signer objects for further calls.

2. Add them to .dlt/secrets.toml

[sources.leap_wallet_source]

dlt reads this automatically at runtime — never hardcode tokens in your pipeline script. For production environments, see setting up credentials with dlt for environment variable and vault-based options.


How do I set up and run the pipeline?

Set up a virtual environment and install dlt:

uv venv && source .venv/bin/activate uv pip install "dlt[workspace]"

1. Install the dlt AI Workbench:

dlt ai init --agent <your-agent> # <agent>: claude | cursor | codex

This installs project rules, a secrets management skill, appropriate ignore files, and configures the dlt MCP server for your agent. Learn more →

2. Install the rest-api-pipeline toolkit:

dlt ai toolkit rest-api-pipeline install

This loads the skills and context about dlt the agent uses to build the pipeline iteratively, efficiently, and safely. The agent uses MCP tools to inspect credentials — it never needs to read your secrets.toml directly. Learn more →

3. Start LLM-assisted coding:

Use /find-source to load data from the Leap Wallet API into DuckDB.

The rest-api-pipeline toolkit takes over from here — it reads relevant API documentation, presents you with options for which endpoints to load, and follows a structured workflow to scaffold, debug, and validate the pipeline step by step.

4. Run the pipeline:

python leap_wallet_pipeline.py

If everything is configured correctly, you'll see output like this:

Pipeline leap_wallet_pipeline load step completed in 0.26 seconds 1 load package(s) were loaded to destination duckdb and into dataset leap_wallet_data The duckdb destination used duckdb:/leap_wallet.duckdb location to store data Load package 1749667187.541553 is LOADED and contains no failed jobs

Inspect your pipeline and data:

dlt pipeline leap_wallet_pipeline show

This opens the Pipeline Dashboard where you can verify pipeline state, load metrics, schema (tables, columns, types), and query the loaded data directly.


Python pipeline example

This example loads getKey and sendTx from the Leap Wallet API into DuckDB. It mirrors the endpoint and data selector configuration from the table above:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def leap_wallet_source(=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "", "auth": { "type": "", "": , }, }, "resources": [ {"name": "get_key", "endpoint": {"path": "window.leap.getKey(chainId)"}}, {"name": "send_tx", "endpoint": {"path": "window.leap.sendTx(chainId, tx, mode)"}} ], } yield from rest_api_resources(config) def get_data() -> None: pipeline = dlt.pipeline( pipeline_name="leap_wallet_pipeline", destination="duckdb", dataset_name="leap_wallet_data", ) load_info = pipeline.run(leap_wallet_source()) print(load_info)

To add more endpoints, append entries from the resource table to the "resources" list using the same name, path, and data_selector pattern.


How do I query the loaded data?

Once the pipeline runs, dlt creates one table per resource. You can query with Python or SQL.

Python (pandas DataFrame):

import dlt data = dlt.pipeline("leap_wallet_pipeline").dataset() sessions_df = data.get_key.df() print(sessions_df.head())

SQL (DuckDB example):

SELECT * FROM leap_wallet_data.get_key LIMIT 10;

In a marimo or Jupyter notebook:

import dlt data = dlt.pipeline("leap_wallet_pipeline").dataset() data.get_key.df().head()

See how to explore your data in marimo Notebooks and how to query your data in Python with dataset.


What destinations can I load Leap Wallet data to?

dlt supports loading into any of these destinations — only the destination parameter changes:

DestinationExample value
DuckDB (local, default)"duckdb"
PostgreSQL"postgres"
BigQuery"bigquery"
Snowflake"snowflake"
Redshift"redshift"
Databricks"databricks"
Filesystem (S3, GCS, Azure)"filesystem"

Change the destination in dlt.pipeline(destination="snowflake") and add credentials in .dlt/secrets.toml. See the full destinations list.


Troubleshooting

Wallet not installed or provider unavailable

If window.leap is undefined the Leap extension/app is not installed or blocked. Prompt the user to install Leap or use the dynamic install link; check content‑security‑policy settings that could block injection.

User denied permission or wallet locked

window.leap.enable will reject or throw if the user denies permission or the wallet is locked; handle rejections and present a retry/UX to unlock the wallet.

Signing/broadcast errors

signAmino, signDirect, or sendTx may throw errors or reject promises if the signer/account is absent, the signDoc is malformed, fees are insufficient, or the wallet’s configured LCD node returns a broadcast error. Surface wallet‑provided error messages and log transaction broadcast error responses (they originate from the LCD).

No REST base URL / no API key

Leap Connect is an in‑page provider; there is no REST base URL or API key to place in secrets.toml. If remote API calls are needed (e.g., Leap/Skip backend services) consult the specific Skip API docs – those are separate services and require their own keys.

Ensure that the API key is valid to avoid 401 Unauthorized errors. Also, verify endpoint paths and parameters to avoid 404 Not Found errors.


Next steps

Continue your data engineering journey with the other toolkits of the dltHub AI Workbench:

  • data-exploration — Build custom notebooks, charts, and dashboards for deeper analysis with marimo notebooks.
  • dlthub-runtime — Deploy, schedule, and monitor your pipeline in production.
dlt ai toolkit data-exploration install dlt ai toolkit dlthub-runtime install

Was this page helpful?

Community Hub

Need more dlt context for Leap Wallet?

Request dlt skills, commands, AGENT.md files, and AI-native context.