API reference
Program id xk7UkNkjzd9axDvF1eLrUqoVbyjaEaVJwj8siR3mXhK, Anchor 0.31.1.
Instructions
| Instruction | Arguments | Signer | Notes |
|---|---|---|---|
open_treasury | none | anyone | Once per accepted mint. Creates the books and both vaults. |
init_config | name_price: u64 | upgrade authority | Once. Pins the D00R mint, burn pools and name price. |
open_inbox | mint: Pubkey, bond: u64, window: i64, encryption_key: [u8; 32] | owner | Bond and window limits below. |
update_inbox | mint, bond, window, encryption_key, accepting: bool | owner | New terms for future knocks. |
send_knock | bond: u64, window: i64, reply_key: [u8; 32], message: Vec<u8> | sender | Must repeat the inbox's current terms. |
reply | message: Vec<u8> | recipient | 0 to 560 bytes, kept in transaction data only. |
mark_spam | none | recipient | Before expires_at. |
expire | none | anyone | At or after expires_at. |
crank_burn | amount: u64 | anyone | Burns D00R bought with spam fees. |
claim_name | name: String | inbox owner | Burns name_price D00R. |
release_name | none | inbox owner | Frees the name. |
Constants
| Constant | Value |
|---|---|
MIN_BOND | 1,000,000 (1 USDC), 10,000,000 lamports (0.01 SOL) |
MIN_WINDOW_SECS | 86,400 (1 day) |
MAX_WINDOW_SECS | 2,592,000 (30 days) |
MAX_MESSAGE_LEN | 560 bytes |
SPAM_FEE_BPS | 500 (5%) |
BURN_MAX_RESERVE_BPS | 10 (0.1% of the pool's input reserve per call) |
BURN_MIN_OUT_BPS | 9,800 (98% of the TWAP price) |
BURN_TWAP_SECS | 1,800 |
| Name length | 3 to 20 characters |
Account layouts
Inbox, after the 8-byte discriminator:
| Field | Type | Offset |
|---|---|---|
| owner | Pubkey | 8 |
| mint | Pubkey | 40 |
| bond | u64 | 72 |
| window | i64 | 80 |
| encryption_key | [u8; 32] | 88 |
| accepting | bool | 120 |
| received | u64 | 121 |
| replied | u64 | 129 |
| kept | u64 | 137 |
| expired | u64 | 145 |
| kept_amount | [u64; 2] | 153 |
| created_at | i64 | 169 |
| name | String | 177 |
Knock: recipient (8), sender (40), mint (72), bond (104), knocked_at (112), expires_at (120), reply_key (128), bump (160), message (161, length-prefixed).
Config: knock_mint (8), burn_pools (40), name_price (104), burned_by_fees (112), burned_by_names (120).
Treasury: mint (8), outstanding (40), fees_collected (48), fees_spent (56).
Events
| Event | Fields |
|---|---|
Knocked | recipient, sender, mint, bond, expires_at |
Replied | recipient, sender, bond_returned |
Kept | recipient, sender, to_recipient, fee |
Expired | recipient, sender, bond_returned |
Burned | fee_mint, fee_spent, knock_burned |
NameClaimed | owner, name, knock_burned |