wallet limit reduction + country list constants

This commit is contained in:
keyan 2023-12-14 12:51:38 -06:00
parent 71bbf34f36
commit 0fe1d45c8f
2 changed files with 6 additions and 4 deletions

View File

@ -30,7 +30,7 @@ export const MAX_POLL_CHOICE_LENGTH = 40
export const ITEM_SPAM_INTERVAL = '10m'
export const ANON_ITEM_SPAM_INTERVAL = '0'
export const INV_PENDING_LIMIT = 10
export const BALANCE_LIMIT_MSATS = 500000000 // 500k sat
export const BALANCE_LIMIT_MSATS = 250000000 // 250k sat
export const SN_USER_IDS = [616, 6030, 946, 4502]
export const ANON_INV_PENDING_LIMIT = 100
export const ANON_BALANCE_LIMIT_MSATS = 0 // disable
@ -59,6 +59,9 @@ export const GLOBAL_SEED = 616
export const FREEBIE_BASE_COST_THRESHOLD = 10
export const USER_IDS_BALANCE_NO_LIMIT = [...SN_USER_IDS, AD_USER_ID]
// WIP ultimately subject to this list: https://ofac.treasury.gov/sanctions-programs-and-country-information
export const SANCTIONED_COUNTRY_CODES = []
export const TERRITORY_COST_MONTHLY = 100000
export const TERRITORY_COST_YEARLY = 1000000
export const TERRITORY_COST_ONCE = 3000000

View File

@ -2,8 +2,7 @@ import { createReadStream, createWriteStream, unlinkSync } from 'fs'
import unzipper from 'unzipper'
import csvParser from 'csv-parser'
import stream from 'stream'
const sanctionedCountryCodes = ['IR', 'KP', 'SY', 'RU']
import { SANCTIONED_COUNTRY_CODES } from '../lib/constants.js'
const IPV4_URL = 'https://ipapi.is/data/geolocationDatabaseIPv4.csv.zip'
const IPV6_URL = 'https://ipapi.is/data/geolocationDatabaseIPv6.csv.zip'
@ -19,7 +18,7 @@ export async function ofac ({ models }) {
createReadStream(csvFilePath)
.pipe(csvParser())
.on('data', (data) => {
if (sanctionedCountryCodes.includes(data.country_code)) {
if (SANCTIONED_COUNTRY_CODES.includes(data.country_code)) {
results.push({
startIP: data.start_ip,
endIP: data.end_ip,