oil-chat-api 0.0.2

API for interacting with the OIL chat protocol on Solana
Documentation

oil-chat-api

API for interacting with the OIL chat protocol on Solana.

Features

  • Instruction builders for all OIL chat instructions (SendMessage, ReplyToMessage, AddReaction, RemoveReaction)
  • State types and account deserialization (Config, Message, Reaction)
  • PDA derivation utilities
  • SDK functions for common operations
  • Support for Fogo Sessions

Usage

Add to your Cargo.toml:

[dependencies]
oil-chat-api = "0.0.1"
oil-api = "0.6.6"  # Required dependency

Example

use oil_chat_api::prelude::*;
use solana_program::pubkey::Pubkey;

// Derive a message PDA
let authority = Pubkey::new_unique();
let message_id = 0u64;
let (message_pda, _) = message_pda(authority, message_id);

// Derive config PDA
let (config_pda, _) = config_pda();

// Build a SendMessage instruction
let instruction = send_message(
    &signer,
    &authority,
    message_hash,
);

Program ID

The OIL chat program ID is: chatrzxmveLWpn9yVz7XycsevCGbfc1NwEPmsHZ3vV3

Documentation

Full documentation is available at https://docs.rs/oil-chat-api

License

Licensed under Apache-2.0