MoonPay: key-gated enablement + inject MOONPAY_API_KEY/EXCHANGE_HELPER_API_KEY in CI

getAvailableBuyProviderTypes() now returns [moonpay] only when moonPayApiKey is
non-empty, so MoonPay's Buy button appears only in builds where the CI secret is
present (and the exchange-helper signer is live). Both build workflows now inject
MOONPAY_API_KEY -> moonPayApiKey and EXCHANGE_HELPER_API_KEY -> exchangeHelperApiKey
alongside Trocador + WalletConnect. moonPaySecretKey is server-side and never injected.
This commit is contained in:
jwinterm
2026-07-02 16:41:45 -04:00
parent 26a554c3f0
commit d9897f13ea
3 changed files with 24 additions and 9 deletions
+11 -6
View File
@@ -6,6 +6,7 @@ import 'package:hash_wallet/buy/moonpay/moonpay_provider.dart';
import 'package:hash_wallet/buy/onramper/onramper_buy_provider.dart';
import 'package:hash_wallet/buy/robinhood/robinhood_buy_provider.dart';
import 'package:hash_wallet/di.dart';
import 'package:hash_wallet/.secrets.g.dart' as secrets;
enum ProviderType { robinhood, dfx, onramper, moonpay, meld, kriptonim }
@@ -46,12 +47,16 @@ extension ProviderTypeName on ProviderType {
}
class ProvidersHelper {
// Hash Bags: all buy/sell providers (Robinhood Connect, DFX, Onramper,
// MoonPay, Kryptonim, Meld) gutted. Each requires a formal partner
// agreement with a revenue-share contract — no free integrations exist.
// Re-add providers here once Such Software has registered the affiliate
// relationship for that provider.
static List<ProviderType> getAvailableBuyProviderTypes() => [];
// Hash Bags: buy/sell providers stay gutted EXCEPT MoonPay, which is
// KEY-GATED — it becomes available only when a real moonPayApiKey is baked
// into the build (injected in CI from the MOONPAY_API_KEY secret; the
// exchange-helper signer must also be live). If the key is empty the Buy
// button stays hidden, so v1.0.0 ships cleanly with or without MoonPay.
// The other providers (Robinhood/DFX/Onramper/Kryptonim/Meld) still need
// their own partner agreements before re-adding here.
// Sell/off-ramp: enable by mirroring the buy line below once tested.
static List<ProviderType> getAvailableBuyProviderTypes() =>
secrets.moonPayApiKey.isNotEmpty ? [ProviderType.moonpay] : [];
static List<ProviderType> getAvailableSellProviderTypes() => [];
static BuyProvider getProviderByType(ProviderType type) {