ソースを参照

Rename Kinobi to Codama (#234)

Loris Leiva 1 年間 前
コミット
e9d56c993f
100 ファイル変更735 行追加735 行削除
  1. 8 8
      .changeset/config.json
  2. 3 3
      .github/workflows/main.yml
  3. 1 1
      LICENSE
  4. 38 38
      README.md
  5. 2 2
      package.json
  6. 27 27
      packages/errors/CHANGELOG.md
  7. 1 1
      packages/errors/LICENSE
  8. 19 19
      packages/errors/README.md
  9. 16 16
      packages/errors/package.json
  10. 7 7
      packages/errors/src/cli.ts
  11. 51 51
      packages/errors/src/codes.ts
  12. 53 53
      packages/errors/src/context.ts
  13. 18 18
      packages/errors/src/error.ts
  14. 6 6
      packages/errors/src/message-formatter.ts
  15. 52 52
      packages/errors/src/messages.ts
  16. 20 20
      packages/errors/test/error.test.ts
  17. 30 30
      packages/errors/test/error.typetest.ts
  18. 1 1
      packages/errors/tsconfig.json
  19. 1 1
      packages/internals/README.md
  20. 1 1
      packages/internals/package.json
  21. 1 1
      packages/internals/scripts/test-unit.mjs
  22. 1 1
      packages/internals/tsup.config.base.ts
  23. 66 66
      packages/library/CHANGELOG.md
  24. 1 1
      packages/library/LICENSE
  25. 32 32
      packages/library/README.md
  26. 17 17
      packages/library/package.json
  27. 51 0
      packages/library/src/codama.ts
  28. 5 5
      packages/library/src/index.ts
  29. 0 51
      packages/library/src/kinobi.ts
  30. 5 5
      packages/library/test/index.test.ts
  31. 1 1
      packages/library/tsconfig.json
  32. 7 7
      packages/node-types/CHANGELOG.md
  33. 1 1
      packages/node-types/LICENSE
  34. 9 9
      packages/node-types/README.md
  35. 10 10
      packages/node-types/package.json
  36. 3 3
      packages/node-types/src/RootNode.ts
  37. 1 1
      packages/node-types/src/shared/version.ts
  38. 1 1
      packages/node-types/tsconfig.json
  39. 57 57
      packages/nodes-from-anchor/CHANGELOG.md
  40. 1 1
      packages/nodes-from-anchor/LICENSE
  41. 12 12
      packages/nodes-from-anchor/README.md
  42. 17 17
      packages/nodes-from-anchor/package.json
  43. 2 2
      packages/nodes-from-anchor/src/defaultVisitor.ts
  44. 1 1
      packages/nodes-from-anchor/src/discriminators.ts
  45. 2 2
      packages/nodes-from-anchor/src/index.ts
  46. 1 1
      packages/nodes-from-anchor/src/v00/AccountNode.ts
  47. 1 1
      packages/nodes-from-anchor/src/v00/DefinedTypeNode.ts
  48. 1 1
      packages/nodes-from-anchor/src/v00/ErrorNode.ts
  49. 1 1
      packages/nodes-from-anchor/src/v00/InstructionAccountNode.ts
  50. 1 1
      packages/nodes-from-anchor/src/v00/InstructionArgumentNode.ts
  51. 1 1
      packages/nodes-from-anchor/src/v00/InstructionNode.ts
  52. 1 1
      packages/nodes-from-anchor/src/v00/PdaNode.ts
  53. 1 1
      packages/nodes-from-anchor/src/v00/ProgramNode.ts
  54. 1 1
      packages/nodes-from-anchor/src/v00/RootNode.ts
  55. 1 1
      packages/nodes-from-anchor/src/v00/typeNodes/ArrayTypeNode.ts
  56. 1 1
      packages/nodes-from-anchor/src/v00/typeNodes/EnumEmptyVariantTypeNode.ts
  57. 1 1
      packages/nodes-from-anchor/src/v00/typeNodes/EnumStructVariantTypeNode.ts
  58. 1 1
      packages/nodes-from-anchor/src/v00/typeNodes/EnumTupleVariantTypeNode.ts
  59. 1 1
      packages/nodes-from-anchor/src/v00/typeNodes/EnumTypeNode.ts
  60. 1 1
      packages/nodes-from-anchor/src/v00/typeNodes/MapTypeNode.ts
  61. 1 1
      packages/nodes-from-anchor/src/v00/typeNodes/OptionTypeNode.ts
  62. 1 1
      packages/nodes-from-anchor/src/v00/typeNodes/SetTypeNode.ts
  63. 1 1
      packages/nodes-from-anchor/src/v00/typeNodes/StructFieldTypeNode.ts
  64. 1 1
      packages/nodes-from-anchor/src/v00/typeNodes/StructTypeNode.ts
  65. 1 1
      packages/nodes-from-anchor/src/v00/typeNodes/TupleTypeNode.ts
  66. 4 4
      packages/nodes-from-anchor/src/v00/typeNodes/TypeNode.ts
  67. 3 3
      packages/nodes-from-anchor/src/v01/AccountNode.ts
  68. 1 1
      packages/nodes-from-anchor/src/v01/DefinedTypeNode.ts
  69. 1 1
      packages/nodes-from-anchor/src/v01/ErrorNode.ts
  70. 12 12
      packages/nodes-from-anchor/src/v01/InstructionAccountNode.ts
  71. 1 1
      packages/nodes-from-anchor/src/v01/InstructionArgumentNode.ts
  72. 1 1
      packages/nodes-from-anchor/src/v01/InstructionNode.ts
  73. 1 1
      packages/nodes-from-anchor/src/v01/ProgramNode.ts
  74. 1 1
      packages/nodes-from-anchor/src/v01/RootNode.ts
  75. 1 1
      packages/nodes-from-anchor/src/v01/typeNodes/ArrayTypeNode.ts
  76. 1 1
      packages/nodes-from-anchor/src/v01/typeNodes/EnumEmptyVariantTypeNode.ts
  77. 1 1
      packages/nodes-from-anchor/src/v01/typeNodes/EnumStructVariantTypeNode.ts
  78. 1 1
      packages/nodes-from-anchor/src/v01/typeNodes/EnumTupleVariantTypeNode.ts
  79. 1 1
      packages/nodes-from-anchor/src/v01/typeNodes/EnumTypeNode.ts
  80. 1 1
      packages/nodes-from-anchor/src/v01/typeNodes/OptionTypeNode.ts
  81. 3 3
      packages/nodes-from-anchor/src/v01/typeNodes/StructFieldTypeNode.ts
  82. 1 1
      packages/nodes-from-anchor/src/v01/typeNodes/StructTypeNode.ts
  83. 1 1
      packages/nodes-from-anchor/src/v01/typeNodes/TupleTypeNode.ts
  84. 4 4
      packages/nodes-from-anchor/src/v01/typeNodes/TypeNode.ts
  85. 1 1
      packages/nodes-from-anchor/test/discriminator.test.ts
  86. 1 1
      packages/nodes-from-anchor/test/rootNodeFromAnchor.test.ts
  87. 1 1
      packages/nodes-from-anchor/test/v00/AccountNode.test.ts
  88. 1 1
      packages/nodes-from-anchor/test/v00/DefinedTypeNode.test.ts
  89. 1 1
      packages/nodes-from-anchor/test/v00/ErrorNode.test.ts
  90. 1 1
      packages/nodes-from-anchor/test/v00/InstructionAccountNode.test.ts
  91. 1 1
      packages/nodes-from-anchor/test/v00/InstructionArgumentNode.test.ts
  92. 1 1
      packages/nodes-from-anchor/test/v00/InstructionNode.test.ts
  93. 1 1
      packages/nodes-from-anchor/test/v00/PdaNode.test.ts
  94. 1 1
      packages/nodes-from-anchor/test/v00/ProgramNode.test.ts
  95. 1 1
      packages/nodes-from-anchor/test/v00/RootNode.test.ts
  96. 1 1
      packages/nodes-from-anchor/test/v00/typeNodes/ArrayTypeNode.test.ts
  97. 1 1
      packages/nodes-from-anchor/test/v00/typeNodes/BooleanTypeNode.test.ts
  98. 1 1
      packages/nodes-from-anchor/test/v00/typeNodes/BytesTypeNode.test.ts
  99. 1 1
      packages/nodes-from-anchor/test/v00/typeNodes/EnumTypeNode.test.ts
  100. 1 1
      packages/nodes-from-anchor/test/v00/typeNodes/MapTypeNode.test.ts

+ 8 - 8
.changeset/config.json

@@ -2,21 +2,21 @@
   "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
   "changelog": [
     "@changesets/changelog-github",
-    { "repo": "kinobi-so/kinobi" }
+    { "repo": "codama-idl/codama" }
   ],
   "commit": false,
   "fixed": [
         [
-            "kinobi",
-            "@kinobi-so/errors",
-            "@kinobi-so/node-types",
-            "@kinobi-so/nodes",
-            "@kinobi-so/validators",
-            "@kinobi-so/visitors*"
+            "codama",
+            "@codama/errors",
+            "@codama/node-types",
+            "@codama/nodes",
+            "@codama/validators",
+            "@codama/visitors*"
         ]
     ],
   "linked": [],
-  "ignore": ["@kinobi-so/internals"],
+  "ignore": ["@codama/internals"],
   "access": "public",
   "baseBranch": "main",
   "privatePackages": {

+ 3 - 3
.github/workflows/main.yml

@@ -9,7 +9,7 @@ env:
   # Among other things, opts out of Turborepo telemetry. See https://consoledonottrack.com/.
   DO_NOT_TRACK: '1'
   NODE_VERSION: 18
-  KINOBI_VERSION: 0.22
+  CODAMA_VERSION: 0.22
   SOLANA_VERSION: 1.18.12
 
 jobs:
@@ -95,8 +95,8 @@ jobs:
         id: changesets
         uses: changesets/action@v1
         with:
-          commit: '[${{ env.KINOBI_VERSION }}] Publish packages'
-          title: '[${{ env.KINOBI_VERSION }}] Publish packages'
+          commit: '[${{ env.CODAMA_VERSION }}] Publish packages'
+          title: '[${{ env.CODAMA_VERSION }}] Publish packages'
           publish: pnpm publish-packages
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

+ 1 - 1
LICENSE

@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2024 Kinobi
+Copyright (c) 2024 Codama
 Copyright (c) 2024 Metaplex Foundation
 
 Permission is hereby granted, free of charge, to any person obtaining

+ 38 - 38
README.md

@@ -1,79 +1,79 @@
-# Kinobi
+# Codama
 
 [![npm][npm-image]][npm-url]
 [![npm-downloads][npm-downloads-image]][npm-url]
 [![ci][ci-image]][ci-url]
 
-[npm-downloads-image]: https://img.shields.io/npm/dm/kinobi.svg?style=flat
-[npm-image]: https://img.shields.io/npm/v/kinobi.svg?style=flat
-[npm-url]: https://www.npmjs.com/package/kinobi
-[ci-image]: https://img.shields.io/github/actions/workflow/status/kinobi-so/kinobi/main.yml?logo=GitHub
-[ci-url]: https://github.com/kinobi-so/kinobi/actions/workflows/main.yml
+[npm-downloads-image]: https://img.shields.io/npm/dm/codama.svg?style=flat
+[npm-image]: https://img.shields.io/npm/v/codama.svg?style=flat
+[npm-url]: https://www.npmjs.com/package/codama
+[ci-image]: https://img.shields.io/github/actions/workflow/status/codama-idl/codama/main.yml?logo=GitHub
+[ci-url]: https://github.com/codama-idl/codama/actions/workflows/main.yml
 
-Kinobi is a tool that describes any Solana program in a powerful standardised format known as the Kinobi IDL. This IDL can then be used to create a variety of utility such as rendering client code for your programs in various languages/frameworks, generating CLIs and providing more information to explorers.
+Codama is a tool that describes any Solana program in a powerful standardised format known as the Codama IDL. This IDL can then be used to create a variety of utility such as rendering client code for your programs in various languages/frameworks, generating CLIs and providing more information to explorers.
 
-![Kinobi header: A small double-sided mind-map with the Kinobi logo in the middle. On the left, we see the various ways to get a Kinobi IDL from your Solana programs such as "Anchor Program" and "Shank macros". On the right, we see the various utility tools that are offered for the IDL such as "Rendering client code" or "Rendering documentation".](https://github.com/kinobi-so/kinobi/assets/3642397/11161fb6-1ef4-446d-bf73-ce04484519a0)
+![Codama header: A small double-sided mind-map with the Codama logo in the middle. On the left, we see the various ways to get a Codama IDL from your Solana programs such as "Anchor Program" and "Shank macros". On the right, we see the various utility tools that are offered for the IDL such as "Rendering client code" or "Rendering documentation".](https://github.com/codama-idl/codama/assets/3642397/11161fb6-1ef4-446d-bf73-ce04484519a0)
 
 ## Nodes and visitors
 
-The Kinobi IDL is designed as a tree of nodes starting with the `RootNode` which contains a `ProgramNode` and additional data such as the Kinobi version used when the IDL was created. Kinobi provides over 60 different types of nodes that help describe just about any aspect of your Solana programs. [You can read more about the Kinobi nodes here](./packages/nodes).
+The Codama IDL is designed as a tree of nodes starting with the `RootNode` which contains a `ProgramNode` and additional data such as the Codama version used when the IDL was created. Codama provides over 60 different types of nodes that help describe just about any aspect of your Solana programs. [You can read more about the Codama nodes here](./packages/nodes).
 
-![A small example of a Kinobi IDL as a tree of nodes. It starts with a RootNode and goes down to ProgramNode, AccountNode, InstructionNode, etc.](https://github.com/kinobi-so/kinobi/assets/3642397/9d53485d-a4f6-459a-b7eb-58faab716bc1)
+![A small example of a Codama IDL as a tree of nodes. It starts with a RootNode and goes down to ProgramNode, AccountNode, InstructionNode, etc.](https://github.com/codama-idl/codama/assets/3642397/9d53485d-a4f6-459a-b7eb-58faab716bc1)
 
-Because everything is designed as a `Node`, we can transform the IDL, aggregate information and output various utility tools using special objects that can traverse node trees known as visitors. [See this documentation to learn more about Kinobi visitors](./packages/visitors).
+Because everything is designed as a `Node`, we can transform the IDL, aggregate information and output various utility tools using special objects that can traverse node trees known as visitors. [See this documentation to learn more about Codama visitors](./packages/visitors).
 
-![A small example of how a visitor can transform a Kinobi IDL into another Kinobi IDL. This example illustrates the "deleteNodesVisitor" which recursively removes NumberTypeNodes from a tree of nested TypleTypeNodes.](https://github.com/kinobi-so/kinobi/assets/3642397/f54e83d1-eade-4674-80dc-7ddc360f5f66)
+![A small example of how a visitor can transform a Codama IDL into another Codama IDL. This example illustrates the "deleteNodesVisitor" which recursively removes NumberTypeNodes from a tree of nested TypleTypeNodes.](https://github.com/codama-idl/codama/assets/3642397/f54e83d1-eade-4674-80dc-7ddc360f5f66)
 
-## From program to Kinobi
+## From program to Codama
 
-There are various ways to extract information from your Solana programs in order to obtain a Kinobi IDL.
+There are various ways to extract information from your Solana programs in order to obtain a Codama IDL.
 
--   **Using Kinobi macros**. This is not yet available but you will soon have access to a set of Rust macros that help attach IDL information directly within your Rust code. These macros enable Kinobi IDLs to be generated whenever you build your programs.
--   **From Anchor IDLs**. If you are using [Anchor programs](https://github.com/coral-xyz/anchor) or [Shank macros](https://github.com/metaplex-foundation/shank), then you can get an Anchor IDL from them. You can then use the `@kinobi-so/nodes-from-anchor` package to convert that IDL into a Kinobi IDL as shown in the code snippet below. Note that the Anchor IDL might not offer all the information that Kinobi can hold and therefore, you may want to transform your Kinobi IDL to provide additional information. You can learn more about this in the next section.
+-   **Using Codama macros**. This is not yet available but you will soon have access to a set of Rust macros that help attach IDL information directly within your Rust code. These macros enable Codama IDLs to be generated whenever you build your programs.
+-   **From Anchor IDLs**. If you are using [Anchor programs](https://github.com/coral-xyz/anchor) or [Shank macros](https://github.com/metaplex-foundation/shank), then you can get an Anchor IDL from them. You can then use the `@codama/nodes-from-anchor` package to convert that IDL into a Codama IDL as shown in the code snippet below. Note that the Anchor IDL might not offer all the information that Codama can hold and therefore, you may want to transform your Codama IDL to provide additional information. You can learn more about this in the next section.
 
     ```ts
-    import { createFromRoot } from 'kinobi';
-    import { rootNodeFromAnchor } from '@kinobi-so/nodes-from-anchor';
+    import { createFromRoot } from 'codama';
+    import { rootNodeFromAnchor } from '@codama/nodes-from-anchor';
     import anchorIdl from 'anchor-idl.json';
 
-    const kinobi = createFromRoot(rootNodeFromAnchor(anchorIdl));
+    const codama = createFromRoot(rootNodeFromAnchor(anchorIdl));
     ```
 
--   **By hand**. If your Solana program cannot be updated to use Kinobi macros and you don’t have an Anchor IDL, you may design your Kinobi IDL by hand. We may provide tools such as a Kinobi Playground to help with that in the future.
+-   **By hand**. If your Solana program cannot be updated to use Codama macros and you don’t have an Anchor IDL, you may design your Codama IDL by hand. We may provide tools such as a Codama Playground to help with that in the future.
 
-## Transforming Kinobi
+## Transforming Codama
 
-Once you have your Kinobi IDL, you may use visitors to transform it. This can be useful when the Kinobi IDL was obtained from another source that may not contain some necessary information. Here is an example using two provided visitors that adjusts the accounts and instructions on the program.
+Once you have your Codama IDL, you may use visitors to transform it. This can be useful when the Codama IDL was obtained from another source that may not contain some necessary information. Here is an example using two provided visitors that adjusts the accounts and instructions on the program.
 
 ```ts
-import { updateAccountsVisitor, updateInstructionsVisitor } from 'kinobi';
+import { updateAccountsVisitor, updateInstructionsVisitor } from 'codama';
 
-kinobi.update(updateAccountsVisitor({ ... }));
-kinobi.update(updateInstructionsVisitor({ ... }));
+codama.update(updateAccountsVisitor({ ... }));
+codama.update(updateInstructionsVisitor({ ... }));
 ```
 
-## From Kinobi to utility
+## From Codama to utility
 
-Now that you have the perfect Kinobi IDL for your Solana program, you can benefit from all the visitors and tools that provide utility such as rendering client code or registering your IDL on-chain so explorers can dynamically display relevant information for your program.
+Now that you have the perfect Codama IDL for your Solana program, you can benefit from all the visitors and tools that provide utility such as rendering client code or registering your IDL on-chain so explorers can dynamically display relevant information for your program.
 
-_Note that some features such as rendering CLIs are not yet available. However, because the Kinobi IDL is designed as a tree of nodes, these features are only a visitor away from being ready. Feel free to reach out if you’d like to contribute to this Kinobi ecosystem._
+_Note that some features such as rendering CLIs are not yet available. However, because the Codama IDL is designed as a tree of nodes, these features are only a visitor away from being ready. Feel free to reach out if you’d like to contribute to this Codama ecosystem._
 
--   **Rendering client code**. Want people to start interacting with your Solana program? You can use special visitors that go through your Kinobi IDL and generate client code that you can then publish for your end-users. Currently, we have the following renderers available:
+-   **Rendering client code**. Want people to start interacting with your Solana program? You can use special visitors that go through your Codama IDL and generate client code that you can then publish for your end-users. Currently, we have the following renderers available:
 
-    -   `@kinobi-so/renderers-js`: Renders a JavaScript client compatible with the soon-to-be-released 2.0 line of [`@solana/web3.js`](https://github.com/solana-labs/solana-web3.js).
-    -   `@kinobi-so/renderers-js-umi`: Renders a JavaScript client compatible with Metaplex’s [Umi](https://github.com/metaplex-foundation/umi) framework.
-    -   `@kinobi-so/renderers-rust`: Renders a Rust client that removes the need for publishing the program crate and offers a better developer experience.
+    -   `@codama/renderers-js`: Renders a JavaScript client compatible with the soon-to-be-released 2.0 line of [`@solana/web3.js`](https://github.com/solana-labs/solana-web3.js).
+    -   `@codama/renderers-js-umi`: Renders a JavaScript client compatible with Metaplex’s [Umi](https://github.com/metaplex-foundation/umi) framework.
+    -   `@codama/renderers-rust`: Renders a Rust client that removes the need for publishing the program crate and offers a better developer experience.
     -   _And more to come._
 
     Here’s an example of how to generate JavaScript and Rust client code for your program.
 
     ```ts
-    import { renderJavaScriptVisitor, renderRustVisitor } from '@kinobi-so/renderers';
+    import { renderJavaScriptVisitor, renderRustVisitor } from '@codama/renderers';
 
-    kinobi.accept(renderJavaScriptVisitor('clients/js/src/generated', { ... }));
-    kinobi.accept(renderRustVisitor('clients/rust/src/generated', { ... }));
+    codama.accept(renderJavaScriptVisitor('clients/js/src/generated', { ... }));
+    codama.accept(renderRustVisitor('clients/rust/src/generated', { ... }));
     ```
 
--   **Registering your Kinobi IDL on-chain** (_Coming soon_). Perhaps the biggest benefit of having a Kinobi IDL from your program is that you can share it on-chain with the rest of the ecosystem. This means explorers may now use this information to provide a better experience for users of your programs. Additionally, anyone can now grab your Kinobi IDL, select the portion they are interested in and benefit from the same ecosystem of Kinobi visitors to iterate over it. For instance, an app could decide to grab the IDLs of all programs they depend on, filter out the accounts and instructions they don’t need and generate a bespoke client for their app that only contains the functions the app needs.
--   **Rendering CLIs** (_Not yet available_). Whilst not available yet, we can imagine a set of CLI commands that can be generated from our Kinobi IDL (much like our clients) so that end-users can fetch decoded accounts and send instructions directly from their terminal.
--   **Rendering documentation** (_Not yet available_). Similarly to CLIs, we may easily generate documentation in various formats from the information held by our Kinobi IDL.
+-   **Registering your Codama IDL on-chain** (_Coming soon_). Perhaps the biggest benefit of having a Codama IDL from your program is that you can share it on-chain with the rest of the ecosystem. This means explorers may now use this information to provide a better experience for users of your programs. Additionally, anyone can now grab your Codama IDL, select the portion they are interested in and benefit from the same ecosystem of Codama visitors to iterate over it. For instance, an app could decide to grab the IDLs of all programs they depend on, filter out the accounts and instructions they don’t need and generate a bespoke client for their app that only contains the functions the app needs.
+-   **Rendering CLIs** (_Not yet available_). Whilst not available yet, we can imagine a set of CLI commands that can be generated from our Codama IDL (much like our clients) so that end-users can fetch decoded accounts and send instructions directly from their terminal.
+-   **Rendering documentation** (_Not yet available_). Similarly to CLIs, we may easily generate documentation in various formats from the information held by our Codama IDL.

+ 2 - 2
package.json

@@ -1,5 +1,5 @@
 {
-    "name": "kinobi-monorepo",
+    "name": "codama-monorepo",
     "private": true,
     "workspaces": [
         "packages/*"
@@ -14,7 +14,7 @@
     "devDependencies": {
         "@changesets/changelog-github": "^0.5.0",
         "@changesets/cli": "^2.27.9",
-        "@kinobi-so/internals": "workspace:*",
+        "@codama/internals": "workspace:*",
         "@solana/eslint-config-solana": "^3.0.3",
         "@solana/prettier-config-solana": "0.0.5",
         "@types/node": "^20",

+ 27 - 27
packages/errors/CHANGELOG.md

@@ -1,116 +1,116 @@
-# @kinobi-so/errors
+# @codama/errors
 
 ## 0.22.0
 
 ### Minor Changes
 
--   [#183](https://github.com/kinobi-so/kinobi/pull/183) [`c8c5934`](https://github.com/kinobi-so/kinobi/commit/c8c593466294f3ec7dca1fb828254e10aa312925) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add `InstructionLinkNode`, `InstructionAccountLinkNode` and `InstructionArgumentLinkNode`
+-   [#183](https://github.com/codama-idl/codama/pull/183) [`c8c5934`](https://github.com/codama-idl/codama/commit/c8c593466294f3ec7dca1fb828254e10aa312925) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add `InstructionLinkNode`, `InstructionAccountLinkNode` and `InstructionArgumentLinkNode`
 
 ### Patch Changes
 
--   [#180](https://github.com/kinobi-so/kinobi/pull/180) [`93a318a`](https://github.com/kinobi-so/kinobi/commit/93a318a9b7ee435eb37934b0ab390e160d50968b) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add optional `program` attribute to link nodes and namespace linkable nodes under their associated program.
+-   [#180](https://github.com/codama-idl/codama/pull/180) [`93a318a`](https://github.com/codama-idl/codama/commit/93a318a9b7ee435eb37934b0ab390e160d50968b) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add optional `program` attribute to link nodes and namespace linkable nodes under their associated program.
 
--   Updated dependencies [[`c8c5934`](https://github.com/kinobi-so/kinobi/commit/c8c593466294f3ec7dca1fb828254e10aa312925), [`2b1259b`](https://github.com/kinobi-so/kinobi/commit/2b1259b566aa439ca61c28f7ef72ff9c0817e540), [`93a318a`](https://github.com/kinobi-so/kinobi/commit/93a318a9b7ee435eb37934b0ab390e160d50968b)]:
-    -   @kinobi-so/node-types@0.22.0
+-   Updated dependencies [[`c8c5934`](https://github.com/codama-idl/codama/commit/c8c593466294f3ec7dca1fb828254e10aa312925), [`2b1259b`](https://github.com/codama-idl/codama/commit/2b1259b566aa439ca61c28f7ef72ff9c0817e540), [`93a318a`](https://github.com/codama-idl/codama/commit/93a318a9b7ee435eb37934b0ab390e160d50968b)]:
+    -   @codama/node-types@0.22.0
 
 ## 0.21.5
 
 ### Patch Changes
 
--   [#204](https://github.com/kinobi-so/kinobi/pull/204) [`a6849d3`](https://github.com/kinobi-so/kinobi/commit/a6849d36a828e2b6b703f2a86d2ea0ae6d2fa0d8) Thanks [@aspnxdd](https://github.com/aspnxdd)! - Fix `KINOBI_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE` instructionName string to actually print the instructionName.
+-   [#204](https://github.com/codama-idl/codama/pull/204) [`a6849d3`](https://github.com/codama-idl/codama/commit/a6849d36a828e2b6b703f2a86d2ea0ae6d2fa0d8) Thanks [@aspnxdd](https://github.com/aspnxdd)! - Fix `codama_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE` instructionName string to actually print the instructionName.
 
 -   Updated dependencies []:
-    -   @kinobi-so/node-types@0.21.5
+    -   @codama/node-types@0.21.5
 
 ## 0.21.4
 
 ### Patch Changes
 
 -   Updated dependencies []:
-    -   @kinobi-so/node-types@0.21.4
+    -   @codama/node-types@0.21.4
 
 ## 0.21.3
 
 ### Patch Changes
 
 -   Updated dependencies []:
-    -   @kinobi-so/node-types@0.21.3
+    -   @codama/node-types@0.21.3
 
 ## 0.21.2
 
 ### Patch Changes
 
 -   Updated dependencies []:
-    -   @kinobi-so/node-types@0.21.2
+    -   @codama/node-types@0.21.2
 
 ## 0.21.1
 
 ### Patch Changes
 
 -   Updated dependencies []:
-    -   @kinobi-so/node-types@0.21.1
+    -   @codama/node-types@0.21.1
 
 ## 0.21.0
 
 ### Minor Changes
 
--   [#111](https://github.com/kinobi-so/kinobi/pull/111) [`2f26050`](https://github.com/kinobi-so/kinobi/commit/2f26050ddbcbdefcefbd853e1017a30c94442e1f) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add `RemainderOptionTypeNode`
+-   [#111](https://github.com/codama-idl/codama/pull/111) [`2f26050`](https://github.com/codama-idl/codama/commit/2f26050ddbcbdefcefbd853e1017a30c94442e1f) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add `RemainderOptionTypeNode`
 
     A node that represents an optional item using a child `TypeNode` such that the item can either be present — i.e. `Some<T>` — or absent — i.e. `None` — depending on whether or not there are remaining bytes in the buffer.
 
 ### Patch Changes
 
--   Updated dependencies [[`2f26050`](https://github.com/kinobi-so/kinobi/commit/2f26050ddbcbdefcefbd853e1017a30c94442e1f)]:
-    -   @kinobi-so/node-types@0.21.0
+-   Updated dependencies [[`2f26050`](https://github.com/codama-idl/codama/commit/2f26050ddbcbdefcefbd853e1017a30c94442e1f)]:
+    -   @codama/node-types@0.21.0
 
 ## 0.20.6
 
 ### Patch Changes
 
--   [#102](https://github.com/kinobi-so/kinobi/pull/102) [`bcf6a23`](https://github.com/kinobi-so/kinobi/commit/bcf6a23fa0e0d1f1a064ea6ddcfc9c092190a51f) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Replace \_\_DEV\_\_ with NODE_ENV is not production in Kinobi
+-   [#102](https://github.com/codama-idl/codama/pull/102) [`bcf6a23`](https://github.com/codama-idl/codama/commit/bcf6a23fa0e0d1f1a064ea6ddcfc9c092190a51f) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Replace \_\_DEV\_\_ with NODE_ENV is not production in codama
 
 -   Updated dependencies []:
-    -   @kinobi-so/node-types@0.20.6
+    -   @codama/node-types@0.20.6
 
 ## 0.20.5
 
 ### Patch Changes
 
--   [#42](https://github.com/kinobi-so/kinobi/pull/42) [`908acba`](https://github.com/kinobi-so/kinobi/commit/908acba99cdb0b761ed79aebf6828e23fde97ef8) Thanks [@kespinola](https://github.com/kespinola)! - set anchor account seed definitions on instructions as defaultValue for the associated instruction account. Removes hoisting PDAs to the program node for the time being.
+-   [#42](https://github.com/codama-idl/codama/pull/42) [`908acba`](https://github.com/codama-idl/codama/commit/908acba99cdb0b761ed79aebf6828e23fde97ef8) Thanks [@kespinola](https://github.com/kespinola)! - set anchor account seed definitions on instructions as defaultValue for the associated instruction account. Removes hoisting PDAs to the program node for the time being.
 
 -   Updated dependencies []:
-    -   @kinobi-so/node-types@0.20.5
+    -   @codama/node-types@0.20.5
 
 ## 0.20.4
 
 ### Patch Changes
 
--   Updated dependencies [[`668b550`](https://github.com/kinobi-so/kinobi/commit/668b550aa2172c24ddb3b8751d91e67e94a93fa4)]:
-    -   @kinobi-so/node-types@0.20.4
+-   Updated dependencies [[`668b550`](https://github.com/codama-idl/codama/commit/668b550aa2172c24ddb3b8751d91e67e94a93fa4)]:
+    -   @codama/node-types@0.20.4
 
 ## 0.20.3
 
 ### Patch Changes
 
--   [#40](https://github.com/kinobi-so/kinobi/pull/40) [`4bc5823`](https://github.com/kinobi-so/kinobi/commit/4bc5823377824198bd5a6432d16333b2cb1d8b8c) Thanks [@febo](https://github.com/febo)! - Fix typo in error message
+-   [#40](https://github.com/codama-idl/codama/pull/40) [`4bc5823`](https://github.com/codama-idl/codama/commit/4bc5823377824198bd5a6432d16333b2cb1d8b8c) Thanks [@febo](https://github.com/febo)! - Fix typo in error message
 
 -   Updated dependencies []:
-    -   @kinobi-so/node-types@0.20.3
+    -   @codama/node-types@0.20.3
 
 ## 0.20.2
 
 ### Patch Changes
 
--   [`964776f`](https://github.com/kinobi-so/kinobi/commit/964776fe73402c236d334032821013674c3b1a5e) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix invalid package dependencies
+-   [`964776f`](https://github.com/codama-idl/codama/commit/964776fe73402c236d334032821013674c3b1a5e) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix invalid package dependencies
 
--   Updated dependencies [[`964776f`](https://github.com/kinobi-so/kinobi/commit/964776fe73402c236d334032821013674c3b1a5e)]:
-    -   @kinobi-so/node-types@0.20.2
+-   Updated dependencies [[`964776f`](https://github.com/codama-idl/codama/commit/964776fe73402c236d334032821013674c3b1a5e)]:
+    -   @codama/node-types@0.20.2
 
 ## 0.20.1
 
 ### Patch Changes
 
--   [#21](https://github.com/kinobi-so/kinobi/pull/21) [`0dec0c8`](https://github.com/kinobi-so/kinobi/commit/0dec0c8fff5e80fafc964416058e4ddf1db2bda0) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix ESM and CJS exports on renderers
+-   [#21](https://github.com/codama-idl/codama/pull/21) [`0dec0c8`](https://github.com/codama-idl/codama/commit/0dec0c8fff5e80fafc964416058e4ddf1db2bda0) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix ESM and CJS exports on renderers
 
 -   Updated dependencies []:
-    -   @kinobi-so/node-types@0.20.1
+    -   @codama/node-types@0.20.1

+ 1 - 1
packages/errors/LICENSE

@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2024 Kinobi
+Copyright (c) 2024 Codama
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the

+ 19 - 19
packages/errors/README.md

@@ -1,25 +1,25 @@
-# Kinobi ➤ Errors
+# Codama ➤ Errors
 
 [![npm][npm-image]][npm-url]
 [![npm-downloads][npm-downloads-image]][npm-url]
 
-[npm-downloads-image]: https://img.shields.io/npm/dm/@kinobi-so/errors.svg?style=flat
-[npm-image]: https://img.shields.io/npm/v/@kinobi-so/errors.svg?style=flat&label=%40kinobi-so%2Ferrors
-[npm-url]: https://www.npmjs.com/package/@kinobi-so/errors
+[npm-downloads-image]: https://img.shields.io/npm/dm/@codama/errors.svg?style=flat
+[npm-image]: https://img.shields.io/npm/v/@codama/errors.svg?style=flat&label=%40codama%2Ferrors
+[npm-url]: https://www.npmjs.com/package/@codama/errors
 
-This package defines a `KinobiError` class that accepts a specific error code and a context object based on that code. It enables us to catch and handle errors in a more structured way.
+This package defines a `CodamaError` class that accepts a specific error code and a context object based on that code. It enables us to catch and handle errors in a more structured way.
 
 ## Installation
 
 ```sh
-pnpm install @kinobi-so/errors
+pnpm install @codama/errors
 ```
 
 > [!NOTE]
-> This package is included in the main [`kinobi`](../library) package. Meaning, you already have access to its content if you are installing Kinobi this way.
+> This package is included in the main [`codama`](../library) package. Meaning, you already have access to its content if you are installing Codama this way.
 >
 > ```sh
-> pnpm install kinobi
+> pnpm install codama
 > ```
 
 ## Reading error messages
@@ -35,24 +35,24 @@ On the other hand, when `NODE_ENV` is set to `"production"`, error messages will
 For instance, to recover the error text for the error with code `123`:
 
 ```shell
-npx @kinobi-so/errors decode -- 123
+npx @codama/errors decode -- 123
 ```
 
 ## Catching errors
 
-When you catch a `KinobiError` and assert its error code using `isKinobiError()`, TypeScript will refine the error's context to the type associated with that error code. You can use that context to render useful error messages, or to make context-aware decisions that help your application to recover from the error.
+When you catch a `CodamaError` and assert its error code using `isCodamaError()`, TypeScript will refine the error's context to the type associated with that error code. You can use that context to render useful error messages, or to make context-aware decisions that help your application to recover from the error.
 
 ```ts
-import { KINOBI_ERROR__UNEXPECTED_NODE_KIND, isKinobiError } from '@kinobi-so/errors';
+import { CODAMA_ERROR__UNEXPECTED_NODE_KIND, isCodamaError } from '@codama/errors';
 
 try {
-    const kinobi = createFromJson(jsonIdl);
+    const codama = createFromJson(jsonIdl);
 } catch (e) {
-    if (isKinobiError(e, KINOBI_ERROR__UNEXPECTED_NODE_KIND)) {
+    if (isCodamaError(e, CODAMA_ERROR__UNEXPECTED_NODE_KIND)) {
         const { expectedKinds, kind, node } = e.context;
         // ...
-    } else if (isKinobiError(e, KINOBI_ERROR__VERSION_MISMATCH)) {
-        const { kinobiVersion, rootVersion } = e.context;
+    } else if (isCodamaError(e, CODAMA_ERROR__VERSION_MISMATCH)) {
+        const { codamaVersion, rootVersion } = e.context;
         // ...
     } else {
         throw e;
@@ -64,14 +64,14 @@ try {
 
 ### Adding a new error
 
-To add a new error in Kinobi, follow these steps:
+To add a new error in Codama, follow these steps:
 
 1. Add a new exported error code constant to `src/codes.ts`. Find the most appropriate group for your error and ensure it is appended to the end of that group.
-2. Add that new constant to the `KinobiErrorCode` union in `src/codes.ts`.
+2. Add that new constant to the `CodamaErrorCode` union in `src/codes.ts`.
 3. If you would like the new error to encapsulate context about the error itself define that context in `src/context.ts`.
 4. Add the error's message to `src/messages.ts`. Any context values that you defined above will be interpolated into the message wherever you write `$key`, where `key` is the index of a value in the context (eg. ``'Unrecognized node `$kind`.'``).
-5. Publish a new version of `@kinobi-so/errors` using changesets — maintainers will handle this via tha changesets CI workflow.
-6. Bump the version of `@kinobi-so/errors` or `kinobi` in the consumer package from which the error is thrown.
+5. Publish a new version of `@codama/errors` using changesets — maintainers will handle this via tha changesets CI workflow.
+6. Bump the version of `@codama/errors` or `codama` in the consumer package from which the error is thrown.
 
 ### Removing an error message
 

+ 16 - 16
packages/errors/package.json

@@ -1,7 +1,7 @@
 {
-    "name": "@kinobi-so/errors",
+    "name": "@codama/errors",
     "version": "0.22.0",
-    "description": "Error management for Kinobi",
+    "description": "Error management for Codama",
     "exports": {
         "types": "./dist/types/index.d.ts",
         "react-native": "./dist/index.react-native.mjs",
@@ -39,31 +39,31 @@
     ],
     "scripts": {
         "build": "rimraf dist && pnpm build:src && pnpm build:cli && pnpm build:types",
-        "build:src": "zx ../../node_modules/@kinobi-so/internals/scripts/build-src.mjs package",
-        "build:cli": "zx ../../node_modules/@kinobi-so/internals/scripts/build-src.mjs cli",
-        "build:types": "zx ../../node_modules/@kinobi-so/internals/scripts/build-types.mjs",
-        "dev": "zx ../../node_modules/@kinobi-so/internals/scripts/test-unit.mjs node --watch",
-        "lint": "zx ../../node_modules/@kinobi-so/internals/scripts/lint.mjs",
-        "lint:fix": "zx ../../node_modules/@kinobi-so/internals/scripts/lint.mjs --fix",
+        "build:src": "zx ../../node_modules/@codama/internals/scripts/build-src.mjs package",
+        "build:cli": "zx ../../node_modules/@codama/internals/scripts/build-src.mjs cli",
+        "build:types": "zx ../../node_modules/@codama/internals/scripts/build-types.mjs",
+        "dev": "zx ../../node_modules/@codama/internals/scripts/test-unit.mjs node --watch",
+        "lint": "zx ../../node_modules/@codama/internals/scripts/lint.mjs",
+        "lint:fix": "zx ../../node_modules/@codama/internals/scripts/lint.mjs --fix",
         "test": "pnpm test:types && pnpm test:treeshakability && pnpm test:browser && pnpm test:node && pnpm test:react-native",
-        "test:browser": "zx ../../node_modules/@kinobi-so/internals/scripts/test-unit.mjs browser",
-        "test:node": "zx ../../node_modules/@kinobi-so/internals/scripts/test-unit.mjs node",
-        "test:react-native": "zx ../../node_modules/@kinobi-so/internals/scripts/test-unit.mjs react-native",
-        "test:treeshakability": "zx ../../node_modules/@kinobi-so/internals/scripts/test-treeshakability.mjs",
-        "test:types": "zx ../../node_modules/@kinobi-so/internals/scripts/test-types.mjs"
+        "test:browser": "zx ../../node_modules/@codama/internals/scripts/test-unit.mjs browser",
+        "test:node": "zx ../../node_modules/@codama/internals/scripts/test-unit.mjs node",
+        "test:react-native": "zx ../../node_modules/@codama/internals/scripts/test-unit.mjs react-native",
+        "test:treeshakability": "zx ../../node_modules/@codama/internals/scripts/test-treeshakability.mjs",
+        "test:types": "zx ../../node_modules/@codama/internals/scripts/test-types.mjs"
     },
     "dependencies": {
-        "@kinobi-so/node-types": "workspace:*",
+        "@codama/node-types": "workspace:*",
         "commander": "^12.1.0",
         "chalk": "^5.3.0"
     },
     "license": "MIT",
     "repository": {
         "type": "git",
-        "url": "https://github.com/kinobi-so/kinobi"
+        "url": "https://github.com/codama-idl/codama"
     },
     "bugs": {
-        "url": "http://github.com/kinobi-so/kinobi/issues"
+        "url": "http://github.com/codama-idl/codama/issues"
     },
     "browserslist": [
         "supports bigint and not dead",

+ 7 - 7
packages/errors/src/cli.ts

@@ -7,24 +7,24 @@ import chalk from 'chalk';
 import { Command, InvalidArgumentError } from 'commander';
 
 import { version } from '../package.json';
-import { KinobiErrorCode } from './codes';
+import { CodamaErrorCode } from './codes';
 import { decodeEncodedContext } from './context';
 import { getHumanReadableErrorMessage } from './message-formatter';
-import { KinobiErrorMessages } from './messages';
+import { CodamaErrorMessages } from './messages';
 
 const program = new Command();
 
-program.name('@kinobi-so/errors').description('Decode Kinobi JavaScript errors thrown in production').version(version);
+program.name('@codama/errors').description('Decode Codama JavaScript errors thrown in production').version(version);
 
 program
     .command('decode')
-    .description('Decode a `KinobiErrorCode` to a human-readable message')
+    .description('Decode a `CodamaErrorCode` to a human-readable message')
     .argument('<code>', 'numeric error code to decode', rawCode => {
         const code = parseInt(rawCode, 10);
         if (isNaN(code) || `${code}` !== rawCode) {
             throw new InvalidArgumentError('It must be an integer');
         }
-        if (!(code in KinobiErrorMessages)) {
+        if (!(code in CodamaErrorMessages)) {
             throw new InvalidArgumentError('There exists no error with that code');
         }
         return code;
@@ -37,7 +37,7 @@ program
         }
     })
     .action((code: number, context) => {
-        const message = getHumanReadableErrorMessage(code as KinobiErrorCode, context);
+        const message = getHumanReadableErrorMessage(code as CodamaErrorCode, context);
         console.log(`
 ${
     chalk.bold(
@@ -50,7 +50,7 @@ ${
             chalk.rgb(79, 212, 181)('e') +
             chalk.rgb(57, 227, 166)('d') +
             chalk.rgb(19, 241, 149)(']'),
-    ) + chalk.rgb(19, 241, 149)(' Kinobi error code #' + code)
+    ) + chalk.rgb(19, 241, 149)(' Codama error code #' + code)
 }
     - ${message}`);
         if (context) {

+ 51 - 51
packages/errors/src/codes.ts

@@ -25,43 +25,43 @@
  *     - `_MISSING`: Some required input is missing. E.g. `TRANSACTION_FEE_PAYER_MISSING`.
  *     - `_UNIMPLEMENTED`: Some required component is not available in the environment. E.g. `SUBTLE_CRYPTO_VERIFY_FUNCTION_UNIMPLEMENTED`.
  */
-export const KINOBI_ERROR__UNRECOGNIZED_NODE_KIND = 1 as const;
-export const KINOBI_ERROR__UNEXPECTED_NODE_KIND = 2 as const;
-export const KINOBI_ERROR__UNEXPECTED_NESTED_NODE_KIND = 3 as const;
-export const KINOBI_ERROR__LINKED_NODE_NOT_FOUND = 4 as const;
-export const KINOBI_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE = 5 as const;
-export const KINOBI_ERROR__VERSION_MISMATCH = 6 as const;
+export const CODAMA_ERROR__UNRECOGNIZED_NODE_KIND = 1 as const;
+export const CODAMA_ERROR__UNEXPECTED_NODE_KIND = 2 as const;
+export const CODAMA_ERROR__UNEXPECTED_NESTED_NODE_KIND = 3 as const;
+export const CODAMA_ERROR__LINKED_NODE_NOT_FOUND = 4 as const;
+export const CODAMA_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE = 5 as const;
+export const CODAMA_ERROR__VERSION_MISMATCH = 6 as const;
 
 // Visitors-related errors.
 // Reserve error codes in the range [1200000-1200999].
-export const KINOBI_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES = 1200000 as const;
-export const KINOBI_ERROR__VISITORS__INVALID_PDA_SEED_VALUES = 1200001 as const;
-export const KINOBI_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES =
+export const CODAMA_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES = 1200000 as const;
+export const CODAMA_ERROR__VISITORS__INVALID_PDA_SEED_VALUES = 1200001 as const;
+export const CODAMA_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES =
     1200002 as const;
-export const KINOBI_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE = 1200003 as const;
-export const KINOBI_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY = 1200004 as const;
-export const KINOBI_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND = 1200005 as const;
-export const KINOBI_ERROR__VISITORS__INVALID_NUMBER_WRAPPER = 1200006 as const;
-export const KINOBI_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION = 1200007 as const;
-export const KINOBI_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE = 1200008 as const;
-export const KINOBI_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND = 1200009 as const;
-export const KINOBI_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES = 1200010 as const;
-export const KINOBI_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND = 1200011 as const;
+export const CODAMA_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE = 1200003 as const;
+export const CODAMA_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY = 1200004 as const;
+export const CODAMA_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND = 1200005 as const;
+export const CODAMA_ERROR__VISITORS__INVALID_NUMBER_WRAPPER = 1200006 as const;
+export const CODAMA_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION = 1200007 as const;
+export const CODAMA_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE = 1200008 as const;
+export const CODAMA_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND = 1200009 as const;
+export const CODAMA_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES = 1200010 as const;
+export const CODAMA_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND = 1200011 as const;
 
 // Anchor-related errors.
 // Reserve error codes in the range [2100000-2100999].
-export const KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE = 2100000 as const;
-export const KINOBI_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING = 2100001 as const;
-export const KINOBI_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING = 2100002 as const;
-export const KINOBI_ERROR__ANCHOR__TYPE_PATH_MISSING = 2100003 as const;
-export const KINOBI_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED = 2100004 as const;
+export const CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE = 2100000 as const;
+export const CODAMA_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING = 2100001 as const;
+export const CODAMA_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING = 2100002 as const;
+export const CODAMA_ERROR__ANCHOR__TYPE_PATH_MISSING = 2100003 as const;
+export const CODAMA_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED = 2100004 as const;
 
 // Renderers-related errors.
 // Reserve error codes in the range [2800000-2800999].
-export const KINOBI_ERROR__RENDERERS__UNSUPPORTED_NODE = 2800000 as const;
+export const CODAMA_ERROR__RENDERERS__UNSUPPORTED_NODE = 2800000 as const;
 
 /**
- * A union of every Kinobi error code
+ * A union of every Codama error code
  *
  * You might be wondering why this is not a TypeScript enum or const enum.
  *
@@ -72,31 +72,31 @@ export const KINOBI_ERROR__RENDERERS__UNSUPPORTED_NODE = 2800000 as const;
  * single error code) would be forced to bundle every code and its label.
  *
  * Const enums appear to solve this problem by letting the compiler inline only the codes that are
- * actually used. Unfortunately exporting ambient (const) enums from a library like `@kinobi-so/errors`
+ * actually used. Unfortunately exporting ambient (const) enums from a library like `@codama/errors`
  * is not safe, for a variety of reasons covered here: https://stackoverflow.com/a/28818850
  */
-export type KinobiErrorCode =
-    | typeof KINOBI_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING
-    | typeof KINOBI_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING
-    | typeof KINOBI_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED
-    | typeof KINOBI_ERROR__ANCHOR__TYPE_PATH_MISSING
-    | typeof KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE
-    | typeof KINOBI_ERROR__LINKED_NODE_NOT_FOUND
-    | typeof KINOBI_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE
-    | typeof KINOBI_ERROR__RENDERERS__UNSUPPORTED_NODE
-    | typeof KINOBI_ERROR__UNEXPECTED_NESTED_NODE_KIND
-    | typeof KINOBI_ERROR__UNEXPECTED_NODE_KIND
-    | typeof KINOBI_ERROR__UNRECOGNIZED_NODE_KIND
-    | typeof KINOBI_ERROR__VERSION_MISMATCH
-    | typeof KINOBI_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND
-    | typeof KINOBI_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES
-    | typeof KINOBI_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION
-    | typeof KINOBI_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES
-    | typeof KINOBI_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE
-    | typeof KINOBI_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES
-    | typeof KINOBI_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE
-    | typeof KINOBI_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND
-    | typeof KINOBI_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY
-    | typeof KINOBI_ERROR__VISITORS__INVALID_NUMBER_WRAPPER
-    | typeof KINOBI_ERROR__VISITORS__INVALID_PDA_SEED_VALUES
-    | typeof KINOBI_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND;
+export type CodamaErrorCode =
+    | typeof CODAMA_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING
+    | typeof CODAMA_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING
+    | typeof CODAMA_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED
+    | typeof CODAMA_ERROR__ANCHOR__TYPE_PATH_MISSING
+    | typeof CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE
+    | typeof CODAMA_ERROR__LINKED_NODE_NOT_FOUND
+    | typeof CODAMA_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE
+    | typeof CODAMA_ERROR__RENDERERS__UNSUPPORTED_NODE
+    | typeof CODAMA_ERROR__UNEXPECTED_NESTED_NODE_KIND
+    | typeof CODAMA_ERROR__UNEXPECTED_NODE_KIND
+    | typeof CODAMA_ERROR__UNRECOGNIZED_NODE_KIND
+    | typeof CODAMA_ERROR__VERSION_MISMATCH
+    | typeof CODAMA_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND
+    | typeof CODAMA_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES
+    | typeof CODAMA_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION
+    | typeof CODAMA_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES
+    | typeof CODAMA_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE
+    | typeof CODAMA_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES
+    | typeof CODAMA_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE
+    | typeof CODAMA_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND
+    | typeof CODAMA_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY
+    | typeof CODAMA_ERROR__VISITORS__INVALID_NUMBER_WRAPPER
+    | typeof CODAMA_ERROR__VISITORS__INVALID_PDA_SEED_VALUES
+    | typeof CODAMA_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND;

+ 53 - 53
packages/errors/src/context.ts

@@ -16,108 +16,108 @@ import {
     PdaNode,
     PdaSeedValueNode,
     ProgramNode,
-} from '@kinobi-so/node-types';
+} from '@codama/node-types';
 
 import {
-    KINOBI_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING,
-    KINOBI_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING,
-    KINOBI_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED,
-    KINOBI_ERROR__ANCHOR__TYPE_PATH_MISSING,
-    KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE,
-    KINOBI_ERROR__LINKED_NODE_NOT_FOUND,
-    KINOBI_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE,
-    KINOBI_ERROR__RENDERERS__UNSUPPORTED_NODE,
-    KINOBI_ERROR__UNEXPECTED_NESTED_NODE_KIND,
-    KINOBI_ERROR__UNEXPECTED_NODE_KIND,
-    KINOBI_ERROR__UNRECOGNIZED_NODE_KIND,
-    KINOBI_ERROR__VERSION_MISMATCH,
-    KINOBI_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND,
-    KINOBI_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES,
-    KINOBI_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION,
-    KINOBI_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES,
-    KINOBI_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE,
-    KINOBI_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES,
-    KINOBI_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE,
-    KINOBI_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND,
-    KINOBI_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY,
-    KINOBI_ERROR__VISITORS__INVALID_NUMBER_WRAPPER,
-    KINOBI_ERROR__VISITORS__INVALID_PDA_SEED_VALUES,
-    KINOBI_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND,
-    KinobiErrorCode,
+    CODAMA_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING,
+    CODAMA_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING,
+    CODAMA_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED,
+    CODAMA_ERROR__ANCHOR__TYPE_PATH_MISSING,
+    CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE,
+    CODAMA_ERROR__LINKED_NODE_NOT_FOUND,
+    CODAMA_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE,
+    CODAMA_ERROR__RENDERERS__UNSUPPORTED_NODE,
+    CODAMA_ERROR__UNEXPECTED_NESTED_NODE_KIND,
+    CODAMA_ERROR__UNEXPECTED_NODE_KIND,
+    CODAMA_ERROR__UNRECOGNIZED_NODE_KIND,
+    CODAMA_ERROR__VERSION_MISMATCH,
+    CODAMA_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND,
+    CODAMA_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES,
+    CODAMA_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION,
+    CODAMA_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES,
+    CODAMA_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE,
+    CODAMA_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES,
+    CODAMA_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE,
+    CODAMA_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND,
+    CODAMA_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY,
+    CODAMA_ERROR__VISITORS__INVALID_NUMBER_WRAPPER,
+    CODAMA_ERROR__VISITORS__INVALID_PDA_SEED_VALUES,
+    CODAMA_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND,
+    CodamaErrorCode,
 } from './codes';
 
 type DefaultUnspecifiedErrorContextToUndefined<T> = {
-    [P in KinobiErrorCode]: P extends keyof T ? T[P] : undefined;
+    [P in CodamaErrorCode]: P extends keyof T ? T[P] : undefined;
 };
 
 /**
  * WARNING:
  *   - Don't change or remove members of an error's context.
  */
-export type KinobiErrorContext = DefaultUnspecifiedErrorContextToUndefined<{
-    [KINOBI_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING]: {
+export type CodamaErrorContext = DefaultUnspecifiedErrorContextToUndefined<{
+    [CODAMA_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING]: {
         name: string;
     };
-    [KINOBI_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING]: {
+    [CODAMA_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING]: {
         name: string;
     };
-    [KINOBI_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED]: {
+    [CODAMA_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED]: {
         kind: string;
     };
-    [KINOBI_ERROR__ANCHOR__TYPE_PATH_MISSING]: {
+    [CODAMA_ERROR__ANCHOR__TYPE_PATH_MISSING]: {
         idlType: string;
         path: string;
     };
-    [KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE]: {
+    [CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE]: {
         idlType: string;
     };
-    [KINOBI_ERROR__LINKED_NODE_NOT_FOUND]: {
+    [CODAMA_ERROR__LINKED_NODE_NOT_FOUND]: {
         kind: LinkNode['kind'];
         linkNode: LinkNode;
         name: CamelCaseString;
         stack: Node[];
     };
-    [KINOBI_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE]: {
+    [CODAMA_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE]: {
         fsFunction: string;
     };
-    [KINOBI_ERROR__RENDERERS__UNSUPPORTED_NODE]: {
+    [CODAMA_ERROR__RENDERERS__UNSUPPORTED_NODE]: {
         kind: NodeKind;
         node: Node | undefined;
     };
-    [KINOBI_ERROR__UNEXPECTED_NESTED_NODE_KIND]: {
+    [CODAMA_ERROR__UNEXPECTED_NESTED_NODE_KIND]: {
         expectedKinds: NodeKind[];
         kind: NodeKind | null;
         node: Node | null | undefined;
     };
-    [KINOBI_ERROR__UNEXPECTED_NODE_KIND]: {
+    [CODAMA_ERROR__UNEXPECTED_NODE_KIND]: {
         expectedKinds: NodeKind[];
         kind: NodeKind | null;
         node: Node | null | undefined;
     };
-    [KINOBI_ERROR__UNRECOGNIZED_NODE_KIND]: {
+    [CODAMA_ERROR__UNRECOGNIZED_NODE_KIND]: {
         kind: string;
     };
-    [KINOBI_ERROR__VERSION_MISMATCH]: {
-        kinobiVersion: string;
+    [CODAMA_ERROR__VERSION_MISMATCH]: {
+        codamaVersion: string;
         rootVersion: string;
     };
-    [KINOBI_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND]: {
+    [CODAMA_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND]: {
         account: AccountNode;
         missingField: CamelCaseString;
         name: CamelCaseString;
     };
-    [KINOBI_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES]: {
+    [CODAMA_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES]: {
         duplicatedPdaNames: CamelCaseString[];
         program: ProgramNode;
         programName: CamelCaseString;
     };
-    [KINOBI_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION]: {
+    [CODAMA_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION]: {
         visitFunction: string;
     };
-    [KINOBI_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES]: {
+    [CODAMA_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES]: {
         conflictingAttributes: CamelCaseString[];
     };
-    [KINOBI_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE]: {
+    [CODAMA_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE]: {
         instruction: InstructionNode;
         instructionAccount: InstructionAccountNode;
         instructionAccountName: CamelCaseString;
@@ -126,22 +126,22 @@ export type KinobiErrorContext = DefaultUnspecifiedErrorContextToUndefined<{
         seedName: CamelCaseString;
         seedValueName: CamelCaseString;
     };
-    [KINOBI_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES]: {
+    [CODAMA_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES]: {
         cycle: (InstructionAccountNode | InstructionArgumentNode)[];
         formattedCycle: string;
         instruction: InstructionNode;
         instructionName: CamelCaseString;
     };
-    [KINOBI_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE]: {
+    [CODAMA_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE]: {
         formattedHistogram: string;
         validationItems: ValidationItem[];
     };
-    [KINOBI_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND]: {
+    [CODAMA_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND]: {
         argumentName: CamelCaseString;
         instruction: InstructionNode;
         instructionName: CamelCaseString;
     };
-    [KINOBI_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY]: {
+    [CODAMA_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY]: {
         dependency: InstructionAccountNode | InstructionArgumentNode;
         dependencyKind: 'instructionAccountNode' | 'instructionArgumentNode';
         dependencyName: CamelCaseString;
@@ -151,16 +151,16 @@ export type KinobiErrorContext = DefaultUnspecifiedErrorContextToUndefined<{
         parentKind: 'instructionAccountNode' | 'instructionArgumentNode';
         parentName: CamelCaseString;
     };
-    [KINOBI_ERROR__VISITORS__INVALID_NUMBER_WRAPPER]: {
+    [CODAMA_ERROR__VISITORS__INVALID_NUMBER_WRAPPER]: {
         wrapper: string;
     };
-    [KINOBI_ERROR__VISITORS__INVALID_PDA_SEED_VALUES]: {
+    [CODAMA_ERROR__VISITORS__INVALID_PDA_SEED_VALUES]: {
         instruction: InstructionNode;
         instructionName: CamelCaseString;
         pda: PdaNode;
         pdaName: CamelCaseString;
     };
-    [KINOBI_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND]: {
+    [CODAMA_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND]: {
         key: string;
     };
 }>;

+ 18 - 18
packages/errors/src/error.ts

@@ -3,38 +3,38 @@
  * @see https://github.com/solana-labs/solana-web3.js/blob/master/packages/errors
  */
 
-import { KinobiErrorCode } from './codes';
-import { KinobiErrorContext } from './context';
+import { CodamaErrorCode } from './codes';
+import { CodamaErrorContext } from './context';
 import { getErrorMessage } from './message-formatter';
 
-export function isKinobiError<TErrorCode extends KinobiErrorCode>(
+export function isCodamaError<TErrorCode extends CodamaErrorCode>(
     e: unknown,
     code?: TErrorCode,
-): e is KinobiError<TErrorCode> {
-    const isKinobiError = e instanceof Error && e.name === 'KinobiError';
-    if (isKinobiError) {
+): e is CodamaError<TErrorCode> {
+    const isCodamaError = e instanceof Error && e.name === 'CodamaError';
+    if (isCodamaError) {
         if (code !== undefined) {
-            return (e as KinobiError<TErrorCode>).context.__code === code;
+            return (e as CodamaError<TErrorCode>).context.__code === code;
         }
         return true;
     }
     return false;
 }
 
-type KinobiErrorCodedContext = Readonly<{
-    [P in KinobiErrorCode]: (KinobiErrorContext[P] extends undefined ? object : KinobiErrorContext[P]) & {
+type CodamaErrorCodedContext = Readonly<{
+    [P in CodamaErrorCode]: (CodamaErrorContext[P] extends undefined ? object : CodamaErrorContext[P]) & {
         __code: P;
     };
 }>;
 
-export class KinobiError<TErrorCode extends KinobiErrorCode = KinobiErrorCode> extends Error {
-    readonly context: KinobiErrorCodedContext[TErrorCode];
+export class CodamaError<TErrorCode extends CodamaErrorCode = CodamaErrorCode> extends Error {
+    readonly context: CodamaErrorCodedContext[TErrorCode];
     constructor(
-        ...[code, contextAndErrorOptions]: KinobiErrorContext[TErrorCode] extends undefined
+        ...[code, contextAndErrorOptions]: CodamaErrorContext[TErrorCode] extends undefined
             ? [code: TErrorCode, errorOptions?: ErrorOptions | undefined]
-            : [code: TErrorCode, contextAndErrorOptions: KinobiErrorContext[TErrorCode] & (ErrorOptions | undefined)]
+            : [code: TErrorCode, contextAndErrorOptions: CodamaErrorContext[TErrorCode] & (ErrorOptions | undefined)]
     ) {
-        let context: KinobiErrorContext[TErrorCode] | undefined;
+        let context: CodamaErrorContext[TErrorCode] | undefined;
         let errorOptions: ErrorOptions | undefined;
         if (contextAndErrorOptions) {
             // If the `ErrorOptions` type ever changes, update this code.
@@ -43,7 +43,7 @@ export class KinobiError<TErrorCode extends KinobiErrorCode = KinobiErrorCode> e
                 errorOptions = { cause };
             }
             if (Object.keys(contextRest).length > 0) {
-                context = contextRest as KinobiErrorContext[TErrorCode];
+                context = contextRest as CodamaErrorContext[TErrorCode];
             }
         }
         const message = getErrorMessage(code, context);
@@ -51,9 +51,9 @@ export class KinobiError<TErrorCode extends KinobiErrorCode = KinobiErrorCode> e
         this.context = {
             __code: code,
             ...context,
-        } as KinobiErrorCodedContext[TErrorCode];
-        // This is necessary so that `isKinobiError()` can identify a `KinobiError` without having
+        } as CodamaErrorCodedContext[TErrorCode];
+        // This is necessary so that `isCodamaError()` can identify a `CodamaError` without having
         // to import the class for use in an `instanceof` check.
-        this.name = 'KinobiError';
+        this.name = 'CodamaError';
     }
 }

+ 6 - 6
packages/errors/src/message-formatter.ts

@@ -3,26 +3,26 @@
  * @see https://github.com/solana-labs/solana-web3.js/blob/master/packages/errors
  */
 
-import { KinobiErrorCode } from './codes';
+import { CodamaErrorCode } from './codes';
 import { encodeContextObject } from './context';
-import { KinobiErrorMessages } from './messages';
+import { CodamaErrorMessages } from './messages';
 
-export function getHumanReadableErrorMessage<TErrorCode extends KinobiErrorCode>(
+export function getHumanReadableErrorMessage<TErrorCode extends CodamaErrorCode>(
     code: TErrorCode,
     context: object = {},
 ): string {
-    const messageFormatString = KinobiErrorMessages[code];
+    const messageFormatString = CodamaErrorMessages[code];
     const message = messageFormatString.replace(/(?<!\\)\$(\w+)/g, (substring, variableName) =>
         variableName in context ? `${context[variableName as keyof typeof context]}` : substring,
     );
     return message;
 }
 
-export function getErrorMessage<TErrorCode extends KinobiErrorCode>(code: TErrorCode, context: object = {}): string {
+export function getErrorMessage<TErrorCode extends CodamaErrorCode>(code: TErrorCode, context: object = {}): string {
     if (process.env.NODE_ENV !== 'production') {
         return getHumanReadableErrorMessage(code, context);
     } else {
-        let decodingAdviceMessage = `Kinobi error #${code}; Decode this error by running \`npx @kinobi-so/errors decode -- ${code}`;
+        let decodingAdviceMessage = `Codama error #${code}; Decode this error by running \`npx @codama/errors decode -- ${code}`;
         if (Object.keys(context).length) {
             /**
              * DANGER: Be sure that the shell command is escaped in such a way that makes it

+ 52 - 52
packages/errors/src/messages.ts

@@ -4,74 +4,74 @@
  */
 
 import {
-    KINOBI_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING,
-    KINOBI_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING,
-    KINOBI_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED,
-    KINOBI_ERROR__ANCHOR__TYPE_PATH_MISSING,
-    KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE,
-    KINOBI_ERROR__LINKED_NODE_NOT_FOUND,
-    KINOBI_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE,
-    KINOBI_ERROR__RENDERERS__UNSUPPORTED_NODE,
-    KINOBI_ERROR__UNEXPECTED_NESTED_NODE_KIND,
-    KINOBI_ERROR__UNEXPECTED_NODE_KIND,
-    KINOBI_ERROR__UNRECOGNIZED_NODE_KIND,
-    KINOBI_ERROR__VERSION_MISMATCH,
-    KINOBI_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND,
-    KINOBI_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES,
-    KINOBI_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION,
-    KINOBI_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES,
-    KINOBI_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE,
-    KINOBI_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES,
-    KINOBI_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE,
-    KINOBI_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND,
-    KINOBI_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY,
-    KINOBI_ERROR__VISITORS__INVALID_NUMBER_WRAPPER,
-    KINOBI_ERROR__VISITORS__INVALID_PDA_SEED_VALUES,
-    KINOBI_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND,
-    KinobiErrorCode,
+    CODAMA_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING,
+    CODAMA_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING,
+    CODAMA_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED,
+    CODAMA_ERROR__ANCHOR__TYPE_PATH_MISSING,
+    CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE,
+    CODAMA_ERROR__LINKED_NODE_NOT_FOUND,
+    CODAMA_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE,
+    CODAMA_ERROR__RENDERERS__UNSUPPORTED_NODE,
+    CODAMA_ERROR__UNEXPECTED_NESTED_NODE_KIND,
+    CODAMA_ERROR__UNEXPECTED_NODE_KIND,
+    CODAMA_ERROR__UNRECOGNIZED_NODE_KIND,
+    CODAMA_ERROR__VERSION_MISMATCH,
+    CODAMA_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND,
+    CODAMA_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES,
+    CODAMA_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION,
+    CODAMA_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES,
+    CODAMA_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE,
+    CODAMA_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES,
+    CODAMA_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE,
+    CODAMA_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND,
+    CODAMA_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY,
+    CODAMA_ERROR__VISITORS__INVALID_NUMBER_WRAPPER,
+    CODAMA_ERROR__VISITORS__INVALID_PDA_SEED_VALUES,
+    CODAMA_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND,
+    CodamaErrorCode,
 } from './codes';
 
 /**
  * WARNING:
  *   - Don't change the meaning of an error message.
  */
-export const KinobiErrorMessages: Readonly<{
+export const CodamaErrorMessages: Readonly<{
     // This type makes this data structure exhaustive with respect to `SolanaErrorCode`.
     // TypeScript will fail to build this project if add an error code without a message.
-    [P in KinobiErrorCode]: string;
+    [P in CodamaErrorCode]: string;
 }> = {
-    [KINOBI_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING]: 'Account type [$name] is missing from the IDL types.',
-    [KINOBI_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING]: 'Argument name [$name] is missing from the instruction definition.',
-    [KINOBI_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED]: 'Seed kind [$kind] is not implemented.',
-    [KINOBI_ERROR__ANCHOR__TYPE_PATH_MISSING]: 'Field type is missing for path [$path] in [$idlType].',
-    [KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE]: 'Unrecognized Anchor IDL type [$idlType].',
-    [KINOBI_ERROR__LINKED_NODE_NOT_FOUND]: 'Could not find linked node [$name] from [$kind].',
-    [KINOBI_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE]:
+    [CODAMA_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING]: 'Account type [$name] is missing from the IDL types.',
+    [CODAMA_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING]: 'Argument name [$name] is missing from the instruction definition.',
+    [CODAMA_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED]: 'Seed kind [$kind] is not implemented.',
+    [CODAMA_ERROR__ANCHOR__TYPE_PATH_MISSING]: 'Field type is missing for path [$path] in [$idlType].',
+    [CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE]: 'Unrecognized Anchor IDL type [$idlType].',
+    [CODAMA_ERROR__LINKED_NODE_NOT_FOUND]: 'Could not find linked node [$name] from [$kind].',
+    [CODAMA_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE]:
         'Node.js filesystem function [$fsFunction] is not available in your environment.',
-    [KINOBI_ERROR__RENDERERS__UNSUPPORTED_NODE]: 'Cannot render the encountered node of kind [$kind].',
-    [KINOBI_ERROR__UNEXPECTED_NESTED_NODE_KIND]: 'Expected nested node of kind [$expectedKinds], got [$kind]',
-    [KINOBI_ERROR__UNEXPECTED_NODE_KIND]: 'Expected node of kind [$expectedKinds], got [$kind].',
-    [KINOBI_ERROR__UNRECOGNIZED_NODE_KIND]: 'Unrecognized node kind [$kind].',
-    [KINOBI_ERROR__VERSION_MISMATCH]:
-        'The provided RootNode version [$rootVersion] is not compatible with the installed Kinobi version [$kinobiVersion].',
-    [KINOBI_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND]: 'Account [$name] does not have a field named [$missingField].',
-    [KINOBI_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES]:
+    [CODAMA_ERROR__RENDERERS__UNSUPPORTED_NODE]: 'Cannot render the encountered node of kind [$kind].',
+    [CODAMA_ERROR__UNEXPECTED_NESTED_NODE_KIND]: 'Expected nested node of kind [$expectedKinds], got [$kind]',
+    [CODAMA_ERROR__UNEXPECTED_NODE_KIND]: 'Expected node of kind [$expectedKinds], got [$kind].',
+    [CODAMA_ERROR__UNRECOGNIZED_NODE_KIND]: 'Unrecognized node kind [$kind].',
+    [CODAMA_ERROR__VERSION_MISMATCH]:
+        'The provided RootNode version [$rootVersion] is not compatible with the installed Codama version [$codamaVersion].',
+    [CODAMA_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND]: 'Account [$name] does not have a field named [$missingField].',
+    [CODAMA_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES]:
         'Cannot add PDAs to program [$programName] because the following PDA names already exist [$duplicatedPdaNames].',
-    [KINOBI_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION]:
+    [CODAMA_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION]:
         'Cannot extend visitor with function [$visitFunction] as the base visitor does not support it.',
-    [KINOBI_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES]:
+    [CODAMA_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES]:
         'Cannot flatten struct since this would cause the following attributes to conflict [$conflictingAttributes].',
-    [KINOBI_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE]:
+    [CODAMA_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE]:
         'Cannot use optional account [$seedValueName] as the [$seedName] PDA seed for the [$instructionAccountName] account of the [$instructionName] instruction.',
-    [KINOBI_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES]:
+    [CODAMA_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES]:
         "Circular dependency detected when resolving the accounts and arguments' default values of the [$instructionName] instruction. Got the following dependency cycle [$formattedCycle].",
-    [KINOBI_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE]: 'Failed to validate the given node [$formattedHistogram].',
-    [KINOBI_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND]:
+    [CODAMA_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE]: 'Failed to validate the given node [$formattedHistogram].',
+    [CODAMA_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND]:
         'Could not find an enum argument named [$argumentName] for instruction [$instructionName].',
-    [KINOBI_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY]:
+    [CODAMA_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY]:
         'Dependency [$dependencyName] of kind [$dependencyKind] is not a valid dependency of [$parentName] of kind [$parentKind] in the [$instructionName] instruction.',
-    [KINOBI_ERROR__VISITORS__INVALID_NUMBER_WRAPPER]: 'Invalid number wrapper kind [$wrapper].',
-    [KINOBI_ERROR__VISITORS__INVALID_PDA_SEED_VALUES]:
+    [CODAMA_ERROR__VISITORS__INVALID_NUMBER_WRAPPER]: 'Invalid number wrapper kind [$wrapper].',
+    [CODAMA_ERROR__VISITORS__INVALID_PDA_SEED_VALUES]:
         'Invalid seed values for PDA [$pdaName] in instruction [$instructionName].',
-    [KINOBI_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND]: 'Cannot find key [$key] in RenderMap.',
+    [CODAMA_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND]: 'Cannot find key [$key] in RenderMap.',
 };

+ 20 - 20
packages/errors/test/error.test.ts

@@ -1,53 +1,53 @@
 import { expect, test } from 'vitest';
 
 import {
-    isKinobiError,
-    KINOBI_ERROR__UNEXPECTED_NODE_KIND,
-    KINOBI_ERROR__UNRECOGNIZED_NODE_KIND,
-    KinobiError,
+    CODAMA_ERROR__UNEXPECTED_NODE_KIND,
+    CODAMA_ERROR__UNRECOGNIZED_NODE_KIND,
+    CodamaError,
+    isCodamaError,
 } from '../src';
 
-test('it exposes the Kinobi error context', () => {
-    const error = new KinobiError(KINOBI_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
+test('it exposes the Codama error context', () => {
+    const error = new CodamaError(CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
     expect(error.context.kind).toBe('missingNode');
 });
 
-test('it exposes the Kinobi error code', () => {
-    const error = new KinobiError(KINOBI_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
-    expect(error.context.__code).toBe(KINOBI_ERROR__UNRECOGNIZED_NODE_KIND);
+test('it exposes the Codama error code', () => {
+    const error = new CodamaError(CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
+    expect(error.context.__code).toBe(CODAMA_ERROR__UNRECOGNIZED_NODE_KIND);
 });
 
 test('it calls the message formatter with the code and context', () => {
-    const error = new KinobiError(KINOBI_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
+    const error = new CodamaError(CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
     expect(error.message).toBe('Unrecognized node kind [missingNode].');
 });
 
 test('it exposes no cause when none is provided', () => {
-    const error = new KinobiError(KINOBI_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
+    const error = new CodamaError(CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
     expect(error.cause).toBeUndefined();
 });
 
 test('it exposes the cause when provided', () => {
     const cause = {} as unknown;
-    const error = new KinobiError(KINOBI_ERROR__UNRECOGNIZED_NODE_KIND, { cause, kind: 'missingNode' });
+    const error = new CodamaError(CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, { cause, kind: 'missingNode' });
     expect(error.cause).toBe(cause);
 });
 
-test('it returns `true` for an instance of `KinobiError`', () => {
-    const error = new KinobiError(KINOBI_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
-    expect(isKinobiError(error)).toBe(true);
+test('it returns `true` for an instance of `CodamaError`', () => {
+    const error = new CodamaError(CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
+    expect(isCodamaError(error)).toBe(true);
 });
 
 test('it returns `false` for an instance of `Error`', () => {
-    expect(isKinobiError(new Error('bad thing'))).toBe(false);
+    expect(isCodamaError(new Error('bad thing'))).toBe(false);
 });
 
 test('it returns `true` when the error code matches', () => {
-    const error = new KinobiError(KINOBI_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
-    expect(isKinobiError(error, KINOBI_ERROR__UNRECOGNIZED_NODE_KIND)).toBe(true);
+    const error = new CodamaError(CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
+    expect(isCodamaError(error, CODAMA_ERROR__UNRECOGNIZED_NODE_KIND)).toBe(true);
 });
 
 test('it returns `false` when the error code does not match', () => {
-    const error = new KinobiError(KINOBI_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
-    expect(isKinobiError(error, KINOBI_ERROR__UNEXPECTED_NODE_KIND)).toBe(false);
+    const error = new CodamaError(CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, { kind: 'missingNode' });
+    expect(isCodamaError(error, CODAMA_ERROR__UNEXPECTED_NODE_KIND)).toBe(false);
 });

+ 30 - 30
packages/errors/test/error.typetest.ts

@@ -1,16 +1,16 @@
-import { PublicKeyTypeNode } from '@kinobi-so/node-types';
+import { PublicKeyTypeNode } from '@codama/node-types';
 
-import { isKinobiError, KinobiError, KinobiErrorCode } from '../src';
-import * as KinobiErrorCodeModule from '../src/codes';
-import { KinobiErrorContext } from '../src/context';
+import { CodamaError, CodamaErrorCode, isCodamaError } from '../src';
+import * as CodamaErrorCodeModule from '../src/codes';
+import { CodamaErrorContext } from '../src/context';
 
-const { KINOBI_ERROR__UNRECOGNIZED_NODE_KIND, KINOBI_ERROR__UNEXPECTED_NODE_KIND } = KinobiErrorCodeModule;
+const { CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, CODAMA_ERROR__UNEXPECTED_NODE_KIND } = CodamaErrorCodeModule;
 
 // If this line raises a type error, you might have forgotten to add a new error to the
-// `KinobiErrorCode` union in `src/codes.ts`.
-Object.values(KinobiErrorCodeModule) satisfies KinobiErrorCode[];
+// `CodamaErrorCode` union in `src/codes.ts`.
+Object.values(CodamaErrorCodeModule) satisfies CodamaErrorCode[];
 
-const unexpectedNodeKindError = new KinobiError(KINOBI_ERROR__UNEXPECTED_NODE_KIND, {
+const unexpectedNodeKindError = new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, {
     expectedKinds: ['numberTypeNode', 'stringTypeNode'],
     kind: 'publicKeyTypeNode',
     node: {} as PublicKeyTypeNode,
@@ -18,58 +18,58 @@ const unexpectedNodeKindError = new KinobiError(KINOBI_ERROR__UNEXPECTED_NODE_KI
 
 {
     const code = unexpectedNodeKindError.context.__code;
-    code satisfies typeof KINOBI_ERROR__UNEXPECTED_NODE_KIND;
+    code satisfies typeof CODAMA_ERROR__UNEXPECTED_NODE_KIND;
     // @ts-expect-error Wrong error code.
-    code satisfies typeof KINOBI_ERROR__UNRECOGNIZED_NODE_KIND;
+    code satisfies typeof CODAMA_ERROR__UNRECOGNIZED_NODE_KIND;
 }
 
 {
     // @ts-expect-error Missing context.
-    new KinobiError(KINOBI_ERROR__UNEXPECTED_NODE_KIND, {});
+    new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, {});
     // @ts-expect-error Missing part of the context.
-    new KinobiError(KINOBI_ERROR__UNEXPECTED_NODE_KIND, {
+    new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, {
         expectedKinds: ['numberTypeNode', 'stringTypeNode'],
         node: {} as PublicKeyTypeNode,
     });
-    new KinobiError(KINOBI_ERROR__UNEXPECTED_NODE_KIND, {
+    new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, {
         // @ts-expect-error Wrong context attribute.
         foo: 'bar',
     });
 }
 
-unexpectedNodeKindError.context satisfies KinobiErrorContext[typeof KINOBI_ERROR__UNEXPECTED_NODE_KIND];
+unexpectedNodeKindError.context satisfies CodamaErrorContext[typeof CODAMA_ERROR__UNEXPECTED_NODE_KIND];
 // @ts-expect-error Non existent context property.
 unexpectedNodeKindError.context.feePayer;
 
 // @ts-expect-error Missing context.
-new KinobiError(KINOBI_ERROR__UNRECOGNIZED_NODE_KIND);
+new CodamaError(CODAMA_ERROR__UNRECOGNIZED_NODE_KIND);
 // @ts-expect-error Missing context.
-new KinobiError(KINOBI_ERROR__UNEXPECTED_NODE_KIND);
+new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND);
 
-const unknownError = null as unknown as KinobiError;
-if (unknownError.context.__code === KINOBI_ERROR__UNEXPECTED_NODE_KIND) {
-    unknownError.context satisfies KinobiErrorContext[typeof KINOBI_ERROR__UNEXPECTED_NODE_KIND];
+const unknownError = null as unknown as CodamaError;
+if (unknownError.context.__code === CODAMA_ERROR__UNEXPECTED_NODE_KIND) {
+    unknownError.context satisfies CodamaErrorContext[typeof CODAMA_ERROR__UNEXPECTED_NODE_KIND];
     // @ts-expect-error Context belongs to another error code
-    unknownError.context satisfies KinobiErrorContext[typeof KINOBI_ERROR__UNRECOGNIZED_NODE_KIND];
+    unknownError.context satisfies CodamaErrorContext[typeof CODAMA_ERROR__UNRECOGNIZED_NODE_KIND];
 }
 
 const e = null as unknown;
-if (isKinobiError(e)) {
-    e.context satisfies Readonly<{ __code: KinobiErrorCode }>;
+if (isCodamaError(e)) {
+    e.context satisfies Readonly<{ __code: CodamaErrorCode }>;
 }
-if (isKinobiError(e, KINOBI_ERROR__UNEXPECTED_NODE_KIND)) {
-    e.context satisfies KinobiErrorContext[typeof KINOBI_ERROR__UNEXPECTED_NODE_KIND];
+if (isCodamaError(e, CODAMA_ERROR__UNEXPECTED_NODE_KIND)) {
+    e.context satisfies CodamaErrorContext[typeof CODAMA_ERROR__UNEXPECTED_NODE_KIND];
     // @ts-expect-error Context belongs to another error code
-    e.context satisfies KinobiErrorContext[typeof KINOBI_ERROR__UNRECOGNIZED_NODE_KIND];
+    e.context satisfies CodamaErrorContext[typeof CODAMA_ERROR__UNRECOGNIZED_NODE_KIND];
 }
 
-// `KinobiErrorContext` must not contain any keys reserved by `ErrorOptions` (eg. `cause`)
-null as unknown as KinobiErrorContext satisfies {
-    [Code in keyof KinobiErrorContext]: KinobiErrorContext[Code] extends undefined
+// `CodamaErrorContext` must not contain any keys reserved by `ErrorOptions` (eg. `cause`)
+null as unknown as CodamaErrorContext satisfies {
+    [Code in keyof CodamaErrorContext]: CodamaErrorContext[Code] extends undefined
         ? undefined
         : {
-              [PP in keyof KinobiErrorContext[Code]]: PP extends keyof ErrorOptions
+              [PP in keyof CodamaErrorContext[Code]]: PP extends keyof ErrorOptions
                   ? never
-                  : KinobiErrorContext[Code][PP];
+                  : CodamaErrorContext[Code][PP];
           };
 };

+ 1 - 1
packages/errors/tsconfig.json

@@ -4,7 +4,7 @@
         "lib": ["DOM", "ES2015", "ES2022.Error"],
         "resolveJsonModule": true
     },
-    "display": "@kinobi-so/errors",
+    "display": "@codama/errors",
     "extends": "../internals/tsconfig.base.json",
     "include": ["src", "test"]
 }

+ 1 - 1
packages/internals/README.md

@@ -1,3 +1,3 @@
-# Kinobi ➤ Internals
+# Codama ➤ Internals
 
 _This package is not exported and is only used for internal purposes._

+ 1 - 1
packages/internals/package.json

@@ -1,5 +1,5 @@
 {
-    "name": "@kinobi-so/internals",
+    "name": "@codama/internals",
     "version": "0.0.0",
     "private": true,
     "files": [

+ 1 - 1
packages/internals/scripts/test-unit.mjs

@@ -5,7 +5,7 @@ $.stdio = 'inherit';
 const platform = argv._[0];
 const watch = argv.watch;
 
-const testArgs = ['--config', `../../node_modules/@kinobi-so/internals/vitest.config.${platform}.mts`];
+const testArgs = ['--config', `../../node_modules/@codama/internals/vitest.config.${platform}.mts`];
 
 if (watch) {
     await $`vitest ${testArgs}`;

+ 1 - 1
packages/internals/tsup.config.base.ts

@@ -37,7 +37,7 @@ export function getBuildConfig(options: BuildOptions): TsupConfig {
         },
         external: ['node:fs', 'node:path', 'node:url'],
         format,
-        globalName: 'globalThis.kinobi',
+        globalName: 'globalThis.codama',
         name: platform,
         // Inline private, non-published packages.
         // WARNING: This inlines packages recursively. Make sure these don't have deep dep trees.

+ 66 - 66
packages/library/CHANGELOG.md

@@ -1,139 +1,139 @@
-# kinobi
+# codama
 
 ## 0.22.0
 
 ### Patch Changes
 
--   Updated dependencies [[`c8c5934`](https://github.com/kinobi-so/kinobi/commit/c8c593466294f3ec7dca1fb828254e10aa312925), [`2b1259b`](https://github.com/kinobi-so/kinobi/commit/2b1259b566aa439ca61c28f7ef72ff9c0817e540), [`93a318a`](https://github.com/kinobi-so/kinobi/commit/93a318a9b7ee435eb37934b0ab390e160d50968b)]:
-    -   @kinobi-so/errors@0.22.0
-    -   @kinobi-so/nodes@0.22.0
-    -   @kinobi-so/validators@0.22.0
-    -   @kinobi-so/visitors@0.22.0
+-   Updated dependencies [[`c8c5934`](https://github.com/codama-idl/codama/commit/c8c593466294f3ec7dca1fb828254e10aa312925), [`2b1259b`](https://github.com/codama-idl/codama/commit/2b1259b566aa439ca61c28f7ef72ff9c0817e540), [`93a318a`](https://github.com/codama-idl/codama/commit/93a318a9b7ee435eb37934b0ab390e160d50968b)]:
+    -   @codama/errors@0.22.0
+    -   @codama/nodes@0.22.0
+    -   @codama/validators@0.22.0
+    -   @codama/visitors@0.22.0
 
 ## 0.21.5
 
 ### Patch Changes
 
--   Updated dependencies [[`a6849d3`](https://github.com/kinobi-so/kinobi/commit/a6849d36a828e2b6b703f2a86d2ea0ae6d2fa0d8)]:
-    -   @kinobi-so/errors@0.21.5
-    -   @kinobi-so/nodes@0.21.5
-    -   @kinobi-so/validators@0.21.5
-    -   @kinobi-so/visitors@0.21.5
+-   Updated dependencies [[`a6849d3`](https://github.com/codama-idl/codama/commit/a6849d36a828e2b6b703f2a86d2ea0ae6d2fa0d8)]:
+    -   @codama/errors@0.21.5
+    -   @codama/nodes@0.21.5
+    -   @codama/validators@0.21.5
+    -   @codama/visitors@0.21.5
 
 ## 0.21.4
 
 ### Patch Changes
 
--   [#181](https://github.com/kinobi-so/kinobi/pull/181) [`28f3d38`](https://github.com/kinobi-so/kinobi/commit/28f3d381f570859cbea1c72b7e352ad3e72db37f) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix TS bug on `accept` and `update` Kinobi function
+-   [#181](https://github.com/codama-idl/codama/pull/181) [`28f3d38`](https://github.com/codama-idl/codama/commit/28f3d381f570859cbea1c72b7e352ad3e72db37f) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix TS bug on `accept` and `update` codama function
 
 -   Updated dependencies []:
-    -   @kinobi-so/errors@0.21.4
-    -   @kinobi-so/nodes@0.21.4
-    -   @kinobi-so/validators@0.21.4
-    -   @kinobi-so/visitors@0.21.4
+    -   @codama/errors@0.21.4
+    -   @codama/nodes@0.21.4
+    -   @codama/validators@0.21.4
+    -   @codama/visitors@0.21.4
 
 ## 0.21.3
 
 ### Patch Changes
 
 -   Updated dependencies []:
-    -   @kinobi-so/validators@0.21.3
-    -   @kinobi-so/visitors@0.21.3
-    -   @kinobi-so/errors@0.21.3
-    -   @kinobi-so/nodes@0.21.3
+    -   @codama/validators@0.21.3
+    -   @codama/visitors@0.21.3
+    -   @codama/errors@0.21.3
+    -   @codama/nodes@0.21.3
 
 ## 0.21.2
 
 ### Patch Changes
 
 -   Updated dependencies []:
-    -   @kinobi-so/validators@0.21.2
-    -   @kinobi-so/visitors@0.21.2
-    -   @kinobi-so/errors@0.21.2
-    -   @kinobi-so/nodes@0.21.2
+    -   @codama/validators@0.21.2
+    -   @codama/visitors@0.21.2
+    -   @codama/errors@0.21.2
+    -   @codama/nodes@0.21.2
 
 ## 0.21.1
 
 ### Patch Changes
 
 -   Updated dependencies []:
-    -   @kinobi-so/validators@0.21.1
-    -   @kinobi-so/visitors@0.21.1
-    -   @kinobi-so/errors@0.21.1
-    -   @kinobi-so/nodes@0.21.1
+    -   @codama/validators@0.21.1
+    -   @codama/visitors@0.21.1
+    -   @codama/errors@0.21.1
+    -   @codama/nodes@0.21.1
 
 ## 0.21.0
 
 ### Patch Changes
 
--   Updated dependencies [[`2f26050`](https://github.com/kinobi-so/kinobi/commit/2f26050ddbcbdefcefbd853e1017a30c94442e1f)]:
-    -   @kinobi-so/errors@0.21.0
-    -   @kinobi-so/nodes@0.21.0
-    -   @kinobi-so/validators@0.21.0
-    -   @kinobi-so/visitors@0.21.0
+-   Updated dependencies [[`2f26050`](https://github.com/codama-idl/codama/commit/2f26050ddbcbdefcefbd853e1017a30c94442e1f)]:
+    -   @codama/errors@0.21.0
+    -   @codama/nodes@0.21.0
+    -   @codama/validators@0.21.0
+    -   @codama/visitors@0.21.0
 
 ## 0.20.6
 
 ### Patch Changes
 
--   [#102](https://github.com/kinobi-so/kinobi/pull/102) [`bcf6a23`](https://github.com/kinobi-so/kinobi/commit/bcf6a23fa0e0d1f1a064ea6ddcfc9c092190a51f) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Replace \_\_DEV\_\_ with NODE_ENV is not production in Kinobi
+-   [#102](https://github.com/codama-idl/codama/pull/102) [`bcf6a23`](https://github.com/codama-idl/codama/commit/bcf6a23fa0e0d1f1a064ea6ddcfc9c092190a51f) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Replace \_\_DEV\_\_ with NODE_ENV is not production in codama
 
--   Updated dependencies [[`bcf6a23`](https://github.com/kinobi-so/kinobi/commit/bcf6a23fa0e0d1f1a064ea6ddcfc9c092190a51f)]:
-    -   @kinobi-so/errors@0.20.6
-    -   @kinobi-so/nodes@0.20.6
-    -   @kinobi-so/validators@0.20.6
-    -   @kinobi-so/visitors@0.20.6
+-   Updated dependencies [[`bcf6a23`](https://github.com/codama-idl/codama/commit/bcf6a23fa0e0d1f1a064ea6ddcfc9c092190a51f)]:
+    -   @codama/errors@0.20.6
+    -   @codama/nodes@0.20.6
+    -   @codama/validators@0.20.6
+    -   @codama/visitors@0.20.6
 
 ## 0.20.5
 
 ### Patch Changes
 
--   Updated dependencies [[`908acba`](https://github.com/kinobi-so/kinobi/commit/908acba99cdb0b761ed79aebf6828e23fde97ef8)]:
-    -   @kinobi-so/errors@0.20.5
-    -   @kinobi-so/nodes@0.20.5
-    -   @kinobi-so/validators@0.20.5
-    -   @kinobi-so/visitors@0.20.5
+-   Updated dependencies [[`908acba`](https://github.com/codama-idl/codama/commit/908acba99cdb0b761ed79aebf6828e23fde97ef8)]:
+    -   @codama/errors@0.20.5
+    -   @codama/nodes@0.20.5
+    -   @codama/validators@0.20.5
+    -   @codama/visitors@0.20.5
 
 ## 0.20.4
 
 ### Patch Changes
 
--   Updated dependencies [[`668b550`](https://github.com/kinobi-so/kinobi/commit/668b550aa2172c24ddb3b8751d91e67e94a93fa4)]:
-    -   @kinobi-so/visitors@0.20.4
-    -   @kinobi-so/nodes@0.20.4
-    -   @kinobi-so/errors@0.20.4
-    -   @kinobi-so/validators@0.20.4
+-   Updated dependencies [[`668b550`](https://github.com/codama-idl/codama/commit/668b550aa2172c24ddb3b8751d91e67e94a93fa4)]:
+    -   @codama/visitors@0.20.4
+    -   @codama/nodes@0.20.4
+    -   @codama/errors@0.20.4
+    -   @codama/validators@0.20.4
 
 ## 0.20.3
 
 ### Patch Changes
 
--   Updated dependencies [[`4bc5823`](https://github.com/kinobi-so/kinobi/commit/4bc5823377824198bd5a6432d16333b2cb1d8b8c)]:
-    -   @kinobi-so/errors@0.20.3
-    -   @kinobi-so/validators@0.20.3
-    -   @kinobi-so/visitors@0.20.3
-    -   @kinobi-so/nodes@0.20.3
+-   Updated dependencies [[`4bc5823`](https://github.com/codama-idl/codama/commit/4bc5823377824198bd5a6432d16333b2cb1d8b8c)]:
+    -   @codama/errors@0.20.3
+    -   @codama/validators@0.20.3
+    -   @codama/visitors@0.20.3
+    -   @codama/nodes@0.20.3
 
 ## 0.20.2
 
 ### Patch Changes
 
--   [`964776f`](https://github.com/kinobi-so/kinobi/commit/964776fe73402c236d334032821013674c3b1a5e) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix invalid package dependencies
+-   [`964776f`](https://github.com/codama-idl/codama/commit/964776fe73402c236d334032821013674c3b1a5e) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix invalid package dependencies
 
--   Updated dependencies [[`964776f`](https://github.com/kinobi-so/kinobi/commit/964776fe73402c236d334032821013674c3b1a5e)]:
-    -   @kinobi-so/errors@0.20.2
-    -   @kinobi-so/nodes@0.20.2
-    -   @kinobi-so/validators@0.20.2
-    -   @kinobi-so/visitors@0.20.2
+-   Updated dependencies [[`964776f`](https://github.com/codama-idl/codama/commit/964776fe73402c236d334032821013674c3b1a5e)]:
+    -   @codama/errors@0.20.2
+    -   @codama/nodes@0.20.2
+    -   @codama/validators@0.20.2
+    -   @codama/visitors@0.20.2
 
 ## 0.20.1
 
 ### Patch Changes
 
--   [#21](https://github.com/kinobi-so/kinobi/pull/21) [`0dec0c8`](https://github.com/kinobi-so/kinobi/commit/0dec0c8fff5e80fafc964416058e4ddf1db2bda0) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix ESM and CJS exports on renderers
+-   [#21](https://github.com/codama-idl/codama/pull/21) [`0dec0c8`](https://github.com/codama-idl/codama/commit/0dec0c8fff5e80fafc964416058e4ddf1db2bda0) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix ESM and CJS exports on renderers
 
--   Updated dependencies [[`0dec0c8`](https://github.com/kinobi-so/kinobi/commit/0dec0c8fff5e80fafc964416058e4ddf1db2bda0)]:
-    -   @kinobi-so/errors@0.20.1
-    -   @kinobi-so/nodes@0.20.1
-    -   @kinobi-so/validators@0.20.1
-    -   @kinobi-so/visitors@0.20.1
+-   Updated dependencies [[`0dec0c8`](https://github.com/codama-idl/codama/commit/0dec0c8fff5e80fafc964416058e4ddf1db2bda0)]:
+    -   @codama/errors@0.20.1
+    -   @codama/nodes@0.20.1
+    -   @codama/validators@0.20.1
+    -   @codama/visitors@0.20.1

+ 1 - 1
packages/library/LICENSE

@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2024 Kinobi
+Copyright (c) 2024 Codama
 Copyright (c) 2024 Metaplex Foundation
 
 Permission is hereby granted, free of charge, to any person obtaining

+ 32 - 32
packages/library/README.md

@@ -1,43 +1,43 @@
-# Kinobi ➤ Main Library
+# Codama ➤ Main Library
 
 [![npm][npm-image]][npm-url]
 [![npm-downloads][npm-downloads-image]][npm-url]
 
-[npm-downloads-image]: https://img.shields.io/npm/dm/kinobi.svg?style=flat
-[npm-image]: https://img.shields.io/npm/v/kinobi.svg?style=flat&label=%40kinobi-so%2Fnodes
-[npm-url]: https://www.npmjs.com/package/kinobi
+[npm-downloads-image]: https://img.shields.io/npm/dm/codama.svg?style=flat
+[npm-image]: https://img.shields.io/npm/v/codama.svg?style=flat&label=%40codama%2Fnodes
+[npm-url]: https://www.npmjs.com/package/codama
 
-This package is the main library for Kinobi. It re-exports most of the other packages in the Kinobi monorepo and offers a `Kinobi` type with a few helpers to help bind everything together.
+This package is the main library for Codama. It re-exports most of the other packages in the Codama monorepo and offers a `Codama` type with a few helpers to help bind everything together.
 
 ## Installation
 
 ```sh
-pnpm install kinobi
+pnpm install codama
 ```
 
 ## Packages included
 
 This package includes the following packages. Note that some of them also re-export other packages.
 
--   [`@kinobi-so/errors`](../errors)
--   [`@kinobi-so/nodes`](../nodes)
-    -   [`@kinobi-so/node-types`](../node-types)
--   [`@kinobi-so/validators`](../validators)
--   [`@kinobi-so/visitors`](../visitors)
-    -   [`@kinobi-so/visitor-core`](../visitor-core)
+-   [`@codama/errors`](../errors)
+-   [`@codama/nodes`](../nodes)
+    -   [`@codama/node-types`](../node-types)
+-   [`@codama/validators`](../validators)
+-   [`@codama/visitors`](../visitors)
+    -   [`@codama/visitor-core`](../visitor-core)
 
-## The Kinobi helper
+## The Codama helper
 
-Additionally, this package offers a `Kinobi` type and a few helper functions to help you work with Kinobi IDLs.
+Additionally, this package offers a `Codama` type and a few helper functions to help you work with Codama IDLs.
 
-### `Kinobi`
+### `Codama`
 
-The `Kinobi` interface wraps a `RootNode` and offers some helper methods to work with it.
+The `Codama` interface wraps a `RootNode` and offers some helper methods to work with it.
 
 ```ts
-export interface Kinobi {
+export interface Codama {
     accept<T>(visitor: Visitor<T>): T;
-    clone(): Kinobi;
+    clone(): Codama;
     getJson(): string;
     getRoot(): RootNode;
     update(visitor: Visitor<Node | null>): void;
@@ -47,18 +47,18 @@ export interface Kinobi {
 The `accept` function allows us to visit the wrapped `RootNode` using the provided visitor.
 
 ```ts
-// Log the Kinobi IDL in the console.
-kinobi.accept(consoleLogVisitor(getDebugStringVisitor({ indent: true })));
+// Log the Codama IDL in the console.
+codama.accept(consoleLogVisitor(getDebugStringVisitor({ indent: true })));
 ```
 
 The `update` function also accepts a visitor, but it uses the return value of that visitor to update the wrapped `RootNode`. This means that, given a `RootNode`, the provided visitor should also return a `RootNode`. An error will be thrown otherwise.
 
 ```ts
 // Delete account nodes named "mint".
-kinobi.update(deleteNodesVisitor(['[accountNode]mint']));
+codama.update(deleteNodesVisitor(['[accountNode]mint']));
 
 // Transform all number nodes into u64 number nodes.
-kinobi.update(
+codama.update(
     bottomUpTransformerVisitor([
         {
             select: '[numberTypeNode]',
@@ -70,29 +70,29 @@ kinobi.update(
 
 Other helper functions include:
 
--   `clone()`: Creates a new instance of the `Kinobi` interface with a deep copy of the wrapped `RootNode`.
--   `getJson()`: Returns the JSON representation of the Kinobi IDL.
+-   `clone()`: Creates a new instance of the `Codama` interface with a deep copy of the wrapped `RootNode`.
+-   `getJson()`: Returns the JSON representation of the Codama IDL.
 -   `getRoot()`: Returns the wrapped `RootNode`.
 
 ```ts
-const clonedKinobi = kinobi.clone();
-const jsonIdl = kinobi.getJson();
-const rootNode = kinobi.getRoot();
+const clonedCodama = codama.clone();
+const jsonIdl = codama.getJson();
+const rootNode = codama.getRoot();
 ```
 
 ### `createFromRoot(rootNode)`
 
-The `createFromRoot` function creates a new instance of the `Kinobi` interface from a `RootNode`.
+The `createFromRoot` function creates a new instance of the `Codama` interface from a `RootNode`.
 
 ```ts
-const kinobi = createFromRoot(rootNode(programNode({ ... })));
+const codama = createFromRoot(rootNode(programNode({ ... })));
 ```
 
 ### `createFromJson(jsonIdl)`
 
-The `createFromJson` function creates a new instance of the `Kinobi` interface from a JSON representation of a `RootNode`.
+The `createFromJson` function creates a new instance of the `Codama` interface from a JSON representation of a `RootNode`.
 
 ```ts
-const json: string = fs.readFileSync('path/to/kinobiIdl.json', 'utf-8');
-const kinobi = createFromJson(json);
+const json: string = fs.readFileSync('path/to/codamaIdl.json', 'utf-8');
+const codama = createFromJson(json);
 ```

+ 17 - 17
packages/library/package.json

@@ -1,5 +1,5 @@
 {
-    "name": "kinobi",
+    "name": "codama",
     "version": "0.22.0",
     "description": "A Solana framework for building standardised programs",
     "exports": {
@@ -40,31 +40,31 @@
     ],
     "scripts": {
         "build": "rimraf dist && pnpm build:src && pnpm build:types",
-        "build:src": "zx ../../node_modules/@kinobi-so/internals/scripts/build-src.mjs library",
-        "build:types": "zx ../../node_modules/@kinobi-so/internals/scripts/build-types.mjs",
-        "dev": "zx ../../node_modules/@kinobi-so/internals/scripts/test-unit.mjs node --watch",
-        "lint": "zx ../../node_modules/@kinobi-so/internals/scripts/lint.mjs",
-        "lint:fix": "zx ../../node_modules/@kinobi-so/internals/scripts/lint.mjs --fix",
+        "build:src": "zx ../../node_modules/@codama/internals/scripts/build-src.mjs library",
+        "build:types": "zx ../../node_modules/@codama/internals/scripts/build-types.mjs",
+        "dev": "zx ../../node_modules/@codama/internals/scripts/test-unit.mjs node --watch",
+        "lint": "zx ../../node_modules/@codama/internals/scripts/lint.mjs",
+        "lint:fix": "zx ../../node_modules/@codama/internals/scripts/lint.mjs --fix",
         "test": "pnpm test:types && pnpm test:treeshakability && pnpm test:browser && pnpm test:node && pnpm test:react-native",
-        "test:browser": "zx ../../node_modules/@kinobi-so/internals/scripts/test-unit.mjs browser",
-        "test:node": "zx ../../node_modules/@kinobi-so/internals/scripts/test-unit.mjs node",
-        "test:react-native": "zx ../../node_modules/@kinobi-so/internals/scripts/test-unit.mjs react-native",
-        "test:treeshakability": "zx ../../node_modules/@kinobi-so/internals/scripts/test-treeshakability.mjs",
-        "test:types": "zx ../../node_modules/@kinobi-so/internals/scripts/test-types.mjs"
+        "test:browser": "zx ../../node_modules/@codama/internals/scripts/test-unit.mjs browser",
+        "test:node": "zx ../../node_modules/@codama/internals/scripts/test-unit.mjs node",
+        "test:react-native": "zx ../../node_modules/@codama/internals/scripts/test-unit.mjs react-native",
+        "test:treeshakability": "zx ../../node_modules/@codama/internals/scripts/test-treeshakability.mjs",
+        "test:types": "zx ../../node_modules/@codama/internals/scripts/test-types.mjs"
     },
     "dependencies": {
-        "@kinobi-so/errors": "workspace:*",
-        "@kinobi-so/nodes": "workspace:*",
-        "@kinobi-so/validators": "workspace:*",
-        "@kinobi-so/visitors": "workspace:*"
+        "@codama/errors": "workspace:*",
+        "@codama/nodes": "workspace:*",
+        "@codama/validators": "workspace:*",
+        "@codama/visitors": "workspace:*"
     },
     "license": "MIT",
     "repository": {
         "type": "git",
-        "url": "https://github.com/kinobi-so/kinobi"
+        "url": "https://github.com/codama-idl/codama"
     },
     "bugs": {
-        "url": "http://github.com/kinobi-so/kinobi/issues"
+        "url": "http://github.com/codama-idl/codama/issues"
     },
     "browserslist": [
         "supports bigint and not dead",

+ 51 - 0
packages/library/src/codama.ts

@@ -0,0 +1,51 @@
+import { CODAMA_ERROR__VERSION_MISMATCH } from '@codama/errors';
+import { CodamaError } from '@codama/errors';
+import { assertIsNode, CodamaVersion, Node, RootNode } from '@codama/nodes';
+import { visit, Visitor } from '@codama/visitors';
+
+export interface Codama {
+    accept<T>(visitor: Visitor<T, 'rootNode'>): T;
+    clone(): Codama;
+    getJson(): string;
+    getRoot(): RootNode;
+    update(visitor: Visitor<Node | null, 'rootNode'>): void;
+}
+
+export function createFromRoot(root: RootNode): Codama {
+    let currentRoot = root;
+    validateCodamaVersion(currentRoot.version);
+    return {
+        accept<T>(visitor: Visitor<T, 'rootNode'>): T {
+            return visit(currentRoot, visitor);
+        },
+        clone(): Codama {
+            return createFromRoot({ ...currentRoot });
+        },
+        getJson(): string {
+            return JSON.stringify(currentRoot);
+        },
+        getRoot(): RootNode {
+            return currentRoot;
+        },
+        update(visitor: Visitor<Node | null, 'rootNode'>): void {
+            const newRoot = visit(currentRoot, visitor);
+            assertIsNode(newRoot, 'rootNode');
+            currentRoot = newRoot;
+        },
+    };
+}
+
+export function createFromJson(json: string): Codama {
+    return createFromRoot(JSON.parse(json) as RootNode);
+}
+
+function validateCodamaVersion(rootVersion: CodamaVersion): void {
+    const codamaVersion = __VERSION__;
+    if (rootVersion === codamaVersion) return;
+    const [rootMajor, rootMinor] = rootVersion.split('.').map(Number);
+    const [CodamaMajor, CodamaMinor] = codamaVersion.split('.').map(Number);
+    const isZeroMajor = rootMajor === 0 && CodamaMajor === 0;
+    if (isZeroMajor && rootMinor === CodamaMinor) return;
+    if (rootMajor === CodamaMajor) return;
+    throw new CodamaError(CODAMA_ERROR__VERSION_MISMATCH, { codamaVersion, rootVersion });
+}

+ 5 - 5
packages/library/src/index.ts

@@ -1,6 +1,6 @@
-export * from '@kinobi-so/errors';
-export * from '@kinobi-so/nodes';
-export * from '@kinobi-so/validators';
-export * from '@kinobi-so/visitors';
+export * from '@codama/errors';
+export * from '@codama/nodes';
+export * from '@codama/validators';
+export * from '@codama/visitors';
 
-export * from './kinobi';
+export * from './codama';

+ 0 - 51
packages/library/src/kinobi.ts

@@ -1,51 +0,0 @@
-import { KINOBI_ERROR__VERSION_MISMATCH } from '@kinobi-so/errors';
-import { KinobiError } from '@kinobi-so/errors';
-import { assertIsNode, KinobiVersion, Node, RootNode } from '@kinobi-so/nodes';
-import { visit, Visitor } from '@kinobi-so/visitors';
-
-export interface Kinobi {
-    accept<T>(visitor: Visitor<T, 'rootNode'>): T;
-    clone(): Kinobi;
-    getJson(): string;
-    getRoot(): RootNode;
-    update(visitor: Visitor<Node | null, 'rootNode'>): void;
-}
-
-export function createFromRoot(root: RootNode): Kinobi {
-    let currentRoot = root;
-    validateKinobiVersion(currentRoot.version);
-    return {
-        accept<T>(visitor: Visitor<T, 'rootNode'>): T {
-            return visit(currentRoot, visitor);
-        },
-        clone(): Kinobi {
-            return createFromRoot({ ...currentRoot });
-        },
-        getJson(): string {
-            return JSON.stringify(currentRoot);
-        },
-        getRoot(): RootNode {
-            return currentRoot;
-        },
-        update(visitor: Visitor<Node | null, 'rootNode'>): void {
-            const newRoot = visit(currentRoot, visitor);
-            assertIsNode(newRoot, 'rootNode');
-            currentRoot = newRoot;
-        },
-    };
-}
-
-export function createFromJson(json: string): Kinobi {
-    return createFromRoot(JSON.parse(json) as RootNode);
-}
-
-function validateKinobiVersion(rootVersion: KinobiVersion): void {
-    const kinobiVersion = __VERSION__;
-    if (rootVersion === kinobiVersion) return;
-    const [rootMajor, rootMinor] = rootVersion.split('.').map(Number);
-    const [KinobiMajor, KinobiMinor] = kinobiVersion.split('.').map(Number);
-    const isZeroMajor = rootMajor === 0 && KinobiMajor === 0;
-    if (isZeroMajor && rootMinor === KinobiMinor) return;
-    if (rootMajor === KinobiMajor) return;
-    throw new KinobiError(KINOBI_ERROR__VERSION_MISMATCH, { kinobiVersion, rootVersion });
-}

+ 5 - 5
packages/library/test/index.test.ts

@@ -11,15 +11,15 @@ test('it exports visitors', () => {
 });
 
 test('it accepts visitors', () => {
-    const kinobi = createFromRoot(rootNode(programNode({ name: 'myProgram', publicKey: '1111' })));
+    const codama = createFromRoot(rootNode(programNode({ name: 'myProgram', publicKey: '1111' })));
     const visitor = voidVisitor(['rootNode']);
-    const result = kinobi.accept(visitor) satisfies void;
+    const result = codama.accept(visitor) satisfies void;
     expect(typeof result).toBe('undefined');
 });
 
 test('it updates the root node returned by visitors', () => {
-    const kinobi = createFromRoot(rootNode(programNode({ name: 'myProgram', publicKey: '1111' })));
+    const codama = createFromRoot(rootNode(programNode({ name: 'myProgram', publicKey: '1111' })));
     const visitor = rootNodeVisitor(node => rootNode(programNode({ ...node.program, name: 'myTransformedProgram' })));
-    kinobi.update(visitor) satisfies void;
-    expect(kinobi.getRoot()).toEqual(rootNode(programNode({ name: 'myTransformedProgram', publicKey: '1111' })));
+    codama.update(visitor) satisfies void;
+    expect(codama.getRoot()).toEqual(rootNode(programNode({ name: 'myTransformedProgram', publicKey: '1111' })));
 });

+ 1 - 1
packages/library/tsconfig.json

@@ -1,7 +1,7 @@
 {
     "$schema": "https://json.schemastore.org/tsconfig",
     "compilerOptions": { "lib": [] },
-    "display": "kinobi",
+    "display": "codama",
     "extends": "../internals/tsconfig.base.json",
     "include": ["src", "test"]
 }

+ 7 - 7
packages/node-types/CHANGELOG.md

@@ -1,16 +1,16 @@
-# @kinobi-so/node-types
+# @codama/node-types
 
 ## 0.22.0
 
 ### Minor Changes
 
--   [#183](https://github.com/kinobi-so/kinobi/pull/183) [`c8c5934`](https://github.com/kinobi-so/kinobi/commit/c8c593466294f3ec7dca1fb828254e10aa312925) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add `InstructionLinkNode`, `InstructionAccountLinkNode` and `InstructionArgumentLinkNode`
+-   [#183](https://github.com/codama-idl/codama/pull/183) [`c8c5934`](https://github.com/codama-idl/codama/commit/c8c593466294f3ec7dca1fb828254e10aa312925) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add `InstructionLinkNode`, `InstructionAccountLinkNode` and `InstructionArgumentLinkNode`
 
--   [#175](https://github.com/kinobi-so/kinobi/pull/175) [`2b1259b`](https://github.com/kinobi-so/kinobi/commit/2b1259b566aa439ca61c28f7ef72ff9c0817e540) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Remove `importFrom` attributes from link nodes and resolvers
+-   [#175](https://github.com/codama-idl/codama/pull/175) [`2b1259b`](https://github.com/codama-idl/codama/commit/2b1259b566aa439ca61c28f7ef72ff9c0817e540) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Remove `importFrom` attributes from link nodes and resolvers
 
     Instead, a new `linkOverrides` attribute is introduced on all renderers to redirect a link node or a resolver to a custom path or module.
 
--   [#180](https://github.com/kinobi-so/kinobi/pull/180) [`93a318a`](https://github.com/kinobi-so/kinobi/commit/93a318a9b7ee435eb37934b0ab390e160d50968b) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add optional `program` attribute to link nodes and namespace linkable nodes under their associated program.
+-   [#180](https://github.com/codama-idl/codama/pull/180) [`93a318a`](https://github.com/codama-idl/codama/commit/93a318a9b7ee435eb37934b0ab390e160d50968b) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add optional `program` attribute to link nodes and namespace linkable nodes under their associated program.
 
 ## 0.21.5
 
@@ -26,7 +26,7 @@
 
 ### Minor Changes
 
--   [#111](https://github.com/kinobi-so/kinobi/pull/111) [`2f26050`](https://github.com/kinobi-so/kinobi/commit/2f26050ddbcbdefcefbd853e1017a30c94442e1f) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add `RemainderOptionTypeNode`
+-   [#111](https://github.com/codama-idl/codama/pull/111) [`2f26050`](https://github.com/codama-idl/codama/commit/2f26050ddbcbdefcefbd853e1017a30c94442e1f) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add `RemainderOptionTypeNode`
 
     A node that represents an optional item using a child `TypeNode` such that the item can either be present — i.e. `Some<T>` — or absent — i.e. `None` — depending on whether or not there are remaining bytes in the buffer.
 
@@ -38,7 +38,7 @@
 
 ### Patch Changes
 
--   [#43](https://github.com/kinobi-so/kinobi/pull/43) [`668b550`](https://github.com/kinobi-so/kinobi/commit/668b550aa2172c24ddb3b8751d91e67e94a93fa4) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Allow PdaValueNode to inline their own PdaNode definition
+-   [#43](https://github.com/codama-idl/codama/pull/43) [`668b550`](https://github.com/codama-idl/codama/commit/668b550aa2172c24ddb3b8751d91e67e94a93fa4) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Allow PdaValueNode to inline their own PdaNode definition
 
 ## 0.20.3
 
@@ -46,6 +46,6 @@
 
 ### Patch Changes
 
--   [`964776f`](https://github.com/kinobi-so/kinobi/commit/964776fe73402c236d334032821013674c3b1a5e) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix invalid package dependencies
+-   [`964776f`](https://github.com/codama-idl/codama/commit/964776fe73402c236d334032821013674c3b1a5e) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix invalid package dependencies
 
 ## 0.20.1

+ 1 - 1
packages/node-types/LICENSE

@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2024 Kinobi
+Copyright (c) 2024 Codama
 Copyright (c) 2024 Metaplex Foundation
 
 Permission is hereby granted, free of charge, to any person obtaining

+ 9 - 9
packages/node-types/README.md

@@ -1,24 +1,24 @@
-# Kinobi ➤ Node Types
+# Codama ➤ Node Types
 
 [![npm][npm-image]][npm-url]
 [![npm-downloads][npm-downloads-image]][npm-url]
 
-[npm-downloads-image]: https://img.shields.io/npm/dm/@kinobi-so/node-types.svg?style=flat
-[npm-image]: https://img.shields.io/npm/v/@kinobi-so/node-types.svg?style=flat&label=%40kinobi-so%2Fnode-types
-[npm-url]: https://www.npmjs.com/package/@kinobi-so/node-types
+[npm-downloads-image]: https://img.shields.io/npm/dm/@codama/node-types.svg?style=flat
+[npm-image]: https://img.shields.io/npm/v/@codama/node-types.svg?style=flat&label=%40codama%2Fnode-types
+[npm-url]: https://www.npmjs.com/package/@codama/node-types
 
-This package is the type-only version of the `@kinobi-so/nodes` package. Check out the [nodes documentation](../nodes) for more information.
+This package is the type-only version of the `@codama/nodes` package. Check out the [nodes documentation](../nodes) for more information.
 
 ## Installation
 
 ```sh
-pnpm install @kinobi-so/node-types
+pnpm install @codama/node-types
 ```
 
 > [!NOTE]
-> This package is included in the [`@kinobi-so/nodes`](../nodes) package and in the main [`kinobi`](../library) library. Meaning, you already have access to its content if you are installing Kinobi in one of these ways.
+> This package is included in the [`@codama/nodes`](../nodes) package and in the main [`codama`](../library) library. Meaning, you already have access to its content if you are installing Codama in one of these ways.
 >
 > ```sh
-> pnpm install @kinobi-so/nodes
-> pnpm install kinobi
+> pnpm install @codama/nodes
+> pnpm install codama
 > ```

+ 10 - 10
packages/node-types/package.json

@@ -1,7 +1,7 @@
 {
-    "name": "@kinobi-so/node-types",
+    "name": "@codama/node-types",
     "version": "0.22.0",
-    "description": "Node specifications for the Kinobi standard",
+    "description": "Node specifications for the Codama standard",
     "exports": {
         "types": "./dist/types/index.d.ts",
         "react-native": "./dist/index.react-native.mjs",
@@ -36,21 +36,21 @@
     ],
     "scripts": {
         "build": "rimraf dist && pnpm build:src && pnpm build:types",
-        "build:src": "zx ../../node_modules/@kinobi-so/internals/scripts/build-src.mjs package",
-        "build:types": "zx ../../node_modules/@kinobi-so/internals/scripts/build-types.mjs",
-        "lint": "zx ../../node_modules/@kinobi-so/internals/scripts/lint.mjs",
-        "lint:fix": "zx ../../node_modules/@kinobi-so/internals/scripts/lint.mjs --fix",
+        "build:src": "zx ../../node_modules/@codama/internals/scripts/build-src.mjs package",
+        "build:types": "zx ../../node_modules/@codama/internals/scripts/build-types.mjs",
+        "lint": "zx ../../node_modules/@codama/internals/scripts/lint.mjs",
+        "lint:fix": "zx ../../node_modules/@codama/internals/scripts/lint.mjs --fix",
         "test": "pnpm test:types && pnpm test:treeshakability",
-        "test:treeshakability": "zx ../../node_modules/@kinobi-so/internals/scripts/test-treeshakability.mjs",
-        "test:types": "zx ../../node_modules/@kinobi-so/internals/scripts/test-types.mjs"
+        "test:treeshakability": "zx ../../node_modules/@codama/internals/scripts/test-treeshakability.mjs",
+        "test:types": "zx ../../node_modules/@codama/internals/scripts/test-types.mjs"
     },
     "license": "MIT",
     "repository": {
         "type": "git",
-        "url": "https://github.com/kinobi-so/kinobi"
+        "url": "https://github.com/codama-idl/codama"
     },
     "bugs": {
-        "url": "http://github.com/kinobi-so/kinobi/issues"
+        "url": "http://github.com/codama-idl/codama/issues"
     },
     "browserslist": [
         "supports bigint and not dead",

+ 3 - 3
packages/node-types/src/RootNode.ts

@@ -1,5 +1,5 @@
 import type { ProgramNode } from './ProgramNode';
-import type { KinobiVersion } from './shared';
+import type { CodamaVersion } from './shared';
 
 export interface RootNode<
     TProgram extends ProgramNode = ProgramNode,
@@ -8,8 +8,8 @@ export interface RootNode<
     readonly kind: 'rootNode';
 
     // Data.
-    readonly standard: 'kinobi';
-    readonly version: KinobiVersion;
+    readonly standard: 'codama';
+    readonly version: CodamaVersion;
 
     // Children.
     readonly program: TProgram;

+ 1 - 1
packages/node-types/src/shared/version.ts

@@ -1,4 +1,4 @@
 type SemanticVersion = `${number}.${number}.${number}`;
 
-export type KinobiVersion = SemanticVersion;
+export type CodamaVersion = SemanticVersion;
 export type ProgramVersion = SemanticVersion;

+ 1 - 1
packages/node-types/tsconfig.json

@@ -1,7 +1,7 @@
 {
     "$schema": "https://json.schemastore.org/tsconfig",
     "compilerOptions": { "lib": [] },
-    "display": "@kinobi-so/node-types",
+    "display": "@codama/node-types",
     "extends": "../internals/tsconfig.base.json",
     "include": ["src", "test"]
 }

+ 57 - 57
packages/nodes-from-anchor/CHANGELOG.md

@@ -1,148 +1,148 @@
-# @kinobi-so/nodes-from-anchor
+# @codama/nodes-from-anchor
 
 ## 0.22.0
 
 ### Minor Changes
 
--   [#175](https://github.com/kinobi-so/kinobi/pull/175) [`2b1259b`](https://github.com/kinobi-so/kinobi/commit/2b1259b566aa439ca61c28f7ef72ff9c0817e540) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Remove `importFrom` attributes from link nodes and resolvers
+-   [#175](https://github.com/codama-idl/codama/pull/175) [`2b1259b`](https://github.com/codama-idl/codama/commit/2b1259b566aa439ca61c28f7ef72ff9c0817e540) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Remove `importFrom` attributes from link nodes and resolvers
 
     Instead, a new `linkOverrides` attribute is introduced on all renderers to redirect a link node or a resolver to a custom path or module.
 
 ### Patch Changes
 
--   Updated dependencies [[`c8c5934`](https://github.com/kinobi-so/kinobi/commit/c8c593466294f3ec7dca1fb828254e10aa312925), [`2b1259b`](https://github.com/kinobi-so/kinobi/commit/2b1259b566aa439ca61c28f7ef72ff9c0817e540), [`93a318a`](https://github.com/kinobi-so/kinobi/commit/93a318a9b7ee435eb37934b0ab390e160d50968b)]:
-    -   @kinobi-so/errors@0.22.0
-    -   @kinobi-so/nodes@0.22.0
-    -   @kinobi-so/visitors@0.22.0
+-   Updated dependencies [[`c8c5934`](https://github.com/codama-idl/codama/commit/c8c593466294f3ec7dca1fb828254e10aa312925), [`2b1259b`](https://github.com/codama-idl/codama/commit/2b1259b566aa439ca61c28f7ef72ff9c0817e540), [`93a318a`](https://github.com/codama-idl/codama/commit/93a318a9b7ee435eb37934b0ab390e160d50968b)]:
+    -   @codama/errors@0.22.0
+    -   @codama/nodes@0.22.0
+    -   @codama/visitors@0.22.0
 
 ## 0.21.3
 
 ### Patch Changes
 
--   Updated dependencies [[`a6849d3`](https://github.com/kinobi-so/kinobi/commit/a6849d36a828e2b6b703f2a86d2ea0ae6d2fa0d8)]:
-    -   @kinobi-so/errors@0.21.5
-    -   @kinobi-so/nodes@0.21.5
-    -   @kinobi-so/visitors@0.21.5
+-   Updated dependencies [[`a6849d3`](https://github.com/codama-idl/codama/commit/a6849d36a828e2b6b703f2a86d2ea0ae6d2fa0d8)]:
+    -   @codama/errors@0.21.5
+    -   @codama/nodes@0.21.5
+    -   @codama/visitors@0.21.5
 
 ## 0.21.2
 
 ### Patch Changes
 
 -   Updated dependencies []:
-    -   @kinobi-so/errors@0.21.4
-    -   @kinobi-so/nodes@0.21.4
-    -   @kinobi-so/visitors@0.21.4
+    -   @codama/errors@0.21.4
+    -   @codama/nodes@0.21.4
+    -   @codama/visitors@0.21.4
 
 ## 0.21.1
 
 ### Patch Changes
 
--   [#123](https://github.com/kinobi-so/kinobi/pull/123) [`59ceb1d`](https://github.com/kinobi-so/kinobi/commit/59ceb1d7803307b3a1a5e23ea3267934ad87bfc6) Thanks [@dependabot](https://github.com/apps/dependabot)! - Update prettier
+-   [#123](https://github.com/codama-idl/codama/pull/123) [`59ceb1d`](https://github.com/codama-idl/codama/commit/59ceb1d7803307b3a1a5e23ea3267934ad87bfc6) Thanks [@dependabot](https://github.com/apps/dependabot)! - Update prettier
 
 -   Updated dependencies []:
-    -   @kinobi-so/visitors@0.21.3
-    -   @kinobi-so/errors@0.21.3
-    -   @kinobi-so/nodes@0.21.3
+    -   @codama/visitors@0.21.3
+    -   @codama/errors@0.21.3
+    -   @codama/nodes@0.21.3
 
 ## 0.21.0
 
 ### Minor Changes
 
--   [`f13abb0`](https://github.com/kinobi-so/kinobi/commit/f13abb01fc4a6fc76fe4566e3f667aab92b43480) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Bring some packages to 0.21 range
+-   [`f13abb0`](https://github.com/codama-idl/codama/commit/f13abb01fc4a6fc76fe4566e3f667aab92b43480) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Bring some packages to 0.21 range
 
 ### Patch Changes
 
 -   Updated dependencies []:
-    -   @kinobi-so/visitors@0.21.2
-    -   @kinobi-so/errors@0.21.2
-    -   @kinobi-so/nodes@0.21.2
+    -   @codama/visitors@0.21.2
+    -   @codama/errors@0.21.2
+    -   @codama/nodes@0.21.2
 
 ## 0.20.10
 
 ### Patch Changes
 
 -   Updated dependencies []:
-    -   @kinobi-so/visitors@0.21.1
-    -   @kinobi-so/errors@0.21.1
-    -   @kinobi-so/nodes@0.21.1
+    -   @codama/visitors@0.21.1
+    -   @codama/errors@0.21.1
+    -   @codama/nodes@0.21.1
 
 ## 0.20.9
 
 ### Patch Changes
 
--   Updated dependencies [[`2f26050`](https://github.com/kinobi-so/kinobi/commit/2f26050ddbcbdefcefbd853e1017a30c94442e1f)]:
-    -   @kinobi-so/errors@0.21.0
-    -   @kinobi-so/nodes@0.21.0
-    -   @kinobi-so/visitors@0.21.0
+-   Updated dependencies [[`2f26050`](https://github.com/codama-idl/codama/commit/2f26050ddbcbdefcefbd853e1017a30c94442e1f)]:
+    -   @codama/errors@0.21.0
+    -   @codama/nodes@0.21.0
+    -   @codama/visitors@0.21.0
 
 ## 0.20.8
 
 ### Patch Changes
 
--   [#109](https://github.com/kinobi-so/kinobi/pull/109) [`4979b94`](https://github.com/kinobi-so/kinobi/commit/4979b94720465a58538ee61bb1a4a23fd5471511) Thanks [@kespinola](https://github.com/kespinola)! - Fix argument node lookup for anchor v01 instruction pda seeds.
+-   [#109](https://github.com/codama-idl/codama/pull/109) [`4979b94`](https://github.com/codama-idl/codama/commit/4979b94720465a58538ee61bb1a4a23fd5471511) Thanks [@kespinola](https://github.com/kespinola)! - Fix argument node lookup for anchor v01 instruction pda seeds.
 
--   Updated dependencies [[`bcf6a23`](https://github.com/kinobi-so/kinobi/commit/bcf6a23fa0e0d1f1a064ea6ddcfc9c092190a51f)]:
-    -   @kinobi-so/errors@0.20.6
-    -   @kinobi-so/nodes@0.20.6
-    -   @kinobi-so/visitors@0.20.6
+-   Updated dependencies [[`bcf6a23`](https://github.com/codama-idl/codama/commit/bcf6a23fa0e0d1f1a064ea6ddcfc9c092190a51f)]:
+    -   @codama/errors@0.20.6
+    -   @codama/nodes@0.20.6
+    -   @codama/visitors@0.20.6
 
 ## 0.20.7
 
 ### Patch Changes
 
--   [#42](https://github.com/kinobi-so/kinobi/pull/42) [`908acba`](https://github.com/kinobi-so/kinobi/commit/908acba99cdb0b761ed79aebf6828e23fde97ef8) Thanks [@kespinola](https://github.com/kespinola)! - set anchor account seed definitions on instructions as defaultValue for the associated instruction account. Removes hoisting PDAs to the program node for the time being.
+-   [#42](https://github.com/codama-idl/codama/pull/42) [`908acba`](https://github.com/codama-idl/codama/commit/908acba99cdb0b761ed79aebf6828e23fde97ef8) Thanks [@kespinola](https://github.com/kespinola)! - set anchor account seed definitions on instructions as defaultValue for the associated instruction account. Removes hoisting PDAs to the program node for the time being.
 
--   Updated dependencies [[`908acba`](https://github.com/kinobi-so/kinobi/commit/908acba99cdb0b761ed79aebf6828e23fde97ef8)]:
-    -   @kinobi-so/errors@0.20.5
-    -   @kinobi-so/nodes@0.20.5
-    -   @kinobi-so/visitors@0.20.5
+-   Updated dependencies [[`908acba`](https://github.com/codama-idl/codama/commit/908acba99cdb0b761ed79aebf6828e23fde97ef8)]:
+    -   @codama/errors@0.20.5
+    -   @codama/nodes@0.20.5
+    -   @codama/visitors@0.20.5
 
 ## 0.20.6
 
 ### Patch Changes
 
--   Updated dependencies [[`668b550`](https://github.com/kinobi-so/kinobi/commit/668b550aa2172c24ddb3b8751d91e67e94a93fa4)]:
-    -   @kinobi-so/visitors@0.20.4
-    -   @kinobi-so/nodes@0.20.4
-    -   @kinobi-so/errors@0.20.4
+-   Updated dependencies [[`668b550`](https://github.com/codama-idl/codama/commit/668b550aa2172c24ddb3b8751d91e67e94a93fa4)]:
+    -   @codama/visitors@0.20.4
+    -   @codama/nodes@0.20.4
+    -   @codama/errors@0.20.4
 
 ## 0.20.5
 
 ### Patch Changes
 
--   Updated dependencies [[`4bc5823`](https://github.com/kinobi-so/kinobi/commit/4bc5823377824198bd5a6432d16333b2cb1d8b8c)]:
-    -   @kinobi-so/errors@0.20.3
-    -   @kinobi-so/visitors@0.20.3
-    -   @kinobi-so/nodes@0.20.3
+-   Updated dependencies [[`4bc5823`](https://github.com/codama-idl/codama/commit/4bc5823377824198bd5a6432d16333b2cb1d8b8c)]:
+    -   @codama/errors@0.20.3
+    -   @codama/visitors@0.20.3
+    -   @codama/nodes@0.20.3
 
 ## 0.20.4
 
 ### Patch Changes
 
--   [#37](https://github.com/kinobi-so/kinobi/pull/37) [`c5bc916`](https://github.com/kinobi-so/kinobi/commit/c5bc91609b5cb16caec13214bbe7a39e74e8d52c) Thanks [@kespinola](https://github.com/kespinola)! - Remove Anchor V01 accounts from defined types to resolve duplicate exports in generated clients
+-   [#37](https://github.com/codama-idl/codama/pull/37) [`c5bc916`](https://github.com/codama-idl/codama/commit/c5bc91609b5cb16caec13214bbe7a39e74e8d52c) Thanks [@kespinola](https://github.com/kespinola)! - Remove Anchor V01 accounts from defined types to resolve duplicate exports in generated clients
 
 ## 0.20.3
 
 ### Patch Changes
 
--   [`964776f`](https://github.com/kinobi-so/kinobi/commit/964776fe73402c236d334032821013674c3b1a5e) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix invalid package dependencies
+-   [`964776f`](https://github.com/codama-idl/codama/commit/964776fe73402c236d334032821013674c3b1a5e) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix invalid package dependencies
 
--   Updated dependencies [[`964776f`](https://github.com/kinobi-so/kinobi/commit/964776fe73402c236d334032821013674c3b1a5e)]:
-    -   @kinobi-so/errors@0.20.2
-    -   @kinobi-so/nodes@0.20.2
-    -   @kinobi-so/visitors@0.20.2
+-   Updated dependencies [[`964776f`](https://github.com/codama-idl/codama/commit/964776fe73402c236d334032821013674c3b1a5e)]:
+    -   @codama/errors@0.20.2
+    -   @codama/nodes@0.20.2
+    -   @codama/visitors@0.20.2
 
 ## 0.20.2
 
 ### Patch Changes
 
--   [#30](https://github.com/kinobi-so/kinobi/pull/30) [`d43493e`](https://github.com/kinobi-so/kinobi/commit/d43493e0e42c4b1064c174050a91e71c4d28e252) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix type definition of Anchor discriminators
+-   [#30](https://github.com/codama-idl/codama/pull/30) [`d43493e`](https://github.com/codama-idl/codama/commit/d43493e0e42c4b1064c174050a91e71c4d28e252) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Fix type definition of Anchor discriminators
 
 ## 0.20.1
 
 ### Patch Changes
 
--   Updated dependencies [[`0dec0c8`](https://github.com/kinobi-so/kinobi/commit/0dec0c8fff5e80fafc964416058e4ddf1db2bda0)]:
-    -   @kinobi-so/errors@0.20.1
-    -   @kinobi-so/nodes@0.20.1
-    -   @kinobi-so/visitors@0.20.1
+-   Updated dependencies [[`0dec0c8`](https://github.com/codama-idl/codama/commit/0dec0c8fff5e80fafc964416058e4ddf1db2bda0)]:
+    -   @codama/errors@0.20.1
+    -   @codama/nodes@0.20.1
+    -   @codama/visitors@0.20.1

+ 1 - 1
packages/nodes-from-anchor/LICENSE

@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2024 Kinobi
+Copyright (c) 2024 Codama
 Copyright (c) 2024 Metaplex Foundation
 
 Permission is hereby granted, free of charge, to any person obtaining

+ 12 - 12
packages/nodes-from-anchor/README.md

@@ -1,22 +1,22 @@
-# Kinobi ➤ Nodes From Anchor
+# Codama ➤ Nodes From Anchor
 
 [![npm][npm-image]][npm-url]
 [![npm-downloads][npm-downloads-image]][npm-url]
 
-[npm-downloads-image]: https://img.shields.io/npm/dm/@kinobi-so/nodes-from-anchor.svg?style=flat
-[npm-image]: https://img.shields.io/npm/v/@kinobi-so/nodes-from-anchor.svg?style=flat&label=%40kinobi-so%2Fnodes-from-anchor
-[npm-url]: https://www.npmjs.com/package/@kinobi-so/nodes-from-anchor
+[npm-downloads-image]: https://img.shields.io/npm/dm/@codama/nodes-from-anchor.svg?style=flat
+[npm-image]: https://img.shields.io/npm/v/@codama/nodes-from-anchor.svg?style=flat&label=%40codama%2Fnodes-from-anchor
+[npm-url]: https://www.npmjs.com/package/@codama/nodes-from-anchor
 
-This package converts Anchor IDLs from various versions into Kinobi IDLs.
+This package converts Anchor IDLs from various versions into Codama IDLs.
 
 ## Installation
 
 ```sh
-pnpm install @kinobi-so/nodes-from-anchor
+pnpm install @codama/nodes-from-anchor
 ```
 
 > [!NOTE]
-> This package is **not** included in the main [`kinobi`](../library) package.
+> This package is **not** included in the main [`codama`](../library) package.
 
 ## Functions
 
@@ -25,9 +25,9 @@ pnpm install @kinobi-so/nodes-from-anchor
 This function takes a valid Anchor IDL and returns a `RootNode`.
 
 ```js
-// node ./kinobi.mjs
-import { rootNodeFromAnchor } from '@kinobi-so/nodes-from-anchor';
-import { createFromRoot } from 'kinobi';
+// node ./codama.mjs
+import { rootNodeFromAnchor } from '@codama/nodes-from-anchor';
+import { createFromRoot } from 'codama';
 import { readFileSync } from 'node:fs';
 import path from 'path';
 
@@ -35,6 +35,6 @@ import path from 'path';
 const anchorIdlPath = path.join(__dirname, 'target', 'idl', 'anchor_program.json');
 const anchorIdl = JSON.parse(readFileSync(anchorIdlPath, 'utf-8'));
 
-// Parse it into a Kinobi IDL.
-const kinobi = createFromRoot(rootNodeFromAnchor(anchorIdl));
+// Parse it into a Codama IDL.
+const codama = createFromRoot(rootNodeFromAnchor(anchorIdl));
 ```

+ 17 - 17
packages/nodes-from-anchor/package.json

@@ -1,7 +1,7 @@
 {
-    "name": "@kinobi-so/nodes-from-anchor",
+    "name": "@codama/nodes-from-anchor",
     "version": "0.22.0",
-    "description": "Node specifications and helpers for the Kinobi standard",
+    "description": "Node specifications and helpers for the Codama standard",
     "exports": {
         "types": "./dist/types/index.d.ts",
         "react-native": "./dist/index.react-native.mjs",
@@ -36,31 +36,31 @@
     ],
     "scripts": {
         "build": "rimraf dist && pnpm build:src && pnpm build:types",
-        "build:src": "zx ../../node_modules/@kinobi-so/internals/scripts/build-src.mjs package",
-        "build:types": "zx ../../node_modules/@kinobi-so/internals/scripts/build-types.mjs",
-        "dev": "zx ../../node_modules/@kinobi-so/internals/scripts/test-unit.mjs node --watch",
-        "lint": "zx ../../node_modules/@kinobi-so/internals/scripts/lint.mjs",
-        "lint:fix": "zx ../../node_modules/@kinobi-so/internals/scripts/lint.mjs --fix",
+        "build:src": "zx ../../node_modules/@codama/internals/scripts/build-src.mjs package",
+        "build:types": "zx ../../node_modules/@codama/internals/scripts/build-types.mjs",
+        "dev": "zx ../../node_modules/@codama/internals/scripts/test-unit.mjs node --watch",
+        "lint": "zx ../../node_modules/@codama/internals/scripts/lint.mjs",
+        "lint:fix": "zx ../../node_modules/@codama/internals/scripts/lint.mjs --fix",
         "test": "pnpm test:types && pnpm test:treeshakability && pnpm test:browser && pnpm test:node && pnpm test:react-native",
-        "test:browser": "zx ../../node_modules/@kinobi-so/internals/scripts/test-unit.mjs browser",
-        "test:node": "zx ../../node_modules/@kinobi-so/internals/scripts/test-unit.mjs node",
-        "test:react-native": "zx ../../node_modules/@kinobi-so/internals/scripts/test-unit.mjs react-native",
-        "test:treeshakability": "zx ../../node_modules/@kinobi-so/internals/scripts/test-treeshakability.mjs",
-        "test:types": "zx ../../node_modules/@kinobi-so/internals/scripts/test-types.mjs"
+        "test:browser": "zx ../../node_modules/@codama/internals/scripts/test-unit.mjs browser",
+        "test:node": "zx ../../node_modules/@codama/internals/scripts/test-unit.mjs node",
+        "test:react-native": "zx ../../node_modules/@codama/internals/scripts/test-unit.mjs react-native",
+        "test:treeshakability": "zx ../../node_modules/@codama/internals/scripts/test-treeshakability.mjs",
+        "test:types": "zx ../../node_modules/@codama/internals/scripts/test-types.mjs"
     },
     "dependencies": {
-        "@kinobi-so/errors": "workspace:*",
-        "@kinobi-so/nodes": "workspace:*",
-        "@kinobi-so/visitors": "workspace:*",
+        "@codama/errors": "workspace:*",
+        "@codama/nodes": "workspace:*",
+        "@codama/visitors": "workspace:*",
         "@noble/hashes": "^1.5.0"
     },
     "license": "MIT",
     "repository": {
         "type": "git",
-        "url": "https://github.com/kinobi-so/kinobi"
+        "url": "https://github.com/codama-idl/codama"
     },
     "bugs": {
-        "url": "http://github.com/kinobi-so/kinobi/issues"
+        "url": "http://github.com/codama-idl/codama/issues"
     },
     "browserslist": [
         "supports bigint and not dead",

+ 2 - 2
packages/nodes-from-anchor/src/defaultVisitor.ts

@@ -1,4 +1,4 @@
-import { assertIsNode, Node, RootNode } from '@kinobi-so/nodes';
+import { assertIsNode, Node, RootNode } from '@codama/nodes';
 import {
     deduplicateIdenticalDefinedTypesVisitor,
     flattenInstructionDataArgumentsVisitor,
@@ -10,7 +10,7 @@ import {
     unwrapInstructionArgsDefinedTypesVisitor,
     visit,
     Visitor,
-} from '@kinobi-so/visitors';
+} from '@codama/visitors';
 
 export function defaultVisitor() {
     return rootNodeVisitor(currentRoot => {

+ 1 - 1
packages/nodes-from-anchor/src/discriminators.ts

@@ -1,4 +1,4 @@
-import { BytesValueNode, bytesValueNode, pascalCase, snakeCase } from '@kinobi-so/nodes';
+import { BytesValueNode, bytesValueNode, pascalCase, snakeCase } from '@codama/nodes';
 import { sha256 } from '@noble/hashes/sha256';
 
 import { hex } from './utils';

+ 2 - 2
packages/nodes-from-anchor/src/index.ts

@@ -1,5 +1,5 @@
-import { RootNode } from '@kinobi-so/nodes';
-import { visit } from '@kinobi-so/visitors';
+import { RootNode } from '@codama/nodes';
+import { visit } from '@codama/visitors';
 
 import { defaultVisitor } from './defaultVisitor';
 import { IdlV00, rootNodeFromAnchorV00 } from './v00';

+ 1 - 1
packages/nodes-from-anchor/src/v00/AccountNode.ts

@@ -11,7 +11,7 @@ import {
     structFieldTypeNode,
     StructTypeNode,
     structTypeNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 
 import { getAnchorAccountDiscriminatorV00 } from '../discriminators';
 import { IdlV00AccountDef } from './idl';

+ 1 - 1
packages/nodes-from-anchor/src/v00/DefinedTypeNode.ts

@@ -1,4 +1,4 @@
-import { DefinedTypeNode, definedTypeNode } from '@kinobi-so/nodes';
+import { DefinedTypeNode, definedTypeNode } from '@codama/nodes';
 
 import { IdlV00TypeDef } from './idl';
 import { typeNodeFromAnchorV00 } from './typeNodes';

+ 1 - 1
packages/nodes-from-anchor/src/v00/ErrorNode.ts

@@ -1,4 +1,4 @@
-import { ErrorNode, errorNode } from '@kinobi-so/nodes';
+import { ErrorNode, errorNode } from '@codama/nodes';
 
 import { IdlV00ErrorCode } from './idl';
 

+ 1 - 1
packages/nodes-from-anchor/src/v00/InstructionAccountNode.ts

@@ -1,4 +1,4 @@
-import { InstructionAccountNode, instructionAccountNode } from '@kinobi-so/nodes';
+import { InstructionAccountNode, instructionAccountNode } from '@codama/nodes';
 
 import { IdlV00Account, IdlV00AccountItem } from './idl';
 

+ 1 - 1
packages/nodes-from-anchor/src/v00/InstructionArgumentNode.ts

@@ -1,4 +1,4 @@
-import { InstructionArgumentNode, instructionArgumentNode } from '@kinobi-so/nodes';
+import { InstructionArgumentNode, instructionArgumentNode } from '@codama/nodes';
 
 import { IdlV00Field } from './idl';
 import { typeNodeFromAnchorV00 } from './typeNodes';

+ 1 - 1
packages/nodes-from-anchor/src/v00/InstructionNode.ts

@@ -8,7 +8,7 @@ import {
     InstructionNode,
     instructionNode,
     numberValueNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 
 import { getAnchorInstructionDiscriminatorV00 } from '../discriminators';
 import { IdlV00Instruction } from './idl';

+ 1 - 1
packages/nodes-from-anchor/src/v00/PdaNode.ts

@@ -11,7 +11,7 @@ import {
     stringTypeNode,
     stringValueNode,
     variablePdaSeedNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 
 import { IdlV00PdaDef } from './idl';
 import { typeNodeFromAnchorV00 } from './typeNodes';

+ 1 - 1
packages/nodes-from-anchor/src/v00/ProgramNode.ts

@@ -1,4 +1,4 @@
-import { ProgramNode, programNode, ProgramVersion } from '@kinobi-so/nodes';
+import { ProgramNode, programNode, ProgramVersion } from '@codama/nodes';
 
 import { accountNodeFromAnchorV00 } from './AccountNode';
 import { definedTypeNodeFromAnchorV00 } from './DefinedTypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v00/RootNode.ts

@@ -1,4 +1,4 @@
-import { RootNode, rootNode } from '@kinobi-so/nodes';
+import { RootNode, rootNode } from '@codama/nodes';
 
 import { IdlV00 } from './idl';
 import { programNodeFromAnchorV00 } from './ProgramNode';

+ 1 - 1
packages/nodes-from-anchor/src/v00/typeNodes/ArrayTypeNode.ts

@@ -5,7 +5,7 @@ import {
     numberTypeNode,
     prefixedCountNode,
     remainderCountNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 
 import { IdlV00TypeArray, IdlV00TypeVec } from '../idl';
 import { typeNodeFromAnchorV00 } from './TypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v00/typeNodes/EnumEmptyVariantTypeNode.ts

@@ -1,4 +1,4 @@
-import { EnumEmptyVariantTypeNode, enumEmptyVariantTypeNode } from '@kinobi-so/nodes';
+import { EnumEmptyVariantTypeNode, enumEmptyVariantTypeNode } from '@codama/nodes';
 
 import { IdlV00EnumVariant } from '../idl';
 

+ 1 - 1
packages/nodes-from-anchor/src/v00/typeNodes/EnumStructVariantTypeNode.ts

@@ -1,4 +1,4 @@
-import { EnumStructVariantTypeNode, enumStructVariantTypeNode, StructTypeNode } from '@kinobi-so/nodes';
+import { EnumStructVariantTypeNode, enumStructVariantTypeNode, StructTypeNode } from '@codama/nodes';
 
 import { IdlV00EnumFieldsNamed, IdlV00EnumVariant } from '../idl';
 import { structTypeNodeFromAnchorV00 } from './StructTypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v00/typeNodes/EnumTupleVariantTypeNode.ts

@@ -1,4 +1,4 @@
-import { EnumTupleVariantTypeNode, enumTupleVariantTypeNode, TupleTypeNode } from '@kinobi-so/nodes';
+import { EnumTupleVariantTypeNode, enumTupleVariantTypeNode, TupleTypeNode } from '@codama/nodes';
 
 import { IdlV00EnumFieldsTuple, IdlV00EnumVariant } from '../idl';
 import { tupleTypeNodeFromAnchorV00 } from './TupleTypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v00/typeNodes/EnumTypeNode.ts

@@ -1,4 +1,4 @@
-import { EnumTypeNode, enumTypeNode, EnumVariantTypeNode, NumberTypeNode, numberTypeNode } from '@kinobi-so/nodes';
+import { EnumTypeNode, enumTypeNode, EnumVariantTypeNode, NumberTypeNode, numberTypeNode } from '@codama/nodes';
 
 import { IdlV00EnumFieldsNamed, IdlV00EnumFieldsTuple, IdlV00EnumVariant, IdlV00TypeDefTyEnum } from '../idl';
 import { enumEmptyVariantTypeNodeFromAnchorV00 } from './EnumEmptyVariantTypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v00/typeNodes/MapTypeNode.ts

@@ -6,7 +6,7 @@ import {
     numberTypeNode,
     prefixedCountNode,
     remainderCountNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 
 import { IdlV00TypeMap } from '../idl';
 import { typeNodeFromAnchorV00 } from './TypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v00/typeNodes/OptionTypeNode.ts

@@ -1,4 +1,4 @@
-import { numberTypeNode, OptionTypeNode, optionTypeNode } from '@kinobi-so/nodes';
+import { numberTypeNode, OptionTypeNode, optionTypeNode } from '@codama/nodes';
 
 import { IdlV00TypeOption } from '../idl';
 import { typeNodeFromAnchorV00 } from './TypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v00/typeNodes/SetTypeNode.ts

@@ -5,7 +5,7 @@ import {
     remainderCountNode,
     SetTypeNode,
     setTypeNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 
 import { IdlV00TypeSet } from '../idl';
 import { typeNodeFromAnchorV00 } from './TypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v00/typeNodes/StructFieldTypeNode.ts

@@ -1,4 +1,4 @@
-import { StructFieldTypeNode, structFieldTypeNode } from '@kinobi-so/nodes';
+import { StructFieldTypeNode, structFieldTypeNode } from '@codama/nodes';
 
 import { IdlV00Field } from '../idl';
 import { typeNodeFromAnchorV00 } from './TypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v00/typeNodes/StructTypeNode.ts

@@ -1,4 +1,4 @@
-import { StructTypeNode, structTypeNode } from '@kinobi-so/nodes';
+import { StructTypeNode, structTypeNode } from '@codama/nodes';
 
 import { IdlV00TypeDefTyStruct } from '../idl';
 import { structFieldTypeNodeFromAnchorV00 } from './StructFieldTypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v00/typeNodes/TupleTypeNode.ts

@@ -1,4 +1,4 @@
-import { TupleTypeNode, tupleTypeNode } from '@kinobi-so/nodes';
+import { TupleTypeNode, tupleTypeNode } from '@codama/nodes';
 
 import { IdlV00TypeTuple } from '../idl';
 import { typeNodeFromAnchorV00 } from './TypeNode';

+ 4 - 4
packages/nodes-from-anchor/src/v00/typeNodes/TypeNode.ts

@@ -1,4 +1,4 @@
-import { KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, KinobiError } from '@kinobi-so/errors';
+import { CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, CodamaError } from '@codama/errors';
 import {
     booleanTypeNode,
     bytesTypeNode,
@@ -8,7 +8,7 @@ import {
     sizePrefixTypeNode,
     stringTypeNode,
     TypeNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 
 import {
     IdlV00Type,
@@ -59,7 +59,7 @@ export const typeNodeFromAnchorV00 = (idlType: IdlV00Type | IdlV00TypeDefTy): Ty
 
     // Ensure eveything else is an object.
     if (typeof idlType !== 'object') {
-        throw new KinobiError(KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, {
+        throw new CodamaError(CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, {
             idlType: JSON.stringify(idlType),
         });
     }
@@ -112,7 +112,7 @@ export const typeNodeFromAnchorV00 = (idlType: IdlV00Type | IdlV00TypeDefTy): Ty
         return tupleTypeNodeFromAnchorV00(idlType as IdlV00TypeTuple);
     }
 
-    throw new KinobiError(KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, {
+    throw new CodamaError(CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, {
         idlType: JSON.stringify(idlType),
     });
 };

+ 3 - 3
packages/nodes-from-anchor/src/v01/AccountNode.ts

@@ -1,4 +1,4 @@
-import { KINOBI_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING, KinobiError } from '@kinobi-so/errors';
+import { CODAMA_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING, CodamaError } from '@codama/errors';
 import {
     AccountNode,
     accountNode,
@@ -9,7 +9,7 @@ import {
     fixedSizeTypeNode,
     structFieldTypeNode,
     structTypeNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 
 import { getAnchorDiscriminatorV01 } from './../discriminators';
 import { IdlV01Account, IdlV01TypeDef } from './idl';
@@ -20,7 +20,7 @@ export function accountNodeFromAnchorV01(idl: IdlV01Account, types: IdlV01TypeDe
     const type = types.find(({ name }) => name === idl.name);
 
     if (!type) {
-        throw new KinobiError(KINOBI_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING, { name: idl.name });
+        throw new CodamaError(CODAMA_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING, { name: idl.name });
     }
 
     const data = typeNodeFromAnchorV01(type.type);

+ 1 - 1
packages/nodes-from-anchor/src/v01/DefinedTypeNode.ts

@@ -1,4 +1,4 @@
-import { DefinedTypeNode, definedTypeNode } from '@kinobi-so/nodes';
+import { DefinedTypeNode, definedTypeNode } from '@codama/nodes';
 
 import { IdlV01TypeDef } from './idl';
 import { typeNodeFromAnchorV01 } from './typeNodes';

+ 1 - 1
packages/nodes-from-anchor/src/v01/ErrorNode.ts

@@ -1,4 +1,4 @@
-import { ErrorNode, errorNode } from '@kinobi-so/nodes';
+import { ErrorNode, errorNode } from '@codama/nodes';
 
 import { IdlV01ErrorCode } from './idl';
 

+ 12 - 12
packages/nodes-from-anchor/src/v01/InstructionAccountNode.ts

@@ -1,10 +1,10 @@
 import {
-    KINOBI_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING,
-    KINOBI_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING,
-    KINOBI_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED,
-    KINOBI_ERROR__ANCHOR__TYPE_PATH_MISSING,
-    KinobiError,
-} from '@kinobi-so/errors';
+    CODAMA_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING,
+    CODAMA_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING,
+    CODAMA_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED,
+    CODAMA_ERROR__ANCHOR__TYPE_PATH_MISSING,
+    CodamaError,
+} from '@codama/errors';
 import {
     AccountNode,
     accountValueNode,
@@ -25,7 +25,7 @@ import {
     publicKeyValueNode,
     resolveNestedTypeNode,
     variablePdaSeedNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 
 import { hex } from '../utils';
 import { IdlV01InstructionAccount, IdlV01InstructionAccountItem, IdlV01Seed } from './idl';
@@ -82,14 +82,14 @@ export function instructionAccountNodeFromAnchorV01(
                                 const accountName = camelCase(seed.account ?? '');
                                 const accountNode = allAccounts.find(({ name }) => name === accountName);
                                 if (!accountNode) {
-                                    throw new KinobiError(KINOBI_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING, { kind });
+                                    throw new CodamaError(CODAMA_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING, { kind });
                                 }
 
                                 const fieldName = camelCase(path[1]);
                                 const accountFields = resolveNestedTypeNode(accountNode.data).fields;
                                 const fieldNode = accountFields.find(({ name }) => name === fieldName);
                                 if (!fieldNode) {
-                                    throw new KinobiError(KINOBI_ERROR__ANCHOR__TYPE_PATH_MISSING, {
+                                    throw new CodamaError(CODAMA_ERROR__ANCHOR__TYPE_PATH_MISSING, {
                                         idlType: seed.account,
                                         path: seed.path,
                                     });
@@ -98,7 +98,7 @@ export function instructionAccountNodeFromAnchorV01(
                                 const seedName = camelCase(seed.path);
                                 return [[...seeds, variablePdaSeedNode(seedName, fieldNode.type)], []];
                             } else {
-                                throw new KinobiError(KINOBI_ERROR__ANCHOR__TYPE_PATH_MISSING, {
+                                throw new CodamaError(CODAMA_ERROR__ANCHOR__TYPE_PATH_MISSING, {
                                     idlType: seed,
                                     path: seed.path,
                                 });
@@ -108,7 +108,7 @@ export function instructionAccountNodeFromAnchorV01(
                             const argumentName = camelCase(seed.path);
                             const argumentNode = instructionArguments.find(({ name }) => name === argumentName);
                             if (!argumentNode) {
-                                throw new KinobiError(KINOBI_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING, { name: seed.path });
+                                throw new CodamaError(CODAMA_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING, { name: seed.path });
                             }
 
                             return [
@@ -117,7 +117,7 @@ export function instructionAccountNodeFromAnchorV01(
                             ];
                         }
                         default:
-                            throw new KinobiError(KINOBI_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED, { kind });
+                            throw new CodamaError(CODAMA_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED, { kind });
                     }
                 },
                 <[PdaSeedNode[], PdaSeedValueNode[]]>[[], []],

+ 1 - 1
packages/nodes-from-anchor/src/v01/InstructionArgumentNode.ts

@@ -1,4 +1,4 @@
-import { InstructionArgumentNode, instructionArgumentNode } from '@kinobi-so/nodes';
+import { InstructionArgumentNode, instructionArgumentNode } from '@codama/nodes';
 
 import { IdlV01Field } from './idl';
 import { typeNodeFromAnchorV01 } from './typeNodes';

+ 1 - 1
packages/nodes-from-anchor/src/v01/InstructionNode.ts

@@ -7,7 +7,7 @@ import {
     instructionArgumentNode,
     InstructionNode,
     instructionNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 
 import { getAnchorDiscriminatorV01 } from '../discriminators';
 import { IdlV01Instruction } from './idl';

+ 1 - 1
packages/nodes-from-anchor/src/v01/ProgramNode.ts

@@ -1,4 +1,4 @@
-import { ProgramNode, programNode, ProgramVersion } from '@kinobi-so/nodes';
+import { ProgramNode, programNode, ProgramVersion } from '@codama/nodes';
 
 import { accountNodeFromAnchorV01WithTypeDefinition } from './AccountNode';
 import { definedTypeNodeFromAnchorV01 } from './DefinedTypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v01/RootNode.ts

@@ -1,4 +1,4 @@
-import { RootNode, rootNode } from '@kinobi-so/nodes';
+import { RootNode, rootNode } from '@codama/nodes';
 
 import { IdlV01 } from './idl';
 import { programNodeFromAnchorV01 } from './ProgramNode';

+ 1 - 1
packages/nodes-from-anchor/src/v01/typeNodes/ArrayTypeNode.ts

@@ -1,4 +1,4 @@
-import { ArrayTypeNode, arrayTypeNode, fixedCountNode, numberTypeNode, prefixedCountNode } from '@kinobi-so/nodes';
+import { ArrayTypeNode, arrayTypeNode, fixedCountNode, numberTypeNode, prefixedCountNode } from '@codama/nodes';
 
 import { IdlV01TypeArray, IdlV01TypeVec } from '../idl';
 import { typeNodeFromAnchorV01 } from './TypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v01/typeNodes/EnumEmptyVariantTypeNode.ts

@@ -1,4 +1,4 @@
-import { EnumEmptyVariantTypeNode, enumEmptyVariantTypeNode } from '@kinobi-so/nodes';
+import { EnumEmptyVariantTypeNode, enumEmptyVariantTypeNode } from '@codama/nodes';
 
 import { IdlV01EnumVariant } from '../idl';
 

+ 1 - 1
packages/nodes-from-anchor/src/v01/typeNodes/EnumStructVariantTypeNode.ts

@@ -1,4 +1,4 @@
-import { EnumStructVariantTypeNode, enumStructVariantTypeNode, StructTypeNode } from '@kinobi-so/nodes';
+import { EnumStructVariantTypeNode, enumStructVariantTypeNode, StructTypeNode } from '@codama/nodes';
 
 import { IdlV01DefinedFieldsNamed, IdlV01EnumVariant } from '../idl';
 import { structTypeNodeFromAnchorV01 } from './StructTypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v01/typeNodes/EnumTupleVariantTypeNode.ts

@@ -1,4 +1,4 @@
-import { EnumTupleVariantTypeNode, enumTupleVariantTypeNode, TupleTypeNode } from '@kinobi-so/nodes';
+import { EnumTupleVariantTypeNode, enumTupleVariantTypeNode, TupleTypeNode } from '@codama/nodes';
 
 import { IdlV01DefinedFieldsTuple, IdlV01EnumVariant } from '../idl';
 import { tupleTypeNodeFromAnchorV01 } from './TupleTypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v01/typeNodes/EnumTypeNode.ts

@@ -1,4 +1,4 @@
-import { EnumTypeNode, enumTypeNode, EnumVariantTypeNode, NumberTypeNode } from '@kinobi-so/nodes';
+import { EnumTypeNode, enumTypeNode, EnumVariantTypeNode, NumberTypeNode } from '@codama/nodes';
 
 import { IdlV01DefinedFieldsNamed, IdlV01DefinedFieldsTuple, IdlV01EnumVariant, IdlV01TypeDefTyEnum } from '../idl';
 import { enumEmptyVariantTypeNodeFromAnchorV01 } from './EnumEmptyVariantTypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v01/typeNodes/OptionTypeNode.ts

@@ -1,4 +1,4 @@
-import { numberTypeNode, OptionTypeNode, optionTypeNode } from '@kinobi-so/nodes';
+import { numberTypeNode, OptionTypeNode, optionTypeNode } from '@codama/nodes';
 
 import { IdlV01TypeCOption, IdlV01TypeOption } from '../idl';
 import { typeNodeFromAnchorV01 } from './TypeNode';

+ 3 - 3
packages/nodes-from-anchor/src/v01/typeNodes/StructFieldTypeNode.ts

@@ -1,12 +1,12 @@
-import { KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, KinobiError } from '@kinobi-so/errors';
-import { StructFieldTypeNode, structFieldTypeNode } from '@kinobi-so/nodes';
+import { CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, CodamaError } from '@codama/errors';
+import { StructFieldTypeNode, structFieldTypeNode } from '@codama/nodes';
 
 import { IdlV01Field, IdlV01Type } from '../idl';
 import { typeNodeFromAnchorV01 } from './TypeNode';
 
 export function structFieldTypeNodeFromAnchorV01(idl: IdlV01Field | IdlV01Type): StructFieldTypeNode {
     if (!isStructField(idl)) {
-        throw new KinobiError(KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, {
+        throw new CodamaError(CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, {
             idlType: JSON.stringify(idl),
         });
     }

+ 1 - 1
packages/nodes-from-anchor/src/v01/typeNodes/StructTypeNode.ts

@@ -1,4 +1,4 @@
-import { StructTypeNode, structTypeNode } from '@kinobi-so/nodes';
+import { StructTypeNode, structTypeNode } from '@codama/nodes';
 
 import { IdlV01DefinedFields, IdlV01TypeDefTyStruct } from '../idl';
 import { structFieldTypeNodeFromAnchorV01 } from './StructFieldTypeNode';

+ 1 - 1
packages/nodes-from-anchor/src/v01/typeNodes/TupleTypeNode.ts

@@ -1,4 +1,4 @@
-import { TupleTypeNode, tupleTypeNode } from '@kinobi-so/nodes';
+import { TupleTypeNode, tupleTypeNode } from '@codama/nodes';
 
 import { IdlV01DefinedFieldsTuple } from '../idl';
 import { typeNodeFromAnchorV01 } from './TypeNode';

+ 4 - 4
packages/nodes-from-anchor/src/v01/typeNodes/TypeNode.ts

@@ -1,4 +1,4 @@
-import { KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, KinobiError } from '@kinobi-so/errors';
+import { CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, CodamaError } from '@codama/errors';
 import {
     booleanTypeNode,
     bytesTypeNode,
@@ -8,7 +8,7 @@ import {
     sizePrefixTypeNode,
     stringTypeNode,
     TypeNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 
 import {
     IdlV01DefinedFields,
@@ -59,7 +59,7 @@ export const typeNodeFromAnchorV01 = (idlType: IdlV01Type | IdlV01TypeDefTy): Ty
 
     // Ensure eveything else is an object.
     if (typeof idlType !== 'object') {
-        throw new KinobiError(KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, {
+        throw new CodamaError(CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, {
             idlType: JSON.stringify(idlType),
         });
     }
@@ -105,7 +105,7 @@ export const typeNodeFromAnchorV01 = (idlType: IdlV01Type | IdlV01TypeDefTy): Ty
         }
     }
 
-    throw new KinobiError(KINOBI_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, {
+    throw new CodamaError(CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, {
         idlType: JSON.stringify(idlType),
     });
 };

+ 1 - 1
packages/nodes-from-anchor/test/discriminator.test.ts

@@ -1,4 +1,4 @@
-import { bytesValueNode } from '@kinobi-so/nodes';
+import { bytesValueNode } from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { getAnchorAccountDiscriminatorV00, getAnchorInstructionDiscriminatorV00 } from '../src/index.js';

+ 1 - 1
packages/nodes-from-anchor/test/rootNodeFromAnchor.test.ts

@@ -1,4 +1,4 @@
-import { programNode, rootNode } from '@kinobi-so/nodes';
+import { programNode, rootNode } from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { rootNodeFromAnchor } from '../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/AccountNode.test.ts

@@ -7,7 +7,7 @@ import {
     numberTypeNode,
     structFieldTypeNode,
     structTypeNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { accountNodeFromAnchorV00 } from '../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/DefinedTypeNode.test.ts

@@ -1,4 +1,4 @@
-import { definedTypeNode, numberTypeNode, structFieldTypeNode, structTypeNode } from '@kinobi-so/nodes';
+import { definedTypeNode, numberTypeNode, structFieldTypeNode, structTypeNode } from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { definedTypeNodeFromAnchorV00 } from '../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/ErrorNode.test.ts

@@ -1,4 +1,4 @@
-import { errorNode } from '@kinobi-so/nodes';
+import { errorNode } from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { errorNodeFromAnchorV00 } from '../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/InstructionAccountNode.test.ts

@@ -1,4 +1,4 @@
-import { instructionAccountNode } from '@kinobi-so/nodes';
+import { instructionAccountNode } from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { instructionAccountNodeFromAnchorV00, instructionAccountNodesFromAnchorV00 } from '../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/InstructionArgumentNode.test.ts

@@ -1,4 +1,4 @@
-import { instructionArgumentNode, numberTypeNode } from '@kinobi-so/nodes';
+import { instructionArgumentNode, numberTypeNode } from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { instructionArgumentNodeFromAnchorV00 } from '../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/InstructionNode.test.ts

@@ -7,7 +7,7 @@ import {
     instructionArgumentNode,
     instructionNode,
     numberTypeNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { instructionNodeFromAnchorV00 } from '../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/PdaNode.test.ts

@@ -5,7 +5,7 @@ import {
     numberValueNode,
     pdaNode,
     variablePdaSeedNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { pdaNodeFromAnchorV00 } from '../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/ProgramNode.test.ts

@@ -8,7 +8,7 @@ import {
     pdaNode,
     programNode,
     structTypeNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { programNodeFromAnchorV00 } from '../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/RootNode.test.ts

@@ -1,4 +1,4 @@
-import { programNode, rootNode } from '@kinobi-so/nodes';
+import { programNode, rootNode } from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { rootNodeFromAnchorV00 } from '../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/typeNodes/ArrayTypeNode.test.ts

@@ -1,4 +1,4 @@
-import { arrayTypeNode, fixedCountNode, numberTypeNode, prefixedCountNode, remainderCountNode } from '@kinobi-so/nodes';
+import { arrayTypeNode, fixedCountNode, numberTypeNode, prefixedCountNode, remainderCountNode } from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { typeNodeFromAnchorV00 } from '../../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/typeNodes/BooleanTypeNode.test.ts

@@ -1,4 +1,4 @@
-import { booleanTypeNode } from '@kinobi-so/nodes';
+import { booleanTypeNode } from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { typeNodeFromAnchorV00 } from '../../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/typeNodes/BytesTypeNode.test.ts

@@ -1,4 +1,4 @@
-import { bytesTypeNode, numberTypeNode, sizePrefixTypeNode } from '@kinobi-so/nodes';
+import { bytesTypeNode, numberTypeNode, sizePrefixTypeNode } from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { typeNodeFromAnchorV00 } from '../../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/typeNodes/EnumTypeNode.test.ts

@@ -8,7 +8,7 @@ import {
     structFieldTypeNode,
     structTypeNode,
     tupleTypeNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { typeNodeFromAnchorV00 } from '../../../src';

+ 1 - 1
packages/nodes-from-anchor/test/v00/typeNodes/MapTypeNode.test.ts

@@ -5,7 +5,7 @@ import {
     numberTypeNode,
     prefixedCountNode,
     remainderCountNode,
-} from '@kinobi-so/nodes';
+} from '@codama/nodes';
 import { expect, test } from 'vitest';
 
 import { typeNodeFromAnchorV00 } from '../../../src';

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません