Skip to main content

Type Definitions

Documentation for core types used throughout the Flow Client Library (FCL).

Interfaces

Account

Properties:

NameTypeDescription
addressstringThe address of the account
balancenumberThe FLOW balance of the account in 10^8
codenumberThe code of any Cadence contracts stored in the account
contractsRecord<string, string>Any contracts deployed to this account
keysAccountKey[]The keys associated with the account

AccountKey

Properties:

NameTypeDescription
indexnumberThe index of the key in the account
publicKeystringThe public key of the account key
signAlgoSignatureAlgorithmThe signature algorithm used by the key
signAlgoStringstringThe signature algorithm used by the key as a string
hashAlgoHashAlgorithmThe hashing algorithm used by the key
hashAlgoStringstringThe hashing algorithm used by the key as a string
sequenceNumbernumberThe sequence number of the key
weightnumberThe weight of the key
revokedbooleanWhether or not the key has been revoked

AccountStatusEvent

Properties:

NameTypeDescription
accountAddressstringThe address of the account which the event is associated with.

Block

Properties:

NameTypeDescription
idstringThe id of the block
parentIdstringThe id of the parent block
heightnumberThe height of the block
timestampstringTime related fields
parentVoterSignaturestringThe parent voter signature of the block
collectionGuaranteesCollectionGuarantee[]Contains the ids of collections included in the block
blockSealsBlockSeal[]The details of which nodes executed and sealed the blocks

BlockDigest

BlockDigest holds lightweight block information which includes only block id, block height and block timestamp.

Properties:

NameTypeDescription
idstringThe id of the block
heightnumberThe height of the block
timestampstringTimestamp of the block

BlockHeader

Header contains all meta-data for a block, as well as a hash representing the combined payload of the entire block. It is what consensus nodes agree on after validating the contents against the payload hash.

Properties:

NameTypeDescription
idstringThe id of the block
parentIdstringThe id of the parent block
heightnumberThe height of the block
timestampstringThe timestamp of the block
parentVoterSignaturestringThe parent voter signature of the block

BlockHeartbeat

Properties:

NameTypeDescription
blockIdstringThe ID of the block
blockHeightnumberThe height of the block
timestampstringThe timestamp of the block

BlockSeal

Properties:

NameTypeDescription
blockIdstringThe id of the block
executionReceiptIdstringThe execution receipt id of the block

CollectionGuarantee

Properties:

NameTypeDescription
collectionIdstringThe id of the block
signerIdsstring[]The signer ids of the block

CompositeSignature

Properties:

NameTypeDescription
f_typestringA type identifier used internally by FCL
f_vsnstringFCL protocol version
addrstringFlow Address (sans prefix)
keyIdnumberKey ID
signaturestringSignature as a hex string

CurrentUser

Properties:

NameTypeDescription
addrstringThe public address of the current user
cidstringA wallet specified content identifier for user metadata
expiresAtnumberA wallet specified time-frame for a valid session
f_typestringA type identifier used internally by FCL
f_vsnstringFCL protocol version
loggedInbooleanWhether or not the current user is logged in
servicesService[]A list of trusted services that express ways of interacting with the current user's identity

Event

Properties:

NameTypeDescription
blockIdstringID of the block that contains the event.
blockHeightnumberHeight of the block that contains the event.
blockTimestampstringThe timestamp of when the block was sealed in a DateString format. eg. '2021-06-25T13:42:04.227Z'
typestringA string containing the event name.
transactionIdstringCan be used to query transaction information, eg. via a Flow block explorer.
transactionIndexnumberUsed to prevent replay attacks.
eventIndexnumberUsed to prevent replay attacks.
dataanyThe data emitted from the event.

EventFilter

Properties:

NameTypeDescription
eventTypesstring[]The event types to listen for
addressesstring[]The addresses to listen for
contractsstring[]The contracts to listen for
startBlockIdstringThe block ID to start listening for events
startHeightnumberThe block height to start listening for events
heartbeatIntervalnumberThe interval in milliseconds to send a heartbeat to the Access Node

Interaction

Properties:

NameTypeDescription
tagInteractionTagThe type of interaction
assignsRecord<string, any>Assigned values for the interaction
statusInteractionStatusThe status of the interaction
reasonstringReason for the current status
accountsRecord<string, InteractionAccount>Accounts involved in the interaction
paramsRecord<string, any>Parameters for the interaction
argumentsRecord<string, any>Arguments for the interaction
message{ cadence: string; refBlock: string; computeLimit: number; proposer: string; payer: string; authorizations: string[]; params: Record<string, any>[]; arguments: string[]; }Message details for the interaction
proposerstringThe proposer of the transaction
authorizationsstring[]The authorizations for the transaction
payerstring[]The payer(s) of the transaction
events{ eventType: string; start: string | number; end: string | number; blockIds: string[]; }Event-related information
transaction{ id: string; }Transaction-related information
block{ id: string; height: string | number; isSealed: boolean; }Block-related information
account{ addr: string; }Account-related information
collection{ id: string; }Collection-related information
subscribeEvents{ eventTypes: string[]; addresses: string[]; contracts: string[]; startBlockId: string; startHeight: number; heartbeatInterval: number; }Event subscription information

InteractionAccount

Properties:

NameTypeDescription
kindInteractionResolverKind.ACCOUNTThe kind of interaction resolver
tempIdstringTemporary identifier for the account
addrstringThe address of the account
keyIdstring | numberThe key ID used for signing
sequenceNumnumberThe sequence number for the account key
signaturestringThe signature for the account
signingFunctionanyFunction used for signing
resolveanyResolver function for the account
role{ proposer: boolean; authorizer: boolean; payer: boolean; param?: boolean; }Role of the account in the transaction
authorizationanyAuthorization details for the account

Key

Properties:

NameTypeDescription
sequenceNumbernumberSequence number of key used by the proposer of this transaction
keyIdnumberThe ID of the key in the account used by the proposer of this transaction
addressstringThe address of the proposer of this transaction

NodeVersionInfo

Properties:

NameTypeDescription
semverstringThe semver version of the node.
commitstringThe commit hash of the node.
sporkIdstringThe spork id of the node.
protocolVersionnumberThe protocol version of the node.
sporkRootBlockHeightnumberThe spork root block height of the node.
nodeRootBlockHeightnumberThe node root block height of the node.

Provider

Properties:

NameTypeDescription
addressstringThe blockchain address of the Wallet provider.
namestringThe name of the Wallet provider.
iconstringThe icon of the Wallet provider (may be a URL or a data URI).
descriptionstringA brief description of the Wallet provider.
colorstringThe preferred color to represent the Wallet provider (e.g., for UI styling).
supportEmailstringThe support email address of the Wallet provider.
websitestringThe website URL of the Wallet provider.
is_installedbooleanIndicates whether the Wallet provider is installed (if applicable).

Service

Properties:

NameTypeDescription
f_typestringA type identifier used internally by FCL
f_vsnstringFCL protocol version
typestringService type
methodstringService method
uidstringService uid
endpointstringService endpoint
providerProviderService provider object
paramsRecord<string, string>Service parameters as key-value pairs

Signature

Properties:

NameTypeDescription
sequenceNumberstringSequence number of the key used to perform this signature.
keyIdnumberID of the key in the account used to perform this signature.
signaturestringThe signature represented as a hex string.

StreamConnection

Transaction

Properties:

NameTypeDescription
scriptstringThe Cadence code used to execute this transaction.
argsstring[]The JSON-CDC encoded arguments passed in to the transaction.
referenceBlockIdstringThe reference block id for this transaction.
gasLimitnumberThe gas limit for the transaction.
proposalKeyKeyThe key used by the proposer of this transaction.
sequenceNumberstringSequence number of the key used by the proposer of this transaction.
keyIdnumberThe ID of the key in the account used by the proposer of this transaction.
addressstringThe address of the proposer of this transaction.
payerstringAddress of the payer of the transaction.
proposerstringAddress of the proposer of this transaction.
authorizersstring[]Array of addresses of authorizers of this transaction.
payloadSignaturesSignature[]The payload signatures for the transaction.
envelopeSignaturesSignature[]The envelope signatures for the transaction.

TransactionStatus

Properties:

NameTypeDescription
blockIdstringThe ID of the Block the transaction is included in.
statusTransactionExecutionStatusThe execution status of the transaction
statusStringstringThe status as as descriptive text (e.g. "FINALIZED").
statusCode0 | 1The result of the transaction, if executed (i.e. 0 for success, 1 for failure)
errorMessagestringThe error message of the transaction.
eventsEvent[]The events for this result.

Types

EventStream

Properties:

NameTypeDescription
on{ <C extends "events" | "heartbeat">(channel: C, listener: (data: { events: Event[]; heartbeat: BlockHeartbeat; }[C]) => void): EventStream; (event: "close", listener: () => void): EventStream; (event: "error", listener: (err: any) => void): EventStream; }
off{ <C extends "events" | "heartbeat">(event: C, listener: (data: { events: Event[]; heartbeat: BlockHeartbeat; }[C]) => void): EventStream; (event: "close", listener: () => void): EventStream; (event: "error", listener: (err: any) => void): EventStream; }
close() => void

RawSubscriptionData

Raw data returned by a subscription, which will vary depending on the topic and is not decoded

SdkTransport

Transport interface for the Flow SDK that provides methods for sending interactions and subscribing to data

Properties:

NameTypeDescription
sendSendFnFunction to send an interaction to the Flow blockchain
subscribeSubscribeFnFunction to subscribe to real-time data from the Flow blockchain

Subscription

A subscription object that allows managing the subscription lifecycle

Properties:

NameTypeDescription
unsubscribe() => voidFunction to unsubscribe from the subscription

SubscriptionArgs

Arguments for a subscription, which will vary depending on the topic

SubscriptionData

The data returned by a subscription, which will vary depending on the topic

Enums

FvmErrorCode

Error codes defined by the Flow Virtual Machine (FVM) for various types of errors that can occur during transaction execution

Members:

NameValueDescription
UNKNOWN_ERROR-1
TX_VALIDATION_ERROR1000
INVALID_TX_BYTE_SIZE_ERROR1001
INVALID_REFERENCE_BLOCK_ERROR1002
EXPIRED_TRANSACTION_ERROR1003
INVALID_SCRIPT_ERROR1004
INVALID_GAS_LIMIT_ERROR1005
INVALID_PROPOSAL_SIGNATURE_ERROR1006
INVALID_PROPOSAL_SEQ_NUMBER_ERROR1007
INVALID_PAYLOAD_SIGNATURE_ERROR1008
INVALID_ENVELOPE_SIGNATURE_ERROR1009
FVM_INTERNAL_ERROR1050
VALUE_ERROR1051
INVALID_ARGUMENT_ERROR1052
INVALID_ADDRESS_ERROR1053
INVALID_LOCATION_ERROR1054
ACCOUNT_AUTHORIZATION_ERROR1055
OPERATION_AUTHORIZATION_ERROR1056
OPERATION_NOT_SUPPORTED_ERROR1057
BLOCK_HEIGHT_OUT_OF_RANGE_ERROR1058
EXECUTION_ERROR1100
CADENCE_RUNTIME_ERROR1101
ENCODING_UNSUPPORTED_VALUE1102
STORAGE_CAPACITY_EXCEEDED1103
GAS_LIMIT_EXCEEDED_ERROR1104
EVENT_LIMIT_EXCEEDED_ERROR1105
LEDGER_INTERACTION_LIMIT_EXCEEDED_ERROR1106
STATE_KEY_SIZE_LIMIT_ERROR1107
STATE_VALUE_SIZE_LIMIT_ERROR1108
TRANSACTION_FEE_DEDUCTION_FAILED_ERROR1109
COMPUTATION_LIMIT_EXCEEDED_ERROR1110
MEMORY_LIMIT_EXCEEDED_ERROR1111
COULD_NOT_DECODE_EXECUTION_PARAMETER_FROM_STATE1112
SCRIPT_EXECUTION_TIMED_OUT_ERROR1113
SCRIPT_EXECUTION_CANCELLED_ERROR1114
EVENT_ENCODING_ERROR1115
INVALID_INTERNAL_STATE_ACCESS_ERROR1116
INSUFFICIENT_PAYER_BALANCE1118
ACCOUNT_ERROR1200
ACCOUNT_NOT_FOUND_ERROR1201
ACCOUNT_PUBLIC_KEY_NOT_FOUND_ERROR1202
ACCOUNT_ALREADY_EXISTS_ERROR1203
FROZEN_ACCOUNT_ERROR1204
ACCOUNT_STORAGE_NOT_INITIALIZED_ERROR1205
ACCOUNT_PUBLIC_KEY_LIMIT_ERROR1206
CONTRACT_ERROR1250
CONTRACT_NOT_FOUND_ERROR1251
CONTRACT_NAMES_NOT_FOUND_ERROR1252
EVM_EXECUTION_ERROR1300

HashAlgorithm

Members:

NameValueDescription
SHA2_2561
SHA2_3842
SHA3_2563
SHA3_3844
KMAC128_BLS_BLS12_3815

InteractionResolverKind

Represents different kinds of interaction resolvers

Members:

NameValueDescription
ARGUMENT"ARGUMENT"
ACCOUNT"ACCOUNT"

InteractionStatus

Status of an interaction with the Flow blockchain

Members:

NameValueDescription
BAD"BAD"
OK"OK"

InteractionTag

Represents different types of interactions with the Flow blockchain

Members:

NameValueDescription
UNKNOWN"UNKNOWN"
SCRIPT"SCRIPT"
TRANSACTION"TRANSACTION"
GET_TRANSACTION_STATUS"GET_TRANSACTION_STATUS"
GET_ACCOUNT"GET_ACCOUNT"
GET_EVENTS"GET_EVENTS"
PING"PING"
GET_TRANSACTION"GET_TRANSACTION"
GET_BLOCK"GET_BLOCK"
GET_BLOCK_HEADER"GET_BLOCK_HEADER"
GET_COLLECTION"GET_COLLECTION"
GET_NETWORK_PARAMETERS"GET_NETWORK_PARAMETERS"
SUBSCRIBE_EVENTS"SUBSCRIBE_EVENTS"
GET_NODE_VERSION_INFO"GET_NODE_VERSION_INFO"

SignatureAlgorithm

Members:

NameValueDescription
ECDSA_P2561
ECDSA_secp256k12
BLS_BLS12_3813

SubscriptionTopic

Represents different topics that can be subscribed to for real-time data from the Flow blockchain

Members:

NameValueDescription
BLOCKS"blocks"
BLOCK_HEADERS"block_headers"
BLOCK_DIGESTS"block_digests"
ACCOUNT_STATUSES"account_statuses"
TRANSACTION_STATUSES"transaction_statuses"
EVENTS"events"

TransactionExecutionStatus

The execution status of the transaction.

Members:

NameValueDescription
UNKNOWN0
PENDING1
FINALIZED2
EXECUTED3
SEALED4
EXPIRED5

TransactionRole

Represents different roles in a transaction

Members:

NameValueDescription
AUTHORIZER"authorizer"
PAYER"payer"
PROPOSER"proposer"

Doc autogenerated from onflow/typedefs