@wuwei-labs/srsly 2.3.3-canary.36.16828734028.0 → 3.0.0-beta.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/README.md +126 -462
- package/dist/cjs/accounts/borrower.js +47 -0
- package/dist/cjs/accounts/borrower.js.map +1 -0
- package/dist/cjs/accounts/config.js +47 -0
- package/dist/cjs/accounts/config.js.map +1 -0
- package/dist/cjs/accounts/contract.js +47 -0
- package/dist/cjs/accounts/contract.js.map +1 -0
- package/dist/cjs/accounts/fleet.js +77 -0
- package/dist/cjs/accounts/fleet.js.map +1 -0
- package/dist/cjs/accounts/rental.js +47 -0
- package/dist/cjs/accounts/rental.js.map +1 -0
- package/dist/cjs/demos.js +124 -59
- package/dist/cjs/demos.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/borrowerState.js +84 -0
- package/dist/cjs/generated/codama/accounts/borrowerState.js.map +1 -0
- package/dist/cjs/generated/codama/accounts/configState.js +37 -52
- package/dist/cjs/generated/codama/accounts/configState.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/contractState.js +27 -51
- package/dist/cjs/generated/codama/accounts/contractState.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/index.js +5 -2
- package/dist/cjs/generated/codama/accounts/index.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/memberState.js +78 -0
- package/dist/cjs/generated/codama/accounts/memberState.js.map +1 -0
- package/dist/cjs/generated/codama/accounts/rentalState.js +23 -59
- package/dist/cjs/generated/codama/accounts/rentalState.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/thread.js +45 -61
- package/dist/cjs/generated/codama/accounts/thread.js.map +1 -1
- package/dist/cjs/generated/codama/accounts/vaultState.js +82 -0
- package/dist/cjs/generated/codama/accounts/vaultState.js.map +1 -0
- package/dist/cjs/generated/codama/errors/index.js +2 -2
- package/dist/cjs/generated/codama/errors/srsly.js +158 -19
- package/dist/cjs/generated/codama/errors/srsly.js.map +1 -1
- package/dist/cjs/generated/codama/index.js +2 -2
- package/dist/cjs/generated/codama/instructions/acceptRental.js +107 -40
- package/dist/cjs/generated/codama/instructions/acceptRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/cancelRental.js +53 -56
- package/dist/cjs/generated/codama/instructions/cancelRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/captureRental.js +129 -0
- package/dist/cjs/generated/codama/instructions/captureRental.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/claimBorrower.js +222 -0
- package/dist/cjs/generated/codama/instructions/claimBorrower.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/claimBorrowerPayments.js +225 -0
- package/dist/cjs/generated/codama/instructions/claimBorrowerPayments.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/claimContractPayments.js +230 -0
- package/dist/cjs/generated/codama/instructions/claimContractPayments.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/closeBorrower.js +84 -0
- package/dist/cjs/generated/codama/instructions/closeBorrower.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/closeContract.js +140 -31
- package/dist/cjs/generated/codama/instructions/closeContract.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/closeRental.js +31 -28
- package/dist/cjs/generated/codama/instructions/closeRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/createConfig.js +212 -0
- package/dist/cjs/generated/codama/instructions/createConfig.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/createContract.js +47 -45
- package/dist/cjs/generated/codama/instructions/createContract.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/deleteBorrower.js +126 -0
- package/dist/cjs/generated/codama/instructions/deleteBorrower.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/deleteConfig.js +193 -0
- package/dist/cjs/generated/codama/instructions/deleteConfig.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/deleteContract.js +115 -0
- package/dist/cjs/generated/codama/instructions/deleteContract.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/deleteRental.js +115 -0
- package/dist/cjs/generated/codama/instructions/deleteRental.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/discountBorrower.js +118 -0
- package/dist/cjs/generated/codama/instructions/discountBorrower.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/index.js +15 -4
- package/dist/cjs/generated/codama/instructions/index.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/payRental.js +95 -68
- package/dist/cjs/generated/codama/instructions/payRental.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/{resetRental.js → releaseRental.js} +79 -38
- package/dist/cjs/generated/codama/instructions/releaseRental.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/reserveRental.js +255 -0
- package/dist/cjs/generated/codama/instructions/reserveRental.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/{initializeConfig.js → updateBorrower.js} +45 -52
- package/dist/cjs/generated/codama/instructions/updateBorrower.js.map +1 -0
- package/dist/cjs/generated/codama/instructions/updateConfig.js +41 -32
- package/dist/cjs/generated/codama/instructions/updateConfig.js.map +1 -1
- package/dist/cjs/generated/codama/instructions/updateContract.js +134 -0
- package/dist/cjs/generated/codama/instructions/updateContract.js.map +1 -0
- package/dist/cjs/generated/codama/programs/index.js +2 -2
- package/dist/cjs/generated/codama/programs/srsly.js +74 -18
- package/dist/cjs/generated/codama/programs/srsly.js.map +1 -1
- package/dist/cjs/generated/codama/shared/index.js +2 -2
- package/dist/cjs/generated/codama/shared/index.js.map +1 -1
- package/dist/cjs/generated/codama/types/capturedFlagData.js +31 -0
- package/dist/cjs/generated/codama/types/capturedFlagData.js.map +1 -0
- package/dist/cjs/generated/codama/types/index.js +7 -9
- package/dist/cjs/generated/codama/types/index.js.map +1 -1
- package/dist/cjs/generated/codama/types/memberConfig.js +33 -0
- package/dist/cjs/generated/codama/types/memberConfig.js.map +1 -0
- package/dist/cjs/generated/codama/types/memberType.js +55 -0
- package/dist/cjs/generated/codama/types/memberType.js.map +1 -0
- package/dist/cjs/generated/codama/types/paymentFrequency.js +2 -2
- package/dist/cjs/generated/codama/types/schedule.js +65 -0
- package/dist/cjs/generated/codama/types/schedule.js.map +1 -0
- package/dist/cjs/generated/codama/types/signal.js +48 -0
- package/dist/cjs/generated/codama/types/signal.js.map +1 -0
- package/dist/cjs/generated/codama/types/trigger.js +36 -23
- package/dist/cjs/generated/codama/types/trigger.js.map +1 -1
- package/dist/cjs/index.js +172 -245
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/instructions/acceptRental.js +153 -0
- package/dist/cjs/instructions/acceptRental.js.map +1 -0
- package/dist/cjs/instructions/cancelRental.js +100 -0
- package/dist/cjs/instructions/cancelRental.js.map +1 -0
- package/dist/cjs/instructions/captureRental.js +85 -0
- package/dist/cjs/instructions/captureRental.js.map +1 -0
- package/dist/cjs/instructions/claimBorrower.js +66 -0
- package/dist/cjs/instructions/claimBorrower.js.map +1 -0
- package/dist/cjs/instructions/claimBorrowerPayments.js +69 -0
- package/dist/cjs/instructions/claimBorrowerPayments.js.map +1 -0
- package/dist/cjs/instructions/claimContractPayments.js +79 -0
- package/dist/cjs/instructions/claimContractPayments.js.map +1 -0
- package/dist/cjs/instructions/closeBorrower.js +60 -0
- package/dist/cjs/instructions/closeBorrower.js.map +1 -0
- package/dist/cjs/instructions/closeContract.js +120 -0
- package/dist/cjs/instructions/closeContract.js.map +1 -0
- package/dist/cjs/instructions/closeRental.js +105 -0
- package/dist/cjs/instructions/closeRental.js.map +1 -0
- package/dist/cjs/instructions/createConfig.js +74 -0
- package/dist/cjs/instructions/createConfig.js.map +1 -0
- package/dist/cjs/instructions/createContract.js +131 -0
- package/dist/cjs/instructions/createContract.js.map +1 -0
- package/dist/cjs/instructions/deleteBorrower.js +60 -0
- package/dist/cjs/instructions/deleteBorrower.js.map +1 -0
- package/dist/cjs/instructions/deleteConfig.js +79 -0
- package/dist/cjs/instructions/deleteConfig.js.map +1 -0
- package/dist/cjs/instructions/deleteRental.js +75 -0
- package/dist/cjs/instructions/deleteRental.js.map +1 -0
- package/dist/cjs/instructions/discountBorrower.js +75 -0
- package/dist/cjs/instructions/discountBorrower.js.map +1 -0
- package/dist/cjs/instructions/releaseRental.js +132 -0
- package/dist/cjs/instructions/releaseRental.js.map +1 -0
- package/dist/cjs/instructions/reserveRental.js +135 -0
- package/dist/cjs/instructions/reserveRental.js.map +1 -0
- package/dist/cjs/instructions/updateBorrower.js +89 -0
- package/dist/cjs/instructions/updateBorrower.js.map +1 -0
- package/dist/cjs/instructions/updateConfig.js +103 -0
- package/dist/cjs/instructions/updateConfig.js.map +1 -0
- package/dist/cjs/instructions/updateContract.js +107 -0
- package/dist/cjs/instructions/updateContract.js.map +1 -0
- package/dist/cjs/package.json +30 -32
- package/dist/cjs/params/amount.js +125 -0
- package/dist/cjs/params/amount.js.map +1 -0
- package/dist/cjs/params/duration.js +120 -0
- package/dist/cjs/params/duration.js.map +1 -0
- package/dist/cjs/params/schedule.js +164 -0
- package/dist/cjs/params/schedule.js.map +1 -0
- package/dist/cjs/pda/constants.js +73 -0
- package/dist/cjs/pda/constants.js.map +1 -0
- package/dist/cjs/pda/index.js +73 -0
- package/dist/cjs/pda/index.js.map +1 -0
- package/dist/cjs/pda/sage.js +175 -0
- package/dist/cjs/pda/sage.js.map +1 -0
- package/dist/cjs/pda/slyvault.js +56 -0
- package/dist/cjs/pda/slyvault.js.map +1 -0
- package/dist/cjs/pda/srsly.js +120 -0
- package/dist/cjs/pda/srsly.js.map +1 -0
- package/dist/cjs/pda/thread.js +64 -0
- package/dist/cjs/pda/thread.js.map +1 -0
- package/dist/cjs/pda/token.js +62 -0
- package/dist/cjs/pda/token.js.map +1 -0
- package/dist/cjs/utils/addresses.js +90 -0
- package/dist/cjs/utils/addresses.js.map +1 -0
- package/dist/cjs/utils/config.js +100 -187
- package/dist/cjs/utils/config.js.map +1 -1
- package/dist/cjs/utils/index.js +32 -28
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/instructions.js +79 -0
- package/dist/cjs/utils/instructions.js.map +1 -0
- package/dist/cjs/utils/signer.js +113 -94
- package/dist/cjs/utils/signer.js.map +1 -1
- package/dist/cjs/utils/web3js.js +76 -0
- package/dist/cjs/utils/web3js.js.map +1 -0
- package/dist/cjs/version.js +7 -0
- package/dist/cjs/version.js.map +1 -0
- package/dist/esm/accounts/borrower.js +44 -0
- package/dist/esm/accounts/borrower.js.map +1 -0
- package/dist/esm/accounts/config.js +44 -0
- package/dist/esm/accounts/config.js.map +1 -0
- package/dist/esm/accounts/contract.js +44 -0
- package/dist/esm/accounts/contract.js.map +1 -0
- package/dist/esm/accounts/fleet.js +74 -0
- package/dist/esm/accounts/fleet.js.map +1 -0
- package/dist/esm/accounts/rental.js +44 -0
- package/dist/esm/accounts/rental.js.map +1 -0
- package/dist/esm/demos.js +123 -18
- package/dist/esm/demos.js.map +1 -1
- package/dist/esm/generated/codama/accounts/borrowerState.js +72 -0
- package/dist/esm/generated/codama/accounts/borrowerState.js.map +1 -0
- package/dist/esm/generated/codama/accounts/configState.js +38 -53
- package/dist/esm/generated/codama/accounts/configState.js.map +1 -1
- package/dist/esm/generated/codama/accounts/contractState.js +28 -52
- package/dist/esm/generated/codama/accounts/contractState.js.map +1 -1
- package/dist/esm/generated/codama/accounts/index.js +5 -2
- package/dist/esm/generated/codama/accounts/index.js.map +1 -1
- package/dist/esm/generated/codama/accounts/memberState.js +66 -0
- package/dist/esm/generated/codama/accounts/memberState.js.map +1 -0
- package/dist/esm/generated/codama/accounts/rentalState.js +23 -60
- package/dist/esm/generated/codama/accounts/rentalState.js.map +1 -1
- package/dist/esm/generated/codama/accounts/thread.js +47 -63
- package/dist/esm/generated/codama/accounts/thread.js.map +1 -1
- package/dist/esm/generated/codama/accounts/vaultState.js +70 -0
- package/dist/esm/generated/codama/accounts/vaultState.js.map +1 -0
- package/dist/esm/generated/codama/errors/index.js +2 -2
- package/dist/esm/generated/codama/errors/srsly.js +156 -18
- package/dist/esm/generated/codama/errors/srsly.js.map +1 -1
- package/dist/esm/generated/codama/index.js +2 -2
- package/dist/esm/generated/codama/instructions/acceptRental.js +107 -40
- package/dist/esm/generated/codama/instructions/acceptRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/cancelRental.js +54 -57
- package/dist/esm/generated/codama/instructions/cancelRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/captureRental.js +119 -0
- package/dist/esm/generated/codama/instructions/captureRental.js.map +1 -0
- package/dist/esm/generated/codama/instructions/claimBorrower.js +212 -0
- package/dist/esm/generated/codama/instructions/claimBorrower.js.map +1 -0
- package/dist/esm/generated/codama/instructions/claimContractPayments.js +220 -0
- package/dist/esm/generated/codama/instructions/claimContractPayments.js.map +1 -0
- package/dist/esm/generated/codama/instructions/closeBorrower.js +75 -0
- package/dist/esm/generated/codama/instructions/closeBorrower.js.map +1 -0
- package/dist/esm/generated/codama/instructions/closeContract.js +142 -33
- package/dist/esm/generated/codama/instructions/closeContract.js.map +1 -1
- package/dist/esm/generated/codama/instructions/closeRental.js +31 -28
- package/dist/esm/generated/codama/instructions/closeRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/createConfig.js +202 -0
- package/dist/esm/generated/codama/instructions/createConfig.js.map +1 -0
- package/dist/esm/generated/codama/instructions/createContract.js +48 -46
- package/dist/esm/generated/codama/instructions/createContract.js.map +1 -1
- package/dist/esm/generated/codama/instructions/deleteBorrower.js +116 -0
- package/dist/esm/generated/codama/instructions/deleteBorrower.js.map +1 -0
- package/dist/esm/generated/codama/instructions/deleteConfig.js +183 -0
- package/dist/esm/generated/codama/instructions/deleteConfig.js.map +1 -0
- package/dist/esm/generated/codama/instructions/deleteContract.js +105 -0
- package/dist/esm/generated/codama/instructions/deleteContract.js.map +1 -0
- package/dist/esm/generated/codama/instructions/deleteRental.js +105 -0
- package/dist/esm/generated/codama/instructions/deleteRental.js.map +1 -0
- package/dist/esm/generated/codama/instructions/discountBorrower.js +108 -0
- package/dist/esm/generated/codama/instructions/discountBorrower.js.map +1 -0
- package/dist/esm/generated/codama/instructions/index.js +15 -4
- package/dist/esm/generated/codama/instructions/index.js.map +1 -1
- package/dist/esm/generated/codama/instructions/payRental.js +95 -68
- package/dist/esm/generated/codama/instructions/payRental.js.map +1 -1
- package/dist/esm/generated/codama/instructions/{resetRental.js → releaseRental.js} +73 -32
- package/dist/esm/generated/codama/instructions/releaseRental.js.map +1 -0
- package/dist/esm/generated/codama/instructions/reserveRental.js +245 -0
- package/dist/esm/generated/codama/instructions/reserveRental.js.map +1 -0
- package/dist/esm/generated/codama/instructions/{initializeConfig.js → updateBorrower.js} +38 -45
- package/dist/esm/generated/codama/instructions/updateBorrower.js.map +1 -0
- package/dist/esm/generated/codama/instructions/updateConfig.js +42 -33
- package/dist/esm/generated/codama/instructions/updateConfig.js.map +1 -1
- package/dist/esm/generated/codama/instructions/updateContract.js +124 -0
- package/dist/esm/generated/codama/instructions/updateContract.js.map +1 -0
- package/dist/esm/generated/codama/programs/index.js +2 -2
- package/dist/esm/generated/codama/programs/srsly.js +74 -18
- package/dist/esm/generated/codama/programs/srsly.js.map +1 -1
- package/dist/esm/generated/codama/shared/index.js +2 -2
- package/dist/esm/generated/codama/shared/index.js.map +1 -1
- package/dist/esm/generated/codama/types/capturedFlagData.js +26 -0
- package/dist/esm/generated/codama/types/capturedFlagData.js.map +1 -0
- package/dist/esm/generated/codama/types/index.js +7 -9
- package/dist/esm/generated/codama/types/index.js.map +1 -1
- package/dist/esm/generated/codama/types/memberConfig.js +28 -0
- package/dist/esm/generated/codama/types/memberConfig.js.map +1 -0
- package/dist/esm/generated/codama/types/memberType.js +48 -0
- package/dist/esm/generated/codama/types/memberType.js.map +1 -0
- package/dist/esm/generated/codama/types/paymentFrequency.js +2 -2
- package/dist/esm/generated/codama/types/schedule.js +58 -0
- package/dist/esm/generated/codama/types/schedule.js.map +1 -0
- package/dist/esm/generated/codama/types/signal.js +41 -0
- package/dist/esm/generated/codama/types/signal.js.map +1 -0
- package/dist/esm/generated/codama/types/trigger.js +37 -24
- package/dist/esm/generated/codama/types/trigger.js.map +1 -1
- package/dist/esm/index.js +78 -208
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/instructions/acceptRental.js +150 -0
- package/dist/esm/instructions/acceptRental.js.map +1 -0
- package/dist/esm/instructions/cancelRental.js +97 -0
- package/dist/esm/instructions/cancelRental.js.map +1 -0
- package/dist/esm/instructions/captureRental.js +82 -0
- package/dist/esm/instructions/captureRental.js.map +1 -0
- package/dist/esm/instructions/claimBorrower.js +63 -0
- package/dist/esm/instructions/claimBorrower.js.map +1 -0
- package/dist/esm/instructions/claimContractPayments.js +76 -0
- package/dist/esm/instructions/claimContractPayments.js.map +1 -0
- package/dist/esm/instructions/closeBorrower.js +57 -0
- package/dist/esm/instructions/closeBorrower.js.map +1 -0
- package/dist/esm/instructions/closeContract.js +117 -0
- package/dist/esm/instructions/closeContract.js.map +1 -0
- package/dist/esm/instructions/closeRental.js +102 -0
- package/dist/esm/instructions/closeRental.js.map +1 -0
- package/dist/esm/instructions/createConfig.js +71 -0
- package/dist/esm/instructions/createConfig.js.map +1 -0
- package/dist/esm/instructions/createContract.js +128 -0
- package/dist/esm/instructions/createContract.js.map +1 -0
- package/dist/esm/instructions/deleteBorrower.js +57 -0
- package/dist/esm/instructions/deleteBorrower.js.map +1 -0
- package/dist/esm/instructions/deleteConfig.js +76 -0
- package/dist/esm/instructions/deleteConfig.js.map +1 -0
- package/dist/esm/instructions/deleteRental.js +72 -0
- package/dist/esm/instructions/deleteRental.js.map +1 -0
- package/dist/esm/instructions/discountBorrower.js +72 -0
- package/dist/esm/instructions/discountBorrower.js.map +1 -0
- package/dist/esm/instructions/releaseRental.js +129 -0
- package/dist/esm/instructions/releaseRental.js.map +1 -0
- package/dist/esm/instructions/reserveRental.js +132 -0
- package/dist/esm/instructions/reserveRental.js.map +1 -0
- package/dist/esm/instructions/updateBorrower.js +86 -0
- package/dist/esm/instructions/updateBorrower.js.map +1 -0
- package/dist/esm/instructions/updateConfig.js +100 -0
- package/dist/esm/instructions/updateConfig.js.map +1 -0
- package/dist/esm/instructions/updateContract.js +104 -0
- package/dist/esm/instructions/updateContract.js.map +1 -0
- package/dist/esm/package.json +30 -32
- package/dist/esm/params/amount.js +119 -0
- package/dist/esm/params/amount.js.map +1 -0
- package/dist/esm/params/duration.js +115 -0
- package/dist/esm/params/duration.js.map +1 -0
- package/dist/esm/params/schedule.js +157 -0
- package/dist/esm/params/schedule.js.map +1 -0
- package/dist/esm/pda/constants.js +67 -0
- package/dist/esm/pda/constants.js.map +1 -0
- package/dist/esm/pda/index.js +42 -0
- package/dist/esm/pda/index.js.map +1 -0
- package/dist/esm/pda/sage.js +168 -0
- package/dist/esm/pda/sage.js.map +1 -0
- package/dist/esm/pda/slyvault.js +53 -0
- package/dist/esm/pda/slyvault.js.map +1 -0
- package/dist/esm/pda/srsly.js +113 -0
- package/dist/esm/pda/srsly.js.map +1 -0
- package/dist/esm/pda/thread.js +61 -0
- package/dist/esm/pda/thread.js.map +1 -0
- package/dist/esm/pda/token.js +59 -0
- package/dist/esm/pda/token.js.map +1 -0
- package/dist/esm/utils/addresses.js +85 -0
- package/dist/esm/utils/addresses.js.map +1 -0
- package/dist/esm/utils/config.js +95 -149
- package/dist/esm/utils/config.js.map +1 -1
- package/dist/esm/utils/index.js +12 -14
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/instructions.js +76 -0
- package/dist/esm/utils/instructions.js.map +1 -0
- package/dist/esm/utils/signer.js +109 -90
- package/dist/esm/utils/signer.js.map +1 -1
- package/dist/esm/utils/web3js.js +72 -0
- package/dist/esm/utils/web3js.js.map +1 -0
- package/dist/esm/version.js +4 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/types/accounts/borrower.d.ts +34 -0
- package/dist/types/accounts/borrower.d.ts.map +1 -0
- package/dist/types/accounts/config.d.ts +31 -0
- package/dist/types/accounts/config.d.ts.map +1 -0
- package/dist/types/accounts/contract.d.ts +34 -0
- package/dist/types/accounts/contract.d.ts.map +1 -0
- package/dist/types/accounts/fleet.d.ts +49 -0
- package/dist/types/accounts/fleet.d.ts.map +1 -0
- package/dist/types/accounts/rental.d.ts +34 -0
- package/dist/types/accounts/rental.d.ts.map +1 -0
- package/dist/types/demos.d.ts +20 -52
- package/dist/types/demos.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/borrowerState.d.ts +94 -0
- package/dist/types/generated/codama/accounts/borrowerState.d.ts.map +1 -0
- package/dist/types/generated/codama/accounts/configState.d.ts +65 -22
- package/dist/types/generated/codama/accounts/configState.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/contractState.d.ts +62 -23
- package/dist/types/generated/codama/accounts/contractState.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/index.d.ts +5 -2
- package/dist/types/generated/codama/accounts/index.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/memberState.d.ts +58 -0
- package/dist/types/generated/codama/accounts/memberState.d.ts.map +1 -0
- package/dist/types/generated/codama/accounts/rentalState.d.ts +35 -39
- package/dist/types/generated/codama/accounts/rentalState.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/thread.d.ts +44 -51
- package/dist/types/generated/codama/accounts/thread.d.ts.map +1 -1
- package/dist/types/generated/codama/accounts/vaultState.d.ts +66 -0
- package/dist/types/generated/codama/accounts/vaultState.d.ts.map +1 -0
- package/dist/types/generated/codama/errors/index.d.ts +2 -2
- package/dist/types/generated/codama/errors/srsly.d.ts +111 -19
- package/dist/types/generated/codama/errors/srsly.d.ts.map +1 -1
- package/dist/types/generated/codama/index.d.ts +2 -2
- package/dist/types/generated/codama/instructions/acceptRental.d.ts +60 -45
- package/dist/types/generated/codama/instructions/acceptRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/cancelRental.d.ts +37 -32
- package/dist/types/generated/codama/instructions/cancelRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/captureRental.d.ts +59 -0
- package/dist/types/generated/codama/instructions/captureRental.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/claimBorrower.d.ts +90 -0
- package/dist/types/generated/codama/instructions/claimBorrower.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/claimBorrowerPayments.d.ts +75 -0
- package/dist/types/generated/codama/instructions/claimBorrowerPayments.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/claimContractPayments.d.ts +98 -0
- package/dist/types/generated/codama/instructions/claimContractPayments.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/closeBorrower.d.ts +43 -0
- package/dist/types/generated/codama/instructions/closeBorrower.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/closeContract.d.ts +44 -28
- package/dist/types/generated/codama/instructions/closeContract.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/closeRental.d.ts +38 -34
- package/dist/types/generated/codama/instructions/closeRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/createConfig.d.ts +79 -0
- package/dist/types/generated/codama/instructions/createConfig.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/createContract.d.ts +38 -30
- package/dist/types/generated/codama/instructions/createContract.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/deleteBorrower.d.ts +55 -0
- package/dist/types/generated/codama/instructions/deleteBorrower.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/deleteConfig.d.ts +75 -0
- package/dist/types/generated/codama/instructions/deleteConfig.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/deleteContract.d.ts +55 -0
- package/dist/types/generated/codama/instructions/deleteContract.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/deleteRental.d.ts +55 -0
- package/dist/types/generated/codama/instructions/deleteRental.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/discountBorrower.d.ts +56 -0
- package/dist/types/generated/codama/instructions/discountBorrower.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/index.d.ts +15 -4
- package/dist/types/generated/codama/instructions/index.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/payRental.d.ts +61 -46
- package/dist/types/generated/codama/instructions/payRental.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/releaseRental.d.ts +105 -0
- package/dist/types/generated/codama/instructions/releaseRental.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/reserveRental.d.ts +129 -0
- package/dist/types/generated/codama/instructions/reserveRental.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/updateBorrower.d.ts +62 -0
- package/dist/types/generated/codama/instructions/updateBorrower.d.ts.map +1 -0
- package/dist/types/generated/codama/instructions/updateConfig.d.ts +88 -28
- package/dist/types/generated/codama/instructions/updateConfig.d.ts.map +1 -1
- package/dist/types/generated/codama/instructions/updateContract.d.ts +88 -0
- package/dist/types/generated/codama/instructions/updateContract.d.ts.map +1 -0
- package/dist/types/generated/codama/programs/index.d.ts +2 -2
- package/dist/types/generated/codama/programs/srsly.d.ts +57 -21
- package/dist/types/generated/codama/programs/srsly.d.ts.map +1 -1
- package/dist/types/generated/codama/shared/index.d.ts +2 -13
- package/dist/types/generated/codama/shared/index.d.ts.map +1 -1
- package/dist/types/generated/codama/types/capturedFlagData.d.ts +35 -0
- package/dist/types/generated/codama/types/capturedFlagData.d.ts.map +1 -0
- package/dist/types/generated/codama/types/index.d.ts +7 -9
- package/dist/types/generated/codama/types/index.d.ts.map +1 -1
- package/dist/types/generated/codama/types/memberConfig.d.ts +33 -0
- package/dist/types/generated/codama/types/memberConfig.d.ts.map +1 -0
- package/dist/types/generated/codama/types/memberType.d.ts +48 -0
- package/dist/types/generated/codama/types/memberType.d.ts.map +1 -0
- package/dist/types/generated/codama/types/paymentFrequency.d.ts +2 -2
- package/dist/types/generated/codama/types/schedule.d.ts +46 -0
- package/dist/types/generated/codama/types/schedule.d.ts.map +1 -0
- package/dist/types/generated/codama/types/signal.d.ts +56 -0
- package/dist/types/generated/codama/types/signal.d.ts.map +1 -0
- package/dist/types/generated/codama/types/trigger.d.ts +45 -34
- package/dist/types/generated/codama/types/trigger.d.ts.map +1 -1
- package/dist/types/index.d.ts +37 -207
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/instructions/acceptRental.d.ts +99 -0
- package/dist/types/instructions/acceptRental.d.ts.map +1 -0
- package/dist/types/instructions/cancelRental.d.ts +90 -0
- package/dist/types/instructions/cancelRental.d.ts.map +1 -0
- package/dist/types/instructions/captureRental.d.ts +58 -0
- package/dist/types/instructions/captureRental.d.ts.map +1 -0
- package/dist/types/instructions/claimBorrower.d.ts +53 -0
- package/dist/types/instructions/claimBorrower.d.ts.map +1 -0
- package/dist/types/instructions/claimBorrowerPayments.d.ts +59 -0
- package/dist/types/instructions/claimBorrowerPayments.d.ts.map +1 -0
- package/dist/types/instructions/claimContractPayments.d.ts +78 -0
- package/dist/types/instructions/claimContractPayments.d.ts.map +1 -0
- package/dist/types/instructions/closeBorrower.d.ts +45 -0
- package/dist/types/instructions/closeBorrower.d.ts.map +1 -0
- package/dist/types/instructions/closeContract.d.ts +91 -0
- package/dist/types/instructions/closeContract.d.ts.map +1 -0
- package/dist/types/instructions/closeRental.d.ts +62 -0
- package/dist/types/instructions/closeRental.d.ts.map +1 -0
- package/dist/types/instructions/createConfig.d.ts +62 -0
- package/dist/types/instructions/createConfig.d.ts.map +1 -0
- package/dist/types/instructions/createContract.d.ts +127 -0
- package/dist/types/instructions/createContract.d.ts.map +1 -0
- package/dist/types/instructions/deleteBorrower.d.ts +53 -0
- package/dist/types/instructions/deleteBorrower.d.ts.map +1 -0
- package/dist/types/instructions/deleteConfig.d.ts +64 -0
- package/dist/types/instructions/deleteConfig.d.ts.map +1 -0
- package/dist/types/instructions/deleteRental.d.ts +67 -0
- package/dist/types/instructions/deleteRental.d.ts.map +1 -0
- package/dist/types/instructions/discountBorrower.d.ts +64 -0
- package/dist/types/instructions/discountBorrower.d.ts.map +1 -0
- package/dist/types/instructions/releaseRental.d.ts +104 -0
- package/dist/types/instructions/releaseRental.d.ts.map +1 -0
- package/dist/types/instructions/reserveRental.d.ts +80 -0
- package/dist/types/instructions/reserveRental.d.ts.map +1 -0
- package/dist/types/instructions/updateBorrower.d.ts +81 -0
- package/dist/types/instructions/updateBorrower.d.ts.map +1 -0
- package/dist/types/instructions/updateConfig.d.ts +142 -0
- package/dist/types/instructions/updateConfig.d.ts.map +1 -0
- package/dist/types/instructions/updateContract.d.ts +113 -0
- package/dist/types/instructions/updateContract.d.ts.map +1 -0
- package/dist/types/params/amount.d.ts +70 -0
- package/dist/types/params/amount.d.ts.map +1 -0
- package/dist/types/params/duration.d.ts +65 -0
- package/dist/types/params/duration.d.ts.map +1 -0
- package/dist/types/params/schedule.d.ts +74 -0
- package/dist/types/params/schedule.d.ts.map +1 -0
- package/dist/types/pda/constants.d.ts +51 -0
- package/dist/types/pda/constants.d.ts.map +1 -0
- package/dist/types/pda/index.d.ts +36 -0
- package/dist/types/pda/index.d.ts.map +1 -0
- package/dist/types/pda/sage.d.ts +69 -0
- package/dist/types/pda/sage.d.ts.map +1 -0
- package/dist/types/pda/slyvault.d.ts +29 -0
- package/dist/types/pda/slyvault.d.ts.map +1 -0
- package/dist/types/pda/srsly.d.ts +40 -0
- package/dist/types/pda/srsly.d.ts.map +1 -0
- package/dist/types/pda/thread.d.ts +31 -0
- package/dist/types/pda/thread.d.ts.map +1 -0
- package/dist/types/pda/token.d.ts +29 -0
- package/dist/types/pda/token.d.ts.map +1 -0
- package/dist/types/utils/addresses.d.ts +75 -0
- package/dist/types/utils/addresses.d.ts.map +1 -0
- package/dist/types/utils/config.d.ts +103 -83
- package/dist/types/utils/config.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +7 -14
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/instructions.d.ts +52 -0
- package/dist/types/utils/instructions.d.ts.map +1 -0
- package/dist/types/utils/signer.d.ts +78 -39
- package/dist/types/utils/signer.d.ts.map +1 -1
- package/dist/types/utils/web3js.d.ts +85 -0
- package/dist/types/utils/web3js.d.ts.map +1 -0
- package/dist/types/version.d.ts +2 -0
- package/dist/types/version.d.ts.map +1 -0
- package/package.json +32 -47
- package/dist/cjs/config/index.js +0 -12
- package/dist/cjs/config/index.js.map +0 -1
- package/dist/cjs/config/initialize.js +0 -95
- package/dist/cjs/config/initialize.js.map +0 -1
- package/dist/cjs/config/update.js +0 -163
- package/dist/cjs/config/update.js.map +0 -1
- package/dist/cjs/contract/close.js +0 -159
- package/dist/cjs/contract/close.js.map +0 -1
- package/dist/cjs/contract/create.js +0 -259
- package/dist/cjs/contract/create.js.map +0 -1
- package/dist/cjs/contract/index.js +0 -68
- package/dist/cjs/contract/index.js.map +0 -1
- package/dist/cjs/generated/codama/instructions/initializeConfig.js.map +0 -1
- package/dist/cjs/generated/codama/instructions/resetRental.js.map +0 -1
- package/dist/cjs/generated/codama/types/clockData.js +0 -58
- package/dist/cjs/generated/codama/types/clockData.js.map +0 -1
- package/dist/cjs/generated/codama/types/equality.js +0 -30
- package/dist/cjs/generated/codama/types/equality.js.map +0 -1
- package/dist/cjs/generated/codama/types/execContext.js +0 -68
- package/dist/cjs/generated/codama/types/execContext.js.map +0 -1
- package/dist/cjs/generated/codama/types/serializableAccount.js +0 -58
- package/dist/cjs/generated/codama/types/serializableAccount.js.map +0 -1
- package/dist/cjs/generated/codama/types/serializableInstruction.js +0 -59
- package/dist/cjs/generated/codama/types/serializableInstruction.js.map +0 -1
- package/dist/cjs/generated/codama/types/threadResponse.js +0 -68
- package/dist/cjs/generated/codama/types/threadResponse.js.map +0 -1
- package/dist/cjs/generated/codama/types/triggerContext.js +0 -49
- package/dist/cjs/generated/codama/types/triggerContext.js.map +0 -1
- package/dist/cjs/idl/index.js +0 -27
- package/dist/cjs/idl/index.js.map +0 -1
- package/dist/cjs/idl/srsly-data.js +0 -3140
- package/dist/cjs/idl/srsly-data.js.map +0 -1
- package/dist/cjs/idl/srsly.json +0 -3104
- package/dist/cjs/rental/accept.js +0 -263
- package/dist/cjs/rental/accept.js.map +0 -1
- package/dist/cjs/rental/cancel.js +0 -184
- package/dist/cjs/rental/cancel.js.map +0 -1
- package/dist/cjs/rental/close.js +0 -184
- package/dist/cjs/rental/close.js.map +0 -1
- package/dist/cjs/rental/index.js +0 -105
- package/dist/cjs/rental/index.js.map +0 -1
- package/dist/cjs/rental/reset.js +0 -192
- package/dist/cjs/rental/reset.js.map +0 -1
- package/dist/cjs/types/payment-frequency.js +0 -87
- package/dist/cjs/types/payment-frequency.js.map +0 -1
- package/dist/cjs/types/srsly.js +0 -3
- package/dist/cjs/types/srsly.js.map +0 -1
- package/dist/cjs/utils/constants.js +0 -78
- package/dist/cjs/utils/constants.js.map +0 -1
- package/dist/cjs/utils/cron.js +0 -204
- package/dist/cjs/utils/cron.js.map +0 -1
- package/dist/cjs/utils/derive-pda.js +0 -415
- package/dist/cjs/utils/derive-pda.js.map +0 -1
- package/dist/cjs/utils/fetch-accounts.js +0 -241
- package/dist/cjs/utils/fetch-accounts.js.map +0 -1
- package/dist/cjs/utils/instruction-converter.js +0 -125
- package/dist/cjs/utils/instruction-converter.js.map +0 -1
- package/dist/cjs/utils/param-converters.js +0 -190
- package/dist/cjs/utils/param-converters.js.map +0 -1
- package/dist/cjs/utils/payment-frequency.js +0 -111
- package/dist/cjs/utils/payment-frequency.js.map +0 -1
- package/dist/cjs/utils/schedule-builder.js +0 -158
- package/dist/cjs/utils/schedule-builder.js.map +0 -1
- package/dist/cjs/utils/schedule-validation.js +0 -136
- package/dist/cjs/utils/schedule-validation.js.map +0 -1
- package/dist/cjs/utils/smart-params.js +0 -52
- package/dist/cjs/utils/smart-params.js.map +0 -1
- package/dist/esm/config/index.js +0 -7
- package/dist/esm/config/index.js.map +0 -1
- package/dist/esm/config/initialize.js +0 -92
- package/dist/esm/config/initialize.js.map +0 -1
- package/dist/esm/config/update.js +0 -159
- package/dist/esm/config/update.js.map +0 -1
- package/dist/esm/contract/close.js +0 -154
- package/dist/esm/contract/close.js.map +0 -1
- package/dist/esm/contract/create.js +0 -255
- package/dist/esm/contract/create.js.map +0 -1
- package/dist/esm/contract/index.js +0 -52
- package/dist/esm/contract/index.js.map +0 -1
- package/dist/esm/generated/codama/instructions/initializeConfig.js.map +0 -1
- package/dist/esm/generated/codama/instructions/resetRental.js.map +0 -1
- package/dist/esm/generated/codama/types/clockData.js +0 -53
- package/dist/esm/generated/codama/types/clockData.js.map +0 -1
- package/dist/esm/generated/codama/types/equality.js +0 -24
- package/dist/esm/generated/codama/types/equality.js.map +0 -1
- package/dist/esm/generated/codama/types/execContext.js +0 -63
- package/dist/esm/generated/codama/types/execContext.js.map +0 -1
- package/dist/esm/generated/codama/types/serializableAccount.js +0 -53
- package/dist/esm/generated/codama/types/serializableAccount.js.map +0 -1
- package/dist/esm/generated/codama/types/serializableInstruction.js +0 -54
- package/dist/esm/generated/codama/types/serializableInstruction.js.map +0 -1
- package/dist/esm/generated/codama/types/threadResponse.js +0 -63
- package/dist/esm/generated/codama/types/threadResponse.js.map +0 -1
- package/dist/esm/generated/codama/types/triggerContext.js +0 -42
- package/dist/esm/generated/codama/types/triggerContext.js.map +0 -1
- package/dist/esm/idl/index.js +0 -21
- package/dist/esm/idl/index.js.map +0 -1
- package/dist/esm/idl/srsly-data.js +0 -3137
- package/dist/esm/idl/srsly-data.js.map +0 -1
- package/dist/esm/idl/srsly.json +0 -3104
- package/dist/esm/rental/accept.js +0 -258
- package/dist/esm/rental/accept.js.map +0 -1
- package/dist/esm/rental/cancel.js +0 -179
- package/dist/esm/rental/cancel.js.map +0 -1
- package/dist/esm/rental/close.js +0 -179
- package/dist/esm/rental/close.js.map +0 -1
- package/dist/esm/rental/index.js +0 -89
- package/dist/esm/rental/index.js.map +0 -1
- package/dist/esm/rental/reset.js +0 -187
- package/dist/esm/rental/reset.js.map +0 -1
- package/dist/esm/types/payment-frequency.js +0 -83
- package/dist/esm/types/payment-frequency.js.map +0 -1
- package/dist/esm/types/srsly.js +0 -2
- package/dist/esm/types/srsly.js.map +0 -1
- package/dist/esm/utils/constants.js +0 -70
- package/dist/esm/utils/constants.js.map +0 -1
- package/dist/esm/utils/cron.js +0 -195
- package/dist/esm/utils/cron.js.map +0 -1
- package/dist/esm/utils/derive-pda.js +0 -402
- package/dist/esm/utils/derive-pda.js.map +0 -1
- package/dist/esm/utils/fetch-accounts.js +0 -233
- package/dist/esm/utils/fetch-accounts.js.map +0 -1
- package/dist/esm/utils/instruction-converter.js +0 -120
- package/dist/esm/utils/instruction-converter.js.map +0 -1
- package/dist/esm/utils/param-converters.js +0 -182
- package/dist/esm/utils/param-converters.js.map +0 -1
- package/dist/esm/utils/payment-frequency.js +0 -104
- package/dist/esm/utils/payment-frequency.js.map +0 -1
- package/dist/esm/utils/schedule-builder.js +0 -153
- package/dist/esm/utils/schedule-builder.js.map +0 -1
- package/dist/esm/utils/schedule-validation.js +0 -132
- package/dist/esm/utils/schedule-validation.js.map +0 -1
- package/dist/esm/utils/smart-params.js +0 -49
- package/dist/esm/utils/smart-params.js.map +0 -1
- package/dist/types/config/index.d.ts +0 -7
- package/dist/types/config/index.d.ts.map +0 -1
- package/dist/types/config/initialize.d.ts +0 -66
- package/dist/types/config/initialize.d.ts.map +0 -1
- package/dist/types/config/update.d.ts +0 -143
- package/dist/types/config/update.d.ts.map +0 -1
- package/dist/types/contract/close.d.ts +0 -124
- package/dist/types/contract/close.d.ts.map +0 -1
- package/dist/types/contract/create.d.ts +0 -150
- package/dist/types/contract/create.d.ts.map +0 -1
- package/dist/types/contract/index.d.ts +0 -52
- package/dist/types/contract/index.d.ts.map +0 -1
- package/dist/types/generated/codama/instructions/initializeConfig.d.ts +0 -60
- package/dist/types/generated/codama/instructions/initializeConfig.d.ts.map +0 -1
- package/dist/types/generated/codama/instructions/resetRental.d.ts +0 -79
- package/dist/types/generated/codama/instructions/resetRental.d.ts.map +0 -1
- package/dist/types/generated/codama/types/clockData.d.ts +0 -30
- package/dist/types/generated/codama/types/clockData.d.ts.map +0 -1
- package/dist/types/generated/codama/types/equality.d.ts +0 -18
- package/dist/types/generated/codama/types/equality.d.ts.map +0 -1
- package/dist/types/generated/codama/types/execContext.d.ts +0 -49
- package/dist/types/generated/codama/types/execContext.d.ts.map +0 -1
- package/dist/types/generated/codama/types/serializableAccount.d.ts +0 -23
- package/dist/types/generated/codama/types/serializableAccount.d.ts.map +0 -1
- package/dist/types/generated/codama/types/serializableInstruction.d.ts +0 -31
- package/dist/types/generated/codama/types/serializableInstruction.d.ts.map +0 -1
- package/dist/types/generated/codama/types/threadResponse.d.ts +0 -43
- package/dist/types/generated/codama/types/threadResponse.d.ts.map +0 -1
- package/dist/types/generated/codama/types/triggerContext.d.ts +0 -75
- package/dist/types/generated/codama/types/triggerContext.d.ts.map +0 -1
- package/dist/types/idl/index.d.ts +0 -21
- package/dist/types/idl/index.d.ts.map +0 -1
- package/dist/types/idl/srsly-data.d.ts +0 -1458
- package/dist/types/idl/srsly-data.d.ts.map +0 -1
- package/dist/types/rental/accept.d.ts +0 -196
- package/dist/types/rental/accept.d.ts.map +0 -1
- package/dist/types/rental/cancel.d.ts +0 -141
- package/dist/types/rental/cancel.d.ts.map +0 -1
- package/dist/types/rental/close.d.ts +0 -130
- package/dist/types/rental/close.d.ts.map +0 -1
- package/dist/types/rental/index.d.ts +0 -89
- package/dist/types/rental/index.d.ts.map +0 -1
- package/dist/types/rental/reset.d.ts +0 -166
- package/dist/types/rental/reset.d.ts.map +0 -1
- package/dist/types/types/payment-frequency.d.ts +0 -55
- package/dist/types/types/payment-frequency.d.ts.map +0 -1
- package/dist/types/types/srsly.d.ts +0 -3111
- package/dist/types/types/srsly.d.ts.map +0 -1
- package/dist/types/utils/constants.d.ts +0 -26
- package/dist/types/utils/constants.d.ts.map +0 -1
- package/dist/types/utils/cron.d.ts +0 -77
- package/dist/types/utils/cron.d.ts.map +0 -1
- package/dist/types/utils/derive-pda.d.ts +0 -213
- package/dist/types/utils/derive-pda.d.ts.map +0 -1
- package/dist/types/utils/fetch-accounts.d.ts +0 -158
- package/dist/types/utils/fetch-accounts.d.ts.map +0 -1
- package/dist/types/utils/instruction-converter.d.ts +0 -171
- package/dist/types/utils/instruction-converter.d.ts.map +0 -1
- package/dist/types/utils/param-converters.d.ts +0 -67
- package/dist/types/utils/param-converters.d.ts.map +0 -1
- package/dist/types/utils/payment-frequency.d.ts +0 -38
- package/dist/types/utils/payment-frequency.d.ts.map +0 -1
- package/dist/types/utils/schedule-builder.d.ts +0 -64
- package/dist/types/utils/schedule-builder.d.ts.map +0 -1
- package/dist/types/utils/schedule-validation.d.ts +0 -36
- package/dist/types/utils/schedule-validation.d.ts.map +0 -1
- package/dist/types/utils/smart-params.d.ts +0 -112
- package/dist/types/utils/smart-params.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"srsly-data.d.ts","sourceRoot":"","sources":["../../../src/idl/srsly-data.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwjGN,CAAC;AACX,eAAe,GAAG,CAAC"}
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @purpose Rental contract acceptance with payment calculation and SAGE integration
|
|
3
|
-
* @reviewed 2025-07-29
|
|
4
|
-
*/
|
|
5
|
-
import { type SdkConfigSelector } from '../utils/config';
|
|
6
|
-
import { type FluentInstruction, type SmartFluentConfigSelector } from '../utils/instruction-converter';
|
|
7
|
-
import { type UniversalSigner } from '../utils/signer';
|
|
8
|
-
import type { DurationParam } from '../utils/smart-params';
|
|
9
|
-
type UniversalAddress = string;
|
|
10
|
-
/**
|
|
11
|
-
* Parameters for accepting a rental contract.
|
|
12
|
-
*
|
|
13
|
-
* This interface defines the required parameters for a borrower to accept an existing
|
|
14
|
-
* rental contract. The SDK automatically fetches contract details and calculates the
|
|
15
|
-
* required payment amount based on the contract's rate and payment frequency.
|
|
16
|
-
*
|
|
17
|
-
* @interface AcceptRentalParams
|
|
18
|
-
*/
|
|
19
|
-
export interface AcceptRentalParams {
|
|
20
|
-
/**
|
|
21
|
-
* The borrower who will rent the fleet (signer object or base58 string address).
|
|
22
|
-
* This account will control the fleet during the rental period and make payments.
|
|
23
|
-
* Can be a wallet/signer object (CLI usage) or base58 address string (browser usage).
|
|
24
|
-
*/
|
|
25
|
-
borrower: UniversalSigner;
|
|
26
|
-
/**
|
|
27
|
-
* String address of the borrower's profile in the Star Atlas game.
|
|
28
|
-
* Used for SAGE integration to transfer fleet control to the borrower.
|
|
29
|
-
*/
|
|
30
|
-
borrowerProfile: UniversalAddress;
|
|
31
|
-
/**
|
|
32
|
-
* Faction identifier for the borrower in Star Atlas.
|
|
33
|
-
* Can be provided as a number (1 = MUD, 2 = ONI, 3 = Ustur) or string ('mud', 'oni', 'ustur').
|
|
34
|
-
* If not provided, the faction will be automatically resolved from the fleet account.
|
|
35
|
-
* Used for deriving faction-specific game accounts required by SAGE.
|
|
36
|
-
* @example 'mud' // or 1
|
|
37
|
-
*/
|
|
38
|
-
borrowerFaction?: number | string;
|
|
39
|
-
/**
|
|
40
|
-
* String address of the rental contract to accept.
|
|
41
|
-
* The SDK will automatically fetch the contract state to retrieve:
|
|
42
|
-
* - Fleet address and ownership details
|
|
43
|
-
* - Rental rate per payment period
|
|
44
|
-
* - Payment frequency (hourly, daily, weekly, monthly)
|
|
45
|
-
* - Duration constraints (minimum and maximum)
|
|
46
|
-
* - Owner information for payment routing
|
|
47
|
-
*/
|
|
48
|
-
contract: UniversalAddress;
|
|
49
|
-
/**
|
|
50
|
-
* Rental duration.
|
|
51
|
-
* Can be specified as seconds (number) or time units (object).
|
|
52
|
-
* Must be within the contract's minimum and maximum duration limits.
|
|
53
|
-
* @example { days: 7 } // 7 days
|
|
54
|
-
* @example { weeks: 2 } // 2 weeks
|
|
55
|
-
* @example 604800 // 7 days in seconds (backwards compatible)
|
|
56
|
-
*/
|
|
57
|
-
duration: DurationParam;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Creates an instruction to accept a rental contract with fluent configuration.
|
|
61
|
-
*
|
|
62
|
-
* This function allows a borrower to accept an existing rental contract, automatically
|
|
63
|
-
* calculating the required payment amount based on the contract's rate and payment frequency.
|
|
64
|
-
* The SDK fetches contract details, validates duration constraints, and derives all
|
|
65
|
-
* necessary accounts for the rental operation.
|
|
66
|
-
*
|
|
67
|
-
* ## Features
|
|
68
|
-
*
|
|
69
|
-
* - **Automatic Payment Calculation**: Fetches contract state and calculates exact payment amount
|
|
70
|
-
* - **Automatic Faction Resolution**: Optionally fetches faction from fleet account if not provided
|
|
71
|
-
* - **Duration Validation**: Ensures rental duration meets contract constraints
|
|
72
|
-
* - **Account Derivation**: Automatically derives all required game accounts
|
|
73
|
-
* - **SAGE Integration**: Sets up fleet ownership transfer in the Star Atlas ecosystem
|
|
74
|
-
* - **Clockwork Integration**: Configures automated payment scheduling
|
|
75
|
-
* - **Universal Library Support**: Works with both @solana/kit and @solana/web3.js
|
|
76
|
-
*
|
|
77
|
-
* ## Process
|
|
78
|
-
*
|
|
79
|
-
* 1. **Fetch Contract**: Retrieves contract state from the blockchain
|
|
80
|
-
* 2. **Validate Duration**: Checks that rental duration meets contract constraints
|
|
81
|
-
* 3. **Calculate Payment**: Computes payment amount using contract rate and payment frequency
|
|
82
|
-
* 4. **Derive Accounts**: Generates required game accounts (starbase, faction, etc.)
|
|
83
|
-
* 5. **Create Instruction**: Builds the rental acceptance instruction
|
|
84
|
-
* 6. **Setup Threading**: Configures automated payment processing
|
|
85
|
-
*
|
|
86
|
-
* ## Payment Calculation
|
|
87
|
-
*
|
|
88
|
-
* The payment amount is calculated using the formula:
|
|
89
|
-
* ```text
|
|
90
|
-
* payment = rate × payment_periods × stardust_to_atlas_conversion
|
|
91
|
-
* ```
|
|
92
|
-
*
|
|
93
|
-
* Where:
|
|
94
|
-
* - `rate`: Contract's rental rate per payment period
|
|
95
|
-
* - `payment_periods`: Duration divided by payment frequency interval
|
|
96
|
-
* - `stardust_to_atlas_conversion`: Network-specific conversion factor
|
|
97
|
-
*
|
|
98
|
-
* ## Requirements
|
|
99
|
-
*
|
|
100
|
-
* - Contract must exist and be active
|
|
101
|
-
* - Duration must be within contract's min/max limits
|
|
102
|
-
* - Duration must be multiple of payment frequency
|
|
103
|
-
* - Borrower must have sufficient ATLAS tokens for payment
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```typescript
|
|
107
|
-
* import { acceptRental } from '@srsly/sdk';
|
|
108
|
-
*
|
|
109
|
-
* // Using smart duration parameters (recommended)
|
|
110
|
-
* const instruction = await acceptRental({
|
|
111
|
-
* borrower: wallet, // Wallet object for signing
|
|
112
|
-
* borrowerProfile: "ProfileAddr...", // Borrower's Star Atlas profile
|
|
113
|
-
* contract: "ContractAddr...", // Contract to accept
|
|
114
|
-
* duration: { days: 7 } // 7 days rental duration
|
|
115
|
-
* // borrowerFaction auto-resolved from fleet account
|
|
116
|
-
* });
|
|
117
|
-
*
|
|
118
|
-
* // Different duration formats
|
|
119
|
-
* const hourlyRental = await acceptRental({
|
|
120
|
-
* borrower: wallet,
|
|
121
|
-
* borrowerProfile: "ProfileAddr...",
|
|
122
|
-
* contract: "ContractAddr...",
|
|
123
|
-
* duration: { hours: 12 } // 12 hours
|
|
124
|
-
* });
|
|
125
|
-
*
|
|
126
|
-
* const weeklyRental = await acceptRental({
|
|
127
|
-
* borrower: wallet,
|
|
128
|
-
* borrowerProfile: "ProfileAddr...",
|
|
129
|
-
* contract: "ContractAddr...",
|
|
130
|
-
* duration: { weeks: 2 } // 2 weeks
|
|
131
|
-
* });
|
|
132
|
-
*
|
|
133
|
-
* const monthlyRental = await acceptRental({
|
|
134
|
-
* borrower: wallet,
|
|
135
|
-
* borrowerProfile: "ProfileAddr...",
|
|
136
|
-
* contract: "ContractAddr...",
|
|
137
|
-
* duration: { months: 1 } // 1 month
|
|
138
|
-
* });
|
|
139
|
-
*
|
|
140
|
-
* // Backwards compatible - raw seconds
|
|
141
|
-
* const legacyRental = await acceptRental({
|
|
142
|
-
* borrower: wallet,
|
|
143
|
-
* borrowerProfile: "ProfileAddr...",
|
|
144
|
-
* contract: "ContractAddr...",
|
|
145
|
-
* duration: 604800 // 7 days in seconds
|
|
146
|
-
* });
|
|
147
|
-
*
|
|
148
|
-
* // Manual faction specification (optional)
|
|
149
|
-
* const manualInstruction = await acceptRental({
|
|
150
|
-
* borrower: wallet.publicKey.toString(), // Address string for browser
|
|
151
|
-
* borrowerProfile: "ProfileAddr...", // Borrower's Star Atlas profile
|
|
152
|
-
* borrowerFaction: 'mud', // Optional: 'mud', 'oni', or 'ustur'
|
|
153
|
-
* contract: "ContractAddr...", // Contract to accept
|
|
154
|
-
* duration: { days: 7 } // 7 days rental duration
|
|
155
|
-
* });
|
|
156
|
-
*
|
|
157
|
-
* // Configure for mainnet
|
|
158
|
-
* const mainnetInstruction = await acceptRental({
|
|
159
|
-
* borrower: wallet, // Wallet object (CLI style)
|
|
160
|
-
* borrowerProfile: "ProfileAddr...",
|
|
161
|
-
* borrowerFaction: 1, // Can use numbers: 1=mud, 2=oni, 3=ustur
|
|
162
|
-
* contract: "ContractAddr...",
|
|
163
|
-
* duration: { days: 7 }
|
|
164
|
-
* }).set({ programs: 'mainnet' });
|
|
165
|
-
*
|
|
166
|
-
* // Use with your preferred Solana library
|
|
167
|
-
* const transaction = new Transaction().add(mainnetInstruction);
|
|
168
|
-
* await sendAndConfirmTransaction(connection, transaction, [wallet]);
|
|
169
|
-
* ```
|
|
170
|
-
*
|
|
171
|
-
* @param params - The rental acceptance parameters including borrower, contract, and duration
|
|
172
|
-
* @returns A SmartFluentConfigSelector that can be configured with .set() or awaited directly
|
|
173
|
-
* @throws Error when contract is not found, duration constraints are violated, or payment calculation fails
|
|
174
|
-
*/
|
|
175
|
-
export declare function acceptRental(params: AcceptRentalParams): SmartFluentConfigSelector<FluentInstruction>;
|
|
176
|
-
/**
|
|
177
|
-
* Low-level function to create a rental acceptance instruction with raw input parameters.
|
|
178
|
-
*
|
|
179
|
-
* This function provides direct access to the underlying codama-generated instruction
|
|
180
|
-
* builder. It's primarily used internally by the SDK but can be used for advanced
|
|
181
|
-
* use cases where full control over instruction parameters is needed.
|
|
182
|
-
*
|
|
183
|
-
* @internal
|
|
184
|
-
* @param input - Raw instruction input parameters as expected by codama
|
|
185
|
-
* @param options - Optional instruction options including program address
|
|
186
|
-
* @returns A SdkConfigSelector for the raw instruction
|
|
187
|
-
*/
|
|
188
|
-
export declare function getAcceptRentalInstructionAsync(input: any, options?: any): SdkConfigSelector<any>;
|
|
189
|
-
export declare const acceptRentalDemo: {
|
|
190
|
-
tabName: string;
|
|
191
|
-
description: string;
|
|
192
|
-
imports: string;
|
|
193
|
-
instruction: string;
|
|
194
|
-
};
|
|
195
|
-
export {};
|
|
196
|
-
//# sourceMappingURL=accept.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accept.d.ts","sourceRoot":"","sources":["../../../src/rental/accept.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAG/B;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B;;;OAGG;IACH,eAAe,EAAE,gBAAgB,CAAC;IAElC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC;;;;;;;;OAQG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;;;;;;OAOG;IACH,QAAQ,EAAE,aAAa,CAAC;CACzB;AAmID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmHG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,kBAAkB,GACzB,yBAAyB,CAAC,iBAAiB,CAAC,CAG9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAKjG;AAGD,eAAO,MAAM,gBAAgB;;;;;CAU5B,CAAC"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @purpose Rental cancellation with penalty processing and thread cleanup
|
|
3
|
-
* @reviewed 2025-07-29
|
|
4
|
-
*/
|
|
5
|
-
import { type SdkConfigSelector } from '../utils/config';
|
|
6
|
-
import { type UniversalSigner } from '../utils/signer';
|
|
7
|
-
import { type FluentInstruction, type SmartFluentConfigSelector } from '../utils/instruction-converter';
|
|
8
|
-
type UniversalAddress = string;
|
|
9
|
-
/**
|
|
10
|
-
* Parameters for canceling an active rental.
|
|
11
|
-
*
|
|
12
|
-
* This interface defines the required parameters for a borrower to cancel their
|
|
13
|
-
* active rental. Canceling a rental stops automated payments but typically
|
|
14
|
-
* incurs a penalty fee as defined in the contract terms.
|
|
15
|
-
*
|
|
16
|
-
* You can provide either the contract address OR the rental state address.
|
|
17
|
-
* If both are provided, rental takes priority.
|
|
18
|
-
*
|
|
19
|
-
* @interface CancelRentalParams
|
|
20
|
-
*/
|
|
21
|
-
export interface CancelRentalParams {
|
|
22
|
-
/**
|
|
23
|
-
* The borrower who wants to cancel the rental (signer object or base58 string address).
|
|
24
|
-
* Must be the original borrower who accepted the rental contract.
|
|
25
|
-
* This account will pay any cancellation penalties.
|
|
26
|
-
* Can be a wallet/signer object (CLI usage) or base58 address string (browser usage).
|
|
27
|
-
*/
|
|
28
|
-
borrower: UniversalSigner;
|
|
29
|
-
/**
|
|
30
|
-
* String address of the rental contract associated with the active rental.
|
|
31
|
-
* The rental state for this contract will be canceled and automated payments stopped.
|
|
32
|
-
*
|
|
33
|
-
* Either this OR rental must be provided. If both are provided, rental takes priority.
|
|
34
|
-
*/
|
|
35
|
-
contract?: UniversalAddress;
|
|
36
|
-
/**
|
|
37
|
-
* String address of the rental state account to cancel.
|
|
38
|
-
* This is an alternative to providing the contract address - the SDK will
|
|
39
|
-
* fetch the rental state to determine the associated contract.
|
|
40
|
-
*
|
|
41
|
-
* Either this OR contract must be provided. If both are provided, this takes priority.
|
|
42
|
-
*/
|
|
43
|
-
rental?: UniversalAddress;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Creates an instruction to cancel a rental with fluent configuration.
|
|
47
|
-
*
|
|
48
|
-
* This function allows a borrower to cancel their active rental before the
|
|
49
|
-
* rental period expires. Canceling a rental stops automated payments but
|
|
50
|
-
* may incur penalty fees as defined in the contract terms. The fleet ownership
|
|
51
|
-
* is immediately returned to the original owner.
|
|
52
|
-
*
|
|
53
|
-
* ## Features
|
|
54
|
-
*
|
|
55
|
-
* - **Immediate Cancellation**: Stops the rental and automated payments immediately
|
|
56
|
-
* - **Fleet Transfer**: Returns fleet control to the original owner
|
|
57
|
-
* - **Thread Cleanup**: Cancels the automated payment thread
|
|
58
|
-
* - **Penalty Processing**: Handles any cancellation fees as defined in the contract
|
|
59
|
-
* - **Universal Library Support**: Works with both @solana/kit and @solana/web3.js
|
|
60
|
-
*
|
|
61
|
-
* ## Process
|
|
62
|
-
*
|
|
63
|
-
* 1. **Validate Authority**: Ensures only the borrower can cancel their rental
|
|
64
|
-
* 2. **Calculate Penalties**: Computes any cancellation fees owed
|
|
65
|
-
* 3. **Transfer Fleet**: Returns fleet ownership to the original owner
|
|
66
|
-
* 4. **Cancel Thread**: Stops automated payment processing
|
|
67
|
-
* 5. **Update State**: Marks rental as canceled in the rental state account
|
|
68
|
-
*
|
|
69
|
-
* ## Requirements
|
|
70
|
-
*
|
|
71
|
-
* - Rental must be active (not already canceled or completed)
|
|
72
|
-
* - Caller must be the original borrower
|
|
73
|
-
* - Borrower must have sufficient funds for any cancellation penalties
|
|
74
|
-
*
|
|
75
|
-
* ## Cancellation Effects
|
|
76
|
-
*
|
|
77
|
-
* - **Fleet Control**: Immediately returned to owner
|
|
78
|
-
* - **Automated Payments**: Stopped permanently
|
|
79
|
-
* - **Rental State**: Marked as canceled
|
|
80
|
-
* - **Thread Account**: Cleaned up and closed
|
|
81
|
-
* - **Penalties**: Charged according to contract terms
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```typescript
|
|
85
|
-
* import { cancelRental } from '@srsly/sdk';
|
|
86
|
-
*
|
|
87
|
-
* // Cancel rental using contract address
|
|
88
|
-
* const instruction = await cancelRental({
|
|
89
|
-
* borrower: wallet,
|
|
90
|
-
* contract: "ContractAddr..."
|
|
91
|
-
* });
|
|
92
|
-
*
|
|
93
|
-
* // Cancel rental using rental state address (alternative approach)
|
|
94
|
-
* const instruction2 = await cancelRental({
|
|
95
|
-
* borrower: wallet,
|
|
96
|
-
* rental: "RentalStateAddr..."
|
|
97
|
-
* });
|
|
98
|
-
*
|
|
99
|
-
* // Configure for mainnet
|
|
100
|
-
* const mainnetInstruction = await cancelRental({
|
|
101
|
-
* borrower: wallet,
|
|
102
|
-
* contract: "ContractAddr..."
|
|
103
|
-
* }).set({ programs: 'mainnet' });
|
|
104
|
-
*
|
|
105
|
-
* // Convert to @solana/web3.js format
|
|
106
|
-
* const web3jsInstruction = await cancelRental({
|
|
107
|
-
* borrower: wallet,
|
|
108
|
-
* rental: "RentalStateAddr..."
|
|
109
|
-
* }).web3js();
|
|
110
|
-
*
|
|
111
|
-
* // Use with your preferred Solana library
|
|
112
|
-
* const transaction = new Transaction().add(web3jsInstruction);
|
|
113
|
-
* await sendAndConfirmTransaction(connection, transaction, [wallet]);
|
|
114
|
-
* ```
|
|
115
|
-
*
|
|
116
|
-
* @param params - The rental cancellation parameters including borrower and either contract or rentalState
|
|
117
|
-
* @returns A SmartFluentConfigSelector that can be configured with .set() or awaited directly
|
|
118
|
-
* @throws Error when rental is not active, caller is not the borrower, or instruction generation fails
|
|
119
|
-
*/
|
|
120
|
-
export declare function cancelRental(params: CancelRentalParams): SmartFluentConfigSelector<FluentInstruction>;
|
|
121
|
-
/**
|
|
122
|
-
* Low-level function to create a rental cancellation instruction with raw input parameters.
|
|
123
|
-
*
|
|
124
|
-
* This function provides direct access to the underlying codama-generated instruction
|
|
125
|
-
* builder. It's primarily used internally by the SDK but can be used for advanced
|
|
126
|
-
* use cases where full control over instruction parameters is needed.
|
|
127
|
-
*
|
|
128
|
-
* @internal
|
|
129
|
-
* @param input - Raw instruction input parameters as expected by codama
|
|
130
|
-
* @param options - Optional instruction options including program address
|
|
131
|
-
* @returns A SdkConfigSelector for the raw instruction
|
|
132
|
-
*/
|
|
133
|
-
export declare function getCancelRentalInstructionAsync(input: any, options?: any): SdkConfigSelector<any>;
|
|
134
|
-
export declare const cancelRentalDemo: {
|
|
135
|
-
tabName: string;
|
|
136
|
-
description: string;
|
|
137
|
-
imports: string;
|
|
138
|
-
instruction: string;
|
|
139
|
-
};
|
|
140
|
-
export {};
|
|
141
|
-
//# sourceMappingURL=cancel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../../src/rental/cancel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,gCAAgC,CAAC;AAMxC,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAE/B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAE5B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AA0FD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,kBAAkB,GACzB,yBAAyB,CAAC,iBAAiB,CAAC,CAG9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAKjG;AAGD,eAAO,MAAM,gBAAgB;;;;;CAQ5B,CAAC"}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @purpose Rental closure with fund transfer and thread cleanup
|
|
3
|
-
* @reviewed 2025-07-29
|
|
4
|
-
*/
|
|
5
|
-
import { type SdkConfigSelector } from '../utils/config';
|
|
6
|
-
import { type FluentInstruction, type SmartFluentConfigSelector } from '../utils/instruction-converter';
|
|
7
|
-
import { type UniversalSigner } from '../utils/signer';
|
|
8
|
-
type UniversalAddress = string;
|
|
9
|
-
/**
|
|
10
|
-
* Parameters for closing a completed rental.
|
|
11
|
-
*
|
|
12
|
-
* This interface defines the required parameters for closing a rental that has
|
|
13
|
-
* reached its expiration or been fully paid. Closing a rental finalizes the
|
|
14
|
-
* rental period, transfers any remaining funds, and cleans up the rental state.
|
|
15
|
-
*
|
|
16
|
-
* @interface CloseRentalParams
|
|
17
|
-
*/
|
|
18
|
-
export interface CloseRentalParams {
|
|
19
|
-
/**
|
|
20
|
-
* The payer for transaction fees (must be a signer object).
|
|
21
|
-
* This account will pay for the transaction fee
|
|
22
|
-
*/
|
|
23
|
-
payer: UniversalSigner;
|
|
24
|
-
/**
|
|
25
|
-
* String address of the rental state to close.
|
|
26
|
-
* This is the unique rental state account that tracks the rental.
|
|
27
|
-
*/
|
|
28
|
-
rental: UniversalAddress;
|
|
29
|
-
/**
|
|
30
|
-
* The borrower's Star Atlas profile address. Required for version 0 rentals.
|
|
31
|
-
* For version 1+ rentals, this is stored in the rental state.
|
|
32
|
-
*/
|
|
33
|
-
borrowerProfile: UniversalAddress;
|
|
34
|
-
/**
|
|
35
|
-
* Optional borrower faction (1/2/3 or 'mud'/'oni'/'ustur'). If not provided, will be fetched from fleet.
|
|
36
|
-
* Only needed for version 0 rentals.
|
|
37
|
-
*/
|
|
38
|
-
borrowerFaction?: number | string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Creates an instruction to close a completed rental with fluent configuration.
|
|
42
|
-
*
|
|
43
|
-
* This function finalizes a rental that has reached its expiration or been fully paid.
|
|
44
|
-
* It transfers any remaining funds to the owner, returns fleet control, and cleans up
|
|
45
|
-
* the rental state account. This instruction can be called by anyone once the rental
|
|
46
|
-
* period has ended.
|
|
47
|
-
*
|
|
48
|
-
* ## Features
|
|
49
|
-
*
|
|
50
|
-
* - **Rental Finalization**: Properly closes completed or expired rentals
|
|
51
|
-
* - **Fund Transfer**: Moves any remaining payments or deposits to the owner
|
|
52
|
-
* - **Fleet Return**: Ensures fleet ownership is returned to the original owner
|
|
53
|
-
* - **State Cleanup**: Closes rental state account and returns lamports
|
|
54
|
-
* - **Thread Cleanup**: Cleans up automated payment threads
|
|
55
|
-
* - **Universal Library Support**: Works with both @solana/kit and @solana/web3.js
|
|
56
|
-
*
|
|
57
|
-
* ## Process
|
|
58
|
-
*
|
|
59
|
-
* 1. **Validate Completion**: Ensures rental period has ended or been fully paid
|
|
60
|
-
* 2. **Transfer Funds**: Moves any remaining ATLAS tokens to owner's account
|
|
61
|
-
* 3. **Return Fleet**: Transfers fleet ownership back to original owner
|
|
62
|
-
* 4. **Clean State**: Closes rental state account and returns SOL to payer
|
|
63
|
-
* 5. **Cancel Thread**: Cleans up any remaining automated payment threads
|
|
64
|
-
*
|
|
65
|
-
* ## Requirements
|
|
66
|
-
*
|
|
67
|
-
* - Rental must be completed or expired
|
|
68
|
-
* - Owner token account must be valid ATLAS token account
|
|
69
|
-
* - Rental state account must exist and be properly initialized
|
|
70
|
-
*
|
|
71
|
-
* ## When to Use
|
|
72
|
-
*
|
|
73
|
-
* - **Natural Expiration**: When rental period has ended
|
|
74
|
-
* - **Full Payment**: When all required payments have been made
|
|
75
|
-
* - **Account Cleanup**: To close expired rental accounts and recover SOL
|
|
76
|
-
* - **Fleet Recovery**: When fleet needs to be returned to owner
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```typescript
|
|
80
|
-
* import { closeRental } from '@srsly/sdk';
|
|
81
|
-
*
|
|
82
|
-
* // Close a completed rental
|
|
83
|
-
* const instruction = await closeRental({
|
|
84
|
-
* payer: wallet, // Transaction payer
|
|
85
|
-
* rental: "RentalState..." // Rental state address
|
|
86
|
-
* });
|
|
87
|
-
*
|
|
88
|
-
* // Configure for mainnet
|
|
89
|
-
* const mainnetInstruction = await closeRental({
|
|
90
|
-
* payer: wallet,
|
|
91
|
-
* rental: "RentalState..."
|
|
92
|
-
* }).set({ programs: 'mainnet' });
|
|
93
|
-
*
|
|
94
|
-
* // Convert to @solana/web3.js format
|
|
95
|
-
* const web3jsInstruction = await closeRental({
|
|
96
|
-
* payer: wallet,
|
|
97
|
-
* rental: "RentalState..."
|
|
98
|
-
* }).web3js(PublicKey);
|
|
99
|
-
*
|
|
100
|
-
* // Use with your preferred Solana library
|
|
101
|
-
* const transaction = new Transaction().add(web3jsInstruction);
|
|
102
|
-
* await sendAndConfirmTransaction(connection, transaction, [wallet]);
|
|
103
|
-
* ```
|
|
104
|
-
*
|
|
105
|
-
* @param params - The rental closure parameters including payer and rental state address
|
|
106
|
-
* @returns A FluentConfigSelector that can be configured with .set() or awaited directly
|
|
107
|
-
* @throws Error when rental is not ready for closure or instruction generation fails
|
|
108
|
-
*/
|
|
109
|
-
export declare function closeRental(params: CloseRentalParams): SmartFluentConfigSelector<FluentInstruction>;
|
|
110
|
-
/**
|
|
111
|
-
* Low-level function to create a rental closure instruction with raw input parameters.
|
|
112
|
-
*
|
|
113
|
-
* This function provides direct access to the underlying codama-generated instruction
|
|
114
|
-
* builder. It's primarily used internally by the SDK but can be used for advanced
|
|
115
|
-
* use cases where full control over instruction parameters is needed.
|
|
116
|
-
*
|
|
117
|
-
* @internal
|
|
118
|
-
* @param input - Raw instruction input parameters as expected by codama
|
|
119
|
-
* @param options - Optional instruction options including program address
|
|
120
|
-
* @returns A SdkConfigSelector for the raw instruction
|
|
121
|
-
*/
|
|
122
|
-
export declare function getCloseRentalInstructionAsync(input: any, options?: any): SdkConfigSelector<any>;
|
|
123
|
-
export declare const closeRentalDemo: {
|
|
124
|
-
tabName: string;
|
|
125
|
-
description: string;
|
|
126
|
-
imports: string;
|
|
127
|
-
instruction: string;
|
|
128
|
-
};
|
|
129
|
-
export {};
|
|
130
|
-
//# sourceMappingURL=close.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../src/rental/close.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGhF,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAE/B;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB;;;OAGG;IACH,MAAM,EAAE,gBAAgB,CAAC;IAEzB;;;OAGG;IACH,eAAe,EAAE,gBAAgB,CAAC;IAElC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACnC;AAiGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,GACxB,yBAAyB,CAAC,iBAAiB,CAAC,CAG9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAKhG;AAGD,eAAO,MAAM,eAAe;;;;;CAQ3B,CAAC"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @purpose Rental operations module with accept, cancel, close, and reset functionality
|
|
3
|
-
* @reviewed 2025-07-29
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* # Rental Operations Module
|
|
7
|
-
*
|
|
8
|
-
* This module provides comprehensive functionality for managing rental operations
|
|
9
|
-
* on the SRSLY program. It includes functions for accepting, canceling, closing,
|
|
10
|
-
* and resetting rentals, with full support for both @solana/kit and @solana/web3.js libraries.
|
|
11
|
-
*
|
|
12
|
-
* ## Available Functions
|
|
13
|
-
*
|
|
14
|
-
* - **acceptRental**: Accept an existing rental contract as a borrower
|
|
15
|
-
* - **cancelRental**: Cancel an active rental before completion
|
|
16
|
-
* - **closeRental**: Close a completed or expired rental
|
|
17
|
-
* - **resetRental**: Reset a canceled rental to make the contract available again
|
|
18
|
-
*
|
|
19
|
-
* ## Rental Lifecycle
|
|
20
|
-
*
|
|
21
|
-
* ```text
|
|
22
|
-
* Contract Created → Accept → [Active Rental] → Close (Complete)
|
|
23
|
-
* ↓ ↓
|
|
24
|
-
* [Payment] Cancel → Reset → [Available Again]
|
|
25
|
-
* ↑ ↓
|
|
26
|
-
* [Automated] [Cleanup]
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* ## Features
|
|
30
|
-
*
|
|
31
|
-
* - **Universal Library Support**: Works with both major Solana libraries
|
|
32
|
-
* - **String-Based Addresses**: Eliminates library-specific type conflicts
|
|
33
|
-
* - **Fluent API**: Chainable configuration and format conversion
|
|
34
|
-
* - **Network Agnostic**: Supports different Solana networks
|
|
35
|
-
* - **Automated Payments**: Integration with Clockwork for scheduled payments
|
|
36
|
-
* - **SAGE Integration**: Fleet ownership management in Star Atlas ecosystem
|
|
37
|
-
*
|
|
38
|
-
* ## Common Patterns
|
|
39
|
-
*
|
|
40
|
-
* ### Accept a Rental
|
|
41
|
-
* ```typescript
|
|
42
|
-
* import { acceptRental } from '@srsly/sdk';
|
|
43
|
-
*
|
|
44
|
-
* const instruction = await acceptRental({
|
|
45
|
-
* borrower: wallet,
|
|
46
|
-
* borrowerProfile: "ProfileAddr...",
|
|
47
|
-
* contract: "ContractAddr...",
|
|
48
|
-
* duration: { days: 7 } // Smart parameter format
|
|
49
|
-
* });
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* ### Cancel Active Rental
|
|
53
|
-
* ```typescript
|
|
54
|
-
* import { cancelRental } from '@srsly/sdk';
|
|
55
|
-
*
|
|
56
|
-
* const instruction = await cancelRental({
|
|
57
|
-
* borrower: wallet,
|
|
58
|
-
* contract: "ContractAddr..."
|
|
59
|
-
* });
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* ### Close Completed Rental
|
|
63
|
-
* ```typescript
|
|
64
|
-
* import { closeRental } from '@srsly/sdk';
|
|
65
|
-
*
|
|
66
|
-
* const instruction = await closeRental({
|
|
67
|
-
* payer: wallet,
|
|
68
|
-
* rental: "RentalStateAddr..."
|
|
69
|
-
* });
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
|
-
* ### Reset Canceled Rental
|
|
73
|
-
* ```typescript
|
|
74
|
-
* import { resetRental } from '@srsly/sdk';
|
|
75
|
-
*
|
|
76
|
-
* const instruction = await resetRental({
|
|
77
|
-
* payer: wallet,
|
|
78
|
-
* contract: "ContractAddr..."
|
|
79
|
-
* // fleet, rental, faction, ownerProfile auto-fetched if not provided
|
|
80
|
-
* });
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* @module Rental
|
|
84
|
-
*/
|
|
85
|
-
export * from './accept';
|
|
86
|
-
export * from './cancel';
|
|
87
|
-
export * from './close';
|
|
88
|
-
export * from './reset';
|
|
89
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rental/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|