Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: meshtrade/api

Python SDK v1.24.0 - IAM Authentication Upgrade

28 Oct 15:56

Choose a tag to compare

Python SDK v1.24.0 - IAM Authentication Upgrade

🚨 Breaking Changes

This release implements breaking changes to the IAM authentication API for improved batch operations and standardized role paths.

Role Path Format Update

Role paths now include explicit /roles/ segment:

# Old format
role = "groups/01ABC123XYZABCDEFGHJKMNPQ/1000001"

# New format  
role = "groups/01ABC123XYZABCDEFGHJKMNPQ/roles/1000001"

Batch Role Operations

API User Service:

from meshtrade.iam.api_user.v1 import (
    ApiUserService,
    AssignRolesToAPIUserRequest,  # Note: plural!
)

# Old - Single role assignment
api_user = service.assign_role_to_a_p_i_user(
    AssignRoleToAPIUserRequest(
        name="api_users/01XYZ...",
        role="groups/01ABC.../1000001"
    )
)

# New - Batch role assignment
api_user = service.assign_roles_to_a_p_i_user(
    AssignRolesToAPIUserRequest(
        name="api_users/01XYZ...",
        roles=[
            "groups/01ABC.../roles/1000001",
            "groups/01ABC.../roles/1000002",
        ]
    )
)

User Service:

from meshtrade.iam.user.v1 import (
    UserService,
    RevokeRolesFromUserRequest,  # NEW method!
)

# Old - No revoke method existed!

# New - Batch role revocation
user = service.revoke_roles_from_user(
    RevokeRolesFromUserRequest(
        name="users/01XYZ...",
        roles=[
            "groups/01ABC.../roles/1000001",
            "groups/01ABC.../roles/1000002",
        ]
    )
)

✨ What's New

Enhanced Role Utilities

Updated role path utilities in meshtrade.iam.role.v1:

from meshtrade.iam.role.v1 import parse_role_path, build_role_path

# Build role path with new format
role_path = build_role_path('01ABC123XYZABCDEFGHJKMNPQ', 1000001)
# Returns: "groups/01ABC123XYZABCDEFGHJKMNPQ/roles/1000001"

# Parse role path
parsed = parse_role_path(role_path)
# Returns: {'group_id': '01ABC123XYZABCDEFGHJKMNPQ', 'role_id': 1000001}

Service Method Updates

API User Service (meshtrade.iam.api_user.v1):

  • βœ… assign_roles_to_a_p_i_user() - Batch assignment
  • βœ… revoke_roles_from_a_p_i_user() - Batch revocation
  • ❌ Removed: assign_role_to_a_p_i_user() (singular)
  • ❌ Removed: revoke_role_from_a_p_i_user() (singular)

User Service (meshtrade.iam.user.v1):

  • βœ… assign_roles_to_user() - Batch assignment
  • ✨ NEW: revoke_roles_from_user() - Batch revocation
  • ❌ Removed: assign_role_to_user() (singular)

πŸ”§ Migration Guide

1. Install Updated Package

pip install --upgrade meshtrade==1.24.0

Or with Poetry:

poetry add meshtrade@^1.24.0

2. Update Imports

# API User Service
from meshtrade.iam.api_user.v1 import (
    ApiUserService,
    AssignRolesToAPIUserRequest,    # Changed: plural
    RevokeRolesFromAPIUserRequest,  # Changed: plural
)

# User Service  
from meshtrade.iam.user.v1 import (
    UserService,
    AssignRolesToUserRequest,      # Changed: plural
    RevokeRolesFromUserRequest,    # NEW!
)

# Role utilities
from meshtrade.iam.role.v1 import parse_role_path, build_role_path

3. Update Method Calls

Before:

# Single role assignment
api_user = service.assign_role_to_a_p_i_user(
    AssignRoleToAPIUserRequest(
        name="api_users/01XYZ...",
        role="groups/01ABC.../1000001"  # Old format
    )
)

After:

# Batch role assignment
api_user = service.assign_roles_to_a_p_i_user(
    AssignRolesToAPIUserRequest(
        name="api_users/01XYZ...",
        roles=[  # Now a list!
            "groups/01ABC.../roles/1000001",  # New format with /roles/
            "groups/01ABC.../roles/1000002",
        ]
    )
)

4. Use Role Utilities

from meshtrade.iam.role.v1 import build_role_path

# Build role paths correctly
roles = [
    build_role_path(group_id, 1000001),
    build_role_path(group_id, 1000002),
]

user = service.assign_roles_to_user(
    AssignRolesToUserRequest(name=user_name, roles=roles)
)

βœ… Testing

All tests passing:

  • βœ… Unit tests with new role format
  • βœ… Validation tests for batch operations
  • βœ… Role utility tests
  • βœ… Integration tests
  • βœ… Ruff linting (150 char limit)

πŸ“¦ Package Details

Package: meshtrade
Version: 1.24.0
Python: 3.12+
PyPI: https://pypi.org/project/meshtrade/1.24.0/

Install:

pip install meshtrade==1.24.0

πŸ”— Related Releases

  • Protobuf v1.24.0
  • Go SDK v1.24.0
  • Java SDK v1.24.0

πŸ“‹ Modified Files (6)

  • python/src/meshtrade/iam/api_user/v1/__init__.py
  • python/src/meshtrade/iam/api_user/v1/service.py
  • python/src/meshtrade/iam/user/v1/__init__.py
  • python/src/meshtrade/iam/role/v1/role.py
  • python/tests/unit/iam/api_user/v1/test_client_validation.py
  • python/tests/unit/iam/role/v1/test_role.py

πŸš€ Deployment

This release will be automatically deployed to PyPI via GitHub Actions trusted publisher workflow.

Deployment Status: Monitor at https://github.com/meshtrade/api/actions


Full Changelog: py/v1.23.1...py/v1.24.0
PR: #76 - Upgrade IAM authentication API

Protobuf v1.24.0 - IAM Authentication Upgrade

28 Oct 15:55

Choose a tag to compare

Protobuf v1.24.0 - IAM Authentication Upgrade

🚨 Breaking Changes

This release introduces significant improvements to the IAM authentication API with breaking changes that require client updates.

1. Role Path Format Standardization

Role resource paths now include an explicit /roles/ segment for better REST compliance:

  • Old: groups/{ULIDv2}/{role_id} (41 chars)
  • New: groups/{ULIDv2}/roles/{role_id} (47-48 chars)

Example:

Old: groups/01ABC123XYZABCDEFGHJKMNPQ/1000001
New: groups/01ABC123XYZABCDEFGHJKMNPQ/roles/1000001

2. Batch Role Operations

Role assignment and revocation now support multiple roles in a single operation:

API User Service:

  • ❌ AssignRoleToAPIUser(role: string) β†’ βœ… AssignRolesToAPIUser(roles: string[])
  • ❌ RevokeRoleFromAPIUser(role: string) β†’ βœ… RevokeRolesFromAPIUser(roles: string[])

User Service:

  • ❌ AssignRoleToUser(role: string) β†’ βœ… AssignRolesToUser(roles: string[])
  • ✨ NEW: RevokeRolesFromUser(roles: string[]) (previously didn't exist!)

3. Protobuf Field Renumbering

Field numbers corrected to sequential ordering:

APIUser:

  • display_name: 4 β†’ 3
  • state: 5 β†’ 4
  • roles: 6 β†’ 5
  • api_key: 7 β†’ 6

User:

  • email: 4 β†’ 3
  • roles: 6 β†’ 4

✨ What's New

  • Batch Operations: Assign/revoke multiple roles in a single API call
  • Improved Validation: Enhanced role path validation with min/max length constraints
  • Better Documentation: Comprehensive comments and examples
  • User Service Parity: Added missing RevokeRolesFromUser method

πŸ“‹ Updated Services

  • meshtrade.iam.api_user.v1.ApiUserService
  • meshtrade.iam.user.v1.UserService

πŸ”§ Migration Required

Update your .proto imports and regenerate all language bindings:

# Update to v1.24.0
buf mod update
buf generate

Role path format:

// Old
string role = 1 [(buf.validate.field) = {
  string: { len: 41 }
}];

// New  
repeated string roles = 1 [(buf.validate.field) = {
  repeated: {
    items: {
      string: {
        min_len: 47
        max_len: 48
        pattern: "^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}/roles/[1-9][0-9]{6,7}$"
      }
    }
  }
}];

πŸ“¦ Related Releases

This protobuf release requires corresponding SDK updates:

  • Go SDK v1.24.0
  • Python SDK v1.24.0
  • Java SDK v1.24.0

πŸ”— Resources


Full Changelog: proto/v1.23.0...proto/v1.24.0

Java SDK v1.24.0 - IAM Authentication Upgrade

28 Oct 15:57

Choose a tag to compare

Java SDK v1.24.0 - IAM Authentication Upgrade

🚨 Breaking Changes

This release implements breaking changes to the IAM authentication API for improved batch operations and standardized role paths.

Role Path Format Update

Role paths now include explicit /roles/ segment:

// Old format
String role = "groups/01ABC123XYZABCDEFGHJKMNPQ/1000001";

// New format
String role = "groups/01ABC123XYZABCDEFGHJKMNPQ/roles/1000001";

Batch Role Operations

API User Service:

import co.meshtrade.api.iam.api_user.v1.ApiUserService;
import co.meshtrade.api.iam.api_user.v1.Service.AssignRolesToAPIUserRequest;
import co.meshtrade.api.iam.api_user.v1.ApiUser.APIUser;

// Old - Single role assignment
AssignRoleToAPIUserRequest request = AssignRoleToAPIUserRequest.newBuilder()
    .setName("api_users/01XYZ...")
    .setRole("groups/01ABC.../1000001")  // Old: singular
    .build();

// New - Batch role assignment  
AssignRolesToAPIUserRequest request = AssignRolesToAPIUserRequest.newBuilder()
    .setName("api_users/01XYZ...")
    .addAllRoles(Arrays.asList(  // New: plural with List
        "groups/01ABC.../roles/1000001",
        "groups/01ABC.../roles/1000002"
    ))
    .build();

APIUser apiUser = service.assignRolesToAPIUser(request, Optional.empty());

User Service:

import co.meshtrade.api.iam.user.v1.UserService;
import co.meshtrade.api.iam.user.v1.Service.RevokeRolesFromUserRequest;
import co.meshtrade.api.iam.user.v1.User.User;

// Old - No revoke method existed!

// New - Batch role revocation
RevokeRolesFromUserRequest request = RevokeRolesFromUserRequest.newBuilder()
    .setName("users/01XYZ...")
    .addAllRoles(Arrays.asList(
        "groups/01ABC.../roles/1000001",
        "groups/01ABC.../roles/1000002"
    ))
    .build();

User user = service.revokeRolesFromUser(request, Optional.empty());

✨ What's New

Enhanced RoleUtils

Updated role utilities in co.meshtrade.api.iam.role.v1.RoleUtils:

import co.meshtrade.api.iam.role.v1.RoleUtils;

// Build role path with new format
String rolePath = RoleUtils.buildRolePath("01ABC123XYZABCDEFGHJKMNPQ", 1000001);
// Returns: "groups/01ABC123XYZABCDEFGHJKMNPQ/roles/1000001"

// Parse role path
RoleUtils.RolePath parsed = RoleUtils.parseRolePath(rolePath);
String groupId = parsed.getGroupId();  // "01ABC123XYZABCDEFGHJKMNPQ"
int roleId = parsed.getRoleId();       // 1000001

// Validate role path
boolean isValid = RoleUtils.isValidRolePath(rolePath);  // true

Service Method Updates

API User Service (co.meshtrade.api.iam.api_user.v1):

  • βœ… assignRolesToAPIUser() - Batch assignment
  • βœ… revokeRolesFromAPIUser() - Batch revocation
  • ❌ Removed: assignRoleToAPIUser() (singular)
  • ❌ Removed: revokeRoleFromAPIUser() (singular)

User Service (co.meshtrade.api.iam.user.v1):

  • βœ… assignRolesToUser() - Batch assignment
  • ✨ NEW: revokeRolesFromUser() - Batch revocation
  • ❌ Removed: assignRoleToUser() (singular)

πŸ”§ Migration Guide

1. Update Maven Dependency

<dependency>
    <groupId>co.meshtrade</groupId>
    <artifactId>api</artifactId>
    <version>1.24.0</version>
</dependency>

Or with Gradle:

implementation 'co.meshtrade:api:1.24.0'

2. Update Imports

// API User Service
import co.meshtrade.api.iam.api_user.v1.ApiUserService;
import co.meshtrade.api.iam.api_user.v1.Service.AssignRolesToAPIUserRequest;    // Changed: plural
import co.meshtrade.api.iam.api_user.v1.Service.RevokeRolesFromAPIUserRequest;  // Changed: plural

// User Service
import co.meshtrade.api.iam.user.v1.UserService;
import co.meshtrade.api.iam.user.v1.Service.AssignRolesToUserRequest;      // Changed: plural
import co.meshtrade.api.iam.user.v1.Service.RevokeRolesFromUserRequest;    // NEW!

// Role utilities
import co.meshtrade.api.iam.role.v1.RoleUtils;

3. Update Method Calls

Before:

// Single role assignment
AssignRoleToAPIUserRequest request = AssignRoleToAPIUserRequest.newBuilder()
    .setName("api_users/01XYZ...")
    .setRole("groups/01ABC.../1000001")  // Old format, singular
    .build();

APIUser apiUser = service.assignRoleToAPIUser(request, Optional.empty());

After:

// Batch role assignment
AssignRolesToAPIUserRequest request = AssignRolesToAPIUserRequest.newBuilder()
    .setName("api_users/01XYZ...")
    .addAllRoles(Arrays.asList(  // Plural method, List parameter
        RoleUtils.buildRolePath(groupId, 1000001),  // New format with helper
        RoleUtils.buildRolePath(groupId, 1000002)
    ))
    .build();

APIUser apiUser = service.assignRolesToAPIUser(request, Optional.empty());

4. Use RoleUtils for Path Construction

import co.meshtrade.api.iam.role.v1.RoleUtils;
import java.util.Arrays;
import java.util.List;

// Build role paths correctly
String groupId = "01ABC123XYZABCDEFGHJKMNPQ";
List<String> roles = Arrays.asList(
    RoleUtils.buildRolePath(groupId, 1000001),
    RoleUtils.buildRolePath(groupId, 1000002)
);

// Use in request
AssignRolesToUserRequest request = AssignRolesToUserRequest.newBuilder()
    .setName("users/01XYZ...")
    .addAllRoles(roles)
    .build();

User user = userService.assignRolesToUser(request, Optional.empty());

βœ… Testing

All tests passing:

  • βœ… Unit tests with new role format
  • βœ… Validation tests for batch operations
  • βœ… RoleUtils tests with comprehensive coverage
  • βœ… Integration tests
  • βœ… Checkstyle (Google Java Style Guide)
  • βœ… PMD code quality checks
  • βœ… Error Prone static analysis

πŸ“¦ Package Details

Group ID: co.meshtrade
Artifact ID: api
Version: 1.24.0
Java: 21+
Maven Central: https://central.sonatype.com/artifact/co.meshtrade/api/1.24.0

Maven:

<dependency>
    <groupId>co.meshtrade</groupId>
    <artifactId>api</artifactId>
    <version>1.24.0</version>
</dependency>

Gradle:

implementation 'co.meshtrade:api:1.24.0'

πŸ”— Related Releases

  • Protobuf v1.24.0
  • Go SDK v1.24.0
  • Python SDK v1.24.0

πŸ“‹ Modified Files (5)

  • java/src/main/java/co/meshtrade/api/iam/api_user/v1/ApiUser.java
  • java/src/main/java/co/meshtrade/api/iam/role/v1/RoleUtils.java
  • java/src/test/java/co/meshtrade/api/iam/api_user/v1/ApiUserServiceIntegrationTest.java
  • java/src/test/java/co/meshtrade/api/iam/api_user/v1/ApiUserServiceValidationTest.java
  • java/src/test/java/co/meshtrade/api/iam/role/v1/RoleUtilsTest.java

πŸš€ Deployment

This release will be automatically deployed to Maven Central via GitHub Actions with GPG signing.

Deployment Status: Monitor at https://github.com/meshtrade/api/actions

Availability: Artifacts typically available on Maven Central within 15-30 minutes of deployment completion.


Full Changelog: java/v1.23.0...java/v1.24.0
PR: #76 - Upgrade IAM authentication API

Go SDK v1.24.0 - IAM Authentication Upgrade

28 Oct 15:55

Choose a tag to compare

Go SDK v1.24.0 - IAM Authentication Upgrade

🚨 Breaking Changes

This release implements breaking changes to the IAM authentication API for improved efficiency and consistency.

Role Path Format Update

Role paths now include explicit /roles/ segment:

// Old format
role := "groups/01ABC123XYZABCDEFGHJKMNPQ/1000001"

// New format
role := "groups/01ABC123XYZABCDEFGHJKMNPQ/roles/1000001"

Batch Role Operations

API User Service (iam/api_user/v1):

// Old - Single role assignment
user, err := service.AssignRoleToAPIUser(ctx, &api_user_v1.AssignRoleToAPIUserRequest{
    Name: "api_users/01XYZ...",
    Role: "groups/01ABC.../1000001", // Old format, singular
})

// New - Batch role assignment
user, err := service.AssignRolesToAPIUser(ctx, &api_user_v1.AssignRolesToAPIUserRequest{
    Name: "api_users/01XYZ...",
    Roles: []string{  // New format, plural
        "groups/01ABC.../roles/1000001",
        "groups/01ABC.../roles/1000002",
    },
})

User Service (iam/user/v1):

// Old - No revoke method existed!

// New - Batch role revocation
user, err := service.RevokeRolesFromUser(ctx, &user_v1.RevokeRolesFromUserRequest{
    Name: "users/01XYZ...",
    Roles: []string{
        "groups/01ABC.../roles/1000001",
        "groups/01ABC.../roles/1000002",
    },
})

✨ What's Changed

Service Interface Updates (13 files)

API User Service (go/iam/api_user/v1/):

  • βœ… Updated method signatures to plural forms
  • βœ… Changed role string β†’ roles []string
  • βœ… Regenerated gRPC bindings
  • βœ… Updated mock implementations
  • βœ… Enhanced validation tests

User Service (go/iam/user/v1/):

  • βœ… Updated method signatures to plural forms
  • βœ… Changed role string β†’ roles []string
  • ✨ NEW: RevokeRolesFromUser method
  • βœ… Regenerated gRPC bindings
  • βœ… Updated mock implementations
  • βœ… Enhanced validation tests

Field Renumbering

Protobuf field numbers corrected for sequential ordering:

  • Affects struct field tags in generated code
  • Wire format compatible within protobuf ecosystem

πŸ”§ Migration Guide

1. Update Go Module

go get github.com/meshtrade/api/[email protected]

2. Update Imports (No Changes Required)

import (
    api_user_v1 "github.com/meshtrade/api/go/iam/api_user/v1"
    user_v1 "github.com/meshtrade/api/go/iam/user/v1"
)

3. Update Method Calls

Before:

// Single role assignment
apiUser, err := apiUserService.AssignRoleToAPIUser(ctx, 
    &api_user_v1.AssignRoleToAPIUserRequest{
        Name: "api_users/01ABC...",
        Role: "groups/01XYZ.../1000001",
    },
)

After:

// Batch role assignment
apiUser, err := apiUserService.AssignRolesToAPIUser(ctx,
    &api_user_v1.AssignRolesToAPIUserRequest{
        Name: "api_users/01ABC...",
        Roles: []string{
            "groups/01XYZ.../roles/1000001",
            "groups/01XYZ.../roles/1000002",
        },
    },
)

4. Update Role Path Construction

// Build role paths with /roles/ segment
func buildRolePath(groupID string, roleID int) string {
    return fmt.Sprintf("groups/%s/roles/%d", groupID, roleID)
}

// Example usage
rolePath := buildRolePath("01ABC123XYZABCDEFGHJKMNPQ", 1000001)
// Returns: "groups/01ABC123XYZABCDEFGHJKMNPQ/roles/1000001"

βœ… Testing

All tests passing:

  • βœ… Unit tests
  • βœ… Validation tests with new patterns
  • βœ… gRPC integration tests
  • βœ… Mock implementations verified

πŸ“¦ Package Details

Module: github.com/meshtrade/api/go
Version: v1.24.0
Go Version: 1.21+

Install:

go get github.com/meshtrade/api/[email protected]

πŸ”— Related Releases

  • Protobuf v1.24.0
  • Python SDK v1.24.0
  • Java SDK v1.24.0

πŸ“‹ Full Changes

Modified Files (13):

  • go/iam/api_user/v1/service.meshgo.go
  • go/iam/api_user/v1/service.pb.go
  • go/iam/api_user/v1/serviceMock.meshgo.go
  • go/iam/api_user/v1/service_grpc.pb.go
  • go/iam/api_user/v1/service_interface.meshgo.go
  • go/iam/api_user/v1/service_validation_test.go
  • go/iam/user/v1/service.meshgo.go
  • go/iam/user/v1/service.pb.go
  • go/iam/user/v1/serviceMock.meshgo.go
  • go/iam/user/v1/service_grpc.pb.go
  • go/iam/user/v1/service_interface.meshgo.go
  • go/iam/user/v1/service_validation_test.go
  • And related protobuf bindings

Full Changelog: go/v1.23.0...go/v1.24.0
PR: #76 - Upgrade IAM authentication API

Python SDK v1.23.1

27 Oct 08:23
0aa5675

Choose a tag to compare

Python SDK v1.23.1 - Patch Release

πŸ› Bug Fix: Missing Companion Function Exports

This patch release fixes a critical issue where 48 handwritten SDK helper functions and 1 exception class were defined but not properly exported in their respective package __init__.py files.

πŸ“¦ Packages Updated

meshtrade/type/v1 (33 exports added)

  • Amount operations (12): amount_is_equal_to, amount_add, amount_sub, amount_decimal_mul, amount_decimal_div, amount_is_negative, amount_is_zero, amount_contains_fractions, amount_is_undefined, amount_is_same_type_as, amount_set_value, new_undefined_amount
  • Decimal operations (13): decimal_add, decimal_sub, decimal_mul, decimal_div, decimal_equal, decimal_less_than, decimal_less_than_or_equal, decimal_greater_than, decimal_greater_than_or_equal, decimal_is_zero, decimal_is_negative, decimal_is_positive, decimal_round
  • Token helpers (4): new_undefined_token, token_is_undefined, token_is_equal_to, token_pretty_string
  • Ledger helpers (4): UnsupportedLedgerError, ledger_to_pretty_string, ledger_is_valid, ledger_is_valid_and_defined

meshtrade/iam/api_user/v1 (3 exports added)

  • default_credentials_path, load_default_credentials, find_credentials

meshtrade/iam/role/v1 (6 exports added)

  • role_is_valid, role_is_valid_and_specified, role_full_resource_name_from_group_id, role_from_full_resource_name, parse_role_parts, must_parse_role_parts

meshtrade/compliance/client/v1 (4 exports added)

  • get_client_default_roles, must_get_client_default_roles, get_client_default_role_index, must_get_client_default_role_index

meshtrade/ledger/transaction/v1 (1 export added)

  • transaction_state_can_perform_action_at_state

meshtrade/reporting/account_report/v1 (1 export added)

  • income_narrative_pretty_string

πŸ“ Impact

All previously defined helper functions are now properly accessible via package imports, achieving full feature parity with the Go SDK companion functions.

πŸ”— Related


Installation:

pip install meshtrade==1.23.1

PyPI: https://pypi.org/project/meshtrade/1.23.1/

Python SDK v1.23.0

24 Oct 11:53
09c40ea

Choose a tag to compare

Python SDK v1.23.0

What's New

This release adds 49 comprehensive helper functions across 9 Python modules, achieving feature parity with the Go SDK!

Key Features Added

Type Utilities (35 functions)

  • decimal_operations.py (13 functions): High-precision decimal arithmetic operations

    • decimal_add(), decimal_sub(), decimal_mul(), decimal_div()
    • decimal_compare(), decimal_equals(), decimal_lt(), decimal_gt()
    • decimal_abs(), decimal_negate(), decimal_round()
    • new_decimal_from_int(), new_decimal_from_str()
  • token.py (5 functions): Token creation, validation, and formatting

    • new_token(), is_undefined_token(), token_to_pretty_string()
    • token_equals(), ledger_to_pretty_string()
  • amount.py (12 functions): Amount creation, comparison, and arithmetic

    • new_amount(), new_undefined_amount(), amount_set_value()
    • amount_add(), amount_sub(), amount_decimal_mul(), amount_decimal_div()
    • amount_compare(), amount_equals(), amount_lt(), amount_gt()
    • amount_to_pretty_string()
    • Precision control: All functions support custom precision_loss_tolerance
    • Fail-fast: Functions throw ValueError instead of returning None
  • ledger.py (3 functions): Ledger validation and formatting

    • ledger_decimals(), is_supported_ledger(), UnsupportedLedgerError

Business Logic (14 functions)

  • role.py (7 functions): Role resource name handling with 3-part integer format

    • parse_role_resource_name(), parse_role_resource_name_with_validation()
    • role_resource_name_to_pretty_string(), is_valid_ulid()
  • api_user_state_machine.py (3 functions): API user state validation

    • is_valid_api_user_state(), is_terminal_state(), can_transition()
  • transaction_state_machine.py (1 function): Transaction state validation

    • is_terminal_transaction_state()
  • client_roles.py (4 functions): Client default role configuration using protobuf introspection

    • get_client_default_roles(), get_client_default_role_count()
    • is_client_default_role(), get_client_default_role_names()
  • income_entry.py (1 function): Income entry pretty printing

    • income_entry_to_narrative()

Quality Improvements

  • 298 comprehensive tests: All functions have 100% test coverage
  • Type safety: Proper type hints with | None for optional parameters
  • Null safety: Documented None-handling patterns matching Go SDK
  • Zero linting issues: All code passes ruff checks (150-char limit)
  • Cross-SDK compatibility: Behavior matches Go SDK exactly

Breaking Changes

  • Removed: token_new_amount_of() - Use new_amount() or new_undefined_amount() instead
  • Behavior change: Amount functions now throw ValueError for invalid inputs instead of returning None

Installation

pip install meshtrade==1.23.0

Usage Examples

from meshtrade.type.v1 import (
    new_amount, amount_add, new_decimal_from_str,
    new_token, token_to_pretty_string
)

# Create amounts with precision control
amount1 = new_amount(token, new_decimal_from_str("100.50"))
amount2 = new_amount(token, new_decimal_from_str("50.25"))

# Perform arithmetic with custom tolerance
result = amount_add(amount1, amount2, precision_loss_tolerance=0.000001)

# Pretty print tokens
token_str = token_to_pretty_string(token)  # e.g., "USDC (Polygon)"

Technical Details

Related Releases

This Python SDK release is part of the coordinated v1.23.0 release:

  • Protobuf v1.23.0
  • Go SDK v1.23.0
  • Java SDK v1.23.0

Migration Guide

If you were using token_new_amount_of():

# Before
amount = token_new_amount_of(token, value)

# After
amount = new_amount(token, value)
# or for undefined tokens
amount = new_undefined_amount(value)

If you were checking for None returns:

# Before
result = amount_add(a1, a2)
if result is None:
    handle_error()

# After (functions now throw exceptions)
try:
    result = amount_add(a1, a2)
except ValueError as e:
    handle_error(e)

Generated as part of the Mesh API v1.23.0 multi-SDK release

Protobuf v1.23.0

24 Oct 11:53
09c40ea

Choose a tag to compare

Protobuf v1.23.0

What's New

This release includes protobuf definitions that support the new SDK companion helper functions added to the Java and Python SDKs.

Key Changes

  • SDK Companion Utilities: Protobuf definitions now support comprehensive helper functions for Java and Python SDKs with feature parity to Go SDK
  • Enhanced Type Support: Improved support for Decimal, Amount, Token, Ledger, Date, and TimeOfDay operations across all SDKs

Features

The protobuf definitions in this release enable:

Type Utilities

  • DecimalUtils: 18+ arithmetic and comparison operations for high-precision decimals
  • TokenUtils: Token creation, validation, and conversion functions
  • AmountUtils: 16+ amount arithmetic, validation, and token operations
  • LedgerUtils: Ledger validation, precision, and formatting functions
  • DateUtils: Date creation and validation utilities
  • TimeOfDayUtils: Time-of-day operations with nanosecond precision

Business Logic Support

  • RoleUtils: Role resource name parsing and ULID validation
  • ApiUserStateMachine: API user state validation and transitions
  • TransactionStateMachine: Transaction state machine functions
  • ClientRoles: Client role extraction using protobuf reflection
  • IncomeEntryUtils: Income narrative formatting

Breaking Changes

None - this is a backward-compatible release.

Technical Details

Related Releases

This protobuf release is part of the coordinated v1.23.0 release across all Mesh API SDKs:

  • Go SDK v1.23.0
  • Python SDK v1.23.0
  • Java SDK v1.23.0

Generated as part of the Mesh API v1.23.0 multi-SDK release

Go SDK v1.23.0

24 Oct 11:53
09c40ea

Choose a tag to compare

Go SDK v1.23.0

What's New

This release maintains the Go SDK's comprehensive companion helper functions while enabling feature parity across all Mesh API SDKs.

Key Changes

  • Cross-SDK Parity: Java and Python SDKs now have equivalent helper functions matching Go SDK functionality
  • Enhanced Testing: Comprehensive test coverage ensures reliability across all SDK languages
  • Improved Documentation: Updated documentation reflects SDK-independent helper functions

Features

The Go SDK continues to provide extensive helper functions for:

Type Utilities

  • Decimal Operations: High-precision arithmetic (add, subtract, multiply, divide, compare)
  • Token Functions: Token creation, validation, formatting, and ledger operations
  • Amount Functions: Amount arithmetic, comparison, validation, and token operations
  • Ledger Functions: Ledger validation, precision checking, and pretty printing
  • Date/Time Functions: Date and TimeOfDay utilities with nanosecond precision

Business Logic

  • Role Management: Role resource name parsing, ULID validation, and formatting
  • State Machines: API user and transaction state validation and transitions
  • Client Configuration: Client role extraction and management
  • Income Reporting: Income entry formatting utilities

Installation

go get github.com/meshtrade/api/[email protected]

Usage

import (
    "github.com/meshtrade/api/go/meshtrade/type/v1"
)

// Example: Working with amounts
amount := type_v1.NewAmount(token, decimalValue)
result := type_v1.AmountAdd(amount1, amount2)

Breaking Changes

None - this is a backward-compatible release.

Technical Details

Related Releases

This Go SDK release is part of the coordinated v1.23.0 release:

  • Protobuf v1.23.0
  • Python SDK v1.23.0
  • Java SDK v1.23.0

Generated as part of the Mesh API v1.23.0 multi-SDK release

Python SDK v1.22.0

23 Oct 14:22

Choose a tag to compare

🎯 Group Context Switching & Architecture Improvements

This release adds group context switching functionality to the Python SDK with significant architecture improvements, achieving 100% feature parity with Go and Java SDKs.

✨ New Features

Python SDK: with_group() Method

  • Added group context switching - Create new client instances with different group contexts
  • Comprehensive validation - Empty group and format checks with clear error messages
  • Preserves all configuration - URL, port, API key, timeout, and TLS settings maintained
  • Zero duplication - DRY principle with base class implementation
  • Type-safe - Uses type(self) pattern for correct subclass instantiation
  • Comprehensive testing - 8 new test cases verify all functionality

Example:

# Create initial client with default group from credentials
service = ApiUserService()

# Switch to different group context
alt_service = service.with_group("groups/01ARZ3NDEKTSV4RRFFQ69G5FAV")

# Both clients work independently with different groups
resp1 = service.get_api_user(request)      # Uses original group
resp2 = alt_service.get_api_user(request)  # Uses alternative group

πŸ—οΈ Architecture Improvements

Centralized ServiceOptions:

  • Created shared ServiceOptions class in meshtrade.common.service_options
  • Eliminated 9+ duplicate ServiceOptions files across service packages
  • All services now use single source of truth

Base Class Enhancement:

  • Added with_group() method to BaseGRPCClient
  • Added property accessors for configuration (url, port, api_key, timeout, tls)
  • Validation centralized with descriptive error messages

Code Generation:

  • Updated template to import shared ServiceOptions
  • Removed code duplication from generated services
  • All future services automatically inherit with_group() functionality

πŸ“¦ What's Changed

Python SDK Enhancements:

Validation Features:

  • βœ… Empty group check: ValueError if group is empty
  • βœ… Format check: ValueError if group doesn't start with groups/
  • βœ… Clear error messages for debugging

Files Modified:

  • python/src/meshtrade/common/grpc_client.py (+93 lines)
  • python/src/meshtrade/common/service_options.py (+46 lines NEW)
  • python/src/meshtrade/*/v1/__init__.py (-18 lines across 9 files)
  • python/tests/unit/common/test_with_group.py (+169 lines NEW)
  • Code generator templates updated

πŸ“Š Statistics

  • 15 files changed: +308 additions, -23 deletions
  • Net improvement: +285 lines of functionality
  • Code duplication eliminated: Removed 9+ duplicate files
  • Test coverage: 8 comprehensive test cases

βœ… Testing

  • βœ… All 140 tests passing
  • βœ… 8 new tests for with_group() functionality:
    • Returns new instance (not same object)
    • Changes group context correctly
    • Preserves URL, port, API key, timeout, TLS
    • Allows independent client usage
    • Validates empty group
    • Validates malformed format
  • βœ… Zero regressions in existing functionality

πŸš€ Feature Parity

Python SDK now has 100% feature parity with Go and Java SDKs for group context switching:

Feature Implementation
Group switching βœ… with_group() in base class
Validation βœ… Empty + format checks
New instance creation βœ… Independent clients
Config preservation βœ… All settings maintained
Test coverage βœ… Comprehensive (8 tests)

πŸ”— Full Changelog

See the complete pull request: #68 - Add group context switching to Java and Python SDKs


Note: Java and Go SDKs also received updates in this release:

  • Java: withGroup() method - java/v1.22.0
  • Go: Removed deprecated Amount.IsEqual() - go/v1.22.0

πŸ€– Generated with Claude Code

Co-Authored-By: Claude [email protected]

Protobuf v1.22.0

23 Oct 14:17

Choose a tag to compare

🎯 Group Context Switching & API Improvements

This release adds group context switching functionality to Java and Go SDKs, and removes deprecated methods for cleaner APIs.

✨ New Features

Java SDK: withGroup() Method

  • Added group context switching - Create new client instances with different group contexts
  • Preserves all configuration - URL, port, API key, timeout, and TLS settings maintained
  • Type-safe API - Returns correct service interface type for each client
  • Comprehensive testing - 3 new integration tests verify independent client usage

Example:

GroupService service = new GroupService();
GroupServiceInterface altService = service.withGroup("groups/NEW_GROUP_ID");
// Both clients work independently with different groups

Go SDK: API Cleanup

  • Removed deprecated Amount.IsEqual() method - Use IsEqualTo() for consistency
  • Breaking Change: Code using IsEqual() must migrate to IsEqualTo()
  • Rationale: Standardizes naming with Token.IsEqualTo() pattern

πŸ“¦ What's Changed

Java SDK Enhancements:

  • Added createOptionsWithGroup() helper to BaseGRPCClient (java/src/.../grpc/BaseGRPCClient.java)
  • Generated withGroup() in all service clients via code generators
  • Added comprehensive WithGroupTest with 3 test scenarios
  • All 54 tests passing βœ…

Go SDK Cleanup:

  • Removed Amount.IsEqual() method (go/type/v1/amount.go)
  • Removed associated test cases
  • Simplified API surface for better maintainability

Code Generation:

  • Updated ClientGenerator.java to generate withGroup() implementations
  • Updated InterfaceGenerator.java to add withGroup() signatures
  • All future services will automatically include this functionality

πŸ“Š Statistics

  • 21 files changed: +548 additions, -141 deletions
  • Net improvement: +407 lines of functionality
  • Test coverage: Comprehensive tests for all new features

πŸ”„ Migration Guide

Go SDK - Amount.IsEqual() Removal:

// Before (deprecated, now removed)
if amount.IsEqual(other) { ... }

// After (use this)
if amount.IsEqualTo(other) { ... }

βœ… Testing

  • βœ… Java: All 54 tests passing
  • βœ… Go: All tests passing with linting clean
  • βœ… Zero regressions in existing functionality

πŸ”— Full Changelog

See the complete pull request: #68 - Add group context switching to Java and Python SDKs


Note: Python SDK also received with_group() functionality in this release, available in py/v1.22.0.

πŸ€– Generated with Claude Code

Co-Authored-By: Claude [email protected]