This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Build the solution:
./build.sh(Mac/Linux) or use Cake directly:dotnet cake - Run unit tests:
dotnet test test/TrueLayer.Tests/TrueLayer.Tests.csproj - Run acceptance tests:
dotnet test test/TrueLayer.AcceptanceTests/TrueLayer.AcceptanceTests.csproj - Run specific test:
dotnet test --filter "TestMethodName" - Generate coverage reports: Coverage is generated automatically during the build process
- Pack NuGet packages:
dotnet cake --target=Pack - Clean artifacts:
dotnet cake --target=Clean
- Restore tools:
dotnet tool restore - Build specific project:
dotnet build src/TrueLayer/TrueLayer.csproj
The TrueLayer .NET client follows a modular architecture with these main components:
- ITrueLayerClient: Main interface providing access to all API modules
- TrueLayerClient: Concrete implementation using lazy initialization for API modules
- ApiClient: HTTP client wrapper handling authentication and request signing
- Authentication: JWT token-based auth with optional caching (InMemory/Custom)
Each API area is encapsulated in its own module:
- Auth: Token management (
IAuthApi) - Payments: Payment creation and management (
IPaymentsApi) - Payouts: Payout operations (
IPayoutsApi) - PaymentsProviders: Provider discovery (
IPaymentsProvidersApi) - MerchantAccounts: Account management (
IMerchantAccountsApi) - Mandates: Mandate operations (
IMandatesApi)
- Dependency Injection: Full DI support with
AddTrueLayer()andAddKeyedTrueLayer()extensions - Options Pattern: Configuration via
TrueLayerOptionswith support for multiple clients - Authentication Caching: Configurable auth token caching strategies
- Request Signing: Cryptographic signing using EC512 keys via TrueLayer.Signing package
- Polymorphic Serialization: OneOf types for discriminated unions, custom JSON converters
- .NET 10.0
- .NET 9.0
- .NET 8.0
- Unit Tests:
/test/TrueLayer.Tests/- Fast, isolated tests with mocking - Acceptance Tests:
/test/TrueLayer.AcceptanceTests/- Integration tests against real/mock APIs - Benchmarks:
/test/TrueLayer.Benchmarks/- Performance testing
- OneOf: Discriminated union types for polymorphic models
- TrueLayer.Signing: Request signing functionality
- Microsoft.Extensions.***: Standard .NET extensions for DI, HTTP, caching, configuration
- System.Text.Json: Primary serialization with custom converters
- ClientId, ClientSecret for API authentication
- SigningKey (KeyId + PrivateKey) for payment request signing
- UseSandbox flag for environment selection
- Optional auth token caching configuration
Uses Cake build system (build.cake) with tasks for:
- Clean, Build, Test, Pack, GenerateReports
- Coverage reporting via Coverlet
- NuGet package publishing
- CI/CD integration with GitHub Actions
- C# 10.0 language features
- Nullable reference types enabled
- Code style enforcement via
EnforceCodeStyleInBuild - EditorConfig and analyzer rules applied
When creating a PR, Claude will ask for a JIRA ticket reference if:
- The GitHub user is part of the Api Client Libraries team at TrueLayer
- The GitHub username has a
tl-prefix - When in doubt, an optional ACL ticket reference will be requested
Format: [ACL-XXX] in the PR title for JIRA ticket references.