@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Address } from '@solana/kit';
|
|
2
|
-
import {
|
|
2
|
+
import { type ConfigSelector } from '../utils/config';
|
|
3
|
+
type CloseRentalInstruction = any;
|
|
3
4
|
/**
|
|
4
5
|
* Simplified parameters for closing a rental
|
|
5
6
|
*/
|
|
@@ -18,27 +19,31 @@ export interface CloseRentalParams {
|
|
|
18
19
|
contract: Address<string>;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
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.
|
|
22
|
+
* Creates an instruction to close a rental with fluent configuration.
|
|
24
23
|
*
|
|
25
24
|
* @example
|
|
26
25
|
* ```typescript
|
|
27
|
-
* //
|
|
26
|
+
* // Use devnet defaults
|
|
28
27
|
* const ix = await closeRental({
|
|
29
28
|
* borrower: borrowerAddress,
|
|
30
29
|
* ownerTokenAccount: ownerTokenAccountAddress,
|
|
31
30
|
* contract: contractAddress
|
|
32
31
|
* });
|
|
33
32
|
*
|
|
34
|
-
* //
|
|
35
|
-
* const
|
|
36
|
-
*
|
|
33
|
+
* // Use mainnet configuration
|
|
34
|
+
* const ix = await closeRental(params).set({ network: 'mainnet' });
|
|
35
|
+
*
|
|
36
|
+
* // Override specific constants
|
|
37
|
+
* const ix = await closeRental(params).set({
|
|
38
|
+
* network: 'mainnet',
|
|
39
|
+
* sageProgramAddress: 'custom...'
|
|
40
|
+
* });
|
|
37
41
|
* ```
|
|
38
42
|
*
|
|
39
43
|
* @param params The simplified parameters for closing a rental
|
|
40
|
-
* @returns A
|
|
44
|
+
* @returns A ConfigSelector that can be configured with .set() or awaited directly
|
|
41
45
|
*/
|
|
42
|
-
export declare function closeRental(params: CloseRentalParams):
|
|
43
|
-
export
|
|
46
|
+
export declare function closeRental(params: CloseRentalParams): ConfigSelector<CloseRentalInstruction>;
|
|
47
|
+
export declare function getCloseRentalInstructionAsync(input: any, options?: any): ConfigSelector<any>;
|
|
48
|
+
export {};
|
|
44
49
|
//# sourceMappingURL=close.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../src/rental/close.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACR,MAAM,aAAa,CAAC;AAErB,OAAO,
|
|
1
|
+
{"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../src/rental/close.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACR,MAAM,aAAa,CAAC;AAErB,OAAO,EAAmC,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAG3G,KAAK,sBAAsB,GAAG,GAAG,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1B;;OAEG;IACH,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3B;AAkCD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,GACxB,cAAc,CAAC,sBAAsB,CAAC,CAExC;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAK7F"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Address } from '@solana/kit';
|
|
2
|
-
import {
|
|
2
|
+
import { type ConfigSelector } from '../utils/config';
|
|
3
|
+
type ResetRentalInstruction = any;
|
|
3
4
|
/**
|
|
4
5
|
* Simplified parameters for resetting a rental
|
|
5
6
|
*/
|
|
@@ -18,7 +19,7 @@ export interface ResetRentalParams {
|
|
|
18
19
|
rentalState: Address<string>;
|
|
19
20
|
/**
|
|
20
21
|
* The game ID account address
|
|
21
|
-
*
|
|
22
|
+
* If not provided, will use network-specific default
|
|
22
23
|
*/
|
|
23
24
|
gameId?: Address<string>;
|
|
24
25
|
/**
|
|
@@ -34,13 +35,11 @@ export interface ResetRentalParams {
|
|
|
34
35
|
ownerProfile: Address<string>;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
|
-
*
|
|
38
|
-
* This is used to reset a fleet's rental state after a rental has ended.
|
|
39
|
-
* Can derive starbase, starbasePlayer, and rentalAuthority automatically.
|
|
38
|
+
* Creates an instruction to reset a rental with fluent configuration.
|
|
40
39
|
*
|
|
41
40
|
* @example
|
|
42
41
|
* ```typescript
|
|
43
|
-
* //
|
|
42
|
+
* // Use devnet defaults
|
|
44
43
|
* const ix = await resetRental({
|
|
45
44
|
* fleet: fleetAddress,
|
|
46
45
|
* contract: contractAddress,
|
|
@@ -49,23 +48,21 @@ export interface ResetRentalParams {
|
|
|
49
48
|
* ownerProfile: ownerProfileAddress
|
|
50
49
|
* });
|
|
51
50
|
*
|
|
52
|
-
* //
|
|
53
|
-
* const ix = await resetRental({
|
|
54
|
-
* fleet: fleetAddress,
|
|
55
|
-
* contract: contractAddress,
|
|
56
|
-
* rentalState: rentalStateAddress,
|
|
57
|
-
* starbase: starbaseAddress,
|
|
58
|
-
* starbasePlayer: starbasePlayerAddress
|
|
59
|
-
* });
|
|
51
|
+
* // Use mainnet configuration
|
|
52
|
+
* const ix = await resetRental(params).set({ network: 'mainnet' });
|
|
60
53
|
*
|
|
61
|
-
* //
|
|
62
|
-
* const
|
|
63
|
-
*
|
|
54
|
+
* // Override specific constants
|
|
55
|
+
* const ix = await resetRental(params).set({
|
|
56
|
+
* network: 'mainnet',
|
|
57
|
+
* gameId: 'custom-game-id...',
|
|
58
|
+
* sageProgramAddress: 'custom...'
|
|
59
|
+
* });
|
|
64
60
|
* ```
|
|
65
61
|
*
|
|
66
62
|
* @param params The simplified parameters for resetting a rental
|
|
67
|
-
* @returns A
|
|
63
|
+
* @returns A ConfigSelector that can be configured with .set() or awaited directly
|
|
68
64
|
*/
|
|
69
|
-
export declare function resetRental(params: ResetRentalParams):
|
|
70
|
-
export
|
|
65
|
+
export declare function resetRental(params: ResetRentalParams): ConfigSelector<ResetRentalInstruction>;
|
|
66
|
+
export declare function getResetRentalInstructionAsync(input: any, options?: any): ConfigSelector<any>;
|
|
67
|
+
export {};
|
|
71
68
|
//# sourceMappingURL=reset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../../src/rental/reset.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACR,MAAM,aAAa,CAAC;AAErB,OAAO,
|
|
1
|
+
{"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../../src/rental/reset.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACR,MAAM,aAAa,CAAC;AAErB,OAAO,EAAmC,KAAK,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AAI3G,KAAK,sBAAsB,GAAG,GAAG,CAAC;AAMlC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzB;;;;OAIG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/B;AAuDD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,GACxB,cAAc,CAAC,sBAAsB,CAAC,CAExC;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAK7F"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network configuration for the SRSLY SDK
|
|
3
|
+
*/
|
|
4
|
+
import { type Address, type TransactionSigner } from '@solana/kit';
|
|
5
|
+
export type ProgramSet = 'mainnet' | 'atlasnet' | 'holosim';
|
|
6
|
+
/**
|
|
7
|
+
* Configuration options that can be set globally or overridden per call
|
|
8
|
+
*/
|
|
9
|
+
export interface ConfigOptions {
|
|
10
|
+
programs?: ProgramSet;
|
|
11
|
+
srslyProgramAddress?: string;
|
|
12
|
+
profileFactionProgramAddress?: string;
|
|
13
|
+
gameId?: string;
|
|
14
|
+
atlasMint?: string;
|
|
15
|
+
rpcUrl?: string;
|
|
16
|
+
transactionOptions?: {
|
|
17
|
+
commitment?: 'processed' | 'confirmed' | 'finalized';
|
|
18
|
+
skipPreflight?: boolean;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Resolve program addresses based on configuration
|
|
23
|
+
* @param config Effective configuration options
|
|
24
|
+
* @returns Resolved program addresses
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveProgramAddresses(config: ConfigOptions): {
|
|
27
|
+
srslyProgramAddress: string;
|
|
28
|
+
sageProgramAddress: "SAGE2HAwep459SNq61LHvjxPk4pLPEJLoMETef7f7EE" | "SAgeTraQfBMdvGVDJYoEvjnbq5szW7RJPi6obDTDQUF";
|
|
29
|
+
profileFactionProgramAddress: string;
|
|
30
|
+
gameId: string;
|
|
31
|
+
atlasMint: string;
|
|
32
|
+
rpcUrl: any;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Set global configuration options that will be used as defaults for all SDK operations
|
|
36
|
+
* @param config Configuration options to set globally
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* // Use default atlasnet program addresses
|
|
41
|
+
* setConfig({ programs: 'atlasnet' });
|
|
42
|
+
*
|
|
43
|
+
* // Use holosim program addresses
|
|
44
|
+
* setConfig({ programs: 'holosim' });
|
|
45
|
+
*
|
|
46
|
+
* // Use holosim program addresses with custom game ID
|
|
47
|
+
* setConfig({
|
|
48
|
+
* programs: 'holosim',
|
|
49
|
+
* gameId: 'custom-game-id...'
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* // Can still override per instruction
|
|
53
|
+
* await createContract(params).set({ srslyProgramAddress: 'custom...' });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function setConfig(config: ConfigOptions): void;
|
|
57
|
+
/**
|
|
58
|
+
* Get the current global configuration
|
|
59
|
+
* @returns Current global configuration options
|
|
60
|
+
*/
|
|
61
|
+
export declare function getConfig(): ConfigOptions;
|
|
62
|
+
/**
|
|
63
|
+
* Clear global configuration (resets to atlasnet program set defaults)
|
|
64
|
+
*/
|
|
65
|
+
export declare function clearConfig(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Get the single codama module (network agnostic)
|
|
68
|
+
* @param modulePath The module type ('instructions' or 'programs')
|
|
69
|
+
* @returns The codama module
|
|
70
|
+
*/
|
|
71
|
+
export declare function getModule(modulePath: 'instructions' | 'programs'): any;
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated Use getModule instead. This function is kept for backward compatibility.
|
|
74
|
+
* Get codama modules (network agnostic)
|
|
75
|
+
*/
|
|
76
|
+
export declare function getCachedNetworkModule<T = any>(modulePath: string): Promise<T>;
|
|
77
|
+
/**
|
|
78
|
+
* Interface for a packed transaction that can be sent or used with wallet adapters
|
|
79
|
+
*/
|
|
80
|
+
export interface PackedTransaction {
|
|
81
|
+
/** Raw transaction message bytes compatible with web3.js VersionedTransaction.deserialize() */
|
|
82
|
+
messageBytes: Uint8Array;
|
|
83
|
+
/** Transaction signature map (empty for unsigned transactions) */
|
|
84
|
+
signatures: any;
|
|
85
|
+
/**
|
|
86
|
+
* Send the packed transaction using @solana/kit (for server-side/CLI usage)
|
|
87
|
+
*
|
|
88
|
+
* @param signer The transaction signer that will sign and pay for the transaction
|
|
89
|
+
* @returns Promise resolving to the transaction signature
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* import { createKeyPairSignerFromBytes } from '@solana/kit';
|
|
94
|
+
*
|
|
95
|
+
* // Create signer from keypair bytes
|
|
96
|
+
* const signer = await createKeyPairSignerFromBytes(keypairBytes);
|
|
97
|
+
*
|
|
98
|
+
* // Pack transaction, then send
|
|
99
|
+
* const signature = await createContract(params)
|
|
100
|
+
* .pack(signer.address)
|
|
101
|
+
* .send(signer);
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
send(signer: TransactionSigner): Promise<string>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Configuration selector for overriding network and constants
|
|
108
|
+
* Also implements PromiseLike to allow direct awaiting
|
|
109
|
+
*/
|
|
110
|
+
export interface ConfigSelector<T> extends PromiseLike<T> {
|
|
111
|
+
/**
|
|
112
|
+
* Set configuration options for this call
|
|
113
|
+
*/
|
|
114
|
+
set(options: ConfigOptions): ConfigSelector<T>;
|
|
115
|
+
/**
|
|
116
|
+
* Build with current configuration (explicit call)
|
|
117
|
+
*/
|
|
118
|
+
build(): Promise<T>;
|
|
119
|
+
/**
|
|
120
|
+
* Pack the instruction into an unsigned transaction ready for signing and sending
|
|
121
|
+
*
|
|
122
|
+
* @param feePayer The address that will pay for the transaction fees
|
|
123
|
+
* @returns Promise resolving to a PackedTransaction with send() method
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* // Option 1: Pack and send (server-side/CLI)
|
|
128
|
+
* import { createKeyPairSignerFromBytes } from '@solana/kit';
|
|
129
|
+
* const signer = await createKeyPairSignerFromBytes(keypairBytes);
|
|
130
|
+
* const signature = await createContract(params)
|
|
131
|
+
* .pack(signer.address)
|
|
132
|
+
* .send(signer);
|
|
133
|
+
*
|
|
134
|
+
* // Option 2: Pack for wallet adapter (browser)
|
|
135
|
+
* const packedTx = await createContract(params).pack(wallet.publicKey);
|
|
136
|
+
* import { VersionedTransaction } from '@solana/web3.js';
|
|
137
|
+
* const versionedTx = VersionedTransaction.deserialize(packedTx.messageBytes);
|
|
138
|
+
* const signedTx = await wallet.signTransaction(versionedTx);
|
|
139
|
+
* // ... send with connection.sendRawTransaction(signedTx.serialize())
|
|
140
|
+
*
|
|
141
|
+
* // Option 3: Get just the bytes for custom handling
|
|
142
|
+
* const txBytes = packedTx.messageBytes;
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
pack(feePayer: Address | string): Promise<PackedTransaction>;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Create the initial fluent config selector for a function.
|
|
149
|
+
* This is the main entry point for the fluent configuration API.
|
|
150
|
+
*
|
|
151
|
+
* The returned selector can be:
|
|
152
|
+
* - Awaited directly (uses global config + atlasnet fallback)
|
|
153
|
+
* - Configured with .set() to override network/constants
|
|
154
|
+
* - Chained with multiple .set() calls
|
|
155
|
+
*
|
|
156
|
+
* @param executeFn - The function to execute with optional configuration
|
|
157
|
+
* @returns A ConfigSelector that supports fluent configuration
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* // Usage patterns:
|
|
161
|
+
* setConfig({ programs: 'mainnet' });
|
|
162
|
+
* await createConfigSelector(executeFn) // Direct await (uses global config)
|
|
163
|
+
* await createConfigSelector(executeFn).set({...}) // Override global config
|
|
164
|
+
* await createConfigSelector(executeFn).set({...}).set({...}) // Chained configs
|
|
165
|
+
*/
|
|
166
|
+
export declare function createConfigSelector<T>(executeFn: (config?: ConfigOptions) => Promise<T>): ConfigSelector<T>;
|
|
167
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAcvB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAwB5D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE;QACnB,UAAU,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;QACrD,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;CACH;AAQD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,aAAa;;;;;;;EAkB5D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAErD;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,aAAa,CAEzC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAYD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,cAAc,GAAG,UAAU,GAAG,GAAG,CAEtE;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,GAAG,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAKpF;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,+FAA+F;IAC/F,YAAY,EAAE,UAAU,CAAC;IACzB,kEAAkE;IAClE,UAAU,EAAE,GAAG,CAAC;IAEhB;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IACvD;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IAE/C;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAEpB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC9D;AA8GD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,GAChD,cAAc,CAAC,CAAC,CAAC,CAsFnB"}
|
|
@@ -1,13 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type Address } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { type ConfigOptions } from './config';
|
|
2
|
+
import { type Address } from '@solana/kit';
|
|
3
|
+
/**
|
|
4
|
+
* Converts a string or Address to an Address type
|
|
5
|
+
* This utility ensures consistent address handling across the SDK
|
|
6
|
+
*/
|
|
7
|
+
export declare function toAddress(value: string | Address<string>): Address<string>;
|
|
7
8
|
export declare const STARBASE_SEED = "Starbase";
|
|
8
9
|
export declare const STARBASE_PLAYER_SEED = "starbase_player";
|
|
9
10
|
export declare const SAGE_PLAYER_PROFILE_SEED = "sage_player_profile";
|
|
10
11
|
export declare const PROFILE_FACTION_SEED = "profile_faction";
|
|
12
|
+
export declare const ATLAS_TO_STARDUST = 100000000;
|
|
13
|
+
export declare enum PaymentFrequency {
|
|
14
|
+
Hourly = 0,
|
|
15
|
+
Daily = 1,
|
|
16
|
+
DailyOld = 2,
|
|
17
|
+
Weekly = 3,
|
|
18
|
+
Monthly = 4,
|
|
19
|
+
Decasecond = 5,
|
|
20
|
+
Minute = 6
|
|
21
|
+
}
|
|
22
|
+
export declare function getSrslyProgramAddress(config?: ConfigOptions): Promise<Address<string>>;
|
|
23
|
+
export declare function getProgramId(): Promise<Address<string>>;
|
|
24
|
+
export declare function getSageProgramAddress(config?: ConfigOptions): Promise<Address<string>>;
|
|
25
|
+
export declare function getProfileFactionProgramAddress(config?: ConfigOptions): Promise<Address<string>>;
|
|
26
|
+
export declare function getSageGameId(config?: ConfigOptions): Promise<Address<string>>;
|
|
27
|
+
export declare function getAtlasMint(config?: ConfigOptions): Promise<Address<string>>;
|
|
11
28
|
export declare const FACTION_SPECIFIC_CSS: Record<string, {
|
|
12
29
|
x: number;
|
|
13
30
|
y: number;
|
|
@@ -17,5 +34,4 @@ export declare const FACTION_MAPPING: Record<number, string>;
|
|
|
17
34
|
* Convert PaymentFrequency enum to string
|
|
18
35
|
*/
|
|
19
36
|
export declare function paymentFrequencyToString(freq: PaymentFrequency): string;
|
|
20
|
-
export { PaymentFrequency };
|
|
21
37
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,EAAE,KAAK,OAAO,EAAW,MAAM,aAAa,CAAC;AAEpD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAE1E;AAGD,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AACtD,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAC9D,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAGtD,eAAO,MAAM,iBAAiB,YAAc,CAAC;AAG7C,oBAAY,gBAAgB;IAC1B,MAAM,IAAI;IACV,KAAK,IAAI;IACT,QAAQ,IAAI;IACZ,MAAM,IAAI;IACV,OAAO,IAAI;IAEX,UAAU,IAAI;IACd,MAAM,IAAI;CACX;AAID,wBAAsB,sBAAsB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAM7F;AAGD,wBAAsB,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAE7D;AAGD,wBAAsB,qBAAqB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAO5F;AAED,wBAAsB,+BAA+B,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAMtG;AAED,wBAAsB,aAAa,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAMpF;AAED,wBAAsB,YAAY,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAMnF;AAGD,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAIzE,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIlD,CAAC;AAEF;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAEvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -1,46 +1,52 @@
|
|
|
1
1
|
import { Address } from '@solana/kit';
|
|
2
|
+
import type { ConfigOptions } from './config';
|
|
2
3
|
/**
|
|
3
4
|
* Helper function to derive the borrower's profile faction account
|
|
4
5
|
*
|
|
5
6
|
* @param profile The borrower's profile address
|
|
7
|
+
* @param config Optional configuration for network-specific constants
|
|
6
8
|
* @returns Promise that resolves to the derived profile faction address
|
|
7
9
|
*/
|
|
8
|
-
export declare function deriveProfileFaction(profile: Address<string
|
|
10
|
+
export declare function deriveProfileFaction(profile: Address<string>, config?: ConfigOptions): Promise<Address<string>>;
|
|
9
11
|
/**
|
|
10
12
|
* Helper function to derive the sage player profile
|
|
11
13
|
*
|
|
12
14
|
* @param borrowerProfile The borrower's profile address
|
|
13
|
-
* @param gameId The game ID (
|
|
15
|
+
* @param gameId The game ID (if not provided, uses network-specific default)
|
|
16
|
+
* @param config Optional configuration for network-specific constants
|
|
14
17
|
* @returns Promise that resolves to the derived sage player profile address
|
|
15
18
|
*/
|
|
16
|
-
export declare function deriveSagePlayerProfile(borrowerProfile: Address<string>, gameId?: Address<string
|
|
19
|
+
export declare function deriveSagePlayerProfile(borrowerProfile: Address<string>, gameId?: Address<string>, config?: ConfigOptions): Promise<Address<string>>;
|
|
17
20
|
/**
|
|
18
21
|
* Helper function to derive the starbase address based on faction
|
|
19
22
|
*
|
|
20
23
|
* @param faction The faction (1/2/3 or 'mud'/'oni'/'ustur')
|
|
21
|
-
* @param gameId The game ID (
|
|
24
|
+
* @param gameId The game ID (if not provided, uses network-specific default)
|
|
25
|
+
* @param config Optional configuration for network-specific constants
|
|
22
26
|
* @returns Promise that resolves to the derived starbase address
|
|
23
27
|
*/
|
|
24
|
-
export declare function deriveStarbase(faction: number | string, gameId?: Address<string
|
|
28
|
+
export declare function deriveStarbase(faction: number | string, gameId?: Address<string>, config?: ConfigOptions): Promise<Address<string>>;
|
|
25
29
|
/**
|
|
26
30
|
* Helper function to derive the starbase player address
|
|
27
31
|
*
|
|
28
32
|
* @param sagePlayerProfile The sage player profile address
|
|
29
33
|
* @param starbase The starbase address
|
|
30
34
|
* @param starbaseSeqId The starbase sequence ID (defaults to 0)
|
|
35
|
+
* @param config Optional configuration for network-specific constants
|
|
31
36
|
* @returns Promise that resolves to the derived starbase player address
|
|
32
37
|
*/
|
|
33
|
-
export declare function deriveStarbasePlayer(sagePlayerProfile: Address<string>, starbase: Address<string>, starbaseSeqId?: number): Promise<Address<string>>;
|
|
38
|
+
export declare function deriveStarbasePlayer(sagePlayerProfile: Address<string>, starbase: Address<string>, starbaseSeqId?: number, config?: ConfigOptions): Promise<Address<string>>;
|
|
34
39
|
/**
|
|
35
40
|
* Derives all three accounts needed: profileFaction, starbase, and starbasePlayer
|
|
36
41
|
*
|
|
37
42
|
* @param profile The borrower's profile address
|
|
38
43
|
* @param faction The faction (1/2/3 or 'mud'/'oni'/'ustur')
|
|
39
|
-
* @param gameId The game ID (
|
|
44
|
+
* @param gameId The game ID (if not provided, uses network-specific default)
|
|
40
45
|
* @param starbaseSeqId The starbase sequence ID (defaults to 0)
|
|
46
|
+
* @param config Optional configuration for network-specific constants
|
|
41
47
|
* @returns Promise that resolves to the three derived addresses
|
|
42
48
|
*/
|
|
43
|
-
export declare function deriveGameAccounts(profile: Address<string>, faction: number | string, gameId?: Address<string>, starbaseSeqId?: number): Promise<{
|
|
49
|
+
export declare function deriveGameAccounts(profile: Address<string>, faction: number | string, gameId?: Address<string>, starbaseSeqId?: number, config?: ConfigOptions): Promise<{
|
|
44
50
|
profileFaction: Address<string>;
|
|
45
51
|
starbase: Address<string>;
|
|
46
52
|
starbasePlayer: Address<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../../src/utils/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAIR,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../../src/utils/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAIR,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAa9C;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,EACxB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAW1B;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,EAChC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EACxB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAe1B;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EACxB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAyC1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,EAClC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,EACzB,aAAa,GAAE,MAAU,EACzB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAmB1B;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,EACxB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EACxB,aAAa,GAAE,MAAU,EACzB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC;IACT,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC,CAAC,CA4BD"}
|
package/package.json
CHANGED
|
@@ -1,26 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wuwei-labs/srsly",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.21",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
7
7
|
"module": "./dist/esm/index.js",
|
|
8
8
|
"source": "./src/index.ts",
|
|
9
|
+
"sideEffects": false,
|
|
9
10
|
"publishConfig": {
|
|
10
11
|
"access": "public"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
14
|
"dist/cjs",
|
|
14
15
|
"dist/esm",
|
|
15
|
-
"dist/types"
|
|
16
|
+
"dist/types",
|
|
17
|
+
"target/idl/srsly.json",
|
|
18
|
+
"target/types/srsly.ts"
|
|
16
19
|
],
|
|
17
20
|
"exports": {
|
|
18
21
|
".": {
|
|
19
22
|
"types": "./dist/types/index.d.ts",
|
|
20
23
|
"require": "./dist/cjs/index.js",
|
|
21
24
|
"import": "./dist/esm/index.js",
|
|
22
|
-
"default": "./dist/
|
|
23
|
-
}
|
|
25
|
+
"default": "./dist/cjs/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./codama": {
|
|
28
|
+
"types": "./dist/types/codama/index.d.ts",
|
|
29
|
+
"require": "./dist/cjs/codama/index.js",
|
|
30
|
+
"import": "./dist/esm/codama/index.js",
|
|
31
|
+
"default": "./dist/cjs/codama/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./codama/*": {
|
|
34
|
+
"types": "./dist/types/codama/*",
|
|
35
|
+
"require": "./dist/cjs/codama/*",
|
|
36
|
+
"import": "./dist/esm/codama/*",
|
|
37
|
+
"default": "./dist/cjs/codama/*"
|
|
38
|
+
},
|
|
39
|
+
"./idl": "./target/idl/srsly.json",
|
|
40
|
+
"./types": "./target/types/srsly.ts"
|
|
24
41
|
},
|
|
25
42
|
"keywords": [
|
|
26
43
|
"SRSLY",
|
|
@@ -29,13 +46,16 @@
|
|
|
29
46
|
"sdk"
|
|
30
47
|
],
|
|
31
48
|
"scripts": {
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"clean": "rm -rf dist && cargo clean &&
|
|
49
|
+
"package": "pnpm run clean && pnpm build && pnpm run package:cjs && pnpm run package:esm && pnpm run generate",
|
|
50
|
+
"package:cjs": "tsc -p tsconfig.cjs.json && tsconfig-to-dual-package tsconfig.cjs.json",
|
|
51
|
+
"package:esm": "tsc -p tsconfig.esm.json && tsconfig-to-dual-package tsconfig.esm.json",
|
|
52
|
+
"clean": "rm -rf dist && cargo clean && pnpm install",
|
|
53
|
+
"generate": "node generate.mjs",
|
|
54
|
+
"build": "anchor build && pnpm run generate",
|
|
36
55
|
"docs": "typedoc",
|
|
37
|
-
"test": "vitest",
|
|
38
|
-
"
|
|
56
|
+
"test": "vitest run",
|
|
57
|
+
"test:watch": "vitest",
|
|
58
|
+
"test:coverage": "vitest run --coverage"
|
|
39
59
|
},
|
|
40
60
|
"author": "",
|
|
41
61
|
"license": "ISC",
|
|
@@ -43,14 +63,16 @@
|
|
|
43
63
|
"devDependencies": {
|
|
44
64
|
"@codama/nodes-from-anchor": "^1.1.13",
|
|
45
65
|
"@codama/renderers": "^1.0.21",
|
|
46
|
-
"@
|
|
66
|
+
"@solana/web3.js": "^1.98.2",
|
|
67
|
+
"@types/node": "^24.0.3",
|
|
47
68
|
"codama": "^1.2.13",
|
|
48
|
-
"
|
|
69
|
+
"tsconfig-to-dual-package": "^1.2.0",
|
|
49
70
|
"typedoc": "^0.28.3",
|
|
50
71
|
"typescript": "^5.8.3",
|
|
51
|
-
"vitest": "^3.
|
|
72
|
+
"vitest": "^3.2.4"
|
|
52
73
|
},
|
|
53
74
|
"dependencies": {
|
|
54
|
-
"@solana/kit": "^2.1.0"
|
|
75
|
+
"@solana/kit": "^2.1.0",
|
|
76
|
+
"@wuwei-labs/srsly": "2.0.0-beta.12"
|
|
55
77
|
}
|
|
56
78
|
}
|