@wuwei-labs/srsly 2.0.0-beta.37 → 2.0.0-beta.41

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 (177) hide show
  1. package/README.md +2 -1
  2. package/dist/cjs/codama/accounts/config.js +0 -2
  3. package/dist/cjs/codama/accounts/config.js.map +1 -1
  4. package/dist/cjs/codama/accounts/contractState.js.map +1 -1
  5. package/dist/cjs/codama/accounts/rentalState.js +1 -3
  6. package/dist/cjs/codama/accounts/rentalState.js.map +1 -1
  7. package/dist/cjs/codama/errors/srsly.js +13 -1
  8. package/dist/cjs/codama/errors/srsly.js.map +1 -1
  9. package/dist/cjs/codama/instructions/acceptRental.js +1 -28
  10. package/dist/cjs/codama/instructions/acceptRental.js.map +1 -1
  11. package/dist/cjs/codama/instructions/closeRental.js +28 -13
  12. package/dist/cjs/codama/instructions/closeRental.js.map +1 -1
  13. package/dist/cjs/codama/instructions/index.js +1 -0
  14. package/dist/cjs/codama/instructions/index.js.map +1 -1
  15. package/dist/cjs/codama/instructions/payRental.js +1 -18
  16. package/dist/cjs/codama/instructions/payRental.js.map +1 -1
  17. package/dist/cjs/codama/instructions/resetContractTemp.js +146 -0
  18. package/dist/cjs/codama/instructions/resetContractTemp.js.map +1 -0
  19. package/dist/cjs/codama/instructions/resetRental.js +6 -1
  20. package/dist/cjs/codama/instructions/resetRental.js.map +1 -1
  21. package/dist/cjs/codama/instructions/updateConfig.js +0 -2
  22. package/dist/cjs/codama/instructions/updateConfig.js.map +1 -1
  23. package/dist/cjs/codama/programs/srsly.js +6 -2
  24. package/dist/cjs/codama/programs/srsly.js.map +1 -1
  25. package/dist/cjs/codama/types/paymentFrequency.js +31 -0
  26. package/dist/cjs/codama/types/paymentFrequency.js.map +1 -1
  27. package/dist/cjs/contract/close.js +71 -11
  28. package/dist/cjs/contract/close.js.map +1 -1
  29. package/dist/cjs/contract/create.js +88 -21
  30. package/dist/cjs/contract/create.js.map +1 -1
  31. package/dist/cjs/contract/index.js +45 -0
  32. package/dist/cjs/contract/index.js.map +1 -1
  33. package/dist/cjs/index.js +110 -7
  34. package/dist/cjs/index.js.map +1 -1
  35. package/dist/cjs/package.json +4 -4
  36. package/dist/cjs/rental/accept.js +164 -45
  37. package/dist/cjs/rental/accept.js.map +1 -1
  38. package/dist/cjs/rental/cancel.js +82 -16
  39. package/dist/cjs/rental/cancel.js.map +1 -1
  40. package/dist/cjs/rental/close.js +152 -27
  41. package/dist/cjs/rental/close.js.map +1 -1
  42. package/dist/cjs/rental/index.js +85 -0
  43. package/dist/cjs/rental/index.js.map +1 -1
  44. package/dist/cjs/rental/reset-contract-temp.js +103 -0
  45. package/dist/cjs/rental/reset-contract-temp.js.map +1 -0
  46. package/dist/cjs/rental/reset.js +102 -19
  47. package/dist/cjs/rental/reset.js.map +1 -1
  48. package/dist/cjs/utils/config.js +44 -9
  49. package/dist/cjs/utils/config.js.map +1 -1
  50. package/dist/cjs/utils/constants.js +16 -6
  51. package/dist/cjs/utils/constants.js.map +1 -1
  52. package/dist/cjs/utils/index.js +1 -0
  53. package/dist/cjs/utils/index.js.map +1 -1
  54. package/dist/cjs/utils/instruction-converter.js +60 -5
  55. package/dist/cjs/utils/instruction-converter.js.map +1 -1
  56. package/dist/cjs/utils/paymentFrequency.js +7 -2
  57. package/dist/cjs/utils/paymentFrequency.js.map +1 -1
  58. package/dist/cjs/utils/pda.js +191 -0
  59. package/dist/cjs/utils/pda.js.map +1 -0
  60. package/dist/esm/codama/accounts/config.js +0 -2
  61. package/dist/esm/codama/accounts/config.js.map +1 -1
  62. package/dist/esm/codama/accounts/contractState.js.map +1 -1
  63. package/dist/esm/codama/accounts/rentalState.js +1 -3
  64. package/dist/esm/codama/accounts/rentalState.js.map +1 -1
  65. package/dist/esm/codama/errors/srsly.js +12 -0
  66. package/dist/esm/codama/errors/srsly.js.map +1 -1
  67. package/dist/esm/codama/instructions/acceptRental.js +1 -28
  68. package/dist/esm/codama/instructions/acceptRental.js.map +1 -1
  69. package/dist/esm/codama/instructions/closeRental.js +28 -13
  70. package/dist/esm/codama/instructions/closeRental.js.map +1 -1
  71. package/dist/esm/codama/instructions/index.js +1 -0
  72. package/dist/esm/codama/instructions/index.js.map +1 -1
  73. package/dist/esm/codama/instructions/payRental.js +1 -18
  74. package/dist/esm/codama/instructions/payRental.js.map +1 -1
  75. package/dist/esm/codama/instructions/resetContractTemp.js +136 -0
  76. package/dist/esm/codama/instructions/resetContractTemp.js.map +1 -0
  77. package/dist/esm/codama/instructions/resetRental.js +6 -1
  78. package/dist/esm/codama/instructions/resetRental.js.map +1 -1
  79. package/dist/esm/codama/instructions/updateConfig.js +0 -2
  80. package/dist/esm/codama/instructions/updateConfig.js.map +1 -1
  81. package/dist/esm/codama/programs/srsly.js +6 -2
  82. package/dist/esm/codama/programs/srsly.js.map +1 -1
  83. package/dist/esm/codama/types/paymentFrequency.js +31 -0
  84. package/dist/esm/codama/types/paymentFrequency.js.map +1 -1
  85. package/dist/esm/contract/close.js +72 -12
  86. package/dist/esm/contract/close.js.map +1 -1
  87. package/dist/esm/contract/create.js +89 -22
  88. package/dist/esm/contract/create.js.map +1 -1
  89. package/dist/esm/contract/index.js +45 -0
  90. package/dist/esm/contract/index.js.map +1 -1
  91. package/dist/esm/index.js +110 -6
  92. package/dist/esm/index.js.map +1 -1
  93. package/dist/esm/package.json +4 -4
  94. package/dist/esm/rental/accept.js +166 -47
  95. package/dist/esm/rental/accept.js.map +1 -1
  96. package/dist/esm/rental/cancel.js +83 -17
  97. package/dist/esm/rental/cancel.js.map +1 -1
  98. package/dist/esm/rental/close.js +152 -27
  99. package/dist/esm/rental/close.js.map +1 -1
  100. package/dist/esm/rental/index.js +85 -0
  101. package/dist/esm/rental/index.js.map +1 -1
  102. package/dist/esm/rental/reset-contract-temp.js +100 -0
  103. package/dist/esm/rental/reset-contract-temp.js.map +1 -0
  104. package/dist/esm/rental/reset.js +102 -19
  105. package/dist/esm/rental/reset.js.map +1 -1
  106. package/dist/esm/utils/config.js +44 -9
  107. package/dist/esm/utils/config.js.map +1 -1
  108. package/dist/esm/utils/constants.js +16 -6
  109. package/dist/esm/utils/constants.js.map +1 -1
  110. package/dist/esm/utils/index.js +1 -0
  111. package/dist/esm/utils/index.js.map +1 -1
  112. package/dist/esm/utils/instruction-converter.js +59 -5
  113. package/dist/esm/utils/instruction-converter.js.map +1 -1
  114. package/dist/esm/utils/paymentFrequency.js +7 -2
  115. package/dist/esm/utils/paymentFrequency.js.map +1 -1
  116. package/dist/esm/utils/pda.js +185 -0
  117. package/dist/esm/utils/pda.js.map +1 -0
  118. package/dist/types/codama/accounts/config.d.ts +24 -2
  119. package/dist/types/codama/accounts/config.d.ts.map +1 -1
  120. package/dist/types/codama/accounts/contractState.d.ts +26 -0
  121. package/dist/types/codama/accounts/contractState.d.ts.map +1 -1
  122. package/dist/types/codama/accounts/rentalState.d.ts +20 -2
  123. package/dist/types/codama/accounts/rentalState.d.ts.map +1 -1
  124. package/dist/types/codama/errors/srsly.d.ts +9 -1
  125. package/dist/types/codama/errors/srsly.d.ts.map +1 -1
  126. package/dist/types/codama/instructions/acceptRental.d.ts +13 -20
  127. package/dist/types/codama/instructions/acceptRental.d.ts.map +1 -1
  128. package/dist/types/codama/instructions/closeRental.d.ts +33 -13
  129. package/dist/types/codama/instructions/closeRental.d.ts.map +1 -1
  130. package/dist/types/codama/instructions/index.d.ts +1 -0
  131. package/dist/types/codama/instructions/index.d.ts.map +1 -1
  132. package/dist/types/codama/instructions/payRental.d.ts +11 -18
  133. package/dist/types/codama/instructions/payRental.d.ts.map +1 -1
  134. package/dist/types/codama/instructions/resetContractTemp.d.ts +71 -0
  135. package/dist/types/codama/instructions/resetContractTemp.d.ts.map +1 -0
  136. package/dist/types/codama/instructions/resetRental.d.ts +21 -17
  137. package/dist/types/codama/instructions/resetRental.d.ts.map +1 -1
  138. package/dist/types/codama/instructions/updateConfig.d.ts +20 -4
  139. package/dist/types/codama/instructions/updateConfig.d.ts.map +1 -1
  140. package/dist/types/codama/programs/srsly.d.ts +6 -3
  141. package/dist/types/codama/programs/srsly.d.ts.map +1 -1
  142. package/dist/types/codama/types/paymentFrequency.d.ts +31 -0
  143. package/dist/types/codama/types/paymentFrequency.d.ts.map +1 -1
  144. package/dist/types/contract/close.d.ts +77 -16
  145. package/dist/types/contract/close.d.ts.map +1 -1
  146. package/dist/types/contract/create.d.ts +114 -17
  147. package/dist/types/contract/create.d.ts.map +1 -1
  148. package/dist/types/contract/index.d.ts +45 -0
  149. package/dist/types/contract/index.d.ts.map +1 -1
  150. package/dist/types/index.d.ts +111 -1
  151. package/dist/types/index.d.ts.map +1 -1
  152. package/dist/types/rental/accept.d.ts +121 -50
  153. package/dist/types/rental/accept.d.ts.map +1 -1
  154. package/dist/types/rental/cancel.d.ts +80 -16
  155. package/dist/types/rental/cancel.d.ts.map +1 -1
  156. package/dist/types/rental/close.d.ts +86 -26
  157. package/dist/types/rental/close.d.ts.map +1 -1
  158. package/dist/types/rental/index.d.ts +85 -0
  159. package/dist/types/rental/index.d.ts.map +1 -1
  160. package/dist/types/rental/reset-contract-temp.d.ts +77 -0
  161. package/dist/types/rental/reset-contract-temp.d.ts.map +1 -0
  162. package/dist/types/rental/reset.d.ts +114 -24
  163. package/dist/types/rental/reset.d.ts.map +1 -1
  164. package/dist/types/utils/config.d.ts +14 -2
  165. package/dist/types/utils/config.d.ts.map +1 -1
  166. package/dist/types/utils/constants.d.ts +1 -1
  167. package/dist/types/utils/constants.d.ts.map +1 -1
  168. package/dist/types/utils/index.d.ts +1 -0
  169. package/dist/types/utils/index.d.ts.map +1 -1
  170. package/dist/types/utils/instruction-converter.d.ts +70 -20
  171. package/dist/types/utils/instruction-converter.d.ts.map +1 -1
  172. package/dist/types/utils/paymentFrequency.d.ts +3 -3
  173. package/dist/types/utils/paymentFrequency.d.ts.map +1 -1
  174. package/dist/types/utils/pda.d.ts +120 -0
  175. package/dist/types/utils/pda.d.ts.map +1 -0
  176. package/package.json +5 -5
  177. package/target/idl/srsly.json +318 -94
@@ -1,51 +1,111 @@
1
1
  import { type ConfigSelector } from '../utils/config';
2
+ import { type FluentInstruction, type SmartFluentConfigSelector } from '../utils/instruction-converter';
2
3
  type UniversalAddress = string;
3
- type CloseRentalInstruction = any;
4
+ type UniversalSigner = any;
4
5
  /**
5
- * Simplified parameters for closing a rental - strings only!
6
+ * Parameters for closing a completed rental.
7
+ *
8
+ * This interface defines the required parameters for closing a rental that has
9
+ * reached its expiration or been fully paid. Closing a rental finalizes the
10
+ * rental period, transfers any remaining funds, and cleans up the rental state.
11
+ *
12
+ * @interface CloseRentalParams
6
13
  */
7
14
  export interface CloseRentalParams {
8
15
  /**
9
- * The borrower address (not a signer in this transaction)
16
+ * The payer for transaction fees (must be a signer object).
17
+ * This account will pay for the transaction and receive any lamports
18
+ * from closed accounts.
10
19
  */
11
- borrower: UniversalAddress;
20
+ payer: UniversalSigner;
12
21
  /**
13
- * The owner's token account address for receiving ATLAS
22
+ * String address of the rental state to close.
23
+ * This is the unique rental state account that tracks the rental.
14
24
  */
15
- ownerTokenAccount: UniversalAddress;
16
- /**
17
- * The rental contract account address
18
- */
19
- contract: UniversalAddress;
25
+ rentalStateAddress: UniversalAddress;
20
26
  }
21
27
  /**
22
- * Creates an instruction to close a rental with fluent configuration.
28
+ * Creates an instruction to close a completed rental with fluent configuration.
29
+ *
30
+ * This function finalizes a rental that has reached its expiration or been fully paid.
31
+ * It transfers any remaining funds to the owner, returns fleet control, and cleans up
32
+ * the rental state account. This instruction can be called by anyone once the rental
33
+ * period has ended.
34
+ *
35
+ * ## Features
36
+ *
37
+ * - **Rental Finalization**: Properly closes completed or expired rentals
38
+ * - **Fund Transfer**: Moves any remaining payments or deposits to the owner
39
+ * - **Fleet Return**: Ensures fleet ownership is returned to the original owner
40
+ * - **State Cleanup**: Closes rental state account and returns lamports
41
+ * - **Thread Cleanup**: Cleans up automated payment threads
42
+ * - **Universal Library Support**: Works with both @solana/kit and @solana/web3.js
43
+ *
44
+ * ## Process
45
+ *
46
+ * 1. **Validate Completion**: Ensures rental period has ended or been fully paid
47
+ * 2. **Transfer Funds**: Moves any remaining ATLAS tokens to owner's account
48
+ * 3. **Return Fleet**: Transfers fleet ownership back to original owner
49
+ * 4. **Clean State**: Closes rental state account and returns SOL to payer
50
+ * 5. **Cancel Thread**: Cleans up any remaining automated payment threads
51
+ *
52
+ * ## Requirements
53
+ *
54
+ * - Rental must be completed or expired
55
+ * - Owner token account must be valid ATLAS token account
56
+ * - Rental state account must exist and be properly initialized
57
+ *
58
+ * ## When to Use
59
+ *
60
+ * - **Natural Expiration**: When rental period has ended
61
+ * - **Full Payment**: When all required payments have been made
62
+ * - **Account Cleanup**: To close expired rental accounts and recover SOL
63
+ * - **Fleet Recovery**: When fleet needs to be returned to owner
23
64
  *
24
65
  * @example
25
66
  * ```typescript
26
- * // Works with any library - just use strings for addresses!
67
+ * import { closeRental } from '@srsly/sdk';
68
+ *
69
+ * // Close a completed rental
27
70
  * const instruction = await closeRental({
28
- * borrower: "BorrowerAddr...", // String address
29
- * ownerTokenAccount: "TokenAcct...", // String address
30
- * contract: "ContractAddr..." // String address
71
+ * payer: wallet, // Transaction payer
72
+ * rentalStateAddress: "RentalState..." // Rental state address
31
73
  * });
32
74
  *
33
- * // Use mainnet configuration
34
- * const instruction = await closeRental(params).set({ programs: 'mainnet' });
75
+ * // Configure for mainnet
76
+ * const mainnetInstruction = await closeRental({
77
+ * payer: wallet,
78
+ * rentalStateAddress: "RentalState..."
79
+ * }).set({ programs: 'mainnet' });
35
80
  *
36
- * // Override specific constants
37
- * const instruction = await closeRental(params).set({
38
- * programs: 'mainnet'
39
- * });
81
+ * // Convert to @solana/web3.js format
82
+ * const web3jsInstruction = await closeRental({
83
+ * payer: wallet,
84
+ * rentalStateAddress: "RentalState..."
85
+ * }).web3js();
40
86
  *
41
- * // Use the instruction with your preferred Solana library
42
- * // instruction is compatible with both @solana/kit and @solana/web3.js
87
+ * // Use with your preferred Solana library
88
+ * const transaction = new Transaction().add(web3jsInstruction);
89
+ * await sendAndConfirmTransaction(connection, transaction, [wallet]);
43
90
  * ```
44
91
  *
45
- * @param params The simplified parameters for closing a rental
46
- * @returns A ConfigSelector that can be configured with .set() or awaited directly
92
+ * @param params - The rental closure parameters including payer and rental state address
93
+ * @returns A FluentConfigSelector that can be configured with .set() or awaited directly
94
+ * @throws Error when rental is not ready for closure or instruction generation fails
95
+ */
96
+ export declare function closeRental(params: CloseRentalParams): SmartFluentConfigSelector<FluentInstruction>;
97
+ /**
98
+ * Low-level function to create a rental closure instruction with raw input parameters.
99
+ *
100
+ * This function provides direct access to the underlying codama-generated instruction
101
+ * builder. It's primarily used internally by the SDK but can be used for advanced
102
+ * use cases where full control over instruction parameters is needed.
103
+ *
104
+ * @internal
105
+ * @param input - Raw instruction input parameters as expected by codama
106
+ * @param options - Optional instruction options including program address
107
+ * @returns A ConfigSelector for the raw instruction
47
108
  */
48
- export declare function closeRental(params: CloseRentalParams): ConfigSelector<CloseRentalInstruction>;
49
109
  export declare function getCloseRentalInstructionAsync(input: any, options?: any): ConfigSelector<any>;
50
110
  export {};
51
111
  //# sourceMappingURL=close.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../src/rental/close.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4D,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAIpI,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;AAqCD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;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
+ {"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../src/rental/close.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4D,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAGpI,OAAO,EAA4D,KAAK,iBAAiB,EAAE,KAAK,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAMlK,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAC/B,KAAK,eAAe,GAAG,GAAG,CAAC;AAE3B;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB;;;OAGG;IACH,kBAAkB,EAAE,gBAAgB,CAAC;CACtC;AAqHD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,GACxB,yBAAyB,CAAC,iBAAiB,CAAC,CAG9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAK7F"}
@@ -1,5 +1,90 @@
1
+ /**
2
+ * # Rental Operations Module
3
+ *
4
+ * This module provides comprehensive functionality for managing rental operations
5
+ * on the SRSLY program. It includes functions for accepting, canceling, closing,
6
+ * and resetting rentals, with full support for both @solana/kit and @solana/web3.js libraries.
7
+ *
8
+ * ## Available Functions
9
+ *
10
+ * - **acceptRental**: Accept an existing rental contract as a borrower
11
+ * - **cancelRental**: Cancel an active rental before completion
12
+ * - **closeRental**: Close a completed or expired rental
13
+ * - **resetRental**: Reset a canceled rental to make the contract available again
14
+ *
15
+ * ## Rental Lifecycle
16
+ *
17
+ * ```text
18
+ * Contract Created → Accept → [Active Rental] → Close (Complete)
19
+ * ↓ ↓
20
+ * [Payment] Cancel → Reset → [Available Again]
21
+ * ↑ ↓
22
+ * [Automated] [Cleanup]
23
+ * ```
24
+ *
25
+ * ## Features
26
+ *
27
+ * - **Universal Library Support**: Works with both major Solana libraries
28
+ * - **String-Based Addresses**: Eliminates library-specific type conflicts
29
+ * - **Fluent API**: Chainable configuration and format conversion
30
+ * - **Network Agnostic**: Supports different Solana networks
31
+ * - **Automated Payments**: Integration with Clockwork for scheduled payments
32
+ * - **SAGE Integration**: Fleet ownership management in Star Atlas ecosystem
33
+ *
34
+ * ## Common Patterns
35
+ *
36
+ * ### Accept a Rental
37
+ * ```typescript
38
+ * import { acceptRental, days } from '@srsly/sdk';
39
+ *
40
+ * const instruction = await acceptRental({
41
+ * borrower: wallet,
42
+ * borrowerProfile: "ProfileAddr...",
43
+ * borrowerFaction: 'mud',
44
+ * contract: "ContractAddr...",
45
+ * duration: days(7)
46
+ * });
47
+ * ```
48
+ *
49
+ * ### Cancel Active Rental
50
+ * ```typescript
51
+ * import { cancelRental } from '@srsly/sdk';
52
+ *
53
+ * const instruction = await cancelRental({
54
+ * borrower: wallet,
55
+ * contract: "ContractAddr..."
56
+ * });
57
+ * ```
58
+ *
59
+ * ### Close Completed Rental
60
+ * ```typescript
61
+ * import { closeRental } from '@srsly/sdk';
62
+ *
63
+ * const instruction = await closeRental({
64
+ * borrower: "BorrowerAddr...",
65
+ * ownerTokenAccount: "TokenAcct...",
66
+ * contract: "ContractAddr..."
67
+ * });
68
+ * ```
69
+ *
70
+ * ### Reset Canceled Rental
71
+ * ```typescript
72
+ * import { resetRental } from '@srsly/sdk';
73
+ *
74
+ * const instruction = await resetRental({
75
+ * fleet: "FleetAddr...",
76
+ * contract: "ContractAddr...",
77
+ * rentalState: "RentalStateAddr...",
78
+ * faction: 'mud',
79
+ * ownerProfile: "OwnerProfileAddr..."
80
+ * });
81
+ * ```
82
+ *
83
+ * @module Rental
84
+ */
1
85
  export * from "./accept";
2
86
  export * from "./cancel";
3
87
  export * from "./close";
4
88
  export * from "./reset";
89
+ export * from "./reset-contract-temp";
5
90
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rental/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rental/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { type FluentInstruction, type SmartFluentConfigSelector } from '../utils/instruction-converter';
2
+ type UniversalAddress = string;
3
+ type UniversalSigner = any;
4
+ /**
5
+ * Parameters for resetting a contract temporarily (devnet testing).
6
+ *
7
+ * This interface defines the required parameters for resetting a contract's
8
+ * rental state and properly resetting the fleet in SAGE.
9
+ *
10
+ * @interface ResetContractTempParams
11
+ */
12
+ export interface ResetContractTempParams {
13
+ /**
14
+ * The signer who will execute the reset (must be a signer object).
15
+ */
16
+ signer: UniversalSigner;
17
+ /**
18
+ * String address of the contract to reset.
19
+ */
20
+ contract: UniversalAddress;
21
+ /**
22
+ * Faction identifier for fleet operations.
23
+ * Can be provided as a number (1 = MUD, 2 = ONI, 3 = Ustur) or string ('mud', 'oni', 'ustur').
24
+ * Used for deriving SAGE accounts.
25
+ * @example 'mud' // or 1
26
+ */
27
+ faction: number | string;
28
+ /**
29
+ * String address of the owner's profile in Star Atlas.
30
+ * Used for SAGE fleet operations.
31
+ */
32
+ ownerProfile: UniversalAddress;
33
+ }
34
+ /**
35
+ * Creates a temporary instruction to reset a contract's fleet in SAGE (devnet testing).
36
+ *
37
+ * This function properly resets a contract by:
38
+ * 1. Resetting the fleet in SAGE via CPI call to invalidate_rental(context, false)
39
+ * 2. Setting the contract's current_rental_state to system_program::ID
40
+ * 3. Making the contract available for new rentals
41
+ *
42
+ * ## Features
43
+ *
44
+ * - **Fleet Reset**: Properly resets fleet in SAGE ecosystem
45
+ * - **Contract Reset**: Updates contract state to be available for new rentals
46
+ * - **Account Derivation**: Automatically derives all required SAGE accounts
47
+ * - **Network Support**: Works across mainnet, atlasnet, and holosim
48
+ * - **Universal Library Support**: Works with both @solana/kit and @solana/web3.js
49
+ *
50
+ * @example
51
+ * ```typescript
52
+ * import { resetContractTemp } from '@wuwei-labs/srsly';
53
+ *
54
+ * // Reset a contract for testing
55
+ * const instruction = await resetContractTemp({
56
+ * signer: wallet,
57
+ * contract: "5YqtCEiGPLH3FqoTCkWXFCLtNFC7StnUydgaYfLSPHWv",
58
+ * faction: 'mud',
59
+ * ownerProfile: "OwnerProfileAddr..."
60
+ * });
61
+ *
62
+ * // Configure for specific network
63
+ * const instruction = await resetContractTemp({
64
+ * signer: wallet,
65
+ * contract: "ContractAddr...",
66
+ * faction: 2,
67
+ * ownerProfile: "OwnerProfileAddr..."
68
+ * }).set({ programs: 'holosim' });
69
+ * ```
70
+ *
71
+ * @param params - The contract reset parameters
72
+ * @returns A FluentConfigSelector that can be configured with .set() or awaited directly
73
+ * @throws Error when contract is not found or account derivation fails
74
+ */
75
+ export declare function resetContractTemp(params: ResetContractTempParams): SmartFluentConfigSelector<FluentInstruction>;
76
+ export {};
77
+ //# sourceMappingURL=reset-contract-temp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset-contract-temp.d.ts","sourceRoot":"","sources":["../../../src/rental/reset-contract-temp.ts"],"names":[],"mappings":"AAGA,OAAO,EAA4D,KAAK,iBAAiB,EAAE,KAAK,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAKlK,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAC/B,KAAK,eAAe,GAAG,GAAG,CAAC;AAE3B;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,EAAE,eAAe,CAAC;IAExB;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;;;;OAKG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,YAAY,EAAE,gBAAgB,CAAC;CAChC;AA8ED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,uBAAuB,GAC9B,yBAAyB,CAAC,iBAAiB,CAAC,CAG9C"}
@@ -1,65 +1,155 @@
1
1
  import { type ConfigSelector } from '../utils/config';
2
2
  type UniversalAddress = string;
3
+ type UniversalSigner = any;
3
4
  type ResetRentalInstruction = any;
4
5
  /**
5
- * Simplified parameters for resetting a rental - strings only!
6
+ * Parameters for resetting a rental after cancellation.
7
+ *
8
+ * This interface defines the required parameters for resetting a rental contract
9
+ * after it has been canceled. Resetting clears the rental state and makes the
10
+ * contract available for new rentals again.
11
+ *
12
+ * @interface ResetRentalParams
6
13
  */
7
14
  export interface ResetRentalParams {
8
15
  /**
9
- * The fleet account address
16
+ * The payer for transaction fees (must be a signer object).
17
+ * This account will pay for the transaction and receive any lamports
18
+ * from closed accounts.
19
+ */
20
+ payer: UniversalSigner;
21
+ /**
22
+ * String address of the fleet associated with the rental contract.
23
+ * The fleet's rental state will be reset to allow for new rentals.
10
24
  */
11
25
  fleet: UniversalAddress;
12
26
  /**
13
- * The rental contract account address
27
+ * String address of the rental contract to reset.
28
+ * This contract will be made available for new rentals after reset.
14
29
  */
15
30
  contract: UniversalAddress;
16
31
  /**
17
- * The rental state account address
32
+ * String address of the rental state account to be reset.
33
+ * This account contains the canceled rental data that needs to be cleared.
18
34
  */
19
35
  rentalState: UniversalAddress;
20
36
  /**
21
- * Optional faction (1 = mud, 2 = oni, 3 = ustur)
22
- * Or as string: 'mud', 'oni', 'ustur'
23
- * Only needed if starbase and starbasePlayer are not provided
37
+ * Faction identifier for Star Atlas integration.
38
+ * Can be provided as a number (1 = MUD, 2 = ONI, 3 = Ustur) or string ('mud', 'oni', 'ustur').
39
+ * Used for deriving faction-specific game accounts required by SAGE.
40
+ * @example 'mud' // or 1
24
41
  */
25
42
  faction: number | string;
26
43
  /**
27
- * The owner's profile address
28
- * Needed only if faction is provided to derive starbasePlayer
44
+ * String address of the owner's profile in the Star Atlas game.
45
+ * Required for deriving game accounts (starbase, starbasePlayer) needed by SAGE.
46
+ * Must be the profile of the original fleet owner.
29
47
  */
30
48
  ownerProfile: UniversalAddress;
31
49
  }
32
50
  /**
33
- * Creates an instruction to reset a rental with fluent configuration.
51
+ * Creates an instruction to reset a rental contract after cancellation with fluent configuration.
52
+ *
53
+ * This function clears the rental state from a canceled rental, making the contract
54
+ * available for new rentals. It's typically called after a rental has been canceled
55
+ * to clean up the state and allow the fleet to be rented out again.
56
+ *
57
+ * ## Features
58
+ *
59
+ * - **State Cleanup**: Clears canceled rental state from accounts
60
+ * - **Contract Reactivation**: Makes the contract available for new rentals
61
+ * - **Fleet Preparation**: Ensures fleet is ready for future rental operations
62
+ * - **SAGE Integration**: Updates fleet status in the Star Atlas ecosystem
63
+ * - **Account Derivation**: Automatically derives required game accounts
64
+ * - **Universal Library Support**: Works with both @solana/kit and @solana/web3.js
65
+ *
66
+ * ## Process
67
+ *
68
+ * 1. **Validate State**: Ensures rental was properly canceled before reset
69
+ * 2. **Derive Accounts**: Generates required game accounts (starbase, etc.)
70
+ * 3. **Clear State**: Removes canceled rental data from accounts
71
+ * 4. **Update SAGE**: Resets fleet status in the Star Atlas ecosystem
72
+ * 5. **Reactivate Contract**: Makes contract available for new rentals
73
+ *
74
+ * ## Requirements
75
+ *
76
+ * - Rental must be in canceled state (not active or completed)
77
+ * - Caller must have authority to reset the rental
78
+ * - All accounts must be properly initialized
79
+ * - Fleet must be under owner control
80
+ *
81
+ * ## When to Use
82
+ *
83
+ * - **After Cancellation**: When a rental has been canceled and needs cleanup
84
+ * - **Contract Reuse**: To make a contract available for new rentals
85
+ * - **State Recovery**: When rental state needs to be cleared
86
+ * - **Fleet Management**: To prepare fleet for future rental operations
34
87
  *
35
88
  * @example
36
89
  * ```typescript
37
- * // Works with any library - just use strings for addresses!
90
+ * import { resetRental } from '@srsly/sdk';
91
+ *
92
+ * // Reset a canceled rental
38
93
  * const instruction = await resetRental({
39
- * fleet: "FleetAddress123...", // String address
40
- * contract: "ContractAddr...", // String address
41
- * rentalState: "RentalStateAddr...", // String address
42
- * faction: 'mud',
43
- * ownerProfile: "OwnerProfileAddr..." // String address
94
+ * fleet: "FleetAddress123...", // Fleet to reset
95
+ * contract: "ContractAddr...", // Contract to reactivate
96
+ * rentalState: "RentalStateAddr...", // Canceled rental state
97
+ * faction: 'mud', // Owner's faction
98
+ * ownerProfile: "OwnerProfileAddr..." // Owner's Star Atlas profile
44
99
  * });
45
100
  *
46
- * // Use mainnet configuration
47
- * const instruction = await resetRental(params).set({ programs: 'mainnet' });
101
+ * // Configure for mainnet
102
+ * const mainnetInstruction = await resetRental({
103
+ * fleet: "FleetAddress123...",
104
+ * contract: "ContractAddr...",
105
+ * rentalState: "RentalStateAddr...",
106
+ * faction: 1, // Can use numbers: 1=mud, 2=oni, 3=ustur
107
+ * ownerProfile: "OwnerProfileAddr..."
108
+ * }).set({ programs: 'mainnet' });
48
109
  *
49
- * // Override specific constants
50
- * const instruction = await resetRental(params).set({
110
+ * // Override specific game configuration
111
+ * const customInstruction = await resetRental({
112
+ * fleet: "FleetAddress123...",
113
+ * contract: "ContractAddr...",
114
+ * rentalState: "RentalStateAddr...",
115
+ * faction: 'mud',
116
+ * ownerProfile: "OwnerProfileAddr..."
117
+ * }).set({
51
118
  * programs: 'mainnet',
52
- * gameId: 'custom-game-id...' // gameId configured via .set()
119
+ * gameId: 'custom-game-id...'
53
120
  * });
54
121
  *
55
- * // Use the instruction with your preferred Solana library
56
- * // instruction is compatible with both @solana/kit and @solana/web3.js
122
+ * // Convert to @solana/web3.js format
123
+ * const web3jsInstruction = await resetRental({
124
+ * fleet: "FleetAddress123...",
125
+ * contract: "ContractAddr...",
126
+ * rentalState: "RentalStateAddr...",
127
+ * faction: 'mud',
128
+ * ownerProfile: "OwnerProfileAddr..."
129
+ * }).web3js();
130
+ *
131
+ * // Use with your preferred Solana library
132
+ * const transaction = new Transaction().add(web3jsInstruction);
133
+ * await sendAndConfirmTransaction(connection, transaction, [wallet]);
57
134
  * ```
58
135
  *
59
- * @param params The simplified parameters for resetting a rental
136
+ * @param params - The rental reset parameters including fleet, contract, rental state, and owner details
60
137
  * @returns A ConfigSelector that can be configured with .set() or awaited directly
138
+ * @throws Error when rental is not in canceled state or instruction generation fails
61
139
  */
62
140
  export declare function resetRental(params: ResetRentalParams): ConfigSelector<ResetRentalInstruction>;
141
+ /**
142
+ * Low-level function to create a rental reset instruction with raw input parameters.
143
+ *
144
+ * This function provides direct access to the underlying codama-generated instruction
145
+ * builder. It's primarily used internally by the SDK but can be used for advanced
146
+ * use cases where full control over instruction parameters is needed.
147
+ *
148
+ * @internal
149
+ * @param input - Raw instruction input parameters as expected by codama
150
+ * @param options - Optional instruction options including program address
151
+ * @returns A ConfigSelector for the raw instruction
152
+ */
63
153
  export declare function getResetRentalInstructionAsync(input: any, options?: any): ConfigSelector<any>;
64
154
  export {};
65
155
  //# sourceMappingURL=reset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../../src/rental/reset.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4D,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAKpI,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAC/B,KAAK,sBAAsB,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;;;;;;;;;;;;;;;;;;;GAyFG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,GACxB,cAAc,CAAC,sBAAsB,CAAC,CAExC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAK7F"}
@@ -2,6 +2,12 @@
2
2
  * Network configuration for the SRSLY SDK
3
3
  */
4
4
  export type ProgramSet = 'mainnet' | 'atlasnet' | 'holosim';
5
+ /**
6
+ * PublicKey constructor interface for web3.js library integration
7
+ */
8
+ export interface PublicKeyConstructor<TPublicKey = any> {
9
+ new (address: string): TPublicKey;
10
+ }
5
11
  /**
6
12
  * Configuration options that can be set globally or overridden per call
7
13
  */
@@ -9,21 +15,27 @@ export interface ConfigOptions {
9
15
  programs?: ProgramSet;
10
16
  srslyProgramAddress?: string;
11
17
  profileFactionProgramAddress?: string;
18
+ antegenProgramAddress?: string;
12
19
  gameId?: string;
13
20
  atlasMint?: string;
21
+ rpcUrl?: string;
22
+ library?: 'kit' | 'web3js';
23
+ PublicKeyConstructor?: PublicKeyConstructor;
14
24
  }
15
25
  /**
16
26
  * Resolve program addresses based on configuration
17
27
  * @param config Effective configuration options
18
28
  * @returns Resolved program addresses
19
29
  */
20
- export declare function resolveProgramAddresses(config: ConfigOptions): {
30
+ export declare function resolveProgramAddresses(config: ConfigOptions): Promise<{
21
31
  srslyProgramAddress: any;
22
32
  sageProgramAddress: any;
23
33
  profileFactionProgramAddress: any;
34
+ antegenProgramAddress: any;
24
35
  gameId: any;
25
36
  atlasMint: any;
26
- };
37
+ rpcUrl: string;
38
+ }>;
27
39
  /**
28
40
  * Set global configuration options that will be used as defaults for all SDK operations
29
41
  * @param config Configuration options to set globally
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,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AGG;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"}
@@ -7,7 +7,7 @@ export declare function toAddress(value: string | any): any;
7
7
  export declare const STARBASE_SEED = "Starbase";
8
8
  export declare const STARBASE_PLAYER_SEED = "starbase_player";
9
9
  export declare const SAGE_PLAYER_PROFILE_SEED = "sage_player_profile";
10
- export declare const PROFILE_FACTION_SEED = "profile_faction";
10
+ export declare const PROFILE_FACTION_SEED = "player_faction";
11
11
  export declare const ATLAS_TO_STARDUST = 100000000;
12
12
  export declare function getSrslyProgramAddress(config?: ConfigOptions): Promise<any>;
13
13
  export declare function getProgramId(): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAGlF;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,CAOlD;AAGD,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AACtD,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;A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AAsB,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"}
@@ -5,4 +5,5 @@ export * from "./paymentFrequency";
5
5
  export * from "./duration";
6
6
  export * from "./instruction-converter";
7
7
  export * from "./fetch-accounts";
8
+ export * from "./pda";
8
9
  //# 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;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,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;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,OAAO,CAAC"}