From 0206568447a5594bc26488696b7632302c571cd7 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 21 Jun 2024 06:35:29 +0100 Subject: [PATCH] fix: added docs for `isReadOnly` function (#2564) * chore: added doc block for `isReadOnly` functions * chore: changeset --------- Co-authored-by: Anderson Arboleya --- .changeset/strong-ducks-tie.md | 5 +++++ packages/program/src/types.ts | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/strong-ducks-tie.md diff --git a/.changeset/strong-ducks-tie.md b/.changeset/strong-ducks-tie.md new file mode 100644 index 00000000000..a54d7a55385 --- /dev/null +++ b/.changeset/strong-ducks-tie.md @@ -0,0 +1,5 @@ +--- +"@fuel-ts/program": patch +--- + +fix: added docs for `isReadOnly` function diff --git a/packages/program/src/types.ts b/packages/program/src/types.ts index 501395c4e21..0a34e7949e0 100644 --- a/packages/program/src/types.ts +++ b/packages/program/src/types.ts @@ -62,6 +62,11 @@ export type CallConfig = { // eslint-disable-next-line @typescript-eslint/no-explicit-any export interface InvokeFunction = Array, TReturn = any> { (...args: TArgs): FunctionInvocationScope; + /** + * Checks if the function is read-only i.e. it only reads from storage, does not write to it. + * + * @returns True if the function is read-only or pure, false otherwise. + */ isReadOnly: () => boolean; }