Skip to content

ChainGraph API Documentation / @badaitech/chaingraph-nodes / GetTokenBalanceNode

Class: GetTokenBalanceNode

Defined in: packages/chaingraph-nodes/src/nodes/blockchain/get-token-balance.node.ts:32

Node for retrieving ERC20 token balance

Extends

Constructors

Constructor

new GetTokenBalanceNode(id, _metadata?): GetTokenBalanceNode

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:32

Parameters

id

string

_metadata?

NodeMetadata

Returns

GetTokenBalanceNode

Inherited from

BaseNode.constructor

Properties

_id

protected readonly _id: string

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:20

Inherited from

BaseNode._id


_metadata

protected _metadata: NodeMetadata

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:21

Inherited from

BaseNode._metadata


_status

protected _status: NodeStatus

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:22

Inherited from

BaseNode._status


address

address: string = ''

Defined in: packages/chaingraph-nodes/src/nodes/blockchain/get-token-balance.node.ts:48


balance

balance: Amount

Defined in: packages/chaingraph-nodes/src/nodes/blockchain/get-token-balance.node.ts:59


balanceRaw

balanceRaw: string = '0'

Defined in: packages/chaingraph-nodes/src/nodes/blockchain/get-token-balance.node.ts:70


token

token: Token

Defined in: packages/chaingraph-nodes/src/nodes/blockchain/get-token-balance.node.ts:40

Accessors

id

Get Signature

get id(): string

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:46

Unique identifier of the node

Returns

string

Inherited from

BaseNode.id


metadata

Get Signature

get metadata(): NodeMetadata

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:47

Metadata describing the node

Returns

NodeMetadata

Inherited from

BaseNode.metadata


ports

Get Signature

get ports(): Map<string, IPort<IPortConfig>>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:65

Get all ports of the node

Returns

Map<string, IPort<IPortConfig>>

Inherited from

BaseNode.ports


status

Get Signature

get status(): NodeStatus

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:48

Current execution status of the node

Returns

NodeStatus

Inherited from

BaseNode.status


storage

Get Signature

get storage(): UnifiedPortStorage

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:52

Access to unified storage (for advanced usage and debugging)

Returns

UnifiedPortStorage

Inherited from

BaseNode.storage

Methods

addObjectProperties()

addObjectProperties(objectPort, properties, useParentUI?): Promise<IPort<IPortConfig>[]>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:203

Parameters

objectPort

IPort

properties

IPortConfig[]

useParentUI?

boolean

Returns

Promise<IPort<IPortConfig>[]>

Deprecated

Use AddFieldsOperation instead

Inherited from

BaseNode.addObjectProperties


addObjectProperty()

addObjectProperty(objectPort, key, portConfig, useParentUI?): Promise<IPort<IPortConfig>>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:199

Add a new property to an object port

Parameters

objectPort

IPort

The parent object port

key

string

The property key

portConfig

IPortConfig

The port configuration for the new property

useParentUI?

boolean

indicates whether we want to use the parents UI

Returns

Promise<IPort<IPortConfig>>

Inherited from

BaseNode.addObjectProperty


appendArrayItem()

appendArrayItem(arrayPort, value): Promise<number>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:217

Add an item to an array port

Parameters

arrayPort

IPort

The array port

value

any

The value to append

Returns

Promise<number>

The index of the new item

Inherited from

BaseNode.appendArrayItem


bindPortBindings()

bindPortBindings(): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:172

Rebind all port properties to storage

Returns

void

Inherited from

BaseNode.bindPortBindings


bindPortToNodeProperty()

bindPortToNodeProperty(targetObject, port): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:168

Bind a port to a node property

Parameters

targetObject

any

port

IPort

Returns

void

Deprecated

Use bindProperty instead

Inherited from

BaseNode.bindPortToNodeProperty


clone()

clone(): INodeComposite

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:250

Create a deep clone of the node

Returns

INodeComposite

A new node instance with the same state

Inherited from

BaseNode.clone


cloneWithNewId()

cloneWithNewId(): this

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:258

Create a deep clone of the node with new unique identifiers This method recursively clones all ports with new IDs while preserving the port hierarchy, values, and metadata

Returns

this

A result object containing the cloned node and ID mappings

Inherited from

BaseNode.cloneWithNewId


commitBatchUpdate()

commitBatchUpdate(eventContext?): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:163

Commit all collected port updates and emit events

Parameters

eventContext?

EventContext

Optional context to be added to all emitted events

Returns

Promise<void>

Inherited from

BaseNode.commitBatchUpdate


copyObjectSchemaTo()

copyObjectSchemaTo(sourceNode, sourceObjectPort, targetObjectPort, useParentUI?): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:101

Copy the schema (properties) from a source ObjectPort to a target ObjectPort

Parameters

sourceNode

INodeComposite

The node containing the source port

sourceObjectPort

The source ObjectPort to copy from

ObjectPort<IObjectSchema<Record<string, IPortConfig>>> | AnyPort

targetObjectPort

The target ObjectPort to copy to

ObjectPort<IObjectSchema<Record<string, IPortConfig>>> | AnyPort

useParentUI?

boolean

Whether to use parent UI settings for the new properties

Returns

Promise<void>

Promise that resolves when copying is complete

Inherited from

BaseNode.copyObjectSchemaTo


createEvent()

createEvent<T>(type, data): EventReturnType<T>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:269

Type Parameters

T

T extends NodeEventType

Parameters

type

T

data

NodeEventDataType<T>

Returns

EventReturnType<T>

Inherited from

BaseNode.createEvent


deserialize()

deserialize(data): INodeComposite

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:249

Deserialize from JSON data

Parameters

data

unknown

The serialized data

Returns

INodeComposite

The deserialized instance

Inherited from

BaseNode.deserialize


dispose()

dispose(): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:64

Release resources and prepare the node for garbage collection

Returns

Promise<void>

Inherited from

BaseNode.dispose


emit()

emit<T>(event): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:127

Emit an event to all subscribers

Type Parameters

T

T extends NodeEvent

Parameters

event

T

The event to emit

Returns

Promise<void>

Inherited from

BaseNode.emit


execute()

execute(context): Promise<NodeExecutionResult>

Defined in: packages/chaingraph-nodes/src/nodes/blockchain/get-token-balance.node.ts:72

Abstract method that must be implemented by concrete nodes We'll wrap this with logic for default port handling

Parameters

context

ExecutionContext

Returns

Promise<NodeExecutionResult>

Overrides

BaseNode.execute


executeOperation()

executeOperation<P, R>(operation): Promise<OperationResult<R>>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:153

Execute an operation on this node

This is the new primary API for node manipulation. Operations provide:

  • Type-safe parameters and results
  • Automatic event emission
  • Traceability (operation IDs, context)
  • Validation before execution

Type Parameters

P

P

R

R

Parameters

operation

IOperation<P, R>

Operation to execute

Returns

Promise<OperationResult<R>>

Operation result with success/error and events

Example

typescript
const op = new SetValueOperation(
  { portPath: 'prompt', value: 'Hello' },
  { userId: 'user123', source: 'ui' }
)
const result = await node.executeOperation(op)
if (result.success) {
  console.log('Value set:', result.data.newValue)
}

Inherited from

BaseNode.executeOperation


executeWithSystemPorts()

executeWithSystemPorts(context): Promise<NodeExecutionResult>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:45

Runtime execute that wraps the abstract execute to handle system ports. This is an internal method used by the execution engine.

Parameters

context

ExecutionContext

The execution context

Returns

Promise<NodeExecutionResult>

The execution result

Inherited from

BaseNode.executeWithSystemPorts


findPort()

findPort(predicate): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:102

Find a port by a predicate function

Parameters

predicate

(port) => boolean

Predicate function to match the port

Returns

IPort<IPortConfig> | undefined

The port if found, undefined otherwise

Inherited from

BaseNode.findPort


findPortByKey()

findPortByKey(key): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:126

Find a port by its key

Parameters

key

string

The key of the port to find

Returns

IPort<IPortConfig> | undefined

The port if found, undefined otherwise

Inherited from

BaseNode.findPortByKey


findPortByPath()

findPortByPath(path): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:74

Find a port by following a path of property names from the node root

Parameters

path

string[]

Path segments (property names or array indices)

Returns

IPort<IPortConfig> | undefined

The port if found, undefined otherwise

Inherited from

BaseNode.findPortByPath


findPorts()

findPorts(predicate): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:103

Find all ports by a predicate function

Parameters

predicate

(port) => boolean

Predicate function to match the port

Returns

IPort<IPortConfig>[]

Array of ports that match the predicate

Inherited from

BaseNode.findPorts


getChildPorts()

getChildPorts(parentPort): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:75

Get all direct child ports of a parent port

Parameters

parentPort

IPort

The parent port

Returns

IPort<IPortConfig>[]

Array of child ports

Inherited from

BaseNode.getChildPorts


getDefaultPorts()

getDefaultPorts(): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:259

Get all default ports based on the node's flow configuration

Returns

IPort<IPortConfig>[]

Inherited from

BaseNode.getDefaultPorts


getErrorMessagePort()

getErrorMessagePort(): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:265

Get error message port

Returns

IPort<IPortConfig> | undefined

Inherited from

BaseNode.getErrorMessagePort


getErrorPort()

getErrorPort(): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:264

Get error port

Returns

IPort<IPortConfig> | undefined

Inherited from

BaseNode.getErrorPort


getFlowInPort()

getFlowInPort(): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:262

Get flow in port

Returns

IPort<IPortConfig> | undefined

Inherited from

BaseNode.getFlowInPort


getFlowOutPort()

getFlowOutPort(): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:263

Get flow out port

Returns

IPort<IPortConfig> | undefined

Inherited from

BaseNode.getFlowOutPort


getInputs()

getInputs(): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:68

Get all input ports

Returns

IPort<IPortConfig>[]

Array of input ports

Inherited from

BaseNode.getInputs


getNestedPorts()

getNestedPorts(parentPort): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:76

Get all nested ports of a parent port, including its children and their children recursively

Parameters

parentPort

IPort

The parent port

Returns

IPort<IPortConfig>[]

Array of all nested ports

Inherited from

BaseNode.getNestedPorts


getOutputs()

getOutputs(): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:69

Get all output ports

Returns

IPort<IPortConfig>[]

Array of output ports

Inherited from

BaseNode.getOutputs


getParentshipChain()

getParentshipChain(port): IPort<IPortConfig>[]

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:77

Get the full parentship chain of a port, from the port up to the root

Parameters

port

IPort

The port to get the chain for

Returns

IPort<IPortConfig>[]

Array of ports in the chain, starting from the given port up to the root

Inherited from

BaseNode.getParentshipChain


getPort()

getPort(portId): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:66

Get a port by its ID

Parameters

portId

string

The port ID

Returns

IPort<IPortConfig> | undefined

The port if found, undefined otherwise

Inherited from

BaseNode.getPort


getPortByPath()

getPortByPath(pathString): IPort<IPortConfig> | undefined

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:104

Get a port by its path string (e.g., "port.subport.array[0].field")

Parameters

pathString

string

The path string to the port

Returns

IPort<IPortConfig> | undefined

The port if found, undefined otherwise

Inherited from

BaseNode.getPortByPath


getPortPath()

getPortPath(portId): string | undefined

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:105

Get the full path string for a given port

Parameters

portId

string

The ID of the port

Returns

string | undefined

The path string (e.g., "port.subport.field") or undefined if port not found

Inherited from

BaseNode.getPortPath


getPortPathForPort()

getPortPathForPort(port): string

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:106

Get the full path string for a given port instance

Parameters

port

IPort

The port instance

Returns

string

The path string (e.g., "port.subport.field")

Inherited from

BaseNode.getPortPathForPort


getRootPort()

getRootPort(port): IPort

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:78

Get the root port of a given port by traversing up the parentship chain

Parameters

port

IPort

The port to find the root for

Returns

IPort

The root port

Inherited from

BaseNode.getRootPort


getSystemPortConfigs()

getSystemPortConfigs(): IPortConfig[]

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:260

Get system port configurations

Returns

IPortConfig[]

Inherited from

BaseNode.getSystemPortConfigs


getUI()

getUI(): NodeUIMetadata | undefined

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:236

Get the node's UI metadata

Returns

NodeUIMetadata | undefined

Node UI metadata or undefined if not set

Inherited from

BaseNode.getUI


getVersion()

getVersion(): number

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:242

Get the current version number

Returns

number

The current version

Inherited from

BaseNode.getVersion


hasPort()

hasPort(portId): boolean

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:67

Check if a port with the given ID exists

Parameters

portId

string

The port ID

Returns

boolean

True if the port exists, false otherwise

Inherited from

BaseNode.hasPort


incrementVersion()

incrementVersion(): number

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:241

Increment the node's version number

Returns

number

The new version number

Inherited from

BaseNode.incrementVersion


initialize()

initialize(portsConfig?): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:268

Initialize the node with port configurations

Parameters

portsConfig?

Map<string, IPortConfig>

Optional map of port configurations

Returns

void

Inherited from

BaseNode.initialize


initializePortsFromConfigs()

initializePortsFromConfigs(portsConfigs, syncValuesToStorage?): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:176

Initialize ports from configs

Parameters

portsConfigs

Map<string, IPortConfig>

syncValuesToStorage?

boolean

Returns

void

Inherited from

BaseNode.initializePortsFromConfigs


isDefaultPort()

isDefaultPort(portId): boolean

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:261

Check if a port is a system default port

Parameters

portId

string

Returns

boolean

Inherited from

BaseNode.isDefaultPort


on()

on<T>(eventType, handler): () => void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:107

Subscribe to node events of a specific type

Type Parameters

T

T extends NodeEvent

Parameters

eventType

T["type"]

The type of event to subscribe to

handler

(event) => void | Promise<void>

The event handler function

Returns

A function to unsubscribe

(): void

Returns

void

Inherited from

BaseNode.on


onAll()

onAll(handler): () => void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:108

Subscribe to all node events

Parameters

handler

(event) => void | Promise<void>

The event handler function

Returns

A function to unsubscribe

(): void

Returns

void

Inherited from

BaseNode.onAll


onEvent()

onEvent(_event): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:115

Event handler for the node This is the key method that derived classes can override to handle events

Parameters

_event

NodeEvent

The event to handle

Returns

Promise<void>

Inherited from

BaseNode.onEvent


processPortConfig()

processPortConfig(config, context): IPortConfig

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:230

Parameters

config

IPortConfig

context
nodeId

string

parentPortConfig

IPortConfig | null

propertyKey

string

propertyValue

any

Returns

IPortConfig

Deprecated

Internal method - should not be called externally

Inherited from

BaseNode.processPortConfig


removeArrayItem()

removeArrayItem(arrayPort, index): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:222

Parameters

arrayPort

IPort

index

number

Returns

Promise<void>

Deprecated

Use RemoveItemOperation instead

Example

ts
await node.executeOperation(new RemoveItemOperation({ arrayPath, index }))

Inherited from

BaseNode.removeArrayItem


removeArrayItems()

removeArrayItems(arrayPort, indices): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:226

Parameters

arrayPort

IPort

indices

number[]

Returns

Promise<void>

Deprecated

Use multiple RemoveItemOperation calls or batch operation

Inherited from

BaseNode.removeArrayItems


removeObjectProperties()

removeObjectProperties(objectPort, keys): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:207

Parameters

objectPort

IPort

keys

string[]

Returns

Promise<void>

Deprecated

Use RemoveFieldsOperation instead

Inherited from

BaseNode.removeObjectProperties


removeObjectProperty()

removeObjectProperty(objectPort, key): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:212

Parameters

objectPort

IPort

key

string

Returns

Promise<void>

Deprecated

Use RemoveFieldOperation instead

Example

ts
await node.executeOperation(new RemoveFieldOperation({ parentPath, key }))

Inherited from

BaseNode.removeObjectProperty


removePort()

removePort(portId): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:72

Remove a port by its ID

Parameters

portId

string

The ID of the port to remove

Returns

void

Inherited from

BaseNode.removePort


removePorts()

removePorts(portIds): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:73

Remove multiple ports by their IDs

Parameters

portIds

string[]

Array of port IDs to remove

Returns

void

Inherited from

BaseNode.removePorts


replaceStorage()

replaceStorage(newStorage): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:59

Internal

Replace the unified storage with a new instance Used during cloning to set up the cloned node's storage

Parameters

newStorage

UnifiedPortStorage

Returns

void

Inherited from

BaseNode.replaceStorage


reset()

reset(): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:63

Reset the node to its initial state

Returns

Promise<void>

Inherited from

BaseNode.reset


serialize()

serialize(): unknown

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:248

Serialize the node to a JSON-compatible format

Returns

unknown

The serialized node

Inherited from

BaseNode.serialize


setDimensions()

setDimensions(dimensions, emitEvent?): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:239

Update the node's dimensions

Parameters

dimensions

Dimensions

New dimensions

emitEvent?

boolean

Whether to emit a dimensions change event

Returns

void

Inherited from

BaseNode.setDimensions


setMetadata()

setMetadata(metadata): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:60

Set the node metadata

Parameters

metadata

NodeMetadata

New metadata

Returns

void

Inherited from

BaseNode.setMetadata


setNodeParent()

setNodeParent(position, parentNodeId?, emitEvent?): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:240

Update the node's parent and position

Parameters

position

Position

New position coordinates

parentNodeId?

string

ID of the parent node or undefined to remove parent

emitEvent?

boolean

Whether to emit a parent change event

Returns

void

Inherited from

BaseNode.setNodeParent


setPort()

setPort(port): IPort

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:70

Add or update a port

Parameters

port

IPort

The port to set

Returns

IPort

The added/updated port

Inherited from

BaseNode.setPort


setPorts()

setPorts(ports): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:71

Set all ports at once

Parameters

ports

Map<string, IPort<IPortConfig>>

Map of ports to set

Returns

void

Inherited from

BaseNode.setPorts


setPosition()

setPosition(position, emitEvent?): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:238

Update the node's position

Parameters

position

Position

New position coordinates

emitEvent?

boolean

Whether to emit a position change event

Returns

void

Inherited from

BaseNode.setPosition


setStatus()

setStatus(status, emitEvent?): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:61

Set the node status

Parameters

status

NodeStatus

New status

emitEvent?

boolean

Whether to emit a status change event

Returns

void

Inherited from

BaseNode.setStatus


setUI()

setUI(ui, emitEvent?): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:237

Update the node's UI metadata

Parameters

ui

NodeUIMetadata

New UI metadata

emitEvent?

boolean

Whether to emit a UI change event

Returns

void

Inherited from

BaseNode.setUI


setVersion()

setVersion(version): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:247

Set the node version

Parameters

version

number

The new version

Returns

void

Inherited from

BaseNode.setVersion


shouldExecute()

shouldExecute(context): boolean

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:266

Determine if node should execute based on flow ports

Parameters

context

ExecutionContext

Returns

boolean

Inherited from

BaseNode.shouldExecute


startBatchUpdate()

startBatchUpdate(): void

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:158

Start collecting port updates without emitting events immediately Used for batch operations where multiple ports are updated

Returns

void

Inherited from

BaseNode.startBatchUpdate


updateArrayItemConfig()

updateArrayItemConfig(arrayPort): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:216

Parameters

arrayPort

IPort

Returns

Promise<void>

Deprecated

Array item config updates should be handled via UpdateConfigOperation

Inherited from

BaseNode.updateArrayItemConfig


updatePort()

updatePort(port, eventContext?): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:85

Update a port and emit a port update event This is a critical method that triggers port-related events

Parameters

port

IPort

The port to update

eventContext?

EventContext

Optional event context for additional metadata

Returns

Promise<void>

Inherited from

BaseNode.updatePort


updatePorts()

updatePorts(ports, eventContext?): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:92

Update multiple ports at once This is useful for batch updates

Parameters

ports

IPort<IPortConfig>[]

Array of ports to update

eventContext?

EventContext

Optional event context for additional metadata

Returns

Promise<void>

Inherited from

BaseNode.updatePorts


updatePortsAfterExecution()

updatePortsAfterExecution(success, errorMessage?): Promise<void>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:267

Update flow ports after execution

Parameters

success

boolean

errorMessage?

string

Returns

Promise<void>

Inherited from

BaseNode.updatePortsAfterExecution


validate()

validate(): Promise<NodeValidationResult>

Defined in: packages/chaingraph-types/dist/node/base-node-compositional.d.ts:62

Validate the node configuration

Returns

Promise<NodeValidationResult>

A promise resolving to the validation result

Inherited from

BaseNode.validate

Licensed under BUSL-1.1