• Stars
    star
    179
  • Rank 214,039 (Top 5 %)
  • Language
    TypeScript
  • License
    Other
  • Created over 1 year ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Solana ChatGPT Plugin

A ChatGPT plugin for Solana. Install as an unverified plugin with url https://chatgpt.solanalabs.com.

Transfer Sol in ChatGPT Buy NFTs in ChatGPT Search NFTs in ChatGPT

Endpoints

ChatGPT can POST to the following resources, as described by .well-known/openapi.yaml.

/getAccountInfo { address }

Returns the output of getAccountInfo method from the RPC with buffer data, and if it can be deserialized by its program IDL, then the response payload has additional field called extended that has a JSON serialized string of the anchor data. Chat GPT's plugin model seems to be able to read this pretty well.

{
  ...,
  "extended": "{\"authority\":\"8fbqVvpK3Dj7fdP2c8JJhtD7Zy3n9qtwAeGfbkgPu625\",\"numMinted\":50}"
}
/getBalance { address }

Returns

{
  "sol": 0.40296
}
/getAssetsByOwner { address }

Returns the assets returned by the Metaplex Read API spec

/getTransaction { signature }

Accepts

{
  "signature": "h51pjmFcn8LkxejofUQoDYkyubUKaB7bNtyMMSCCamSEYRutS2G2vm2w1ERShko8boRqdaaTAs4MR6sGYkTByNF"
}

Returns the transaction status metadata for the getTransaction method from the Solana RPC.

/getTokenAccounts { address }

Returns the token accounts owned by a user with an amount > 0. Derived from the getTokenAccountsByOwner method on the Solana RPC.

/getSignaturesForAddress { address }

Returns the transaction signatures returned in getSignaturesForAddress method from the Solana RPC.

Endpoints for NFT discovery

These endpoints are under development and subject to rapid change. These currently use the Hyperspace API.

/getCollectionsByFloorPrice { maxFloorPrice, minFloorPrice, orderBy, pageSize }

Returns

{
  "projects": [
    {
      "id": "<hyperspace-collection-id or pubkey>",
      "desc": "collection description",
      "img": "collection image url",
      "website": "collection website url",
      "floor_price": 0.1
    }
  ],
  "hasMore": true,
  "currentPage'": 1
}
/getListedCollectionNFTs { projectId, pageSize, priceOrder }

Returns LLM friendly response of available NFTs:

{ 
  "listings": [
    {
      "price": 0.1,
      "token": "<token-address-pubkey>",
      "marketplace": "<marketplace-pubkey>"
    }
  ],
  "hasMore": true,
  "currentPage": 1
} 

Endpoints for Sending Transactions

/createBuyTransaction { token, price }

Right now we are trusting Hyperspace to craft a valid transaction for us. In the future we will setup a write interface for programs on Solana to adhere to in order to be a target of LLM transaction composition.

Returns

{
  "linkToSign": "<url-to-sign-transaction>" 
}
/createTransferSol { destination, amount }

Creates a transaction to transfer an amount in Sol.

Returns

{
  "linkToSign": "<url-to-sign-transaction>" 
}
/createTransferToken { destination, mint, amount }

Creates a transaction to transfer an amount of token (from the mint).

Returns

{
  "linkToSign": "<url-to-sign-transaction>" 
}

Endpoints for Transaction Composition (not LLM accessible)

These are also subject to change, and we may create actual webpages to inspect the transaction before signing. However for now, these are simply redirect links to ensure that SolanaPay QR codes show up in the ChatGPT link previews.

/page/:methodName

Returns a webpage with OpenGraph metadata that will be rendered in the ChatGPT rich link preview. All ChatGPT links should be proxied through this sort of pipeline to maximize user engagement of links. The og:image tag is to /qr/:methodName to show a SolanaPay QR code in link previews.

This is currently a blank page, but we may show a preview of the transaction in the future.

/qr/:methodName

Returns a PNG QR code that has been optimized to show in the particular aspect ratio of ChatGPT plugins. This just encodes a SolanaPay link that redirects to /sign/:methodName.

/sign/:methodName

This is the final redirect link that actually returns transaction bytes in a SolanaPay compatible format so users can sign transactions that are recommended by ChatGPT.

{
  "transaction": "<base64-encoded-transaction-bytes>"
}

Development

To install dependencies, just execute yarn. This project uses node with version >=16.17.0.

To start a development server, execute yarn dev. This will start the plugin available from localhost:3333 with its own configuration settings in .well-known-dev/.

License

This codebase is released under Apache License 2.0.

Disclaimer

By accessing or using this codebase or any of its components, you accept and agree with the Disclaimer.

More Repositories

1

solana

Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces.
Rust
12,934
star
2

solana-program-library

A collection of Solana programs maintained by Solana Labs
Rust
3,441
star
3

solana-web3.js

Solana JavaScript SDK
TypeScript
2,090
star
4

dapp-scaffold

Scaffolding for a dapp built on Solana
TypeScript
1,733
star
5

token-list

The community maintained Solana token registry
Go
1,470
star
6

wallet-adapter

Modular TypeScript wallet adapters and components for Solana applications.
TypeScript
1,180
star
7

solana-pay

A new standard for decentralized payments.
TypeScript
1,173
star
8

example-helloworld

Hello world on Solana
TypeScript
900
star
9

solana-season

337
star
10

break

Break Solana Game
TypeScript
300
star
11

governance-ui

TypeScript
293
star
12

explorer

Explorer for Solana clusters
TypeScript
222
star
13

defi-hackathon

170
star
14

octane

Octane is a gasless transaction relayer for Solana.
TypeScript
164
star
15

ecosystem

Project files for Solana ecosystem members
153
star
16

obsolete-spl-zk-token

Obsolete - don't use
Rust
145
star
17

oyster-swap

TypeScript
121
star
18

oyster

TypeScript
115
star
19

solana-solidity.js

Compile, deploy, and use Solidity contracts on Solana
TypeScript
115
star
20

solana-accountsdb-plugin-postgres

Rust
87
star
21

solana-payments-app

Solana Pay for Commerce Platforms
TypeScript
84
star
22

solana-bigtable

Shell
77
star
23

whitepaper

Solana whitepaper LaTeX source
TeX
71
star
24

perpetuals

Solana perpetuals reference implementation
Rust
71
star
25

dexterity

Reference implementation of a decentralized exchange for custom instruments, risk, and fees
Rust
69
star
26

oyster-lending

TypeScript
66
star
27

eslint-plugin-require-extensions

JavaScript
58
star
28

governance-program-library

Rust
48
star
29

wallet-standard

TypeScript
46
star
30

security-audits

Published security audits
45
star
31

solana-perf-libs

C and CUDA libraries to enhance Solana
C
41
star
32

solana-pay-scaffold

Scaffolding for a dapp using Solana Pay
TypeScript
41
star
33

example-token

Obsoleted by https://spl.solana.com/token (Token Example)
Rust
40
star
34

example-tictactoe

Tic-Tac-Toe built on Solana
JavaScript
37
star
35

obsolete-dontuse-example-webwallet

Example Solana Web-based Wallet
JavaScript
36
star
36

browser-extension

Solana Chrome Extension
TypeScript
35
star
37

wormhole-hackathon

34
star
38

example-messagefeed

Simple message feed built on Solana
JavaScript
34
star
39

solana-ping-api

solana ping api server
Go
33
star
40

platform-tools

Shell
30
star
41

cluster

Cluster Infrastructure
Shell
27
star
42

rust-bpf-sysroot

Rust sysroot source for Berkley Packet Filter Rust programs
C
20
star
43

governance-docs

JavaScript
20
star
44

solana-labs.github.io

Organization Pages
17
star
45

wbtc

TypeScript
17
star
46

auto-emissions

Python
16
star
47

example-move

Solana example which runs a Libra Move program
JavaScript
16
star
48

launchpad

Solana launchpad reference implementation
Rust
15
star
49

solana-voib-demo

Voice over Internet & Blockchain (VoIB) demo
Rust
15
star
50

buffer-layout-utils

TypeScript utilities for using buffer-layout with Solana programs
TypeScript
14
star
51

eslint-config-solana

ESLint rules to be shared across all Solana Labs projects
JavaScript
14
star
52

token-ops

Scripts and tools for token accounting and operation
Shell
14
star
53

networkexplorer

Retired
JavaScript
13
star
54

rust-bpf-builder

Dockerfile
13
star
55

network_simulation

Python
13
star
56

sealevel

A parallel runtime for layer 1 blockchains
12
star
57

token-aggregator

Aggregates tokens listed in onchain token registry
TypeScript
12
star
58

twamm

Solana twamm reference implementation
TypeScript
12
star
59

bench-tps-dos-test

UDP and QUIC dos test for buildkite using bench-tps utility
Shell
10
star
60

governance-api

TypeScript
10
star
61

farms

Solana Farms
Rust
10
star
62

interns-codehub

Public repo for Solana interns
TypeScript
10
star
63

solminer

Cross-platform Solana Replicator UI ⛏️
JavaScript
9
star
64

dc-homedir-skeleton

Base directory struct for the `solana` user on Solana's datacenter infrastructure
Shell
9
star
65

newlib

Newlib is a C library intended for use on embedded systems.
C
9
star
66

reddit-scaling-demo

Demo for Reddit scaling
Rust
9
star
67

solana-flagged-accounts

A community-maintained registry of flagged accounts
JavaScript
8
star
68

llvm-builder

Builds customized LLVM for Solana
Dockerfile
8
star
69

ledger-app-solana

Solana app for Ledger Wallet
8
star
70

tour-de-sol

Tour de SOL
Rust
8
star
71

bridge-adapter

TypeScript
8
star
72

secure-wrap-token

Rust
8
star
73

validator-tracker

https://metrics.solana.com:3000/d/jrdi4uUWz/validator-tracker
Shell
7
star
74

oyster-margin

7
star
75

governance-ui-landing

Governance UI Landing Page - realms.today
TypeScript
7
star
76

cargo-run-solana-tests

Cargo command to compile and run BPF test
Rust
7
star
77

contributor-access-policy

This document outlines the procedure for getting contributor access to various Solana Labs source code repositories
7
star
78

inc-20210825

Tool for audit and reclaim of delegated SPL Token accounts
Rust
6
star
79

prettier-config-solana

A Prettier config consistent to all Solana Labs projects
6
star
80

k8s-cluster

5
star
81

solana-pkcs8

A utility to parse DER-encoded PKCS #8 files
Rust
5
star
82

solana-graphql-playground

GraphQL web IDE for working with the Solana RPC-GraphQL resolver
TypeScript
5
star
83

kurtosis-solana-testing

Rust
5
star
84

solana-json-rpc-https-proxy

DEPRECATED - Provides a TLS proxy for web-based Solana JSON RPC users
Shell
4
star
85

solana-build

Rust
4
star
86

governance-sdk

Governance SDK
TypeScript
4
star
87

solana-tokens

Utility for distributing Solana tokens
4
star
88

oyster-bridge

3
star
89

oyster-gov

1
star
90

ipfs-ledger

1
star
91

sync_test

For developing a Github Action to sync solana-labs/solana from anza-xyz/agave
1
star
92

spl-token-subscription

Rust
1
star