createSdkClient
Creates an SDK client with the provided options.
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.createSdkClient(options)
Or import directly the specific function:
_10import { createSdkClient } from "@onflow/sdk"_10_10createSdkClient(options)
Usage
_10const client = createSdkClient({_10 accessNodeUrl: "https://rest-mainnet.onflow.org",_10 transport: myTransport,_10 computeLimit: 1000,_10})_10client.send([myScript, myTransaction])_10 .then(client.decode)_10 .catch(error => console.error("Error sending request:", error))
Parameters
options
- Type:
_10export interface SdkClientOptions {_10 accessNodeUrl: string_10 transport: SdkTransport_10 computeLimit: number_10 contracts?: {_10 [contractName: string]: string_10 }_10 customResolver?: (args: any) => Promise<any>_10 customDecoders?: {[key: string]: (data: any) => any}_10}
- Description: - Configuration options for the SDK client.
Returns
Promise<any>
A client object with methods to interact with the Flow blockchain.