@wuwei-labs/srsly
Version:
TypeScript SDK for SRSLY
128 lines • 3.67 kB
TypeScript
/**
* @purpose Simplified updateConfig instruction wrapper
*
* Thin convenience wrapper around Codama-generated updateConfig instruction.
* Updates the global program configuration settings.
*/
import { type Address } from '@solana/kit';
import { type SdkConfig } from '../utils/config';
import { type UniversalSigner } from '../utils/signer';
import { prepareInstructions } from '../utils/instructions';
/**
* Parameters for updating the global program configuration
* All fields are optional - only provide the ones you want to update
*/
export interface UpdateConfigParams {
/**
* Admin who has permission to update config
* Accepts string address, web3.js Keypair, or @solana/kit signer
*/
admin: UniversalSigner;
/**
* New admin address (updates the admin)
*/
newAdmin?: Address | string | null;
/**
* Stardust to ATLAS conversion rate
*/
stardustToAtlas?: number | bigint | null;
/**
* Service fee in basis points (1000 = 10%)
*/
serviceFeeBps?: number | bigint | null;
/**
* Basis points denominator
*/
baseBps?: number | null;
/**
* Minimum rental duration in seconds
*/
rentalDurationMinSeconds?: number | bigint | null;
/**
* Maximum rental duration in seconds
*/
rentalDurationMaxSeconds?: number | bigint | null;
/**
* ATLAS token mint address
*/
atlasMint?: Address | string | null;
/**
* Whether reservation system is enabled
*/
reservationsEnabled?: boolean | null;
/**
* Capture points awarded per day of rental
*/
pointsPerDay?: number | null;
/**
* Points penalty for cancelling a rental
*/
cancellationPenalty?: number | null;
/**
* Minimum points needed to capture a flag
*/
minCaptureThreshold?: number | null;
/**
* Base for logarithmic weight calculation
*/
weightBase?: number | null;
/**
* Multiplier for weight calculation
*/
weightMultiplier?: number | null;
/**
* Maximum weight value
*/
maxWeight?: number | null;
/**
* Rate increase in basis points after capture (10000 = 100%, 11000 = 110%)
*/
captureRateBps?: number | bigint | null;
/**
* ATLAS lamports per point equivalent for reservation bidding
*/
atlasPerPoint?: number | bigint | null;
/**
* Maximum floor multiplier in basis points (100 = 1×, 465 = 4.65×).
* 100 disables the snipe ramp; 100..=10000 enables it.
*/
contestedMultiplierMaxBps?: number | null;
/**
* Sets compute units to allocate for the transaction.
* @example 400000
*/
computeUnits?: number;
}
/**
* Update one or more global program settings. All fields are optional —
* only the ones you supply change.
*
* @param params - Configuration update parameters
* @param config - Optional SDK configuration overrides
* @returns Kit instruction (or web3.js if PublicKey in config)
*
* @example
* ```typescript
* // Update service fee
* const ix = await updateConfig({
* admin: adminWallet,
* serviceFeeBps: 1000 // 10%
* });
*
* // Update multiple settings
* const ix2 = await updateConfig({
* admin: adminWallet,
* serviceFeeBps: 1500,
* reservationsEnabled: true,
* pointsPerDay: 100
* });
*
* // Change admin
* const ix3 = await updateConfig({
* admin: currentAdmin,
* newAdmin: newAdminAddress
* });
* ```
*/
export declare function updateConfig(params: UpdateConfigParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>;
//# sourceMappingURL=updateConfig.d.ts.map