@wuwei-labs/srsly 3.0.0-beta.21 → 3.0.0-beta.22
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/accounts/index.js +23 -0
- package/dist/cjs/accounts/index.js.map +1 -0
- package/dist/cjs/demos.js +157 -57
- package/dist/cjs/demos.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/borrowerState.js +8 -2
- package/dist/cjs/generated/codama/accounts/borrowerState.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/configState.js +0 -2
- package/dist/cjs/generated/codama/accounts/configState.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/contractState.js +23 -30
- package/dist/cjs/generated/codama/accounts/contractState.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/index.js +0 -1
- package/dist/cjs/generated/codama/accounts/index.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/rentalState.js +20 -14
- package/dist/cjs/generated/codama/accounts/rentalState.js.map +1 -1
- package/dist/cjs/generated/codama/errors/srsly.js +43 -43
- package/dist/cjs/generated/codama/errors/srsly.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/acceptRental.js +60 -47
- package/dist/cjs/generated/codama/instructions/acceptRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/activateRental.js +144 -22
- package/dist/cjs/generated/codama/instructions/activateRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/cancelRental.js +13 -42
- package/dist/cjs/generated/codama/instructions/cancelRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/claimBorrower.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/claimContract.js +197 -0
- package/dist/cjs/generated/codama/instructions/claimContract.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/closeContract.js +130 -14
- package/dist/cjs/generated/codama/instructions/closeContract.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/closeContractThread.js +154 -0
- package/dist/cjs/generated/codama/instructions/closeContractThread.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/closeRental.js +10 -121
- package/dist/cjs/generated/codama/instructions/closeRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/createBorrower.js +211 -0
- package/dist/cjs/generated/codama/instructions/createBorrower.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/createContract.js +40 -24
- package/dist/cjs/generated/codama/instructions/createContract.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/createContractThread.js +299 -0
- package/dist/cjs/generated/codama/instructions/createContractThread.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/index.js +6 -5
- package/dist/cjs/generated/codama/instructions/index.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/payContract.js +237 -0
- package/dist/cjs/generated/codama/instructions/payContract.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/reserveRental.js +81 -60
- package/dist/cjs/generated/codama/instructions/reserveRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/updateBorrower.js +7 -43
- package/dist/cjs/generated/codama/instructions/updateBorrower.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/updateConfig.js +0 -2
- package/dist/cjs/generated/codama/instructions/updateConfig.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/updateContract.js +0 -10
- package/dist/cjs/generated/codama/instructions/updateContract.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/updateContractThread.js +177 -0
- package/dist/cjs/generated/codama/instructions/updateContractThread.js.map +1 -0
- package/dist/cjs/generated/codama/programs/srsly.js +36 -36
- package/dist/cjs/generated/codama/programs/srsly.js.map +1 -1
- package/dist/cjs/generated/codama/types/bidType.js +30 -0
- package/dist/cjs/generated/codama/types/bidType.js.map +1 -0
- package/dist/cjs/generated/codama/types/contractThreadClosed.js +29 -0
- package/dist/cjs/generated/codama/types/contractThreadClosed.js.map +1 -0
- package/dist/cjs/generated/codama/types/contractThreadCreated.js +29 -0
- package/dist/cjs/generated/codama/types/contractThreadCreated.js.map +1 -0
- package/dist/cjs/generated/codama/types/contractThreadUpdated.js +39 -0
- package/dist/cjs/generated/codama/types/contractThreadUpdated.js.map +1 -0
- package/dist/cjs/generated/codama/types/index.js +6 -2
- package/dist/cjs/generated/codama/types/index.js.map +1 -1
- package/dist/cjs/generated/codama/types/queuedRentalRefunded.js +33 -0
- package/dist/cjs/generated/codama/types/queuedRentalRefunded.js.map +1 -0
- package/dist/cjs/generated/codama/types/rentalActivated.js +2 -0
- package/dist/cjs/generated/codama/types/rentalActivated.js.map +1 -1
- package/dist/cjs/generated/codama/types/rentalExpiredInline.js +31 -0
- package/dist/cjs/generated/codama/types/rentalExpiredInline.js.map +1 -0
- package/dist/cjs/generated/codama/types/rentalStatus.js +4 -3
- package/dist/cjs/generated/codama/types/rentalStatus.js.map +1 -1
- package/dist/cjs/generated/codama/types/reservationCreated.js +9 -4
- package/dist/cjs/generated/codama/types/reservationCreated.js.map +1 -1
- package/dist/cjs/index.js +4 -221
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/instructions/acceptRental.js +23 -79
- package/dist/cjs/instructions/acceptRental.js.map +1 -1
- package/dist/cjs/instructions/activateRental.js +83 -0
- package/dist/cjs/instructions/activateRental.js.map +1 -0
- package/dist/cjs/instructions/cancelRental.js +21 -23
- package/dist/cjs/instructions/cancelRental.js.map +1 -1
- package/dist/cjs/instructions/claimBorrower.js +27 -14
- package/dist/cjs/instructions/claimBorrower.js.map +1 -1
- package/dist/cjs/instructions/claimContract.js +56 -0
- package/dist/cjs/instructions/claimContract.js.map +1 -0
- package/dist/cjs/instructions/closeContract.js +13 -12
- package/dist/cjs/instructions/closeContract.js.map +1 -1
- package/dist/cjs/instructions/closeContractThread.js +58 -0
- package/dist/cjs/instructions/closeContractThread.js.map +1 -0
- package/dist/cjs/instructions/closeRental.js +34 -45
- package/dist/cjs/instructions/closeRental.js.map +1 -1
- package/dist/cjs/instructions/createBorrower.js +64 -0
- package/dist/cjs/instructions/createBorrower.js.map +1 -0
- package/dist/cjs/instructions/createContract.js +2 -34
- package/dist/cjs/instructions/createContract.js.map +1 -1
- package/dist/cjs/instructions/createContractThread.js +74 -0
- package/dist/cjs/instructions/createContractThread.js.map +1 -0
- package/dist/cjs/instructions/index.js +41 -49
- package/dist/cjs/instructions/index.js.map +1 -1
- package/dist/cjs/instructions/reserveRental.js +70 -68
- package/dist/cjs/instructions/reserveRental.js.map +1 -1
- package/dist/cjs/instructions/updateBorrower.js +44 -40
- package/dist/cjs/instructions/updateBorrower.js.map +1 -1
- package/dist/cjs/instructions/updateConfig.js +0 -1
- package/dist/cjs/instructions/updateConfig.js.map +1 -1
- package/dist/cjs/instructions/updateContract.js +14 -30
- package/dist/cjs/instructions/updateContract.js.map +1 -1
- package/dist/cjs/instructions/updateContractThread.js +60 -0
- package/dist/cjs/instructions/updateContractThread.js.map +1 -0
- package/dist/cjs/kit/index.js +37 -3
- package/dist/cjs/kit/index.js.map +1 -1
- package/dist/cjs/legacy/index.js +13 -16
- package/dist/cjs/legacy/index.js.map +1 -1
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/params/index.js +21 -0
- package/dist/cjs/params/index.js.map +1 -0
- package/dist/cjs/params/sol.js +71 -0
- package/dist/cjs/params/sol.js.map +1 -0
- package/dist/cjs/pda/constants.js +4 -2
- package/dist/cjs/pda/constants.js.map +1 -1
- package/dist/cjs/pda/index.js +7 -23
- package/dist/cjs/pda/index.js.map +1 -1
- package/dist/cjs/pda/srsly.js +30 -37
- package/dist/cjs/pda/srsly.js.map +1 -1
- package/dist/cjs/pda/thread.js +37 -24
- package/dist/cjs/pda/thread.js.map +1 -1
- package/dist/cjs/utils/index.js +3 -5
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/rental.js +23 -109
- package/dist/cjs/utils/rental.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/accounts/index.js +7 -0
- package/dist/esm/accounts/index.js.map +1 -0
- package/dist/esm/demos.js +156 -56
- package/dist/esm/demos.js.map +1 -1
- package/dist/esm/generated/codama/accounts/borrowerState.js +9 -3
- package/dist/esm/generated/codama/accounts/borrowerState.js.map +1 -1
- package/dist/esm/generated/codama/accounts/configState.js +0 -2
- package/dist/esm/generated/codama/accounts/configState.js.map +1 -1
- package/dist/esm/generated/codama/accounts/contractState.js +24 -31
- package/dist/esm/generated/codama/accounts/contractState.js.map +1 -1
- package/dist/esm/generated/codama/accounts/index.js +0 -1
- package/dist/esm/generated/codama/accounts/index.js.map +1 -1
- package/dist/esm/generated/codama/accounts/rentalState.js +22 -16
- package/dist/esm/generated/codama/accounts/rentalState.js.map +1 -1
- package/dist/esm/generated/codama/errors/srsly.js +41 -41
- package/dist/esm/generated/codama/errors/srsly.js.map +1 -1
- package/dist/esm/generated/codama/instructions/acceptRental.js +60 -47
- package/dist/esm/generated/codama/instructions/acceptRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/activateRental.js +146 -24
- package/dist/esm/generated/codama/instructions/activateRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/cancelRental.js +14 -43
- package/dist/esm/generated/codama/instructions/cancelRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/claimBorrower.js.map +1 -1
- package/dist/esm/generated/codama/instructions/claimContract.js +187 -0
- package/dist/esm/generated/codama/instructions/claimContract.js.map +1 -0
- package/dist/esm/generated/codama/instructions/closeContract.js +130 -14
- package/dist/esm/generated/codama/instructions/closeContract.js.map +1 -1
- package/dist/esm/generated/codama/instructions/closeContractThread.js +144 -0
- package/dist/esm/generated/codama/instructions/closeContractThread.js.map +1 -0
- package/dist/esm/generated/codama/instructions/closeRental.js +11 -122
- package/dist/esm/generated/codama/instructions/closeRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/createBorrower.js +201 -0
- package/dist/esm/generated/codama/instructions/createBorrower.js.map +1 -0
- package/dist/esm/generated/codama/instructions/createContract.js +41 -25
- package/dist/esm/generated/codama/instructions/createContract.js.map +1 -1
- package/dist/esm/generated/codama/instructions/createContractThread.js +289 -0
- package/dist/esm/generated/codama/instructions/createContractThread.js.map +1 -0
- package/dist/esm/generated/codama/instructions/index.js +6 -5
- package/dist/esm/generated/codama/instructions/index.js.map +1 -1
- package/dist/esm/generated/codama/instructions/payContract.js +227 -0
- package/dist/esm/generated/codama/instructions/payContract.js.map +1 -0
- package/dist/esm/generated/codama/instructions/reserveRental.js +82 -61
- package/dist/esm/generated/codama/instructions/reserveRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/updateBorrower.js +8 -43
- package/dist/esm/generated/codama/instructions/updateBorrower.js.map +1 -1
- package/dist/esm/generated/codama/instructions/updateConfig.js +0 -2
- package/dist/esm/generated/codama/instructions/updateConfig.js.map +1 -1
- package/dist/esm/generated/codama/instructions/updateContract.js +1 -11
- package/dist/esm/generated/codama/instructions/updateContract.js.map +1 -1
- package/dist/esm/generated/codama/instructions/updateContractThread.js +167 -0
- package/dist/esm/generated/codama/instructions/updateContractThread.js.map +1 -0
- package/dist/esm/generated/codama/programs/srsly.js +36 -36
- package/dist/esm/generated/codama/programs/srsly.js.map +1 -1
- package/dist/esm/generated/codama/types/bidType.js +24 -0
- package/dist/esm/generated/codama/types/bidType.js.map +1 -0
- package/dist/esm/generated/codama/types/contractThreadClosed.js +24 -0
- package/dist/esm/generated/codama/types/contractThreadClosed.js.map +1 -0
- package/dist/esm/generated/codama/types/contractThreadCreated.js +24 -0
- package/dist/esm/generated/codama/types/contractThreadCreated.js.map +1 -0
- package/dist/esm/generated/codama/types/contractThreadUpdated.js +34 -0
- package/dist/esm/generated/codama/types/contractThreadUpdated.js.map +1 -0
- package/dist/esm/generated/codama/types/index.js +6 -2
- package/dist/esm/generated/codama/types/index.js.map +1 -1
- package/dist/esm/generated/codama/types/queuedRentalRefunded.js +28 -0
- package/dist/esm/generated/codama/types/queuedRentalRefunded.js.map +1 -0
- package/dist/esm/generated/codama/types/rentalActivated.js +3 -1
- package/dist/esm/generated/codama/types/rentalActivated.js.map +1 -1
- package/dist/esm/generated/codama/types/rentalExpiredInline.js +26 -0
- package/dist/esm/generated/codama/types/rentalExpiredInline.js.map +1 -0
- package/dist/esm/generated/codama/types/rentalStatus.js +4 -3
- package/dist/esm/generated/codama/types/rentalStatus.js.map +1 -1
- package/dist/esm/generated/codama/types/reservationCreated.js +10 -5
- package/dist/esm/generated/codama/types/reservationCreated.js.map +1 -1
- package/dist/esm/index.js +1 -99
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/instructions/acceptRental.js +26 -82
- package/dist/esm/instructions/acceptRental.js.map +1 -1
- package/dist/esm/instructions/activateRental.js +80 -0
- package/dist/esm/instructions/activateRental.js.map +1 -0
- package/dist/esm/instructions/cancelRental.js +22 -24
- package/dist/esm/instructions/cancelRental.js.map +1 -1
- package/dist/esm/instructions/claimBorrower.js +27 -14
- package/dist/esm/instructions/claimBorrower.js.map +1 -1
- package/dist/esm/instructions/claimContract.js +53 -0
- package/dist/esm/instructions/claimContract.js.map +1 -0
- package/dist/esm/instructions/closeContract.js +13 -12
- package/dist/esm/instructions/closeContract.js.map +1 -1
- package/dist/esm/instructions/closeContractThread.js +55 -0
- package/dist/esm/instructions/closeContractThread.js.map +1 -0
- package/dist/esm/instructions/closeRental.js +35 -46
- package/dist/esm/instructions/closeRental.js.map +1 -1
- package/dist/esm/instructions/createBorrower.js +61 -0
- package/dist/esm/instructions/createBorrower.js.map +1 -0
- package/dist/esm/instructions/createContract.js +2 -34
- package/dist/esm/instructions/createContract.js.map +1 -1
- package/dist/esm/instructions/createContractThread.js +71 -0
- package/dist/esm/instructions/createContractThread.js.map +1 -0
- package/dist/esm/instructions/index.js +27 -24
- package/dist/esm/instructions/index.js.map +1 -1
- package/dist/esm/instructions/reserveRental.js +71 -69
- package/dist/esm/instructions/reserveRental.js.map +1 -1
- package/dist/esm/instructions/updateBorrower.js +45 -41
- package/dist/esm/instructions/updateBorrower.js.map +1 -1
- package/dist/esm/instructions/updateConfig.js +0 -1
- package/dist/esm/instructions/updateConfig.js.map +1 -1
- package/dist/esm/instructions/updateContract.js +14 -30
- package/dist/esm/instructions/updateContract.js.map +1 -1
- package/dist/esm/instructions/updateContractThread.js +57 -0
- package/dist/esm/instructions/updateContractThread.js.map +1 -0
- package/dist/esm/kit/index.js +11 -3
- package/dist/esm/kit/index.js.map +1 -1
- package/dist/esm/legacy/index.js +11 -14
- package/dist/esm/legacy/index.js.map +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/params/index.js +5 -0
- package/dist/esm/params/index.js.map +1 -0
- package/dist/esm/params/sol.js +68 -0
- package/dist/esm/params/sol.js.map +1 -0
- package/dist/esm/pda/constants.js +3 -1
- package/dist/esm/pda/constants.js.map +1 -1
- package/dist/esm/pda/index.js +3 -21
- package/dist/esm/pda/index.js.map +1 -1
- package/dist/esm/pda/srsly.js +29 -36
- package/dist/esm/pda/srsly.js.map +1 -1
- package/dist/esm/pda/thread.js +36 -24
- package/dist/esm/pda/thread.js.map +1 -1
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/rental.js +22 -106
- package/dist/esm/utils/rental.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/idl/srsly.json +1704 -1909
- package/dist/types/accounts/index.d.ts +7 -0
- package/dist/types/accounts/index.d.ts.map +1 -0
- package/dist/types/demos.d.ts +24 -10
- package/dist/types/demos.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/borrowerState.d.ts +15 -3
- package/dist/types/generated/codama/accounts/borrowerState.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/configState.d.ts +0 -4
- package/dist/types/generated/codama/accounts/configState.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/contractState.d.ts +51 -74
- package/dist/types/generated/codama/accounts/contractState.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/index.d.ts +0 -1
- package/dist/types/generated/codama/accounts/index.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/rentalState.d.ts +46 -34
- package/dist/types/generated/codama/accounts/rentalState.d.ts.map +1 -1
- package/dist/types/generated/codama/errors/srsly.d.ts +39 -39
- package/dist/types/generated/codama/errors/srsly.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/acceptRental.d.ts +50 -35
- package/dist/types/generated/codama/instructions/acceptRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/activateRental.d.ts +72 -32
- package/dist/types/generated/codama/instructions/activateRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/cancelRental.d.ts +20 -28
- package/dist/types/generated/codama/instructions/cancelRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/claimBorrower.d.ts +3 -18
- package/dist/types/generated/codama/instructions/claimBorrower.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/claimContract.d.ts +75 -0
- package/dist/types/generated/codama/instructions/claimContract.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/closeContract.d.ts +70 -18
- package/dist/types/generated/codama/instructions/closeContract.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/closeContractThread.d.ts +63 -0
- package/dist/types/generated/codama/instructions/closeContractThread.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/closeRental.d.ts +20 -70
- package/dist/types/generated/codama/instructions/closeRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/createBorrower.d.ts +88 -0
- package/dist/types/generated/codama/instructions/createBorrower.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/createContract.d.ts +28 -32
- package/dist/types/generated/codama/instructions/createContract.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/createContractThread.d.ts +125 -0
- package/dist/types/generated/codama/instructions/createContractThread.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/index.d.ts +6 -5
- package/dist/types/generated/codama/instructions/index.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/payContract.d.ts +104 -0
- package/dist/types/generated/codama/instructions/payContract.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/reserveRental.d.ts +84 -68
- package/dist/types/generated/codama/instructions/reserveRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/updateBorrower.d.ts +21 -19
- package/dist/types/generated/codama/instructions/updateBorrower.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/updateConfig.d.ts +0 -6
- package/dist/types/generated/codama/instructions/updateConfig.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/updateContract.d.ts +2 -14
- package/dist/types/generated/codama/instructions/updateContract.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/updateContractThread.d.ts +76 -0
- package/dist/types/generated/codama/instructions/updateContractThread.d.ts.map +1 -0
- package/dist/types/generated/codama/programs/srsly.d.ts +34 -32
- package/dist/types/generated/codama/programs/srsly.d.ts.map +1 -1
- package/dist/types/generated/codama/types/bidType.d.ts +18 -0
- package/dist/types/generated/codama/types/bidType.d.ts.map +1 -0
- package/dist/types/generated/codama/types/contractThreadClosed.d.ts +17 -0
- package/dist/types/generated/codama/types/contractThreadClosed.d.ts.map +1 -0
- package/dist/types/generated/codama/types/contractThreadCreated.d.ts +17 -0
- package/dist/types/generated/codama/types/contractThreadCreated.d.ts.map +1 -0
- package/dist/types/generated/codama/types/contractThreadUpdated.d.ts +24 -0
- package/dist/types/generated/codama/types/contractThreadUpdated.d.ts.map +1 -0
- package/dist/types/generated/codama/types/index.d.ts +6 -2
- package/dist/types/generated/codama/types/index.d.ts.map +1 -1
- package/dist/types/generated/codama/types/queuedRentalRefunded.d.ts +24 -0
- package/dist/types/generated/codama/types/queuedRentalRefunded.d.ts.map +1 -0
- package/dist/types/generated/codama/types/rentalActivated.d.ts +7 -1
- package/dist/types/generated/codama/types/rentalActivated.d.ts.map +1 -1
- package/dist/types/generated/codama/types/rentalExpiredInline.d.ts +18 -0
- package/dist/types/generated/codama/types/rentalExpiredInline.d.ts.map +1 -0
- package/dist/types/generated/codama/types/rentalStatus.d.ts +4 -3
- package/dist/types/generated/codama/types/rentalStatus.d.ts.map +1 -1
- package/dist/types/generated/codama/types/reservationCreated.d.ts +9 -4
- package/dist/types/generated/codama/types/reservationCreated.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -42
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/instructions/acceptRental.d.ts +2 -31
- package/dist/types/instructions/acceptRental.d.ts.map +1 -1
- package/dist/types/instructions/activateRental.d.ts +41 -0
- package/dist/types/instructions/activateRental.d.ts.map +1 -0
- package/dist/types/instructions/cancelRental.d.ts +8 -18
- package/dist/types/instructions/cancelRental.d.ts.map +1 -1
- package/dist/types/instructions/claimBorrower.d.ts +27 -10
- package/dist/types/instructions/claimBorrower.d.ts.map +1 -1
- package/dist/types/instructions/claimContract.d.ts +40 -0
- package/dist/types/instructions/claimContract.d.ts.map +1 -0
- package/dist/types/instructions/closeContract.d.ts +1 -12
- package/dist/types/instructions/closeContract.d.ts.map +1 -1
- package/dist/types/instructions/closeContractThread.d.ts +40 -0
- package/dist/types/instructions/closeContractThread.d.ts.map +1 -0
- package/dist/types/instructions/closeRental.d.ts +6 -14
- package/dist/types/instructions/closeRental.d.ts.map +1 -1
- package/dist/types/instructions/createBorrower.d.ts +49 -0
- package/dist/types/instructions/createBorrower.d.ts.map +1 -0
- package/dist/types/instructions/createContract.d.ts +1 -41
- package/dist/types/instructions/createContract.d.ts.map +1 -1
- package/dist/types/instructions/createContractThread.d.ts +50 -0
- package/dist/types/instructions/createContractThread.d.ts.map +1 -0
- package/dist/types/instructions/index.d.ts +27 -24
- package/dist/types/instructions/index.d.ts.map +1 -1
- package/dist/types/instructions/reserveRental.d.ts +33 -29
- package/dist/types/instructions/reserveRental.d.ts.map +1 -1
- package/dist/types/instructions/updateBorrower.d.ts +23 -29
- package/dist/types/instructions/updateBorrower.d.ts.map +1 -1
- package/dist/types/instructions/updateConfig.d.ts +0 -4
- package/dist/types/instructions/updateConfig.d.ts.map +1 -1
- package/dist/types/instructions/updateContract.d.ts +11 -33
- package/dist/types/instructions/updateContract.d.ts.map +1 -1
- package/dist/types/instructions/updateContractThread.d.ts +48 -0
- package/dist/types/instructions/updateContractThread.d.ts.map +1 -0
- package/dist/types/kit/index.d.ts +10 -3
- package/dist/types/kit/index.d.ts.map +1 -1
- package/dist/types/legacy/index.d.ts +11 -39
- package/dist/types/legacy/index.d.ts.map +1 -1
- package/dist/types/params/index.d.ts +5 -0
- package/dist/types/params/index.d.ts.map +1 -0
- package/dist/types/params/sol.d.ts +34 -0
- package/dist/types/params/sol.d.ts.map +1 -0
- package/dist/types/pda/constants.d.ts +3 -1
- package/dist/types/pda/constants.d.ts.map +1 -1
- package/dist/types/pda/index.d.ts +3 -21
- package/dist/types/pda/index.d.ts.map +1 -1
- package/dist/types/pda/srsly.d.ts +13 -15
- package/dist/types/pda/srsly.d.ts.map +1 -1
- package/dist/types/pda/thread.d.ts +17 -18
- package/dist/types/pda/thread.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/rental.d.ts +8 -66
- package/dist/types/utils/rental.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -43,17 +43,9 @@ export interface AcceptRentalParams {
|
|
|
43
43
|
* @example 604800 // 7 days in seconds
|
|
44
44
|
*/
|
|
45
45
|
duration: DurationParam;
|
|
46
|
-
/**
|
|
47
|
-
* Whether to bundle the scheduleRental instruction with acceptRental.
|
|
48
|
-
* If true, the scheduleRental instruction will be bundled after acceptRental.
|
|
49
|
-
* If the contract has `automationRequired: true`, this is automatically enabled.
|
|
50
|
-
* @default false (unless contract.automationRequired is true)
|
|
51
|
-
*/
|
|
52
|
-
automate?: boolean;
|
|
53
46
|
/**
|
|
54
47
|
* Optional compute units to allocate for the transaction
|
|
55
48
|
* Recommended: 400,000 for rental acceptance (includes multiple CPIs)
|
|
56
|
-
* If automate is enabled, recommend 600,000 for both instructions.
|
|
57
49
|
* @example 400000
|
|
58
50
|
*/
|
|
59
51
|
computeUnits?: number;
|
|
@@ -86,13 +78,13 @@ export interface AcceptRentalParams {
|
|
|
86
78
|
*
|
|
87
79
|
* This function automatically fetches the contract and config to get required
|
|
88
80
|
* data (fleet, vault, gameId), then derives all SAGE accounts (profile faction,
|
|
89
|
-
* starbase, starbase player) and the
|
|
81
|
+
* starbase, starbase player) and the contract thread for automated payments.
|
|
90
82
|
*
|
|
91
83
|
* @param params - Rental acceptance parameters
|
|
92
84
|
* @param config - Optional SDK configuration overrides
|
|
93
85
|
* @returns Array of instructions (Kit format or web3.js if PublicKey in config)
|
|
94
86
|
*
|
|
95
|
-
* @
|
|
87
|
+
* @example
|
|
96
88
|
* ```typescript
|
|
97
89
|
* // Accept a 7-day rental (borrowerProfile auto-fetched)
|
|
98
90
|
* const ixs = await acceptRental({
|
|
@@ -102,27 +94,6 @@ export interface AcceptRentalParams {
|
|
|
102
94
|
* computeUnits: 400_000
|
|
103
95
|
* });
|
|
104
96
|
* ```
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* ```typescript
|
|
108
|
-
* // Accept a 7-day rental (fleet and vault auto-fetched)
|
|
109
|
-
* const ixs = await acceptRental({
|
|
110
|
-
* borrower: wallet,
|
|
111
|
-
* borrowerProfile: borrowerProfileAddress,
|
|
112
|
-
* contract: contractAddress,
|
|
113
|
-
* duration: { days: 7 }
|
|
114
|
-
* });
|
|
115
|
-
*
|
|
116
|
-
* // With referrer and compute budget
|
|
117
|
-
* const ixs2 = await acceptRental({
|
|
118
|
-
* borrower: wallet,
|
|
119
|
-
* borrowerProfile: borrowerProfileAddress,
|
|
120
|
-
* contract: contractAddress,
|
|
121
|
-
* referrer: referrerAddress,
|
|
122
|
-
* duration: { weeks: 2 },
|
|
123
|
-
* computeUnits: 400_000
|
|
124
|
-
* });
|
|
125
|
-
* ```
|
|
126
97
|
*/
|
|
127
98
|
export declare function acceptRental(params: AcceptRentalParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>;
|
|
128
99
|
//# sourceMappingURL=acceptRental.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acceptRental.d.ts","sourceRoot":"","sources":["../../../src/instructions/acceptRental.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"acceptRental.d.ts","sourceRoot":"","sources":["../../../src/instructions/acceptRental.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAA2B,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAG7F;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEnC;;OAEG;IACH,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE5B;;;;;;OAMG;IACH,QAAQ,EAAE,aAAa,CAAC;IAExB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAE7C;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,kBAAkB,EAC1B,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC1B,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CA+HjD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @purpose Simplified activateRental instruction wrapper
|
|
3
|
+
*
|
|
4
|
+
* Thin convenience wrapper around Codama-generated activateRental instruction.
|
|
5
|
+
* Manually activates a queued rental when automation is delayed or unavailable.
|
|
6
|
+
*/
|
|
7
|
+
import { type Address } from '@solana/kit';
|
|
8
|
+
import { type SdkConfig } from '../utils/config';
|
|
9
|
+
import { type UniversalSigner } from '../utils/signer';
|
|
10
|
+
import { prepareInstructions } from '../utils/instructions';
|
|
11
|
+
/**
|
|
12
|
+
* Parameters for manually activating a queued rental
|
|
13
|
+
*/
|
|
14
|
+
export interface ActivateRentalParams {
|
|
15
|
+
/**
|
|
16
|
+
* Payer for the transaction (permissionless — anyone can call this)
|
|
17
|
+
* Accepts string address, web3.js Keypair, or @solana/kit signer
|
|
18
|
+
*/
|
|
19
|
+
payer: UniversalSigner;
|
|
20
|
+
/** Contract address with a queued rental to activate */
|
|
21
|
+
contract: Address | string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional compute units to allocate for the transaction
|
|
24
|
+
* @example 400000
|
|
25
|
+
*/
|
|
26
|
+
computeUnits?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Manually activate a queued rental
|
|
30
|
+
*
|
|
31
|
+
* This is a fallback for when the Antegen automation thread is delayed.
|
|
32
|
+
* Anyone can call this — it's permissionless. The queued rental will be
|
|
33
|
+
* promoted to active, the fleet will be delegated to the borrower in SAGE,
|
|
34
|
+
* and deferred fees will be paid.
|
|
35
|
+
*
|
|
36
|
+
* @param params - Activate rental parameters
|
|
37
|
+
* @param config - Optional SDK configuration overrides
|
|
38
|
+
* @returns Kit instruction (or web3.js if PublicKey in config)
|
|
39
|
+
*/
|
|
40
|
+
export declare function activateRental(params: ActivateRentalParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>;
|
|
41
|
+
//# sourceMappingURL=activateRental.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activateRental.d.ts","sourceRoot":"","sources":["../../../src/instructions/activateRental.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAS5D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB,wDAAwD;IACxD,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAE3B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC1B,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CA4DjD"}
|
|
@@ -22,21 +22,14 @@ export interface CancelRentalParams {
|
|
|
22
22
|
* Contract address to cancel
|
|
23
23
|
*/
|
|
24
24
|
contract: Address | string;
|
|
25
|
-
/**
|
|
26
|
-
* Rental slot to cancel (0 or 1)
|
|
27
|
-
* If not provided, auto-detects by checking which slot belongs to the borrower
|
|
28
|
-
*/
|
|
29
|
-
rentalSlot?: number;
|
|
30
25
|
/**
|
|
31
26
|
* Cancellation delay
|
|
32
27
|
*
|
|
33
|
-
* - 0: Instant cancellation (requires contract.
|
|
34
|
-
* Sets Trigger::Immediate, rental_pay fires right away for cleanup
|
|
28
|
+
* - 0: Instant cancellation (requires contract.cancelDelayMin = 0)
|
|
35
29
|
* - > 0: Deferred cancellation - rental continues for the specified delay
|
|
36
|
-
* Existing Cron trigger handles cleanup when end_time is reached
|
|
37
30
|
*
|
|
38
31
|
* Accepts seconds as a number, or an object with time units:
|
|
39
|
-
* @example 0 // Instant cancel
|
|
32
|
+
* @example 0 // Instant cancel
|
|
40
33
|
* @example { hours: 12 } // Cancel after 12 hours
|
|
41
34
|
* @example { days: 1 } // Cancel after 1 day
|
|
42
35
|
* @example { weeks: 1 } // Cancel after 1 week
|
|
@@ -52,17 +45,14 @@ export interface CancelRentalParams {
|
|
|
52
45
|
/**
|
|
53
46
|
* Cancel a rental
|
|
54
47
|
*
|
|
55
|
-
* Allows a borrower to cancel an active rental.
|
|
48
|
+
* Allows a borrower to cancel an active rental. Always targets the active
|
|
49
|
+
* rental PDA (no more slot detection needed).
|
|
56
50
|
*
|
|
57
51
|
* **Cancellation Behavior:**
|
|
58
|
-
* - `cancelDelay = 0`: Instant cancellation
|
|
59
|
-
*
|
|
60
|
-
* - Returns `InstantCancelNotAllowed` error if contract doesn't allow it
|
|
61
|
-
* - `cancelDelay > 0`: Deferred cancellation
|
|
62
|
-
* - Rental continues until `now + cancelDelay`
|
|
63
|
-
* - Existing Cron trigger handles cleanup when `end_time` is reached
|
|
52
|
+
* - `cancelDelay = 0`: Instant cancellation
|
|
53
|
+
* - `cancelDelay > 0`: Deferred cancellation, rental continues until `now + cancelDelay`
|
|
64
54
|
*
|
|
65
|
-
* Both paths refund the borrower for unused time.
|
|
55
|
+
* Both paths refund the borrower for unused time.
|
|
66
56
|
*
|
|
67
57
|
* @param params - Cancellation parameters (borrower, contract, cancelDelay)
|
|
68
58
|
* @param config - Optional SDK configuration overrides
|
|
@@ -76,7 +66,7 @@ export interface CancelRentalParams {
|
|
|
76
66
|
* contract: contractAddress
|
|
77
67
|
* });
|
|
78
68
|
*
|
|
79
|
-
* // Instant cancellation
|
|
69
|
+
* // Instant cancellation
|
|
80
70
|
* const ix2 = await cancelRental({
|
|
81
71
|
* borrower: borrowerWallet,
|
|
82
72
|
* contract: contractAddress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancelRental.d.ts","sourceRoot":"","sources":["../../../src/instructions/cancelRental.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAG5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIzE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B;;OAEG;IACH,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAE3B
|
|
1
|
+
{"version":3,"file":"cancelRental.d.ts","sourceRoot":"","sources":["../../../src/instructions/cancelRental.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAG5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIzE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B;;OAEG;IACH,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAE3B;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC;IAE5B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,kBAAkB,EAC1B,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC1B,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAyDjD"}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* @purpose Simplified claimBorrower instruction wrapper
|
|
3
3
|
*
|
|
4
4
|
* Thin convenience wrapper around Codama-generated claimBorrower instruction.
|
|
5
|
-
* Allows
|
|
5
|
+
* Allows claiming accumulated ATLAS from a borrower's managed token account.
|
|
6
6
|
*/
|
|
7
|
+
import { type Address } from '@solana/kit';
|
|
7
8
|
import { type SdkConfig } from '../utils/config';
|
|
8
9
|
import { type UniversalSigner } from '../utils/signer';
|
|
9
10
|
import { prepareInstructions } from '../utils/instructions';
|
|
@@ -12,10 +13,17 @@ import { prepareInstructions } from '../utils/instructions';
|
|
|
12
13
|
*/
|
|
13
14
|
export interface ClaimBorrowerParams {
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
+
* Payer for the transaction (signs and pays fees)
|
|
16
17
|
* Accepts string address, web3.js Keypair, or @solana/kit signer
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
+
payer: UniversalSigner;
|
|
20
|
+
/**
|
|
21
|
+
* Borrower whose ATLAS to claim (optional)
|
|
22
|
+
* If not provided, defaults to the payer's address.
|
|
23
|
+
* This allows a third party to pay for the claim transaction
|
|
24
|
+
* on behalf of the borrower.
|
|
25
|
+
*/
|
|
26
|
+
borrower?: Address | string;
|
|
19
27
|
/**
|
|
20
28
|
* If true, close the BorrowerState account and reclaim rent after claiming.
|
|
21
29
|
* Requires no active rentals.
|
|
@@ -36,22 +44,31 @@ export interface ClaimBorrowerParams {
|
|
|
36
44
|
* account (an ATA with the borrower_state as authority). This instruction
|
|
37
45
|
* transfers those funds to the borrower's personal wallet.
|
|
38
46
|
*
|
|
47
|
+
* The payer and borrower can be different accounts, allowing a third party
|
|
48
|
+
* to pay for the claim transaction on behalf of the borrower.
|
|
49
|
+
*
|
|
39
50
|
* @param params - Borrower claim parameters
|
|
40
51
|
* @param config - Optional SDK configuration overrides
|
|
41
52
|
* @returns Kit instruction (or web3.js if PublicKey in config)
|
|
42
53
|
*
|
|
43
54
|
* @example
|
|
44
55
|
* ```typescript
|
|
45
|
-
* //
|
|
56
|
+
* // Self-claim: payer is the borrower
|
|
46
57
|
* const ix = await claimBorrower({
|
|
47
|
-
*
|
|
58
|
+
* payer: borrowerWallet,
|
|
59
|
+
* // borrower defaults to payer
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* // Third-party claim: someone else pays
|
|
63
|
+
* const ix2 = await claimBorrower({
|
|
64
|
+
* payer: relayerWallet,
|
|
65
|
+
* borrower: "BORROWER_ADDRESS"
|
|
48
66
|
* });
|
|
49
67
|
*
|
|
50
|
-
* //
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* borrower: keypair
|
|
68
|
+
* // Claim and close the BorrowerState account
|
|
69
|
+
* const ix3 = await claimBorrower({
|
|
70
|
+
* payer: borrowerWallet,
|
|
71
|
+
* close: true
|
|
55
72
|
* });
|
|
56
73
|
* ```
|
|
57
74
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claimBorrower.d.ts","sourceRoot":"","sources":["../../../src/instructions/claimBorrower.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"claimBorrower.d.ts","sourceRoot":"","sources":["../../../src/instructions/claimBorrower.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC1B,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAuCjD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @purpose Simplified claimContract instruction wrapper
|
|
3
|
+
*
|
|
4
|
+
* Thin convenience wrapper around Codama-generated claimContract instruction.
|
|
5
|
+
* Allows contract owners to claim accumulated ATLAS from the contract's escrow.
|
|
6
|
+
*/
|
|
7
|
+
import { type Address } from '@solana/kit';
|
|
8
|
+
import { type SdkConfig } from '../utils/config';
|
|
9
|
+
import { type UniversalSigner } from '../utils/signer';
|
|
10
|
+
import { prepareInstructions } from '../utils/instructions';
|
|
11
|
+
/**
|
|
12
|
+
* Parameters for claiming contract ATLAS earnings
|
|
13
|
+
*/
|
|
14
|
+
export interface ClaimContractParams {
|
|
15
|
+
/**
|
|
16
|
+
* Contract owner claiming their ATLAS
|
|
17
|
+
* Accepts string address, web3.js Keypair, or @solana/kit signer
|
|
18
|
+
*/
|
|
19
|
+
owner: UniversalSigner;
|
|
20
|
+
/** Contract address to claim from */
|
|
21
|
+
contract: Address | string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional compute units to allocate for the transaction
|
|
24
|
+
* @example 400000
|
|
25
|
+
*/
|
|
26
|
+
computeUnits?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Claim contract ATLAS earnings
|
|
30
|
+
*
|
|
31
|
+
* Transfers `owner_claimable` ATLAS from the contract's token account
|
|
32
|
+
* to the owner's wallet. No OwnerState needed — claims directly from
|
|
33
|
+
* the per-contract escrow.
|
|
34
|
+
*
|
|
35
|
+
* @param params - Contract claim parameters
|
|
36
|
+
* @param config - Optional SDK configuration overrides
|
|
37
|
+
* @returns Kit instruction (or web3.js if PublicKey in config)
|
|
38
|
+
*/
|
|
39
|
+
export declare function claimContract(params: ClaimContractParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>;
|
|
40
|
+
//# sourceMappingURL=claimContract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claimContract.d.ts","sourceRoot":"","sources":["../../../src/instructions/claimContract.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB,qCAAqC;IACrC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAE3B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC1B,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAoCjD"}
|
|
@@ -23,11 +23,6 @@ export interface CloseContractParams {
|
|
|
23
23
|
* NOTE: If using contract only, it must already exist (will be fetched to get fleet)
|
|
24
24
|
*/
|
|
25
25
|
contract?: Address | string;
|
|
26
|
-
/**
|
|
27
|
-
* Destination token account for claiming remaining payments (optional)
|
|
28
|
-
* Defaults to owner's preferred token account
|
|
29
|
-
*/
|
|
30
|
-
destinationTokenAccount?: Address | string;
|
|
31
26
|
/**
|
|
32
27
|
* SAGE fleet address (optional - fetched from contract if not provided)
|
|
33
28
|
* Either contract or fleet must be provided
|
|
@@ -65,25 +60,19 @@ export interface CloseContractParams {
|
|
|
65
60
|
* const ix = await closeContract({
|
|
66
61
|
* owner: wallet,
|
|
67
62
|
* fleet: fleetAddress
|
|
68
|
-
* // contract derived from fleet PDA
|
|
69
|
-
* // Works even if contract doesn't exist (init_if_needed)
|
|
70
63
|
* });
|
|
71
64
|
*
|
|
72
65
|
* // Option 2: Provide contract only (contract MUST exist)
|
|
73
66
|
* const ix2 = await closeContract({
|
|
74
67
|
* owner: wallet,
|
|
75
68
|
* contract: contractAddress
|
|
76
|
-
* // fleet fetched from contract.fleet
|
|
77
|
-
* // REQUIRES contract to already exist
|
|
78
69
|
* });
|
|
79
70
|
*
|
|
80
71
|
* // Option 3: Provide both (most explicit, no fetching)
|
|
81
72
|
* const ix3 = await closeContract({
|
|
82
73
|
* owner: wallet,
|
|
83
74
|
* fleet: fleetAddress,
|
|
84
|
-
* contract: contractAddress
|
|
85
|
-
* sageProgram: customSageProgram, // Optional
|
|
86
|
-
* destinationTokenAccount: customTokenAccount // Optional
|
|
75
|
+
* contract: contractAddress
|
|
87
76
|
* });
|
|
88
77
|
* ```
|
|
89
78
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closeContract.d.ts","sourceRoot":"","sources":["../../../src/instructions/closeContract.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"closeContract.d.ts","sourceRoot":"","sources":["../../../src/instructions/closeContract.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAK5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEzB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE/B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC1B,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CA0EjD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @purpose Simplified closeContractThread instruction wrapper
|
|
3
|
+
*
|
|
4
|
+
* Thin convenience wrapper around Codama-generated closeContractThread instruction.
|
|
5
|
+
* Closes a per-contract automation thread and reclaims rent.
|
|
6
|
+
*/
|
|
7
|
+
import { type Address } from '@solana/kit';
|
|
8
|
+
import { type SdkConfig } from '../utils/config';
|
|
9
|
+
import { type UniversalSigner } from '../utils/signer';
|
|
10
|
+
import { prepareInstructions } from '../utils/instructions';
|
|
11
|
+
/**
|
|
12
|
+
* Parameters for closing a contract automation thread
|
|
13
|
+
*/
|
|
14
|
+
export interface CloseContractThreadParams {
|
|
15
|
+
/**
|
|
16
|
+
* Contract owner (must be the contract's owner)
|
|
17
|
+
* Accepts string address, web3.js Keypair, or @solana/kit signer
|
|
18
|
+
*/
|
|
19
|
+
owner: UniversalSigner;
|
|
20
|
+
/** Contract address whose thread to close */
|
|
21
|
+
contract: Address | string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional compute units to allocate for the transaction
|
|
24
|
+
* @example 400000
|
|
25
|
+
*/
|
|
26
|
+
computeUnits?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Close a per-contract automation thread
|
|
30
|
+
*
|
|
31
|
+
* Closes the Antegen thread and any existing fiber PDAs, reclaiming rent to the owner.
|
|
32
|
+
* Fiber PDAs are derived and passed as remaining accounts. Only initialized fibers
|
|
33
|
+
* will be closed on-chain.
|
|
34
|
+
*
|
|
35
|
+
* @param params - Thread closing parameters
|
|
36
|
+
* @param config - Optional SDK configuration overrides
|
|
37
|
+
* @returns Kit instruction (or web3.js if PublicKey in config)
|
|
38
|
+
*/
|
|
39
|
+
export declare function closeContractThread(params: CloseContractThreadParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>;
|
|
40
|
+
//# sourceMappingURL=closeContractThread.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closeContractThread.d.ts","sourceRoot":"","sources":["../../../src/instructions/closeContractThread.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAwB,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAE3B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,yBAAyB,EACjC,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC1B,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAyCjD"}
|
|
@@ -17,19 +17,13 @@ export interface CloseRentalParams {
|
|
|
17
17
|
* Accepts string address, web3.js Keypair, or @solana/kit signer
|
|
18
18
|
*/
|
|
19
19
|
payer: UniversalSigner;
|
|
20
|
-
/**
|
|
21
|
-
* Rental slot to close (0 or 1)
|
|
22
|
-
* If not provided, auto-detects from contract state.
|
|
23
|
-
* If both slots have rentals, defaults to the active slot.
|
|
24
|
-
*/
|
|
25
|
-
rentalSlot?: number;
|
|
26
20
|
/**
|
|
27
21
|
* Contract address to close the rental from
|
|
28
22
|
*/
|
|
29
23
|
contract: Address | string;
|
|
30
24
|
/**
|
|
31
25
|
* Borrower address (optional)
|
|
32
|
-
* If not provided, automatically fetched from the rental state.
|
|
26
|
+
* If not provided, automatically fetched from the active rental state.
|
|
33
27
|
* Falls back to payer if rental state doesn't exist.
|
|
34
28
|
*/
|
|
35
29
|
borrower?: Address | string;
|
|
@@ -43,16 +37,15 @@ export interface CloseRentalParams {
|
|
|
43
37
|
* Close a rental
|
|
44
38
|
*
|
|
45
39
|
* Closes a completed rental and transfers the fleet back to the owner.
|
|
46
|
-
*
|
|
40
|
+
* Always targets the active rental PDA.
|
|
47
41
|
*
|
|
48
42
|
* This function automatically:
|
|
49
|
-
* - Fetches contract to get owner,
|
|
50
|
-
* - Fetches
|
|
43
|
+
* - Fetches contract to get owner, fleet, gameId
|
|
44
|
+
* - Fetches the active rental to get borrower (if not provided)
|
|
45
|
+
* - Fetches the borrower's SAGE profile from borrower_state
|
|
51
46
|
* - Derives required SAGE accounts (starbase, starbase player)
|
|
52
|
-
* - Derives rental thread for automated payments
|
|
53
|
-
* - Codama auto-derives contractTokenAccount as ATA
|
|
54
47
|
*
|
|
55
|
-
* @param params - Rental closure parameters (payer,
|
|
48
|
+
* @param params - Rental closure parameters (payer, contract)
|
|
56
49
|
* @param config - Optional SDK configuration overrides
|
|
57
50
|
* @returns Kit instruction (or web3.js if PublicKey in config)
|
|
58
51
|
*
|
|
@@ -60,7 +53,6 @@ export interface CloseRentalParams {
|
|
|
60
53
|
* ```typescript
|
|
61
54
|
* const ix = await closeRental({
|
|
62
55
|
* payer: ownerWallet,
|
|
63
|
-
* rentalSlot: 0,
|
|
64
56
|
* contract: contractAddress
|
|
65
57
|
* });
|
|
66
58
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"closeRental.d.ts","sourceRoot":"","sources":["../../../src/instructions/closeRental.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"closeRental.d.ts","sourceRoot":"","sources":["../../../src/instructions/closeRental.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAQ5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAE3B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE5B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,iBAAiB,EACzB,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC1B,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CA6FjD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @purpose Simplified createBorrower instruction wrapper
|
|
3
|
+
*
|
|
4
|
+
* Thin convenience wrapper around Codama-generated createBorrower instruction.
|
|
5
|
+
* Creates a BorrowerState PDA with managed token account for a borrower.
|
|
6
|
+
* Derives SAGE accounts (profileFaction, starbase, starbasePlayer) from
|
|
7
|
+
* borrowerProfile + faction automatically.
|
|
8
|
+
*/
|
|
9
|
+
import { type Address } from '@solana/kit';
|
|
10
|
+
import { type SdkConfig } from '../utils/config';
|
|
11
|
+
import { type UniversalSigner } from '../utils/signer';
|
|
12
|
+
import { prepareInstructions } from '../utils/instructions';
|
|
13
|
+
/**
|
|
14
|
+
* Parameters for creating a borrower state
|
|
15
|
+
*/
|
|
16
|
+
export interface CreateBorrowerParams {
|
|
17
|
+
/**
|
|
18
|
+
* Borrower wallet (pays for account creation)
|
|
19
|
+
* Accepts string address, web3.js Keypair, or @solana/kit signer
|
|
20
|
+
*/
|
|
21
|
+
borrower: UniversalSigner;
|
|
22
|
+
/** SAGE borrower profile address */
|
|
23
|
+
borrowerProfile: Address | string;
|
|
24
|
+
/**
|
|
25
|
+
* Faction name or ID — used to derive starbase and starbasePlayer PDAs
|
|
26
|
+
* Accepts 'mud' | 'oni' | 'ustur' or 1 | 2 | 3
|
|
27
|
+
*/
|
|
28
|
+
faction: string | number;
|
|
29
|
+
/**
|
|
30
|
+
* Optional compute units to allocate for the transaction
|
|
31
|
+
* @example 400000
|
|
32
|
+
*/
|
|
33
|
+
computeUnits?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Create a borrower state account
|
|
37
|
+
*
|
|
38
|
+
* Creates a BorrowerState PDA and an associated managed token account.
|
|
39
|
+
* The managed token account holds ATLAS refunds from reservation knockoffs.
|
|
40
|
+
*
|
|
41
|
+
* Derives borrowerProfileFaction, starbase, and starbasePlayer PDAs
|
|
42
|
+
* automatically from the borrowerProfile and faction.
|
|
43
|
+
*
|
|
44
|
+
* @param params - Borrower creation parameters
|
|
45
|
+
* @param config - Optional SDK configuration overrides
|
|
46
|
+
* @returns Kit instruction (or web3.js if PublicKey in config)
|
|
47
|
+
*/
|
|
48
|
+
export declare function createBorrower(params: CreateBorrowerParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>;
|
|
49
|
+
//# sourceMappingURL=createBorrower.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createBorrower.d.ts","sourceRoot":"","sources":["../../../src/instructions/createBorrower.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B,oCAAoC;IACpC,eAAe,EAAE,OAAO,GAAG,MAAM,CAAC;IAElC;;;OAGG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC1B,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CA4CjD"}
|
|
@@ -9,7 +9,6 @@ import { type SdkConfig } from '../utils/config';
|
|
|
9
9
|
import { type UniversalSigner } from '../utils/signer';
|
|
10
10
|
import { type AmountParam } from '../params/amount';
|
|
11
11
|
import { type DurationParam } from '../params/duration';
|
|
12
|
-
import { type ScheduleParam } from '../params/schedule';
|
|
13
12
|
import { prepareInstructions } from '../utils/instructions';
|
|
14
13
|
/**
|
|
15
14
|
* Parameters for creating a rental contract
|
|
@@ -47,13 +46,6 @@ export interface CreateContractParams {
|
|
|
47
46
|
* @example 2592000 // 30 days in seconds
|
|
48
47
|
*/
|
|
49
48
|
durationMax: DurationParam;
|
|
50
|
-
/**
|
|
51
|
-
* Payment schedule
|
|
52
|
-
* @example '@daily'
|
|
53
|
-
* @example 'hourly'
|
|
54
|
-
* @example '0 * * * *' // Cron expression
|
|
55
|
-
*/
|
|
56
|
-
paymentsFreq: ScheduleParam;
|
|
57
49
|
/**
|
|
58
50
|
* Owner's key index in SAGE
|
|
59
51
|
* @default 0
|
|
@@ -74,13 +66,6 @@ export interface CreateContractParams {
|
|
|
74
66
|
* @default true
|
|
75
67
|
*/
|
|
76
68
|
reservationsDisabled?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Whether automation (rental_schedule) is required for this contract.
|
|
79
|
-
* If true, rental_accept/claim will fail unless rental_schedule is bundled
|
|
80
|
-
* in the same transaction. This enforces automated payments via Antegen.
|
|
81
|
-
* @default true
|
|
82
|
-
*/
|
|
83
|
-
automationRequired?: boolean;
|
|
84
69
|
/**
|
|
85
70
|
* Optional compute units to allocate for the transaction
|
|
86
71
|
* @example 400000
|
|
@@ -101,34 +86,9 @@ export interface CreateContractParams {
|
|
|
101
86
|
* const ix = await createContract({
|
|
102
87
|
* owner: wallet,
|
|
103
88
|
* fleet: fleetAddress,
|
|
104
|
-
* // ownerProfile and gameId fetched automatically from fleet
|
|
105
|
-
* rate: 100,
|
|
106
|
-
* durationMax: { days: 30 },
|
|
107
|
-
* paymentsFreq: '@daily'
|
|
108
|
-
* });
|
|
109
|
-
*
|
|
110
|
-
* // Explicit ownerProfile and gameId (skips fetch)
|
|
111
|
-
* const ix2 = await createContract({
|
|
112
|
-
* owner: wallet,
|
|
113
|
-
* fleet: fleetAddress,
|
|
114
|
-
* ownerProfile: profileAddress, // Explicitly provided
|
|
115
|
-
* gameId: gameAddress, // Explicitly provided
|
|
116
|
-
* rate: 100,
|
|
117
|
-
* durationMax: { days: 30 },
|
|
118
|
-
* paymentsFreq: '@daily'
|
|
119
|
-
* });
|
|
120
|
-
*
|
|
121
|
-
* // With web3.js
|
|
122
|
-
* import { PublicKey } from '@solana/web3.js';
|
|
123
|
-
* setSdkConfig({ network: 'atlasnet', PublicKey });
|
|
124
|
-
* const web3Ix = await createContract({
|
|
125
|
-
* owner: keypair,
|
|
126
|
-
* fleet: fleetPubkey,
|
|
127
89
|
* rate: 100,
|
|
128
|
-
* durationMax: { days: 30 }
|
|
129
|
-
* paymentsFreq: '@daily'
|
|
90
|
+
* durationMax: { days: 30 }
|
|
130
91
|
* });
|
|
131
|
-
* // web3Ix.keys[0].pubkey is a PublicKey instance
|
|
132
92
|
* ```
|
|
133
93
|
*/
|
|
134
94
|
export declare function createContract(params: CreateContractParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createContract.d.ts","sourceRoot":"","sources":["../../../src/instructions/createContract.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"createContract.d.ts","sourceRoot":"","sources":["../../../src/instructions/createContract.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAkC,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB;;;;OAIG;IACH,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IAExB;;;;;OAKG;IACH,IAAI,EAAE,WAAW,CAAC;IAElB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC;IAE5B;;;;;OAKG;IACH,WAAW,EAAE,aAAa,CAAC;IAE3B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,aAAa,CAAC;IAE/B;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC1B,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAqFjD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @purpose Simplified createContractThread instruction wrapper
|
|
3
|
+
*
|
|
4
|
+
* Thin convenience wrapper around Codama-generated createContractThread instruction.
|
|
5
|
+
* Creates a per-contract automation thread with fiber-based dispatch.
|
|
6
|
+
*/
|
|
7
|
+
import { type Address } from '@solana/kit';
|
|
8
|
+
import { type SdkConfig } from '../utils/config';
|
|
9
|
+
import { type UniversalSigner } from '../utils/signer';
|
|
10
|
+
import { prepareInstructions } from '../utils/instructions';
|
|
11
|
+
import { type ScheduleParam } from '../params/schedule';
|
|
12
|
+
import { type SolParam } from '../params/sol';
|
|
13
|
+
/**
|
|
14
|
+
* Parameters for creating a contract automation thread
|
|
15
|
+
*/
|
|
16
|
+
export interface CreateContractThreadParams {
|
|
17
|
+
/**
|
|
18
|
+
* Contract owner (must be the contract's owner)
|
|
19
|
+
* Accepts string address, web3.js Keypair, or @solana/kit signer
|
|
20
|
+
*/
|
|
21
|
+
owner: UniversalSigner;
|
|
22
|
+
/** Contract address to create thread for */
|
|
23
|
+
contract: Address | string;
|
|
24
|
+
/**
|
|
25
|
+
* SOL to fund the thread with (defaults to 0.01 SOL)
|
|
26
|
+
* Accepts plain number (SOL), { sol: number }, or { lamports: number }
|
|
27
|
+
*/
|
|
28
|
+
lamports?: SolParam;
|
|
29
|
+
/** Payment processing frequency (cron expression or named schedule) */
|
|
30
|
+
paymentsFreq: ScheduleParam;
|
|
31
|
+
/**
|
|
32
|
+
* Optional compute units to allocate for the transaction
|
|
33
|
+
* @example 400000
|
|
34
|
+
*/
|
|
35
|
+
computeUnits?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Create a per-contract automation thread
|
|
39
|
+
*
|
|
40
|
+
* Creates an Antegen thread with controller fiber (fiber 0, inline).
|
|
41
|
+
* Thread starts **paused** by default. Fiber 1 (rental_close) and
|
|
42
|
+
* fiber 2 (rental_activate) are created lazily when needed by
|
|
43
|
+
* rental_accept and rental_reserve respectively.
|
|
44
|
+
*
|
|
45
|
+
* @param params - Thread creation parameters
|
|
46
|
+
* @param config - Optional SDK configuration overrides
|
|
47
|
+
* @returns Kit instruction (or web3.js if PublicKey in config)
|
|
48
|
+
*/
|
|
49
|
+
export declare function createContractThread(params: CreateContractThreadParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>;
|
|
50
|
+
//# sourceMappingURL=createContractThread.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createContractThread.d.ts","sourceRoot":"","sources":["../../../src/instructions/createContractThread.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAK5D,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB,4CAA4C;IAC5C,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB,uEAAuE;IACvE,YAAY,EAAE,aAAa,CAAC;IAE5B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,0BAA0B,EAClC,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC1B,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAmDjD"}
|