createFlowClient
Creates a Flow client instance with authentication, transaction, and query capabilities.
Import
You can import the entire package and access the function:
_10import * as fcl from "@onflow/fcl"_10_10fcl.createFlowClient(params)
Or import directly the specific function:
_10import { createFlowClient } from "@onflow/fcl"_10_10createFlowClient(params)
Parameters
params
- Type:
_21export interface FlowClientConfig {_21 accessNodeUrl: string _21 flowNetwork?: string_21 flowJson?: any_21 discoveryWallet?: string_21 discoveryWalletMethod?: string_21 discoveryAuthnEndpoint?: string_21 discoveryAuthnInclude?: string[]_21 walletconnectProjectId?: string_21 walletconnectDisableNotifications?: boolean_21 storage?: StorageProvider_21 appDetailTitle?: string_21 appDetailIcon?: string_21 appDetailDescription?: string_21 appDetailUrl?: string_21 serviceOpenIdScopes?: string[]_21 transport?: SdkTransport_21 computeLimit?: number_21 customResolver?: any_21 customDecoders?: any_21}
- Description: Configuration object for the Flow client
Returns
_56{_56 send: (args?: false | InteractionBuilderFn | (false | InteractionBuilderFn)[], opts?: any) => Promise<any>;_56 subscribe: <T extends SubscriptionTopic>({_56 topic, args, onData, onError_56}: SubscribeParams<T>, opts?: {_56 node?: string;_56 transport?: SdkTransport;_56}) => Subscription;_56 subscribeRaw: <T extends SubscriptionTopic>({_56 topic, args, onData, onError_56}: SubscribeRawParams<T>, opts?: {_56 node?: string;_56 transport?: SdkTransport;_56}) => {_56 unsubscribe: () => void;_56};_56 account: (address: string, {_56 height, id, isSealed_56}?: AccountQueryOptions, opts?: object) => Promise<Account>;_56 block: ({_56 sealed, id, height_56}?: BlockQueryOptions, opts?: object) => Promise<Block>;_56 resolve: (ix: Interaction) => Promise<Interaction>;_56 decode: (response: any) => Promise<any>;_56 currentUser: CurrentUserServiceApi;_56 mutate: (opts?: MutateOptions) => Promise<string>;_56 query: (opts?: QueryOptions) => Promise<any>;_56 queryRaw: (opts?: QueryOptions) => Promise<any>;_56 verifyUserSignatures: (message: string, compSigs: CompositeSignature[], opts?: VerifySignaturesScriptOptions) => Promise<boolean>;_56 getChainId: (opts?: GetChainIdOptions) => Promise<string>;_56 tx: {_56 (transactionId: string, opts?: {_56 pollRate?: number;_56 txNotFoundTimeout?: number;_56}): {_56 snapshot: () => Promise<TransactionStatus>;_56 subscribe: (onData: (txStatus: TransactionStatus) => void, onError?: (err: Error) => void) => () => void;_56 onceFinalized: () => Promise<TransactionStatus>;_56 onceExecuted: () => Promise<TransactionStatus>;_56 onceSealed: () => Promise<TransactionStatus>;_56};_56 isUnknown: (ix: Interaction) => boolean;_56 isPending: (tx: TransactionStatus) => boolean;_56 isFinalized: (tx: TransactionStatus) => boolean;_56 isExecuted: (tx: TransactionStatus) => boolean;_56 isSealed: (tx: TransactionStatus) => boolean;_56 isExpired: (tx: TransactionStatus) => boolean;_56};_56 events: (filterOrType?: string | EventFilter) => {_56 subscribe: (onData: (event: Event) => void, onError?: (error: Error) => void) => () => void;_56};_56 authenticate: (opts?: AuthenticationOptions) => Promise<CurrentUser>;_56 unauthenticate: () => void;_56 signUserMessage: (msg: string) => Promise<CompositeSignature[]>;_56 serialize: (args: (false | InteractionBuilderFn)[] | Interaction, opts?: SerializeOptions) => Promise<string>;_56}
A Flow client object with many methods for interacting with the Flow blockchain