rc 1.0
This commit is contained in:
27
lib/payment-currencies.ts
Normal file
27
lib/payment-currencies.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Allowed payment cryptocurrencies
|
||||
*
|
||||
* Edit this list to add or remove supported payment currencies.
|
||||
* All currencies should be in lowercase.
|
||||
*/
|
||||
export const ALLOWED_PAYMENT_CURRENCIES = [
|
||||
'btc',
|
||||
'eth',
|
||||
'sol',
|
||||
'xrp',
|
||||
'bnbbsc',
|
||||
'usdterc20',
|
||||
] as const
|
||||
|
||||
/**
|
||||
* Type for allowed payment currency
|
||||
*/
|
||||
export type AllowedPaymentCurrency = typeof ALLOWED_PAYMENT_CURRENCIES[number]
|
||||
|
||||
/**
|
||||
* Check if a currency is in the allowed list
|
||||
*/
|
||||
export function isAllowedCurrency(currency: string): boolean {
|
||||
return ALLOWED_PAYMENT_CURRENCIES.includes(currency.toLowerCase() as AllowedPaymentCurrency)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user