@wuwei-labs/srsly 4.1.4 → 4.2.0
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/dist/cjs/demos.js +13 -26
- package/dist/cjs/demos.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/configState.js +3 -1
- package/dist/cjs/generated/codama/accounts/configState.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/contractState.js +2 -0
- package/dist/cjs/generated/codama/accounts/contractState.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/rentalState.js +4 -2
- package/dist/cjs/generated/codama/accounts/rentalState.js.map +1 -1
- package/dist/cjs/generated/codama/errors/srsly.js +7 -4
- package/dist/cjs/generated/codama/errors/srsly.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/acceptRental.js +39 -11
- package/dist/cjs/generated/codama/instructions/acceptRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/activateRental.js +1 -70
- package/dist/cjs/generated/codama/instructions/activateRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/closeRental.js +170 -25
- package/dist/cjs/generated/codama/instructions/closeRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/createConfig.js +0 -8
- package/dist/cjs/generated/codama/instructions/createConfig.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/deleteBorrower.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/deleteContract.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/deleteContractThread.js +175 -0
- package/dist/cjs/generated/codama/instructions/deleteContractThread.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/deleteRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/index.js +1 -1
- package/dist/cjs/generated/codama/instructions/index.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/reserveRental.js +7 -10
- package/dist/cjs/generated/codama/instructions/reserveRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/updateConfig.js +2 -0
- package/dist/cjs/generated/codama/instructions/updateConfig.js.map +1 -1
- package/dist/cjs/generated/codama/programs/srsly.js +18 -18
- package/dist/cjs/generated/codama/programs/srsly.js.map +1 -1
- package/dist/cjs/generated/codama/types/fleet.js +14 -0
- package/dist/cjs/generated/codama/types/fleet.js.map +1 -1
- package/dist/cjs/generated/codama/types/index.js +1 -1
- package/dist/cjs/generated/codama/types/index.js.map +1 -1
- package/dist/cjs/generated/codama/types/rentalClosed.js +2 -0
- package/dist/cjs/generated/codama/types/rentalClosed.js.map +1 -1
- package/dist/cjs/generated/codama/types/reservationCreated.js +2 -0
- package/dist/cjs/generated/codama/types/reservationCreated.js.map +1 -1
- package/dist/cjs/generated/codama/types/shipStats.js +2 -0
- package/dist/cjs/generated/codama/types/shipStats.js.map +1 -1
- package/dist/cjs/instructions/acceptRental.js +15 -23
- package/dist/cjs/instructions/acceptRental.js.map +1 -1
- package/dist/cjs/instructions/activateRental.js +0 -8
- package/dist/cjs/instructions/activateRental.js.map +1 -1
- package/dist/cjs/instructions/closeContract.js +79 -27
- package/dist/cjs/instructions/closeContract.js.map +1 -1
- package/dist/cjs/instructions/closeRental.js +25 -20
- package/dist/cjs/instructions/closeRental.js.map +1 -1
- package/dist/cjs/instructions/createConfig.js +1 -4
- package/dist/cjs/instructions/createConfig.js.map +1 -1
- package/dist/cjs/instructions/deleteContractThread.js +65 -0
- package/dist/cjs/instructions/deleteContractThread.js.map +1 -0
- package/dist/cjs/instructions/index.js +1 -1
- package/dist/cjs/instructions/index.js.map +1 -1
- package/dist/cjs/instructions/invalidateRental.js +10 -7
- package/dist/cjs/instructions/invalidateRental.js.map +1 -1
- package/dist/cjs/instructions/releaseRental.js +10 -7
- package/dist/cjs/instructions/releaseRental.js.map +1 -1
- package/dist/cjs/instructions/reserveRental.js +3 -10
- package/dist/cjs/instructions/reserveRental.js.map +1 -1
- package/dist/cjs/instructions/updateConfig.js +1 -0
- package/dist/cjs/instructions/updateConfig.js.map +1 -1
- package/dist/cjs/kit/index.js +2 -2
- package/dist/cjs/kit/index.js.map +1 -1
- package/dist/cjs/legacy/index.js +2 -3
- package/dist/cjs/legacy/index.js.map +1 -1
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/utils/config.js.map +1 -1
- package/dist/cjs/utils/discountAuth.js +45 -106
- package/dist/cjs/utils/discountAuth.js.map +1 -1
- package/dist/cjs/utils/index.js +1 -7
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/demos.js +12 -25
- package/dist/esm/demos.js.map +1 -1
- package/dist/esm/generated/codama/accounts/configState.js +3 -1
- package/dist/esm/generated/codama/accounts/configState.js.map +1 -1
- package/dist/esm/generated/codama/accounts/contractState.js +2 -0
- package/dist/esm/generated/codama/accounts/contractState.js.map +1 -1
- package/dist/esm/generated/codama/accounts/rentalState.js +6 -4
- package/dist/esm/generated/codama/accounts/rentalState.js.map +1 -1
- package/dist/esm/generated/codama/errors/srsly.js +6 -3
- package/dist/esm/generated/codama/errors/srsly.js.map +1 -1
- package/dist/esm/generated/codama/instructions/acceptRental.js +40 -12
- package/dist/esm/generated/codama/instructions/acceptRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/activateRental.js +1 -70
- package/dist/esm/generated/codama/instructions/activateRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/closeRental.js +170 -25
- package/dist/esm/generated/codama/instructions/closeRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/createConfig.js +0 -8
- package/dist/esm/generated/codama/instructions/createConfig.js.map +1 -1
- package/dist/esm/generated/codama/instructions/deleteBorrower.js.map +1 -1
- package/dist/esm/generated/codama/instructions/deleteContract.js.map +1 -1
- package/dist/esm/generated/codama/instructions/deleteContractThread.js +165 -0
- package/dist/esm/generated/codama/instructions/deleteContractThread.js.map +1 -0
- package/dist/esm/generated/codama/instructions/deleteRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/index.js +1 -1
- package/dist/esm/generated/codama/instructions/index.js.map +1 -1
- package/dist/esm/generated/codama/instructions/reserveRental.js +8 -11
- package/dist/esm/generated/codama/instructions/reserveRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/updateConfig.js +2 -0
- package/dist/esm/generated/codama/instructions/updateConfig.js.map +1 -1
- package/dist/esm/generated/codama/programs/srsly.js +18 -18
- package/dist/esm/generated/codama/programs/srsly.js.map +1 -1
- package/dist/esm/generated/codama/types/fleet.js +15 -1
- package/dist/esm/generated/codama/types/fleet.js.map +1 -1
- package/dist/esm/generated/codama/types/index.js +1 -1
- package/dist/esm/generated/codama/types/index.js.map +1 -1
- package/dist/esm/generated/codama/types/rentalClosed.js +3 -1
- package/dist/esm/generated/codama/types/rentalClosed.js.map +1 -1
- package/dist/esm/generated/codama/types/reservationCreated.js +3 -1
- package/dist/esm/generated/codama/types/reservationCreated.js.map +1 -1
- package/dist/esm/generated/codama/types/shipStats.js +3 -1
- package/dist/esm/generated/codama/types/shipStats.js.map +1 -1
- package/dist/esm/instructions/acceptRental.js +15 -23
- package/dist/esm/instructions/acceptRental.js.map +1 -1
- package/dist/esm/instructions/activateRental.js +0 -8
- package/dist/esm/instructions/activateRental.js.map +1 -1
- package/dist/esm/instructions/closeContract.js +79 -27
- package/dist/esm/instructions/closeContract.js.map +1 -1
- package/dist/esm/instructions/closeRental.js +25 -20
- package/dist/esm/instructions/closeRental.js.map +1 -1
- package/dist/esm/instructions/createConfig.js +1 -4
- package/dist/esm/instructions/createConfig.js.map +1 -1
- package/dist/esm/instructions/deleteContractThread.js +62 -0
- package/dist/esm/instructions/deleteContractThread.js.map +1 -0
- package/dist/esm/instructions/index.js +1 -1
- package/dist/esm/instructions/index.js.map +1 -1
- package/dist/esm/instructions/invalidateRental.js +10 -7
- package/dist/esm/instructions/invalidateRental.js.map +1 -1
- package/dist/esm/instructions/releaseRental.js +10 -7
- package/dist/esm/instructions/releaseRental.js.map +1 -1
- package/dist/esm/instructions/reserveRental.js +3 -10
- package/dist/esm/instructions/reserveRental.js.map +1 -1
- package/dist/esm/instructions/updateConfig.js +1 -0
- package/dist/esm/instructions/updateConfig.js.map +1 -1
- package/dist/esm/kit/index.js +1 -1
- package/dist/esm/kit/index.js.map +1 -1
- package/dist/esm/legacy/index.js +1 -2
- package/dist/esm/legacy/index.js.map +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/utils/config.js.map +1 -1
- package/dist/esm/utils/discountAuth.js +45 -103
- package/dist/esm/utils/discountAuth.js.map +1 -1
- package/dist/esm/utils/index.js +0 -2
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/idl/srsly.json +411 -352
- package/dist/types/demos.d.ts +0 -2
- package/dist/types/demos.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/configState.d.ts +4 -0
- package/dist/types/generated/codama/accounts/configState.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/contractState.d.ts +4 -0
- package/dist/types/generated/codama/accounts/contractState.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/rentalState.d.ts +13 -9
- package/dist/types/generated/codama/accounts/rentalState.d.ts.map +1 -1
- package/dist/types/generated/codama/errors/srsly.d.ts +5 -3
- package/dist/types/generated/codama/errors/srsly.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/acceptRental.d.ts +53 -32
- package/dist/types/generated/codama/instructions/acceptRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/activateRental.d.ts +18 -49
- package/dist/types/generated/codama/instructions/activateRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/closeRental.d.ts +83 -28
- package/dist/types/generated/codama/instructions/closeRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/createConfig.d.ts +3 -3
- package/dist/types/generated/codama/instructions/createConfig.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/deleteBorrower.d.ts +3 -0
- package/dist/types/generated/codama/instructions/deleteBorrower.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/deleteContract.d.ts +3 -0
- package/dist/types/generated/codama/instructions/deleteContract.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/deleteContractThread.d.ts +70 -0
- package/dist/types/generated/codama/instructions/deleteContractThread.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/deleteRental.d.ts +3 -0
- package/dist/types/generated/codama/instructions/deleteRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/index.d.ts +1 -1
- package/dist/types/generated/codama/instructions/index.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/reserveRental.d.ts +18 -23
- package/dist/types/generated/codama/instructions/reserveRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/updateConfig.d.ts +6 -0
- package/dist/types/generated/codama/instructions/updateConfig.d.ts.map +1 -1
- package/dist/types/generated/codama/programs/srsly.d.ts +18 -18
- package/dist/types/generated/codama/programs/srsly.d.ts.map +1 -1
- package/dist/types/generated/codama/types/fleet.d.ts +14 -0
- package/dist/types/generated/codama/types/fleet.d.ts.map +1 -1
- package/dist/types/generated/codama/types/index.d.ts +1 -1
- package/dist/types/generated/codama/types/index.d.ts.map +1 -1
- package/dist/types/generated/codama/types/rentalClosed.d.ts +8 -1
- package/dist/types/generated/codama/types/rentalClosed.d.ts.map +1 -1
- package/dist/types/generated/codama/types/reservationCreated.d.ts +2 -0
- package/dist/types/generated/codama/types/reservationCreated.d.ts.map +1 -1
- package/dist/types/generated/codama/types/shipStats.d.ts +3 -1
- package/dist/types/generated/codama/types/shipStats.d.ts.map +1 -1
- package/dist/types/instructions/acceptRental.d.ts +3 -12
- package/dist/types/instructions/acceptRental.d.ts.map +1 -1
- package/dist/types/instructions/activateRental.d.ts.map +1 -1
- package/dist/types/instructions/closeContract.d.ts +5 -0
- package/dist/types/instructions/closeContract.d.ts.map +1 -1
- package/dist/types/instructions/closeRental.d.ts.map +1 -1
- package/dist/types/instructions/createConfig.d.ts +4 -4
- package/dist/types/instructions/createConfig.d.ts.map +1 -1
- package/dist/types/instructions/deleteContractThread.d.ts +42 -0
- package/dist/types/instructions/deleteContractThread.d.ts.map +1 -0
- package/dist/types/instructions/index.d.ts +1 -1
- package/dist/types/instructions/index.d.ts.map +1 -1
- package/dist/types/instructions/invalidateRental.d.ts +4 -3
- package/dist/types/instructions/invalidateRental.d.ts.map +1 -1
- package/dist/types/instructions/releaseRental.d.ts +4 -3
- package/dist/types/instructions/releaseRental.d.ts.map +1 -1
- package/dist/types/instructions/reserveRental.d.ts +0 -7
- package/dist/types/instructions/reserveRental.d.ts.map +1 -1
- package/dist/types/instructions/updateConfig.d.ts +4 -4
- package/dist/types/instructions/updateConfig.d.ts.map +1 -1
- package/dist/types/kit/index.d.ts +1 -1
- package/dist/types/kit/index.d.ts.map +1 -1
- package/dist/types/legacy/index.d.ts +1 -2
- package/dist/types/legacy/index.d.ts.map +1 -1
- package/dist/types/utils/config.d.ts +3 -3
- package/dist/types/utils/config.d.ts.map +1 -1
- package/dist/types/utils/discountAuth.d.ts +38 -70
- package/dist/types/utils/discountAuth.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteContractThread.js","sourceRoot":"","sources":["../../../src/instructions/deleteContractThread.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA2CH,oDAiDC;AA1FD,qCAAiE;AACjE,mEAA2F;AAC3F,4CAA4E;AAC5E,4CAA4E;AAC5E,wDAA4D;AAC5D,+CAAiD;AACjD,0CAAkE;AAClE,wCAAqD;AAsBrD;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,oBAAoB,CACxC,MAAkC,EAClC,MAA2B;IAE3B,MAAM,WAAW,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,CAAC;IAExC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC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,EAAE;QACzC,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,SAAS,EAAE,WAAW,CAAC,SAAS;KACjC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -35,9 +35,9 @@ __exportStar(require("./closeBorrower"), exports);
|
|
|
35
35
|
__exportStar(require("./createBorrower"), exports);
|
|
36
36
|
__exportStar(require("./deleteBorrower"), exports);
|
|
37
37
|
__exportStar(require("./claimContract"), exports);
|
|
38
|
-
__exportStar(require("./activateRental"), exports);
|
|
39
38
|
__exportStar(require("./createContractThread"), exports);
|
|
40
39
|
__exportStar(require("./closeContractThread"), exports);
|
|
40
|
+
__exportStar(require("./deleteContractThread"), exports);
|
|
41
41
|
__exportStar(require("./updateContractThread"), exports);
|
|
42
42
|
__exportStar(require("./createConfig"), exports);
|
|
43
43
|
__exportStar(require("./updateConfig"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/instructions/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,mDAAiC;AACjC,mDAAiC;AACjC,kDAAgC;AAChC,mDAAiC;AACjC,gDAA8B;AAC9B,iDAA+B;AAC/B,iDAA+B;AAC/B,gDAA8B;AAC9B,kDAAgC;AAChC,qDAAmC;AACnC,kDAAgC;AAChC,iDAA+B;AAC/B,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,mDAAiC;AACjC,kDAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/instructions/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,mDAAiC;AACjC,mDAAiC;AACjC,kDAAgC;AAChC,mDAAiC;AACjC,gDAA8B;AAC9B,iDAA+B;AAC/B,iDAA+B;AAC/B,gDAA8B;AAC9B,kDAAgC;AAChC,qDAAmC;AACnC,kDAAgC;AAChC,iDAA+B;AAC/B,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,mDAAiC;AACjC,kDAAgC;AAChC,yDAAuC;AACvC,wDAAsC;AACtC,yDAAuC;AACvC,yDAAuC;AACvC,iDAA+B;AAC/B,iDAA+B;AAC/B,iDAA+B;AAC/B,oDAAkC;AAClC,qDAAmC;AACnC,oDAAkC;AAClC,oDAAkC"}
|
|
@@ -13,6 +13,7 @@ const config_1 = require("../utils/config");
|
|
|
13
13
|
const signer_1 = require("../utils/signer");
|
|
14
14
|
const instructions_2 = require("../utils/instructions");
|
|
15
15
|
const sage_1 = require("../pda/sage");
|
|
16
|
+
const fleet_1 = require("../accounts/fleet");
|
|
16
17
|
/**
|
|
17
18
|
* Invalidate a rental
|
|
18
19
|
*
|
|
@@ -68,12 +69,6 @@ async function invalidateRental(params, config) {
|
|
|
68
69
|
if (!params.signer) {
|
|
69
70
|
throw new Error('signer is required');
|
|
70
71
|
}
|
|
71
|
-
if (!params.ownerProfile) {
|
|
72
|
-
throw new Error('ownerProfile is required');
|
|
73
|
-
}
|
|
74
|
-
if (!params.faction) {
|
|
75
|
-
throw new Error('faction is required');
|
|
76
|
-
}
|
|
77
72
|
// Convert signer to transaction signer
|
|
78
73
|
const signerAccount = (0, signer_1.toTransactionSigner)(params.signer);
|
|
79
74
|
// Get network-specific addresses (including gameId)
|
|
@@ -81,8 +76,16 @@ async function invalidateRental(params, config) {
|
|
|
81
76
|
const gameId = (0, kit_1.address)(addresses.gameId);
|
|
82
77
|
const sageProgram = (0, kit_1.address)(addresses.sage);
|
|
83
78
|
const programAddress = (0, kit_1.address)(addresses.srsly);
|
|
79
|
+
// Auto-fetch ownerProfile and faction from fleet when not provided
|
|
80
|
+
let ownerProfile = params.ownerProfile;
|
|
81
|
+
let faction = params.faction;
|
|
82
|
+
if (!ownerProfile || !faction) {
|
|
83
|
+
const fleetState = await (0, fleet_1.fetchFleet)(params.fleet, finalConfig.rpcUrl);
|
|
84
|
+
ownerProfile = ownerProfile ?? fleetState.ownerProfile;
|
|
85
|
+
faction = faction ?? fleetState.faction;
|
|
86
|
+
}
|
|
84
87
|
// Derive owner's SAGE accounts (NOT borrower's)
|
|
85
|
-
const gameAccounts = await (0, sage_1.deriveGameAccounts)(
|
|
88
|
+
const gameAccounts = await (0, sage_1.deriveGameAccounts)(ownerProfile, faction, gameId);
|
|
86
89
|
// Call Codama-generated instruction
|
|
87
90
|
// Contract and rentalAuthority are auto-derived by Codama
|
|
88
91
|
const kitInstruction = await (0, instructions_1.getInvalidateRentalInstructionAsync)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalidateRental.js","sourceRoot":"","sources":["../../../src/instructions/invalidateRental.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;
|
|
1
|
+
{"version":3,"file":"invalidateRental.js","sourceRoot":"","sources":["../../../src/instructions/invalidateRental.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA0FH,4CA0DC;AAlJD,qCAAoD;AACpD,mEAAuF;AACvF,4CAA4E;AAC5E,4CAA4E;AAC5E,wDAA4D;AAC5D,sCAAiD;AACjD,6CAA+C;AAqC/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACI,KAAK,UAAU,gBAAgB,CACpC,MAA8B,EAC9B,MAA2B;IAE3B,eAAe;IACf,MAAM,WAAW,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,CAAC;IAExC,2BAA2B;IAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,uCAAuC;IACvC,MAAM,aAAa,GAAG,IAAA,4BAAmB,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEzD,oDAAoD;IACpD,MAAM,SAAS,GAAG,IAAA,qBA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 @@ const config_1 = require("../utils/config");
|
|
|
13
13
|
const signer_1 = require("../utils/signer");
|
|
14
14
|
const instructions_2 = require("../utils/instructions");
|
|
15
15
|
const sage_1 = require("../pda/sage");
|
|
16
|
+
const fleet_1 = require("../accounts/fleet");
|
|
16
17
|
/**
|
|
17
18
|
* Release a rental
|
|
18
19
|
*
|
|
@@ -66,12 +67,6 @@ async function releaseRental(params, config) {
|
|
|
66
67
|
if (!params.signer) {
|
|
67
68
|
throw new Error('signer is required');
|
|
68
69
|
}
|
|
69
|
-
if (!params.ownerProfile) {
|
|
70
|
-
throw new Error('ownerProfile is required');
|
|
71
|
-
}
|
|
72
|
-
if (!params.faction) {
|
|
73
|
-
throw new Error('faction is required');
|
|
74
|
-
}
|
|
75
70
|
// Convert signer to transaction signer
|
|
76
71
|
const signerAccount = (0, signer_1.toTransactionSigner)(params.signer);
|
|
77
72
|
// Get network-specific addresses (including gameId)
|
|
@@ -79,8 +74,16 @@ async function releaseRental(params, config) {
|
|
|
79
74
|
const gameId = (0, kit_1.address)(addresses.gameId);
|
|
80
75
|
const sageProgram = (0, kit_1.address)(addresses.sage);
|
|
81
76
|
const programAddress = (0, kit_1.address)(addresses.srsly);
|
|
77
|
+
// Auto-fetch ownerProfile and faction from fleet when not provided
|
|
78
|
+
let ownerProfile = params.ownerProfile;
|
|
79
|
+
let faction = params.faction;
|
|
80
|
+
if (!ownerProfile || !faction) {
|
|
81
|
+
const fleetState = await (0, fleet_1.fetchFleet)(params.fleet, finalConfig.rpcUrl);
|
|
82
|
+
ownerProfile = ownerProfile ?? fleetState.ownerProfile;
|
|
83
|
+
faction = faction ?? fleetState.faction;
|
|
84
|
+
}
|
|
82
85
|
// Derive owner's SAGE accounts (NOT borrower's)
|
|
83
|
-
const gameAccounts = await (0, sage_1.deriveGameAccounts)(
|
|
86
|
+
const gameAccounts = await (0, sage_1.deriveGameAccounts)(ownerProfile, faction, gameId);
|
|
84
87
|
// Call Codama-generated instruction
|
|
85
88
|
// Contract and rentalAuthority are auto-derived by Codama from seeds
|
|
86
89
|
const kitInstruction = await (0, instructions_1.getReleaseRentalInstructionAsync)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"releaseRental.js","sourceRoot":"","sources":["../../../src/instructions/releaseRental.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;
|
|
1
|
+
{"version":3,"file":"releaseRental.js","sourceRoot":"","sources":["../../../src/instructions/releaseRental.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAwFH,sCA0DC;AAhJD,qCAAoD;AACpD,mEAAoF;AACpF,4CAA4E;AAC5E,4CAA4E;AAC5E,wDAA4D;AAC5D,sCAAiD;AACjD,6CAA+C;AAqC/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACI,KAAK,UAAU,aAAa,CACjC,MAA2B,EAC3B,MAA2B;IAE3B,eAAe;IACf,MAAM,WAAW,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,CAAC;IAExC,2BAA2B;IAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,uCAAuC;IACvC,MAAM,aAAa,GAAG,IAAA,4BAAmB,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEzD,oDAAoD;IACpD,MAAM,SAAS,GAAG,IAAA,qBAAY,EAAC,MAAM,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,IAAA,aAAO,EAAC,SAAS,CAAC,MAAiB,CAAC,CAAC;IACpD,MAAM,WAAW,GAAG,IAAA,aAAO,EAAC,SAAS,CAAC,IAAe,CAAC,CAAC;IACvD,MAAM,cAAc,GAAG,IAAA,aAAO,EAAC,SAAS,CAAC,KAAgB,CAAC,CAAC;IAE3D,mEAAmE;IACnE,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IACvC,IAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC7B,IAAI,CAAC,YAAY,IAAI,CAAC,OAAO,EAAE,CAAC;QAC9B,MAAM,UAAU,GAAG,MAAM,IAAA,kBAAU,EAAC,MAAM,CAAC,KAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACjF,YAAY,GAAG,YAAY,IAAI,UAAU,CAAC,YAAY,CAAC;QACvD,OAAO,GAAG,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC;IAC1C,CAAC;IAED,gDAAgD;IAChD,MAAM,YAAY,GAAG,MAAM,IAAA,yBAAkB,EAC3C,YAAY,EACZ,OAAO,EACP,MAAM,CACP,CAAC;IAEF,oCAAoC;IACpC,qEAAqE;IACrE,MAAM,cAAc,GAAG,MAAM,IAAA,+CAAgC,EAC3D;QACE,MAAM,EAAE,aAAa;QACrB,KAAK,EAAE,IAAA,aAAO,EAAC,MAAM,CAAC,KAAgB,CAAC;QACvC,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,YAAY,CAAC,QAAQ;QAC/B,cAAc,EAAE,YAAY,CAAC,cAAc;QAC3C,WAAW;KACZ,EACD,EAAE,cAAc,EAAE,CACnB,CAAC;IAEF,OAAO,IAAA,kCAAmB,EAAC,cAAc,EAAE;QACzC,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,SAAS,EAAE,WAAW,CAAC,SAAS;KACjC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -24,7 +24,6 @@ const srsly_1 = require("../pda/srsly");
|
|
|
24
24
|
const token_1 = require("../pda/token");
|
|
25
25
|
const thread_1 = require("../pda/thread");
|
|
26
26
|
const instructions_2 = require("../utils/instructions");
|
|
27
|
-
const discountAuth_1 = require("../utils/discountAuth");
|
|
28
27
|
/**
|
|
29
28
|
* Reserve a rental contract via GBM-style auction
|
|
30
29
|
*
|
|
@@ -87,9 +86,9 @@ async function reserveRental(params, config) {
|
|
|
87
86
|
const rentalState = await (0, srsly_1.deriveQueuedRental)(params.contract);
|
|
88
87
|
// Derive rental authority
|
|
89
88
|
const rentalAuthority = await (0, srsly_1.deriveRentalAuthority)();
|
|
90
|
-
// Derive contract thread and
|
|
89
|
+
// Derive contract thread and close_rental fiber (fiber index 1)
|
|
91
90
|
const contractThread = await (0, thread_1.deriveContractThread)(params.contract, rentalAuthority);
|
|
92
|
-
const
|
|
91
|
+
const closeRentalFiber = await (0, thread_1.deriveFiber)(contractThread, 1);
|
|
93
92
|
// Derive contract token account (ATA of contract PDA)
|
|
94
93
|
const contractAddress = (0, kit_1.address)(params.contract);
|
|
95
94
|
const contractTokenAccount = await (0, token_1.deriveAssociatedTokenAccount)(contractAddress, atlasMint);
|
|
@@ -97,18 +96,13 @@ async function reserveRental(params, config) {
|
|
|
97
96
|
const challengerTokenAccount = await (0, token_1.deriveAssociatedTokenAccount)(challengerSigner.address, atlasMint);
|
|
98
97
|
// Convert duration to seconds
|
|
99
98
|
const durationSeconds = (0, duration_1.convertDuration)(params.duration);
|
|
100
|
-
// Deserialize discount auth if provided
|
|
101
|
-
let discountAuth = null;
|
|
102
|
-
if (params.discountAuth) {
|
|
103
|
-
discountAuth = (0, discountAuth_1.deserializeDiscountAuth)(params.discountAuth);
|
|
104
|
-
}
|
|
105
99
|
const referrer = params.referrer ? (0, kit_1.address)(params.referrer) : undefined;
|
|
106
100
|
// Build instruction input
|
|
107
101
|
const instructionInput = {
|
|
108
102
|
challenger: challengerSigner,
|
|
109
103
|
contract: contractAddress,
|
|
110
104
|
contractThread,
|
|
111
|
-
|
|
105
|
+
closeRentalFiber,
|
|
112
106
|
contractTokenAccount,
|
|
113
107
|
challengerTokenAccount,
|
|
114
108
|
rentalState,
|
|
@@ -117,7 +111,6 @@ async function reserveRental(params, config) {
|
|
|
117
111
|
bidPoints,
|
|
118
112
|
bidAtlas: bidAtlasValue,
|
|
119
113
|
duration: BigInt(durationSeconds),
|
|
120
|
-
discountAuth,
|
|
121
114
|
};
|
|
122
115
|
// If there's a current queued reservation, provide defender accounts
|
|
123
116
|
// Fetch queued rental to check if there's an existing reservation holder
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reserveRental.js","sourceRoot":"","sources":["../../../src/instructions/reserveRental.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;
|
|
1
|
+
{"version":3,"file":"reserveRental.js","sourceRoot":"","sources":["../../../src/instructions/reserveRental.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAqGH,sCA0IC;AA7OD,qCAAiE;AACjE,mEAAoF;AACpF,4CAA4E;AAC5E,4CAA4E;AAC5E,6CAAmE;AACnE,iDAAyE;AACzE,mDAAqD;AACrD,+CAAiD;AACjD,6CAA+C;AAC/C,mDAAqD;AACrD,+CAAiD;AACjD,qDAAyD;AACzD,sCAAiD;AACjD,wCAA8F;AAC9F,wCAA4D;AAC5D,0CAAkE;AAClE,wDAA4D;AAyD5D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACI,KAAK,UAAU,aAAa,CACjC,MAA2B,EAC3B,MAA2B;IAE3B,eAAe;IACf,MAAM,WAAW,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,CAAC;IAExC,2BAA2B;IAC3B,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,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AAQ,EAAE;KACrE,CAAC;IACD,cAAc,CAAC,QAAyC,CAAC,IAAI,CAAC,GAAG,qBAAqB,CAAC,CAAC;IAEzF,oDAAoD;IACpD,OAAO,IAAA,kCAAmB,EAAC,cAAc,EAAE;QACzC,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,SAAS,EAAE,WAAW,CAAC,SAAS;KACjC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -90,6 +90,7 @@ async function updateConfig(params, config) {
|
|
|
90
90
|
maxWeight: toOption(params.maxWeight),
|
|
91
91
|
captureRateBps: toOption(params.captureRateBps),
|
|
92
92
|
atlasPerPoint: toOption(params.atlasPerPoint),
|
|
93
|
+
knockoffBonusBps: toOption(params.knockoffBonusBps),
|
|
93
94
|
}, { programAddress });
|
|
94
95
|
return (0, instructions_2.prepareInstructions)(kitInstruction, {
|
|
95
96
|
computeUnits: params.computeUnits,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateConfig.js","sourceRoot":"","sources":["../../../src/instructions/updateConfig.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA8JH,
|
|
1
|
+
{"version":3,"file":"updateConfig.js","sourceRoot":"","sources":["../../../src/instructions/updateConfig.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA8JH,oCA0DC;AAtND,qCAMqB;AACrB,mEAAmF;AACnF,4CAA4E;AAC5E,4CAA4E;AAE5E,wDAA4D;AAyG5D;;GAEG;AACH,SAAS,QAAQ,CAAI,KAA2B;IAC9C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAA,UAAI,GAAK,CAAC,CAAC,CAAC,IAAA,UAAI,EAAI,KAAK,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACI,KAAK,UAAU,YAAY,CAChC,MAA0B,EAC1B,MAA2B;IAE3B,eAAe;IACf,MAAM,WAAW,GAAG,IAAA,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YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC;QAC3C,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC;QACzD,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC;QACzD,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC;QACvC,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC;QACnD,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC;QACrC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC;QAC/C,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC;QAC7C,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC;KACpD,EACD,EAAE,cAAc,EAAE,CACnB,CAAC;IAEF,OAAO,IAAA,kCAAmB,EAAC,cAAc,EAAE;QACzC,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,SAAS,EAAE,WAAW,CAAC,SAAS;KACjC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/cjs/kit/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
52
52
|
};
|
|
53
53
|
})();
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
-
exports.codama = exports.claim = exports.
|
|
55
|
+
exports.codama = exports.claim = exports.deriveDiscountPda = exports.VERSION = void 0;
|
|
56
56
|
var version_1 = require("../version");
|
|
57
57
|
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
|
|
58
58
|
__exportStar(require("../utils"), exports);
|
|
@@ -62,7 +62,7 @@ __exportStar(require("../params"), exports);
|
|
|
62
62
|
__exportStar(require("../pda"), exports);
|
|
63
63
|
// External re-exports
|
|
64
64
|
var slyvault_1 = require("@wuwei-labs/slyvault");
|
|
65
|
-
Object.defineProperty(exports, "
|
|
65
|
+
Object.defineProperty(exports, "deriveDiscountPda", { enumerable: true, get: function () { return slyvault_1.deriveDiscountPda; } });
|
|
66
66
|
Object.defineProperty(exports, "claim", { enumerable: true, get: function () { return slyvault_1.claim; } });
|
|
67
67
|
exports.codama = __importStar(require("../generated/codama"));
|
|
68
68
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/kit/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,sCAAqC;AAA5B,kGAAA,OAAO,OAAA;AAChB,2CAAyB;AACzB,kDAAgC;AAChC,8CAA4B;AAC5B,4CAA0B;AAC1B,yCAAuB;AAEvB,sBAAsB;AACtB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/kit/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,sCAAqC;AAA5B,kGAAA,OAAO,OAAA;AAChB,2CAAyB;AACzB,kDAAgC;AAChC,8CAA4B;AAC5B,4CAA0B;AAC1B,yCAAuB;AAEvB,sBAAsB;AACtB,iDAI8B;AAH5B,6GAAA,iBAAiB,OAAA;AACjB,iGAAA,KAAK,OAAA;AAIP,8DAA8C"}
|
package/dist/cjs/legacy/index.js
CHANGED
|
@@ -59,7 +59,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
59
59
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
60
60
|
};
|
|
61
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
-
exports.claim = exports.updateAffiliate = exports.removeAffiliate = exports.approveAffiliate = exports.createAffiliate = exports.deleteConfig = exports.updateConfig = exports.createConfig = exports.updateContractThread = exports.closeContractThread = exports.createContractThread = exports.
|
|
62
|
+
exports.claim = exports.updateAffiliate = exports.removeAffiliate = exports.approveAffiliate = exports.createAffiliate = exports.deleteConfig = exports.updateConfig = exports.createConfig = exports.updateContractThread = exports.closeContractThread = exports.createContractThread = exports.claimContract = exports.deleteBorrower = exports.createBorrower = exports.closeBorrower = exports.claimBorrower = exports.deleteRental = exports.reserveRental = exports.invalidateRental = exports.releaseRental = exports.closeRental = exports.cancelRental = exports.acceptRental = exports.setDelegate = exports.deleteContract = exports.closeContract = exports.updateContract = exports.createContract = exports.deriveDiscountPda = exports.codama = exports.VERSION = void 0;
|
|
63
63
|
const utils_1 = require("../utils");
|
|
64
64
|
const kit = __importStar(require("../instructions"));
|
|
65
65
|
const slyvault_1 = require("@wuwei-labs/slyvault");
|
|
@@ -73,7 +73,7 @@ Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () {
|
|
|
73
73
|
exports.codama = __importStar(require("../generated/codama"));
|
|
74
74
|
// External re-exports
|
|
75
75
|
var slyvault_2 = require("@wuwei-labs/slyvault");
|
|
76
|
-
Object.defineProperty(exports, "
|
|
76
|
+
Object.defineProperty(exports, "deriveDiscountPda", { enumerable: true, get: function () { return slyvault_2.deriveDiscountPda; } });
|
|
77
77
|
/**
|
|
78
78
|
* Wrapper that checks for PublicKey and provides helpful error
|
|
79
79
|
*/
|
|
@@ -110,7 +110,6 @@ exports.closeBorrower = w(kit.closeBorrower);
|
|
|
110
110
|
exports.createBorrower = w(kit.createBorrower);
|
|
111
111
|
exports.deleteBorrower = w(kit.deleteBorrower);
|
|
112
112
|
exports.claimContract = w(kit.claimContract);
|
|
113
|
-
exports.activateRental = w(kit.activateRental);
|
|
114
113
|
exports.createContractThread = w(kit.createContractThread);
|
|
115
114
|
exports.closeContractThread = w(kit.closeContractThread);
|
|
116
115
|
exports.updateContractThread = w(kit.updateContractThread);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/legacy/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oCAAwF;AACxF,qDAAuC;AACvC,mDAA8D;AAE9D,oDAAoD;AACpD,2CAAyB;AACzB,8CAA4B;AAC5B,4CAA0B;AAC1B,yCAAuB;AACvB,sCAAqC;AAA5B,kGAAA,OAAO,OAAA;AAChB,8DAA8C;AAG9C,sBAAsB;AACtB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/legacy/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oCAAwF;AACxF,qDAAuC;AACvC,mDAA8D;AAE9D,oDAAoD;AACpD,2CAAyB;AACzB,8CAA4B;AAC5B,4CAA0B;AAC1B,yCAAuB;AACvB,sCAAqC;AAA5B,kGAAA,OAAO,OAAA;AAChB,8DAA8C;AAG9C,sBAAsB;AACtB,iDAG8B;AAF5B,6GAAA,iBAAiB,OAAA;AAInB;;GAEG;AACH,SAAS,UAAU,CACjB,EAAkD;IAElD,OAAO,KAAK,EAAE,GAAG,IAAW,EAAgC,EAAE;QAC5D,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QACjC,MAAM,EAAE,GAAG,IAAA,oBAAY,GAAE,CAAC,SAAS,CAAC;QACpC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,MAAM,IAAI,KAAK,CACb,8DAA8D;gBAC5D,iCAAiC;gBACjC,kDAAkD;gBAClD,8DAA8D;gBAC9D,gCAAgC,CACnC,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,GAAG,UAAU,CAAC;AAErB,+DAA+D;AAClD,QAAA,cAAc,GAAG,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AmB,CAAC,CAAC;AACjD,QAAA,oBAAoB,GAAG,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AACnD,QAAA,YAAY,GAAG,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AACnC,QAAA,YAAY,GAAG,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AACnC,QAAA,YAAY,GAAG,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AACnC,QAAA,eAAe,GAAG,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACzC,QAAA,gBAAgB,GAAG,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC3C,QAAA,eAAe,GAAG,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACzC,QAAA,eAAe,GAAG,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACzC,QAAA,KAAK,GAAG,CAAC,CAAC,gBAAa,CAAC,CAAC"}
|
package/dist/cjs/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAmKH,oCAQC;AAOD,oCAEC;AAKD,wCAIC;AAQD,kCAEC;AAQD,8BAOC;AAQD,oCAEC;AAQD,sCAEC;AAQD,gDAGC;AA0BD,oCASC;AAiBD,4CAIC;AA1SD,gDAA4D;AAC5D,2CAA2L;AAC3L,+BAAkC;AAElC,mDAA4E;AA4F5E;;GAEG;AACH,MAAM,gBAAgB,GAA2B;IAC/C,CAAC,2BAAe,CAAC,EAAE,qCAAqC;IACxD,CAAC,0BAAc,CAAC,EAAE,+BAA+B;IACjD,sEAAsE;CACvE,CAAC;AAEF;;GAEG;AACH,MAAM,cAAc,GAA2B;IAC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AAO,MAAM,CAAC,SAAS,IAAI,kBAAkB,CAAC;AAChD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,MAAiB;IAC7C,OAAO,MAAM,CAAC,UAAU,IAAI,WAAW,CAAC;AAC1C,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,MAA2B;IAC5D,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC,SAAS,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAgB,YAAY,CAAC,MAA2B;IACtD,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,gBAAgB,GAAG,IAAA,+BAAmB,EAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAEnE,uDAAuD;IACvD,OAAO;QACL,GAAG,gBAAgB;QACnB,KAAK,EAAE,WAAW,CAAC,SAAS,IAAI,gBAAgB,CAAC,KAAK;KACvD,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,gBAAgB,CAAC,MAAc;IACnD,MAAM,GAAG,GAAG,IAAA,eAAS,EAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,CAAC;IACtD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* @purpose Discount
|
|
3
|
+
* @purpose Discount PDA helpers for rental discount vouchers
|
|
4
4
|
* @module utils/discountAuth
|
|
5
|
+
*
|
|
6
|
+
* The discount system uses on-chain PDAs instead of ed25519 signatures.
|
|
7
|
+
* Server creates a Discount PDA via slyvault's discount_create instruction,
|
|
8
|
+
* then returns the PDA address to the user for inclusion in rental transactions.
|
|
5
9
|
*/
|
|
6
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
8
|
-
exports.deserializeDiscountAuth = deserializeDiscountAuth;
|
|
9
|
-
exports.serializeDiscountAuth = serializeDiscountAuth;
|
|
10
|
-
exports.isSerializedDiscountAuth = isSerializedDiscountAuth;
|
|
11
|
+
exports.createDiscountForRental = createDiscountForRental;
|
|
11
12
|
const kit_1 = require("@solana/kit");
|
|
12
13
|
const slyvault_1 = require("@wuwei-labs/slyvault");
|
|
13
14
|
const config_1 = require("./config");
|
|
14
15
|
const rpc_1 = require("./rpc");
|
|
15
16
|
/**
|
|
16
|
-
* Parse a stringified keypair (JSON array of bytes) into a
|
|
17
|
+
* Parse a stringified keypair (JSON array of bytes) into a TransactionSigner
|
|
17
18
|
*/
|
|
18
19
|
async function parseKeypairString(keypairString) {
|
|
19
20
|
try {
|
|
@@ -28,62 +29,38 @@ async function parseKeypairString(keypairString) {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
function uint8ArrayToBase64(bytes) {
|
|
34
|
-
let binary = '';
|
|
35
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
36
|
-
binary += String.fromCharCode(bytes[i]);
|
|
37
|
-
}
|
|
38
|
-
return btoa(binary);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Browser-compatible base64 decoding (string -> Uint8Array)
|
|
42
|
-
*/
|
|
43
|
-
function base64ToUint8Array(base64) {
|
|
44
|
-
const binary = atob(base64);
|
|
45
|
-
const bytes = new Uint8Array(binary.length);
|
|
46
|
-
for (let i = 0; i < binary.length; i++) {
|
|
47
|
-
bytes[i] = binary.charCodeAt(i);
|
|
48
|
-
}
|
|
49
|
-
return bytes;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Create a signed discount authorization
|
|
32
|
+
* Create a Discount PDA for a rental via slyvault's discount_create instruction.
|
|
53
33
|
*
|
|
54
|
-
* Server-side helper that
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* @returns A SerializedDiscountAuth object ready for API transport
|
|
34
|
+
* Server-side helper that:
|
|
35
|
+
* 1. Fetches the member to get nonce + vault
|
|
36
|
+
* 2. Generates a random 16-byte nonce
|
|
37
|
+
* 3. Derives the Discount PDA address
|
|
38
|
+
* 4. Returns the PDA address and the parameters needed to build the create_discount transaction
|
|
60
39
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* import { createDiscount } from '@wuwei-labs/srsly';
|
|
40
|
+
* The caller is responsible for building and sending the transaction with the
|
|
41
|
+
* codama-generated `discountCreate` instruction using the returned params.
|
|
64
42
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* expirySlots: 1000, // ~6-7 minutes
|
|
69
|
-
* discountAuthority: serverKeypair,
|
|
70
|
-
* });
|
|
71
|
-
*
|
|
72
|
-
* // Ready to return via API - no serialization needed
|
|
73
|
-
* return discountAuth;
|
|
74
|
-
* ```
|
|
43
|
+
* @param params - Discount parameters
|
|
44
|
+
* @param config - Optional SDK configuration overrides
|
|
45
|
+
* @returns Object with the PDA address and instruction params
|
|
75
46
|
*/
|
|
76
|
-
async function
|
|
47
|
+
async function createDiscountForRental(params, config) {
|
|
77
48
|
const finalConfig = (0, config_1.mergeConfig)(config);
|
|
78
49
|
const rpcUrl = (0, config_1.getRpcUrl)(finalConfig);
|
|
79
|
-
// Fetch member to get nonce
|
|
80
|
-
const memberAddr = (0, kit_1.address)(params.
|
|
50
|
+
// Fetch member to get nonce + vault
|
|
51
|
+
const memberAddr = (0, kit_1.address)(params.memberAddress);
|
|
81
52
|
const member = await (0, slyvault_1.fetchMember)(memberAddr, rpcUrl);
|
|
82
|
-
//
|
|
53
|
+
// Get current time and compute expiry
|
|
83
54
|
const rpc = (0, rpc_1.createRpc)(rpcUrl);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
55
|
+
const slot = await rpc.getSlot({ commitment: 'confirmed' }).send();
|
|
56
|
+
// Estimate current unix time (slot time is ~400ms on Solana)
|
|
57
|
+
const now = Math.floor(Date.now() / 1000);
|
|
58
|
+
const expiresAt = BigInt(now + params.expirySeconds);
|
|
59
|
+
// Generate random 16-byte nonce
|
|
60
|
+
const nonce = crypto.getRandomValues(new Uint8Array(16));
|
|
61
|
+
// Convert context to Address
|
|
62
|
+
const context = (0, kit_1.address)(params.context);
|
|
63
|
+
// Convert discountAuthority to TransactionSigner
|
|
87
64
|
let discountAuthority;
|
|
88
65
|
if (typeof params.discountAuthority === 'string') {
|
|
89
66
|
discountAuthority = await parseKeypairString(params.discountAuthority);
|
|
@@ -95,67 +72,29 @@ async function createDiscount(params, config) {
|
|
|
95
72
|
discountAuthority = await (0, kit_1.createKeyPairSignerFromBytes)(new Uint8Array(params.discountAuthority));
|
|
96
73
|
}
|
|
97
74
|
else if ('secretKey' in params.discountAuthority && params.discountAuthority.secretKey instanceof Uint8Array) {
|
|
98
|
-
// web3.js Keypair
|
|
99
75
|
discountAuthority = await (0, kit_1.createKeyPairSignerFromBytes)(params.discountAuthority.secretKey);
|
|
100
76
|
}
|
|
101
77
|
else {
|
|
102
|
-
// Already a KeyPairSigner
|
|
103
78
|
discountAuthority = params.discountAuthority;
|
|
104
79
|
}
|
|
105
|
-
//
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
80
|
+
// Derive the Discount PDA
|
|
81
|
+
const discountPda = await (0, slyvault_1.deriveDiscountPda)(context, nonce);
|
|
82
|
+
// Convert discount percentage to bps
|
|
83
|
+
const discountBps = Math.round(params.discount * 100);
|
|
84
|
+
const createParams = {
|
|
85
|
+
authority: discountAuthority,
|
|
86
|
+
memberState: memberAddr,
|
|
87
|
+
vault: member.data.vault,
|
|
88
|
+
context,
|
|
89
|
+
nonce,
|
|
109
90
|
memberNonce: member.data.nonce,
|
|
110
91
|
discount: params.discount,
|
|
111
|
-
|
|
112
|
-
discountAuthority,
|
|
113
|
-
});
|
|
114
|
-
// Return serialized format for API transport
|
|
115
|
-
return serializeDiscountAuth({ ...raw, context: contextAddr });
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Deserialize a discount authorization from API format
|
|
119
|
-
*
|
|
120
|
-
* Converts the JSON-safe SerializedDiscountAuth back to the format
|
|
121
|
-
* expected by the on-chain program.
|
|
122
|
-
*
|
|
123
|
-
* @internal Used by acceptRental and claimRental
|
|
124
|
-
*/
|
|
125
|
-
function deserializeDiscountAuth(serialized) {
|
|
126
|
-
return {
|
|
127
|
-
context: (0, kit_1.address)(serialized.context),
|
|
128
|
-
memberNonce: serialized.memberNonce,
|
|
129
|
-
discountBps: serialized.discountBps,
|
|
130
|
-
expirySlot: BigInt(serialized.expirySlot),
|
|
131
|
-
signature: base64ToUint8Array(serialized.signature),
|
|
92
|
+
expiresAt,
|
|
132
93
|
};
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Serialize a raw discount authorization to JSON-safe format
|
|
136
|
-
*
|
|
137
|
-
* Converts bigint expirySlot and Uint8Array signature to string representations
|
|
138
|
-
* suitable for API transport (JSON.stringify/JSON.parse safe).
|
|
139
|
-
*
|
|
140
|
-
* @param raw - Raw discount authorization with bigint/Uint8Array fields
|
|
141
|
-
* @returns SerializedDiscountAuth ready for JSON transport
|
|
142
|
-
*/
|
|
143
|
-
function serializeDiscountAuth(raw) {
|
|
144
94
|
return {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
expirySlot: raw.expirySlot.toString(),
|
|
149
|
-
signature: uint8ArrayToBase64(new Uint8Array(raw.signature)),
|
|
95
|
+
discountPda,
|
|
96
|
+
rentPayer: memberAddr,
|
|
97
|
+
createParams,
|
|
150
98
|
};
|
|
151
99
|
}
|
|
152
|
-
/**
|
|
153
|
-
* Check if a value is a SerializedDiscountAuth
|
|
154
|
-
*/
|
|
155
|
-
function isSerializedDiscountAuth(value) {
|
|
156
|
-
return (typeof value === 'object' &&
|
|
157
|
-
value !== null &&
|
|
158
|
-
'signature' in value &&
|
|
159
|
-
typeof value.signature === 'string');
|
|
160
|
-
}
|
|
161
100
|
//# sourceMappingURL=discountAuth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discountAuth.js","sourceRoot":"","sources":["../../../src/utils/discountAuth.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"discountAuth.js","sourceRoot":"","sources":["../../../src/utils/discountAuth.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAoEH,0DAmEC;AArID,qCAA0G;AAC1G,mDAI8B;AAC9B,qCAAkE;AAClE,+BAAkC;AAOlC;;GAEG;AACH,KAAK,UAAU,kBAAkB,CAAC,aAAqB;IACrD,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;YACjD,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,MAAM,IAAA,kCAA4B,EAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;AACH,CAAC;AAuBD;;;;;;;;;;;;;;;GAeG;AACI,KAAK,UAAU,uBAAuB,CAC3C,MAAqC,EACrC,MAA2B;IAS3B,MAAM,WAAW,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,IAAA,kBAAS,EAAC,WAAW,CAAC,CAAC;IAEtC,oCAAoC;IACpC,MAAM,UAAU,GAAG,IAAA,aAAO,EAAC,MAAM,CAAC,aAAwB,CAA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iBAAiB,IAAI,MAAM,CAAC,iBAAiB,CAAC,SAAS,YAAY,UAAU,EAAE,CAAC;QAC/G,iBAAiB,GAAG,MAAM,IAAA,kCAA4B,EAAC,MAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC7F,CAAC;SAAM,CAAC;QACN,iBAAiB,GAAG,MAAM,CAAC,iBAAsC,CAAC;IACpE,CAAC;IAED,0BAA0B;IAC1B,MAAM,WAAW,GAAG,MAAM,IAAA,4BAAiB,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAE5D,qCAAqC;IACrC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC;IAEtD,MAAM,YAAY,GAAyB;QACzC,SAAS,EAAE,iBAAiB;QAC5B,WAAW,EAAE,UAAU;QACvB,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK;QACxB,OAAO;QACP,KAAK;QACL,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK;QAC9B,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,SAAS;KACV,CAAC;IAEF,OAAO;QACL,WAAW;QACX,SAAS,EAAE,UAAU;QACrB,YAAY;KACb,CAAC;AACJ,CAAC"}
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @module utils
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.hasQueuedRental = exports.hasActiveRental = exports.getLookupTableAddress = exports.fetchLookupTable = exports.isRpcDebugEnabled = exports.setRpcDebug = exports.createRpc = exports.InstructionResult = exports.prepareInstructions = exports.toAddress = exports.toWeb3Instruction = exports.isAddressString = exports.isKitSigner = exports.isWeb3jsSigner = exports.validateAddress = exports.toTransactionSigner = exports.ATLASNET_ADDRESSES = exports.MAINNET_ADDRESSES = exports.ATLASNET_GENESIS = exports.DEVNET_GENESIS = exports.MAINNET_GENESIS = exports.resolveGenesisHash = exports.isValidNetwork = exports.isValidProgramSet = exports.getNetworkAddresses = exports.getProgramAddresses = exports.detectProgramSet = exports.getRpcUrl = exports.getAffiliateConfig = exports.getAddresses = exports.mergeConfig = exports.clearSdkConfig = exports.getSdkConfig = exports.setSdkConfig = void 0;
|
|
8
8
|
// Configuration
|
|
9
9
|
var config_1 = require("./config");
|
|
10
10
|
Object.defineProperty(exports, "setSdkConfig", { enumerable: true, get: function () { return config_1.setSdkConfig; } });
|
|
@@ -57,10 +57,4 @@ Object.defineProperty(exports, "getLookupTableAddress", { enumerable: true, get:
|
|
|
57
57
|
var rental_1 = require("./rental");
|
|
58
58
|
Object.defineProperty(exports, "hasActiveRental", { enumerable: true, get: function () { return rental_1.hasActiveRental; } });
|
|
59
59
|
Object.defineProperty(exports, "hasQueuedRental", { enumerable: true, get: function () { return rental_1.hasQueuedRental; } });
|
|
60
|
-
// Discount Authorization Utilities
|
|
61
|
-
var discountAuth_1 = require("./discountAuth");
|
|
62
|
-
Object.defineProperty(exports, "createDiscount", { enumerable: true, get: function () { return discountAuth_1.createDiscount; } });
|
|
63
|
-
Object.defineProperty(exports, "serializeDiscountAuth", { enumerable: true, get: function () { return discountAuth_1.serializeDiscountAuth; } });
|
|
64
|
-
Object.defineProperty(exports, "deserializeDiscountAuth", { enumerable: true, get: function () { return discountAuth_1.deserializeDiscountAuth; } });
|
|
65
|
-
Object.defineProperty(exports, "isSerializedDiscountAuth", { enumerable: true, get: function () { return discountAuth_1.isSerializedDiscountAuth; } });
|
|
66
60
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gBAAgB;AAChB,mCAYkB;AAXhB,sGAAA,YAAY,OAAA;AACZ,sGAAA,YAAY,OAAA;AACZ,wGAAA,cAAc,OAAA;AACd,qGA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AAc,OAAA;AACd,qGAAA,WAAW,OAAA;AACX,sGAAA,YAAY,OAAA;AACZ,4GAAA,kBAAkB,OAAA;AAClB,mGAAA,SAAS,OAAA;AACT,0GAAA,gBAAgB,OAAA;AAMlB,oBAAoB;AACpB,yCAeqB;AAdnB,gHAAA,mBAAmB,OAAA;AACnB,gHAAA,mBAAmB,OAAA;AACnB,8GAAA,iBAAiB,OAAA;AACjB,2GAAA,cAAc,OAAA;AACd,+GAAA,kBAAkB,OAAA;AAClB,4GAAA,eAAe,OAAA;AACf,2GAAA,cAAc,OAAA;AACd,6GAAA,gBAAgB,OAAA;AAChB,8GAAA,iBAAiB,OAAA;AACjB,+GAAA,kBAAkB,OAAA;AAOpB,mBAAmB;AACnB,mCAOkB;AANhB,6GAAA,mBAAmB,OAAA;AACnB,yGAAA,eAAe,OAAA;AACf,wGAAA,cAAc,OAAA;AACd,qGAAA,WAAW,OAAA;AACX,yGAAA,eAAe,OAAA;AAIjB,wBAAwB;AACxB,mCAMkB;AALhB,2GAAA,iBAAiB,OAAA;AACjB,mGAAA,SAAS,OAAA;AAMX,wBAAwB;AACxB,+CAGwB;AAFtB,mHAAA,mBAAmB,OAAA;AAIrB,qBAAqB;AACrB,yDAG6B;AAF3B,sHAAA,iBAAiB,OAAA;AAInB,gBAAgB;AAChB,6BAAkE;AAAzD,gGAAA,SAAS,OAAA;AAAE,kGAAA,WAAW,OAAA;AAAE,wGAAA,iBAAiB,OAAA;AAElD,iCAAiC;AACjC,6CAIuB;AAHrB,+GAAA,gBAAgB,OAAA;AAChB,oHAAA,qBAAqB,OAAA;AAIvB,mBAAmB;AACnB,mCAGkB;AAFhB,yGAAA,eAAe,OAAA;AACf,yGAAA,eAAe,OAAA"}
|
package/dist/cjs/version.js
CHANGED
|
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
4
|
// Auto-generated from package.json - DO NOT EDIT
|
|
5
5
|
// Run "pnpm run generate:version" to update
|
|
6
|
-
exports.VERSION = '4.
|
|
6
|
+
exports.VERSION = '4.2.0';
|
|
7
7
|
//# sourceMappingURL=version.js.map
|