Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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: 12 days 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


https://phantom.app

## Table of contents

- [Introduction](##introduction)
- [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)

## Introduction

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

> [!IMPORTANT]
> This project currently does not support swap functions.

## Functionalities

### Learn - learn.py

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

### Quests - quests.py

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

### 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.

## 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.