From eaeb3f2838b797ac855cf01535e6bb79d6ccf79e Mon Sep 17 00:00:00 2001 From: Nicolas Burtey Date: Tue, 19 Dec 2023 13:05:56 -0600 Subject: [PATCH] chore: more file moving around --- core/api/src/app/earn/add-earn.ts | 3 +- core/api/src/app/earn/config.ts | 126 ++++++++++++++++++++ core/api/src/config/index.ts | 128 +-------------------- core/api/src/services/mongoose/accounts.ts | 3 +- 4 files changed, 130 insertions(+), 130 deletions(-) create mode 100644 core/api/src/app/earn/config.ts diff --git a/core/api/src/app/earn/add-earn.ts b/core/api/src/app/earn/add-earn.ts index 79d76d28566..f0f28421ad0 100644 --- a/core/api/src/app/earn/add-earn.ts +++ b/core/api/src/app/earn/add-earn.ts @@ -1,6 +1,6 @@ import { intraledgerPaymentSendWalletIdForBtcWallet } from "../payments/send-intraledger" -import { getRewardsConfig, OnboardingEarn } from "@/config" +import { getRewardsConfig } from "@/config" import { getBalanceForWallet } from "@/app/wallets" @@ -30,6 +30,7 @@ import { import { consumeLimiter } from "@/services/rate-limit" import { getFunderWalletId } from "@/services/ledger/caching" import { AccountsIpsRepository } from "@/services/mongoose/accounts-ips" +import { OnboardingEarn } from "./config" export const addEarn = async ({ quizQuestionId: quizQuestionIdString, diff --git a/core/api/src/app/earn/config.ts b/core/api/src/app/earn/config.ts new file mode 100644 index 00000000000..91edda329e5 --- /dev/null +++ b/core/api/src/app/earn/config.ts @@ -0,0 +1,126 @@ +// onboarding +export const OnboardingEarn: Record = { + walletDownloaded: 1 as Satoshis, + walletActivated: 1 as Satoshis, + whatIsBitcoin: 1 as Satoshis, + sat: 2 as Satoshis, + whereBitcoinExist: 2 as Satoshis, + whoControlsBitcoin: 2 as Satoshis, + copyBitcoin: 3 as Satoshis, + moneySocialAgreement: 2 as Satoshis, + coincidenceOfWants: 2 as Satoshis, + moneyEvolution: 2 as Satoshis, + whyStonesShellGold: 3 as Satoshis, + moneyIsImportant: 3 as Satoshis, + moneyImportantGovernement: 4 as Satoshis, + WhatIsFiat: 2 as Satoshis, + whyCareAboutFiatMoney: 2 as Satoshis, + GovernementCanPrintMoney: 2 as Satoshis, + FiatLosesValueOverTime: 3 as Satoshis, + OtherIssues: 4 as Satoshis, + LimitedSupply: 2 as Satoshis, + Decentralized: 2 as Satoshis, + NoCounterfeitMoney: 2 as Satoshis, + HighlyDivisible: 3 as Satoshis, + securePartOne: 3 as Satoshis, + securePartTwo: 4 as Satoshis, + originsOfMoney: 2 as Satoshis, + primitiveMoney: 2 as Satoshis, + anticipatingDemand: 3 as Satoshis, + nashEquilibrium: 3 as Satoshis, + singleStoreOfValue: 4 as Satoshis, + whatIsGoodSOV: 2 as Satoshis, + durability: 2 as Satoshis, + portability: 2 as Satoshis, + fungibility: 2 as Satoshis, + verifiability: 3 as Satoshis, + divisibility: 3 as Satoshis, + scarce: 3 as Satoshis, + establishedHistory: 4 as Satoshis, + censorshipResistance: 5 as Satoshis, + evolutionMoney: 2 as Satoshis, + collectible: 2 as Satoshis, + storeOfValue: 2 as Satoshis, + mediumOfExchange: 3 as Satoshis, + unitOfAccount: 3 as Satoshis, + partlyMonetized: 3 as Satoshis, + monetizationStage: 4 as Satoshis, + notFromGovernment: 2 as Satoshis, + primaryFunction: 2 as Satoshis, + monetaryMetals: 3 as Satoshis, + stockToFlow: 3 as Satoshis, + hardMoney: 4 as Satoshis, + convergingOnGold: 2 as Satoshis, + originsOfPaperMoney: 2 as Satoshis, + fractionalReserve: 2 as Satoshis, + bankRun: 2 as Satoshis, + modernCentralBanking: 3 as Satoshis, + goldBacked: 3 as Satoshis, + brettonWoods: 4 as Satoshis, + globalReserve: 5 as Satoshis, + nixonShock: 2 as Satoshis, + fiatEra: 2 as Satoshis, + digitalFiat: 2 as Satoshis, + plasticCredit: 3 as Satoshis, + doubleSpendProblem: 3 as Satoshis, + satoshisBreakthrough: 3 as Satoshis, + nativelyDigital: 4 as Satoshis, + CBDCs: 5 as Satoshis, + rootProblem: 2 as Satoshis, + bitcoinCreator: 2 as Satoshis, + fiatRequiresTrust: 3 as Satoshis, + moneyPrinting: 3 as Satoshis, + genesisBlock: 4 as Satoshis, + cypherpunks: 13 as Satoshis, + peer2Peer: 2 as Satoshis, + blockchain: 2 as Satoshis, + privateKey: 2 as Satoshis, + publicKey: 3 as Satoshis, + mining: 3 as Satoshis, + proofOfWork: 3 as Satoshis, + difficultyAdjustment: 4 as Satoshis, + halving: 5 as Satoshis, + bitcoinDrawbacks: 2 as Satoshis, + blocksizeWars: 2 as Satoshis, + lightningNetwork: 2 as Satoshis, + instantPayments: 3 as Satoshis, + micropayments: 3 as Satoshis, + scalability: 3 as Satoshis, + paymentChannels: 4 as Satoshis, + routing: 5 as Satoshis, + itsaBubble: 2 as Satoshis, + itstooVolatile: 2 as Satoshis, + itsnotBacked: 3 as Satoshis, + willbecomeObsolete: 3 as Satoshis, + toomuchEnergy: 4 as Satoshis, + strandedEnergy: 5 as Satoshis, + internetDependent: 2 as Satoshis, + forcrimeOnly: 2 as Satoshis, + ponziScheme: 2 as Satoshis, + bitcoinisTooSlow: 3 as Satoshis, + supplyLimit: 3 as Satoshis, + governmentBan: 4 as Satoshis, + concentratedOwnership: 2 as Satoshis, + centralizedMining: 2 as Satoshis, + tooExpensive: 2 as Satoshis, + prohibitivelyHigh: 3 as Satoshis, + willBeHoarded: 4 as Satoshis, + canBeDuplicated: 5 as Satoshis, + scarcity: 2 as Satoshis, + monetaryPremium: 2 as Satoshis, + greshamsLaw: 2 as Satoshis, + thiersLaw: 3 as Satoshis, + cantillonEffect: 4 as Satoshis, + schellingPoint: 5 as Satoshis, + opportunityCost: 2 as Satoshis, + timePreference: 2 as Satoshis, + impossibleTrinity: 3 as Satoshis, + jevonsParadox: 3 as Satoshis, + powerLaws: 4 as Satoshis, + winnerTakeAll: 5 as Satoshis, + unitBias: 2 as Satoshis, + veblenGood: 2 as Satoshis, + malinvestment: 3 as Satoshis, + asymmetricPayoff: 4 as Satoshis, + ansoffMatrix: 5 as Satoshis, +} as const diff --git a/core/api/src/config/index.ts b/core/api/src/config/index.ts index bb659932ffc..4f92efec883 100644 --- a/core/api/src/config/index.ts +++ b/core/api/src/config/index.ts @@ -13,6 +13,7 @@ export * from "./schema" import { ConfigError } from "./error" import { toDays } from "@/domain/primitives" +import { OnboardingEarn } from "@/app/earn/config" export const MS_PER_SEC = 1000 as MilliSeconds export const MS_PER_5_MINS = (60 * 5 * MS_PER_SEC) as MilliSeconds @@ -81,133 +82,6 @@ export const getLoopConfig = () => { throw new ConfigError("getLoopConfig() was called though swapEnabled is false") } -// onboarding -export const OnboardingEarn: Record = { - walletDownloaded: 1 as Satoshis, - walletActivated: 1 as Satoshis, - whatIsBitcoin: 1 as Satoshis, - sat: 2 as Satoshis, - whereBitcoinExist: 2 as Satoshis, - whoControlsBitcoin: 2 as Satoshis, - copyBitcoin: 3 as Satoshis, - moneySocialAgreement: 2 as Satoshis, - coincidenceOfWants: 2 as Satoshis, - moneyEvolution: 2 as Satoshis, - whyStonesShellGold: 3 as Satoshis, - moneyIsImportant: 3 as Satoshis, - moneyImportantGovernement: 4 as Satoshis, - WhatIsFiat: 2 as Satoshis, - whyCareAboutFiatMoney: 2 as Satoshis, - GovernementCanPrintMoney: 2 as Satoshis, - FiatLosesValueOverTime: 3 as Satoshis, - OtherIssues: 4 as Satoshis, - LimitedSupply: 2 as Satoshis, - Decentralized: 2 as Satoshis, - NoCounterfeitMoney: 2 as Satoshis, - HighlyDivisible: 3 as Satoshis, - securePartOne: 3 as Satoshis, - securePartTwo: 4 as Satoshis, - originsOfMoney: 2 as Satoshis, - primitiveMoney: 2 as Satoshis, - anticipatingDemand: 3 as Satoshis, - nashEquilibrium: 3 as Satoshis, - singleStoreOfValue: 4 as Satoshis, - whatIsGoodSOV: 2 as Satoshis, - durability: 2 as Satoshis, - portability: 2 as Satoshis, - fungibility: 2 as Satoshis, - verifiability: 3 as Satoshis, - divisibility: 3 as Satoshis, - scarce: 3 as Satoshis, - establishedHistory: 4 as Satoshis, - censorshipResistance: 5 as Satoshis, - evolutionMoney: 2 as Satoshis, - collectible: 2 as Satoshis, - storeOfValue: 2 as Satoshis, - mediumOfExchange: 3 as Satoshis, - unitOfAccount: 3 as Satoshis, - partlyMonetized: 3 as Satoshis, - monetizationStage: 4 as Satoshis, - notFromGovernment: 2 as Satoshis, - primaryFunction: 2 as Satoshis, - monetaryMetals: 3 as Satoshis, - stockToFlow: 3 as Satoshis, - hardMoney: 4 as Satoshis, - convergingOnGold: 2 as Satoshis, - originsOfPaperMoney: 2 as Satoshis, - fractionalReserve: 2 as Satoshis, - bankRun: 2 as Satoshis, - modernCentralBanking: 3 as Satoshis, - goldBacked: 3 as Satoshis, - brettonWoods: 4 as Satoshis, - globalReserve: 5 as Satoshis, - nixonShock: 2 as Satoshis, - fiatEra: 2 as Satoshis, - digitalFiat: 2 as Satoshis, - plasticCredit: 3 as Satoshis, - doubleSpendProblem: 3 as Satoshis, - satoshisBreakthrough: 3 as Satoshis, - nativelyDigital: 4 as Satoshis, - CBDCs: 5 as Satoshis, - rootProblem: 2 as Satoshis, - bitcoinCreator: 2 as Satoshis, - fiatRequiresTrust: 3 as Satoshis, - moneyPrinting: 3 as Satoshis, - genesisBlock: 4 as Satoshis, - cypherpunks: 13 as Satoshis, - peer2Peer: 2 as Satoshis, - blockchain: 2 as Satoshis, - privateKey: 2 as Satoshis, - publicKey: 3 as Satoshis, - mining: 3 as Satoshis, - proofOfWork: 3 as Satoshis, - difficultyAdjustment: 4 as Satoshis, - halving: 5 as Satoshis, - bitcoinDrawbacks: 2 as Satoshis, - blocksizeWars: 2 as Satoshis, - lightningNetwork: 2 as Satoshis, - instantPayments: 3 as Satoshis, - micropayments: 3 as Satoshis, - scalability: 3 as Satoshis, - paymentChannels: 4 as Satoshis, - routing: 5 as Satoshis, - itsaBubble: 2 as Satoshis, - itstooVolatile: 2 as Satoshis, - itsnotBacked: 3 as Satoshis, - willbecomeObsolete: 3 as Satoshis, - toomuchEnergy: 4 as Satoshis, - strandedEnergy: 5 as Satoshis, - internetDependent: 2 as Satoshis, - forcrimeOnly: 2 as Satoshis, - ponziScheme: 2 as Satoshis, - bitcoinisTooSlow: 3 as Satoshis, - supplyLimit: 3 as Satoshis, - governmentBan: 4 as Satoshis, - concentratedOwnership: 2 as Satoshis, - centralizedMining: 2 as Satoshis, - tooExpensive: 2 as Satoshis, - prohibitivelyHigh: 3 as Satoshis, - willBeHoarded: 4 as Satoshis, - canBeDuplicated: 5 as Satoshis, - scarcity: 2 as Satoshis, - monetaryPremium: 2 as Satoshis, - greshamsLaw: 2 as Satoshis, - thiersLaw: 3 as Satoshis, - cantillonEffect: 4 as Satoshis, - schellingPoint: 5 as Satoshis, - opportunityCost: 2 as Satoshis, - timePreference: 2 as Satoshis, - impossibleTrinity: 3 as Satoshis, - jevonsParadox: 3 as Satoshis, - powerLaws: 4 as Satoshis, - winnerTakeAll: 5 as Satoshis, - unitBias: 2 as Satoshis, - veblenGood: 2 as Satoshis, - malinvestment: 3 as Satoshis, - asymmetricPayoff: 4 as Satoshis, - ansoffMatrix: 5 as Satoshis, -} as const - export const memoSharingConfig = { memoSharingSatsThreshold: MEMO_SHARING_SATS_THRESHOLD, memoSharingCentsThreshold: MEMO_SHARING_CENTS_THRESHOLD, diff --git a/core/api/src/services/mongoose/accounts.ts b/core/api/src/services/mongoose/accounts.ts index 9db2934410d..00df21cbb82 100644 --- a/core/api/src/services/mongoose/accounts.ts +++ b/core/api/src/services/mongoose/accounts.ts @@ -1,7 +1,6 @@ +import { OnboardingEarn } from "@/app/earn/config" import { parseRepositoryError } from "./utils" -import { OnboardingEarn } from "@/config" - import { AccountStatus } from "@/domain/accounts" import { CouldNotFindAccountError,