24 lines
1.1 KiB
TypeScript
Raw Permalink Normal View History

2025-06-21 23:30:33 +03:00
/**
* The default timeout for waiting for a transaction to be included in a block.
*/
export declare const DEFAULT_TIMEOUT = 10;
/**
* Keep calling a `fn` for `timeoutInSeconds` seconds, if `keepWaitingIf` is true.
* Returns an array of all attempts to call the function.
*/
export declare function withExponentialBackoff<T>(fn: (previousFailure?: T) => Promise<T>, keepWaitingIf: (result: T) => boolean, timeoutInSeconds: number, exponentialFactor?: number, verbose?: boolean): Promise<T[]>;
/**
* If contracts are implemented using the `#[contracterror]` macro, then the
* errors get included in the on-chain XDR that also describes your contract's
* methods. Each error will have a specific number. This Regular Expression
* matches these "expected error types" that a contract may throw, and helps
* @{link AssembledTransaction} parse these errors.
*/
export declare const contractErrorPattern: RegExp;
/**
* A TypeScript type guard that checks if an object has a `toString` method.
*/
export declare function implementsToString(obj: unknown): obj is {
toString(): string;
};