@wuwei-labs/srsly 2.0.0-beta.2 → 2.0.0-beta.21
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 +305 -110
- package/dist/cjs/codama/accounts/config.js +88 -0
- package/dist/cjs/codama/accounts/config.js.map +1 -0
- package/dist/cjs/codama/accounts/contractState.js +17 -39
- package/dist/cjs/codama/accounts/contractState.js.map +1 -1
- package/dist/cjs/codama/accounts/index.js +1 -1
- package/dist/cjs/codama/accounts/index.js.map +1 -1
- package/dist/cjs/codama/accounts/rentalState.js +18 -33
- package/dist/cjs/codama/accounts/rentalState.js.map +1 -1
- package/dist/cjs/codama/accounts/thread.js +15 -32
- package/dist/cjs/codama/accounts/thread.js.map +1 -1
- package/dist/cjs/codama/errors/srsly.js +24 -3
- package/dist/cjs/codama/errors/srsly.js.map +1 -1
- package/dist/cjs/codama/instructions/acceptRental.js +202 -224
- package/dist/cjs/codama/instructions/acceptRental.js.map +1 -1
- package/dist/cjs/codama/instructions/cancelRental.js +100 -136
- package/dist/cjs/codama/instructions/cancelRental.js.map +1 -1
- package/dist/cjs/codama/instructions/closeContract.js +95 -116
- package/dist/cjs/codama/instructions/closeContract.js.map +1 -1
- package/dist/cjs/codama/instructions/closeRental.js +119 -132
- package/dist/cjs/codama/instructions/closeRental.js.map +1 -1
- package/dist/cjs/codama/instructions/createContract.js +127 -143
- package/dist/cjs/codama/instructions/createContract.js.map +1 -1
- package/dist/cjs/codama/instructions/index.js +2 -1
- package/dist/cjs/codama/instructions/index.js.map +1 -1
- package/dist/cjs/codama/instructions/initializeConfig.js +131 -0
- package/dist/cjs/codama/instructions/initializeConfig.js.map +1 -0
- package/dist/cjs/codama/instructions/payRental.js +125 -129
- package/dist/cjs/codama/instructions/payRental.js.map +1 -1
- package/dist/cjs/codama/instructions/resetRental.js +55 -77
- package/dist/cjs/codama/instructions/resetRental.js.map +1 -1
- package/dist/cjs/codama/instructions/updateConfig.js +145 -0
- package/dist/cjs/codama/instructions/updateConfig.js.map +1 -0
- package/dist/cjs/codama/programs/srsly.js +12 -8
- package/dist/cjs/codama/programs/srsly.js.map +1 -1
- package/dist/cjs/codama/shared/index.js +6 -2
- package/dist/cjs/codama/shared/index.js.map +1 -1
- package/dist/cjs/codama/types/trigger.js +1 -1
- package/dist/cjs/codama/types/trigger.js.map +1 -1
- package/dist/cjs/codama/types/triggerContext.js +1 -1
- package/dist/cjs/codama/types/triggerContext.js.map +1 -1
- package/dist/cjs/contract/close.js +75 -34
- package/dist/cjs/contract/close.js.map +1 -1
- package/dist/cjs/contract/create.js +59 -43
- package/dist/cjs/contract/create.js.map +1 -1
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/package.json +54 -0
- package/dist/cjs/rental/accept.js +68 -40
- package/dist/cjs/rental/accept.js.map +1 -1
- package/dist/cjs/rental/cancel.js +36 -28
- package/dist/cjs/rental/cancel.js.map +1 -1
- package/dist/cjs/rental/close.js +37 -29
- package/dist/cjs/rental/close.js.map +1 -1
- package/dist/cjs/rental/reset.js +46 -42
- package/dist/cjs/rental/reset.js.map +1 -1
- package/dist/cjs/utils/config.js +319 -0
- package/dist/cjs/utils/config.js.map +1 -0
- package/dist/cjs/utils/constants.js +69 -9
- package/dist/cjs/utils/constants.js.map +1 -1
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/profiles.js +96 -95
- package/dist/cjs/utils/profiles.js.map +1 -1
- package/dist/esm/codama/accounts/config.js +76 -0
- package/dist/esm/codama/accounts/config.js.map +1 -0
- package/dist/esm/codama/accounts/contractState.js +3 -7
- package/dist/esm/codama/accounts/contractState.js.map +1 -1
- package/dist/esm/codama/accounts/index.js +1 -1
- package/dist/esm/codama/accounts/index.js.map +1 -1
- package/dist/esm/codama/accounts/rentalState.js +3 -1
- package/dist/esm/codama/accounts/rentalState.js.map +1 -1
- package/dist/esm/codama/errors/srsly.js +23 -2
- package/dist/esm/codama/errors/srsly.js.map +1 -1
- package/dist/esm/codama/instructions/acceptRental.js +30 -39
- package/dist/esm/codama/instructions/acceptRental.js.map +1 -1
- package/dist/esm/codama/instructions/cancelRental.js +10 -33
- package/dist/esm/codama/instructions/cancelRental.js.map +1 -1
- package/dist/esm/codama/instructions/closeContract.js +17 -25
- package/dist/esm/codama/instructions/closeContract.js.map +1 -1
- package/dist/esm/codama/instructions/closeRental.js +19 -19
- package/dist/esm/codama/instructions/closeRental.js.map +1 -1
- package/dist/esm/codama/instructions/createContract.js +13 -16
- package/dist/esm/codama/instructions/createContract.js.map +1 -1
- package/dist/esm/codama/instructions/index.js +2 -1
- package/dist/esm/codama/instructions/index.js.map +1 -1
- package/dist/esm/codama/instructions/initializeConfig.js +121 -0
- package/dist/esm/codama/instructions/initializeConfig.js.map +1 -0
- package/dist/esm/codama/instructions/payRental.js +34 -25
- package/dist/esm/codama/instructions/payRental.js.map +1 -1
- package/dist/esm/codama/instructions/resetRental.js +0 -9
- package/dist/esm/codama/instructions/resetRental.js.map +1 -1
- package/dist/esm/codama/instructions/updateConfig.js +135 -0
- package/dist/esm/codama/instructions/updateConfig.js.map +1 -0
- package/dist/esm/codama/programs/srsly.js +12 -8
- package/dist/esm/codama/programs/srsly.js.map +1 -1
- package/dist/esm/contract/close.js +68 -16
- package/dist/esm/contract/close.js.map +1 -1
- package/dist/esm/contract/create.js +60 -33
- package/dist/esm/contract/create.js.map +1 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +54 -0
- package/dist/esm/rental/accept.js +70 -31
- package/dist/esm/rental/accept.js.map +1 -1
- package/dist/esm/rental/cancel.js +37 -18
- package/dist/esm/rental/cancel.js.map +1 -1
- package/dist/esm/rental/close.js +38 -19
- package/dist/esm/rental/close.js.map +1 -1
- package/dist/esm/rental/reset.js +48 -33
- package/dist/esm/rental/reset.js.map +1 -1
- package/dist/esm/utils/config.js +277 -0
- package/dist/esm/utils/config.js.map +1 -0
- package/dist/esm/utils/constants.js +60 -7
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/profiles.js +39 -19
- package/dist/esm/utils/profiles.js.map +1 -1
- package/dist/types/codama/accounts/config.d.ts +52 -0
- package/dist/types/codama/accounts/config.d.ts.map +1 -0
- package/dist/types/codama/accounts/contractState.d.ts +2 -4
- package/dist/types/codama/accounts/contractState.d.ts.map +1 -1
- package/dist/types/codama/accounts/index.d.ts +1 -1
- package/dist/types/codama/accounts/index.d.ts.map +1 -1
- package/dist/types/codama/accounts/rentalState.d.ts +2 -0
- package/dist/types/codama/accounts/rentalState.d.ts.map +1 -1
- package/dist/types/codama/errors/srsly.d.ts +16 -2
- package/dist/types/codama/errors/srsly.d.ts.map +1 -1
- package/dist/types/codama/instructions/acceptRental.d.ts +41 -34
- package/dist/types/codama/instructions/acceptRental.d.ts.map +1 -1
- package/dist/types/codama/instructions/cancelRental.d.ts +14 -10
- package/dist/types/codama/instructions/cancelRental.d.ts.map +1 -1
- package/dist/types/codama/instructions/closeContract.d.ts +29 -21
- package/dist/types/codama/instructions/closeContract.d.ts.map +1 -1
- package/dist/types/codama/instructions/closeRental.d.ts +20 -12
- package/dist/types/codama/instructions/closeRental.d.ts.map +1 -1
- package/dist/types/codama/instructions/createContract.d.ts +27 -23
- package/dist/types/codama/instructions/createContract.d.ts.map +1 -1
- package/dist/types/codama/instructions/index.d.ts +2 -1
- package/dist/types/codama/instructions/index.d.ts.map +1 -1
- package/dist/types/codama/instructions/initializeConfig.d.ts +60 -0
- package/dist/types/codama/instructions/initializeConfig.d.ts.map +1 -0
- package/dist/types/codama/instructions/payRental.d.ts +28 -13
- package/dist/types/codama/instructions/payRental.d.ts.map +1 -1
- package/dist/types/codama/instructions/resetRental.d.ts +3 -3
- package/dist/types/codama/instructions/resetRental.d.ts.map +1 -1
- package/dist/types/codama/instructions/updateConfig.d.ts +93 -0
- package/dist/types/codama/instructions/updateConfig.d.ts.map +1 -0
- package/dist/types/codama/programs/srsly.d.ts +11 -8
- package/dist/types/codama/programs/srsly.d.ts.map +1 -1
- package/dist/types/contract/close.d.ts +20 -24
- package/dist/types/contract/close.d.ts.map +1 -1
- package/dist/types/contract/create.d.ts +34 -22
- package/dist/types/contract/create.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/rental/accept.d.ts +42 -20
- package/dist/types/rental/accept.d.ts.map +1 -1
- package/dist/types/rental/cancel.d.ts +16 -11
- package/dist/types/rental/cancel.d.ts.map +1 -1
- package/dist/types/rental/close.d.ts +16 -11
- package/dist/types/rental/close.d.ts.map +1 -1
- package/dist/types/rental/reset.d.ts +17 -20
- package/dist/types/rental/reset.d.ts.map +1 -1
- package/dist/types/utils/config.d.ts +167 -0
- package/dist/types/utils/config.d.ts.map +1 -0
- package/dist/types/utils/constants.d.ts +23 -7
- package/dist/types/utils/constants.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/profiles.d.ts +14 -8
- package/dist/types/utils/profiles.d.ts.map +1 -1
- package/package.json +36 -14
- package/target/idl/srsly.json +3279 -0
- package/target/types/srsly.ts +1 -0
- package/dist/cjs/codama/accounts/fleet.js +0 -94
- package/dist/cjs/codama/accounts/fleet.js.map +0 -1
- package/dist/cjs/codama/instructions/normalizeAdmin.js +0 -165
- package/dist/cjs/codama/instructions/normalizeAdmin.js.map +0 -1
- package/dist/esm/codama/accounts/fleet.js +0 -64
- package/dist/esm/codama/accounts/fleet.js.map +0 -1
- package/dist/esm/codama/instructions/normalizeAdmin.js +0 -142
- package/dist/esm/codama/instructions/normalizeAdmin.js.map +0 -1
- package/dist/types/codama/accounts/fleet.d.ts +0 -38
- package/dist/types/codama/accounts/fleet.d.ts.map +0 -1
- package/dist/types/codama/instructions/normalizeAdmin.d.ts +0 -67
- package/dist/types/codama/instructions/normalizeAdmin.d.ts.map +0 -1
|
@@ -9,7 +9,7 @@ import { type Address, type Codec, type Decoder, type Encoder, type IAccountMeta
|
|
|
9
9
|
import { SRSLY_PROGRAM_ADDRESS } from '../programs';
|
|
10
10
|
export declare const RESET_RENTAL_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
11
|
export declare function getResetRentalDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
-
export type ResetRentalInstruction<TProgram extends string = typeof SRSLY_PROGRAM_ADDRESS, TAccountFleet extends string | IAccountMeta<string> = string, TAccountGameId extends string | IAccountMeta<string> = string, TAccountStarbase extends string | IAccountMeta<string> = string, TAccountStarbasePlayer extends string | IAccountMeta<string> = string, TAccountRentalState extends string | IAccountMeta<string> = string, TAccountContract extends string | IAccountMeta<string> = string, TAccountRentalAuthority extends string | IAccountMeta<string> = string, TAccountSageProgram extends string | IAccountMeta<string> =
|
|
12
|
+
export type ResetRentalInstruction<TProgram extends string = typeof SRSLY_PROGRAM_ADDRESS, TAccountFleet extends string | IAccountMeta<string> = string, TAccountGameId extends string | IAccountMeta<string> = string, TAccountStarbase extends string | IAccountMeta<string> = string, TAccountStarbasePlayer extends string | IAccountMeta<string> = string, TAccountRentalState extends string | IAccountMeta<string> = string, TAccountContract extends string | IAccountMeta<string> = string, TAccountRentalAuthority extends string | IAccountMeta<string> = string, TAccountSageProgram extends string | IAccountMeta<string> = string, TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
|
|
13
13
|
TAccountFleet extends string ? WritableAccount<TAccountFleet> : TAccountFleet,
|
|
14
14
|
TAccountGameId extends string ? ReadonlyAccount<TAccountGameId> : TAccountGameId,
|
|
15
15
|
TAccountStarbase extends string ? ReadonlyAccount<TAccountStarbase> : TAccountStarbase,
|
|
@@ -35,7 +35,7 @@ export type ResetRentalAsyncInput<TAccountFleet extends string = string, TAccoun
|
|
|
35
35
|
rentalState: Address<TAccountRentalState>;
|
|
36
36
|
contract: Address<TAccountContract>;
|
|
37
37
|
rentalAuthority?: Address<TAccountRentalAuthority>;
|
|
38
|
-
sageProgram
|
|
38
|
+
sageProgram: Address<TAccountSageProgram>;
|
|
39
39
|
};
|
|
40
40
|
export declare function getResetRentalInstructionAsync<TAccountFleet extends string, TAccountGameId extends string, TAccountStarbase extends string, TAccountStarbasePlayer extends string, TAccountRentalState extends string, TAccountContract extends string, TAccountRentalAuthority extends string, TAccountSageProgram extends string, TProgramAddress extends Address = typeof SRSLY_PROGRAM_ADDRESS>(input: ResetRentalAsyncInput<TAccountFleet, TAccountGameId, TAccountStarbase, TAccountStarbasePlayer, TAccountRentalState, TAccountContract, TAccountRentalAuthority, TAccountSageProgram>, config?: {
|
|
41
41
|
programAddress?: TProgramAddress;
|
|
@@ -48,7 +48,7 @@ export type ResetRentalInput<TAccountFleet extends string = string, TAccountGame
|
|
|
48
48
|
rentalState: Address<TAccountRentalState>;
|
|
49
49
|
contract: Address<TAccountContract>;
|
|
50
50
|
rentalAuthority: Address<TAccountRentalAuthority>;
|
|
51
|
-
sageProgram
|
|
51
|
+
sageProgram: Address<TAccountSageProgram>;
|
|
52
52
|
};
|
|
53
53
|
export declare function getResetRentalInstruction<TAccountFleet extends string, TAccountGameId extends string, TAccountStarbase extends string, TAccountStarbasePlayer extends string, TAccountRentalState extends string, TAccountContract extends string, TAccountRentalAuthority extends string, TAccountSageProgram extends string, TProgramAddress extends Address = typeof SRSLY_PROGRAM_ADDRESS>(input: ResetRentalInput<TAccountFleet, TAccountGameId, TAccountStarbase, TAccountStarbasePlayer, TAccountRentalState, TAccountContract, TAccountRentalAuthority, TAccountSageProgram>, config?: {
|
|
54
54
|
programAddress?: TProgramAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resetRental.d.ts","sourceRoot":"","sources":["../../../../src/codama/instructions/resetRental.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;A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AC,CAAC,CAAC;QACxB,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACzB,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC3B,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACjC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC9B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC3B,eAAe,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAClC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;KAC/B,CAAC;IACF,IAAI,EAAE,0BAA0B,CAAC;CAClC,CAAC;AAEF,wBAAgB,2BAA2B,CACzC,QAAQ,SAAS,MAAM,EACvB,aAAa,SAAS,SAAS,YAAY,EAAE,EAE7C,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAC,GACjC,wBAAwB,CAAC,aAAa,CAAC,GACvC,oBAAoB,CAAC,UAAU,CAAC,GACjC,4BAA4B,CAAC,QAAQ,EAAE,aAAa,CAAC,CAyBvD"}
|
|
@@ -0,0 +1,93 @@
|
|
|
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 IAccountMeta, type IAccountSignerMeta, type IInstruction, type IInstructionWithAccounts, type IInstructionWithData, type Option, type OptionOrNullable, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from '@solana/kit';
|
|
9
|
+
import { SRSLY_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
import { type PaymentFrequency, type PaymentFrequencyArgs } from '../types';
|
|
11
|
+
export declare const UPDATE_CONFIG_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
12
|
+
export declare function getUpdateConfigDiscriminatorBytes(): ReadonlyUint8Array;
|
|
13
|
+
export type UpdateConfigInstruction<TProgram extends string = typeof SRSLY_PROGRAM_ADDRESS, TAccountConfig extends string | IAccountMeta<string> = string, TAccountAuthority extends string | IAccountMeta<string> = string, TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
|
|
14
|
+
TAccountConfig extends string ? WritableAccount<TAccountConfig> : TAccountConfig,
|
|
15
|
+
TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & IAccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
16
|
+
...TRemainingAccounts
|
|
17
|
+
]>;
|
|
18
|
+
export type UpdateConfigInstructionData = {
|
|
19
|
+
discriminator: ReadonlyUint8Array;
|
|
20
|
+
authority: Option<Address>;
|
|
21
|
+
stardustToAtlas: Option<bigint>;
|
|
22
|
+
serviceFeeBps: Option<bigint>;
|
|
23
|
+
referralFeeBps: Option<bigint>;
|
|
24
|
+
baseBps: Option<bigint>;
|
|
25
|
+
rentalDurationMinSeconds: Option<bigint>;
|
|
26
|
+
rentalDurationMaxSeconds: Option<bigint>;
|
|
27
|
+
feesAccount: Option<Address>;
|
|
28
|
+
atlasMint: Option<Address>;
|
|
29
|
+
defaultPaymentFrequency: Option<PaymentFrequency>;
|
|
30
|
+
allowedFrequencies: Option<Array<PaymentFrequency>>;
|
|
31
|
+
};
|
|
32
|
+
export type UpdateConfigInstructionDataArgs = {
|
|
33
|
+
authority: OptionOrNullable<Address>;
|
|
34
|
+
stardustToAtlas: OptionOrNullable<number | bigint>;
|
|
35
|
+
serviceFeeBps: OptionOrNullable<number | bigint>;
|
|
36
|
+
referralFeeBps: OptionOrNullable<number | bigint>;
|
|
37
|
+
baseBps: OptionOrNullable<number | bigint>;
|
|
38
|
+
rentalDurationMinSeconds: OptionOrNullable<number | bigint>;
|
|
39
|
+
rentalDurationMaxSeconds: OptionOrNullable<number | bigint>;
|
|
40
|
+
feesAccount: OptionOrNullable<Address>;
|
|
41
|
+
atlasMint: OptionOrNullable<Address>;
|
|
42
|
+
defaultPaymentFrequency: OptionOrNullable<PaymentFrequencyArgs>;
|
|
43
|
+
allowedFrequencies: OptionOrNullable<Array<PaymentFrequencyArgs>>;
|
|
44
|
+
};
|
|
45
|
+
export declare function getUpdateConfigInstructionDataEncoder(): Encoder<UpdateConfigInstructionDataArgs>;
|
|
46
|
+
export declare function getUpdateConfigInstructionDataDecoder(): Decoder<UpdateConfigInstructionData>;
|
|
47
|
+
export declare function getUpdateConfigInstructionDataCodec(): Codec<UpdateConfigInstructionDataArgs, UpdateConfigInstructionData>;
|
|
48
|
+
export type UpdateConfigAsyncInput<TAccountConfig extends string = string, TAccountAuthority extends string = string> = {
|
|
49
|
+
config?: Address<TAccountConfig>;
|
|
50
|
+
authority: TransactionSigner<TAccountAuthority>;
|
|
51
|
+
authorityArg: UpdateConfigInstructionDataArgs['authority'];
|
|
52
|
+
stardustToAtlas: UpdateConfigInstructionDataArgs['stardustToAtlas'];
|
|
53
|
+
serviceFeeBps: UpdateConfigInstructionDataArgs['serviceFeeBps'];
|
|
54
|
+
referralFeeBps: UpdateConfigInstructionDataArgs['referralFeeBps'];
|
|
55
|
+
baseBps: UpdateConfigInstructionDataArgs['baseBps'];
|
|
56
|
+
rentalDurationMinSeconds: UpdateConfigInstructionDataArgs['rentalDurationMinSeconds'];
|
|
57
|
+
rentalDurationMaxSeconds: UpdateConfigInstructionDataArgs['rentalDurationMaxSeconds'];
|
|
58
|
+
feesAccount: UpdateConfigInstructionDataArgs['feesAccount'];
|
|
59
|
+
atlasMint: UpdateConfigInstructionDataArgs['atlasMint'];
|
|
60
|
+
defaultPaymentFrequency: UpdateConfigInstructionDataArgs['defaultPaymentFrequency'];
|
|
61
|
+
allowedFrequencies: UpdateConfigInstructionDataArgs['allowedFrequencies'];
|
|
62
|
+
};
|
|
63
|
+
export declare function getUpdateConfigInstructionAsync<TAccountConfig extends string, TAccountAuthority extends string, TProgramAddress extends Address = typeof SRSLY_PROGRAM_ADDRESS>(input: UpdateConfigAsyncInput<TAccountConfig, TAccountAuthority>, config?: {
|
|
64
|
+
programAddress?: TProgramAddress;
|
|
65
|
+
}): Promise<UpdateConfigInstruction<TProgramAddress, TAccountConfig, TAccountAuthority>>;
|
|
66
|
+
export type UpdateConfigInput<TAccountConfig extends string = string, TAccountAuthority extends string = string> = {
|
|
67
|
+
config: Address<TAccountConfig>;
|
|
68
|
+
authority: TransactionSigner<TAccountAuthority>;
|
|
69
|
+
authorityArg: UpdateConfigInstructionDataArgs['authority'];
|
|
70
|
+
stardustToAtlas: UpdateConfigInstructionDataArgs['stardustToAtlas'];
|
|
71
|
+
serviceFeeBps: UpdateConfigInstructionDataArgs['serviceFeeBps'];
|
|
72
|
+
referralFeeBps: UpdateConfigInstructionDataArgs['referralFeeBps'];
|
|
73
|
+
baseBps: UpdateConfigInstructionDataArgs['baseBps'];
|
|
74
|
+
rentalDurationMinSeconds: UpdateConfigInstructionDataArgs['rentalDurationMinSeconds'];
|
|
75
|
+
rentalDurationMaxSeconds: UpdateConfigInstructionDataArgs['rentalDurationMaxSeconds'];
|
|
76
|
+
feesAccount: UpdateConfigInstructionDataArgs['feesAccount'];
|
|
77
|
+
atlasMint: UpdateConfigInstructionDataArgs['atlasMint'];
|
|
78
|
+
defaultPaymentFrequency: UpdateConfigInstructionDataArgs['defaultPaymentFrequency'];
|
|
79
|
+
allowedFrequencies: UpdateConfigInstructionDataArgs['allowedFrequencies'];
|
|
80
|
+
};
|
|
81
|
+
export declare function getUpdateConfigInstruction<TAccountConfig extends string, TAccountAuthority extends string, TProgramAddress extends Address = typeof SRSLY_PROGRAM_ADDRESS>(input: UpdateConfigInput<TAccountConfig, TAccountAuthority>, config?: {
|
|
82
|
+
programAddress?: TProgramAddress;
|
|
83
|
+
}): UpdateConfigInstruction<TProgramAddress, TAccountConfig, TAccountAuthority>;
|
|
84
|
+
export type ParsedUpdateConfigInstruction<TProgram extends string = typeof SRSLY_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
|
|
85
|
+
programAddress: Address<TProgram>;
|
|
86
|
+
accounts: {
|
|
87
|
+
config: TAccountMetas[0];
|
|
88
|
+
authority: TAccountMetas[1];
|
|
89
|
+
};
|
|
90
|
+
data: UpdateConfigInstructionData;
|
|
91
|
+
};
|
|
92
|
+
export declare function parseUpdateConfigInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedUpdateConfigInstruction<TProgram, TAccountMetas>;
|
|
93
|
+
//# sourceMappingURL=updateConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateConfig.d.ts","sourceRoot":"","sources":["../../../../src/codama/instructions/updateConfig.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAkBL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAC1B,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,2BAA2B,yBAEtC,CAAC;AAEH,wBAAgB,iCAAiC,uBAIhD;AAED,MAAM,MAAM,uBAAuB,CACjC,QAAQ,SAAS,MAAM,GAAG,OAAO,qBAAqB,EACtD,cAAc,SAAS,MA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 @@
|
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
8
|
import { type Address, type ReadonlyUint8Array } from '@solana/kit';
|
|
9
|
-
import { type ParsedAcceptRentalInstruction, type ParsedCancelRentalInstruction, type ParsedCloseContractInstruction, type ParsedCloseRentalInstruction, type ParsedCreateContractInstruction, type
|
|
9
|
+
import { type ParsedAcceptRentalInstruction, type ParsedCancelRentalInstruction, type ParsedCloseContractInstruction, type ParsedCloseRentalInstruction, type ParsedCreateContractInstruction, type ParsedInitializeConfigInstruction, type ParsedPayRentalInstruction, type ParsedResetRentalInstruction, type ParsedUpdateConfigInstruction } from '../instructions';
|
|
10
10
|
export declare const SRSLY_PROGRAM_ADDRESS: Address<"SRSLY1fq9TJqCk1gNSE7VZL2bztvTn9wm4VR8u8jMKT">;
|
|
11
11
|
export declare enum SrslyAccount {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
Config = 0,
|
|
13
|
+
ContractState = 1,
|
|
14
14
|
RentalState = 2,
|
|
15
15
|
Thread = 3
|
|
16
16
|
}
|
|
@@ -23,9 +23,10 @@ export declare enum SrslyInstruction {
|
|
|
23
23
|
CloseContract = 2,
|
|
24
24
|
CloseRental = 3,
|
|
25
25
|
CreateContract = 4,
|
|
26
|
-
|
|
26
|
+
InitializeConfig = 5,
|
|
27
27
|
PayRental = 6,
|
|
28
|
-
ResetRental = 7
|
|
28
|
+
ResetRental = 7,
|
|
29
|
+
UpdateConfig = 8
|
|
29
30
|
}
|
|
30
31
|
export declare function identifySrslyInstruction(instruction: {
|
|
31
32
|
data: ReadonlyUint8Array;
|
|
@@ -41,10 +42,12 @@ export type ParsedSrslyInstruction<TProgram extends string = 'SRSLY1fq9TJqCk1gNS
|
|
|
41
42
|
} & ParsedCloseRentalInstruction<TProgram>) | ({
|
|
42
43
|
instructionType: SrslyInstruction.CreateContract;
|
|
43
44
|
} & ParsedCreateContractInstruction<TProgram>) | ({
|
|
44
|
-
instructionType: SrslyInstruction.
|
|
45
|
-
} &
|
|
45
|
+
instructionType: SrslyInstruction.InitializeConfig;
|
|
46
|
+
} & ParsedInitializeConfigInstruction<TProgram>) | ({
|
|
46
47
|
instructionType: SrslyInstruction.PayRental;
|
|
47
48
|
} & ParsedPayRentalInstruction<TProgram>) | ({
|
|
48
49
|
instructionType: SrslyInstruction.ResetRental;
|
|
49
|
-
} & ParsedResetRentalInstruction<TProgram>)
|
|
50
|
+
} & ParsedResetRentalInstruction<TProgram>) | ({
|
|
51
|
+
instructionType: SrslyInstruction.UpdateConfig;
|
|
52
|
+
} & ParsedUpdateConfigInstruction<TProgram>);
|
|
50
53
|
//# sourceMappingURL=srsly.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"srsly.d.ts","sourceRoot":"","sources":["../../../../src/codama/programs/srsly.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EACpC,KAAK
|
|
1
|
+
{"version":3,"file":"srsly.d.ts","sourceRoot":"","sources":["../../../../src/codama/programs/srsly.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,EACtC,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EACnC,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,qBAAqB,EACiB,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAE1G,oBAAY,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C7C,GAAG,0BAA0B,CAAC,QAAQ,CAAC,CAAC,GACzC,CAAC;IACC,eAAe,EAAE,gBAAgB,CAAC,WAAW,CAAC;CAC/C,GAAG,4BAA4B,CAAC,QAAQ,CAAC,CAAC,GAC3C,CAAC;IACC,eAAe,EAAE,gBAAgB,CAAC,YAAY,CAAC;CAChD,GAAG,6BAA6B,CAAC,QAAQ,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Address, TransactionSigner } from '@solana/kit';
|
|
2
|
-
import {
|
|
2
|
+
import { type ConfigSelector } from '../utils/config';
|
|
3
|
+
type CloseContractInstruction = any;
|
|
3
4
|
/**
|
|
4
5
|
* Simplified parameters for closing a rental contract
|
|
5
6
|
*/
|
|
@@ -11,11 +12,11 @@ export interface CloseContractParams {
|
|
|
11
12
|
/**
|
|
12
13
|
* The fleet account address associated with the contract
|
|
13
14
|
*/
|
|
14
|
-
fleet: Address<string>;
|
|
15
|
+
fleet: string | Address<string>;
|
|
15
16
|
/**
|
|
16
17
|
* The rental contract account address to close
|
|
17
18
|
*/
|
|
18
|
-
contract: Address<string>;
|
|
19
|
+
contract: string | Address<string>;
|
|
19
20
|
/**
|
|
20
21
|
* Optional faction (1 = mud, 2 = oni, 3 = ustur)
|
|
21
22
|
* Or as string: 'mud', 'oni', 'ustur'
|
|
@@ -23,34 +24,29 @@ export interface CloseContractParams {
|
|
|
23
24
|
faction: number | string;
|
|
24
25
|
/**
|
|
25
26
|
* The game ID account address
|
|
26
|
-
*
|
|
27
|
+
* If not provided, will use network-specific default
|
|
27
28
|
*/
|
|
28
|
-
gameId?: Address<string>;
|
|
29
|
+
gameId?: string | Address<string>;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
32
|
+
* Creates an instruction to close a rental contract with fluent configuration.
|
|
33
|
+
*
|
|
34
|
+
* @param params The contract closing parameters
|
|
35
|
+
* @returns A ConfigSelector that can be configured with .set() or awaited directly
|
|
33
36
|
*
|
|
34
37
|
* @example
|
|
35
38
|
* ```typescript
|
|
36
|
-
* //
|
|
37
|
-
*
|
|
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
|
-
* });
|
|
39
|
+
* // Use devnet defaults
|
|
40
|
+
* await closeContract(params);
|
|
45
41
|
*
|
|
46
|
-
* //
|
|
47
|
-
*
|
|
48
|
-
* await sendAndConfirmTransaction(connection, tx, [wallet]);
|
|
49
|
-
* ```
|
|
42
|
+
* // Use mainnet
|
|
43
|
+
* await closeContract(params).set({ network: 'mainnet' });
|
|
50
44
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
45
|
+
* // Override game ID
|
|
46
|
+
* await closeContract(params).set({ gameId: 'custom...' });
|
|
47
|
+
* ```
|
|
53
48
|
*/
|
|
54
|
-
export declare function closeContract(params: CloseContractParams):
|
|
55
|
-
export
|
|
49
|
+
export declare function closeContract(params: CloseContractParams): ConfigSelector<CloseContractInstruction>;
|
|
50
|
+
export declare function getCloseContractInstructionAsync(input: any, options?: any): ConfigSelector<any>;
|
|
51
|
+
export {};
|
|
56
52
|
//# sourceMappingURL=close.d.ts.map
|
|
@@ -1 +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,
|
|
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,EAAmC,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAI3G,KAAK,wBAAwB,GAAG,GAAG,CAAC;AAMpC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnC;;;OAGG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnC;AA0FD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,mBAAmB,GAC1B,cAAc,CAAC,wBAAwB,CAAC,CAE1C;AAGD,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAK/F"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Address, TransactionSigner } from '@solana/kit';
|
|
2
|
-
import {
|
|
2
|
+
import { type ConfigSelector } from '../utils/config';
|
|
3
|
+
type CreateContractInstruction = any;
|
|
3
4
|
/**
|
|
4
5
|
* Simplified parameters for creating a rental contract
|
|
5
6
|
*/
|
|
@@ -11,11 +12,11 @@ export interface CreateContractParams {
|
|
|
11
12
|
/**
|
|
12
13
|
* The fleet account address to be rented out
|
|
13
14
|
*/
|
|
14
|
-
fleet: Address<string>;
|
|
15
|
+
fleet: string | Address<string>;
|
|
15
16
|
/**
|
|
16
17
|
* The owner's profile account address
|
|
17
18
|
*/
|
|
18
|
-
ownerProfile: Address<string>;
|
|
19
|
+
ownerProfile: string | Address<string>;
|
|
19
20
|
/**
|
|
20
21
|
* The rental rate in ATLAS tokens
|
|
21
22
|
*/
|
|
@@ -39,35 +40,46 @@ export interface CreateContractParams {
|
|
|
39
40
|
ownerKeyIndex?: number;
|
|
40
41
|
/**
|
|
41
42
|
* The game ID account address
|
|
42
|
-
*
|
|
43
|
+
* If not provided, will use network-specific default
|
|
43
44
|
*/
|
|
44
|
-
gameId?: Address<string>;
|
|
45
|
+
gameId?: string | Address<string>;
|
|
46
|
+
/**
|
|
47
|
+
* The ATLAS mint address
|
|
48
|
+
* If not provided, will use the default ATLAS mint
|
|
49
|
+
*/
|
|
50
|
+
mint?: string | Address<string>;
|
|
45
51
|
}
|
|
46
52
|
/**
|
|
47
|
-
*
|
|
48
|
-
* Derives ownerTokenAccount, contract, and rentalAuthority automatically if not provided.
|
|
53
|
+
* Creates an instruction to create a rental contract with fluent configuration.
|
|
49
54
|
*
|
|
50
55
|
* @example
|
|
51
56
|
* ```typescript
|
|
52
|
-
* //
|
|
53
|
-
* const ix = await createContract(
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
57
|
+
* // Use devnet defaults
|
|
58
|
+
* const ix = await createContract(params);
|
|
59
|
+
*
|
|
60
|
+
* // Use mainnet configuration
|
|
61
|
+
* const ix = await createContract(params).set({ network: 'mainnet' });
|
|
62
|
+
*
|
|
63
|
+
* // Override specific constants
|
|
64
|
+
* const ix = await createContract(params).set({
|
|
65
|
+
* network: 'mainnet',
|
|
66
|
+
* gameId: 'custom-game-id...',
|
|
67
|
+
* sageProgramAddress: 'custom-sage...'
|
|
61
68
|
* });
|
|
62
69
|
*
|
|
63
|
-
* //
|
|
64
|
-
* const
|
|
65
|
-
*
|
|
70
|
+
* // Chain configurations
|
|
71
|
+
* const ix = await createContract(params)
|
|
72
|
+
* .set({ network: 'devnet' })
|
|
73
|
+
* .set({ gameId: 'override-game...' });
|
|
66
74
|
* ```
|
|
67
75
|
*
|
|
68
76
|
* @param params The simplified parameters for creating a rental contract
|
|
69
|
-
* @returns A
|
|
77
|
+
* @returns A ConfigSelector that can be configured with .set() or awaited directly
|
|
78
|
+
*/
|
|
79
|
+
export declare function createContract(params: CreateContractParams): ConfigSelector<CreateContractInstruction>;
|
|
80
|
+
/**
|
|
81
|
+
* Export config selector for getCreateContractInstructionAsync
|
|
70
82
|
*/
|
|
71
|
-
export declare function
|
|
72
|
-
export {
|
|
83
|
+
export declare function getCreateContractInstructionAsync(input: any, options?: any): ConfigSelector<any>;
|
|
84
|
+
export {};
|
|
73
85
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +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,
|
|
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,EAAmC,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAI3G,KAAK,yBAAyB,GAAG,GAAG,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvC;;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,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAElC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC;AAuDD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,oBAAoB,GAC3B,cAAc,CAAC,yBAAyB,CAAC,CAE3C;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAKhG"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export * from "./codama/index";
|
|
2
1
|
export * from "./contract";
|
|
2
|
+
export * from "./rental";
|
|
3
|
+
export * from "./utils";
|
|
4
|
+
export type { ContractState, RentalState, CreateContractInstruction, AcceptRentalInstruction, CancelRentalInstruction, CloseRentalInstruction, CloseContractInstruction, ResetRentalInstruction, ClockData, ThreadResponse } from "./codama";
|
|
5
|
+
export { PaymentFrequency } from "./utils/constants";
|
|
3
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAIxB,YAAY,EAEV,aAAa,EACb,WAAW,EAGX,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EAGtB,SAAS,EACT,cAAc,EACf,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Address, TransactionSigner } from '@solana/kit';
|
|
2
|
-
import {
|
|
2
|
+
import { type ConfigSelector } from '../utils/config';
|
|
3
|
+
type AcceptRentalInstruction = any;
|
|
3
4
|
/**
|
|
4
5
|
* Simplified parameters for accepting a rental
|
|
5
6
|
*/
|
|
@@ -11,7 +12,7 @@ export interface AcceptRentalParams {
|
|
|
11
12
|
/**
|
|
12
13
|
* The borrower's profile account address
|
|
13
14
|
*/
|
|
14
|
-
borrowerProfile: Address<string>;
|
|
15
|
+
borrowerProfile: string | Address<string>;
|
|
15
16
|
/**
|
|
16
17
|
* The borrower's faction (1 = mud, 2 = oni, 3 = ustur)
|
|
17
18
|
* Or as string: 'mud', 'oni', 'ustur'
|
|
@@ -20,51 +21,72 @@ export interface AcceptRentalParams {
|
|
|
20
21
|
/**
|
|
21
22
|
* The fleet account address that will be rented
|
|
22
23
|
*/
|
|
23
|
-
fleet: Address<string>;
|
|
24
|
+
fleet: string | Address<string>;
|
|
24
25
|
/**
|
|
25
26
|
* The rental contract account address
|
|
26
27
|
*/
|
|
27
|
-
contract: Address<string>;
|
|
28
|
+
contract: string | Address<string>;
|
|
28
29
|
/**
|
|
29
30
|
* The game ID account address
|
|
30
|
-
*
|
|
31
|
+
* If not provided, will use network-specific default
|
|
31
32
|
*/
|
|
32
|
-
gameId?: Address<string>;
|
|
33
|
+
gameId?: string | Address<string>;
|
|
33
34
|
/**
|
|
34
|
-
* The rental
|
|
35
|
+
* The rental rate (in ATLAS tokens)
|
|
35
36
|
*/
|
|
36
|
-
|
|
37
|
+
rate: number | bigint;
|
|
37
38
|
/**
|
|
38
39
|
* The rental duration (in seconds)
|
|
39
40
|
*/
|
|
40
41
|
duration: number | bigint;
|
|
42
|
+
/**
|
|
43
|
+
* Optional referral token account address
|
|
44
|
+
* If provided, referrer will receive 5% of the platform fees
|
|
45
|
+
*/
|
|
46
|
+
referralTokenAccount?: string | Address<string>;
|
|
41
47
|
}
|
|
42
48
|
/**
|
|
43
|
-
*
|
|
44
|
-
* Derives borrowerProfileFaction, starbase, and starbasePlayer automatically.
|
|
49
|
+
* Creates an instruction to accept a rental with fluent configuration.
|
|
45
50
|
*
|
|
46
51
|
* @example
|
|
47
52
|
* ```typescript
|
|
48
|
-
* //
|
|
53
|
+
* // Use devnet defaults
|
|
49
54
|
* const ix = await acceptRental({
|
|
50
55
|
* borrower: wallet,
|
|
51
56
|
* borrowerProfile: profileAddress,
|
|
52
57
|
* borrowerFaction: 1, // 1 = mud, 2 = oni, 3 = ustur
|
|
53
58
|
* fleet: fleetAddress,
|
|
54
59
|
* contract: contractAddress,
|
|
55
|
-
*
|
|
56
|
-
* duration: 86400 // 1 day in seconds
|
|
57
|
-
* // gameId is optional and will default to the standard game ID
|
|
60
|
+
* rate: 1000, // ATLAS tokens
|
|
61
|
+
* duration: 86400 // 1 day in seconds (total: 1000 * 86400 * 100M stardust)
|
|
58
62
|
* });
|
|
59
63
|
*
|
|
60
|
-
* //
|
|
61
|
-
* const
|
|
62
|
-
*
|
|
64
|
+
* // With referral (referrer gets 5% of platform fees)
|
|
65
|
+
* const ix = await acceptRental({
|
|
66
|
+
* borrower: wallet,
|
|
67
|
+
* borrowerProfile: profileAddress,
|
|
68
|
+
* borrowerFaction: 1,
|
|
69
|
+
* fleet: fleetAddress,
|
|
70
|
+
* contract: contractAddress,
|
|
71
|
+
* rate: 1000,
|
|
72
|
+
* duration: 86400,
|
|
73
|
+
* referralTokenAccount: referrerTokenAddress
|
|
74
|
+
* });
|
|
75
|
+
*
|
|
76
|
+
* // Use mainnet configuration
|
|
77
|
+
* const ix = await acceptRental(params).set({ network: 'mainnet' });
|
|
78
|
+
*
|
|
79
|
+
* // Override specific constants
|
|
80
|
+
* const ix = await acceptRental(params).set({
|
|
81
|
+
* network: 'mainnet',
|
|
82
|
+
* gameId: 'custom-game-id...'
|
|
83
|
+
* });
|
|
63
84
|
* ```
|
|
64
85
|
*
|
|
65
86
|
* @param params The simplified parameters for accepting a rental
|
|
66
|
-
* @returns A
|
|
87
|
+
* @returns A ConfigSelector that can be configured with .set() or awaited directly
|
|
67
88
|
*/
|
|
68
|
-
export declare function acceptRental(params: AcceptRentalParams):
|
|
69
|
-
export
|
|
89
|
+
export declare function acceptRental(params: AcceptRentalParams): ConfigSelector<AcceptRentalInstruction>;
|
|
90
|
+
export declare function getAcceptRentalInstructionAsync(input: any, options?: any): ConfigSelector<any>;
|
|
91
|
+
export {};
|
|
70
92
|
//# sourceMappingURL=accept.d.ts.map
|
|
@@ -1 +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,
|
|
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,EAAmC,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAK3G,KAAK,uBAAuB,GAAG,GAAG,CAAC;AAMnC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEpC;;OAEG;IACH,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;;OAGG;IACH,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC;IAEjC;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAElC;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAE1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACjD;AAoED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,kBAAkB,GACzB,cAAc,CAAC,uBAAuB,CAAC,CAEzC;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAK9F"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Address, TransactionSigner } from '@solana/kit';
|
|
2
|
-
import {
|
|
2
|
+
import { type ConfigSelector } from '../utils/config';
|
|
3
|
+
type CancelRentalInstruction = any;
|
|
3
4
|
/**
|
|
4
5
|
* Simplified parameters for canceling a rental
|
|
5
6
|
*/
|
|
@@ -14,26 +15,30 @@ export interface CancelRentalParams {
|
|
|
14
15
|
contract: Address<string>;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
-
* Derives rentalState, rentalThread, borrowerTokenAccount, rentalTokenAccount and
|
|
19
|
-
* rentalAuthority automatically if not provided.
|
|
18
|
+
* Creates an instruction to cancel a rental with fluent configuration.
|
|
20
19
|
*
|
|
21
20
|
* @example
|
|
22
21
|
* ```typescript
|
|
23
|
-
* //
|
|
22
|
+
* // Use devnet defaults
|
|
24
23
|
* const ix = await cancelRental({
|
|
25
24
|
* borrower: wallet,
|
|
26
25
|
* contract: contractAddress
|
|
27
26
|
* });
|
|
28
27
|
*
|
|
29
|
-
* //
|
|
30
|
-
* const
|
|
31
|
-
*
|
|
28
|
+
* // Use mainnet configuration
|
|
29
|
+
* const ix = await cancelRental(params).set({ network: 'mainnet' });
|
|
30
|
+
*
|
|
31
|
+
* // Override specific constants
|
|
32
|
+
* const ix = await cancelRental(params).set({
|
|
33
|
+
* network: 'mainnet',
|
|
34
|
+
* sageProgramAddress: 'custom...'
|
|
35
|
+
* });
|
|
32
36
|
* ```
|
|
33
37
|
*
|
|
34
38
|
* @param params The simplified parameters for canceling a rental
|
|
35
|
-
* @returns A
|
|
39
|
+
* @returns A ConfigSelector that can be configured with .set() or awaited directly
|
|
36
40
|
*/
|
|
37
|
-
export declare function cancelRental(params: CancelRentalParams):
|
|
38
|
-
export
|
|
41
|
+
export declare function cancelRental(params: CancelRentalParams): ConfigSelector<CancelRentalInstruction>;
|
|
42
|
+
export declare function getCancelRentalInstructionAsync(input: any, options?: any): ConfigSelector<any>;
|
|
43
|
+
export {};
|
|
39
44
|
//# sourceMappingURL=cancel.d.ts.map
|
|
@@ -1 +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,
|
|
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,EAAmC,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAG3G,KAAK,uBAAuB,GAAG,GAAG,CAAC;AAEnC;;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;AAgCD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,kBAAkB,GACzB,cAAc,CAAC,uBAAuB,CAAC,CAEzC;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAK9F"}
|