getWalletUrl function

String getWalletUrl(
  1. MessageType type,
  2. String domain,
  3. String? protocol, {
  4. ConnectType? connectType,
})

Implementation

String getWalletUrl(MessageType type, String domain, String? protocol, {ConnectType? connectType}) {
  final protocol_ = protocol ?? "https";
  final domain_ = domain;

  switch (type) {
    case MessageType.upConnect:
      if (connectType == ConnectType.google) {
        return '$protocol_://$domain_/connect?connectType=google';
      }
      if (connectType == ConnectType.email) {
        return '$protocol_://$domain_/connect?connectType=email';
      }
      return '$protocol_://$domain_/connect';
    case MessageType.upSignMessage:
      return '$protocol_://$domain_/sign-message';
    case MessageType.upSendTransaction:
      return '$protocol_://$domain_/send-transaction';
    case MessageType.upReady:
      return '$protocol_://$domain_/connect/loading';
    default:
      return domain_;
  }
}