Skip to main content

decodeResponse

Decodes a response from Flow into JSON

Import

You can import the entire package and access the function:


_10
import * as sdk from "@onflow/sdk"
_10
_10
sdk.decodeResponse(response, customDecoders)

Or import directly the specific function:


_10
import { decodeResponse } from "@onflow/sdk"
_10
_10
decodeResponse(response, customDecoders)

Parameters

response

  • Type: FlowResponse
  • Description: The response object from Flow

_21
interface FlowResponse {
_21
encodedData?: DecodeInstructions
_21
transactionStatus?: FlowTransactionStatus
_21
transaction?: any
_21
events?: FlowBlockEvent[]
_21
account?: any
_21
block?: any
_21
blockHeader?: any
_21
blockDigest?: any
_21
event?: any
_21
accountStatusEvent?: any
_21
latestBlock?: any
_21
transactionId?: string
_21
collection?: any
_21
networkParameters?: {
_21
chainId: string
_21
}
_21
streamConnection?: any
_21
heartbeat?: any
_21
nodeVersionInfo?: any
_21
}

customDecoders (optional)

  • Type: DecoderMap
  • Description: An object of custom decoders

_10
interface DecoderMap {
_10
[key: string]: DecoderFunction
_10
}

Returns

Promise<any>


Rate this page