@wuwei-labs/srsly 1.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 +33 -0
- package/dist/cjs/codama/accounts/contractState.js +92 -0
- package/dist/cjs/codama/accounts/contractState.js.map +1 -0
- package/dist/cjs/codama/accounts/fleet.js +77 -0
- package/dist/cjs/codama/accounts/fleet.js.map +1 -0
- package/dist/cjs/codama/accounts/index.js +28 -0
- package/dist/cjs/codama/accounts/index.js.map +1 -0
- package/dist/cjs/codama/accounts/rentalState.js +85 -0
- package/dist/cjs/codama/accounts/rentalState.js.map +1 -0
- package/dist/cjs/codama/accounts/thread.js +89 -0
- package/dist/cjs/codama/accounts/thread.js.map +1 -0
- package/dist/cjs/codama/errors/index.js +25 -0
- package/dist/cjs/codama/errors/index.js.map +1 -0
- package/dist/cjs/codama/errors/srsly.js +71 -0
- package/dist/cjs/codama/errors/srsly.js.map +1 -0
- package/dist/cjs/codama/index.js +29 -0
- package/dist/cjs/codama/index.js.map +1 -0
- package/dist/cjs/codama/instructions/acceptRental.js +363 -0
- package/dist/cjs/codama/instructions/acceptRental.js.map +1 -0
- package/dist/cjs/codama/instructions/cancelRental.js +225 -0
- package/dist/cjs/codama/instructions/cancelRental.js.map +1 -0
- package/dist/cjs/codama/instructions/closeContract.js +219 -0
- package/dist/cjs/codama/instructions/closeContract.js.map +1 -0
- package/dist/cjs/codama/instructions/closeRental.js +233 -0
- package/dist/cjs/codama/instructions/closeRental.js.map +1 -0
- package/dist/cjs/codama/instructions/createContract.js +261 -0
- package/dist/cjs/codama/instructions/createContract.js.map +1 -0
- package/dist/cjs/codama/instructions/index.js +32 -0
- package/dist/cjs/codama/instructions/index.js.map +1 -0
- package/dist/cjs/codama/instructions/normalizeAdmin.js +152 -0
- package/dist/cjs/codama/instructions/normalizeAdmin.js.map +1 -0
- package/dist/cjs/codama/instructions/payRental.js +236 -0
- package/dist/cjs/codama/instructions/payRental.js.map +1 -0
- package/dist/cjs/codama/instructions/resetRental.js +155 -0
- package/dist/cjs/codama/instructions/resetRental.js.map +1 -0
- package/dist/cjs/codama/programs/index.js +25 -0
- package/dist/cjs/codama/programs/index.js.map +1 -0
- package/dist/cjs/codama/programs/srsly.js +77 -0
- package/dist/cjs/codama/programs/srsly.js.map +1 -0
- package/dist/cjs/codama/shared/index.js +95 -0
- package/dist/cjs/codama/shared/index.js.map +1 -0
- package/dist/cjs/codama/types/clockData.js +31 -0
- package/dist/cjs/codama/types/clockData.js.map +1 -0
- package/dist/cjs/codama/types/equality.js +30 -0
- package/dist/cjs/codama/types/equality.js.map +1 -0
- package/dist/cjs/codama/types/execContext.js +38 -0
- package/dist/cjs/codama/types/execContext.js.map +1 -0
- package/dist/cjs/codama/types/index.js +33 -0
- package/dist/cjs/codama/types/index.js.map +1 -0
- package/dist/cjs/codama/types/paymentFrequency.js +34 -0
- package/dist/cjs/codama/types/paymentFrequency.js.map +1 -0
- package/dist/cjs/codama/types/serializableAccount.js +31 -0
- package/dist/cjs/codama/types/serializableAccount.js.map +1 -0
- package/dist/cjs/codama/types/serializableInstruction.js +32 -0
- package/dist/cjs/codama/types/serializableInstruction.js.map +1 -0
- package/dist/cjs/codama/types/threadResponse.js +38 -0
- package/dist/cjs/codama/types/threadResponse.js.map +1 -0
- package/dist/cjs/codama/types/trigger.js +90 -0
- package/dist/cjs/codama/types/trigger.js.map +1 -0
- package/dist/cjs/codama/types/triggerContext.js +49 -0
- package/dist/cjs/codama/types/triggerContext.js.map +1 -0
- package/dist/cjs/contract/close.js +48 -0
- package/dist/cjs/contract/close.js.map +1 -0
- package/dist/cjs/contract/create.js +49 -0
- package/dist/cjs/contract/create.js.map +1 -0
- package/dist/cjs/contract/index.js +19 -0
- package/dist/cjs/contract/index.js.map +1 -0
- package/dist/cjs/index.js +19 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/rental/accept.js +53 -0
- package/dist/cjs/rental/accept.js.map +1 -0
- package/dist/cjs/rental/cancel.js +37 -0
- package/dist/cjs/rental/cancel.js.map +1 -0
- package/dist/cjs/rental/close.js +39 -0
- package/dist/cjs/rental/close.js.map +1 -0
- package/dist/cjs/rental/index.js +21 -0
- package/dist/cjs/rental/index.js.map +1 -0
- package/dist/cjs/rental/reset.js +56 -0
- package/dist/cjs/rental/reset.js.map +1 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils/constants.js +34 -0
- package/dist/cjs/utils/constants.js.map +1 -0
- package/dist/cjs/utils/index.js +19 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/profiles.js +139 -0
- package/dist/cjs/utils/profiles.js.map +1 -0
- package/dist/esm/codama/accounts/contractState.js +79 -0
- package/dist/esm/codama/accounts/contractState.js.map +1 -0
- package/dist/esm/codama/accounts/fleet.js +64 -0
- package/dist/esm/codama/accounts/fleet.js.map +1 -0
- package/dist/esm/codama/accounts/index.js +12 -0
- package/dist/esm/codama/accounts/index.js.map +1 -0
- package/dist/esm/codama/accounts/rentalState.js +72 -0
- package/dist/esm/codama/accounts/rentalState.js.map +1 -0
- package/dist/esm/codama/accounts/thread.js +77 -0
- package/dist/esm/codama/accounts/thread.js.map +1 -0
- package/dist/esm/codama/errors/index.js +9 -0
- package/dist/esm/codama/errors/index.js.map +1 -0
- package/dist/esm/codama/errors/srsly.js +66 -0
- package/dist/esm/codama/errors/srsly.js.map +1 -0
- package/dist/esm/codama/index.js +13 -0
- package/dist/esm/codama/index.js.map +1 -0
- package/dist/esm/codama/instructions/acceptRental.js +353 -0
- package/dist/esm/codama/instructions/acceptRental.js.map +1 -0
- package/dist/esm/codama/instructions/cancelRental.js +215 -0
- package/dist/esm/codama/instructions/cancelRental.js.map +1 -0
- package/dist/esm/codama/instructions/closeContract.js +209 -0
- package/dist/esm/codama/instructions/closeContract.js.map +1 -0
- package/dist/esm/codama/instructions/closeRental.js +223 -0
- package/dist/esm/codama/instructions/closeRental.js.map +1 -0
- package/dist/esm/codama/instructions/createContract.js +251 -0
- package/dist/esm/codama/instructions/createContract.js.map +1 -0
- package/dist/esm/codama/instructions/index.js +16 -0
- package/dist/esm/codama/instructions/index.js.map +1 -0
- package/dist/esm/codama/instructions/normalizeAdmin.js +142 -0
- package/dist/esm/codama/instructions/normalizeAdmin.js.map +1 -0
- package/dist/esm/codama/instructions/payRental.js +226 -0
- package/dist/esm/codama/instructions/payRental.js.map +1 -0
- package/dist/esm/codama/instructions/resetRental.js +145 -0
- package/dist/esm/codama/instructions/resetRental.js.map +1 -0
- package/dist/esm/codama/programs/index.js +9 -0
- package/dist/esm/codama/programs/index.js.map +1 -0
- package/dist/esm/codama/programs/srsly.js +72 -0
- package/dist/esm/codama/programs/srsly.js.map +1 -0
- package/dist/esm/codama/shared/index.js +87 -0
- package/dist/esm/codama/shared/index.js.map +1 -0
- package/dist/esm/codama/types/clockData.js +26 -0
- package/dist/esm/codama/types/clockData.js.map +1 -0
- package/dist/esm/codama/types/equality.js +24 -0
- package/dist/esm/codama/types/equality.js.map +1 -0
- package/dist/esm/codama/types/execContext.js +33 -0
- package/dist/esm/codama/types/execContext.js.map +1 -0
- package/dist/esm/codama/types/index.js +17 -0
- package/dist/esm/codama/types/index.js.map +1 -0
- package/dist/esm/codama/types/paymentFrequency.js +28 -0
- package/dist/esm/codama/types/paymentFrequency.js.map +1 -0
- package/dist/esm/codama/types/serializableAccount.js +26 -0
- package/dist/esm/codama/types/serializableAccount.js.map +1 -0
- package/dist/esm/codama/types/serializableInstruction.js +27 -0
- package/dist/esm/codama/types/serializableInstruction.js.map +1 -0
- package/dist/esm/codama/types/threadResponse.js +33 -0
- package/dist/esm/codama/types/threadResponse.js.map +1 -0
- package/dist/esm/codama/types/trigger.js +83 -0
- package/dist/esm/codama/types/trigger.js.map +1 -0
- package/dist/esm/codama/types/triggerContext.js +42 -0
- package/dist/esm/codama/types/triggerContext.js.map +1 -0
- package/dist/esm/contract/close.js +44 -0
- package/dist/esm/contract/close.js.map +1 -0
- package/dist/esm/contract/create.js +45 -0
- package/dist/esm/contract/create.js.map +1 -0
- package/dist/esm/contract/index.js +3 -0
- package/dist/esm/contract/index.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/rental/accept.js +49 -0
- package/dist/esm/rental/accept.js.map +1 -0
- package/dist/esm/rental/cancel.js +33 -0
- package/dist/esm/rental/cancel.js.map +1 -0
- package/dist/esm/rental/close.js +35 -0
- package/dist/esm/rental/close.js.map +1 -0
- package/dist/esm/rental/index.js +5 -0
- package/dist/esm/rental/index.js.map +1 -0
- package/dist/esm/rental/reset.js +52 -0
- package/dist/esm/rental/reset.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/constants.js +30 -0
- package/dist/esm/utils/constants.js.map +1 -0
- package/dist/esm/utils/index.js +3 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/profiles.js +132 -0
- package/dist/esm/utils/profiles.js.map +1 -0
- package/dist/types/codama/accounts/contractState.d.ts +53 -0
- package/dist/types/codama/accounts/contractState.d.ts.map +1 -0
- package/dist/types/codama/accounts/fleet.d.ts +38 -0
- package/dist/types/codama/accounts/fleet.d.ts.map +1 -0
- package/dist/types/codama/accounts/index.d.ts +12 -0
- package/dist/types/codama/accounts/index.d.ts.map +1 -0
- package/dist/types/codama/accounts/rentalState.d.ts +46 -0
- package/dist/types/codama/accounts/rentalState.d.ts.map +1 -0
- package/dist/types/codama/accounts/thread.d.ts +74 -0
- package/dist/types/codama/accounts/thread.d.ts.map +1 -0
- package/dist/types/codama/errors/index.d.ts +9 -0
- package/dist/types/codama/errors/index.d.ts.map +1 -0
- package/dist/types/codama/errors/srsly.d.ts +48 -0
- package/dist/types/codama/errors/srsly.d.ts.map +1 -0
- package/dist/types/codama/index.d.ts +13 -0
- package/dist/types/codama/index.d.ts.map +1 -0
- package/dist/types/codama/instructions/acceptRental.d.ts +128 -0
- package/dist/types/codama/instructions/acceptRental.d.ts.map +1 -0
- package/dist/types/codama/instructions/cancelRental.d.ts +71 -0
- package/dist/types/codama/instructions/cancelRental.d.ts.map +1 -0
- package/dist/types/codama/instructions/closeContract.d.ts +96 -0
- package/dist/types/codama/instructions/closeContract.d.ts.map +1 -0
- package/dist/types/codama/instructions/closeRental.d.ts +79 -0
- package/dist/types/codama/instructions/closeRental.d.ts.map +1 -0
- package/dist/types/codama/instructions/createContract.d.ts +108 -0
- package/dist/types/codama/instructions/createContract.d.ts.map +1 -0
- package/dist/types/codama/instructions/index.d.ts +16 -0
- package/dist/types/codama/instructions/index.d.ts.map +1 -0
- package/dist/types/codama/instructions/normalizeAdmin.d.ts +67 -0
- package/dist/types/codama/instructions/normalizeAdmin.d.ts.map +1 -0
- package/dist/types/codama/instructions/payRental.d.ts +99 -0
- package/dist/types/codama/instructions/payRental.d.ts.map +1 -0
- package/dist/types/codama/instructions/resetRental.d.ts +71 -0
- package/dist/types/codama/instructions/resetRental.d.ts.map +1 -0
- package/dist/types/codama/programs/index.d.ts +9 -0
- package/dist/types/codama/programs/index.d.ts.map +1 -0
- package/dist/types/codama/programs/srsly.d.ts +50 -0
- package/dist/types/codama/programs/srsly.d.ts.map +1 -0
- package/dist/types/codama/shared/index.d.ts +50 -0
- package/dist/types/codama/shared/index.d.ts.map +1 -0
- package/dist/types/codama/types/clockData.d.ts +29 -0
- package/dist/types/codama/types/clockData.d.ts.map +1 -0
- package/dist/types/codama/types/equality.d.ts +18 -0
- package/dist/types/codama/types/equality.d.ts.map +1 -0
- package/dist/types/codama/types/execContext.d.ts +48 -0
- package/dist/types/codama/types/execContext.d.ts.map +1 -0
- package/dist/types/codama/types/index.d.ts +17 -0
- package/dist/types/codama/types/index.d.ts.map +1 -0
- package/dist/types/codama/types/paymentFrequency.d.ts +22 -0
- package/dist/types/codama/types/paymentFrequency.d.ts.map +1 -0
- package/dist/types/codama/types/serializableAccount.d.ts +22 -0
- package/dist/types/codama/types/serializableAccount.d.ts.map +1 -0
- package/dist/types/codama/types/serializableInstruction.d.ts +30 -0
- package/dist/types/codama/types/serializableInstruction.d.ts.map +1 -0
- package/dist/types/codama/types/threadResponse.d.ts +42 -0
- package/dist/types/codama/types/threadResponse.d.ts.map +1 -0
- package/dist/types/codama/types/trigger.d.ts +98 -0
- package/dist/types/codama/types/trigger.d.ts.map +1 -0
- package/dist/types/codama/types/triggerContext.d.ts +75 -0
- package/dist/types/codama/types/triggerContext.d.ts.map +1 -0
- package/dist/types/contract/close.d.ts +56 -0
- package/dist/types/contract/close.d.ts.map +1 -0
- package/dist/types/contract/create.d.ts +73 -0
- package/dist/types/contract/create.d.ts.map +1 -0
- package/dist/types/contract/index.d.ts +3 -0
- package/dist/types/contract/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/rental/accept.d.ts +70 -0
- package/dist/types/rental/accept.d.ts.map +1 -0
- package/dist/types/rental/cancel.d.ts +39 -0
- package/dist/types/rental/cancel.d.ts.map +1 -0
- package/dist/types/rental/close.d.ts +44 -0
- package/dist/types/rental/close.d.ts.map +1 -0
- package/dist/types/rental/index.d.ts +5 -0
- package/dist/types/rental/index.d.ts.map +1 -0
- package/dist/types/rental/reset.d.ts +71 -0
- package/dist/types/rental/reset.d.ts.map +1 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils/constants.d.ts +21 -0
- package/dist/types/utils/constants.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/profiles.d.ts +48 -0
- package/dist/types/utils/profiles.d.ts.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Codec, type Decoder, type Encoder } from '@solana/kit';
|
|
9
|
+
export declare enum PaymentFrequency {
|
|
10
|
+
Hourly = 0,
|
|
11
|
+
Daily = 1,
|
|
12
|
+
DailyOld = 2,
|
|
13
|
+
Weekly = 3,
|
|
14
|
+
Monthly = 4,
|
|
15
|
+
Decasecond = 5,
|
|
16
|
+
Minute = 6
|
|
17
|
+
}
|
|
18
|
+
export type PaymentFrequencyArgs = PaymentFrequency;
|
|
19
|
+
export declare function getPaymentFrequencyEncoder(): Encoder<PaymentFrequencyArgs>;
|
|
20
|
+
export declare function getPaymentFrequencyDecoder(): Decoder<PaymentFrequency>;
|
|
21
|
+
export declare function getPaymentFrequencyCodec(): Codec<PaymentFrequencyArgs, PaymentFrequency>;
|
|
22
|
+
//# sourceMappingURL=paymentFrequency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paymentFrequency.d.ts","sourceRoot":"","sources":["../../../../src/codama/types/paymentFrequency.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACb,MAAM,aAAa,CAAC;AAErB,oBAAY,gBAAgB;IAC1B,MAAM,IAAA;IACN,KAAK,IAAA;IACL,QAAQ,IAAA;IACR,MAAM,IAAA;IACN,OAAO,IAAA;IACP,UAAU,IAAA;IACV,MAAM,IAAA;CACP;AAED,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAEpD,wBAAgB,0BAA0B,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAE1E;AAED,wBAAgB,0BAA0B,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAEtE;AAED,wBAAgB,wBAAwB,IAAI,KAAK,CAC/C,oBAAoB,EACpB,gBAAgB,CACjB,CAKA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Address, type Codec, type Decoder, type Encoder } from '@solana/kit';
|
|
9
|
+
/** Account metadata needed to execute an instruction on Solana. */
|
|
10
|
+
export type SerializableAccount = {
|
|
11
|
+
/** An account's public key */
|
|
12
|
+
pubkey: Address;
|
|
13
|
+
/** True if an Instruction requires a Transaction signature matching `pubkey`. */
|
|
14
|
+
isSigner: boolean;
|
|
15
|
+
/** True if the `pubkey` can be loaded as a read-write account. */
|
|
16
|
+
isWritable: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type SerializableAccountArgs = SerializableAccount;
|
|
19
|
+
export declare function getSerializableAccountEncoder(): Encoder<SerializableAccountArgs>;
|
|
20
|
+
export declare function getSerializableAccountDecoder(): Decoder<SerializableAccount>;
|
|
21
|
+
export declare function getSerializableAccountCodec(): Codec<SerializableAccountArgs, SerializableAccount>;
|
|
22
|
+
//# sourceMappingURL=serializableAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializableAccount.d.ts","sourceRoot":"","sources":["../../../../src/codama/types/serializableAccount.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAQL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACb,MAAM,aAAa,CAAC;AAErB,mEAAmE;AACnE,MAAM,MAAM,mBAAmB,GAAG;IAChC,8BAA8B;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,iFAAiF;IACjF,QAAQ,EAAE,OAAO,CAAC;IAClB,kEAAkE;IAClE,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAE1D,wBAAgB,6BAA6B,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAMhF;AAED,wBAAgB,6BAA6B,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAM5E;AAED,wBAAgB,2BAA2B,IAAI,KAAK,CAClD,uBAAuB,EACvB,mBAAmB,CACpB,CAKA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Address, type Codec, type Decoder, type Encoder, type ReadonlyUint8Array } from '@solana/kit';
|
|
9
|
+
import { type SerializableAccount, type SerializableAccountArgs } from '.';
|
|
10
|
+
/** The data needed execute an instruction on Solana. */
|
|
11
|
+
export type SerializableInstruction = {
|
|
12
|
+
/** Pubkey of the instruction processor that executes this instruction */
|
|
13
|
+
programId: Address;
|
|
14
|
+
/** Metadata for what accounts should be passed to the instruction processor */
|
|
15
|
+
accounts: Array<SerializableAccount>;
|
|
16
|
+
/** Opaque data passed to the instruction processor */
|
|
17
|
+
data: ReadonlyUint8Array;
|
|
18
|
+
};
|
|
19
|
+
export type SerializableInstructionArgs = {
|
|
20
|
+
/** Pubkey of the instruction processor that executes this instruction */
|
|
21
|
+
programId: Address;
|
|
22
|
+
/** Metadata for what accounts should be passed to the instruction processor */
|
|
23
|
+
accounts: Array<SerializableAccountArgs>;
|
|
24
|
+
/** Opaque data passed to the instruction processor */
|
|
25
|
+
data: ReadonlyUint8Array;
|
|
26
|
+
};
|
|
27
|
+
export declare function getSerializableInstructionEncoder(): Encoder<SerializableInstructionArgs>;
|
|
28
|
+
export declare function getSerializableInstructionDecoder(): Decoder<SerializableInstruction>;
|
|
29
|
+
export declare function getSerializableInstructionCodec(): Codec<SerializableInstructionArgs, SerializableInstruction>;
|
|
30
|
+
//# sourceMappingURL=serializableInstruction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializableInstruction.d.ts","sourceRoot":"","sources":["../../../../src/codama/types/serializableInstruction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAcL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC7B,MAAM,GAAG,CAAC;AAEX,wDAAwD;AACxD,MAAM,MAAM,uBAAuB,GAAG;IACpC,yEAAyE;IACzE,SAAS,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,QAAQ,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACrC,sDAAsD;IACtD,IAAI,EAAE,kBAAkB,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,yEAAyE;IACzE,SAAS,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,QAAQ,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC;IACzC,sDAAsD;IACtD,IAAI,EAAE,kBAAkB,CAAC;CAC1B,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAMxF;AAED,wBAAgB,iCAAiC,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAMpF;AAED,wBAAgB,+BAA+B,IAAI,KAAK,CACtD,2BAA2B,EAC3B,uBAAuB,CACxB,CAKA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Address, type Codec, type Decoder, type Encoder, type Option, type OptionOrNullable } from '@solana/kit';
|
|
9
|
+
import { type SerializableInstruction, type SerializableInstructionArgs, type Trigger, type TriggerArgs } from '.';
|
|
10
|
+
/** A response value target programs can return to update the thread. */
|
|
11
|
+
export type ThreadResponse = {
|
|
12
|
+
/**
|
|
13
|
+
* If set, the thread will automatically close and return lamports to the provided address.
|
|
14
|
+
* If dynamic_instruction is also set, close_to will take precedence and the dynamic instruction will not be executed.
|
|
15
|
+
*/
|
|
16
|
+
closeTo: Option<Address>;
|
|
17
|
+
/**
|
|
18
|
+
* A dynamic instruction to execute next.
|
|
19
|
+
* If close_to is also set, it will take precedence and the dynamic instruction will not be executed.
|
|
20
|
+
*/
|
|
21
|
+
dynamicInstruction: Option<SerializableInstruction>;
|
|
22
|
+
/** Value to update the thread trigger to. */
|
|
23
|
+
trigger: Option<Trigger>;
|
|
24
|
+
};
|
|
25
|
+
export type ThreadResponseArgs = {
|
|
26
|
+
/**
|
|
27
|
+
* If set, the thread will automatically close and return lamports to the provided address.
|
|
28
|
+
* If dynamic_instruction is also set, close_to will take precedence and the dynamic instruction will not be executed.
|
|
29
|
+
*/
|
|
30
|
+
closeTo: OptionOrNullable<Address>;
|
|
31
|
+
/**
|
|
32
|
+
* A dynamic instruction to execute next.
|
|
33
|
+
* If close_to is also set, it will take precedence and the dynamic instruction will not be executed.
|
|
34
|
+
*/
|
|
35
|
+
dynamicInstruction: OptionOrNullable<SerializableInstructionArgs>;
|
|
36
|
+
/** Value to update the thread trigger to. */
|
|
37
|
+
trigger: OptionOrNullable<TriggerArgs>;
|
|
38
|
+
};
|
|
39
|
+
export declare function getThreadResponseEncoder(): Encoder<ThreadResponseArgs>;
|
|
40
|
+
export declare function getThreadResponseDecoder(): Decoder<ThreadResponse>;
|
|
41
|
+
export declare function getThreadResponseCodec(): Codec<ThreadResponseArgs, ThreadResponse>;
|
|
42
|
+
//# sourceMappingURL=threadResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threadResponse.d.ts","sourceRoot":"","sources":["../../../../src/codama/types/threadResponse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAQL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAKL,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,OAAO,EACZ,KAAK,WAAW,EACjB,MAAM,GAAG,CAAC;AAEX,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC,uBAAuB,CAAC,CAAC;IACpD,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACnC;;;OAGG;IACH,kBAAkB,EAAE,gBAAgB,CAAC,2BAA2B,CAAC,CAAC;IAClE,6CAA6C;IAC7C,OAAO,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;CACxC,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAStE;AAED,wBAAgB,wBAAwB,IAAI,OAAO,CAAC,cAAc,CAAC,CASlE;AAED,wBAAgB,sBAAsB,IAAI,KAAK,CAC7C,kBAAkB,EAClB,cAAc,CACf,CAEA"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Address, type Codec, type Decoder, type Encoder, type GetDiscriminatedUnionVariant, type GetDiscriminatedUnionVariantContent } from '@solana/kit';
|
|
9
|
+
import { type Equality, type EqualityArgs } from '.';
|
|
10
|
+
/** The triggering conditions of a thread. */
|
|
11
|
+
export type Trigger = {
|
|
12
|
+
__kind: 'Account';
|
|
13
|
+
/** The address of the account to monitor. */
|
|
14
|
+
address: Address;
|
|
15
|
+
/** The byte offset of the account data to monitor. */
|
|
16
|
+
offset: bigint;
|
|
17
|
+
/** The size of the byte slice to monitor (must be less than 1kb) */
|
|
18
|
+
size: bigint;
|
|
19
|
+
} | {
|
|
20
|
+
__kind: 'Cron';
|
|
21
|
+
/** The schedule in cron syntax. Value must be parsable by the `solana_cron` package. */
|
|
22
|
+
schedule: string;
|
|
23
|
+
/**
|
|
24
|
+
* Boolean value indicating whether triggering moments may be skipped if they are missed (e.g. due to network downtime).
|
|
25
|
+
* If false, any "missed" triggering moments will simply be executed as soon as the network comes back online.
|
|
26
|
+
*/
|
|
27
|
+
skippable: boolean;
|
|
28
|
+
} | {
|
|
29
|
+
__kind: 'Now';
|
|
30
|
+
} | {
|
|
31
|
+
__kind: 'Slot';
|
|
32
|
+
slot: bigint;
|
|
33
|
+
} | {
|
|
34
|
+
__kind: 'Epoch';
|
|
35
|
+
epoch: bigint;
|
|
36
|
+
} | {
|
|
37
|
+
__kind: 'Timestamp';
|
|
38
|
+
unixTs: bigint;
|
|
39
|
+
} | {
|
|
40
|
+
__kind: 'Pyth';
|
|
41
|
+
/** The address of the price feed to monitor. */
|
|
42
|
+
priceFeed: Address;
|
|
43
|
+
/** The equality operator (gte or lte) used to compare prices. */
|
|
44
|
+
equality: Equality;
|
|
45
|
+
/** The limit price to compare the Pyth feed to. */
|
|
46
|
+
limit: bigint;
|
|
47
|
+
};
|
|
48
|
+
export type TriggerArgs = {
|
|
49
|
+
__kind: 'Account';
|
|
50
|
+
/** The address of the account to monitor. */
|
|
51
|
+
address: Address;
|
|
52
|
+
/** The byte offset of the account data to monitor. */
|
|
53
|
+
offset: number | bigint;
|
|
54
|
+
/** The size of the byte slice to monitor (must be less than 1kb) */
|
|
55
|
+
size: number | bigint;
|
|
56
|
+
} | {
|
|
57
|
+
__kind: 'Cron';
|
|
58
|
+
/** The schedule in cron syntax. Value must be parsable by the `solana_cron` package. */
|
|
59
|
+
schedule: string;
|
|
60
|
+
/**
|
|
61
|
+
* Boolean value indicating whether triggering moments may be skipped if they are missed (e.g. due to network downtime).
|
|
62
|
+
* If false, any "missed" triggering moments will simply be executed as soon as the network comes back online.
|
|
63
|
+
*/
|
|
64
|
+
skippable: boolean;
|
|
65
|
+
} | {
|
|
66
|
+
__kind: 'Now';
|
|
67
|
+
} | {
|
|
68
|
+
__kind: 'Slot';
|
|
69
|
+
slot: number | bigint;
|
|
70
|
+
} | {
|
|
71
|
+
__kind: 'Epoch';
|
|
72
|
+
epoch: number | bigint;
|
|
73
|
+
} | {
|
|
74
|
+
__kind: 'Timestamp';
|
|
75
|
+
unixTs: number | bigint;
|
|
76
|
+
} | {
|
|
77
|
+
__kind: 'Pyth';
|
|
78
|
+
/** The address of the price feed to monitor. */
|
|
79
|
+
priceFeed: Address;
|
|
80
|
+
/** The equality operator (gte or lte) used to compare prices. */
|
|
81
|
+
equality: EqualityArgs;
|
|
82
|
+
/** The limit price to compare the Pyth feed to. */
|
|
83
|
+
limit: number | bigint;
|
|
84
|
+
};
|
|
85
|
+
export declare function getTriggerEncoder(): Encoder<TriggerArgs>;
|
|
86
|
+
export declare function getTriggerDecoder(): Decoder<Trigger>;
|
|
87
|
+
export declare function getTriggerCodec(): Codec<TriggerArgs, Trigger>;
|
|
88
|
+
export declare function trigger(kind: 'Account', data: GetDiscriminatedUnionVariantContent<TriggerArgs, '__kind', 'Account'>): GetDiscriminatedUnionVariant<TriggerArgs, '__kind', 'Account'>;
|
|
89
|
+
export declare function trigger(kind: 'Cron', data: GetDiscriminatedUnionVariantContent<TriggerArgs, '__kind', 'Cron'>): GetDiscriminatedUnionVariant<TriggerArgs, '__kind', 'Cron'>;
|
|
90
|
+
export declare function trigger(kind: 'Now'): GetDiscriminatedUnionVariant<TriggerArgs, '__kind', 'Now'>;
|
|
91
|
+
export declare function trigger(kind: 'Slot', data: GetDiscriminatedUnionVariantContent<TriggerArgs, '__kind', 'Slot'>): GetDiscriminatedUnionVariant<TriggerArgs, '__kind', 'Slot'>;
|
|
92
|
+
export declare function trigger(kind: 'Epoch', data: GetDiscriminatedUnionVariantContent<TriggerArgs, '__kind', 'Epoch'>): GetDiscriminatedUnionVariant<TriggerArgs, '__kind', 'Epoch'>;
|
|
93
|
+
export declare function trigger(kind: 'Timestamp', data: GetDiscriminatedUnionVariantContent<TriggerArgs, '__kind', 'Timestamp'>): GetDiscriminatedUnionVariant<TriggerArgs, '__kind', 'Timestamp'>;
|
|
94
|
+
export declare function trigger(kind: 'Pyth', data: GetDiscriminatedUnionVariantContent<TriggerArgs, '__kind', 'Pyth'>): GetDiscriminatedUnionVariant<TriggerArgs, '__kind', 'Pyth'>;
|
|
95
|
+
export declare function isTrigger<K extends Trigger['__kind']>(kind: K, value: Trigger): value is Trigger & {
|
|
96
|
+
__kind: K;
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../../src/codama/types/trigger.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAsBL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,4BAA4B,EACjC,KAAK,mCAAmC,EACzC,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,YAAY,EAClB,MAAM,GAAG,CAAC;AAEX,6CAA6C;AAC7C,MAAM,MAAM,OAAO,G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,EAAE,mCAAmC,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,GACxE,4BAA4B,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAChE,wBAAgB,OAAO,CACrB,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mCAAmC,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,GAC5E,4BAA4B,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AACpE,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,mCAAmC,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,GACvE,4BAA4B,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAU/D,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,EACnD,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,OAAO,GAAG;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAElC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Codec, type Decoder, type Encoder, type GetDiscriminatedUnionVariant, type GetDiscriminatedUnionVariantContent } from '@solana/kit';
|
|
9
|
+
/** The event which allowed a particular transaction thread to be triggered. */
|
|
10
|
+
export type TriggerContext = {
|
|
11
|
+
__kind: 'Account';
|
|
12
|
+
/** The account's data hash. */
|
|
13
|
+
dataHash: bigint;
|
|
14
|
+
} | {
|
|
15
|
+
__kind: 'Cron';
|
|
16
|
+
/** The threshold moment the schedule was waiting for. */
|
|
17
|
+
startedAt: bigint;
|
|
18
|
+
} | {
|
|
19
|
+
__kind: 'Now';
|
|
20
|
+
} | {
|
|
21
|
+
__kind: 'Slot';
|
|
22
|
+
/** The threshold slot the schedule was waiting for. */
|
|
23
|
+
startedAt: bigint;
|
|
24
|
+
} | {
|
|
25
|
+
__kind: 'Epoch';
|
|
26
|
+
/** The threshold epoch the schedule was waiting for. */
|
|
27
|
+
startedAt: bigint;
|
|
28
|
+
} | {
|
|
29
|
+
__kind: 'Timestamp';
|
|
30
|
+
/** The threshold moment the schedule was waiting for. */
|
|
31
|
+
startedAt: bigint;
|
|
32
|
+
} | {
|
|
33
|
+
__kind: 'Pyth';
|
|
34
|
+
price: bigint;
|
|
35
|
+
};
|
|
36
|
+
export type TriggerContextArgs = {
|
|
37
|
+
__kind: 'Account';
|
|
38
|
+
/** The account's data hash. */
|
|
39
|
+
dataHash: number | bigint;
|
|
40
|
+
} | {
|
|
41
|
+
__kind: 'Cron';
|
|
42
|
+
/** The threshold moment the schedule was waiting for. */
|
|
43
|
+
startedAt: number | bigint;
|
|
44
|
+
} | {
|
|
45
|
+
__kind: 'Now';
|
|
46
|
+
} | {
|
|
47
|
+
__kind: 'Slot';
|
|
48
|
+
/** The threshold slot the schedule was waiting for. */
|
|
49
|
+
startedAt: number | bigint;
|
|
50
|
+
} | {
|
|
51
|
+
__kind: 'Epoch';
|
|
52
|
+
/** The threshold epoch the schedule was waiting for. */
|
|
53
|
+
startedAt: number | bigint;
|
|
54
|
+
} | {
|
|
55
|
+
__kind: 'Timestamp';
|
|
56
|
+
/** The threshold moment the schedule was waiting for. */
|
|
57
|
+
startedAt: number | bigint;
|
|
58
|
+
} | {
|
|
59
|
+
__kind: 'Pyth';
|
|
60
|
+
price: number | bigint;
|
|
61
|
+
};
|
|
62
|
+
export declare function getTriggerContextEncoder(): Encoder<TriggerContextArgs>;
|
|
63
|
+
export declare function getTriggerContextDecoder(): Decoder<TriggerContext>;
|
|
64
|
+
export declare function getTriggerContextCodec(): Codec<TriggerContextArgs, TriggerContext>;
|
|
65
|
+
export declare function triggerContext(kind: 'Account', data: GetDiscriminatedUnionVariantContent<TriggerContextArgs, '__kind', 'Account'>): GetDiscriminatedUnionVariant<TriggerContextArgs, '__kind', 'Account'>;
|
|
66
|
+
export declare function triggerContext(kind: 'Cron', data: GetDiscriminatedUnionVariantContent<TriggerContextArgs, '__kind', 'Cron'>): GetDiscriminatedUnionVariant<TriggerContextArgs, '__kind', 'Cron'>;
|
|
67
|
+
export declare function triggerContext(kind: 'Now'): GetDiscriminatedUnionVariant<TriggerContextArgs, '__kind', 'Now'>;
|
|
68
|
+
export declare function triggerContext(kind: 'Slot', data: GetDiscriminatedUnionVariantContent<TriggerContextArgs, '__kind', 'Slot'>): GetDiscriminatedUnionVariant<TriggerContextArgs, '__kind', 'Slot'>;
|
|
69
|
+
export declare function triggerContext(kind: 'Epoch', data: GetDiscriminatedUnionVariantContent<TriggerContextArgs, '__kind', 'Epoch'>): GetDiscriminatedUnionVariant<TriggerContextArgs, '__kind', 'Epoch'>;
|
|
70
|
+
export declare function triggerContext(kind: 'Timestamp', data: GetDiscriminatedUnionVariantContent<TriggerContextArgs, '__kind', 'Timestamp'>): GetDiscriminatedUnionVariant<TriggerContextArgs, '__kind', 'Timestamp'>;
|
|
71
|
+
export declare function triggerContext(kind: 'Pyth', data: GetDiscriminatedUnionVariantContent<TriggerContextArgs, '__kind', 'Pyth'>): GetDiscriminatedUnionVariant<TriggerContextArgs, '__kind', 'Pyth'>;
|
|
72
|
+
export declare function isTriggerContext<K extends TriggerContext['__kind']>(kind: K, value: TriggerContext): value is TriggerContext & {
|
|
73
|
+
__kind: K;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=triggerContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggerContext.d.ts","sourceRoot":"","sources":["../../../../src/codama/types/triggerContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAYL,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,K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C,kBAAkB,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC3E,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,mCAAmC,CACvC,kBAAkB,EAClB,QAAQ,EACR,MAAM,CACP,GACA,4BAA4B,CAAC,kBAAkB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAUtE,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,cAAc,CAAC,QAAQ,CAAC,EACjE,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,cAAc,GACpB,KAAK,IAAI,cAAc,GAAG;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAEzC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Address, TransactionSigner } from '@solana/kit';
|
|
2
|
+
import { CloseContractInstruction, getCloseContractInstructionAsync } from '../codama';
|
|
3
|
+
/**
|
|
4
|
+
* Simplified parameters for closing a rental contract
|
|
5
|
+
*/
|
|
6
|
+
export interface CloseContractParams {
|
|
7
|
+
/**
|
|
8
|
+
* The owner wallet that will sign the transaction
|
|
9
|
+
*/
|
|
10
|
+
owner: TransactionSigner<string>;
|
|
11
|
+
/**
|
|
12
|
+
* The fleet account address associated with the contract
|
|
13
|
+
*/
|
|
14
|
+
fleet: Address<string>;
|
|
15
|
+
/**
|
|
16
|
+
* The rental contract account address to close
|
|
17
|
+
*/
|
|
18
|
+
contract: Address<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Optional faction (1 = mud, 2 = oni, 3 = ustur)
|
|
21
|
+
* Or as string: 'mud', 'oni', 'ustur'
|
|
22
|
+
*/
|
|
23
|
+
faction: number | string;
|
|
24
|
+
/**
|
|
25
|
+
* The game ID account address
|
|
26
|
+
* Defaults to 'GAMEzqJehF8yAnKiTARUuhZMvLvkZVAsCVri5vSfemLr' if not provided
|
|
27
|
+
*/
|
|
28
|
+
gameId?: Address<string>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Asynchronously creates an instruction to close a rental contract with minimal required parameters.
|
|
32
|
+
* Derives rentalAuthority automatically and handles optional parameters.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* // Create the instruction with automatic account derivation
|
|
37
|
+
* const ix = await closeContract({
|
|
38
|
+
* owner: wallet,
|
|
39
|
+
* fleet: fleetAddress,
|
|
40
|
+
* contract: contractAddress,
|
|
41
|
+
* faction: 'mud', // Only needed if starbase and starbasePlayer not provided
|
|
42
|
+
* // Optional: provide explicit starbase and starbasePlayer if you have them
|
|
43
|
+
* // Optional: provide rentalState and rentalTokenAccount if active rental exists
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Add to transaction and sign
|
|
47
|
+
* const tx = new Transaction().add(ix);
|
|
48
|
+
* await sendAndConfirmTransaction(connection, tx, [wallet]);
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @param params The simplified parameters for closing a rental contract
|
|
52
|
+
* @returns A promise that resolves to the instruction to close a contract
|
|
53
|
+
*/
|
|
54
|
+
export declare function closeContract(params: CloseContractParams): Promise<CloseContractInstruction>;
|
|
55
|
+
export { getCloseContractInstructionAsync };
|
|
56
|
+
//# sourceMappingURL=close.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../src/contract/close.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAEjC,MAAM,WAAW,CAAC;AAOnB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1B;;;OAGG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,wBAAwB,CAAC,CAgCnC;AAED,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Address, TransactionSigner } from '@solana/kit';
|
|
2
|
+
import { CreateContractInstruction, getCreateContractInstructionAsync } from '../codama';
|
|
3
|
+
/**
|
|
4
|
+
* Simplified parameters for creating a rental contract
|
|
5
|
+
*/
|
|
6
|
+
export interface CreateContractParams {
|
|
7
|
+
/**
|
|
8
|
+
* The owner wallet that will sign the transaction
|
|
9
|
+
*/
|
|
10
|
+
owner: TransactionSigner<string>;
|
|
11
|
+
/**
|
|
12
|
+
* The fleet account address to be rented out
|
|
13
|
+
*/
|
|
14
|
+
fleet: Address<string>;
|
|
15
|
+
/**
|
|
16
|
+
* The owner's profile account address
|
|
17
|
+
*/
|
|
18
|
+
ownerProfile: Address<string>;
|
|
19
|
+
/**
|
|
20
|
+
* The rental rate in ATLAS tokens
|
|
21
|
+
*/
|
|
22
|
+
rate: number | bigint;
|
|
23
|
+
/**
|
|
24
|
+
* The minimum rental duration in seconds
|
|
25
|
+
*/
|
|
26
|
+
durationMin: number | bigint;
|
|
27
|
+
/**
|
|
28
|
+
* The maximum rental duration in seconds
|
|
29
|
+
*/
|
|
30
|
+
durationMax: number | bigint;
|
|
31
|
+
/**
|
|
32
|
+
* The payment frequency (e.g., "daily", "weekly", "monthly")
|
|
33
|
+
*/
|
|
34
|
+
paymentsFreq: string;
|
|
35
|
+
/**
|
|
36
|
+
* The owner key index
|
|
37
|
+
* Typically 0 unless the owner has multiple authorized keys
|
|
38
|
+
*/
|
|
39
|
+
ownerKeyIndex?: number;
|
|
40
|
+
/**
|
|
41
|
+
* The game ID account address
|
|
42
|
+
* Defaults to 'GAMEzqJehF8yAnKiTARUuhZMvLvkZVAsCVri5vSfemLr' if not provided
|
|
43
|
+
*/
|
|
44
|
+
gameId?: Address<string>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Asynchronously creates an instruction to create a rental contract with minimal required parameters.
|
|
48
|
+
* Derives ownerTokenAccount, contract, and rentalAuthority automatically if not provided.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* // Create the instruction with minimal parameters
|
|
53
|
+
* const ix = await createContract({
|
|
54
|
+
* owner: wallet,
|
|
55
|
+
* fleet: fleetAddress,
|
|
56
|
+
* ownerProfile: profileAddress,
|
|
57
|
+
* rate: 100, // 100 ATLAS per second
|
|
58
|
+
* durationMin: 3600, // 1 hour in seconds
|
|
59
|
+
* durationMax: 604800, // 1 week in seconds
|
|
60
|
+
* paymentsFreq: "daily"
|
|
61
|
+
* });
|
|
62
|
+
*
|
|
63
|
+
* // Add to transaction and sign
|
|
64
|
+
* const tx = new Transaction().add(ix);
|
|
65
|
+
* await sendAndConfirmTransaction(connection, tx, [wallet]);
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @param params The simplified parameters for creating a rental contract
|
|
69
|
+
* @returns A promise that resolves to the instruction to create a contract
|
|
70
|
+
*/
|
|
71
|
+
export declare function createContract(params: CreateContractParams): Promise<CreateContractInstruction>;
|
|
72
|
+
export { getCreateContractInstructionAsync };
|
|
73
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/contract/create.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EAElC,MAAM,WAAW,CAAC;AAOnB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvB;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9B;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAE7B;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAE7B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,yBAAyB,CAAC,CA8BpC;AAED,OAAO,EAAE,iCAAiC,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contract/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Address, TransactionSigner } from '@solana/kit';
|
|
2
|
+
import { AcceptRentalInstruction, getAcceptRentalInstructionAsync } from '../codama';
|
|
3
|
+
/**
|
|
4
|
+
* Simplified parameters for accepting a rental
|
|
5
|
+
*/
|
|
6
|
+
export interface AcceptRentalParams {
|
|
7
|
+
/**
|
|
8
|
+
* The borrower wallet that will sign the transaction
|
|
9
|
+
*/
|
|
10
|
+
borrower: TransactionSigner<string>;
|
|
11
|
+
/**
|
|
12
|
+
* The borrower's profile account address
|
|
13
|
+
*/
|
|
14
|
+
borrowerProfile: Address<string>;
|
|
15
|
+
/**
|
|
16
|
+
* The borrower's faction (1 = mud, 2 = oni, 3 = ustur)
|
|
17
|
+
* Or as string: 'mud', 'oni', 'ustur'
|
|
18
|
+
*/
|
|
19
|
+
borrowerFaction: number | string;
|
|
20
|
+
/**
|
|
21
|
+
* The fleet account address that will be rented
|
|
22
|
+
*/
|
|
23
|
+
fleet: Address<string>;
|
|
24
|
+
/**
|
|
25
|
+
* The rental contract account address
|
|
26
|
+
*/
|
|
27
|
+
contract: Address<string>;
|
|
28
|
+
/**
|
|
29
|
+
* The game ID account address
|
|
30
|
+
* Defaults to 'GAMEzqJehF8yAnKiTARUuhZMvLvkZVAsCVri5vSfemLr' if not provided
|
|
31
|
+
*/
|
|
32
|
+
gameId?: Address<string>;
|
|
33
|
+
/**
|
|
34
|
+
* The rental amount (in ATLAS tokens)
|
|
35
|
+
*/
|
|
36
|
+
amount: number | bigint;
|
|
37
|
+
/**
|
|
38
|
+
* The rental duration (in seconds)
|
|
39
|
+
*/
|
|
40
|
+
duration: number | bigint;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Asynchronously creates an instruction to accept a rental with minimal required parameters.
|
|
44
|
+
* Derives borrowerProfileFaction, starbase, and starbasePlayer automatically.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* // Create the instruction with automatic account derivation
|
|
49
|
+
* const ix = await acceptRental({
|
|
50
|
+
* borrower: wallet,
|
|
51
|
+
* borrowerProfile: profileAddress,
|
|
52
|
+
* borrowerFaction: 1, // 1 = mud, 2 = oni, 3 = ustur
|
|
53
|
+
* fleet: fleetAddress,
|
|
54
|
+
* contract: contractAddress,
|
|
55
|
+
* amount: 1000,
|
|
56
|
+
* duration: 86400 // 1 day in seconds
|
|
57
|
+
* // gameId is optional and will default to the standard game ID
|
|
58
|
+
* });
|
|
59
|
+
*
|
|
60
|
+
* // Add to transaction and sign
|
|
61
|
+
* const tx = new Transaction().add(ix);
|
|
62
|
+
* await sendAndConfirmTransaction(connection, tx, [wallet]);
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @param params The simplified parameters for accepting a rental
|
|
66
|
+
* @returns A promise that resolves to the instruction to accept a rental
|
|
67
|
+
*/
|
|
68
|
+
export declare function acceptRental(params: AcceptRentalParams): Promise<AcceptRentalInstruction>;
|
|
69
|
+
export { getAcceptRentalInstructionAsync };
|
|
70
|
+
//# sourceMappingURL=accept.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accept.d.ts","sourceRoot":"","sources":["../../../src/rental/accept.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,uBAAuB,EACvB,+BAA+B,EAEhC,MAAM,WAAW,CAAC;AAOnB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEpC;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjC;;;OAGG;IACH,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC;IAEjC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzB;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,uBAAuB,CAAC,CAyClC;AAED,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Address, TransactionSigner } from '@solana/kit';
|
|
2
|
+
import { CancelRentalInstruction, getCancelRentalInstructionAsync } from '../codama';
|
|
3
|
+
/**
|
|
4
|
+
* Simplified parameters for canceling a rental
|
|
5
|
+
*/
|
|
6
|
+
export interface CancelRentalParams {
|
|
7
|
+
/**
|
|
8
|
+
* The borrower wallet that will sign the transaction
|
|
9
|
+
*/
|
|
10
|
+
borrower: TransactionSigner<string>;
|
|
11
|
+
/**
|
|
12
|
+
* The rental contract account address
|
|
13
|
+
*/
|
|
14
|
+
contract: Address<string>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Asynchronously creates an instruction to cancel a rental with minimal required parameters.
|
|
18
|
+
* Derives rentalState, rentalThread, borrowerTokenAccount, rentalTokenAccount and
|
|
19
|
+
* rentalAuthority automatically if not provided.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Create the instruction with minimal parameters - just borrower and contract
|
|
24
|
+
* const ix = await cancelRental({
|
|
25
|
+
* borrower: wallet,
|
|
26
|
+
* contract: contractAddress
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* // Add to transaction and sign
|
|
30
|
+
* const tx = new Transaction().add(ix);
|
|
31
|
+
* await sendAndConfirmTransaction(connection, tx, [wallet]);
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param params The simplified parameters for canceling a rental
|
|
35
|
+
* @returns A promise that resolves to the instruction to cancel a rental
|
|
36
|
+
*/
|
|
37
|
+
export declare function cancelRental(params: CancelRentalParams): Promise<CancelRentalInstruction>;
|
|
38
|
+
export { getCancelRentalInstructionAsync };
|
|
39
|
+
//# sourceMappingURL=cancel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../../src/rental/cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,uBAAuB,EACvB,+BAA+B,EAEhC,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEpC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,uBAAuB,CAAC,CAgBlC;AAED,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Address } from '@solana/kit';
|
|
2
|
+
import { CloseRentalInstruction, getCloseRentalInstructionAsync } from '../codama';
|
|
3
|
+
/**
|
|
4
|
+
* Simplified parameters for closing a rental
|
|
5
|
+
*/
|
|
6
|
+
export interface CloseRentalParams {
|
|
7
|
+
/**
|
|
8
|
+
* The borrower address (not a signer in this transaction)
|
|
9
|
+
*/
|
|
10
|
+
borrower: Address<string>;
|
|
11
|
+
/**
|
|
12
|
+
* The owner's token account address for receiving ATLAS
|
|
13
|
+
*/
|
|
14
|
+
ownerTokenAccount: Address<string>;
|
|
15
|
+
/**
|
|
16
|
+
* The rental contract account address
|
|
17
|
+
*/
|
|
18
|
+
contract: Address<string>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Asynchronously creates an instruction to close a rental with minimal required parameters.
|
|
22
|
+
* This is called by an owner to close a rental that was previously accepted by a borrower.
|
|
23
|
+
* Derives rentalState, rentalThread, rentalTokenAccount and rentalAuthority automatically if not provided.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // Create the instruction with minimal parameters
|
|
28
|
+
* const ix = await closeRental({
|
|
29
|
+
* borrower: borrowerAddress,
|
|
30
|
+
* ownerTokenAccount: ownerTokenAccountAddress,
|
|
31
|
+
* contract: contractAddress
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* // Add to transaction and sign
|
|
35
|
+
* const tx = new Transaction().add(ix);
|
|
36
|
+
* await sendAndConfirmTransaction(connection, tx, [owner]);
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @param params The simplified parameters for closing a rental
|
|
40
|
+
* @returns A promise that resolves to the instruction to close a rental
|
|
41
|
+
*/
|
|
42
|
+
export declare function closeRental(params: CloseRentalParams): Promise<CloseRentalInstruction>;
|
|
43
|
+
export { getCloseRentalInstructionAsync };
|
|
44
|
+
//# sourceMappingURL=close.d.ts.map
|