TonConnectManager constructor

TonConnectManager(
  1. String manifestUrl, {
  2. IStorage? customStorage,
  3. String? walletsListSource,
  4. int? walletsListCacheTtl,
  5. Level? logLevel = Level.nothing,
})

Implementation

TonConnectManager(String manifestUrl,
    {IStorage? customStorage,
      String? walletsListSource,
      int? walletsListCacheTtl, Level? logLevel = Level.nothing}) {
  TonConnectManager.logLevel = logLevel;
  connector = TonConnect(manifestUrl,
      customStorage: customStorage,
      walletsListSource: walletsListSource,
      walletsListCacheTtl: walletsListCacheTtl);
  connector.onStatusChange((status) {
    if (status is Map<String, dynamic>) {
      if (status.containsKey('error')) {
        broadcastMessage(TonPaymentStatus.Transaction_error_or_rejected);
      } else if (status.containsKey('result')){
        broadcastMessage(TonPaymentStatus.Transaction_sent);
      }
      return;
    }
    broadcastMessage(connector.connected
        ? TonPaymentStatus.Connected
        : TonPaymentStatus.Disconnected);
  });
  connector.restoreConnection();
  loadWallets();
}