@loyal-labs/loyal-smart-accounts-core 0.1.1

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 (436) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +1 -0
  3. package/dist/internal.d.ts +1 -0
  4. package/dist/internal.js +1 -0
  5. package/dist/loyal.d.ts +1 -0
  6. package/dist/loyal.js +1 -0
  7. package/dist/src/accounts.d.ts +1 -0
  8. package/dist/src/accounts.js +1 -0
  9. package/dist/src/codecs.d.ts +6 -0
  10. package/dist/src/codecs.js +6 -0
  11. package/dist/src/core/codecs/index.d.ts +6 -0
  12. package/dist/src/core/codecs/index.js +6 -0
  13. package/dist/src/core/codecs/primitives.d.ts +7 -0
  14. package/dist/src/core/codecs/primitives.js +28 -0
  15. package/dist/src/core/errors/index.d.ts +29 -0
  16. package/dist/src/core/errors/index.js +124 -0
  17. package/dist/src/core/generated/index.d.ts +1 -0
  18. package/dist/src/core/generated/index.js +1 -0
  19. package/dist/src/core/pda/index.d.ts +44 -0
  20. package/dist/src/core/pda/index.js +80 -0
  21. package/dist/src/core/spec/features.d.ts +1 -0
  22. package/dist/src/core/spec/features.js +1 -0
  23. package/dist/src/core/spec/idl.d.ts +1 -0
  24. package/dist/src/core/spec/idl.js +1 -0
  25. package/dist/src/core/spec/index.d.ts +4 -0
  26. package/dist/src/core/spec/index.js +4 -0
  27. package/dist/src/core/spec/pda-registry.d.ts +1 -0
  28. package/dist/src/core/spec/pda-registry.js +1 -0
  29. package/dist/src/core/transport/index.d.ts +54 -0
  30. package/dist/src/core/transport/index.js +96 -0
  31. package/dist/src/errors.d.ts +1 -0
  32. package/dist/src/errors.js +1 -0
  33. package/dist/src/generated/accounts/Batch.d.ts +130 -0
  34. package/dist/src/generated/accounts/Batch.js +158 -0
  35. package/dist/src/generated/accounts/BatchTransaction.d.ts +105 -0
  36. package/dist/src/generated/accounts/BatchTransaction.js +130 -0
  37. package/dist/src/generated/accounts/LegacyTransaction.d.ts +122 -0
  38. package/dist/src/generated/accounts/LegacyTransaction.js +163 -0
  39. package/dist/src/generated/accounts/Policy.d.ts +139 -0
  40. package/dist/src/generated/accounts/Policy.js +208 -0
  41. package/dist/src/generated/accounts/ProgramConfig.d.ts +116 -0
  42. package/dist/src/generated/accounts/ProgramConfig.js +153 -0
  43. package/dist/src/generated/accounts/Proposal.d.ts +119 -0
  44. package/dist/src/generated/accounts/Proposal.js +157 -0
  45. package/dist/src/generated/accounts/Settings.d.ts +140 -0
  46. package/dist/src/generated/accounts/Settings.js +210 -0
  47. package/dist/src/generated/accounts/SettingsTransaction.d.ts +113 -0
  48. package/dist/src/generated/accounts/SettingsTransaction.js +151 -0
  49. package/dist/src/generated/accounts/SpendingLimit.d.ts +137 -0
  50. package/dist/src/generated/accounts/SpendingLimit.js +206 -0
  51. package/dist/src/generated/accounts/Transaction.d.ts +110 -0
  52. package/dist/src/generated/accounts/Transaction.js +145 -0
  53. package/dist/src/generated/accounts/TransactionBuffer.d.ts +113 -0
  54. package/dist/src/generated/accounts/TransactionBuffer.js +143 -0
  55. package/dist/src/generated/accounts/index.d.ts +35 -0
  56. package/dist/src/generated/accounts/index.js +35 -0
  57. package/dist/src/generated/errors/index.d.ts +1420 -0
  58. package/dist/src/generated/errors/index.js +2312 -0
  59. package/dist/src/generated/index.d.ts +19 -0
  60. package/dist/src/generated/index.js +19 -0
  61. package/dist/src/generated/instructions/activateProposal.d.ts +42 -0
  62. package/dist/src/generated/instructions/activateProposal.js +58 -0
  63. package/dist/src/generated/instructions/addSignerAsAuthority.d.ts +59 -0
  64. package/dist/src/generated/instructions/addSignerAsAuthority.js +78 -0
  65. package/dist/src/generated/instructions/addSpendingLimitAsAuthority.d.ts +58 -0
  66. package/dist/src/generated/instructions/addSpendingLimitAsAuthority.js +80 -0
  67. package/dist/src/generated/instructions/addTransactionToBatch.d.ts +60 -0
  68. package/dist/src/generated/instructions/addTransactionToBatch.js +85 -0
  69. package/dist/src/generated/instructions/approveProposal.d.ts +59 -0
  70. package/dist/src/generated/instructions/approveProposal.js +78 -0
  71. package/dist/src/generated/instructions/cancelProposal.d.ts +59 -0
  72. package/dist/src/generated/instructions/cancelProposal.js +78 -0
  73. package/dist/src/generated/instructions/changeThresholdAsAuthority.d.ts +59 -0
  74. package/dist/src/generated/instructions/changeThresholdAsAuthority.js +78 -0
  75. package/dist/src/generated/instructions/closeBatch.d.ts +49 -0
  76. package/dist/src/generated/instructions/closeBatch.js +78 -0
  77. package/dist/src/generated/instructions/closeBatchTransaction.d.ts +47 -0
  78. package/dist/src/generated/instructions/closeBatchTransaction.js +73 -0
  79. package/dist/src/generated/instructions/closeEmptyPolicyTransaction.d.ts +51 -0
  80. package/dist/src/generated/instructions/closeEmptyPolicyTransaction.js +83 -0
  81. package/dist/src/generated/instructions/closeSettingsTransaction.d.ts +49 -0
  82. package/dist/src/generated/instructions/closeSettingsTransaction.js +78 -0
  83. package/dist/src/generated/instructions/closeTransaction.d.ts +49 -0
  84. package/dist/src/generated/instructions/closeTransaction.js +78 -0
  85. package/dist/src/generated/instructions/closeTransactionBuffer.d.ts +42 -0
  86. package/dist/src/generated/instructions/closeTransactionBuffer.js +58 -0
  87. package/dist/src/generated/instructions/createBatch.d.ts +56 -0
  88. package/dist/src/generated/instructions/createBatch.js +75 -0
  89. package/dist/src/generated/instructions/createProposal.d.ts +58 -0
  90. package/dist/src/generated/instructions/createProposal.js +80 -0
  91. package/dist/src/generated/instructions/createSettingsTransaction.d.ts +58 -0
  92. package/dist/src/generated/instructions/createSettingsTransaction.js +80 -0
  93. package/dist/src/generated/instructions/createSmartAccount.d.ts +56 -0
  94. package/dist/src/generated/instructions/createSmartAccount.js +75 -0
  95. package/dist/src/generated/instructions/createTransaction.d.ts +58 -0
  96. package/dist/src/generated/instructions/createTransaction.js +80 -0
  97. package/dist/src/generated/instructions/createTransactionBuffer.d.ts +56 -0
  98. package/dist/src/generated/instructions/createTransactionBuffer.js +75 -0
  99. package/dist/src/generated/instructions/createTransactionFromBuffer.d.ts +63 -0
  100. package/dist/src/generated/instructions/createTransactionFromBuffer.js +90 -0
  101. package/dist/src/generated/instructions/executeBatchTransaction.d.ts +46 -0
  102. package/dist/src/generated/instructions/executeBatchTransaction.js +68 -0
  103. package/dist/src/generated/instructions/executeSettingsTransaction.d.ts +52 -0
  104. package/dist/src/generated/instructions/executeSettingsTransaction.js +81 -0
  105. package/dist/src/generated/instructions/executeSettingsTransactionSync.d.ts +57 -0
  106. package/dist/src/generated/instructions/executeSettingsTransactionSync.js +73 -0
  107. package/dist/src/generated/instructions/executeTransaction.d.ts +46 -0
  108. package/dist/src/generated/instructions/executeTransaction.js +68 -0
  109. package/dist/src/generated/instructions/executeTransactionSync.d.ts +51 -0
  110. package/dist/src/generated/instructions/executeTransactionSync.js +60 -0
  111. package/dist/src/generated/instructions/executeTransactionSyncV2.d.ts +51 -0
  112. package/dist/src/generated/instructions/executeTransactionSyncV2.js +60 -0
  113. package/dist/src/generated/instructions/extendTransactionBuffer.d.ts +53 -0
  114. package/dist/src/generated/instructions/extendTransactionBuffer.js +65 -0
  115. package/dist/src/generated/instructions/index.d.ts +39 -0
  116. package/dist/src/generated/instructions/index.js +39 -0
  117. package/dist/src/generated/instructions/initializeProgramConfig.d.ts +52 -0
  118. package/dist/src/generated/instructions/initializeProgramConfig.js +65 -0
  119. package/dist/src/generated/instructions/logEvent.d.ts +49 -0
  120. package/dist/src/generated/instructions/logEvent.js +55 -0
  121. package/dist/src/generated/instructions/rejectProposal.d.ts +59 -0
  122. package/dist/src/generated/instructions/rejectProposal.js +78 -0
  123. package/dist/src/generated/instructions/removeSignerAsAuthority.d.ts +59 -0
  124. package/dist/src/generated/instructions/removeSignerAsAuthority.js +78 -0
  125. package/dist/src/generated/instructions/removeSpendingLimitAsAuthority.d.ts +57 -0
  126. package/dist/src/generated/instructions/removeSpendingLimitAsAuthority.js +75 -0
  127. package/dist/src/generated/instructions/setArchivalAuthorityAsAuthority.d.ts +59 -0
  128. package/dist/src/generated/instructions/setArchivalAuthorityAsAuthority.js +78 -0
  129. package/dist/src/generated/instructions/setNewSettingsAuthorityAsAuthority.d.ts +59 -0
  130. package/dist/src/generated/instructions/setNewSettingsAuthorityAsAuthority.js +78 -0
  131. package/dist/src/generated/instructions/setProgramConfigAuthority.d.ts +51 -0
  132. package/dist/src/generated/instructions/setProgramConfigAuthority.js +60 -0
  133. package/dist/src/generated/instructions/setProgramConfigSmartAccountCreationFee.d.ts +51 -0
  134. package/dist/src/generated/instructions/setProgramConfigSmartAccountCreationFee.js +60 -0
  135. package/dist/src/generated/instructions/setProgramConfigTreasury.d.ts +51 -0
  136. package/dist/src/generated/instructions/setProgramConfigTreasury.js +60 -0
  137. package/dist/src/generated/instructions/setTimeLockAsAuthority.d.ts +59 -0
  138. package/dist/src/generated/instructions/setTimeLockAsAuthority.js +78 -0
  139. package/dist/src/generated/instructions/useSpendingLimit.d.ts +70 -0
  140. package/dist/src/generated/instructions/useSpendingLimit.js +108 -0
  141. package/dist/src/generated/types/AccountConstraint.d.ts +19 -0
  142. package/dist/src/generated/types/AccountConstraint.js +18 -0
  143. package/dist/src/generated/types/AccountConstraintType.d.ts +49 -0
  144. package/dist/src/generated/types/AccountConstraintType.js +25 -0
  145. package/dist/src/generated/types/AddSignerArgs.d.ts +17 -0
  146. package/dist/src/generated/types/AddSignerArgs.js +16 -0
  147. package/dist/src/generated/types/AddSpendingLimitArgs.d.ts +25 -0
  148. package/dist/src/generated/types/AddSpendingLimitArgs.js +24 -0
  149. package/dist/src/generated/types/AddTransactionToBatchArgs.d.ts +16 -0
  150. package/dist/src/generated/types/AddTransactionToBatchArgs.js +15 -0
  151. package/dist/src/generated/types/AllowedSettingsChange.d.ts +60 -0
  152. package/dist/src/generated/types/AllowedSettingsChange.js +35 -0
  153. package/dist/src/generated/types/ChangeThresholdArgs.d.ts +16 -0
  154. package/dist/src/generated/types/ChangeThresholdArgs.js +15 -0
  155. package/dist/src/generated/types/ConsensusAccountType.d.ts +20 -0
  156. package/dist/src/generated/types/ConsensusAccountType.js +21 -0
  157. package/dist/src/generated/types/CreateBatchArgs.d.ts +16 -0
  158. package/dist/src/generated/types/CreateBatchArgs.js +15 -0
  159. package/dist/src/generated/types/CreateProposalArgs.d.ts +16 -0
  160. package/dist/src/generated/types/CreateProposalArgs.js +15 -0
  161. package/dist/src/generated/types/CreateSettingsTransactionArgs.d.ts +17 -0
  162. package/dist/src/generated/types/CreateSettingsTransactionArgs.js +16 -0
  163. package/dist/src/generated/types/CreateSmartAccountArgs.d.ts +22 -0
  164. package/dist/src/generated/types/CreateSmartAccountArgs.js +21 -0
  165. package/dist/src/generated/types/CreateTransactionArgs.d.ts +49 -0
  166. package/dist/src/generated/types/CreateTransactionArgs.js +25 -0
  167. package/dist/src/generated/types/CreateTransactionBufferArgs.d.ts +19 -0
  168. package/dist/src/generated/types/CreateTransactionBufferArgs.js +18 -0
  169. package/dist/src/generated/types/DataConstraint.d.ts +19 -0
  170. package/dist/src/generated/types/DataConstraint.js +18 -0
  171. package/dist/src/generated/types/DataOperator.d.ts +24 -0
  172. package/dist/src/generated/types/DataOperator.js +25 -0
  173. package/dist/src/generated/types/DataValue.d.ts +71 -0
  174. package/dist/src/generated/types/DataValue.js +43 -0
  175. package/dist/src/generated/types/ExtendTransactionBufferArgs.d.ts +15 -0
  176. package/dist/src/generated/types/ExtendTransactionBufferArgs.js +12 -0
  177. package/dist/src/generated/types/Hook.d.ts +21 -0
  178. package/dist/src/generated/types/Hook.js +20 -0
  179. package/dist/src/generated/types/InitProgramConfigArgs.d.ts +18 -0
  180. package/dist/src/generated/types/InitProgramConfigArgs.js +17 -0
  181. package/dist/src/generated/types/InstructionConstraint.d.ts +20 -0
  182. package/dist/src/generated/types/InstructionConstraint.js +19 -0
  183. package/dist/src/generated/types/InternalFundTransferPayload.d.ts +20 -0
  184. package/dist/src/generated/types/InternalFundTransferPayload.js +19 -0
  185. package/dist/src/generated/types/InternalFundTransferPolicy.d.ts +18 -0
  186. package/dist/src/generated/types/InternalFundTransferPolicy.js +17 -0
  187. package/dist/src/generated/types/InternalFundTransferPolicyCreationPayload.d.ts +18 -0
  188. package/dist/src/generated/types/InternalFundTransferPolicyCreationPayload.js +17 -0
  189. package/dist/src/generated/types/LegacySyncTransactionArgs.d.ts +17 -0
  190. package/dist/src/generated/types/LegacySyncTransactionArgs.js +16 -0
  191. package/dist/src/generated/types/LimitedQuantityConstraints.d.ts +15 -0
  192. package/dist/src/generated/types/LimitedQuantityConstraints.js +12 -0
  193. package/dist/src/generated/types/LimitedSettingsAction.d.ts +61 -0
  194. package/dist/src/generated/types/LimitedSettingsAction.js +35 -0
  195. package/dist/src/generated/types/LimitedSpendingLimit.d.ts +20 -0
  196. package/dist/src/generated/types/LimitedSpendingLimit.js +19 -0
  197. package/dist/src/generated/types/LimitedTimeConstraints.d.ts +18 -0
  198. package/dist/src/generated/types/LimitedTimeConstraints.js +17 -0
  199. package/dist/src/generated/types/LogEventArgs.d.ts +17 -0
  200. package/dist/src/generated/types/LogEventArgs.js +16 -0
  201. package/dist/src/generated/types/LogEventArgsV2.d.ts +15 -0
  202. package/dist/src/generated/types/LogEventArgsV2.js +12 -0
  203. package/dist/src/generated/types/Payload.d.ts +49 -0
  204. package/dist/src/generated/types/Payload.js +25 -0
  205. package/dist/src/generated/types/Period.d.ts +22 -0
  206. package/dist/src/generated/types/Period.js +23 -0
  207. package/dist/src/generated/types/PeriodV2.d.ts +57 -0
  208. package/dist/src/generated/types/PeriodV2.js +26 -0
  209. package/dist/src/generated/types/Permissions.d.ts +15 -0
  210. package/dist/src/generated/types/Permissions.js +12 -0
  211. package/dist/src/generated/types/PolicyActionPayloadDetails.d.ts +16 -0
  212. package/dist/src/generated/types/PolicyActionPayloadDetails.js +13 -0
  213. package/dist/src/generated/types/PolicyCreationPayload.d.ts +63 -0
  214. package/dist/src/generated/types/PolicyCreationPayload.js +42 -0
  215. package/dist/src/generated/types/PolicyEventType.d.ts +22 -0
  216. package/dist/src/generated/types/PolicyEventType.js +23 -0
  217. package/dist/src/generated/types/PolicyExecutionContext.d.ts +20 -0
  218. package/dist/src/generated/types/PolicyExecutionContext.js +21 -0
  219. package/dist/src/generated/types/PolicyExpiration.d.ts +47 -0
  220. package/dist/src/generated/types/PolicyExpiration.js +28 -0
  221. package/dist/src/generated/types/PolicyExpirationArgs.d.ts +45 -0
  222. package/dist/src/generated/types/PolicyExpirationArgs.js +20 -0
  223. package/dist/src/generated/types/PolicyPayload.d.ts +63 -0
  224. package/dist/src/generated/types/PolicyPayload.js +37 -0
  225. package/dist/src/generated/types/PolicyState.d.ts +63 -0
  226. package/dist/src/generated/types/PolicyState.js +37 -0
  227. package/dist/src/generated/types/ProgramConfigSetAuthorityArgs.d.ts +16 -0
  228. package/dist/src/generated/types/ProgramConfigSetAuthorityArgs.js +13 -0
  229. package/dist/src/generated/types/ProgramConfigSetSmartAccountCreationFeeArgs.d.ts +15 -0
  230. package/dist/src/generated/types/ProgramConfigSetSmartAccountCreationFeeArgs.js +12 -0
  231. package/dist/src/generated/types/ProgramConfigSetTreasuryArgs.d.ts +16 -0
  232. package/dist/src/generated/types/ProgramConfigSetTreasuryArgs.js +13 -0
  233. package/dist/src/generated/types/ProgramInteractionPayload.d.ts +17 -0
  234. package/dist/src/generated/types/ProgramInteractionPayload.js +16 -0
  235. package/dist/src/generated/types/ProgramInteractionPolicy.d.ts +22 -0
  236. package/dist/src/generated/types/ProgramInteractionPolicy.js +21 -0
  237. package/dist/src/generated/types/ProgramInteractionPolicyCreationPayload.d.ts +22 -0
  238. package/dist/src/generated/types/ProgramInteractionPolicyCreationPayload.js +21 -0
  239. package/dist/src/generated/types/ProgramInteractionTransactionPayload.d.ts +49 -0
  240. package/dist/src/generated/types/ProgramInteractionTransactionPayload.js +25 -0
  241. package/dist/src/generated/types/ProposalEventType.d.ts +24 -0
  242. package/dist/src/generated/types/ProposalEventType.js +25 -0
  243. package/dist/src/generated/types/ProposalStatus.d.ts +75 -0
  244. package/dist/src/generated/types/ProposalStatus.js +45 -0
  245. package/dist/src/generated/types/QuantityConstraints.d.ts +17 -0
  246. package/dist/src/generated/types/QuantityConstraints.js +16 -0
  247. package/dist/src/generated/types/RemoveSignerArgs.d.ts +17 -0
  248. package/dist/src/generated/types/RemoveSignerArgs.js +16 -0
  249. package/dist/src/generated/types/RemoveSpendingLimitArgs.d.ts +15 -0
  250. package/dist/src/generated/types/RemoveSpendingLimitArgs.js +12 -0
  251. package/dist/src/generated/types/SetArchivalAuthorityArgs.d.ts +17 -0
  252. package/dist/src/generated/types/SetArchivalAuthorityArgs.js +16 -0
  253. package/dist/src/generated/types/SetNewSettingsAuthorityArgs.d.ts +17 -0
  254. package/dist/src/generated/types/SetNewSettingsAuthorityArgs.js +16 -0
  255. package/dist/src/generated/types/SetTimeLockArgs.d.ts +16 -0
  256. package/dist/src/generated/types/SetTimeLockArgs.js +15 -0
  257. package/dist/src/generated/types/SettingsAction.d.ts +118 -0
  258. package/dist/src/generated/types/SettingsAction.js +92 -0
  259. package/dist/src/generated/types/SettingsChangePayload.d.ts +17 -0
  260. package/dist/src/generated/types/SettingsChangePayload.js +16 -0
  261. package/dist/src/generated/types/SettingsChangePolicy.d.ts +16 -0
  262. package/dist/src/generated/types/SettingsChangePolicy.js +13 -0
  263. package/dist/src/generated/types/SettingsChangePolicyCreationPayload.d.ts +16 -0
  264. package/dist/src/generated/types/SettingsChangePolicyCreationPayload.js +13 -0
  265. package/dist/src/generated/types/SmartAccountCompiledInstruction.d.ts +17 -0
  266. package/dist/src/generated/types/SmartAccountCompiledInstruction.js +16 -0
  267. package/dist/src/generated/types/SmartAccountMessageAddressTableLookup.d.ts +18 -0
  268. package/dist/src/generated/types/SmartAccountMessageAddressTableLookup.js +17 -0
  269. package/dist/src/generated/types/SmartAccountSigner.d.ts +18 -0
  270. package/dist/src/generated/types/SmartAccountSigner.js +17 -0
  271. package/dist/src/generated/types/SmartAccountTransactionMessage.d.ts +23 -0
  272. package/dist/src/generated/types/SmartAccountTransactionMessage.js +25 -0
  273. package/dist/src/generated/types/SpendingLimitPayload.d.ts +18 -0
  274. package/dist/src/generated/types/SpendingLimitPayload.js +17 -0
  275. package/dist/src/generated/types/SpendingLimitPolicy.d.ts +19 -0
  276. package/dist/src/generated/types/SpendingLimitPolicy.js +18 -0
  277. package/dist/src/generated/types/SpendingLimitPolicyCreationPayload.d.ts +24 -0
  278. package/dist/src/generated/types/SpendingLimitPolicyCreationPayload.js +23 -0
  279. package/dist/src/generated/types/SpendingLimitV2.d.ts +22 -0
  280. package/dist/src/generated/types/SpendingLimitV2.js +21 -0
  281. package/dist/src/generated/types/SyncPayload.d.ts +48 -0
  282. package/dist/src/generated/types/SyncPayload.js +24 -0
  283. package/dist/src/generated/types/SyncSettingsTransactionArgs.d.ts +18 -0
  284. package/dist/src/generated/types/SyncSettingsTransactionArgs.js +17 -0
  285. package/dist/src/generated/types/SyncTransactionArgs.d.ts +18 -0
  286. package/dist/src/generated/types/SyncTransactionArgs.js +17 -0
  287. package/dist/src/generated/types/SyncTransactionPayloadDetails.d.ts +16 -0
  288. package/dist/src/generated/types/SyncTransactionPayloadDetails.js +15 -0
  289. package/dist/src/generated/types/SynchronousTransactionEventPayload.d.ts +50 -0
  290. package/dist/src/generated/types/SynchronousTransactionEventPayload.js +28 -0
  291. package/dist/src/generated/types/TimeConstraints.d.ts +19 -0
  292. package/dist/src/generated/types/TimeConstraints.js +18 -0
  293. package/dist/src/generated/types/TransactionEventType.d.ts +21 -0
  294. package/dist/src/generated/types/TransactionEventType.js +22 -0
  295. package/dist/src/generated/types/TransactionPayload.d.ts +18 -0
  296. package/dist/src/generated/types/TransactionPayload.js +17 -0
  297. package/dist/src/generated/types/TransactionPayloadDetails.d.ts +18 -0
  298. package/dist/src/generated/types/TransactionPayloadDetails.js +17 -0
  299. package/dist/src/generated/types/UsageState.d.ts +16 -0
  300. package/dist/src/generated/types/UsageState.js +15 -0
  301. package/dist/src/generated/types/UseSpendingLimitArgs.d.ts +17 -0
  302. package/dist/src/generated/types/UseSpendingLimitArgs.js +16 -0
  303. package/dist/src/generated/types/Vote.d.ts +21 -0
  304. package/dist/src/generated/types/Vote.js +22 -0
  305. package/dist/src/generated/types/VoteOnProposalArgs.d.ts +15 -0
  306. package/dist/src/generated/types/VoteOnProposalArgs.js +12 -0
  307. package/dist/src/generated/types/index.d.ts +83 -0
  308. package/dist/src/generated/types/index.js +83 -0
  309. package/dist/src/index.d.ts +15 -0
  310. package/dist/src/index.js +15 -0
  311. package/dist/src/internal/generated.d.ts +1 -0
  312. package/dist/src/internal/generated.js +1 -0
  313. package/dist/src/internal/index.d.ts +2 -0
  314. package/dist/src/internal/index.js +2 -0
  315. package/dist/src/internal/instructions/activateProposal.d.ts +7 -0
  316. package/dist/src/internal/instructions/activateProposal.js +14 -0
  317. package/dist/src/internal/instructions/addSignerAsAuthority.d.ts +10 -0
  318. package/dist/src/internal/instructions/addSignerAsAuthority.js +11 -0
  319. package/dist/src/internal/instructions/addSpendingLimitAsAuthority.d.ts +18 -0
  320. package/dist/src/internal/instructions/addSpendingLimitAsAuthority.js +27 -0
  321. package/dist/src/internal/instructions/addTransactionToBatch.d.ts +18 -0
  322. package/dist/src/internal/instructions/addTransactionToBatch.js +44 -0
  323. package/dist/src/internal/instructions/approveProposal.d.ts +8 -0
  324. package/dist/src/internal/instructions/approveProposal.js +10 -0
  325. package/dist/src/internal/instructions/cancelProposal.d.ts +8 -0
  326. package/dist/src/internal/instructions/cancelProposal.js +11 -0
  327. package/dist/src/internal/instructions/changeThresholdAsAuthority.d.ts +9 -0
  328. package/dist/src/internal/instructions/changeThresholdAsAuthority.js +14 -0
  329. package/dist/src/internal/instructions/closeBatch.d.ts +15 -0
  330. package/dist/src/internal/instructions/closeBatch.js +29 -0
  331. package/dist/src/internal/instructions/closeBatchTransaction.d.ts +15 -0
  332. package/dist/src/internal/instructions/closeBatchTransaction.js +34 -0
  333. package/dist/src/internal/instructions/closeEmptyPolicyTransaction.d.ts +8 -0
  334. package/dist/src/internal/instructions/closeEmptyPolicyTransaction.js +26 -0
  335. package/dist/src/internal/instructions/closeSettingsTransaction.d.ts +8 -0
  336. package/dist/src/internal/instructions/closeSettingsTransaction.js +22 -0
  337. package/dist/src/internal/instructions/closeTransaction.d.ts +8 -0
  338. package/dist/src/internal/instructions/closeTransaction.js +22 -0
  339. package/dist/src/internal/instructions/closeTransactionBuffer.d.ts +8 -0
  340. package/dist/src/internal/instructions/closeTransactionBuffer.js +15 -0
  341. package/dist/src/internal/instructions/createBatch.d.ts +12 -0
  342. package/dist/src/internal/instructions/createBatch.js +15 -0
  343. package/dist/src/internal/instructions/createPolicyTransaction.d.ts +11 -0
  344. package/dist/src/internal/instructions/createPolicyTransaction.js +21 -0
  345. package/dist/src/internal/instructions/createProposal.d.ts +11 -0
  346. package/dist/src/internal/instructions/createProposal.js +19 -0
  347. package/dist/src/internal/instructions/createSettingsTransaction.d.ts +14 -0
  348. package/dist/src/internal/instructions/createSettingsTransaction.js +17 -0
  349. package/dist/src/internal/instructions/createSmartAccount.d.ts +15 -0
  350. package/dist/src/internal/instructions/createSmartAccount.js +30 -0
  351. package/dist/src/internal/instructions/createTransaction.d.ts +16 -0
  352. package/dist/src/internal/instructions/createTransaction.js +39 -0
  353. package/dist/src/internal/instructions/createTransactionBuffer.d.ts +13 -0
  354. package/dist/src/internal/instructions/createTransactionBuffer.js +24 -0
  355. package/dist/src/internal/instructions/createTransactionFromBuffer.d.ts +13 -0
  356. package/dist/src/internal/instructions/createTransactionFromBuffer.js +39 -0
  357. package/dist/src/internal/instructions/executeBatchTransaction.d.ts +13 -0
  358. package/dist/src/internal/instructions/executeBatchTransaction.js +47 -0
  359. package/dist/src/internal/instructions/executePolicyPayloadSync.d.ts +15 -0
  360. package/dist/src/internal/instructions/executePolicyPayloadSync.js +18 -0
  361. package/dist/src/internal/instructions/executePolicyTransaction.d.ts +9 -0
  362. package/dist/src/internal/instructions/executePolicyTransaction.js +22 -0
  363. package/dist/src/internal/instructions/executeSettingsTransaction.d.ts +12 -0
  364. package/dist/src/internal/instructions/executeSettingsTransaction.js +37 -0
  365. package/dist/src/internal/instructions/executeSettingsTransactionSync.d.ts +11 -0
  366. package/dist/src/internal/instructions/executeSettingsTransactionSync.js +26 -0
  367. package/dist/src/internal/instructions/executeTransaction.d.ts +12 -0
  368. package/dist/src/internal/instructions/executeTransaction.js +49 -0
  369. package/dist/src/internal/instructions/executeTransactionSync.d.ts +14 -0
  370. package/dist/src/internal/instructions/executeTransactionSync.js +15 -0
  371. package/dist/src/internal/instructions/executeTransactionSyncV2.d.ts +14 -0
  372. package/dist/src/internal/instructions/executeTransactionSyncV2.js +18 -0
  373. package/dist/src/internal/instructions/extendTransactionBuffer.d.ts +9 -0
  374. package/dist/src/internal/instructions/extendTransactionBuffer.js +19 -0
  375. package/dist/src/internal/instructions/index.d.ts +42 -0
  376. package/dist/src/internal/instructions/index.js +42 -0
  377. package/dist/src/internal/instructions/initializeProgramConfig.d.ts +9 -0
  378. package/dist/src/internal/instructions/initializeProgramConfig.js +16 -0
  379. package/dist/src/internal/instructions/logEvent.d.ts +6 -0
  380. package/dist/src/internal/instructions/logEvent.js +10 -0
  381. package/dist/src/internal/instructions/rejectProposal.d.ts +8 -0
  382. package/dist/src/internal/instructions/rejectProposal.js +15 -0
  383. package/dist/src/internal/instructions/removeSignerAsAuthority.d.ts +8 -0
  384. package/dist/src/internal/instructions/removeSignerAsAuthority.js +10 -0
  385. package/dist/src/internal/instructions/removeSpendingLimitAsAuthority.d.ts +9 -0
  386. package/dist/src/internal/instructions/removeSpendingLimitAsAuthority.js +14 -0
  387. package/dist/src/internal/instructions/setArchivalAuthorityAsAuthority.d.ts +8 -0
  388. package/dist/src/internal/instructions/setArchivalAuthorityAsAuthority.js +15 -0
  389. package/dist/src/internal/instructions/setNewSettingsAuthorityAsAuthority.d.ts +8 -0
  390. package/dist/src/internal/instructions/setNewSettingsAuthorityAsAuthority.js +13 -0
  391. package/dist/src/internal/instructions/setProgramConfigAuthority.d.ts +6 -0
  392. package/dist/src/internal/instructions/setProgramConfigAuthority.js +13 -0
  393. package/dist/src/internal/instructions/setProgramConfigSmartAccountCreationFee.d.ts +7 -0
  394. package/dist/src/internal/instructions/setProgramConfigSmartAccountCreationFee.js +14 -0
  395. package/dist/src/internal/instructions/setProgramConfigTreasury.d.ts +6 -0
  396. package/dist/src/internal/instructions/setProgramConfigTreasury.js +13 -0
  397. package/dist/src/internal/instructions/setTimeLockAsAuthority.d.ts +8 -0
  398. package/dist/src/internal/instructions/setTimeLockAsAuthority.js +13 -0
  399. package/dist/src/internal/instructions/useSpendingLimit.d.ts +15 -0
  400. package/dist/src/internal/instructions/useSpendingLimit.js +24 -0
  401. package/dist/src/internal/pda.d.ts +1 -0
  402. package/dist/src/internal/pda.js +1 -0
  403. package/dist/src/internal/utils.d.ts +1 -0
  404. package/dist/src/internal/utils.js +1 -0
  405. package/dist/src/loyal.d.ts +18 -0
  406. package/dist/src/loyal.js +56 -0
  407. package/dist/src/pda.d.ts +1 -0
  408. package/dist/src/pda.js +1 -0
  409. package/dist/src/spec/features.d.ts +15 -0
  410. package/dist/src/spec/features.js +69 -0
  411. package/dist/src/spec/idl.d.ts +3 -0
  412. package/dist/src/spec/idl.js +75 -0
  413. package/dist/src/spec/index.d.ts +4 -0
  414. package/dist/src/spec/index.js +4 -0
  415. package/dist/src/spec/operation-registry.d.ts +385 -0
  416. package/dist/src/spec/operation-registry.js +390 -0
  417. package/dist/src/spec/pda-registry.d.ts +32 -0
  418. package/dist/src/spec/pda-registry.js +71 -0
  419. package/dist/src/transport.d.ts +1 -0
  420. package/dist/src/transport.js +1 -0
  421. package/dist/src/types.d.ts +69 -0
  422. package/dist/src/types.js +129 -0
  423. package/dist/src/utils/compileToSynchronousMessage.d.ts +9 -0
  424. package/dist/src/utils/compileToSynchronousMessage.js +87 -0
  425. package/dist/src/utils/compileToSynchronousMessageV2.d.ts +19 -0
  426. package/dist/src/utils/compileToSynchronousMessageV2.js +154 -0
  427. package/dist/src/utils/compileToWrappedMessageV0.d.ts +7 -0
  428. package/dist/src/utils/compileToWrappedMessageV0.js +30 -0
  429. package/dist/src/utils/compiled-keys.d.ts +31 -0
  430. package/dist/src/utils/compiled-keys.js +144 -0
  431. package/dist/src/utils.d.ts +61 -0
  432. package/dist/src/utils.js +217 -0
  433. package/package.json +71 -0
  434. package/upstream/manifest.json +14 -0
  435. package/upstream/normalized/squads_smart_account_program.json +6020 -0
  436. package/upstream/raw/squads_smart_account_program.json +6020 -0
@@ -0,0 +1,163 @@
1
+ /**
2
+ * This code was GENERATED using the solita package.
3
+ * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
4
+ *
5
+ * See: https://github.com/metaplex-foundation/solita
6
+ */
7
+ import * as web3 from '@solana/web3.js';
8
+ import * as beet from '@metaplex-foundation/beet';
9
+ import * as beetSolana from '@metaplex-foundation/beet-solana';
10
+ import { smartAccountTransactionMessageBeet, } from '../types/SmartAccountTransactionMessage';
11
+ export const legacyTransactionDiscriminator = [
12
+ 144, 147, 65, 169, 145, 227, 57, 51,
13
+ ];
14
+ /**
15
+ * Holds the data for the {@link LegacyTransaction} Account and provides de/serialization
16
+ * functionality for that data
17
+ *
18
+ * @category Accounts
19
+ * @category generated
20
+ */
21
+ export class LegacyTransaction {
22
+ smartAccountSettings;
23
+ creator;
24
+ rentCollector;
25
+ index;
26
+ bump;
27
+ accountIndex;
28
+ accountBump;
29
+ ephemeralSignerBumps;
30
+ message;
31
+ constructor(smartAccountSettings, creator, rentCollector, index, bump, accountIndex, accountBump, ephemeralSignerBumps, message) {
32
+ this.smartAccountSettings = smartAccountSettings;
33
+ this.creator = creator;
34
+ this.rentCollector = rentCollector;
35
+ this.index = index;
36
+ this.bump = bump;
37
+ this.accountIndex = accountIndex;
38
+ this.accountBump = accountBump;
39
+ this.ephemeralSignerBumps = ephemeralSignerBumps;
40
+ this.message = message;
41
+ }
42
+ /**
43
+ * Creates a {@link LegacyTransaction} instance from the provided args.
44
+ */
45
+ static fromArgs(args) {
46
+ return new LegacyTransaction(args.smartAccountSettings, args.creator, args.rentCollector, args.index, args.bump, args.accountIndex, args.accountBump, args.ephemeralSignerBumps, args.message);
47
+ }
48
+ /**
49
+ * Deserializes the {@link LegacyTransaction} from the data of the provided {@link web3.AccountInfo}.
50
+ * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
51
+ */
52
+ static fromAccountInfo(accountInfo, offset = 0) {
53
+ return LegacyTransaction.deserialize(accountInfo.data, offset);
54
+ }
55
+ /**
56
+ * Retrieves the account info from the provided address and deserializes
57
+ * the {@link LegacyTransaction} from its data.
58
+ *
59
+ * @throws Error if no account info is found at the address or if deserialization fails
60
+ */
61
+ static async fromAccountAddress(connection, address, commitmentOrConfig) {
62
+ const accountInfo = await connection.getAccountInfo(address, commitmentOrConfig);
63
+ if (accountInfo == null) {
64
+ throw new Error(`Unable to find LegacyTransaction account at ${address}`);
65
+ }
66
+ return LegacyTransaction.fromAccountInfo(accountInfo, 0)[0];
67
+ }
68
+ /**
69
+ * Provides a {@link web3.Connection.getProgramAccounts} config builder,
70
+ * to fetch accounts matching filters that can be specified via that builder.
71
+ *
72
+ * @param programId - the program that owns the accounts we are filtering
73
+ */
74
+ static gpaBuilder(programId = new web3.PublicKey('SMRTzfY6DfH5ik3TKiyLFfXexV8uSG3d2UksSCYdunG')) {
75
+ return beetSolana.GpaBuilder.fromStruct(programId, legacyTransactionBeet);
76
+ }
77
+ /**
78
+ * Deserializes the {@link LegacyTransaction} from the provided data Buffer.
79
+ * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
80
+ */
81
+ static deserialize(buf, offset = 0) {
82
+ return legacyTransactionBeet.deserialize(buf, offset);
83
+ }
84
+ /**
85
+ * Serializes the {@link LegacyTransaction} into a Buffer.
86
+ * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
87
+ */
88
+ serialize() {
89
+ return legacyTransactionBeet.serialize({
90
+ accountDiscriminator: legacyTransactionDiscriminator,
91
+ ...this,
92
+ });
93
+ }
94
+ /**
95
+ * Returns the byteSize of a {@link Buffer} holding the serialized data of
96
+ * {@link LegacyTransaction} for the provided args.
97
+ *
98
+ * @param args need to be provided since the byte size for this account
99
+ * depends on them
100
+ */
101
+ static byteSize(args) {
102
+ const instance = LegacyTransaction.fromArgs(args);
103
+ return legacyTransactionBeet.toFixedFromValue({
104
+ accountDiscriminator: legacyTransactionDiscriminator,
105
+ ...instance,
106
+ }).byteSize;
107
+ }
108
+ /**
109
+ * Fetches the minimum balance needed to exempt an account holding
110
+ * {@link LegacyTransaction} data from rent
111
+ *
112
+ * @param args need to be provided since the byte size for this account
113
+ * depends on them
114
+ * @param connection used to retrieve the rent exemption information
115
+ */
116
+ static async getMinimumBalanceForRentExemption(args, connection, commitment) {
117
+ return connection.getMinimumBalanceForRentExemption(LegacyTransaction.byteSize(args), commitment);
118
+ }
119
+ /**
120
+ * Returns a readable version of {@link LegacyTransaction} properties
121
+ * and can be used to convert to JSON and/or logging
122
+ */
123
+ pretty() {
124
+ return {
125
+ smartAccountSettings: this.smartAccountSettings.toBase58(),
126
+ creator: this.creator.toBase58(),
127
+ rentCollector: this.rentCollector.toBase58(),
128
+ index: (() => {
129
+ const x = this.index;
130
+ if (typeof x.toNumber === 'function') {
131
+ try {
132
+ return x.toNumber();
133
+ }
134
+ catch (_) {
135
+ return x;
136
+ }
137
+ }
138
+ return x;
139
+ })(),
140
+ bump: this.bump,
141
+ accountIndex: this.accountIndex,
142
+ accountBump: this.accountBump,
143
+ ephemeralSignerBumps: this.ephemeralSignerBumps,
144
+ message: this.message,
145
+ };
146
+ }
147
+ }
148
+ /**
149
+ * @category Accounts
150
+ * @category generated
151
+ */
152
+ export const legacyTransactionBeet = new beet.FixableBeetStruct([
153
+ ['accountDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
154
+ ['smartAccountSettings', beetSolana.publicKey],
155
+ ['creator', beetSolana.publicKey],
156
+ ['rentCollector', beetSolana.publicKey],
157
+ ['index', beet.u64],
158
+ ['bump', beet.u8],
159
+ ['accountIndex', beet.u8],
160
+ ['accountBump', beet.u8],
161
+ ['ephemeralSignerBumps', beet.bytes],
162
+ ['message', smartAccountTransactionMessageBeet],
163
+ ], LegacyTransaction.fromArgs, 'LegacyTransaction');
@@ -0,0 +1,139 @@
1
+ /**
2
+ * This code was GENERATED using the solita package.
3
+ * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
4
+ *
5
+ * See: https://github.com/metaplex-foundation/solita
6
+ */
7
+ import * as web3 from '@solana/web3.js';
8
+ import * as beet from '@metaplex-foundation/beet';
9
+ import * as beetSolana from '@metaplex-foundation/beet-solana';
10
+ import { SmartAccountSigner } from '../types/SmartAccountSigner';
11
+ import { PolicyState } from '../types/PolicyState';
12
+ import { PolicyExpiration } from '../types/PolicyExpiration';
13
+ /**
14
+ * Arguments used to create {@link Policy}
15
+ * @category Accounts
16
+ * @category generated
17
+ */
18
+ export type PolicyArgs = {
19
+ settings: web3.PublicKey;
20
+ seed: beet.bignum;
21
+ bump: number;
22
+ transactionIndex: beet.bignum;
23
+ staleTransactionIndex: beet.bignum;
24
+ signers: SmartAccountSigner[];
25
+ threshold: number;
26
+ timeLock: number;
27
+ policyState: PolicyState;
28
+ start: beet.bignum;
29
+ expiration: beet.COption<PolicyExpiration>;
30
+ rentCollector: web3.PublicKey;
31
+ };
32
+ export declare const policyDiscriminator: number[];
33
+ /**
34
+ * Holds the data for the {@link Policy} Account and provides de/serialization
35
+ * functionality for that data
36
+ *
37
+ * @category Accounts
38
+ * @category generated
39
+ */
40
+ export declare class Policy implements PolicyArgs {
41
+ readonly settings: web3.PublicKey;
42
+ readonly seed: beet.bignum;
43
+ readonly bump: number;
44
+ readonly transactionIndex: beet.bignum;
45
+ readonly staleTransactionIndex: beet.bignum;
46
+ readonly signers: SmartAccountSigner[];
47
+ readonly threshold: number;
48
+ readonly timeLock: number;
49
+ readonly policyState: PolicyState;
50
+ readonly start: beet.bignum;
51
+ readonly expiration: beet.COption<PolicyExpiration>;
52
+ readonly rentCollector: web3.PublicKey;
53
+ private constructor();
54
+ /**
55
+ * Creates a {@link Policy} instance from the provided args.
56
+ */
57
+ static fromArgs(args: PolicyArgs): Policy;
58
+ /**
59
+ * Deserializes the {@link Policy} from the data of the provided {@link web3.AccountInfo}.
60
+ * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
61
+ */
62
+ static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [Policy, number];
63
+ /**
64
+ * Retrieves the account info from the provided address and deserializes
65
+ * the {@link Policy} from its data.
66
+ *
67
+ * @throws Error if no account info is found at the address or if deserialization fails
68
+ */
69
+ static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<Policy>;
70
+ /**
71
+ * Provides a {@link web3.Connection.getProgramAccounts} config builder,
72
+ * to fetch accounts matching filters that can be specified via that builder.
73
+ *
74
+ * @param programId - the program that owns the accounts we are filtering
75
+ */
76
+ static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<PolicyArgs & {
77
+ accountDiscriminator: number[];
78
+ }>;
79
+ /**
80
+ * Deserializes the {@link Policy} from the provided data Buffer.
81
+ * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
82
+ */
83
+ static deserialize(buf: Buffer, offset?: number): [Policy, number];
84
+ /**
85
+ * Serializes the {@link Policy} into a Buffer.
86
+ * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
87
+ */
88
+ serialize(): [Buffer, number];
89
+ /**
90
+ * Returns the byteSize of a {@link Buffer} holding the serialized data of
91
+ * {@link Policy} for the provided args.
92
+ *
93
+ * @param args need to be provided since the byte size for this account
94
+ * depends on them
95
+ */
96
+ static byteSize(args: PolicyArgs): number;
97
+ /**
98
+ * Fetches the minimum balance needed to exempt an account holding
99
+ * {@link Policy} data from rent
100
+ *
101
+ * @param args need to be provided since the byte size for this account
102
+ * depends on them
103
+ * @param connection used to retrieve the rent exemption information
104
+ */
105
+ static getMinimumBalanceForRentExemption(args: PolicyArgs, connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
106
+ /**
107
+ * Returns a readable version of {@link Policy} properties
108
+ * and can be used to convert to JSON and/or logging
109
+ */
110
+ pretty(): {
111
+ settings: string;
112
+ seed: number | {
113
+ toNumber: () => number;
114
+ };
115
+ bump: number;
116
+ transactionIndex: number | {
117
+ toNumber: () => number;
118
+ };
119
+ staleTransactionIndex: number | {
120
+ toNumber: () => number;
121
+ };
122
+ signers: SmartAccountSigner[];
123
+ threshold: number;
124
+ timeLock: number;
125
+ policyState: "InternalFundTransfer" | "SpendingLimit" | "SettingsChange" | "ProgramInteraction";
126
+ start: number | {
127
+ toNumber: () => number;
128
+ };
129
+ expiration: beet.COption<PolicyExpiration>;
130
+ rentCollector: string;
131
+ };
132
+ }
133
+ /**
134
+ * @category Accounts
135
+ * @category generated
136
+ */
137
+ export declare const policyBeet: beet.FixableBeetStruct<Policy, PolicyArgs & {
138
+ accountDiscriminator: number[];
139
+ }>;
@@ -0,0 +1,208 @@
1
+ /**
2
+ * This code was GENERATED using the solita package.
3
+ * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
4
+ *
5
+ * See: https://github.com/metaplex-foundation/solita
6
+ */
7
+ import * as web3 from '@solana/web3.js';
8
+ import * as beet from '@metaplex-foundation/beet';
9
+ import * as beetSolana from '@metaplex-foundation/beet-solana';
10
+ import { smartAccountSignerBeet, } from '../types/SmartAccountSigner';
11
+ import { policyStateBeet } from '../types/PolicyState';
12
+ import { policyExpirationBeet, } from '../types/PolicyExpiration';
13
+ export const policyDiscriminator = [222, 135, 7, 163, 235, 177, 33, 68];
14
+ /**
15
+ * Holds the data for the {@link Policy} Account and provides de/serialization
16
+ * functionality for that data
17
+ *
18
+ * @category Accounts
19
+ * @category generated
20
+ */
21
+ export class Policy {
22
+ settings;
23
+ seed;
24
+ bump;
25
+ transactionIndex;
26
+ staleTransactionIndex;
27
+ signers;
28
+ threshold;
29
+ timeLock;
30
+ policyState;
31
+ start;
32
+ expiration;
33
+ rentCollector;
34
+ constructor(settings, seed, bump, transactionIndex, staleTransactionIndex, signers, threshold, timeLock, policyState, start, expiration, rentCollector) {
35
+ this.settings = settings;
36
+ this.seed = seed;
37
+ this.bump = bump;
38
+ this.transactionIndex = transactionIndex;
39
+ this.staleTransactionIndex = staleTransactionIndex;
40
+ this.signers = signers;
41
+ this.threshold = threshold;
42
+ this.timeLock = timeLock;
43
+ this.policyState = policyState;
44
+ this.start = start;
45
+ this.expiration = expiration;
46
+ this.rentCollector = rentCollector;
47
+ }
48
+ /**
49
+ * Creates a {@link Policy} instance from the provided args.
50
+ */
51
+ static fromArgs(args) {
52
+ return new Policy(args.settings, args.seed, args.bump, args.transactionIndex, args.staleTransactionIndex, args.signers, args.threshold, args.timeLock, args.policyState, args.start, args.expiration, args.rentCollector);
53
+ }
54
+ /**
55
+ * Deserializes the {@link Policy} from the data of the provided {@link web3.AccountInfo}.
56
+ * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
57
+ */
58
+ static fromAccountInfo(accountInfo, offset = 0) {
59
+ return Policy.deserialize(accountInfo.data, offset);
60
+ }
61
+ /**
62
+ * Retrieves the account info from the provided address and deserializes
63
+ * the {@link Policy} from its data.
64
+ *
65
+ * @throws Error if no account info is found at the address or if deserialization fails
66
+ */
67
+ static async fromAccountAddress(connection, address, commitmentOrConfig) {
68
+ const accountInfo = await connection.getAccountInfo(address, commitmentOrConfig);
69
+ if (accountInfo == null) {
70
+ throw new Error(`Unable to find Policy account at ${address}`);
71
+ }
72
+ return Policy.fromAccountInfo(accountInfo, 0)[0];
73
+ }
74
+ /**
75
+ * Provides a {@link web3.Connection.getProgramAccounts} config builder,
76
+ * to fetch accounts matching filters that can be specified via that builder.
77
+ *
78
+ * @param programId - the program that owns the accounts we are filtering
79
+ */
80
+ static gpaBuilder(programId = new web3.PublicKey('SMRTzfY6DfH5ik3TKiyLFfXexV8uSG3d2UksSCYdunG')) {
81
+ return beetSolana.GpaBuilder.fromStruct(programId, policyBeet);
82
+ }
83
+ /**
84
+ * Deserializes the {@link Policy} from the provided data Buffer.
85
+ * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
86
+ */
87
+ static deserialize(buf, offset = 0) {
88
+ return policyBeet.deserialize(buf, offset);
89
+ }
90
+ /**
91
+ * Serializes the {@link Policy} into a Buffer.
92
+ * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
93
+ */
94
+ serialize() {
95
+ return policyBeet.serialize({
96
+ accountDiscriminator: policyDiscriminator,
97
+ ...this,
98
+ });
99
+ }
100
+ /**
101
+ * Returns the byteSize of a {@link Buffer} holding the serialized data of
102
+ * {@link Policy} for the provided args.
103
+ *
104
+ * @param args need to be provided since the byte size for this account
105
+ * depends on them
106
+ */
107
+ static byteSize(args) {
108
+ const instance = Policy.fromArgs(args);
109
+ return policyBeet.toFixedFromValue({
110
+ accountDiscriminator: policyDiscriminator,
111
+ ...instance,
112
+ }).byteSize;
113
+ }
114
+ /**
115
+ * Fetches the minimum balance needed to exempt an account holding
116
+ * {@link Policy} data from rent
117
+ *
118
+ * @param args need to be provided since the byte size for this account
119
+ * depends on them
120
+ * @param connection used to retrieve the rent exemption information
121
+ */
122
+ static async getMinimumBalanceForRentExemption(args, connection, commitment) {
123
+ return connection.getMinimumBalanceForRentExemption(Policy.byteSize(args), commitment);
124
+ }
125
+ /**
126
+ * Returns a readable version of {@link Policy} properties
127
+ * and can be used to convert to JSON and/or logging
128
+ */
129
+ pretty() {
130
+ return {
131
+ settings: this.settings.toBase58(),
132
+ seed: (() => {
133
+ const x = this.seed;
134
+ if (typeof x.toNumber === 'function') {
135
+ try {
136
+ return x.toNumber();
137
+ }
138
+ catch (_) {
139
+ return x;
140
+ }
141
+ }
142
+ return x;
143
+ })(),
144
+ bump: this.bump,
145
+ transactionIndex: (() => {
146
+ const x = this.transactionIndex;
147
+ if (typeof x.toNumber === 'function') {
148
+ try {
149
+ return x.toNumber();
150
+ }
151
+ catch (_) {
152
+ return x;
153
+ }
154
+ }
155
+ return x;
156
+ })(),
157
+ staleTransactionIndex: (() => {
158
+ const x = this.staleTransactionIndex;
159
+ if (typeof x.toNumber === 'function') {
160
+ try {
161
+ return x.toNumber();
162
+ }
163
+ catch (_) {
164
+ return x;
165
+ }
166
+ }
167
+ return x;
168
+ })(),
169
+ signers: this.signers,
170
+ threshold: this.threshold,
171
+ timeLock: this.timeLock,
172
+ policyState: this.policyState.__kind,
173
+ start: (() => {
174
+ const x = this.start;
175
+ if (typeof x.toNumber === 'function') {
176
+ try {
177
+ return x.toNumber();
178
+ }
179
+ catch (_) {
180
+ return x;
181
+ }
182
+ }
183
+ return x;
184
+ })(),
185
+ expiration: this.expiration,
186
+ rentCollector: this.rentCollector.toBase58(),
187
+ };
188
+ }
189
+ }
190
+ /**
191
+ * @category Accounts
192
+ * @category generated
193
+ */
194
+ export const policyBeet = new beet.FixableBeetStruct([
195
+ ['accountDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
196
+ ['settings', beetSolana.publicKey],
197
+ ['seed', beet.u64],
198
+ ['bump', beet.u8],
199
+ ['transactionIndex', beet.u64],
200
+ ['staleTransactionIndex', beet.u64],
201
+ ['signers', beet.array(smartAccountSignerBeet)],
202
+ ['threshold', beet.u16],
203
+ ['timeLock', beet.u32],
204
+ ['policyState', policyStateBeet],
205
+ ['start', beet.i64],
206
+ ['expiration', beet.coption(policyExpirationBeet)],
207
+ ['rentCollector', beetSolana.publicKey],
208
+ ], Policy.fromArgs, 'Policy');
@@ -0,0 +1,116 @@
1
+ /**
2
+ * This code was GENERATED using the solita package.
3
+ * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
4
+ *
5
+ * See: https://github.com/metaplex-foundation/solita
6
+ */
7
+ import * as beet from '@metaplex-foundation/beet';
8
+ import * as web3 from '@solana/web3.js';
9
+ import * as beetSolana from '@metaplex-foundation/beet-solana';
10
+ /**
11
+ * Arguments used to create {@link ProgramConfig}
12
+ * @category Accounts
13
+ * @category generated
14
+ */
15
+ export type ProgramConfigArgs = {
16
+ smartAccountIndex: beet.bignum;
17
+ authority: web3.PublicKey;
18
+ smartAccountCreationFee: beet.bignum;
19
+ treasury: web3.PublicKey;
20
+ reserved: number[];
21
+ };
22
+ export declare const programConfigDiscriminator: number[];
23
+ /**
24
+ * Holds the data for the {@link ProgramConfig} Account and provides de/serialization
25
+ * functionality for that data
26
+ *
27
+ * @category Accounts
28
+ * @category generated
29
+ */
30
+ export declare class ProgramConfig implements ProgramConfigArgs {
31
+ readonly smartAccountIndex: beet.bignum;
32
+ readonly authority: web3.PublicKey;
33
+ readonly smartAccountCreationFee: beet.bignum;
34
+ readonly treasury: web3.PublicKey;
35
+ readonly reserved: number[];
36
+ private constructor();
37
+ /**
38
+ * Creates a {@link ProgramConfig} instance from the provided args.
39
+ */
40
+ static fromArgs(args: ProgramConfigArgs): ProgramConfig;
41
+ /**
42
+ * Deserializes the {@link ProgramConfig} from the data of the provided {@link web3.AccountInfo}.
43
+ * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
44
+ */
45
+ static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [ProgramConfig, number];
46
+ /**
47
+ * Retrieves the account info from the provided address and deserializes
48
+ * the {@link ProgramConfig} from its data.
49
+ *
50
+ * @throws Error if no account info is found at the address or if deserialization fails
51
+ */
52
+ static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<ProgramConfig>;
53
+ /**
54
+ * Provides a {@link web3.Connection.getProgramAccounts} config builder,
55
+ * to fetch accounts matching filters that can be specified via that builder.
56
+ *
57
+ * @param programId - the program that owns the accounts we are filtering
58
+ */
59
+ static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<{
60
+ accountDiscriminator: any;
61
+ smartAccountIndex: any;
62
+ authority: any;
63
+ smartAccountCreationFee: any;
64
+ treasury: any;
65
+ reserved: any;
66
+ }>;
67
+ /**
68
+ * Deserializes the {@link ProgramConfig} from the provided data Buffer.
69
+ * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
70
+ */
71
+ static deserialize(buf: Buffer, offset?: number): [ProgramConfig, number];
72
+ /**
73
+ * Serializes the {@link ProgramConfig} into a Buffer.
74
+ * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
75
+ */
76
+ serialize(): [Buffer, number];
77
+ /**
78
+ * Returns the byteSize of a {@link Buffer} holding the serialized data of
79
+ * {@link ProgramConfig}
80
+ */
81
+ static get byteSize(): number;
82
+ /**
83
+ * Fetches the minimum balance needed to exempt an account holding
84
+ * {@link ProgramConfig} data from rent
85
+ *
86
+ * @param connection used to retrieve the rent exemption information
87
+ */
88
+ static getMinimumBalanceForRentExemption(connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
89
+ /**
90
+ * Determines if the provided {@link Buffer} has the correct byte size to
91
+ * hold {@link ProgramConfig} data.
92
+ */
93
+ static hasCorrectByteSize(buf: Buffer, offset?: number): boolean;
94
+ /**
95
+ * Returns a readable version of {@link ProgramConfig} properties
96
+ * and can be used to convert to JSON and/or logging
97
+ */
98
+ pretty(): {
99
+ smartAccountIndex: number | {
100
+ toNumber: () => number;
101
+ };
102
+ authority: string;
103
+ smartAccountCreationFee: number | {
104
+ toNumber: () => number;
105
+ };
106
+ treasury: string;
107
+ reserved: number[];
108
+ };
109
+ }
110
+ /**
111
+ * @category Accounts
112
+ * @category generated
113
+ */
114
+ export declare const programConfigBeet: beet.BeetStruct<ProgramConfig, ProgramConfigArgs & {
115
+ accountDiscriminator: number[];
116
+ }>;