@wuwei-labs/srsly 2.3.3-canary.36.16828734028.0 → 3.0.0-beta.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 (724) hide show
  1. package/README.md +126 -462
  2. package/dist/cjs/accounts/borrower.js +47 -0
  3. package/dist/cjs/accounts/borrower.js.map +1 -0
  4. package/dist/cjs/accounts/config.js +47 -0
  5. package/dist/cjs/accounts/config.js.map +1 -0
  6. package/dist/cjs/accounts/contract.js +47 -0
  7. package/dist/cjs/accounts/contract.js.map +1 -0
  8. package/dist/cjs/accounts/fleet.js +77 -0
  9. package/dist/cjs/accounts/fleet.js.map +1 -0
  10. package/dist/cjs/accounts/rental.js +47 -0
  11. package/dist/cjs/accounts/rental.js.map +1 -0
  12. package/dist/cjs/demos.js +124 -59
  13. package/dist/cjs/demos.js.map +1 -1
  14. package/dist/cjs/generated/codama/accounts/borrowerState.js +84 -0
  15. package/dist/cjs/generated/codama/accounts/borrowerState.js.map +1 -0
  16. package/dist/cjs/generated/codama/accounts/configState.js +37 -52
  17. package/dist/cjs/generated/codama/accounts/configState.js.map +1 -1
  18. package/dist/cjs/generated/codama/accounts/contractState.js +27 -51
  19. package/dist/cjs/generated/codama/accounts/contractState.js.map +1 -1
  20. package/dist/cjs/generated/codama/accounts/index.js +5 -2
  21. package/dist/cjs/generated/codama/accounts/index.js.map +1 -1
  22. package/dist/cjs/generated/codama/accounts/memberState.js +78 -0
  23. package/dist/cjs/generated/codama/accounts/memberState.js.map +1 -0
  24. package/dist/cjs/generated/codama/accounts/rentalState.js +23 -59
  25. package/dist/cjs/generated/codama/accounts/rentalState.js.map +1 -1
  26. package/dist/cjs/generated/codama/accounts/thread.js +45 -61
  27. package/dist/cjs/generated/codama/accounts/thread.js.map +1 -1
  28. package/dist/cjs/generated/codama/accounts/vaultState.js +82 -0
  29. package/dist/cjs/generated/codama/accounts/vaultState.js.map +1 -0
  30. package/dist/cjs/generated/codama/errors/index.js +2 -2
  31. package/dist/cjs/generated/codama/errors/srsly.js +158 -19
  32. package/dist/cjs/generated/codama/errors/srsly.js.map +1 -1
  33. package/dist/cjs/generated/codama/index.js +2 -2
  34. package/dist/cjs/generated/codama/instructions/acceptRental.js +107 -40
  35. package/dist/cjs/generated/codama/instructions/acceptRental.js.map +1 -1
  36. package/dist/cjs/generated/codama/instructions/cancelRental.js +53 -56
  37. package/dist/cjs/generated/codama/instructions/cancelRental.js.map +1 -1
  38. package/dist/cjs/generated/codama/instructions/captureRental.js +129 -0
  39. package/dist/cjs/generated/codama/instructions/captureRental.js.map +1 -0
  40. package/dist/cjs/generated/codama/instructions/claimBorrower.js +222 -0
  41. package/dist/cjs/generated/codama/instructions/claimBorrower.js.map +1 -0
  42. package/dist/cjs/generated/codama/instructions/claimBorrowerPayments.js +225 -0
  43. package/dist/cjs/generated/codama/instructions/claimBorrowerPayments.js.map +1 -0
  44. package/dist/cjs/generated/codama/instructions/claimContractPayments.js +230 -0
  45. package/dist/cjs/generated/codama/instructions/claimContractPayments.js.map +1 -0
  46. package/dist/cjs/generated/codama/instructions/closeBorrower.js +84 -0
  47. package/dist/cjs/generated/codama/instructions/closeBorrower.js.map +1 -0
  48. package/dist/cjs/generated/codama/instructions/closeContract.js +140 -31
  49. package/dist/cjs/generated/codama/instructions/closeContract.js.map +1 -1
  50. package/dist/cjs/generated/codama/instructions/closeRental.js +31 -28
  51. package/dist/cjs/generated/codama/instructions/closeRental.js.map +1 -1
  52. package/dist/cjs/generated/codama/instructions/createConfig.js +212 -0
  53. package/dist/cjs/generated/codama/instructions/createConfig.js.map +1 -0
  54. package/dist/cjs/generated/codama/instructions/createContract.js +47 -45
  55. package/dist/cjs/generated/codama/instructions/createContract.js.map +1 -1
  56. package/dist/cjs/generated/codama/instructions/deleteBorrower.js +126 -0
  57. package/dist/cjs/generated/codama/instructions/deleteBorrower.js.map +1 -0
  58. package/dist/cjs/generated/codama/instructions/deleteConfig.js +193 -0
  59. package/dist/cjs/generated/codama/instructions/deleteConfig.js.map +1 -0
  60. package/dist/cjs/generated/codama/instructions/deleteContract.js +115 -0
  61. package/dist/cjs/generated/codama/instructions/deleteContract.js.map +1 -0
  62. package/dist/cjs/generated/codama/instructions/deleteRental.js +115 -0
  63. package/dist/cjs/generated/codama/instructions/deleteRental.js.map +1 -0
  64. package/dist/cjs/generated/codama/instructions/discountBorrower.js +118 -0
  65. package/dist/cjs/generated/codama/instructions/discountBorrower.js.map +1 -0
  66. package/dist/cjs/generated/codama/instructions/index.js +15 -4
  67. package/dist/cjs/generated/codama/instructions/index.js.map +1 -1
  68. package/dist/cjs/generated/codama/instructions/payRental.js +95 -68
  69. package/dist/cjs/generated/codama/instructions/payRental.js.map +1 -1
  70. package/dist/cjs/generated/codama/instructions/{resetRental.js → releaseRental.js} +79 -38
  71. package/dist/cjs/generated/codama/instructions/releaseRental.js.map +1 -0
  72. package/dist/cjs/generated/codama/instructions/reserveRental.js +255 -0
  73. package/dist/cjs/generated/codama/instructions/reserveRental.js.map +1 -0
  74. package/dist/cjs/generated/codama/instructions/{initializeConfig.js → updateBorrower.js} +45 -52
  75. package/dist/cjs/generated/codama/instructions/updateBorrower.js.map +1 -0
  76. package/dist/cjs/generated/codama/instructions/updateConfig.js +41 -32
  77. package/dist/cjs/generated/codama/instructions/updateConfig.js.map +1 -1
  78. package/dist/cjs/generated/codama/instructions/updateContract.js +134 -0
  79. package/dist/cjs/generated/codama/instructions/updateContract.js.map +1 -0
  80. package/dist/cjs/generated/codama/programs/index.js +2 -2
  81. package/dist/cjs/generated/codama/programs/srsly.js +74 -18
  82. package/dist/cjs/generated/codama/programs/srsly.js.map +1 -1
  83. package/dist/cjs/generated/codama/shared/index.js +2 -2
  84. package/dist/cjs/generated/codama/shared/index.js.map +1 -1
  85. package/dist/cjs/generated/codama/types/capturedFlagData.js +31 -0
  86. package/dist/cjs/generated/codama/types/capturedFlagData.js.map +1 -0
  87. package/dist/cjs/generated/codama/types/index.js +7 -9
  88. package/dist/cjs/generated/codama/types/index.js.map +1 -1
  89. package/dist/cjs/generated/codama/types/memberConfig.js +33 -0
  90. package/dist/cjs/generated/codama/types/memberConfig.js.map +1 -0
  91. package/dist/cjs/generated/codama/types/memberType.js +55 -0
  92. package/dist/cjs/generated/codama/types/memberType.js.map +1 -0
  93. package/dist/cjs/generated/codama/types/paymentFrequency.js +2 -2
  94. package/dist/cjs/generated/codama/types/schedule.js +65 -0
  95. package/dist/cjs/generated/codama/types/schedule.js.map +1 -0
  96. package/dist/cjs/generated/codama/types/signal.js +48 -0
  97. package/dist/cjs/generated/codama/types/signal.js.map +1 -0
  98. package/dist/cjs/generated/codama/types/trigger.js +36 -23
  99. package/dist/cjs/generated/codama/types/trigger.js.map +1 -1
  100. package/dist/cjs/index.js +172 -245
  101. package/dist/cjs/index.js.map +1 -1
  102. package/dist/cjs/instructions/acceptRental.js +153 -0
  103. package/dist/cjs/instructions/acceptRental.js.map +1 -0
  104. package/dist/cjs/instructions/cancelRental.js +100 -0
  105. package/dist/cjs/instructions/cancelRental.js.map +1 -0
  106. package/dist/cjs/instructions/captureRental.js +85 -0
  107. package/dist/cjs/instructions/captureRental.js.map +1 -0
  108. package/dist/cjs/instructions/claimBorrower.js +66 -0
  109. package/dist/cjs/instructions/claimBorrower.js.map +1 -0
  110. package/dist/cjs/instructions/claimBorrowerPayments.js +69 -0
  111. package/dist/cjs/instructions/claimBorrowerPayments.js.map +1 -0
  112. package/dist/cjs/instructions/claimContractPayments.js +79 -0
  113. package/dist/cjs/instructions/claimContractPayments.js.map +1 -0
  114. package/dist/cjs/instructions/closeBorrower.js +60 -0
  115. package/dist/cjs/instructions/closeBorrower.js.map +1 -0
  116. package/dist/cjs/instructions/closeContract.js +120 -0
  117. package/dist/cjs/instructions/closeContract.js.map +1 -0
  118. package/dist/cjs/instructions/closeRental.js +105 -0
  119. package/dist/cjs/instructions/closeRental.js.map +1 -0
  120. package/dist/cjs/instructions/createConfig.js +74 -0
  121. package/dist/cjs/instructions/createConfig.js.map +1 -0
  122. package/dist/cjs/instructions/createContract.js +131 -0
  123. package/dist/cjs/instructions/createContract.js.map +1 -0
  124. package/dist/cjs/instructions/deleteBorrower.js +60 -0
  125. package/dist/cjs/instructions/deleteBorrower.js.map +1 -0
  126. package/dist/cjs/instructions/deleteConfig.js +79 -0
  127. package/dist/cjs/instructions/deleteConfig.js.map +1 -0
  128. package/dist/cjs/instructions/deleteRental.js +75 -0
  129. package/dist/cjs/instructions/deleteRental.js.map +1 -0
  130. package/dist/cjs/instructions/discountBorrower.js +75 -0
  131. package/dist/cjs/instructions/discountBorrower.js.map +1 -0
  132. package/dist/cjs/instructions/releaseRental.js +132 -0
  133. package/dist/cjs/instructions/releaseRental.js.map +1 -0
  134. package/dist/cjs/instructions/reserveRental.js +135 -0
  135. package/dist/cjs/instructions/reserveRental.js.map +1 -0
  136. package/dist/cjs/instructions/updateBorrower.js +89 -0
  137. package/dist/cjs/instructions/updateBorrower.js.map +1 -0
  138. package/dist/cjs/instructions/updateConfig.js +103 -0
  139. package/dist/cjs/instructions/updateConfig.js.map +1 -0
  140. package/dist/cjs/instructions/updateContract.js +107 -0
  141. package/dist/cjs/instructions/updateContract.js.map +1 -0
  142. package/dist/cjs/package.json +30 -32
  143. package/dist/cjs/params/amount.js +125 -0
  144. package/dist/cjs/params/amount.js.map +1 -0
  145. package/dist/cjs/params/duration.js +120 -0
  146. package/dist/cjs/params/duration.js.map +1 -0
  147. package/dist/cjs/params/schedule.js +164 -0
  148. package/dist/cjs/params/schedule.js.map +1 -0
  149. package/dist/cjs/pda/constants.js +73 -0
  150. package/dist/cjs/pda/constants.js.map +1 -0
  151. package/dist/cjs/pda/index.js +73 -0
  152. package/dist/cjs/pda/index.js.map +1 -0
  153. package/dist/cjs/pda/sage.js +175 -0
  154. package/dist/cjs/pda/sage.js.map +1 -0
  155. package/dist/cjs/pda/slyvault.js +56 -0
  156. package/dist/cjs/pda/slyvault.js.map +1 -0
  157. package/dist/cjs/pda/srsly.js +120 -0
  158. package/dist/cjs/pda/srsly.js.map +1 -0
  159. package/dist/cjs/pda/thread.js +64 -0
  160. package/dist/cjs/pda/thread.js.map +1 -0
  161. package/dist/cjs/pda/token.js +62 -0
  162. package/dist/cjs/pda/token.js.map +1 -0
  163. package/dist/cjs/utils/addresses.js +90 -0
  164. package/dist/cjs/utils/addresses.js.map +1 -0
  165. package/dist/cjs/utils/config.js +100 -187
  166. package/dist/cjs/utils/config.js.map +1 -1
  167. package/dist/cjs/utils/index.js +32 -28
  168. package/dist/cjs/utils/index.js.map +1 -1
  169. package/dist/cjs/utils/instructions.js +79 -0
  170. package/dist/cjs/utils/instructions.js.map +1 -0
  171. package/dist/cjs/utils/signer.js +113 -94
  172. package/dist/cjs/utils/signer.js.map +1 -1
  173. package/dist/cjs/utils/web3js.js +76 -0
  174. package/dist/cjs/utils/web3js.js.map +1 -0
  175. package/dist/cjs/version.js +7 -0
  176. package/dist/cjs/version.js.map +1 -0
  177. package/dist/esm/accounts/borrower.js +44 -0
  178. package/dist/esm/accounts/borrower.js.map +1 -0
  179. package/dist/esm/accounts/config.js +44 -0
  180. package/dist/esm/accounts/config.js.map +1 -0
  181. package/dist/esm/accounts/contract.js +44 -0
  182. package/dist/esm/accounts/contract.js.map +1 -0
  183. package/dist/esm/accounts/fleet.js +74 -0
  184. package/dist/esm/accounts/fleet.js.map +1 -0
  185. package/dist/esm/accounts/rental.js +44 -0
  186. package/dist/esm/accounts/rental.js.map +1 -0
  187. package/dist/esm/demos.js +123 -18
  188. package/dist/esm/demos.js.map +1 -1
  189. package/dist/esm/generated/codama/accounts/borrowerState.js +72 -0
  190. package/dist/esm/generated/codama/accounts/borrowerState.js.map +1 -0
  191. package/dist/esm/generated/codama/accounts/configState.js +38 -53
  192. package/dist/esm/generated/codama/accounts/configState.js.map +1 -1
  193. package/dist/esm/generated/codama/accounts/contractState.js +28 -52
  194. package/dist/esm/generated/codama/accounts/contractState.js.map +1 -1
  195. package/dist/esm/generated/codama/accounts/index.js +5 -2
  196. package/dist/esm/generated/codama/accounts/index.js.map +1 -1
  197. package/dist/esm/generated/codama/accounts/memberState.js +66 -0
  198. package/dist/esm/generated/codama/accounts/memberState.js.map +1 -0
  199. package/dist/esm/generated/codama/accounts/rentalState.js +23 -60
  200. package/dist/esm/generated/codama/accounts/rentalState.js.map +1 -1
  201. package/dist/esm/generated/codama/accounts/thread.js +47 -63
  202. package/dist/esm/generated/codama/accounts/thread.js.map +1 -1
  203. package/dist/esm/generated/codama/accounts/vaultState.js +70 -0
  204. package/dist/esm/generated/codama/accounts/vaultState.js.map +1 -0
  205. package/dist/esm/generated/codama/errors/index.js +2 -2
  206. package/dist/esm/generated/codama/errors/srsly.js +156 -18
  207. package/dist/esm/generated/codama/errors/srsly.js.map +1 -1
  208. package/dist/esm/generated/codama/index.js +2 -2
  209. package/dist/esm/generated/codama/instructions/acceptRental.js +107 -40
  210. package/dist/esm/generated/codama/instructions/acceptRental.js.map +1 -1
  211. package/dist/esm/generated/codama/instructions/cancelRental.js +54 -57
  212. package/dist/esm/generated/codama/instructions/cancelRental.js.map +1 -1
  213. package/dist/esm/generated/codama/instructions/captureRental.js +119 -0
  214. package/dist/esm/generated/codama/instructions/captureRental.js.map +1 -0
  215. package/dist/esm/generated/codama/instructions/claimBorrower.js +212 -0
  216. package/dist/esm/generated/codama/instructions/claimBorrower.js.map +1 -0
  217. package/dist/esm/generated/codama/instructions/claimContractPayments.js +220 -0
  218. package/dist/esm/generated/codama/instructions/claimContractPayments.js.map +1 -0
  219. package/dist/esm/generated/codama/instructions/closeBorrower.js +75 -0
  220. package/dist/esm/generated/codama/instructions/closeBorrower.js.map +1 -0
  221. package/dist/esm/generated/codama/instructions/closeContract.js +142 -33
  222. package/dist/esm/generated/codama/instructions/closeContract.js.map +1 -1
  223. package/dist/esm/generated/codama/instructions/closeRental.js +31 -28
  224. package/dist/esm/generated/codama/instructions/closeRental.js.map +1 -1
  225. package/dist/esm/generated/codama/instructions/createConfig.js +202 -0
  226. package/dist/esm/generated/codama/instructions/createConfig.js.map +1 -0
  227. package/dist/esm/generated/codama/instructions/createContract.js +48 -46
  228. package/dist/esm/generated/codama/instructions/createContract.js.map +1 -1
  229. package/dist/esm/generated/codama/instructions/deleteBorrower.js +116 -0
  230. package/dist/esm/generated/codama/instructions/deleteBorrower.js.map +1 -0
  231. package/dist/esm/generated/codama/instructions/deleteConfig.js +183 -0
  232. package/dist/esm/generated/codama/instructions/deleteConfig.js.map +1 -0
  233. package/dist/esm/generated/codama/instructions/deleteContract.js +105 -0
  234. package/dist/esm/generated/codama/instructions/deleteContract.js.map +1 -0
  235. package/dist/esm/generated/codama/instructions/deleteRental.js +105 -0
  236. package/dist/esm/generated/codama/instructions/deleteRental.js.map +1 -0
  237. package/dist/esm/generated/codama/instructions/discountBorrower.js +108 -0
  238. package/dist/esm/generated/codama/instructions/discountBorrower.js.map +1 -0
  239. package/dist/esm/generated/codama/instructions/index.js +15 -4
  240. package/dist/esm/generated/codama/instructions/index.js.map +1 -1
  241. package/dist/esm/generated/codama/instructions/payRental.js +95 -68
  242. package/dist/esm/generated/codama/instructions/payRental.js.map +1 -1
  243. package/dist/esm/generated/codama/instructions/{resetRental.js → releaseRental.js} +73 -32
  244. package/dist/esm/generated/codama/instructions/releaseRental.js.map +1 -0
  245. package/dist/esm/generated/codama/instructions/reserveRental.js +245 -0
  246. package/dist/esm/generated/codama/instructions/reserveRental.js.map +1 -0
  247. package/dist/esm/generated/codama/instructions/{initializeConfig.js → updateBorrower.js} +38 -45
  248. package/dist/esm/generated/codama/instructions/updateBorrower.js.map +1 -0
  249. package/dist/esm/generated/codama/instructions/updateConfig.js +42 -33
  250. package/dist/esm/generated/codama/instructions/updateConfig.js.map +1 -1
  251. package/dist/esm/generated/codama/instructions/updateContract.js +124 -0
  252. package/dist/esm/generated/codama/instructions/updateContract.js.map +1 -0
  253. package/dist/esm/generated/codama/programs/index.js +2 -2
  254. package/dist/esm/generated/codama/programs/srsly.js +74 -18
  255. package/dist/esm/generated/codama/programs/srsly.js.map +1 -1
  256. package/dist/esm/generated/codama/shared/index.js +2 -2
  257. package/dist/esm/generated/codama/shared/index.js.map +1 -1
  258. package/dist/esm/generated/codama/types/capturedFlagData.js +26 -0
  259. package/dist/esm/generated/codama/types/capturedFlagData.js.map +1 -0
  260. package/dist/esm/generated/codama/types/index.js +7 -9
  261. package/dist/esm/generated/codama/types/index.js.map +1 -1
  262. package/dist/esm/generated/codama/types/memberConfig.js +28 -0
  263. package/dist/esm/generated/codama/types/memberConfig.js.map +1 -0
  264. package/dist/esm/generated/codama/types/memberType.js +48 -0
  265. package/dist/esm/generated/codama/types/memberType.js.map +1 -0
  266. package/dist/esm/generated/codama/types/paymentFrequency.js +2 -2
  267. package/dist/esm/generated/codama/types/schedule.js +58 -0
  268. package/dist/esm/generated/codama/types/schedule.js.map +1 -0
  269. package/dist/esm/generated/codama/types/signal.js +41 -0
  270. package/dist/esm/generated/codama/types/signal.js.map +1 -0
  271. package/dist/esm/generated/codama/types/trigger.js +37 -24
  272. package/dist/esm/generated/codama/types/trigger.js.map +1 -1
  273. package/dist/esm/index.js +78 -208
  274. package/dist/esm/index.js.map +1 -1
  275. package/dist/esm/instructions/acceptRental.js +150 -0
  276. package/dist/esm/instructions/acceptRental.js.map +1 -0
  277. package/dist/esm/instructions/cancelRental.js +97 -0
  278. package/dist/esm/instructions/cancelRental.js.map +1 -0
  279. package/dist/esm/instructions/captureRental.js +82 -0
  280. package/dist/esm/instructions/captureRental.js.map +1 -0
  281. package/dist/esm/instructions/claimBorrower.js +63 -0
  282. package/dist/esm/instructions/claimBorrower.js.map +1 -0
  283. package/dist/esm/instructions/claimContractPayments.js +76 -0
  284. package/dist/esm/instructions/claimContractPayments.js.map +1 -0
  285. package/dist/esm/instructions/closeBorrower.js +57 -0
  286. package/dist/esm/instructions/closeBorrower.js.map +1 -0
  287. package/dist/esm/instructions/closeContract.js +117 -0
  288. package/dist/esm/instructions/closeContract.js.map +1 -0
  289. package/dist/esm/instructions/closeRental.js +102 -0
  290. package/dist/esm/instructions/closeRental.js.map +1 -0
  291. package/dist/esm/instructions/createConfig.js +71 -0
  292. package/dist/esm/instructions/createConfig.js.map +1 -0
  293. package/dist/esm/instructions/createContract.js +128 -0
  294. package/dist/esm/instructions/createContract.js.map +1 -0
  295. package/dist/esm/instructions/deleteBorrower.js +57 -0
  296. package/dist/esm/instructions/deleteBorrower.js.map +1 -0
  297. package/dist/esm/instructions/deleteConfig.js +76 -0
  298. package/dist/esm/instructions/deleteConfig.js.map +1 -0
  299. package/dist/esm/instructions/deleteRental.js +72 -0
  300. package/dist/esm/instructions/deleteRental.js.map +1 -0
  301. package/dist/esm/instructions/discountBorrower.js +72 -0
  302. package/dist/esm/instructions/discountBorrower.js.map +1 -0
  303. package/dist/esm/instructions/releaseRental.js +129 -0
  304. package/dist/esm/instructions/releaseRental.js.map +1 -0
  305. package/dist/esm/instructions/reserveRental.js +132 -0
  306. package/dist/esm/instructions/reserveRental.js.map +1 -0
  307. package/dist/esm/instructions/updateBorrower.js +86 -0
  308. package/dist/esm/instructions/updateBorrower.js.map +1 -0
  309. package/dist/esm/instructions/updateConfig.js +100 -0
  310. package/dist/esm/instructions/updateConfig.js.map +1 -0
  311. package/dist/esm/instructions/updateContract.js +104 -0
  312. package/dist/esm/instructions/updateContract.js.map +1 -0
  313. package/dist/esm/package.json +30 -32
  314. package/dist/esm/params/amount.js +119 -0
  315. package/dist/esm/params/amount.js.map +1 -0
  316. package/dist/esm/params/duration.js +115 -0
  317. package/dist/esm/params/duration.js.map +1 -0
  318. package/dist/esm/params/schedule.js +157 -0
  319. package/dist/esm/params/schedule.js.map +1 -0
  320. package/dist/esm/pda/constants.js +67 -0
  321. package/dist/esm/pda/constants.js.map +1 -0
  322. package/dist/esm/pda/index.js +42 -0
  323. package/dist/esm/pda/index.js.map +1 -0
  324. package/dist/esm/pda/sage.js +168 -0
  325. package/dist/esm/pda/sage.js.map +1 -0
  326. package/dist/esm/pda/slyvault.js +53 -0
  327. package/dist/esm/pda/slyvault.js.map +1 -0
  328. package/dist/esm/pda/srsly.js +113 -0
  329. package/dist/esm/pda/srsly.js.map +1 -0
  330. package/dist/esm/pda/thread.js +61 -0
  331. package/dist/esm/pda/thread.js.map +1 -0
  332. package/dist/esm/pda/token.js +59 -0
  333. package/dist/esm/pda/token.js.map +1 -0
  334. package/dist/esm/utils/addresses.js +85 -0
  335. package/dist/esm/utils/addresses.js.map +1 -0
  336. package/dist/esm/utils/config.js +95 -149
  337. package/dist/esm/utils/config.js.map +1 -1
  338. package/dist/esm/utils/index.js +12 -14
  339. package/dist/esm/utils/index.js.map +1 -1
  340. package/dist/esm/utils/instructions.js +76 -0
  341. package/dist/esm/utils/instructions.js.map +1 -0
  342. package/dist/esm/utils/signer.js +109 -90
  343. package/dist/esm/utils/signer.js.map +1 -1
  344. package/dist/esm/utils/web3js.js +72 -0
  345. package/dist/esm/utils/web3js.js.map +1 -0
  346. package/dist/esm/version.js +4 -0
  347. package/dist/esm/version.js.map +1 -0
  348. package/dist/types/accounts/borrower.d.ts +34 -0
  349. package/dist/types/accounts/borrower.d.ts.map +1 -0
  350. package/dist/types/accounts/config.d.ts +31 -0
  351. package/dist/types/accounts/config.d.ts.map +1 -0
  352. package/dist/types/accounts/contract.d.ts +34 -0
  353. package/dist/types/accounts/contract.d.ts.map +1 -0
  354. package/dist/types/accounts/fleet.d.ts +49 -0
  355. package/dist/types/accounts/fleet.d.ts.map +1 -0
  356. package/dist/types/accounts/rental.d.ts +34 -0
  357. package/dist/types/accounts/rental.d.ts.map +1 -0
  358. package/dist/types/demos.d.ts +20 -52
  359. package/dist/types/demos.d.ts.map +1 -1
  360. package/dist/types/generated/codama/accounts/borrowerState.d.ts +94 -0
  361. package/dist/types/generated/codama/accounts/borrowerState.d.ts.map +1 -0
  362. package/dist/types/generated/codama/accounts/configState.d.ts +65 -22
  363. package/dist/types/generated/codama/accounts/configState.d.ts.map +1 -1
  364. package/dist/types/generated/codama/accounts/contractState.d.ts +62 -23
  365. package/dist/types/generated/codama/accounts/contractState.d.ts.map +1 -1
  366. package/dist/types/generated/codama/accounts/index.d.ts +5 -2
  367. package/dist/types/generated/codama/accounts/index.d.ts.map +1 -1
  368. package/dist/types/generated/codama/accounts/memberState.d.ts +58 -0
  369. package/dist/types/generated/codama/accounts/memberState.d.ts.map +1 -0
  370. package/dist/types/generated/codama/accounts/rentalState.d.ts +35 -39
  371. package/dist/types/generated/codama/accounts/rentalState.d.ts.map +1 -1
  372. package/dist/types/generated/codama/accounts/thread.d.ts +44 -51
  373. package/dist/types/generated/codama/accounts/thread.d.ts.map +1 -1
  374. package/dist/types/generated/codama/accounts/vaultState.d.ts +66 -0
  375. package/dist/types/generated/codama/accounts/vaultState.d.ts.map +1 -0
  376. package/dist/types/generated/codama/errors/index.d.ts +2 -2
  377. package/dist/types/generated/codama/errors/srsly.d.ts +111 -19
  378. package/dist/types/generated/codama/errors/srsly.d.ts.map +1 -1
  379. package/dist/types/generated/codama/index.d.ts +2 -2
  380. package/dist/types/generated/codama/instructions/acceptRental.d.ts +60 -45
  381. package/dist/types/generated/codama/instructions/acceptRental.d.ts.map +1 -1
  382. package/dist/types/generated/codama/instructions/cancelRental.d.ts +37 -32
  383. package/dist/types/generated/codama/instructions/cancelRental.d.ts.map +1 -1
  384. package/dist/types/generated/codama/instructions/captureRental.d.ts +59 -0
  385. package/dist/types/generated/codama/instructions/captureRental.d.ts.map +1 -0
  386. package/dist/types/generated/codama/instructions/claimBorrower.d.ts +90 -0
  387. package/dist/types/generated/codama/instructions/claimBorrower.d.ts.map +1 -0
  388. package/dist/types/generated/codama/instructions/claimBorrowerPayments.d.ts +75 -0
  389. package/dist/types/generated/codama/instructions/claimBorrowerPayments.d.ts.map +1 -0
  390. package/dist/types/generated/codama/instructions/claimContractPayments.d.ts +98 -0
  391. package/dist/types/generated/codama/instructions/claimContractPayments.d.ts.map +1 -0
  392. package/dist/types/generated/codama/instructions/closeBorrower.d.ts +43 -0
  393. package/dist/types/generated/codama/instructions/closeBorrower.d.ts.map +1 -0
  394. package/dist/types/generated/codama/instructions/closeContract.d.ts +44 -28
  395. package/dist/types/generated/codama/instructions/closeContract.d.ts.map +1 -1
  396. package/dist/types/generated/codama/instructions/closeRental.d.ts +38 -34
  397. package/dist/types/generated/codama/instructions/closeRental.d.ts.map +1 -1
  398. package/dist/types/generated/codama/instructions/createConfig.d.ts +79 -0
  399. package/dist/types/generated/codama/instructions/createConfig.d.ts.map +1 -0
  400. package/dist/types/generated/codama/instructions/createContract.d.ts +38 -30
  401. package/dist/types/generated/codama/instructions/createContract.d.ts.map +1 -1
  402. package/dist/types/generated/codama/instructions/deleteBorrower.d.ts +55 -0
  403. package/dist/types/generated/codama/instructions/deleteBorrower.d.ts.map +1 -0
  404. package/dist/types/generated/codama/instructions/deleteConfig.d.ts +75 -0
  405. package/dist/types/generated/codama/instructions/deleteConfig.d.ts.map +1 -0
  406. package/dist/types/generated/codama/instructions/deleteContract.d.ts +55 -0
  407. package/dist/types/generated/codama/instructions/deleteContract.d.ts.map +1 -0
  408. package/dist/types/generated/codama/instructions/deleteRental.d.ts +55 -0
  409. package/dist/types/generated/codama/instructions/deleteRental.d.ts.map +1 -0
  410. package/dist/types/generated/codama/instructions/discountBorrower.d.ts +56 -0
  411. package/dist/types/generated/codama/instructions/discountBorrower.d.ts.map +1 -0
  412. package/dist/types/generated/codama/instructions/index.d.ts +15 -4
  413. package/dist/types/generated/codama/instructions/index.d.ts.map +1 -1
  414. package/dist/types/generated/codama/instructions/payRental.d.ts +61 -46
  415. package/dist/types/generated/codama/instructions/payRental.d.ts.map +1 -1
  416. package/dist/types/generated/codama/instructions/releaseRental.d.ts +105 -0
  417. package/dist/types/generated/codama/instructions/releaseRental.d.ts.map +1 -0
  418. package/dist/types/generated/codama/instructions/reserveRental.d.ts +129 -0
  419. package/dist/types/generated/codama/instructions/reserveRental.d.ts.map +1 -0
  420. package/dist/types/generated/codama/instructions/updateBorrower.d.ts +62 -0
  421. package/dist/types/generated/codama/instructions/updateBorrower.d.ts.map +1 -0
  422. package/dist/types/generated/codama/instructions/updateConfig.d.ts +88 -28
  423. package/dist/types/generated/codama/instructions/updateConfig.d.ts.map +1 -1
  424. package/dist/types/generated/codama/instructions/updateContract.d.ts +88 -0
  425. package/dist/types/generated/codama/instructions/updateContract.d.ts.map +1 -0
  426. package/dist/types/generated/codama/programs/index.d.ts +2 -2
  427. package/dist/types/generated/codama/programs/srsly.d.ts +57 -21
  428. package/dist/types/generated/codama/programs/srsly.d.ts.map +1 -1
  429. package/dist/types/generated/codama/shared/index.d.ts +2 -13
  430. package/dist/types/generated/codama/shared/index.d.ts.map +1 -1
  431. package/dist/types/generated/codama/types/capturedFlagData.d.ts +35 -0
  432. package/dist/types/generated/codama/types/capturedFlagData.d.ts.map +1 -0
  433. package/dist/types/generated/codama/types/index.d.ts +7 -9
  434. package/dist/types/generated/codama/types/index.d.ts.map +1 -1
  435. package/dist/types/generated/codama/types/memberConfig.d.ts +33 -0
  436. package/dist/types/generated/codama/types/memberConfig.d.ts.map +1 -0
  437. package/dist/types/generated/codama/types/memberType.d.ts +48 -0
  438. package/dist/types/generated/codama/types/memberType.d.ts.map +1 -0
  439. package/dist/types/generated/codama/types/paymentFrequency.d.ts +2 -2
  440. package/dist/types/generated/codama/types/schedule.d.ts +46 -0
  441. package/dist/types/generated/codama/types/schedule.d.ts.map +1 -0
  442. package/dist/types/generated/codama/types/signal.d.ts +56 -0
  443. package/dist/types/generated/codama/types/signal.d.ts.map +1 -0
  444. package/dist/types/generated/codama/types/trigger.d.ts +45 -34
  445. package/dist/types/generated/codama/types/trigger.d.ts.map +1 -1
  446. package/dist/types/index.d.ts +37 -207
  447. package/dist/types/index.d.ts.map +1 -1
  448. package/dist/types/instructions/acceptRental.d.ts +99 -0
  449. package/dist/types/instructions/acceptRental.d.ts.map +1 -0
  450. package/dist/types/instructions/cancelRental.d.ts +90 -0
  451. package/dist/types/instructions/cancelRental.d.ts.map +1 -0
  452. package/dist/types/instructions/captureRental.d.ts +58 -0
  453. package/dist/types/instructions/captureRental.d.ts.map +1 -0
  454. package/dist/types/instructions/claimBorrower.d.ts +53 -0
  455. package/dist/types/instructions/claimBorrower.d.ts.map +1 -0
  456. package/dist/types/instructions/claimBorrowerPayments.d.ts +59 -0
  457. package/dist/types/instructions/claimBorrowerPayments.d.ts.map +1 -0
  458. package/dist/types/instructions/claimContractPayments.d.ts +78 -0
  459. package/dist/types/instructions/claimContractPayments.d.ts.map +1 -0
  460. package/dist/types/instructions/closeBorrower.d.ts +45 -0
  461. package/dist/types/instructions/closeBorrower.d.ts.map +1 -0
  462. package/dist/types/instructions/closeContract.d.ts +91 -0
  463. package/dist/types/instructions/closeContract.d.ts.map +1 -0
  464. package/dist/types/instructions/closeRental.d.ts +62 -0
  465. package/dist/types/instructions/closeRental.d.ts.map +1 -0
  466. package/dist/types/instructions/createConfig.d.ts +62 -0
  467. package/dist/types/instructions/createConfig.d.ts.map +1 -0
  468. package/dist/types/instructions/createContract.d.ts +127 -0
  469. package/dist/types/instructions/createContract.d.ts.map +1 -0
  470. package/dist/types/instructions/deleteBorrower.d.ts +53 -0
  471. package/dist/types/instructions/deleteBorrower.d.ts.map +1 -0
  472. package/dist/types/instructions/deleteConfig.d.ts +64 -0
  473. package/dist/types/instructions/deleteConfig.d.ts.map +1 -0
  474. package/dist/types/instructions/deleteRental.d.ts +67 -0
  475. package/dist/types/instructions/deleteRental.d.ts.map +1 -0
  476. package/dist/types/instructions/discountBorrower.d.ts +64 -0
  477. package/dist/types/instructions/discountBorrower.d.ts.map +1 -0
  478. package/dist/types/instructions/releaseRental.d.ts +104 -0
  479. package/dist/types/instructions/releaseRental.d.ts.map +1 -0
  480. package/dist/types/instructions/reserveRental.d.ts +80 -0
  481. package/dist/types/instructions/reserveRental.d.ts.map +1 -0
  482. package/dist/types/instructions/updateBorrower.d.ts +81 -0
  483. package/dist/types/instructions/updateBorrower.d.ts.map +1 -0
  484. package/dist/types/instructions/updateConfig.d.ts +142 -0
  485. package/dist/types/instructions/updateConfig.d.ts.map +1 -0
  486. package/dist/types/instructions/updateContract.d.ts +113 -0
  487. package/dist/types/instructions/updateContract.d.ts.map +1 -0
  488. package/dist/types/params/amount.d.ts +70 -0
  489. package/dist/types/params/amount.d.ts.map +1 -0
  490. package/dist/types/params/duration.d.ts +65 -0
  491. package/dist/types/params/duration.d.ts.map +1 -0
  492. package/dist/types/params/schedule.d.ts +74 -0
  493. package/dist/types/params/schedule.d.ts.map +1 -0
  494. package/dist/types/pda/constants.d.ts +51 -0
  495. package/dist/types/pda/constants.d.ts.map +1 -0
  496. package/dist/types/pda/index.d.ts +36 -0
  497. package/dist/types/pda/index.d.ts.map +1 -0
  498. package/dist/types/pda/sage.d.ts +69 -0
  499. package/dist/types/pda/sage.d.ts.map +1 -0
  500. package/dist/types/pda/slyvault.d.ts +29 -0
  501. package/dist/types/pda/slyvault.d.ts.map +1 -0
  502. package/dist/types/pda/srsly.d.ts +40 -0
  503. package/dist/types/pda/srsly.d.ts.map +1 -0
  504. package/dist/types/pda/thread.d.ts +31 -0
  505. package/dist/types/pda/thread.d.ts.map +1 -0
  506. package/dist/types/pda/token.d.ts +29 -0
  507. package/dist/types/pda/token.d.ts.map +1 -0
  508. package/dist/types/utils/addresses.d.ts +75 -0
  509. package/dist/types/utils/addresses.d.ts.map +1 -0
  510. package/dist/types/utils/config.d.ts +103 -83
  511. package/dist/types/utils/config.d.ts.map +1 -1
  512. package/dist/types/utils/index.d.ts +7 -14
  513. package/dist/types/utils/index.d.ts.map +1 -1
  514. package/dist/types/utils/instructions.d.ts +52 -0
  515. package/dist/types/utils/instructions.d.ts.map +1 -0
  516. package/dist/types/utils/signer.d.ts +78 -39
  517. package/dist/types/utils/signer.d.ts.map +1 -1
  518. package/dist/types/utils/web3js.d.ts +85 -0
  519. package/dist/types/utils/web3js.d.ts.map +1 -0
  520. package/dist/types/version.d.ts +2 -0
  521. package/dist/types/version.d.ts.map +1 -0
  522. package/package.json +32 -47
  523. package/dist/cjs/config/index.js +0 -12
  524. package/dist/cjs/config/index.js.map +0 -1
  525. package/dist/cjs/config/initialize.js +0 -95
  526. package/dist/cjs/config/initialize.js.map +0 -1
  527. package/dist/cjs/config/update.js +0 -163
  528. package/dist/cjs/config/update.js.map +0 -1
  529. package/dist/cjs/contract/close.js +0 -159
  530. package/dist/cjs/contract/close.js.map +0 -1
  531. package/dist/cjs/contract/create.js +0 -259
  532. package/dist/cjs/contract/create.js.map +0 -1
  533. package/dist/cjs/contract/index.js +0 -68
  534. package/dist/cjs/contract/index.js.map +0 -1
  535. package/dist/cjs/generated/codama/instructions/initializeConfig.js.map +0 -1
  536. package/dist/cjs/generated/codama/instructions/resetRental.js.map +0 -1
  537. package/dist/cjs/generated/codama/types/clockData.js +0 -58
  538. package/dist/cjs/generated/codama/types/clockData.js.map +0 -1
  539. package/dist/cjs/generated/codama/types/equality.js +0 -30
  540. package/dist/cjs/generated/codama/types/equality.js.map +0 -1
  541. package/dist/cjs/generated/codama/types/execContext.js +0 -68
  542. package/dist/cjs/generated/codama/types/execContext.js.map +0 -1
  543. package/dist/cjs/generated/codama/types/serializableAccount.js +0 -58
  544. package/dist/cjs/generated/codama/types/serializableAccount.js.map +0 -1
  545. package/dist/cjs/generated/codama/types/serializableInstruction.js +0 -59
  546. package/dist/cjs/generated/codama/types/serializableInstruction.js.map +0 -1
  547. package/dist/cjs/generated/codama/types/threadResponse.js +0 -68
  548. package/dist/cjs/generated/codama/types/threadResponse.js.map +0 -1
  549. package/dist/cjs/generated/codama/types/triggerContext.js +0 -49
  550. package/dist/cjs/generated/codama/types/triggerContext.js.map +0 -1
  551. package/dist/cjs/idl/index.js +0 -27
  552. package/dist/cjs/idl/index.js.map +0 -1
  553. package/dist/cjs/idl/srsly-data.js +0 -3140
  554. package/dist/cjs/idl/srsly-data.js.map +0 -1
  555. package/dist/cjs/idl/srsly.json +0 -3104
  556. package/dist/cjs/rental/accept.js +0 -263
  557. package/dist/cjs/rental/accept.js.map +0 -1
  558. package/dist/cjs/rental/cancel.js +0 -184
  559. package/dist/cjs/rental/cancel.js.map +0 -1
  560. package/dist/cjs/rental/close.js +0 -184
  561. package/dist/cjs/rental/close.js.map +0 -1
  562. package/dist/cjs/rental/index.js +0 -105
  563. package/dist/cjs/rental/index.js.map +0 -1
  564. package/dist/cjs/rental/reset.js +0 -192
  565. package/dist/cjs/rental/reset.js.map +0 -1
  566. package/dist/cjs/types/payment-frequency.js +0 -87
  567. package/dist/cjs/types/payment-frequency.js.map +0 -1
  568. package/dist/cjs/types/srsly.js +0 -3
  569. package/dist/cjs/types/srsly.js.map +0 -1
  570. package/dist/cjs/utils/constants.js +0 -78
  571. package/dist/cjs/utils/constants.js.map +0 -1
  572. package/dist/cjs/utils/cron.js +0 -204
  573. package/dist/cjs/utils/cron.js.map +0 -1
  574. package/dist/cjs/utils/derive-pda.js +0 -415
  575. package/dist/cjs/utils/derive-pda.js.map +0 -1
  576. package/dist/cjs/utils/fetch-accounts.js +0 -241
  577. package/dist/cjs/utils/fetch-accounts.js.map +0 -1
  578. package/dist/cjs/utils/instruction-converter.js +0 -125
  579. package/dist/cjs/utils/instruction-converter.js.map +0 -1
  580. package/dist/cjs/utils/param-converters.js +0 -190
  581. package/dist/cjs/utils/param-converters.js.map +0 -1
  582. package/dist/cjs/utils/payment-frequency.js +0 -111
  583. package/dist/cjs/utils/payment-frequency.js.map +0 -1
  584. package/dist/cjs/utils/schedule-builder.js +0 -158
  585. package/dist/cjs/utils/schedule-builder.js.map +0 -1
  586. package/dist/cjs/utils/schedule-validation.js +0 -136
  587. package/dist/cjs/utils/schedule-validation.js.map +0 -1
  588. package/dist/cjs/utils/smart-params.js +0 -52
  589. package/dist/cjs/utils/smart-params.js.map +0 -1
  590. package/dist/esm/config/index.js +0 -7
  591. package/dist/esm/config/index.js.map +0 -1
  592. package/dist/esm/config/initialize.js +0 -92
  593. package/dist/esm/config/initialize.js.map +0 -1
  594. package/dist/esm/config/update.js +0 -159
  595. package/dist/esm/config/update.js.map +0 -1
  596. package/dist/esm/contract/close.js +0 -154
  597. package/dist/esm/contract/close.js.map +0 -1
  598. package/dist/esm/contract/create.js +0 -255
  599. package/dist/esm/contract/create.js.map +0 -1
  600. package/dist/esm/contract/index.js +0 -52
  601. package/dist/esm/contract/index.js.map +0 -1
  602. package/dist/esm/generated/codama/instructions/initializeConfig.js.map +0 -1
  603. package/dist/esm/generated/codama/instructions/resetRental.js.map +0 -1
  604. package/dist/esm/generated/codama/types/clockData.js +0 -53
  605. package/dist/esm/generated/codama/types/clockData.js.map +0 -1
  606. package/dist/esm/generated/codama/types/equality.js +0 -24
  607. package/dist/esm/generated/codama/types/equality.js.map +0 -1
  608. package/dist/esm/generated/codama/types/execContext.js +0 -63
  609. package/dist/esm/generated/codama/types/execContext.js.map +0 -1
  610. package/dist/esm/generated/codama/types/serializableAccount.js +0 -53
  611. package/dist/esm/generated/codama/types/serializableAccount.js.map +0 -1
  612. package/dist/esm/generated/codama/types/serializableInstruction.js +0 -54
  613. package/dist/esm/generated/codama/types/serializableInstruction.js.map +0 -1
  614. package/dist/esm/generated/codama/types/threadResponse.js +0 -63
  615. package/dist/esm/generated/codama/types/threadResponse.js.map +0 -1
  616. package/dist/esm/generated/codama/types/triggerContext.js +0 -42
  617. package/dist/esm/generated/codama/types/triggerContext.js.map +0 -1
  618. package/dist/esm/idl/index.js +0 -21
  619. package/dist/esm/idl/index.js.map +0 -1
  620. package/dist/esm/idl/srsly-data.js +0 -3137
  621. package/dist/esm/idl/srsly-data.js.map +0 -1
  622. package/dist/esm/idl/srsly.json +0 -3104
  623. package/dist/esm/rental/accept.js +0 -258
  624. package/dist/esm/rental/accept.js.map +0 -1
  625. package/dist/esm/rental/cancel.js +0 -179
  626. package/dist/esm/rental/cancel.js.map +0 -1
  627. package/dist/esm/rental/close.js +0 -179
  628. package/dist/esm/rental/close.js.map +0 -1
  629. package/dist/esm/rental/index.js +0 -89
  630. package/dist/esm/rental/index.js.map +0 -1
  631. package/dist/esm/rental/reset.js +0 -187
  632. package/dist/esm/rental/reset.js.map +0 -1
  633. package/dist/esm/types/payment-frequency.js +0 -83
  634. package/dist/esm/types/payment-frequency.js.map +0 -1
  635. package/dist/esm/types/srsly.js +0 -2
  636. package/dist/esm/types/srsly.js.map +0 -1
  637. package/dist/esm/utils/constants.js +0 -70
  638. package/dist/esm/utils/constants.js.map +0 -1
  639. package/dist/esm/utils/cron.js +0 -195
  640. package/dist/esm/utils/cron.js.map +0 -1
  641. package/dist/esm/utils/derive-pda.js +0 -402
  642. package/dist/esm/utils/derive-pda.js.map +0 -1
  643. package/dist/esm/utils/fetch-accounts.js +0 -233
  644. package/dist/esm/utils/fetch-accounts.js.map +0 -1
  645. package/dist/esm/utils/instruction-converter.js +0 -120
  646. package/dist/esm/utils/instruction-converter.js.map +0 -1
  647. package/dist/esm/utils/param-converters.js +0 -182
  648. package/dist/esm/utils/param-converters.js.map +0 -1
  649. package/dist/esm/utils/payment-frequency.js +0 -104
  650. package/dist/esm/utils/payment-frequency.js.map +0 -1
  651. package/dist/esm/utils/schedule-builder.js +0 -153
  652. package/dist/esm/utils/schedule-builder.js.map +0 -1
  653. package/dist/esm/utils/schedule-validation.js +0 -132
  654. package/dist/esm/utils/schedule-validation.js.map +0 -1
  655. package/dist/esm/utils/smart-params.js +0 -49
  656. package/dist/esm/utils/smart-params.js.map +0 -1
  657. package/dist/types/config/index.d.ts +0 -7
  658. package/dist/types/config/index.d.ts.map +0 -1
  659. package/dist/types/config/initialize.d.ts +0 -66
  660. package/dist/types/config/initialize.d.ts.map +0 -1
  661. package/dist/types/config/update.d.ts +0 -143
  662. package/dist/types/config/update.d.ts.map +0 -1
  663. package/dist/types/contract/close.d.ts +0 -124
  664. package/dist/types/contract/close.d.ts.map +0 -1
  665. package/dist/types/contract/create.d.ts +0 -150
  666. package/dist/types/contract/create.d.ts.map +0 -1
  667. package/dist/types/contract/index.d.ts +0 -52
  668. package/dist/types/contract/index.d.ts.map +0 -1
  669. package/dist/types/generated/codama/instructions/initializeConfig.d.ts +0 -60
  670. package/dist/types/generated/codama/instructions/initializeConfig.d.ts.map +0 -1
  671. package/dist/types/generated/codama/instructions/resetRental.d.ts +0 -79
  672. package/dist/types/generated/codama/instructions/resetRental.d.ts.map +0 -1
  673. package/dist/types/generated/codama/types/clockData.d.ts +0 -30
  674. package/dist/types/generated/codama/types/clockData.d.ts.map +0 -1
  675. package/dist/types/generated/codama/types/equality.d.ts +0 -18
  676. package/dist/types/generated/codama/types/equality.d.ts.map +0 -1
  677. package/dist/types/generated/codama/types/execContext.d.ts +0 -49
  678. package/dist/types/generated/codama/types/execContext.d.ts.map +0 -1
  679. package/dist/types/generated/codama/types/serializableAccount.d.ts +0 -23
  680. package/dist/types/generated/codama/types/serializableAccount.d.ts.map +0 -1
  681. package/dist/types/generated/codama/types/serializableInstruction.d.ts +0 -31
  682. package/dist/types/generated/codama/types/serializableInstruction.d.ts.map +0 -1
  683. package/dist/types/generated/codama/types/threadResponse.d.ts +0 -43
  684. package/dist/types/generated/codama/types/threadResponse.d.ts.map +0 -1
  685. package/dist/types/generated/codama/types/triggerContext.d.ts +0 -75
  686. package/dist/types/generated/codama/types/triggerContext.d.ts.map +0 -1
  687. package/dist/types/idl/index.d.ts +0 -21
  688. package/dist/types/idl/index.d.ts.map +0 -1
  689. package/dist/types/idl/srsly-data.d.ts +0 -1458
  690. package/dist/types/idl/srsly-data.d.ts.map +0 -1
  691. package/dist/types/rental/accept.d.ts +0 -196
  692. package/dist/types/rental/accept.d.ts.map +0 -1
  693. package/dist/types/rental/cancel.d.ts +0 -141
  694. package/dist/types/rental/cancel.d.ts.map +0 -1
  695. package/dist/types/rental/close.d.ts +0 -130
  696. package/dist/types/rental/close.d.ts.map +0 -1
  697. package/dist/types/rental/index.d.ts +0 -89
  698. package/dist/types/rental/index.d.ts.map +0 -1
  699. package/dist/types/rental/reset.d.ts +0 -166
  700. package/dist/types/rental/reset.d.ts.map +0 -1
  701. package/dist/types/types/payment-frequency.d.ts +0 -55
  702. package/dist/types/types/payment-frequency.d.ts.map +0 -1
  703. package/dist/types/types/srsly.d.ts +0 -3111
  704. package/dist/types/types/srsly.d.ts.map +0 -1
  705. package/dist/types/utils/constants.d.ts +0 -26
  706. package/dist/types/utils/constants.d.ts.map +0 -1
  707. package/dist/types/utils/cron.d.ts +0 -77
  708. package/dist/types/utils/cron.d.ts.map +0 -1
  709. package/dist/types/utils/derive-pda.d.ts +0 -213
  710. package/dist/types/utils/derive-pda.d.ts.map +0 -1
  711. package/dist/types/utils/fetch-accounts.d.ts +0 -158
  712. package/dist/types/utils/fetch-accounts.d.ts.map +0 -1
  713. package/dist/types/utils/instruction-converter.d.ts +0 -171
  714. package/dist/types/utils/instruction-converter.d.ts.map +0 -1
  715. package/dist/types/utils/param-converters.d.ts +0 -67
  716. package/dist/types/utils/param-converters.d.ts.map +0 -1
  717. package/dist/types/utils/payment-frequency.d.ts +0 -38
  718. package/dist/types/utils/payment-frequency.d.ts.map +0 -1
  719. package/dist/types/utils/schedule-builder.d.ts +0 -64
  720. package/dist/types/utils/schedule-builder.d.ts.map +0 -1
  721. package/dist/types/utils/schedule-validation.d.ts +0 -36
  722. package/dist/types/utils/schedule-validation.d.ts.map +0 -1
  723. package/dist/types/utils/smart-params.d.ts +0 -112
  724. package/dist/types/utils/smart-params.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"srsly-data.d.ts","sourceRoot":"","sources":["../../../src/idl/srsly-data.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwjGN,CAAC;AACX,eAAe,GAAG,CAAC"}
@@ -1,196 +0,0 @@
1
- /**
2
- * @purpose Rental contract acceptance with payment calculation and SAGE integration
3
- * @reviewed 2025-07-29
4
- */
5
- import { type SdkConfigSelector } from '../utils/config';
6
- import { type FluentInstruction, type SmartFluentConfigSelector } from '../utils/instruction-converter';
7
- import { type UniversalSigner } from '../utils/signer';
8
- import type { DurationParam } from '../utils/smart-params';
9
- type UniversalAddress = string;
10
- /**
11
- * Parameters for accepting a rental contract.
12
- *
13
- * This interface defines the required parameters for a borrower to accept an existing
14
- * rental contract. The SDK automatically fetches contract details and calculates the
15
- * required payment amount based on the contract's rate and payment frequency.
16
- *
17
- * @interface AcceptRentalParams
18
- */
19
- export interface AcceptRentalParams {
20
- /**
21
- * The borrower who will rent the fleet (signer object or base58 string address).
22
- * This account will control the fleet during the rental period and make payments.
23
- * Can be a wallet/signer object (CLI usage) or base58 address string (browser usage).
24
- */
25
- borrower: UniversalSigner;
26
- /**
27
- * String address of the borrower's profile in the Star Atlas game.
28
- * Used for SAGE integration to transfer fleet control to the borrower.
29
- */
30
- borrowerProfile: UniversalAddress;
31
- /**
32
- * Faction identifier for the borrower in Star Atlas.
33
- * Can be provided as a number (1 = MUD, 2 = ONI, 3 = Ustur) or string ('mud', 'oni', 'ustur').
34
- * If not provided, the faction will be automatically resolved from the fleet account.
35
- * Used for deriving faction-specific game accounts required by SAGE.
36
- * @example 'mud' // or 1
37
- */
38
- borrowerFaction?: number | string;
39
- /**
40
- * String address of the rental contract to accept.
41
- * The SDK will automatically fetch the contract state to retrieve:
42
- * - Fleet address and ownership details
43
- * - Rental rate per payment period
44
- * - Payment frequency (hourly, daily, weekly, monthly)
45
- * - Duration constraints (minimum and maximum)
46
- * - Owner information for payment routing
47
- */
48
- contract: UniversalAddress;
49
- /**
50
- * Rental duration.
51
- * Can be specified as seconds (number) or time units (object).
52
- * Must be within the contract's minimum and maximum duration limits.
53
- * @example { days: 7 } // 7 days
54
- * @example { weeks: 2 } // 2 weeks
55
- * @example 604800 // 7 days in seconds (backwards compatible)
56
- */
57
- duration: DurationParam;
58
- }
59
- /**
60
- * Creates an instruction to accept a rental contract with fluent configuration.
61
- *
62
- * This function allows a borrower to accept an existing rental contract, automatically
63
- * calculating the required payment amount based on the contract's rate and payment frequency.
64
- * The SDK fetches contract details, validates duration constraints, and derives all
65
- * necessary accounts for the rental operation.
66
- *
67
- * ## Features
68
- *
69
- * - **Automatic Payment Calculation**: Fetches contract state and calculates exact payment amount
70
- * - **Automatic Faction Resolution**: Optionally fetches faction from fleet account if not provided
71
- * - **Duration Validation**: Ensures rental duration meets contract constraints
72
- * - **Account Derivation**: Automatically derives all required game accounts
73
- * - **SAGE Integration**: Sets up fleet ownership transfer in the Star Atlas ecosystem
74
- * - **Clockwork Integration**: Configures automated payment scheduling
75
- * - **Universal Library Support**: Works with both @solana/kit and @solana/web3.js
76
- *
77
- * ## Process
78
- *
79
- * 1. **Fetch Contract**: Retrieves contract state from the blockchain
80
- * 2. **Validate Duration**: Checks that rental duration meets contract constraints
81
- * 3. **Calculate Payment**: Computes payment amount using contract rate and payment frequency
82
- * 4. **Derive Accounts**: Generates required game accounts (starbase, faction, etc.)
83
- * 5. **Create Instruction**: Builds the rental acceptance instruction
84
- * 6. **Setup Threading**: Configures automated payment processing
85
- *
86
- * ## Payment Calculation
87
- *
88
- * The payment amount is calculated using the formula:
89
- * ```text
90
- * payment = rate × payment_periods × stardust_to_atlas_conversion
91
- * ```
92
- *
93
- * Where:
94
- * - `rate`: Contract's rental rate per payment period
95
- * - `payment_periods`: Duration divided by payment frequency interval
96
- * - `stardust_to_atlas_conversion`: Network-specific conversion factor
97
- *
98
- * ## Requirements
99
- *
100
- * - Contract must exist and be active
101
- * - Duration must be within contract's min/max limits
102
- * - Duration must be multiple of payment frequency
103
- * - Borrower must have sufficient ATLAS tokens for payment
104
- *
105
- * @example
106
- * ```typescript
107
- * import { acceptRental } from '@srsly/sdk';
108
- *
109
- * // Using smart duration parameters (recommended)
110
- * const instruction = await acceptRental({
111
- * borrower: wallet, // Wallet object for signing
112
- * borrowerProfile: "ProfileAddr...", // Borrower's Star Atlas profile
113
- * contract: "ContractAddr...", // Contract to accept
114
- * duration: { days: 7 } // 7 days rental duration
115
- * // borrowerFaction auto-resolved from fleet account
116
- * });
117
- *
118
- * // Different duration formats
119
- * const hourlyRental = await acceptRental({
120
- * borrower: wallet,
121
- * borrowerProfile: "ProfileAddr...",
122
- * contract: "ContractAddr...",
123
- * duration: { hours: 12 } // 12 hours
124
- * });
125
- *
126
- * const weeklyRental = await acceptRental({
127
- * borrower: wallet,
128
- * borrowerProfile: "ProfileAddr...",
129
- * contract: "ContractAddr...",
130
- * duration: { weeks: 2 } // 2 weeks
131
- * });
132
- *
133
- * const monthlyRental = await acceptRental({
134
- * borrower: wallet,
135
- * borrowerProfile: "ProfileAddr...",
136
- * contract: "ContractAddr...",
137
- * duration: { months: 1 } // 1 month
138
- * });
139
- *
140
- * // Backwards compatible - raw seconds
141
- * const legacyRental = await acceptRental({
142
- * borrower: wallet,
143
- * borrowerProfile: "ProfileAddr...",
144
- * contract: "ContractAddr...",
145
- * duration: 604800 // 7 days in seconds
146
- * });
147
- *
148
- * // Manual faction specification (optional)
149
- * const manualInstruction = await acceptRental({
150
- * borrower: wallet.publicKey.toString(), // Address string for browser
151
- * borrowerProfile: "ProfileAddr...", // Borrower's Star Atlas profile
152
- * borrowerFaction: 'mud', // Optional: 'mud', 'oni', or 'ustur'
153
- * contract: "ContractAddr...", // Contract to accept
154
- * duration: { days: 7 } // 7 days rental duration
155
- * });
156
- *
157
- * // Configure for mainnet
158
- * const mainnetInstruction = await acceptRental({
159
- * borrower: wallet, // Wallet object (CLI style)
160
- * borrowerProfile: "ProfileAddr...",
161
- * borrowerFaction: 1, // Can use numbers: 1=mud, 2=oni, 3=ustur
162
- * contract: "ContractAddr...",
163
- * duration: { days: 7 }
164
- * }).set({ programs: 'mainnet' });
165
- *
166
- * // Use with your preferred Solana library
167
- * const transaction = new Transaction().add(mainnetInstruction);
168
- * await sendAndConfirmTransaction(connection, transaction, [wallet]);
169
- * ```
170
- *
171
- * @param params - The rental acceptance parameters including borrower, contract, and duration
172
- * @returns A SmartFluentConfigSelector that can be configured with .set() or awaited directly
173
- * @throws Error when contract is not found, duration constraints are violated, or payment calculation fails
174
- */
175
- export declare function acceptRental(params: AcceptRentalParams): SmartFluentConfigSelector<FluentInstruction>;
176
- /**
177
- * Low-level function to create a rental acceptance instruction with raw input parameters.
178
- *
179
- * This function provides direct access to the underlying codama-generated instruction
180
- * builder. It's primarily used internally by the SDK but can be used for advanced
181
- * use cases where full control over instruction parameters is needed.
182
- *
183
- * @internal
184
- * @param input - Raw instruction input parameters as expected by codama
185
- * @param options - Optional instruction options including program address
186
- * @returns A SdkConfigSelector for the raw instruction
187
- */
188
- export declare function getAcceptRentalInstructionAsync(input: any, options?: any): SdkConfigSelector<any>;
189
- export declare const acceptRentalDemo: {
190
- tabName: string;
191
- description: string;
192
- imports: string;
193
- instruction: string;
194
- };
195
- export {};
196
- //# sourceMappingURL=accept.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accept.d.ts","sourceRoot":"","sources":["../../../src/rental/accept.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAG/B;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B;;;OAGG;IACH,eAAe,EAAE,gBAAgB,CAAC;IAElC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC;;;;;;;;OAQG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;;;;;;OAOG;IACH,QAAQ,EAAE,aAAa,CAAC;CACzB;AAmID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmHG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,kBAAkB,GACzB,yBAAyB,CAAC,iBAAiB,CAAC,CAG9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAKjG;AAGD,eAAO,MAAM,gBAAgB;;;;;CAU5B,CAAC"}
@@ -1,141 +0,0 @@
1
- /**
2
- * @purpose Rental cancellation with penalty processing and thread cleanup
3
- * @reviewed 2025-07-29
4
- */
5
- import { type SdkConfigSelector } from '../utils/config';
6
- import { type UniversalSigner } from '../utils/signer';
7
- import { type FluentInstruction, type SmartFluentConfigSelector } from '../utils/instruction-converter';
8
- type UniversalAddress = string;
9
- /**
10
- * Parameters for canceling an active rental.
11
- *
12
- * This interface defines the required parameters for a borrower to cancel their
13
- * active rental. Canceling a rental stops automated payments but typically
14
- * incurs a penalty fee as defined in the contract terms.
15
- *
16
- * You can provide either the contract address OR the rental state address.
17
- * If both are provided, rental takes priority.
18
- *
19
- * @interface CancelRentalParams
20
- */
21
- export interface CancelRentalParams {
22
- /**
23
- * The borrower who wants to cancel the rental (signer object or base58 string address).
24
- * Must be the original borrower who accepted the rental contract.
25
- * This account will pay any cancellation penalties.
26
- * Can be a wallet/signer object (CLI usage) or base58 address string (browser usage).
27
- */
28
- borrower: UniversalSigner;
29
- /**
30
- * String address of the rental contract associated with the active rental.
31
- * The rental state for this contract will be canceled and automated payments stopped.
32
- *
33
- * Either this OR rental must be provided. If both are provided, rental takes priority.
34
- */
35
- contract?: UniversalAddress;
36
- /**
37
- * String address of the rental state account to cancel.
38
- * This is an alternative to providing the contract address - the SDK will
39
- * fetch the rental state to determine the associated contract.
40
- *
41
- * Either this OR contract must be provided. If both are provided, this takes priority.
42
- */
43
- rental?: UniversalAddress;
44
- }
45
- /**
46
- * Creates an instruction to cancel a rental with fluent configuration.
47
- *
48
- * This function allows a borrower to cancel their active rental before the
49
- * rental period expires. Canceling a rental stops automated payments but
50
- * may incur penalty fees as defined in the contract terms. The fleet ownership
51
- * is immediately returned to the original owner.
52
- *
53
- * ## Features
54
- *
55
- * - **Immediate Cancellation**: Stops the rental and automated payments immediately
56
- * - **Fleet Transfer**: Returns fleet control to the original owner
57
- * - **Thread Cleanup**: Cancels the automated payment thread
58
- * - **Penalty Processing**: Handles any cancellation fees as defined in the contract
59
- * - **Universal Library Support**: Works with both @solana/kit and @solana/web3.js
60
- *
61
- * ## Process
62
- *
63
- * 1. **Validate Authority**: Ensures only the borrower can cancel their rental
64
- * 2. **Calculate Penalties**: Computes any cancellation fees owed
65
- * 3. **Transfer Fleet**: Returns fleet ownership to the original owner
66
- * 4. **Cancel Thread**: Stops automated payment processing
67
- * 5. **Update State**: Marks rental as canceled in the rental state account
68
- *
69
- * ## Requirements
70
- *
71
- * - Rental must be active (not already canceled or completed)
72
- * - Caller must be the original borrower
73
- * - Borrower must have sufficient funds for any cancellation penalties
74
- *
75
- * ## Cancellation Effects
76
- *
77
- * - **Fleet Control**: Immediately returned to owner
78
- * - **Automated Payments**: Stopped permanently
79
- * - **Rental State**: Marked as canceled
80
- * - **Thread Account**: Cleaned up and closed
81
- * - **Penalties**: Charged according to contract terms
82
- *
83
- * @example
84
- * ```typescript
85
- * import { cancelRental } from '@srsly/sdk';
86
- *
87
- * // Cancel rental using contract address
88
- * const instruction = await cancelRental({
89
- * borrower: wallet,
90
- * contract: "ContractAddr..."
91
- * });
92
- *
93
- * // Cancel rental using rental state address (alternative approach)
94
- * const instruction2 = await cancelRental({
95
- * borrower: wallet,
96
- * rental: "RentalStateAddr..."
97
- * });
98
- *
99
- * // Configure for mainnet
100
- * const mainnetInstruction = await cancelRental({
101
- * borrower: wallet,
102
- * contract: "ContractAddr..."
103
- * }).set({ programs: 'mainnet' });
104
- *
105
- * // Convert to @solana/web3.js format
106
- * const web3jsInstruction = await cancelRental({
107
- * borrower: wallet,
108
- * rental: "RentalStateAddr..."
109
- * }).web3js();
110
- *
111
- * // Use with your preferred Solana library
112
- * const transaction = new Transaction().add(web3jsInstruction);
113
- * await sendAndConfirmTransaction(connection, transaction, [wallet]);
114
- * ```
115
- *
116
- * @param params - The rental cancellation parameters including borrower and either contract or rentalState
117
- * @returns A SmartFluentConfigSelector that can be configured with .set() or awaited directly
118
- * @throws Error when rental is not active, caller is not the borrower, or instruction generation fails
119
- */
120
- export declare function cancelRental(params: CancelRentalParams): SmartFluentConfigSelector<FluentInstruction>;
121
- /**
122
- * Low-level function to create a rental cancellation instruction with raw input parameters.
123
- *
124
- * This function provides direct access to the underlying codama-generated instruction
125
- * builder. It's primarily used internally by the SDK but can be used for advanced
126
- * use cases where full control over instruction parameters is needed.
127
- *
128
- * @internal
129
- * @param input - Raw instruction input parameters as expected by codama
130
- * @param options - Optional instruction options including program address
131
- * @returns A SdkConfigSelector for the raw instruction
132
- */
133
- export declare function getCancelRentalInstructionAsync(input: any, options?: any): SdkConfigSelector<any>;
134
- export declare const cancelRentalDemo: {
135
- tabName: string;
136
- description: string;
137
- imports: string;
138
- instruction: string;
139
- };
140
- export {};
141
- //# sourceMappingURL=cancel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../../src/rental/cancel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,gCAAgC,CAAC;AAMxC,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAE/B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAE5B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AA0FD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,kBAAkB,GACzB,yBAAyB,CAAC,iBAAiB,CAAC,CAG9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAKjG;AAGD,eAAO,MAAM,gBAAgB;;;;;CAQ5B,CAAC"}
@@ -1,130 +0,0 @@
1
- /**
2
- * @purpose Rental closure with fund transfer and thread cleanup
3
- * @reviewed 2025-07-29
4
- */
5
- import { type SdkConfigSelector } from '../utils/config';
6
- import { type FluentInstruction, type SmartFluentConfigSelector } from '../utils/instruction-converter';
7
- import { type UniversalSigner } from '../utils/signer';
8
- type UniversalAddress = string;
9
- /**
10
- * Parameters for closing a completed rental.
11
- *
12
- * This interface defines the required parameters for closing a rental that has
13
- * reached its expiration or been fully paid. Closing a rental finalizes the
14
- * rental period, transfers any remaining funds, and cleans up the rental state.
15
- *
16
- * @interface CloseRentalParams
17
- */
18
- export interface CloseRentalParams {
19
- /**
20
- * The payer for transaction fees (must be a signer object).
21
- * This account will pay for the transaction fee
22
- */
23
- payer: UniversalSigner;
24
- /**
25
- * String address of the rental state to close.
26
- * This is the unique rental state account that tracks the rental.
27
- */
28
- rental: UniversalAddress;
29
- /**
30
- * The borrower's Star Atlas profile address. Required for version 0 rentals.
31
- * For version 1+ rentals, this is stored in the rental state.
32
- */
33
- borrowerProfile: UniversalAddress;
34
- /**
35
- * Optional borrower faction (1/2/3 or 'mud'/'oni'/'ustur'). If not provided, will be fetched from fleet.
36
- * Only needed for version 0 rentals.
37
- */
38
- borrowerFaction?: number | string;
39
- }
40
- /**
41
- * Creates an instruction to close a completed rental with fluent configuration.
42
- *
43
- * This function finalizes a rental that has reached its expiration or been fully paid.
44
- * It transfers any remaining funds to the owner, returns fleet control, and cleans up
45
- * the rental state account. This instruction can be called by anyone once the rental
46
- * period has ended.
47
- *
48
- * ## Features
49
- *
50
- * - **Rental Finalization**: Properly closes completed or expired rentals
51
- * - **Fund Transfer**: Moves any remaining payments or deposits to the owner
52
- * - **Fleet Return**: Ensures fleet ownership is returned to the original owner
53
- * - **State Cleanup**: Closes rental state account and returns lamports
54
- * - **Thread Cleanup**: Cleans up automated payment threads
55
- * - **Universal Library Support**: Works with both @solana/kit and @solana/web3.js
56
- *
57
- * ## Process
58
- *
59
- * 1. **Validate Completion**: Ensures rental period has ended or been fully paid
60
- * 2. **Transfer Funds**: Moves any remaining ATLAS tokens to owner's account
61
- * 3. **Return Fleet**: Transfers fleet ownership back to original owner
62
- * 4. **Clean State**: Closes rental state account and returns SOL to payer
63
- * 5. **Cancel Thread**: Cleans up any remaining automated payment threads
64
- *
65
- * ## Requirements
66
- *
67
- * - Rental must be completed or expired
68
- * - Owner token account must be valid ATLAS token account
69
- * - Rental state account must exist and be properly initialized
70
- *
71
- * ## When to Use
72
- *
73
- * - **Natural Expiration**: When rental period has ended
74
- * - **Full Payment**: When all required payments have been made
75
- * - **Account Cleanup**: To close expired rental accounts and recover SOL
76
- * - **Fleet Recovery**: When fleet needs to be returned to owner
77
- *
78
- * @example
79
- * ```typescript
80
- * import { closeRental } from '@srsly/sdk';
81
- *
82
- * // Close a completed rental
83
- * const instruction = await closeRental({
84
- * payer: wallet, // Transaction payer
85
- * rental: "RentalState..." // Rental state address
86
- * });
87
- *
88
- * // Configure for mainnet
89
- * const mainnetInstruction = await closeRental({
90
- * payer: wallet,
91
- * rental: "RentalState..."
92
- * }).set({ programs: 'mainnet' });
93
- *
94
- * // Convert to @solana/web3.js format
95
- * const web3jsInstruction = await closeRental({
96
- * payer: wallet,
97
- * rental: "RentalState..."
98
- * }).web3js(PublicKey);
99
- *
100
- * // Use with your preferred Solana library
101
- * const transaction = new Transaction().add(web3jsInstruction);
102
- * await sendAndConfirmTransaction(connection, transaction, [wallet]);
103
- * ```
104
- *
105
- * @param params - The rental closure parameters including payer and rental state address
106
- * @returns A FluentConfigSelector that can be configured with .set() or awaited directly
107
- * @throws Error when rental is not ready for closure or instruction generation fails
108
- */
109
- export declare function closeRental(params: CloseRentalParams): SmartFluentConfigSelector<FluentInstruction>;
110
- /**
111
- * Low-level function to create a rental closure instruction with raw input parameters.
112
- *
113
- * This function provides direct access to the underlying codama-generated instruction
114
- * builder. It's primarily used internally by the SDK but can be used for advanced
115
- * use cases where full control over instruction parameters is needed.
116
- *
117
- * @internal
118
- * @param input - Raw instruction input parameters as expected by codama
119
- * @param options - Optional instruction options including program address
120
- * @returns A SdkConfigSelector for the raw instruction
121
- */
122
- export declare function getCloseRentalInstructionAsync(input: any, options?: any): SdkConfigSelector<any>;
123
- export declare const closeRentalDemo: {
124
- tabName: string;
125
- description: string;
126
- imports: string;
127
- instruction: string;
128
- };
129
- export {};
130
- //# sourceMappingURL=close.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../src/rental/close.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGhF,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAE/B;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB;;;OAGG;IACH,MAAM,EAAE,gBAAgB,CAAC;IAEzB;;;OAGG;IACH,eAAe,EAAE,gBAAgB,CAAC;IAElC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACnC;AAiGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,GACxB,yBAAyB,CAAC,iBAAiB,CAAC,CAG9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAKhG;AAGD,eAAO,MAAM,eAAe;;;;;CAQ3B,CAAC"}
@@ -1,89 +0,0 @@
1
- /**
2
- * @purpose Rental operations module with accept, cancel, close, and reset functionality
3
- * @reviewed 2025-07-29
4
- */
5
- /**
6
- * # Rental Operations Module
7
- *
8
- * This module provides comprehensive functionality for managing rental operations
9
- * on the SRSLY program. It includes functions for accepting, canceling, closing,
10
- * and resetting rentals, with full support for both @solana/kit and @solana/web3.js libraries.
11
- *
12
- * ## Available Functions
13
- *
14
- * - **acceptRental**: Accept an existing rental contract as a borrower
15
- * - **cancelRental**: Cancel an active rental before completion
16
- * - **closeRental**: Close a completed or expired rental
17
- * - **resetRental**: Reset a canceled rental to make the contract available again
18
- *
19
- * ## Rental Lifecycle
20
- *
21
- * ```text
22
- * Contract Created → Accept → [Active Rental] → Close (Complete)
23
- * ↓ ↓
24
- * [Payment] Cancel → Reset → [Available Again]
25
- * ↑ ↓
26
- * [Automated] [Cleanup]
27
- * ```
28
- *
29
- * ## Features
30
- *
31
- * - **Universal Library Support**: Works with both major Solana libraries
32
- * - **String-Based Addresses**: Eliminates library-specific type conflicts
33
- * - **Fluent API**: Chainable configuration and format conversion
34
- * - **Network Agnostic**: Supports different Solana networks
35
- * - **Automated Payments**: Integration with Clockwork for scheduled payments
36
- * - **SAGE Integration**: Fleet ownership management in Star Atlas ecosystem
37
- *
38
- * ## Common Patterns
39
- *
40
- * ### Accept a Rental
41
- * ```typescript
42
- * import { acceptRental } from '@srsly/sdk';
43
- *
44
- * const instruction = await acceptRental({
45
- * borrower: wallet,
46
- * borrowerProfile: "ProfileAddr...",
47
- * contract: "ContractAddr...",
48
- * duration: { days: 7 } // Smart parameter format
49
- * });
50
- * ```
51
- *
52
- * ### Cancel Active Rental
53
- * ```typescript
54
- * import { cancelRental } from '@srsly/sdk';
55
- *
56
- * const instruction = await cancelRental({
57
- * borrower: wallet,
58
- * contract: "ContractAddr..."
59
- * });
60
- * ```
61
- *
62
- * ### Close Completed Rental
63
- * ```typescript
64
- * import { closeRental } from '@srsly/sdk';
65
- *
66
- * const instruction = await closeRental({
67
- * payer: wallet,
68
- * rental: "RentalStateAddr..."
69
- * });
70
- * ```
71
- *
72
- * ### Reset Canceled Rental
73
- * ```typescript
74
- * import { resetRental } from '@srsly/sdk';
75
- *
76
- * const instruction = await resetRental({
77
- * payer: wallet,
78
- * contract: "ContractAddr..."
79
- * // fleet, rental, faction, ownerProfile auto-fetched if not provided
80
- * });
81
- * ```
82
- *
83
- * @module Rental
84
- */
85
- export * from './accept';
86
- export * from './cancel';
87
- export * from './close';
88
- export * from './reset';
89
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rental/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}