oil-mint-api
API for interacting with the OIL mint program on Solana. This crate provides instruction builders and state types for minting OIL tokens.
Features
- Instruction builders for OIL minting operations
- State types and account deserialization
- PDA derivation utilities for the authority account
- Type-safe instruction handling using
steelandbytemuck
Usage
Add to your Cargo.toml:
[]
= "0.0.1"
Example
use *;
use Pubkey;
// Derive the authority PDA
let = authority_pda;
// Build an Init instruction
let init_ix = init;
// Build a MintOIL instruction
let mint_ix = mint_oil; // amount in OIL (grams)
Modules
consts- Program constants including mint address, treasury address, and token configurationerror- Custom program error typesinstruction- Instruction types and builderssdk- High-level SDK functions for minting operationsstate- Account state types and PDA derivation functions
Instructions
init- Initialize the authority accountmint_oil- Mint OIL tokens to the treasury
Constants
MINT_ADDRESS- The OIL token mint addressTREASURY_ADDRESS- The treasury address authorized to request mintsTOKEN_DECIMALS- Token decimal precision (11)ONE_OIL- One OIL token in indivisible units (grams)MAX_MINT_AMOUNT- Maximum amount that can be minted per requestMAX_SUPPLY- Maximum token supply (21 million OIL)
Program ID
The OIL mint program ID is: minti1ANBuCm6bzkWqXprLRP1xiFurquUmtkA9qFNMa
Documentation
Full API documentation is available at:
- docs.rs: https://docs.rs/oil-mint-api
- Repository: https://github.com/oil-protocol/oil
License
Licensed under Apache-2.0
Related
- OIL API - Main OIL protocol API
- OIL Protocol - Protocol website