@wuwei-labs/srsly 2.0.0-beta.25 → 2.0.0-beta.28

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 (70) hide show
  1. package/README.md +200 -99
  2. package/dist/cjs/contract/close.js +33 -24
  3. package/dist/cjs/contract/close.js.map +1 -1
  4. package/dist/cjs/contract/create.js +67 -52
  5. package/dist/cjs/contract/create.js.map +1 -1
  6. package/dist/cjs/package.json +2 -6
  7. package/dist/cjs/rental/accept.js +35 -29
  8. package/dist/cjs/rental/accept.js.map +1 -1
  9. package/dist/cjs/rental/cancel.js +13 -9
  10. package/dist/cjs/rental/cancel.js.map +1 -1
  11. package/dist/cjs/rental/close.js +15 -11
  12. package/dist/cjs/rental/close.js.map +1 -1
  13. package/dist/cjs/rental/reset.js +20 -17
  14. package/dist/cjs/rental/reset.js.map +1 -1
  15. package/dist/cjs/utils/config.js +1 -180
  16. package/dist/cjs/utils/config.js.map +1 -1
  17. package/dist/cjs/utils/constants.js +2 -2
  18. package/dist/cjs/utils/constants.js.map +1 -1
  19. package/dist/cjs/utils/index.js +1 -0
  20. package/dist/cjs/utils/index.js.map +1 -1
  21. package/dist/cjs/utils/instruction-converter.js +49 -0
  22. package/dist/cjs/utils/instruction-converter.js.map +1 -0
  23. package/dist/cjs/utils/types.js +6 -0
  24. package/dist/cjs/utils/types.js.map +1 -0
  25. package/dist/esm/contract/close.js +34 -25
  26. package/dist/esm/contract/close.js.map +1 -1
  27. package/dist/esm/contract/create.js +67 -51
  28. package/dist/esm/contract/create.js.map +1 -1
  29. package/dist/esm/package.json +2 -6
  30. package/dist/esm/rental/accept.js +36 -30
  31. package/dist/esm/rental/accept.js.map +1 -1
  32. package/dist/esm/rental/cancel.js +13 -9
  33. package/dist/esm/rental/cancel.js.map +1 -1
  34. package/dist/esm/rental/close.js +15 -11
  35. package/dist/esm/rental/close.js.map +1 -1
  36. package/dist/esm/rental/reset.js +22 -19
  37. package/dist/esm/rental/reset.js.map +1 -1
  38. package/dist/esm/utils/config.js +1 -181
  39. package/dist/esm/utils/config.js.map +1 -1
  40. package/dist/esm/utils/constants.js +2 -2
  41. package/dist/esm/utils/constants.js.map +1 -1
  42. package/dist/esm/utils/index.js +1 -0
  43. package/dist/esm/utils/index.js.map +1 -1
  44. package/dist/esm/utils/instruction-converter.js +45 -0
  45. package/dist/esm/utils/instruction-converter.js.map +1 -0
  46. package/dist/esm/utils/types.js +5 -0
  47. package/dist/esm/utils/types.js.map +1 -0
  48. package/dist/types/contract/close.d.ts +12 -11
  49. package/dist/types/contract/close.d.ts.map +1 -1
  50. package/dist/types/contract/create.d.ts +49 -65
  51. package/dist/types/contract/create.d.ts.map +1 -1
  52. package/dist/types/rental/accept.d.ts +32 -28
  53. package/dist/types/rental/accept.d.ts.map +1 -1
  54. package/dist/types/rental/cancel.d.ts +16 -12
  55. package/dist/types/rental/cancel.d.ts.map +1 -1
  56. package/dist/types/rental/close.d.ts +16 -13
  57. package/dist/types/rental/close.d.ts.map +1 -1
  58. package/dist/types/rental/reset.d.ts +19 -16
  59. package/dist/types/rental/reset.d.ts.map +1 -1
  60. package/dist/types/utils/config.d.ts +6 -84
  61. package/dist/types/utils/config.d.ts.map +1 -1
  62. package/dist/types/utils/constants.d.ts +8 -8
  63. package/dist/types/utils/constants.d.ts.map +1 -1
  64. package/dist/types/utils/index.d.ts +1 -0
  65. package/dist/types/utils/index.d.ts.map +1 -1
  66. package/dist/types/utils/instruction-converter.d.ts +76 -0
  67. package/dist/types/utils/instruction-converter.d.ts.map +1 -0
  68. package/dist/types/utils/types.d.ts +6 -0
  69. package/dist/types/utils/types.d.ts.map +1 -0
  70. package/package.json +2 -6
@@ -4,7 +4,6 @@
4
4
  // Single codama output - network agnostic
5
5
  import * as instructions from '../codama/instructions';
6
6
  import * as programs from '../codama/programs';
7
- import { createSolanaRpc, createSolanaRpcSubscriptions, createTransactionMessage, setTransactionMessageFeePayer, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, compileTransaction, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, pipe, } from '@solana/kit';
8
7
  const PROGRAM_SETS = {
9
8
  mainnet: {
10
9
  SAGE_PROGRAM_ADDRESS: 'SAGE2HAwep459SNq61LHvjxPk4pLPEJLoMETef7f7EE',
@@ -49,7 +48,6 @@ export function resolveProgramAddresses(config) {
49
48
  profileFactionProgramAddress: config.profileFactionProgramAddress || programConfig.PROFILE_FACTION_PROGRAM_ADDRESS,
50
49
  gameId: config.gameId || programConfig.SAGE_GAME_ID,
51
50
  atlasMint: config.atlasMint || programConfig.ATLAS_MINT,
52
- rpcUrl: config.rpcUrl || programConfig.RPC_URL,
53
51
  };
54
52
  }
55
53
  /**
@@ -95,7 +93,7 @@ export function clearConfig() {
95
93
  * @param overrides Optional configuration overrides
96
94
  * @returns Merged configuration with global defaults and any overrides
97
95
  */
98
- function getEffectiveConfig(overrides) {
96
+ export function getEffectiveConfig(overrides) {
99
97
  return { ...globalConfig, ...overrides };
100
98
  }
101
99
  /**
@@ -116,72 +114,6 @@ export async function getCachedNetworkModule(modulePath) {
116
114
  }
117
115
  return getModule(modulePath);
118
116
  }
119
- /**
120
- * Ensures the input is a proper Uint8Array compatible with web3.js
121
- * Handles various TypedArray formats that @solana/kit might return
122
- */
123
- function ensureUint8Array(input) {
124
- // If it's already a standard Uint8Array, return as-is
125
- if (input instanceof Uint8Array && input.constructor === Uint8Array) {
126
- return input;
127
- }
128
- // Handle various ArrayBufferView types (including ReadonlyUint8Array)
129
- if (ArrayBuffer.isView(input)) {
130
- return new Uint8Array(input.buffer, input.byteOffset, input.byteLength);
131
- }
132
- // Handle objects with buffer property (some Node.js environments)
133
- if (input && input.buffer && typeof input.byteLength === 'number') {
134
- return new Uint8Array(input.buffer, input.byteOffset || 0, input.byteLength);
135
- }
136
- // Handle array-like objects and iterables
137
- if (input && typeof input.length === 'number') {
138
- return new Uint8Array(input);
139
- }
140
- // Handle objects that might be iterable but don't have length
141
- if (input && typeof input[Symbol.iterator] === 'function') {
142
- return new Uint8Array(Array.from(input));
143
- }
144
- // Fallback: try to create from the input directly
145
- return new Uint8Array(input);
146
- }
147
- /**
148
- * Create a chainable packed transaction that allows .pack().send() without double await
149
- *
150
- * @param packedTxPromise Promise that resolves to a PackedTransaction
151
- * @returns ChainablePackedTransaction that can be chained with .send()
152
- */
153
- function createChainablePackedTransaction(packedTxPromise) {
154
- let cachedPackedTx = null;
155
- const chainable = {
156
- get messageBytes() {
157
- if (cachedPackedTx)
158
- return cachedPackedTx.messageBytes;
159
- throw new Error('PackedTransaction not yet resolved. Use await on .pack() first, or use .send() directly for chaining.');
160
- },
161
- get signatures() {
162
- if (cachedPackedTx)
163
- return cachedPackedTx.signatures;
164
- throw new Error('PackedTransaction not yet resolved. Use await on .pack() first, or use .send() directly for chaining.');
165
- },
166
- send: async (signer) => {
167
- // If not cached, wait for the packed transaction
168
- if (!cachedPackedTx) {
169
- cachedPackedTx = await packedTxPromise;
170
- }
171
- return cachedPackedTx.send(signer);
172
- }
173
- };
174
- // Make the chainable object thenable so it can be awaited to get the PackedTransaction
175
- const thenable = Object.assign(chainable, {
176
- then(onfulfilled, onrejected) {
177
- return packedTxPromise.then((packedTx) => {
178
- cachedPackedTx = packedTx;
179
- return onfulfilled ? onfulfilled(packedTx) : packedTx;
180
- }, onrejected);
181
- }
182
- });
183
- return thenable;
184
- }
185
117
  /**
186
118
  * Create a chainable config selector with existing configuration state.
187
119
  * This enables config chaining by merging new options with existing ones.
@@ -201,61 +133,6 @@ function createChainableConfigSelector(executeFn, existingConfig) {
201
133
  const selector = {
202
134
  set: (additionalOptions) => createChainableConfigSelector(executeFn, { ...existingConfig, ...additionalOptions }),
203
135
  build: () => executeFn(existingConfig),
204
- pack: (feePayer) => {
205
- const packedTxPromise = (async () => {
206
- const instruction = await executeFn(existingConfig);
207
- const effectiveConfig = getEffectiveConfig(existingConfig);
208
- const resolvedAddresses = resolveProgramAddresses(effectiveConfig);
209
- if (!resolvedAddresses.rpcUrl) {
210
- const networkType = effectiveConfig.programs || 'unknown';
211
- if (networkType === 'atlasnet' || networkType === 'holosim') {
212
- throw new Error(`RPC URL is required for ${networkType} network. Please provide your RPC endpoint via setConfig({ rpcUrl: "your-rpc-url-with-api-key" }) or .set({ rpcUrl: "your-rpc-url-with-api-key" })`);
213
- }
214
- throw new Error('RPC URL is required for creating transactions. Please set it via setConfig({ rpcUrl: "..." }) or provide it in .set({ rpcUrl: "..." })');
215
- }
216
- // Create RPC connection to get latest blockhash
217
- const rpc = createSolanaRpc(resolvedAddresses.rpcUrl);
218
- const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
219
- // Build unsigned transaction message
220
- const transactionMessage = pipe(createTransactionMessage({ version: 0 }), (msg) => setTransactionMessageFeePayer(feePayer, msg), (msg) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, msg), (msg) => appendTransactionMessageInstructions([instruction], msg));
221
- // Compile to unsigned transaction
222
- const unsignedTransaction = compileTransaction(transactionMessage);
223
- // Return raw messageBytes - users can convert to web3.js format if needed:
224
- // import { VersionedTransaction, VersionedMessage } from '@solana/web3.js';
225
- // const versionedMessage = VersionedMessage.deserialize(messageBytes);
226
- // const versionedTx = new VersionedTransaction(versionedMessage);
227
- const messageBytes = ensureUint8Array(unsignedTransaction.messageBytes);
228
- // Return PackedTransaction with send() method
229
- return {
230
- messageBytes,
231
- signatures: unsignedTransaction.signatures,
232
- send: async (signer) => {
233
- // Create RPC connections for sending
234
- const sendRpc = createSolanaRpc(resolvedAddresses.rpcUrl);
235
- const rpcSubscriptions = createSolanaRpcSubscriptions(resolvedAddresses.rpcUrl.replace('https:', 'wss:').replace('http:', 'ws:'));
236
- // Build transaction message with signer
237
- const signerTransactionMessage = pipe(createTransactionMessage({ version: 0 }), (msg) => setTransactionMessageFeePayerSigner(signer, msg), (msg) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, msg), (msg) => appendTransactionMessageInstructions([instruction], msg));
238
- // Sign transaction
239
- const signedTransaction = await signTransactionMessageWithSigners(signerTransactionMessage);
240
- // Send and confirm transaction
241
- const sendAndConfirmTransaction = sendAndConfirmTransactionFactory({ rpc: sendRpc, rpcSubscriptions: rpcSubscriptions });
242
- try {
243
- await sendAndConfirmTransaction(signedTransaction, {
244
- commitment: effectiveConfig.transactionOptions?.commitment || 'confirmed',
245
- skipPreflight: effectiveConfig.transactionOptions?.skipPreflight || false
246
- });
247
- // Extract and return the signature
248
- const signature = getSignatureFromTransaction(signedTransaction);
249
- return signature;
250
- }
251
- catch (error) {
252
- throw new Error(`Transaction failed: ${error instanceof Error ? error.message : String(error)}`);
253
- }
254
- }
255
- };
256
- })();
257
- return createChainablePackedTransaction(packedTxPromise);
258
- },
259
136
  // Implement PromiseLike to allow direct awaiting
260
137
  then(onfulfilled, onrejected) {
261
138
  return executeFn(existingConfig).then(onfulfilled, onrejected);
@@ -286,63 +163,6 @@ export function createConfigSelector(executeFn) {
286
163
  const selector = {
287
164
  set: (options) => createChainableConfigSelector(executeFn, getEffectiveConfig(options)),
288
165
  build: () => executeFn(getEffectiveConfig()),
289
- pack: (feePayer) => {
290
- const packedTxPromise = (async () => {
291
- const instruction = await executeFn(getEffectiveConfig());
292
- const effectiveConfig = getEffectiveConfig();
293
- const resolvedAddresses = resolveProgramAddresses(effectiveConfig);
294
- if (!resolvedAddresses.rpcUrl) {
295
- const networkType = effectiveConfig.programs || 'unknown';
296
- if (networkType === 'atlasnet' || networkType === 'holosim') {
297
- throw new Error(`RPC URL is required for ${networkType} network. Please provide your RPC endpoint via setConfig({ rpcUrl: "your-rpc-url-with-api-key" }) or .set({ rpcUrl: "your-rpc-url-with-api-key" })`);
298
- }
299
- throw new Error('RPC URL is required for creating transactions. Please set it via setConfig({ rpcUrl: "..." }) or provide it in .set({ rpcUrl: "..." })');
300
- }
301
- // Create RPC connection to get latest blockhash
302
- const rpc = createSolanaRpc(resolvedAddresses.rpcUrl);
303
- const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
304
- // Build unsigned transaction message
305
- const transactionMessage = pipe(createTransactionMessage({ version: 0 }), (msg) => setTransactionMessageFeePayer(feePayer, msg), (msg) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, msg), (msg) => appendTransactionMessageInstructions([instruction], msg));
306
- // Compile to unsigned transaction
307
- const unsignedTransaction = compileTransaction(transactionMessage);
308
- // Create a web3.js compatible transaction by converting messageBytes to VersionedMessage
309
- const { VersionedTransaction, VersionedMessage } = await import('@solana/web3.js');
310
- const messageUint8Array = ensureUint8Array(unsignedTransaction.messageBytes);
311
- const versionedMessage = VersionedMessage.deserialize(messageUint8Array);
312
- const versionedTx = new VersionedTransaction(versionedMessage);
313
- // Serialize to get proper messageBytes that can be deserialized by web3.js
314
- const messageBytes = ensureUint8Array(versionedTx.serialize());
315
- // Return PackedTransaction with send() method
316
- return {
317
- messageBytes,
318
- signatures: unsignedTransaction.signatures,
319
- send: async (signer) => {
320
- // Create RPC connections for sending
321
- const sendRpc = createSolanaRpc(resolvedAddresses.rpcUrl);
322
- const rpcSubscriptions = createSolanaRpcSubscriptions(resolvedAddresses.rpcUrl.replace('https:', 'wss:').replace('http:', 'ws:'));
323
- // Build transaction message with signer
324
- const signerTransactionMessage = pipe(createTransactionMessage({ version: 0 }), (msg) => setTransactionMessageFeePayerSigner(signer, msg), (msg) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, msg), (msg) => appendTransactionMessageInstructions([instruction], msg));
325
- // Sign transaction
326
- const signedTransaction = await signTransactionMessageWithSigners(signerTransactionMessage);
327
- // Send and confirm transaction
328
- const sendAndConfirmTransaction = sendAndConfirmTransactionFactory({ rpc: sendRpc, rpcSubscriptions: rpcSubscriptions });
329
- try {
330
- await sendAndConfirmTransaction(signedTransaction, {
331
- commitment: effectiveConfig.transactionOptions?.commitment || 'confirmed',
332
- skipPreflight: effectiveConfig.transactionOptions?.skipPreflight || false
333
- });
334
- // Extract and return the signature
335
- const signature = getSignatureFromTransaction(signedTransaction);
336
- return signature;
337
- }
338
- catch (error) {
339
- throw new Error(`Transaction failed: ${error instanceof Error ? error.message : String(error)}`);
340
- }
341
- }
342
- };
343
- })();
344
- return createChainablePackedTransaction(packedTxPromise);
345
- },
346
166
  // Implement PromiseLike to allow direct awaiting
347
167
  then(onfulfilled, onrejected) {
348
168
  return executeFn(getEffectiveConfig()).then(onfulfilled, onrejected);
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,0CAA0C;AAC1C,OAAO,KAAK,YAAY,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAIL,eAAe,EACf,4BAA4B,EAC5B,wBAAwB,EACxB,6BAA6B,EAC7B,mCAAmC,EACnC,2CAA2C,EAC3C,oCAAoC,EACpC,kBAAkB,EAClB,iCAAiC,EACjC,gCAAgC,EAChC,2BAA2B,EAC3B,IAAI,GACL,MAAM,aAAa,CAAC;AAIrB,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE;QACP,oBAAoB,EAAE,6CAA6C;QACnE,+BAA+B,EAAE,6CAA6C;QAC9E,YAAY,EAAE,8CAA8C;QAC5D,UAAU,EAAE,8CAA8C;QAC1D,OAAO,EAAE,qCAAqC;KAC/C;IACD,QAAQ,EAAE;QACR,oBAAoB,EAAE,6CAA6C;QACnE,+BAA+B,EAAE,6CAA6C;QAC9E,YAAY,EAAE,8CAA8C;QAC5D,UAAU,EAAE,8CAA8C;KAC3D;IACD,OAAO,EAAE;QACP,oBAAoB,EAAE,6CAA6C;QACnE,+BAA+B,EAAE,6CAA6C;QAC9E,YAAY,EAAE,8CAA8C;QAC5D,UAAU,EAAE,8CAA8C;KAC3D;CACO,CAAC;AAkBX,6CAA6C;AAC7C,MAAM,mBAAmB,GAAe,UAAU,CAAC;AAEnD,6BAA6B;AAC7B,IAAI,YAA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SAAS,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QACjE,CAAC;KACF,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,oBAAoB,CAClC,SAAiD;IAEjD,MAAM,QAAQ,GAAG;QACf,GAAG,EAAE,CAAC,OAAsB,EAAE,EAAE,CAAC,6BAA6B,CAAC,SAAS,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;QACtG,KAAK,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC5C,iDAAiD;QACjD,IAAI,CACF,WAAqE,EACrE,UAAuE;YAEvE,OAAO,SAAS,CAAC,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QACvE,CAAC;KACF,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import { getConfig, resolveProgramAddresses } from './config';
2
- import { address } from '@solana/kit';
3
2
  /**
4
3
  * Converts a string or Address to an Address type
5
4
  * This utility ensures consistent address handling across the SDK
5
+ * Note: This is a simple passthrough now since pack functions handle library-specific conversions
6
6
  */
7
7
  export function toAddress(value) {
8
- return typeof value === 'string' ? address(value) : value;
8
+ return value;
9
9
  }
10
10
  // Seed constants
11
11
  export const STARBASE_SEED = 'Starbase';
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAsB,MAAM,UAAU,CAAC;AAClF,OAAO,EAAgB,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,KAA+B;IACvD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CA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CAAC,EAAE,KAAK;IACR,CAAC,EAAE,OAAO;CACX,CAAC;AAEF,kEAAkE"}
@@ -3,4 +3,5 @@ export * from "./profiles";
3
3
  export * from "./config";
4
4
  export * from "./paymentFrequency";
5
5
  export * from "./duration";
6
+ export * from "./instruction-converter";
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Fluent instruction interface for format conversion between @solana/kit and @solana/web3.js
3
+ */
4
+ /**
5
+ * Create a fluent instruction wrapper around a kit instruction
6
+ * @param kitInstruction The base instruction in kit format
7
+ * @returns Fluent instruction with conversion methods
8
+ */
9
+ export function createFluentInstruction(kitInstruction) {
10
+ return {
11
+ ...kitInstruction,
12
+ web3js() {
13
+ return {
14
+ keys: kitInstruction.accounts.map(account => ({
15
+ pubkey: account.address,
16
+ isWritable: (account.role & 1) === 1, // Check if writable bit is set
17
+ isSigner: (account.role & 2) === 2, // Check if signer bit is set
18
+ })),
19
+ programId: kitInstruction.programAddress,
20
+ data: kitInstruction.data
21
+ };
22
+ }
23
+ };
24
+ }
25
+ /**
26
+ * Create a fluent config selector that adds format conversion methods
27
+ * @param baseSelector The base ConfigSelector
28
+ * @returns FluentConfigSelector with additional format conversion methods
29
+ */
30
+ export function createFluentConfigSelector(baseSelector) {
31
+ return {
32
+ // Override set to return FluentConfigSelector
33
+ set(options) {
34
+ const newBaseSelector = baseSelector.set(options);
35
+ return createFluentConfigSelector(newBaseSelector);
36
+ },
37
+ build: baseSelector.build,
38
+ then: baseSelector.then,
39
+ async web3js() {
40
+ const fluentInstruction = await baseSelector.build();
41
+ return fluentInstruction.web3js();
42
+ }
43
+ };
44
+ }
45
+ //# sourceMappingURL=instruction-converter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instruction-converter.js","sourceRoot":"","sources":["../../../src/utils/instruction-converter.ts"],"names":[],"mappings":"AAAA;;GAEG;AA+DH;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,cAA8B;IACpE,OAAO;QACL,GAAG,cAAc;QACjB,MAAM;YACJ,OAAO;gBACL,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;oBAC5C,MAAM,EAAE,OAAO,CAAC,OAAO;oBACvB,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,+BAA+B;oBACrE,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,EAAI,6BAA6B;iBACpE,CAAC,CAAC;gBACH,SAAS,EAAE,cAAc,CAAC,cAAc;gBACxC,IAAI,EAAE,cAAc,CAAC,IAAI;aAC1B,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CACxC,YAA+B;IAE/B,OAAO;QACL,8CAA8C;QAC9C,GAAG,CAAC,OAAO;YACT,MAAM,eAAe,GAAG,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAClD,OAAO,0BAA0B,CAAC,eAAe,CAAC,CAAC;QACrD,CAAC;QACD,KAAK,EAAE,YAAY,CAAC,KAAK;QACzB,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,KAAK,CAAC,MAAM;YACV,MAAM,iBAAiB,GAAG,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC;YACrD,OAAO,iBAAiB,CAAC,MAAM,EAAE,CAAC;QACpC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Universal types that work with both @solana/kit and @solana/web3.js
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1,22 +1,23 @@
1
- import { Address, TransactionSigner } from '@solana/kit';
2
1
  import { type ConfigSelector } from '../utils/config';
3
- type CloseContractInstruction = any;
2
+ import { type FluentInstruction, type FluentConfigSelector } from '../utils/instruction-converter';
3
+ type UniversalAddress = string;
4
+ type UniversalSigner = any;
4
5
  /**
5
- * Simplified parameters for closing a rental contract
6
+ * Simplified parameters for closing a rental contract - strings only!
6
7
  */
7
8
  export interface CloseContractParams {
8
9
  /**
9
- * The owner wallet that will sign the transaction
10
+ * The owner wallet that will sign the transaction (can be signer or string)
10
11
  */
11
- owner: TransactionSigner<string>;
12
+ owner: UniversalSigner | UniversalAddress;
12
13
  /**
13
14
  * The fleet account address associated with the contract
14
15
  */
15
- fleet: string | Address<string>;
16
+ fleet: UniversalAddress;
16
17
  /**
17
18
  * The rental contract account address to close
18
19
  */
19
- contract: string | Address<string>;
20
+ contract: UniversalAddress;
20
21
  /**
21
22
  * Optional faction (1 = mud, 2 = oni, 3 = ustur)
22
23
  * Or as string: 'mud', 'oni', 'ustur'
@@ -26,7 +27,7 @@ export interface CloseContractParams {
26
27
  * The game ID account address
27
28
  * If not provided, will use network-specific default
28
29
  */
29
- gameId?: string | Address<string>;
30
+ gameId?: UniversalAddress;
30
31
  }
31
32
  /**
32
33
  * Creates an instruction to close a rental contract with fluent configuration.
@@ -36,17 +37,17 @@ export interface CloseContractParams {
36
37
  *
37
38
  * @example
38
39
  * ```typescript
39
- * // Use devnet defaults
40
+ * // Use atlasnet defaults (instruction building only)
40
41
  * await closeContract(params);
41
42
  *
42
43
  * // Use mainnet
43
- * await closeContract(params).set({ network: 'mainnet' });
44
+ * await closeContract(params).set({ programs: 'mainnet' });
44
45
  *
45
46
  * // Override game ID
46
47
  * await closeContract(params).set({ gameId: 'custom...' });
47
48
  * ```
48
49
  */
49
- export declare function closeContract(params: CloseContractParams): ConfigSelector<CloseContractInstruction>;
50
+ export declare function closeContract(params: CloseContractParams): FluentConfigSelector<FluentInstruction>;
50
51
  export declare function getCloseContractInstructionAsync(input: any, options?: any): ConfigSelector<any>;
51
52
  export {};
52
53
  //# sourceMappingURL=close.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../src/contract/close.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAmC,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAI3G,KAAK,wBAAwB,GAAG,GAAG,CAAC;AAMpC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnC;;;OAGG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnC;AA0FD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,mBAAmB,GAC1B,cAAc,CAAC,wBAAwB,CAAC,CAE1C;AAGD,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAK/F"}
1
+ {"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../src/contract/close.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAG3G,OAAO,EAAuD,KAAK,iBAAiB,EAAE,KAAK,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGxJ,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAC/B,KAAK,eAAe,GAAG,GAAG,CAAC;AAE3B;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAAC;IAE1C;;OAEG;IACH,KAAK,EAAE,gBAAgB,CAAC;IAExB;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;;OAGG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAkGD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,mBAAmB,GAC1B,oBAAoB,CAAC,iBAAiB,CAAC,CAGzC;AAGD,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAK/F"}
@@ -1,87 +1,71 @@
1
- import { Address, TransactionSigner } from '@solana/kit';
2
- import { type ConfigSelector } from '../utils/config';
1
+ /**
2
+ * Unified contract creation - works with both @solana/kit and @solana/web3.js
3
+ * Uses strings for all addresses to eliminate library-specific type complexity
4
+ */
3
5
  import { PaymentFrequencyString } from '../types/paymentFrequency';
4
- type CreateContractInstruction = any;
6
+ import { type FluentInstruction, type FluentConfigSelector } from '../utils/instruction-converter';
7
+ type UniversalAddress = string;
8
+ type UniversalSigner = any;
5
9
  /**
6
- * Simplified parameters for creating a rental contract
10
+ * Simplified parameters for creating a rental contract - strings only!
7
11
  */
8
12
  export interface CreateContractParams {
9
- /**
10
- * The owner wallet that will sign the transaction
11
- */
12
- owner: TransactionSigner<string>;
13
- /**
14
- * The fleet account address to be rented out
15
- */
16
- fleet: string | Address<string>;
17
- /**
18
- * The owner's profile account address
19
- */
20
- ownerProfile: string | Address<string>;
21
- /**
22
- * The rental rate in ATLAS tokens
23
- */
24
- rate: number | bigint;
25
- /**
26
- * The maximum rental duration in seconds
27
- * Must be a multiple of the payment frequency interval
28
- * e.g., 2592000 for "30 days" with daily frequency, 86400 for "24 hours" with hourly frequency
29
- */
30
- durationMax: number | bigint;
31
- /**
32
- * The payment frequency (e.g., "daily", "weekly", "monthly")
33
- * Valid values are auto-generated from Rust PaymentFrequency enum
34
- * Note: Do not include the '@' prefix - it will be added automatically
35
- * The minimum rental duration will be automatically set to the payment frequency interval
36
- */
13
+ owner: UniversalSigner | UniversalAddress;
14
+ fleet: UniversalAddress;
15
+ ownerProfile: UniversalAddress;
16
+ rate: number;
17
+ durationMax: number;
37
18
  paymentsFreq: PaymentFrequencyString;
38
- /**
39
- * The owner key index
40
- * Typically 0 unless the owner has multiple authorized keys
41
- */
19
+ gameId?: UniversalAddress;
20
+ sageProgramAddress?: UniversalAddress;
21
+ atlasMint?: UniversalAddress;
42
22
  ownerKeyIndex?: number;
43
- /**
44
- * The game ID account address
45
- * If not provided, will use network-specific default
46
- */
47
- gameId?: string | Address<string>;
48
- /**
49
- * The ATLAS mint address
50
- * If not provided, will use the default ATLAS mint
51
- */
52
- mint?: string | Address<string>;
53
23
  }
54
24
  /**
55
25
  * Creates an instruction to create a rental contract with fluent configuration.
26
+ * This unified version works with both @solana/kit and @solana/web3.js using strings for addresses.
56
27
  *
57
28
  * @example
58
29
  * ```typescript
59
- * // Use devnet defaults
60
- * const ix = await createContract(params);
30
+ * // Works with any library - just use strings for addresses!
61
31
  *
62
- * // Use mainnet configuration
63
- * const ix = await createContract(params).set({ network: 'mainnet' });
64
- *
65
- * // Override specific constants
66
- * const ix = await createContract(params).set({
67
- * network: 'mainnet',
68
- * gameId: 'custom-game-id...',
69
- * sageProgramAddress: 'custom-sage...'
32
+ * // Default returns @solana/kit format
33
+ * const kitInstruction = await createContract({
34
+ * owner: wallet, // Can be signer object or string
35
+ * fleet: "FleetAddress123...", // String address
36
+ * ownerProfile: "ProfileAddr...", // String address
37
+ * rate: 1000,
38
+ * durationMax: days(7),
39
+ * paymentsFreq: 'daily'
70
40
  * });
71
41
  *
72
- * // Chain configurations
73
- * const ix = await createContract(params)
74
- * .set({ network: 'devnet' })
75
- * .set({ gameId: 'override-game...' });
42
+ * // Convert to @solana/web3.js format using fluent interface
43
+ * const web3jsInstruction = await createContract({
44
+ * owner: wallet,
45
+ * fleet: "FleetAddress123...",
46
+ * ownerProfile: "ProfileAddr...",
47
+ * rate: 1000,
48
+ * durationMax: days(7),
49
+ * paymentsFreq: 'daily'
50
+ * }).web3js();
51
+ *
52
+ * // Chain configuration and format conversion
53
+ * const web3jsInstructionWithConfig = await createContract({
54
+ * owner: wallet,
55
+ * fleet: "FleetAddress123...",
56
+ * ownerProfile: "ProfileAddr...",
57
+ * rate: 1000,
58
+ * durationMax: days(7),
59
+ * paymentsFreq: 'daily'
60
+ * }).set({ programs: 'mainnet' }).web3js();
61
+ *
62
+ * // Use with your preferred Solana library
63
+ * const transaction = new Transaction().add(web3jsInstruction);
76
64
  * ```
77
65
  *
78
66
  * @param params The simplified parameters for creating a rental contract
79
67
  * @returns A ConfigSelector that can be configured with .set() or awaited directly
80
68
  */
81
- export declare function createContract(params: CreateContractParams): ConfigSelector<CreateContractInstruction>;
82
- /**
83
- * Export config selector for getCreateContractInstructionAsync
84
- */
85
- export declare function getCreateContractInstructionAsync(input: any, options?: any): ConfigSelector<any>;
69
+ export declare function createContract(params: CreateContractParams): FluentConfigSelector<FluentInstruction>;
86
70
  export {};
87
71
  //# sourceMappingURL=create.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/contract/create.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAmC,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAG3G,OAAO,EAAE,sBAAsB,EAA2B,MAAM,2BAA2B,CAAC;AAG5F,KAAK,yBAAyB,GAAG,GAAG,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvC;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtB;;;;OAIG;IACH,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAE7B;;;;;OAKG;IACH,YAAY,EAAE,sBAAsB,CAAC;IAErC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAElC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC;AAkED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,oBAAoB,GAC3B,cAAc,CAAC,yBAAyB,CAAC,CAE3C;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAKhG"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/contract/create.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