Skip to main content

Module utils

Module utils 

Source
Expand description

指令解析通用工具函数

Structs§

InnerInstructionsIndex
InnerInstructions 索引缓存

Functions§

calculate_price_impact_bps
计算价格影响基点
calculate_slippage_bps
计算滑点基点
create_metadata
创建事件元数据的通用函数
create_metadata_simple
创建事件元数据的兼容性函数(用于指令解析)
get_account
从账户列表中获取账户
get_instruction_account_getter
获取指令账户访问器 返回一个可以通过索引获取 Pubkey 的闭包
get_instruction_account_getter_indexed
使用预构建索引的账户获取器(O(1) 查找)
read_bool
从指令数据中读取布尔值
read_bytes
Read bytes from instruction data
read_i32_le
从指令数据中读取 i32(小端序)- SIMD 优化
read_pubkey
从指令数据中读取公钥 - SIMD 优化
read_pubkey_fast
快速读取 Pubkey(从字节数组)
read_str_unchecked
Read string with 4-byte length prefix (Borsh format) Returns (string slice, total bytes consumed including length prefix)
read_u8
从指令数据中读取 u8
read_u16_le
从指令数据中读取 u16(小端序)- SIMD 优化
read_u32_le
从指令数据中读取 u32(小端序)- SIMD 优化
read_u64_le
从指令数据中读取 u64(小端序)- SIMD 优化
read_u128_le
从指令数据中读取 u128(小端序)- SIMD 优化
read_vec_u64
从指令数据中读取u64向量(简化版本)