diff --git a/src/contract/ContractProvider.ts b/src/contract/ContractProvider.ts index f359bbb..596c030 100644 --- a/src/contract/ContractProvider.ts +++ b/src/contract/ContractProvider.ts @@ -13,6 +13,7 @@ import { TupleItem } from "../tuple/tuple"; import { Maybe } from "../utils/maybe"; import { ContractState } from "./ContractState"; import { Sender } from './Sender'; +import { Contract } from './Contract'; export type ContractGetMethodResult = { stack: TupleReader; @@ -25,4 +26,12 @@ export interface ContractProvider { get(name: string, args: TupleItem[]): Promise; external(message: Cell): Promise; internal(via: Sender, args: { value: bigint | string, bounce?: Maybe, sendMode?: SendMode, body?: Maybe }): Promise; +} + +export interface ReopenableContractProvider extends ContractProvider { + reopenFor(contract: Contract): ContractProvider; +} + +export function isReopenableContractProvider(provider: ContractProvider): provider is ReopenableContractProvider { + return !!(provider as ReopenableContractProvider)['reopenFor']; } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index a418d53..9946937 100644 --- a/src/index.ts +++ b/src/index.ts @@ -49,7 +49,9 @@ export * from './types/_export'; export { Contract } from './contract/Contract'; export { ContractProvider, - ContractGetMethodResult + ContractGetMethodResult, + ReopenableContractProvider, + isReopenableContractProvider } from './contract/ContractProvider'; export { ContractState } from './contract/ContractState'; export { Sender, SenderArguments } from './contract/Sender';