# Table of Contents - [Tutorial | Bankrun](#tutorial-bankrun) - [Introduction | Bankrun](#introduction-bankrun) - [API Reference - v0.4.0 | Bankrun](#api-reference-v0-4-0-bankrun) - [Class: BanksClient | Bankrun](#class-banksclient-bankrun) - [Class: BanksTransactionMeta | Bankrun](#class-bankstransactionmeta-bankrun) - [Class: Clock | Bankrun](#class-clock-bankrun) - [Class: FeeRateGovernor | Bankrun](#class-feerategovernor-bankrun) - [Class: PohConfig | Bankrun](#class-pohconfig-bankrun) - [Class: TransactionReturnData | Bankrun](#class-transactionreturndata-bankrun) - [Class: EpochSchedule | Bankrun](#class-epochschedule-bankrun) - [Class: TransactionStatus | Bankrun](#class-transactionstatus-bankrun) - [Interface: AddedAccount | Bankrun](#interface-addedaccount-bankrun) - [Class: BanksTransactionResultWithMeta | Bankrun](#class-bankstransactionresultwithmeta-bankrun) - [Interface: AddedProgram | Bankrun](#interface-addedprogram-bankrun) - [Class: Rent | Bankrun](#class-rent-bankrun) - [Class: GenesisConfig | Bankrun](#class-genesisconfig-bankrun) - [Class: ProgramTestContext | Bankrun](#class-programtestcontext-bankrun) --- # Tutorial | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/tutorial/#tutorial) Tutorial ============================================================================== [#](https://kevinheavey.github.io/solana-bankrun/tutorial/#deploying-programs) Deploying programs -------------------------------------------------------------------------------------------------- Most of the time we want to do more than just mess around with token transfers - we want to test our own programs. `solana-program-test` is a bit fussy about how this is done. Firstly, the program's `.so` file must be present in one of the following directories: * `./tests/fixtures` (just create this directory if it doesn't exist) * The current working directory * A directory you define in the `BPF_OUT_DIR` or `SBF_OUT_DIR` environment variables. (If you're not aware, the `.so` file is created when you run `anchor build` or `cargo build-sbf` and can be found in `target/deploy`). TIP If you want to pull a Solana program from mainnet or devnet, use the `solana program dump` command from the Solana CLI. Now to add the program to our tests we use the `programs` parameter in the `start` function. The program name used in this parameter must match the filename without the `.so` extension. Here's an example using a [simple program (opens new window)](https://github.com/solana-labs/solana-program-library/tree/bd216c8103cd8eb9f5f32e742973e7afb52f3b81/examples/rust/logging) from the Solana Program Library that just does some logging: import { start } from "solana-bankrun"; import { PublicKey, Transaction, TransactionInstruction, } from "@solana/web3.js"; test("spl logging", async () => { const programId = PublicKey.unique(); const context = await start([{ name: "spl_example_logging", programId }], []); const client = context.banksClient; const payer = context.payer; const blockhash = context.lastBlockhash; const ixs = [\ new TransactionInstruction({\ programId,\ keys: [\ { pubkey: PublicKey.unique(), isSigner: false, isWritable: false },\ ],\ }),\ ]; const tx = new Transaction(); tx.recentBlockhash = blockhash; tx.add(...ixs); tx.sign(payer); // let's sim it first const simRes = await client.simulateTransaction(tx); const meta = await client.processTransaction(tx); expect(simRes.meta?.logMessages).toEqual(meta?.logMessages); expect(meta.logMessages[1]).toBe("Program log: static string"); }); The `.so` file must be named `spl_example_logging.so`, since `spl_example_logging` is the name we used in the `programs` parameter. [#](https://kevinheavey.github.io/solana-bankrun/tutorial/#anchor-integration) Anchor integration -------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/tutorial/#basic) Basic If you have an Anchor workspace, `bankrun` can make some extra assumptions that make it more convenient to get started. Just use `start_anchor` and give it the path to the project root (the folder containing the `Anchor.toml` file). The programs in the workspace will be automatically deployed to the test environment. Example: import { startAnchor } from "solana-bankrun"; import { PublicKey } from "@solana/web3.js"; test("anchor", async () => { const context = await startAnchor("tests/anchor-example", [], []); const programId = new PublicKey( "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS", ); const executableAccount = await context.banksClient.getAccount(programId); expect(executableAccount).not.toBeNull(); expect(executableAccount?.executable).toBe(true); }); ### [#](https://kevinheavey.github.io/solana-bankrun/tutorial/#anchor-bankrun) anchor-bankrun If you want deeper Anchor integration, you can install the [anchor-bankrun (opens new window)](https://www.npmjs.com/package/anchor-bankrun) package. This allows you to write typical Anchor tests with minimal changes using the `BankrunProvider` class. Here's an example that tests a program from the Anchor repository: import { startAnchor } from "solana-bankrun"; import { BankrunProvider } from "anchor-bankrun"; import { Keypair, PublicKey } from "@solana/web3.js"; import { BN, Program } from "@coral-xyz/anchor"; import { IDL as PuppetIDL, Puppet } from "./anchor-example/puppet"; const PUPPET_PROGRAM_ID = new PublicKey( "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS", ); test("anchor", async () => { const context = await startAnchor("tests/anchor-example", [], []); const provider = new BankrunProvider(context); const puppetProgram = new Program( PuppetIDL, PUPPET_PROGRAM_ID, provider, ); const puppetKeypair = Keypair.generate(); await puppetProgram.methods .initialize() .accounts({ puppet: puppetKeypair.publicKey, }) .signers([puppetKeypair]) .rpc(); const data = new BN(123456); await puppetProgram.methods .setData(data) .accounts({ puppet: puppetKeypair.publicKey, }) .rpc(); const dataAccount = await puppetProgram.account.data.fetch( puppetKeypair.publicKey, ); expect(dataAccount.data.eq(new BN(123456))); }); [#](https://kevinheavey.github.io/solana-bankrun/tutorial/#time-travel) Time travel ------------------------------------------------------------------------------------ Many programs rely on the `Clock` sysvar: for example, a mint that doesn't become available until after a certain time. With `bankrun` you can dynamically overwrite the `Clock` sysvar using `context.set_clock()`. Here's an example using a program that panics if `clock.unix_timestamp` is greater than 100 (which is on January 1st 1970): import { Clock, start } from "solana-bankrun"; import { PublicKey, Transaction, TransactionInstruction, } from "@solana/web3.js"; test("clock", async () => { const programId = PublicKey.unique(); const context = await start( [{ name: "bankrun_clock_example", programId }], [], ); const client = context.banksClient; const payer = context.payer; const blockhash = context.lastBlockhash; const ixs = [\ new TransactionInstruction({ keys: [], programId, data: Buffer.from("") }),\ ]; const tx = new Transaction(); tx.recentBlockhash = blockhash; tx.add(...ixs); tx.sign(payer); // this will fail because it's not January 1970 anymore await expect(client.processTransaction(tx)).rejects.toThrow( "Program failed to complete", ); // so let's turn back time const currentClock = await client.getClock(); context.setClock( new Clock( currentClock.slot, currentClock.epochStartTimestamp, currentClock.epoch, currentClock.leaderScheduleEpoch, 50n, ), ); const ixs2 = [\ new TransactionInstruction({\ keys: [],\ programId,\ data: Buffer.from("foobar"), // unused, just here to dedup the tx\ }),\ ]; const tx2 = new Transaction(); tx2.recentBlockhash = blockhash; tx2.add(...ixs2); tx2.sign(payer); // now the transaction goes through await client.processTransaction(tx2); }); See also: `context.warp_to_slot()`, which lets you jump to a future slot. [#](https://kevinheavey.github.io/solana-bankrun/tutorial/#writing-arbitrary-accounts) Writing arbitrary accounts ------------------------------------------------------------------------------------------------------------------ Bankrun lets you write any account data you want, regardless of whether the account state would even be possible. Here's an example where we give an account a bunch of USDC, even though we don't have the USDC mint keypair. This is convenient for testing because it means we don't have to work with fake USDC in our tests: import { start } from "solana-bankrun"; import { PublicKey } from "@solana/web3.js"; import { getAssociatedTokenAddressSync, AccountLayout, ACCOUNT_SIZE, TOKEN_PROGRAM_ID, } from "@solana/spl-token"; test("infinite usdc mint", async () => { const owner = PublicKey.unique(); const usdcMint = new PublicKey( "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", ); const ata = getAssociatedTokenAddressSync(usdcMint, owner, true); const usdcToOwn = 1_000_000_000_000n; const tokenAccData = Buffer.alloc(ACCOUNT_SIZE); AccountLayout.encode( { mint: usdcMint, owner, amount: usdcToOwn, delegateOption: 0, delegate: PublicKey.default, delegatedAmount: 0n, state: 1, isNativeOption: 0, isNative: 0n, closeAuthorityOption: 0, closeAuthority: PublicKey.default, }, tokenAccData, ); const context = await start( [], [\ {\ address: ata,\ info: {\ lamports: 1_000_000_000,\ data: tokenAccData,\ owner: TOKEN_PROGRAM_ID,\ executable: false,\ },\ },\ ], ); const client = context.banksClient; const rawAccount = await client.getAccount(ata); expect(rawAccount).not.toBeNull(); const rawAccountData = rawAccount?.data; const decoded = AccountLayout.decode(rawAccountData); expect(decoded.amount).toBe(usdcToOwn); }); TIP If you want to set account data _after_ calling `start()`, you can use `context.set_account()`. ### [#](https://kevinheavey.github.io/solana-bankrun/tutorial/#copying-accounts-from-a-live-environment) Copying Accounts from a live environment If you want to copy accounts from mainnet or devnet, you can use the `solana account` command in the Solana CLI to save account data to a file. Or, if you want to pull live data every time you test, you can do this with a few lines of code. Here's a simple example that pulls account data from devnet and passes it to bankrun: import { start } from "solana-bankrun"; import { PublicKey, Connection } from "@solana/web3.js"; test("copy accounts from devnet", async () => { const owner = PublicKey.unique(); const usdcMint = new PublicKey( "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", ); const connection = new Connection("https://api.devnet.solana.com"); const accountInfo = await connection.getAccountInfo(usdcMint); const context = await start( [], [\ {\ address: usdcMint,\ info: accountInfo,\ },\ ], ); const client = context.banksClient; const rawAccount = await client.getAccount(usdcMint); expect(rawAccount).not.toBeNull(); }); [#](https://kevinheavey.github.io/solana-bankrun/tutorial/#other-features) Other features ------------------------------------------------------------------------------------------ Other things you can do with `bankrun` include: * Changing the max compute units with the `compute_max_units` parameter. * Changing the transaction account lock limit with the `transaction_account_lock_limit` parameter. [#](https://kevinheavey.github.io/solana-bankrun/tutorial/#when-should-i-use-solana-test-validator) When should I use `solana-test-validator`? ----------------------------------------------------------------------------------------------------------------------------------------------- While `bankrun` is faster and more convenient, it is also less like a real RPC node. So `solana-test-validator` is still useful when you need to call RPC methods that `BanksServer` doesn't support, or when you want to test something that depends on real-life validator behaviour rather than just testing your program and client code. In general though I would recommend using `bankrun` wherever possible, as it will make your life much easier. [#](https://kevinheavey.github.io/solana-bankrun/tutorial/#supported-platforms) Supported platforms ---------------------------------------------------------------------------------------------------- `bankrun` is supported on Linux x64 and MacOS targets, because this is what `solana-program-test` runs on. If you find a platform that is not supported but which can run `solana-program-test`, please open an issue. ← [Introduction](https://kevinheavey.github.io/solana-bankrun/) [API Reference - v0.4.0](https://kevinheavey.github.io/solana-bankrun/api/) → --- # Introduction | Bankrun ![](https://raw.githubusercontent.com/kevinheavey/solana-bankrun/main/logo.png) * * * [#](https://kevinheavey.github.io/solana-bankrun/#bankrun-deprecated) Bankrun (deprecated) =========================================================================================== DEPRECATED: use [LiteSVM (opens new window)](https://github.com/LiteSVM/litesvm/tree/master/crates/node-litesvm) instead. `Bankrun` is a superfast, powerful and lightweight framework for testing Solana programs in NodeJS. While people often use `solana-test-validator` for this, `bankrun` is orders of magnitude faster and far more convenient. You can also do things that are not possible with `solana-test-validator`, such as jumping back and forth in time or dynamically setting account data. If you've used [solana-program-test (opens new window)](https://crates.io/crates/solana-program-test) you'll be familiar with `bankrun`, since that's what it uses under the hood. For those unfamiliar, `bankrun` and `solana-program-test` work by spinning up a lightweight `BanksServer` that's like an RPC node but much faster, and creating a `BanksClient` to talk to the server. This author thought `solana-program-test` was a boring name, so he chose `bankrun` instead (you're running Solana [Banks (opens new window)](https://github.com/solana-labs/solana/blob/master/runtime/src/bank.rs) ). [#](https://kevinheavey.github.io/solana-bankrun/#minimal-example) Minimal example ----------------------------------------------------------------------------------- This example just transfers lamports from Alice to Bob without loading any programs of our own. It uses the [jest (opens new window)](https://jestjs.io/) test runner but you can use any test runner you like. Note: If you have multiple test files you should disable parallel tests using the `--runInBand` Jest flag for now. There is an [open issue (opens new window)](https://github.com/kevinheavey/solana-bankrun/issues/2) where concurrent Jest tests occasionally fail due to the program name getting garbled. Note: The underlying Rust process may print a lot of logs. You can control these with the `RUST_LOG` environment variable. If you want to silence these logs your test command would look like `RUST_LOG= jest --runInBand`. import { start } from "solana-bankrun"; import { PublicKey, Transaction, SystemProgram } from "@solana/web3.js"; test("one transfer", async () => { const context = await start([], []); const client = context.banksClient; const payer = context.payer; const receiver = PublicKey.unique(); const blockhash = context.lastBlockhash; const transferLamports = 1_000_000n; const ixs = [\ SystemProgram.transfer({\ fromPubkey: payer.publicKey,\ toPubkey: receiver,\ lamports: transferLamports,\ }),\ ]; const tx = new Transaction(); tx.recentBlockhash = blockhash; tx.add(...ixs); tx.sign(payer); await client.processTransaction(tx); const balanceAfter = await client.getBalance(receiver); expect(balanceAfter).toEqual(transferLamports); }); Some things to note here: * The `context` object contains a `banks_client` to talk to the `BanksServer`, a `payer` keypair that has been funded with a bunch of SOL, and a `last_blockhash` that we can use in our transactions. * We haven't loaded any specific programs, but by default we have access to the System Program, the SPL token programs and the SPL memo program. [#](https://kevinheavey.github.io/solana-bankrun/#installation) Installation ----------------------------------------------------------------------------- yarn add solana-bankrun [#](https://kevinheavey.github.io/solana-bankrun/#contributing) Contributing ----------------------------------------------------------------------------- Make sure you have Yarn and the Rust toolchain installed. Then run `yarn` to install deps, run `yarn build` to build the binary and `yarn test` to run the tests. [Tutorial](https://kevinheavey.github.io/solana-bankrun/tutorial/) → --- # API Reference - v0.4.0 | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/#api-reference-v0-4-0) API Reference - v0.4.0 =================================================================================================== [#](https://kevinheavey.github.io/solana-bankrun/api/#table-of-contents) Table of contents ------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/#classes) Classes * [BanksClient](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html) * [BanksTransactionMeta](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html) * [BanksTransactionResultWithMeta](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html) * [Clock](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html) * [EpochSchedule](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html) * [FeeRateGovernor](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html) * [GenesisConfig](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html) * [PohConfig](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html) * [ProgramTestContext](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html) * [Rent](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html) * [TransactionReturnData](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html) * [TransactionStatus](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html) ### [#](https://kevinheavey.github.io/solana-bankrun/api/#interfaces) Interfaces * [AddedAccount](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html) * [AddedProgram](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html) ### [#](https://kevinheavey.github.io/solana-bankrun/api/#type-aliases) Type Aliases * [AccountInfoBytes](https://kevinheavey.github.io/solana-bankrun/api/#accountinfobytes) * [ClusterType](https://kevinheavey.github.io/solana-bankrun/api/#clustertype) ### [#](https://kevinheavey.github.io/solana-bankrun/api/#functions) Functions * [start](https://kevinheavey.github.io/solana-bankrun/api/#start) * [startAnchor](https://kevinheavey.github.io/solana-bankrun/api/#startanchor) [#](https://kevinheavey.github.io/solana-bankrun/api/#type-aliases-2) Type Aliases ----------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/#accountinfobytes) AccountInfoBytes Ƭ **AccountInfoBytes**: `AccountInfo`<`Uint8Array`\> #### [#](https://kevinheavey.github.io/solana-bankrun/api/#defined-in) Defined in [index.ts:42 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L42) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/#clustertype) ClusterType Ƭ **ClusterType**: `Cluster` | `"development"` #### [#](https://kevinheavey.github.io/solana-bankrun/api/#defined-in-2) Defined in [index.ts:137 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L137) [#](https://kevinheavey.github.io/solana-bankrun/api/#functions-2) Functions ----------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/#start) start ▸ **start**(`programs`, `accounts`, `computeMaxUnits?`, `transactionAccountLockLimit?`, `deactivateFeatures?`): `Promise`<[`ProgramTestContext`](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html) \> Start a bankrun! This will spin up a BanksServer and a BanksClient, deploy programs and add accounts as instructed. #### [#](https://kevinheavey.github.io/solana-bankrun/api/#parameters) Parameters | Name | Type | Description | | --- | --- | --- | | `programs` | [`AddedProgram`](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html)
\[\] | An array of objects indicating which programs to deploy to the test environment. See the main bankrun docs for more explanation on how to add programs. | | `accounts` | [`AddedAccount`](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html)
\[\] | An array of objects indicating what data to write to the given addresses. | | `computeMaxUnits?` | `bigint` | Override the default compute unit limit for a transaction. | | `transactionAccountLockLimit?` | `bigint` | Override the default transaction account lock limit. | | `deactivateFeatures?` | `PublicKey`\[\] | A list of feature IDs (pubkeys) to deactivate. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/#returns) Returns `Promise`<[`ProgramTestContext`](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html) \> A container for stuff you'll need to send transactions and interact with the test environment. #### [#](https://kevinheavey.github.io/solana-bankrun/api/#defined-in-3) Defined in [index.ts:506 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L506) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/#startanchor) startAnchor ▸ **startAnchor**(`path`, `extraPrograms`, `accounts`, `computeMaxUnits?`, `transactionAccountLockLimit?`, `deactivateFeatures?`): `Promise`<[`ProgramTestContext`](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html) \> Start a bankrun in an Anchor workspace, with all the workspace programs deployed. This will spin up a BanksServer and a BanksClient, deploy programs and add accounts as instructed. #### [#](https://kevinheavey.github.io/solana-bankrun/api/#parameters-2) Parameters | Name | Type | Description | | --- | --- | --- | | `path` | `string` | Path to root of the Anchor project. | | `extraPrograms` | [`AddedProgram`](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html)
\[\] | \- | | `accounts` | [`AddedAccount`](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html)
\[\] | An array of objects indicating what data to write to the given addresses. | | `computeMaxUnits?` | `bigint` | Override the default compute unit limit for a transaction. | | `transactionAccountLockLimit?` | `bigint` | Override the default transaction account lock limit. | | `deactivateFeatures?` | `PublicKey`\[\] | A list of feature IDs (pubkeys) to deactivate. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/#returns-2) Returns `Promise`<[`ProgramTestContext`](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html) \> A container for stuff you'll need to send transactions and interact with the test environment. #### [#](https://kevinheavey.github.io/solana-bankrun/api/#defined-in-4) Defined in [index.ts:537 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L537) --- # Class: BanksClient | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#class-banksclient) Class: BanksClient ==================================================================================================================== A client for the ledger state, from the perspective of an arbitrary validator. The client is used to send transactions and query account data, among other things. Use `start()` to initialize a BanksClient. [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#table-of-contents) Table of contents ------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#constructors) Constructors * [constructor](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#constructor) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#properties) Properties * [inner](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#inner) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#methods) Methods * [getAccount](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getaccount) * [getBalance](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getbalance) * [getBlockHeight](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getblockheight) * [getClock](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getclock) * [getFeeForMessage](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getfeeformessage) * [getLatestBlockhash](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getlatestblockhash) * [getRent](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getrent) * [getSlot](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getslot) * [getTransactionStatus](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#gettransactionstatus) * [getTransactionStatuses](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#gettransactionstatuses) * [processTransaction](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#processtransaction) * [sendTransaction](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#sendtransaction) * [simulateTransaction](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#simulatetransaction) * [tryProcessTransaction](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#tryprocesstransaction) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#constructors-2) Constructors ----------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#constructor) constructor • **new BanksClient**(`inner`) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters) Parameters | Name | Type | | --- | --- | | `inner` | `BanksClient` | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in) Defined in [index.ts:197 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L197) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#properties-2) Properties ------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#inner) inner • `Private` **inner**: `BanksClient` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-2) Defined in [index.ts:200 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L200) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#methods-2) Methods ------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getaccount) getAccount ▸ **getAccount**(`address`, `commitment?`): `Promise`<[`AccountInfoBytes`](https://kevinheavey.github.io/solana-bankrun/api/#accountinfobytes) \> Return the account at the given address at the slot corresponding to the given commitment level. If the account is not found, None is returned. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters-2) Parameters | Name | Type | Description | | --- | --- | --- | | `address` | `PublicKey` | The account address to look up. | | `commitment?` | `Commitment` | The commitment to use. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns) Returns `Promise`<[`AccountInfoBytes`](https://kevinheavey.github.io/solana-bankrun/api/#accountinfobytes) \> The account object, if the account exists. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-3) Defined in [index.ts:209 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L209) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getbalance) getBalance ▸ **getBalance**(`address`, `commitment?`): `Promise`<`bigint`\> Return the balance in lamports of an account at the given address at the slot. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters-3) Parameters | Name | Type | Description | | --- | --- | --- | | `address` | `PublicKey` | The account to look up. | | `commitment?` | `Commitment` | The commitment to use. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-2) Returns `Promise`<`bigint`\> The account balance in lamports. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-4) Defined in [index.ts:371 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L371) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getblockheight) getBlockHeight ▸ **getBlockHeight**(`commitment?`): `Promise`<`bigint`\> Get the current block height. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters-4) Parameters | Name | Type | Description | | --- | --- | --- | | `commitment?` | `Commitment` | The commitment to use. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-3) Returns `Promise`<`bigint`\> The current block height. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-5) Defined in [index.ts:345 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L345) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getclock) getClock ▸ **getClock**(): `Promise`<[`Clock`](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html) \> Get the cluster clock. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-4) Returns `Promise`<[`Clock`](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html) \> the clock object. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-6) Defined in [index.ts:361 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L361) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getfeeformessage) getFeeForMessage ▸ **getFeeForMessage**(`msg`, `commitment?`): `Promise`<`bigint`\> Get the fee in lamports for a given message. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters-5) Parameters | Name | Type | Description | | --- | --- | --- | | `msg` | `Message` | The message to check. | | `commitment?` | `Commitment` | The commitment to use. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-5) Returns `Promise`<`bigint`\> The fee for the given message. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-7) Defined in [index.ts:402 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L402) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getlatestblockhash) getLatestBlockhash ▸ **getLatestBlockhash**(`commitment?`): `Promise`<\[`string`, `bigint`\]> Returns latest blockhash and last valid block height for given commitment level. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters-6) Parameters | Name | Type | Description | | --- | --- | --- | | `commitment?` | `Commitment` | The commitment to use. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-6) Returns `Promise`<\[`string`, `bigint`\]> The blockhash and last valid block height. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-8) Defined in [index.ts:386 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L386) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getrent) getRent ▸ **getRent**(): `Promise`<[`Rent`](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html) \> Get the cluster rent. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-7) Returns `Promise`<[`Rent`](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html) \> The rent object. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-9) Defined in [index.ts:353 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L353) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#getslot) getSlot ▸ **getSlot**(`commitment?`): `Promise`<`bigint`\> Get the slot that has reached the given commitment level (or the default commitment). #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters-7) Parameters | Name | Type | Description | | --- | --- | --- | | `commitment?` | `Commitment` | The commitment to use. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-8) Returns `Promise`<`bigint`\> The current slot. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-10) Defined in [index.ts:336 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L336) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#gettransactionstatus) getTransactionStatus ▸ **getTransactionStatus**(`signature`): `Promise`<[`TransactionStatus`](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html) \> Return the status of a transaction with a signature matching the transaction's first signature. Return None if the transaction is not found, which may be because the blockhash was expired or the fee-paying account had insufficient funds to pay the transaction fee. Note that servers rarely store the full transaction history. This method may return None if the transaction status has been discarded. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters-8) Parameters | Name | Type | Description | | --- | --- | --- | | `signature` | `string` | The transaction signature (the first signature of the transaction). | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-9) Returns `Promise`<[`TransactionStatus`](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html) \> The transaction status, if found. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-11) Defined in [index.ts:312 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L312) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#gettransactionstatuses) getTransactionStatuses ▸ **getTransactionStatuses**(`signatures`): `Promise`<[`TransactionStatus`](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html) \[\]> Same as `getTransactionStatus`, but for multiple transactions. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters-9) Parameters | Name | Type | Description | | --- | --- | --- | | `signatures` | `string`\[\] | The transaction signatures. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-10) Returns `Promise`<[`TransactionStatus`](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html) \[\]> The transaction statuses, if found. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-12) Defined in [index.ts:324 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L324) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#processtransaction) processTransaction ▸ **processTransaction**(`tx`): `Promise`<[`BanksTransactionMeta`](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html) \> Process a transaction and return the result with metadata. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters-10) Parameters | Name | Type | Description | | --- | --- | --- | | `tx` | `Transaction` \| `VersionedTransaction` | The transaction to send. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-11) Returns `Promise`<[`BanksTransactionMeta`](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html) \> The transaction result and metadata. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-13) Defined in [index.ts:239 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L239) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#sendtransaction) sendTransaction ▸ **sendTransaction**(`tx`): `Promise`<`void`\> Send a transaction and return immediately. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters-11) Parameters | Name | Type | Description | | --- | --- | --- | | `tx` | `Transaction` \| `VersionedTransaction` | The transaction to send. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-12) Returns `Promise`<`void`\> #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-14) Defined in [index.ts:224 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L224) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#simulatetransaction) simulateTransaction ▸ **simulateTransaction**(`tx`, `commitment?`): `Promise`<[`BanksTransactionResultWithMeta`](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html) \> Simulate a transaction at the given commitment level. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters-12) Parameters | Name | Type | Description | | --- | --- | --- | | `tx` | `Transaction` \| `VersionedTransaction` | The transaction to simulate. | | `commitment?` | `Commitment` | The commitment to use. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-13) Returns `Promise`<[`BanksTransactionResultWithMeta`](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html) \> The transaction simulation result. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-15) Defined in [index.ts:281 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L281) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#tryprocesstransaction) tryProcessTransaction ▸ **tryProcessTransaction**(`tx`): `Promise`<[`BanksTransactionResultWithMeta`](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html) \> Try to process a transaction and return the result with metadata. If the transaction errors, a JS error is not raised. Instead the returned object's `result` field will contain an error message. This makes it easier to process transactions that you expect to fail and make assertions about things like log messages. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#parameters-13) Parameters | Name | Type | Description | | --- | --- | --- | | `tx` | `Transaction` \| `VersionedTransaction` | The transaction to send. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#returns-14) Returns `Promise`<[`BanksTransactionResultWithMeta`](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html) \> The transaction result and metadata. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html#defined-in-16) Defined in [index.ts:263 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L263) --- # Class: BanksTransactionMeta | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#class-bankstransactionmeta) Class: BanksTransactionMeta =============================================================================================================================================== Transaction metadata. [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#table-of-contents) Table of contents ---------------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#constructors) Constructors * [constructor](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#constructor) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#properties) Properties * [inner](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#inner) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#accessors) Accessors * [computeUnitsConsumed](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#computeunitsconsumed) * [logMessages](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#logmessages) * [returnData](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#returndata) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#constructors-2) Constructors -------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#constructor) constructor • **new BanksTransactionMeta**(`inner`) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#parameters) Parameters | Name | Type | | --- | --- | | `inner` | `BanksTransactionMeta` | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#defined-in) Defined in [index.ts:98 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L98) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#properties-2) Properties ---------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#inner) inner • `Private` **inner**: `BanksTransactionMeta` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#defined-in-2) Defined in [index.ts:101 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L101) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#accessors-2) Accessors -------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#computeunitsconsumed) computeUnitsConsumed • `get` **computeUnitsConsumed**(): `bigint` The number of compute units consumed by the transaction. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#returns) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#defined-in-3) Defined in [index.ts:113 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L113) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#logmessages) logMessages • `get` **logMessages**(): `string`\[\] The log messages written during transaction execution. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#returns-2) Returns `string`\[\] #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#defined-in-4) Defined in [index.ts:103 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L103) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#returndata) returnData • `get` **returnData**(): [`TransactionReturnData`](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html) The transaction return data, if present. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#returns-3) Returns [`TransactionReturnData`](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html#defined-in-5) Defined in [index.ts:107 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L107) --- # Class: Clock | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#class-clock) Class: Clock ================================================================================================== A representation of network time. All members of `Clock` start from 0 upon network boot. [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#table-of-contents) Table of contents ------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#constructors) Constructors * [constructor](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#constructor) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#accessors) Accessors * [epoch](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#epoch) * [epochStartTimestamp](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#epochstarttimestamp) * [leaderScheduleEpoch](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#leaderscheduleepoch) * [slot](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#slot) * [unixTimestamp](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#unixtimestamp) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#constructors-2) Constructors ----------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#constructor) constructor • **new Clock**(`slot`, `epochStartTimestamp`, `epoch`, `leaderScheduleEpoch`, `unixTimestamp`) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#parameters) Parameters | Name | Type | Description | | --- | --- | --- | | `slot` | `bigint` | The current Slot. | | `epochStartTimestamp` | `bigint` | The timestamp of the first `Slot` in this `Epoch`. | | `epoch` | `bigint` | The current epoch. | | `leaderScheduleEpoch` | `bigint` | The future Epoch for which the leader schedule has most recently been calculated. | | `unixTimestamp` | `bigint` | The approximate real world time of the current slot. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#defined-in) Defined in [internal.d.ts:147 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L147) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#accessors-2) Accessors ----------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#epoch) epoch • `get` **epoch**(): `bigint` The current epoch. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#returns) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#defined-in-2) Defined in [internal.d.ts:151 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L151) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#epochstarttimestamp) epochStartTimestamp • `get` **epochStartTimestamp**(): `bigint` The timestamp of the first `Slot` in this `Epoch`. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#returns-2) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#defined-in-3) Defined in [internal.d.ts:153 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L153) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#leaderscheduleepoch) leaderScheduleEpoch • `get` **leaderScheduleEpoch**(): `bigint` The future Epoch for which the leader schedule has most recently been calculated. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#returns-3) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#defined-in-4) Defined in [internal.d.ts:155 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L155) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#slot) slot • `get` **slot**(): `bigint` The current Slot. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#returns-4) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#defined-in-5) Defined in [internal.d.ts:149 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L149) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#unixtimestamp) unixTimestamp • `get` **unixTimestamp**(): `bigint` The approximate real world time of the current slot. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#returns-5) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html#defined-in-6) Defined in [internal.d.ts:157 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L157) --- # Class: FeeRateGovernor | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#class-feerategovernor) Class: FeeRateGovernor ================================================================================================================================ [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#table-of-contents) Table of contents ----------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#constructors) Constructors * [constructor](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#constructor) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#accessors) Accessors * [burnPercent](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#burnpercent) * [lamportsPerSignature](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#lamportspersignature) * [maxLamportsPerSignature](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#maxlamportspersignature) * [minLamportsPerSignature](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#minlamportspersignature) * [targetLamportsPerSignature](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#targetlamportspersignature) * [targetSignaturesPerSlot](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#targetsignaturesperslot) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#constructors-2) Constructors --------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#constructor) constructor • **new FeeRateGovernor**() [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#accessors-2) Accessors --------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#burnpercent) burnPercent • `get` **burnPercent**(): `number` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#returns) Returns `number` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#defined-in) Defined in [internal.d.ts:170 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L170) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#lamportspersignature) lamportsPerSignature • `get` **lamportsPerSignature**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#returns-2) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#defined-in-2) Defined in [internal.d.ts:165 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L165) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#maxlamportspersignature) maxLamportsPerSignature • `get` **maxLamportsPerSignature**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#returns-3) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#defined-in-3) Defined in [internal.d.ts:169 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L169) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#minlamportspersignature) minLamportsPerSignature • `get` **minLamportsPerSignature**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#returns-4) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#defined-in-4) Defined in [internal.d.ts:168 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L168) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#targetlamportspersignature) targetLamportsPerSignature • `get` **targetLamportsPerSignature**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#returns-5) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#defined-in-5) Defined in [internal.d.ts:166 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L166) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#targetsignaturesperslot) targetSignaturesPerSlot • `get` **targetSignaturesPerSlot**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#returns-6) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html#defined-in-6) Defined in [internal.d.ts:167 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L167) --- # Class: PohConfig | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#class-pohconfig) Class: PohConfig ============================================================================================================== [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#table-of-contents) Table of contents ----------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#constructors) Constructors * [constructor](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#constructor) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#accessors) Accessors * [hashesPerTick](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#hashespertick) * [targetTickCount](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#targettickcount) * [targetTickDuration](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#targettickduration) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#constructors-2) Constructors --------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#constructor) constructor • **new PohConfig**() [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#accessors-2) Accessors --------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#hashespertick) hashesPerTick • `get` **hashesPerTick**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#returns) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#defined-in) Defined in [internal.d.ts:162 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L162) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#targettickcount) targetTickCount • `get` **targetTickCount**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#returns-2) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#defined-in-2) Defined in [internal.d.ts:161 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L161) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#targettickduration) targetTickDuration • `get` **targetTickDuration**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#returns-3) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html#defined-in-3) Defined in [internal.d.ts:160 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L160) --- # Class: TransactionReturnData | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#class-transactionreturndata) Class: TransactionReturnData ================================================================================================================================================== [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#table-of-contents) Table of contents ----------------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#constructors) Constructors * [constructor](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#constructor) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#properties) Properties * [inner](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#inner) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#accessors) Accessors * [data](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#data) * [programId](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#programid) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#constructors-2) Constructors --------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#constructor) constructor • **new TransactionReturnData**(`inner`) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#parameters) Parameters | Name | Type | | --- | --- | | `inner` | `TransactionReturnData` | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#defined-in) Defined in [index.ts:82 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L82) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#properties-2) Properties ----------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#inner) inner • `Private` **inner**: `TransactionReturnData` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#defined-in-2) Defined in [index.ts:85 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L85) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#accessors-2) Accessors --------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#data) data • `get` **data**(): `Uint8Array` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#returns) Returns `Uint8Array` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#defined-in-3) Defined in [index.ts:89 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L89) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#programid) programId • `get` **programId**(): `PublicKey` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#returns-2) Returns `PublicKey` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionReturnData.html#defined-in-4) Defined in [index.ts:86 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L86) --- # Class: EpochSchedule | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#class-epochschedule) Class: EpochSchedule ========================================================================================================================== [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#table-of-contents) Table of contents --------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#constructors) Constructors * [constructor](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#constructor) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#accessors) Accessors * [firstNormalEpoch](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#firstnormalepoch) * [firstNormalSlot](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#firstnormalslot) * [leaderScheduleSlotOffset](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#leaderscheduleslotoffset) * [slotsPerEpoch](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#slotsperepoch) * [warmup](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#warmup) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#constructors-2) Constructors ------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#constructor) constructor • **new EpochSchedule**() [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#accessors-2) Accessors ------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#firstnormalepoch) firstNormalEpoch • `get` **firstNormalEpoch**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#returns) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#defined-in) Defined in [internal.d.ts:183 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L183) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#firstnormalslot) firstNormalSlot • `get` **firstNormalSlot**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#returns-2) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#defined-in-2) Defined in [internal.d.ts:184 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L184) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#leaderscheduleslotoffset) leaderScheduleSlotOffset • `get` **leaderScheduleSlotOffset**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#returns-3) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#defined-in-3) Defined in [internal.d.ts:181 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L181) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#slotsperepoch) slotsPerEpoch • `get` **slotsPerEpoch**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#returns-4) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#defined-in-4) Defined in [internal.d.ts:180 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L180) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#warmup) warmup • `get` **warmup**(): `boolean` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#returns-5) Returns `boolean` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html#defined-in-5) Defined in [internal.d.ts:182 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L182) --- # Class: TransactionStatus | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#class-transactionstatus) Class: TransactionStatus ====================================================================================================================================== [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#table-of-contents) Table of contents ------------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#constructors) Constructors * [constructor](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#constructor) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#accessors) Accessors * [confirmationStatus](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#confirmationstatus) * [confirmations](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#confirmations) * [err](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#err) * [slot](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#slot) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#constructors-2) Constructors ----------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#constructor) constructor • **new TransactionStatus**() [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#accessors-2) Accessors ----------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#confirmationstatus) confirmationStatus • `get` **confirmationStatus**(): `string` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#returns) Returns `string` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#defined-in) Defined in [internal.d.ts:29 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L29) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#confirmations) confirmations • `get` **confirmations**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#returns-2) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#defined-in-2) Defined in [internal.d.ts:27 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L27) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#err) err • `get` **err**(): `string` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#returns-3) Returns `string` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#defined-in-3) Defined in [internal.d.ts:28 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L28) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#slot) slot • `get` **slot**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#returns-4) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/TransactionStatus.html#defined-in-4) Defined in [internal.d.ts:26 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L26) --- # Interface: AddedAccount | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html#interface-addedaccount) Interface: AddedAccount ================================================================================================================================== [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html#table-of-contents) Table of contents ----------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html#properties) Properties * [address](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html#address) * [info](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html#info) [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html#properties-2) Properties ----------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html#address) address • **address**: `PublicKey` #### [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html#defined-in) Defined in [index.ts:489 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L489) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html#info) info • **info**: [`AccountInfoBytes`](https://kevinheavey.github.io/solana-bankrun/api/#accountinfobytes) #### [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedAccount.html#defined-in-2) Defined in [index.ts:490 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L490) --- # Class: BanksTransactionResultWithMeta | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#class-bankstransactionresultwithmeta) Class: BanksTransactionResultWithMeta ============================================================================================================================================================================= A transaction result. Contains transaction metadata, and the transaction error, if there is one. [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#table-of-contents) Table of contents -------------------------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#constructors) Constructors * [constructor](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#constructor) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#properties) Properties * [inner](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#inner) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#accessors) Accessors * [meta](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#meta) * [result](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#result) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#constructors-2) Constructors ------------------------------------------------------------------------------------------------------------------------------ ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#constructor) constructor • **new BanksTransactionResultWithMeta**(`inner`) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#parameters) Parameters | Name | Type | | --- | --- | | `inner` | `BanksTransactionResultWithMeta` | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#defined-in) Defined in [index.ts:121 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L121) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#properties-2) Properties -------------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#inner) inner • `Private` **inner**: `BanksTransactionResultWithMeta` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#defined-in-2) Defined in [index.ts:124 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L124) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#accessors-2) Accessors ------------------------------------------------------------------------------------------------------------------------ ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#meta) meta • `get` **meta**(): [`BanksTransactionMeta`](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html) The transaction metadata. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#returns) Returns [`BanksTransactionMeta`](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionMeta.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#defined-in-3) Defined in [index.ts:130 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L130) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#result) result • `get` **result**(): `string` The transaction error info, if the transaction failed. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#returns-2) Returns `string` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksTransactionResultWithMeta.html#defined-in-4) Defined in [index.ts:126 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L126) --- # Interface: AddedProgram | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html#interface-addedprogram) Interface: AddedProgram ================================================================================================================================== [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html#table-of-contents) Table of contents ----------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html#properties) Properties * [name](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html#name) * [programId](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html#programid) [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html#properties-2) Properties ----------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html#name) name • **name**: `string` #### [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html#defined-in) Defined in [index.ts:484 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L484) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html#programid) programId • **programId**: `PublicKey` #### [#](https://kevinheavey.github.io/solana-bankrun/api/interfaces/AddedProgram.html#defined-in-2) Defined in [index.ts:485 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L485) --- # Class: Rent | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#class-rent) Class: Rent =============================================================================================== Configuration of network rent. [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#table-of-contents) Table of contents ------------------------------------------------------------------------------------------------------------ ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#constructors) Constructors * [constructor](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#constructor) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#accessors) Accessors * [burnPercent](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#burnpercent) * [exemptionThreshold](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#exemptionthreshold) * [lamportsPerByteYear](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#lamportsperbyteyear) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#methods) Methods * [calculateBurn](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#calculateburn) * [due](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#due) * [dueAmount](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#dueamount) * [isExempt](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#isexempt) * [minimumBalance](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#minimumbalance) * [default](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#default) * [free](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#free) * [withSlotsPerEpoch](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#withslotsperepoch) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#constructors-2) Constructors ---------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#constructor) constructor • **new Rent**(`lamportsPerByteYear`, `exemptionThreshold`, `burnPercent`) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#parameters) Parameters | Name | Type | Description | | --- | --- | --- | | `lamportsPerByteYear` | `bigint` | Rental rate in lamports/byte-year. | | `exemptionThreshold` | `number` | Amount of time (in years) a balance must include rent for the account to be rent exempt. | | `burnPercent` | `number` | The percentage of collected rent that is burned. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#defined-in) Defined in [internal.d.ts:71 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L71) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#accessors-2) Accessors ---------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#burnpercent) burnPercent • `get` **burnPercent**(): `number` The percentage of collected rent that is burned. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#returns) Returns `number` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#defined-in-2) Defined in [internal.d.ts:78 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L78) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#exemptionthreshold) exemptionThreshold • `get` **exemptionThreshold**(): `number` Amount of time (in years) a balance must include rent for the account to be rent exempt. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#returns-2) Returns `number` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#defined-in-3) Defined in [internal.d.ts:76 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L76) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#lamportsperbyteyear) lamportsPerByteYear • `get` **lamportsPerByteYear**(): `bigint` Rental rate in lamports/byte-year. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#returns-3) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#defined-in-4) Defined in [internal.d.ts:74 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L74) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#methods-2) Methods ------------------------------------------------------------------------------------------ ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#calculateburn) calculateBurn ▸ **calculateBurn**(`rentCollected`): `unknown`\[\] Calculate how much rent to burn from the collected rent. The first value returned is the amount burned. The second is the amount to distribute to validators. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#parameters-2) Parameters | Name | Type | | --- | --- | | `rentCollected` | `bigint` | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#returns-4) Returns `unknown`\[\] The amount burned and the amount to distribute to validators. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#defined-in-5) Defined in [internal.d.ts:88 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L88) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#due) due ▸ **due**(`balance`, `dataLen`, `yearsElapsed`): `bigint` Rent due on account's data length with balance. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#parameters-3) Parameters | Name | Type | Description | | --- | --- | --- | | `balance` | `bigint` | The account balance. | | `dataLen` | `bigint` | The account data length. | | `yearsElapsed` | `number` | Time elapsed in years. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#returns-5) Returns `bigint` The rent due. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#defined-in-6) Defined in [internal.d.ts:111 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L111) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#dueamount) dueAmount ▸ **dueAmount**(`dataLen`, `yearsElapsed`): `bigint` Rent due for account that is known to be not exempt. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#parameters-4) Parameters | Name | Type | Description | | --- | --- | --- | | `dataLen` | `bigint` | The account data length. | | `yearsElapsed` | `number` | Time elapsed in years. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#returns-6) Returns `bigint` The amount due. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#defined-in-7) Defined in [internal.d.ts:119 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L119) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#isexempt) isExempt ▸ **isExempt**(`balance`, `dataLen`): `boolean` Whether a given balance and data length would be exempt. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#parameters-5) Parameters | Name | Type | | --- | --- | | `balance` | `bigint` | | `dataLen` | `bigint` | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#returns-7) Returns `boolean` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#defined-in-8) Defined in [internal.d.ts:102 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L102) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#minimumbalance) minimumBalance ▸ **minimumBalance**(`dataLen`): `bigint` Minimum balance due for rent-exemption of a given account data size. Note: a stripped-down version of this calculation is used in `calculate_split_rent_exempt_reserve` in the stake program. When this function is updated, eg. when making rent variable, the stake program will need to be refactored. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#parameters-6) Parameters | Name | Type | Description | | --- | --- | --- | | `dataLen` | `bigint` | The account data size. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#returns-8) Returns `bigint` The minimum balance due. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#defined-in-9) Defined in [internal.d.ts:100 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L100) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#default) default ▸ `Static` **default**(): [`Rent`](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#returns-9) Returns [`Rent`](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#defined-in-10) Defined in [internal.d.ts:72 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L72) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#free) free ▸ `Static` **free**(): [`Rent`](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html) Creates a `Rent` that charges no lamports. This is used for testing. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#returns-10) Returns [`Rent`](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#defined-in-11) Defined in [internal.d.ts:126 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L126) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#withslotsperepoch) withSlotsPerEpoch ▸ `Static` **withSlotsPerEpoch**(`slotsPerEpoch`): [`Rent`](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html) Creates a `Rent` that is scaled based on the number of slots in an epoch. This is used for testing. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#parameters-7) Parameters | Name | Type | | --- | --- | | `slotsPerEpoch` | `bigint` | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#returns-11) Returns [`Rent`](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html#defined-in-12) Defined in [internal.d.ts:132 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/internal.d.ts#L132) --- # Class: GenesisConfig | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#class-genesisconfig) Class: GenesisConfig ========================================================================================================================== [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#table-of-contents) Table of contents --------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#constructors) Constructors * [constructor](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#constructor) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#properties) Properties * [inner](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#inner) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#accessors) Accessors * [accounts](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#accounts) * [clusterType](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#clustertype) * [creationTime](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#creationtime) * [epochSchedule](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#epochschedule) * [feeRateGovernor](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#feerategovernor) * [inflation](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#inflation) * [nativeInstructionProcessors](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#nativeinstructionprocessors) * [pohConfig](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#pohconfig) * [rent](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#rent) * [rewardsPools](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#rewardspools) * [ticksPerSlot](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#ticksperslot) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#constructors-2) Constructors ------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#constructor) constructor • **new GenesisConfig**(`inner`) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#parameters) Parameters | Name | Type | | --- | --- | | `inner` | `GenesisConfig` | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in) Defined in [index.ts:140 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L140) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#properties-2) Properties --------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#inner) inner • `Private` **inner**: `GenesisConfig` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in-2) Defined in [index.ts:143 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L143) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#accessors-2) Accessors ------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#accounts) accounts • `get` **accounts**(): `Map`<`PublicKey`, [`AccountInfoBytes`](https://kevinheavey.github.io/solana-bankrun/api/#accountinfobytes) \> #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#returns) Returns `Map`<`PublicKey`, [`AccountInfoBytes`](https://kevinheavey.github.io/solana-bankrun/api/#accountinfobytes) \> #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in-3) Defined in [index.ts:147 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L147) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#clustertype) clusterType • `get` **clusterType**(): [`ClusterType`](https://kevinheavey.github.io/solana-bankrun/api/#clustertype) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#returns-2) Returns [`ClusterType`](https://kevinheavey.github.io/solana-bankrun/api/#clustertype) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in-4) Defined in [index.ts:185 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L185) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#creationtime) creationTime • `get` **creationTime**(): `number` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#returns-3) Returns `number` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in-5) Defined in [index.ts:144 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L144) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#epochschedule) epochSchedule • `get` **epochSchedule**(): [`EpochSchedule`](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#returns-4) Returns [`EpochSchedule`](https://kevinheavey.github.io/solana-bankrun/api/classes/EpochSchedule.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in-6) Defined in [index.ts:182 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L182) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#feerategovernor) feeRateGovernor • `get` **feeRateGovernor**(): [`FeeRateGovernor`](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#returns-5) Returns [`FeeRateGovernor`](https://kevinheavey.github.io/solana-bankrun/api/classes/FeeRateGovernor.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in-7) Defined in [index.ts:173 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L173) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#inflation) inflation • `get` **inflation**(): `InflationGovernor` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#returns-6) Returns `InflationGovernor` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in-8) Defined in [index.ts:179 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L179) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#nativeinstructionprocessors) nativeInstructionProcessors • `get` **nativeInstructionProcessors**(): \[`String`, `PublicKey`\]\[\] #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#returns-7) Returns \[`String`, `PublicKey`\]\[\] #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in-9) Defined in [index.ts:154 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L154) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#pohconfig) pohConfig • `get` **pohConfig**(): [`PohConfig`](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#returns-8) Returns [`PohConfig`](https://kevinheavey.github.io/solana-bankrun/api/classes/PohConfig.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in-10) Defined in [index.ts:170 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L170) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#rent) rent • `get` **rent**(): [`Rent`](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#returns-9) Returns [`Rent`](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in-11) Defined in [index.ts:176 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L176) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#rewardspools) rewardsPools • `get` **rewardsPools**(): `Map`<`PublicKey`, [`AccountInfoBytes`](https://kevinheavey.github.io/solana-bankrun/api/#accountinfobytes) \> #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#returns-10) Returns `Map`<`PublicKey`, [`AccountInfoBytes`](https://kevinheavey.github.io/solana-bankrun/api/#accountinfobytes) \> #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in-12) Defined in [index.ts:160 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L160) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#ticksperslot) ticksPerSlot • `get` **ticksPerSlot**(): `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#returns-11) Returns `bigint` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html#defined-in-13) Defined in [index.ts:167 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L167) --- # Class: ProgramTestContext | Bankrun [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#class-programtestcontext) Class: ProgramTestContext ========================================================================================================================================= The result of calling `start()`. Contains a BanksClient, a recent blockhash and a funded payer keypair. [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#table-of-contents) Table of contents -------------------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#constructors) Constructors * [constructor](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#constructor) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#properties) Properties * [inner](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#inner) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#accessors) Accessors * [banksClient](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#banksclient) * [genesisConfig](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#genesisconfig) * [lastBlockhash](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#lastblockhash) * [payer](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#payer) ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#methods) Methods * [setAccount](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#setaccount) * [setClock](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#setclock) * [setRent](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#setrent) * [warpToEpoch](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#warptoepoch) * [warpToSlot](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#warptoslot) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#constructors-2) Constructors ------------------------------------------------------------------------------------------------------------------ ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#constructor) constructor • **new ProgramTestContext**(`inner`) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#parameters) Parameters | Name | Type | | --- | --- | | `inner` | `ProgramTestContext` | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#defined-in) Defined in [index.ts:419 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L419) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#properties-2) Properties -------------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#inner) inner • `Private` **inner**: `ProgramTestContext` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#defined-in-2) Defined in [index.ts:422 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L422) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#accessors-2) Accessors ------------------------------------------------------------------------------------------------------------ ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#banksclient) banksClient • `get` **banksClient**(): [`BanksClient`](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html) The client for this test. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#returns) Returns [`BanksClient`](https://kevinheavey.github.io/solana-bankrun/api/classes/BanksClient.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#defined-in-3) Defined in [index.ts:424 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L424) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#genesisconfig) genesisConfig • `get` **genesisConfig**(): [`GenesisConfig`](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html) The chain's genesis config. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#returns-2) Returns [`GenesisConfig`](https://kevinheavey.github.io/solana-bankrun/api/classes/GenesisConfig.html) #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#defined-in-4) Defined in [index.ts:436 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L436) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#lastblockhash) lastBlockhash • `get` **lastBlockhash**(): `string` The last blockhash registered when the client was initialized. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#returns-3) Returns `string` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#defined-in-5) Defined in [index.ts:432 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L432) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#payer) payer • `get` **payer**(): `Keypair` A funded keypair for sending transactions. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#returns-4) Returns `Keypair` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#defined-in-6) Defined in [index.ts:428 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L428) [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#methods-2) Methods -------------------------------------------------------------------------------------------------------- ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#setaccount) setAccount ▸ **setAccount**(`address`, `account`): `void` Create or overwrite an account, subverting normal runtime checks. This method exists to make it easier to set up artificial situations that would be difficult to replicate by sending individual transactions. Beware that it can be used to create states that would not be reachable by sending transactions! #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#parameters-2) Parameters | Name | Type | Description | | --- | --- | --- | | `address` | `PublicKey` | The address to write to. | | `account` | [`AccountInfoBytes`](https://kevinheavey.github.io/solana-bankrun/api/#accountinfobytes) | The account object to write. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#returns-5) Returns `void` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#defined-in-7) Defined in [index.ts:450 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L450) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#setclock) setClock ▸ **setClock**(`clock`): `void` Overwrite the clock sysvar. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#parameters-3) Parameters | Name | Type | Description | | --- | --- | --- | | `clock` | [`Clock`](https://kevinheavey.github.io/solana-bankrun/api/classes/Clock.html) | The new clock object. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#returns-6) Returns `void` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#defined-in-8) Defined in [index.ts:457 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L457) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#setrent) setRent ▸ **setRent**(`rent`): `void` Overwrite the rent sysvar. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#parameters-4) Parameters | Name | Type | Description | | --- | --- | --- | | `rent` | [`Rent`](https://kevinheavey.github.io/solana-bankrun/api/classes/Rent.html) | The new rent object. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#returns-7) Returns `void` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#defined-in-9) Defined in [index.ts:464 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L464) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#warptoepoch) warpToEpoch ▸ **warpToEpoch**(`epoch`): `void` Force the working bank ahead to a new epoch. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#parameters-5) Parameters | Name | Type | Description | | --- | --- | --- | | `epoch` | `bigint` | The epoch to warp to. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#returns-8) Returns `void` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#defined-in-10) Defined in [index.ts:478 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L478) * * * ### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#warptoslot) warpToSlot ▸ **warpToSlot**(`slot`): `void` Force the working bank ahead to a new slot. #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#parameters-6) Parameters | Name | Type | Description | | --- | --- | --- | | `slot` | `bigint` | The slot to warp to. | #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#returns-9) Returns `void` #### [#](https://kevinheavey.github.io/solana-bankrun/api/classes/ProgramTestContext.html#defined-in-11) Defined in [index.ts:471 (opens new window)](https://github.com/kevinheavey/solana-bankrun/blob/ec917cf/solana-bankrun/index.ts#L471) ---