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.
| Name | Type | Description |
|---|---|---|
pubkey* | string | The public key of the account to update, as a base-58 encoded string. This identifies which account will be modified. |
update* | object | The account data to update. Contains the new values for lamports, owner, executable status, rent epoch, and data. |
â”” data | string | The new account data, as a hex encoded string. This contains the actual data stored in the account. |
â”” executable | boolean | Whether the account should be executable (true for program accounts, false for data accounts). |
â”” lamports | integer | The new balance in lamports (1 SOL = 1,000,000,000 lamports). |
â”” owner | string | The new owner program ID, as a base-58 encoded string. |
â”” rentEpoch | integer | The new rent epoch in which this account will next owe rent. |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | null |
{ "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.
| Name | Type | Description |
|---|---|---|
owner* | 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* | string | The public key of the token mint, as a base-58 encoded string. This identifies the specific token type (e.g., USDC, SOL). |
tokenProgram | string | The token program ID, as a base-58 encoded string. Defaults to SPL Token program if not specified. |
update* | object | The token account data to update. Contains new values for balance, delegate, state, and authorities. |
â”” amount | integer | The new token balance amount in the smallest unit (e.g., lamports for SOL, or the smallest token unit). |
â”” closeAuthority | string | The new close authority that can close the account and recover rent. |
â”” delegate | string | The new delegate account that can spend tokens on behalf of the owner. |
â”” delegatedAmount | integer | The new delegated amount that the delegate is authorized to spend. |
â”” state | string | The new account state (e.g., 'initialized', 'frozen', 'closed'). |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | null |
{ "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.
| Name | Type | Description |
|---|---|---|
sourceProgramId* | string | The public key of the source program to clone, as a base-58 encoded string. |
destinationProgramId* | string | The public key of the destination program, as a base-58 encoded string. |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | null |
{ "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.
| Name | Type | Description |
|---|---|---|
transactionData* | string | The transaction data to profile, as a base-64 encoded string. This should be a serialized VersionedTransaction. |
tag | string | An optional tag to identify the profiling results. Useful for grouping related transaction profiles. |
config | object | Configuration for the profile result, including encoding format and profiling depth. |
â”” depth | string | The depth of profiling - 'transaction' for overall transaction profile, 'instruction' for per-instruction breakdown. |
â”” encoding | string | The encoding format for returned account data (e.g., 'base64', 'base58', 'jsonParsed'). |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | object | |
â”” computeUnits | object | Compute units estimation result |
â”” computeUnitsConsumed | integer | Number of compute units consumed |
â”” errorMessage | string | Error message if estimation failed |
â”” logMessages | array | Log messages from the transaction |
â”” success | boolean | Indicates if the estimation was successful |
â”” state | object | Profile state containing pre and post execution states |
â”” postExecution | object | Account states after execution |
â”” preExecution | object | Account states before execution |
{ "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.
| Name | Type | Description |
|---|---|---|
tag* | string | The tag to retrieve profiling results for. Returns all transaction profiles that were tagged with this identifier. |
config | object | Configuration for the profile result, including encoding format and profiling depth. |
â”” depth | string | The depth of profiling - 'transaction' for overall transaction profile, 'instruction' for per-instruction breakdown. |
â”” encoding | string | The encoding format for returned account data (e.g., 'base64', 'base58', 'jsonParsed'). |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | array<ProfileResultSchema> | |
â”” [] | object | Array item |
â”” computeUnits | object | Compute units estimation result |
â”” computeUnitsConsumed | integer | Number of compute units consumed |
â”” errorMessage | string | Error message if estimation failed |
â”” logMessages | array | Log messages from the transaction |
â”” success | boolean | Indicates if the estimation was successful |
â”” state | object | Profile state containing pre and post execution states |
â”” postExecution | object | Account states after execution |
â”” preExecution | object | Account states before execution |
{ "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.
| Name | Type | Description |
|---|---|---|
update* | object | The supply data to update. Contains new values for total, circulating, and non-circulating SOL amounts. |
â”” circulating | integer | The new circulating supply of SOL in lamports (total supply minus non-circulating). |
â”” nonCirculating | integer | The new non-circulating supply of SOL in lamports (locked in non-circulating accounts). |
â”” nonCirculatingAccounts | array | The new list of non-circulating account addresses that hold locked SOL. |
â”” total | integer | The new total supply of SOL in lamports across the entire network. |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | null |
{ "jsonrpc": "2.0", "id": 1, "method": "surfnet_setSupply", "params": { "update": { "circulating": 0, "nonCirculating": 0, "nonCirculatingAccounts": [], "total": 0 } }}surfnet_getTransactionProfile
Retrieves the detailed profile of a specific transaction by signature or UUID.
| Name | Type | Description |
|---|---|---|
signatureOrUuid* | 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 | object | Configuration for the profile result, including encoding format and profiling depth. |
â”” depth | string | The depth of profiling - 'transaction' for overall transaction profile, 'instruction' for per-instruction breakdown. |
â”” encoding | string | The encoding format for returned account data (e.g., 'base64', 'base58', 'jsonParsed'). |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | object | |
â”” instructionProfiles | array | |
â”” key | UuidOrSignature | |
â”” readonlyAccountStates | object | |
â”” slot | integer | |
â”” transactionProfile | object | |
â”” accountStates | object | |
â”” computeUnitsConsumed | integer | |
â”” errorMessage | string | |
â”” logMessages | array |
{ "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.
| Name | Type | Description |
|---|---|---|
slot | integer | The slot at which to register the IDL. If omitted, uses the latest slot. This determines when the IDL becomes active for account parsing. |
idl* | object | 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* | array | The IDL accounts array defining all account types that the program can create or interact with. |
â”” address* | string | The program address that this IDL describes, as a base-58 encoded string. |
â”” constants* | array | The IDL constants array defining constant values used by the program. |
â”” errors* | array | The IDL errors array defining custom error types that the program can return. |
â”” events* | array | The IDL events array defining events that the program can emit. |
â”” instructions* | array | The IDL instructions array defining all available program instructions and their parameters. |
â”” metadata* | string | The IDL metadata containing program name, version, and description information. |
â”” state | string | The IDL state object defining the program's state account structure (if applicable). |
â”” types* | array | The IDL types array defining custom data types used by the program. |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | null |
{ "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.
| Name | Type | Description |
|---|---|---|
programId* | 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 | 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. |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | object | |
â”” accounts | array<any> | The IDL accounts array defining all account types that the program can create or interact with. |
â”” address | string | The 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 | any | The IDL metadata containing program name, version, and description information. |
â”” state | any | The 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. |
{ "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.
| Name | Type | Description |
|---|---|---|
limit | integer | The maximum number of signatures to return. Defaults to 50 if not specified. Returns the most recent signatures first. |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | array<RpcLogsResponse> | |
â”” [] | object | Array item |
â”” err | object | |
â”” errorType | string | Error type |
â”” message | string | Error message |
â”” logs | array<string> | |
â”” signature | string |
{ "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.
| Name | Type | Description |
|---|---|---|
config | string | Configuration specifying how to modify the clock. Can move to a specific epoch, slot, or timestamp. |
| Field | Type | Description |
|---|---|---|
absoluteSlot | integer | Absolute root slot |
blockHeight | integer | Block height |
epoch | integer | Current epoch |
slotIndex | integer | Current slot index within the epoch |
slotsInEpoch | integer | Total number of slots in the epoch |
transactionCount | integer | Current transaction count |
{ "jsonrpc": "2.0", "id": 1, "method": "surfnet_timeTravel", "params": { "config": { "absoluteEpoch": 100 } }}surfnet_pauseClock
Pauses the local network's clock progression, halting block production.
| Field | Type | Description |
|---|---|---|
absoluteSlot | integer | Absolute root slot |
blockHeight | integer | Block height |
epoch | integer | Current epoch |
slotIndex | integer | Current slot index within the epoch |
slotsInEpoch | integer | Total number of slots in the epoch |
transactionCount | integer | Current transaction count |
{ "jsonrpc": "2.0", "id": 1, "method": "surfnet_pauseClock", "params": {}}surfnet_resumeClock
Resumes the network's block production if paused.
| Field | Type | Description |
|---|---|---|
absoluteSlot | integer | Absolute root slot |
blockHeight | integer | Block height |
epoch | integer | Current epoch |
slotIndex | integer | Current slot index within the epoch |
slotsInEpoch | integer | Total number of slots in the epoch |
transactionCount | integer | Current transaction count |
{ "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.
| Name | Type | Description |
|---|---|---|
pubkey* | string | The base-58 encoded public key of the account to reset. |
config | object | Configuration for the reset operation. |
â”” includeOwnedAccounts | boolean | If true, also resets accounts owned by the specified account. |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | null |
{ "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.
| Name | Type | Description |
|---|---|---|
config | object | Configuration for the export operation. |
â”” includeParsedAccounts | boolean | If true, includes parsed account data in the snapshot. |
â”” filter | object | Filter configuration to limit which accounts are included. |
â”” includeProgramAccounts | boolean | Whether to include program accounts in the snapshot. |
â”” includeAccounts | array | List of specific account public keys to include. |
â”” excludeAccounts | array | List of specific account public keys to exclude. |
â”” scope | string | object | Scope to limit the accounts included. Options are 'network' (all accounts) or 'preTransaction' (accounts touched by a transaction). |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | object | Map of account public keys to their snapshots |
{ "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.
| Name | Type | Description |
|---|---|---|
pubkey* | string | The base-58 encoded public key of the account to stream. |
config | object | Configuration for the stream operation. |
â”” includeOwnedAccounts | boolean | If true, also streams accounts owned by the specified account. |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | null |
{ "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.
| Name | Type | Description |
|---|---|---|
programId* | string | The public key of the program account, as a base-58 encoded string. |
data* | string | Hex-encoded program data chunk to write. |
offset* | integer | The byte offset at which to write this data chunk. |
authority | string | The base-58 encoded public key of the authority allowed to write to the program. Defaults to the system program if omitted. |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | null |
{ "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.
| Name | Type | Description |
|---|---|---|
slot | integer | The base slot from which relative slot offsets are calculated. If omitted, uses the current slot. |
scenario* | object | The scenario object containing overrides. |
â”” id* | string | Unique identifier for the scenario. |
â”” name* | string | Human-readable name. |
â”” description* | string | Description of this scenario. |
â”” overrides* | array[OverrideInstance] | List of override instances in this scenario. |
â”” tags* | array[string] | Tags for categorization. |
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | null |
{ "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
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | null |
{ "jsonrpc": "2.0", "id": 1, "method": "surfnet_resetNetwork", "params": []}surfnet_getStreamedAccounts
Retrieves the list of accounts registered for streaming
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | object | |
â”” accounts | array<StreamedAccountInfoSchema> | |
â”” [] | object | Array item |
â”” pubkey | string | Account public key as base-58 string |
â”” includeOwnedAccounts | boolean | Whether owned accounts are also streamed |
{ "jsonrpc": "2.0", "id": 1, "method": "surfnet_getStreamedAccounts", "params": []}surfnet_getSurfnetInfo
Retrieves Surfnet network information
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | object | |
â”” runbookExecutions | array<RunbookExecutionStatusSchema> | |
â”” [] | object | Array item |
â”” startedAt | integer | Unix timestamp when execution started |
â”” completedAt | integer | Unix timestamp when execution completed (null if still running) |
â”” runbookId | string | Identifier of the runbook |
â”” errors | array | List of errors encountered during execution |
{ "jsonrpc": "2.0", "id": 1, "method": "surfnet_getSurfnetInfo", "params": []}