decodeResponse
Decodes a response from Flow into JSON
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.decodeResponse(response, customDecoders)
Or import directly the specific function:
_10import { decodeResponse } from "@onflow/sdk"_10_10decodeResponse(response, customDecoders)
Parameters
response
- Type:
FlowResponse
- Description: The response object from Flow
_21interface 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
_10interface DecoderMap {_10 [key: string]: DecoderFunction_10}
Returns
Promise<any>