@dappykit/sdk
Version:
Web3 SDK for DApps
131 lines (130 loc) • 6.98 kB
TypeScript
import { INetworkConfig } from '../network-config';
import { RpcHelper } from '../rpc-helper';
import { Multihash } from '../utils/multihash';
import { Hash } from 'viem';
import { HDAccount } from 'viem/accounts';
import { Abi } from 'abitype';
export declare class FilesystemChanges {
readonly config: INetworkConfig;
rpcHelper: RpcHelper;
signer?: HDAccount | undefined;
constructor(config: INetworkConfig, rpcHelper: RpcHelper, signer?: HDAccount | undefined);
getTheContract(): {
read: {
[x: string]: (...parameters: [options?: import("viem").Prettify<import("viem").UnionOmit<import("viem").ReadContractParameters<Abi, string, readonly unknown[]>, "address" | "abi" | "functionName" | "args">> | undefined] | [args: readonly unknown[], options?: import("viem").Prettify<import("viem").UnionOmit<import("viem").ReadContractParameters<Abi, string, readonly unknown[]>, "address" | "abi" | "functionName" | "args">> | undefined]) => Promise<import("viem").ReadContractReturnType>;
};
estimateGas: {
[x: string]: (...parameters: [options: import("viem").Prettify<import("viem").UnionOmit<import("viem").EstimateContractGasParameters<Abi, string, readonly unknown[], import("viem").Chain>, "address" | "abi" | "functionName" | "args">>] | [args: readonly unknown[], options: import("viem").Prettify<import("viem").UnionOmit<import("viem").EstimateContractGasParameters<Abi, string, readonly unknown[], import("viem").Chain>, "address" | "abi" | "functionName" | "args">>]) => Promise<import("viem").EstimateContractGasReturnType>;
};
simulate: {
[x: string]: <chainOverride extends import("viem").Chain | undefined = undefined, accountOverride extends import("viem").Account | import("viem").Address | undefined = undefined>(...parameters: [options?: Omit<import("viem").SimulateContractParameters<Abi, string, readonly unknown[], import("viem").Chain, chainOverride, accountOverride>, "address" | "abi" | "functionName" | "args"> | undefined] | [args: readonly unknown[], options?: Omit<import("viem").SimulateContractParameters<Abi, string, readonly unknown[], import("viem").Chain, chainOverride, accountOverride>, "address" | "abi" | "functionName" | "args"> | undefined]) => Promise<import("viem").SimulateContractReturnType>;
};
createEventFilter: {
[x: string]: <strict extends boolean | undefined = undefined>(...parameters: [options?: ({
fromBlock?: bigint | import("viem").BlockTag | undefined;
toBlock?: bigint | import("viem").BlockTag | undefined;
} & {
strict?: strict | undefined;
}) | undefined] | [args: readonly unknown[] | {
[x: string]: unknown;
address?: undefined;
abi?: undefined;
eventName?: undefined;
fromBlock?: undefined;
strict?: undefined;
toBlock?: undefined;
args?: undefined;
}, options?: ({
fromBlock?: bigint | import("viem").BlockTag | undefined;
toBlock?: bigint | import("viem").BlockTag | undefined;
} & {
strict?: strict | undefined;
}) | undefined]) => Promise<import("viem").CreateContractEventFilterReturnType>;
};
getEvents: {
[x: string]: (...parameters: [options?: {
blockHash?: `0x${string}` | undefined;
strict?: boolean | undefined;
fromBlock?: bigint | import("viem").BlockTag | undefined;
toBlock?: bigint | import("viem").BlockTag | undefined;
} | undefined] | [args?: readonly unknown[] | {
[x: string]: unknown;
address?: undefined;
abi?: undefined;
args?: undefined;
eventName?: undefined;
fromBlock?: undefined;
onError?: undefined;
onLogs?: undefined;
strict?: undefined;
poll?: undefined;
batch?: undefined;
pollingInterval?: undefined;
} | undefined, options?: {
blockHash?: `0x${string}` | undefined;
strict?: boolean | undefined;
fromBlock?: bigint | import("viem").BlockTag | undefined;
toBlock?: bigint | import("viem").BlockTag | undefined;
} | undefined]) => Promise<import("viem").GetContractEventsReturnType<Abi, string>>;
};
watchEvent: {
[x: string]: (...parameters: [options?: {
batch?: boolean | undefined | undefined;
pollingInterval?: number | undefined | undefined;
strict?: boolean | undefined;
fromBlock?: bigint | undefined;
onError?: ((error: Error) => void) | undefined | undefined;
onLogs: import("viem").WatchContractEventOnLogsFn<Abi, string, undefined>;
poll?: true | undefined | undefined;
} | undefined] | [args: readonly unknown[] | {
[x: string]: unknown;
address?: undefined;
abi?: undefined;
args?: undefined;
eventName?: undefined;
fromBlock?: undefined;
onError?: undefined;
onLogs?: undefined;
strict?: undefined;
poll?: undefined;
batch?: undefined;
pollingInterval?: undefined;
}, options?: {
batch?: boolean | undefined | undefined;
pollingInterval?: number | undefined | undefined;
strict?: boolean | undefined;
fromBlock?: bigint | undefined;
onError?: ((error: Error) => void) | undefined | undefined;
onLogs: import("viem").WatchContractEventOnLogsFn<Abi, string, undefined>;
poll?: true | undefined | undefined;
} | undefined]) => import("viem").WatchContractEventReturnType;
};
address: `0x${string}`;
abi: Abi;
};
/**
* Sets user changes multihash
* @param multihash Multihash
*/
setUserChange(multihash: Multihash): Promise<Hash>;
/**
* Sets service changes multihash
* @param multihash Multihash
*/
setServiceChange(multihash: Multihash): Promise<Hash>;
/**
* Removes user changes multihash
* @param isService Is service or user
*/
removeChange(isService: boolean): Promise<Hash>;
/**
* Gets user change multihash
* @param address Address of the user
*/
getUserChangeMultihash(address: string): Promise<Multihash>;
/**
* Gets service change multihash
* @param address Address of the service
*/
getServiceChangeMultihash(address: string): Promise<Multihash>;
}