From 48dcca1f92a19e90d624e36a8eb39b1098d0d56f Mon Sep 17 00:00:00 2001 From: mfbz Date: Fri, 5 Sep 2025 14:52:36 +0200 Subject: [PATCH 1/2] Regenerated docs with types extraction fixes --- .../clients/fcl-js/packages-docs/fcl/arg.md | 34 ++--- .../clients/fcl-js/packages-docs/fcl/args.md | 37 +++--- .../fcl-js/packages-docs/fcl/atBlockHeight.md | 44 ++++--- .../fcl-js/packages-docs/fcl/atBlockId.md | 51 ++++---- .../fcl-js/packages-docs/fcl/authorization.md | 52 ++++---- .../packages-docs/fcl/authorizations.md | 35 ++--- .../clients/fcl-js/packages-docs/fcl/build.md | 30 +++-- .../fcl-js/packages-docs/fcl/createFcl.md | 95 -------------- .../packages-docs/fcl/createFlowClient.md | 66 ++++++++++ .../fcl-js/packages-docs/fcl/events.md | 2 +- .../fcl-js/packages-docs/fcl/getAccount.md | 27 ++-- .../fcl-js/packages-docs/fcl/getBlock.md | 33 ++--- .../packages-docs/fcl/getBlockHeader.md | 50 ++++---- .../fcl-js/packages-docs/fcl/getChainId.md | 68 ---------- .../fcl-js/packages-docs/fcl/getCollection.md | 51 ++++---- .../fcl-js/packages-docs/fcl/getEvents.md | 51 ++++---- .../fcl/getEventsAtBlockHeightRange.md | 37 +++--- .../packages-docs/fcl/getEventsAtBlockIds.md | 44 ++++--- .../packages-docs/fcl/getNetworkParameters.md | 40 +++--- .../packages-docs/fcl/getNodeVersionInfo.md | 36 +++--- .../packages-docs/fcl/getTransaction.md | 2 +- .../packages-docs/fcl/getTransactionStatus.md | 39 +++--- .../clients/fcl-js/packages-docs/fcl/index.md | 5 +- .../clients/fcl-js/packages-docs/fcl/limit.md | 31 +++-- .../fcl-js/packages-docs/fcl/mutate.md | 46 ++++--- .../clients/fcl-js/packages-docs/fcl/payer.md | 37 +++--- .../clients/fcl-js/packages-docs/fcl/ping.md | 38 +++--- .../fcl-js/packages-docs/fcl/proposer.md | 31 ++--- .../clients/fcl-js/packages-docs/fcl/query.md | 2 +- .../fcl-js/packages-docs/fcl/queryRaw.md | 2 +- .../clients/fcl-js/packages-docs/fcl/ref.md | 31 +++-- .../fcl-js/packages-docs/fcl/script.md | 29 +++-- .../packages-docs/fcl/subscribeEvents.md | 41 +++--- .../fcl-js/packages-docs/fcl/transaction.md | 120 ++++++++++-------- .../clients/fcl-js/packages-docs/fcl/tx.md | 2 +- .../fcl-js/packages-docs/fcl/validator.md | 31 +++-- .../packages-docs/fcl/voucherIntercept.md | 37 +++--- .../clients/fcl-js/packages-docs/sdk/arg.md | 34 ++--- .../clients/fcl-js/packages-docs/sdk/args.md | 37 +++--- .../fcl-js/packages-docs/sdk/atBlockHeight.md | 44 ++++--- .../fcl-js/packages-docs/sdk/atBlockId.md | 51 ++++---- .../fcl-js/packages-docs/sdk/atLatestBlock.md | 42 +++--- .../fcl-js/packages-docs/sdk/authorization.md | 52 ++++---- .../packages-docs/sdk/authorizations.md | 35 ++--- .../clients/fcl-js/packages-docs/sdk/build.md | 30 +++-- .../fcl-js/packages-docs/sdk/getAccount.md | 27 ++-- .../fcl-js/packages-docs/sdk/getBlock.md | 33 ++--- .../packages-docs/sdk/getBlockHeader.md | 50 ++++---- .../fcl-js/packages-docs/sdk/getCollection.md | 51 ++++---- .../fcl-js/packages-docs/sdk/getEvents.md | 51 ++++---- .../sdk/getEventsAtBlockHeightRange.md | 37 +++--- .../packages-docs/sdk/getEventsAtBlockIds.md | 44 ++++--- .../packages-docs/sdk/getNetworkParameters.md | 40 +++--- .../packages-docs/sdk/getNodeVersionInfo.md | 36 +++--- .../packages-docs/sdk/getTransaction.md | 2 +- .../packages-docs/sdk/getTransactionStatus.md | 39 +++--- .../clients/fcl-js/packages-docs/sdk/index.md | 18 +-- .../clients/fcl-js/packages-docs/sdk/limit.md | 31 +++-- .../clients/fcl-js/packages-docs/sdk/payer.md | 37 +++--- .../clients/fcl-js/packages-docs/sdk/ping.md | 38 +++--- .../fcl-js/packages-docs/sdk/proposer.md | 31 ++--- .../clients/fcl-js/packages-docs/sdk/ref.md | 31 +++-- .../fcl-js/packages-docs/sdk/script.md | 29 +++-- .../fcl-js/packages-docs/sdk/subscribe.md | 11 +- .../packages-docs/sdk/subscribeEvents.md | 41 +++--- .../fcl-js/packages-docs/sdk/subscribeRaw.md | 11 +- .../fcl-js/packages-docs/sdk/transaction.md | 39 +++--- .../fcl-js/packages-docs/sdk/validator.md | 31 +++-- .../packages-docs/sdk/voucherIntercept.md | 37 +++--- 69 files changed, 1283 insertions(+), 1244 deletions(-) delete mode 100644 docs/build/tools/clients/fcl-js/packages-docs/fcl/createFcl.md create mode 100644 docs/build/tools/clients/fcl-js/packages-docs/fcl/createFlowClient.md delete mode 100644 docs/build/tools/clients/fcl-js/packages-docs/fcl/getChainId.md diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/arg.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/arg.md index 4ee333d620..bb863d8bc8 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/arg.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/arg.md @@ -1,9 +1,9 @@ --- -title: 'arg' -description: 'arg function documentation.' +title: "arg" +description: "arg function documentation." --- - + # arg @@ -17,23 +17,23 @@ This function creates an ArgumentObject that holds the value and type passed in. You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.arg(value, xform); +fcl.arg(value, xform) ``` Or import directly the specific function: ```typescript -import { arg } from '@onflow/fcl'; +import { arg } from "@onflow/fcl" -arg(value, xform); +arg(value, xform) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" const result = await fcl.query({ cadence: ` @@ -45,34 +45,36 @@ const result = await fcl.query({ args: (arg, t) => [ arg(7, t.Int), // a: Int arg(6, t.Int), // b: Int - arg('0xba1132bc08f82fe2', t.Address), // addr: Address + arg("0xba1132bc08f82fe2", t.Address), // addr: Address ], }); ``` ## Parameters -### `value` +### `value` -- Type: +- Type: ```typescript -TypeDescriptorInput; +TypeDescriptorInput ``` - - Description: Any value that you are looking to pass to other builders -### `xform` +### `xform` + - Type: `T` - Description: A type supported by Flow (FType descriptor) + ## Returns ```typescript -CadenceArgument; +CadenceArgument ``` + An ArgumentObject that holds the value and type passed in ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/args.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/args.md index 62d188c623..25a8cc1fac 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/args.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/args.md @@ -1,9 +1,9 @@ --- -title: 'args' -description: 'args function documentation.' +title: "args" +description: "args function documentation." --- - + # args @@ -17,23 +17,23 @@ This function returns a Partial Interaction that contains the arguments and type You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.args(ax); +fcl.args(ax) ``` Or import directly the specific function: ```typescript -import { args } from '@onflow/fcl'; +import { args } from "@onflow/fcl" -args(ax); +args(ax) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" await fcl.mutate({ cadence: ` @@ -44,32 +44,33 @@ await fcl.mutate({ } `, args: (arg, t) => [ - arg('10.0', t.UFix64), // Will be the first argument `amount: UFix64` - arg('0xba1132bc08f82fe2', t.Address), // Will be the second argument `to: Address` + arg("10.0", t.UFix64), // Will be the first argument `amount: UFix64` + arg("0xba1132bc08f82fe2", t.Address), // Will be the second argument `to: Address` ], -}); +}) ``` ## Parameters -### `ax` +### `ax` -- Type: +- Type: ```typescript -CadenceArgument < any > []; +CadenceArgument[] ``` - - Description: An array of argument objects created with fcl.arg() + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A Partial Interaction object containing the arguments and types passed in ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/atBlockHeight.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/atBlockHeight.md index ce73a8bba8..c2d9cf5cd1 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/atBlockHeight.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/atBlockHeight.md @@ -1,9 +1,9 @@ --- -title: 'atBlockHeight' -description: 'atBlockHeight function documentation.' +title: "atBlockHeight" +description: "atBlockHeight function documentation." --- - + # atBlockHeight @@ -18,60 +18,62 @@ Block height expresses the height of the block on the chain. The latest block he You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.atBlockHeight(height); +fcl.atBlockHeight(height) ``` Or import directly the specific function: ```typescript -import { atBlockHeight } from '@onflow/fcl'; +import { atBlockHeight } from "@onflow/fcl" -atBlockHeight(height); +atBlockHeight(height) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get block at specific height await fcl.send([fcl.getBlock(), fcl.atBlockHeight(123)]).then(fcl.decode); // Get account at specific block height -await fcl - .send([fcl.getAccount('0x1d007d755706c469'), fcl.atBlockHeight(12345)]) - .then(fcl.decode); +await fcl.send([ + fcl.getAccount("0x1d007d755706c469"), + fcl.atBlockHeight(12345) +]).then(fcl.decode); // Execute script at specific block height -await fcl - .send([ - fcl.script` +await fcl.send([ + fcl.script` access(all) fun main(): UFix64 { return getCurrentBlock().height } `, - fcl.atBlockHeight(100), - ]) - .then(fcl.decode); + fcl.atBlockHeight(100) +]).then(fcl.decode); ``` ## Parameters -### `height` +### `height` + - Type: `number` - Description: The height of the block to execute the interaction at + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A partial interaction to be paired with another interaction such as 'fcl.getBlock()' or 'fcl.getAccount()' ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/atBlockId.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/atBlockId.md index 88e8e44e37..0337cf5c07 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/atBlockId.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/atBlockId.md @@ -1,9 +1,9 @@ --- -title: 'atBlockId' -description: 'atBlockId function documentation.' +title: "atBlockId" +description: "atBlockId function documentation." --- - + # atBlockId @@ -18,65 +18,62 @@ Block ID is SHA3-256 hash of the entire block payload. This hash is stored as an You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.atBlockId(id); +fcl.atBlockId(id) ``` Or import directly the specific function: ```typescript -import { atBlockId } from '@onflow/fcl'; +import { atBlockId } from "@onflow/fcl" -atBlockId(id); +atBlockId(id) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get block by ID -await fcl.send([fcl.getBlock(), fcl.atBlockId('23232323232')]).then(fcl.decode); +await fcl.send([fcl.getBlock(), fcl.atBlockId("23232323232")]).then(fcl.decode); // Get account at specific block ID -await fcl - .send([ - fcl.getAccount('0x1d007d755706c469'), - fcl.atBlockId( - '9dda5f281897389b99f103a1c6b180eec9dac870de846449a302103ce38453f3', - ), - ]) - .then(fcl.decode); +await fcl.send([ + fcl.getAccount("0x1d007d755706c469"), + fcl.atBlockId("9dda5f281897389b99f103a1c6b180eec9dac870de846449a302103ce38453f3") +]).then(fcl.decode); // Execute script at specific block -await fcl - .send([ - fcl.script` +await fcl.send([ + fcl.script` access(all) fun main(): UFix64 { return getCurrentBlock().timestamp } `, - fcl.atBlockId('a1b2c3d4e5f6'), - ]) - .then(fcl.decode); + fcl.atBlockId("a1b2c3d4e5f6") +]).then(fcl.decode); ``` ## Parameters -### `id` +### `id` + - Type: `string` - Description: The ID of the block to execute the interaction at + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A partial interaction to be paired with another interaction such as 'fcl.getBlock()' or 'fcl.getAccount()' ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/authorization.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/authorization.md index 84f7a5782b..d76cf68298 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/authorization.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/authorization.md @@ -1,9 +1,9 @@ --- -title: 'authorization' -description: 'authorization function documentation.' +title: "authorization" +description: "authorization function documentation." --- - + # authorization @@ -18,41 +18,41 @@ Read more about [authorization functions](https://docs.onflow.org/fcl/reference/ You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.authorization(addr, signingFunction, keyId, sequenceNum); +fcl.authorization(addr, signingFunction, keyId, sequenceNum) ``` Or import directly the specific function: ```typescript -import { authorization } from '@onflow/fcl'; +import { authorization } from "@onflow/fcl" -authorization(addr, signingFunction, keyId, sequenceNum); +authorization(addr, signingFunction, keyId, sequenceNum) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; -import { ec as EC } from 'elliptic'; +import * as fcl from "@onflow/fcl"; +import { ec as EC } from "elliptic"; // Create a signing function const signingFunction = ({ message }) => { // Your signing logic here return { - addr: '0x123456789abcdef0', + addr: "0x123456789abcdef0", keyId: 0, - signature: 'your_signature_here', + signature: "your_signature_here" }; }; // Create authorization const authz = fcl.authorization( - '0x123456789abcdef0', // account address - signingFunction, // signing function - 0, // key ID - 42, // sequence number + "0x123456789abcdef0", // account address + signingFunction, // signing function + 0, // key ID + 42 // sequence number ); // Use in transaction @@ -60,45 +60,49 @@ await fcl.mutate({ cadence: `transaction { prepare(acct: AuthAccount) {} }`, proposer: authz, payer: authz, - authorizations: [authz], + authorizations: [authz] }); ``` ## Parameters -### `addr` +### `addr` + - Type: `string` - Description: The address of the account that will sign the transaction -### `signingFunction` +### `signingFunction` -- Type: +- Type: ```typescript type SigningFn = ( - signable?: SignableMessage, -) => SigningResult | Promise; + signable?: SignableMessage +) => SigningResult | Promise ``` - - Description: A function that produces signatures for the account ### `keyId` (optional) + - Type: `string | number` - Description: The index of the key to use for signing (optional) ### `sequenceNum` (optional) + - Type: `number` - Description: The sequence number for the account key (optional) + ## Returns ```typescript -Partial; +Partial ``` + A partial interaction account object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/authorizations.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/authorizations.md index 722e174e87..bb6a5b0ddc 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/authorizations.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/authorizations.md @@ -1,9 +1,9 @@ --- -title: 'authorizations' -description: 'authorizations function documentation.' +title: "authorizations" +description: "authorizations function documentation." --- - + # authorizations @@ -19,23 +19,23 @@ Read more about [transaction roles](https://docs.onflow.org/concepts/transaction You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.authorizations(ax); +fcl.authorizations(ax) ``` Or import directly the specific function: ```typescript -import { authorizations } from '@onflow/fcl'; +import { authorizations } from "@onflow/fcl" -authorizations(ax); +authorizations(ax) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Single authorizer (most common case) await fcl.mutate({ @@ -46,7 +46,7 @@ await fcl.mutate({ } } `, - authorizations: [fcl.authz], // Current user authorization + authorizations: [fcl.authz] // Current user authorization }); // Multiple authorizers - both accounts must approve @@ -58,7 +58,7 @@ await fcl.mutate({ } } `, - authorizations: [userOneAuthz, userTwoAuthz], + authorizations: [userOneAuthz, userTwoAuthz] }); // Using builder pattern @@ -73,7 +73,7 @@ await fcl.send([ fcl.authorizations([fcl.authz]), fcl.proposer(fcl.authz), fcl.payer(fcl.authz), - fcl.limit(100), + fcl.limit(100) ]); ``` @@ -81,24 +81,25 @@ await fcl.send([ ### `ax` (optional) -- Type: +- Type: ```typescript export type AccountAuthorization = | (AuthorizationFn & Partial) - | Partial; + | Partial ``` - - Description: An array of authorization functions that produce account authorization details + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/build.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/build.md index f94c2a8bf1..e752da4e9d 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/build.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/build.md @@ -1,9 +1,9 @@ --- -title: 'build' -description: 'build function documentation.' +title: "build" +description: "build function documentation." --- - + # build @@ -18,23 +18,23 @@ Each builder function modifies specific parts of the interaction object, such as You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.build(fns); +fcl.build(fns) ``` Or import directly the specific function: ```typescript -import { build } from '@onflow/fcl'; +import { build } from "@onflow/fcl" -build(fns); +build(fns) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Build a script interaction const scriptInteraction = await fcl.build([ @@ -43,7 +43,10 @@ const scriptInteraction = await fcl.build([ return a + b } `, - fcl.args([fcl.arg(1, fcl.t.Int), fcl.arg(2, fcl.t.Int)]), + fcl.args([ + fcl.arg(1, fcl.t.Int), + fcl.arg(2, fcl.t.Int) + ]) ]); // Build a transaction interaction @@ -55,11 +58,11 @@ const txInteraction = await fcl.build([ } } `, - fcl.args([fcl.arg('World', fcl.t.String)]), + fcl.args([fcl.arg("World", fcl.t.String)]), fcl.proposer(proposerAuthz), fcl.payer(payerAuthz), fcl.authorizations([authorizerAuthz]), - fcl.limit(100), + fcl.limit(100) ]); ``` @@ -67,13 +70,16 @@ const txInteraction = await fcl.build([ ### `fns` (optional) + - Type: `(false | InteractionBuilderFn)[]` - Description: The functions to apply to the interaction + ## Returns [`Promise`](../types#interaction) + A promise of an interaction ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/createFcl.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/createFcl.md deleted file mode 100644 index 202f416cdd..0000000000 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/createFcl.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: "createFcl" -description: "createFcl function documentation." ---- - - - -# createFcl - -Creates a configured FCL (Flow Client Library) instance for web applications. -This function initializes FCL with web-specific defaults and discovery configuration, -providing a complete interface for interacting with the Flow blockchain. - -The created FCL instance includes all core functionality for: -- User authentication and wallet connections -- Transaction submission and monitoring -- Blockchain queries and event subscriptions -- Configuration management -- Discovery service integration - -This function automatically configures the platform as "web" and uses localStorage -for session persistence by default, while allowing customization of other parameters. - -## Import - -You can import the entire package and access the function: - -```typescript -import * as fcl from "@onflow/fcl" - -fcl.createFcl(params) -``` - -Or import directly the specific function: - -```typescript -import { createFcl } from "@onflow/fcl" - -createFcl(params) -``` - -## Usage - -```typescript -// Basic FCL instance creation -import { createFcl } from "@onflow/fcl" - -const fcl = createFcl({ - accessNodeUrl: "https://rest-testnet.onflow.org", - computeLimit: 1000, - flowNetwork: "testnet" -}) - -// Use the instance for authentication -const user = await fcl.currentUser.authenticate() -console.log("Authenticated user:", user.addr) -``` - -## Parameters - -### `params` - - -- Type: -```typescript -WithOptionalProperties -``` -- Description: Configuration parameters for the FCL instance - -#### Properties: - -- **`accessNodeUrl`** - URL of the Flow access node (e.g., "https://rest-testnet.onflow.org") -- **`computeLimit`** - Default compute limit for transactions and queries -- **`customResolver`** - Optional custom resolver for address replacement -- **`customDecoders`** - Optional custom decoders for response parsing -- **`contracts`** - Optional contract address mappings -- **`discoveryWallet`** - Optional discovery wallet endpoint -- **`discoveryWalletMethod`** - Optional discovery wallet method -- **`defaultComputeLimit`** - Optional default compute limit override -- **`flowNetwork`** - Optional Flow network identifier -- **`serviceOpenIdScopes`** - Optional OpenID scopes for services -- **`walletconnectProjectId`** - Optional WalletConnect project ID -- **`walletconnectDisableNotifications`** - Optional flag to disable WalletConnect notifications -- **`storage`** - Optional custom storage provider (defaults to localStorage) -- **`discovery`** - Optional discovery configuration - - -## Returns - -`any` - - -A fully configured FCL instance with all core methods and services - ---- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/createFlowClient.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/createFlowClient.md new file mode 100644 index 0000000000..0a6b30c64d --- /dev/null +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/createFlowClient.md @@ -0,0 +1,66 @@ +--- +title: "createFlowClient" +description: "createFlowClient function documentation." +--- + + + +# createFlowClient + + +## Import + +You can import the entire package and access the function: + +```typescript +import * as fcl from "@onflow/fcl" + +fcl.createFlowClient(params) +``` + +Or import directly the specific function: + +```typescript +import { createFlowClient } from "@onflow/fcl" + +createFlowClient(params) +``` + + +## Parameters + +### `params` + + +- Type: +```typescript +export interface FlowClientConfig { + accessNodeUrl: string + flowNetwork?: string + flowJson?: any + discoveryWallet?: string + discoveryWalletMethod?: string + discoveryAuthnEndpoint?: string + discoveryAuthnInclude?: string[] + walletconnectProjectId?: string + walletconnectDisableNotifications?: boolean + storage?: StorageProvider + appDetailTitle?: string + appDetailIcon?: string + appDetailDescription?: string + appDetailUrl?: string + serviceOpenIdScopes?: string[] + transport?: SdkTransport + computeLimit?: number + customResolver?: any + customDecoders?: any +} +``` + + +## Returns + +`Promise` + + +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/events.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/events.md index f11efa53bc..0c2efe0a1c 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/events.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/events.md @@ -3,7 +3,7 @@ title: "events" description: "events function documentation." --- - + # events diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getAccount.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getAccount.md index 8ea48696f0..26df9d050d 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getAccount.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getAccount.md @@ -1,9 +1,9 @@ --- -title: 'getAccount' -description: 'getAccount function documentation.' +title: "getAccount" +description: "getAccount function documentation." --- - + # getAccount @@ -18,23 +18,23 @@ Account address is a unique account identifier. Be mindful about the '0x' prefix You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.getAccount(addr); +fcl.getAccount(addr) ``` Or import directly the specific function: ```typescript -import { getAccount } from '@onflow/fcl'; +import { getAccount } from "@onflow/fcl" -getAccount(addr); +getAccount(addr) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // somewhere in an async function // fcl.account is the same as this function @@ -46,18 +46,21 @@ const getAccount = async (address) => { ## Parameters -### `addr` +### `addr` + - Type: `string` + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getBlock.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getBlock.md index a4738e28ea..e3aa4b0e5e 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getBlock.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getBlock.md @@ -1,9 +1,9 @@ --- -title: 'getBlock' -description: 'getBlock function documentation.' +title: "getBlock" +description: "getBlock function documentation." --- - + # getBlock @@ -22,46 +22,47 @@ Block height expresses the height of the block on the chain. The latest block he You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.getBlock(isSealed); +fcl.getBlock(isSealed) ``` Or import directly the specific function: ```typescript -import { getBlock } from '@onflow/fcl'; +import { getBlock } from "@onflow/fcl" -getBlock(isSealed); +getBlock(isSealed) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; -const latestSealedBlock = await fcl - .send([ - fcl.getBlock(true), // isSealed = true - ]) - .then(fcl.decode); +const latestSealedBlock = await fcl.send([ + fcl.getBlock(true) // isSealed = true +]).then(fcl.decode); ``` ## Parameters ### `isSealed` (optional) + - Type: `boolean` - Description: If the latest block should be sealed or not. See block states + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getBlockHeader.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getBlockHeader.md index e57f8fe290..ac87c953ba 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getBlockHeader.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getBlockHeader.md @@ -1,9 +1,9 @@ --- -title: 'getBlockHeader' -description: 'getBlockHeader function documentation.' +title: "getBlockHeader" +description: "getBlockHeader function documentation." --- - + # getBlockHeader @@ -20,59 +20,63 @@ Use with 'fcl.atBlockId()' and 'fcl.atBlockHeight()' when building the interacti You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.getBlockHeader(isSealed); +fcl.getBlockHeader(isSealed) ``` Or import directly the specific function: ```typescript -import { getBlockHeader } from '@onflow/fcl'; +import { getBlockHeader } from "@onflow/fcl" -getBlockHeader(isSealed); +getBlockHeader(isSealed) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get latest sealed block header -const sealedHeader = await fcl - .send([fcl.getBlockHeader(true)]) - .then(fcl.decode); +const sealedHeader = await fcl.send([ + fcl.getBlockHeader(true) +]).then(fcl.decode); -console.log('Block height:', sealedHeader.height); -console.log('Block timestamp:', sealedHeader.timestamp); -console.log('Parent block ID:', sealedHeader.parentId); +console.log("Block height:", sealedHeader.height); +console.log("Block timestamp:", sealedHeader.timestamp); +console.log("Parent block ID:", sealedHeader.parentId); // Get header for specific block -const blockHeader = await fcl - .send([fcl.getBlockHeader(), fcl.atBlockHeight(12345)]) - .then(fcl.decode); +const blockHeader = await fcl.send([ + fcl.getBlockHeader(), + fcl.atBlockHeight(12345) +]).then(fcl.decode); // Get latest finalized block header -const finalizedHeader = await fcl - .send([fcl.getBlockHeader(false)]) - .then(fcl.decode); +const finalizedHeader = await fcl.send([ + fcl.getBlockHeader(false) +]).then(fcl.decode); ``` ## Parameters ### `isSealed` (optional) + - Type: `boolean` - Description: Block finality state, true for sealed blocks, false for finalized blocks, null for latest + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getChainId.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getChainId.md deleted file mode 100644 index 09411be86c..0000000000 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getChainId.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: "getChainId" -description: "getChainId function documentation." ---- - - - -# getChainId - -Gets the chain ID if its set, otherwise gets the chain ID from the access node - -## Import - -You can import the entire package and access the function: - -```typescript -import * as fcl from "@onflow/fcl" - -fcl.getChainId(opts) -``` - -Or import directly the specific function: - -```typescript -import { getChainId } from "@onflow/fcl" - -getChainId(opts) -``` - -## Usage - -```typescript -// Get chain ID using configured access node -import * as fcl from "@onflow/fcl" - -const chainId = await fcl.getChainId() -console.log("Connected to:", chainId) // "testnet" or "mainnet" -``` - -## Parameters - -### `opts` (optional) - - -- Type: -```typescript -export interface GetChainIdOptions { - node?: unknown - enableRequestLogging?: boolean - [key: string]: any -} -``` -- Description: Optional configuration parameters - -#### Properties: - -- **`node`** - Override the access node URL for this request instead of using the configured one -- **`enableRequestLogging`** - Enable logging for the chain ID request - - -## Returns - -`Promise` - - -Promise that resolves to the chain ID string (e.g., "mainnet", "testnet", "local") - ---- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getCollection.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getCollection.md index 654a7d641f..b2a5c78015 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getCollection.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getCollection.md @@ -1,9 +1,9 @@ --- -title: 'getCollection' -description: 'getCollection function documentation.' +title: "getCollection" +description: "getCollection function documentation." --- - + # getCollection @@ -20,43 +20,39 @@ The collection ID provided must be from the current spork. Collections from past You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.getCollection(id); +fcl.getCollection(id) ``` Or import directly the specific function: ```typescript -import { getCollection } from '@onflow/fcl'; +import { getCollection } from "@onflow/fcl" -getCollection(id); +getCollection(id) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get a collection and see what transactions it contains -const collection = await fcl - .send([ - fcl.getCollection( - 'cccdb0c67d015dc7f6444e8f62a3244ed650215ed66b90603006c70c5ef1f6e5', - ), - ]) - .then(fcl.decode); - -console.log('Collection ID:', collection.id); -console.log('Transaction IDs:', collection.transactionIds); -console.log('Total transactions:', collection.transactionIds.length); +const collection = await fcl.send([ + fcl.getCollection("cccdb0c67d015dc7f6444e8f62a3244ed650215ed66b90603006c70c5ef1f6e5") +]).then(fcl.decode); + +console.log("Collection ID:", collection.id); +console.log("Transaction IDs:", collection.transactionIds); +console.log("Total transactions:", collection.transactionIds.length); // Process each transaction in the collection for (const txId of collection.transactionIds) { - const transaction = await fcl - .send([fcl.getTransaction(txId)]) - .then(fcl.decode); - console.log('Transaction:', transaction); + const transaction = await fcl.send([ + fcl.getTransaction(txId) + ]).then(fcl.decode); + console.log("Transaction:", transaction); } ``` @@ -64,16 +60,19 @@ for (const txId of collection.transactionIds) { ### `id` (optional) + - Type: `string` + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getEvents.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getEvents.md index 1a24f6028d..a3fade4ac2 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getEvents.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getEvents.md @@ -1,9 +1,9 @@ --- -title: 'getEvents' -description: 'getEvents function documentation.' +title: "getEvents" +description: "getEvents function documentation." --- - + # getEvents @@ -17,63 +17,66 @@ This function queries for events of a specific type within a range of block heig You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.getEvents(eventType, start, end); +fcl.getEvents(eventType, start, end) ``` Or import directly the specific function: ```typescript -import { getEvents } from '@onflow/fcl'; +import { getEvents } from "@onflow/fcl" -getEvents(eventType, start, end); +getEvents(eventType, start, end) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get FlowToken transfer events from blocks 1000 to 2000 -const events = await fcl - .send([ - fcl.getEvents('A.1654653399040a61.FlowToken.TokensDeposited', 1000, 2000), - ]) - .then(fcl.decode); - -console.log('Found events:', events.length); -events.forEach((event) => { - console.log('Event data:', event.data); - console.log('Transaction ID:', event.transactionId); +const events = await fcl.send([ + fcl.getEvents("A.1654653399040a61.FlowToken.TokensDeposited", 1000, 2000) +]).then(fcl.decode); + +console.log("Found events:", events.length); +events.forEach(event => { + console.log("Event data:", event.data); + console.log("Transaction ID:", event.transactionId); }); ``` ## Parameters -### `eventType` +### `eventType` + - Type: `string` - Description: The type of event to get (e.g., "A.1654653399040a61.FlowToken.TokensWithdrawn") -### `start` +### `start` + - Type: `number` - Description: The start block height to query from -### `end` +### `end` + - Type: `number` - Description: The end block height to query to + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getEventsAtBlockHeightRange.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getEventsAtBlockHeightRange.md index aea3e7309f..b5795730f5 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getEventsAtBlockHeightRange.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getEventsAtBlockHeightRange.md @@ -1,9 +1,9 @@ --- -title: 'getEventsAtBlockHeightRange' -description: 'getEventsAtBlockHeightRange function documentation.' +title: "getEventsAtBlockHeightRange" +description: "getEventsAtBlockHeightRange function documentation." --- - + # getEventsAtBlockHeightRange @@ -24,31 +24,31 @@ Block height range expresses the height of the start and end block in the chain. You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.getEventsAtBlockHeightRange(eventType, startHeight, endHeight); +fcl.getEventsAtBlockHeightRange(eventType, startHeight, endHeight) ``` Or import directly the specific function: ```typescript -import { getEventsAtBlockHeightRange } from '@onflow/fcl'; +import { getEventsAtBlockHeightRange } from "@onflow/fcl" -getEventsAtBlockHeightRange(eventType, startHeight, endHeight); +getEventsAtBlockHeightRange(eventType, startHeight, endHeight) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get events at block height range await fcl .send([ fcl.getEventsAtBlockHeightRange( - 'A.7e60df042a9c0868.FlowToken.TokensWithdrawn', // event name + "A.7e60df042a9c0868.FlowToken.TokensWithdrawn", // event name 35580624, // block to start looking for events at - 35580624, // block to stop looking for events at + 35580624 // block to stop looking for events at ), ]) .then(fcl.decode); @@ -56,29 +56,34 @@ await fcl ## Parameters -### `eventType` +### `eventType` + - Type: `string` - Description: The type of event to get -### `startHeight` +### `startHeight` + - Type: `number` - Description: The height of the block to start looking for events (inclusive) -### `endHeight` +### `endHeight` + - Type: `number` - Description: The height of the block to stop looking for events (inclusive) + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getEventsAtBlockIds.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getEventsAtBlockIds.md index b0e9e285ef..8fbc995f33 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getEventsAtBlockIds.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getEventsAtBlockIds.md @@ -1,9 +1,9 @@ --- -title: 'getEventsAtBlockIds' -description: 'getEventsAtBlockIds function documentation.' +title: "getEventsAtBlockIds" +description: "getEventsAtBlockIds function documentation." --- - + # getEventsAtBlockIds @@ -20,54 +20,56 @@ Please read more about [events in the documentation](https://docs.onflow.org/cad You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.getEventsAtBlockIds(eventType, blockIds); +fcl.getEventsAtBlockIds(eventType, blockIds) ``` Or import directly the specific function: ```typescript -import { getEventsAtBlockIds } from '@onflow/fcl'; +import { getEventsAtBlockIds } from "@onflow/fcl" -getEventsAtBlockIds(eventType, blockIds); +getEventsAtBlockIds(eventType, blockIds) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; - -const events = await fcl - .send([ - fcl.getEventsAtBlockIds('A.7e60df042a9c0868.FlowToken.TokensWithdrawn', [ - 'c4f239d49e96d1e5fbcf1f31027a6e582e8c03fcd9954177b7723fdb03d938c7', - '5dbaa85922eb194a3dc463c946cc01c866f2ff2b88f3e59e21c0d8d00113273f', - ]), +import * as fcl from "@onflow/fcl"; + +const events = await fcl.send([ + fcl.getEventsAtBlockIds("A.7e60df042a9c0868.FlowToken.TokensWithdrawn", [ + "c4f239d49e96d1e5fbcf1f31027a6e582e8c03fcd9954177b7723fdb03d938c7", + "5dbaa85922eb194a3dc463c946cc01c866f2ff2b88f3e59e21c0d8d00113273f" ]) - .then(fcl.decode); +]).then(fcl.decode); ``` ## Parameters -### `eventType` +### `eventType` + - Type: `string` - Description: The type of event to get -### `blockIds` +### `blockIds` + - Type: `string[]` - Description: The ids of the blocks to scan for events + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getNetworkParameters.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getNetworkParameters.md index 2d0486e1b2..e4340c5162 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getNetworkParameters.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getNetworkParameters.md @@ -1,9 +1,9 @@ --- -title: 'getNetworkParameters' -description: 'getNetworkParameters function documentation.' +title: "getNetworkParameters" +description: "getNetworkParameters function documentation." --- - + # getNetworkParameters @@ -18,46 +18,50 @@ This information is crucial for ensuring transactions are submitted to the corre You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.getNetworkParameters(); +fcl.getNetworkParameters() ``` Or import directly the specific function: ```typescript -import { getNetworkParameters } from '@onflow/fcl'; +import { getNetworkParameters } from "@onflow/fcl" -getNetworkParameters(); +getNetworkParameters() ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get network parameters to verify chain ID -const params = await fcl.send([fcl.getNetworkParameters()]).then(fcl.decode); +const params = await fcl.send([ + fcl.getNetworkParameters() +]).then(fcl.decode); -console.log('Chain ID:', params.chainId); -console.log('Network:', params.name); +console.log("Chain ID:", params.chainId); +console.log("Network:", params.name); // Use this to verify you're connected to the right network -if (params.chainId === 'flow-mainnet') { - console.log('Connected to Flow Mainnet'); -} else if (params.chainId === 'flow-testnet') { - console.log('Connected to Flow Testnet'); +if (params.chainId === "flow-mainnet") { + console.log("Connected to Flow Mainnet"); +} else if (params.chainId === "flow-testnet") { + console.log("Connected to Flow Testnet"); } ``` + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getNodeVersionInfo.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getNodeVersionInfo.md index 541ffa9ae9..ed709a9480 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getNodeVersionInfo.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getNodeVersionInfo.md @@ -1,9 +1,9 @@ --- -title: 'getNodeVersionInfo' -description: 'getNodeVersionInfo function documentation.' +title: "getNodeVersionInfo" +description: "getNodeVersionInfo function documentation." --- - + # getNodeVersionInfo @@ -19,46 +19,50 @@ Consider using the pre-built interaction 'fcl.nodeVersionInfo()' if you do not n You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.getNodeVersionInfo(); +fcl.getNodeVersionInfo() ``` Or import directly the specific function: ```typescript -import { getNodeVersionInfo } from '@onflow/fcl'; +import { getNodeVersionInfo } from "@onflow/fcl" -getNodeVersionInfo(); +getNodeVersionInfo() ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get node version information using builder -const versionInfo = await fcl.send([fcl.getNodeVersionInfo()]).then(fcl.decode); +const versionInfo = await fcl.send([ + fcl.getNodeVersionInfo() +]).then(fcl.decode); -console.log('Node version:', versionInfo.semver); -console.log('Protocol version:', versionInfo.protocol_version); -console.log('Spork ID:', versionInfo.spork_id); +console.log("Node version:", versionInfo.semver); +console.log("Protocol version:", versionInfo.protocol_version); +console.log("Spork ID:", versionInfo.spork_id); // Use with other builders if needed const interaction = await fcl.build([ - fcl.getNodeVersionInfo(), + fcl.getNodeVersionInfo() // other builders can be added here ]); ``` + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getTransaction.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getTransaction.md index eade4a8f8b..e5dee5ac0c 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getTransaction.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getTransaction.md @@ -3,7 +3,7 @@ title: "getTransaction" description: "getTransaction function documentation." --- - + # getTransaction diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getTransactionStatus.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getTransactionStatus.md index 0bf149e33b..02a4c4ba63 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/getTransactionStatus.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/getTransactionStatus.md @@ -1,9 +1,9 @@ --- -title: 'getTransactionStatus' -description: 'getTransactionStatus function documentation.' +title: "getTransactionStatus" +description: "getTransactionStatus function documentation." --- - + # getTransactionStatus @@ -18,48 +18,47 @@ Consider using 'fcl.tx(id)' instead of calling this method directly for real-tim You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.getTransactionStatus(transactionId); +fcl.getTransactionStatus(transactionId) ``` Or import directly the specific function: ```typescript -import { getTransactionStatus } from '@onflow/fcl'; +import { getTransactionStatus } from "@onflow/fcl" -getTransactionStatus(transactionId); +getTransactionStatus(transactionId) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; - -const status = await fcl - .send([ - fcl.getTransactionStatus( - '9dda5f281897389b99f103a1c6b180eec9dac870de846449a302103ce38453f3', - ), - ]) - .then(fcl.decode); +import * as fcl from "@onflow/fcl"; + +const status = await fcl.send([ + fcl.getTransactionStatus("9dda5f281897389b99f103a1c6b180eec9dac870de846449a302103ce38453f3") +]).then(fcl.decode); ``` ## Parameters -### `transactionId` +### `transactionId` + - Type: `string` - Description: The id of the transaction to get the status of + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/index.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/index.md index 46bd9fb598..73925ceca3 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/index.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/index.md @@ -240,7 +240,7 @@ This section contains documentation for all of the functions and namespaces in t - [cadence](./cadence.md) - Creates a template function - [cdc](./cdc.md) - Creates a template function - [config](./config.md) - Sets the config -- [createFcl](./createFcl.md) - Creates a configured FCL (Flow Client Library) instance for web applications.... +- [createFlowClient](./createFlowClient.md) - [createSignableVoucher](./createSignableVoucher.md) - Creates a signable voucher object from an interaction for signing purposes. A... - [currentUser](./currentUser.md) - The main current user service for managing user authentication and authorization... - [decode](./decode.md) - Decodes the response from 'fcl.send()' into the appropriate JSON representation... @@ -249,7 +249,6 @@ This section contains documentation for all of the functions and namespaces in t - [getAccount](./getAccount.md) - A builder function that returns the interaction to get an account by address.... - [getBlock](./getBlock.md) - A builder function that returns the interaction to get the latest block. Use... - [getBlockHeader](./getBlockHeader.md) - A builder function that returns the interaction to get a block header. A block... -- [getChainId](./getChainId.md) - Gets the chain ID if its set, otherwise gets the chain ID from the access node - [getCollection](./getCollection.md) - A builder function that returns a collection containing a list of transaction... - [getEvents](./getEvents.md) - A builder function that returns the interaction to get events. Events are... - [getEventsAtBlockHeightRange](./getEventsAtBlockHeightRange.md) - A builder function that returns all instances of a particular event (by name)... @@ -284,7 +283,7 @@ This section contains documentation for all of the functions and namespaces in t - [subscribe](./subscribe.md) - Subscribe to real-time data from the Flow blockchain and automatically decode... - [subscribeEvents](./subscribeEvents.md) - Subscribe to events with the given filter and parameters. Creates a subscription... - [subscribeRaw](./subscribeRaw.md) - Subscribe to a topic without decoding the data. This function creates a raw... -- [transaction](./transaction.md) - A template builder to use a Cadence transaction for an interaction. FCL "mutate"... +- [transaction](./transaction.md) - Creates a transaction monitor that provides methods for tracking and subscribing... - [tx](./tx.md) - Creates a transaction monitor that provides methods for tracking and subscribing... - [unauthenticate](./unauthenticate.md) - Logs out the current user and sets the values on the current user object to... - [validator](./validator.md) - A builder function that adds a validator to a transaction. Validators are... diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/limit.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/limit.md index 4702ee62e8..51ab296569 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/limit.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/limit.md @@ -1,9 +1,9 @@ --- -title: 'limit' -description: 'limit function documentation.' +title: "limit" +description: "limit function documentation." --- - + # limit @@ -19,23 +19,23 @@ Read more about [computation cost](https://docs.onflow.org/concepts/fees/#comput You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.limit(limit); +fcl.limit(limit) ``` Or import directly the specific function: ```typescript -import { limit } from '@onflow/fcl'; +import { limit } from "@onflow/fcl" -limit(limit); +limit(limit) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; await fcl.mutate({ cadence: ` @@ -45,7 +45,7 @@ await fcl.mutate({ } } `, - limit: 1000, // Set compute limit to 1000 + limit: 1000 // Set compute limit to 1000 }); // Using builder pattern @@ -57,25 +57,28 @@ await fcl.send([ } } `, - fcl.limit(9999), // Set higher limit for complex operations + fcl.limit(9999) // Set higher limit for complex operations ]); ``` ## Parameters -### `limit` +### `limit` + - Type: `number` - Description: The maximum amount of computation for the transaction + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/mutate.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/mutate.md index a5d472ff7f..cc6b828978 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/mutate.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/mutate.md @@ -1,6 +1,6 @@ --- -title: 'mutate' -description: 'mutate function documentation.' +title: "mutate" +description: "mutate function documentation." --- @@ -8,7 +8,7 @@ description: 'mutate function documentation.' # mutate A transaction execution function that allows you to submit Cadence transactions to the Flow blockchain -to mutate onchain state. This function handles the complete transaction lifecycle including building, signing, and +to mutate on-chain state. This function handles the complete transaction lifecycle including building, signing, and sending transactions to Flow. It provides a high-level interface that abstracts the complexity of transaction construction while offering flexibility for advanced use cases. @@ -21,7 +21,6 @@ Cadence code that are replaced with actual addresses at execution time. It also for standardized transaction execution patterns. The mutate function accepts a configuration object with the following structure: - ```typescript { cadence?: string, // The Cadence transaction code to execute (required if template not provided) @@ -40,34 +39,34 @@ authorizations?: AccountAuthorization[] // Array of authorization functions for You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.mutate(opts); +fcl.mutate(opts) ``` Or import directly the specific function: ```typescript -import { mutate } from '@onflow/fcl'; +import { mutate } from "@onflow/fcl" -mutate(opts); +mutate(opts) ``` ## Usage ```typescript // Basic transaction submission -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" // Configure FCL first fcl.config({ - 'accessNode.api': 'https://rest-testnet.onflow.org', - 'discovery.wallet': 'https://fcl-discovery.onflow.org/testnet/authn', - 'flow.network': 'testnet', -}); + "accessNode.api": "https://rest-testnet.onflow.org", + "discovery.wallet": "https://fcl-discovery.onflow.org/testnet/authn", + "flow.network": "testnet" +}) // Authenticate user -await fcl.authenticate(); +await fcl.authenticate() // Submit a basic transaction const txId = await fcl.mutate({ @@ -79,26 +78,31 @@ const txId = await fcl.mutate({ } } `, - args: (arg, t) => [arg('Hello Flow!', t.String)], - limit: 50, -}); + args: (arg, t) => [ + arg("Hello Flow!", t.String) + ], + limit: 50 +}) -console.log('Transaction submitted:', txId); +console.log("Transaction submitted:", txId) ``` ## Parameters -### `opts` +### `opts` + - Type: `any` - Description: Transaction configuration options + ## Returns ```typescript -(opts?: MutateOptions) => Promise; +(opts?: MutateOptions) => Promise ``` + Promise that resolves to the transaction ID (txId) when the transaction is submitted ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/payer.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/payer.md index 76c41aa838..13a64c1d87 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/payer.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/payer.md @@ -1,9 +1,9 @@ --- -title: 'payer' -description: 'payer function documentation.' +title: "payer" +description: "payer function documentation." --- - + # payer @@ -21,23 +21,23 @@ Read more about [transaction roles](https://docs.onflow.org/concepts/transaction You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.payer(ax); +fcl.payer(ax) ``` Or import directly the specific function: ```typescript -import { payer } from '@onflow/fcl'; +import { payer } from "@onflow/fcl" -payer(ax); +payer(ax) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Using current user as payer (most common case) await fcl.mutate({ @@ -48,7 +48,7 @@ await fcl.mutate({ } } `, - payer: fcl.authz, // Current user as payer + payer: fcl.authz // Current user as payer }); // Using custom payer with builder pattern @@ -60,9 +60,9 @@ await fcl.send([ } } `, - fcl.proposer(fcl.authz), // Current user as proposer + fcl.proposer(fcl.authz), // Current user as proposer fcl.authorizations([fcl.authz]), // Current user as authorizer - fcl.payer(customPayerAuthz), // Custom payer pays fees + fcl.payer(customPayerAuthz) // Custom payer pays fees ]); // Multiple payers (advanced use case) @@ -74,7 +74,7 @@ await fcl.send([ } } `, - fcl.payer([payerAuthz1, payerAuthz2]), // Multiple payers split fees + fcl.payer([payerAuthz1, payerAuthz2]) // Multiple payers split fees ]); ``` @@ -82,24 +82,25 @@ await fcl.send([ ### `ax` (optional) -- Type: +- Type: ```typescript export type AccountAuthorization = | (AuthorizationFn & Partial) - | Partial; + | Partial ``` - - Description: An account address or an array of account addresses + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that takes an interaction object and returns a new interaction object with the payer(s) added ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/ping.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/ping.md index 7f62176005..5b82411a71 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/ping.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/ping.md @@ -1,9 +1,9 @@ --- -title: 'ping' -description: 'ping function documentation.' +title: "ping" +description: "ping function documentation." --- - + # ping @@ -16,58 +16,56 @@ The ping interaction is a simple way to test if the Flow Access Node is reachabl You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.ping(); +fcl.ping() ``` Or import directly the specific function: ```typescript -import { ping } from '@onflow/fcl'; +import { ping } from "@onflow/fcl" -ping(); +ping() ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Simple ping to test connectivity try { const response = await fcl.send([fcl.ping()]); - console.log('Access Node is reachable'); + console.log("Access Node is reachable"); } catch (error) { - console.error('Access Node is not reachable:', error); + console.error("Access Node is not reachable:", error); } // Use ping for health checks const healthCheck = async () => { try { await fcl.send([fcl.ping()]); - return { status: 'healthy', timestamp: new Date().toISOString() }; + return { status: "healthy", timestamp: new Date().toISOString() }; } catch (error) { - return { - status: 'unhealthy', - error: error.message, - timestamp: new Date().toISOString(), - }; + return { status: "unhealthy", error: error.message, timestamp: new Date().toISOString() }; } }; const health = await healthCheck(); -console.log('Health status:', health); +console.log("Health status:", health); ``` + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/proposer.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/proposer.md index 42eca56b0b..11a85e9ec1 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/proposer.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/proposer.md @@ -1,9 +1,9 @@ --- -title: 'proposer' -description: 'proposer function documentation.' +title: "proposer" +description: "proposer function documentation." --- - + # proposer @@ -21,23 +21,23 @@ Read more about [transaction roles](https://docs.onflow.org/concepts/transaction You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.proposer(authz); +fcl.proposer(authz) ``` Or import directly the specific function: ```typescript -import { proposer } from '@onflow/fcl'; +import { proposer } from "@onflow/fcl" -proposer(authz); +proposer(authz) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Using the current user as proposer await fcl.mutate({ @@ -48,7 +48,7 @@ await fcl.mutate({ } } `, - proposer: fcl.authz, + proposer: fcl.authz }); // Using builder pattern @@ -63,28 +63,29 @@ await fcl.send([ fcl.proposer(proposerAuthz), fcl.payer(payerAuthz), fcl.authorizations([authorizerAuthz]), - fcl.limit(100), + fcl.limit(100) ]); ``` ## Parameters -### `authz` +### `authz` -- Type: +- Type: ```typescript export type AccountAuthorization = | (AuthorizationFn & Partial) - | Partial; + | Partial ``` - - Description: The authorization object for the proposer + ## Returns [`Interaction`](../types#interaction) + A function that takes an interaction object and returns a new interaction object with the proposer added ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/query.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/query.md index 94034bcf70..a3b92778ca 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/query.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/query.md @@ -3,7 +3,7 @@ title: "query" description: "query function documentation." --- - + # query diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/queryRaw.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/queryRaw.md index 2cf607ae84..20516afcfc 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/queryRaw.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/queryRaw.md @@ -3,7 +3,7 @@ title: "queryRaw" description: "queryRaw function documentation." --- - + # queryRaw diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/ref.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/ref.md index fc0df24810..a6bf2b3c3c 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/ref.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/ref.md @@ -1,9 +1,9 @@ --- -title: 'ref' -description: 'ref function documentation.' +title: "ref" +description: "ref function documentation." --- - + # ref @@ -17,23 +17,23 @@ A transaction will be rejected if it is submitted past its expiry block. Flow ca You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.ref(refBlock); +fcl.ref(refBlock) ``` Or import directly the specific function: ```typescript -import { ref } from '@onflow/fcl'; +import { ref } from "@onflow/fcl" -ref(refBlock); +ref(refBlock) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Set specific reference block for transaction await fcl.send([ @@ -44,11 +44,11 @@ await fcl.send([ } } `, - fcl.ref('a1b2c3d4e5f6789...'), // Custom reference block ID + fcl.ref("a1b2c3d4e5f6789..."), // Custom reference block ID fcl.proposer(fcl.authz), fcl.payer(fcl.authz), fcl.authorizations([fcl.authz]), - fcl.limit(100), + fcl.limit(100) ]); // Usually, you don't need to set reference block manually @@ -57,19 +57,22 @@ await fcl.send([ ## Parameters -### `refBlock` +### `refBlock` + - Type: `string` - Description: The reference block ID + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/script.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/script.md index 78e8c642a3..ebd3776565 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/script.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/script.md @@ -1,9 +1,9 @@ --- -title: 'script' -description: 'script function documentation.' +title: "script" +description: "script function documentation." --- - + # script @@ -22,23 +22,23 @@ Block height expresses the height of the block in the chain. You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.script(args); +fcl.script(args) ``` Or import directly the specific function: ```typescript -import { script } from '@onflow/fcl'; +import { script } from "@onflow/fcl" -script(args); +script(args) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; const result = await fcl.query({ cadence: ` @@ -50,7 +50,7 @@ const result = await fcl.query({ args: (arg, t) => [ arg(7, t.Int), // a: Int arg(6, t.Int), // b: Int - arg('0xba1132bc08f82fe2', t.Address), // addr: Address + arg("0xba1132bc08f82fe2", t.Address), // addr: Address ], }); @@ -61,22 +61,23 @@ console.log(result); // 13 ### `args` (optional) -- Type: +- Type: ```typescript [string | TemplateStringsArray | ((x?: unknown) => string), ...unknown[]] ``` - - Description: The arguments to pass to the template + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/subscribeEvents.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/subscribeEvents.md index bc0b10261a..85565d1a97 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/subscribeEvents.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/subscribeEvents.md @@ -1,9 +1,9 @@ --- -title: 'subscribeEvents' -description: 'subscribeEvents function documentation.' +title: "subscribeEvents" +description: "subscribeEvents function documentation." --- - + # subscribeEvents @@ -20,42 +20,42 @@ Subscriptions allow you to listen for these events in real-time without polling. You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.subscribeEvents(eventFilter); +fcl.subscribeEvents(eventFilter) ``` Or import directly the specific function: ```typescript -import { subscribeEvents } from '@onflow/fcl'; +import { subscribeEvents } from "@onflow/fcl" -subscribeEvents(eventFilter); +subscribeEvents(eventFilter) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Subscribe to FlowToken transfer events const subscription = await fcl.send([ fcl.subscribeEvents({ eventTypes: [ - 'A.1654653399040a61.FlowToken.TokensWithdrawn', - 'A.1654653399040a61.FlowToken.TokensDeposited', + "A.1654653399040a61.FlowToken.TokensWithdrawn", + "A.1654653399040a61.FlowToken.TokensDeposited" ], startHeight: 1000000, // Start from specific block height - heartbeatInterval: 3000, // 3 second heartbeat - }), + heartbeatInterval: 3000 // 3 second heartbeat + }) ]); // Subscribe to events from specific contracts const contractSubscription = await fcl.send([ fcl.subscribeEvents({ - contracts: ['FlowToken', 'FungibleToken'], - addresses: ['0x1654653399040a61'], - }), + contracts: ["FlowToken", "FungibleToken"], + addresses: ["0x1654653399040a61"] + }) ]); // Handle the subscription data elsewhere using fcl.subscribe() @@ -63,18 +63,21 @@ const contractSubscription = await fcl.send([ ## Parameters -### `eventFilter` +### `eventFilter` + - Type: [`EventFilter`](../types#eventfilter) + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/transaction.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/transaction.md index 3ded61950c..cd0c2499e3 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/transaction.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/transaction.md @@ -3,13 +3,13 @@ title: "transaction" description: "transaction function documentation." --- - + # transaction -A template builder to use a Cadence transaction for an interaction. FCL "mutate" does the work of building, signing, and sending a transaction behind the scenes. - -Flow supports great flexibility when it comes to transaction signing, we can define multiple authorizers (multi-sig transactions) and have different payer account than proposer. +Creates a transaction monitor that provides methods for tracking and subscribing to +transaction status updates on the Flow blockchain. This function returns an object with methods +to get snapshots, subscribe to status changes, and wait for specific transaction states. ## Import @@ -18,7 +18,7 @@ You can import the entire package and access the function: ```typescript import * as fcl from "@onflow/fcl" -fcl.transaction(args) +fcl.transaction(transactionId, opts) ``` Or import directly the specific function: @@ -26,78 +26,98 @@ Or import directly the specific function: ```typescript import { transaction } from "@onflow/fcl" -transaction(args) +transaction(transactionId, opts) ``` ## Usage ```typescript +// Basic transaction monitoring import * as fcl from "@onflow/fcl" -// Basic transaction usage -await fcl.mutate({ - cadence: ` - transaction(a: Int) { - prepare(acct: &Account) { - log(acct) - log(a) - } - } - `, - args: (arg, t) => [ - arg(6, t.Int) - ], - limit: 50 -}) - -// Single party, single signature -// Proposer, payer and authorizer are the same account -await fcl.mutate({ +const txId = await fcl.mutate({ cadence: ` transaction { - prepare(acct: &Account) {} + execute { log("Hello, World!") } } - `, - authz: currentUser, // Optional. Will default to currentUser if not provided. - limit: 50, + ` }) -// Multiple parties -// Proposer and authorizer are the same account, but different payer -await fcl.mutate({ - cadence: ` - transaction { - prepare(acct: &Account) {} - } - `, - proposer: authzFn, - payer: authzTwoFn, - authorizations: [authzFn], - limit: 50, +// Get current status +const status = await fcl.tx(txId).snapshot() +console.log("Current status:", status.status) + +// Subscribe to all status changes +const unsubscribe = fcl.tx(txId).subscribe((status) => { + console.log("Status update:", status.status) + if (status.status === fcl.transaction.isSealed) { + console.log("Transaction sealed!") + console.log("Events:", status.events) + } }) +// Clean up subscription when done +setTimeout(() => unsubscribe(), 60000) + +// Wait for specific transaction states +try { + // Wait for finalization (consensus reached) + const finalizedStatus = await fcl.tx(txId).onceFinalized() + console.log("Transaction finalized") + + // Wait for execution (transaction executed) + const executedStatus = await fcl.tx(txId).onceExecuted() + console.log("Transaction executed") + + // Wait for sealing (transaction sealed in block) + const sealedStatus = await fcl.tx(txId).onceSealed() + console.log("Transaction sealed:", sealedStatus.events) +} catch (error) { + console.error("Transaction failed:", error.message) +} + +// Handle transaction errors +fcl.tx(txId).subscribe( + (status) => { + if (status.statusCode === 1) { + console.error("Transaction error:", status.errorMessage) + } + }, + (error) => { + console.error("Subscription error:", error) + } +) ``` ## Parameters -### `args` (optional) +### `transactionId` + + +- Type: `string` +- Description: The 64-character hex transaction ID to monitor. Must be a valid +Flow transaction hash (64 bytes represented as hex string). + +### `opts` (optional) - Type: ```typescript -[string | TemplateStringsArray, ...any[]] +{ pollRate?: number; txNotFoundTimeout?: number; } ``` -- Description: The arguments to pass to the template +- Description: Optional configuration parameters + +#### Properties: + +- **`pollRate`** - Polling rate in milliseconds when using legacy polling fallback +- **`txNotFoundTimeout`** - Timeout in milliseconds for ignoring transaction +not found errors during initial transaction propagation (do not modify unless you know what you are doing) ## Returns -```typescript -export type InteractionBuilderFn = ( - ix: Interaction -) => Interaction | Promise -``` +[`Promise`](../types#transactionstatus) -A function that processes an interaction object +Transaction monitor object with methods for tracking transaction status --- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/tx.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/tx.md index 97e965db6f..44b6bc50b6 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/tx.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/tx.md @@ -3,7 +3,7 @@ title: "tx" description: "tx function documentation." --- - + # tx diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/validator.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/validator.md index 39fba51fdf..6df6e58fc0 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/validator.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/validator.md @@ -1,9 +1,9 @@ --- -title: 'validator' -description: 'validator function documentation.' +title: "validator" +description: "validator function documentation." --- - + # validator @@ -18,28 +18,28 @@ and wasted compute costs. You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.validator(cb); +fcl.validator(cb) ``` Or import directly the specific function: ```typescript -import { validator } from '@onflow/fcl'; +import { validator } from "@onflow/fcl" -validator(cb); +validator(cb) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Custom validator to ensure account has sufficient balance const validateBalance = (ix) => { if (ix.message.computeLimit > 1000) { - throw new Error('Compute limit too high for this account'); + throw new Error("Compute limit too high for this account"); } return ix; }; @@ -53,25 +53,28 @@ await fcl.send([ } `, fcl.validator(validateBalance), - fcl.limit(500), // This will pass validation + fcl.limit(500) // This will pass validation ]); ``` ## Parameters -### `cb` +### `cb` + - Type: `Function` - Description: The validator function that takes an interaction and returns it (or throws an error if invalid) + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/voucherIntercept.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/voucherIntercept.md index 7319d9083d..75a6b35f47 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/voucherIntercept.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/voucherIntercept.md @@ -1,9 +1,9 @@ --- -title: 'voucherIntercept' -description: 'voucherIntercept function documentation.' +title: "voucherIntercept" +description: "voucherIntercept function documentation." --- - + # voucherIntercept @@ -17,23 +17,23 @@ the transaction data. The voucher contains all the transaction details in their You can import the entire package and access the function: ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" -fcl.voucherIntercept(fn); +fcl.voucherIntercept(fn) ``` Or import directly the specific function: ```typescript -import { voucherIntercept } from '@onflow/fcl'; +import { voucherIntercept } from "@onflow/fcl" -voucherIntercept(fn); +voucherIntercept(fn) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Intercept voucher for logging await fcl.send([ @@ -45,40 +45,41 @@ await fcl.send([ } `, fcl.voucherIntercept((voucher) => { - console.log('Voucher details:', { + console.log("Voucher details:", { cadence: voucher.cadence, proposalKey: voucher.proposalKey, payer: voucher.payer, authorizers: voucher.authorizers, - computeLimit: voucher.computeLimit, + computeLimit: voucher.computeLimit }); }), fcl.proposer(fcl.authz), fcl.payer(fcl.authz), - fcl.authorizations([fcl.authz]), + fcl.authorizations([fcl.authz]) ]); ``` ## Parameters -### `fn` +### `fn` -- Type: +- Type: ```typescript -type VoucherInterceptFn = (voucher: Voucher) => any | Promise; +type VoucherInterceptFn = (voucher: Voucher) => any | Promise ``` - - Description: The function to intercept and potentially modify the voucher + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/arg.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/arg.md index de066735a5..80230e3901 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/arg.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/arg.md @@ -1,9 +1,9 @@ --- -title: 'arg' -description: 'arg function documentation.' +title: "arg" +description: "arg function documentation." --- - + # arg @@ -17,23 +17,23 @@ This function creates an ArgumentObject that holds the value and type passed in. You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.arg(value, xform); +sdk.arg(value, xform) ``` Or import directly the specific function: ```typescript -import { arg } from '@onflow/sdk'; +import { arg } from "@onflow/sdk" -arg(value, xform); +arg(value, xform) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" const result = await fcl.query({ cadence: ` @@ -45,34 +45,36 @@ const result = await fcl.query({ args: (arg, t) => [ arg(7, t.Int), // a: Int arg(6, t.Int), // b: Int - arg('0xba1132bc08f82fe2', t.Address), // addr: Address + arg("0xba1132bc08f82fe2", t.Address), // addr: Address ], }); ``` ## Parameters -### `value` +### `value` -- Type: +- Type: ```typescript -TypeDescriptorInput; +TypeDescriptorInput ``` - - Description: Any value that you are looking to pass to other builders -### `xform` +### `xform` + - Type: `T` - Description: A type supported by Flow (FType descriptor) + ## Returns ```typescript -CadenceArgument; +CadenceArgument ``` + An ArgumentObject that holds the value and type passed in ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/args.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/args.md index bdc93b7171..15b5c32e39 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/args.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/args.md @@ -1,9 +1,9 @@ --- -title: 'args' -description: 'args function documentation.' +title: "args" +description: "args function documentation." --- - + # args @@ -17,23 +17,23 @@ This function returns a Partial Interaction that contains the arguments and type You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.args(ax); +sdk.args(ax) ``` Or import directly the specific function: ```typescript -import { args } from '@onflow/sdk'; +import { args } from "@onflow/sdk" -args(ax); +args(ax) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" await fcl.mutate({ cadence: ` @@ -44,32 +44,33 @@ await fcl.mutate({ } `, args: (arg, t) => [ - arg('10.0', t.UFix64), // Will be the first argument `amount: UFix64` - arg('0xba1132bc08f82fe2', t.Address), // Will be the second argument `to: Address` + arg("10.0", t.UFix64), // Will be the first argument `amount: UFix64` + arg("0xba1132bc08f82fe2", t.Address), // Will be the second argument `to: Address` ], -}); +}) ``` ## Parameters -### `ax` +### `ax` -- Type: +- Type: ```typescript -CadenceArgument < any > []; +CadenceArgument[] ``` - - Description: An array of argument objects created with fcl.arg() + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A Partial Interaction object containing the arguments and types passed in ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/atBlockHeight.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/atBlockHeight.md index 698aada250..69e7e2d6da 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/atBlockHeight.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/atBlockHeight.md @@ -1,9 +1,9 @@ --- -title: 'atBlockHeight' -description: 'atBlockHeight function documentation.' +title: "atBlockHeight" +description: "atBlockHeight function documentation." --- - + # atBlockHeight @@ -18,60 +18,62 @@ Block height expresses the height of the block on the chain. The latest block he You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.atBlockHeight(height); +sdk.atBlockHeight(height) ``` Or import directly the specific function: ```typescript -import { atBlockHeight } from '@onflow/sdk'; +import { atBlockHeight } from "@onflow/sdk" -atBlockHeight(height); +atBlockHeight(height) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get block at specific height await fcl.send([fcl.getBlock(), fcl.atBlockHeight(123)]).then(fcl.decode); // Get account at specific block height -await fcl - .send([fcl.getAccount('0x1d007d755706c469'), fcl.atBlockHeight(12345)]) - .then(fcl.decode); +await fcl.send([ + fcl.getAccount("0x1d007d755706c469"), + fcl.atBlockHeight(12345) +]).then(fcl.decode); // Execute script at specific block height -await fcl - .send([ - fcl.script` +await fcl.send([ + fcl.script` access(all) fun main(): UFix64 { return getCurrentBlock().height } `, - fcl.atBlockHeight(100), - ]) - .then(fcl.decode); + fcl.atBlockHeight(100) +]).then(fcl.decode); ``` ## Parameters -### `height` +### `height` + - Type: `number` - Description: The height of the block to execute the interaction at + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A partial interaction to be paired with another interaction such as 'fcl.getBlock()' or 'fcl.getAccount()' ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/atBlockId.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/atBlockId.md index 302ff43803..2e951faf94 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/atBlockId.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/atBlockId.md @@ -1,9 +1,9 @@ --- -title: 'atBlockId' -description: 'atBlockId function documentation.' +title: "atBlockId" +description: "atBlockId function documentation." --- - + # atBlockId @@ -18,65 +18,62 @@ Block ID is SHA3-256 hash of the entire block payload. This hash is stored as an You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.atBlockId(id); +sdk.atBlockId(id) ``` Or import directly the specific function: ```typescript -import { atBlockId } from '@onflow/sdk'; +import { atBlockId } from "@onflow/sdk" -atBlockId(id); +atBlockId(id) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get block by ID -await fcl.send([fcl.getBlock(), fcl.atBlockId('23232323232')]).then(fcl.decode); +await fcl.send([fcl.getBlock(), fcl.atBlockId("23232323232")]).then(fcl.decode); // Get account at specific block ID -await fcl - .send([ - fcl.getAccount('0x1d007d755706c469'), - fcl.atBlockId( - '9dda5f281897389b99f103a1c6b180eec9dac870de846449a302103ce38453f3', - ), - ]) - .then(fcl.decode); +await fcl.send([ + fcl.getAccount("0x1d007d755706c469"), + fcl.atBlockId("9dda5f281897389b99f103a1c6b180eec9dac870de846449a302103ce38453f3") +]).then(fcl.decode); // Execute script at specific block -await fcl - .send([ - fcl.script` +await fcl.send([ + fcl.script` access(all) fun main(): UFix64 { return getCurrentBlock().timestamp } `, - fcl.atBlockId('a1b2c3d4e5f6'), - ]) - .then(fcl.decode); + fcl.atBlockId("a1b2c3d4e5f6") +]).then(fcl.decode); ``` ## Parameters -### `id` +### `id` + - Type: `string` - Description: The ID of the block to execute the interaction at + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A partial interaction to be paired with another interaction such as 'fcl.getBlock()' or 'fcl.getAccount()' ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/atLatestBlock.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/atLatestBlock.md index 5ef8a649ee..975ca324fb 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/atLatestBlock.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/atLatestBlock.md @@ -1,9 +1,9 @@ --- -title: 'atLatestBlock' -description: 'atLatestBlock function documentation.' +title: "atLatestBlock" +description: "atLatestBlock function documentation." --- - + # atLatestBlock @@ -20,23 +20,23 @@ Block finality determines whether you get the latest executed block or the lates You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.atLatestBlock(isSealed); +sdk.atLatestBlock(isSealed) ``` Or import directly the specific function: ```typescript -import { atLatestBlock } from '@onflow/sdk'; +import { atLatestBlock } from "@onflow/sdk" -atLatestBlock(isSealed); +atLatestBlock(isSealed) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get latest executed block (soft finality) await fcl.send([fcl.getBlock(), fcl.atLatestBlock()]).then(fcl.decode); @@ -45,38 +45,40 @@ await fcl.send([fcl.getBlock(), fcl.atLatestBlock()]).then(fcl.decode); await fcl.send([fcl.getBlock(), fcl.atLatestBlock(true)]).then(fcl.decode); // Get account from latest sealed block -await fcl - .send([fcl.getAccount('0x1d007d755706c469'), fcl.atLatestBlock(true)]) - .then(fcl.decode); +await fcl.send([ + fcl.getAccount("0x1d007d755706c469"), + fcl.atLatestBlock(true) +]).then(fcl.decode); // Execute script against latest executed block -await fcl - .send([ - fcl.script` +await fcl.send([ + fcl.script` access(all) fun main(): UFix64 { return getCurrentBlock().height } `, - fcl.atLatestBlock(), - ]) - .then(fcl.decode); + fcl.atLatestBlock() +]).then(fcl.decode); ``` ## Parameters ### `isSealed` (optional) + - Type: `boolean` - Description: Block finality state, defaults to latest executed block ("soft-finality"), set to true for sealed blocks ("hard-finality") + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes a partial interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/authorization.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/authorization.md index 5f592bf02d..e02a052cc2 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/authorization.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/authorization.md @@ -1,9 +1,9 @@ --- -title: 'authorization' -description: 'authorization function documentation.' +title: "authorization" +description: "authorization function documentation." --- - + # authorization @@ -18,41 +18,41 @@ Read more about [authorization functions](https://docs.onflow.org/fcl/reference/ You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.authorization(addr, signingFunction, keyId, sequenceNum); +sdk.authorization(addr, signingFunction, keyId, sequenceNum) ``` Or import directly the specific function: ```typescript -import { authorization } from '@onflow/sdk'; +import { authorization } from "@onflow/sdk" -authorization(addr, signingFunction, keyId, sequenceNum); +authorization(addr, signingFunction, keyId, sequenceNum) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; -import { ec as EC } from 'elliptic'; +import * as fcl from "@onflow/fcl"; +import { ec as EC } from "elliptic"; // Create a signing function const signingFunction = ({ message }) => { // Your signing logic here return { - addr: '0x123456789abcdef0', + addr: "0x123456789abcdef0", keyId: 0, - signature: 'your_signature_here', + signature: "your_signature_here" }; }; // Create authorization const authz = fcl.authorization( - '0x123456789abcdef0', // account address - signingFunction, // signing function - 0, // key ID - 42, // sequence number + "0x123456789abcdef0", // account address + signingFunction, // signing function + 0, // key ID + 42 // sequence number ); // Use in transaction @@ -60,45 +60,49 @@ await fcl.mutate({ cadence: `transaction { prepare(acct: AuthAccount) {} }`, proposer: authz, payer: authz, - authorizations: [authz], + authorizations: [authz] }); ``` ## Parameters -### `addr` +### `addr` + - Type: `string` - Description: The address of the account that will sign the transaction -### `signingFunction` +### `signingFunction` -- Type: +- Type: ```typescript type SigningFn = ( - signable?: SignableMessage, -) => SigningResult | Promise; + signable?: SignableMessage +) => SigningResult | Promise ``` - - Description: A function that produces signatures for the account ### `keyId` (optional) + - Type: `string | number` - Description: The index of the key to use for signing (optional) ### `sequenceNum` (optional) + - Type: `number` - Description: The sequence number for the account key (optional) + ## Returns ```typescript -Partial; +Partial ``` + A partial interaction account object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/authorizations.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/authorizations.md index 873cada177..c03d41b052 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/authorizations.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/authorizations.md @@ -1,9 +1,9 @@ --- -title: 'authorizations' -description: 'authorizations function documentation.' +title: "authorizations" +description: "authorizations function documentation." --- - + # authorizations @@ -19,23 +19,23 @@ Read more about [transaction roles](https://docs.onflow.org/concepts/transaction You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.authorizations(ax); +sdk.authorizations(ax) ``` Or import directly the specific function: ```typescript -import { authorizations } from '@onflow/sdk'; +import { authorizations } from "@onflow/sdk" -authorizations(ax); +authorizations(ax) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Single authorizer (most common case) await fcl.mutate({ @@ -46,7 +46,7 @@ await fcl.mutate({ } } `, - authorizations: [fcl.authz], // Current user authorization + authorizations: [fcl.authz] // Current user authorization }); // Multiple authorizers - both accounts must approve @@ -58,7 +58,7 @@ await fcl.mutate({ } } `, - authorizations: [userOneAuthz, userTwoAuthz], + authorizations: [userOneAuthz, userTwoAuthz] }); // Using builder pattern @@ -73,7 +73,7 @@ await fcl.send([ fcl.authorizations([fcl.authz]), fcl.proposer(fcl.authz), fcl.payer(fcl.authz), - fcl.limit(100), + fcl.limit(100) ]); ``` @@ -81,24 +81,25 @@ await fcl.send([ ### `ax` (optional) -- Type: +- Type: ```typescript export type AccountAuthorization = | (AuthorizationFn & Partial) - | Partial; + | Partial ``` - - Description: An array of authorization functions that produce account authorization details + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/build.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/build.md index a9c8df270f..7491a11326 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/build.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/build.md @@ -1,9 +1,9 @@ --- -title: 'build' -description: 'build function documentation.' +title: "build" +description: "build function documentation." --- - + # build @@ -18,23 +18,23 @@ Each builder function modifies specific parts of the interaction object, such as You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.build(fns); +sdk.build(fns) ``` Or import directly the specific function: ```typescript -import { build } from '@onflow/sdk'; +import { build } from "@onflow/sdk" -build(fns); +build(fns) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Build a script interaction const scriptInteraction = await fcl.build([ @@ -43,7 +43,10 @@ const scriptInteraction = await fcl.build([ return a + b } `, - fcl.args([fcl.arg(1, fcl.t.Int), fcl.arg(2, fcl.t.Int)]), + fcl.args([ + fcl.arg(1, fcl.t.Int), + fcl.arg(2, fcl.t.Int) + ]) ]); // Build a transaction interaction @@ -55,11 +58,11 @@ const txInteraction = await fcl.build([ } } `, - fcl.args([fcl.arg('World', fcl.t.String)]), + fcl.args([fcl.arg("World", fcl.t.String)]), fcl.proposer(proposerAuthz), fcl.payer(payerAuthz), fcl.authorizations([authorizerAuthz]), - fcl.limit(100), + fcl.limit(100) ]); ``` @@ -67,13 +70,16 @@ const txInteraction = await fcl.build([ ### `fns` (optional) + - Type: `(false | InteractionBuilderFn)[]` - Description: The functions to apply to the interaction + ## Returns [`Promise`](../types#interaction) + A promise of an interaction ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getAccount.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getAccount.md index 8ac1b50abf..9eb2f9870c 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getAccount.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getAccount.md @@ -1,9 +1,9 @@ --- -title: 'getAccount' -description: 'getAccount function documentation.' +title: "getAccount" +description: "getAccount function documentation." --- - + # getAccount @@ -18,23 +18,23 @@ Account address is a unique account identifier. Be mindful about the '0x' prefix You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.getAccount(addr); +sdk.getAccount(addr) ``` Or import directly the specific function: ```typescript -import { getAccount } from '@onflow/sdk'; +import { getAccount } from "@onflow/sdk" -getAccount(addr); +getAccount(addr) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // somewhere in an async function // fcl.account is the same as this function @@ -46,18 +46,21 @@ const getAccount = async (address) => { ## Parameters -### `addr` +### `addr` + - Type: `string` + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getBlock.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getBlock.md index 496565a6da..8f23df0ce0 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getBlock.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getBlock.md @@ -1,9 +1,9 @@ --- -title: 'getBlock' -description: 'getBlock function documentation.' +title: "getBlock" +description: "getBlock function documentation." --- - + # getBlock @@ -22,46 +22,47 @@ Block height expresses the height of the block on the chain. The latest block he You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.getBlock(isSealed); +sdk.getBlock(isSealed) ``` Or import directly the specific function: ```typescript -import { getBlock } from '@onflow/sdk'; +import { getBlock } from "@onflow/sdk" -getBlock(isSealed); +getBlock(isSealed) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; -const latestSealedBlock = await fcl - .send([ - fcl.getBlock(true), // isSealed = true - ]) - .then(fcl.decode); +const latestSealedBlock = await fcl.send([ + fcl.getBlock(true) // isSealed = true +]).then(fcl.decode); ``` ## Parameters ### `isSealed` (optional) + - Type: `boolean` - Description: If the latest block should be sealed or not. See block states + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getBlockHeader.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getBlockHeader.md index c55ba7da99..6ee9bc5020 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getBlockHeader.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getBlockHeader.md @@ -1,9 +1,9 @@ --- -title: 'getBlockHeader' -description: 'getBlockHeader function documentation.' +title: "getBlockHeader" +description: "getBlockHeader function documentation." --- - + # getBlockHeader @@ -20,59 +20,63 @@ Use with 'fcl.atBlockId()' and 'fcl.atBlockHeight()' when building the interacti You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.getBlockHeader(isSealed); +sdk.getBlockHeader(isSealed) ``` Or import directly the specific function: ```typescript -import { getBlockHeader } from '@onflow/sdk'; +import { getBlockHeader } from "@onflow/sdk" -getBlockHeader(isSealed); +getBlockHeader(isSealed) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get latest sealed block header -const sealedHeader = await fcl - .send([fcl.getBlockHeader(true)]) - .then(fcl.decode); +const sealedHeader = await fcl.send([ + fcl.getBlockHeader(true) +]).then(fcl.decode); -console.log('Block height:', sealedHeader.height); -console.log('Block timestamp:', sealedHeader.timestamp); -console.log('Parent block ID:', sealedHeader.parentId); +console.log("Block height:", sealedHeader.height); +console.log("Block timestamp:", sealedHeader.timestamp); +console.log("Parent block ID:", sealedHeader.parentId); // Get header for specific block -const blockHeader = await fcl - .send([fcl.getBlockHeader(), fcl.atBlockHeight(12345)]) - .then(fcl.decode); +const blockHeader = await fcl.send([ + fcl.getBlockHeader(), + fcl.atBlockHeight(12345) +]).then(fcl.decode); // Get latest finalized block header -const finalizedHeader = await fcl - .send([fcl.getBlockHeader(false)]) - .then(fcl.decode); +const finalizedHeader = await fcl.send([ + fcl.getBlockHeader(false) +]).then(fcl.decode); ``` ## Parameters ### `isSealed` (optional) + - Type: `boolean` - Description: Block finality state, true for sealed blocks, false for finalized blocks, null for latest + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getCollection.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getCollection.md index f78204c71a..8c8a6e7cee 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getCollection.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getCollection.md @@ -1,9 +1,9 @@ --- -title: 'getCollection' -description: 'getCollection function documentation.' +title: "getCollection" +description: "getCollection function documentation." --- - + # getCollection @@ -20,43 +20,39 @@ The collection ID provided must be from the current spork. Collections from past You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.getCollection(id); +sdk.getCollection(id) ``` Or import directly the specific function: ```typescript -import { getCollection } from '@onflow/sdk'; +import { getCollection } from "@onflow/sdk" -getCollection(id); +getCollection(id) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get a collection and see what transactions it contains -const collection = await fcl - .send([ - fcl.getCollection( - 'cccdb0c67d015dc7f6444e8f62a3244ed650215ed66b90603006c70c5ef1f6e5', - ), - ]) - .then(fcl.decode); - -console.log('Collection ID:', collection.id); -console.log('Transaction IDs:', collection.transactionIds); -console.log('Total transactions:', collection.transactionIds.length); +const collection = await fcl.send([ + fcl.getCollection("cccdb0c67d015dc7f6444e8f62a3244ed650215ed66b90603006c70c5ef1f6e5") +]).then(fcl.decode); + +console.log("Collection ID:", collection.id); +console.log("Transaction IDs:", collection.transactionIds); +console.log("Total transactions:", collection.transactionIds.length); // Process each transaction in the collection for (const txId of collection.transactionIds) { - const transaction = await fcl - .send([fcl.getTransaction(txId)]) - .then(fcl.decode); - console.log('Transaction:', transaction); + const transaction = await fcl.send([ + fcl.getTransaction(txId) + ]).then(fcl.decode); + console.log("Transaction:", transaction); } ``` @@ -64,16 +60,19 @@ for (const txId of collection.transactionIds) { ### `id` (optional) + - Type: `string` + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getEvents.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getEvents.md index f53f650e32..e8a41e2bc2 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getEvents.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getEvents.md @@ -1,9 +1,9 @@ --- -title: 'getEvents' -description: 'getEvents function documentation.' +title: "getEvents" +description: "getEvents function documentation." --- - + # getEvents @@ -17,63 +17,66 @@ This function queries for events of a specific type within a range of block heig You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.getEvents(eventType, start, end); +sdk.getEvents(eventType, start, end) ``` Or import directly the specific function: ```typescript -import { getEvents } from '@onflow/sdk'; +import { getEvents } from "@onflow/sdk" -getEvents(eventType, start, end); +getEvents(eventType, start, end) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get FlowToken transfer events from blocks 1000 to 2000 -const events = await fcl - .send([ - fcl.getEvents('A.1654653399040a61.FlowToken.TokensDeposited', 1000, 2000), - ]) - .then(fcl.decode); - -console.log('Found events:', events.length); -events.forEach((event) => { - console.log('Event data:', event.data); - console.log('Transaction ID:', event.transactionId); +const events = await fcl.send([ + fcl.getEvents("A.1654653399040a61.FlowToken.TokensDeposited", 1000, 2000) +]).then(fcl.decode); + +console.log("Found events:", events.length); +events.forEach(event => { + console.log("Event data:", event.data); + console.log("Transaction ID:", event.transactionId); }); ``` ## Parameters -### `eventType` +### `eventType` + - Type: `string` - Description: The type of event to get (e.g., "A.1654653399040a61.FlowToken.TokensWithdrawn") -### `start` +### `start` + - Type: `number` - Description: The start block height to query from -### `end` +### `end` + - Type: `number` - Description: The end block height to query to + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getEventsAtBlockHeightRange.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getEventsAtBlockHeightRange.md index 668952a47d..94a766b562 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getEventsAtBlockHeightRange.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getEventsAtBlockHeightRange.md @@ -1,9 +1,9 @@ --- -title: 'getEventsAtBlockHeightRange' -description: 'getEventsAtBlockHeightRange function documentation.' +title: "getEventsAtBlockHeightRange" +description: "getEventsAtBlockHeightRange function documentation." --- - + # getEventsAtBlockHeightRange @@ -24,31 +24,31 @@ Block height range expresses the height of the start and end block in the chain. You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.getEventsAtBlockHeightRange(eventType, startHeight, endHeight); +sdk.getEventsAtBlockHeightRange(eventType, startHeight, endHeight) ``` Or import directly the specific function: ```typescript -import { getEventsAtBlockHeightRange } from '@onflow/sdk'; +import { getEventsAtBlockHeightRange } from "@onflow/sdk" -getEventsAtBlockHeightRange(eventType, startHeight, endHeight); +getEventsAtBlockHeightRange(eventType, startHeight, endHeight) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get events at block height range await fcl .send([ fcl.getEventsAtBlockHeightRange( - 'A.7e60df042a9c0868.FlowToken.TokensWithdrawn', // event name + "A.7e60df042a9c0868.FlowToken.TokensWithdrawn", // event name 35580624, // block to start looking for events at - 35580624, // block to stop looking for events at + 35580624 // block to stop looking for events at ), ]) .then(fcl.decode); @@ -56,29 +56,34 @@ await fcl ## Parameters -### `eventType` +### `eventType` + - Type: `string` - Description: The type of event to get -### `startHeight` +### `startHeight` + - Type: `number` - Description: The height of the block to start looking for events (inclusive) -### `endHeight` +### `endHeight` + - Type: `number` - Description: The height of the block to stop looking for events (inclusive) + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getEventsAtBlockIds.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getEventsAtBlockIds.md index 38b755f319..d2ad215452 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getEventsAtBlockIds.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getEventsAtBlockIds.md @@ -1,9 +1,9 @@ --- -title: 'getEventsAtBlockIds' -description: 'getEventsAtBlockIds function documentation.' +title: "getEventsAtBlockIds" +description: "getEventsAtBlockIds function documentation." --- - + # getEventsAtBlockIds @@ -20,54 +20,56 @@ Please read more about [events in the documentation](https://docs.onflow.org/cad You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.getEventsAtBlockIds(eventType, blockIds); +sdk.getEventsAtBlockIds(eventType, blockIds) ``` Or import directly the specific function: ```typescript -import { getEventsAtBlockIds } from '@onflow/sdk'; +import { getEventsAtBlockIds } from "@onflow/sdk" -getEventsAtBlockIds(eventType, blockIds); +getEventsAtBlockIds(eventType, blockIds) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; - -const events = await fcl - .send([ - fcl.getEventsAtBlockIds('A.7e60df042a9c0868.FlowToken.TokensWithdrawn', [ - 'c4f239d49e96d1e5fbcf1f31027a6e582e8c03fcd9954177b7723fdb03d938c7', - '5dbaa85922eb194a3dc463c946cc01c866f2ff2b88f3e59e21c0d8d00113273f', - ]), +import * as fcl from "@onflow/fcl"; + +const events = await fcl.send([ + fcl.getEventsAtBlockIds("A.7e60df042a9c0868.FlowToken.TokensWithdrawn", [ + "c4f239d49e96d1e5fbcf1f31027a6e582e8c03fcd9954177b7723fdb03d938c7", + "5dbaa85922eb194a3dc463c946cc01c866f2ff2b88f3e59e21c0d8d00113273f" ]) - .then(fcl.decode); +]).then(fcl.decode); ``` ## Parameters -### `eventType` +### `eventType` + - Type: `string` - Description: The type of event to get -### `blockIds` +### `blockIds` + - Type: `string[]` - Description: The ids of the blocks to scan for events + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getNetworkParameters.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getNetworkParameters.md index 7e91370284..0588265fae 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getNetworkParameters.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getNetworkParameters.md @@ -1,9 +1,9 @@ --- -title: 'getNetworkParameters' -description: 'getNetworkParameters function documentation.' +title: "getNetworkParameters" +description: "getNetworkParameters function documentation." --- - + # getNetworkParameters @@ -18,46 +18,50 @@ This information is crucial for ensuring transactions are submitted to the corre You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.getNetworkParameters(); +sdk.getNetworkParameters() ``` Or import directly the specific function: ```typescript -import { getNetworkParameters } from '@onflow/sdk'; +import { getNetworkParameters } from "@onflow/sdk" -getNetworkParameters(); +getNetworkParameters() ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get network parameters to verify chain ID -const params = await fcl.send([fcl.getNetworkParameters()]).then(fcl.decode); +const params = await fcl.send([ + fcl.getNetworkParameters() +]).then(fcl.decode); -console.log('Chain ID:', params.chainId); -console.log('Network:', params.name); +console.log("Chain ID:", params.chainId); +console.log("Network:", params.name); // Use this to verify you're connected to the right network -if (params.chainId === 'flow-mainnet') { - console.log('Connected to Flow Mainnet'); -} else if (params.chainId === 'flow-testnet') { - console.log('Connected to Flow Testnet'); +if (params.chainId === "flow-mainnet") { + console.log("Connected to Flow Mainnet"); +} else if (params.chainId === "flow-testnet") { + console.log("Connected to Flow Testnet"); } ``` + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getNodeVersionInfo.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getNodeVersionInfo.md index 5926e2a436..fd9e57721d 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getNodeVersionInfo.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getNodeVersionInfo.md @@ -1,9 +1,9 @@ --- -title: 'getNodeVersionInfo' -description: 'getNodeVersionInfo function documentation.' +title: "getNodeVersionInfo" +description: "getNodeVersionInfo function documentation." --- - + # getNodeVersionInfo @@ -19,46 +19,50 @@ Consider using the pre-built interaction 'fcl.nodeVersionInfo()' if you do not n You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.getNodeVersionInfo(); +sdk.getNodeVersionInfo() ``` Or import directly the specific function: ```typescript -import { getNodeVersionInfo } from '@onflow/sdk'; +import { getNodeVersionInfo } from "@onflow/sdk" -getNodeVersionInfo(); +getNodeVersionInfo() ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Get node version information using builder -const versionInfo = await fcl.send([fcl.getNodeVersionInfo()]).then(fcl.decode); +const versionInfo = await fcl.send([ + fcl.getNodeVersionInfo() +]).then(fcl.decode); -console.log('Node version:', versionInfo.semver); -console.log('Protocol version:', versionInfo.protocol_version); -console.log('Spork ID:', versionInfo.spork_id); +console.log("Node version:", versionInfo.semver); +console.log("Protocol version:", versionInfo.protocol_version); +console.log("Spork ID:", versionInfo.spork_id); // Use with other builders if needed const interaction = await fcl.build([ - fcl.getNodeVersionInfo(), + fcl.getNodeVersionInfo() // other builders can be added here ]); ``` + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getTransaction.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getTransaction.md index 120f440b19..39aab83f82 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getTransaction.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getTransaction.md @@ -3,7 +3,7 @@ title: "getTransaction" description: "getTransaction function documentation." --- - + # getTransaction diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getTransactionStatus.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getTransactionStatus.md index abb37f634b..77654aa64e 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/getTransactionStatus.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/getTransactionStatus.md @@ -1,9 +1,9 @@ --- -title: 'getTransactionStatus' -description: 'getTransactionStatus function documentation.' +title: "getTransactionStatus" +description: "getTransactionStatus function documentation." --- - + # getTransactionStatus @@ -18,48 +18,47 @@ Consider using 'fcl.tx(id)' instead of calling this method directly for real-tim You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.getTransactionStatus(transactionId); +sdk.getTransactionStatus(transactionId) ``` Or import directly the specific function: ```typescript -import { getTransactionStatus } from '@onflow/sdk'; +import { getTransactionStatus } from "@onflow/sdk" -getTransactionStatus(transactionId); +getTransactionStatus(transactionId) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; - -const status = await fcl - .send([ - fcl.getTransactionStatus( - '9dda5f281897389b99f103a1c6b180eec9dac870de846449a302103ce38453f3', - ), - ]) - .then(fcl.decode); +import * as fcl from "@onflow/fcl"; + +const status = await fcl.send([ + fcl.getTransactionStatus("9dda5f281897389b99f103a1c6b180eec9dac870de846449a302103ce38453f3") +]).then(fcl.decode); ``` ## Parameters -### `transactionId` +### `transactionId` + - Type: `string` - Description: The id of the transaction to get the status of + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/index.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/index.md index 517d6e0f83..a91ed49f93 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/index.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/index.md @@ -1,6 +1,6 @@ --- -title: '@onflow/sdk' -description: 'Low-level JavaScript/TypeScript SDK for interacting with the Flow blockchain.' +title: "@onflow/sdk" +description: "Low-level JavaScript/TypeScript SDK for interacting with the Flow blockchain." --- @@ -34,13 +34,13 @@ yarn add @onflow/sdk You can import the entire package: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" ``` Or import specific functions: ```typescript -import { functionName } from '@onflow/sdk'; +import { functionName } from "@onflow/sdk" ``` ## Connect @@ -50,11 +50,11 @@ By default, the library uses HTTP to communicate with the access nodes and it mu Example: ```typescript -import { config } from '@onflow/fcl'; +import { config } from "@onflow/fcl" config({ - 'accessNode.api': 'https://rest-testnet.onflow.org', -}); + "accessNode.api": "https://rest-testnet.onflow.org" +}) ``` ## Querying the Flow Network @@ -93,7 +93,7 @@ A proposal key contains three fields: - Key index - Sequence number -A transaction is only valid if its declared sequence number matches the current onchain sequence number for that key. The sequence number increments by one after the transaction is executed. +A transaction is only valid if its declared sequence number matches the current on-chain sequence number for that key. The sequence number increments by one after the transaction is executed. **Payer** is the account that pays the fees for the transaction. A transaction must specify exactly one payer. The payer is only responsible for paying the network and gas fees; the transaction is not authorized to access resources or code stored in the payer account. @@ -200,4 +200,4 @@ This section contains documentation for all of the functions and namespaces in t - [voucherToTxId](./voucherToTxId.md) - Converts a voucher object to a transaction ID. This function computes the... - [why](./why.md) - Returns the reason for an interaction failure. ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/limit.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/limit.md index dd69229789..08cd474ccc 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/limit.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/limit.md @@ -1,9 +1,9 @@ --- -title: 'limit' -description: 'limit function documentation.' +title: "limit" +description: "limit function documentation." --- - + # limit @@ -19,23 +19,23 @@ Read more about [computation cost](https://docs.onflow.org/concepts/fees/#comput You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.limit(limit); +sdk.limit(limit) ``` Or import directly the specific function: ```typescript -import { limit } from '@onflow/sdk'; +import { limit } from "@onflow/sdk" -limit(limit); +limit(limit) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; await fcl.mutate({ cadence: ` @@ -45,7 +45,7 @@ await fcl.mutate({ } } `, - limit: 1000, // Set compute limit to 1000 + limit: 1000 // Set compute limit to 1000 }); // Using builder pattern @@ -57,25 +57,28 @@ await fcl.send([ } } `, - fcl.limit(9999), // Set higher limit for complex operations + fcl.limit(9999) // Set higher limit for complex operations ]); ``` ## Parameters -### `limit` +### `limit` + - Type: `number` - Description: The maximum amount of computation for the transaction + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/payer.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/payer.md index fc4b43e0c9..2c76746908 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/payer.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/payer.md @@ -1,9 +1,9 @@ --- -title: 'payer' -description: 'payer function documentation.' +title: "payer" +description: "payer function documentation." --- - + # payer @@ -21,23 +21,23 @@ Read more about [transaction roles](https://docs.onflow.org/concepts/transaction You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.payer(ax); +sdk.payer(ax) ``` Or import directly the specific function: ```typescript -import { payer } from '@onflow/sdk'; +import { payer } from "@onflow/sdk" -payer(ax); +payer(ax) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Using current user as payer (most common case) await fcl.mutate({ @@ -48,7 +48,7 @@ await fcl.mutate({ } } `, - payer: fcl.authz, // Current user as payer + payer: fcl.authz // Current user as payer }); // Using custom payer with builder pattern @@ -60,9 +60,9 @@ await fcl.send([ } } `, - fcl.proposer(fcl.authz), // Current user as proposer + fcl.proposer(fcl.authz), // Current user as proposer fcl.authorizations([fcl.authz]), // Current user as authorizer - fcl.payer(customPayerAuthz), // Custom payer pays fees + fcl.payer(customPayerAuthz) // Custom payer pays fees ]); // Multiple payers (advanced use case) @@ -74,7 +74,7 @@ await fcl.send([ } } `, - fcl.payer([payerAuthz1, payerAuthz2]), // Multiple payers split fees + fcl.payer([payerAuthz1, payerAuthz2]) // Multiple payers split fees ]); ``` @@ -82,24 +82,25 @@ await fcl.send([ ### `ax` (optional) -- Type: +- Type: ```typescript export type AccountAuthorization = | (AuthorizationFn & Partial) - | Partial; + | Partial ``` - - Description: An account address or an array of account addresses + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that takes an interaction object and returns a new interaction object with the payer(s) added ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/ping.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/ping.md index bc59cfc69a..3baa8cb73a 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/ping.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/ping.md @@ -1,9 +1,9 @@ --- -title: 'ping' -description: 'ping function documentation.' +title: "ping" +description: "ping function documentation." --- - + # ping @@ -16,58 +16,56 @@ The ping interaction is a simple way to test if the Flow Access Node is reachabl You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.ping(); +sdk.ping() ``` Or import directly the specific function: ```typescript -import { ping } from '@onflow/sdk'; +import { ping } from "@onflow/sdk" -ping(); +ping() ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Simple ping to test connectivity try { const response = await fcl.send([fcl.ping()]); - console.log('Access Node is reachable'); + console.log("Access Node is reachable"); } catch (error) { - console.error('Access Node is not reachable:', error); + console.error("Access Node is not reachable:", error); } // Use ping for health checks const healthCheck = async () => { try { await fcl.send([fcl.ping()]); - return { status: 'healthy', timestamp: new Date().toISOString() }; + return { status: "healthy", timestamp: new Date().toISOString() }; } catch (error) { - return { - status: 'unhealthy', - error: error.message, - timestamp: new Date().toISOString(), - }; + return { status: "unhealthy", error: error.message, timestamp: new Date().toISOString() }; } }; const health = await healthCheck(); -console.log('Health status:', health); +console.log("Health status:", health); ``` + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/proposer.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/proposer.md index e4df768783..43882d9fb0 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/proposer.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/proposer.md @@ -1,9 +1,9 @@ --- -title: 'proposer' -description: 'proposer function documentation.' +title: "proposer" +description: "proposer function documentation." --- - + # proposer @@ -21,23 +21,23 @@ Read more about [transaction roles](https://docs.onflow.org/concepts/transaction You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.proposer(authz); +sdk.proposer(authz) ``` Or import directly the specific function: ```typescript -import { proposer } from '@onflow/sdk'; +import { proposer } from "@onflow/sdk" -proposer(authz); +proposer(authz) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Using the current user as proposer await fcl.mutate({ @@ -48,7 +48,7 @@ await fcl.mutate({ } } `, - proposer: fcl.authz, + proposer: fcl.authz }); // Using builder pattern @@ -63,28 +63,29 @@ await fcl.send([ fcl.proposer(proposerAuthz), fcl.payer(payerAuthz), fcl.authorizations([authorizerAuthz]), - fcl.limit(100), + fcl.limit(100) ]); ``` ## Parameters -### `authz` +### `authz` -- Type: +- Type: ```typescript export type AccountAuthorization = | (AuthorizationFn & Partial) - | Partial; + | Partial ``` - - Description: The authorization object for the proposer + ## Returns [`Interaction`](../types#interaction) + A function that takes an interaction object and returns a new interaction object with the proposer added ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/ref.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/ref.md index 8258ae4d6b..216e335c93 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/ref.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/ref.md @@ -1,9 +1,9 @@ --- -title: 'ref' -description: 'ref function documentation.' +title: "ref" +description: "ref function documentation." --- - + # ref @@ -17,23 +17,23 @@ A transaction will be rejected if it is submitted past its expiry block. Flow ca You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.ref(refBlock); +sdk.ref(refBlock) ``` Or import directly the specific function: ```typescript -import { ref } from '@onflow/sdk'; +import { ref } from "@onflow/sdk" -ref(refBlock); +ref(refBlock) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Set specific reference block for transaction await fcl.send([ @@ -44,11 +44,11 @@ await fcl.send([ } } `, - fcl.ref('a1b2c3d4e5f6789...'), // Custom reference block ID + fcl.ref("a1b2c3d4e5f6789..."), // Custom reference block ID fcl.proposer(fcl.authz), fcl.payer(fcl.authz), fcl.authorizations([fcl.authz]), - fcl.limit(100), + fcl.limit(100) ]); // Usually, you don't need to set reference block manually @@ -57,19 +57,22 @@ await fcl.send([ ## Parameters -### `refBlock` +### `refBlock` + - Type: `string` - Description: The reference block ID + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/script.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/script.md index 5154c842cd..0cd71155d6 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/script.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/script.md @@ -1,9 +1,9 @@ --- -title: 'script' -description: 'script function documentation.' +title: "script" +description: "script function documentation." --- - + # script @@ -22,23 +22,23 @@ Block height expresses the height of the block in the chain. You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.script(args); +sdk.script(args) ``` Or import directly the specific function: ```typescript -import { script } from '@onflow/sdk'; +import { script } from "@onflow/sdk" -script(args); +script(args) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; const result = await fcl.query({ cadence: ` @@ -50,7 +50,7 @@ const result = await fcl.query({ args: (arg, t) => [ arg(7, t.Int), // a: Int arg(6, t.Int), // b: Int - arg('0xba1132bc08f82fe2', t.Address), // addr: Address + arg("0xba1132bc08f82fe2", t.Address), // addr: Address ], }); @@ -61,22 +61,23 @@ console.log(result); // 13 ### `args` (optional) -- Type: +- Type: ```typescript [string | TemplateStringsArray | ((x?: unknown) => string), ...unknown[]] ``` - - Description: The arguments to pass to the template + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribe.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribe.md index b39b2589c9..09369c0a7a 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribe.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribe.md @@ -74,11 +74,14 @@ blockSubscription.unsubscribe(); ### `subscribeParams` +- Type: `SubscribeParams` -- Type: -```typescript -SubscribeParams -``` +#### Properties: + +- **`topic`** - Type: `T` - The topic to subscribe to. +- **`args`** - Type: `SubscriptionArgs` - The arguments for the subscription. +- **`onData`** - Type: `(data: SubscriptionData) => void` - The callback to call when data is received. +- **`onError`** - Type: `(error: Error) => void` - The callback to call when a fatal error occurs. ### `opts` (optional) diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribeEvents.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribeEvents.md index 2cae9b239b..f856df1a48 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribeEvents.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribeEvents.md @@ -1,9 +1,9 @@ --- -title: 'subscribeEvents' -description: 'subscribeEvents function documentation.' +title: "subscribeEvents" +description: "subscribeEvents function documentation." --- - + # subscribeEvents @@ -20,42 +20,42 @@ Subscriptions allow you to listen for these events in real-time without polling. You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.subscribeEvents(eventFilter); +sdk.subscribeEvents(eventFilter) ``` Or import directly the specific function: ```typescript -import { subscribeEvents } from '@onflow/sdk'; +import { subscribeEvents } from "@onflow/sdk" -subscribeEvents(eventFilter); +subscribeEvents(eventFilter) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Subscribe to FlowToken transfer events const subscription = await fcl.send([ fcl.subscribeEvents({ eventTypes: [ - 'A.1654653399040a61.FlowToken.TokensWithdrawn', - 'A.1654653399040a61.FlowToken.TokensDeposited', + "A.1654653399040a61.FlowToken.TokensWithdrawn", + "A.1654653399040a61.FlowToken.TokensDeposited" ], startHeight: 1000000, // Start from specific block height - heartbeatInterval: 3000, // 3 second heartbeat - }), + heartbeatInterval: 3000 // 3 second heartbeat + }) ]); // Subscribe to events from specific contracts const contractSubscription = await fcl.send([ fcl.subscribeEvents({ - contracts: ['FlowToken', 'FungibleToken'], - addresses: ['0x1654653399040a61'], - }), + contracts: ["FlowToken", "FungibleToken"], + addresses: ["0x1654653399040a61"] + }) ]); // Handle the subscription data elsewhere using fcl.subscribe() @@ -63,18 +63,21 @@ const contractSubscription = await fcl.send([ ## Parameters -### `eventFilter` +### `eventFilter` + - Type: [`EventFilter`](../types#eventfilter) + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribeRaw.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribeRaw.md index 61e9f69b93..967f8bcf67 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribeRaw.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribeRaw.md @@ -76,11 +76,14 @@ rawSubscription.unsubscribe(); ### `subscribeRawParams` +- Type: `SubscribeRawParams` -- Type: -```typescript -SubscribeRawParams -``` +#### Properties: + +- **`topic`** - Type: `T` - The topic to subscribe to. +- **`args`** - Type: `SubscriptionArgs` - The arguments for the subscription. +- **`onData`** - Type: `(data: RawSubscriptionData) => void` - The callback to call when data is received. +- **`onError`** - Type: `(error: Error) => void` - The callback to call when a fatal error occurs. ### `opts` (optional) diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/transaction.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/transaction.md index 56034b76e4..c291e20e35 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/transaction.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/transaction.md @@ -1,9 +1,9 @@ --- -title: 'transaction' -description: 'transaction function documentation.' +title: "transaction" +description: "transaction function documentation." --- - + # transaction @@ -16,23 +16,23 @@ Flow supports great flexibility when it comes to transaction signing, we can def You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.transaction(args); +sdk.transaction(args) ``` Or import directly the specific function: ```typescript -import { transaction } from '@onflow/sdk'; +import { transaction } from "@onflow/sdk" -transaction(args); +transaction(args) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl" // Basic transaction usage await fcl.mutate({ @@ -44,9 +44,11 @@ await fcl.mutate({ } } `, - args: (arg, t) => [arg(6, t.Int)], - limit: 50, -}); + args: (arg, t) => [ + arg(6, t.Int) + ], + limit: 50 +}) // Single party, single signature // Proposer, payer and authorizer are the same account @@ -58,7 +60,7 @@ await fcl.mutate({ `, authz: currentUser, // Optional. Will default to currentUser if not provided. limit: 50, -}); +}) // Multiple parties // Proposer and authorizer are the same account, but different payer @@ -72,29 +74,30 @@ await fcl.mutate({ payer: authzTwoFn, authorizations: [authzFn], limit: 50, -}); +}) ``` ## Parameters ### `args` (optional) -- Type: +- Type: ```typescript [string | TemplateStringsArray, ...any[]] ``` - - Description: The arguments to pass to the template + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/validator.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/validator.md index 183bdc4270..5781f7d40e 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/validator.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/validator.md @@ -1,9 +1,9 @@ --- -title: 'validator' -description: 'validator function documentation.' +title: "validator" +description: "validator function documentation." --- - + # validator @@ -18,28 +18,28 @@ and wasted compute costs. You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.validator(cb); +sdk.validator(cb) ``` Or import directly the specific function: ```typescript -import { validator } from '@onflow/sdk'; +import { validator } from "@onflow/sdk" -validator(cb); +validator(cb) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Custom validator to ensure account has sufficient balance const validateBalance = (ix) => { if (ix.message.computeLimit > 1000) { - throw new Error('Compute limit too high for this account'); + throw new Error("Compute limit too high for this account"); } return ix; }; @@ -53,25 +53,28 @@ await fcl.send([ } `, fcl.validator(validateBalance), - fcl.limit(500), // This will pass validation + fcl.limit(500) // This will pass validation ]); ``` ## Parameters -### `cb` +### `cb` + - Type: `Function` - Description: The validator function that takes an interaction and returns it (or throws an error if invalid) + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/voucherIntercept.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/voucherIntercept.md index 0c620529c9..10c8d18119 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/voucherIntercept.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/voucherIntercept.md @@ -1,9 +1,9 @@ --- -title: 'voucherIntercept' -description: 'voucherIntercept function documentation.' +title: "voucherIntercept" +description: "voucherIntercept function documentation." --- - + # voucherIntercept @@ -17,23 +17,23 @@ the transaction data. The voucher contains all the transaction details in their You can import the entire package and access the function: ```typescript -import * as sdk from '@onflow/sdk'; +import * as sdk from "@onflow/sdk" -sdk.voucherIntercept(fn); +sdk.voucherIntercept(fn) ``` Or import directly the specific function: ```typescript -import { voucherIntercept } from '@onflow/sdk'; +import { voucherIntercept } from "@onflow/sdk" -voucherIntercept(fn); +voucherIntercept(fn) ``` ## Usage ```typescript -import * as fcl from '@onflow/fcl'; +import * as fcl from "@onflow/fcl"; // Intercept voucher for logging await fcl.send([ @@ -45,40 +45,41 @@ await fcl.send([ } `, fcl.voucherIntercept((voucher) => { - console.log('Voucher details:', { + console.log("Voucher details:", { cadence: voucher.cadence, proposalKey: voucher.proposalKey, payer: voucher.payer, authorizers: voucher.authorizers, - computeLimit: voucher.computeLimit, + computeLimit: voucher.computeLimit }); }), fcl.proposer(fcl.authz), fcl.payer(fcl.authz), - fcl.authorizations([fcl.authz]), + fcl.authorizations([fcl.authz]) ]); ``` ## Parameters -### `fn` +### `fn` -- Type: +- Type: ```typescript -type VoucherInterceptFn = (voucher: Voucher) => any | Promise; +type VoucherInterceptFn = (voucher: Voucher) => any | Promise ``` - - Description: The function to intercept and potentially modify the voucher + ## Returns ```typescript export type InteractionBuilderFn = ( - ix: Interaction, -) => Interaction | Promise; + ix: Interaction +) => Interaction | Promise ``` + A function that processes an interaction object ---- +--- \ No newline at end of file From 6a483b0683e868010c2d8405c08cc2642b8b57b4 Mon Sep 17 00:00:00 2001 From: mfbz Date: Fri, 5 Sep 2025 19:15:35 +0200 Subject: [PATCH 2/2] Improved return types and formatting --- .../fcl-js/packages-docs/fcl/config.md | 13 +++- .../packages-docs/fcl/createFlowClient.md | 63 ++++++++++++++++++- .../fcl/createSignableVoucher.md | 28 ++++++++- .../fcl-js/packages-docs/fcl/events.md | 6 +- .../clients/fcl-js/packages-docs/fcl/index.md | 2 +- .../packages-docs/fcl/pluginRegistry.md | 5 +- .../fcl-js/packages-docs/fcl/subscribe.md | 5 +- .../fcl-js/packages-docs/fcl/subscribeRaw.md | 11 +++- .../fcl-js/packages-docs/fcl/transaction.md | 15 ++++- .../clients/fcl-js/packages-docs/fcl/tx.md | 15 ++++- .../fcl-js/packages-docs/sdk/config.md | 13 +++- .../packages-docs/sdk/createSdkClient.md | 28 ++++++++- .../sdk/createSignableVoucher.md | 28 ++++++++- .../packages-docs/sdk/resolveRefBlockId.md | 4 +- .../fcl-js/packages-docs/sdk/response.md | 21 ++++++- .../fcl-js/packages-docs/sdk/subscribe.md | 5 +- .../fcl-js/packages-docs/sdk/subscribeRaw.md | 11 +++- .../fcl-js/packages-docs/sdk/testUtils.md | 16 ++++- 18 files changed, 267 insertions(+), 22 deletions(-) diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/config.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/config.md index 04a3f90892..21fe3831ab 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/config.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/config.md @@ -43,7 +43,18 @@ Record ## Returns ```typescript -{ put: typeof put; get: typeof get; all: typeof all; first: typeof first; update: typeof update; delete: typeof _delete; where: typeof where; subscribe: typeof subscribe; overload: typeof overload; load: typeof load; } +{ + put: typeof put; + get: typeof get; + all: typeof all; + first: typeof first; + update: typeof update; + delete: typeof _delete; + where: typeof where; + subscribe: typeof subscribe; + overload: typeof overload; + load: typeof load; +} ``` diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/createFlowClient.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/createFlowClient.md index 0a6b30c64d..e865d9c3fd 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/createFlowClient.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/createFlowClient.md @@ -7,6 +7,7 @@ description: "createFlowClient function documentation." # createFlowClient +Creates a Flow client instance with authentication, transaction, and query capabilities. ## Import @@ -56,11 +57,71 @@ export interface FlowClientConfig { customDecoders?: any } ``` +- Description: Configuration object for the Flow client ## Returns -`Promise` +```typescript +{ + send: (args?: false | InteractionBuilderFn | (false | InteractionBuilderFn)[], opts?: any) => Promise; + subscribe: ({ + topic, args, onData, onError +}: SubscribeParams, opts?: { + node?: string; + transport?: SdkTransport; +}) => Subscription; + subscribeRaw: ({ + topic, args, onData, onError +}: SubscribeRawParams, opts?: { + node?: string; + transport?: SdkTransport; +}) => { + unsubscribe: () => void; +}; + account: (address: string, { + height, id, isSealed +}?: AccountQueryOptions, opts?: object) => Promise; + block: ({ + sealed, id, height +}?: BlockQueryOptions, opts?: object) => Promise; + resolve: (ix: Interaction) => Promise; + decode: (response: any) => Promise; + currentUser: CurrentUserServiceApi; + mutate: (opts?: MutateOptions) => Promise; + query: (opts?: QueryOptions) => Promise; + queryRaw: (opts?: QueryOptions) => Promise; + verifyUserSignatures: (message: string, compSigs: CompositeSignature[], opts?: VerifySignaturesScriptOptions) => Promise; + getChainId: (opts?: GetChainIdOptions) => Promise; + tx: { + (transactionId: string, opts?: { + pollRate?: number; + txNotFoundTimeout?: number; +}): { + snapshot: () => Promise; + subscribe: (onData: (txStatus: TransactionStatus) => void, onError?: (err: Error) => void) => () => void; + onceFinalized: () => Promise; + onceExecuted: () => Promise; + onceSealed: () => Promise; +}; + isUnknown: (ix: Interaction) => boolean; + isPending: (tx: TransactionStatus) => boolean; + isFinalized: (tx: TransactionStatus) => boolean; + isExecuted: (tx: TransactionStatus) => boolean; + isSealed: (tx: TransactionStatus) => boolean; + isExpired: (tx: TransactionStatus) => boolean; +}; + events: (filterOrType?: string | EventFilter) => { + subscribe: (onData: (event: Event) => void, onError?: (error: Error) => void) => () => void; +}; + authenticate: (opts?: AuthenticationOptions) => Promise; + unauthenticate: () => void; + signUserMessage: (msg: string) => Promise; + serialize: (args: (false | InteractionBuilderFn)[] | Interaction, opts?: SerializeOptions) => Promise; +} +``` + +A Flow client object with many methods for interacting with the Flow blockchain --- \ No newline at end of file diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/createSignableVoucher.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/createSignableVoucher.md index 19d76dced3..fedf7601c9 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/createSignableVoucher.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/createSignableVoucher.md @@ -75,7 +75,33 @@ console.log(voucher.authorizers); // List of authorizer addresses ## Returns ```typescript -{ cadence: string; refBlock: string; computeLimit: number; arguments: any[]; proposalKey: { address: string; keyId: string | number; sequenceNum: number; } | { address?: undefined; keyId?: undefined; sequenceNum?: undefined; }; payer: string; authorizers: string[]; payloadSigs: { address: string; keyId: string | number; sig: string; }[]; envelopeSigs: { address: string; keyId: string | number; sig: string; }[]; } +{ + cadence: string; + refBlock: string; + computeLimit: number; + arguments: any[]; + proposalKey: { + address: string; + keyId: string | number; + sequenceNum: number; +} | { + address?: undefined; + keyId?: undefined; + sequenceNum?: undefined; +}; + payer: string; + authorizers: string[]; + payloadSigs: { + address: string; + keyId: string | number; + sig: string; +}[]; + envelopeSigs: { + address: string; + keyId: string | number; + sig: string; +}[]; +} ``` diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/events.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/events.md index 0c2efe0a1c..7dc9e0f450 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/events.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/events.md @@ -90,7 +90,11 @@ If an EventFilter object is provided, it can contain multiple event types and ot ## Returns -`void; }` +```typescript +{ + subscribe: (onData: (event: Event) => void, onError?: (error: Error) => void) => () => void; +} +``` An object containing a subscribe method diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/index.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/index.md index 73925ceca3..82df7dd42c 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/index.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/index.md @@ -240,7 +240,7 @@ This section contains documentation for all of the functions and namespaces in t - [cadence](./cadence.md) - Creates a template function - [cdc](./cdc.md) - Creates a template function - [config](./config.md) - Sets the config -- [createFlowClient](./createFlowClient.md) +- [createFlowClient](./createFlowClient.md) - Creates a Flow client instance with authentication, transaction, and query... - [createSignableVoucher](./createSignableVoucher.md) - Creates a signable voucher object from an interaction for signing purposes. A... - [currentUser](./currentUser.md) - The main current user service for managing user authentication and authorization... - [decode](./decode.md) - Decodes the response from 'fcl.send()' into the appropriate JSON representation... diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/pluginRegistry.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/pluginRegistry.md index b443597b4b..8f3a09dcc4 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/pluginRegistry.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/pluginRegistry.md @@ -46,7 +46,10 @@ pluginRegistry.add({ ## Returns ```typescript -Readonly<{ add: (plugins: any) => void; getPlugins: () => Map; }> +Readonly<{ + add: (plugins: any) => void; + getPlugins: () => Map; +}> ``` diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/subscribe.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/subscribe.md index 11385c8ef1..c73acd0993 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/subscribe.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/subscribe.md @@ -85,7 +85,10 @@ SubscribeParams - Type: ```typescript -{ node?: string; transport?: SdkTransport; } +{ + node?: string; + transport?: SdkTransport; +} ``` - Description: Additional options for the subscription diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/subscribeRaw.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/subscribeRaw.md index f2ed470bbe..3954184f70 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/subscribeRaw.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/subscribeRaw.md @@ -87,7 +87,10 @@ SubscribeRawParams - Type: ```typescript -{ node?: string; transport?: SdkTransport; } +{ + node?: string; + transport?: SdkTransport; +} ``` - Description: Additional options for the subscription @@ -99,7 +102,11 @@ SubscribeRawParams ## Returns -`void; }` +```typescript +{ + unsubscribe: () => void; +} +``` A subscription object with an unsubscribe method diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/transaction.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/transaction.md index cd0c2499e3..693e9df68c 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/transaction.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/transaction.md @@ -102,7 +102,10 @@ Flow transaction hash (64 bytes represented as hex string). - Type: ```typescript -{ pollRate?: number; txNotFoundTimeout?: number; } +{ + pollRate?: number; + txNotFoundTimeout?: number; +} ``` - Description: Optional configuration parameters @@ -115,7 +118,15 @@ not found errors during initial transaction propagation (do not modify unless yo ## Returns -[`Promise`](../types#transactionstatus) +```typescript +{ + snapshot: () => Promise; + subscribe: (onData: (txStatus: TransactionStatus) => void, onError?: (err: Error) => void) => () => void; + onceFinalized: () => Promise; + onceExecuted: () => Promise; + onceSealed: () => Promise; +} +``` Transaction monitor object with methods for tracking transaction status diff --git a/docs/build/tools/clients/fcl-js/packages-docs/fcl/tx.md b/docs/build/tools/clients/fcl-js/packages-docs/fcl/tx.md index 44b6bc50b6..a9e4607444 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/fcl/tx.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/fcl/tx.md @@ -102,7 +102,10 @@ Flow transaction hash (64 bytes represented as hex string). - Type: ```typescript -{ pollRate?: number; txNotFoundTimeout?: number; } +{ + pollRate?: number; + txNotFoundTimeout?: number; +} ``` - Description: Optional configuration parameters @@ -115,7 +118,15 @@ not found errors during initial transaction propagation (do not modify unless yo ## Returns -[`Promise`](../types#transactionstatus) +```typescript +{ + snapshot: () => Promise; + subscribe: (onData: (txStatus: TransactionStatus) => void, onError?: (err: Error) => void) => () => void; + onceFinalized: () => Promise; + onceExecuted: () => Promise; + onceSealed: () => Promise; +} +``` Transaction monitor object with methods for tracking transaction status diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/config.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/config.md index 72e51da6e7..bd60e74342 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/config.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/config.md @@ -43,7 +43,18 @@ Record ## Returns ```typescript -{ put: typeof put; get: typeof get; all: typeof all; first: typeof first; update: typeof update; delete: typeof _delete; where: typeof where; subscribe: typeof subscribe; overload: typeof overload; load: typeof load; } +{ + put: typeof put; + get: typeof get; + all: typeof all; + first: typeof first; + update: typeof update; + delete: typeof _delete; + where: typeof where; + subscribe: typeof subscribe; + overload: typeof overload; + load: typeof load; +} ``` diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/createSdkClient.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/createSdkClient.md index bf82099e8a..ec046a97e1 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/createSdkClient.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/createSdkClient.md @@ -63,7 +63,33 @@ export interface SdkClientOptions { ## Returns -`Promise` +```typescript +{ + send: (args?: false | InteractionBuilderFn | (false | InteractionBuilderFn)[], opts?: any) => Promise; + subscribe: ({ + topic, args, onData, onError +}: SubscribeParams, opts?: { + node?: string; + transport?: SdkTransport; +}) => Subscription; + subscribeRaw: ({ + topic, args, onData, onError +}: SubscribeRawParams, opts?: { + node?: string; + transport?: SdkTransport; +}) => { + unsubscribe: () => void; +}; + account: (address: string, { + height, id, isSealed +}?: AccountQueryOptions, opts?: object) => Promise; + block: ({ + sealed, id, height +}?: BlockQueryOptions, opts?: object) => Promise; + resolve: (ix: Interaction) => Promise; + decode: (response: any) => Promise; +} +``` A client object with methods to interact with the Flow blockchain. diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/createSignableVoucher.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/createSignableVoucher.md index 54bb58e35e..da0d776b5e 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/createSignableVoucher.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/createSignableVoucher.md @@ -75,7 +75,33 @@ console.log(voucher.authorizers); // List of authorizer addresses ## Returns ```typescript -{ cadence: string; refBlock: string; computeLimit: number; arguments: any[]; proposalKey: { address: string; keyId: string | number; sequenceNum: number; } | { address?: undefined; keyId?: undefined; sequenceNum?: undefined; }; payer: string; authorizers: string[]; payloadSigs: { address: string; keyId: string | number; sig: string; }[]; envelopeSigs: { address: string; keyId: string | number; sig: string; }[]; } +{ + cadence: string; + refBlock: string; + computeLimit: number; + arguments: any[]; + proposalKey: { + address: string; + keyId: string | number; + sequenceNum: number; +} | { + address?: undefined; + keyId?: undefined; + sequenceNum?: undefined; +}; + payer: string; + authorizers: string[]; + payloadSigs: { + address: string; + keyId: string | number; + sig: string; +}[]; + envelopeSigs: { + address: string; + keyId: string | number; + sig: string; +}[]; +} ``` diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/resolveRefBlockId.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/resolveRefBlockId.md index ca7cce8509..ccd9282263 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/resolveRefBlockId.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/resolveRefBlockId.md @@ -35,7 +35,9 @@ resolveRefBlockId(opts) - Type: ```typescript -{ [key: string]: any; } +{ + [key: string]: any; +} ``` - Description: Optional configuration parameters diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/response.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/response.md index fd63839bfd..2fb2bd36dc 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/response.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/response.md @@ -46,7 +46,26 @@ console.log(defaultResponse.block); // null ## Returns ```typescript -{ tag: any; transaction: any; transactionStatus: any; transactionId: any; encodedData: any; events: any; event: any; accountStatusEvent: any; account: any; block: any; blockHeader: any; blockDigest: any; latestBlock: any; collection: any; networkParameters: any; streamConnection: any; heartbeat: any; nodeVersionInfo: any; } +{ + tag: any; + transaction: any; + transactionStatus: any; + transactionId: any; + encodedData: any; + events: any; + event: any; + accountStatusEvent: any; + account: any; + block: any; + blockHeader: any; + blockDigest: any; + latestBlock: any; + collection: any; + networkParameters: any; + streamConnection: any; + heartbeat: any; + nodeVersionInfo: any; +} ``` diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribe.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribe.md index 09369c0a7a..546e0fc00a 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribe.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribe.md @@ -88,7 +88,10 @@ blockSubscription.unsubscribe(); - Type: ```typescript -{ node?: string; transport?: SdkTransport; } +{ + node?: string; + transport?: SdkTransport; +} ``` - Description: Additional options for the subscription diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribeRaw.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribeRaw.md index 967f8bcf67..5a30aee4f2 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribeRaw.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/subscribeRaw.md @@ -90,7 +90,10 @@ rawSubscription.unsubscribe(); - Type: ```typescript -{ node?: string; transport?: SdkTransport; } +{ + node?: string; + transport?: SdkTransport; +} ``` - Description: Additional options for the subscription @@ -102,7 +105,11 @@ rawSubscription.unsubscribe(); ## Returns -`void; }` +```typescript +{ + unsubscribe: () => void; +} +``` A subscription object with an unsubscribe method diff --git a/docs/build/tools/clients/fcl-js/packages-docs/sdk/testUtils.md b/docs/build/tools/clients/fcl-js/packages-docs/sdk/testUtils.md index ef25508b69..87b29eaf7d 100644 --- a/docs/build/tools/clients/fcl-js/packages-docs/sdk/testUtils.md +++ b/docs/build/tools/clients/fcl-js/packages-docs/sdk/testUtils.md @@ -141,7 +141,21 @@ interface IAuthzResolveOpts { #### Returns ```typescript -Partial; kind: InteractionResolverKind.ACCOUNT; addr: string; keyId: string | number; sequenceNum: number; signature: string; signingFunction: any; role: { proposer: boolean; authorizer: boolean; payer: boolean; param?: boolean; }; authorization: any; } +Partial; + kind: InteractionResolverKind.ACCOUNT; + addr: string; + keyId: string | number; + sequenceNum: number; + signature: string; + signingFunction: any; + role: { + proposer: boolean; + authorizer: boolean; + payer: boolean; + param?: boolean; +}; + authorization: any; +} ``` ### authzResolveMany