token.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. /* Autogenerated SPL Token program C Bindings */
  2. #pragma once
  3. #include <stdarg.h>
  4. #include <stdbool.h>
  5. #include <stdint.h>
  6. #include <stdlib.h>
  7. /**
  8. * Minimum number of multisignature signers (min N)
  9. */
  10. #define Token_MIN_SIGNERS 1
  11. /**
  12. * Maximum number of multisignature signers (max N)
  13. */
  14. #define Token_MAX_SIGNERS 11
  15. /**
  16. * Account state.
  17. */
  18. enum Token_AccountState
  19. #ifdef __cplusplus
  20. : uint8_t
  21. #endif // __cplusplus
  22. {
  23. /**
  24. * Account is not yet initialized
  25. */
  26. Token_AccountState_Uninitialized,
  27. /**
  28. * Account is initialized; the account owner and/or delegate may perform permitted operations
  29. * on this account
  30. */
  31. Token_AccountState_Initialized,
  32. /**
  33. * Account has been frozen by the mint freeze authority. Neither the account owner nor
  34. * the delegate are able to perform operations on this account.
  35. */
  36. Token_AccountState_Frozen,
  37. };
  38. #ifndef __cplusplus
  39. typedef uint8_t Token_AccountState;
  40. #endif // __cplusplus
  41. /**
  42. * Specifies the authority type for SetAuthority instructions
  43. */
  44. enum Token_AuthorityType
  45. #ifdef __cplusplus
  46. : uint8_t
  47. #endif // __cplusplus
  48. {
  49. /**
  50. * Authority to mint new tokens
  51. */
  52. Token_AuthorityType_MintTokens,
  53. /**
  54. * Authority to freeze any account associated with the Mint
  55. */
  56. Token_AuthorityType_FreezeAccount,
  57. /**
  58. * Owner of a given token account
  59. */
  60. Token_AuthorityType_AccountOwner,
  61. /**
  62. * Authority to close a token account
  63. */
  64. Token_AuthorityType_CloseAccount,
  65. };
  66. #ifndef __cplusplus
  67. typedef uint8_t Token_AuthorityType;
  68. #endif // __cplusplus
  69. typedef uint8_t Token_Pubkey[32];
  70. /**
  71. * A C representation of Rust's `std::option::Option`
  72. */
  73. typedef enum Token_COption_Pubkey_Tag {
  74. /**
  75. * No value
  76. */
  77. Token_COption_Pubkey_None_Pubkey,
  78. /**
  79. * Some value `T`
  80. */
  81. Token_COption_Pubkey_Some_Pubkey,
  82. } Token_COption_Pubkey_Tag;
  83. typedef struct Token_COption_Pubkey {
  84. Token_COption_Pubkey_Tag tag;
  85. union {
  86. struct {
  87. Token_Pubkey some;
  88. };
  89. };
  90. } Token_COption_Pubkey;
  91. /**
  92. * Instructions supported by the token program.
  93. */
  94. typedef enum Token_TokenInstruction_Tag {
  95. /**
  96. * Initializes a new mint and optionally deposits all the newly minted
  97. * tokens in an account.
  98. *
  99. * The `InitializeMint` instruction requires no signers and MUST be
  100. * included within the same Transaction as the system program's
  101. * `CreateAccount` instruction that creates the account being initialized.
  102. * Otherwise another party can acquire ownership of the uninitialized
  103. * account.
  104. *
  105. * Accounts expected by this instruction:
  106. *
  107. * 0. `[writable]` The mint to initialize.
  108. * 1. `[]` Rent sysvar
  109. *
  110. */
  111. Token_TokenInstruction_InitializeMint,
  112. /**
  113. * Initializes a new account to hold tokens. If this account is associated
  114. * with the native mint then the token balance of the initialized account
  115. * will be equal to the amount of SOL in the account. If this account is
  116. * associated with another mint, that mint must be initialized before this
  117. * command can succeed.
  118. *
  119. * The `InitializeAccount` instruction requires no signers and MUST be
  120. * included within the same Transaction as the system program's
  121. * `CreateAccount` instruction that creates the account being initialized.
  122. * Otherwise another party can acquire ownership of the uninitialized
  123. * account.
  124. *
  125. * Accounts expected by this instruction:
  126. *
  127. * 0. `[writable]` The account to initialize.
  128. * 1. `[]` The mint this account will be associated with.
  129. * 2. `[]` The new account's owner/multisignature.
  130. * 3. `[]` Rent sysvar
  131. */
  132. Token_TokenInstruction_InitializeAccount,
  133. /**
  134. * Initializes a multisignature account with N provided signers.
  135. *
  136. * Multisignature accounts can used in place of any single owner/delegate
  137. * accounts in any token instruction that require an owner/delegate to be
  138. * present. The variant field represents the number of signers (M)
  139. * required to validate this multisignature account.
  140. *
  141. * The `InitializeMultisig` instruction requires no signers and MUST be
  142. * included within the same Transaction as the system program's
  143. * `CreateAccount` instruction that creates the account being initialized.
  144. * Otherwise another party can acquire ownership of the uninitialized
  145. * account.
  146. *
  147. * Accounts expected by this instruction:
  148. *
  149. * 0. `[writable]` The multisignature account to initialize.
  150. * 1. `[]` Rent sysvar
  151. * 2. ..2+N. `[]` The signer accounts, must equal to N where 1 <= N <=
  152. * 11.
  153. */
  154. Token_TokenInstruction_InitializeMultisig,
  155. /**
  156. * Transfers tokens from one account to another either directly or via a
  157. * delegate. If this account is associated with the native mint then equal
  158. * amounts of SOL and Tokens will be transferred to the destination
  159. * account.
  160. *
  161. * Accounts expected by this instruction:
  162. *
  163. * * Single owner/delegate
  164. * 0. `[writable]` The source account.
  165. * 1. `[writable]` The destination account.
  166. * 2. `[signer]` The source account's owner/delegate.
  167. *
  168. * * Multisignature owner/delegate
  169. * 0. `[writable]` The source account.
  170. * 1. `[writable]` The destination account.
  171. * 2. `[]` The source account's multisignature owner/delegate.
  172. * 3. ..3+M `[signer]` M signer accounts.
  173. */
  174. Token_TokenInstruction_Transfer,
  175. /**
  176. * Approves a delegate. A delegate is given the authority over tokens on
  177. * behalf of the source account's owner.
  178. *
  179. * Accounts expected by this instruction:
  180. *
  181. * * Single owner
  182. * 0. `[writable]` The source account.
  183. * 1. `[]` The delegate.
  184. * 2. `[signer]` The source account owner.
  185. *
  186. * * Multisignature owner
  187. * 0. `[writable]` The source account.
  188. * 1. `[]` The delegate.
  189. * 2. `[]` The source account's multisignature owner.
  190. * 3. ..3+M `[signer]` M signer accounts
  191. */
  192. Token_TokenInstruction_Approve,
  193. /**
  194. * Revokes the delegate's authority.
  195. *
  196. * Accounts expected by this instruction:
  197. *
  198. * * Single owner
  199. * 0. `[writable]` The source account.
  200. * 1. `[signer]` The source account owner.
  201. *
  202. * * Multisignature owner
  203. * 0. `[writable]` The source account.
  204. * 1. `[]` The source account's multisignature owner.
  205. * 2. ..2+M `[signer]` M signer accounts
  206. */
  207. Token_TokenInstruction_Revoke,
  208. /**
  209. * Sets a new authority of a mint or account.
  210. *
  211. * Accounts expected by this instruction:
  212. *
  213. * * Single authority
  214. * 0. `[writable]` The mint or account to change the authority of.
  215. * 1. `[signer]` The current authority of the mint or account.
  216. *
  217. * * Multisignature authority
  218. * 0. `[writable]` The mint or account to change the authority of.
  219. * 1. `[]` The mint's or account's current multisignature authority.
  220. * 2. ..2+M `[signer]` M signer accounts
  221. */
  222. Token_TokenInstruction_SetAuthority,
  223. /**
  224. * Mints new tokens to an account. The native mint does not support
  225. * minting.
  226. *
  227. * Accounts expected by this instruction:
  228. *
  229. * * Single authority
  230. * 0. `[writable]` The mint.
  231. * 1. `[writable]` The account to mint tokens to.
  232. * 2. `[signer]` The mint's minting authority.
  233. *
  234. * * Multisignature authority
  235. * 0. `[writable]` The mint.
  236. * 1. `[writable]` The account to mint tokens to.
  237. * 2. `[]` The mint's multisignature mint-tokens authority.
  238. * 3. ..3+M `[signer]` M signer accounts.
  239. */
  240. Token_TokenInstruction_MintTo,
  241. /**
  242. * Burns tokens by removing them from an account. `Burn` does not support
  243. * accounts associated with the native mint, use `CloseAccount` instead.
  244. *
  245. * Accounts expected by this instruction:
  246. *
  247. * * Single owner/delegate
  248. * 0. `[writable]` The account to burn from.
  249. * 1. `[writable]` The token mint.
  250. * 2. `[signer]` The account's owner/delegate.
  251. *
  252. * * Multisignature owner/delegate
  253. * 0. `[writable]` The account to burn from.
  254. * 1. `[writable]` The token mint.
  255. * 2. `[]` The account's multisignature owner/delegate.
  256. * 3. ..3+M `[signer]` M signer accounts.
  257. */
  258. Token_TokenInstruction_Burn,
  259. /**
  260. * Close an account by transferring all its SOL to the destination account.
  261. * Non-native accounts may only be closed if its token amount is zero.
  262. *
  263. * Accounts expected by this instruction:
  264. *
  265. * * Single owner
  266. * 0. `[writable]` The account to close.
  267. * 1. `[writable]` The destination account.
  268. * 2. `[signer]` The account's owner.
  269. *
  270. * * Multisignature owner
  271. * 0. `[writable]` The account to close.
  272. * 1. `[writable]` The destination account.
  273. * 2. `[]` The account's multisignature owner.
  274. * 3. ..3+M `[signer]` M signer accounts.
  275. */
  276. Token_TokenInstruction_CloseAccount,
  277. /**
  278. * Freeze an Initialized account using the Mint's freeze_authority (if
  279. * set).
  280. *
  281. * Accounts expected by this instruction:
  282. *
  283. * * Single owner
  284. * 0. `[writable]` The account to freeze.
  285. * 1. `[]` The token mint.
  286. * 2. `[signer]` The mint freeze authority.
  287. *
  288. * * Multisignature owner
  289. * 0. `[writable]` The account to freeze.
  290. * 1. `[]` The token mint.
  291. * 2. `[]` The mint's multisignature freeze authority.
  292. * 3. ..3+M `[signer]` M signer accounts.
  293. */
  294. Token_TokenInstruction_FreezeAccount,
  295. /**
  296. * Thaw a Frozen account using the Mint's freeze_authority (if set).
  297. *
  298. * Accounts expected by this instruction:
  299. *
  300. * * Single owner
  301. * 0. `[writable]` The account to freeze.
  302. * 1. `[]` The token mint.
  303. * 2. `[signer]` The mint freeze authority.
  304. *
  305. * * Multisignature owner
  306. * 0. `[writable]` The account to freeze.
  307. * 1. `[]` The token mint.
  308. * 2. `[]` The mint's multisignature freeze authority.
  309. * 3. ..3+M `[signer]` M signer accounts.
  310. */
  311. Token_TokenInstruction_ThawAccount,
  312. /**
  313. * Transfers tokens from one account to another either directly or via a
  314. * delegate. If this account is associated with the native mint then equal
  315. * amounts of SOL and Tokens will be transferred to the destination
  316. * account.
  317. *
  318. * This instruction differs from Transfer in that the token mint and
  319. * decimals value is checked by the caller. This may be useful when
  320. * creating transactions offline or within a hardware wallet.
  321. *
  322. * Accounts expected by this instruction:
  323. *
  324. * * Single owner/delegate
  325. * 0. `[writable]` The source account.
  326. * 1. `[]` The token mint.
  327. * 2. `[writable]` The destination account.
  328. * 3. `[signer]` The source account's owner/delegate.
  329. *
  330. * * Multisignature owner/delegate
  331. * 0. `[writable]` The source account.
  332. * 1. `[]` The token mint.
  333. * 2. `[writable]` The destination account.
  334. * 3. `[]` The source account's multisignature owner/delegate.
  335. * 4. ..4+M `[signer]` M signer accounts.
  336. */
  337. Token_TokenInstruction_TransferChecked,
  338. /**
  339. * Approves a delegate. A delegate is given the authority over tokens on
  340. * behalf of the source account's owner.
  341. *
  342. * This instruction differs from Approve in that the token mint and
  343. * decimals value is checked by the caller. This may be useful when
  344. * creating transactions offline or within a hardware wallet.
  345. *
  346. * Accounts expected by this instruction:
  347. *
  348. * * Single owner
  349. * 0. `[writable]` The source account.
  350. * 1. `[]` The token mint.
  351. * 2. `[]` The delegate.
  352. * 3. `[signer]` The source account owner.
  353. *
  354. * * Multisignature owner
  355. * 0. `[writable]` The source account.
  356. * 1. `[]` The token mint.
  357. * 2. `[]` The delegate.
  358. * 3. `[]` The source account's multisignature owner.
  359. * 4. ..4+M `[signer]` M signer accounts
  360. */
  361. Token_TokenInstruction_ApproveChecked,
  362. /**
  363. * Mints new tokens to an account. The native mint does not support
  364. * minting.
  365. *
  366. * This instruction differs from MintTo in that the decimals value is
  367. * checked by the caller. This may be useful when creating transactions
  368. * offline or within a hardware wallet.
  369. *
  370. * Accounts expected by this instruction:
  371. *
  372. * * Single authority
  373. * 0. `[writable]` The mint.
  374. * 1. `[writable]` The account to mint tokens to.
  375. * 2. `[signer]` The mint's minting authority.
  376. *
  377. * * Multisignature authority
  378. * 0. `[writable]` The mint.
  379. * 1. `[writable]` The account to mint tokens to.
  380. * 2. `[]` The mint's multisignature mint-tokens authority.
  381. * 3. ..3+M `[signer]` M signer accounts.
  382. */
  383. Token_TokenInstruction_MintToChecked,
  384. /**
  385. * Burns tokens by removing them from an account. `BurnChecked` does not
  386. * support accounts associated with the native mint, use `CloseAccount`
  387. * instead.
  388. *
  389. * This instruction differs from Burn in that the decimals value is checked
  390. * by the caller. This may be useful when creating transactions offline or
  391. * within a hardware wallet.
  392. *
  393. * Accounts expected by this instruction:
  394. *
  395. * * Single owner/delegate
  396. * 0. `[writable]` The account to burn from.
  397. * 1. `[writable]` The token mint.
  398. * 2. `[signer]` The account's owner/delegate.
  399. *
  400. * * Multisignature owner/delegate
  401. * 0. `[writable]` The account to burn from.
  402. * 1. `[writable]` The token mint.
  403. * 2. `[]` The account's multisignature owner/delegate.
  404. * 3. ..3+M `[signer]` M signer accounts.
  405. */
  406. Token_TokenInstruction_BurnChecked,
  407. /**
  408. * Like InitializeAccount, but the owner pubkey is passed via instruction data
  409. * rather than the accounts list. This variant may be preferable when using
  410. * Cross Program Invocation from an instruction that does not need the owner's
  411. * `AccountInfo` otherwise.
  412. *
  413. * Accounts expected by this instruction:
  414. *
  415. * 0. `[writable]` The account to initialize.
  416. * 1. `[]` The mint this account will be associated with.
  417. * 3. `[]` Rent sysvar
  418. */
  419. Token_TokenInstruction_InitializeAccount2,
  420. /**
  421. * Given a wrapped / native token account (a token account containing SOL)
  422. * updates its amount field based on the account's underlying `lamports`.
  423. * This is useful if a non-wrapped SOL account uses `system_instruction::transfer`
  424. * to move lamports to a wrapped token account, and needs to have its token
  425. * `amount` field updated.
  426. *
  427. * Accounts expected by this instruction:
  428. *
  429. * 0. `[writable]` The native token account to sync with its underlying lamports.
  430. */
  431. Token_TokenInstruction_SyncNative,
  432. } Token_TokenInstruction_Tag;
  433. typedef struct Token_TokenInstruction_Token_InitializeMint_Body {
  434. /**
  435. * Number of base 10 digits to the right of the decimal place.
  436. */
  437. uint8_t decimals;
  438. /**
  439. * The authority/multisignature to mint tokens.
  440. */
  441. Token_Pubkey mint_authority;
  442. /**
  443. * The freeze authority/multisignature of the mint.
  444. */
  445. struct Token_COption_Pubkey freeze_authority;
  446. } Token_TokenInstruction_Token_InitializeMint_Body;
  447. typedef struct Token_TokenInstruction_Token_InitializeMultisig_Body {
  448. /**
  449. * The number of signers (M) required to validate this multisignature
  450. * account.
  451. */
  452. uint8_t m;
  453. } Token_TokenInstruction_Token_InitializeMultisig_Body;
  454. typedef struct Token_TokenInstruction_Token_Transfer_Body {
  455. /**
  456. * The amount of tokens to transfer.
  457. */
  458. uint64_t amount;
  459. } Token_TokenInstruction_Token_Transfer_Body;
  460. typedef struct Token_TokenInstruction_Token_Approve_Body {
  461. /**
  462. * The amount of tokens the delegate is approved for.
  463. */
  464. uint64_t amount;
  465. } Token_TokenInstruction_Token_Approve_Body;
  466. typedef struct Token_TokenInstruction_Token_SetAuthority_Body {
  467. /**
  468. * The type of authority to update.
  469. */
  470. Token_AuthorityType authority_type;
  471. /**
  472. * The new authority
  473. */
  474. struct Token_COption_Pubkey new_authority;
  475. } Token_TokenInstruction_Token_SetAuthority_Body;
  476. typedef struct Token_TokenInstruction_Token_MintTo_Body {
  477. /**
  478. * The amount of new tokens to mint.
  479. */
  480. uint64_t amount;
  481. } Token_TokenInstruction_Token_MintTo_Body;
  482. typedef struct Token_TokenInstruction_Token_Burn_Body {
  483. /**
  484. * The amount of tokens to burn.
  485. */
  486. uint64_t amount;
  487. } Token_TokenInstruction_Token_Burn_Body;
  488. typedef struct Token_TokenInstruction_Token_TransferChecked_Body {
  489. /**
  490. * The amount of tokens to transfer.
  491. */
  492. uint64_t amount;
  493. /**
  494. * Expected number of base 10 digits to the right of the decimal place.
  495. */
  496. uint8_t decimals;
  497. } Token_TokenInstruction_Token_TransferChecked_Body;
  498. typedef struct Token_TokenInstruction_Token_ApproveChecked_Body {
  499. /**
  500. * The amount of tokens the delegate is approved for.
  501. */
  502. uint64_t amount;
  503. /**
  504. * Expected number of base 10 digits to the right of the decimal place.
  505. */
  506. uint8_t decimals;
  507. } Token_TokenInstruction_Token_ApproveChecked_Body;
  508. typedef struct Token_TokenInstruction_Token_MintToChecked_Body {
  509. /**
  510. * The amount of new tokens to mint.
  511. */
  512. uint64_t amount;
  513. /**
  514. * Expected number of base 10 digits to the right of the decimal place.
  515. */
  516. uint8_t decimals;
  517. } Token_TokenInstruction_Token_MintToChecked_Body;
  518. typedef struct Token_TokenInstruction_Token_BurnChecked_Body {
  519. /**
  520. * The amount of tokens to burn.
  521. */
  522. uint64_t amount;
  523. /**
  524. * Expected number of base 10 digits to the right of the decimal place.
  525. */
  526. uint8_t decimals;
  527. } Token_TokenInstruction_Token_BurnChecked_Body;
  528. typedef struct Token_TokenInstruction_Token_InitializeAccount2_Body {
  529. /**
  530. * The new account's owner/multisignature.
  531. */
  532. Token_Pubkey owner;
  533. } Token_TokenInstruction_Token_InitializeAccount2_Body;
  534. typedef struct Token_TokenInstruction {
  535. Token_TokenInstruction_Tag tag;
  536. union {
  537. Token_TokenInstruction_Token_InitializeMint_Body initialize_mint;
  538. Token_TokenInstruction_Token_InitializeMultisig_Body initialize_multisig;
  539. Token_TokenInstruction_Token_Transfer_Body transfer;
  540. Token_TokenInstruction_Token_Approve_Body approve;
  541. Token_TokenInstruction_Token_SetAuthority_Body set_authority;
  542. Token_TokenInstruction_Token_MintTo_Body mint_to;
  543. Token_TokenInstruction_Token_Burn_Body burn;
  544. Token_TokenInstruction_Token_TransferChecked_Body transfer_checked;
  545. Token_TokenInstruction_Token_ApproveChecked_Body approve_checked;
  546. Token_TokenInstruction_Token_MintToChecked_Body mint_to_checked;
  547. Token_TokenInstruction_Token_BurnChecked_Body burn_checked;
  548. Token_TokenInstruction_Token_InitializeAccount2_Body initialize_account2;
  549. };
  550. } Token_TokenInstruction;
  551. /**
  552. * Mint data.
  553. */
  554. typedef struct Token_Mint {
  555. /**
  556. * Optional authority used to mint new tokens. The mint authority may only be provided during
  557. * mint creation. If no mint authority is present then the mint has a fixed supply and no
  558. * further tokens may be minted.
  559. */
  560. struct Token_COption_Pubkey mint_authority;
  561. /**
  562. * Total supply of tokens.
  563. */
  564. uint64_t supply;
  565. /**
  566. * Number of base 10 digits to the right of the decimal place.
  567. */
  568. uint8_t decimals;
  569. /**
  570. * Is `true` if this structure has been initialized
  571. */
  572. bool is_initialized;
  573. /**
  574. * Optional authority to freeze token accounts.
  575. */
  576. struct Token_COption_Pubkey freeze_authority;
  577. } Token_Mint;
  578. /**
  579. * A C representation of Rust's `std::option::Option`
  580. */
  581. typedef enum Token_COption_u64_Tag {
  582. /**
  583. * No value
  584. */
  585. Token_COption_u64_None_u64,
  586. /**
  587. * Some value `T`
  588. */
  589. Token_COption_u64_Some_u64,
  590. } Token_COption_u64_Tag;
  591. typedef struct Token_COption_u64 {
  592. Token_COption_u64_Tag tag;
  593. union {
  594. struct {
  595. uint64_t some;
  596. };
  597. };
  598. } Token_COption_u64;
  599. /**
  600. * Account data.
  601. */
  602. typedef struct Token_Account {
  603. /**
  604. * The mint associated with this account
  605. */
  606. Token_Pubkey mint;
  607. /**
  608. * The owner of this account.
  609. */
  610. Token_Pubkey owner;
  611. /**
  612. * The amount of tokens this account holds.
  613. */
  614. uint64_t amount;
  615. /**
  616. * If `delegate` is `Some` then `delegated_amount` represents
  617. * the amount authorized by the delegate
  618. */
  619. struct Token_COption_Pubkey delegate;
  620. /**
  621. * The account's state
  622. */
  623. Token_AccountState state;
  624. /**
  625. * If is_some, this is a native token, and the value logs the rent-exempt reserve. An Account
  626. * is required to be rent-exempt, so the value is used by the Processor to ensure that wrapped
  627. * SOL accounts do not drop below this threshold.
  628. */
  629. struct Token_COption_u64 is_native;
  630. /**
  631. * The amount delegated
  632. */
  633. uint64_t delegated_amount;
  634. /**
  635. * Optional authority to close the account.
  636. */
  637. struct Token_COption_Pubkey close_authority;
  638. } Token_Account;
  639. /**
  640. * Multisignature data.
  641. */
  642. typedef struct Token_Multisig {
  643. /**
  644. * Number of signers required
  645. */
  646. uint8_t m;
  647. /**
  648. * Number of valid signers
  649. */
  650. uint8_t n;
  651. /**
  652. * Is `true` if this structure has been initialized
  653. */
  654. bool is_initialized;
  655. /**
  656. * Signer public keys
  657. */
  658. Token_Pubkey signers[Token_MAX_SIGNERS];
  659. } Token_Multisig;