Skip to main content

Crate satrush_client

Crate satrush_client 

Source

Modules§

accounts
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.
gpa
getProgramAccounts queries: scan the program’s accounts by discriminator (account type) plus field filters, returning decoded accounts.
instructions
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.
test_utils
Mock swap route support for validation environments.
types
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.

Structs§

DecodedAccount

Enums§

MaybeAccount
SatrushError

Constants§

ASSOCIATED_TOKEN_PROGRAM_ID
SPL Associated Token Account program.
SATRUSH_ID
satrush program ID.
SLOT_HASHES_ID
SlotHashes sysvar.
SYSTEM_PROGRAM_ID
System program.
TILE_COUNT
Number of selectable tiles on the board.
TOKEN_PROGRAM_ID
SPL Token program.

Functions§

get_associated_token_address
Derive the canonical associated token account for wallet holding mint.
get_board_address
get_claim_instruction
claim: settle the miner authority’s deployment in a Settled round — credit winnings (USD + sats vault shares) and hashrate points to the miner profile, then close the deployment account, returning its rent. Valid for losing deployments too (they still earn hashrate points).
get_create_board_instruction
create_board: the board singleton, its USD/BTC pools and the initial round (id 1). Signed by the config’s admin authority.
get_create_epoch_vault_instruction
create_epoch_vault: the epoch vault singleton, its USD/BTC pools and the first iteration (id 1).
get_create_one_btc_vault_instruction
create_one_btc_vault: the 1 BTC vault singleton, its USD/BTC pools and the first iteration (id 1).
get_create_satrush_config_instruction
create_satrush_config: the config PDA holding authorities, mints and fee parameters. authority pays and must equal the program’s upgrade authority.
get_create_sats_vault_instruction
create_sats_vault: the sats vault singleton and its BTC reserve pool.
get_create_treasury_instruction
create_treasury: the treasury singleton and its USD fee pool.
get_deploy_public_instruction
deploy_public: stake amount USD (base units, gross of fees) on the tiles in selection_mask for round round_id, as the miner authority. The round must be the board’s current one and open for deploys; the miner profile and deployment record PDAs are created by the instruction.
get_epoch_vault_address
get_epoch_vault_entry_address
get_epoch_vault_iteration_address
get_epoch_vault_page_address
get_miner_address
get_one_btc_vault_address
get_one_btc_vault_iteration_address
get_public_deployment_address
get_rotate_round_instruction
rotate_round: reveal current_round_id’s winning tile and deploy round current_round_id + 1 as the board’s new active round. Signed by the config’s round authority; valid once the current round’s window elapsed.
get_round_address
get_satrush_config_address
get_sats_vault_address
get_swap_round_stake_instruction
swap_round_stake: relay a pre-built aggregator route that converts part of the revealed round’s USD into BTC. swap_data and route_accounts are the route’s opaque instruction data and account list; the on-chain handler enforces the economics against observed balance deltas. Signed by the config’s round authority.
get_treasury_address
selection_mask_from_tiles
Convert a fixed-size array of tile selections into the packed u32 selection mask expected by deploy_public: bit i is set when tiles[i] is true.
tiles_from_selection_mask
Inverse of selection_mask_from_tiles: unpack a u32 selection mask into a per-tile boolean array. Bits above TILE_COUNT are ignored.