tatum 1.0.7 copy "tatum: ^1.0.7" to clipboard
tatum: ^1.0.7 copied to clipboard

Generated Dart libraries for accessing Tatum APIs.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:tatum/tatum.dart';
import 'package:universal_html/controller.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  Tatum.initArchitecture();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: const Home());
  }
}

class Home extends StatefulWidget {
  const Home({super.key});

  @override
  State<Home> createState() => _HomeState();
}

class _HomeState extends State<Home> {
  final tatum = Tatum.instance;

  String addr = 'noting';
  String addr2 = 'noting';

  @override
  void initState() {
    super.initState();
    tatum.setKey('enter-api-key');
    // test();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
          Row(
            children: [
              Flexible(child: const Text('Eth address:')),
              Text(addr),
            ],
          ),
          const SizedBox(
            height: 20,
          ),
          Row(
            children: [
              Flexible(child: const Text('XRP address:')),
              Text(addr2),
            ],
          ),
          const SizedBox(
            height: 20,
          ),
          Row(
            children: [
              ElevatedButton(
                  onPressed: () async {
                    // print(data.toJson());
                    // print(data2.toJson());
                  },
                  child: const Text('Test Eth')),
              ElevatedButton(
                  onPressed: () async {
                    final xrp = await tatum.ripple.generateAccount();

                    addr2 = xrp.address!;
                    final eth = await tatum.ethereum.generateWallet();
                    final address = await tatum.ethereum
                        .generateEthereumAccountAddressFromXPubKey(
                            xpub: eth.xpub, index: 1);
                    setState(() {
                      addr = address.address;
                    });

                    // print(data.toJson());
                    // print(data2.toJson());
                  },
                  child: const Text('Test Ripple')),
            ],
          )
        ]),
      ),
    );
  }
}
2
likes
120
points
90
downloads

Publisher

unverified uploader

Weekly Downloads

Generated Dart libraries for accessing Tatum APIs.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

device_info_plus, dio, equatable, flutter, get_it, injectable, json_annotation, package_info_plus, pretty_dio_logger, retrofit

More

Packages that depend on tatum