@j0nnyboi/amman
Version:
A modern mandatory toolbelt to help test solana SDK libraries and apps on a locally running validator.
32 lines (31 loc) • 1.82 kB
TypeScript
/// <reference types="node" />
import { PersistedAccountInfo } from '@j0nnyboi/amman-client';
import { AccountInfo, Connection, Keypair, PublicKey } from '@safecoin/web3.js';
import { SnapshotConfig } from './types';
export declare class AccountPersister {
readonly targetDir: string;
readonly connection?: Connection | undefined;
constructor(targetDir: string, connection?: Connection | undefined);
saveAccountInfo(address: PublicKey, accountInfo: AccountInfo<Buffer>, subdir?: string, label?: string): Promise<string>;
savePersistedAccountInfo(persistedAccount: PersistedAccountInfo, subdir?: string, label?: string): Promise<string>;
saveAccount(address: PublicKey, connection?: Connection, data?: Buffer): Promise<string>;
saveKeypair(id: string, keypair: Keypair, subdir?: string): Promise<string>;
snapshot(snapshotLabel: string, addresses: string[], accountLabels: Record<string, string>, keypairs: Map<string, {
keypair: Keypair;
id: string;
}>, accountOverrides?: Map<string, PersistedAccountInfo>): Promise<string>;
private _requireConnection;
}
export declare function loadAccount(address: PublicKey, sourceDir?: string, label?: string): Promise<PersistedAccountInfo>;
export declare function accountInfoFromPersisted(persisted: PersistedAccountInfo): {
address: string;
accountInfo: AccountInfo<Buffer>;
};
export declare function mapPersistedAccountInfos(persisteds: PersistedAccountInfo[]): Map<string, AccountInfo<Buffer>>;
export declare function createTemporarySnapshot(addresses: string[], accountLabels: Record<string, string>, keypairs: Map<string, {
keypair: Keypair;
id: string;
}>, accountOverrides?: Map<string, PersistedAccountInfo>): Promise<{
config: SnapshotConfig;
cleanupSnapshotDir: () => Promise<void>;
}>;