Doc autogenerated from onflow/sdk
@onflow/sdk
Overview
The Flow sdk provides a set of tools for developers to build applications on the Flow blockchain.
Installation
You can install the @onflow/sdk package using npm or yarn:
_10npm install @onflow/sdk
Or using yarn:
_10yarn add @onflow/sdk
Requirements
- Node.js 14.x or later
Importing
You can import the entire package:
_10import * as sdk from "@onflow/sdk"
Or import specific functions:
_10import { functionName } from "@onflow/sdk"
API Reference
This section contains documentation for all of the functions in the sdk package.
- account - Returns the details of an account from their public address
- arg - A utility builder to be used with fcl.args[...] to create FCL supported arguments for interactions
- args - A utility builder to be used with other builders to pass in arguments with a value and supported type
- atBlockHeight - A builder function that returns a partial interaction to a block at a specific height
- atBlockId
- atLatestBlock - A builder function that returns a partial interaction to query the latest block with the given finality state
- authorization
- authorizations
- authzDeepResolveMany
- authzFn
- authzResolve
- authzResolveMany
- Bad
- block - Returns the latest block (optionally sealed or not), by id, or by height
- build - A builder function that creates an interaction
- buildPreSignable
- buildSignable
- cadence - Creates a template function
- cdc - Creates a template function
- config - Sets the config
- createSignableVoucher
- decode
- decodeResponse
- decodeStream
- destroy
- encodeMessageFromSignable
- encodeTransactionEnvelope
- encodeTransactionPayload
- encodeTxIdFromVoucher
- findInsideSigners
- findOutsideSigners
- get
- getAccount - A builder function that returns the interaction to get an account by address
- getBlock - A builder function that returns the interaction to get the latest block
- getBlockHeader - A builder function that returns the interaction to get a block header
- getCollection - A builder function that returns the interaction to get a collection by ID
- getEvents - A builder function that returns the interaction to get events
- getEventsAtBlockHeightRange - A builder function that returns the interaction to get events at a block height range
- getEventsAtBlockIds - A builder function that returns the interaction to get events at specific block IDs
- getLatestBlock - A builder function that returns the interaction to get the latest block
- getNetworkParameters - A builder function that returns the interaction to get network parameters
- getNodeVersionInfo - A builder function for the Get Node Version Info interaction
- getTransaction - A builder function that returns the interaction to get a transaction by ID
- getTransactionStatus - A builder function that returns the status of transaction NOTE: The transactionID provided must be from the current spork.
- getTransport - Get the SDK transport object, either from the provided override or from the global config.
- idof
- initAccount
- initInteraction
- interaction
- isAccount
- isArgument
- isArray
- isBad
- isFn
- isInteraction
- isNull
- isNumber
- isObj
- isOk
- limit - A builder function that sets the compute limit for a transaction
- makeArgument
- nodeVersionInfo - Returns the version information from to connected node
- Ok
- param
- params
- payer - A builder function that adds payer account(s) to a transaction
- ping - A builder function that creates a ping interaction
- pipe - Async pipe function to compose interactions
- prepAccount
- proposer
- put
- ref - A builder function that sets the reference block for a transaction
- resolveAccounts
- resolveArguments
- resolveCadence
- resolveComputeLimit
- resolveFinalNormalization
- resolveProposerSequenceNumber
- resolveRefBlockId
- resolveSignatures
- resolveValidators
- resolveVoucherIntercept
- response
- run
- script - A builder function that creates a script interaction
- send
- sig
- subscribe - Subscribe to a topic and decode the data.
- subscribeEvents - Subscribe to events with the given filter & parameters
- subscribeRaw - Subscribe to a topic without decoding the data.
- transaction - A template builder to use a Cadence transaction for an interaction
- update
- validateSignableTransaction
- validator - A builder function that adds a validator to a transaction
- voucherIntercept - A builder function that intercepts and modifies a voucher
- voucherToTxId
- why