It would be useful to have visitors such as addAccountsVisitor, addInstructionsVisitor, addDefinedTypesVisitor, addErrorsVisitor, etc.
By default these visitors would add the provided nodes to the main program of the RootNode.
// Example.
codama.update(
addDefinedTypesVisitor([
definedTypeNode({ name: 'slot', type: numberTypeNode('u64') }),
definedTypeNode({ name: 'hash', type: publicKeyTypeNode() })
])
);
However, we could also support an additional signature that would look for the correct ProgramNode using the provided program name.
// Example.
codama.update(
addDefinedTypesVisitor('someAdditionalProgram', [
definedTypeNode({ name: 'slot', type: numberTypeNode('u64') }),
definedTypeNode({ name: 'hash', type: publicKeyTypeNode() })
])
);
It would be useful to have visitors such as
addAccountsVisitor,addInstructionsVisitor,addDefinedTypesVisitor,addErrorsVisitor, etc.By default these visitors would add the provided nodes to the main
programof theRootNode.However, we could also support an additional signature that would look for the correct
ProgramNodeusing the provided program name.