Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Highlights include:
- [Dogecoin](https://dogecoin.com/)
- [Epic Cash](https://linktr.ee/epiccash)
- [MimbleWimbleCoin](https://mwc.mw)
- [Grin](https://grin.mw/)
- [Ethereum](https://ethereum.org/en/)
- [Ecash](https://e.cash/)
- [Fact0rn](https://www.fact0rn.io/)
Expand Down
8 changes: 8 additions & 0 deletions docs/building/native-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ to build them in `dev` mode.
| Flutter and platform plugins | Target SDKs and the platform's C/C++ build tools in either mode |
| OpenAlias / DNSSEC (every app) | Rustup on the Flutter host in both modes; `dnssec_resolver` builds from source with Rust **1.90.0** |
| Xelis (Stack Wallet) | Rustup; its hook installs Rust **1.99.1** and the required target; Android needs NDK r28 or newer |
| Grin (Stack Wallet) | Rustup; the `grin_native` hook builds `grin-ffi` and its pinned Grin wallet/core sources fetched over public HTTPS |
| Spark (Stack Wallet and Campfire) | CMake and a C++ compiler; its native-assets hook builds from source |
| Coinlib secp256k1 | A separate platform build, described in each host guide |
| MWEB (Stack Wallet) | Go **1.24.1** or newer; CI uses 1.24.13. The Windows executable has a separate WSL build (Go 1.24.0 or newer) or prebuilt download |
Expand All @@ -78,6 +79,13 @@ This build doesn't use the earlier manual steps for these packages: host Rust
toolchain lists, `cbindgen`, `cargo-lipo`, building the Epic, MWC and Tor
libraries by hand, the MXE setup, or the Epic-specific CMake upgrade.

Stack Wallet depends only on `grin_native`, which re-exports the shared Grin
API; it does not depend on the separate `grin` Dart package. To build against
a local `grin_native` checkout, edit the generated `pubspec.yaml` after
configuration (it is not committed), replace the Git dependency with the
checkout path, and run `flutter pub upgrade grin_native` after each library
commit.

## When native hooks run

The icon and splash `dart run` commands during configuration use only those
Expand Down
1 change: 1 addition & 0 deletions integration_test/desktop_forgot_password/harness.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const _walletFiles = [
'wallets/monero/test_wallet/test_wallet',
'wallets/monero/test_wallet/test_wallet.keys',
'epiccash/test_wallet/wallet_data/wallet.seed',
'grin/test_wallet/wallet_data/wallet.seed',
];

/// Seeded files a reset must delete.
Expand Down
1 change: 1 addition & 0 deletions integration_test/wallet_creation/coin_matrix.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const defaultWordCounts = <String, int>{
'ethereum': 12,
'fact0rn': 12,
'firo': 12,
'grin': 24,
'litecoin': 12,
'mimblewimblecoin': 12,
'monero': 16,
Expand Down
3 changes: 3 additions & 0 deletions integration_test/wallet_creation/seed_validators.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:stackwallet/services/wallets.dart';
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
import 'package:stackwallet/wallets/isar/models/wallet_info.dart';
import 'package:stackwallet/wallets/wallet/impl/epiccash_wallet.dart';
import 'package:stackwallet/wallets/wallet/impl/grin_wallet.dart';
import 'package:stackwallet/wallets/wallet/impl/mimblewimblecoin_wallet.dart';
import 'package:stackwallet/wallets/wallet/intermediate/cryptonote_wallet.dart';
import 'package:stackwallet/wallets/wallet/intermediate/lib_xelis_wallet.dart';
Expand All @@ -31,6 +32,8 @@ Future<void> verifyOpenNativeWallet(Wallet wallet, String expected) async {
0,
await wallet.getMwcMqsConfig(),
)).value;
} else if (wallet is GrinWallet) {
actual = await wallet.getNativeReceivingAddress();
} else if (wallet is LibXelisWallet) {
wallet.checkInitialized();
actual = wallet.xelis.getAddress(wallet.wallet!);
Expand Down
64 changes: 64 additions & 0 deletions lib/models/isar/models/blockchain_data/v2/transaction_v2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ class TransactionV2 {
bool get isMimblewimblecoinTransaction =>
_getFromOtherData(key: TxV2OdKeys.isMimblewimblecoinTransaction) == true;

@ignore
bool get isGrinTransaction =>
_getFromOtherData(key: TxV2OdKeys.isGrinTransaction) == true;

/// The last slate state a Grin wallet saw, as its wire name ("S1" ...).
@ignore
String? get grinSlateState =>
_getFromOtherData(key: TxV2OdKeys.grinSlateState) as String?;

@ignore
bool get isReverted => _getFromOtherData(key: TxV2OdKeys.isReverted) == true;

int? get numberOfMessages =>
_getFromOtherData(key: TxV2OdKeys.numberOfMessages) as int?;
String? get slateId => _getFromOtherData(key: TxV2OdKeys.slateId) as String?;
Expand Down Expand Up @@ -302,6 +314,15 @@ class TransactionV2 {
}
}

if (isGrinTransaction) {
return _grinStatusLabel(
currentChainHeight: currentChainHeight,
minConfirms: minConfirms,
minCoinbaseConfirms: minCoinbaseConfirms,
prettyConfirms: prettyConfirms,
);
}

if (isMimblewimblecoinTransaction) {
if (slateId == null) {
return "Restored Funds";
Expand Down Expand Up @@ -364,6 +385,40 @@ class TransactionV2 {
}
}

String _grinStatusLabel({
required int currentChainHeight,
required int minConfirms,
required int minCoinbaseConfirms,
required String Function() prettyConfirms,
}) {
final incoming = type == TransactionType.incoming;
final outgoing =
type == TransactionType.outgoing || type == TransactionType.sentToSelf;
final state = grinSlateState;
final onChain = height != null;

if (incoming && slateId == null && !isCoinbase()) return "Restored funds";
if (isCancelled) return "Cancelled";
if (isReverted) return "Reverted";
if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) {
if (type == TransactionType.sentToSelf) return "Sent to self";
return incoming ? "Received" : "Sent";
}
if (!onChain) {
if (state == "S1" && outgoing) return "Sending (waiting for response)";
if (state == "S2" && incoming) {
return "Receiving (waiting for sender to finalize)";
}
if (state == "I1") return "Invoice issued (waiting for payer)";
if (state == "I2" && outgoing) {
return "Paying invoice (waiting for invoicer)";
}
}
return incoming
? "Receiving ${prettyConfirms()}"
: "Sending ${prettyConfirms()}";
}

dynamic _getFromOtherData({required dynamic key}) {
if (otherData == null) {
return null;
Expand Down Expand Up @@ -421,4 +476,13 @@ abstract final class TxV2OdKeys {
static const salviumTypeInt = "salviumTypeInt";
static const salviumTypeString = "salviumTypeString";
static const memo = "onChainMemo";
static const isGrinTransaction = "isGrinTransaction";
static const grinLogIds = "grinLogIds";
static const grinSlateState = "grinSlateState";
static const grinHasStoredTx = "grinHasStoredTx";
static const grinKernelExcess = "grinKernelExcess";
static const grinTtlCutoff = "grinTtlCutoff";
static const grinHasPaymentProof = "grinHasPaymentProof";
static const counterpartyAddress = "counterpartyAddress";
static const isReverted = "isReverted";
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class _NewWalletRecoveryPhraseWarningViewState
// this may not be epiccash and sol specific?
if (coin is Epiccash ||
coin is Mimblewimblecoin ||
coin is Grin ||
coin is Solana) {
mnemonicPassphrase = "";
}
Expand Down Expand Up @@ -287,15 +288,14 @@ class _NewWalletRecoveryPhraseWarningViewState
right: 10,
),
child: AppBarIconButton(
semanticsLabel:
"Question Button. Opens A Dialog For Recovery Phrase Explanation.",
semanticsLabel: "Question Button. Opens A Dialog For Recovery Phrase Explanation.",
icon: SvgPicture.asset(
Assets.svg.circleQuestion,
width: 20,
height: 20,
color: Theme.of(
context,
).extension<StackColors>()!.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
onPressed: () async {
await showDialog<void>(
Expand Down Expand Up @@ -331,9 +331,8 @@ class _NewWalletRecoveryPhraseWarningViewState
Text(
walletName,
textAlign: TextAlign.center,
style: STextStyles.label(
context,
).copyWith(fontSize: 12),
style: STextStyles.label(context)
.copyWith(fontSize: 12),
),
if (!isDesktop) const SizedBox(height: 4),
Text(
Expand Down Expand Up @@ -362,9 +361,8 @@ class _NewWalletRecoveryPhraseWarningViewState
? STextStyles.desktopTextMediumRegular(
context,
)
: STextStyles.subtitle(
context,
).copyWith(fontSize: 12),
: STextStyles.subtitle(context)
.copyWith(fontSize: 12),
)
: Column(
children: [
Expand All @@ -381,13 +379,11 @@ class _NewWalletRecoveryPhraseWarningViewState
RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: STextStyles.desktopH3(
context,
).copyWith(fontSize: 18),
style: STextStyles.desktopH3(context)
.copyWith(fontSize: 18),
children: [
TextSpan(
text:
"On the next screen you will be given ",
text: "On the next screen you will be given ",
style: STextStyles.desktopH3(context)
.copyWith(
color: Theme.of(context)
Expand Down Expand Up @@ -597,9 +593,8 @@ class _NewWalletRecoveryPhraseWarningViewState
? STextStyles.desktopTextMedium(
context,
)
: STextStyles.baseXS(
context,
).copyWith(height: 1.3),
: STextStyles.baseXS(context)
.copyWith(height: 1.3),
),
),
],
Expand Down
Loading
Loading