Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit fec5717

Browse files
Tyera Eulbergmvines
authored andcommitted
More C headers
1 parent 8d0ba35 commit fec5717

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

token/program/inc/token.h

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,31 @@ typedef struct Token_Mint {
407407
Token_COption_Pubkey freeze_authority;
408408
} Token_Mint;
409409

410+
/**
411+
* A C representation of Rust's `std::option::Option`
412+
*/
413+
typedef enum Token_COption_u64_Tag {
414+
/**
415+
* No value
416+
*/
417+
Token_COption_u64_None_u64,
418+
/**
419+
* Some value `T`
420+
*/
421+
Token_COption_u64_Some_u64,
422+
} Token_COption_u64_Tag;
423+
424+
typedef struct Token_COption_u64_Token_Some_Body_u64 {
425+
uint64_t _0;
426+
} Token_COption_u64_Token_Some_Body_u64;
427+
428+
typedef struct Token_COption_u64 {
429+
Token_COption_u64_Tag tag;
430+
union {
431+
Token_COption_u64_Token_Some_Body_u64 some;
432+
};
433+
} Token_COption_u64;
434+
410435
/**
411436
* Account data.
412437
*/
@@ -433,9 +458,11 @@ typedef struct Token_Account {
433458
*/
434459
Token_AccountState state;
435460
/**
436-
* Is this a native token
461+
* If is_some, this is a native token, and the value logs the rent-exempt reserve. An Account
462+
* is required to be rent-exempt, so the value is used by the Processor to ensure that wrapped
463+
* SOL accounts do not drop below this threshold.
437464
*/
438-
bool is_native;
465+
Token_COption_u64 is_native;
439466
/**
440467
* The amount delegated
441468
*/
@@ -444,11 +471,6 @@ typedef struct Token_Account {
444471
* Optional authority to close the account.
445472
*/
446473
Token_COption_Pubkey close_authority;
447-
/**
448-
* An Account is required to be rent-exempt. This value logs the reserve required to be
449-
* rent-exempt so that wrapped SOL accounts do not drop below this threshold.
450-
*/
451-
uint64_t rent_exempt_reserve;
452474
} Token_Account;
453475

454476
/**

0 commit comments

Comments
 (0)