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
Available
Sets or updates an account's properties including lamports, data, owner, and executable status.
Parameters
pubkey
required
string
The public key of the account to update, as a base-58 encoded string. This identifies which account will be modified.
update
required
The 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
Available
Sets or updates a token account's properties including balance, delegate, state, and authorities.
Parameters
owner
required
string
The public key of the token account owner, as a base-58 encoded string. This is the wallet that owns the token account.
mint
required
string
The public key of the token mint, as a base-58 encoded string. This identifies the specific token type (e.g., USDC, SOL).
update
required
The 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
Available
Clones a program account from one program ID to another, including its associated program data.
Parameters
sourceProgramId
required
string
The public key of the source program to clone, as a base-58 encoded string.
destinationProgramId
required
string
The public key of the destination program, as a base-58 encoded string.

surfnet_profileTransaction
Available
Profiles a transaction to analyze compute units, account changes, and execution details.
Parameters
transactionData
required
string
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
Available
Retrieves all profiling results for transactions tagged with a specific identifier.
Parameters
tag
required
string
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
Available
Configures the network supply information including total, circulating, and non-circulating amounts.
Parameters
update
required
The 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
Available
Sets or removes the upgrade authority for a program's ProgramData account.
Parameters
programId
required
string
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
Available
Retrieves the detailed profile of a specific transaction by signature or UUID.
Parameters
signatureOrUuid
required
object | 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
Available
Registers an IDL (Interface Definition Language) for a program to enable account data parsing.
Parameters
idl
required
The 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
required
array
The IDL accounts array defining all account types that the program can create or interact with.
address
required
string
The program address that this IDL describes, as a base-58 encoded string.
constants
required
array
The IDL constants array defining constant values used by the program.
errors
required
array
The IDL errors array defining custom error types that the program can return.
events
required
array
The IDL events array defining events that the program can emit.
instructions
required
array
The IDL instructions array defining all available program instructions and their parameters.
metadata
required
string
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
required
array
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
Available
Retrieves the registered IDL for a specific program ID at a given slot.
Parameters
programId
required
string
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
Available
Retrieves 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
Available
Sets 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.

surfnet_pauseClock
Available
Pauses the local network's clock progression, halting block production.
Parameters
No parameters required

surfnet_resumeClock
Available
Resumes the network's block production if paused.
Parameters
No parameters required