-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Labels
anchorImproves conversion from Anchor IDLImproves conversion from Anchor IDLv2Something to look into when updating the Codama standard to v2Something to look into when updating the Codama standard to v2
Description
I'm attempting to use @codama/nodes-from-anchor to convert an Anchor-generated IDL into the Codama format for client generation using @codama/renderers-js.
When running the conversion script, i encounter the following error:
/program/node_modules/@codama/nodes-from-anchor/src/v01/InstructionAccountNode.ts:137
throw new CodamaError(CODAMA_ERROR__ANCHOR__PROGRAM_ID_KIND_UNIMPLEMENTED, { kind });
^
CodamaError: Program ID kind [account] is not implemented.
at instructionAccountNodeFromAnchorV01 (/Users/kajman/coding/program/node_modules/@codama/nodes-from-anchor/src/v01/InstructionAccountNode.ts:137:31)
at <anonymous> (/Users/kajman/coding/program/node_modules/@codama/nodes-from-anchor/src/v01/InstructionAccountNode.ts:43:16)
at Array.flatMap (<anonymous>)
at instructionAccountNodesFromAnchorV01 (/Users/kajman/coding/program/node_modules/@codama/nodes-from-anchor/src/v01/InstructionAccountNode.ts:40:16)
at instructionNodeFromAnchorV01 (/Users/kajman/coding/program/node_modules/@codama/nodes-from-anchor/src/v01/InstructionNode.ts:31:19)
at <anonymous> (/Users/kajman/coding/program/node_modules/@codama/nodes-from-anchor/src/v01/ProgramNode.ts:24:55)
at Array.map (<anonymous>)
at programNodeFromAnchorV01 (/Users/kajman/coding/program/node_modules/@codama/nodes-from-anchor/src/v01/ProgramNode.ts:24:36)
at rootNodeFromAnchorV01 (/Users/kajman/coding/program/node_modules/@codama/nodes-from-anchor/src/v01/RootNode.ts:7:25)
at rootNodeFromAnchorWithoutDefaultVisitor (/Users/kajman/coding/program/node_modules/@codama/nodes-from-anchor/src/index.ts:20:16) {
context: { __code: 2100005, kind: 'account' }
}
Node.js v18.20.7
Example account definition structure from my IDL that causes the issue:
"program": {
"kind": "account",
"path": "token_metadata_program"
}
However after manually editing pattern in IDL from "program": { "kind": "account", ... } to "program": { "kind": "const", ... }
creates the client successfully
anchor 0.31.1
Metadata
Metadata
Assignees
Labels
anchorImproves conversion from Anchor IDLImproves conversion from Anchor IDLv2Something to look into when updating the Codama standard to v2Something to look into when updating the Codama standard to v2