/** Fadroma. Copyright (C) 2023 Hack.bg. License: GNU AGPLv3 or custom.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see . **/
import { Console } from "./core.dist";
import type { ChainId, Address, Message } from "./chain.dist";
import { Connection, Backend, Batch, Identity } from "./chain.dist";
import type { CodeHash } from "./program.browser.dist";
import { Compiler, SourceCode, CompiledCode } from "./program.browser.dist";
import type { CodeId } from "./deploy.dist";
import { UploadedCode, ContractInstance } from "./deploy.dist";
import * as Token from "./token.dist";
export declare class StubConnection extends Connection {
static gasToken: Token.Native;
backend: StubBackend;
constructor(properties?: Partial);
batch(): Batch;
doGetHeight(): Promise;
doGetBlockInfo(): Promise<{
height: number;
}>;
doGetCodes(): Promise<{
[k: string]: UploadedCode;
}>;
doGetBalance(token?: string, address?: string): Promise;
doGetCodeId(address: Address): Promise;
doGetContractsByCodeId(id: CodeId): Promise<{
address: string;
}[]>;
doGetCodeHashOfAddress(address: Address): Promise;
doGetCodeHashOfCodeId(id: CodeId): Promise;
doQuery(contract: {
address: Address;
}, message: Message): Promise;
doSend(recipient: Address, sums: Token.ICoin[], opts?: never): Promise;
doSendMany(outputs: [Address, Token.ICoin[]][], opts?: never): Promise;
doUpload(codeData: Uint8Array): Promise;
doInstantiate(codeId: CodeId, options: Parameters[1]): Promise;
doExecute(contract: {
address: Address;
codeHash: CodeHash;
}, message: Message, options?: Parameters[2]): Promise;
}
type StubAccount = {
address: Address;
mnemonic?: string;
};
type StubBalances = Record;
type StubUpload = {
chainId: ChainId;
codeId: CodeId;
codeHash: CodeHash;
codeData: Uint8Array;
instances: Set;
};
type StubInstance = {
codeId: CodeId;
address: Address;
creator: Address;
};
export declare class StubBackend extends Backend {
gasToken: Token.Native;
prefix: string;
chainId: string;
url: string;
alive: boolean;
lastCodeId: number;
accounts: Map;
balances: Map;
uploads: Map;
instances: Map;
constructor(properties?: Partial;
}>);
connect(parameter?: string | Partial): Promise;
getIdentity(name: string): Promise;
start(): Promise;
pause(): Promise;
import(...args: unknown[]): Promise;
export(...args: unknown[]): Promise;
upload(codeData: Uint8Array): Promise<{
codeId: string;
chainId: string;
codeHash: string;
codeData: Uint8Array;
instances: Set;
}>;
instantiate(creator: Address, codeId: CodeId, options: unknown): Promise & {
address: Address;
}>;
execute(...args: unknown[]): Promise;
}
export declare class StubBatch extends Batch {
messages: object[];
upload(...args: Parameters): this;
instantiate(...args: Parameters): this;
execute(...args: Parameters): this;
submit(): Promise