sendfun-sdk 3.0.0

Rust SDK for send.fun programs
Documentation
#![allow(
	clippy::all,
	clippy::pedantic,
	clippy::nursery,
	clippy::expect_used,
	clippy::unwrap_used,
	clippy::indexing_slicing,
	clippy::allow_attributes,
	clippy::allow_attributes_without_reason,
	clippy::mem_forget,
	unfulfilled_lint_expectations,
	unexpected_cfgs,
	unused_imports
)]

//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/codama-idl/codama>
//!

use solana_address::Address;

use crate::nexus::generated::SEND_NEXUS_ID;

pub const FEE_PRESET_SEED: &'static [u8] =
	&[102, 101, 101, 95, 112, 114, 101, 115, 101, 116];
pub fn create_fee_preset_pda(
	platform_config: Address,
	index: u8,
	bump: u8,
) -> Result<solana_address::Address, solana_address::error::AddressError> {
	solana_address::Address::create_program_address(
		&[
			FEE_PRESET_SEED,
			platform_config.as_ref(),
			&index.to_le_bytes(),
			&[bump],
		],
		&SEND_NEXUS_ID,
	)
}
pub fn find_fee_preset_pda(
	platform_config: &Address,
	index: u8,
) -> (solana_address::Address, u8) {
	solana_address::Address::find_program_address(
		&[
			FEE_PRESET_SEED,
			platform_config.as_ref(),
			&index.to_le_bytes(),
		],
		&SEND_NEXUS_ID,
	)
}