RPC

Cheatcodes

Powerful testing utilities unique to Surfpool for state manipulation

Powerful testing utilities unique to Surfpool that allow you to directly modify account and token states. These methods are only available on Surfnet.

surfnet_setAccount

Sets or updates an account's properties including lamports, data, owner, and executable status.

Parameters
NameTypeDescription
pubkey*
stringThe public key of the account to update, as a base-58 encoded string. This identifies which account will be modified.
update*
objectThe account data to update. Contains the new values for lamports, owner, executable status, rent epoch, and data.
â””data
stringThe new account data, as a hex encoded string. This contains the actual data stored in the account.
â””executable
booleanWhether the account should be executable (true for program accounts, false for data accounts).
â””lamports
integerThe new balance in lamports (1 SOL = 1,000,000,000 lamports).
â””owner
stringThe new owner program ID, as a base-58 encoded string.
â””rentEpoch
integerThe new rent epoch in which this account will next owe rent.
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
null
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_setAccount",  "params": {    "pubkey": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",    "update": {      "data": "0x3b9aca00",      "executable": true,      "lamports": 1000000000,      "owner": "11111111111111111111111111111111",      "rentEpoch": 100    }  }}

surfnet_setTokenAccount

Sets or updates a token account's properties including balance, delegate, state, and authorities.

Parameters
NameTypeDescription
owner*
stringThe public key of the token account owner, as a base-58 encoded string. This is the wallet that owns the token account.
mint*
stringThe public key of the token mint, as a base-58 encoded string. This identifies the specific token type (e.g., USDC, SOL).
tokenProgram
stringThe token program ID, as a base-58 encoded string. Defaults to SPL Token program if not specified.
update*
objectThe token account data to update. Contains new values for balance, delegate, state, and authorities.
â””amount
integerThe new token balance amount in the smallest unit (e.g., lamports for SOL, or the smallest token unit).
â””closeAuthority
stringThe new close authority that can close the account and recover rent.
â””delegate
stringThe new delegate account that can spend tokens on behalf of the owner.
â””delegatedAmount
integerThe new delegated amount that the delegate is authorized to spend.
â””state
stringThe new account state (e.g., 'initialized', 'frozen', 'closed').
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
null
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_setTokenAccount",  "params": {    "owner": "11111111111111111111111111111111",    "mint": "<some-mint>",    "update": {      "amount": 1000000000,      "closeAuthority": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",      "delegate": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",      "delegatedAmount": 1000000000,      "state": "<some-state>"    },    "tokenProgram": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"  }}

surfnet_cloneProgramAccount

Clones a program account from one program ID to another, including its associated program data.

Parameters
NameTypeDescription
sourceProgramId*
stringThe public key of the source program to clone, as a base-58 encoded string.
destinationProgramId*
stringThe public key of the destination program, as a base-58 encoded string.
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
null
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_cloneProgramAccount",  "params": {    "sourceProgramId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",    "destinationProgramId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"  }}

surfnet_profileTransaction

Profiles a transaction to analyze compute units, account changes, and execution details.

Parameters
NameTypeDescription
transactionData*
stringThe transaction data to profile, as a base-64 encoded string. This should be a serialized VersionedTransaction.
tag
stringAn optional tag to identify the profiling results. Useful for grouping related transaction profiles.
config
objectConfiguration for the profile result, including encoding format and profiling depth.
â””depth
stringThe depth of profiling - 'transaction' for overall transaction profile, 'instruction' for per-instruction breakdown.
â””encoding
stringThe encoding format for returned account data (e.g., 'base64', 'base58', 'jsonParsed').
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
object
â””computeUnits
objectCompute units estimation result
â””computeUnitsConsumed
integerNumber of compute units consumed
â””errorMessage
stringError message if estimation failed
â””logMessages
arrayLog messages from the transaction
â””success
booleanIndicates if the estimation was successful
â””state
objectProfile state containing pre and post execution states
â””postExecution
objectAccount states after execution
â””preExecution
objectAccount states before execution
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_profileTransaction",  "params": {    "transactionData": "0x3b9aca00",    "tag": "<some-tag>",    "config": {      "depth": "instruction",      "encoding": "base64"    }  }}

surfnet_getProfileResultsByTag

Retrieves all profiling results for transactions tagged with a specific identifier.

Parameters
NameTypeDescription
tag*
stringThe tag to retrieve profiling results for. Returns all transaction profiles that were tagged with this identifier.
config
objectConfiguration for the profile result, including encoding format and profiling depth.
â””depth
stringThe depth of profiling - 'transaction' for overall transaction profile, 'instruction' for per-instruction breakdown.
â””encoding
stringThe encoding format for returned account data (e.g., 'base64', 'base58', 'jsonParsed').
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
array<ProfileResultSchema>
â””[]
objectArray item
â””computeUnits
objectCompute units estimation result
â””computeUnitsConsumed
integerNumber of compute units consumed
â””errorMessage
stringError message if estimation failed
â””logMessages
arrayLog messages from the transaction
â””success
booleanIndicates if the estimation was successful
â””state
objectProfile state containing pre and post execution states
â””postExecution
objectAccount states after execution
â””preExecution
objectAccount states before execution
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_getProfileResultsByTag",  "params": {    "tag": "<some-tag>",    "config": {      "depth": "instruction",      "encoding": "base64"    }  }}

surfnet_setSupply

Configures the network supply information including total, circulating, and non-circulating amounts.

Parameters
NameTypeDescription
update*
objectThe supply data to update. Contains new values for total, circulating, and non-circulating SOL amounts.
â””circulating
integerThe new circulating supply of SOL in lamports (total supply minus non-circulating).
â””nonCirculating
integerThe new non-circulating supply of SOL in lamports (locked in non-circulating accounts).
â””nonCirculatingAccounts
arrayThe new list of non-circulating account addresses that hold locked SOL.
â””total
integerThe new total supply of SOL in lamports across the entire network.
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
null
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_setSupply",  "params": {    "update": {      "circulating": 0,      "nonCirculating": 0,      "nonCirculatingAccounts": [],      "total": 0    }  }}

surfnet_setProgramAuthority

Sets or removes the upgrade authority for a program's ProgramData account.

Parameters
NameTypeDescription
programId*
stringThe public key of the program, as a base-58 encoded string. This is the program whose upgrade authority will be modified.
newAuthority
stringThe public key of the new authority, as a base-58 encoded string. If omitted, the program will have no upgrade authority (immutable).
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
null
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_setProgramAuthority",  "params": {    "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",    "newAuthority": "<some-newauthority>"  }}

surfnet_getTransactionProfile

Retrieves the detailed profile of a specific transaction by signature or UUID.

Parameters
NameTypeDescription
signatureOrUuid*
object | objectThe 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
objectConfiguration for the profile result, including encoding format and profiling depth.
â””depth
stringThe depth of profiling - 'transaction' for overall transaction profile, 'instruction' for per-instruction breakdown.
â””encoding
stringThe encoding format for returned account data (e.g., 'base64', 'base58', 'jsonParsed').
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
object
â””instructionProfiles
array
â””key
UuidOrSignature
â””readonlyAccountStates
object
â””slot
integer
â””transactionProfile
object
â””accountStates
object
â””computeUnitsConsumed
integer
â””errorMessage
string
â””logMessages
array
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_getTransactionProfile",  "params": {    "signatureOrUuid": {      "uuid": "<some-uuid>"    },    "config": {      "depth": "instruction",      "encoding": "base64"    }  }}

surfnet_registerIdl

Registers an IDL (Interface Definition Language) for a program to enable account data parsing.

Parameters
NameTypeDescription
slot
integerThe slot at which to register the IDL. If omitted, uses the latest slot. This determines when the IDL becomes active for account parsing.
idl*
objectThe 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*
arrayThe IDL accounts array defining all account types that the program can create or interact with.
â””address*
stringThe program address that this IDL describes, as a base-58 encoded string.
â””constants*
arrayThe IDL constants array defining constant values used by the program.
â””errors*
arrayThe IDL errors array defining custom error types that the program can return.
â””events*
arrayThe IDL events array defining events that the program can emit.
â””instructions*
arrayThe IDL instructions array defining all available program instructions and their parameters.
â””metadata*
stringThe IDL metadata containing program name, version, and description information.
â””state
stringThe IDL state object defining the program's state account structure (if applicable).
â””types*
arrayThe IDL types array defining custom data types used by the program.
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
null
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_registerIdl",  "params": {    "idl": {      "accounts": [],      "address": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",      "constants": [],      "errors": [],      "events": [],      "instructions": [],      "metadata": null,      "state": null,      "types": []    },    "slot": 123456789  }}

surfnet_getActiveIdl

Retrieves the registered IDL for a specific program ID at a given slot.

Parameters
NameTypeDescription
programId*
stringThe 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
integerThe slot at which to query the IDL. If omitted, the latest slot will be used. This determines which version of the IDL to return.
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
object
â””accounts
array<any>The IDL accounts array defining all account types that the program can create or interact with.
â””address
stringThe program address that this IDL describes, as a base-58 encoded string.
â””constants
array<any>The IDL constants array defining constant values used by the program.
â””errors
array<any>The IDL errors array defining custom error types that the program can return.
â””events
array<any>The IDL events array defining events that the program can emit.
â””instructions
array<any>The IDL instructions array defining all available program instructions and their parameters.
â””metadata
anyThe IDL metadata containing program name, version, and description information.
â””state
anyThe IDL state object defining the program's state account structure (if applicable).
â””types
array<any>The IDL types array defining custom data types used by the program.
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_getActiveIdl",  "params": {    "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",    "slot": 123456789  }}

surfnet_getLocalSignatures

Retrieves the most recent transaction signatures from the local network.

Parameters
NameTypeDescription
limit
integerThe maximum number of signatures to return. Defaults to 50 if not specified. Returns the most recent signatures first.
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
array<RpcLogsResponse>
â””[]
objectArray item
â””err
object
â””errorType
stringError type
â””message
stringError message
â””logs
array<string>
â””signature
string
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_getLocalSignatures",  "params": {    "limit": 0  }}

surfnet_timeTravel

Sets the network's current epoch info to a future time based on the supplied epoch, slot, or time.

Parameters
NameTypeDescription
config
stringConfiguration specifying how to modify the clock. Can move to a specific epoch, slot, or timestamp.
Result
FieldTypeDescription
absoluteSlot
integerAbsolute root slot
blockHeight
integerBlock height
epoch
integerCurrent epoch
slotIndex
integerCurrent slot index within the epoch
slotsInEpoch
integerTotal number of slots in the epoch
transactionCount
integerCurrent transaction count
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_timeTravel",  "params": {    "config": {      "absoluteEpoch": 100    }  }}

surfnet_pauseClock

Pauses the local network's clock progression, halting block production.

Result
FieldTypeDescription
absoluteSlot
integerAbsolute root slot
blockHeight
integerBlock height
epoch
integerCurrent epoch
slotIndex
integerCurrent slot index within the epoch
slotsInEpoch
integerTotal number of slots in the epoch
transactionCount
integerCurrent transaction count
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_pauseClock",  "params": {}}

surfnet_resumeClock

Resumes the network's block production if paused.

Result
FieldTypeDescription
absoluteSlot
integerAbsolute root slot
blockHeight
integerBlock height
epoch
integerCurrent epoch
slotIndex
integerCurrent slot index within the epoch
slotsInEpoch
integerTotal number of slots in the epoch
transactionCount
integerCurrent transaction count
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_resumeClock",  "params": {}}

surfnet_resetAccount

Resets an account on the local network to its original state from the remote datasource.

Parameters
NameTypeDescription
pubkey*
stringThe base-58 encoded public key of the account to reset.
config
objectConfiguration for the reset operation.
â””includeOwnedAccounts
booleanIf true, also resets accounts owned by the specified account.
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
null
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_resetAccount",  "params": {    "pubkey": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",    "config": {      "includeOwnedAccounts": true    }  }}

surfnet_exportSnapshot

Exports a snapshot of all accounts in the Surfnet SVM.

Parameters
NameTypeDescription
config
objectConfiguration for the export operation.
â””includeParsedAccounts
booleanIf true, includes parsed account data in the snapshot.
â””filter
objectFilter configuration to limit which accounts are included.
â””includeProgramAccounts
booleanWhether to include program accounts in the snapshot.
â””includeAccounts
arrayList of specific account public keys to include.
â””excludeAccounts
arrayList of specific account public keys to exclude.
â””scope
string | objectScope to limit the accounts included. Options are 'network' (all accounts) or 'preTransaction' (accounts touched by a transaction).
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
objectMap of account public keys to their snapshots
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_exportSnapshot",  "params": {    "config": {      "includeParsedAccounts": true,      "filter": {        "includeProgramAccounts": true,        "includeAccounts": [],        "excludeAccounts": []      },      "scope": "network"    }  }}

surfnet_streamAccount

Registers an account for streaming, downloading it from the datasource every time rather than caching it in the SVM.

Parameters
NameTypeDescription
pubkey*
stringThe base-58 encoded public key of the account to stream.
config
objectConfiguration for the stream operation.
â””includeOwnedAccounts
booleanIf true, also streams accounts owned by the specified account.
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
null
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_streamAccount",  "params": {    "pubkey": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",    "config": {      "includeOwnedAccounts": true    }  }}

surfnet_writeProgram

Writes program data at a specified offset, allowing deployment of large programs by sending data in chunks.

Parameters
NameTypeDescription
programId*
stringThe public key of the program account, as a base-58 encoded string.
data*
stringHex-encoded program data chunk to write.
offset*
integerThe byte offset at which to write this data chunk.
authority
stringThe base-58 encoded public key of the authority allowed to write to the program. Defaults to the system program if omitted.
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
null
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_writeProgram",  "params": {    "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",    "data": "0x3b9aca00",    "offset": 0,    "authority": "<some-authority>"  }}

surfnet_registerScenario

Registers a scenario with account overrides for testing different network states.

Parameters
NameTypeDescription
slot
integerThe base slot from which relative slot offsets are calculated. If omitted, uses the current slot.
scenario*
objectThe scenario object containing overrides.
â””id*
stringUnique identifier for the scenario.
â””name*
stringHuman-readable name.
â””description*
stringDescription of this scenario.
â””overrides*
array[OverrideInstance]List of override instances in this scenario.
â””tags*
array[string]Tags for categorization.
Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
null
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_registerScenario",  "params": {    "scenario": {      "id": "<some-id>",      "name": "<some-name>",      "description": "<some-description>",      "overrides": [        {          "id": "<some-id>",          "templateId": "<some-templateid>",          "values": {},          "scenarioRelativeSlot": 123456789,          "label": "<some-label>",          "enabled": true,          "fetchBeforeUse": true,          "account": {            "pubkey": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"          }        }      ],      "tags": [        "<some-tags>"      ]    },    "slot": 123456789  }}

surfnet_resetNetwork

Resets the entire network to its initial state

Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
null
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_resetNetwork",  "params": []}

surfnet_getStreamedAccounts

Retrieves the list of accounts registered for streaming

Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
object
â””accounts
array<StreamedAccountInfoSchema>
â””[]
objectArray item
â””pubkey
stringAccount public key as base-58 string
â””includeOwnedAccounts
booleanWhether owned accounts are also streamed
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_getStreamedAccounts",  "params": []}

surfnet_getSurfnetInfo

Retrieves Surfnet network information

Result
FieldTypeDescription
context
object
â””apiVersion
stringThe API version
â””slot
integerThe current slot
value
object
â””runbookExecutions
array<RunbookExecutionStatusSchema>
â””[]
objectArray item
â””startedAt
integerUnix timestamp when execution started
â””completedAt
integerUnix timestamp when execution completed (null if still running)
â””runbookId
stringIdentifier of the runbook
â””errors
arrayList of errors encountered during execution
Example
{  "jsonrpc": "2.0",  "id": 1,  "method": "surfnet_getSurfnetInfo",  "params": []}

On this page