Documentation
¶
Overview ¶
Package anchor computes the 8-byte discriminators the Anchor framework writes at the start of instruction data and program account data. It is pure logic over crypto/sha256 with no dependency on the rest of the SDK.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountDisc ¶
AccountDisc returns the 8-byte tag Anchor writes at the start of a program account's data: sha256("account:" + name)[:8]. name is the PascalCase Rust struct (e.g. "Pool", "UserPosition").
func MethodDisc ¶
MethodDisc returns the 8-byte discriminator Anchor emits at the start of an instruction's data: sha256("global:" + name)[:8]. name is the snake_case Rust method on the program (e.g. "initialize", "swap").
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.