fix: allow ETH pricing mode for membership quotes
Some checks are pending
check / secretapi (push) Waiting to run
Some checks are pending
check / secretapi (push) Waiting to run
This commit is contained in:
parent
eebaaa077c
commit
03e1a6e9c4
@ -77,11 +77,18 @@ func (c Config) Validate() error {
|
||||
if c.ChainID <= 0 {
|
||||
return fmt.Errorf("SECRET_API_CHAIN_ID must be positive")
|
||||
}
|
||||
if strings.ToUpper(strings.TrimSpace(c.MintCurrency)) != "USDC" {
|
||||
return fmt.Errorf("SECRET_API_MINT_CURRENCY must be USDC")
|
||||
}
|
||||
if c.MintDecimals != 6 {
|
||||
return fmt.Errorf("SECRET_API_MINT_DECIMALS must be 6")
|
||||
currency := strings.ToUpper(strings.TrimSpace(c.MintCurrency))
|
||||
switch currency {
|
||||
case "USDC":
|
||||
if c.MintDecimals != 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)
|
||||
amount, ok := new(big.Int).SetString(amountRaw, 10)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user