Cheatcode Methods
These special-purpose methods are unique to Surfpool and allow developers to directly modify account and token states. They're invaluable for simulating certain conditions, reproducing edge cases, or setting up specific scenarios without needing full transaction flows.
surfnet_setAccount
AvailableSets or updates an account's properties including lamports, data, owner, and executable status.
Parameters
pubkey
requiredstring
The public key of the account to update, as a base-58 encoded string. This identifies which account will be modified.
update
requiredThe account data to update. Contains the new values for lamports, owner, executable status, rent epoch, and data.
data
string (optional)
The new account data, as a hex encoded string. This contains the actual data stored in the account.
executable
boolean (optional)
Whether the account should be executable (true for program accounts, false for data accounts).
lamports
integer (optional)
The new balance in lamports (1 SOL = 1,000,000,000 lamports).
owner
string (optional)
The new owner program ID, as a base-58 encoded string.
rentEpoch
integer (optional)
The new rent epoch in which this account will next owe rent.
surfnet_setTokenAccount
AvailableSets or updates a token account's properties including balance, delegate, state, and authorities.
Parameters
owner
requiredstring
The public key of the token account owner, as a base-58 encoded string. This is the wallet that owns the token account.
mint
requiredstring
The public key of the token mint, as a base-58 encoded string. This identifies the specific token type (e.g., USDC, SOL).
update
requiredThe token account data to update. Contains new values for balance, delegate, state, and authorities.
amount
integer (optional)
The new token balance amount in the smallest unit (e.g., lamports for SOL, or the smallest token unit).
closeAuthority
string (optional)
The new close authority that can close the account and recover rent.
delegate
string (optional)
The new delegate account that can spend tokens on behalf of the owner.
delegatedAmount
integer (optional)
The new delegated amount that the delegate is authorized to spend.
state
string (optional)
The new account state (e.g., 'initialized', 'frozen', 'closed').
tokenProgram
string (optional)
The token program ID, as a base-58 encoded string. Defaults to SPL Token program if not specified.
surfnet_cloneProgramAccount
AvailableClones a program account from one program ID to another, including its associated program data.
Parameters
sourceProgramId
requiredstring
The public key of the source program to clone, as a base-58 encoded string.
destinationProgramId
requiredstring
The public key of the destination program, as a base-58 encoded string.
surfnet_profileTransaction
AvailableProfiles a transaction to analyze compute units, account changes, and execution details.
Parameters
transactionData
requiredstring
The transaction data to profile, as a base-64 encoded string. This should be a serialized VersionedTransaction.
tag
string (optional)
An optional tag to identify the profiling results. Useful for grouping related transaction profiles.
config
Configuration for the profile result, including encoding format and profiling depth.
depth
string (optional)
The depth of profiling - 'transaction' for overall transaction profile, 'instruction' for per-instruction breakdown.
encoding
string (optional)
The encoding format for returned account data (e.g., 'base64', 'base58', 'jsonParsed').
surfnet_getProfileResults
AvailableRetrieves all profiling results for transactions tagged with a specific identifier.
Parameters
tag
requiredstring
The tag to retrieve profiling results for. Returns all transaction profiles that were tagged with this identifier.
config
Configuration for the profile result, including encoding format and profiling depth.
depth
string (optional)
The depth of profiling - 'transaction' for overall transaction profile, 'instruction' for per-instruction breakdown.
encoding
string (optional)
The encoding format for returned account data (e.g., 'base64', 'base58', 'jsonParsed').
surfnet_setSupply
AvailableConfigures the network supply information including total, circulating, and non-circulating amounts.
Parameters
update
requiredThe supply data to update. Contains new values for total, circulating, and non-circulating SOL amounts.
circulating
integer (optional)
The new circulating supply of SOL in lamports (total supply minus non-circulating).
nonCirculating
integer (optional)
The new non-circulating supply of SOL in lamports (locked in non-circulating accounts).
nonCirculatingAccounts
array (optional)
The new list of non-circulating account addresses that hold locked SOL.
total
integer (optional)
The new total supply of SOL in lamports across the entire network.
surfnet_setProgramAuthority
AvailableSets or removes the upgrade authority for a program's ProgramData account.
Parameters
programId
requiredstring
The public key of the program, as a base-58 encoded string. This is the program whose upgrade authority will be modified.
newAuthority
string (optional)
The public key of the new authority, as a base-58 encoded string. If omitted, the program will have no upgrade authority (immutable).
surfnet_getTransactionProfile
AvailableRetrieves the detailed profile of a specific transaction by signature or UUID.
Parameters
signatureOrUuid
requiredobject | object
The transaction signature (as a base-58 string) or a UUID (as a string) for which to retrieve the profile. This identifies the specific transaction to analyze.
config
Configuration for the profile result, including encoding format and profiling depth.
depth
string (optional)
The depth of profiling - 'transaction' for overall transaction profile, 'instruction' for per-instruction breakdown.
encoding
string (optional)
The encoding format for returned account data (e.g., 'base64', 'base58', 'jsonParsed').
surfnet_registerIdl
AvailableRegisters an IDL (Interface Definition Language) for a program to enable account data parsing.
Parameters
idl
requiredThe full IDL object to be registered in memory. The `address` field should match the program's public key. This enables account data parsing for the program.
accounts
requiredarray
The IDL accounts array defining all account types that the program can create or interact with.
address
requiredstring
The program address that this IDL describes, as a base-58 encoded string.
constants
requiredarray
The IDL constants array defining constant values used by the program.
errors
requiredarray
The IDL errors array defining custom error types that the program can return.
events
requiredarray
The IDL events array defining events that the program can emit.
instructions
requiredarray
The IDL instructions array defining all available program instructions and their parameters.
metadata
requiredstring
The IDL metadata containing program name, version, and description information.
state
string (optional)
The IDL state object defining the program's state account structure (if applicable).
types
requiredarray
The IDL types array defining custom data types used by the program.
slot
integer (optional)
The slot at which to register the IDL. If omitted, uses the latest slot. This determines when the IDL becomes active for account parsing.
surfnet_getIdl
AvailableRetrieves the registered IDL for a specific program ID at a given slot.
Parameters
programId
requiredstring
The public key of the program whose IDL is being requested, as a base-58 encoded string. This identifies which program's IDL to retrieve.
slot
integer (optional)
The slot at which to query the IDL. If omitted, the latest slot will be used. This determines which version of the IDL to return.
surfnet_getLocalSignatures
AvailableRetrieves the most recent transaction signatures from the local network.
Parameters
limit
integer (optional)
The maximum number of signatures to return. Defaults to 50 if not specified. Returns the most recent signatures first.
surfnet_timeTravel
AvailableSets the network's current epoch info to a future time based on the supplied epoch, slot, or time.
Parameters
config
string (optional)
Configuration specifying how to modify the clock. Can move to a specific epoch, slot, or timestamp.