fix: allow ETH pricing mode for membership quotes
Some checks are pending
check / secretapi (push) Waiting to run

This commit is contained in:
Joshua 2026-02-19 12:10:23 -08:00
parent eebaaa077c
commit 03e1a6e9c4

View File

@ -77,11 +77,18 @@ func (c Config) Validate() error {
if c.ChainID <= 0 { if c.ChainID <= 0 {
return fmt.Errorf("SECRET_API_CHAIN_ID must be positive") return fmt.Errorf("SECRET_API_CHAIN_ID must be positive")
} }
if strings.ToUpper(strings.TrimSpace(c.MintCurrency)) != "USDC" { currency := strings.ToUpper(strings.TrimSpace(c.MintCurrency))
return fmt.Errorf("SECRET_API_MINT_CURRENCY must be USDC") switch currency {
} case "USDC":
if c.MintDecimals != 6 { if c.MintDecimals != 6 {
return fmt.Errorf("SECRET_API_MINT_DECIMALS must be 6") return fmt.Errorf("SECRET_API_MINT_DECIMALS must be 6 for USDC")
}
case "ETH":
if c.MintDecimals != 18 {
return fmt.Errorf("SECRET_API_MINT_DECIMALS must be 18 for ETH")
}
default:
return fmt.Errorf("SECRET_API_MINT_CURRENCY must be USDC or ETH")
} }
amountRaw := strings.TrimSpace(c.MintAmountAtomic) amountRaw := strings.TrimSpace(c.MintAmountAtomic)
amount, ok := new(big.Int).SetString(amountRaw, 10) amount, ok := new(big.Int).SetString(amountRaw, 10)