@wuwei-labs/srsly 2.0.0-beta.2 → 2.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 (188) hide show
  1. package/README.md +283 -111
  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/accounts/contractState.js +17 -39
  5. package/dist/cjs/codama/accounts/contractState.js.map +1 -1
  6. package/dist/cjs/codama/accounts/index.js +1 -1
  7. package/dist/cjs/codama/accounts/index.js.map +1 -1
  8. package/dist/cjs/codama/accounts/rentalState.js +18 -33
  9. package/dist/cjs/codama/accounts/rentalState.js.map +1 -1
  10. package/dist/cjs/codama/accounts/thread.js +15 -32
  11. package/dist/cjs/codama/accounts/thread.js.map +1 -1
  12. package/dist/cjs/codama/errors/srsly.js +24 -3
  13. package/dist/cjs/codama/errors/srsly.js.map +1 -1
  14. package/dist/cjs/codama/instructions/acceptRental.js +202 -224
  15. package/dist/cjs/codama/instructions/acceptRental.js.map +1 -1
  16. package/dist/cjs/codama/instructions/cancelRental.js +100 -136
  17. package/dist/cjs/codama/instructions/cancelRental.js.map +1 -1
  18. package/dist/cjs/codama/instructions/closeContract.js +95 -116
  19. package/dist/cjs/codama/instructions/closeContract.js.map +1 -1
  20. package/dist/cjs/codama/instructions/closeRental.js +119 -132
  21. package/dist/cjs/codama/instructions/closeRental.js.map +1 -1
  22. package/dist/cjs/codama/instructions/createContract.js +127 -143
  23. package/dist/cjs/codama/instructions/createContract.js.map +1 -1
  24. package/dist/cjs/codama/instructions/index.js +2 -1
  25. package/dist/cjs/codama/instructions/index.js.map +1 -1
  26. package/dist/cjs/codama/instructions/initializeConfig.js +131 -0
  27. package/dist/cjs/codama/instructions/initializeConfig.js.map +1 -0
  28. package/dist/cjs/codama/instructions/payRental.js +125 -129
  29. package/dist/cjs/codama/instructions/payRental.js.map +1 -1
  30. package/dist/cjs/codama/instructions/resetRental.js +55 -77
  31. package/dist/cjs/codama/instructions/resetRental.js.map +1 -1
  32. package/dist/cjs/codama/instructions/updateConfig.js +145 -0
  33. package/dist/cjs/codama/instructions/updateConfig.js.map +1 -0
  34. package/dist/cjs/codama/programs/srsly.js +12 -8
  35. package/dist/cjs/codama/programs/srsly.js.map +1 -1
  36. package/dist/cjs/codama/shared/index.js +6 -2
  37. package/dist/cjs/codama/shared/index.js.map +1 -1
  38. package/dist/cjs/codama/types/trigger.js +1 -1
  39. package/dist/cjs/codama/types/trigger.js.map +1 -1
  40. package/dist/cjs/codama/types/triggerContext.js +1 -1
  41. package/dist/cjs/codama/types/triggerContext.js.map +1 -1
  42. package/dist/cjs/contract/close.js +75 -34
  43. package/dist/cjs/contract/close.js.map +1 -1
  44. package/dist/cjs/contract/create.js +59 -43
  45. package/dist/cjs/contract/create.js.map +1 -1
  46. package/dist/cjs/index.js +7 -1
  47. package/dist/cjs/index.js.map +1 -1
  48. package/dist/cjs/package.json +54 -0
  49. package/dist/cjs/rental/accept.js +68 -40
  50. package/dist/cjs/rental/accept.js.map +1 -1
  51. package/dist/cjs/rental/cancel.js +36 -28
  52. package/dist/cjs/rental/cancel.js.map +1 -1
  53. package/dist/cjs/rental/close.js +37 -29
  54. package/dist/cjs/rental/close.js.map +1 -1
  55. package/dist/cjs/rental/reset.js +46 -42
  56. package/dist/cjs/rental/reset.js.map +1 -1
  57. package/dist/cjs/utils/config.js +303 -0
  58. package/dist/cjs/utils/config.js.map +1 -0
  59. package/dist/cjs/utils/constants.js +69 -9
  60. package/dist/cjs/utils/constants.js.map +1 -1
  61. package/dist/cjs/utils/index.js +1 -0
  62. package/dist/cjs/utils/index.js.map +1 -1
  63. package/dist/cjs/utils/profiles.js +96 -95
  64. package/dist/cjs/utils/profiles.js.map +1 -1
  65. package/dist/esm/codama/accounts/config.js +76 -0
  66. package/dist/esm/codama/accounts/config.js.map +1 -0
  67. package/dist/esm/codama/accounts/contractState.js +3 -7
  68. package/dist/esm/codama/accounts/contractState.js.map +1 -1
  69. package/dist/esm/codama/accounts/index.js +1 -1
  70. package/dist/esm/codama/accounts/index.js.map +1 -1
  71. package/dist/esm/codama/accounts/rentalState.js +3 -1
  72. package/dist/esm/codama/accounts/rentalState.js.map +1 -1
  73. package/dist/esm/codama/errors/srsly.js +23 -2
  74. package/dist/esm/codama/errors/srsly.js.map +1 -1
  75. package/dist/esm/codama/instructions/acceptRental.js +30 -39
  76. package/dist/esm/codama/instructions/acceptRental.js.map +1 -1
  77. package/dist/esm/codama/instructions/cancelRental.js +10 -33
  78. package/dist/esm/codama/instructions/cancelRental.js.map +1 -1
  79. package/dist/esm/codama/instructions/closeContract.js +17 -25
  80. package/dist/esm/codama/instructions/closeContract.js.map +1 -1
  81. package/dist/esm/codama/instructions/closeRental.js +19 -19
  82. package/dist/esm/codama/instructions/closeRental.js.map +1 -1
  83. package/dist/esm/codama/instructions/createContract.js +13 -16
  84. package/dist/esm/codama/instructions/createContract.js.map +1 -1
  85. package/dist/esm/codama/instructions/index.js +2 -1
  86. package/dist/esm/codama/instructions/index.js.map +1 -1
  87. package/dist/esm/codama/instructions/initializeConfig.js +121 -0
  88. package/dist/esm/codama/instructions/initializeConfig.js.map +1 -0
  89. package/dist/esm/codama/instructions/payRental.js +34 -25
  90. package/dist/esm/codama/instructions/payRental.js.map +1 -1
  91. package/dist/esm/codama/instructions/resetRental.js +0 -9
  92. package/dist/esm/codama/instructions/resetRental.js.map +1 -1
  93. package/dist/esm/codama/instructions/updateConfig.js +135 -0
  94. package/dist/esm/codama/instructions/updateConfig.js.map +1 -0
  95. package/dist/esm/codama/programs/srsly.js +12 -8
  96. package/dist/esm/codama/programs/srsly.js.map +1 -1
  97. package/dist/esm/contract/close.js +68 -16
  98. package/dist/esm/contract/close.js.map +1 -1
  99. package/dist/esm/contract/create.js +60 -33
  100. package/dist/esm/contract/create.js.map +1 -1
  101. package/dist/esm/index.js +5 -1
  102. package/dist/esm/index.js.map +1 -1
  103. package/dist/esm/package.json +54 -0
  104. package/dist/esm/rental/accept.js +70 -31
  105. package/dist/esm/rental/accept.js.map +1 -1
  106. package/dist/esm/rental/cancel.js +37 -18
  107. package/dist/esm/rental/cancel.js.map +1 -1
  108. package/dist/esm/rental/close.js +38 -19
  109. package/dist/esm/rental/close.js.map +1 -1
  110. package/dist/esm/rental/reset.js +48 -33
  111. package/dist/esm/rental/reset.js.map +1 -1
  112. package/dist/esm/utils/config.js +261 -0
  113. package/dist/esm/utils/config.js.map +1 -0
  114. package/dist/esm/utils/constants.js +60 -7
  115. package/dist/esm/utils/constants.js.map +1 -1
  116. package/dist/esm/utils/index.js +1 -0
  117. package/dist/esm/utils/index.js.map +1 -1
  118. package/dist/esm/utils/profiles.js +39 -19
  119. package/dist/esm/utils/profiles.js.map +1 -1
  120. package/dist/types/codama/accounts/config.d.ts +52 -0
  121. package/dist/types/codama/accounts/config.d.ts.map +1 -0
  122. package/dist/types/codama/accounts/contractState.d.ts +2 -4
  123. package/dist/types/codama/accounts/contractState.d.ts.map +1 -1
  124. package/dist/types/codama/accounts/index.d.ts +1 -1
  125. package/dist/types/codama/accounts/index.d.ts.map +1 -1
  126. package/dist/types/codama/accounts/rentalState.d.ts +2 -0
  127. package/dist/types/codama/accounts/rentalState.d.ts.map +1 -1
  128. package/dist/types/codama/errors/srsly.d.ts +16 -2
  129. package/dist/types/codama/errors/srsly.d.ts.map +1 -1
  130. package/dist/types/codama/instructions/acceptRental.d.ts +41 -34
  131. package/dist/types/codama/instructions/acceptRental.d.ts.map +1 -1
  132. package/dist/types/codama/instructions/cancelRental.d.ts +14 -10
  133. package/dist/types/codama/instructions/cancelRental.d.ts.map +1 -1
  134. package/dist/types/codama/instructions/closeContract.d.ts +29 -21
  135. package/dist/types/codama/instructions/closeContract.d.ts.map +1 -1
  136. package/dist/types/codama/instructions/closeRental.d.ts +20 -12
  137. package/dist/types/codama/instructions/closeRental.d.ts.map +1 -1
  138. package/dist/types/codama/instructions/createContract.d.ts +27 -23
  139. package/dist/types/codama/instructions/createContract.d.ts.map +1 -1
  140. package/dist/types/codama/instructions/index.d.ts +2 -1
  141. package/dist/types/codama/instructions/index.d.ts.map +1 -1
  142. package/dist/types/codama/instructions/initializeConfig.d.ts +60 -0
  143. package/dist/types/codama/instructions/initializeConfig.d.ts.map +1 -0
  144. package/dist/types/codama/instructions/payRental.d.ts +28 -13
  145. package/dist/types/codama/instructions/payRental.d.ts.map +1 -1
  146. package/dist/types/codama/instructions/resetRental.d.ts +3 -3
  147. package/dist/types/codama/instructions/resetRental.d.ts.map +1 -1
  148. package/dist/types/codama/instructions/updateConfig.d.ts +93 -0
  149. package/dist/types/codama/instructions/updateConfig.d.ts.map +1 -0
  150. package/dist/types/codama/programs/srsly.d.ts +11 -8
  151. package/dist/types/codama/programs/srsly.d.ts.map +1 -1
  152. package/dist/types/contract/close.d.ts +20 -24
  153. package/dist/types/contract/close.d.ts.map +1 -1
  154. package/dist/types/contract/create.d.ts +34 -22
  155. package/dist/types/contract/create.d.ts.map +1 -1
  156. package/dist/types/index.d.ts +4 -1
  157. package/dist/types/index.d.ts.map +1 -1
  158. package/dist/types/rental/accept.d.ts +42 -20
  159. package/dist/types/rental/accept.d.ts.map +1 -1
  160. package/dist/types/rental/cancel.d.ts +16 -11
  161. package/dist/types/rental/cancel.d.ts.map +1 -1
  162. package/dist/types/rental/close.d.ts +16 -11
  163. package/dist/types/rental/close.d.ts.map +1 -1
  164. package/dist/types/rental/reset.d.ts +17 -20
  165. package/dist/types/rental/reset.d.ts.map +1 -1
  166. package/dist/types/utils/config.d.ts +167 -0
  167. package/dist/types/utils/config.d.ts.map +1 -0
  168. package/dist/types/utils/constants.d.ts +23 -7
  169. package/dist/types/utils/constants.d.ts.map +1 -1
  170. package/dist/types/utils/index.d.ts +1 -0
  171. package/dist/types/utils/index.d.ts.map +1 -1
  172. package/dist/types/utils/profiles.d.ts +14 -8
  173. package/dist/types/utils/profiles.d.ts.map +1 -1
  174. package/package.json +36 -14
  175. package/target/idl/srsly.json +3279 -0
  176. package/target/types/srsly.ts +1 -0
  177. package/dist/cjs/codama/accounts/fleet.js +0 -94
  178. package/dist/cjs/codama/accounts/fleet.js.map +0 -1
  179. package/dist/cjs/codama/instructions/normalizeAdmin.js +0 -165
  180. package/dist/cjs/codama/instructions/normalizeAdmin.js.map +0 -1
  181. package/dist/esm/codama/accounts/fleet.js +0 -64
  182. package/dist/esm/codama/accounts/fleet.js.map +0 -1
  183. package/dist/esm/codama/instructions/normalizeAdmin.js +0 -142
  184. package/dist/esm/codama/instructions/normalizeAdmin.js.map +0 -1
  185. package/dist/types/codama/accounts/fleet.d.ts +0 -38
  186. package/dist/types/codama/accounts/fleet.d.ts.map +0 -1
  187. package/dist/types/codama/instructions/normalizeAdmin.d.ts +0 -67
  188. package/dist/types/codama/instructions/normalizeAdmin.d.ts.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { Address } from '@solana/kit';
2
- import { ResetRentalInstruction, getResetRentalInstructionAsync } from '../codama';
2
+ import { type ConfigSelector } from '../utils/config';
3
+ type ResetRentalInstruction = any;
3
4
  /**
4
5
  * Simplified parameters for resetting a rental
5
6
  */
@@ -18,7 +19,7 @@ export interface ResetRentalParams {
18
19
  rentalState: Address<string>;
19
20
  /**
20
21
  * The game ID account address
21
- * Defaults to the standard game ID if not provided
22
+ * If not provided, will use network-specific default
22
23
  */
23
24
  gameId?: Address<string>;
24
25
  /**
@@ -34,13 +35,11 @@ export interface ResetRentalParams {
34
35
  ownerProfile: Address<string>;
35
36
  }
36
37
  /**
37
- * Asynchronously creates an instruction to reset a rental with minimal required parameters.
38
- * This is used to reset a fleet's rental state after a rental has ended.
39
- * Can derive starbase, starbasePlayer, and rentalAuthority automatically.
38
+ * Creates an instruction to reset a rental with fluent configuration.
40
39
  *
41
40
  * @example
42
41
  * ```typescript
43
- * // Create the instruction with minimum required parameters and faction
42
+ * // Use devnet defaults
44
43
  * const ix = await resetRental({
45
44
  * fleet: fleetAddress,
46
45
  * contract: contractAddress,
@@ -49,23 +48,21 @@ export interface ResetRentalParams {
49
48
  * ownerProfile: ownerProfileAddress
50
49
  * });
51
50
  *
52
- * // Or with explicit starbase and starbasePlayer
53
- * const ix = await resetRental({
54
- * fleet: fleetAddress,
55
- * contract: contractAddress,
56
- * rentalState: rentalStateAddress,
57
- * starbase: starbaseAddress,
58
- * starbasePlayer: starbasePlayerAddress
59
- * });
51
+ * // Use mainnet configuration
52
+ * const ix = await resetRental(params).set({ network: 'mainnet' });
60
53
  *
61
- * // Add to transaction and sign
62
- * const tx = new Transaction().add(ix);
63
- * await sendAndConfirmTransaction(connection, tx, [owner]);
54
+ * // Override specific constants
55
+ * const ix = await resetRental(params).set({
56
+ * network: 'mainnet',
57
+ * gameId: 'custom-game-id...',
58
+ * sageProgramAddress: 'custom...'
59
+ * });
64
60
  * ```
65
61
  *
66
62
  * @param params The simplified parameters for resetting a rental
67
- * @returns A promise that resolves to the instruction to reset a rental
63
+ * @returns A ConfigSelector that can be configured with .set() or awaited directly
68
64
  */
69
- export declare function resetRental(params: ResetRentalParams): Promise<ResetRentalInstruction>;
70
- export { getResetRentalInstructionAsync };
65
+ export declare function resetRental(params: ResetRentalParams): ConfigSelector<ResetRentalInstruction>;
66
+ export declare function getResetRentalInstructionAsync(input: any, options?: any): ConfigSelector<any>;
67
+ export {};
71
68
  //# 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,EACL,sBAAsB,EACtB,8BAA8B,EAE/B,MAAM,WAAW,CAAC;AAOnB;;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,C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,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAK7F"}
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Network configuration for the SRSLY SDK
3
+ */
4
+ import { type Address, type TransactionSigner } from '@solana/kit';
5
+ export type ProgramSet = 'mainnet' | 'atlasnet' | 'holosim';
6
+ /**
7
+ * Configuration options that can be set globally or overridden per call
8
+ */
9
+ export interface ConfigOptions {
10
+ programs?: ProgramSet;
11
+ srslyProgramAddress?: string;
12
+ profileFactionProgramAddress?: string;
13
+ gameId?: string;
14
+ atlasMint?: string;
15
+ rpcUrl?: string;
16
+ transactionOptions?: {
17
+ commitment?: 'processed' | 'confirmed' | 'finalized';
18
+ skipPreflight?: boolean;
19
+ };
20
+ }
21
+ /**
22
+ * Resolve program addresses based on configuration
23
+ * @param config Effective configuration options
24
+ * @returns Resolved program addresses
25
+ */
26
+ export declare function resolveProgramAddresses(config: ConfigOptions): {
27
+ srslyProgramAddress: string;
28
+ sageProgramAddress: "SAGE2HAwep459SNq61LHvjxPk4pLPEJLoMETef7f7EE" | "SAgeTraQfBMdvGVDJYoEvjnbq5szW7RJPi6obDTDQUF";
29
+ profileFactionProgramAddress: string;
30
+ gameId: string;
31
+ atlasMint: string;
32
+ rpcUrl: any;
33
+ };
34
+ /**
35
+ * Set global configuration options that will be used as defaults for all SDK operations
36
+ * @param config Configuration options to set globally
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * // Use default atlasnet program addresses
41
+ * setConfig({ programs: 'atlasnet' });
42
+ *
43
+ * // Use holosim program addresses
44
+ * setConfig({ programs: 'holosim' });
45
+ *
46
+ * // Use holosim program addresses with custom game ID
47
+ * setConfig({
48
+ * programs: 'holosim',
49
+ * gameId: 'custom-game-id...'
50
+ * });
51
+ *
52
+ * // Can still override per instruction
53
+ * await createContract(params).set({ srslyProgramAddress: 'custom...' });
54
+ * ```
55
+ */
56
+ export declare function setConfig(config: ConfigOptions): void;
57
+ /**
58
+ * Get the current global configuration
59
+ * @returns Current global configuration options
60
+ */
61
+ export declare function getConfig(): ConfigOptions;
62
+ /**
63
+ * Clear global configuration (resets to atlasnet program set defaults)
64
+ */
65
+ export declare function clearConfig(): void;
66
+ /**
67
+ * Get the single codama module (network agnostic)
68
+ * @param modulePath The module type ('instructions' or 'programs')
69
+ * @returns The codama module
70
+ */
71
+ export declare function getModule(modulePath: 'instructions' | 'programs'): any;
72
+ /**
73
+ * @deprecated Use getModule instead. This function is kept for backward compatibility.
74
+ * Get codama modules (network agnostic)
75
+ */
76
+ export declare function getCachedNetworkModule<T = any>(modulePath: string): Promise<T>;
77
+ /**
78
+ * Interface for a packed transaction that can be sent or used with wallet adapters
79
+ */
80
+ export interface PackedTransaction {
81
+ /** Raw transaction message bytes for wallet adapters */
82
+ messageBytes: any;
83
+ /** Transaction signature map (empty for unsigned transactions) */
84
+ signatures: any;
85
+ /**
86
+ * Send the packed transaction using @solana/kit (for server-side/CLI usage)
87
+ *
88
+ * @param signer The transaction signer that will sign and pay for the transaction
89
+ * @returns Promise resolving to the transaction signature
90
+ *
91
+ * @example
92
+ * ```typescript
93
+ * import { createKeyPairSignerFromBytes } from '@solana/kit';
94
+ *
95
+ * // Create signer from keypair bytes
96
+ * const signer = await createKeyPairSignerFromBytes(keypairBytes);
97
+ *
98
+ * // Pack transaction, then send
99
+ * const signature = await createContract(params)
100
+ * .pack(signer.address)
101
+ * .send(signer);
102
+ * ```
103
+ */
104
+ send(signer: TransactionSigner): Promise<string>;
105
+ }
106
+ /**
107
+ * Configuration selector for overriding network and constants
108
+ * Also implements PromiseLike to allow direct awaiting
109
+ */
110
+ export interface ConfigSelector<T> extends PromiseLike<T> {
111
+ /**
112
+ * Set configuration options for this call
113
+ */
114
+ set(options: ConfigOptions): ConfigSelector<T>;
115
+ /**
116
+ * Build with current configuration (explicit call)
117
+ */
118
+ build(): Promise<T>;
119
+ /**
120
+ * Pack the instruction into an unsigned transaction ready for signing and sending
121
+ *
122
+ * @param feePayer The address that will pay for the transaction fees
123
+ * @returns Promise resolving to a PackedTransaction with send() method
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * // Option 1: Pack and send (server-side/CLI)
128
+ * import { createKeyPairSignerFromBytes } from '@solana/kit';
129
+ * const signer = await createKeyPairSignerFromBytes(keypairBytes);
130
+ * const signature = await createContract(params)
131
+ * .pack(signer.address)
132
+ * .send(signer);
133
+ *
134
+ * // Option 2: Pack for wallet adapter (browser)
135
+ * const packedTx = await createContract(params).pack(wallet.publicKey);
136
+ * import { VersionedTransaction } from '@solana/web3.js';
137
+ * const versionedTx = VersionedTransaction.deserialize(packedTx.messageBytes);
138
+ * const signedTx = await wallet.signTransaction(versionedTx);
139
+ * // ... send with connection.sendRawTransaction(signedTx.serialize())
140
+ *
141
+ * // Option 3: Get just the bytes for custom handling
142
+ * const txBytes = packedTx.messageBytes;
143
+ * ```
144
+ */
145
+ pack(feePayer: Address | string): Promise<PackedTransaction>;
146
+ }
147
+ /**
148
+ * Create the initial fluent config selector for a function.
149
+ * This is the main entry point for the fluent configuration API.
150
+ *
151
+ * The returned selector can be:
152
+ * - Awaited directly (uses global config + atlasnet fallback)
153
+ * - Configured with .set() to override network/constants
154
+ * - Chained with multiple .set() calls
155
+ *
156
+ * @param executeFn - The function to execute with optional configuration
157
+ * @returns A ConfigSelector that supports fluent configuration
158
+ *
159
+ * @example
160
+ * // Usage patterns:
161
+ * setConfig({ programs: 'mainnet' });
162
+ * await createConfigSelector(executeFn) // Direct await (uses global config)
163
+ * await createConfigSelector(executeFn).set({...}) // Override global config
164
+ * await createConfigSelector(executeFn).set({...}).set({...}) // Chained configs
165
+ */
166
+ export declare function createConfigSelector<T>(executeFn: (config?: ConfigOptions) => Promise<T>): ConfigSelector<T>;
167
+ //# 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;AAKH,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,E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;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;IAEpB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC9D;AAqGD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,GAChD,cAAc,CAAC,CAAC,CAAC,CA6EnB"}
@@ -1,13 +1,30 @@
1
- import { PaymentFrequency } from "../codama";
2
- import { type Address } from "@solana/kit";
3
- export declare const PROGRAM_ID: Address;
4
- export declare const SAGE_PROGRAM_ADDRESS = "sAgezwJpDb1aHvzNr3o24cKjsETmFEKghBEyJ1askDi";
5
- export declare const PROFILE_FACTION_PROGRAM_ADDRESS = "pFACSRuobDmvfMKq1bAzwj27t6d2GJhSCHb1VcfnRmq";
6
- export declare const DEFAULT_GAME_ID = "GAMEzqJehF8yAnKiTARUuhZMvLvkZVAsCVri5vSfemLr";
1
+ import { type ConfigOptions } from './config';
2
+ import { type Address } from '@solana/kit';
3
+ /**
4
+ * Converts a string or Address to an Address type
5
+ * This utility ensures consistent address handling across the SDK
6
+ */
7
+ export declare function toAddress(value: string | Address<string>): Address<string>;
7
8
  export declare const STARBASE_SEED = "Starbase";
8
9
  export declare const STARBASE_PLAYER_SEED = "starbase_player";
9
10
  export declare const SAGE_PLAYER_PROFILE_SEED = "sage_player_profile";
10
11
  export declare const PROFILE_FACTION_SEED = "profile_faction";
12
+ export declare const ATLAS_TO_STARDUST = 100000000;
13
+ export declare enum PaymentFrequency {
14
+ Hourly = 0,
15
+ Daily = 1,
16
+ DailyOld = 2,
17
+ Weekly = 3,
18
+ Monthly = 4,
19
+ Decasecond = 5,
20
+ Minute = 6
21
+ }
22
+ export declare function getSrslyProgramAddress(config?: ConfigOptions): Promise<Address<string>>;
23
+ export declare function getProgramId(): Promise<Address<string>>;
24
+ export declare function getSageProgramAddress(config?: ConfigOptions): Promise<Address<string>>;
25
+ export declare function getProfileFactionProgramAddress(config?: ConfigOptions): Promise<Address<string>>;
26
+ export declare function getSageGameId(config?: ConfigOptions): Promise<Address<string>>;
27
+ export declare function getAtlasMint(config?: ConfigOptions): Promise<Address<string>>;
11
28
  export declare const FACTION_SPECIFIC_CSS: Record<string, {
12
29
  x: number;
13
30
  y: number;
@@ -17,5 +34,4 @@ export declare const FACTION_MAPPING: Record<number, string>;
17
34
  * Convert PaymentFrequency enum to string
18
35
  */
19
36
  export declare function paymentFrequencyToString(freq: PaymentFrequency): string;
20
- export { PaymentFrequency };
21
37
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAyB,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,eAAO,MAAM,UAAU,EAAE,OAA+B,CAAC;AAGzD,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;I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AsB,+BAA+B,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAMtG;AAED,wBAAsB,aAAa,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAMpF;AAED,wBAAsB,YAAY,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAMnF;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;AAEF;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAEvE"}
@@ -1,3 +1,4 @@
1
1
  export * from "./constants";
2
2
  export * from "./profiles";
3
+ export * from "./config";
3
4
  //# 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"}
@@ -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>;
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../../src/utils/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAIR,MAAM,aAAa,CAAC;AAcrB;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,GACvB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAS1B;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,EAChC,MAAM,GAAE,OAAO,CAAC,MAAM,CAAsC,GAC3D,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAU1B;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,MAAM,GAAE,OAAO,CAAC,MAAM,CAAsC,GAC3D,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAmC1B;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,EAClC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,EACzB,aAAa,GAAE,MAAU,GACxB,OAAO,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xC,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,EAClC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,EACzB,aAAa,GAAE,MAAU,EACzB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAmB1B;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,EACxB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EACxB,aAAa,GAAE,MAAU,EACzB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC;IACT,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC,CAAC,CA4BD"}
package/package.json CHANGED
@@ -1,26 +1,43 @@
1
1
  {
2
2
  "name": "@wuwei-labs/srsly",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.20",
4
4
  "description": "",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/types/index.d.ts",
7
7
  "module": "./dist/esm/index.js",
8
8
  "source": "./src/index.ts",
9
+ "sideEffects": false,
9
10
  "publishConfig": {
10
11
  "access": "public"
11
12
  },
12
13
  "files": [
13
14
  "dist/cjs",
14
15
  "dist/esm",
15
- "dist/types"
16
+ "dist/types",
17
+ "target/idl/srsly.json",
18
+ "target/types/srsly.ts"
16
19
  ],
17
20
  "exports": {
18
21
  ".": {
19
22
  "types": "./dist/types/index.d.ts",
20
23
  "require": "./dist/cjs/index.js",
21
24
  "import": "./dist/esm/index.js",
22
- "default": "./dist/esm/index.js"
23
- }
25
+ "default": "./dist/cjs/index.js"
26
+ },
27
+ "./codama": {
28
+ "types": "./dist/types/codama/index.d.ts",
29
+ "require": "./dist/cjs/codama/index.js",
30
+ "import": "./dist/esm/codama/index.js",
31
+ "default": "./dist/cjs/codama/index.js"
32
+ },
33
+ "./codama/*": {
34
+ "types": "./dist/types/codama/*",
35
+ "require": "./dist/cjs/codama/*",
36
+ "import": "./dist/esm/codama/*",
37
+ "default": "./dist/cjs/codama/*"
38
+ },
39
+ "./idl": "./target/idl/srsly.json",
40
+ "./types": "./target/types/srsly.ts"
24
41
  },
25
42
  "keywords": [
26
43
  "SRSLY",
@@ -29,13 +46,16 @@
29
46
  "sdk"
30
47
  ],
31
48
  "scripts": {
32
- "build": "pnpm run clean && pnpm run build:cjs && pnpm run build:esm",
33
- "build:cjs": "tsc -p tsconfig.cjs.json",
34
- "build:esm": "tsc -p tsconfig.esm.json",
35
- "clean": "rm -rf dist && cargo clean && anchor build && pnpm install && pnpm run generate",
49
+ "package": "pnpm run clean && pnpm build && pnpm run package:cjs && pnpm run package:esm && pnpm run generate",
50
+ "package:cjs": "tsc -p tsconfig.cjs.json && tsconfig-to-dual-package tsconfig.cjs.json",
51
+ "package:esm": "tsc -p tsconfig.esm.json && tsconfig-to-dual-package tsconfig.esm.json",
52
+ "clean": "rm -rf dist && cargo clean && pnpm install",
53
+ "generate": "node generate.mjs",
54
+ "build": "anchor build && pnpm run generate",
36
55
  "docs": "typedoc",
37
- "test": "vitest",
38
- "generate": "node generate.mjs"
56
+ "test": "vitest run",
57
+ "test:watch": "vitest",
58
+ "test:coverage": "vitest run --coverage"
39
59
  },
40
60
  "author": "",
41
61
  "license": "ISC",
@@ -43,14 +63,16 @@
43
63
  "devDependencies": {
44
64
  "@codama/nodes-from-anchor": "^1.1.13",
45
65
  "@codama/renderers": "^1.0.21",
46
- "@types/bn.js": "^5.1.6",
66
+ "@solana/web3.js": "^1.98.2",
67
+ "@types/node": "^24.0.3",
47
68
  "codama": "^1.2.13",
48
- "ts-node": "^10.9.2",
69
+ "tsconfig-to-dual-package": "^1.2.0",
49
70
  "typedoc": "^0.28.3",
50
71
  "typescript": "^5.8.3",
51
- "vitest": "^3.1.2"
72
+ "vitest": "^3.2.4"
52
73
  },
53
74
  "dependencies": {
54
- "@solana/kit": "^2.1.0"
75
+ "@solana/kit": "^2.1.0",
76
+ "@wuwei-labs/srsly": "2.0.0-beta.12"
55
77
  }
56
78
  }