@wuwei-labs/srsly 2.0.0-beta.3 → 2.0.0-beta.32

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 (414) hide show
  1. package/README.md +322 -197
  2. package/dist/cjs/codama/accounts/config.js +88 -0
  3. package/dist/cjs/codama/accounts/config.js.map +1 -0
  4. package/dist/cjs/codama/{devnet/accounts → accounts}/contractState.js +2 -7
  5. package/dist/cjs/codama/accounts/contractState.js.map +1 -0
  6. package/dist/cjs/codama/{devnet/accounts → accounts}/index.js +1 -1
  7. package/dist/cjs/codama/accounts/index.js.map +1 -0
  8. package/dist/cjs/codama/{devnet/accounts → accounts}/rentalState.js +3 -1
  9. package/dist/cjs/codama/accounts/rentalState.js.map +1 -0
  10. package/dist/cjs/codama/accounts/thread.js.map +1 -0
  11. package/dist/cjs/codama/errors/index.js.map +1 -0
  12. package/dist/cjs/codama/{devnet/errors → errors}/srsly.js +33 -3
  13. package/dist/cjs/codama/errors/srsly.js.map +1 -0
  14. package/dist/cjs/codama/index.js.map +1 -0
  15. package/dist/cjs/codama/{devnet/instructions → instructions}/acceptRental.js +30 -39
  16. package/dist/cjs/codama/instructions/acceptRental.js.map +1 -0
  17. package/dist/cjs/codama/instructions/cancelContract.js +131 -0
  18. package/dist/cjs/codama/instructions/cancelContract.js.map +1 -0
  19. package/dist/cjs/codama/{devnet/instructions → instructions}/cancelRental.js +10 -33
  20. package/dist/cjs/codama/instructions/cancelRental.js.map +1 -0
  21. package/dist/cjs/codama/{devnet/instructions → instructions}/closeContract.js +22 -36
  22. package/dist/cjs/codama/instructions/closeContract.js.map +1 -0
  23. package/dist/cjs/codama/{devnet/instructions → instructions}/closeRental.js +19 -19
  24. package/dist/cjs/codama/instructions/closeRental.js.map +1 -0
  25. package/dist/cjs/codama/{devnet/instructions → instructions}/createContract.js +13 -16
  26. package/dist/cjs/codama/instructions/createContract.js.map +1 -0
  27. package/dist/cjs/codama/{devnet/instructions → instructions}/index.js +3 -1
  28. package/dist/cjs/codama/instructions/index.js.map +1 -0
  29. package/dist/cjs/codama/instructions/initializeConfig.js +131 -0
  30. package/dist/cjs/codama/instructions/initializeConfig.js.map +1 -0
  31. package/dist/cjs/codama/{devnet/instructions → instructions}/payRental.js +32 -23
  32. package/dist/cjs/codama/instructions/payRental.js.map +1 -0
  33. package/dist/cjs/codama/{devnet/instructions → instructions}/resetRental.js +6 -10
  34. package/dist/cjs/codama/instructions/resetRental.js.map +1 -0
  35. package/dist/cjs/codama/instructions/updateConfig.js +145 -0
  36. package/dist/cjs/codama/instructions/updateConfig.js.map +1 -0
  37. package/dist/cjs/codama/programs/index.js.map +1 -0
  38. package/dist/cjs/codama/{devnet/programs → programs}/srsly.js +22 -14
  39. package/dist/cjs/codama/programs/srsly.js.map +1 -0
  40. package/dist/cjs/codama/shared/index.js.map +1 -0
  41. package/dist/cjs/codama/types/clockData.js.map +1 -0
  42. package/dist/cjs/codama/types/equality.js.map +1 -0
  43. package/dist/cjs/codama/types/execContext.js.map +1 -0
  44. package/dist/cjs/codama/types/index.js.map +1 -0
  45. package/dist/cjs/codama/types/paymentFrequency.js.map +1 -0
  46. package/dist/cjs/codama/types/serializableAccount.js.map +1 -0
  47. package/dist/cjs/codama/types/serializableInstruction.js.map +1 -0
  48. package/dist/cjs/codama/types/threadResponse.js.map +1 -0
  49. package/dist/cjs/codama/types/trigger.js.map +1 -0
  50. package/dist/cjs/codama/types/triggerContext.js.map +1 -0
  51. package/dist/cjs/contract/cancel.js +77 -0
  52. package/dist/cjs/contract/cancel.js.map +1 -0
  53. package/dist/cjs/contract/close.js +74 -31
  54. package/dist/cjs/contract/close.js.map +1 -1
  55. package/dist/cjs/contract/create.js +79 -35
  56. package/dist/cjs/contract/create.js.map +1 -1
  57. package/dist/cjs/contract/index.js +1 -0
  58. package/dist/cjs/contract/index.js.map +1 -1
  59. package/dist/cjs/index.js +25 -2
  60. package/dist/cjs/index.js.map +1 -1
  61. package/dist/cjs/package.json +53 -0
  62. package/dist/cjs/rental/accept.js +76 -42
  63. package/dist/cjs/rental/accept.js.map +1 -1
  64. package/dist/cjs/rental/cancel.js +40 -28
  65. package/dist/cjs/rental/cancel.js.map +1 -1
  66. package/dist/cjs/rental/close.js +42 -30
  67. package/dist/cjs/rental/close.js.map +1 -1
  68. package/dist/cjs/rental/reset.js +50 -43
  69. package/dist/cjs/rental/reset.js.map +1 -1
  70. package/dist/cjs/types/paymentFrequency.js +58 -0
  71. package/dist/cjs/types/paymentFrequency.js.map +1 -0
  72. package/dist/cjs/utils/config.js +216 -0
  73. package/dist/cjs/utils/config.js.map +1 -0
  74. package/dist/cjs/utils/constants.js +55 -27
  75. package/dist/cjs/utils/constants.js.map +1 -1
  76. package/dist/cjs/utils/duration.js +77 -0
  77. package/dist/cjs/utils/duration.js.map +1 -0
  78. package/dist/cjs/utils/index.js +4 -0
  79. package/dist/cjs/utils/index.js.map +1 -1
  80. package/dist/cjs/utils/instruction-converter.js +66 -0
  81. package/dist/cjs/utils/instruction-converter.js.map +1 -0
  82. package/dist/cjs/utils/paymentFrequency.js +60 -0
  83. package/dist/cjs/utils/paymentFrequency.js.map +1 -0
  84. package/dist/cjs/utils/profiles.js +38 -18
  85. package/dist/cjs/utils/profiles.js.map +1 -1
  86. package/dist/cjs/utils/types.js +6 -0
  87. package/dist/cjs/utils/types.js.map +1 -0
  88. package/dist/esm/codama/accounts/config.js +76 -0
  89. package/dist/esm/codama/accounts/config.js.map +1 -0
  90. package/dist/esm/codama/{devnet/accounts → accounts}/contractState.js +3 -7
  91. package/dist/esm/codama/accounts/contractState.js.map +1 -0
  92. package/dist/esm/codama/{devnet/accounts → accounts}/index.js +1 -1
  93. package/dist/esm/codama/accounts/index.js.map +1 -0
  94. package/dist/esm/codama/{devnet/accounts → accounts}/rentalState.js +3 -1
  95. package/dist/esm/codama/accounts/rentalState.js.map +1 -0
  96. package/dist/esm/codama/accounts/thread.js.map +1 -0
  97. package/dist/esm/codama/errors/index.js.map +1 -0
  98. package/dist/esm/codama/{devnet/errors → errors}/srsly.js +32 -2
  99. package/dist/esm/codama/errors/srsly.js.map +1 -0
  100. package/dist/esm/codama/index.js.map +1 -0
  101. package/dist/esm/codama/{devnet/instructions → instructions}/acceptRental.js +30 -39
  102. package/dist/esm/codama/instructions/acceptRental.js.map +1 -0
  103. package/dist/esm/codama/instructions/cancelContract.js +121 -0
  104. package/dist/esm/codama/instructions/cancelContract.js.map +1 -0
  105. package/dist/esm/codama/{devnet/instructions → instructions}/cancelRental.js +10 -33
  106. package/dist/esm/codama/instructions/cancelRental.js.map +1 -0
  107. package/dist/esm/codama/{devnet/instructions → instructions}/closeContract.js +24 -38
  108. package/dist/esm/codama/instructions/closeContract.js.map +1 -0
  109. package/dist/esm/codama/{devnet/instructions → instructions}/closeRental.js +19 -19
  110. package/dist/esm/codama/instructions/closeRental.js.map +1 -0
  111. package/dist/esm/codama/{devnet/instructions → instructions}/createContract.js +13 -16
  112. package/dist/esm/codama/instructions/createContract.js.map +1 -0
  113. package/dist/esm/codama/{devnet/instructions → instructions}/index.js +3 -1
  114. package/dist/esm/codama/instructions/index.js.map +1 -0
  115. package/dist/esm/codama/instructions/initializeConfig.js +121 -0
  116. package/dist/esm/codama/instructions/initializeConfig.js.map +1 -0
  117. package/dist/esm/codama/{devnet/instructions → instructions}/payRental.js +34 -25
  118. package/dist/esm/codama/instructions/payRental.js.map +1 -0
  119. package/dist/esm/codama/{devnet/instructions → instructions}/resetRental.js +6 -10
  120. package/dist/esm/codama/instructions/resetRental.js.map +1 -0
  121. package/dist/esm/codama/instructions/updateConfig.js +135 -0
  122. package/dist/esm/codama/instructions/updateConfig.js.map +1 -0
  123. package/dist/esm/codama/programs/index.js.map +1 -0
  124. package/dist/esm/codama/{devnet/programs → programs}/srsly.js +22 -14
  125. package/dist/esm/codama/programs/srsly.js.map +1 -0
  126. package/dist/esm/codama/shared/index.js.map +1 -0
  127. package/dist/esm/codama/types/clockData.js.map +1 -0
  128. package/dist/esm/codama/types/equality.js.map +1 -0
  129. package/dist/esm/codama/types/execContext.js.map +1 -0
  130. package/dist/esm/codama/types/index.js.map +1 -0
  131. package/dist/esm/codama/types/paymentFrequency.js.map +1 -0
  132. package/dist/esm/codama/types/serializableAccount.js.map +1 -0
  133. package/dist/esm/codama/types/serializableInstruction.js.map +1 -0
  134. package/dist/esm/codama/types/threadResponse.js.map +1 -0
  135. package/dist/esm/codama/types/trigger.js.map +1 -0
  136. package/dist/esm/codama/types/triggerContext.js.map +1 -0
  137. package/dist/esm/contract/cancel.js +73 -0
  138. package/dist/esm/contract/cancel.js.map +1 -0
  139. package/dist/esm/contract/close.js +75 -32
  140. package/dist/esm/contract/close.js.map +1 -1
  141. package/dist/esm/contract/create.js +79 -34
  142. package/dist/esm/contract/create.js.map +1 -1
  143. package/dist/esm/contract/index.js +1 -0
  144. package/dist/esm/contract/index.js.map +1 -1
  145. package/dist/esm/index.js +8 -2
  146. package/dist/esm/index.js.map +1 -1
  147. package/dist/esm/package.json +53 -0
  148. package/dist/esm/rental/accept.js +77 -43
  149. package/dist/esm/rental/accept.js.map +1 -1
  150. package/dist/esm/rental/cancel.js +40 -28
  151. package/dist/esm/rental/cancel.js.map +1 -1
  152. package/dist/esm/rental/close.js +42 -30
  153. package/dist/esm/rental/close.js.map +1 -1
  154. package/dist/esm/rental/reset.js +51 -44
  155. package/dist/esm/rental/reset.js.map +1 -1
  156. package/dist/esm/types/paymentFrequency.js +53 -0
  157. package/dist/esm/types/paymentFrequency.js.map +1 -0
  158. package/dist/esm/utils/config.js +173 -0
  159. package/dist/esm/utils/config.js.map +1 -0
  160. package/dist/esm/utils/constants.js +49 -24
  161. package/dist/esm/utils/constants.js.map +1 -1
  162. package/dist/esm/utils/duration.js +68 -0
  163. package/dist/esm/utils/duration.js.map +1 -0
  164. package/dist/esm/utils/index.js +4 -0
  165. package/dist/esm/utils/index.js.map +1 -1
  166. package/dist/esm/utils/instruction-converter.js +62 -0
  167. package/dist/esm/utils/instruction-converter.js.map +1 -0
  168. package/dist/esm/utils/paymentFrequency.js +55 -0
  169. package/dist/esm/utils/paymentFrequency.js.map +1 -0
  170. package/dist/esm/utils/profiles.js +39 -19
  171. package/dist/esm/utils/profiles.js.map +1 -1
  172. package/dist/esm/utils/types.js +5 -0
  173. package/dist/esm/utils/types.js.map +1 -0
  174. package/dist/types/codama/accounts/config.d.ts +52 -0
  175. package/dist/types/codama/accounts/config.d.ts.map +1 -0
  176. package/dist/types/codama/{devnet/accounts → accounts}/contractState.d.ts +2 -4
  177. package/dist/types/codama/accounts/contractState.d.ts.map +1 -0
  178. package/dist/types/codama/{devnet/accounts → accounts}/index.d.ts +1 -1
  179. package/dist/types/codama/accounts/index.d.ts.map +1 -0
  180. package/dist/types/codama/{devnet/accounts → accounts}/rentalState.d.ts +2 -0
  181. package/dist/types/codama/accounts/rentalState.d.ts.map +1 -0
  182. package/dist/types/codama/accounts/thread.d.ts.map +1 -0
  183. package/dist/types/codama/errors/index.d.ts.map +1 -0
  184. package/dist/types/codama/errors/srsly.d.ts +68 -0
  185. package/dist/types/codama/errors/srsly.d.ts.map +1 -0
  186. package/dist/types/codama/index.d.ts.map +1 -0
  187. package/dist/types/codama/instructions/acceptRental.d.ts +135 -0
  188. package/dist/types/codama/instructions/acceptRental.d.ts.map +1 -0
  189. package/dist/types/codama/instructions/cancelContract.d.ts +59 -0
  190. package/dist/types/codama/instructions/cancelContract.d.ts.map +1 -0
  191. package/dist/types/codama/{devnet/instructions → instructions}/cancelRental.d.ts +14 -10
  192. package/dist/types/codama/instructions/cancelRental.d.ts.map +1 -0
  193. package/dist/types/codama/instructions/closeContract.d.ts +104 -0
  194. package/dist/types/codama/instructions/closeContract.d.ts.map +1 -0
  195. package/dist/types/codama/{devnet/instructions → instructions}/closeRental.d.ts +20 -12
  196. package/dist/types/codama/instructions/closeRental.d.ts.map +1 -0
  197. package/dist/types/codama/instructions/createContract.d.ts +112 -0
  198. package/dist/types/codama/instructions/createContract.d.ts.map +1 -0
  199. package/dist/types/codama/{devnet/instructions → instructions}/index.d.ts +3 -1
  200. package/dist/types/codama/instructions/index.d.ts.map +1 -0
  201. package/dist/types/codama/instructions/initializeConfig.d.ts +60 -0
  202. package/dist/types/codama/instructions/initializeConfig.d.ts.map +1 -0
  203. package/dist/types/codama/{devnet/instructions → instructions}/payRental.d.ts +28 -13
  204. package/dist/types/codama/instructions/payRental.d.ts.map +1 -0
  205. package/dist/types/codama/{devnet/instructions → instructions}/resetRental.d.ts +15 -11
  206. package/dist/types/codama/instructions/resetRental.d.ts.map +1 -0
  207. package/dist/types/codama/instructions/updateConfig.d.ts +93 -0
  208. package/dist/types/codama/instructions/updateConfig.d.ts.map +1 -0
  209. package/dist/types/codama/programs/index.d.ts.map +1 -0
  210. package/dist/types/codama/{devnet/programs → programs}/srsly.d.ts +19 -13
  211. package/dist/types/codama/programs/srsly.d.ts.map +1 -0
  212. package/dist/types/codama/shared/index.d.ts.map +1 -0
  213. package/dist/types/codama/types/clockData.d.ts.map +1 -0
  214. package/dist/types/codama/types/equality.d.ts.map +1 -0
  215. package/dist/types/codama/types/execContext.d.ts.map +1 -0
  216. package/dist/types/codama/types/index.d.ts.map +1 -0
  217. package/dist/types/codama/types/paymentFrequency.d.ts.map +1 -0
  218. package/dist/types/codama/types/serializableAccount.d.ts.map +1 -0
  219. package/dist/types/codama/types/serializableInstruction.d.ts.map +1 -0
  220. package/dist/types/codama/types/threadResponse.d.ts.map +1 -0
  221. package/dist/types/codama/types/trigger.d.ts.map +1 -0
  222. package/dist/types/codama/types/triggerContext.d.ts.map +1 -0
  223. package/dist/types/contract/cancel.d.ts +66 -0
  224. package/dist/types/contract/cancel.d.ts.map +1 -0
  225. package/dist/types/contract/close.d.ts +29 -13
  226. package/dist/types/contract/close.d.ts.map +1 -1
  227. package/dist/types/contract/create.d.ts +55 -54
  228. package/dist/types/contract/create.d.ts.map +1 -1
  229. package/dist/types/contract/index.d.ts +1 -0
  230. package/dist/types/contract/index.d.ts.map +1 -1
  231. package/dist/types/index.d.ts +5 -2
  232. package/dist/types/index.d.ts.map +1 -1
  233. package/dist/types/rental/accept.d.ts +65 -15
  234. package/dist/types/rental/accept.d.ts.map +1 -1
  235. package/dist/types/rental/cancel.d.ts +36 -8
  236. package/dist/types/rental/cancel.d.ts.map +1 -1
  237. package/dist/types/rental/close.d.ts +36 -8
  238. package/dist/types/rental/close.d.ts.map +1 -1
  239. package/dist/types/rental/reset.d.ts +42 -11
  240. package/dist/types/rental/reset.d.ts.map +1 -1
  241. package/dist/types/types/paymentFrequency.d.ts +44 -0
  242. package/dist/types/types/paymentFrequency.d.ts.map +1 -0
  243. package/dist/types/utils/config.d.ts +110 -0
  244. package/dist/types/utils/config.d.ts.map +1 -0
  245. package/dist/types/utils/constants.d.ts +14 -11
  246. package/dist/types/utils/constants.d.ts.map +1 -1
  247. package/dist/types/utils/duration.d.ts +56 -0
  248. package/dist/types/utils/duration.d.ts.map +1 -0
  249. package/dist/types/utils/index.d.ts +4 -0
  250. package/dist/types/utils/index.d.ts.map +1 -1
  251. package/dist/types/utils/instruction-converter.d.ts +117 -0
  252. package/dist/types/utils/instruction-converter.d.ts.map +1 -0
  253. package/dist/types/utils/paymentFrequency.d.ts +18 -0
  254. package/dist/types/utils/paymentFrequency.d.ts.map +1 -0
  255. package/dist/types/utils/profiles.d.ts +14 -8
  256. package/dist/types/utils/profiles.d.ts.map +1 -1
  257. package/dist/types/utils/types.d.ts +6 -0
  258. package/dist/types/utils/types.d.ts.map +1 -0
  259. package/package.json +33 -25
  260. package/target/idl/{srsly-devnet.json → srsly.json} +834 -466
  261. package/dist/cjs/codama/devnet/accounts/contractState.js.map +0 -1
  262. package/dist/cjs/codama/devnet/accounts/fleet.js +0 -77
  263. package/dist/cjs/codama/devnet/accounts/fleet.js.map +0 -1
  264. package/dist/cjs/codama/devnet/accounts/index.js.map +0 -1
  265. package/dist/cjs/codama/devnet/accounts/rentalState.js.map +0 -1
  266. package/dist/cjs/codama/devnet/accounts/thread.js.map +0 -1
  267. package/dist/cjs/codama/devnet/errors/index.js.map +0 -1
  268. package/dist/cjs/codama/devnet/errors/srsly.js.map +0 -1
  269. package/dist/cjs/codama/devnet/index.js.map +0 -1
  270. package/dist/cjs/codama/devnet/instructions/acceptRental.js.map +0 -1
  271. package/dist/cjs/codama/devnet/instructions/cancelRental.js.map +0 -1
  272. package/dist/cjs/codama/devnet/instructions/closeContract.js.map +0 -1
  273. package/dist/cjs/codama/devnet/instructions/closeRental.js.map +0 -1
  274. package/dist/cjs/codama/devnet/instructions/createContract.js.map +0 -1
  275. package/dist/cjs/codama/devnet/instructions/index.js.map +0 -1
  276. package/dist/cjs/codama/devnet/instructions/normalizeAdmin.js +0 -152
  277. package/dist/cjs/codama/devnet/instructions/normalizeAdmin.js.map +0 -1
  278. package/dist/cjs/codama/devnet/instructions/payRental.js.map +0 -1
  279. package/dist/cjs/codama/devnet/instructions/resetRental.js.map +0 -1
  280. package/dist/cjs/codama/devnet/programs/index.js.map +0 -1
  281. package/dist/cjs/codama/devnet/programs/srsly.js.map +0 -1
  282. package/dist/cjs/codama/devnet/shared/index.js.map +0 -1
  283. package/dist/cjs/codama/devnet/types/clockData.js.map +0 -1
  284. package/dist/cjs/codama/devnet/types/equality.js.map +0 -1
  285. package/dist/cjs/codama/devnet/types/execContext.js.map +0 -1
  286. package/dist/cjs/codama/devnet/types/index.js.map +0 -1
  287. package/dist/cjs/codama/devnet/types/paymentFrequency.js.map +0 -1
  288. package/dist/cjs/codama/devnet/types/serializableAccount.js.map +0 -1
  289. package/dist/cjs/codama/devnet/types/serializableInstruction.js.map +0 -1
  290. package/dist/cjs/codama/devnet/types/threadResponse.js.map +0 -1
  291. package/dist/cjs/codama/devnet/types/trigger.js.map +0 -1
  292. package/dist/cjs/codama/devnet/types/triggerContext.js.map +0 -1
  293. package/dist/cjs/network.js +0 -107
  294. package/dist/cjs/network.js.map +0 -1
  295. package/dist/esm/codama/devnet/accounts/contractState.js.map +0 -1
  296. package/dist/esm/codama/devnet/accounts/fleet.js +0 -64
  297. package/dist/esm/codama/devnet/accounts/fleet.js.map +0 -1
  298. package/dist/esm/codama/devnet/accounts/index.js.map +0 -1
  299. package/dist/esm/codama/devnet/accounts/rentalState.js.map +0 -1
  300. package/dist/esm/codama/devnet/accounts/thread.js.map +0 -1
  301. package/dist/esm/codama/devnet/errors/index.js.map +0 -1
  302. package/dist/esm/codama/devnet/errors/srsly.js.map +0 -1
  303. package/dist/esm/codama/devnet/index.js.map +0 -1
  304. package/dist/esm/codama/devnet/instructions/acceptRental.js.map +0 -1
  305. package/dist/esm/codama/devnet/instructions/cancelRental.js.map +0 -1
  306. package/dist/esm/codama/devnet/instructions/closeContract.js.map +0 -1
  307. package/dist/esm/codama/devnet/instructions/closeRental.js.map +0 -1
  308. package/dist/esm/codama/devnet/instructions/createContract.js.map +0 -1
  309. package/dist/esm/codama/devnet/instructions/index.js.map +0 -1
  310. package/dist/esm/codama/devnet/instructions/normalizeAdmin.js +0 -142
  311. package/dist/esm/codama/devnet/instructions/normalizeAdmin.js.map +0 -1
  312. package/dist/esm/codama/devnet/instructions/payRental.js.map +0 -1
  313. package/dist/esm/codama/devnet/instructions/resetRental.js.map +0 -1
  314. package/dist/esm/codama/devnet/programs/index.js.map +0 -1
  315. package/dist/esm/codama/devnet/programs/srsly.js.map +0 -1
  316. package/dist/esm/codama/devnet/shared/index.js.map +0 -1
  317. package/dist/esm/codama/devnet/types/clockData.js.map +0 -1
  318. package/dist/esm/codama/devnet/types/equality.js.map +0 -1
  319. package/dist/esm/codama/devnet/types/execContext.js.map +0 -1
  320. package/dist/esm/codama/devnet/types/index.js.map +0 -1
  321. package/dist/esm/codama/devnet/types/paymentFrequency.js.map +0 -1
  322. package/dist/esm/codama/devnet/types/serializableAccount.js.map +0 -1
  323. package/dist/esm/codama/devnet/types/serializableInstruction.js.map +0 -1
  324. package/dist/esm/codama/devnet/types/threadResponse.js.map +0 -1
  325. package/dist/esm/codama/devnet/types/trigger.js.map +0 -1
  326. package/dist/esm/codama/devnet/types/triggerContext.js.map +0 -1
  327. package/dist/esm/network.js +0 -67
  328. package/dist/esm/network.js.map +0 -1
  329. package/dist/types/codama/devnet/accounts/contractState.d.ts.map +0 -1
  330. package/dist/types/codama/devnet/accounts/fleet.d.ts +0 -38
  331. package/dist/types/codama/devnet/accounts/fleet.d.ts.map +0 -1
  332. package/dist/types/codama/devnet/accounts/index.d.ts.map +0 -1
  333. package/dist/types/codama/devnet/accounts/rentalState.d.ts.map +0 -1
  334. package/dist/types/codama/devnet/accounts/thread.d.ts.map +0 -1
  335. package/dist/types/codama/devnet/errors/index.d.ts.map +0 -1
  336. package/dist/types/codama/devnet/errors/srsly.d.ts +0 -48
  337. package/dist/types/codama/devnet/errors/srsly.d.ts.map +0 -1
  338. package/dist/types/codama/devnet/index.d.ts.map +0 -1
  339. package/dist/types/codama/devnet/instructions/acceptRental.d.ts +0 -128
  340. package/dist/types/codama/devnet/instructions/acceptRental.d.ts.map +0 -1
  341. package/dist/types/codama/devnet/instructions/cancelRental.d.ts.map +0 -1
  342. package/dist/types/codama/devnet/instructions/closeContract.d.ts +0 -96
  343. package/dist/types/codama/devnet/instructions/closeContract.d.ts.map +0 -1
  344. package/dist/types/codama/devnet/instructions/closeRental.d.ts.map +0 -1
  345. package/dist/types/codama/devnet/instructions/createContract.d.ts +0 -108
  346. package/dist/types/codama/devnet/instructions/createContract.d.ts.map +0 -1
  347. package/dist/types/codama/devnet/instructions/index.d.ts.map +0 -1
  348. package/dist/types/codama/devnet/instructions/normalizeAdmin.d.ts +0 -67
  349. package/dist/types/codama/devnet/instructions/normalizeAdmin.d.ts.map +0 -1
  350. package/dist/types/codama/devnet/instructions/payRental.d.ts.map +0 -1
  351. package/dist/types/codama/devnet/instructions/resetRental.d.ts.map +0 -1
  352. package/dist/types/codama/devnet/programs/index.d.ts.map +0 -1
  353. package/dist/types/codama/devnet/programs/srsly.d.ts.map +0 -1
  354. package/dist/types/codama/devnet/shared/index.d.ts.map +0 -1
  355. package/dist/types/codama/devnet/types/clockData.d.ts.map +0 -1
  356. package/dist/types/codama/devnet/types/equality.d.ts.map +0 -1
  357. package/dist/types/codama/devnet/types/execContext.d.ts.map +0 -1
  358. package/dist/types/codama/devnet/types/index.d.ts.map +0 -1
  359. package/dist/types/codama/devnet/types/paymentFrequency.d.ts.map +0 -1
  360. package/dist/types/codama/devnet/types/serializableAccount.d.ts.map +0 -1
  361. package/dist/types/codama/devnet/types/serializableInstruction.d.ts.map +0 -1
  362. package/dist/types/codama/devnet/types/threadResponse.d.ts.map +0 -1
  363. package/dist/types/codama/devnet/types/trigger.d.ts.map +0 -1
  364. package/dist/types/codama/devnet/types/triggerContext.d.ts.map +0 -1
  365. package/dist/types/network.d.ts +0 -58
  366. package/dist/types/network.d.ts.map +0 -1
  367. package/target/idl/srsly-mainnet.json +0 -3011
  368. package/target/types/srsly-mainnet.ts +0 -1
  369. /package/dist/cjs/codama/{devnet/accounts → accounts}/thread.js +0 -0
  370. /package/dist/cjs/codama/{devnet/errors → errors}/index.js +0 -0
  371. /package/dist/cjs/codama/{devnet/index.js → index.js} +0 -0
  372. /package/dist/cjs/codama/{devnet/programs → programs}/index.js +0 -0
  373. /package/dist/cjs/codama/{devnet/shared → shared}/index.js +0 -0
  374. /package/dist/cjs/codama/{devnet/types → types}/clockData.js +0 -0
  375. /package/dist/cjs/codama/{devnet/types → types}/equality.js +0 -0
  376. /package/dist/cjs/codama/{devnet/types → types}/execContext.js +0 -0
  377. /package/dist/cjs/codama/{devnet/types → types}/index.js +0 -0
  378. /package/dist/cjs/codama/{devnet/types → types}/paymentFrequency.js +0 -0
  379. /package/dist/cjs/codama/{devnet/types → types}/serializableAccount.js +0 -0
  380. /package/dist/cjs/codama/{devnet/types → types}/serializableInstruction.js +0 -0
  381. /package/dist/cjs/codama/{devnet/types → types}/threadResponse.js +0 -0
  382. /package/dist/cjs/codama/{devnet/types → types}/trigger.js +0 -0
  383. /package/dist/cjs/codama/{devnet/types → types}/triggerContext.js +0 -0
  384. /package/dist/esm/codama/{devnet/accounts → accounts}/thread.js +0 -0
  385. /package/dist/esm/codama/{devnet/errors → errors}/index.js +0 -0
  386. /package/dist/esm/codama/{devnet/index.js → index.js} +0 -0
  387. /package/dist/esm/codama/{devnet/programs → programs}/index.js +0 -0
  388. /package/dist/esm/codama/{devnet/shared → shared}/index.js +0 -0
  389. /package/dist/esm/codama/{devnet/types → types}/clockData.js +0 -0
  390. /package/dist/esm/codama/{devnet/types → types}/equality.js +0 -0
  391. /package/dist/esm/codama/{devnet/types → types}/execContext.js +0 -0
  392. /package/dist/esm/codama/{devnet/types → types}/index.js +0 -0
  393. /package/dist/esm/codama/{devnet/types → types}/paymentFrequency.js +0 -0
  394. /package/dist/esm/codama/{devnet/types → types}/serializableAccount.js +0 -0
  395. /package/dist/esm/codama/{devnet/types → types}/serializableInstruction.js +0 -0
  396. /package/dist/esm/codama/{devnet/types → types}/threadResponse.js +0 -0
  397. /package/dist/esm/codama/{devnet/types → types}/trigger.js +0 -0
  398. /package/dist/esm/codama/{devnet/types → types}/triggerContext.js +0 -0
  399. /package/dist/types/codama/{devnet/accounts → accounts}/thread.d.ts +0 -0
  400. /package/dist/types/codama/{devnet/errors → errors}/index.d.ts +0 -0
  401. /package/dist/types/codama/{devnet/index.d.ts → index.d.ts} +0 -0
  402. /package/dist/types/codama/{devnet/programs → programs}/index.d.ts +0 -0
  403. /package/dist/types/codama/{devnet/shared → shared}/index.d.ts +0 -0
  404. /package/dist/types/codama/{devnet/types → types}/clockData.d.ts +0 -0
  405. /package/dist/types/codama/{devnet/types → types}/equality.d.ts +0 -0
  406. /package/dist/types/codama/{devnet/types → types}/execContext.d.ts +0 -0
  407. /package/dist/types/codama/{devnet/types → types}/index.d.ts +0 -0
  408. /package/dist/types/codama/{devnet/types → types}/paymentFrequency.d.ts +0 -0
  409. /package/dist/types/codama/{devnet/types → types}/serializableAccount.d.ts +0 -0
  410. /package/dist/types/codama/{devnet/types → types}/serializableInstruction.d.ts +0 -0
  411. /package/dist/types/codama/{devnet/types → types}/threadResponse.d.ts +0 -0
  412. /package/dist/types/codama/{devnet/types → types}/trigger.d.ts +0 -0
  413. /package/dist/types/codama/{devnet/types → types}/triggerContext.d.ts +0 -0
  414. /package/target/types/{srsly-devnet.ts → srsly.ts} +0 -0
@@ -1,24 +1,52 @@
1
- import { Address } from '@solana/kit';
2
- import { type NetworkSelector } from '../network';
1
+ import { type ConfigSelector } from '../utils/config';
2
+ type UniversalAddress = string;
3
3
  type CloseRentalInstruction = any;
4
4
  /**
5
- * Simplified parameters for closing a rental
5
+ * Simplified parameters for closing a rental - strings only!
6
6
  */
7
7
  export interface CloseRentalParams {
8
8
  /**
9
9
  * The borrower address (not a signer in this transaction)
10
10
  */
11
- borrower: Address<string>;
11
+ borrower: UniversalAddress;
12
12
  /**
13
13
  * The owner's token account address for receiving ATLAS
14
14
  */
15
- ownerTokenAccount: Address<string>;
15
+ ownerTokenAccount: UniversalAddress;
16
16
  /**
17
17
  * The rental contract account address
18
18
  */
19
- contract: Address<string>;
19
+ contract: UniversalAddress;
20
20
  }
21
- export declare function closeRental(params: CloseRentalParams): NetworkSelector<CloseRentalInstruction>;
22
- export declare function getCloseRentalInstructionAsync(input: any, options?: any): NetworkSelector<any>;
21
+ /**
22
+ * Creates an instruction to close a rental with fluent configuration.
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * // Works with any library - just use strings for addresses!
27
+ * const instruction = await closeRental({
28
+ * borrower: "BorrowerAddr...", // String address
29
+ * ownerTokenAccount: "TokenAcct...", // String address
30
+ * contract: "ContractAddr..." // String address
31
+ * });
32
+ *
33
+ * // Use mainnet configuration
34
+ * const instruction = await closeRental(params).set({ programs: 'mainnet' });
35
+ *
36
+ * // Override specific constants
37
+ * const instruction = await closeRental(params).set({
38
+ * programs: 'mainnet',
39
+ * sageProgramAddress: 'custom...'
40
+ * });
41
+ *
42
+ * // Use the instruction with your preferred Solana library
43
+ * // instruction is compatible with both @solana/kit and @solana/web3.js
44
+ * ```
45
+ *
46
+ * @param params The simplified parameters for closing a rental
47
+ * @returns A ConfigSelector that can be configured with .set() or awaited directly
48
+ */
49
+ export declare function closeRental(params: CloseRentalParams): ConfigSelector<CloseRentalInstruction>;
50
+ export declare function getCloseRentalInstructionAsync(input: any, options?: any): ConfigSelector<any>;
23
51
  export {};
24
52
  //# sourceMappingURL=close.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../src/rental/close.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACR,MAAM,aAAa,CAAC;AAErB,OAAO,EAAiD,KAAK,eAAe,EAAgB,MAAM,YAAY,CAAC;AAG/G,KAAK,sBAAsB,GAAG,GAAG,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1B;;OAEG;IACH,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3B;AAmDD,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,GACxB,eAAe,CAAC,sBAAsB,CAAC,CAEzC;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,GAAG,CAAC,CAK9F"}
1
+ {"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../src/rental/close.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAI3G,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAC/B,KAAK,sBAAsB,GAAG,GAAG,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;OAEG;IACH,iBAAiB,EAAE,gBAAgB,CAAC;IAEpC;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAkCD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,GACxB,cAAc,CAAC,sBAAsB,CAAC,CAExC;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAK7F"}
@@ -1,27 +1,27 @@
1
- import { Address } from '@solana/kit';
2
- import { type NetworkSelector } from '../network';
1
+ import { type ConfigSelector } from '../utils/config';
2
+ type UniversalAddress = string;
3
3
  type ResetRentalInstruction = any;
4
4
  /**
5
- * Simplified parameters for resetting a rental
5
+ * Simplified parameters for resetting a rental - strings only!
6
6
  */
7
7
  export interface ResetRentalParams {
8
8
  /**
9
9
  * The fleet account address
10
10
  */
11
- fleet: Address<string>;
11
+ fleet: UniversalAddress;
12
12
  /**
13
13
  * The rental contract account address
14
14
  */
15
- contract: Address<string>;
15
+ contract: UniversalAddress;
16
16
  /**
17
17
  * The rental state account address
18
18
  */
19
- rentalState: Address<string>;
19
+ rentalState: UniversalAddress;
20
20
  /**
21
21
  * The game ID account address
22
- * Defaults to the standard game ID if not provided
22
+ * If not provided, will use network-specific default
23
23
  */
24
- gameId?: Address<string>;
24
+ gameId?: UniversalAddress;
25
25
  /**
26
26
  * Optional faction (1 = mud, 2 = oni, 3 = ustur)
27
27
  * Or as string: 'mud', 'oni', 'ustur'
@@ -32,9 +32,40 @@ export interface ResetRentalParams {
32
32
  * The owner's profile address
33
33
  * Needed only if faction is provided to derive starbasePlayer
34
34
  */
35
- ownerProfile: Address<string>;
35
+ ownerProfile: UniversalAddress;
36
36
  }
37
- export declare function resetRental(params: ResetRentalParams): NetworkSelector<ResetRentalInstruction>;
38
- export declare function getResetRentalInstructionAsync(input: any, options?: any): NetworkSelector<any>;
37
+ /**
38
+ * Creates an instruction to reset a rental with fluent configuration.
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * // Works with any library - just use strings for addresses!
43
+ * const instruction = await resetRental({
44
+ * fleet: "FleetAddress123...", // String address
45
+ * contract: "ContractAddr...", // String address
46
+ * rentalState: "RentalStateAddr...", // String address
47
+ * faction: 'mud',
48
+ * ownerProfile: "OwnerProfileAddr..." // String address
49
+ * });
50
+ *
51
+ * // Use mainnet configuration
52
+ * const instruction = await resetRental(params).set({ programs: 'mainnet' });
53
+ *
54
+ * // Override specific constants
55
+ * const instruction = await resetRental(params).set({
56
+ * programs: 'mainnet',
57
+ * gameId: 'custom-game-id...',
58
+ * sageProgramAddress: 'custom...'
59
+ * });
60
+ *
61
+ * // Use the instruction with your preferred Solana library
62
+ * // instruction is compatible with both @solana/kit and @solana/web3.js
63
+ * ```
64
+ *
65
+ * @param params The simplified parameters for resetting a rental
66
+ * @returns A ConfigSelector that can be configured with .set() or awaited directly
67
+ */
68
+ export declare function resetRental(params: ResetRentalParams): ConfigSelector<ResetRentalInstruction>;
69
+ export declare function getResetRentalInstructionAsync(input: any, options?: any): ConfigSelector<any>;
39
70
  export {};
40
71
  //# sourceMappingURL=reset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../../src/rental/reset.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACR,MAAM,aAAa,CAAC;AAErB,OAAO,EAAiD,KAAK,eAAe,EAAgB,MAAM,YAAY,CAAC;AAG/G,KAAK,sBAAsB,GAAG,GAAG,CAAC;AAOlC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzB;;;;OAIG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/B;AA8ED,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,GACxB,eAAe,CAAC,sBAAsB,CAAC,CAEzC;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,GAAG,CAAC,CAK9F"}
1
+ {"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../../src/rental/reset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAK3G,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAC/B,KAAK,sBAAsB,GAAG,GAAG,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,KAAK,EAAE,gBAAgB,CAAC;IAExB;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;OAEG;IACH,WAAW,EAAE,gBAAgB,CAAC;IAE9B;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;;;OAIG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,YAAY,EAAE,gBAAgB,CAAC;CAChC;AAuDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,GACxB,cAAc,CAAC,sBAAsB,CAAC,CAExC;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAK7F"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * This code was AUTO-GENERATED from the Rust PaymentFrequency implementation.
3
+ * Please DO NOT EDIT THIS FILE manually - it will be overwritten.
4
+ *
5
+ * Source: programs/srsly/src/utils.rs
6
+ * Generated by: generate.mjs
7
+ */
8
+ import { PaymentFrequency } from '../codama/types/paymentFrequency';
9
+ /**
10
+ * User-facing payment frequency string type
11
+ * Auto-generated from Rust PaymentFrequency enum
12
+ */
13
+ export type PaymentFrequencyString = 'hourly' | 'daily' | 'weekly' | 'monthly';
14
+ /**
15
+ * Array of all valid payment frequency strings
16
+ * Auto-generated from Rust PaymentFrequency enum
17
+ */
18
+ export declare const VALID_PAYMENT_FREQUENCIES: readonly PaymentFrequencyString[];
19
+ /**
20
+ * Mapping from user-friendly strings to PaymentFrequency enum values
21
+ * Auto-generated from Rust PaymentFrequency enum
22
+ */
23
+ export declare const PAYMENT_FREQUENCY_MAP: Record<PaymentFrequencyString, PaymentFrequency>;
24
+ /**
25
+ * Constants extracted from Rust constants.rs
26
+ * Auto-synced with Rust implementation
27
+ */
28
+ export declare const PAYMENT_FREQUENCY_CONSTANTS: {
29
+ readonly SECONDS_PER_DECASECOND: 10;
30
+ readonly SECONDS_PER_MINUTE: 60;
31
+ readonly SECONDS_PER_HOUR: 3600;
32
+ readonly SECONDS_PER_DAY: 86400;
33
+ readonly SECONDS_PER_WEEK: 604800;
34
+ readonly SECONDS_PER_MONTH: 2678400;
35
+ };
36
+ /**
37
+ * Get PaymentFrequency enum value from user-friendly string
38
+ */
39
+ export declare function getPaymentFrequencyFromString(frequencyString: PaymentFrequencyString): PaymentFrequency;
40
+ /**
41
+ * Check if a string is a valid payment frequency
42
+ */
43
+ export declare function isValidPaymentFrequency(value: string): value is PaymentFrequencyString;
44
+ //# sourceMappingURL=paymentFrequency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentFrequency.d.ts","sourceRoot":"","sources":["../../../src/types/paymentFrequency.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,sBAAsB,EAK7D,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,sBAAsB,EAAE,gBAAgB,CAKzE,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;;;;CAO9B,CAAC;AAEX;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,sBAAsB,GAAG,gBAAgB,CAEvG;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,sBAAsB,CAEtF"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Network configuration for the SRSLY SDK
3
+ */
4
+ export type ProgramSet = 'mainnet' | 'atlasnet' | 'holosim';
5
+ /**
6
+ * Configuration options that can be set globally or overridden per call
7
+ */
8
+ export interface ConfigOptions {
9
+ programs?: ProgramSet;
10
+ srslyProgramAddress?: string;
11
+ profileFactionProgramAddress?: string;
12
+ gameId?: string;
13
+ atlasMint?: string;
14
+ }
15
+ /**
16
+ * Resolve program addresses based on configuration
17
+ * @param config Effective configuration options
18
+ * @returns Resolved program addresses
19
+ */
20
+ export declare function resolveProgramAddresses(config: ConfigOptions): {
21
+ srslyProgramAddress: string;
22
+ sageProgramAddress: "SAGE2HAwep459SNq61LHvjxPk4pLPEJLoMETef7f7EE" | "SAgeTraQfBMdvGVDJYoEvjnbq5szW7RJPi6obDTDQUF";
23
+ profileFactionProgramAddress: string;
24
+ gameId: string;
25
+ atlasMint: string;
26
+ };
27
+ /**
28
+ * Set global configuration options that will be used as defaults for all SDK operations
29
+ * @param config Configuration options to set globally
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * // Use default atlasnet program addresses
34
+ * setConfig({ programs: 'atlasnet' });
35
+ *
36
+ * // Use holosim program addresses
37
+ * setConfig({ programs: 'holosim' });
38
+ *
39
+ * // Use holosim program addresses with custom game ID
40
+ * setConfig({
41
+ * programs: 'holosim',
42
+ * gameId: 'custom-game-id...'
43
+ * });
44
+ *
45
+ * // Can still override per instruction
46
+ * await createContract(params).set({ srslyProgramAddress: 'custom...' });
47
+ * ```
48
+ */
49
+ export declare function setConfig(config: ConfigOptions): void;
50
+ /**
51
+ * Get the current global configuration
52
+ * @returns Current global configuration options
53
+ */
54
+ export declare function getConfig(): ConfigOptions;
55
+ /**
56
+ * Clear global configuration (resets to atlasnet program set defaults)
57
+ */
58
+ export declare function clearConfig(): void;
59
+ /**
60
+ * Get the effective configuration by merging global config with provided overrides
61
+ * @param overrides Optional configuration overrides
62
+ * @returns Merged configuration with global defaults and any overrides
63
+ */
64
+ export declare function getEffectiveConfig(overrides?: ConfigOptions): ConfigOptions;
65
+ /**
66
+ * Get the single codama module (network agnostic)
67
+ * @param modulePath The module type ('instructions' or 'programs')
68
+ * @returns The codama module
69
+ */
70
+ export declare function getModule(modulePath: 'instructions' | 'programs'): any;
71
+ /**
72
+ * @deprecated Use getModule instead. This function is kept for backward compatibility.
73
+ * Get codama modules (network agnostic)
74
+ */
75
+ export declare function getCachedNetworkModule<T = any>(modulePath: string): Promise<T>;
76
+ /**
77
+ * Configuration selector for overriding network and constants
78
+ * Also implements PromiseLike to allow direct awaiting
79
+ */
80
+ export interface ConfigSelector<T> extends PromiseLike<T> {
81
+ /**
82
+ * Set configuration options for this call
83
+ */
84
+ set(options: ConfigOptions): ConfigSelector<T>;
85
+ /**
86
+ * Build with current configuration (explicit call)
87
+ */
88
+ build(): Promise<T>;
89
+ }
90
+ /**
91
+ * Create the initial fluent config selector for a function.
92
+ * This is the main entry point for the fluent configuration API.
93
+ *
94
+ * The returned selector can be:
95
+ * - Awaited directly (uses global config + atlasnet fallback)
96
+ * - Configured with .set() to override network/constants
97
+ * - Chained with multiple .set() calls
98
+ *
99
+ * @param executeFn - The function to execute with optional configuration
100
+ * @returns A ConfigSelector that supports fluent configuration
101
+ *
102
+ * @example
103
+ * // Usage patterns:
104
+ * setConfig({ programs: 'mainnet' });
105
+ * await createConfigSelector(executeFn) // Direct await (uses global config)
106
+ * await createConfigSelector(executeFn).set({...}) // Override global config
107
+ * await createConfigSelector(executeFn).set({...}).set({...}) // Chained configs
108
+ */
109
+ export declare function createConfigSelector<T>(executeFn: (config?: ConfigOptions) => Promise<T>): ConfigSelector<T>;
110
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAwB5D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,aAAa;;;;;;EAiB5D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAErD;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,aAAa,CAEzC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAGD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,aAAa,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,cAAc,GAAG,UAAU,GAAG,GAAG,CAEtE;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,GAAG,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAKpF;AAID;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IACvD;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IAE/C;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CACrB;AAsCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,GAChD,cAAc,CAAC,CAAC,CAAC,CAcnB"}
@@ -1,21 +1,24 @@
1
- export declare function getPaymentFrequency(): Promise<any>;
2
- export declare function getSrslyProgramAddress(): Promise<any>;
3
- import { type Address } from "@solana/kit";
4
- export declare function getProgramId(): Promise<Address>;
5
- export declare const SAGE_PROGRAM_ADDRESS = "sAgezwJpDb1aHvzNr3o24cKjsETmFEKghBEyJ1askDi";
6
- export declare const PROFILE_FACTION_PROGRAM_ADDRESS = "pFACSRuobDmvfMKq1bAzwj27t6d2GJhSCHb1VcfnRmq";
7
- export declare const DEFAULT_GAME_ID = "GAMEzqJehF8yAnKiTARUuhZMvLvkZVAsCVri5vSfemLr";
1
+ import { type ConfigOptions } from './config';
2
+ /**
3
+ * Converts a string or Address to an Address type
4
+ * This utility ensures consistent address handling across the SDK
5
+ * Note: This is a simple passthrough now since pack functions handle library-specific conversions
6
+ */
7
+ export declare function toAddress(value: string | any): any;
8
8
  export declare const STARBASE_SEED = "Starbase";
9
9
  export declare const STARBASE_PLAYER_SEED = "starbase_player";
10
10
  export declare const SAGE_PLAYER_PROFILE_SEED = "sage_player_profile";
11
11
  export declare const PROFILE_FACTION_SEED = "profile_faction";
12
+ export declare const ATLAS_TO_STARDUST = 100000000;
13
+ export declare function getSrslyProgramAddress(config?: ConfigOptions): Promise<any>;
14
+ export declare function getProgramId(): Promise<any>;
15
+ export declare function getSageProgramAddress(config?: ConfigOptions): Promise<any>;
16
+ export declare function getProfileFactionProgramAddress(config?: ConfigOptions): Promise<any>;
17
+ export declare function getSageGameId(config?: ConfigOptions): Promise<any>;
18
+ export declare function getAtlasMint(config?: ConfigOptions): Promise<any>;
12
19
  export declare const FACTION_SPECIFIC_CSS: Record<string, {
13
20
  x: number;
14
21
  y: number;
15
22
  }>;
16
23
  export declare const FACTION_MAPPING: Record<number, string>;
17
- /**
18
- * Convert PaymentFrequency enum to string (async version)
19
- */
20
- export declare function paymentFrequencyToString(freq: any): Promise<string>;
21
24
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAGA,wBAAsB,mBAAmB,iBAGxC;AAED,wBAAsB,sBAAsB,iBAG3C;AACD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,wBAAsB,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,CAErD;AAGD,eAAO,MAAM,oBAAoB,gDAAgD,CAAC;AAClF,eAAO,MAAM,+BAA+B,gDAAgD,CAAC;AAC7F,eAAO,MAAM,eAAe,iDAAiD,CAAC;AAG9E,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AACtD,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAC9D,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAGtD,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAIzE,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIlD,CAAC;AAEF;;GAEG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAGzE"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAClF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,CAElD;AAGD,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AACtD,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAC9D,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAGtD,eAAO,MAAM,iBAAiB,YAAc,CAAC;AAM7C,wBAAsB,sBAAsB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAMjF;AAGD,wBAAsB,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,CAEjD;AAGD,wBAAsB,qBAAqB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAOhF;AAED,wBAAsB,+BAA+B,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAM1F;AAED,wBAAsB,aAAa,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAMxE;AAED,wBAAsB,YAAY,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAMvE;AAGD,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAIzE,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIlD,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Convert decaseconds (10 seconds) to seconds
3
+ * @param amount Number of decaseconds
4
+ * @returns Number of seconds
5
+ */
6
+ export declare function decaseconds(amount: number): number;
7
+ /**
8
+ * Convert minutes to seconds
9
+ * @param amount Number of minutes
10
+ * @returns Number of seconds
11
+ */
12
+ export declare function minutes(amount: number): number;
13
+ /**
14
+ * Convert hours to seconds
15
+ * @param amount Number of hours
16
+ * @returns Number of seconds
17
+ */
18
+ export declare function hours(amount: number): number;
19
+ /**
20
+ * Convert days to seconds
21
+ * @param amount Number of days
22
+ * @returns Number of seconds
23
+ */
24
+ export declare function days(amount: number): number;
25
+ /**
26
+ * Convert weeks to seconds
27
+ * @param amount Number of weeks
28
+ * @returns Number of seconds
29
+ */
30
+ export declare function weeks(amount: number): number;
31
+ /**
32
+ * Convert months to seconds
33
+ * @param amount Number of months (31 days each)
34
+ * @returns Number of seconds
35
+ */
36
+ export declare function months(amount: number): number;
37
+ /**
38
+ * All duration helper functions
39
+ */
40
+ export declare const duration: {
41
+ readonly decaseconds: typeof decaseconds;
42
+ readonly minutes: typeof minutes;
43
+ readonly hours: typeof hours;
44
+ readonly days: typeof days;
45
+ readonly weeks: typeof weeks;
46
+ readonly months: typeof months;
47
+ readonly constants: {
48
+ readonly SECONDS_PER_DECASECOND: 10;
49
+ readonly SECONDS_PER_MINUTE: 60;
50
+ readonly SECONDS_PER_HOUR: 3600;
51
+ readonly SECONDS_PER_DAY: 86400;
52
+ readonly SECONDS_PER_WEEK: 604800;
53
+ readonly SECONDS_PER_MONTH: 2678400;
54
+ };
55
+ };
56
+ //# sourceMappingURL=duration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../../src/utils/duration.ts"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;CAUX,CAAC"}
@@ -1,3 +1,7 @@
1
1
  export * from "./constants";
2
2
  export * from "./profiles";
3
+ export * from "./config";
4
+ export * from "./paymentFrequency";
5
+ export * from "./duration";
6
+ export * from "./instruction-converter";
3
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Fluent instruction interface for format conversion between @solana/kit and @solana/web3.js
3
+ */
4
+ import { ConfigSelector } from './config';
5
+ /**
6
+ * @solana/kit instruction format
7
+ */
8
+ export interface KitInstruction {
9
+ accounts: Array<{
10
+ address: string;
11
+ role: number;
12
+ }>;
13
+ programAddress: string;
14
+ data: Uint8Array | {
15
+ [key: string]: number;
16
+ };
17
+ }
18
+ /**
19
+ * @solana/web3.js instruction format with string addresses
20
+ */
21
+ export interface Web3jsInstructionWithStrings {
22
+ keys: Array<{
23
+ pubkey: string;
24
+ isWritable: boolean;
25
+ isSigner: boolean;
26
+ }>;
27
+ programId: string;
28
+ data: Uint8Array | {
29
+ [key: string]: number;
30
+ };
31
+ }
32
+ /**
33
+ * @solana/web3.js instruction format with PublicKey instances
34
+ */
35
+ export interface Web3jsInstructionWithPublicKeys<TPublicKey = any> {
36
+ keys: Array<{
37
+ pubkey: TPublicKey;
38
+ isWritable: boolean;
39
+ isSigner: boolean;
40
+ }>;
41
+ programId: TPublicKey;
42
+ data: Uint8Array | {
43
+ [key: string]: number;
44
+ };
45
+ }
46
+ /**
47
+ * Generic web3.js instruction format
48
+ */
49
+ export type Web3jsInstruction<TPublicKey = string> = TPublicKey extends string ? Web3jsInstructionWithStrings : Web3jsInstructionWithPublicKeys<TPublicKey>;
50
+ /**
51
+ * PublicKey constructor interface
52
+ */
53
+ export interface PublicKeyConstructor<TPublicKey = any> {
54
+ new (address: string): TPublicKey;
55
+ }
56
+ /**
57
+ * Fluent instruction wrapper that provides format conversion methods
58
+ * @example
59
+ * ```typescript
60
+ * import { PublicKey } from '@solana/web3.js';
61
+ *
62
+ * // Default returns kit format
63
+ * const kitInstruction = await createContract(params);
64
+ *
65
+ * // Convert to web3.js format with string addresses
66
+ * const web3jsInstruction = await createContract(params).web3js();
67
+ *
68
+ * // Convert to web3.js format with PublicKey instances
69
+ * const web3jsInstructionWithPK = await createContract(params).web3js(PublicKey);
70
+ *
71
+ * // Use with libraries
72
+ * const transaction = new Transaction().add(web3jsInstructionWithPK);
73
+ * ```
74
+ */
75
+ export interface FluentInstruction extends KitInstruction {
76
+ /**
77
+ * Convert instruction to @solana/web3.js format with string addresses
78
+ * @returns Instruction in @solana/web3.js format with string pubkeys
79
+ */
80
+ web3js(): Web3jsInstructionWithStrings;
81
+ /**
82
+ * Convert instruction to @solana/web3.js format with PublicKey instances
83
+ * @param PublicKeyConstructor Constructor for creating PublicKey instances
84
+ * @returns Instruction in @solana/web3.js format with PublicKey instances
85
+ */
86
+ web3js<TPublicKey>(PublicKeyConstructor: PublicKeyConstructor<TPublicKey>): Web3jsInstructionWithPublicKeys<TPublicKey>;
87
+ }
88
+ /**
89
+ * Fluent config selector that adds format conversion methods
90
+ * This allows chaining both configuration and format conversion
91
+ */
92
+ export interface FluentConfigSelector<T extends FluentInstruction> extends ConfigSelector<T> {
93
+ /**
94
+ * Convert instruction to @solana/web3.js format with string addresses
95
+ * @returns Promise that resolves to Web3jsInstructionWithStrings
96
+ */
97
+ web3js(): Promise<Web3jsInstructionWithStrings>;
98
+ /**
99
+ * Convert instruction to @solana/web3.js format with PublicKey instances
100
+ * @param PublicKeyConstructor Constructor for creating PublicKey instances
101
+ * @returns Promise that resolves to Web3jsInstructionWithPublicKeys
102
+ */
103
+ web3js<TPublicKey>(PublicKeyConstructor: PublicKeyConstructor<TPublicKey>): Promise<Web3jsInstructionWithPublicKeys<TPublicKey>>;
104
+ }
105
+ /**
106
+ * Create a fluent instruction wrapper around a kit instruction
107
+ * @param kitInstruction The base instruction in kit format
108
+ * @returns Fluent instruction with conversion methods
109
+ */
110
+ export declare function createFluentInstruction(kitInstruction: KitInstruction): FluentInstruction;
111
+ /**
112
+ * Create a fluent config selector that adds format conversion methods
113
+ * @param baseSelector The base ConfigSelector
114
+ * @returns FluentConfigSelector with additional format conversion methods
115
+ */
116
+ export declare function createFluentConfigSelector<T extends FluentInstruction>(baseSelector: ConfigSelector<T>): FluentConfigSelector<T>;
117
+ //# sourceMappingURL=instruction-converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instruction-converter.d.ts","sourceRoot":"","sources":["../../../src/utils/instruction-converter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,KAAK,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,UAAU,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,KAAK,CAAC;QACV,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,OAAO,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC,CAAC;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,UAAU,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B,CAAC,UAAU,GAAG,GAAG;IAC/D,IAAI,EAAE,KAAK,CAAC;QACV,MAAM,EAAE,UAAU,CAAC;QACnB,UAAU,EAAE,OAAO,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC,CAAC;IACH,SAAS,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,UAAU,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,UAAU,GAAG,MAAM,IAAI,UAAU,SAAS,MAAM,GAC1E,4BAA4B,GAC5B,+BAA+B,CAAC,UAAU,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,oBAAoB,CAAC,UAAU,GAAG,GAAG;IACpD,KAAK,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD;;;OAGG;IACH,MAAM,IAAI,4BAA4B,CAAC;IAEvC;;;;OAIG;IACH,MAAM,CAAC,UAAU,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,UAAU,CAAC,GAAG,+BAA+B,CAAC,UAAU,CAAC,CAAC;CACzH;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,iBAAiB,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IAC1F;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAEhD;;;;OAIG;IACH,MAAM,CAAC,UAAU,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,+BAA+B,CAAC,UAAU,CAAC,CAAC,CAAC;CAClI;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,cAAc,GAAG,iBAAiB,CA+BzF;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,iBAAiB,EACpE,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,GAC9B,oBAAoB,CAAC,CAAC,CAAC,CAgBzB"}
@@ -0,0 +1,18 @@
1
+ import { PaymentFrequency } from '../codama/types/paymentFrequency';
2
+ import { PaymentFrequencyString } from '../types/paymentFrequency';
3
+ /**
4
+ * Converts a PaymentFrequency enum value to seconds
5
+ * Mirrors the to_seconds() method from the Rust implementation
6
+ */
7
+ export declare function paymentFrequencyToSeconds(frequency: PaymentFrequency): number;
8
+ /**
9
+ * Converts a payment frequency string to seconds
10
+ * Uses auto-generated mapping from Rust PaymentFrequency enum
11
+ */
12
+ export declare function paymentFrequencyStringToSeconds(frequencyString: PaymentFrequencyString): number;
13
+ /**
14
+ * Validates that a duration is a multiple of the payment frequency
15
+ * Uses auto-generated types from Rust PaymentFrequency enum
16
+ */
17
+ export declare function validateDurationAlignment(duration: number | bigint, frequencyString: PaymentFrequencyString): void;
18
+ //# sourceMappingURL=paymentFrequency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentFrequency.d.ts","sourceRoot":"","sources":["../../../src/utils/paymentFrequency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EACL,sBAAsB,EAGvB,MAAM,2BAA2B,CAAC;AAkBnC;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,CAkB7E;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,eAAe,EAAE,sBAAsB,GAAG,MAAM,CAO/F;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,eAAe,EAAE,sBAAsB,GACtC,IAAI,CASN"}
@@ -1,46 +1,52 @@
1
1
  import { Address } from '@solana/kit';
2
+ import type { ConfigOptions } from './config';
2
3
  /**
3
4
  * Helper function to derive the borrower's profile faction account
4
5
  *
5
6
  * @param profile The borrower's profile address
7
+ * @param config Optional configuration for network-specific constants
6
8
  * @returns Promise that resolves to the derived profile faction address
7
9
  */
8
- export declare function deriveProfileFaction(profile: Address<string>): Promise<Address<string>>;
10
+ export declare function deriveProfileFaction(profile: Address<string>, config?: ConfigOptions): Promise<Address<string>>;
9
11
  /**
10
12
  * Helper function to derive the sage player profile
11
13
  *
12
14
  * @param borrowerProfile The borrower's profile address
13
- * @param gameId The game ID (defaults to the standard game ID)
15
+ * @param gameId The game ID (if not provided, uses network-specific default)
16
+ * @param config Optional configuration for network-specific constants
14
17
  * @returns Promise that resolves to the derived sage player profile address
15
18
  */
16
- export declare function deriveSagePlayerProfile(borrowerProfile: Address<string>, gameId?: Address<string>): Promise<Address<string>>;
19
+ export declare function deriveSagePlayerProfile(borrowerProfile: Address<string>, gameId?: Address<string>, config?: ConfigOptions): Promise<Address<string>>;
17
20
  /**
18
21
  * Helper function to derive the starbase address based on faction
19
22
  *
20
23
  * @param faction The faction (1/2/3 or 'mud'/'oni'/'ustur')
21
- * @param gameId The game ID (defaults to the standard game ID)
24
+ * @param gameId The game ID (if not provided, uses network-specific default)
25
+ * @param config Optional configuration for network-specific constants
22
26
  * @returns Promise that resolves to the derived starbase address
23
27
  */
24
- export declare function deriveStarbase(faction: number | string, gameId?: Address<string>): Promise<Address<string>>;
28
+ export declare function deriveStarbase(faction: number | string, gameId?: Address<string>, config?: ConfigOptions): Promise<Address<string>>;
25
29
  /**
26
30
  * Helper function to derive the starbase player address
27
31
  *
28
32
  * @param sagePlayerProfile The sage player profile address
29
33
  * @param starbase The starbase address
30
34
  * @param starbaseSeqId The starbase sequence ID (defaults to 0)
35
+ * @param config Optional configuration for network-specific constants
31
36
  * @returns Promise that resolves to the derived starbase player address
32
37
  */
33
- export declare function deriveStarbasePlayer(sagePlayerProfile: Address<string>, starbase: Address<string>, starbaseSeqId?: number): Promise<Address<string>>;
38
+ export declare function deriveStarbasePlayer(sagePlayerProfile: Address<string>, starbase: Address<string>, starbaseSeqId?: number, config?: ConfigOptions): Promise<Address<string>>;
34
39
  /**
35
40
  * Derives all three accounts needed: profileFaction, starbase, and starbasePlayer
36
41
  *
37
42
  * @param profile The borrower's profile address
38
43
  * @param faction The faction (1/2/3 or 'mud'/'oni'/'ustur')
39
- * @param gameId The game ID (defaults to the standard game ID)
44
+ * @param gameId The game ID (if not provided, uses network-specific default)
40
45
  * @param starbaseSeqId The starbase sequence ID (defaults to 0)
46
+ * @param config Optional configuration for network-specific constants
41
47
  * @returns Promise that resolves to the three derived addresses
42
48
  */
43
- export declare function deriveGameAccounts(profile: Address<string>, faction: number | string, gameId?: Address<string>, starbaseSeqId?: number): Promise<{
49
+ export declare function deriveGameAccounts(profile: Address<string>, faction: number | string, gameId?: Address<string>, starbaseSeqId?: number, config?: ConfigOptions): Promise<{
44
50
  profileFaction: Address<string>;
45
51
  starbase: Address<string>;
46
52
  starbasePlayer: Address<string>;