pub struct SurfnetCheatcodesClient { /* private fields */ }Expand description
The Client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(sender: RpcChannel) -> Self
pub fn new(sender: RpcChannel) -> Self
Creates a new Client.
Sourcepub fn set_account(
&self,
pubkey: String,
update: AccountUpdate,
) -> impl Future<Output = RpcResult<RpcResponse<()>>>
pub fn set_account( &self, pubkey: String, update: AccountUpdate, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>
A “cheat code” method for developers to set or update an account in Surfpool.
This method allows developers to set or update the lamports, data, owner, executable status, and rent epoch of a given account.
§Parameters
pubkey: The public key of the account to be updated, as a base-58 encoded string.update: TheAccountUpdatestruct containing the fields to update the account.
§Returns
A RpcResponse<()> indicating whether the account update was successful.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_setAccount",
"params": ["account_pubkey", {"lamports": 1000, "data": "base58string", "owner": "program_pubkey"}]
}§Example Response
{
"jsonrpc": "2.0",
"result": {},
"id": 1
}§Notes
This method is designed to help developers set or modify account properties within Surfpool. Developers can quickly test or update account attributes, such as lamports, program ownership, and executable status.
§See Also
getAccount,getAccountInfo,getAccountBalance
Sourcepub fn set_token_account(
&self,
owner: String,
mint: String,
update: TokenAccountUpdate,
token_program: Option<String>,
) -> impl Future<Output = RpcResult<RpcResponse<()>>>
pub fn set_token_account( &self, owner: String, mint: String, update: TokenAccountUpdate, token_program: Option<String>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>
A “cheat code” method for developers to set or update a token account in Surfpool.
This method allows developers to set or update various properties of a token account, including the token amount, delegate, state, delegated amount, and close authority.
§Parameters
owner: The base-58 encoded public key of the token account’s owner.mint: The base-58 encoded public key of the token mint (e.g., the token type).update: TheTokenAccountUpdatestruct containing the fields to update the token account.token_program: The optional base-58 encoded address of the token program (defaults to the system token program).
§Returns
A RpcResponse<()> indicating whether the token account update was successful.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_setTokenAccount",
"params": ["owner_pubkey", "mint_pubkey", {"amount": 1000, "state": "initialized"}]
}§Example Response
{
"jsonrpc": "2.0",
"result": {},
"id": 1
}§Notes
This method is designed to help developers quickly test or modify token account properties in Surfpool. Developers can update attributes such as token amounts, delegates, and authorities for specific token accounts.
§See Also
getTokenAccountInfo,getTokenAccountBalance,getTokenAccountDelegate
pub fn clone_program_account( &self, source_program_id: String, destination_program_id: String, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>
Sourcepub fn profile_transaction(
&self,
transaction_data: String,
tag: Option<String>,
config: Option<RpcProfileResultConfig>,
) -> impl Future<Output = RpcResult<RpcResponse<UiKeyedProfileResult>>>
pub fn profile_transaction( &self, transaction_data: String, tag: Option<String>, config: Option<RpcProfileResultConfig>, ) -> impl Future<Output = RpcResult<RpcResponse<UiKeyedProfileResult>>>
Estimates the compute units that a given transaction will consume.
This method simulates the transaction without committing its state changes and returns an estimation of the compute units used, along with logs and potential errors.
§Parameters
transaction_data: A base64 encoded string of theVersionedTransaction.tag: An optional tag for the transaction.encoding: An optional encoding for returned account data.
§Returns
A RpcResponse<ProfileResult> containing the estimation details and a snapshot of the accounts before and after execution.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_profileTransaction",
"params": ["base64_encoded_transaction_string", "optional_tag"]
}Sourcepub fn get_profile_results_by_tag(
&self,
tag: String,
config: Option<RpcProfileResultConfig>,
) -> impl Future<Output = RpcResult<RpcResponse<Option<Vec<UiKeyedProfileResult>>>>>
pub fn get_profile_results_by_tag( &self, tag: String, config: Option<RpcProfileResultConfig>, ) -> impl Future<Output = RpcResult<RpcResponse<Option<Vec<UiKeyedProfileResult>>>>>
Sourcepub fn set_supply(
&self,
update: SupplyUpdate,
) -> impl Future<Output = RpcResult<RpcResponse<()>>>
pub fn set_supply( &self, update: SupplyUpdate, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>
A “cheat code” method for developers to set or update the network supply information in Surfpool.
This method allows developers to configure the total supply, circulating supply,
non-circulating supply, and non-circulating accounts list that will be returned
by the getSupply RPC method.
§Parameters
update: TheSupplyUpdatestruct containing the optional fields to update:total: Optional total supply in lamportscirculating: Optional circulating supply in lamportsnon_circulating: Optional non-circulating supply in lamportsnon_circulating_accounts: Optional list of non-circulating account addresses
§Returns
A RpcResponse<()> indicating whether the supply update was successful.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_setSupply",
"params": [{
"total": 1000000000000000,
"circulating": 800000000000000,
"non_circulating": 200000000000000,
"non_circulating_accounts": ["Account1...", "Account2..."]
}]
}§Example Response
{
"jsonrpc": "2.0",
"result": {},
"id": 1
}§Notes
This method is designed to help developers test supply-related functionality by
allowing them to configure the values returned by getSupply without needing
to connect to a real network or manipulate actual token supplies.
§See Also
getSupply
A cheat code to set the upgrade authority of a program’s ProgramData account.
This method allows developers to directly patch the upgrade authority of a program’s ProgramData account.
§Parameters
program_id: The base-58 encoded public key of the program.new_authority: The base-58 encoded public key of the new authority. If omitted, the program will have no upgrade authority.
§Returns
A RpcResponse<()> indicating whether the authority update was successful.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_setProgramAuthority",
"params": [
"PROGRAM_ID_BASE58",
"NEW_AUTHORITY_BASE58"
]
}§Example Response
{
"jsonrpc": "2.0",
"result": {},
"id": 1
}Sourcepub fn get_transaction_profile(
&self,
signature_or_uuid: UuidOrSignature,
config: Option<RpcProfileResultConfig>,
) -> impl Future<Output = RpcResult<RpcResponse<Option<UiKeyedProfileResult>>>>
pub fn get_transaction_profile( &self, signature_or_uuid: UuidOrSignature, config: Option<RpcProfileResultConfig>, ) -> impl Future<Output = RpcResult<RpcResponse<Option<UiKeyedProfileResult>>>>
A cheat code to get the transaction profile for a given signature or UUID.
§Parameters
signature_or_uuid: The transaction signature (as a base-58 string) or a UUID (as a string) for which to retrieve the profile.
§Returns
A RpcResponse<Option<ProfileResult>> containing the transaction profile if found, or None if not found.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_getTransactionProfile",
"params": [
"5Nf3...TxSignatureOrUuidHere"
]
}§Example Response
{
"jsonrpc": "2.0",
"context": {
"slot": 355684457,
"apiVersion": "2.2.2"
},
"value": { /* ...ProfileResult object... */ },
"id": 1
}Sourcepub fn register_idl(
&self,
idl: Idl,
slot: Option<Slot>,
) -> impl Future<Output = RpcResult<RpcResponse<()>>>
pub fn register_idl( &self, idl: Idl, slot: Option<Slot>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>
A cheat code to register an IDL for a given program in memory.
§Parameters
idl: The full IDL object to be registered in memory. Theaddressfield should match the program’s public key.slot(optional): The slot at which to register the IDL. If omitted, uses the latest slot.
§Returns
A RpcResponse<()> indicating whether the IDL registration was successful.
§Example Request (with slot)
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_registerIdl",
"params": [
{
"address": "4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa",
"metadata": {
"name": "test",
"version": "0.1.0",
"spec": "0.1.0",
"description": "Created with Anchor"
},
"instructions": [
{
"name": "initialize",
"discriminator": [175,175,109,31,13,152,155,237],
"accounts": [],
"args": []
}
],
"accounts": [],
"types": [],
"events": [],
"errors": [],
"constants": [],
"state": null
},
355684457
]
}§Example Request (without slot)
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_registerIdl",
"params": [
{
"address": "4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa",
"metadata": {
"name": "test",
"version": "0.1.0",
"spec": "0.1.0",
"description": "Created with Anchor"
},
"instructions": [
{
"name": "initialize",
"discriminator": [175,175,109,31,13,152,155,237],
"accounts": [],
"args": []
}
],
"accounts": [],
"types": [],
"events": [],
"errors": [],
"constants": [],
"state": null
}
]
}§Example Response
{
"jsonrpc": "2.0",
"context": {
"slot": 355684457,
"apiVersion": "2.2.2"
},
"value": null,
"id": 1
}Sourcepub fn get_idl(
&self,
program_id: String,
slot: Option<Slot>,
) -> impl Future<Output = RpcResult<RpcResponse<Option<Idl>>>>
pub fn get_idl( &self, program_id: String, slot: Option<Slot>, ) -> impl Future<Output = RpcResult<RpcResponse<Option<Idl>>>>
A cheat code to get the registered IDL for a given program ID.
§Parameters
program_id: The base-58 encoded public key of the program whose IDL is being requested.slot(optional): The slot at which to query the IDL. If omitted, uses the latest slot.
§Returns
A RpcResponse<Option<Idl>> containing the IDL if it exists, or None if not found.
§Example Request (with slot)
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_getIdl",
"params": [
"4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa",
355684457
]
}§Example Request (without slot)
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_getIdl",
"params": [
"4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa"
]
}§Example Response
{
"jsonrpc": "2.0",
"context": {
"slot": 355684457,
"apiVersion": "2.2.2"
},
"value": { /* ...IDL object... */ },
"id": 1
}Sourcepub fn get_local_signatures(
&self,
limit: Option<u64>,
) -> impl Future<Output = RpcResult<RpcResponse<Vec<RpcLogsResponse>>>>
pub fn get_local_signatures( &self, limit: Option<u64>, ) -> impl Future<Output = RpcResult<RpcResponse<Vec<RpcLogsResponse>>>>
A cheat code to get the last 50 local signatures from the local network.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_getLocalSignatures",
"params": [ { "limit": 50 } ]
}
## Example Response
```json
{
"jsonrpc": "2.0",
"result": {
"signature": String,
"err": Option<TransactionError>,
"slot": u64,
},
"id": 1
}Sourcepub fn time_travel(
&self,
config: Option<TimeTravelConfig>,
) -> impl Future<Output = RpcResult<EpochInfo>>
pub fn time_travel( &self, config: Option<TimeTravelConfig>, ) -> impl Future<Output = RpcResult<EpochInfo>>
A cheat code to jump forward or backward in time on the local network. Useful for testing epoch-based or time-sensitive logic.
§Parameters
config(optional): ATimeTravelConfigspecifying how to modify the clock:absoluteTimestamp(u64): Moves time to the specified UNIX timestamp.absoluteSlot(u64): Moves to the specified absolute slot.absoluteEpoch(u64): Advances time to the specified epoch (each epoch = 432,000 slots).
§Returns
An EpochInfo object reflecting the updated clock state.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_timeTravel",
"params": [ { "absoluteSlot": 512 } ]
}§Example Response
{
"jsonrpc": "2.0",
"result": {
"epoch": 512,
"slot_index": 0,
"slots_in_epoch": 432000,
"absolute_slot": 221184000,
"block_height": 650000000,
"transaction_count": 923472834
},
"id": 1
}Sourcepub fn pause_clock(&self) -> impl Future<Output = RpcResult<EpochInfo>>
pub fn pause_clock(&self) -> impl Future<Output = RpcResult<EpochInfo>>
A cheat code to freeze the Surfnet clock on the local network. All time progression halts until resumed.
§Returns
An EpochInfo object showing the current clock state at the moment of pause.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_pauseClock",
"params": []
}§Example Response
{
"jsonrpc": "2.0",
"result": {
"epoch": 512,
"slot_index": 0,
"slots_in_epoch": 432000,
"absolute_slot": 221184000,
"block_height": 650000000,
"transaction_count": 923472834
},
"id": 1
}Sourcepub fn resume_clock(&self) -> impl Future<Output = RpcResult<EpochInfo>>
pub fn resume_clock(&self) -> impl Future<Output = RpcResult<EpochInfo>>
A cheat code to resume Solana clock progression after it was paused. The validator will start producing new slots again.
§Parameters
§Returns
An EpochInfo object reflecting the resumed clock state.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_resumeClock",
"params": []
}§Example Response
{
"jsonrpc": "2.0",
"result": {
"epoch": 512,
"slot_index": 0,
"slots_in_epoch": 432000,
"absolute_slot": 221184000,
"block_height": 650000000,
"transaction_count": 923472834
},
"id": 1
}Sourcepub fn reset_account(
&self,
pubkey_str: String,
config: Option<ResetAccountConfig>,
) -> impl Future<Output = RpcResult<RpcResponse<()>>>
pub fn reset_account( &self, pubkey_str: String, config: Option<ResetAccountConfig>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>
A cheat code to reset an account on the local network.
§Parameters
pubkey_str: The base-58 encoded public key of the account to reset.config: AResetAccountConfigspecifying how to reset the account. If omitted, the account will be reset without cascading to owned accounts.
§Returns
An RpcResponse<()> indicating whether the account reset was successful.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_resetAccount",
"params": [ "4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa", { "includeOwnedAccounts": true } ]
}§Example Response
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 123456789,
"apiVersion": "2.3.8"
},
"value": null
},
"id": 1
}Sourcepub fn reset_network(&self) -> impl Future<Output = RpcResult<RpcResponse<()>>>
pub fn reset_network(&self) -> impl Future<Output = RpcResult<RpcResponse<()>>>
A cheat code to reset a network.
§Returns
An RpcResponse<()> indicating whether the network reset was successful.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_resetNetwork", /// }§Example Response
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 123456789,
"apiVersion": "2.3.8"
},
"value": null /// },
"id": 1
}Sourcepub fn export_snapshot(
&self,
config: Option<ExportSnapshotConfig>,
) -> impl Future<Output = RpcResult<RpcResponse<BTreeMap<String, AccountSnapshot>>>>
pub fn export_snapshot( &self, config: Option<ExportSnapshotConfig>, ) -> impl Future<Output = RpcResult<RpcResponse<BTreeMap<String, AccountSnapshot>>>>
A cheat code to export a snapshot of all accounts in the Surfnet SVM.
This method retrieves the current state of all accounts stored in the Surfnet Virtual Machine (SVM) and returns them as a mapping of account public keys to their respective account snapshots.
§Parameters
config: An optionalExportSnapshotConfigto customize the export behavior. The config fields are:includeParsedAccounts: If true, includes parsed account data in the snapshot.filter: An optional filter config to limit which accounts are included in the snapshot. Fields include:includeProgramAccounts: A boolean indicating whether to include program accounts.includeAccounts: A list of specific account public keys to include.excludeAccounts: A list of specific account public keys to exclude.
scope: An optional scope to limit the accounts included in the snapshot. Options include:network: Includes all accounts in the network.preTransaction: Only includes accounts touched by the given transaction.
§Returns
An RpcResponse<BTreeMap<String, AccountSnapshot>> containing the exported account snapshots.
The keys of the map are the base-58 encoded public keys of the accounts,
and the values are the corresponding AccountSnapshot objects.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_exportSnapshot"
}§Example Response
{
"jsonrpc": "2.0",
"result": {
"4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa": {
"lamports": 1000000,
"owner": "11111111111111111111111111111111",
"executable": false,
"rent_epoch": 0,
"data": "base64_encoded_data_string"
},
"AnotherAccountPubkeyBase58": {
"lamports": 500000,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"executable": false,
"rent_epoch": 0,
"data": "base64_encoded_data_string"
}
},
"id": 1
}Sourcepub fn stream_account(
&self,
pubkey_str: String,
config: Option<StreamAccountConfig>,
) -> impl Future<Output = RpcResult<RpcResponse<()>>>
pub fn stream_account( &self, pubkey_str: String, config: Option<StreamAccountConfig>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>
A cheat code to simulate account streaming. When a transaction is processed, the accounts that are accessed are downloaded from the datasource and cached in the SVM. With this method, you can simulate the streaming of accounts by providing a pubkey.
§Parameters
pubkey_str: The base-58 encoded public key of the account to stream.config: AStreamAccountConfigspecifying how to stream the account. If omitted, the account will be streamed without cascading to owned accounts.
§Returns
An RpcResponse<()> indicating whether the account stream registration was successful.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_streamAccount",
"params": [ "4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa", { "includeOwnedAccounts": true } ]
}§Example Response
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 123456789,
"apiVersion": "2.3.8"
},
"value": null
},
"id": 1
}Sourcepub fn get_streamed_accounts(
&self,
) -> impl Future<Output = RpcResult<RpcResponse<GetStreamedAccountsResponse>>>
pub fn get_streamed_accounts( &self, ) -> impl Future<Output = RpcResult<RpcResponse<GetStreamedAccountsResponse>>>
A cheat code to retrieve the streamed accounts. When a transaction is processed, the accounts that are accessed are downloaded from the datasource and cached in the SVM. With this method, you can simulate the streaming of accounts by providing a pubkey.
§Parameters
§Returns
An RpcResponse<()> indicating whether the account stream registration was successful.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_getStreamedAccounts",
"params": []
}§Example Response
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 123456789,
"apiVersion": "2.3.8"
},
"value": [
"4EXSeLGxVBpAZwq7vm6evLdewpcvE2H56fpqL2pPiLFa"
]
},
"id": 1
}Sourcepub fn get_surfnet_info(
&self,
) -> impl Future<Output = RpcResult<RpcResponse<GetSurfnetInfoResponse>>>
pub fn get_surfnet_info( &self, ) -> impl Future<Output = RpcResult<RpcResponse<GetSurfnetInfoResponse>>>
A cheat code to get Surfnet network information.
§Returns
A RpcResponse<GetSurfnetInfoResponse> containing the Surfnet network information.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_getSurfnetInfo"
}§Example Response
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 369027326,
"apiVersion": "2.3.8"
},
"value": {
"runbookExecutions": [
{
"startedAt": 1758747828,
"completedAt": 1758747828,
"runbookId": "deployment"
}
]
}
},
"id": 1
}Sourcepub fn write_program(
&self,
program_id: String,
data: String,
offset: usize,
authority: Option<String>,
) -> impl Future<Output = RpcResult<RpcResponse<()>>>
pub fn write_program( &self, program_id: String, data: String, offset: usize, authority: Option<String>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>
A “cheat code” method for developers to write program data at a specified offset in Surfpool.
This method allows developers to write large Solana programs by sending data in chunks, bypassing transaction size limits by using RPC size limits (5MB) instead.
§Parameters
program_id: The public key of the program account, as a base-58 encoded string.data: Hex-encoded program data chunk to write.offset: The byte offset at which to write this data chunk.authority(optional): The base-58 encoded public key of the authority allowed to write to the program. If omitted, defaults to the system program.
§Returns
A RpcResponse<()> indicating whether the write was successful.
§Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_writeProgram",
"params": [
"program_pubkey",
"deadbeef...",
0
]
}§Example Response
{
"jsonrpc": "2.0",
"result": {},
"id": 1
}§Notes
This method is designed to help developers deploy large programs by writing data incrementally. Multiple calls can be made with different offsets to build the complete program. The program account and program data account will be created automatically if they don’t exist.
Sourcepub fn register_scenario(
&self,
scenario: Scenario,
slot: Option<Slot>,
) -> impl Future<Output = RpcResult<RpcResponse<()>>>
pub fn register_scenario( &self, scenario: Scenario, slot: Option<Slot>, ) -> impl Future<Output = RpcResult<RpcResponse<()>>>
A cheat code to register a scenario with account overrides.
§Parameters
scenario: The Scenario object containing:id: Unique identifier for the scenarioname: Human-readable namedescription: Description of the scenariooverrides: Array of OverrideInstance objects, each containing:id: Unique identifier for this override instancetemplateId: Reference to the override templatevalues: HashMap of field paths to override valuesscenarioRelativeSlot: The relative slot offset (from base slot) when this override should be appliedlabel: Optional label for this overrideenabled: Whether this override is activefetchBeforeUse: If true, fetch fresh account data just before transaction execution (useful for price feeds, oracle updates, and dynamic balances)account: Account address (either{ "pubkey": "..." }or{ "pda": { "programId": "...", "seeds": [...] } })
tags: Array of tags for categorization
slot(optional): The base slot from which relative slot offsets are calculated. If omitted, uses the current slot.
§Returns
A RpcResponse<()> indicating whether the Scenario registration was successful.
§Example Request (with slot)
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_registerScenario",
"params": [
{
"id": "scenario-1",
"name": "Price Feed Override",
"description": "Override Pyth BTC/USD price at specific slots",
"overrides": [
{
"id": "override-1",
"templateId": "pyth_btcusd",
"values": {
"price_message.price_value": 67500,
"price_message.conf": 100,
"price_message.expo": -8
},
"scenarioRelativeSlot": 100,
"label": "Set BTC price to $67,500",
"enabled": true,
"fetchBeforeUse": false,
"account": {
"pubkey": "H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4QJNYH"
}
}
],
"tags": ["defi", "price-feed"]
},
355684457
]
}§Example Request (without slot)
{
"jsonrpc": "2.0",
"id": 1,
"method": "surfnet_registerScenario",
"params": [
{
"id": "scenario-1",
"name": "Price Feed Override",
"description": "Override Pyth BTC/USD price",
"overrides": [
{
"id": "override-1",
"templateId": "pyth_btcusd",
"values": {
"price_message.price_value": 67500
},
"scenarioRelativeSlot": 100,
"label": "Set BTC price",
"enabled": true,
"fetchBeforeUse": true,
"account": {
"pubkey": "H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4QJNYH"
}
}
],
"tags": []
}
]
}§Example Response
{
"jsonrpc": "2.0",
"context": {
"slot": 355684457,
"apiVersion": "2.2.2"
},
"value": null,
"id": 1
}Trait Implementations§
Source§impl From<RpcChannel> for Client
impl From<RpcChannel> for Client
Source§fn from(channel: RpcChannel) -> Self
fn from(channel: RpcChannel) -> Self
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.