Skip to content

Releases: codama-idl/renderers-rust

v3.1.0

22 Apr 09:18
093be40

Choose a tag to compare

Minor Changes

v3.0.0

10 Mar 15:01
0a65cc6

Choose a tag to compare

Major Changes

  • #92 4af6c06 Thanks @grod220! - Removed default serde support and replaced kaigan with spl-collections

    BREAKING CHANGES:

    • Generated variable-sized string/vector wrappers now come from spl-collections instead of kaigan. If you have handwritten code that references these generated wrapper types, update those imports and usages after regenerating your client:

      • kaigan::types::RemainderStr -> spl_collections::TrailingStr
      • kaigan::types::RemainderVec<T> -> spl_collections::TrailingVec<T>
      • kaigan::types::U8PrefixString, U16PrefixString, U64PrefixString -> spl_collections::U8PrefixedStr, U16PrefixedStr, U64PrefixedStr
      • kaigan::types::U8PrefixVec<T>, U16PrefixVec<T>, U64PrefixVec<T> -> spl_collections::U8PrefixedVec<T>, U16PrefixedVec<T>, U64PrefixedVec<T>
    • serde is no longer part of the default or recommended generated client surface. The previous default derives on wrapper types were misleading because their serde representation does not match the Borsh/Wincode wire format.

    • If you still want serde derives for a separate JSON representation, you can opt in explicitly via traitOptions as shown below. This does not make the generated types serde-compatible with their Borsh/Wincode wire format, but you can define a handwritten implementation with your own serde mapping as needed.

        traitOptions: {
          baseDefaults: [
            'borsh::BorshSerialize',
            'borsh::BorshDeserialize',
    •   'serde::Serialize',
      
    •   'serde::Deserialize',
        'Clone',
        'Debug',
        'Eq',
        'PartialEq',
      ],
      
    • featureFlags: {

    •   serde: ['serde::Serialize', 'serde::Deserialize'],
      
    • },
      }

      
      
  • #90 f214970 Thanks @grod220! - Switch generated Rust code from solana_pubkey::Pubkey to solana_address::Address and update the default dependency set to newer Solana 3.x and borsh 1.0 versions. This affects generated program IDs, account/instruction types, PDA helpers, and public key literals, so downstream users may need to update imports and pubkey usage after regenerating clients.

v2.0.1

25 Feb 12:20
a7b322a

Choose a tag to compare

Patch Changes

  • #88 6477636 Thanks @yihau! - resolve io_other_error and uninlined_format_args warnings

v2.0.0

17 Feb 12:29
bcaed69

Choose a tag to compare

Major Changes

  • #85 44dacca Thanks @lorisleiva! - Refactor renderVisitor to use crateFolder as its primary argument instead of the generated output path. The generated folder is now derived internally using a new generatedFolder option (defaults to 'src/generated'). Remove the crateFolder option as it is no longer needed.

    BREAKING CHANGES

    First argument of renderVisitor changed from output path to crate folder. The function now takes the crate folder (where Cargo.toml lives) and derives the generated output path internally.

    - const visitor = renderVisitor('clients/rust/src/generated', {
    -     crateFolder: 'clients/rust',
    - });
    + const visitor = renderVisitor('clients/rust');

    crateFolder option removed. It is replaced by the first argument of renderVisitor.

    New generatedFolder option. Defaults to 'src/generated' and can be customized to change the output path relative to the crate folder.

    - const visitor = renderVisitor('clients/rust/my/custom/path', {
    -     crateFolder: 'clients/rust',
    - });
    + const visitor = renderVisitor('clients/rust', {
    +     generatedFolder: 'my/custom/path',
    + });

Patch Changes

  • #70 f0fbbb0 Thanks @lorisleiva! - Add syncCargoToml and dependencyVersions options in order to create or update the Cargo.toml of the Rust crate when generating its code.

v1.2.9

02 Dec 17:40
0835a3a

Choose a tag to compare

Patch Changes

v1.2.8

25 Nov 16:46
c4779b6

Choose a tag to compare

Patch Changes

v1.2.7

29 Sep 09:36
e534b4f

Choose a tag to compare

Patch Changes

v1.2.6

19 Sep 10:40
213424d

Choose a tag to compare

Patch Changes