locklift
Version:
Node JS framework for working with Ever contracts. Inspired by Truffle and Hardhat. Helps you to build, test, run and maintain your smart contracts.
65 lines (64 loc) • 2.17 kB
TypeScript
import { ContractData, DeployContractParams, FactoryType, Giver } from "./index";
import { Address, Contract } from "everscale-inpage-provider";
import { CreateAccountOutput, DeployTransaction, WalletTypes } from "../../types";
import { Account, MsigAccount, SimpleAccountsStorage } from "everscale-standalone-client";
type MSigType = ConstructorParameters<typeof MsigAccount>[0]["type"];
type CreateAccountParams<T extends FactoryType> = {
type: WalletTypes.WalletV3 | WalletTypes.HighLoadWalletV2;
publicKey: string;
value: string;
} | {
type: WalletTypes.EverWallet;
publicKey: string;
value: string;
nonce?: number;
} | ({
type: WalletTypes.MsigAccount;
} & DeployContractParams<T, keyof T> & {
mSigType: MSigType;
}) | {
type: WalletTypes.WalletV5R1;
publicKey: string;
value: string;
nonce?: number;
};
type AddExistingAccountParams = {
type: WalletTypes.HighLoadWalletV2 | WalletTypes.WalletV3;
publicKey: string;
} | ({
type: WalletTypes.EverWallet;
} & ({
address: Address;
} | {
publicKey: string;
nonce?: number;
})) | {
type: WalletTypes.MsigAccount;
publicKey?: string;
address: Address;
mSigType: MSigType;
} | ({
type: WalletTypes.WalletV5R1;
} & ({
address: Address;
} | {
publicKey: string;
nonce?: number;
}));
export declare class AccountFactory2<T extends FactoryType> {
private readonly sourceFactory;
private readonly sender;
private readonly accountsStorage;
constructor(sourceFactory: {
getContractArtifacts: <key extends keyof T>(name: key) => ContractData<T[key]>;
deployContract: <ContractName extends keyof T>(args: DeployContractParams<T, ContractName>) => Promise<{
contract: Contract<T[ContractName]>;
} & DeployTransaction>;
}, sender: Giver["sendTo"], accountsStorage: SimpleAccountsStorage);
addNewAccount: (params: CreateAccountParams<T>) => Promise<CreateAccountOutput>;
private createAccount;
addExistingAccount: (params: AddExistingAccountParams) => Promise<Account>;
private getExistingAccount;
get storage(): SimpleAccountsStorage;
}
export {};