An open API service indexing awesome lists of open source software.

https://github.com/christiansassi/phantom-api

Unofficial library for interacting with the Phantom Wallet API. For more info https://phantom.app
https://github.com/christiansassi/phantom-api

base bitcoin ethereum phantom-wallet polygon solana

Last synced: 4 months ago
JSON representation

Unofficial library for interacting with the Phantom Wallet API. For more info https://phantom.app

Awesome Lists containing this project

README

        

# Phantom Wallet API



## Table of contents

- [Introduction](#introduction)
- [Supported Chains](#supported-chains)
- [Functionalities](#functionalities)
- [Learn - learn.py](#learn---learnpy)
- [Quests - quests.py](#quests---questspy)
- [Tokens - tokens.py](#tokens---tokenspy)
- [Trending - trending.py](#trending---trendingpy)
- [Wallet - wallet.py](#wallet---walletpy)
- [Project Structure](#project-structure)
- [Getting Started](#getting-started)
- [What's Missing](#whats-missing)

## Introduction

Unofficial library for interacting with the [Phantom Wallet](https://phantom.app) API.

### Supported Chains




https://phantom.app



https://phantom.app



https://phantom.app



https://phantom.app



https://phantom.app



https://phantom.app

## Functionalities

### Learn - learn.py

- `learn`: Provides useful learning resources based on queried chains.

### Quests - quests.py

- `get_quests`: Retrieves available quests for specific wallets.

### Tokens - tokens.py

- `search_token`: Searches for tokens based on a query, chain IDs, and other filters.
- `get_token`: Retrieves information about a specific token based on its chain ID and address.
- `get_price`: Fetches the current price and 24-hour price change for a specific token.
- `get_price_history`: Retrieves price history of a token over a given time frame.

### Trending - trending.py

- `get_trending_tokens`: Returns a list of trending tokens based on various filters like time frame and sort criteria.
- `get_trending_dapps`: Fetches a list of trending decentralized applications (DApps).
- `get_trending_collections`: Gets trending collections based on ranking and time frame.

### Wallet - wallet.py

- `get_balance`: Retrieve balances for multiple wallets.
- `get_quotes`: Retrieve quotes for a specific swap, including cross-chain swaps.
- `get_best_quote`: Retrieve the best quote for a specific swap, including cross-chain swaps.
- `get_history`: Retrieve transaction history for multiple wallets.
- `get_pending_transactions`: Retrieve pending transactions for multiple wallets.

## Project Structure

```
.
└── phantom_api
├── core # Constants, enums, and core configurations
├── learn # Script related to learning resources
├── quests # Script to interact with quests
├── tokens # Scripts for token-related functionalities
├── trending # Scripts to fetch trending data (tokens, DApps, collections)
└── wallet # Scripts for wallet-related features
```

## Getting Started

1. Set up the workspace:

```bash
git clone https://github.com/christiansassi/phantom_api
cd phantom_api
pip install -r requirements.txt
```

2. You can now use the library in your Python script by importing the necessary modules from the `phantom_api` directory.

## What's Missing

- [TODO](https://github.com/christiansassi/phantom-api/blob/64f8a6ce7ab748b544578124c95d2466c928823e/phantom_api/wallet.py#L230) Implement seamless navigation between multiple transaction pages.
- This project does not yet support all RPC-based functions, such as token swapping.