Skip to content

Commit

Permalink
chore: more file moving around
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Burtey committed Dec 19, 2023
1 parent 99d5e9e commit eaeb3f2
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 130 deletions.
3 changes: 2 additions & 1 deletion core/api/src/app/earn/add-earn.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { intraledgerPaymentSendWalletIdForBtcWallet } from "../payments/send-intraledger"

import { getRewardsConfig, OnboardingEarn } from "@/config"
import { getRewardsConfig } from "@/config"

import { getBalanceForWallet } from "@/app/wallets"

Expand Down Expand Up @@ -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,
Expand Down
126 changes: 126 additions & 0 deletions core/api/src/app/earn/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// onboarding
export const OnboardingEarn: Record<QuizQuestionId, Satoshis> = {
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
128 changes: 1 addition & 127 deletions core/api/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -81,133 +82,6 @@ export const getLoopConfig = () => {
throw new ConfigError("getLoopConfig() was called though swapEnabled is false")
}

// onboarding
export const OnboardingEarn: Record<QuizQuestionId, Satoshis> = {
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,
Expand Down
3 changes: 1 addition & 2 deletions core/api/src/services/mongoose/accounts.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit eaeb3f2

Please sign in to comment.