FlowType

FlowType Definitions

The FlowType in the Flooks library is a set of TypeScript types used to define various data structures for interacting with the Flow blockchain.

FlowType

export type FlowType =
  | FlowPrimitiveType
  | FlowType[]
  | FlowDictionaryType
  | undefined;

Description

  • FlowType is a union type that can be a FlowPrimitiveType, an array of FlowType (for representing arrays), a FlowDictionaryType, or undefined.
  • This type is flexible and can represent a wide range of data structures used in Flow blockchain interactions.

FlowPrimitiveType

export type FlowPrimitiveType = string | number | boolean | FlowPathType;

Description

  • Represents basic data types in Flow, including strings, numbers, booleans, and FlowPathType.

FlowPathType

export type FlowPathType = {
  domain: 'public' | 'private' | 'storage';
  identifier: string;
};

Description

  • Defines a type for Flow paths, which are unique identifiers within a user's account.
  • domain can be 'public', 'private', or 'storage', indicating the path's domain.
  • identifier is a string representing the specific path.

FlowDictionaryType

export type FlowDictionaryType =
  | FlowDictionaryObjectType
  | FlowDictionaryArrayType;

Description

  • Represents a dictionary type, which can be either an object or an array of key-value pairs.

FlowDictionaryObjectType

export type FlowDictionaryObjectType = { [key: string]: FlowType };

Description

  • Defines an object with string keys and FlowType values, representing a dictionary structure.

FlowDictionaryArrayType

export type FlowDictionaryArrayType = { key: FlowType; value: FlowType }[];

Description

  • Represents an array of objects, each with a key and value of FlowType, used for dictionary-like structures.

Usage

These types are essential for defining the data structures used in Flow blockchain transactions and scripts. They provide the flexibility needed to handle various data types and structures encountered in blockchain development.