@wuwei-labs/srsly 2.0.0-beta.26 → 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.
- package/README.md +189 -97
- package/dist/cjs/contract/close.js +33 -24
- package/dist/cjs/contract/close.js.map +1 -1
- package/dist/cjs/contract/create.js +67 -52
- package/dist/cjs/contract/create.js.map +1 -1
- package/dist/cjs/package.json +2 -13
- package/dist/cjs/rental/accept.js +35 -29
- package/dist/cjs/rental/accept.js.map +1 -1
- package/dist/cjs/rental/cancel.js +13 -9
- package/dist/cjs/rental/cancel.js.map +1 -1
- package/dist/cjs/rental/close.js +15 -11
- package/dist/cjs/rental/close.js.map +1 -1
- package/dist/cjs/rental/reset.js +20 -17
- package/dist/cjs/rental/reset.js.map +1 -1
- package/dist/cjs/utils/config.js +0 -88
- package/dist/cjs/utils/config.js.map +1 -1
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/instruction-converter.js +49 -0
- package/dist/cjs/utils/instruction-converter.js.map +1 -0
- package/dist/esm/contract/close.js +34 -25
- package/dist/esm/contract/close.js.map +1 -1
- package/dist/esm/contract/create.js +67 -51
- package/dist/esm/contract/create.js.map +1 -1
- package/dist/esm/package.json +2 -13
- package/dist/esm/rental/accept.js +36 -30
- package/dist/esm/rental/accept.js.map +1 -1
- package/dist/esm/rental/cancel.js +13 -9
- package/dist/esm/rental/cancel.js.map +1 -1
- package/dist/esm/rental/close.js +15 -11
- package/dist/esm/rental/close.js.map +1 -1
- package/dist/esm/rental/reset.js +22 -19
- package/dist/esm/rental/reset.js.map +1 -1
- package/dist/esm/utils/config.js +0 -88
- package/dist/esm/utils/config.js.map +1 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/instruction-converter.js +45 -0
- package/dist/esm/utils/instruction-converter.js.map +1 -0
- package/dist/types/contract/close.d.ts +12 -11
- package/dist/types/contract/close.d.ts.map +1 -1
- package/dist/types/contract/create.d.ts +49 -65
- package/dist/types/contract/create.d.ts.map +1 -1
- package/dist/types/rental/accept.d.ts +32 -28
- package/dist/types/rental/accept.d.ts.map +1 -1
- package/dist/types/rental/cancel.d.ts +16 -12
- package/dist/types/rental/cancel.d.ts.map +1 -1
- package/dist/types/rental/close.d.ts +16 -13
- package/dist/types/rental/close.d.ts.map +1 -1
- package/dist/types/rental/reset.d.ts +19 -16
- package/dist/types/rental/reset.d.ts.map +1 -1
- package/dist/types/utils/config.d.ts +0 -95
- package/dist/types/utils/config.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/instruction-converter.d.ts +76 -0
- package/dist/types/utils/instruction-converter.d.ts.map +1 -0
- package/dist/types/utils/types.d.ts +0 -8
- package/dist/types/utils/types.d.ts.map +1 -1
- package/package.json +2 -13
- package/dist/cjs/utils/pack-functions.js +0 -148
- package/dist/cjs/utils/pack-functions.js.map +0 -1
- package/dist/cjs/utils/solana-adapter.js +0 -120
- package/dist/cjs/utils/solana-adapter.js.map +0 -1
- package/dist/esm/utils/pack-functions.js +0 -110
- package/dist/esm/utils/pack-functions.js.map +0 -1
- package/dist/esm/utils/solana-adapter.js +0 -82
- package/dist/esm/utils/solana-adapter.js.map +0 -1
- package/dist/types/utils/pack-functions.d.ts +0 -18
- package/dist/types/utils/pack-functions.d.ts.map +0 -1
- package/dist/types/utils/solana-adapter.d.ts +0 -26
- package/dist/types/utils/solana-adapter.d.ts.map +0 -1
package/dist/cjs/utils/config.js
CHANGED
|
@@ -47,7 +47,6 @@ exports.createConfigSelector = createConfigSelector;
|
|
|
47
47
|
// Single codama output - network agnostic
|
|
48
48
|
const instructions = __importStar(require("../codama/instructions"));
|
|
49
49
|
const programs = __importStar(require("../codama/programs"));
|
|
50
|
-
const pack_functions_1 = require("./pack-functions");
|
|
51
50
|
const PROGRAM_SETS = {
|
|
52
51
|
mainnet: {
|
|
53
52
|
SAGE_PROGRAM_ADDRESS: 'SAGE2HAwep459SNq61LHvjxPk4pLPEJLoMETef7f7EE',
|
|
@@ -92,7 +91,6 @@ function resolveProgramAddresses(config) {
|
|
|
92
91
|
profileFactionProgramAddress: config.profileFactionProgramAddress || programConfig.PROFILE_FACTION_PROGRAM_ADDRESS,
|
|
93
92
|
gameId: config.gameId || programConfig.SAGE_GAME_ID,
|
|
94
93
|
atlasMint: config.atlasMint || programConfig.ATLAS_MINT,
|
|
95
|
-
rpcUrl: config.rpcUrl || programConfig.RPC_URL,
|
|
96
94
|
};
|
|
97
95
|
}
|
|
98
96
|
/**
|
|
@@ -159,44 +157,6 @@ async function getCachedNetworkModule(modulePath) {
|
|
|
159
157
|
}
|
|
160
158
|
return getModule(modulePath);
|
|
161
159
|
}
|
|
162
|
-
/**
|
|
163
|
-
* Create a chainable packed transaction that allows .pack().send() without double await
|
|
164
|
-
*
|
|
165
|
-
* @param packedTxPromise Promise that resolves to a PackedTransaction
|
|
166
|
-
* @returns ChainablePackedTransaction that can be chained with .send()
|
|
167
|
-
*/
|
|
168
|
-
function createChainablePackedTransaction(packedTxPromise) {
|
|
169
|
-
let cachedPackedTx = null;
|
|
170
|
-
const chainable = {
|
|
171
|
-
get messageBytes() {
|
|
172
|
-
if (cachedPackedTx)
|
|
173
|
-
return cachedPackedTx.messageBytes;
|
|
174
|
-
throw new Error('PackedTransaction not yet resolved. Use await on .pack() first, or use .send() directly for chaining.');
|
|
175
|
-
},
|
|
176
|
-
get signatures() {
|
|
177
|
-
if (cachedPackedTx)
|
|
178
|
-
return cachedPackedTx.signatures;
|
|
179
|
-
throw new Error('PackedTransaction not yet resolved. Use await on .pack() first, or use .send() directly for chaining.');
|
|
180
|
-
},
|
|
181
|
-
send: async (signer) => {
|
|
182
|
-
// If not cached, wait for the packed transaction
|
|
183
|
-
if (!cachedPackedTx) {
|
|
184
|
-
cachedPackedTx = await packedTxPromise;
|
|
185
|
-
}
|
|
186
|
-
return cachedPackedTx.send(signer);
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
// Make the chainable object thenable so it can be awaited to get the PackedTransaction
|
|
190
|
-
const thenable = Object.assign(chainable, {
|
|
191
|
-
then(onfulfilled, onrejected) {
|
|
192
|
-
return packedTxPromise.then((packedTx) => {
|
|
193
|
-
cachedPackedTx = packedTx;
|
|
194
|
-
return onfulfilled ? onfulfilled(packedTx) : packedTx;
|
|
195
|
-
}, onrejected);
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
return thenable;
|
|
199
|
-
}
|
|
200
160
|
/**
|
|
201
161
|
* Create a chainable config selector with existing configuration state.
|
|
202
162
|
* This enables config chaining by merging new options with existing ones.
|
|
@@ -216,30 +176,6 @@ function createChainableConfigSelector(executeFn, existingConfig) {
|
|
|
216
176
|
const selector = {
|
|
217
177
|
set: (additionalOptions) => createChainableConfigSelector(executeFn, { ...existingConfig, ...additionalOptions }),
|
|
218
178
|
build: () => executeFn(existingConfig),
|
|
219
|
-
packKit: (feePayer) => {
|
|
220
|
-
const packedTxPromise = (async () => {
|
|
221
|
-
const instruction = await executeFn(existingConfig);
|
|
222
|
-
const effectiveConfig = getEffectiveConfig(existingConfig);
|
|
223
|
-
return await (0, pack_functions_1.packWithKit)(instruction, feePayer, effectiveConfig);
|
|
224
|
-
})();
|
|
225
|
-
return createChainablePackedTransaction(packedTxPromise);
|
|
226
|
-
},
|
|
227
|
-
packWeb3js: (feePayer) => {
|
|
228
|
-
const packedTxPromise = (async () => {
|
|
229
|
-
const instruction = await executeFn(existingConfig);
|
|
230
|
-
const effectiveConfig = getEffectiveConfig(existingConfig);
|
|
231
|
-
return await (0, pack_functions_1.packWithWeb3js)(instruction, feePayer, effectiveConfig);
|
|
232
|
-
})();
|
|
233
|
-
return createChainablePackedTransaction(packedTxPromise);
|
|
234
|
-
},
|
|
235
|
-
pack: (feePayer) => {
|
|
236
|
-
const packedTxPromise = (async () => {
|
|
237
|
-
const instruction = await executeFn(existingConfig);
|
|
238
|
-
const effectiveConfig = getEffectiveConfig(existingConfig);
|
|
239
|
-
return await (0, pack_functions_1.packWithAuto)(instruction, feePayer, effectiveConfig);
|
|
240
|
-
})();
|
|
241
|
-
return createChainablePackedTransaction(packedTxPromise);
|
|
242
|
-
},
|
|
243
179
|
// Implement PromiseLike to allow direct awaiting
|
|
244
180
|
then(onfulfilled, onrejected) {
|
|
245
181
|
return executeFn(existingConfig).then(onfulfilled, onrejected);
|
|
@@ -270,30 +206,6 @@ function createConfigSelector(executeFn) {
|
|
|
270
206
|
const selector = {
|
|
271
207
|
set: (options) => createChainableConfigSelector(executeFn, getEffectiveConfig(options)),
|
|
272
208
|
build: () => executeFn(getEffectiveConfig()),
|
|
273
|
-
packKit: (feePayer) => {
|
|
274
|
-
const packedTxPromise = (async () => {
|
|
275
|
-
const instruction = await executeFn(getEffectiveConfig());
|
|
276
|
-
const effectiveConfig = getEffectiveConfig();
|
|
277
|
-
return await (0, pack_functions_1.packWithKit)(instruction, feePayer, effectiveConfig);
|
|
278
|
-
})();
|
|
279
|
-
return createChainablePackedTransaction(packedTxPromise);
|
|
280
|
-
},
|
|
281
|
-
packWeb3js: (feePayer) => {
|
|
282
|
-
const packedTxPromise = (async () => {
|
|
283
|
-
const instruction = await executeFn(getEffectiveConfig());
|
|
284
|
-
const effectiveConfig = getEffectiveConfig();
|
|
285
|
-
return await (0, pack_functions_1.packWithWeb3js)(instruction, feePayer, effectiveConfig);
|
|
286
|
-
})();
|
|
287
|
-
return createChainablePackedTransaction(packedTxPromise);
|
|
288
|
-
},
|
|
289
|
-
pack: (feePayer) => {
|
|
290
|
-
const packedTxPromise = (async () => {
|
|
291
|
-
const instruction = await executeFn(getEffectiveConfig());
|
|
292
|
-
const effectiveConfig = getEffectiveConfig();
|
|
293
|
-
return await (0, pack_functions_1.packWithAuto)(instruction, feePayer, effectiveConfig);
|
|
294
|
-
})();
|
|
295
|
-
return createChainablePackedTransaction(packedTxPromise);
|
|
296
|
-
},
|
|
297
209
|
// Implement PromiseLike to allow direct awaiting
|
|
298
210
|
then(onfulfilled, onrejected) {
|
|
299
211
|
return executeFn(getEffectiveConfig()).then(onfulfilled, onrejected);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDH,0DAiBC;AAwBD,8BAEC;AAMD,8BAEC;AAKD,kCAEC;AAQD,gDAEC;AAOD,8BAEC;AAMD,wDAKC;AA2ED,oDAgBC;AArOD,0CAA0C;AAC1C,qEAAuD;AACvD,6DAA+C;AAI/C,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;AAaX,6CAA6C;AAC7C,MAAM,mBAAmB,GAAe,UAAU,CAAC;AAEnD,6BAA6B;AAC7B,IAAI,YAAY,GAAkB,EAAE,CAAC;AAErC;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,MAAqB;IAC3D,qCAAqC;IACrC,MAAM,UAAU,GAAG,MAA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"), exports);
|
|
|
19
19
|
__exportStar(require("./config"), exports);
|
|
20
20
|
__exportStar(require("./paymentFrequency"), exports);
|
|
21
21
|
__exportStar(require("./duration"), exports);
|
|
22
|
+
__exportStar(require("./instruction-converter"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,6CAA2B;AAC3B,2CAAyB;AACzB,qDAAmC;AACnC,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,6CAA2B;AAC3B,2CAAyB;AACzB,qDAAmC;AACnC,6CAA2B;AAC3B,0DAAwC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Fluent instruction interface for format conversion between @solana/kit and @solana/web3.js
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createFluentInstruction = createFluentInstruction;
|
|
7
|
+
exports.createFluentConfigSelector = createFluentConfigSelector;
|
|
8
|
+
/**
|
|
9
|
+
* Create a fluent instruction wrapper around a kit instruction
|
|
10
|
+
* @param kitInstruction The base instruction in kit format
|
|
11
|
+
* @returns Fluent instruction with conversion methods
|
|
12
|
+
*/
|
|
13
|
+
function createFluentInstruction(kitInstruction) {
|
|
14
|
+
return {
|
|
15
|
+
...kitInstruction,
|
|
16
|
+
web3js() {
|
|
17
|
+
return {
|
|
18
|
+
keys: kitInstruction.accounts.map(account => ({
|
|
19
|
+
pubkey: account.address,
|
|
20
|
+
isWritable: (account.role & 1) === 1, // Check if writable bit is set
|
|
21
|
+
isSigner: (account.role & 2) === 2, // Check if signer bit is set
|
|
22
|
+
})),
|
|
23
|
+
programId: kitInstruction.programAddress,
|
|
24
|
+
data: kitInstruction.data
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create a fluent config selector that adds format conversion methods
|
|
31
|
+
* @param baseSelector The base ConfigSelector
|
|
32
|
+
* @returns FluentConfigSelector with additional format conversion methods
|
|
33
|
+
*/
|
|
34
|
+
function createFluentConfigSelector(baseSelector) {
|
|
35
|
+
return {
|
|
36
|
+
// Override set to return FluentConfigSelector
|
|
37
|
+
set(options) {
|
|
38
|
+
const newBaseSelector = baseSelector.set(options);
|
|
39
|
+
return createFluentConfigSelector(newBaseSelector);
|
|
40
|
+
},
|
|
41
|
+
build: baseSelector.build,
|
|
42
|
+
then: baseSelector.then,
|
|
43
|
+
async web3js() {
|
|
44
|
+
const fluentInstruction = await baseSelector.build();
|
|
45
|
+
return fluentInstruction.web3js();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# 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;;AAoEH,0DAeC;AAOD,gEAgBC;AA3CD;;;;GAIG;AACH,SAAgB,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,SAAgB,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"}
|
|
@@ -1,38 +1,42 @@
|
|
|
1
1
|
import { getModule, createConfigSelector } from '../utils/config';
|
|
2
2
|
import { getSageGameId, toAddress } from '../utils/constants';
|
|
3
|
-
import { deriveGameAccounts
|
|
3
|
+
import { deriveGameAccounts } from '../utils';
|
|
4
|
+
import { createFluentInstruction, createFluentConfigSelector } from '../utils/instruction-converter';
|
|
4
5
|
/**
|
|
5
6
|
* Asynchronously creates an instruction to close a rental contract with minimal required parameters.
|
|
6
7
|
* Derives rentalAuthority automatically and handles optional parameters.
|
|
7
8
|
*
|
|
8
9
|
* @example
|
|
9
10
|
* ```typescript
|
|
10
|
-
* //
|
|
11
|
-
* const
|
|
12
|
-
* owner: wallet,
|
|
13
|
-
* fleet:
|
|
14
|
-
* contract:
|
|
11
|
+
* // Works with any library - just use strings for addresses!
|
|
12
|
+
* const instruction = await closeContract({
|
|
13
|
+
* owner: wallet, // Can be signer object or string
|
|
14
|
+
* fleet: "FleetAddress123...", // String address
|
|
15
|
+
* contract: "ContractAddr...", // String address
|
|
15
16
|
* faction: 'mud',
|
|
16
17
|
* });
|
|
17
18
|
*
|
|
18
19
|
* // Use mainnet configuration
|
|
19
|
-
* const
|
|
20
|
+
* const instruction = await closeContract({
|
|
20
21
|
* owner: wallet,
|
|
21
|
-
* fleet:
|
|
22
|
-
* contract:
|
|
22
|
+
* fleet: "FleetAddress123...",
|
|
23
|
+
* contract: "ContractAddr...",
|
|
23
24
|
* faction: 'mud',
|
|
24
|
-
* }).set({
|
|
25
|
+
* }).set({ programs: 'mainnet' });
|
|
25
26
|
*
|
|
26
27
|
* // Override specific constants
|
|
27
|
-
* const
|
|
28
|
+
* const instruction = await closeContract({
|
|
28
29
|
* owner: wallet,
|
|
29
|
-
* fleet:
|
|
30
|
-
* contract:
|
|
30
|
+
* fleet: "FleetAddress123...",
|
|
31
|
+
* contract: "ContractAddr...",
|
|
31
32
|
* faction: 'mud',
|
|
32
33
|
* }).set({
|
|
33
|
-
*
|
|
34
|
+
* programs: 'mainnet',
|
|
34
35
|
* gameId: 'custom-game-id...'
|
|
35
36
|
* });
|
|
37
|
+
*
|
|
38
|
+
* // Use the instruction with your preferred Solana library
|
|
39
|
+
* // instruction is compatible with both @solana/kit and @solana/web3.js
|
|
36
40
|
* ```
|
|
37
41
|
*
|
|
38
42
|
* @param params The simplified parameters for closing a rental contract
|
|
@@ -45,7 +49,10 @@ async function _closeContract(params, config) {
|
|
|
45
49
|
const { owner, fleet, contract, faction, gameId, } = params;
|
|
46
50
|
// Get the actual game ID to use (param override, config override, or network default)
|
|
47
51
|
const actualGameId = gameId ? toAddress(gameId) : await getSageGameId(config);
|
|
48
|
-
|
|
52
|
+
// Extract owner address (handle both string and signer object)
|
|
53
|
+
const ownerAddress = typeof owner === 'string' ? owner :
|
|
54
|
+
(owner && typeof owner === 'object' && 'address' in owner) ? owner.address : owner;
|
|
55
|
+
const derivedAccounts = await deriveGameAccounts(ownerAddress, faction, actualGameId, 0, // starbaseSeqId
|
|
49
56
|
config);
|
|
50
57
|
const starbase = derivedAccounts.starbase;
|
|
51
58
|
const starbasePlayer = derivedAccounts.starbasePlayer;
|
|
@@ -56,14 +63,15 @@ async function _closeContract(params, config) {
|
|
|
56
63
|
const { SRSLY_PROGRAM_ADDRESS } = programsModule;
|
|
57
64
|
// Let codama derive the rest (rentalAuthority, ownerTokenAccount, etc.)
|
|
58
65
|
const input = {
|
|
59
|
-
owner,
|
|
60
|
-
fleet: toAddress(fleet),
|
|
61
|
-
contract: toAddress(contract),
|
|
62
|
-
starbase,
|
|
63
|
-
starbasePlayer,
|
|
64
|
-
gameId: actualGameId,
|
|
66
|
+
owner, // Pass as-is (string or signer)
|
|
67
|
+
fleet: toAddress(fleet), // Ensure string
|
|
68
|
+
contract: toAddress(contract), // Ensure string
|
|
69
|
+
starbase, // Already string from deriveGameAccounts
|
|
70
|
+
starbasePlayer, // Already string from deriveGameAccounts
|
|
71
|
+
gameId: actualGameId, // Already string
|
|
65
72
|
};
|
|
66
|
-
|
|
73
|
+
const rawInstruction = await getCloseContractInstructionAsync(input, { programAddress: SRSLY_PROGRAM_ADDRESS });
|
|
74
|
+
return createFluentInstruction(rawInstruction);
|
|
67
75
|
}
|
|
68
76
|
/**
|
|
69
77
|
* Creates an instruction to close a rental contract with fluent configuration.
|
|
@@ -73,18 +81,19 @@ async function _closeContract(params, config) {
|
|
|
73
81
|
*
|
|
74
82
|
* @example
|
|
75
83
|
* ```typescript
|
|
76
|
-
* // Use
|
|
84
|
+
* // Use atlasnet defaults (instruction building only)
|
|
77
85
|
* await closeContract(params);
|
|
78
86
|
*
|
|
79
87
|
* // Use mainnet
|
|
80
|
-
* await closeContract(params).set({
|
|
88
|
+
* await closeContract(params).set({ programs: 'mainnet' });
|
|
81
89
|
*
|
|
82
90
|
* // Override game ID
|
|
83
91
|
* await closeContract(params).set({ gameId: 'custom...' });
|
|
84
92
|
* ```
|
|
85
93
|
*/
|
|
86
94
|
export function closeContract(params) {
|
|
87
|
-
|
|
95
|
+
const baseSelector = createConfigSelector((config) => _closeContract(params, config));
|
|
96
|
+
return createFluentConfigSelector(baseSelector);
|
|
88
97
|
}
|
|
89
98
|
// Export config selector for getCloseContractInstructionAsync
|
|
90
99
|
export function getCloseContractInstructionAsync(input, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"close.js","sourceRoot":"","sources":["../../../src/contract/close.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"close.js","sourceRoot":"","sources":["../../../src/contract/close.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAA2C,MAAM,iBAAiB,CAAC;AAC3G,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAqD,MAAM,gCAAgC,CAAC;AAsCxJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH;;GAEG;AACH,KAAK,UAAU,cAAc,CAC3B,MAA2B,EAC3B,MAAsB;IAEtB,MAAM,EACJ,KAAK,EACL,KAAK,EACL,QAAQ,EACR,OAAO,EACP,MAAM,GACP,GAAG,MAAM,CAAC;IAEX,sFAAsF;IACtF,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,aAAa,CAAC,MAAM,CAAC,CAAC;IAE9E,+DAA+D;IAC/D,MAAM,YAAY,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IAExG,MAAM,eAAe,GAAG,MAAM,kBAAkB,CAC9C,YAAY,EACZ,OAAQ,EACR,YAAY,EACZ,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Ac,CAAC,CAAC;QACrD,OAAO,kBAAkB,CAAC,gCAAgC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,83 +1,99 @@
|
|
|
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
|
+
*/
|
|
1
5
|
import { getModule, createConfigSelector } from '../utils/config';
|
|
2
6
|
import { getSageGameId, getSageProgramAddress, getAtlasMint, toAddress } from '../utils/constants';
|
|
3
7
|
import { validateDurationAlignment, paymentFrequencyStringToSeconds } from '../utils/paymentFrequency';
|
|
4
8
|
import { isValidPaymentFrequency } from '../types/paymentFrequency';
|
|
9
|
+
import { createFluentInstruction, createFluentConfigSelector } from '../utils/instruction-converter';
|
|
5
10
|
/**
|
|
6
|
-
* Internal function to create a contract instruction with configuration options
|
|
11
|
+
* Internal function to create a rental contract instruction with configuration options
|
|
7
12
|
*/
|
|
8
13
|
async function _createContract(params, config) {
|
|
9
|
-
const { owner, fleet, ownerProfile, rate, durationMax, paymentsFreq, ownerKeyIndex = 0,
|
|
10
|
-
// Validate payment frequency
|
|
14
|
+
const { owner, fleet, ownerProfile, rate, durationMax, paymentsFreq, gameId, sageProgramAddress, atlasMint, ownerKeyIndex = 0, } = params;
|
|
15
|
+
// Validate payment frequency
|
|
11
16
|
if (!isValidPaymentFrequency(paymentsFreq)) {
|
|
12
|
-
throw new Error(`Invalid payment frequency: ${paymentsFreq}. Valid values are
|
|
17
|
+
throw new Error(`Invalid payment frequency: "${paymentsFreq}". Valid values are: ${JSON.stringify(Object.keys({ daily: true, weekly: true, monthly: true, hourly: true }))}`);
|
|
13
18
|
}
|
|
14
|
-
//
|
|
19
|
+
// Validate duration alignment
|
|
20
|
+
validateDurationAlignment(Number(durationMax), paymentsFreq);
|
|
21
|
+
// Get the payment frequency interval (this will be the minimum duration)
|
|
15
22
|
const durationMin = paymentFrequencyStringToSeconds(paymentsFreq);
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// Get the actual game ID to use (param override, config override, or network default)
|
|
23
|
+
// Convert the payment frequency to the format expected by the Rust program (with @ prefix)
|
|
24
|
+
const paymentsFreqWithPrefix = `@${paymentsFreq}`;
|
|
25
|
+
// Get network-specific addresses (param override, config override, or network default)
|
|
20
26
|
const actualGameId = gameId ? toAddress(gameId) : await getSageGameId(config);
|
|
21
|
-
|
|
27
|
+
const actualSageProgramAddress = sageProgramAddress ? toAddress(sageProgramAddress) : await getSageProgramAddress(config);
|
|
28
|
+
const actualAtlasMint = atlasMint ? toAddress(atlasMint) : await getAtlasMint(config);
|
|
29
|
+
const input = {
|
|
30
|
+
owner, // Pass as-is (string or signer)
|
|
31
|
+
fleet: toAddress(fleet), // Ensure string
|
|
32
|
+
ownerProfile: toAddress(ownerProfile), // Ensure string
|
|
33
|
+
gameId: actualGameId, // Already string
|
|
34
|
+
sageProgram: actualSageProgramAddress, // Fixed: use sageProgram instead of sageProgramAddress
|
|
35
|
+
mint: actualAtlasMint, // Fixed: use mint instead of atlasMint
|
|
36
|
+
durationMin,
|
|
37
|
+
durationMax,
|
|
38
|
+
rate,
|
|
39
|
+
paymentsFeq: paymentsFreqWithPrefix, // Fixed: use paymentsFeq as expected by codama
|
|
40
|
+
ownerKeyIndex,
|
|
41
|
+
};
|
|
42
|
+
// Get network-specific codama functions from centralized config
|
|
22
43
|
const instructionsModule = getModule('instructions');
|
|
23
44
|
const programsModule = getModule('programs');
|
|
24
45
|
const { getCreateContractInstructionAsync } = instructionsModule;
|
|
25
46
|
const { SRSLY_PROGRAM_ADDRESS } = programsModule;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// Let codama derive the rest (contract, rentalAuthority, ownerTokenAccount, etc.)
|
|
29
|
-
const input = {
|
|
30
|
-
mint: atlasMint,
|
|
31
|
-
owner, // Keep as TransactionSigner
|
|
32
|
-
fleet: toAddress(fleet),
|
|
33
|
-
ownerProfile: toAddress(ownerProfile),
|
|
34
|
-
gameId: actualGameId,
|
|
35
|
-
rate: BigInt(rate),
|
|
36
|
-
durationMin: BigInt(durationMin),
|
|
37
|
-
durationMax: BigInt(durationMax),
|
|
38
|
-
paymentsFeq: `@${paymentsFreq}`,
|
|
39
|
-
ownerKeyIndex,
|
|
40
|
-
sageProgram: toAddress(await getSageProgramAddress(config)),
|
|
41
|
-
};
|
|
42
|
-
return getCreateContractInstructionAsync(input, { programAddress: SRSLY_PROGRAM_ADDRESS });
|
|
47
|
+
const rawInstruction = await getCreateContractInstructionAsync(input, { programAddress: SRSLY_PROGRAM_ADDRESS });
|
|
48
|
+
return createFluentInstruction(rawInstruction);
|
|
43
49
|
}
|
|
44
50
|
/**
|
|
45
51
|
* Creates an instruction to create a rental contract with fluent configuration.
|
|
52
|
+
* This unified version works with both @solana/kit and @solana/web3.js using strings for addresses.
|
|
46
53
|
*
|
|
47
54
|
* @example
|
|
48
55
|
* ```typescript
|
|
49
|
-
* //
|
|
50
|
-
* const ix = await createContract(params);
|
|
51
|
-
*
|
|
52
|
-
* // Use mainnet configuration
|
|
53
|
-
* const ix = await createContract(params).set({ network: 'mainnet' });
|
|
56
|
+
* // Works with any library - just use strings for addresses!
|
|
54
57
|
*
|
|
55
|
-
* //
|
|
56
|
-
* const
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
58
|
+
* // Default returns @solana/kit format
|
|
59
|
+
* const kitInstruction = await createContract({
|
|
60
|
+
* owner: wallet, // Can be signer object or string
|
|
61
|
+
* fleet: "FleetAddress123...", // String address
|
|
62
|
+
* ownerProfile: "ProfileAddr...", // String address
|
|
63
|
+
* rate: 1000,
|
|
64
|
+
* durationMax: days(7),
|
|
65
|
+
* paymentsFreq: 'daily'
|
|
60
66
|
* });
|
|
61
67
|
*
|
|
62
|
-
* //
|
|
63
|
-
* const
|
|
64
|
-
*
|
|
65
|
-
*
|
|
68
|
+
* // Convert to @solana/web3.js format using fluent interface
|
|
69
|
+
* const web3jsInstruction = await createContract({
|
|
70
|
+
* owner: wallet,
|
|
71
|
+
* fleet: "FleetAddress123...",
|
|
72
|
+
* ownerProfile: "ProfileAddr...",
|
|
73
|
+
* rate: 1000,
|
|
74
|
+
* durationMax: days(7),
|
|
75
|
+
* paymentsFreq: 'daily'
|
|
76
|
+
* }).web3js();
|
|
77
|
+
*
|
|
78
|
+
* // Chain configuration and format conversion
|
|
79
|
+
* const web3jsInstructionWithConfig = await createContract({
|
|
80
|
+
* owner: wallet,
|
|
81
|
+
* fleet: "FleetAddress123...",
|
|
82
|
+
* ownerProfile: "ProfileAddr...",
|
|
83
|
+
* rate: 1000,
|
|
84
|
+
* durationMax: days(7),
|
|
85
|
+
* paymentsFreq: 'daily'
|
|
86
|
+
* }).set({ programs: 'mainnet' }).web3js();
|
|
87
|
+
*
|
|
88
|
+
* // Use with your preferred Solana library
|
|
89
|
+
* const transaction = new Transaction().add(web3jsInstruction);
|
|
66
90
|
* ```
|
|
67
91
|
*
|
|
68
92
|
* @param params The simplified parameters for creating a rental contract
|
|
69
93
|
* @returns A ConfigSelector that can be configured with .set() or awaited directly
|
|
70
94
|
*/
|
|
71
95
|
export function createContract(params) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Export config selector for getCreateContractInstructionAsync
|
|
76
|
-
*/
|
|
77
|
-
export function getCreateContractInstructionAsync(input, options) {
|
|
78
|
-
return createConfigSelector(async (config) => {
|
|
79
|
-
const instructionsModule = getModule('instructions');
|
|
80
|
-
return instructionsModule.getCreateContractInstructionAsync(input, options);
|
|
81
|
-
});
|
|
96
|
+
const baseSelector = createConfigSelector((config) => _createContract(params, config));
|
|
97
|
+
return createFluentConfigSelector(baseSelector);
|
|
82
98
|
}
|
|
83
99
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/contract/create.ts"],"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G;AACH,MAAM,UAAU,cAAc,CAAC,MAA4B;IACzD,MAAM,YAAY,GAAG,oBAAoB,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACvF,OAAO,0BAA0B,CAAC,YAAY,CAAC,CAAC;AAClD,CAAC"}
|
package/dist/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wuwei-labs/srsly",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.28",
|
|
4
4
|
"description": "",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@codama/nodes-from-anchor": "^1.1.13",
|
|
40
40
|
"@codama/renderers": "^1.0.21",
|
|
41
|
+
"@solana/kit": "^2.0.0",
|
|
41
42
|
"@types/node": "^24.0.3",
|
|
42
43
|
"codama": "^1.2.13",
|
|
43
44
|
"tsconfig-to-dual-package": "^1.2.0",
|
|
@@ -45,17 +46,5 @@
|
|
|
45
46
|
"typescript": "^5.8.3",
|
|
46
47
|
"vitest": "^3.2.4"
|
|
47
48
|
},
|
|
48
|
-
"peerDependencies": {
|
|
49
|
-
"@solana/kit": ">=2.0.0",
|
|
50
|
-
"@solana/web3.js": ">=1.95.0"
|
|
51
|
-
},
|
|
52
|
-
"peerDependenciesMeta": {
|
|
53
|
-
"@solana/kit": {
|
|
54
|
-
"optional": true
|
|
55
|
-
},
|
|
56
|
-
"@solana/web3.js": {
|
|
57
|
-
"optional": true
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
49
|
"type": "module"
|
|
61
50
|
}
|