@sly-rentals/core 5.4.0 → 5.5.1
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/api.json +13092 -9148
- package/dist/cjs/audit/events-registry.js +3 -0
- package/dist/cjs/audit/events-registry.js.map +1 -1
- package/dist/cjs/audit/events.js +41 -0
- package/dist/cjs/audit/events.js.map +1 -1
- package/dist/cjs/doctor/contract.js +297 -0
- package/dist/cjs/doctor/contract.js.map +1 -0
- package/dist/cjs/doctor/contract.test.js +143 -0
- package/dist/cjs/doctor/contract.test.js.map +1 -0
- package/dist/cjs/doctor/index.js +18 -0
- package/dist/cjs/doctor/index.js.map +1 -0
- package/dist/cjs/generated/codama/errors/srsly.js +10 -1
- package/dist/cjs/generated/codama/errors/srsly.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/closeContract.js +6 -1
- package/dist/cjs/generated/codama/instructions/closeContract.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/contractDoctorFiber.js +202 -0
- package/dist/cjs/generated/codama/instructions/contractDoctorFiber.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/index.js +1 -0
- package/dist/cjs/generated/codama/instructions/index.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/processContract.js.map +1 -1
- package/dist/cjs/generated/codama/programs/srsly.js +23 -19
- package/dist/cjs/generated/codama/programs/srsly.js.map +1 -1
- package/dist/cjs/generated/codama/types/contractFiberDoctored.js +31 -0
- package/dist/cjs/generated/codama/types/contractFiberDoctored.js.map +1 -0
- package/dist/cjs/generated/codama/types/index.js +3 -0
- package/dist/cjs/generated/codama/types/index.js.map +1 -1
- package/dist/cjs/generated/codama/types/reservationForceClosed.js +37 -0
- package/dist/cjs/generated/codama/types/reservationForceClosed.js.map +1 -0
- package/dist/cjs/generated/codama/types/serializableAccountMeta.js +31 -0
- package/dist/cjs/generated/codama/types/serializableAccountMeta.js.map +1 -0
- package/dist/cjs/idl/srsly.json +301 -2
- package/dist/cjs/instructions/closeContract.js +56 -12
- package/dist/cjs/instructions/closeContract.js.map +1 -1
- package/dist/cjs/instructions/closeContract.test.js +117 -0
- package/dist/cjs/instructions/closeContract.test.js.map +1 -0
- package/dist/cjs/instructions/closeRental.js +7 -4
- package/dist/cjs/instructions/closeRental.js.map +1 -1
- package/dist/cjs/instructions/contractDoctorFiber.js +75 -0
- package/dist/cjs/instructions/contractDoctorFiber.js.map +1 -0
- package/dist/cjs/instructions/index.js +3 -1
- package/dist/cjs/instructions/index.js.map +1 -1
- package/dist/cjs/kit/index.js +1 -0
- package/dist/cjs/kit/index.js.map +1 -1
- package/dist/cjs/legacy/index.js +3 -1
- package/dist/cjs/legacy/index.js.map +1 -1
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/utils/config.js +48 -11
- package/dist/cjs/utils/config.js.map +1 -1
- package/dist/cjs/utils/config.test.js +86 -0
- package/dist/cjs/utils/config.test.js.map +1 -0
- package/dist/cjs/version.js +1 -1
- package/dist/esm/audit/events-registry.js +3 -0
- package/dist/esm/audit/events-registry.js.map +1 -1
- package/dist/esm/audit/events.js +41 -0
- package/dist/esm/audit/events.js.map +1 -1
- package/dist/esm/doctor/contract.js +292 -0
- package/dist/esm/doctor/contract.js.map +1 -0
- package/dist/esm/doctor/contract.test.js +141 -0
- package/dist/esm/doctor/contract.test.js.map +1 -0
- package/dist/esm/doctor/index.js +12 -0
- package/dist/esm/doctor/index.js.map +1 -0
- package/dist/esm/generated/codama/errors/srsly.js +9 -0
- package/dist/esm/generated/codama/errors/srsly.js.map +1 -1
- package/dist/esm/generated/codama/instructions/closeContract.js +6 -1
- package/dist/esm/generated/codama/instructions/closeContract.js.map +1 -1
- package/dist/esm/generated/codama/instructions/contractDoctorFiber.js +192 -0
- package/dist/esm/generated/codama/instructions/contractDoctorFiber.js.map +1 -0
- package/dist/esm/generated/codama/instructions/index.js +1 -0
- package/dist/esm/generated/codama/instructions/index.js.map +1 -1
- package/dist/esm/generated/codama/instructions/processContract.js.map +1 -1
- package/dist/esm/generated/codama/programs/srsly.js +23 -19
- package/dist/esm/generated/codama/programs/srsly.js.map +1 -1
- package/dist/esm/generated/codama/types/contractFiberDoctored.js +26 -0
- package/dist/esm/generated/codama/types/contractFiberDoctored.js.map +1 -0
- package/dist/esm/generated/codama/types/index.js +3 -0
- package/dist/esm/generated/codama/types/index.js.map +1 -1
- package/dist/esm/generated/codama/types/reservationForceClosed.js +32 -0
- package/dist/esm/generated/codama/types/reservationForceClosed.js.map +1 -0
- package/dist/esm/generated/codama/types/serializableAccountMeta.js +26 -0
- package/dist/esm/generated/codama/types/serializableAccountMeta.js.map +1 -0
- package/dist/esm/idl/srsly.json +301 -2
- package/dist/esm/instructions/closeContract.js +57 -13
- package/dist/esm/instructions/closeContract.js.map +1 -1
- package/dist/esm/instructions/closeContract.test.js +115 -0
- package/dist/esm/instructions/closeContract.test.js.map +1 -0
- package/dist/esm/instructions/closeRental.js +7 -4
- package/dist/esm/instructions/closeRental.js.map +1 -1
- package/dist/esm/instructions/contractDoctorFiber.js +72 -0
- package/dist/esm/instructions/contractDoctorFiber.js.map +1 -0
- package/dist/esm/instructions/index.js +1 -0
- package/dist/esm/instructions/index.js.map +1 -1
- package/dist/esm/kit/index.js +1 -0
- package/dist/esm/kit/index.js.map +1 -1
- package/dist/esm/legacy/index.js +2 -0
- package/dist/esm/legacy/index.js.map +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/utils/config.js +49 -12
- package/dist/esm/utils/config.js.map +1 -1
- package/dist/esm/utils/config.test.js +84 -0
- package/dist/esm/utils/config.test.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/idl/srsly.json +301 -2
- package/dist/types/audit/events-registry.d.ts +1 -1
- package/dist/types/audit/events-registry.d.ts.map +1 -1
- package/dist/types/audit/events.d.ts.map +1 -1
- package/dist/types/audit/index.d.ts +1 -1
- package/dist/types/audit/index.d.ts.map +1 -1
- package/dist/types/audit/types.d.ts +46 -1
- package/dist/types/audit/types.d.ts.map +1 -1
- package/dist/types/doctor/contract.d.ts +133 -0
- package/dist/types/doctor/contract.d.ts.map +1 -0
- package/dist/types/doctor/contract.test.d.ts +2 -0
- package/dist/types/doctor/contract.test.d.ts.map +1 -0
- package/dist/types/doctor/index.d.ts +12 -0
- package/dist/types/doctor/index.d.ts.map +1 -0
- package/dist/types/generated/codama/errors/srsly.d.ts +6 -1
- package/dist/types/generated/codama/errors/srsly.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/closeContract.d.ts +34 -12
- package/dist/types/generated/codama/instructions/closeContract.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/contractDoctorFiber.d.ts +154 -0
- package/dist/types/generated/codama/instructions/contractDoctorFiber.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/index.d.ts +1 -0
- package/dist/types/generated/codama/instructions/index.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/processContract.d.ts +15 -3
- package/dist/types/generated/codama/instructions/processContract.d.ts.map +1 -1
- package/dist/types/generated/codama/programs/srsly.d.ts +23 -20
- package/dist/types/generated/codama/programs/srsly.d.ts.map +1 -1
- package/dist/types/generated/codama/types/contractFiberDoctored.d.ts +22 -0
- package/dist/types/generated/codama/types/contractFiberDoctored.d.ts.map +1 -0
- package/dist/types/generated/codama/types/index.d.ts +3 -0
- package/dist/types/generated/codama/types/index.d.ts.map +1 -1
- package/dist/types/generated/codama/types/reservationForceClosed.d.ts +36 -0
- package/dist/types/generated/codama/types/reservationForceClosed.d.ts.map +1 -0
- package/dist/types/generated/codama/types/serializableAccountMeta.d.ts +19 -0
- package/dist/types/generated/codama/types/serializableAccountMeta.d.ts.map +1 -0
- package/dist/types/instructions/closeContract.d.ts +13 -3
- package/dist/types/instructions/closeContract.d.ts.map +1 -1
- package/dist/types/instructions/closeContract.test.d.ts +2 -0
- package/dist/types/instructions/closeContract.test.d.ts.map +1 -0
- package/dist/types/instructions/closeRental.d.ts +11 -0
- package/dist/types/instructions/closeRental.d.ts.map +1 -1
- package/dist/types/instructions/contractDoctorFiber.d.ts +87 -0
- package/dist/types/instructions/contractDoctorFiber.d.ts.map +1 -0
- package/dist/types/instructions/index.d.ts +1 -0
- package/dist/types/instructions/index.d.ts.map +1 -1
- package/dist/types/kit/index.d.ts +1 -0
- package/dist/types/kit/index.d.ts.map +1 -1
- package/dist/types/legacy/index.d.ts +2 -0
- package/dist/types/legacy/index.d.ts.map +1 -1
- package/dist/types/utils/config.d.ts +5 -0
- package/dist/types/utils/config.d.ts.map +1 -1
- package/dist/types/utils/config.test.d.ts +2 -0
- package/dist/types/utils/config.test.d.ts.map +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getContractFiberDoctoredEncoder = getContractFiberDoctoredEncoder;
|
|
11
|
+
exports.getContractFiberDoctoredDecoder = getContractFiberDoctoredDecoder;
|
|
12
|
+
exports.getContractFiberDoctoredCodec = getContractFiberDoctoredCodec;
|
|
13
|
+
const kit_1 = require("@solana/kit");
|
|
14
|
+
function getContractFiberDoctoredEncoder() {
|
|
15
|
+
return (0, kit_1.getStructEncoder)([
|
|
16
|
+
["thread", (0, kit_1.getAddressEncoder)()],
|
|
17
|
+
["fiber", (0, kit_1.getAddressEncoder)()],
|
|
18
|
+
["fiberIndex", (0, kit_1.getU8Encoder)()],
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
function getContractFiberDoctoredDecoder() {
|
|
22
|
+
return (0, kit_1.getStructDecoder)([
|
|
23
|
+
["thread", (0, kit_1.getAddressDecoder)()],
|
|
24
|
+
["fiber", (0, kit_1.getAddressDecoder)()],
|
|
25
|
+
["fiberIndex", (0, kit_1.getU8Decoder)()],
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
function getContractFiberDoctoredCodec() {
|
|
29
|
+
return (0, kit_1.combineCodec)(getContractFiberDoctoredEncoder(), getContractFiberDoctoredDecoder());
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=contractFiberDoctored.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractFiberDoctored.js","sourceRoot":"","sources":["../../../../../src/generated/codama/types/contractFiberDoctored.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA4BH,0EAMC;AAED,0EAMC;AAED,sEAQC;AAlDD,qCAYqB;AAcrB,SAAgB,+BAA+B;IAC7C,OAAO,IAAA,sBAAgB,EAAC;QACtB,CAAC,QAAQ,EAAE,IAAA,uBAAiB,GAAE,CAAC;QAC/B,CAAC,OAAO,EAAE,IAAA,uBAAiB,GAAE,CAAC;QAC9B,CAAC,YAAY,EAAE,IAAA,kBAAY,GAAE,CAAC;KAC/B,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,+BAA+B;IAC7C,OAAO,IAAA,sBAAgB,EAAC;QACtB,CAAC,QAAQ,EAAE,IAAA,uBAAiB,GAAE,CAAC;QAC/B,CAAC,OAAO,EAAE,IAAA,uBAAiB,GAAE,CAAC;QAC9B,CAAC,YAAY,EAAE,IAAA,kBAAY,GAAE,CAAC;KAC/B,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,6BAA6B;IAI3C,OAAO,IAAA,kBAAY,EACjB,+BAA+B,EAAE,EACjC,+BAA+B,EAAE,CAClC,CAAC;AACJ,CAAC"}
|
|
@@ -28,6 +28,7 @@ __exportStar(require("./cargoStats"), exports);
|
|
|
28
28
|
__exportStar(require("./contractClosed"), exports);
|
|
29
29
|
__exportStar(require("./contractCloseQueued"), exports);
|
|
30
30
|
__exportStar(require("./contractCreated"), exports);
|
|
31
|
+
__exportStar(require("./contractFiberDoctored"), exports);
|
|
31
32
|
__exportStar(require("./contractUpdated"), exports);
|
|
32
33
|
__exportStar(require("./delegateSet"), exports);
|
|
33
34
|
__exportStar(require("./feesPaid"), exports);
|
|
@@ -41,9 +42,11 @@ __exportStar(require("./rentalCancelled"), exports);
|
|
|
41
42
|
__exportStar(require("./rentalClosed"), exports);
|
|
42
43
|
__exportStar(require("./rentalSettled"), exports);
|
|
43
44
|
__exportStar(require("./rentalStatus"), exports);
|
|
45
|
+
__exportStar(require("./reservationForceClosed"), exports);
|
|
44
46
|
__exportStar(require("./reservationKnockedOff"), exports);
|
|
45
47
|
__exportStar(require("./reservationPlaced"), exports);
|
|
46
48
|
__exportStar(require("./schedule"), exports);
|
|
49
|
+
__exportStar(require("./serializableAccountMeta"), exports);
|
|
47
50
|
__exportStar(require("./shipCounts"), exports);
|
|
48
51
|
__exportStar(require("./shipStats"), exports);
|
|
49
52
|
__exportStar(require("./signal"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/generated/codama/types/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;AAEH,oDAAkC;AAClC,mDAAiC;AACjC,oDAAkC;AAClC,+CAA6B;AAC7B,mDAAiC;AACjC,wDAAsC;AACtC,oDAAkC;AAClC,oDAAkC;AAClC,gDAA8B;AAC9B,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,kDAAgC;AAChC,4DAA0C;AAC1C,8CAA4B;AAC5B,mDAAiC;AACjC,oDAAkC;AAClC,iDAA+B;AAC/B,kDAAgC;AAChC,iDAA+B;AAC/B,0DAAwC;AACxC,sDAAoC;AACpC,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,2CAAyB;AACzB,sDAAoC;AACpC,2CAAyB;AACzB,iDAA+B;AAC/B,kDAAgC;AAChC,iDAA+B;AAC/B,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/generated/codama/types/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;AAEH,oDAAkC;AAClC,mDAAiC;AACjC,oDAAkC;AAClC,+CAA6B;AAC7B,mDAAiC;AACjC,wDAAsC;AACtC,oDAAkC;AAClC,0DAAwC;AACxC,oDAAkC;AAClC,gDAA8B;AAC9B,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,kDAAgC;AAChC,4DAA0C;AAC1C,8CAA4B;AAC5B,mDAAiC;AACjC,oDAAkC;AAClC,iDAA+B;AAC/B,kDAAgC;AAChC,iDAA+B;AAC/B,2DAAyC;AACzC,0DAAwC;AACxC,sDAAoC;AACpC,6CAA2B;AAC3B,4DAA0C;AAC1C,+CAA6B;AAC7B,8CAA4B;AAC5B,2CAAyB;AACzB,sDAAoC;AACpC,2CAAyB;AACzB,iDAA+B;AAC/B,kDAAgC;AAChC,iDAA+B;AAC/B,4CAA0B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getReservationForceClosedEncoder = getReservationForceClosedEncoder;
|
|
11
|
+
exports.getReservationForceClosedDecoder = getReservationForceClosedDecoder;
|
|
12
|
+
exports.getReservationForceClosedCodec = getReservationForceClosedCodec;
|
|
13
|
+
const kit_1 = require("@solana/kit");
|
|
14
|
+
function getReservationForceClosedEncoder() {
|
|
15
|
+
return (0, kit_1.getStructEncoder)([
|
|
16
|
+
["rentalState", (0, kit_1.getAddressEncoder)()],
|
|
17
|
+
["contract", (0, kit_1.getAddressEncoder)()],
|
|
18
|
+
["borrower", (0, kit_1.getAddressEncoder)()],
|
|
19
|
+
["refund", (0, kit_1.getU64Encoder)()],
|
|
20
|
+
["fromContract", (0, kit_1.getU64Encoder)()],
|
|
21
|
+
["fromOwner", (0, kit_1.getU64Encoder)()],
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
function getReservationForceClosedDecoder() {
|
|
25
|
+
return (0, kit_1.getStructDecoder)([
|
|
26
|
+
["rentalState", (0, kit_1.getAddressDecoder)()],
|
|
27
|
+
["contract", (0, kit_1.getAddressDecoder)()],
|
|
28
|
+
["borrower", (0, kit_1.getAddressDecoder)()],
|
|
29
|
+
["refund", (0, kit_1.getU64Decoder)()],
|
|
30
|
+
["fromContract", (0, kit_1.getU64Decoder)()],
|
|
31
|
+
["fromOwner", (0, kit_1.getU64Decoder)()],
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
function getReservationForceClosedCodec() {
|
|
35
|
+
return (0, kit_1.combineCodec)(getReservationForceClosedEncoder(), getReservationForceClosedDecoder());
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=reservationForceClosed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reservationForceClosed.js","sourceRoot":"","sources":["../../../../../src/generated/codama/types/reservationForceClosed.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA0CH,4EASC;AAED,4EASC;AAED,wEAQC;AAtED,qCAYqB;AA4BrB,SAAgB,gCAAgC;IAC9C,OAAO,IAAA,sBAAgB,EAAC;QACtB,CAAC,aAAa,EAAE,IAAA,uBAAiB,GAAE,CAAC;QACpC,CAAC,UAAU,EAAE,IAAA,uBAAiB,GAAE,CAAC;QACjC,CAAC,UAAU,EAAE,IAAA,uBAAiB,GAAE,CAAC;QACjC,CAAC,QAAQ,EAAE,IAAA,mBAAa,GAAE,CAAC;QAC3B,CAAC,cAAc,EAAE,IAAA,mBAAa,GAAE,CAAC;QACjC,CAAC,WAAW,EAAE,IAAA,mBAAa,GAAE,CAAC;KAC/B,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,gCAAgC;IAC9C,OAAO,IAAA,sBAAgB,EAAC;QACtB,CAAC,aAAa,EAAE,IAAA,uBAAiB,GAAE,CAAC;QACpC,CAAC,UAAU,EAAE,IAAA,uBAAiB,GAAE,CAAC;QACjC,CAAC,UAAU,EAAE,IAAA,uBAAiB,GAAE,CAAC;QACjC,CAAC,QAAQ,EAAE,IAAA,mBAAa,GAAE,CAAC;QAC3B,CAAC,cAAc,EAAE,IAAA,mBAAa,GAAE,CAAC;QACjC,CAAC,WAAW,EAAE,IAAA,mBAAa,GAAE,CAAC;KAC/B,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,8BAA8B;IAI5C,OAAO,IAAA,kBAAY,EACjB,gCAAgC,EAAE,EAClC,gCAAgC,EAAE,CACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun Codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getSerializableAccountMetaEncoder = getSerializableAccountMetaEncoder;
|
|
11
|
+
exports.getSerializableAccountMetaDecoder = getSerializableAccountMetaDecoder;
|
|
12
|
+
exports.getSerializableAccountMetaCodec = getSerializableAccountMetaCodec;
|
|
13
|
+
const kit_1 = require("@solana/kit");
|
|
14
|
+
function getSerializableAccountMetaEncoder() {
|
|
15
|
+
return (0, kit_1.getStructEncoder)([
|
|
16
|
+
["pubkey", (0, kit_1.getAddressEncoder)()],
|
|
17
|
+
["isSigner", (0, kit_1.getBooleanEncoder)()],
|
|
18
|
+
["isWritable", (0, kit_1.getBooleanEncoder)()],
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
function getSerializableAccountMetaDecoder() {
|
|
22
|
+
return (0, kit_1.getStructDecoder)([
|
|
23
|
+
["pubkey", (0, kit_1.getAddressDecoder)()],
|
|
24
|
+
["isSigner", (0, kit_1.getBooleanDecoder)()],
|
|
25
|
+
["isWritable", (0, kit_1.getBooleanDecoder)()],
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
function getSerializableAccountMetaCodec() {
|
|
29
|
+
return (0, kit_1.combineCodec)(getSerializableAccountMetaEncoder(), getSerializableAccountMetaDecoder());
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=serializableAccountMeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializableAccountMeta.js","sourceRoot":"","sources":["../../../../../src/generated/codama/types/serializableAccountMeta.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAyBH,8EAMC;AAED,8EAMC;AAED,0EAQC;AA/CD,qCAYqB;AAWrB,SAAgB,iCAAiC;IAC/C,OAAO,IAAA,sBAAgB,EAAC;QACtB,CAAC,QAAQ,EAAE,IAAA,uBAAiB,GAAE,CAAC;QAC/B,CAAC,UAAU,EAAE,IAAA,uBAAiB,GAAE,CAAC;QACjC,CAAC,YAAY,EAAE,IAAA,uBAAiB,GAAE,CAAC;KACpC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,iCAAiC;IAC/C,OAAO,IAAA,sBAAgB,EAAC;QACtB,CAAC,QAAQ,EAAE,IAAA,uBAAiB,GAAE,CAAC;QAC/B,CAAC,UAAU,EAAE,IAAA,uBAAiB,GAAE,CAAC;QACjC,CAAC,YAAY,EAAE,IAAA,uBAAiB,GAAE,CAAC;KACpC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,+BAA+B;IAI7C,OAAO,IAAA,kBAAY,EACjB,iCAAiC,EAAE,EACnC,iCAAiC,EAAE,CACpC,CAAC;AACJ,CAAC"}
|
package/dist/cjs/idl/srsly.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"address": "SRSLYxcFnjd5jG2DpJw4as6UEyjwJQK1U4J1TD1hvZH",
|
|
3
3
|
"metadata": {
|
|
4
4
|
"name": "srsly",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.7.0",
|
|
6
6
|
"spec": "0.1.0",
|
|
7
7
|
"description": "Space Rental from SLY",
|
|
8
8
|
"repository": "https://github.com/wuwei-labs/srsly"
|
|
@@ -1541,6 +1541,16 @@
|
|
|
1541
1541
|
"writable": true,
|
|
1542
1542
|
"optional": true
|
|
1543
1543
|
},
|
|
1544
|
+
{
|
|
1545
|
+
"name": "contract_thread",
|
|
1546
|
+
"docs": [
|
|
1547
|
+
"gone when `contract.thread` still names it — `delete_contract_thread`",
|
|
1548
|
+
"tears a thread down without clearing the pointer, which would",
|
|
1549
|
+
"otherwise leave the contract permanently unclosable. Only the address",
|
|
1550
|
+
"is trusted; it must equal `contract.thread` and hold no data."
|
|
1551
|
+
],
|
|
1552
|
+
"optional": true
|
|
1553
|
+
},
|
|
1544
1554
|
{
|
|
1545
1555
|
"name": "rental_authority",
|
|
1546
1556
|
"pda": {
|
|
@@ -1936,6 +1946,146 @@
|
|
|
1936
1946
|
}
|
|
1937
1947
|
}
|
|
1938
1948
|
},
|
|
1949
|
+
{
|
|
1950
|
+
"name": "contract_doctor_fiber",
|
|
1951
|
+
"docs": [
|
|
1952
|
+
"Rewrite one of a contract thread's fibers, for when `fiber_ids` and the",
|
|
1953
|
+
"accounts it names have diverged and the thread can no longer build.",
|
|
1954
|
+
"Callable by the contract's owner or by admin; `payer` funds the rent and",
|
|
1955
|
+
"`rental_authority` signs the CPI."
|
|
1956
|
+
],
|
|
1957
|
+
"discriminator": [
|
|
1958
|
+
129,
|
|
1959
|
+
173,
|
|
1960
|
+
84,
|
|
1961
|
+
247,
|
|
1962
|
+
167,
|
|
1963
|
+
228,
|
|
1964
|
+
206,
|
|
1965
|
+
192
|
|
1966
|
+
],
|
|
1967
|
+
"accounts": [
|
|
1968
|
+
{
|
|
1969
|
+
"name": "payer",
|
|
1970
|
+
"docs": [
|
|
1971
|
+
"Signs, and pays rent for the rewritten fiber. The contract's owner or",
|
|
1972
|
+
"`config.admin`. It is *not* the thread's authority — that is",
|
|
1973
|
+
"`rental_authority`, and only this program can sign for it."
|
|
1974
|
+
],
|
|
1975
|
+
"writable": true,
|
|
1976
|
+
"signer": true
|
|
1977
|
+
},
|
|
1978
|
+
{
|
|
1979
|
+
"name": "config",
|
|
1980
|
+
"docs": [
|
|
1981
|
+
"Bypassed when payer is AUTHORIZED_INITIALIZER (break-glass)."
|
|
1982
|
+
],
|
|
1983
|
+
"pda": {
|
|
1984
|
+
"seeds": [
|
|
1985
|
+
{
|
|
1986
|
+
"kind": "const",
|
|
1987
|
+
"value": [
|
|
1988
|
+
99,
|
|
1989
|
+
111,
|
|
1990
|
+
110,
|
|
1991
|
+
102,
|
|
1992
|
+
105,
|
|
1993
|
+
103
|
|
1994
|
+
]
|
|
1995
|
+
}
|
|
1996
|
+
]
|
|
1997
|
+
}
|
|
1998
|
+
},
|
|
1999
|
+
{
|
|
2000
|
+
"name": "contract",
|
|
2001
|
+
"docs": [
|
|
2002
|
+
"binds the write: it authorizes the payer, pins `contract_thread` to",
|
|
2003
|
+
"`contract.thread`, and scopes the payload. Owners must supply it.",
|
|
2004
|
+
"Optional so admins retain a break-glass path for a contract that is",
|
|
2005
|
+
"mid-migration or undeserializable."
|
|
2006
|
+
],
|
|
2007
|
+
"optional": true
|
|
2008
|
+
},
|
|
2009
|
+
{
|
|
2010
|
+
"name": "rental_authority",
|
|
2011
|
+
"writable": true,
|
|
2012
|
+
"pda": {
|
|
2013
|
+
"seeds": [
|
|
2014
|
+
{
|
|
2015
|
+
"kind": "const",
|
|
2016
|
+
"value": [
|
|
2017
|
+
114,
|
|
2018
|
+
101,
|
|
2019
|
+
110,
|
|
2020
|
+
116,
|
|
2021
|
+
97,
|
|
2022
|
+
108,
|
|
2023
|
+
95,
|
|
2024
|
+
97,
|
|
2025
|
+
117,
|
|
2026
|
+
116,
|
|
2027
|
+
104,
|
|
2028
|
+
111,
|
|
2029
|
+
114,
|
|
2030
|
+
105,
|
|
2031
|
+
116,
|
|
2032
|
+
121
|
|
2033
|
+
]
|
|
2034
|
+
}
|
|
2035
|
+
]
|
|
2036
|
+
}
|
|
2037
|
+
},
|
|
2038
|
+
{
|
|
2039
|
+
"name": "contract_thread",
|
|
2040
|
+
"docs": [
|
|
2041
|
+
"`contract` is supplied. Left unchecked in the struct so the break-glass",
|
|
2042
|
+
"path still works: antegen's `update_fiber` rejects any thread whose",
|
|
2043
|
+
"authority is not `rental_authority`, which confines this to SRSLY",
|
|
2044
|
+
"threads on its own."
|
|
2045
|
+
],
|
|
2046
|
+
"writable": true
|
|
2047
|
+
},
|
|
2048
|
+
{
|
|
2049
|
+
"name": "fiber",
|
|
2050
|
+
"docs": [
|
|
2051
|
+
"against the thread via seeds."
|
|
2052
|
+
],
|
|
2053
|
+
"writable": true
|
|
2054
|
+
},
|
|
2055
|
+
{
|
|
2056
|
+
"name": "antegen_program",
|
|
2057
|
+
"address": "AgTv5w1UvUb6zeqkThwMrztGu9hpepBu8YLghuR4dpSx"
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
"name": "fiber_program",
|
|
2061
|
+
"address": "AgFv5afjW9DmSPkiEvJ1er5bAAmRUqaBeTB6Cr8e1hKx"
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
"name": "system_program",
|
|
2065
|
+
"address": "11111111111111111111111111111111"
|
|
2066
|
+
}
|
|
2067
|
+
],
|
|
2068
|
+
"args": [
|
|
2069
|
+
{
|
|
2070
|
+
"name": "fiber_index",
|
|
2071
|
+
"type": "u8"
|
|
2072
|
+
},
|
|
2073
|
+
{
|
|
2074
|
+
"name": "instruction",
|
|
2075
|
+
"type": {
|
|
2076
|
+
"defined": {
|
|
2077
|
+
"name": "SerializableInstruction"
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
},
|
|
2081
|
+
{
|
|
2082
|
+
"name": "priority_fee",
|
|
2083
|
+
"type": {
|
|
2084
|
+
"option": "u64"
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
]
|
|
2088
|
+
},
|
|
1939
2089
|
{
|
|
1940
2090
|
"name": "create_borrower",
|
|
1941
2091
|
"docs": [
|
|
@@ -3597,7 +3747,9 @@
|
|
|
3597
3747
|
{
|
|
3598
3748
|
"name": "owner_token_account",
|
|
3599
3749
|
"docs": [
|
|
3600
|
-
"Owner's destination token account (created by contract_thread)"
|
|
3750
|
+
"Owner's destination token account (created by contract_thread). The",
|
|
3751
|
+
"owner may close it, in which case payouts are deferred rather than",
|
|
3752
|
+
"failing the tick."
|
|
3601
3753
|
],
|
|
3602
3754
|
"writable": true
|
|
3603
3755
|
},
|
|
@@ -4600,6 +4752,19 @@
|
|
|
4600
4752
|
164
|
|
4601
4753
|
]
|
|
4602
4754
|
},
|
|
4755
|
+
{
|
|
4756
|
+
"name": "ContractFiberDoctored",
|
|
4757
|
+
"discriminator": [
|
|
4758
|
+
14,
|
|
4759
|
+
49,
|
|
4760
|
+
216,
|
|
4761
|
+
13,
|
|
4762
|
+
84,
|
|
4763
|
+
33,
|
|
4764
|
+
142,
|
|
4765
|
+
31
|
|
4766
|
+
]
|
|
4767
|
+
},
|
|
4603
4768
|
{
|
|
4604
4769
|
"name": "ContractUpdated",
|
|
4605
4770
|
"discriminator": [
|
|
@@ -4704,6 +4869,19 @@
|
|
|
4704
4869
|
59
|
|
4705
4870
|
]
|
|
4706
4871
|
},
|
|
4872
|
+
{
|
|
4873
|
+
"name": "ReservationForceClosed",
|
|
4874
|
+
"discriminator": [
|
|
4875
|
+
242,
|
|
4876
|
+
40,
|
|
4877
|
+
22,
|
|
4878
|
+
31,
|
|
4879
|
+
119,
|
|
4880
|
+
14,
|
|
4881
|
+
46,
|
|
4882
|
+
11
|
|
4883
|
+
]
|
|
4884
|
+
},
|
|
4707
4885
|
{
|
|
4708
4886
|
"name": "ReservationKnockedOff",
|
|
4709
4887
|
"discriminator": [
|
|
@@ -5253,6 +5431,11 @@
|
|
|
5253
5431
|
"code": 6093,
|
|
5254
5432
|
"name": "InsufficientFundsToCloseQueuedReservation",
|
|
5255
5433
|
"msg": "Owner has insufficient ATLAS to refund the queued challenger's full bid. \\\n Deposit more ATLAS into your token account and retry. The exact \\\n shortfall amount is emitted in the program log."
|
|
5434
|
+
},
|
|
5435
|
+
{
|
|
5436
|
+
"code": 6094,
|
|
5437
|
+
"name": "InvalidInstructionData",
|
|
5438
|
+
"msg": "Fiber payload rejected. Index 0 must carry ProcessContract and index 1 \\\n must carry CloseRental, both targeting this program; and when the \\\n caller is the contract owner rather than admin, the payload must \\\n name that same contract, and that same thread."
|
|
5256
5439
|
}
|
|
5257
5440
|
],
|
|
5258
5441
|
"types": [
|
|
@@ -5947,6 +6130,30 @@
|
|
|
5947
6130
|
]
|
|
5948
6131
|
}
|
|
5949
6132
|
},
|
|
6133
|
+
{
|
|
6134
|
+
"name": "ContractFiberDoctored",
|
|
6135
|
+
"docs": [
|
|
6136
|
+
"Emitted on `contract_doctor_fiber` — one per fiber rewritten to bring a",
|
|
6137
|
+
"thread's `fiber_ids` back into agreement with the accounts they name."
|
|
6138
|
+
],
|
|
6139
|
+
"type": {
|
|
6140
|
+
"kind": "struct",
|
|
6141
|
+
"fields": [
|
|
6142
|
+
{
|
|
6143
|
+
"name": "thread",
|
|
6144
|
+
"type": "pubkey"
|
|
6145
|
+
},
|
|
6146
|
+
{
|
|
6147
|
+
"name": "fiber",
|
|
6148
|
+
"type": "pubkey"
|
|
6149
|
+
},
|
|
6150
|
+
{
|
|
6151
|
+
"name": "fiber_index",
|
|
6152
|
+
"type": "u8"
|
|
6153
|
+
}
|
|
6154
|
+
]
|
|
6155
|
+
}
|
|
6156
|
+
},
|
|
5950
6157
|
{
|
|
5951
6158
|
"name": "ContractState",
|
|
5952
6159
|
"docs": [
|
|
@@ -6944,6 +7151,46 @@
|
|
|
6944
7151
|
]
|
|
6945
7152
|
}
|
|
6946
7153
|
},
|
|
7154
|
+
{
|
|
7155
|
+
"name": "ReservationForceClosed",
|
|
7156
|
+
"docs": [
|
|
7157
|
+
"Emitted when the owner closes a contract out from under a queued",
|
|
7158
|
+
"reservation. The challenger is made whole on their gross stake —",
|
|
7159
|
+
"`refund` = `from_contract` + `from_owner`, where `from_owner` is the",
|
|
7160
|
+
"shortfall the owner tops up (the bonus already paid out during the",
|
|
7161
|
+
"contract's auction history). No CTF points are awarded: the rental",
|
|
7162
|
+
"never happened."
|
|
7163
|
+
],
|
|
7164
|
+
"type": {
|
|
7165
|
+
"kind": "struct",
|
|
7166
|
+
"fields": [
|
|
7167
|
+
{
|
|
7168
|
+
"name": "rental_state",
|
|
7169
|
+
"type": "pubkey"
|
|
7170
|
+
},
|
|
7171
|
+
{
|
|
7172
|
+
"name": "contract",
|
|
7173
|
+
"type": "pubkey"
|
|
7174
|
+
},
|
|
7175
|
+
{
|
|
7176
|
+
"name": "borrower",
|
|
7177
|
+
"type": "pubkey"
|
|
7178
|
+
},
|
|
7179
|
+
{
|
|
7180
|
+
"name": "refund",
|
|
7181
|
+
"type": "u64"
|
|
7182
|
+
},
|
|
7183
|
+
{
|
|
7184
|
+
"name": "from_contract",
|
|
7185
|
+
"type": "u64"
|
|
7186
|
+
},
|
|
7187
|
+
{
|
|
7188
|
+
"name": "from_owner",
|
|
7189
|
+
"type": "u64"
|
|
7190
|
+
}
|
|
7191
|
+
]
|
|
7192
|
+
}
|
|
7193
|
+
},
|
|
6947
7194
|
{
|
|
6948
7195
|
"name": "ReservationKnockedOff",
|
|
6949
7196
|
"docs": [
|
|
@@ -7070,6 +7317,58 @@
|
|
|
7070
7317
|
]
|
|
7071
7318
|
}
|
|
7072
7319
|
},
|
|
7320
|
+
{
|
|
7321
|
+
"name": "SerializableAccountMeta",
|
|
7322
|
+
"docs": [
|
|
7323
|
+
"Serializable version of AccountMeta"
|
|
7324
|
+
],
|
|
7325
|
+
"type": {
|
|
7326
|
+
"kind": "struct",
|
|
7327
|
+
"fields": [
|
|
7328
|
+
{
|
|
7329
|
+
"name": "pubkey",
|
|
7330
|
+
"type": "pubkey"
|
|
7331
|
+
},
|
|
7332
|
+
{
|
|
7333
|
+
"name": "is_signer",
|
|
7334
|
+
"type": "bool"
|
|
7335
|
+
},
|
|
7336
|
+
{
|
|
7337
|
+
"name": "is_writable",
|
|
7338
|
+
"type": "bool"
|
|
7339
|
+
}
|
|
7340
|
+
]
|
|
7341
|
+
}
|
|
7342
|
+
},
|
|
7343
|
+
{
|
|
7344
|
+
"name": "SerializableInstruction",
|
|
7345
|
+
"docs": [
|
|
7346
|
+
"Serializable version of Solana's Instruction for easier handling"
|
|
7347
|
+
],
|
|
7348
|
+
"type": {
|
|
7349
|
+
"kind": "struct",
|
|
7350
|
+
"fields": [
|
|
7351
|
+
{
|
|
7352
|
+
"name": "program_id",
|
|
7353
|
+
"type": "pubkey"
|
|
7354
|
+
},
|
|
7355
|
+
{
|
|
7356
|
+
"name": "accounts",
|
|
7357
|
+
"type": {
|
|
7358
|
+
"vec": {
|
|
7359
|
+
"defined": {
|
|
7360
|
+
"name": "SerializableAccountMeta"
|
|
7361
|
+
}
|
|
7362
|
+
}
|
|
7363
|
+
}
|
|
7364
|
+
},
|
|
7365
|
+
{
|
|
7366
|
+
"name": "data",
|
|
7367
|
+
"type": "bytes"
|
|
7368
|
+
}
|
|
7369
|
+
]
|
|
7370
|
+
}
|
|
7371
|
+
},
|
|
7073
7372
|
{
|
|
7074
7373
|
"name": "ShipCounts",
|
|
7075
7374
|
"docs": [
|
|
@@ -10,6 +10,7 @@ exports.closeContract = closeContract;
|
|
|
10
10
|
const kit_1 = require("@solana/kit");
|
|
11
11
|
const instructions_1 = require("../generated/codama/instructions");
|
|
12
12
|
const config_1 = require("../utils/config");
|
|
13
|
+
const rpc_1 = require("../utils/rpc");
|
|
13
14
|
const signer_1 = require("../utils/signer");
|
|
14
15
|
const thread_1 = require("../accounts/thread");
|
|
15
16
|
const contractSnapshot_1 = require("../utils/contractSnapshot");
|
|
@@ -19,9 +20,19 @@ const thread_2 = require("../pda/thread");
|
|
|
19
20
|
const instructions_2 = require("../utils/instructions");
|
|
20
21
|
const closeRental_1 = require("./closeRental");
|
|
21
22
|
/**
|
|
22
|
-
* Close a rental contract and refund rent to the owner.
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* Close a rental contract and refund rent to the owner. When no rental is
|
|
24
|
+
* active, the contract's automation thread is closed in the same transaction.
|
|
25
|
+
*
|
|
26
|
+
* A live rental cannot be closed out from under its borrower, so the close is
|
|
27
|
+
* latched as `to_close` and completed later by the automation thread, once the
|
|
28
|
+
* rental ends. Antegen execution is permissionless and executors are paid from
|
|
29
|
+
* the thread's own lamport balance, so a drained thread can be revived by
|
|
30
|
+
* anyone with a plain SOL transfer — the owner does not need to come back.
|
|
31
|
+
*
|
|
32
|
+
* Safe to retry while the close is still pending: a repeat call is a no-op
|
|
33
|
+
* that re-latches the flag. It is *not* a no-op after a successful full close
|
|
34
|
+
* — the contract account is gone, so the next call fails during account
|
|
35
|
+
* validation. That reverts cleanly, burning no rent.
|
|
25
36
|
*
|
|
26
37
|
* @param params - Contract closing parameters
|
|
27
38
|
* @param config - Optional SDK configuration overrides
|
|
@@ -137,16 +148,43 @@ async function closeContract(params, config) {
|
|
|
137
148
|
const contractThread = await (0, thread_2.deriveContractThread)(contractAddress, rentalAuthority);
|
|
138
149
|
const threadAccount = await (0, thread_1.fetchThreadByAddress)(contractThread, finalConfig.rpcUrl);
|
|
139
150
|
const fiberIds = Array.from(threadAccount.data.fiberIds);
|
|
140
|
-
|
|
141
|
-
|
|
151
|
+
// Only pass fibers that still exist. `fiber_ids` records what the thread
|
|
152
|
+
// *tracks*, and nothing on chain keeps that in agreement with the accounts
|
|
153
|
+
// it names — a fiber account can be closed out from under it, which is
|
|
154
|
+
// exactly what the 2026-08-26 rent sweep did to hundreds of them. Passing
|
|
155
|
+
// an id whose account is gone makes the fiber program deserialize an empty
|
|
156
|
+
// buffer and fail with `InvalidFiberData`, so a contract that tracks a
|
|
157
|
+
// destroyed fiber could never be closed at all.
|
|
158
|
+
//
|
|
159
|
+
// A tracked-but-absent fiber needs nothing closed; dropping it from the
|
|
160
|
+
// list is the whole remedy.
|
|
161
|
+
const fiberAddresses = await Promise.all(fiberIds.map(id => (0, thread_2.deriveFiber)(contractThread, id)));
|
|
162
|
+
const rpc = (0, rpc_1.createRpc)(finalConfig.rpcUrl || (0, config_1.getRpcUrl)(config));
|
|
163
|
+
const probed = fiberAddresses.length
|
|
164
|
+
? (await rpc.getMultipleAccounts(fiberAddresses, { encoding: 'base64' }).send()).value
|
|
165
|
+
: [];
|
|
166
|
+
const fiberAccounts = fiberAddresses
|
|
167
|
+
.filter((_, i) => probed[i] !== null)
|
|
168
|
+
.map(fiberAddress => ({
|
|
169
|
+
address: fiberAddress,
|
|
142
170
|
role: kit_1.AccountRole.WRITABLE,
|
|
143
|
-
}))
|
|
171
|
+
}));
|
|
144
172
|
const ix = await (0, instructions_1.getCloseContractThreadInstructionAsync)({ owner: ownerSigner, contract: contractAddress, thread: contractThread }, { programAddress });
|
|
145
173
|
ix.accounts.push(...fiberAccounts);
|
|
146
174
|
return ix;
|
|
147
175
|
};
|
|
148
176
|
// Helper: build a closeContract instruction with optional queued borrower accounts
|
|
149
177
|
const buildCloseContractIx = async (includeQueued) => {
|
|
178
|
+
// Pass the thread PDA whenever the contract still points at one. Normally
|
|
179
|
+
// it's redundant — `closeContractThread` clears the pointer first. It
|
|
180
|
+
// matters when the pointer is stale: `deleteContractThread` (admin
|
|
181
|
+
// break-glass) closes a thread without touching the contract, and without
|
|
182
|
+
// the account to prove it's gone the contract can never be closed at all.
|
|
183
|
+
let contractThread;
|
|
184
|
+
if (hasThread) {
|
|
185
|
+
const rentalAuthority = await (0, srsly_1.deriveRentalAuthority)();
|
|
186
|
+
contractThread = await (0, thread_2.deriveContractThread)(contractAddress, rentalAuthority);
|
|
187
|
+
}
|
|
150
188
|
return (0, instructions_1.getCloseContractInstructionAsync)({
|
|
151
189
|
owner: ownerSigner,
|
|
152
190
|
contract: contractAddress,
|
|
@@ -154,6 +192,7 @@ async function closeContract(params, config) {
|
|
|
154
192
|
fleet: fleetAddress,
|
|
155
193
|
contractTokenAccount: contractTokenAccount,
|
|
156
194
|
sageProgram,
|
|
195
|
+
...(contractThread ? { contractThread } : {}),
|
|
157
196
|
...(includeQueued && queuedBorrowerState && queuedBorrowerTokenAccount
|
|
158
197
|
? { queuedBorrowerState, queuedBorrowerTokenAccount }
|
|
159
198
|
: {}),
|
|
@@ -162,18 +201,23 @@ async function closeContract(params, config) {
|
|
|
162
201
|
// Compose instructions based on scenario
|
|
163
202
|
const ixs = [];
|
|
164
203
|
if (activeExpired && hasQueuedSlot) {
|
|
165
|
-
// Expired active + queued
|
|
166
|
-
//
|
|
167
|
-
|
|
204
|
+
// Expired active + queued.
|
|
205
|
+
//
|
|
206
|
+
// Order is load-bearing. `closeRental` must NOT promote the challenger —
|
|
207
|
+
// Path B would install a brand-new live rental and every close after it
|
|
208
|
+
// would just re-latch `to_close`. Suppress the activation so the rental
|
|
209
|
+
// ends and the slot stays empty (Path A), drop the thread so the
|
|
210
|
+
// immediate-close branch isn't blocked by `ThreadStillExists`, then let a
|
|
211
|
+
// single `closeContract` force-refund the challenger and close for real.
|
|
212
|
+
// 1. Settle the expired active without promoting the queued challenger.
|
|
213
|
+
const closeRentalResult = await (0, closeRental_1.closeRental)({ payer: params.owner, contract: contractAddress, activateQueued: false }, config);
|
|
168
214
|
ixs.push(...closeRentalResult.instructions);
|
|
169
215
|
// 2. closeContractThread (if thread exists)
|
|
170
216
|
if (hasThread) {
|
|
171
217
|
ixs.push(await buildThreadCloseIx());
|
|
172
218
|
}
|
|
173
|
-
// 3. closeContract — force-
|
|
219
|
+
// 3. closeContract — force-refunds the queued challenger, then closes.
|
|
174
220
|
ixs.push(await buildCloseContractIx(true));
|
|
175
|
-
// 4. closeContract — final close (no active, no queued, no thread)
|
|
176
|
-
ixs.push(await buildCloseContractIx(false));
|
|
177
221
|
}
|
|
178
222
|
else if (activeExpired && !hasQueuedSlot) {
|
|
179
223
|
// Expired active only, no queued — settle then close
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closeContract.js","sourceRoot":"","sources":["../../../src/instructions/closeContract.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;
|
|
1
|
+
{"version":3,"file":"closeContract.js","sourceRoot":"","sources":["../../../src/instructions/closeContract.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA8GH,sCAuNC;AAnUD,qCAAmF;AACnF,mEAG0C;AAC1C,4CAAuF;AACvF,sCAAyC;AACzC,4CAA4E;AAC5E,+CAA0D;AAC1D,gEAA2F;AAC3F,wCAA4D;AAC5D,wCAA0F;AAC1F,0CAAkE;AAClE,wDAA4D;AAC5D,+CAA4C;AAqD5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;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,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IAED,sCAAsC;IACtC,MAAM,WAAW,GAAG,IAAA,4BAAmB,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAEtD,MAAM,SAAS,GAAG,IAAA,qBAAY,EAAC,MAAM,CAAC,CAAC;IACvC,MAAM,cAAc,GAAG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