pub struct Order {Show 39 fields
pub state: u8,
pub mode: u8,
pub from_balance: bool,
pub flags: u8,
pub bump: u8,
pub decimals: u8,
pub reserve_days: u8,
pub repo_id: u64,
pub issue: u64,
pub scope: [u8; 32],
pub seq: u32,
pub holdback_bps: u16,
pub kill_bps: u16,
pub amount: u64,
pub fee: u64,
pub rate: u64,
pub paid: u64,
pub deadline: i64,
pub not_before: i64,
pub hold_until: i64,
pub warranty_s: i64,
pub reserved_by: u64,
pub reserved_until: i64,
pub cancel_at: i64,
pub payee_id: u64,
pub funder_id: u64,
pub owner_id: u64,
pub arbiter_id: u64,
pub judge_repo_id: u64,
pub source: Pubkey,
pub refund_to: Pubkey,
pub rent_to: Pubkey,
pub mint: Pubkey,
pub terms: [u8; 32],
pub wf_repo: [u8; 32],
pub wf_sha: [u8; 40],
pub fee_bps: u16,
pub inc: u64,
pub grace: bool,
}Expand description
A work order as knos_pay stores it (512 bytes, version 2). An order that was paid out or refunded is gone.
Fields§
§state: u8§mode: u8§from_balance: bool§flags: u8§bump: u8§decimals: u8§reserve_days: u8§repo_id: u64§issue: u64§scope: [u8; 32]§seq: u32§holdback_bps: u16§kill_bps: u16§amount: u64§fee: u64§rate: u64§paid: u64§deadline: i64§not_before: i64§hold_until: i64§warranty_s: i64§reserved_by: u64§reserved_until: i64§cancel_at: i64§payee_id: u64§funder_id: u64§owner_id: u64§arbiter_id: u64§judge_repo_id: u64§source: Pubkey§refund_to: Pubkey§rent_to: Pubkey§mint: Pubkey§terms: [u8; 32]§wf_repo: [u8; 32]§wf_sha: [u8; 40]§fee_bps: u16§inc: u64The slot of the order’s funding plus one, which its judges’ markers are bound to (0: funded under 2.1).
grace: boolA pay token issued by the deadline is still taken for a grace after it, and no refund is taken before.
Implementations§
Source§impl Order
impl Order
Sourcepub fn parse(d: &[u8]) -> Option<Order>
pub fn parse(d: &[u8]) -> Option<Order>
The order’s fields, with no check of where the bytes came from: only their length and version.
Sourcepub fn read(
address: &Pubkey,
owner: &Pubkey,
data: &[u8],
program: &Pubkey,
) -> Option<Order>
pub fn read( address: &Pubkey, owner: &Pubkey, data: &[u8], program: &Pubkey, ) -> Option<Order>
An order read ON CHAIN from an account another program was handed: the account’s owner is program, and
its address is the one its own fields derive, so nothing else can pass for an order.
pub fn is(&self, flag: u8) -> bool
pub fn token_program(&self) -> Pubkey
pub fn address(&self, program: &Pubkey) -> Pubkey
Sourcepub fn refundable(&self, now: i64) -> bool
pub fn refundable(&self, now: i64) -> bool
Whether RefundOrder would be accepted at now: open past the deadline, or held past the hold. (An order with
grace is refunded only once its grace has passed as well: this does not count the grace.)