Skip to main content

createSdkClient

Creates an SDK client with the provided options.

Import

You can import the entire package and access the function:


_10
import * as sdk from "@onflow/sdk"
_10
_10
sdk.createSdkClient(options)

Or import directly the specific function:


_10
import { createSdkClient } from "@onflow/sdk"
_10
_10
createSdkClient(options)

Usage


_10
const client = createSdkClient({
_10
accessNodeUrl: "https://rest-mainnet.onflow.org",
_10
transport: myTransport,
_10
computeLimit: 1000,
_10
})
_10
client.send([myScript, myTransaction])
_10
.then(client.decode)
_10
.catch(error => console.error("Error sending request:", error))

Parameters

options

  • Type:

_10
export 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.


Rate this page