tbank_invest_grpc 0.1.1
tbank_invest_grpc: ^0.1.1 copied to clipboard
Dart gRPC client for T-Invest API (T-Bank) with generated protobuf models for every service and Decimal support for Quotation/MoneyValue.
example/tbank_invest_grpc_example.dart
import 'dart:io';
import 'package:tbank_invest_grpc/tbank_invest_grpc.dart';
void main() async {
final token = Platform.environment['TINVEST_TOKEN'];
if (token == null) {
stderr.writeln('TINVEST_TOKEN is not set');
exit(1);
}
final client = InvestClient(token, environment: InvestEnvironment.production);
try {
final response = await client.users.getAccounts(GetAccountsRequest());
print('Accounts found: ${response.accounts.length}');
} catch (e) {
print('API call failed: $e');
}
}