@wuwei-labs/srsly
Version:
TypeScript SDK for SRSLY
97 lines • 3.2 kB
TypeScript
/**
* @purpose Centralized program and token addresses for different networks
*
* Single source of truth for all Solana program addresses used by SRSLY.
* Supports mainnet-beta, devnet, and localnet environments.
*/
/**
* Genesis hash constants — canonical chain identifiers
*/
export declare const MAINNET_GENESIS = "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d";
export declare const DEVNET_GENESIS = "EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG";
export declare const ATLASNET_GENESIS = "Ccod9gttTtZWqCeMgyTW3iCSoPLjkptAGsBUeP2CpchR";
/**
* Named aliases for CLI/human convenience
*/
export type ProgramSetAlias = 'mainnet' | 'atlasnet' | 'holosim' | 'localnet';
/**
* Program set type — accepts either a genesis hash or a named alias
*/
export type ProgramSet = string;
/**
* Addresses for a specific program set
*/
export interface ProgramAddresses {
/** SRSLY rental program address */
srsly: string;
/** Star Atlas SAGE program address */
sage: string;
/** Antegen (thread/automation) program address */
antegen: string;
/**
* ATLAS token mint address
* @deprecated Instructions now source atlasMint from on-chain ConfigState.
* Only used for createConfig bootstrap and CLI display.
*/
atlasMint: string;
/** Profile Faction program address */
profileFaction: string;
/** Star Atlas game ID */
gameId: string;
}
/**
* @deprecated Use ProgramAddresses instead
*/
export type NetworkAddresses = ProgramAddresses;
/**
* Mainnet addresses (production Star Atlas)
*/
declare const MAINNET_ADDRESSES: ProgramAddresses;
/**
* Atlasnet addresses (Star Atlas testnet/devnet)
*/
declare const ATLASNET_ADDRESSES: ProgramAddresses;
/**
* Resolve a program set input (alias or genesis hash) to a genesis hash
*
* @param programSet - Named alias or genesis hash string
* @returns Genesis hash string
*/
export declare function resolveGenesisHash(programSet: string): string;
/**
* Get addresses for a specific program set
*
* @param programSet - Program set identifier ('mainnet', 'atlasnet', or 'localnet')
* @returns Program-specific addresses
* @throws Error if program set is unknown
*
* @example
* ```typescript
* const addresses = getProgramAddresses('mainnet');
* console.log(addresses.atlasMint); // 'ATLASXmbP...'
*
* const testnetAddresses = getProgramAddresses('atlasnet');
* console.log(testnetAddresses.sage); // 'SAGEqqFew...'
* ```
*/
export declare function getProgramAddresses(programSet: ProgramSet): ProgramAddresses;
/**
* @deprecated Use getProgramAddresses instead
*/
export declare function getNetworkAddresses(network: ProgramSet): ProgramAddresses;
/**
* Check if a program set is valid
*
* @param programSet - Program set to validate
* @returns True if program set is supported
*/
export declare function isValidProgramSet(programSet: string): programSet is ProgramSet;
/**
* @deprecated Use isValidProgramSet instead
*/
export declare function isValidNetwork(network: string): network is ProgramSet;
/**
* Re-export individual network addresses for direct access
*/
export { MAINNET_ADDRESSES, ATLASNET_ADDRESSES };
//# sourceMappingURL=addresses.d.ts.map