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 {
|
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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user