Documentation
¶
Index ¶
- Variables
- func NewDepositSolInstruction(accountParam [20]uint8, referenceParam [32]uint8, amountParam uint64, ...) (solanago.Instruction, error)
- func NewDepositSplInstruction(accountParam [20]uint8, referenceParam [32]uint8, amountParam uint64, ...) (solanago.Instruction, error)
- func NewExecuteInstruction(toParam solanago.PublicKey, mintParam solanago.PublicKey, amountParam uint64, ...) (solanago.Instruction, error)
- func NewInitializeInstruction(signersParam []solanago.PublicKey, thresholdParam uint8, chainIdParam uint64, ...) (solanago.Instruction, error)
- func NewUpdateSignersInstruction(newSignersParam []solanago.PublicKey, newThresholdParam uint8, ...) (solanago.Instruction, error)
- func ParseAnyAccount(accountData []byte) (any, error)
- func ParseAnyEvent(eventData []byte) (any, error)
- type Config
- type Deposited
- type Executed
- type SignersUpdated
- type WithdrawalRecord
Constants ¶
This section is empty.
Variables ¶
var ( Account_Config = [8]byte{155, 12, 170, 224, 30, 250, 204, 130} Account_WithdrawalRecord = [8]byte{88, 59, 154, 202, 216, 210, 211, 237} )
Account discriminators
var ( Event_Deposited = [8]byte{111, 141, 26, 45, 161, 35, 100, 57} Event_Executed = [8]byte{8, 232, 139, 132, 197, 45, 29, 164} Event_SignersUpdated = [8]byte{71, 177, 47, 237, 194, 42, 20, 105} )
Event discriminators
var ( Instruction_DepositSol = [8]byte{108, 81, 78, 117, 125, 155, 56, 200} Instruction_DepositSpl = [8]byte{224, 0, 198, 175, 198, 47, 105, 204} Instruction_Execute = [8]byte{130, 221, 242, 154, 13, 193, 189, 29} Instruction_Initialize = [8]byte{175, 175, 109, 31, 13, 152, 155, 237} Instruction_UpdateSigners = [8]byte{228, 82, 68, 150, 92, 66, 140, 174} )
Instruction discriminators
var ProgramID = solanago.MustPublicKeyFromBase58("98eVpih8X9CAcgU9bzNB9V7VtkRrnFZUmqzEnsq7cfmg")
Functions ¶
func NewDepositSolInstruction ¶
func NewDepositSolInstruction( accountParam [20]uint8, referenceParam [32]uint8, amountParam uint64, depositorAccount solanago.PublicKey, vaultAccount solanago.PublicKey, systemProgramAccount solanago.PublicKey, eventAuthorityAccount solanago.PublicKey, programAccount solanago.PublicKey, ) (solanago.Instruction, error)
Builds a "deposit_sol" instruction. Native SOL deposit crediting the 20-byte clearnet `account`, with an // optional ADR-015 sub-account `reference` ([0u8; 32] for none).
func NewDepositSplInstruction ¶
func NewDepositSplInstruction( accountParam [20]uint8, referenceParam [32]uint8, amountParam uint64, depositorAccount solanago.PublicKey, mintAccount solanago.PublicKey, depositorAtaAccount solanago.PublicKey, vaultAccount solanago.PublicKey, vaultAtaAccount solanago.PublicKey, tokenProgramAccount solanago.PublicKey, associatedTokenProgramAccount solanago.PublicKey, eventAuthorityAccount solanago.PublicKey, programAccount solanago.PublicKey, ) (solanago.Instruction, error)
Builds a "deposit_spl" instruction. SPL token deposit crediting the 20-byte clearnet `account`, with an // optional ADR-015 sub-account `reference` ([0u8; 32] for none).
func NewExecuteInstruction ¶
func NewExecuteInstruction( toParam solanago.PublicKey, mintParam solanago.PublicKey, amountParam uint64, withdrawalIdParam [32]uint8, sigIxIndexParam uint8, deadlineParam int64, feePayerAccount solanago.PublicKey, configAccount solanago.PublicKey, vaultAccount solanago.PublicKey, withdrawalAccount solanago.PublicKey, recipientAccount solanago.PublicKey, instructionsAccount solanago.PublicKey, systemProgramAccount solanago.PublicKey, eventAuthorityAccount solanago.PublicKey, programAccount solanago.PublicKey, ) (solanago.Instruction, error)
Builds a "execute" instruction. Execute a quorum-authorized withdrawal (native or SPL).
func NewInitializeInstruction ¶
func NewInitializeInstruction( signersParam []solanago.PublicKey, thresholdParam uint8, chainIdParam uint64, configAccount solanago.PublicKey, payerAccount solanago.PublicKey, programAccount solanago.PublicKey, programDataAccount solanago.PublicKey, systemProgramAccount solanago.PublicKey, ) (solanago.Instruction, error)
Builds a "initialize" instruction. One-time setup of the Config PDA (signer set, threshold, chain_id).
func NewUpdateSignersInstruction ¶
func NewUpdateSignersInstruction( newSignersParam []solanago.PublicKey, newThresholdParam uint8, sigIxIndexParam uint8, configAccount solanago.PublicKey, instructionsAccount solanago.PublicKey, eventAuthorityAccount solanago.PublicKey, programAccount solanago.PublicKey, ) (solanago.Instruction, error)
Builds a "update_signers" instruction. In-place signer rotation (ADR-013 Flow A).
func ParseAnyAccount ¶
func ParseAnyEvent ¶
Types ¶
type Config ¶
type Config struct {
Signers []solanago.PublicKey `json:"signers"`
Threshold uint8 `json:"threshold"`
SignerNonce uint64 `json:"signerNonce"`
ChainId uint64 `json:"chainId"`
Bump uint8 `json:"bump"`
}
Config PDA — seeds `["config"]`. The on-chain analogue of `Custody.sol`'s signer set + threshold + nonce. `signers` is kept strictly ascending so a linear membership scan in the Ed25519 verifier is unambiguous.
func ParseAccount_Config ¶
func UnmarshalConfig ¶
func (Config) MarshalWithEncoder ¶
type Deposited ¶
type Deposited struct {
Depositor solanago.PublicKey `json:"depositor"`
Account [20]uint8 `json:"account"`
Reference [32]uint8 `json:"reference"`
Mint solanago.PublicKey `json:"mint"`
Amount uint64 `json:"amount"`
}
Emitted by `deposit_sol` / `deposit_spl` via `emit_cpi!`. The custody watcher decodes these from the self-CPI inner instructions and turns each into a `chains.DepositEvent`. `mint == Pubkey::default()` denotes native SOL (the analogue of EVM's `asset == address(0)`). `account` is the 20-byte clearnet account the deposit credits. `reference` is the ADR-015 opaque sub-account selector ([0u8; 32] when absent); never interpreted on-chain, the watcher folds it into the account URI as a /tag/<reference> suffix.
func ParseEvent_Deposited ¶
func UnmarshalDeposited ¶
func (Deposited) MarshalWithEncoder ¶
type Executed ¶
type Executed struct {
WithdrawalId [32]uint8 `json:"withdrawalId"`
To solanago.PublicKey `json:"to"`
Mint solanago.PublicKey `json:"mint"`
Amount uint64 `json:"amount"`
}
Emitted by `execute` via `emit_cpi!`. The watcher writes a ledger row keyed by `withdrawal_id` (the reconciliation key against `signing_wal`).
func ParseEvent_Executed ¶
func UnmarshalExecuted ¶
func (Executed) MarshalWithEncoder ¶
type SignersUpdated ¶
type SignersUpdated struct {
Signers []solanago.PublicKey `json:"signers"`
Threshold uint8 `json:"threshold"`
SignerNonce uint64 `json:"signerNonce"`
}
Emitted by `update_signers` via `emit_cpi!`.
func ParseEvent_SignersUpdated ¶
func ParseEvent_SignersUpdated(eventData []byte) (*SignersUpdated, error)
func UnmarshalSignersUpdated ¶
func UnmarshalSignersUpdated(buf []byte) (*SignersUpdated, error)
func (SignersUpdated) Marshal ¶
func (obj SignersUpdated) Marshal() ([]byte, error)
func (SignersUpdated) MarshalWithEncoder ¶
func (obj SignersUpdated) MarshalWithEncoder(encoder *binary.Encoder) (err error)
func (*SignersUpdated) Unmarshal ¶
func (obj *SignersUpdated) Unmarshal(buf []byte) error
func (*SignersUpdated) UnmarshalWithDecoder ¶
func (obj *SignersUpdated) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)
type WithdrawalRecord ¶
type WithdrawalRecord struct {
To solanago.PublicKey `json:"to"`
Mint solanago.PublicKey `json:"mint"`
Amount uint64 `json:"amount"`
}
WithdrawalRecord PDA — seeds `["withdrawal", withdrawal_id]`. Its mere existence is the replay guard: `execute` creates it with `init`, so a second execution of the same `withdrawal_id` fails at account creation. The analogue of `Custody.sol`'s `executed[withdrawalId]` storage slot; never closed (closing would re-enable replay).
func ParseAccount_WithdrawalRecord ¶
func ParseAccount_WithdrawalRecord(accountData []byte) (*WithdrawalRecord, error)
func UnmarshalWithdrawalRecord ¶
func UnmarshalWithdrawalRecord(buf []byte) (*WithdrawalRecord, error)
func (WithdrawalRecord) Marshal ¶
func (obj WithdrawalRecord) Marshal() ([]byte, error)
func (WithdrawalRecord) MarshalWithEncoder ¶
func (obj WithdrawalRecord) MarshalWithEncoder(encoder *binary.Encoder) (err error)
func (*WithdrawalRecord) Unmarshal ¶
func (obj *WithdrawalRecord) Unmarshal(buf []byte) error
func (*WithdrawalRecord) UnmarshalWithDecoder ¶
func (obj *WithdrawalRecord) UnmarshalWithDecoder(decoder *binary.Decoder) (err error)