@upshiftfinance/sdk 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +408 -2
  3. package/lib/abis/AddressResolver.d.ts +28 -0
  4. package/lib/abis/AddressResolver.js +23 -0
  5. package/lib/abis/ChainlinkV3.d.ts +87 -0
  6. package/lib/abis/ChainlinkV3.js +117 -0
  7. package/lib/abis/ERC20.d.ts +168 -0
  8. package/lib/abis/ERC20.js +226 -0
  9. package/lib/abis/ERC20_Bytes32.d.ts +139 -0
  10. package/lib/abis/ERC20_Bytes32.js +196 -0
  11. package/lib/abis/ERC4626.d.ts +364 -0
  12. package/lib/abis/ERC4626.js +507 -0
  13. package/lib/abis/ERC721.d.ts +231 -0
  14. package/lib/abis/ERC721.js +321 -0
  15. package/lib/abis/FeeOracle.d.ts +120 -0
  16. package/lib/abis/FeeOracle.js +162 -0
  17. package/lib/abis/LendingPool.d.ts +1393 -0
  18. package/lib/abis/LendingPool.js +1807 -0
  19. package/lib/abis/LendingPoolV2.d.ts +1413 -0
  20. package/lib/abis/LendingPoolV2.js +1833 -0
  21. package/lib/abis/LendingPoolV3.d.ts +1677 -0
  22. package/lib/abis/LendingPoolV3.js +1160 -0
  23. package/lib/abis/Loan.d.ts +837 -0
  24. package/lib/abis/Loan.js +1080 -0
  25. package/lib/abis/MultiAssetNativeDepositWrapper.d.ts +137 -0
  26. package/lib/abis/MultiAssetNativeDepositWrapper.js +125 -0
  27. package/lib/abis/Multicall3.d.ts +30 -0
  28. package/lib/abis/Multicall3.js +97 -0
  29. package/lib/abis/OFT.d.ts +116 -0
  30. package/lib/abis/OFT.js +85 -0
  31. package/lib/abis/PoolAdapter.d.ts +36 -0
  32. package/lib/abis/PoolAdapter.js +51 -0
  33. package/lib/abis/RewardDistributor.d.ts +267 -0
  34. package/lib/abis/RewardDistributor.js +352 -0
  35. package/lib/abis/RwaRedeemSubaccount.d.ts +747 -0
  36. package/lib/abis/RwaRedeemSubaccount.js +548 -0
  37. package/lib/abis/SmartAccount.d.ts +17 -0
  38. package/lib/abis/SmartAccount.js +19 -0
  39. package/lib/abis/SwapRouter.d.ts +953 -0
  40. package/lib/abis/SwapRouter.js +1228 -0
  41. package/lib/abis/TextResolver.d.ts +16 -0
  42. package/lib/abis/TextResolver.js +16 -0
  43. package/lib/abis/TokenizedVaultV2.d.ts +1364 -0
  44. package/lib/abis/TokenizedVaultV2.js +1041 -0
  45. package/lib/abis/TokenizedVaultV2DepositWithPermit.d.ts +1456 -0
  46. package/lib/abis/TokenizedVaultV2DepositWithPermit.js +1878 -0
  47. package/lib/abis/TokenizedVaultV2Receipt.d.ts +1568 -0
  48. package/lib/abis/TokenizedVaultV2Receipt.js +1061 -0
  49. package/lib/abis/TokenizedVaultV2SenderAllocationWhitelist.d.ts +454 -0
  50. package/lib/abis/TokenizedVaultV2SenderAllocationWhitelist.js +327 -0
  51. package/lib/abis/TokenizedVaultV2WhitelistedAllocation.d.ts +1466 -0
  52. package/lib/abis/TokenizedVaultV2WhitelistedAllocation.js +1092 -0
  53. package/lib/abis/TokenizedVaultV2WhitelistedAssets.d.ts +274 -0
  54. package/lib/abis/TokenizedVaultV2WhitelistedAssets.js +167 -0
  55. package/lib/abis/UniversalResolverResolve.d.ts +69 -0
  56. package/lib/abis/UniversalResolverResolve.js +35 -0
  57. package/lib/abis/UniversalSignatureValidator.d.ts +17 -0
  58. package/lib/abis/UniversalSignatureValidator.js +30 -0
  59. package/lib/abis/WrapperAdapter.d.ts +71 -0
  60. package/lib/abis/WrapperAdapter.js +77 -0
  61. package/lib/abis/index.d.ts +34 -0
  62. package/lib/abis/index.js +51 -0
  63. package/lib/adapters/evm/getters.d.ts +19 -0
  64. package/lib/adapters/evm/getters.js +249 -0
  65. package/lib/adapters/evm/index.d.ts +539 -0
  66. package/lib/adapters/evm/index.js +656 -0
  67. package/lib/adapters/evm/utils.d.ts +8 -0
  68. package/lib/adapters/evm/utils.js +51 -0
  69. package/lib/adapters/solana/confirm.d.ts +88 -0
  70. package/lib/adapters/solana/confirm.js +291 -0
  71. package/lib/adapters/solana/constants.d.ts +42 -0
  72. package/lib/adapters/solana/constants.js +59 -0
  73. package/lib/adapters/solana/getters.d.ts +42 -0
  74. package/lib/adapters/solana/getters.js +275 -0
  75. package/lib/adapters/solana/idl/vault-idl.d.ts +700 -0
  76. package/lib/adapters/solana/idl/vault-idl.js +2101 -0
  77. package/lib/adapters/solana/idl/withdrawal-queue-idl.d.ts +795 -0
  78. package/lib/adapters/solana/idl/withdrawal-queue-idl.js +1864 -0
  79. package/lib/adapters/solana/index.d.ts +372 -0
  80. package/lib/adapters/solana/index.js +459 -0
  81. package/lib/adapters/solana/pricing.d.ts +184 -0
  82. package/lib/adapters/solana/pricing.js +239 -0
  83. package/lib/adapters/solana/queue-hints.d.ts +29 -0
  84. package/lib/adapters/solana/queue-hints.js +59 -0
  85. package/lib/adapters/solana/queue.actions.d.ts +97 -0
  86. package/lib/adapters/solana/queue.actions.js +468 -0
  87. package/lib/adapters/solana/token-reads.d.ts +108 -0
  88. package/lib/adapters/solana/token-reads.js +145 -0
  89. package/lib/adapters/solana/types.d.ts +325 -0
  90. package/lib/adapters/solana/types.js +3 -0
  91. package/lib/adapters/solana/utils.d.ts +229 -0
  92. package/lib/adapters/solana/utils.js +773 -0
  93. package/lib/adapters/solana/vault.actions.d.ts +140 -0
  94. package/lib/adapters/solana/vault.actions.js +657 -0
  95. package/lib/adapters/solana/withdrawal-queue.d.ts +125 -0
  96. package/lib/adapters/solana/withdrawal-queue.js +301 -0
  97. package/lib/adapters/stellar/actions.d.ts +41 -0
  98. package/lib/adapters/stellar/actions.js +126 -0
  99. package/lib/adapters/stellar/constants.d.ts +43 -0
  100. package/lib/adapters/stellar/constants.js +53 -0
  101. package/lib/adapters/stellar/getters.d.ts +68 -0
  102. package/lib/adapters/stellar/getters.js +290 -0
  103. package/lib/adapters/stellar/index.d.ts +126 -0
  104. package/lib/adapters/stellar/index.js +187 -0
  105. package/lib/adapters/stellar/invocation.d.ts +55 -0
  106. package/lib/adapters/stellar/invocation.js +92 -0
  107. package/lib/adapters/stellar/soroban.d.ts +131 -0
  108. package/lib/adapters/stellar/soroban.js +617 -0
  109. package/lib/adapters/stellar/submit.d.ts +42 -0
  110. package/lib/adapters/stellar/submit.js +195 -0
  111. package/lib/adapters/stellar/types.d.ts +57 -0
  112. package/lib/adapters/stellar/types.js +6 -0
  113. package/lib/adapters/stellar/utils.d.ts +24 -0
  114. package/lib/adapters/stellar/utils.js +34 -0
  115. package/lib/adapters/sui/client.d.ts +83 -0
  116. package/lib/adapters/sui/client.js +216 -0
  117. package/lib/adapters/sui/constants.d.ts +33 -0
  118. package/lib/adapters/sui/constants.js +31 -0
  119. package/lib/adapters/sui/index.d.ts +57 -0
  120. package/lib/adapters/sui/index.js +100 -0
  121. package/lib/adapters/sui/targets.d.ts +171 -0
  122. package/lib/adapters/sui/targets.js +225 -0
  123. package/lib/adapters/sui/utils.d.ts +8 -0
  124. package/lib/adapters/sui/utils.js +17 -0
  125. package/lib/core/analytics/app-name.d.ts +27 -0
  126. package/lib/core/analytics/app-name.js +48 -0
  127. package/lib/core/analytics/chain-name.d.ts +9 -0
  128. package/lib/core/analytics/chain-name.js +34 -0
  129. package/lib/core/analytics/constants.d.ts +15 -0
  130. package/lib/core/analytics/constants.js +28 -0
  131. package/lib/core/analytics/env.d.ts +46 -0
  132. package/lib/core/analytics/env.js +147 -0
  133. package/lib/core/analytics/index.d.ts +39 -0
  134. package/lib/core/analytics/index.js +83 -0
  135. package/lib/core/analytics/instrumentation.d.ts +29 -0
  136. package/lib/core/analytics/instrumentation.js +292 -0
  137. package/lib/core/analytics/method-taxonomy.d.ts +19 -0
  138. package/lib/core/analytics/method-taxonomy.js +156 -0
  139. package/lib/core/analytics/metrics.d.ts +48 -0
  140. package/lib/core/analytics/metrics.js +142 -0
  141. package/lib/core/analytics/sanitize.d.ts +57 -0
  142. package/lib/core/analytics/sanitize.js +272 -0
  143. package/lib/core/analytics/sentry-runtime.d.ts +15 -0
  144. package/lib/core/analytics/sentry-runtime.js +131 -0
  145. package/lib/core/analytics/sentry.d.ts +100 -0
  146. package/lib/core/analytics/sentry.js +696 -0
  147. package/lib/core/analytics/types.d.ts +55 -0
  148. package/lib/core/analytics/types.js +3 -0
  149. package/lib/core/analytics/user-identity.d.ts +55 -0
  150. package/lib/core/analytics/user-identity.js +218 -0
  151. package/lib/core/analytics/version.d.ts +6 -0
  152. package/lib/core/analytics/version.js +10 -0
  153. package/lib/core/attribution.d.ts +159 -0
  154. package/lib/core/attribution.js +194 -0
  155. package/lib/core/auth/index.d.ts +1 -0
  156. package/lib/core/auth/index.js +18 -0
  157. package/lib/core/auth/verify.d.ts +2 -0
  158. package/lib/core/auth/verify.js +35 -0
  159. package/lib/core/base.class.d.ts +193 -0
  160. package/lib/core/base.class.js +163 -0
  161. package/lib/core/cache.d.ts +9 -0
  162. package/lib/core/cache.js +31 -0
  163. package/lib/core/constants/adapters.d.ts +103 -0
  164. package/lib/core/constants/adapters.js +180 -0
  165. package/lib/core/constants/core.d.ts +162 -0
  166. package/lib/core/constants/core.js +281 -0
  167. package/lib/core/constants/swap-router.d.ts +180 -0
  168. package/lib/core/constants/swap-router.js +203 -0
  169. package/lib/core/constants/vaults.d.ts +93 -0
  170. package/lib/core/constants/vaults.js +277 -0
  171. package/lib/core/constants/web3.d.ts +106 -0
  172. package/lib/core/constants/web3.js +251 -0
  173. package/lib/core/errors/index.d.ts +177 -0
  174. package/lib/core/errors/index.js +257 -0
  175. package/lib/core/fetcher.d.ts +237 -0
  176. package/lib/core/fetcher.js +1103 -0
  177. package/lib/core/helpers/adapters.d.ts +13 -0
  178. package/lib/core/helpers/adapters.js +39 -0
  179. package/lib/core/helpers/chain-address.d.ts +13 -0
  180. package/lib/core/helpers/chain-address.js +47 -0
  181. package/lib/core/helpers/chain-error.d.ts +207 -0
  182. package/lib/core/helpers/chain-error.js +697 -0
  183. package/lib/core/helpers/chain-support.d.ts +98 -0
  184. package/lib/core/helpers/chain-support.js +139 -0
  185. package/lib/core/helpers/concurrency.d.ts +51 -0
  186. package/lib/core/helpers/concurrency.js +79 -0
  187. package/lib/core/helpers/core.d.ts +92 -0
  188. package/lib/core/helpers/core.js +368 -0
  189. package/lib/core/helpers/explorer-link.d.ts +16 -0
  190. package/lib/core/helpers/explorer-link.js +26 -0
  191. package/lib/core/helpers/multicall.d.ts +68 -0
  192. package/lib/core/helpers/multicall.js +103 -0
  193. package/lib/core/helpers/revert-decode.d.ts +248 -0
  194. package/lib/core/helpers/revert-decode.js +515 -0
  195. package/lib/core/helpers/signer.d.ts +61 -0
  196. package/lib/core/helpers/signer.js +184 -0
  197. package/lib/core/helpers/swap-router.d.ts +269 -0
  198. package/lib/core/helpers/swap-router.js +542 -0
  199. package/lib/core/helpers/vault-version.d.ts +24 -0
  200. package/lib/core/helpers/vault-version.js +83 -0
  201. package/lib/core/helpers/vaults.d.ts +89 -0
  202. package/lib/core/helpers/vaults.js +241 -0
  203. package/lib/core/helpers/web3.d.ts +366 -0
  204. package/lib/core/helpers/web3.js +1034 -0
  205. package/lib/core/index.d.ts +23 -0
  206. package/lib/core/index.js +40 -0
  207. package/lib/core/logger/curator-alert.d.ts +217 -0
  208. package/lib/core/logger/curator-alert.js +276 -0
  209. package/lib/core/logger/index.d.ts +99 -0
  210. package/lib/core/logger/index.js +163 -0
  211. package/lib/core/logger/slack.d.ts +49 -0
  212. package/lib/core/logger/slack.js +111 -0
  213. package/lib/core/vault-metadata.d.ts +12 -0
  214. package/lib/core/vault-metadata.js +42 -0
  215. package/lib/core/version-check.d.ts +58 -0
  216. package/lib/core/version-check.js +182 -0
  217. package/lib/evm/index.d.ts +2 -0
  218. package/lib/evm/index.js +19 -0
  219. package/lib/evm/methods/crossChainVault.d.ts +132 -0
  220. package/lib/evm/methods/crossChainVault.js +857 -0
  221. package/lib/evm/methods/crossChainVaultRegistry.d.ts +92 -0
  222. package/lib/evm/methods/crossChainVaultRegistry.js +239 -0
  223. package/lib/evm/methods/index.d.ts +2 -0
  224. package/lib/evm/methods/index.js +19 -0
  225. package/lib/evm/types/crossChain.d.ts +363 -0
  226. package/lib/evm/types/crossChain.js +20 -0
  227. package/lib/evm/types/index.d.ts +1 -0
  228. package/lib/evm/types/index.js +18 -0
  229. package/lib/index.d.ts +30 -0
  230. package/lib/index.js +52 -0
  231. package/lib/main.d.ts +596 -0
  232. package/lib/main.js +681 -0
  233. package/lib/modules/api/fetcher.d.ts +108 -0
  234. package/lib/modules/api/fetcher.js +187 -0
  235. package/lib/modules/api/index.d.ts +1 -0
  236. package/lib/modules/api/index.js +6 -0
  237. package/lib/modules/api/main.d.ts +587 -0
  238. package/lib/modules/api/main.js +911 -0
  239. package/lib/modules/sub-accounts/fetcher.d.ts +53 -0
  240. package/lib/modules/sub-accounts/fetcher.js +96 -0
  241. package/lib/modules/sub-accounts/index.d.ts +2 -0
  242. package/lib/modules/sub-accounts/index.js +19 -0
  243. package/lib/modules/sub-accounts/main.d.ts +249 -0
  244. package/lib/modules/sub-accounts/main.js +211 -0
  245. package/lib/modules/sub-accounts/utils.d.ts +106 -0
  246. package/lib/modules/sub-accounts/utils.js +112 -0
  247. package/lib/modules/vaults/adapter.helpers.d.ts +84 -0
  248. package/lib/modules/vaults/adapter.helpers.js +202 -0
  249. package/lib/modules/vaults/fetcher.d.ts +147 -0
  250. package/lib/modules/vaults/fetcher.js +357 -0
  251. package/lib/modules/vaults/getters.d.ts +1060 -0
  252. package/lib/modules/vaults/getters.js +4079 -0
  253. package/lib/modules/vaults/index.d.ts +20 -0
  254. package/lib/modules/vaults/index.js +44 -0
  255. package/lib/modules/vaults/main.d.ts +607 -0
  256. package/lib/modules/vaults/main.js +1687 -0
  257. package/lib/modules/vaults/prefetch.d.ts +65 -0
  258. package/lib/modules/vaults/prefetch.js +120 -0
  259. package/lib/modules/vaults/read.actions.d.ts +406 -0
  260. package/lib/modules/vaults/read.actions.js +891 -0
  261. package/lib/modules/vaults/types.d.ts +149 -0
  262. package/lib/modules/vaults/types.js +3 -0
  263. package/lib/modules/vaults/utils/call-data-decoder.d.ts +61 -0
  264. package/lib/modules/vaults/utils/call-data-decoder.js +194 -0
  265. package/lib/modules/vaults/utils/date-utils.d.ts +50 -0
  266. package/lib/modules/vaults/utils/date-utils.js +84 -0
  267. package/lib/modules/vaults/utils.d.ts +153 -0
  268. package/lib/modules/vaults/utils.js +818 -0
  269. package/lib/modules/vaults/write.actions.d.ts +812 -0
  270. package/lib/modules/vaults/write.actions.js +2377 -0
  271. package/lib/polyfills.d.ts +1 -0
  272. package/lib/polyfills.js +12 -0
  273. package/lib/sdk.d.ts +30173 -0
  274. package/lib/services/coingecko/fetcher.d.ts +15 -0
  275. package/lib/services/coingecko/fetcher.js +67 -0
  276. package/lib/services/coingecko/index.d.ts +2 -0
  277. package/lib/services/coingecko/index.js +19 -0
  278. package/lib/services/coingecko/utils.d.ts +1 -0
  279. package/lib/services/coingecko/utils.js +24 -0
  280. package/lib/services/debank/fetcher.d.ts +126 -0
  281. package/lib/services/debank/fetcher.js +47 -0
  282. package/lib/services/debank/index.d.ts +2 -0
  283. package/lib/services/debank/index.js +19 -0
  284. package/lib/services/debank/utils.d.ts +50 -0
  285. package/lib/services/debank/utils.js +325 -0
  286. package/lib/services/layerzero/deposits.d.ts +55 -0
  287. package/lib/services/layerzero/deposits.js +174 -0
  288. package/lib/services/layerzero/redeems.d.ts +20 -0
  289. package/lib/services/layerzero/redeems.js +92 -0
  290. package/lib/services/layerzero/utils.d.ts +9 -0
  291. package/lib/services/layerzero/utils.js +22 -0
  292. package/lib/services/octavfi/fetcher.d.ts +33 -0
  293. package/lib/services/octavfi/fetcher.js +39 -0
  294. package/lib/services/octavfi/index.d.ts +3 -0
  295. package/lib/services/octavfi/index.js +20 -0
  296. package/lib/services/octavfi/types.d.ts +34 -0
  297. package/lib/services/octavfi/types.js +3 -0
  298. package/lib/services/octavfi/utils.d.ts +16 -0
  299. package/lib/services/octavfi/utils.js +244 -0
  300. package/lib/services/subgraph/fetcher.d.ts +2 -0
  301. package/lib/services/subgraph/fetcher.js +66 -0
  302. package/lib/services/subgraph/index.d.ts +2 -0
  303. package/lib/services/subgraph/index.js +19 -0
  304. package/lib/services/subgraph/schema.d.ts +48 -0
  305. package/lib/services/subgraph/schema.js +87 -0
  306. package/lib/services/subgraph/vaults.d.ts +83 -0
  307. package/lib/services/subgraph/vaults.js +1282 -0
  308. package/lib/services/swap-quotes/index.d.ts +105 -0
  309. package/lib/services/swap-quotes/index.js +77 -0
  310. package/lib/services/swap-quotes/paraswap.d.ts +51 -0
  311. package/lib/services/swap-quotes/paraswap.js +138 -0
  312. package/lib/services/untangled/fetcher.d.ts +40 -0
  313. package/lib/services/untangled/fetcher.js +110 -0
  314. package/lib/services/untangled/index.d.ts +3 -0
  315. package/lib/services/untangled/index.js +20 -0
  316. package/lib/services/untangled/types.d.ts +83 -0
  317. package/lib/services/untangled/types.js +10 -0
  318. package/lib/services/untangled/utils.d.ts +91 -0
  319. package/lib/services/untangled/utils.js +339 -0
  320. package/lib/types/api.d.ts +498 -0
  321. package/lib/types/api.js +3 -0
  322. package/lib/types/index.d.ts +12 -0
  323. package/lib/types/index.js +28 -0
  324. package/lib/types/points.d.ts +28 -0
  325. package/lib/types/points.js +3 -0
  326. package/lib/types/pools.d.ts +144 -0
  327. package/lib/types/pools.js +3 -0
  328. package/lib/types/staking.d.ts +28 -0
  329. package/lib/types/staking.js +3 -0
  330. package/lib/types/sub-accounts.d.ts +150 -0
  331. package/lib/types/sub-accounts.js +3 -0
  332. package/lib/types/subgraph.d.ts +84 -0
  333. package/lib/types/subgraph.js +3 -0
  334. package/lib/types/typed-contract.d.ts +102 -0
  335. package/lib/types/typed-contract.js +3 -0
  336. package/lib/types/user.d.ts +1 -0
  337. package/lib/types/user.js +3 -0
  338. package/lib/types/vaults.d.ts +886 -0
  339. package/lib/types/vaults.js +30 -0
  340. package/lib/types/web3.d.ts +100 -0
  341. package/lib/types/web3.js +14 -0
  342. package/lib/types/webserver.d.ts +730 -0
  343. package/lib/types/webserver.js +3 -0
  344. package/package.json +79 -3
@@ -0,0 +1,2101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vaultIdl = void 0;
4
+ /**
5
+ * august_vault program IDL (Anchor).
6
+ *
7
+ * GENERATED — do not edit by hand. Source of truth is the program repo's build
8
+ * artifact: `target/idl/august_vault.json` from
9
+ * fractal-protocol/solana-upshift-vault-programs, built at the release the SDK
10
+ * targets (solana-vaults' `frontend/idl/august_vault.json` is a copy of the same
11
+ * artifact, synced from its vendored submodule). Regenerate from there, NOT with
12
+ * `anchor idl fetch`: an Anchor IDL upload is not refreshed by a program
13
+ * upgrade, so every IDL published for this program lineage is stale — both
14
+ * `up12…` on mainnet (last written 2026-01-21) and the `C8B1…` devnet reference
15
+ * (2026-01-23) predate the ProgramConfig build deployed on 2026-08-06.
16
+ *
17
+ * `address` is a build stamp (the mainnet id), NOT network-aware. Never rely on
18
+ * it: SolanaAdapter/getProgram resolve the real program id per network from
19
+ * programIds, or from an explicit `programId` override.
20
+ *
21
+ * Generated from release v0.3.0 (87c0f2d), which mainnet and devnet run since
22
+ * 14 Oct 2026. It drops `mut` from accounts the program only reads, so the
23
+ * client sends `deposit_mint` and the signer of deposit and redeem read-only
24
+ * (AUGUST-8045); tests/adapters/solana-idl.test.ts pins that. Built with the
25
+ * doc-only fix from program PR #48 applied (`SubaccountDelegationMissing` is
26
+ * 6027), so it differs from the v0.3.0 artifact in doc strings alone.
27
+ *
28
+ * One hand edit after generation: `operator_token_account` in `operator_deposit`
29
+ * and `operator_withdraw` carries no `pda`. The program derives it as the ATA of
30
+ * the registered subaccount's stored `address`, or of the operator when there is
31
+ * none, which Anchor's IDL cannot express: the generated seed names the
32
+ * `subaccount` account itself, so Anchor would silently resolve the wrong ATA.
33
+ * Without the `pda`, callers must pass the account, and a missing one throws.
34
+ * Pinned by tests/adapters/solana-idl.test.ts; reapply it on every regeneration.
35
+ *
36
+ * Drift is guarded by tests/vaults/solana-idl-drift.test.ts: the deployed binary
37
+ * is pinned, every discriminator declared here must appear in that binary, and
38
+ * live VaultState accounts must decode against this file.
39
+ */
40
+ exports.vaultIdl = {
41
+ accounts: [
42
+ {
43
+ discriminator: [195, 131, 96, 55, 140, 253, 93, 195],
44
+ name: 'NominatedAdmin',
45
+ },
46
+ {
47
+ discriminator: [196, 210, 90, 231, 144, 149, 140, 63],
48
+ name: 'ProgramConfig',
49
+ },
50
+ {
51
+ discriminator: [205, 168, 49, 209, 131, 86, 56, 195],
52
+ name: 'Subaccount',
53
+ },
54
+ {
55
+ discriminator: [228, 196, 82, 165, 98, 210, 235, 152],
56
+ name: 'VaultState',
57
+ },
58
+ ],
59
+ address: 'up12bytoZBmwofqsySf2uqKQ7zpfeKiAWwfvqzJjtRt',
60
+ errors: [
61
+ {
62
+ code: 6000,
63
+ msg: 'Signer must be the operator',
64
+ name: 'NotOperator',
65
+ },
66
+ {
67
+ code: 6001,
68
+ msg: 'Amount must be > 0',
69
+ name: 'ZeroAmount',
70
+ },
71
+ {
72
+ code: 6002,
73
+ msg: 'Insufficient amount for initial deposit',
74
+ name: 'InsufficientAmount',
75
+ },
76
+ {
77
+ code: 6003,
78
+ msg: 'Over 10% aum increase ?',
79
+ name: 'AumIncreaseTooBig',
80
+ },
81
+ {
82
+ code: 6004,
83
+ msg: 'Over 10% aum decrease ?',
84
+ name: 'AumDecreaseTooBig',
85
+ },
86
+ {
87
+ code: 6005,
88
+ msg: 'Withdrawal fee too high',
89
+ name: 'WithdrawalFeeTooHigh',
90
+ },
91
+ {
92
+ code: 6006,
93
+ msg: 'AUM limit exceeds maximum allowed value',
94
+ name: 'AumLimitTooHigh',
95
+ },
96
+ {
97
+ code: 6007,
98
+ msg: 'Signer is Not Admin',
99
+ name: 'NotAdmin',
100
+ },
101
+ {
102
+ code: 6008,
103
+ msg: 'Vault is paused',
104
+ name: 'VaultPaused',
105
+ },
106
+ {
107
+ code: 6009,
108
+ msg: 'Nominated Admin is incorrect',
109
+ name: 'InvalidNominatedAdmin',
110
+ },
111
+ {
112
+ code: 6010,
113
+ msg: 'Admin nomination window expired',
114
+ name: 'NominationExpired',
115
+ },
116
+ {
117
+ code: 6011,
118
+ msg: 'Math error',
119
+ name: 'MathError',
120
+ },
121
+ {
122
+ code: 6012,
123
+ msg: 'Number Overflow',
124
+ name: 'NumberOverflow',
125
+ },
126
+ {
127
+ code: 6013,
128
+ msg: 'Not Enough Liquidity',
129
+ name: 'NotEnoughLiquidity',
130
+ },
131
+ {
132
+ code: 6014,
133
+ msg: 'Unauthorized admin for metadata operation',
134
+ name: 'UnauthorizedAdmin',
135
+ },
136
+ {
137
+ code: 6015,
138
+ msg: 'Vault must be empty to close',
139
+ name: 'VaultNotEmpty',
140
+ },
141
+ {
142
+ code: 6016,
143
+ msg: 'Signer is not the protocol authority',
144
+ name: 'NotProtocolAuthority',
145
+ },
146
+ {
147
+ code: 6017,
148
+ msg: 'Authority must not be the zero key',
149
+ name: 'InvalidAuthority',
150
+ },
151
+ {
152
+ code: 6018,
153
+ msg: "Received fewer shares than the caller's minimum",
154
+ name: 'SlippageExceeded',
155
+ },
156
+ {
157
+ code: 6019,
158
+ msg: 'Vault holds no assets while shares are outstanding; share price is undefined',
159
+ name: 'SharePriceUndefined',
160
+ },
161
+ {
162
+ code: 6020,
163
+ msg: 'Share offset must be a power of ten within the permitted range',
164
+ name: 'InvalidShareOffset',
165
+ },
166
+ {
167
+ code: 6021,
168
+ msg: "Signer is not this vault's withdrawal_queue_authority; holders request a withdrawal at the queue instead",
169
+ name: 'WithdrawalQueueRequired',
170
+ },
171
+ {
172
+ code: 6022,
173
+ msg: "Queue must be this vault's initialized, queue-program-owned withdrawal-queue PDA",
174
+ name: 'InvalidWithdrawalQueueAuthority',
175
+ },
176
+ {
177
+ code: 6023,
178
+ msg: 'The queue slot was signed by a key other than the attached queue',
179
+ name: 'WrongWithdrawalQueueSigner',
180
+ },
181
+ {
182
+ code: 6024,
183
+ msg: 'A withdrawal queue is already attached; detach it before attaching again',
184
+ name: 'WithdrawalQueueAlreadyAttached',
185
+ },
186
+ {
187
+ code: 6025,
188
+ msg: 'No withdrawal queue is attached to this vault',
189
+ name: 'WithdrawalQueueNotAttached',
190
+ },
191
+ {
192
+ code: 6026,
193
+ msg: 'A subaccount must differ from the operator, belong to this vault, and be passed whenever the vault has any registered',
194
+ name: 'InvalidSubaccount',
195
+ },
196
+ {
197
+ code: 6027,
198
+ msg: "The named address's ATA must have this vault approved as delegate, with an allowance covering the transfer",
199
+ name: 'SubaccountDelegationMissing',
200
+ },
201
+ {
202
+ code: 6028,
203
+ msg: 'A subaccount still holds outstanding principal and cannot be deregistered',
204
+ name: 'SubaccountNotEmpty',
205
+ },
206
+ {
207
+ code: 6029,
208
+ msg: 'A loss settlement may not exceed the principal that is not sitting at the destination',
209
+ name: 'LossExceedsShortfall',
210
+ },
211
+ ],
212
+ events: [
213
+ {
214
+ discriminator: [36, 238, 119, 15, 12, 255, 94, 79],
215
+ name: 'DepositEvt',
216
+ },
217
+ {
218
+ discriminator: [6, 132, 68, 72, 106, 106, 131, 225],
219
+ name: 'WithdrawEvt',
220
+ },
221
+ {
222
+ discriminator: [215, 155, 176, 78, 69, 189, 182, 34],
223
+ name: 'WithdrawalQueueAttached',
224
+ },
225
+ {
226
+ discriminator: [152, 26, 84, 125, 223, 150, 156, 122],
227
+ name: 'WithdrawalQueueDetached',
228
+ },
229
+ ],
230
+ instructions: [
231
+ {
232
+ accounts: [
233
+ {
234
+ name: 'vault_state',
235
+ writable: true,
236
+ },
237
+ {
238
+ name: 'deposit_mint',
239
+ },
240
+ {
241
+ name: 'nominated_admin_pda',
242
+ writable: true,
243
+ },
244
+ {
245
+ name: 'new_admin',
246
+ signer: true,
247
+ },
248
+ {
249
+ name: 'receiver',
250
+ writable: true,
251
+ },
252
+ {
253
+ address: '11111111111111111111111111111111',
254
+ name: 'system_program',
255
+ },
256
+ ],
257
+ args: [],
258
+ discriminator: [190, 164, 198, 207, 17, 27, 152, 203],
259
+ docs: ['New accepts the Admin Nomination', '### Parameters'],
260
+ name: 'accept_admin_nomination',
261
+ },
262
+ {
263
+ accounts: [
264
+ {
265
+ name: 'vault_state',
266
+ writable: true,
267
+ },
268
+ {
269
+ name: 'deposit_mint',
270
+ },
271
+ {
272
+ name: 'admin',
273
+ signer: true,
274
+ },
275
+ {
276
+ docs: [
277
+ 'This vault\'s queue PDA, `["withdrawal_queue", vault_state]` under the',
278
+ 'hardcoded queue program, already initialized by that program.',
279
+ '',
280
+ ],
281
+ name: 'queue',
282
+ },
283
+ ],
284
+ args: [],
285
+ discriminator: [6, 130, 226, 67, 214, 208, 145, 212],
286
+ docs: [
287
+ "Admin attaches this vault's withdrawal queue.",
288
+ '',
289
+ "`queue` must be this vault's queue PDA under the hardcoded queue program,",
290
+ 'already initialized there. Anything else is refused, because a stored key',
291
+ 'nobody can sign for would freeze every exit. That PDA is a pure function',
292
+ 'of the vault, so the instruction takes no key argument: there is exactly',
293
+ 'one value it can store. A vault with a queue already attached is refused.',
294
+ ],
295
+ name: 'attach_withdrawal_queue',
296
+ },
297
+ {
298
+ accounts: [
299
+ {
300
+ name: 'vault_state',
301
+ writable: true,
302
+ },
303
+ {
304
+ name: 'share_mint',
305
+ writable: true,
306
+ },
307
+ {
308
+ name: 'vault_token_ata',
309
+ writable: true,
310
+ },
311
+ {
312
+ name: 'deposit_mint',
313
+ },
314
+ {
315
+ name: 'admin',
316
+ signer: true,
317
+ writable: true,
318
+ },
319
+ {
320
+ name: 'token_program',
321
+ },
322
+ ],
323
+ args: [],
324
+ discriminator: [141, 103, 17, 126, 72, 75, 29, 29],
325
+ docs: [
326
+ 'Admin Closes an empty Vault',
327
+ 'Reclaims rent from vault_state, share_mint, and vault_token_ata',
328
+ 'Requires vault to have zero shares outstanding and empty token account',
329
+ ],
330
+ name: 'close_vault',
331
+ },
332
+ {
333
+ accounts: [
334
+ {
335
+ name: 'payer',
336
+ signer: true,
337
+ writable: true,
338
+ },
339
+ {
340
+ docs: [
341
+ 'The admin of the vault - only they can create/update metadata',
342
+ ],
343
+ name: 'admin',
344
+ signer: true,
345
+ },
346
+ {
347
+ docs: ['The vault state PDA that owns the mint authority'],
348
+ name: 'vault_state',
349
+ },
350
+ {
351
+ docs: ['The deposit mint used for PDA derivation'],
352
+ name: 'deposit_mint',
353
+ },
354
+ {
355
+ docs: ['The share token mint'],
356
+ name: 'share_mint',
357
+ },
358
+ {
359
+ name: 'metadata_account',
360
+ pda: {
361
+ program: {
362
+ kind: 'const',
363
+ value: [
364
+ 11, 112, 101, 177, 227, 209, 124, 69, 56, 157, 82, 127, 107, 4,
365
+ 195, 205, 88, 184, 108, 115, 26, 160, 253, 181, 73, 182, 209,
366
+ 188, 3, 248, 41, 70,
367
+ ],
368
+ },
369
+ seeds: [
370
+ {
371
+ kind: 'const',
372
+ value: [109, 101, 116, 97, 100, 97, 116, 97],
373
+ },
374
+ {
375
+ kind: 'const',
376
+ value: [
377
+ 11, 112, 101, 177, 227, 209, 124, 69, 56, 157, 82, 127, 107,
378
+ 4, 195, 205, 88, 184, 108, 115, 26, 160, 253, 181, 73, 182,
379
+ 209, 188, 3, 248, 41, 70,
380
+ ],
381
+ },
382
+ {
383
+ kind: 'account',
384
+ path: 'share_mint',
385
+ },
386
+ ],
387
+ },
388
+ writable: true,
389
+ },
390
+ {
391
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
392
+ name: 'token_program',
393
+ },
394
+ {
395
+ address: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s',
396
+ name: 'token_metadata_program',
397
+ },
398
+ {
399
+ address: '11111111111111111111111111111111',
400
+ name: 'system_program',
401
+ },
402
+ {
403
+ address: 'SysvarRent111111111111111111111111111111111',
404
+ name: 'rent',
405
+ },
406
+ ],
407
+ args: [
408
+ {
409
+ name: 'name',
410
+ type: 'string',
411
+ },
412
+ {
413
+ name: 'symbol',
414
+ type: 'string',
415
+ },
416
+ {
417
+ name: 'uri',
418
+ type: 'string',
419
+ },
420
+ ],
421
+ discriminator: [54, 182, 66, 108, 197, 135, 53, 117],
422
+ docs: [
423
+ 'Create metadata for the share token',
424
+ '### Parameters',
425
+ '- `name` - The name of the token',
426
+ '- `symbol` - The symbol of the token',
427
+ '- `uri` - The URI for the token metadata',
428
+ ],
429
+ name: 'create_share_token_metadata',
430
+ },
431
+ {
432
+ accounts: [
433
+ {
434
+ name: 'vault_state',
435
+ writable: true,
436
+ },
437
+ {
438
+ name: 'vault_token_ata',
439
+ writable: true,
440
+ },
441
+ {
442
+ name: 'sender_token_account',
443
+ writable: true,
444
+ },
445
+ {
446
+ name: 'sender_share_account',
447
+ writable: true,
448
+ },
449
+ {
450
+ name: 'share_mint',
451
+ writable: true,
452
+ },
453
+ {
454
+ name: 'deposit_mint',
455
+ },
456
+ {
457
+ name: 'signer',
458
+ signer: true,
459
+ },
460
+ {
461
+ name: 'token_program',
462
+ },
463
+ ],
464
+ args: [
465
+ {
466
+ name: 'amount',
467
+ type: 'u64',
468
+ },
469
+ ],
470
+ discriminator: [242, 35, 198, 137, 82, 225, 242, 182],
471
+ docs: [
472
+ 'Deposit funds in the Vault',
473
+ 'Mint Vault shares',
474
+ '',
475
+ 'No slippage bound — prefer `deposit_checked` in new integrations.',
476
+ '',
477
+ '### Parameters',
478
+ '- `amount` - The amount to deposit',
479
+ ],
480
+ name: 'deposit',
481
+ },
482
+ {
483
+ accounts: [
484
+ {
485
+ name: 'vault_state',
486
+ writable: true,
487
+ },
488
+ {
489
+ name: 'vault_token_ata',
490
+ writable: true,
491
+ },
492
+ {
493
+ name: 'sender_token_account',
494
+ writable: true,
495
+ },
496
+ {
497
+ name: 'sender_share_account',
498
+ writable: true,
499
+ },
500
+ {
501
+ name: 'share_mint',
502
+ writable: true,
503
+ },
504
+ {
505
+ name: 'deposit_mint',
506
+ },
507
+ {
508
+ name: 'signer',
509
+ signer: true,
510
+ },
511
+ {
512
+ name: 'token_program',
513
+ },
514
+ ],
515
+ args: [
516
+ {
517
+ name: 'amount',
518
+ type: 'u64',
519
+ },
520
+ {
521
+ name: 'min_shares_out',
522
+ type: 'u64',
523
+ },
524
+ ],
525
+ discriminator: [216, 117, 3, 197, 107, 28, 130, 111],
526
+ docs: [
527
+ 'Deposit funds in the Vault, refusing to mint fewer than',
528
+ '`min_shares_out` shares.',
529
+ '',
530
+ 'Same accounts and semantics as `deposit`, plus a caller-stated worst',
531
+ 'acceptable rate. Additive rather than a change to `deposit`, so existing',
532
+ 'integrations keep working; pass 0 for identical behaviour.',
533
+ '',
534
+ '### Parameters',
535
+ '- `amount` - The amount to deposit',
536
+ '- `min_shares_out` - Revert with `SlippageExceeded` below this many shares',
537
+ ],
538
+ name: 'deposit_checked',
539
+ },
540
+ {
541
+ accounts: [
542
+ {
543
+ name: 'vault_state',
544
+ writable: true,
545
+ },
546
+ {
547
+ name: 'subaccount',
548
+ pda: {
549
+ seeds: [
550
+ {
551
+ kind: 'const',
552
+ value: [83, 85, 66, 65, 67, 67, 79, 85, 78, 84],
553
+ },
554
+ {
555
+ kind: 'account',
556
+ path: 'vault_state',
557
+ },
558
+ {
559
+ account: 'Subaccount',
560
+ kind: 'account',
561
+ path: 'subaccount.address',
562
+ },
563
+ ],
564
+ },
565
+ writable: true,
566
+ },
567
+ {
568
+ name: 'deposit_mint',
569
+ },
570
+ {
571
+ name: 'admin',
572
+ signer: true,
573
+ writable: true,
574
+ },
575
+ ],
576
+ args: [],
577
+ discriminator: [112, 91, 26, 5, 186, 249, 34, 151],
578
+ docs: [
579
+ 'Remove a registered destination, refunding its rent. Admin only, and',
580
+ 'only once its outstanding principal is zero. Removing the last one',
581
+ "returns the vault to the operator's own ATA.",
582
+ ],
583
+ name: 'deregister_subaccount',
584
+ },
585
+ {
586
+ accounts: [
587
+ {
588
+ name: 'vault_state',
589
+ writable: true,
590
+ },
591
+ {
592
+ name: 'deposit_mint',
593
+ },
594
+ {
595
+ name: 'admin',
596
+ signer: true,
597
+ },
598
+ {
599
+ docs: [
600
+ 'The attached queue, which must sign. The handler checks its key against',
601
+ 'the stored authority.',
602
+ ],
603
+ name: 'queue',
604
+ signer: true,
605
+ },
606
+ ],
607
+ args: [],
608
+ discriminator: [58, 25, 112, 37, 254, 105, 157, 96],
609
+ docs: [
610
+ "Admin detaches this vault's withdrawal queue, restoring direct redemption.",
611
+ '',
612
+ 'The attached queue must co-sign, which it does only from its',
613
+ '`release_vault`. The vault never reads queue state, so that signature is',
614
+ "how the queue's consent is expressed.",
615
+ ],
616
+ name: 'detach_withdrawal_queue',
617
+ },
618
+ {
619
+ accounts: [
620
+ {
621
+ docs: [
622
+ 'Gates vault creation: it is restricted to the authority recorded in',
623
+ '`ProgramConfig`, rather than being open to any paying signer.',
624
+ '',
625
+ '**Declared first so a missing config fails closed early.** Anchor',
626
+ 'deserializes fields in declaration order, so if this account does not',
627
+ 'exist the instruction aborts with `AccountNotInitialized` before any',
628
+ 'account is created. That much *is* order-sensitive.',
629
+ '',
630
+ 'The authority comparison below is **not**. It is a `constraint` on a',
631
+ 'non-`init` field, and `anchor_syn::codegen::accounts::try_accounts::',
632
+ "generate_constraints` emits every `init` field's creation CPI ahead of",
633
+ '*all* non-init access checks, regardless of declaration order — and',
634
+ 'within a single field `linearize` orders `Init` before `Raw`, so moving',
635
+ 'the constraint onto an `init` account would not help either. An',
636
+ 'unauthorized caller who is also their own `payer` and cannot fund the',
637
+ 'rent therefore fails with a System Program "insufficient lamports" error',
638
+ 'rather than `NotProtocolAuthority`.',
639
+ '',
640
+ 'Authorization is still enforced in every case — only the error surfaced',
641
+ "depends on the caller's balance. Pinned by",
642
+ '`unauthorized_signer_creates_nothing_whatever_their_balance`.',
643
+ '',
644
+ '**Namespace note**: `vault_version` is a `u8` seed byte, so each deposit',
645
+ 'mint has 256 namespaces and each is single-use. `close_vault` cannot',
646
+ 'close the share mint (classic SPL Token has no close-mint instruction)',
647
+ 'and revokes its mint authority irreversibly, so a retired version can',
648
+ 'never be re-initialized. Retiring a vault therefore consumes one of the',
649
+ '256 permanently and strands its share-mint rent.',
650
+ ],
651
+ name: 'program_config',
652
+ pda: {
653
+ seeds: [
654
+ {
655
+ kind: 'const',
656
+ value: [
657
+ 112, 114, 111, 103, 114, 97, 109, 95, 99, 111, 110, 102, 105,
658
+ 103,
659
+ ],
660
+ },
661
+ ],
662
+ },
663
+ },
664
+ {
665
+ docs: [
666
+ 'The protocol authority. Authorizes creation but does not fund it, so a',
667
+ 'cold or MPC-held key can hold this role without carrying SOL.',
668
+ ],
669
+ name: 'signer',
670
+ signer: true,
671
+ },
672
+ {
673
+ docs: [
674
+ 'Funds the three accounts below. May be the same key as `signer`.',
675
+ ],
676
+ name: 'payer',
677
+ signer: true,
678
+ writable: true,
679
+ },
680
+ {
681
+ name: 'deposit_mint',
682
+ },
683
+ {
684
+ name: 'vault_state',
685
+ writable: true,
686
+ },
687
+ {
688
+ name: 'share_mint',
689
+ writable: true,
690
+ },
691
+ {
692
+ name: 'vault_token_ata',
693
+ writable: true,
694
+ },
695
+ {
696
+ address: '11111111111111111111111111111111',
697
+ name: 'system_program',
698
+ },
699
+ {
700
+ name: 'token_program',
701
+ },
702
+ {
703
+ address: 'SysvarRent111111111111111111111111111111111',
704
+ name: 'rent',
705
+ },
706
+ ],
707
+ args: [
708
+ {
709
+ name: 'admin',
710
+ type: 'pubkey',
711
+ },
712
+ {
713
+ name: 'operator',
714
+ type: 'pubkey',
715
+ },
716
+ {
717
+ name: 'fee_recipient',
718
+ type: 'pubkey',
719
+ },
720
+ {
721
+ name: 'vault_version',
722
+ type: 'u8',
723
+ },
724
+ {
725
+ name: 'share_offset',
726
+ type: 'u64',
727
+ },
728
+ ],
729
+ discriminator: [175, 175, 109, 31, 13, 152, 155, 237],
730
+ docs: [
731
+ 'Initialize the Vault state',
732
+ 'Mint Vault shares',
733
+ '',
734
+ 'Requires the signer to be the protocol authority from `ProgramConfig`.',
735
+ '',
736
+ '### Parameters',
737
+ '- `admin` - The Admin of the Vault',
738
+ '- `operator` - The Operator of the Vault',
739
+ '- `fee_recipient` - The Fee recipient of the Vault',
740
+ '- `vault_version` - Version number for the vault (allows multiple vaults per deposit mint)',
741
+ "- `share_offset` - This vault's virtual-share offset, in base units of the",
742
+ 'deposit mint. Must be a power of ten within',
743
+ '`MIN_SHARE_OFFSET..=MAX_SHARE_OFFSET`. It is fixed for the life of the',
744
+ 'vault and also sets the minimum first deposit',
745
+ '(`MIN_SUPPLY_MULTIPLE * share_offset`), so choose it for what a base',
746
+ 'unit of this mint is worth: a larger offset buys a wider margin against',
747
+ 'share-burn price manipulation, a smaller one keeps a high-value mint',
748
+ 'launchable.',
749
+ ],
750
+ name: 'initialize',
751
+ },
752
+ {
753
+ accounts: [
754
+ {
755
+ docs: ["Must be the program's current upgrade authority."],
756
+ name: 'upgrade_authority',
757
+ signer: true,
758
+ },
759
+ {
760
+ docs: [
761
+ "This program's `ProgramData`. The seed constraint pins it to *this*",
762
+ 'program, so a caller cannot present the `ProgramData` of some unrelated',
763
+ 'program they happen to control.',
764
+ '',
765
+ 'Note that declaration order does **not** make this check run before',
766
+ "`program_config` is created: Anchor emits every `init` field's creation",
767
+ 'CPI ahead of all non-init access checks. An upgrade-authority mismatch is',
768
+ 'still always caught — the whole transaction reverts — but a caller who',
769
+ "cannot fund the config's rent sees the System Program's error rather than",
770
+ '`NotProtocolAuthority`.',
771
+ ],
772
+ name: 'program_data',
773
+ pda: {
774
+ program: {
775
+ kind: 'const',
776
+ value: [
777
+ 2, 168, 246, 145, 78, 136, 161, 176, 226, 16, 21, 62, 247, 99,
778
+ 174, 43, 0, 194, 185, 61, 22, 193, 36, 210, 192, 83, 122, 16, 4,
779
+ 128, 0, 0,
780
+ ],
781
+ },
782
+ seeds: [
783
+ {
784
+ kind: 'const',
785
+ value: [
786
+ 13, 135, 88, 126, 126, 197, 36, 47, 73, 223, 215, 77, 214,
787
+ 167, 161, 118, 224, 21, 117, 226, 241, 67, 46, 100, 19, 247,
788
+ 103, 179, 29, 106, 67, 143,
789
+ ],
790
+ },
791
+ ],
792
+ },
793
+ },
794
+ {
795
+ name: 'payer',
796
+ signer: true,
797
+ writable: true,
798
+ },
799
+ {
800
+ name: 'program_config',
801
+ pda: {
802
+ seeds: [
803
+ {
804
+ kind: 'const',
805
+ value: [
806
+ 112, 114, 111, 103, 114, 97, 109, 95, 99, 111, 110, 102, 105,
807
+ 103,
808
+ ],
809
+ },
810
+ ],
811
+ },
812
+ writable: true,
813
+ },
814
+ {
815
+ address: '11111111111111111111111111111111',
816
+ name: 'system_program',
817
+ },
818
+ ],
819
+ args: [
820
+ {
821
+ name: 'authority',
822
+ type: 'pubkey',
823
+ },
824
+ ],
825
+ discriminator: [208, 127, 21, 1, 194, 190, 196, 70],
826
+ docs: [
827
+ 'Create the singleton program config, naming the key permitted to create',
828
+ "vaults. Callable only by the program's current upgrade authority, and",
829
+ 'only once.',
830
+ '',
831
+ '### Parameters',
832
+ '- `authority` - The key that may call `initialize` from now on',
833
+ ],
834
+ name: 'initialize_config',
835
+ },
836
+ {
837
+ accounts: [
838
+ {
839
+ name: 'vault_state',
840
+ },
841
+ {
842
+ name: 'deposit_mint',
843
+ },
844
+ {
845
+ name: 'nominated_admin_pda',
846
+ writable: true,
847
+ },
848
+ {
849
+ name: 'admin',
850
+ signer: true,
851
+ },
852
+ {
853
+ name: 'payer',
854
+ signer: true,
855
+ writable: true,
856
+ },
857
+ {
858
+ address: '11111111111111111111111111111111',
859
+ name: 'system_program',
860
+ },
861
+ ],
862
+ args: [
863
+ {
864
+ name: 'new_admin',
865
+ type: 'pubkey',
866
+ },
867
+ ],
868
+ discriminator: [134, 11, 31, 244, 20, 77, 138, 121],
869
+ docs: [
870
+ 'Admin Nominates a new Admin',
871
+ '### Parameters',
872
+ '- `new_admin` - The new admin',
873
+ ],
874
+ name: 'nominate_admin',
875
+ },
876
+ {
877
+ accounts: [
878
+ {
879
+ name: 'vault_state',
880
+ writable: true,
881
+ },
882
+ {
883
+ name: 'vault_deposit_ata',
884
+ writable: true,
885
+ },
886
+ {
887
+ docs: [
888
+ "Source: a registered subaccount's ATA, else the operator's own. Keeps the",
889
+ 'old name for wire compatibility.',
890
+ ],
891
+ name: 'operator_token_account',
892
+ writable: true,
893
+ },
894
+ {
895
+ name: 'deposit_mint',
896
+ },
897
+ {
898
+ docs: [
899
+ 'Still the operator: the destination changed, not who may move funds.',
900
+ ],
901
+ name: 'operator',
902
+ signer: true,
903
+ },
904
+ {
905
+ name: 'token_program',
906
+ },
907
+ {
908
+ docs: [
909
+ "The source's registry entry, required exactly when the vault has",
910
+ 'registrations. Its PDA binds it to this vault.',
911
+ '',
912
+ '**Last, and omittable.** Inserted mid-struct it would shift',
913
+ '`deposit_mint`, breaking every pre-registry operator call on upgrade.',
914
+ ],
915
+ name: 'subaccount',
916
+ optional: true,
917
+ pda: {
918
+ seeds: [
919
+ {
920
+ kind: 'const',
921
+ value: [83, 85, 66, 65, 67, 67, 79, 85, 78, 84],
922
+ },
923
+ {
924
+ kind: 'account',
925
+ path: 'vault_state',
926
+ },
927
+ {
928
+ account: 'Subaccount',
929
+ kind: 'account',
930
+ path: 'subaccount.address',
931
+ },
932
+ ],
933
+ },
934
+ writable: true,
935
+ },
936
+ ],
937
+ args: [
938
+ {
939
+ name: 'amount',
940
+ type: 'u64',
941
+ },
942
+ ],
943
+ discriminator: [30, 228, 53, 180, 222, 19, 226, 158],
944
+ docs: [
945
+ 'Operator deposit funds in the Vault',
946
+ '',
947
+ "Get tokens in, from the named registered subaccount's ATA once the vault",
948
+ "has any, else the operator's own. From a subaccount the vault PDA — not",
949
+ 'the operator — signs against the granted delegation; a missing or short',
950
+ 'allowance fails `SubaccountDelegationMissing` (6027).',
951
+ '',
952
+ '### Parameters',
953
+ '- `amount` - The amount of tokens to get in the Vault',
954
+ ],
955
+ name: 'operator_deposit',
956
+ },
957
+ {
958
+ accounts: [
959
+ {
960
+ name: 'vault_state',
961
+ writable: true,
962
+ },
963
+ {
964
+ name: 'deposit_mint',
965
+ },
966
+ {
967
+ name: 'operator',
968
+ signer: true,
969
+ },
970
+ ],
971
+ args: [
972
+ {
973
+ name: 'new_aum',
974
+ type: 'u64',
975
+ },
976
+ ],
977
+ discriminator: [101, 222, 179, 164, 219, 110, 161, 98],
978
+ docs: [
979
+ 'Operator Updates the Deployed AUM',
980
+ '',
981
+ 'Update must be within a +/- 10% bounderies of current deployed AUM',
982
+ 'Any update will increase / decrease the shares value',
983
+ '### Parameters',
984
+ '- `new_aum` - The new deployed AUM value',
985
+ ],
986
+ name: 'operator_update_aum',
987
+ },
988
+ {
989
+ accounts: [
990
+ {
991
+ name: 'vault_state',
992
+ writable: true,
993
+ },
994
+ {
995
+ name: 'vault_deposit_ata',
996
+ writable: true,
997
+ },
998
+ {
999
+ docs: [
1000
+ "Destination: a registered subaccount's ATA, else the operator's own.",
1001
+ 'Keeps the old name for wire compatibility.',
1002
+ ],
1003
+ name: 'operator_token_account',
1004
+ writable: true,
1005
+ },
1006
+ {
1007
+ name: 'deposit_mint',
1008
+ },
1009
+ {
1010
+ name: 'operator',
1011
+ signer: true,
1012
+ },
1013
+ {
1014
+ name: 'token_program',
1015
+ },
1016
+ {
1017
+ docs: [
1018
+ "The destination's registry entry, required exactly when the vault has",
1019
+ 'registrations. Its PDA binds it to this vault.',
1020
+ '',
1021
+ '**Last, and omittable.** Inserted mid-struct it would shift',
1022
+ '`deposit_mint`, breaking every pre-registry operator call on upgrade.',
1023
+ ],
1024
+ name: 'subaccount',
1025
+ optional: true,
1026
+ pda: {
1027
+ seeds: [
1028
+ {
1029
+ kind: 'const',
1030
+ value: [83, 85, 66, 65, 67, 67, 79, 85, 78, 84],
1031
+ },
1032
+ {
1033
+ kind: 'account',
1034
+ path: 'vault_state',
1035
+ },
1036
+ {
1037
+ account: 'Subaccount',
1038
+ kind: 'account',
1039
+ path: 'subaccount.address',
1040
+ },
1041
+ ],
1042
+ },
1043
+ writable: true,
1044
+ },
1045
+ ],
1046
+ args: [
1047
+ {
1048
+ name: 'amount',
1049
+ type: 'u64',
1050
+ },
1051
+ ],
1052
+ discriminator: [204, 93, 227, 34, 168, 109, 25, 130],
1053
+ docs: [
1054
+ 'Operator withdraw funds from the Vault',
1055
+ '',
1056
+ "Get tokens out, to the named registered subaccount's ATA once the vault",
1057
+ "has any, else the operator's own; the account must already exist. The",
1058
+ "subaccount's delegation must cover its outstanding principal plus",
1059
+ '`amount`, else `SubaccountDelegationMissing` (6027). A wrong-party ATA',
1060
+ 'fails `ConstraintTokenOwner` (2015); a non-derived token account, 2009.',
1061
+ '',
1062
+ '### Parameters',
1063
+ '- `amount` - The amount of tokens to get out of the Vault',
1064
+ ],
1065
+ name: 'operator_withdraw',
1066
+ },
1067
+ {
1068
+ accounts: [
1069
+ {
1070
+ name: 'program_config',
1071
+ pda: {
1072
+ seeds: [
1073
+ {
1074
+ kind: 'const',
1075
+ value: [
1076
+ 112, 114, 111, 103, 114, 97, 109, 95, 99, 111, 110, 102, 105,
1077
+ 103,
1078
+ ],
1079
+ },
1080
+ ],
1081
+ },
1082
+ writable: true,
1083
+ },
1084
+ {
1085
+ docs: ["Must be the program's current upgrade authority."],
1086
+ name: 'upgrade_authority',
1087
+ signer: true,
1088
+ },
1089
+ {
1090
+ docs: [
1091
+ "This program's `ProgramData`, pinned by seeds so a caller cannot present",
1092
+ 'the `ProgramData` of an unrelated program they happen to control.',
1093
+ ],
1094
+ name: 'program_data',
1095
+ pda: {
1096
+ program: {
1097
+ kind: 'const',
1098
+ value: [
1099
+ 2, 168, 246, 145, 78, 136, 161, 176, 226, 16, 21, 62, 247, 99,
1100
+ 174, 43, 0, 194, 185, 61, 22, 193, 36, 210, 192, 83, 122, 16, 4,
1101
+ 128, 0, 0,
1102
+ ],
1103
+ },
1104
+ seeds: [
1105
+ {
1106
+ kind: 'const',
1107
+ value: [
1108
+ 13, 135, 88, 126, 126, 197, 36, 47, 73, 223, 215, 77, 214,
1109
+ 167, 161, 118, 224, 21, 117, 226, 241, 67, 46, 100, 19, 247,
1110
+ 103, 179, 29, 106, 67, 143,
1111
+ ],
1112
+ },
1113
+ ],
1114
+ },
1115
+ },
1116
+ ],
1117
+ args: [
1118
+ {
1119
+ name: 'new_authority',
1120
+ type: 'pubkey',
1121
+ },
1122
+ ],
1123
+ discriminator: [49, 53, 195, 205, 146, 192, 154, 236],
1124
+ docs: [
1125
+ "Reset the vault-creation authority using the program's **upgrade",
1126
+ 'authority**, for when the current config authority is wrong or lost.',
1127
+ '',
1128
+ '### Parameters',
1129
+ '- `new_authority` - The replacement authority (must not be the zero key)',
1130
+ ],
1131
+ name: 'override_config_authority',
1132
+ },
1133
+ {
1134
+ accounts: [
1135
+ {
1136
+ name: 'vault_state',
1137
+ writable: true,
1138
+ },
1139
+ {
1140
+ name: 'deposit_mint',
1141
+ },
1142
+ {
1143
+ name: 'admin',
1144
+ signer: true,
1145
+ },
1146
+ ],
1147
+ args: [],
1148
+ discriminator: [211, 22, 221, 251, 74, 121, 193, 47],
1149
+ docs: [
1150
+ 'Admin Pauses the Vault',
1151
+ '### Parameters',
1152
+ '- `new_fee_recipient` - The new fee recipient',
1153
+ ],
1154
+ name: 'pause',
1155
+ },
1156
+ {
1157
+ accounts: [
1158
+ {
1159
+ name: 'vault_state',
1160
+ writable: true,
1161
+ },
1162
+ {
1163
+ name: 'vault_deposit_ata',
1164
+ writable: true,
1165
+ },
1166
+ {
1167
+ name: 'sender_token_account',
1168
+ writable: true,
1169
+ },
1170
+ {
1171
+ name: 'sender_share_account',
1172
+ writable: true,
1173
+ },
1174
+ {
1175
+ name: 'fee_recipient_account',
1176
+ writable: true,
1177
+ },
1178
+ {
1179
+ name: 'share_mint',
1180
+ writable: true,
1181
+ },
1182
+ {
1183
+ name: 'deposit_mint',
1184
+ },
1185
+ {
1186
+ name: 'signer',
1187
+ signer: true,
1188
+ },
1189
+ {
1190
+ name: 'token_program',
1191
+ },
1192
+ ],
1193
+ args: [
1194
+ {
1195
+ name: 'shares',
1196
+ type: 'u64',
1197
+ },
1198
+ ],
1199
+ discriminator: [184, 12, 86, 149, 70, 196, 97, 225],
1200
+ docs: [
1201
+ 'Redeem funds from the Vault',
1202
+ 'Burn shared',
1203
+ 'Get tokens out',
1204
+ '',
1205
+ 'No slippage bound — prefer `redeem_checked` in new integrations.',
1206
+ '',
1207
+ '### Parameters',
1208
+ '- `shares` - The amount of shares to burn',
1209
+ ],
1210
+ name: 'redeem',
1211
+ },
1212
+ {
1213
+ accounts: [
1214
+ {
1215
+ name: 'vault_state',
1216
+ writable: true,
1217
+ },
1218
+ {
1219
+ name: 'vault_deposit_ata',
1220
+ writable: true,
1221
+ },
1222
+ {
1223
+ name: 'sender_token_account',
1224
+ writable: true,
1225
+ },
1226
+ {
1227
+ name: 'sender_share_account',
1228
+ writable: true,
1229
+ },
1230
+ {
1231
+ name: 'fee_recipient_account',
1232
+ writable: true,
1233
+ },
1234
+ {
1235
+ name: 'share_mint',
1236
+ writable: true,
1237
+ },
1238
+ {
1239
+ name: 'deposit_mint',
1240
+ },
1241
+ {
1242
+ name: 'signer',
1243
+ signer: true,
1244
+ },
1245
+ {
1246
+ name: 'token_program',
1247
+ },
1248
+ ],
1249
+ args: [
1250
+ {
1251
+ name: 'shares',
1252
+ type: 'u64',
1253
+ },
1254
+ {
1255
+ name: 'min_assets_out',
1256
+ type: 'u64',
1257
+ },
1258
+ ],
1259
+ discriminator: [37, 136, 51, 20, 129, 161, 11, 218],
1260
+ docs: [
1261
+ 'Redeem funds from the Vault, refusing to pay out less than',
1262
+ '`min_assets_out`.',
1263
+ '',
1264
+ 'Same accounts and semantics as `redeem`, plus a caller-stated worst',
1265
+ 'acceptable payout, measured **net of the withdrawal fee** — what the',
1266
+ 'caller actually receives. Additive rather than a change to `redeem`, so',
1267
+ 'existing integrations keep working; pass 0 for identical behaviour.',
1268
+ '',
1269
+ '### Parameters',
1270
+ '- `shares` - The amount of shares to burn',
1271
+ '- `min_assets_out` - Revert with `SlippageExceeded` below this payout',
1272
+ ],
1273
+ name: 'redeem_checked',
1274
+ },
1275
+ {
1276
+ accounts: [
1277
+ {
1278
+ name: 'vault_state',
1279
+ writable: true,
1280
+ },
1281
+ {
1282
+ name: 'subaccount',
1283
+ pda: {
1284
+ seeds: [
1285
+ {
1286
+ kind: 'const',
1287
+ value: [83, 85, 66, 65, 67, 67, 79, 85, 78, 84],
1288
+ },
1289
+ {
1290
+ kind: 'account',
1291
+ path: 'vault_state',
1292
+ },
1293
+ {
1294
+ kind: 'arg',
1295
+ path: 'address',
1296
+ },
1297
+ ],
1298
+ },
1299
+ writable: true,
1300
+ },
1301
+ {
1302
+ name: 'deposit_mint',
1303
+ },
1304
+ {
1305
+ docs: [
1306
+ "The address's ATA, carrying the delegation. Derived from `address`, so it",
1307
+ 'cannot disagree with the argument.',
1308
+ ],
1309
+ name: 'subaccount_ata',
1310
+ pda: {
1311
+ program: {
1312
+ kind: 'const',
1313
+ value: [
1314
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
1315
+ 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
1316
+ 219, 233, 248, 89,
1317
+ ],
1318
+ },
1319
+ seeds: [
1320
+ {
1321
+ kind: 'arg',
1322
+ path: 'address',
1323
+ },
1324
+ {
1325
+ kind: 'account',
1326
+ path: 'token_program',
1327
+ },
1328
+ {
1329
+ kind: 'account',
1330
+ path: 'deposit_mint',
1331
+ },
1332
+ ],
1333
+ },
1334
+ },
1335
+ {
1336
+ name: 'token_program',
1337
+ },
1338
+ {
1339
+ docs: [
1340
+ 'Admin, not the operator. Where they are the same key this buys nothing.',
1341
+ ],
1342
+ name: 'admin',
1343
+ signer: true,
1344
+ writable: true,
1345
+ },
1346
+ {
1347
+ address: '11111111111111111111111111111111',
1348
+ name: 'system_program',
1349
+ },
1350
+ ],
1351
+ args: [
1352
+ {
1353
+ name: 'address',
1354
+ type: 'pubkey',
1355
+ },
1356
+ ],
1357
+ discriminator: [12, 219, 227, 235, 28, 220, 20, 220],
1358
+ docs: [
1359
+ 'Register a permitted operator destination. Admin only. Once any exists,',
1360
+ "both operator transfers must name one and the operator's own ATA is",
1361
+ 'refused.',
1362
+ '',
1363
+ "The address's ATA must already delegate to this vault",
1364
+ '(`approve(subaccount_ata, vault_state, n)`) — the only on-chain proof it',
1365
+ 'can return funds. `n` also caps deployments to that destination, is spent',
1366
+ 'down by returns, and SPL clears it at zero, so it needs re-granting per',
1367
+ 'cycle; short or lapsed fails `SubaccountDelegationMissing` (6027). The',
1368
+ "first registration adopts the vault's outstanding principal and must",
1369
+ 'cover it.',
1370
+ '',
1371
+ '### Parameters',
1372
+ '- `address` - The receiving address. Must not be the operator',
1373
+ ],
1374
+ name: 'register_subaccount',
1375
+ },
1376
+ {
1377
+ accounts: [
1378
+ {
1379
+ name: 'vault_state',
1380
+ writable: true,
1381
+ },
1382
+ {
1383
+ name: 'deposit_mint',
1384
+ },
1385
+ {
1386
+ name: 'admin',
1387
+ signer: true,
1388
+ },
1389
+ ],
1390
+ args: [
1391
+ {
1392
+ name: 'increase_limit',
1393
+ type: 'u32',
1394
+ },
1395
+ {
1396
+ name: 'decrease_limit',
1397
+ type: 'u32',
1398
+ },
1399
+ ],
1400
+ discriminator: [215, 97, 244, 184, 210, 255, 129, 225],
1401
+ docs: [
1402
+ 'Admin Updates the AUM Change Limits',
1403
+ '### Parameters',
1404
+ '- `increase_limit` - Max increase in basis points (e.g., 20 = 0.2%, 100 = 1%)',
1405
+ '- `decrease_limit` - Max decrease in basis points (e.g., 20 = 0.2%, 100 = 1%)',
1406
+ ],
1407
+ name: 'set_aum_limits',
1408
+ },
1409
+ {
1410
+ accounts: [
1411
+ {
1412
+ name: 'program_config',
1413
+ pda: {
1414
+ seeds: [
1415
+ {
1416
+ kind: 'const',
1417
+ value: [
1418
+ 112, 114, 111, 103, 114, 97, 109, 95, 99, 111, 110, 102, 105,
1419
+ 103,
1420
+ ],
1421
+ },
1422
+ ],
1423
+ },
1424
+ writable: true,
1425
+ },
1426
+ {
1427
+ name: 'authority',
1428
+ signer: true,
1429
+ },
1430
+ ],
1431
+ args: [
1432
+ {
1433
+ name: 'new_authority',
1434
+ type: 'pubkey',
1435
+ },
1436
+ ],
1437
+ discriminator: [16, 200, 212, 18, 95, 43, 107, 89],
1438
+ docs: [
1439
+ 'Rotate the key permitted to create vaults. Signed by the current',
1440
+ 'authority; see `override_config_authority` for the recovery path.',
1441
+ '',
1442
+ '### Parameters',
1443
+ '- `new_authority` - The replacement authority (must not be the zero key)',
1444
+ ],
1445
+ name: 'set_config_authority',
1446
+ },
1447
+ {
1448
+ accounts: [
1449
+ {
1450
+ name: 'vault_state',
1451
+ writable: true,
1452
+ },
1453
+ {
1454
+ name: 'deposit_mint',
1455
+ },
1456
+ {
1457
+ name: 'admin',
1458
+ signer: true,
1459
+ },
1460
+ ],
1461
+ args: [
1462
+ {
1463
+ name: 'new_fee_recipient',
1464
+ type: 'pubkey',
1465
+ },
1466
+ ],
1467
+ discriminator: [227, 18, 215, 42, 237, 246, 151, 66],
1468
+ docs: [
1469
+ 'Admin Updates the Fee recipient',
1470
+ '### Parameters',
1471
+ '- `new_fee_recipient` - The new fee recipient',
1472
+ ],
1473
+ name: 'set_fee_recipient',
1474
+ },
1475
+ {
1476
+ accounts: [
1477
+ {
1478
+ name: 'vault_state',
1479
+ writable: true,
1480
+ },
1481
+ {
1482
+ name: 'deposit_mint',
1483
+ },
1484
+ {
1485
+ name: 'admin',
1486
+ signer: true,
1487
+ },
1488
+ ],
1489
+ args: [
1490
+ {
1491
+ name: 'new_operator',
1492
+ type: 'pubkey',
1493
+ },
1494
+ ],
1495
+ discriminator: [238, 153, 101, 169, 243, 131, 36, 1],
1496
+ docs: [
1497
+ 'Admin Updates the Operator',
1498
+ '### Parameters',
1499
+ '- `new_operator` - The new operator',
1500
+ ],
1501
+ name: 'set_operator',
1502
+ },
1503
+ {
1504
+ accounts: [
1505
+ {
1506
+ name: 'vault_state',
1507
+ writable: true,
1508
+ },
1509
+ {
1510
+ name: 'deposit_mint',
1511
+ },
1512
+ {
1513
+ name: 'admin',
1514
+ signer: true,
1515
+ },
1516
+ ],
1517
+ args: [
1518
+ {
1519
+ name: 'new_fee',
1520
+ type: 'u32',
1521
+ },
1522
+ ],
1523
+ discriminator: [202, 235, 196, 76, 230, 68, 57, 150],
1524
+ docs: [
1525
+ 'Admin Updates the Withdrawal Fee',
1526
+ '',
1527
+ 'Fee should discourage users from sandwiching operator_update_aum.',
1528
+ '### Parameters',
1529
+ '- `new_fee` - Fee in units of `FEE_RATE_DENOMINATOR_VALUE` (full denominator',
1530
+ '≡ 100%). The handler caps `new_fee` strictly below',
1531
+ '`FEE_RATE_DENOMINATOR_VALUE / 10` (i.e. < 10%); see',
1532
+ '`set_withdrawal_fee::handler` for the exact cap expression. Higher',
1533
+ 'inputs revert with `WithdrawalFeeTooHigh`.',
1534
+ ],
1535
+ name: 'set_withdrawal_fee',
1536
+ },
1537
+ {
1538
+ accounts: [
1539
+ {
1540
+ name: 'vault_state',
1541
+ writable: true,
1542
+ },
1543
+ {
1544
+ name: 'subaccount',
1545
+ pda: {
1546
+ seeds: [
1547
+ {
1548
+ kind: 'const',
1549
+ value: [83, 85, 66, 65, 67, 67, 79, 85, 78, 84],
1550
+ },
1551
+ {
1552
+ kind: 'account',
1553
+ path: 'vault_state',
1554
+ },
1555
+ {
1556
+ account: 'Subaccount',
1557
+ kind: 'account',
1558
+ path: 'subaccount.address',
1559
+ },
1560
+ ],
1561
+ },
1562
+ writable: true,
1563
+ },
1564
+ {
1565
+ name: 'deposit_mint',
1566
+ },
1567
+ {
1568
+ docs: [
1569
+ 'Read for its balance, to bound the write-down. Derived, so it cannot be',
1570
+ 'substituted.',
1571
+ ],
1572
+ name: 'subaccount_ata',
1573
+ pda: {
1574
+ program: {
1575
+ kind: 'const',
1576
+ value: [
1577
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
1578
+ 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
1579
+ 219, 233, 248, 89,
1580
+ ],
1581
+ },
1582
+ seeds: [
1583
+ {
1584
+ account: 'Subaccount',
1585
+ kind: 'account',
1586
+ path: 'subaccount.address',
1587
+ },
1588
+ {
1589
+ kind: 'account',
1590
+ path: 'token_program',
1591
+ },
1592
+ {
1593
+ kind: 'account',
1594
+ path: 'deposit_mint',
1595
+ },
1596
+ ],
1597
+ },
1598
+ },
1599
+ {
1600
+ name: 'token_program',
1601
+ },
1602
+ {
1603
+ name: 'admin',
1604
+ signer: true,
1605
+ },
1606
+ ],
1607
+ args: [
1608
+ {
1609
+ name: 'amount',
1610
+ type: 'u64',
1611
+ },
1612
+ ],
1613
+ discriminator: [0, 151, 152, 213, 157, 238, 7, 62],
1614
+ docs: [
1615
+ 'Write down principal a destination will never return, after a realized',
1616
+ 'loss. Admin only; the operator reducing principal would reopen',
1617
+ 'deployment capacity.',
1618
+ '',
1619
+ 'Bounded by `principal - ata.amount`, so funds still sitting there must be',
1620
+ 'returned rather than written off. Leaves `deployed_aum` alone. Without',
1621
+ 'this a vault that took a loss could never be closed.',
1622
+ '',
1623
+ '### Parameters',
1624
+ '- `amount` - Principal to write down',
1625
+ ],
1626
+ name: 'settle_subaccount_loss',
1627
+ },
1628
+ {
1629
+ accounts: [
1630
+ {
1631
+ name: 'vault_state',
1632
+ writable: true,
1633
+ },
1634
+ {
1635
+ name: 'deposit_mint',
1636
+ },
1637
+ {
1638
+ name: 'admin',
1639
+ signer: true,
1640
+ },
1641
+ ],
1642
+ args: [],
1643
+ discriminator: [169, 144, 4, 38, 10, 141, 188, 255],
1644
+ docs: [
1645
+ 'Admin Unpauses the Vault',
1646
+ '### Parameters',
1647
+ '- `new_fee_recipient` - The new fee recipient',
1648
+ ],
1649
+ name: 'unpause',
1650
+ },
1651
+ {
1652
+ accounts: [
1653
+ {
1654
+ docs: ['The admin of the vault - only they can update metadata'],
1655
+ name: 'admin',
1656
+ signer: true,
1657
+ },
1658
+ {
1659
+ docs: [
1660
+ 'The vault state PDA that owns the mint authority and is the update authority',
1661
+ ],
1662
+ name: 'vault_state',
1663
+ },
1664
+ {
1665
+ docs: ['The deposit mint used for PDA derivation'],
1666
+ name: 'deposit_mint',
1667
+ },
1668
+ {
1669
+ docs: ['The share token mint'],
1670
+ name: 'share_mint',
1671
+ },
1672
+ {
1673
+ name: 'metadata_account',
1674
+ pda: {
1675
+ program: {
1676
+ kind: 'const',
1677
+ value: [
1678
+ 11, 112, 101, 177, 227, 209, 124, 69, 56, 157, 82, 127, 107, 4,
1679
+ 195, 205, 88, 184, 108, 115, 26, 160, 253, 181, 73, 182, 209,
1680
+ 188, 3, 248, 41, 70,
1681
+ ],
1682
+ },
1683
+ seeds: [
1684
+ {
1685
+ kind: 'const',
1686
+ value: [109, 101, 116, 97, 100, 97, 116, 97],
1687
+ },
1688
+ {
1689
+ kind: 'const',
1690
+ value: [
1691
+ 11, 112, 101, 177, 227, 209, 124, 69, 56, 157, 82, 127, 107,
1692
+ 4, 195, 205, 88, 184, 108, 115, 26, 160, 253, 181, 73, 182,
1693
+ 209, 188, 3, 248, 41, 70,
1694
+ ],
1695
+ },
1696
+ {
1697
+ kind: 'account',
1698
+ path: 'share_mint',
1699
+ },
1700
+ ],
1701
+ },
1702
+ writable: true,
1703
+ },
1704
+ {
1705
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
1706
+ name: 'token_program',
1707
+ },
1708
+ {
1709
+ address: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s',
1710
+ name: 'token_metadata_program',
1711
+ },
1712
+ ],
1713
+ args: [
1714
+ {
1715
+ name: 'name',
1716
+ type: 'string',
1717
+ },
1718
+ {
1719
+ name: 'symbol',
1720
+ type: 'string',
1721
+ },
1722
+ {
1723
+ name: 'uri',
1724
+ type: 'string',
1725
+ },
1726
+ ],
1727
+ discriminator: [33, 144, 157, 164, 161, 4, 219, 121],
1728
+ docs: [
1729
+ 'Update metadata for the share token',
1730
+ '### Parameters',
1731
+ '- `name` - The new name of the token',
1732
+ '- `symbol` - The new symbol of the token',
1733
+ '- `uri` - The new URI for the token metadata',
1734
+ ],
1735
+ name: 'update_share_token_metadata',
1736
+ },
1737
+ ],
1738
+ metadata: {
1739
+ description: 'Created with Anchor',
1740
+ name: 'august_vault',
1741
+ spec: '0.1.0',
1742
+ version: '0.1.0',
1743
+ },
1744
+ types: [
1745
+ {
1746
+ name: 'DepositEvt',
1747
+ type: {
1748
+ fields: [
1749
+ {
1750
+ name: 'caller',
1751
+ type: 'pubkey',
1752
+ },
1753
+ {
1754
+ name: 'receiver',
1755
+ type: 'pubkey',
1756
+ },
1757
+ {
1758
+ name: 'amount',
1759
+ type: 'u64',
1760
+ },
1761
+ {
1762
+ name: 'shares',
1763
+ type: 'u64',
1764
+ },
1765
+ ],
1766
+ kind: 'struct',
1767
+ },
1768
+ },
1769
+ {
1770
+ name: 'NominatedAdmin',
1771
+ repr: {
1772
+ kind: 'c',
1773
+ },
1774
+ serialization: 'bytemuck',
1775
+ type: {
1776
+ fields: [
1777
+ {
1778
+ name: 'nominated_admin',
1779
+ type: 'pubkey',
1780
+ },
1781
+ {
1782
+ name: 'valid_until',
1783
+ type: 'i64',
1784
+ },
1785
+ ],
1786
+ kind: 'struct',
1787
+ },
1788
+ },
1789
+ {
1790
+ docs: [
1791
+ 'Program-wide configuration.',
1792
+ '',
1793
+ 'Exists so vault creation is authenticated rather than open to any paying',
1794
+ 'signer. See the namespace note in `initialize.rs` for why a',
1795
+ '`(deposit_mint, vault_version)` pair cannot be reused once retired.',
1796
+ '',
1797
+ 'The authority is stored here rather than hardcoded so it can be rotated with',
1798
+ '`set_config_authority` instead of a program upgrade (upgrades require a',
1799
+ 'Fordefi-signed verified deploy).',
1800
+ ],
1801
+ name: 'ProgramConfig',
1802
+ type: {
1803
+ fields: [
1804
+ {
1805
+ docs: ['The only key permitted to call `initialize`.'],
1806
+ name: 'authority',
1807
+ type: 'pubkey',
1808
+ },
1809
+ {
1810
+ docs: [
1811
+ 'Bump of this PDA, stored so callers need not recompute it.',
1812
+ ],
1813
+ name: 'bump',
1814
+ type: {
1815
+ array: ['u8', 1],
1816
+ },
1817
+ },
1818
+ {
1819
+ docs: [
1820
+ 'Reserved. Lets a future change add policy fields (for example an',
1821
+ 'allowlist of approved vault creators) without resizing the account.',
1822
+ 'New fields must be carved **out of** this array, keeping `LEN` at 169:',
1823
+ '`initialize_config` uses `init` and can never be re-run, so once the',
1824
+ 'config exists on mainnet a larger `LEN` would make Anchor allocate a',
1825
+ 'different size for new deployments while the live account stays 169 and',
1826
+ 'stops deserializing. Enforced by a compile-time assertion in',
1827
+ '`programs/august-vault/src/state/config.rs`.',
1828
+ ],
1829
+ name: 'padding',
1830
+ type: {
1831
+ array: ['u64', 16],
1832
+ },
1833
+ },
1834
+ ],
1835
+ kind: 'struct',
1836
+ },
1837
+ },
1838
+ {
1839
+ name: 'Subaccount',
1840
+ type: {
1841
+ fields: [
1842
+ {
1843
+ docs: [
1844
+ 'In the seeds, so it cannot be used against another vault; stored for',
1845
+ '`getProgramAccounts` indexing.',
1846
+ ],
1847
+ name: 'vault_state',
1848
+ type: 'pubkey',
1849
+ },
1850
+ {
1851
+ docs: ['The receiving address. Its ATA is where funds go.'],
1852
+ name: 'address',
1853
+ type: 'pubkey',
1854
+ },
1855
+ {
1856
+ docs: [
1857
+ 'Principal sent here and not returned. Read by the coverage rule;',
1858
+ 'deregistration requires zero.',
1859
+ ],
1860
+ name: 'principal',
1861
+ type: 'u64',
1862
+ },
1863
+ {
1864
+ name: 'bump',
1865
+ type: 'u8',
1866
+ },
1867
+ {
1868
+ name: 'padding',
1869
+ type: {
1870
+ array: ['u64', 8],
1871
+ },
1872
+ },
1873
+ ],
1874
+ kind: 'struct',
1875
+ },
1876
+ },
1877
+ {
1878
+ name: 'VaultState',
1879
+ type: {
1880
+ fields: [
1881
+ {
1882
+ name: 'operator',
1883
+ type: 'pubkey',
1884
+ },
1885
+ {
1886
+ name: 'admin',
1887
+ type: 'pubkey',
1888
+ },
1889
+ {
1890
+ name: 'share_mint',
1891
+ type: 'pubkey',
1892
+ },
1893
+ {
1894
+ name: 'deposit_mint',
1895
+ type: 'pubkey',
1896
+ },
1897
+ {
1898
+ name: 'fee_recipient',
1899
+ type: 'pubkey',
1900
+ },
1901
+ {
1902
+ name: 'withdrawal_fee',
1903
+ type: 'u32',
1904
+ },
1905
+ {
1906
+ name: 'local_aum',
1907
+ type: 'u64',
1908
+ },
1909
+ {
1910
+ name: 'deployed_aum',
1911
+ type: 'u64',
1912
+ },
1913
+ {
1914
+ name: 'aum_increase_limit',
1915
+ type: 'u32',
1916
+ },
1917
+ {
1918
+ name: 'aum_decrease_limit',
1919
+ type: 'u32',
1920
+ },
1921
+ {
1922
+ name: 'pda_bump',
1923
+ type: {
1924
+ array: ['u8', 1],
1925
+ },
1926
+ },
1927
+ {
1928
+ name: 'vault_version',
1929
+ type: {
1930
+ array: ['u8', 1],
1931
+ },
1932
+ },
1933
+ {
1934
+ name: 'paused',
1935
+ type: 'bool',
1936
+ },
1937
+ {
1938
+ docs: [
1939
+ "This vault's virtual-share offset, in base units.",
1940
+ '',
1941
+ 'Per-vault rather than global because the right value depends on what a',
1942
+ 'base unit of the deposit mint is *worth*. The offset must dominate a',
1943
+ '1-unit retained sliver (so it is an absolute count), while',
1944
+ '`MIN_SUPPLY_MULTIPLE * offset` is the minimum first deposit — whose cost',
1945
+ 'is that count times the base-unit price. One global constant cannot serve',
1946
+ 'both a 6-decimal dollar stablecoin and an 8-decimal asset worth ~$100k.',
1947
+ '',
1948
+ '**Zero means "not set" and maps to [`EXTRA_SHARES`].** Vaults created',
1949
+ 'before this field existed have zeroed padding, so they read 0 — both live',
1950
+ 'mainnet vaults are in that state. Never read this field directly: on-chain',
1951
+ 'use `VaultState::share_offset()`, and off-chain use',
1952
+ '`resolved_share_offset()` from the generated Rust client, which mirrors it.',
1953
+ 'A raw 0 collapses the pricing to pure pro-rata, which agrees with the',
1954
+ 'program only while the vault sits exactly at par.',
1955
+ ],
1956
+ name: 'share_offset',
1957
+ type: 'u64',
1958
+ },
1959
+ {
1960
+ docs: [
1961
+ 'The only key permitted to redeem, or zero for "no queue".',
1962
+ '',
1963
+ 'Zero is what every live vault reads — their padding is zeroed here, so the',
1964
+ 'field arrives without a migration and redemption stays open to any holder.',
1965
+ "When set it holds this vault's withdrawal-queue PDA, and a direct holder",
1966
+ 'redeem is refused with `WithdrawalQueueRequired` (6021).',
1967
+ '',
1968
+ 'Two instructions write this field. `attach_withdrawal_queue` stores',
1969
+ "nothing but this vault's [`withdrawal_queue_pda`], and only while the field",
1970
+ 'is zero. `detach_withdrawal_queue` clears it, and needs **both** the',
1971
+ "admin's signature and the stored key's. Both rules exist because a key",
1972
+ 'nobody can sign for would freeze every exit permanently while deposits',
1973
+ 'kept working.',
1974
+ '',
1975
+ '`close_vault` also clears it, by closing the whole account, behind its',
1976
+ 'zero-supply and empty-reserve checks. Closing a gated vault is therefore an',
1977
+ 'implicit detach.',
1978
+ '',
1979
+ 'Read this field via [`Self::withdrawal_queue`] at every decision point.',
1980
+ "The only raw accesses are the two writers' own writes.",
1981
+ ],
1982
+ name: 'withdrawal_queue_authority',
1983
+ type: 'pubkey',
1984
+ },
1985
+ {
1986
+ docs: [
1987
+ 'Registered operator destinations. Nonzero means operator transfers must',
1988
+ "name one; zero means the operator's own ATA.",
1989
+ '',
1990
+ 'Zero on every vault created before the registry existed, so it arrives',
1991
+ 'without a migration. A count rather than an address because the',
1992
+ 'destination is always passed as a PDA — this only decides *whether* one',
1993
+ 'is required. Its safety rests on the addresses being custody the',
1994
+ 'operator cannot sweep, and on the admin being a different party from',
1995
+ 'the operator. One address serves one vault per deposit mint, since an',
1996
+ 'ATA has a single delegate slot.',
1997
+ ],
1998
+ name: 'subaccount_count',
1999
+ type: 'u64',
2000
+ },
2001
+ {
2002
+ docs: [
2003
+ 'Total principal taken out and not returned, across destinations.',
2004
+ '',
2005
+ 'Distinct from `deployed_aum`, which `operator_update_aum` marks with no',
2006
+ "tokens moving. Informational: coverage reads the destination's own",
2007
+ '`Subaccount::principal`, so nothing on-chain trusts this.',
2008
+ ],
2009
+ name: 'deployed_principal',
2010
+ type: 'u64',
2011
+ },
2012
+ {
2013
+ docs: [
2014
+ 'Reserved. Carve new fields **out of** this array so `LEN` stays 455, the',
2015
+ 'size of the live mainnet accounts — enforced by the `const` assertion below.',
2016
+ '',
2017
+ '**Declare a new field immediately before `padding`.** Anything inserted',
2018
+ 'earlier shifts the fields after it silently, and each then reads zero:',
2019
+ '`share_offset` (199) re-prices the vault, `withdrawal_queue_authority`',
2020
+ '(207) reopens a gated vault, `subaccount_count` (239) reads as no',
2021
+ 'subaccounts and pays the operator again, `deployed_principal` (247)',
2022
+ 'reads as nothing owed. Pinned by the per-field',
2023
+ '`*_stays_at_its_byte_offset` tests plus',
2024
+ '`every_field_stays_at_its_byte_offset`.',
2025
+ '',
2026
+ 'Shrinks in 8-byte steps only: it is an array of `u64`.',
2027
+ ],
2028
+ name: 'padding',
2029
+ type: {
2030
+ array: ['u64', 25],
2031
+ },
2032
+ },
2033
+ ],
2034
+ kind: 'struct',
2035
+ },
2036
+ },
2037
+ {
2038
+ name: 'WithdrawEvt',
2039
+ type: {
2040
+ fields: [
2041
+ {
2042
+ name: 'caller',
2043
+ type: 'pubkey',
2044
+ },
2045
+ {
2046
+ name: 'receiver',
2047
+ type: 'pubkey',
2048
+ },
2049
+ {
2050
+ name: 'owner',
2051
+ type: 'pubkey',
2052
+ },
2053
+ {
2054
+ name: 'assets',
2055
+ type: 'u64',
2056
+ },
2057
+ {
2058
+ name: 'shares',
2059
+ type: 'u64',
2060
+ },
2061
+ ],
2062
+ kind: 'struct',
2063
+ },
2064
+ },
2065
+ {
2066
+ docs: ['`queue` is the key now stored in `withdrawal_queue_authority`.'],
2067
+ name: 'WithdrawalQueueAttached',
2068
+ type: {
2069
+ fields: [
2070
+ {
2071
+ name: 'vault',
2072
+ type: 'pubkey',
2073
+ },
2074
+ {
2075
+ name: 'queue',
2076
+ type: 'pubkey',
2077
+ },
2078
+ ],
2079
+ kind: 'struct',
2080
+ },
2081
+ },
2082
+ {
2083
+ docs: ['`queue` is the key that was stored, and has just been cleared.'],
2084
+ name: 'WithdrawalQueueDetached',
2085
+ type: {
2086
+ fields: [
2087
+ {
2088
+ name: 'vault',
2089
+ type: 'pubkey',
2090
+ },
2091
+ {
2092
+ name: 'queue',
2093
+ type: 'pubkey',
2094
+ },
2095
+ ],
2096
+ kind: 'struct',
2097
+ },
2098
+ },
2099
+ ],
2100
+ };
2101
+ //# sourceMappingURL=vault-idl.js.map