Releases: meshtrade/api
Python SDK v1.24.0 - IAM Authentication Upgrade
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.0Or with Poetry:
poetry add meshtrade@^1.24.02. 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_path3. 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__.pypython/src/meshtrade/iam/api_user/v1/service.pypython/src/meshtrade/iam/user/v1/__init__.pypython/src/meshtrade/iam/role/v1/role.pypython/tests/unit/iam/api_user/v1/test_client_validation.pypython/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
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 β 3state: 5 β 4roles: 6 β 5api_key: 7 β 6
User:
email: 4 β 3roles: 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
RevokeRolesFromUsermethod
π Updated Services
meshtrade.iam.api_user.v1.ApiUserServicemeshtrade.iam.user.v1.UserService
π§ Migration Required
Update your .proto imports and regenerate all language bindings:
# Update to v1.24.0
buf mod update
buf generateRole 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
- PR: #76 - Upgrade IAM authentication API: Batch role operations and standardized role paths
- Buf Registry: https://buf.build/meshtrade/api
Full Changelog: proto/v1.23.0...proto/v1.24.0
Java SDK v1.24.0 - IAM Authentication Upgrade
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); // trueService 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.javajava/src/main/java/co/meshtrade/api/iam/role/v1/RoleUtils.javajava/src/test/java/co/meshtrade/api/iam/api_user/v1/ApiUserServiceIntegrationTest.javajava/src/test/java/co/meshtrade/api/iam/api_user/v1/ApiUserServiceValidationTest.javajava/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
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:
RevokeRolesFromUsermethod - β 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.gogo/iam/api_user/v1/service.pb.gogo/iam/api_user/v1/serviceMock.meshgo.gogo/iam/api_user/v1/service_grpc.pb.gogo/iam/api_user/v1/service_interface.meshgo.gogo/iam/api_user/v1/service_validation_test.gogo/iam/user/v1/service.meshgo.gogo/iam/user/v1/service.pb.gogo/iam/user/v1/serviceMock.meshgo.gogo/iam/user/v1/service_grpc.pb.gogo/iam/user/v1/service_interface.meshgo.gogo/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
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.1Python SDK v1.23.0
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 operationsdecimal_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 formattingnew_token(),is_undefined_token(),token_to_pretty_string()token_equals(),ledger_to_pretty_string()
-
amount.py(12 functions): Amount creation, comparison, and arithmeticnew_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
ValueErrorinstead of returningNone
-
ledger.py(3 functions): Ledger validation and formattingledger_decimals(),is_supported_ledger(),UnsupportedLedgerError
Business Logic (14 functions)
-
role.py(7 functions): Role resource name handling with 3-part integer formatparse_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 validationis_valid_api_user_state(),is_terminal_state(),can_transition()
-
transaction_state_machine.py(1 function): Transaction state validationis_terminal_transaction_state()
-
client_roles.py(4 functions): Client default role configuration using protobuf introspectionget_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 printingincome_entry_to_narrative()
Quality Improvements
- 298 comprehensive tests: All functions have 100% test coverage
- Type safety: Proper type hints with
| Nonefor optional parameters - Null safety: Documented None-handling patterns matching Go SDK
- Zero linting issues: All code passes
ruffchecks (150-char limit) - Cross-SDK compatibility: Behavior matches Go SDK exactly
Breaking Changes
- Removed:
token_new_amount_of()- Usenew_amount()ornew_undefined_amount()instead - Behavior change: Amount functions now throw
ValueErrorfor invalid inputs instead of returningNone
Installation
pip install meshtrade==1.23.0Usage 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
- Python Version: 3.12+
- Repository: https://github.com/meshtrade/api
- PyPI: https://pypi.org/project/meshtrade/
- Version: 1.23.0
- Release Date: 2025-10-24
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
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
- Repository: https://github.com/meshtrade/api
- Buf Registry: https://buf.build/meshtrade/api
- Version: 1.23.0
- Release Date: 2025-10-24
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
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
- Go Version: 1.21+
- Repository: https://github.com/meshtrade/api
- Version: 1.23.0
- Release Date: 2025-10-24
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
π― 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
ServiceOptionsclass inmeshtrade.common.service_options - Eliminated 9+ duplicate
ServiceOptionsfiles across service packages - All services now use single source of truth
Base Class Enhancement:
- Added
with_group()method toBaseGRPCClient - 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:
- Added
with_group()toBaseGRPCClient(python/src/.../grpc_client.py) - Created
ServiceOptionscommon class (python/src/.../service_options.py) - Added comprehensive test suite with 8 test cases
- All 140 tests passing β
Validation Features:
- β
Empty group check:
ValueErrorif group is empty - β
Format check:
ValueErrorif group doesn't start withgroups/ - β 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
π― 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 groupsGo SDK: API Cleanup
- Removed deprecated
Amount.IsEqual()method - UseIsEqualTo()for consistency - Breaking Change: Code using
IsEqual()must migrate toIsEqualTo() - Rationale: Standardizes naming with
Token.IsEqualTo()pattern
π¦ What's Changed
Java SDK Enhancements:
- Added
createOptionsWithGroup()helper toBaseGRPCClient(java/src/.../grpc/BaseGRPCClient.java) - Generated
withGroup()in all service clients via code generators - Added comprehensive
WithGroupTestwith 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.javato generatewithGroup()implementations - Updated
InterfaceGenerator.javato addwithGroup()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]