@wuwei-labs/srsly 3.0.0-beta.19 → 3.0.0-beta.20

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 (300) hide show
  1. package/dist/cjs/accounts/member.js +2 -1
  2. package/dist/cjs/accounts/member.js.map +1 -1
  3. package/dist/cjs/accounts/owner.js +105 -0
  4. package/dist/cjs/accounts/owner.js.map +1 -0
  5. package/dist/cjs/demos.js +85 -9
  6. package/dist/cjs/demos.js.map +1 -1
  7. package/dist/cjs/generated/codama/accounts/borrowerState.js +0 -4
  8. package/dist/cjs/generated/codama/accounts/borrowerState.js.map +1 -1
  9. package/dist/cjs/generated/codama/accounts/configState.js +0 -2
  10. package/dist/cjs/generated/codama/accounts/configState.js.map +1 -1
  11. package/dist/cjs/generated/codama/accounts/contractState.js +4 -2
  12. package/dist/cjs/generated/codama/accounts/contractState.js.map +1 -1
  13. package/dist/cjs/generated/codama/accounts/index.js +1 -0
  14. package/dist/cjs/generated/codama/accounts/index.js.map +1 -1
  15. package/dist/cjs/generated/codama/accounts/ownerState.js +86 -0
  16. package/dist/cjs/generated/codama/accounts/ownerState.js.map +1 -0
  17. package/dist/cjs/generated/codama/errors/srsly.js +26 -29
  18. package/dist/cjs/generated/codama/errors/srsly.js.map +1 -1
  19. package/dist/cjs/generated/codama/instructions/claimBorrower.js +24 -11
  20. package/dist/cjs/generated/codama/instructions/claimBorrower.js.map +1 -1
  21. package/dist/cjs/generated/codama/instructions/{claimContractPayments.js → claimOwner.js} +58 -44
  22. package/dist/cjs/generated/codama/instructions/claimOwner.js.map +1 -0
  23. package/dist/cjs/generated/codama/instructions/closeContract.js +10 -78
  24. package/dist/cjs/generated/codama/instructions/closeContract.js.map +1 -1
  25. package/dist/cjs/generated/codama/instructions/closeRental.js +15 -15
  26. package/dist/cjs/generated/codama/instructions/closeRental.js.map +1 -1
  27. package/dist/cjs/generated/codama/instructions/createContract.js +25 -11
  28. package/dist/cjs/generated/codama/instructions/createContract.js.map +1 -1
  29. package/dist/cjs/generated/codama/instructions/index.js +2 -4
  30. package/dist/cjs/generated/codama/instructions/index.js.map +1 -1
  31. package/dist/cjs/generated/codama/instructions/payRental.js +12 -12
  32. package/dist/cjs/generated/codama/instructions/payRental.js.map +1 -1
  33. package/dist/cjs/generated/codama/instructions/reserveRental.js +27 -8
  34. package/dist/cjs/generated/codama/instructions/reserveRental.js.map +1 -1
  35. package/dist/cjs/generated/codama/instructions/updateConfig.js +0 -2
  36. package/dist/cjs/generated/codama/instructions/updateConfig.js.map +1 -1
  37. package/dist/cjs/generated/codama/instructions/updateOwner.js +79 -0
  38. package/dist/cjs/generated/codama/instructions/updateOwner.js.map +1 -0
  39. package/dist/cjs/generated/codama/programs/srsly.js +29 -33
  40. package/dist/cjs/generated/codama/programs/srsly.js.map +1 -1
  41. package/dist/cjs/generated/codama/types/index.js +0 -1
  42. package/dist/cjs/generated/codama/types/index.js.map +1 -1
  43. package/dist/cjs/index.js +17 -11
  44. package/dist/cjs/index.js.map +1 -1
  45. package/dist/cjs/instructions/acceptRental.js +2 -2
  46. package/dist/cjs/instructions/acceptRental.js.map +1 -1
  47. package/dist/cjs/instructions/cancelRental.js +4 -2
  48. package/dist/cjs/instructions/cancelRental.js.map +1 -1
  49. package/dist/cjs/instructions/claimBorrower.js +7 -3
  50. package/dist/cjs/instructions/claimBorrower.js.map +1 -1
  51. package/dist/cjs/instructions/claimRental.js +2 -2
  52. package/dist/cjs/instructions/claimRental.js.map +1 -1
  53. package/dist/cjs/instructions/closeContract.js +4 -3
  54. package/dist/cjs/instructions/closeContract.js.map +1 -1
  55. package/dist/cjs/instructions/closeRental.js +8 -4
  56. package/dist/cjs/instructions/closeRental.js.map +1 -1
  57. package/dist/cjs/instructions/createContract.js +4 -2
  58. package/dist/cjs/instructions/createContract.js.map +1 -1
  59. package/dist/cjs/instructions/deleteConfig.js +15 -4
  60. package/dist/cjs/instructions/deleteConfig.js.map +1 -1
  61. package/dist/cjs/instructions/index.js +5 -9
  62. package/dist/cjs/instructions/index.js.map +1 -1
  63. package/dist/cjs/instructions/ownerClaim.js +110 -0
  64. package/dist/cjs/instructions/ownerClaim.js.map +1 -0
  65. package/dist/cjs/instructions/ownerUpdate.js +68 -0
  66. package/dist/cjs/instructions/ownerUpdate.js.map +1 -0
  67. package/dist/cjs/instructions/reserveRental.js +6 -5
  68. package/dist/cjs/instructions/reserveRental.js.map +1 -1
  69. package/dist/cjs/instructions/updateBorrower.js +4 -2
  70. package/dist/cjs/instructions/updateBorrower.js.map +1 -1
  71. package/dist/cjs/instructions/updateConfig.js +0 -1
  72. package/dist/cjs/instructions/updateConfig.js.map +1 -1
  73. package/dist/cjs/legacy/index.js +6 -5
  74. package/dist/cjs/legacy/index.js.map +1 -1
  75. package/dist/cjs/package.json +3 -2
  76. package/dist/cjs/pda/constants.js +2 -1
  77. package/dist/cjs/pda/constants.js.map +1 -1
  78. package/dist/cjs/pda/index.js +3 -1
  79. package/dist/cjs/pda/index.js.map +1 -1
  80. package/dist/cjs/pda/srsly.js +21 -0
  81. package/dist/cjs/pda/srsly.js.map +1 -1
  82. package/dist/cjs/utils/addresses.js +1 -1
  83. package/dist/cjs/utils/addresses.js.map +1 -1
  84. package/dist/cjs/utils/signer.js +8 -8
  85. package/dist/cjs/utils/signer.js.map +1 -1
  86. package/dist/cjs/version.js +1 -1
  87. package/dist/esm/accounts/member.js +1 -1
  88. package/dist/esm/accounts/member.js.map +1 -1
  89. package/dist/esm/accounts/owner.js +101 -0
  90. package/dist/esm/accounts/owner.js.map +1 -0
  91. package/dist/esm/demos.js +84 -8
  92. package/dist/esm/demos.js.map +1 -1
  93. package/dist/esm/generated/codama/accounts/borrowerState.js +0 -4
  94. package/dist/esm/generated/codama/accounts/borrowerState.js.map +1 -1
  95. package/dist/esm/generated/codama/accounts/configState.js +0 -2
  96. package/dist/esm/generated/codama/accounts/configState.js.map +1 -1
  97. package/dist/esm/generated/codama/accounts/contractState.js +4 -2
  98. package/dist/esm/generated/codama/accounts/contractState.js.map +1 -1
  99. package/dist/esm/generated/codama/accounts/index.js +1 -0
  100. package/dist/esm/generated/codama/accounts/index.js.map +1 -1
  101. package/dist/esm/generated/codama/accounts/ownerState.js +73 -0
  102. package/dist/esm/generated/codama/accounts/ownerState.js.map +1 -0
  103. package/dist/esm/generated/codama/errors/srsly.js +25 -28
  104. package/dist/esm/generated/codama/errors/srsly.js.map +1 -1
  105. package/dist/esm/generated/codama/instructions/claimBorrower.js +25 -12
  106. package/dist/esm/generated/codama/instructions/claimBorrower.js.map +1 -1
  107. package/dist/esm/generated/codama/instructions/{claimContractPayments.js → claimOwner.js} +51 -37
  108. package/dist/esm/generated/codama/instructions/claimOwner.js.map +1 -0
  109. package/dist/esm/generated/codama/instructions/closeContract.js +10 -78
  110. package/dist/esm/generated/codama/instructions/closeContract.js.map +1 -1
  111. package/dist/esm/generated/codama/instructions/closeRental.js +15 -15
  112. package/dist/esm/generated/codama/instructions/closeRental.js.map +1 -1
  113. package/dist/esm/generated/codama/instructions/createContract.js +25 -11
  114. package/dist/esm/generated/codama/instructions/createContract.js.map +1 -1
  115. package/dist/esm/generated/codama/instructions/index.js +2 -4
  116. package/dist/esm/generated/codama/instructions/index.js.map +1 -1
  117. package/dist/esm/generated/codama/instructions/payRental.js +12 -12
  118. package/dist/esm/generated/codama/instructions/payRental.js.map +1 -1
  119. package/dist/esm/generated/codama/instructions/reserveRental.js +27 -8
  120. package/dist/esm/generated/codama/instructions/reserveRental.js.map +1 -1
  121. package/dist/esm/generated/codama/instructions/updateConfig.js +0 -2
  122. package/dist/esm/generated/codama/instructions/updateConfig.js.map +1 -1
  123. package/dist/esm/generated/codama/instructions/updateOwner.js +70 -0
  124. package/dist/esm/generated/codama/instructions/updateOwner.js.map +1 -0
  125. package/dist/esm/generated/codama/programs/srsly.js +29 -33
  126. package/dist/esm/generated/codama/programs/srsly.js.map +1 -1
  127. package/dist/esm/generated/codama/types/index.js +0 -1
  128. package/dist/esm/generated/codama/types/index.js.map +1 -1
  129. package/dist/esm/index.js +10 -8
  130. package/dist/esm/index.js.map +1 -1
  131. package/dist/esm/instructions/acceptRental.js +2 -2
  132. package/dist/esm/instructions/acceptRental.js.map +1 -1
  133. package/dist/esm/instructions/cancelRental.js +4 -2
  134. package/dist/esm/instructions/cancelRental.js.map +1 -1
  135. package/dist/esm/instructions/claimBorrower.js +8 -4
  136. package/dist/esm/instructions/claimBorrower.js.map +1 -1
  137. package/dist/esm/instructions/claimRental.js +2 -2
  138. package/dist/esm/instructions/claimRental.js.map +1 -1
  139. package/dist/esm/instructions/closeContract.js +4 -3
  140. package/dist/esm/instructions/closeContract.js.map +1 -1
  141. package/dist/esm/instructions/closeRental.js +9 -5
  142. package/dist/esm/instructions/closeRental.js.map +1 -1
  143. package/dist/esm/instructions/createContract.js +4 -2
  144. package/dist/esm/instructions/createContract.js.map +1 -1
  145. package/dist/esm/instructions/deleteConfig.js +15 -4
  146. package/dist/esm/instructions/deleteConfig.js.map +1 -1
  147. package/dist/esm/instructions/index.js +2 -4
  148. package/dist/esm/instructions/index.js.map +1 -1
  149. package/dist/esm/instructions/ownerClaim.js +107 -0
  150. package/dist/esm/instructions/ownerClaim.js.map +1 -0
  151. package/dist/esm/instructions/ownerUpdate.js +65 -0
  152. package/dist/esm/instructions/ownerUpdate.js.map +1 -0
  153. package/dist/esm/instructions/reserveRental.js +7 -6
  154. package/dist/esm/instructions/reserveRental.js.map +1 -1
  155. package/dist/esm/instructions/updateBorrower.js +4 -2
  156. package/dist/esm/instructions/updateBorrower.js.map +1 -1
  157. package/dist/esm/instructions/updateConfig.js +0 -1
  158. package/dist/esm/instructions/updateConfig.js.map +1 -1
  159. package/dist/esm/legacy/index.js +5 -4
  160. package/dist/esm/legacy/index.js.map +1 -1
  161. package/dist/esm/package.json +3 -2
  162. package/dist/esm/pda/constants.js +1 -0
  163. package/dist/esm/pda/constants.js.map +1 -1
  164. package/dist/esm/pda/index.js +2 -2
  165. package/dist/esm/pda/index.js.map +1 -1
  166. package/dist/esm/pda/srsly.js +21 -1
  167. package/dist/esm/pda/srsly.js.map +1 -1
  168. package/dist/esm/utils/addresses.js +1 -1
  169. package/dist/esm/utils/addresses.js.map +1 -1
  170. package/dist/esm/utils/signer.js +8 -8
  171. package/dist/esm/utils/signer.js.map +1 -1
  172. package/dist/esm/version.js +1 -1
  173. package/dist/idl/srsly.json +662 -806
  174. package/dist/types/accounts/member.d.ts +1 -1
  175. package/dist/types/accounts/member.d.ts.map +1 -1
  176. package/dist/types/accounts/owner.d.ts +52 -0
  177. package/dist/types/accounts/owner.d.ts.map +1 -0
  178. package/dist/types/demos.d.ts +14 -2
  179. package/dist/types/demos.d.ts.map +1 -1
  180. package/dist/types/generated/codama/accounts/borrowerState.d.ts +0 -8
  181. package/dist/types/generated/codama/accounts/borrowerState.d.ts.map +1 -1
  182. package/dist/types/generated/codama/accounts/configState.d.ts +0 -4
  183. package/dist/types/generated/codama/accounts/configState.d.ts.map +1 -1
  184. package/dist/types/generated/codama/accounts/contractState.d.ts +8 -4
  185. package/dist/types/generated/codama/accounts/contractState.d.ts.map +1 -1
  186. package/dist/types/generated/codama/accounts/index.d.ts +1 -0
  187. package/dist/types/generated/codama/accounts/index.d.ts.map +1 -1
  188. package/dist/types/generated/codama/accounts/ownerState.d.ts +65 -0
  189. package/dist/types/generated/codama/accounts/ownerState.d.ts.map +1 -0
  190. package/dist/types/generated/codama/errors/srsly.d.ts +26 -28
  191. package/dist/types/generated/codama/errors/srsly.d.ts.map +1 -1
  192. package/dist/types/generated/codama/instructions/claimBorrower.d.ts +31 -19
  193. package/dist/types/generated/codama/instructions/claimBorrower.d.ts.map +1 -1
  194. package/dist/types/generated/codama/instructions/claimOwner.d.ts +91 -0
  195. package/dist/types/generated/codama/instructions/claimOwner.d.ts.map +1 -0
  196. package/dist/types/generated/codama/instructions/closeContract.d.ts +15 -27
  197. package/dist/types/generated/codama/instructions/closeContract.d.ts.map +1 -1
  198. package/dist/types/generated/codama/instructions/closeRental.d.ts +18 -15
  199. package/dist/types/generated/codama/instructions/closeRental.d.ts.map +1 -1
  200. package/dist/types/generated/codama/instructions/createContract.d.ts +20 -16
  201. package/dist/types/generated/codama/instructions/createContract.d.ts.map +1 -1
  202. package/dist/types/generated/codama/instructions/index.d.ts +2 -4
  203. package/dist/types/generated/codama/instructions/index.d.ts.map +1 -1
  204. package/dist/types/generated/codama/instructions/payRental.d.ts +22 -22
  205. package/dist/types/generated/codama/instructions/payRental.d.ts.map +1 -1
  206. package/dist/types/generated/codama/instructions/reserveRental.d.ts +21 -17
  207. package/dist/types/generated/codama/instructions/reserveRental.d.ts.map +1 -1
  208. package/dist/types/generated/codama/instructions/updateConfig.d.ts +0 -6
  209. package/dist/types/generated/codama/instructions/updateConfig.d.ts.map +1 -1
  210. package/dist/types/generated/codama/instructions/updateOwner.d.ts +44 -0
  211. package/dist/types/generated/codama/instructions/updateOwner.d.ts.map +1 -0
  212. package/dist/types/generated/codama/programs/srsly.d.ts +27 -32
  213. package/dist/types/generated/codama/programs/srsly.d.ts.map +1 -1
  214. package/dist/types/generated/codama/types/index.d.ts +0 -1
  215. package/dist/types/generated/codama/types/index.d.ts.map +1 -1
  216. package/dist/types/index.d.ts +6 -7
  217. package/dist/types/index.d.ts.map +1 -1
  218. package/dist/types/instructions/cancelRental.d.ts.map +1 -1
  219. package/dist/types/instructions/claimBorrower.d.ts +6 -0
  220. package/dist/types/instructions/claimBorrower.d.ts.map +1 -1
  221. package/dist/types/instructions/closeContract.d.ts.map +1 -1
  222. package/dist/types/instructions/closeRental.d.ts.map +1 -1
  223. package/dist/types/instructions/createContract.d.ts.map +1 -1
  224. package/dist/types/instructions/deleteConfig.d.ts +4 -2
  225. package/dist/types/instructions/deleteConfig.d.ts.map +1 -1
  226. package/dist/types/instructions/index.d.ts +2 -4
  227. package/dist/types/instructions/index.d.ts.map +1 -1
  228. package/dist/types/instructions/ownerClaim.d.ts +72 -0
  229. package/dist/types/instructions/ownerClaim.d.ts.map +1 -0
  230. package/dist/types/instructions/ownerUpdate.d.ts +57 -0
  231. package/dist/types/instructions/ownerUpdate.d.ts.map +1 -0
  232. package/dist/types/instructions/reserveRental.d.ts.map +1 -1
  233. package/dist/types/instructions/updateBorrower.d.ts.map +1 -1
  234. package/dist/types/instructions/updateConfig.d.ts.map +1 -1
  235. package/dist/types/legacy/index.d.ts +7 -8
  236. package/dist/types/legacy/index.d.ts.map +1 -1
  237. package/dist/types/pda/constants.d.ts +1 -0
  238. package/dist/types/pda/constants.d.ts.map +1 -1
  239. package/dist/types/pda/index.d.ts +2 -2
  240. package/dist/types/pda/index.d.ts.map +1 -1
  241. package/dist/types/pda/srsly.d.ts +7 -0
  242. package/dist/types/pda/srsly.d.ts.map +1 -1
  243. package/dist/types/utils/addresses.d.ts +5 -1
  244. package/dist/types/utils/addresses.d.ts.map +1 -1
  245. package/dist/types/utils/signer.d.ts +2 -2
  246. package/dist/types/utils/signer.d.ts.map +1 -1
  247. package/dist/types/version.d.ts +1 -1
  248. package/package.json +25 -19
  249. package/dist/cjs/generated/codama/instructions/claimContractPayments.js.map +0 -1
  250. package/dist/cjs/generated/codama/instructions/closeBorrower.js +0 -84
  251. package/dist/cjs/generated/codama/instructions/closeBorrower.js.map +0 -1
  252. package/dist/cjs/generated/codama/instructions/deleteBorrower.js +0 -126
  253. package/dist/cjs/generated/codama/instructions/deleteBorrower.js.map +0 -1
  254. package/dist/cjs/generated/codama/instructions/discountBorrower.js +0 -118
  255. package/dist/cjs/generated/codama/instructions/discountBorrower.js.map +0 -1
  256. package/dist/cjs/generated/codama/types/borrowerDiscountSet.js +0 -29
  257. package/dist/cjs/generated/codama/types/borrowerDiscountSet.js.map +0 -1
  258. package/dist/cjs/instructions/claimContractPayments.js +0 -79
  259. package/dist/cjs/instructions/claimContractPayments.js.map +0 -1
  260. package/dist/cjs/instructions/closeBorrower.js +0 -60
  261. package/dist/cjs/instructions/closeBorrower.js.map +0 -1
  262. package/dist/cjs/instructions/deleteBorrower.js +0 -60
  263. package/dist/cjs/instructions/deleteBorrower.js.map +0 -1
  264. package/dist/cjs/instructions/discountBorrower.js +0 -76
  265. package/dist/cjs/instructions/discountBorrower.js.map +0 -1
  266. package/dist/esm/generated/codama/instructions/claimContractPayments.js.map +0 -1
  267. package/dist/esm/generated/codama/instructions/closeBorrower.js +0 -75
  268. package/dist/esm/generated/codama/instructions/closeBorrower.js.map +0 -1
  269. package/dist/esm/generated/codama/instructions/deleteBorrower.js +0 -116
  270. package/dist/esm/generated/codama/instructions/deleteBorrower.js.map +0 -1
  271. package/dist/esm/generated/codama/instructions/discountBorrower.js +0 -108
  272. package/dist/esm/generated/codama/instructions/discountBorrower.js.map +0 -1
  273. package/dist/esm/generated/codama/types/borrowerDiscountSet.js +0 -24
  274. package/dist/esm/generated/codama/types/borrowerDiscountSet.js.map +0 -1
  275. package/dist/esm/instructions/claimContractPayments.js +0 -76
  276. package/dist/esm/instructions/claimContractPayments.js.map +0 -1
  277. package/dist/esm/instructions/closeBorrower.js +0 -57
  278. package/dist/esm/instructions/closeBorrower.js.map +0 -1
  279. package/dist/esm/instructions/deleteBorrower.js +0 -57
  280. package/dist/esm/instructions/deleteBorrower.js.map +0 -1
  281. package/dist/esm/instructions/discountBorrower.js +0 -73
  282. package/dist/esm/instructions/discountBorrower.js.map +0 -1
  283. package/dist/types/generated/codama/instructions/claimContractPayments.d.ts +0 -98
  284. package/dist/types/generated/codama/instructions/claimContractPayments.d.ts.map +0 -1
  285. package/dist/types/generated/codama/instructions/closeBorrower.d.ts +0 -43
  286. package/dist/types/generated/codama/instructions/closeBorrower.d.ts.map +0 -1
  287. package/dist/types/generated/codama/instructions/deleteBorrower.d.ts +0 -55
  288. package/dist/types/generated/codama/instructions/deleteBorrower.d.ts.map +0 -1
  289. package/dist/types/generated/codama/instructions/discountBorrower.d.ts +0 -56
  290. package/dist/types/generated/codama/instructions/discountBorrower.d.ts.map +0 -1
  291. package/dist/types/generated/codama/types/borrowerDiscountSet.d.ts +0 -20
  292. package/dist/types/generated/codama/types/borrowerDiscountSet.d.ts.map +0 -1
  293. package/dist/types/instructions/claimContractPayments.d.ts +0 -78
  294. package/dist/types/instructions/claimContractPayments.d.ts.map +0 -1
  295. package/dist/types/instructions/closeBorrower.d.ts +0 -45
  296. package/dist/types/instructions/closeBorrower.d.ts.map +0 -1
  297. package/dist/types/instructions/deleteBorrower.d.ts +0 -53
  298. package/dist/types/instructions/deleteBorrower.d.ts.map +0 -1
  299. package/dist/types/instructions/discountBorrower.d.ts +0 -64
  300. package/dist/types/instructions/discountBorrower.d.ts.map +0 -1
@@ -1,79 +0,0 @@
1
- "use strict";
2
- /**
3
- * @purpose Simplified claimContractPayments instruction wrapper
4
- *
5
- * Thin convenience wrapper around Codama-generated claimContractPayments instruction.
6
- * Allows contract owners to claim accumulated rental payments.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.claimContractPayments = claimContractPayments;
10
- const kit_1 = require("@solana/kit");
11
- const instructions_1 = require("../generated/codama/instructions");
12
- const config_1 = require("../utils/config");
13
- const signer_1 = require("../utils/signer");
14
- const instructions_2 = require("../utils/instructions");
15
- /**
16
- * Claim contract payments
17
- *
18
- * Allows the contract owner to claim accumulated rental payments from
19
- * the contract's token account to their destination account.
20
- * Can be automated via Antegen by creating a thread with authority as the contract owner.
21
- *
22
- * @param params - Payment claim parameters
23
- * @param config - Optional SDK configuration overrides
24
- * @returns Kit instruction (or web3.js if PublicKey in config)
25
- *
26
- * @example
27
- * ```typescript
28
- * // Manual claim (owner signs as payer)
29
- * const ix = await claimContractPayments({
30
- * payer: ownerWallet,
31
- * owner: ownerWallet.address,
32
- * contract: contractAddress
33
- * });
34
- *
35
- * // Automated claim via Antegen thread
36
- * const ix2 = await claimContractPayments({
37
- * payer: threadSigner,
38
- * owner: ownerAddress,
39
- * contract: contractAddress,
40
- * claimThread: threadAddress
41
- * });
42
- * ```
43
- */
44
- async function claimContractPayments(params, config) {
45
- // Merge config
46
- const finalConfig = (0, config_1.mergeConfig)(config);
47
- // Validate required params
48
- if (!params.payer) {
49
- throw new Error('payer is required');
50
- }
51
- if (!params.owner) {
52
- throw new Error('owner is required');
53
- }
54
- if (!params.contract) {
55
- throw new Error('contract is required');
56
- }
57
- // Convert payer to transaction signer
58
- const payerSigner = (0, signer_1.toTransactionSigner)(params.payer);
59
- // Get network-specific addresses
60
- const addresses = (0, config_1.getAddresses)(config);
61
- const atlasMint = (0, kit_1.address)(addresses.atlasMint);
62
- const programAddress = (0, kit_1.address)(addresses.srsly);
63
- // Call Codama-generated instruction
64
- const kitInstruction = await (0, instructions_1.getClaimContractPaymentsInstructionAsync)({
65
- payer: payerSigner,
66
- mint: atlasMint,
67
- owner: (0, kit_1.address)(params.owner),
68
- contract: (0, kit_1.address)(params.contract),
69
- destinationTokenAccount: params.destinationTokenAccount
70
- ? (0, kit_1.address)(params.destinationTokenAccount)
71
- : undefined,
72
- claimThread: params.claimThread ? (0, kit_1.address)(params.claimThread) : undefined,
73
- }, { programAddress });
74
- return (0, instructions_2.prepareInstructions)(kitInstruction, {
75
- computeUnits: params.computeUnits,
76
- PublicKey: finalConfig.PublicKey
77
- });
78
- }
79
- //# sourceMappingURL=claimContractPayments.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claimContractPayments.js","sourceRoot":"","sources":["../../../src/instructions/claimContractPayments.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAiFH,sDA6CC;AA5HD,qCAAoD;AACpD,mEAA4F;AAC5F,4CAA4E;AAC5E,4CAA4E;AAE5E,wDAA4D;AA6C5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACI,KAAK,UAAU,qBAAqB,CACzC,MAAmC,EACnC,MAA2B;IAE3B,eAAe;IACf,MAAM,WAAW,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,CAAC;IAExC,2BAA2B;IAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC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@
1
- "use strict";
2
- /**
3
- * @purpose Simplified closeBorrower instruction wrapper
4
- *
5
- * Thin convenience wrapper around Codama-generated closeBorrower instruction.
6
- * Closes the borrower account and reclaims rent.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.closeBorrower = closeBorrower;
10
- const kit_1 = require("@solana/kit");
11
- const instructions_1 = require("../generated/codama/instructions");
12
- const config_1 = require("../utils/config");
13
- const signer_1 = require("../utils/signer");
14
- const instructions_2 = require("../utils/instructions");
15
- const srsly_1 = require("../pda/srsly");
16
- /**
17
- * Close borrower account
18
- *
19
- * Closes the borrower account and reclaims rent.
20
- *
21
- * This function automatically derives the borrower state PDA.
22
- *
23
- * @param params - Close borrower parameters
24
- * @param config - Optional SDK configuration overrides
25
- * @returns Kit instruction (or web3.js if PublicKey in config)
26
- *
27
- * @example
28
- * ```typescript
29
- * // Close borrower account
30
- * const ix = await closeBorrower({
31
- * borrower: borrowerWallet
32
- * });
33
- * ```
34
- */
35
- async function closeBorrower(params, config) {
36
- // Merge config
37
- const finalConfig = (0, config_1.mergeConfig)(config);
38
- // Validate required params
39
- if (!params.borrower) {
40
- throw new Error('borrower is required');
41
- }
42
- // Convert borrower to transaction signer
43
- const borrowerSigner = (0, signer_1.toTransactionSigner)(params.borrower);
44
- const borrowerAddress = (0, signer_1.getSignerAddress)(borrowerSigner);
45
- // Get network-specific addresses
46
- const addresses = (0, config_1.getAddresses)(config);
47
- const programAddress = (0, kit_1.address)(addresses.srsly);
48
- // Derive borrower state PDA
49
- const borrowerState = await (0, srsly_1.deriveBorrowerState)(borrowerAddress);
50
- // Call Codama-generated instruction (sync version - no async derivation)
51
- const kitInstruction = (0, instructions_1.getCloseBorrowerInstruction)({
52
- borrower: borrowerSigner,
53
- borrowerState,
54
- }, { programAddress });
55
- return (0, instructions_2.prepareInstructions)(kitInstruction, {
56
- computeUnits: params.computeUnits,
57
- PublicKey: finalConfig.PublicKey
58
- });
59
- }
60
- //# sourceMappingURL=closeBorrower.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"closeBorrower.js","sourceRoot":"","sources":["../../../src/instructions/closeBorrower.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA8CH,sCAoCC;AAhFD,qCAAoD;AACpD,mEAA+E;AAC/E,4CAA4E;AAC5E,4CAA8F;AAE9F,wDAA4D;AAC5D,wCAAmD;AAmBnD;;;;;;;;;;;;;;;;;;GAkBG;AACI,KAAK,UAAU,aAAa,CACjC,MAA2B,EAC3B,MAA2B;IAE3B,eAAe;IACf,MAAM,WAAW,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,CAAC;IAExC,2BAA2B;IAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED,yCAAyC;IACzC,MAAM,cAAc,GAAG,IAAA,4BAAmB,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5D,MAAM,eAAe,GAAG,IAAA,yBAAgB,EAAC,cAAc,CAAC,CAAC;IAEzD,iCAAiC;IACjC,MAAM,SAAS,GAAG,IAAA,qBAAY,EAAC,MAAM,CAAC,CAAC;IACvC,MAAM,cAAc,GAAG,IAAA,aAAO,EAAC,SAAS,CAAC,KAAgB,CAAC,CAAC;IAE3D,4BAA4B;IAC5B,MAAM,aAAa,GAAG,MAAM,IAAA,2BAAmB,EAAC,eAAe,CAAC,CAAC;IAEjE,yEAAyE;IACzE,MAAM,cAAc,GAAG,IAAA,0CAA2B,EAChD;QACE,QAAQ,EAAE,cAAc;QACxB,aAAa;KACd,EACD,EAAE,cAAc,EAAE,CACnB,CAAC;IAEF,OAAO,IAAA,kCAAmB,EAAC,cAAc,EAAE;QACzC,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,SAAS,EAAE,WAAW,CAAC,SAAS;KACjC,CAAC,CAAC;AACL,CAAC"}
@@ -1,60 +0,0 @@
1
- "use strict";
2
- /**
3
- * @purpose Simplified deleteBorrower instruction wrapper
4
- *
5
- * Thin convenience wrapper around Codama-generated deleteBorrower instruction.
6
- * Allows admin OR borrower to delete borrower state for schema migrations.
7
- * Returns lamports to the borrower. Next rental will lazy-init fresh state.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.deleteBorrower = deleteBorrower;
11
- const kit_1 = require("@solana/kit");
12
- const instructions_1 = require("../generated/codama/instructions");
13
- const config_1 = require("../utils/config");
14
- const signer_1 = require("../utils/signer");
15
- const instructions_2 = require("../utils/instructions");
16
- /**
17
- * Delete borrower state (admin only)
18
- *
19
- * Used for schema migrations when BorrowerState structure changes.
20
- * Returns lamports to the borrower. Next rental will lazy-init fresh state.
21
- *
22
- * @param params - Delete borrower parameters
23
- * @param config - Optional SDK configuration overrides
24
- * @returns Kit instruction (or web3.js if PublicKey in config)
25
- *
26
- * @example
27
- * ```typescript
28
- * // Admin deletes borrower state for migration
29
- * const ix = await deleteBorrower({
30
- * admin: adminWallet,
31
- * borrower: "BORROWER_WALLET_ADDRESS"
32
- * });
33
- * ```
34
- */
35
- async function deleteBorrower(params, config) {
36
- // Merge config
37
- const finalConfig = (0, config_1.mergeConfig)(config);
38
- // Validate required params
39
- if (!params.admin) {
40
- throw new Error('admin is required');
41
- }
42
- if (!params.borrower) {
43
- throw new Error('borrower is required');
44
- }
45
- // Convert admin to transaction signer
46
- const adminSigner = (0, signer_1.toTransactionSigner)(params.admin);
47
- // Get network-specific addresses
48
- const addresses = (0, config_1.getAddresses)(config);
49
- const programAddress = (0, kit_1.address)(addresses.srsly);
50
- // Call Codama-generated instruction
51
- const kitInstruction = await (0, instructions_1.getDeleteBorrowerInstructionAsync)({
52
- admin: adminSigner,
53
- borrower: (0, kit_1.address)(params.borrower)
54
- }, { programAddress });
55
- return (0, instructions_2.prepareInstructions)(kitInstruction, {
56
- computeUnits: params.computeUnits,
57
- PublicKey: finalConfig.PublicKey
58
- });
59
- }
60
- //# sourceMappingURL=deleteBorrower.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deleteBorrower.js","sourceRoot":"","sources":["../../../src/instructions/deleteBorrower.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAmDH,wCAmCC;AApFD,qCAAoD;AACpD,mEAAqF;AACrF,4CAA4E;AAC5E,4CAA4E;AAC5E,wDAA4D;AA0B5D;;;;;;;;;;;;;;;;;;GAkBG;AACI,KAAK,UAAU,cAAc,CAClC,MAA4B,EAC5B,MAA2B;IAE3B,eAAe;IACf,MAAM,WAAW,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,CAAC;IAExC,2BAA2B;IAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED,sCAAsC;IACtC,MAAM,WAAW,GAAG,IAAA,4BAAmB,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAEtD,iCAAiC;IACjC,MAAM,SAAS,GAAG,IAAA,qBAAY,EAAC,MAAM,CAAC,CAAC;IACvC,MAAM,cAAc,GAAG,IAAA,aAAO,EAAC,SAAS,CAAC,KAAgB,CAAC,CAAC;IAE3D,oCAAoC;IACpC,MAAM,cAAc,GAAG,MAAM,IAAA,gDAAiC,EAC5D;QACE,KAAK,EAAE,WAAW;QAClB,QAAQ,EAAE,IAAA,aAAO,EAAC,MAAM,CAAC,QAAmB,CAAC;KAC9C,EACD,EAAE,cAAc,EAAE,CACnB,CAAC;IAEF,OAAO,IAAA,kCAAmB,EAAC,cAAc,EAAE;QACzC,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,SAAS,EAAE,WAAW,CAAC,SAAS;KACjC,CAAC,CAAC;AACL,CAAC"}
@@ -1,76 +0,0 @@
1
- "use strict";
2
- /**
3
- * @purpose Simplified discountBorrower instruction wrapper
4
- *
5
- * Thin convenience wrapper around Codama-generated discountBorrower instruction.
6
- * Admin-only instruction to apply a discount to a specific borrower.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.discountBorrower = discountBorrower;
10
- const kit_1 = require("@solana/kit");
11
- const instructions_1 = require("../generated/codama/instructions");
12
- const config_1 = require("../utils/config");
13
- const signer_1 = require("../utils/signer");
14
- const srsly_1 = require("../pda/srsly");
15
- const instructions_2 = require("../utils/instructions");
16
- const slyvault_1 = require("@wuwei-labs/slyvault");
17
- /**
18
- * Apply discount to borrower
19
- *
20
- * Admin-only instruction that applies a discount to a specific borrower.
21
- * The discount is specified in basis points (1 basis point = 0.01%).
22
- *
23
- * @param params - Discount parameters
24
- * @param config - Optional SDK configuration overrides
25
- * @returns Kit instruction (or web3.js if PublicKey in config)
26
- *
27
- * @example
28
- * ```typescript
29
- * // Apply 10% discount
30
- * const ix = await discountBorrower({
31
- * admin: adminWallet,
32
- * borrower: borrowerAddress,
33
- * discount: 10
34
- * });
35
- *
36
- * // Remove discount
37
- * const ix2 = await discountBorrower({
38
- * admin: adminWallet,
39
- * borrower: borrowerAddress,
40
- * discount: null
41
- * });
42
- * ```
43
- */
44
- async function discountBorrower(params, config) {
45
- // Merge config
46
- const finalConfig = (0, config_1.mergeConfig)(config);
47
- // Validate required params
48
- if (!params.admin) {
49
- throw new Error('admin is required');
50
- }
51
- if (!params.borrower) {
52
- throw new Error('borrower is required');
53
- }
54
- // Convert admin to transaction signer
55
- const adminSigner = (0, signer_1.toTransactionSigner)(params.admin);
56
- // Derive borrower state PDA
57
- const borrowerState = await (0, srsly_1.deriveBorrowerState)(params.borrower);
58
- // Get network-specific addresses
59
- const addresses = (0, config_1.getAddresses)(config);
60
- const programAddress = (0, kit_1.address)(addresses.srsly);
61
- // Convert percentage to BPS Option<number>
62
- const discountBps = params.discount === null || params.discount === undefined
63
- ? (0, kit_1.none)()
64
- : (0, kit_1.some)((0, slyvault_1.percentToBps)(params.discount));
65
- // Call Codama-generated instruction
66
- const kitInstruction = await (0, instructions_1.getDiscountBorrowerInstructionAsync)({
67
- admin: adminSigner,
68
- borrowerState,
69
- discountBps,
70
- }, { programAddress });
71
- return (0, instructions_2.prepareInstructions)(kitInstruction, {
72
- computeUnits: params.computeUnits,
73
- PublicKey: finalConfig.PublicKey
74
- });
75
- }
76
- //# sourceMappingURL=discountBorrower.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discountBorrower.js","sourceRoot":"","sources":["../../../src/instructions/discountBorrower.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAmEH,4CA6CC;AA9GD,qCAAgE;AAChE,mEAAuF;AACvF,4CAA4E;AAC5E,4CAA4E;AAE5E,wCAAmD;AACnD,wDAA4D;AAC5D,mDAAoD;AA+BpD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,KAAK,UAAU,gBAAgB,CACpC,MAA8B,EAC9B,MAA2B;IAE3B,eAAe;IACf,MAAM,WAAW,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,CAAC;IAExC,2BAA2B;IAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED,sCAAsC;IACtC,MAAM,WAAW,GAAG,IAAA,4BAAmB,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAEtD,4BAA4B;IAC5B,MAAM,aAAa,GAAG,MAAM,IAAA,2BAAmB,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAEjE,iCAAiC;IACjC,MAAM,SAAS,GAAG,IAAA,qBAAY,EAAC,MAAM,CAAC,CAAC;IACvC,MAAM,cAAc,GAAG,IAAA,aAAO,EAAC,SAAS,CAAC,KAAgB,CAAC,CAAC;IAE3D,2CAA2C;IAC3C,MAAM,WAAW,GACf,MAAM,CAAC,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS;QACvD,CAAC,CAAC,IAAA,UAAI,GAAU;QAChB,CAAC,CAAC,IAAA,UAAI,EAAS,IAAA,uBAAY,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAElD,oCAAoC;IACpC,MAAM,cAAc,GAAG,MAAM,IAAA,kDAAmC,EAC9D;QACE,KAAK,EAAE,WAAW;QAClB,aAAa;QACb,WAAW;KACZ,EACD,EAAE,cAAc,EAAE,CACnB,CAAC;IAEF,OAAO,IAAA,kCAAmB,EAAC,cAAc,EAAE;QACzC,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,SAAS,EAAE,WAAW,CAAC,SAAS;KACjC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"claimContractPayments.js","sourceRoot":"","sources":["../../../../../src/generated/codama/instructions/claimContractPayments.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAejB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,aAAa,EACb,qBAAqB,GAEtB,MAAM,WAAW,CAAC;AAEnB,MAAM,CAAC,MAAM,qCAAqC,GAAG,IAAI,UAAU,CAAC;IAClE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG;CACpC,CAAC,CAAC;AAEH,MAAM,UAAU,0CAA0C;IACxD,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAChD,qCAAqC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,75 +0,0 @@
1
- /**
2
- * This code was AUTOGENERATED using the Codama library.
3
- * Please DO NOT EDIT THIS FILE, instead use visitors
4
- * to add features, then rerun Codama to update it.
5
- *
6
- * @see https://github.com/codama-idl/codama
7
- */
8
- import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, transformEncoder, } from "@solana/kit";
9
- import { SRSLY_PROGRAM_ADDRESS } from "../programs";
10
- import { getAccountMetaFactory } from "../shared";
11
- export const CLOSE_BORROWER_DISCRIMINATOR = new Uint8Array([
12
- 136, 79, 95, 44, 18, 151, 73, 199,
13
- ]);
14
- export function getCloseBorrowerDiscriminatorBytes() {
15
- return fixEncoderSize(getBytesEncoder(), 8).encode(CLOSE_BORROWER_DISCRIMINATOR);
16
- }
17
- export function getCloseBorrowerInstructionDataEncoder() {
18
- return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({ ...value, discriminator: CLOSE_BORROWER_DISCRIMINATOR }));
19
- }
20
- export function getCloseBorrowerInstructionDataDecoder() {
21
- return getStructDecoder([
22
- ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
23
- ]);
24
- }
25
- export function getCloseBorrowerInstructionDataCodec() {
26
- return combineCodec(getCloseBorrowerInstructionDataEncoder(), getCloseBorrowerInstructionDataDecoder());
27
- }
28
- export function getCloseBorrowerInstruction(input, config) {
29
- // Program address.
30
- const programAddress = config?.programAddress ?? SRSLY_PROGRAM_ADDRESS;
31
- // Original accounts.
32
- const originalAccounts = {
33
- borrower: { value: input.borrower ?? null, isWritable: true },
34
- borrowerState: { value: input.borrowerState ?? null, isWritable: true },
35
- systemProgram: { value: input.systemProgram ?? null, isWritable: false },
36
- };
37
- const accounts = originalAccounts;
38
- // Resolve default values.
39
- if (!accounts.systemProgram.value) {
40
- accounts.systemProgram.value =
41
- "11111111111111111111111111111111";
42
- }
43
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
44
- return Object.freeze({
45
- accounts: [
46
- getAccountMeta(accounts.borrower),
47
- getAccountMeta(accounts.borrowerState),
48
- getAccountMeta(accounts.systemProgram),
49
- ],
50
- data: getCloseBorrowerInstructionDataEncoder().encode({}),
51
- programAddress,
52
- });
53
- }
54
- export function parseCloseBorrowerInstruction(instruction) {
55
- if (instruction.accounts.length < 3) {
56
- // TODO: Coded error.
57
- throw new Error("Not enough accounts");
58
- }
59
- let accountIndex = 0;
60
- const getNextAccount = () => {
61
- const accountMeta = instruction.accounts[accountIndex];
62
- accountIndex += 1;
63
- return accountMeta;
64
- };
65
- return {
66
- programAddress: instruction.programAddress,
67
- accounts: {
68
- borrower: getNextAccount(),
69
- borrowerState: getNextAccount(),
70
- systemProgram: getNextAccount(),
71
- },
72
- data: getCloseBorrowerInstructionDataDecoder().decode(instruction.data),
73
- };
74
- }
75
- //# sourceMappingURL=closeBorrower.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"closeBorrower.js","sourceRoot":"","sources":["../../../../../src/generated/codama/instructions/closeBorrower.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAejB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAwB,MAAM,WAAW,CAAC;AAExE,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,UAAU,CAAC;IACzD,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG;CAClC,CAAC,CAAC;AAEH,MAAM,UAAU,kCAAkC;IAChD,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAChD,4BAA4B,CAC7B,CAAC;AACJ,CAAC;AAiCD,MAAM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,EAAE,WAAW,CAAC,CAAC;IAC1E,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,QAAQ,EAAE;YACR,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACjC,cAAc,CAAC,QAAQ,CAAC,aAAa,CAAC;YACtC,cAAc,CAAC,QAAQ,CAAC,aAAa,CAAC;SACvC;QACD,IAAI,EAAE,sCAAsC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;QACzD,cAAc;KAMf,CAAC,CAAC;AACL,CAAC;AAeD,MAAM,UAAU,6BAA6B,CAI3C,WAEyC;IAEzC,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,qBAAqB;QACrB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACzC,CAAC;IACD,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,MAAM,WAAW,GAAI,WAAW,CAAC,QAA0B,CAAC,YAAY,CAAE,CAAC;QAC3E,YAAY,IAAI,CAAC,CAAC;QAClB,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IACF,OAAO;QACL,cAAc,EAAE,WAAW,CAAC,cAAc;QAC1C,QAAQ,EAAE;YACR,QAAQ,EAAE,cAAc,EAAE;YAC1B,aAAa,EAAE,cAAc,EAAE;YAC/B,aAAa,EAAE,cAAc,EAAE;SAChC;QACD,IAAI,EAAE,sCAAsC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;KACxE,CAAC;AACJ,CAAC"}
@@ -1,116 +0,0 @@
1
- /**
2
- * This code was AUTOGENERATED using the Codama library.
3
- * Please DO NOT EDIT THIS FILE, instead use visitors
4
- * to add features, then rerun Codama to update it.
5
- *
6
- * @see https://github.com/codama-idl/codama
7
- */
8
- import { combineCodec, fixDecoderSize, fixEncoderSize, getAddressEncoder, getBytesDecoder, getBytesEncoder, getProgramDerivedAddress, getStructDecoder, getStructEncoder, transformEncoder, } from "@solana/kit";
9
- import { SRSLY_PROGRAM_ADDRESS } from "../programs";
10
- import { expectAddress, getAccountMetaFactory, } from "../shared";
11
- export const DELETE_BORROWER_DISCRIMINATOR = new Uint8Array([
12
- 89, 147, 185, 127, 231, 56, 190, 45,
13
- ]);
14
- export function getDeleteBorrowerDiscriminatorBytes() {
15
- return fixEncoderSize(getBytesEncoder(), 8).encode(DELETE_BORROWER_DISCRIMINATOR);
16
- }
17
- export function getDeleteBorrowerInstructionDataEncoder() {
18
- return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({ ...value, discriminator: DELETE_BORROWER_DISCRIMINATOR }));
19
- }
20
- export function getDeleteBorrowerInstructionDataDecoder() {
21
- return getStructDecoder([
22
- ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
23
- ]);
24
- }
25
- export function getDeleteBorrowerInstructionDataCodec() {
26
- return combineCodec(getDeleteBorrowerInstructionDataEncoder(), getDeleteBorrowerInstructionDataDecoder());
27
- }
28
- export async function getDeleteBorrowerInstructionAsync(input, config) {
29
- // Program address.
30
- const programAddress = config?.programAddress ?? SRSLY_PROGRAM_ADDRESS;
31
- // Original accounts.
32
- const originalAccounts = {
33
- admin: { value: input.admin ?? null, isWritable: true },
34
- config: { value: input.config ?? null, isWritable: false },
35
- borrower: { value: input.borrower ?? null, isWritable: true },
36
- borrowerState: { value: input.borrowerState ?? null, isWritable: true },
37
- };
38
- const accounts = originalAccounts;
39
- // Resolve default values.
40
- if (!accounts.config.value) {
41
- accounts.config.value = await getProgramDerivedAddress({
42
- programAddress,
43
- seeds: [
44
- getBytesEncoder().encode(new Uint8Array([99, 111, 110, 102, 105, 103])),
45
- ],
46
- });
47
- }
48
- if (!accounts.borrowerState.value) {
49
- accounts.borrowerState.value = await getProgramDerivedAddress({
50
- programAddress,
51
- seeds: [
52
- getBytesEncoder().encode(new Uint8Array([
53
- 98, 111, 114, 114, 111, 119, 101, 114, 95, 115, 116, 97, 116, 101,
54
- ])),
55
- getAddressEncoder().encode(expectAddress(accounts.borrower.value)),
56
- ],
57
- });
58
- }
59
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
60
- return Object.freeze({
61
- accounts: [
62
- getAccountMeta(accounts.admin),
63
- getAccountMeta(accounts.config),
64
- getAccountMeta(accounts.borrower),
65
- getAccountMeta(accounts.borrowerState),
66
- ],
67
- data: getDeleteBorrowerInstructionDataEncoder().encode({}),
68
- programAddress,
69
- });
70
- }
71
- export function getDeleteBorrowerInstruction(input, config) {
72
- // Program address.
73
- const programAddress = config?.programAddress ?? SRSLY_PROGRAM_ADDRESS;
74
- // Original accounts.
75
- const originalAccounts = {
76
- admin: { value: input.admin ?? null, isWritable: true },
77
- config: { value: input.config ?? null, isWritable: false },
78
- borrower: { value: input.borrower ?? null, isWritable: true },
79
- borrowerState: { value: input.borrowerState ?? null, isWritable: true },
80
- };
81
- const accounts = originalAccounts;
82
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
83
- return Object.freeze({
84
- accounts: [
85
- getAccountMeta(accounts.admin),
86
- getAccountMeta(accounts.config),
87
- getAccountMeta(accounts.borrower),
88
- getAccountMeta(accounts.borrowerState),
89
- ],
90
- data: getDeleteBorrowerInstructionDataEncoder().encode({}),
91
- programAddress,
92
- });
93
- }
94
- export function parseDeleteBorrowerInstruction(instruction) {
95
- if (instruction.accounts.length < 4) {
96
- // TODO: Coded error.
97
- throw new Error("Not enough accounts");
98
- }
99
- let accountIndex = 0;
100
- const getNextAccount = () => {
101
- const accountMeta = instruction.accounts[accountIndex];
102
- accountIndex += 1;
103
- return accountMeta;
104
- };
105
- return {
106
- programAddress: instruction.programAddress,
107
- accounts: {
108
- admin: getNextAccount(),
109
- config: getNextAccount(),
110
- borrower: getNextAccount(),
111
- borrowerState: getNextAccount(),
112
- },
113
- data: getDeleteBorrowerInstructionDataDecoder().decode(instruction.data),
114
- };
115
- }
116
- //# sourceMappingURL=deleteBorrower.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deleteBorrower.js","sourceRoot":"","sources":["../../../../../src/generated/codama/instructions/deleteBorrower.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAejB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,aAAa,EACb,qBAAqB,GAEtB,MAAM,WAAW,CAAC;AAEnB,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,UAAU,CAAC;IAC1D,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE;CACpC,CAAC,CAAC;AAEH,MAAM,UAAU,mCAAmC;IACjD,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAChD,6BAA6B,CAC9B,CAAC;AACJ,CAAC;AAoCD,MAAM,UAAU,uCAAuC;IACrD,OAAO,gBAAgB,CACrB,gBAAgB,CAAC,CAAC,CAAC,eAAe,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAC3E,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,6BAA6B,EAAE,CAAC,CACxE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uCAAuC;IACrD,OAAO,gBAAgB,CAAC;QACtB,CAAC,eAAe,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;KACxD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,qCAAqC;IAInD,OAAO,YAAY,CACjB,uCAAuC,EAAE,EACzC,uCAAuC,EAAE,CAC1C,CAAC;AACJ,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OT EDIT THIS FILE, instead use visitors
4
- * to add features, then rerun Codama to update it.
5
- *
6
- * @see https://github.com/codama-idl/codama
7
- */
8
- import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getOptionDecoder, getOptionEncoder, getProgramDerivedAddress, getStructDecoder, getStructEncoder, getU16Decoder, getU16Encoder, transformEncoder, } from "@solana/kit";
9
- import { SRSLY_PROGRAM_ADDRESS } from "../programs";
10
- import { getAccountMetaFactory } from "../shared";
11
- export const DISCOUNT_BORROWER_DISCRIMINATOR = new Uint8Array([
12
- 110, 191, 200, 109, 103, 39, 185, 141,
13
- ]);
14
- export function getDiscountBorrowerDiscriminatorBytes() {
15
- return fixEncoderSize(getBytesEncoder(), 8).encode(DISCOUNT_BORROWER_DISCRIMINATOR);
16
- }
17
- export function getDiscountBorrowerInstructionDataEncoder() {
18
- return transformEncoder(getStructEncoder([
19
- ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
20
- ["discountBps", getOptionEncoder(getU16Encoder())],
21
- ]), (value) => ({ ...value, discriminator: DISCOUNT_BORROWER_DISCRIMINATOR }));
22
- }
23
- export function getDiscountBorrowerInstructionDataDecoder() {
24
- return getStructDecoder([
25
- ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
26
- ["discountBps", getOptionDecoder(getU16Decoder())],
27
- ]);
28
- }
29
- export function getDiscountBorrowerInstructionDataCodec() {
30
- return combineCodec(getDiscountBorrowerInstructionDataEncoder(), getDiscountBorrowerInstructionDataDecoder());
31
- }
32
- export async function getDiscountBorrowerInstructionAsync(input, config) {
33
- // Program address.
34
- const programAddress = config?.programAddress ?? SRSLY_PROGRAM_ADDRESS;
35
- // Original accounts.
36
- const originalAccounts = {
37
- admin: { value: input.admin ?? null, isWritable: true },
38
- config: { value: input.config ?? null, isWritable: false },
39
- borrowerState: { value: input.borrowerState ?? null, isWritable: true },
40
- };
41
- const accounts = originalAccounts;
42
- // Original args.
43
- const args = { ...input };
44
- // Resolve default values.
45
- if (!accounts.config.value) {
46
- accounts.config.value = await getProgramDerivedAddress({
47
- programAddress,
48
- seeds: [
49
- getBytesEncoder().encode(new Uint8Array([99, 111, 110, 102, 105, 103])),
50
- ],
51
- });
52
- }
53
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
54
- return Object.freeze({
55
- accounts: [
56
- getAccountMeta(accounts.admin),
57
- getAccountMeta(accounts.config),
58
- getAccountMeta(accounts.borrowerState),
59
- ],
60
- data: getDiscountBorrowerInstructionDataEncoder().encode(args),
61
- programAddress,
62
- });
63
- }
64
- export function getDiscountBorrowerInstruction(input, config) {
65
- // Program address.
66
- const programAddress = config?.programAddress ?? SRSLY_PROGRAM_ADDRESS;
67
- // Original accounts.
68
- const originalAccounts = {
69
- admin: { value: input.admin ?? null, isWritable: true },
70
- config: { value: input.config ?? null, isWritable: false },
71
- borrowerState: { value: input.borrowerState ?? null, isWritable: true },
72
- };
73
- const accounts = originalAccounts;
74
- // Original args.
75
- const args = { ...input };
76
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
77
- return Object.freeze({
78
- accounts: [
79
- getAccountMeta(accounts.admin),
80
- getAccountMeta(accounts.config),
81
- getAccountMeta(accounts.borrowerState),
82
- ],
83
- data: getDiscountBorrowerInstructionDataEncoder().encode(args),
84
- programAddress,
85
- });
86
- }
87
- export function parseDiscountBorrowerInstruction(instruction) {
88
- if (instruction.accounts.length < 3) {
89
- // TODO: Coded error.
90
- throw new Error("Not enough accounts");
91
- }
92
- let accountIndex = 0;
93
- const getNextAccount = () => {
94
- const accountMeta = instruction.accounts[accountIndex];
95
- accountIndex += 1;
96
- return accountMeta;
97
- };
98
- return {
99
- programAddress: instruction.programAddress,
100
- accounts: {
101
- admin: getNextAccount(),
102
- config: getNextAccount(),
103
- borrowerState: getNextAccount(),
104
- },
105
- data: getDiscountBorrowerInstructionDataDecoder().decode(instruction.data),
106
- };
107
- }
108
- //# sourceMappingURL=discountBorrower.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discountBorrower.js","sourceRoot":"","sources":["../../../../../src/generated/codama/instructions/discountBorrower.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,gBAAgB,GAiBjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAwB,MAAM,WAAW,CAAC;AAExE,MAAM,CAAC,MAAM,+BAA+B,GAAG,IAAI,UAAU,CAAC;IAC5D,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG;CACtC,CAAC,CAAC;AAEH,MAAM,UAAU,qCAAqC;IACnD,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAChD,+BAA+B,CAChC,CAAC;AACJ,CAAC;AAmCD,MAAM,UAAU,yCAAyC;IACvD,OAAO,gBAAgB,CACrB,gBAAgB,CAAC;QACf,CAAC,eAAe,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC,aAAa,EAAE,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAC;KACnD,CAAC,EACF,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,+BAA+B,EAAE,CAAC,CAC1E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yCAAyC;IACvD,OAAO,gBAAgB,CAAC;QACtB,CAAC,eAAe,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC,aAAa,EAAE,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAC;KACnD,C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