├── .env.example ├── .eslintrc.js ├── .github ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── api-dev.yaml │ ├── api-pr.yaml │ └── api-prd.yaml ├── .gitignore ├── .prettierrc ├── .vscode ├── extensions.json └── settings.json ├── Dockerfile ├── LICENSE ├── README.md ├── assets ├── ocp-bitcoin-focus-sticker_de.png ├── ocp-bitcoin-focus-sticker_en.png ├── ocp-bitcoin-focus-sticker_fr.png ├── ocp-bitcoin-focus-sticker_it.png ├── ocp-classic-sticker.png └── ocp_logo.png ├── infrastructure ├── README.md ├── bicep │ ├── btc-node.bicep │ ├── container-apps │ │ ├── README.md │ │ ├── apps │ │ │ ├── deploy.sh │ │ │ ├── main.bicep │ │ │ ├── modules │ │ │ │ ├── containerApp.bicep │ │ │ │ ├── containerAppsEnv.bicep │ │ │ │ └── storage.bicep │ │ │ └── parameters │ │ │ │ ├── dev-dea.json │ │ │ │ ├── dev-ded.json │ │ │ │ ├── dev-dep.json │ │ │ │ ├── dev-fcp.json │ │ │ │ ├── loc-dea.json │ │ │ │ ├── loc-ded.json │ │ │ │ ├── loc-dep.json │ │ │ │ ├── loc-fcp.json │ │ │ │ ├── prd-dea.json │ │ │ │ ├── prd-ded.json │ │ │ │ ├── prd-dep.json │ │ │ │ └── prd-fcp.json │ │ ├── initial │ │ │ ├── deploy.sh │ │ │ ├── main.bicep │ │ │ └── modules │ │ │ │ ├── containerAppsEnv.bicep │ │ │ │ ├── frontdoorWafPolicies.bicep │ │ │ │ └── network.bicep │ │ ├── manualDockerImageUpdate.sh │ │ └── manualFrontdoorSetup.sh │ ├── defi-node.bicep │ ├── dfx-api.bicep │ └── parameters │ │ ├── dev.json │ │ ├── loc.json │ │ └── prd.json ├── config │ ├── btc │ │ └── bitcoin.conf │ ├── docker │ │ ├── docker-compose-bitcoin.yml │ │ ├── docker-compose-frankencoin.yml │ │ ├── docker-compose-monero.yml │ │ └── docker-compose.sh │ ├── lightning │ │ ├── lnbits │ │ │ └── lnbits.env │ │ ├── lnd │ │ │ ├── lnd.conf │ │ │ └── pwd.txt │ │ └── thunderhub │ │ │ ├── accounts.yml │ │ │ └── thunderhub.env │ ├── nginx │ │ └── default.conf │ └── openssl │ │ └── openssl.conf └── scripts │ ├── check-node-state.sh │ ├── nodes.sh │ ├── rpcauth.py │ ├── runBackup-exclude-file.txt │ ├── runBackup.sh │ ├── setupDocker.sh │ ├── setupEnv.sh │ ├── swap-nodes.sh │ └── update-nodes.sh ├── migration ├── 1629931929472-Initial.js ├── 1630442140734-PaymentLogReference.js ├── 1630570422486-buyIndexRefRoute.js ├── 1630752818367-assetChainId.js ├── 1630793510647-chainIdUniqueAndPaymentAccepted.js ├── 1630905170074-acceptedDefaultFalse.js ├── 1631053872391-originValuePayment.js ├── 1631349575897-AddedKycFields.js ├── 1631376454040-AddedBankData.js ├── 1631391307230-UseNvarchar.js ├── 1631406679976-AddedKycCustomerId.js ├── 1631789044326-batch.js ├── 1633031752353-AddedKycTable.js ├── 1633385141530-MoveKycFileRelation.js ├── 1633387539454-UsingKycTable.js ├── 1634018813862-AddedBlockcchainPayment.js ├── 1634505176611-UserUserData.js ├── 1634567460981-RefFee.js ├── 1634755673943-RemoveNameCheck.js ├── 1634776207411-SellUpdate.js ├── 1635290916747-AddedCryptoInputs.js ├── 1636247160807-AddedFiatInputs.js ├── 1636381062249-RenamedToBankTx.js ├── 1638442520666-AddedMainBankData.js ├── 1638523518369-AddedBtcAmount.js ├── 1639995229164-ImprovedSellIndex.js ├── 1640083876365-AddedCompanyInfos.js ├── 1640308644376-AddedCryptoBuys.js ├── 1640624148186-CryptoBuysFix.js ├── 1640790899428-AddedRefFactor.js ├── 1640792213363-AddedVolumes.js ├── 1640871093160-RenamedDates.js ├── 1640956734281-AddedRefCredit.js ├── 1641808941123-assetColsAndCryptoInputUSDT.js ├── 1641998536589-MovedUserData.js ├── 1642065684911-AddedAnnualVolume.js ├── 1642111342005-AddedSpiderData.js ├── 1642166757868-AddedCustomerId.js ├── 1642188863002-AddedSettings.js ├── 1642202974459-AddBanknameBIC.js ├── 1642275049526-FixedSpelling.js ├── 1642707971516-AddedStaking.js ├── 1643030894399-AddedBankCharges.js ├── 1643412054153-AddedStakingAsset.js ├── 1643425957345-AddedCryptoSell.js ├── 1643464750617-AddedBuyStaking.js ├── 1643764925428-AddedMasternode.js ├── 1643904788026-AddedKycStatusChangeDate.js ├── 1644245381979-AddedCfpVotes.js ├── 1644277595687-AddedSecondSpiderUrl.js ├── 1644330803237-RemovedSpiderVersion.js ├── 1644510951347-AddedLimitRequest.js ├── 1644845249891-AdaptedSpiderData.js ├── 1644923304230-AdaptedKycHash.js ├── 1645027900566-UniqueRef.js ├── 1645055031387-MovedCurrencyToUserData.js ├── 1645293088887-AddedRefTables.js ├── 1646056717919-StakingRewardType.js ├── 1646302953368-AddedIndividualBuyFee.js ├── 1646339952425-AddedCryptoInputConfirmation.js ├── 1646661213234-AddedIdentData.js ├── 1646746737427-RenamedIdentId.js ├── 1646754421345-AddedIndividualFees.js ├── 1647250807785-AddedStakingStart.js ├── 1647349398970-AddedUserOrigin.js ├── 1647620456307-apiKeyCT.js ├── 1648038234783-UserDataNotNull.js ├── 1648158906542-StakingTable.js ├── 1648287465315-UserDataRoots.js ├── 1648306118526-AddedMnResignInfos.js ├── 1648518980376-BalancePreparation.js ├── 1648559523365-RenamedIsPayback.js ├── 1648589636157-AddedPaybackDeposit.js ├── 1648658611672-RefactoringBankTxCryptoInputMapping.js ├── 1648694246010-RefactoringReturnBankTx.js ├── 1650105288039-AddSpiderExport.js ├── 1650799366623-buyCrypto.js ├── 1650975087497-removeBankTxReturnCol.js ├── 1650984785735-Added2ndOutTxId.js ├── 1651145926011-newFeeCol.js ├── 1651594286102-AddedAmlCheckToCryptoInput.js ├── 1651730232319-buyColNotNullable.js ├── 1652133330298-AddIpCountry.js ├── 1653065204700-AddedStakingRefRewards.js ├── 1653301377329-newVolumeCols.js ├── 1653675386990-AddIdentPdf.js ├── 1654250762961-AllowIdleMasternodes.js ├── 1654346660483-IpEnable.js ├── 1655213109083-RemovedMnEnable.js ├── 1655213220947-UniqueKycHash.js ├── 1656083888483-addBankAccount.js ├── 1656519269231-indexNameChange.js ├── 1656546677836-extendBicLength.js ├── 1656549565635-bankAccountNotNullable.js ├── 1656577848807-newBuyProcess.js ├── 1657116819290-newMonitoringSystem.js ├── 1657232252222-CryptoRoute.js ├── 1657277336514-SignatureNotUnique.js ├── 1657577348235-AddedBuyFiat.js ├── 1657834977332-AdditionalUserDataFields.js ├── 1657872324388-AddedBuyCryptoChargeback.js ├── 1657999099158-CryptoInput.js ├── 1658047296831-buyFiatCols.js ├── 1658213098316-assetCategorization.js ├── 1658763007658-apiKeyCTUniqueIndex.js ├── 1658842416111-liquidityOrders.js ├── 1659083576871-kycHashToUUID.js ├── 1660657475628-link-address.js ├── 1660729279828-blockchain-info.js ├── 1660735191489-bankAccountPreferrredCurrency.js ├── 1660746952871-userFilterCode.js ├── 1660920470489-ChangedMailSendDateFormat.js ├── 1661433580045-VideoIdRename.js ├── 1661519910674-BankTxChanges.js ├── 1661805067683-AddAba.js ├── 1662077975490-renameAccountNumber.js ├── 1662081355184-addMaerkiBaumannEnable.js ├── 1662719663283-payoutOrders.js ├── 1663343755659-addAmlReason.js ├── 1663859336813-addWalletCols.js ├── 1663921954240-addUserDataCols.js ├── 1663942486233-addLimitRequestCols.js ├── 1664363339859-addFiatBuyableSellableCols.js ├── 1664656167454-addBankTxReturnTable.js ├── 1664663025469-addBankTable.js ├── 1664968683394-addBankTxRepeatTable.js ├── 1664983634440-renameWalletDescription.js ├── 1665408086368-assetChainId.js ├── 1665483618683-addBankTxReturnCols.js ├── 1665486331833-notificationModule.js ├── 1665740859063-amountInColsBankTxReturn.js ├── 1666018992624-limitRequestMail.js ├── 1666088375171-RemoveDfiToken.js ├── 1666094113435-removeUnusedUserFields.js ├── 1666347510059-DepositLimitDefaultNull.js ├── 1666774727290-feesAndAssetReferences.js ├── 1666880270785-AddNullableForwardFeeAmount.js ├── 1668150169114-AddKycType.js ├── 1668435876824-removeUnusedBankDataCols.js ├── 1668501231072-liquidityManagementCore.js ├── 1668509150637-statusInBuyCrypto.js ├── 1668517587302-removeUnusedBuyCryptoCols.js ├── 1668519616316-addCustomKyc.js ├── 1668697486667-newCountryEnableCol.js ├── 1668788080022-newBankTxRepeatCols.js ├── 1668861354398-AddFiatOutput.js ├── 1669043161178-liquidityOrdersRefactoring.js ├── 1669051731231-changeBankTxRepeatUserCol.js ├── 1669279232998-indexLiquidityMgmtRule.js ├── 1669303590842-addLogTable.js ├── 1669716170239-addBuyFiatRefCols.js ├── 1669832431098-AddFeeTier.js ├── 1671067435892-addBankSctInst.js ├── 1671119109834-ExpandFiatOutputTable.js ├── 1671210355232-MovedBankAccountsToUserData.js ├── 1671536749610-nullableFees.js ├── 1672501910578-fiatOutputAmountType.js ├── 1672830459527-bankTxNewFeeCols.js ├── 1673260380636-unique-asset-name.js ├── 1673383602546-AddSortOrder.js ├── 1673444810025-cardano-signature.js ├── 1673605795897-CryptoInputTxType.js ├── 1673907649562-AddIsCompleteFiatOutput.js ├── 1673941417695-bank-account-active.js ├── 1673945356653-UniqueNameNotNull.js ├── 1673962395406-bankTxNewFeeChfCols.js ├── 1674646766576-fiatOutputBankTxChange.js ├── 1674808936701-payInModule.js ├── 1675256828822-lmRulesReactivation.js ├── 1676019359879-payInPurposeNullable.js ├── 1676295102612-payoutOrderIndex.js ├── 1676898596389-cleanupWallet.js ├── 1677015014694-add-ip-logger.js ├── 1677023402003-CryptoInputIndex.js ├── 1677498484244-lmExtension.js ├── 1677621943796-RemovedFiatEnable.js ├── 1677661685147-user-comment.js ├── 1677703052796-ip-log-address.js ├── 1677706598544-ip-log-address-remove.js ├── 1678101398721-buyCryptoFeeExtension.js ├── 1678184308215-user-ref-index.js ├── 1678203329136-liquidityAmountEstimation.js ├── 1678570625764-removeStakingCols.js ├── 1679009222552-addBlackSquadMail.js ├── 1679056644182-addExchangeTx.js ├── 1679407981278-addUserDataCols.js ├── 1679413264247-addExchangeTx.js ├── 1680269985226-DepositAddressesFromSeed.js ├── 1680704008642-AssetPricingMetadata.js ├── 1681301794263-OptionalBankAccountOnBuy.js ├── 1681395711006-buy-fiat-crypto-fee.js ├── 1681738588820-add-transaction-specification.js ├── 1683798078851-WalletAddressNonNull.js ├── 1683930589503-refRewardPayout.js ├── 1684743418738-AssetApproxPrice.js ├── 1685745426886-exchangeTxAddressMax.js ├── 1686139882726-FixedAssetIndex.js ├── 1686151116788-addBuyCryptoChargebackTxId.js ├── 1686668014082-addUserDataIdentificationType.js ├── 1686836193039-addUserDataInternalAmlNote.js ├── 1688069984111-bankDataUserDataNotNullableRelation.js ├── 1688117678089-bankDataIbanIndex.js ├── 1689274956333-addAssetIknaCol.js ├── 1689879272205-addMasterKey.js ├── 1690281913933-addUserDataAmlCols.js ├── 1690971110553-BankDataActiveNullable.js ├── 1691067451904-addCryptoInputReturnMail.js ├── 1691142414745-AddWalletIdentMethod.js ├── 1692364580860-WalletFees.js ├── 1692871401157-BankTxUltimateAddress.js ├── 1694431107346-removeUserCfpVotes.js ├── 1696423782974-AddedCheckoutTx.js ├── 1696902324452-buyCryptoCheckoutTx.js ├── 1698061942628-addFeeTable.js ├── 1698078756376-CheckoutTxExpiresNullable.js ├── 1699010411038-addHigRiskAndAmlAccountType.js ├── 1699279253111-addFeeActive.js ├── 1699464913349-addAddtionalFee.js ├── 1699717429095-addFatfEnable.js ├── 1699975053005-addPayoutRefBonus.js ├── 1700042209571-addMaxTxUsage.js ├── 1700155481772-addKycLog.js ├── 1700237877955-addApiKey.js ├── 1700772785883-addMinTxVolume.js ├── 1701110085106-KycSteps.js ├── 1701424853056-addRelatedUsers.js ├── 1701717309599-kycLog.js ├── 1702166865606-removeUserWalletFee.js ├── 1702308322848-twoFA.js ├── 1702368838915-FiatCardSpec.js ├── 1702387425806-addKycStepsReminderSentDate.js ├── 1702397850900-addDfxAutoEnableCitizenship.js ├── 1702398154376-addVerificationDocumentId.js ├── 1702560534941-addUserApproved.js ├── 1702567551022-addUserDataUniqueIndex.js ├── 1702638521946-CascadeDeleteStepLogs.js ├── 1702649945339-addVerifiedName.js ├── 1702910132205-addBankDataType.js ├── 1702911907152-addUserDataRelation.js ├── 1703043124684-addVerifiedCountry.js ├── 1703085045337-addFeeWallet.js ├── 1703646442636-addUserDataIndex.js ├── 1703805093068-addMaxUserTxUsage.js ├── 1705317913911-LmRuleOneToOne.js ├── 1705329071570-addUserDataBusinessCols.js ├── 1705334216650-removeLegacyCols.js ├── 1705932599781-changeAccountOpenerRelation.js ├── 1706281445442-AccountMerge.js ├── 1706520096880-addOlkypayAllowed.js ├── 1706615639015-addCheckoutEnable.js ├── 1706893942400-addFeeBlockchainFactor.js ├── 1707143190169-PriceRules.js ├── 1707381820806-addFeeMaxAnnualTxVolume.js ├── 1707445735007-removeFeeDirection.js ├── 1707474941775-addUserDataCryptoCryptoAllowed.js ├── 1707566483072-addFeeFiats.js ├── 1707779311833-removeFeeTier.js ├── 1707818694046-FiatInstantEnable.js ├── 1707842967880-bankDataNameNullable.js ├── 1707898032038-PriceRuleReferenceNullable.js ├── 1708419598903-TransactionRequest.js ├── 1708438339667-AssetChfPrice.js ├── 1708443094666-FiatChfPrice.js ├── 1708528000647-addAssetInstantCardCol.js ├── 1708689929273-addWebhookTable.js ├── 1709002783827-addBuyFiatOutputAssetEntity.js ├── 1709043105474-removeBuyFiatOutputAssetStringCol.js ├── 1709053680408-transactionRequestMatchExactPrice.js ├── 1709074419260-addBlockchainFee.js ├── 1709154274442-TxRequestFix.js ├── 1709285328919-addMultiAccountIban.js ├── 1709568743635-renameOutputAssetEntity.js ├── 1709650387730-addSpecialExternalIbanTable.js ├── 1710147158334-checkoutTxApprovedNullable.js ├── 1710171992947-removeCryptoInputReferenceAmounts.js ├── 1710244992687-Trading.js ├── 1710428413363-CardDetails.js ├── 1710429164723-AmlComment.js ├── 1710458972483-addTransactionTable.js ├── 1710508901053-addWalletAmlRule.js ├── 1710862950751-addBlockchainFee.js ├── 1710941322134-renameSpecialExternalAccountTable.js ├── 1710952208059-LimitRequestTextLength.js ├── 1711018262474-changeUserSignatureLength.js ├── 1711103926691-TradingAmountOut.js ├── 1711385162487-addSupportIssueTable.js ├── 1711385233909-AssetCategory.js ├── 1711386769485-addTradingRulePoolFee.js ├── 1712139649720-TransactionRequestFees.js ├── 1712159051309-addNotificationCols.js ├── 1712301393382-changeNotificationCols.js ├── 1712837309998-removeCryptoCryptoAllowed.js ├── 1712912069605-SenderAccount.js ├── 1713784225473-addTransactionMailCol.js ├── 1713784635813-addTransactionUid.js ├── 1713863357521-uniqueTransactionUid.js ├── 1713916293496-optimizeBuyCryptoFee.js ├── 1714134150049-notificationUserData.js ├── 1714983022675-TradingRuleTargets.js ├── 1714993664547-TradingRuleCheckPrice.js ├── 1715009353122-supportMessageTable.js ├── 1715673475995-changeSupportIssueTable.js ├── 1716378941373-addBankDataComment.js ├── 1716379249107-addKycStepComment.js ├── 1716379533490-addPriceSteps.js ├── 1716448529870-LmActionTag.js ├── 1716479348259-SupportIssueUser.js ├── 1716501966588-SupportIssueUserNonNullable.js ├── 1716895506387-TransactionRequestUser.js ├── 1716910408337-TransactionRequestUserNotNull.js ├── 1717159823109-addCountryBankTransactionVerificationEnable.js ├── 1717417655338-WebhookImprovements.js ├── 1717506324942-MultichainDeposits.js ├── 1717511943083-improveWebhookRelations.js ├── 1718282641572-buyCryptoStatusDefault.js ├── 1718311906077-addSiftResponse.js ├── 1718358825622-TransactionRequestCleanup.js ├── 1718370557278-WebhookDataIdentifier.js ├── 1718612157296-RequestToTransaction.js ├── 1718702723340-LiquidityOrderIndex.js ├── 1718803670219-AddPriceDefinitionAllowedDate.js ├── 1718874027084-AddAssetFinancialType.js ├── 1718892189636-SupportIssueInformation.js ├── 1719236716020-AddAmlResponsible.js ├── 1719239340197-SetTransactionNullableFalse.js ├── 1719318163610-AddNetworkStartFeeAmount.js ├── 1719957070772-AddBuyCryptoChargebackIban.js ├── 1720456949278-AddChargebackAllowedDate.js ├── 1720608014547-AddBuyCryptoChargebackOutput.js ├── 1720712636550-TradingExpectedAmount.js ├── 1720789084318-AssetDecimals.js ├── 1720894487055-addIEntitySetting.js ├── 1721121807418-TradingAmountInNullable.js ├── 1721145312353-AddBuyCryptoBuyFiatBankData.js ├── 1721314183039-AddSupportIssueLimitRequestRelation.js ├── 1721646752233-AddDeactivationDate.js ├── 1721648314972-TradingFee.js ├── 1721730420883-AddressLabel.js ├── 1721741056118-PaymentLink.js ├── 1722260156443-LegalEntitySignatoryPower.js ├── 1722587833504-ChangePaymentLinkCryptoInputRelation.js ├── 1722976135849-AccountTypeDefaultNull.js ├── 1723033123342-bankDataManualCheck.js ├── 1723196698943-PaymentRelationsNonNullable.js ├── 1723204471679-PaymentQuote.js ├── 1723313441422-AddChargebackAllowedBy.js ├── 1723809890294-AddPaymentQuoteWebhook.js ├── 1723914432929-AddPaymentLinksName.js ├── 1724053870032-NoPaymentUniqueIndex.js ├── 1724071909790-AddPaymentLinkRecipient.js ├── 1724158978862-AddPaymentTxCount.js ├── 1724243393972-CryptoInputAddChargebackAmountRenameAction.js ├── 1724462452884-BuyFiatChargebackAddress.js ├── 1724831923414-PaymentDevice.js ├── 1725004077486-Sanction.js ├── 1725021580953-UserAddressType.js ├── 1725292202834-BankAccountUserDataNullable.js ├── 1725348870382-HexEndpoint.js ├── 1725896607355-AddRouteTable.js ├── 1725951276293-QuoteActivationLink.js ├── 1725958684942-ActivationStatusRename.js ├── 1725997902507-CryptoInputPaymentQuote.js ├── 1726061526398-RemoveLimitRequestCols.js ├── 1726136380521-WalletsWithDummyAddresses.js ├── 1726223659967-SupportMessageNullable.js ├── 1726241282692-SupportIssueUId.js ├── 1726336625985-AddChargebackCols.js ├── 1726484428228-AddKycLogEventDate.js ├── 1726514387448-SupportIssueUidUnique.js ├── 1726567402949-NoPaymentStandardDefault.js ├── 1726840507343-TradingSwapFee.js ├── 1727073411626-addSymbol3Country.js ├── 1727443350989-MergeReason.js ├── 1727885942716-RenameBankDataCols.js ├── 1728464997390-AddBankDataLabelCurrencyCol.js ├── 1728487950655-PaymentFee.js ├── 1728551171987-AddAssetFiatAmlRule.js ├── 1728909581873-AddAssetFiatAmlRuleFromAmlRuleTo.js ├── 1729019908345-symbol3Unique.js ├── 1729093904453-FeeFinancialType.js ├── 1729153982778-LiquidityManagementNotifications.js ├── 1729588433771-PaymentConfirmation.js ├── 1729938623909-UserDataCTKey.js ├── 1730198374915-AddFeeAmountChfCols.js ├── 1730310677880-AddUserIpLog.js ├── 1730705112313-AddSenderAddresses.js ├── 1730807216547-CollectiveFiatPayouts.js ├── 1731136439777-AddCategoryValidLog.js ├── 1731428656810-buySellBankData.js ├── 1731574551987-countryNationalityStepEnable.js ├── 1731963190430-ChangeSpecialCode.js ├── 1732013545724-KycFiles.js ├── 1732015898509-removeBankAccountBuySell.js ├── 1732580379505-AddMinConfirmation.js ├── 1732636815181-AddCustodyProvider.js ├── 1732808206829-RemoveMasterKeyWallet.js ├── 1733047979126-addTransactionCols.js ├── 1733221494398-removeBankDataUniqueIndex.js ├── 1733327461525-addBankFee.js ├── 1733327830775-addBankTxReturnChargebackCols.js ├── 1733331767293-addCountryTxCols.js ├── 1733762279358-addBankDataActive.js ├── 1733922716978-removeBankAccountUserCols.js ├── 1734357833598-addUserDataAmlListCols.js ├── 1735574957300-addUserDataTransaction.js ├── 1736008113726-addUserDataAmlListStatus.js ├── 1736346664324-addForeignName.js ├── 1736848934721-addUserDataWallet.js ├── 1736952747456-addTransactionRequestUid.js ├── 1737629409528-addTransactionRequestUidUnique.js ├── 1737629605853-UserDataRelationSignatoryOptional.js ├── 1737809090150-UserDataPostAmlCheck.js ├── 1738319166726-KycLogFile.js ├── 1738424022124-SupportIssueAssignCols.js ├── 1738429095584-WalletAddFraudWarning.js ├── 1738595868385-AddBankAmlEnabled.js ├── 1738681331278-FiatOutputReport.js ├── 1739643604085-AddFeeExcludingAssets.js ├── 1739872103563-ChangeWalletAmlRule.js ├── 1739880957294-AddOrganizationTable.js ├── 1739907449972-AddAmountChf.js ├── 1740043761421-ChangeBuyFiatBankTx.js ├── 1740137995169-AddBankTxSenderChargeAmount.js ├── 1740490560669-TravelRulePdf.js ├── 1740558871808-AddCustodyOrder.js ├── 1740757860019-AddCustodyOrderStep.js ├── 1740864893515-RemoveUserDataRiskState.js ├── 1742927582173-AddBuyCryptoLiqPipeline.js ├── 1742992597290-LmOrderOutputAmount.js ├── 1744028086488-AddFeeExcludedUserDatas.js ├── 1744382196177-AddKycLogSynced.js ├── 1745591390587-AddCustodyBalanceTable.js ├── 1746166295428-AddAssetPrices.js ├── 1746739483764-AddUserDataModerator.js ├── 1746783044276-RemoveKycLogSync.js ├── 1747037678344-AddKycFileSubType.js ├── 1747381205530-PaymentLinkLabel.js ├── 1747660336767-AddBankDataDefault.js ├── 1747757193317-AdaptiveLiquidityManagement.js ├── 1748259486840-AddCountryAmlRule.js ├── 1748340316200-AddPaymentLinkStoreInfoCols.js ├── 1748442542239-AddRegistrationNumberUserData.js ├── 1748454754162-AddAssetBank.js ├── 1748614193804-AddTxRequestStatus.js ├── 1749049390753-PaymentNote.js ├── 1749183174663-AddBinancePayColumns.js ├── 1749673095988-AddWalletMailConfig.js ├── 1750087655189-AddLimitRequestAcceptedLimit.js ├── 1750156076191-LiquidityDfxOwned.js ├── 1750404224308-LiquidityLimit.js ├── 1750973273733-AddModeToPaymentLinkTable.js ├── 1751809890624-AddBankDataStatus.js ├── README.md └── generate.sh ├── nest-cli.json ├── package-lock.json ├── package.json ├── rest-client └── dfx-api.http ├── src ├── app.controller.spec.ts ├── app.controller.ts ├── app.module.ts ├── config │ ├── __tests__ │ │ └── config.spec.ts │ ├── config.module.ts │ └── config.ts ├── integration │ ├── alchemy │ │ ├── alchemy-network-mapper.ts │ │ ├── alchemy.module.ts │ │ ├── controllers │ │ │ └── alchemy.controller.ts │ │ ├── dto │ │ │ ├── alchemy-asset-transfers.dto.ts │ │ │ ├── alchemy-create-webhook.dto.ts │ │ │ ├── alchemy-sync-transactions.dto.ts │ │ │ ├── alchemy-transaction.dto.ts │ │ │ ├── alchemy-transaction.mapper.ts │ │ │ └── alchemy-webhook.dto.ts │ │ └── services │ │ │ ├── alchemy-webhook.service.ts │ │ │ └── alchemy.service.ts │ ├── bank │ │ ├── bank.module.ts │ │ └── services │ │ │ ├── iban.service.ts │ │ │ ├── olkypay.service.ts │ │ │ └── revolut.service.ts │ ├── binance-pay │ │ ├── binance-pay.module.ts │ │ ├── dto │ │ │ └── binance.dto.ts │ │ ├── guards │ │ │ └── binance-pay-webhook.guard.ts │ │ └── services │ │ │ └── binance-pay.service.ts │ ├── blockchain │ │ ├── arbitrum │ │ │ ├── arbitrum-client.ts │ │ │ ├── arbitrum.module.ts │ │ │ └── arbitrum.service.ts │ │ ├── arweave │ │ │ ├── arweave.module.ts │ │ │ └── services │ │ │ │ └── arweave.service.ts │ │ ├── base │ │ │ ├── base-client.ts │ │ │ ├── base.module.ts │ │ │ └── base.service.ts │ │ ├── bitcoin │ │ │ ├── bitcoin.module.ts │ │ │ ├── node │ │ │ │ ├── bitcoin-client.ts │ │ │ │ ├── bitcoin.service.ts │ │ │ │ ├── dto │ │ │ │ │ ├── bitcoin-transaction.dto.ts │ │ │ │ │ └── command.dto.ts │ │ │ │ ├── node-client.ts │ │ │ │ └── node.controller.ts │ │ │ └── services │ │ │ │ ├── __tests__ │ │ │ │ └── crypto.service.spec.ts │ │ │ │ └── bitcoin-fee.service.ts │ │ ├── blockchain.module.ts │ │ ├── bsc │ │ │ ├── bsc-client.ts │ │ │ ├── bsc.module.ts │ │ │ └── bsc.service.ts │ │ ├── deuro │ │ │ ├── controllers │ │ │ │ └── deuro.controller.ts │ │ │ ├── deuro-client.ts │ │ │ ├── deuro.module.ts │ │ │ ├── deuro.service.ts │ │ │ └── dto │ │ │ │ └── deuro.dto.ts │ │ ├── ebel2x │ │ │ ├── ebel2x-client.ts │ │ │ ├── ebel2x.module.ts │ │ │ └── ebel2x.service.ts │ │ ├── ethereum │ │ │ ├── ethereum-client.ts │ │ │ ├── ethereum.module.ts │ │ │ └── ethereum.service.ts │ │ ├── frankencoin │ │ │ ├── controllers │ │ │ │ └── frankencoin.controller.ts │ │ │ ├── dto │ │ │ │ └── frankencoin.dto.ts │ │ │ ├── frankencoin-client.ts │ │ │ ├── frankencoin.module.ts │ │ │ └── frankencoin.service.ts │ │ ├── gnosis │ │ │ ├── gnosis-client.ts │ │ │ ├── gnosis.module.ts │ │ │ └── gnosis.service.ts │ │ ├── liquid │ │ │ └── liquid-helper.ts │ │ ├── monero │ │ │ ├── dto │ │ │ │ └── monero.dto.ts │ │ │ ├── monero-client.ts │ │ │ ├── monero-helper.ts │ │ │ ├── monero.module.ts │ │ │ └── services │ │ │ │ └── monero.service.ts │ │ ├── optimism │ │ │ ├── optimism-client.ts │ │ │ ├── optimism.module.ts │ │ │ └── optimism.service.ts │ │ ├── polygon │ │ │ ├── polygon-client.ts │ │ │ ├── polygon.module.ts │ │ │ └── polygon.service.ts │ │ ├── shared │ │ │ ├── __test__ │ │ │ │ └── crypto-service.spec.ts │ │ │ ├── dto │ │ │ │ ├── blockchain-token-balance.dto.ts │ │ │ │ ├── frankencoin-based.dto.ts │ │ │ │ └── signed-transaction-reponse.dto.ts │ │ │ ├── enums │ │ │ │ └── blockchain.enum.ts │ │ │ ├── evm │ │ │ │ ├── abi │ │ │ │ │ ├── erc20.abi.json │ │ │ │ │ ├── frankencoin-equity.abi.json │ │ │ │ │ ├── frankencoin-position.abi.json │ │ │ │ │ ├── frankencoin-stablecoin-bridge.abi.json │ │ │ │ │ ├── frankencoin.abi.json │ │ │ │ │ ├── signature-transfer.abi.json │ │ │ │ │ ├── uniswap-router02.abi.json │ │ │ │ │ └── uniswap-v3-nft-manager.abi.json │ │ │ │ ├── domain │ │ │ │ │ └── wallet-account.ts │ │ │ │ ├── dto │ │ │ │ │ ├── evm-approval.dto.ts │ │ │ │ │ ├── evm-coin-transaction.dto.ts │ │ │ │ │ ├── evm-raw-input-data.dto.ts │ │ │ │ │ ├── evm-raw-transaction.dto.ts │ │ │ │ │ └── evm-token-transaction.dto.ts │ │ │ │ ├── evm-client.ts │ │ │ │ ├── evm-decimals.service.ts │ │ │ │ ├── evm.service.ts │ │ │ │ ├── evm.util.ts │ │ │ │ └── interfaces │ │ │ │ │ └── index.ts │ │ │ ├── frankencoin │ │ │ │ ├── frankencoin-based.dto.ts │ │ │ │ └── frankencoin-based.service.ts │ │ │ ├── services │ │ │ │ ├── blockchain-registry.service.ts │ │ │ │ └── crypto.service.ts │ │ │ └── util │ │ │ │ ├── blockchain-client.ts │ │ │ │ ├── blockchain.service.ts │ │ │ │ └── blockchain.util.ts │ │ └── solana │ │ │ ├── dto │ │ │ └── solana.dto.ts │ │ │ ├── services │ │ │ └── solana.service.ts │ │ │ ├── solana-client.ts │ │ │ ├── solana-wallet.ts │ │ │ ├── solana.module.ts │ │ │ └── solana.util.ts │ ├── checkout │ │ ├── checkout.module.ts │ │ ├── dto │ │ │ └── checkout.dto.ts │ │ └── services │ │ │ └── checkout.service.ts │ ├── exchange │ │ ├── controllers │ │ │ ├── __tests__ │ │ │ │ └── exchange.controller.spec.ts │ │ │ └── exchange.controller.ts │ │ ├── dto │ │ │ ├── __mocks__ │ │ │ │ ├── exchange-tx.entity.mock.ts │ │ │ │ └── price.dto.mock.ts │ │ │ ├── exchange-tx.dto.ts │ │ │ ├── trade-order.dto.ts │ │ │ ├── trade-response.dto.ts │ │ │ ├── trade-result.dto.ts │ │ │ └── withdrawal-order.dto.ts │ │ ├── entities │ │ │ └── exchange-tx.entity.ts │ │ ├── enums │ │ │ └── exchange.enum.ts │ │ ├── exceptions │ │ │ └── trade-changed.exception.ts │ │ ├── exchange.module.ts │ │ ├── mappers │ │ │ └── exchange-tx.mapper.ts │ │ ├── repositories │ │ │ └── exchange-tx.repository.ts │ │ └── services │ │ │ ├── __tests__ │ │ │ ├── exchange.service.spec.ts │ │ │ └── exchange.test.ts │ │ │ ├── binance.service.ts │ │ │ ├── bitstamp.service.ts │ │ │ ├── exchange-registry.service.ts │ │ │ ├── exchange-tx.service.ts │ │ │ ├── exchange.service.ts │ │ │ ├── kraken.service.ts │ │ │ ├── kucoin.service.ts │ │ │ ├── mexc.service.ts │ │ │ ├── p2b.service.ts │ │ │ └── xt.service.ts │ ├── geolocation │ │ ├── geo-location.module.ts │ │ └── geo-location.service.ts │ ├── ikna │ │ ├── controllers │ │ │ └── ikna.controller.ts │ │ ├── dto │ │ │ ├── ikna-address-neighbor.dto.ts │ │ │ ├── ikna-address-tag.dto.ts │ │ │ ├── ikna-query.dto.ts │ │ │ └── ikna-sanction-result.dto.ts │ │ ├── ikna.module.ts │ │ └── services │ │ │ └── ikna.service.ts │ ├── infrastructure │ │ ├── azure-service.ts │ │ └── azure-storage.service.ts │ ├── integration.module.ts │ ├── letter │ │ ├── letter.module.ts │ │ └── letter.service.ts │ ├── lightning │ │ ├── __tests__ │ │ │ └── lightning-helper.spec.ts │ │ ├── dto │ │ │ ├── lnbits-webhook.mapper.ts │ │ │ ├── lnbits.dto.ts │ │ │ ├── lnd.dto.ts │ │ │ ├── lnurlp.dto.ts │ │ │ ├── lnurlw.dto.ts │ │ │ ├── verifymessage-response.dto.ts │ │ │ └── verifymessage.dto.ts │ │ ├── lightning-client.ts │ │ ├── lightning-helper.ts │ │ ├── lightning.module.ts │ │ └── services │ │ │ └── lightning.service.ts │ ├── railgun │ │ ├── railgun.module.ts │ │ └── railgun.service.ts │ ├── sift │ │ ├── dto │ │ │ └── sift.dto.ts │ │ ├── services │ │ │ └── sift.service.ts │ │ └── sift.module.ts │ └── tatum │ │ ├── controllers │ │ └── tatum.controller.ts │ │ ├── dto │ │ ├── tatum-webhook-payload.mapper.ts │ │ └── tatum.dto.ts │ │ ├── services │ │ └── tatum-webhook.service.ts │ │ ├── tatum-network-mapper.ts │ │ └── tatum.module.ts ├── main.ts ├── shared │ ├── auth │ │ ├── get-jwt.decorator.ts │ │ ├── ip-country.guard.ts │ │ ├── ip.guard.ts │ │ ├── jwt-payload.interface.ts │ │ ├── jwt-user-active.guard.ts │ │ ├── jwt.strategy.ts │ │ ├── optional.guard.ts │ │ ├── rate-limit.guard.ts │ │ ├── role.guard.ts │ │ ├── user-active.guard.ts │ │ └── user-role.enum.ts │ ├── dto │ │ ├── advertisement.dto.ts │ │ ├── announcement.dto.ts │ │ ├── entity.dto.ts │ │ ├── error.dto.ts │ │ ├── flag.dto.ts │ │ └── route.dto.ts │ ├── filters │ │ └── exception.filter.ts │ ├── i18n │ │ ├── de │ │ │ ├── invoice.json │ │ │ ├── kyc.json │ │ │ ├── mail.json │ │ │ └── payment.json │ │ ├── en │ │ │ ├── invoice.json │ │ │ ├── kyc.json │ │ │ ├── mail.json │ │ │ └── payment.json │ │ ├── es │ │ │ ├── kyc.json │ │ │ └── mail.json │ │ ├── fr │ │ │ ├── invoice.json │ │ │ ├── kyc.json │ │ │ ├── mail.json │ │ │ └── payment.json │ │ ├── it │ │ │ ├── invoice.json │ │ │ ├── kyc.json │ │ │ ├── mail.json │ │ │ └── payment.json │ │ ├── pt │ │ │ ├── kyc.json │ │ │ └── mail.json │ │ └── sq │ │ │ └── payment.json │ ├── models │ │ ├── active.ts │ │ ├── asset │ │ │ ├── __mocks__ │ │ │ │ └── asset.entity.mock.ts │ │ │ ├── asset.controller.ts │ │ │ ├── asset.entity.ts │ │ │ ├── asset.repository.ts │ │ │ ├── asset.service.spec.ts │ │ │ ├── asset.service.ts │ │ │ └── dto │ │ │ │ ├── asset-dto.mapper.ts │ │ │ │ ├── asset-query.dto.ts │ │ │ │ ├── asset.dto.ts │ │ │ │ └── update-asset.dto.ts │ │ ├── blockchain-address.ts │ │ ├── country │ │ │ ├── __mocks__ │ │ │ │ └── country.entity.mock.ts │ │ │ ├── country.controller.ts │ │ │ ├── country.entity.ts │ │ │ ├── country.repository.ts │ │ │ ├── country.service.ts │ │ │ └── dto │ │ │ │ ├── country-dto.mapper.ts │ │ │ │ └── country.dto.ts │ │ ├── entity.ts │ │ ├── fiat │ │ │ ├── __mocks__ │ │ │ │ └── fiat.entity.mock.ts │ │ │ ├── dto │ │ │ │ ├── fiat-dto.mapper.ts │ │ │ │ └── fiat.dto.ts │ │ │ ├── fiat.controller.ts │ │ │ ├── fiat.entity.ts │ │ │ ├── fiat.repository.ts │ │ │ └── fiat.service.ts │ │ ├── ip-log │ │ │ ├── ip-log.entity.ts │ │ │ ├── ip-log.repository.ts │ │ │ └── ip-log.service.ts │ │ ├── language │ │ │ ├── __mocks__ │ │ │ │ └── language.entity.mock.ts │ │ │ ├── dto │ │ │ │ ├── language-dto.mapper.ts │ │ │ │ └── language.dto.ts │ │ │ ├── language.controller.ts │ │ │ ├── language.entity.ts │ │ │ ├── language.repository.ts │ │ │ └── language.service.ts │ │ ├── reward.entity.ts │ │ └── setting │ │ │ ├── dto │ │ │ ├── custom-sign-up-fees.dto.ts │ │ │ ├── info-banner.dto.ts │ │ │ └── update-process.dto.ts │ │ │ ├── setting.controller.ts │ │ │ ├── setting.entity.ts │ │ │ ├── setting.repository.ts │ │ │ └── setting.service.ts │ ├── repositories │ │ ├── base.repository.ts │ │ ├── cached.repository.ts │ │ └── repository.factory.ts │ ├── services │ │ ├── api-key.service.ts │ │ ├── dfx-cron.service.ts │ │ ├── dfx-logger.ts │ │ ├── ftp.service.ts │ │ ├── http.service.ts │ │ ├── payment-info.service.ts │ │ └── process.service.ts │ ├── shared.module.ts │ ├── utils │ │ ├── __tests__ │ │ │ ├── lock.spec.ts │ │ │ └── util.spec.ts │ │ ├── async-cache.ts │ │ ├── async-map.ts │ │ ├── cron.ts │ │ ├── custom-cron-expression.ts │ │ ├── lock.ts │ │ ├── parallel-queue.ts │ │ ├── queue-handler.ts │ │ ├── test.shared.module.ts │ │ ├── test.util.ts │ │ └── util.ts │ └── validators │ │ └── xor.validator.ts └── subdomains │ ├── core │ ├── aml │ │ ├── aml.module.ts │ │ ├── entities │ │ │ └── sanction.entity.ts │ │ ├── enums │ │ │ ├── aml-error.enum.ts │ │ │ ├── aml-list-status.enum.ts │ │ │ ├── aml-reason.enum.ts │ │ │ ├── aml-rule.enum.ts │ │ │ └── check-status.enum.ts │ │ ├── repositories │ │ │ └── sanction.repository.ts │ │ └── services │ │ │ ├── aml-helper.service.ts │ │ │ ├── aml.service.ts │ │ │ └── sanction.service.ts │ ├── buy-crypto │ │ ├── buy-crypto.module.ts │ │ ├── process │ │ │ ├── buy-crypto.controller.ts │ │ │ ├── dto │ │ │ │ └── update-buy-crypto.dto.ts │ │ │ ├── entities │ │ │ │ ├── __mocks__ │ │ │ │ │ ├── buy-crypto-batch.entity.mock.ts │ │ │ │ │ ├── buy-crypto-fee.entity.mock.ts │ │ │ │ │ └── buy-crypto.entity.mock.ts │ │ │ │ ├── __tests__ │ │ │ │ │ ├── buy-crypto-batch.entity.spec.ts │ │ │ │ │ └── buy-crypto.entity.spec.ts │ │ │ │ ├── buy-crypto-batch.entity.ts │ │ │ │ ├── buy-crypto-fees.entity.ts │ │ │ │ └── buy-crypto.entity.ts │ │ │ ├── exceptions │ │ │ │ └── abort-batch-creation.exception.ts │ │ │ ├── repositories │ │ │ │ ├── buy-crypto-batch.repository.ts │ │ │ │ └── buy-crypto.repository.ts │ │ │ └── services │ │ │ │ ├── __tests__ │ │ │ │ ├── buy-crypto-batch.service.spec.ts │ │ │ │ └── buy-crypto.service.spec.ts │ │ │ │ ├── buy-crypto-batch.service.ts │ │ │ │ ├── buy-crypto-dex.service.ts │ │ │ │ ├── buy-crypto-job.service.ts │ │ │ │ ├── buy-crypto-notification.service.ts │ │ │ │ ├── buy-crypto-out.service.ts │ │ │ │ ├── buy-crypto-preparation.service.ts │ │ │ │ ├── buy-crypto-pricing.service.ts │ │ │ │ ├── buy-crypto-registration.service.ts │ │ │ │ ├── buy-crypto-webhook.service.ts │ │ │ │ └── buy-crypto.service.ts │ │ └── routes │ │ │ ├── buy │ │ │ ├── __mocks__ │ │ │ │ └── buy.entity.mock.ts │ │ │ ├── __tests__ │ │ │ │ ├── buy.controller.spec.ts │ │ │ │ └── buy.service.spec.ts │ │ │ ├── buy.controller.ts │ │ │ ├── buy.entity.ts │ │ │ ├── buy.repository.ts │ │ │ ├── buy.service.ts │ │ │ └── dto │ │ │ │ ├── __mocks__ │ │ │ │ └── buy-history.dto.mock.ts │ │ │ │ ├── buy-history.dto.ts │ │ │ │ ├── buy-payment-info.dto.ts │ │ │ │ ├── buy-quote.dto.ts │ │ │ │ ├── buy.dto.ts │ │ │ │ ├── create-buy.dto.ts │ │ │ │ ├── get-buy-payment-info.dto.ts │ │ │ │ ├── get-buy-quote.dto.ts │ │ │ │ ├── pdf.dto.ts │ │ │ │ └── update-buy.dto.ts │ │ │ └── swap │ │ │ ├── __mocks__ │ │ │ └── crypto-route.entity.mock.ts │ │ │ ├── __tests__ │ │ │ └── crypto-route.controller.spec.ts │ │ │ ├── crypto-route.controller.ts │ │ │ ├── dto │ │ │ ├── create-swap.dto.ts │ │ │ ├── get-swap-payment-info.dto.ts │ │ │ ├── get-swap-quote.dto.ts │ │ │ ├── swap-payment-info.dto.ts │ │ │ ├── swap-quote.dto.ts │ │ │ ├── swap.dto.ts │ │ │ └── update-swap.dto.ts │ │ │ ├── swap.controller.ts │ │ │ ├── swap.entity.ts │ │ │ ├── swap.repository.ts │ │ │ └── swap.service.ts │ ├── core.module.ts │ ├── custody │ │ ├── adapter │ │ │ └── dfx-order-step.adapter.ts │ │ ├── config │ │ │ └── order-config.ts │ │ ├── controllers │ │ │ └── custody.controller.ts │ │ ├── custody.module.ts │ │ ├── dto │ │ │ ├── input │ │ │ │ ├── create-custody-account.dto.ts │ │ │ │ ├── create-custody-order.dto.ts │ │ │ │ ├── get-custody-info.dto.ts │ │ │ │ └── update-custody-order.dto.ts │ │ │ └── output │ │ │ │ ├── custody-auth.dto.ts │ │ │ │ ├── custody-balance.dto.ts │ │ │ │ ├── custody-order-response.dto.ts │ │ │ │ └── custody-order.dto.ts │ │ ├── entities │ │ │ ├── custody-balance.entity.ts │ │ │ ├── custody-order-step.entity.ts │ │ │ └── custody-order.entity.ts │ │ ├── enums │ │ │ └── custody.ts │ │ ├── mappers │ │ │ ├── custody-asset-balance-dto.mapper.ts │ │ │ ├── custody-order-response-dto.mapper.ts │ │ │ └── get-custody-order-dto.mapper.ts │ │ ├── repositories │ │ │ ├── custody-balance.repository.ts │ │ │ ├── custody-order-step.repository.ts │ │ │ └── custody-order.repository.ts │ │ └── services │ │ │ ├── custody-job.service.ts │ │ │ ├── custody-order.service.ts │ │ │ └── custody.service.ts │ ├── history │ │ ├── __tests__ │ │ │ ├── transaction-helper.spec.ts │ │ │ └── transaction.controller.spec.ts │ │ ├── controllers │ │ │ ├── history.controller.ts │ │ │ ├── transaction-admin.controller.ts │ │ │ └── transaction.controller.ts │ │ ├── dto │ │ │ ├── __mocks__ │ │ │ │ └── history.dto.mock.ts │ │ │ ├── history-filter.dto.ts │ │ │ ├── history-query.dto.ts │ │ │ ├── history.dto.ts │ │ │ ├── output │ │ │ │ ├── chain-report-history.dto.ts │ │ │ │ └── coin-tracking-history.dto.ts │ │ │ ├── refund-data.dto.ts │ │ │ ├── refund-internal.dto.ts │ │ │ ├── transaction-filter.dto.ts │ │ │ ├── transaction-refund.dto.ts │ │ │ └── update-transaction.dto.ts │ │ ├── history.module.ts │ │ ├── mappers │ │ │ ├── chain-report-history-dto.mapper.ts │ │ │ ├── coin-tracking-history-dto.mapper.ts │ │ │ └── transaction-dto.mapper.ts │ │ └── services │ │ │ └── history.service.ts │ ├── liquidity-management │ │ ├── __mocks__ │ │ │ └── liquidity-balance.entity.mock.ts │ │ ├── adapters │ │ │ ├── actions │ │ │ │ ├── arbitrum-l2-bridge.adapter.ts │ │ │ │ ├── base-l2-bridge.adapter.ts │ │ │ │ ├── base │ │ │ │ │ ├── ccxt-exchange.adapter.ts │ │ │ │ │ ├── evm-l2-bridge.adapter.ts │ │ │ │ │ ├── frankencoin-based.adapter.ts │ │ │ │ │ └── liquidity-action.adapter.ts │ │ │ │ ├── binance.adapter.ts │ │ │ │ ├── deuro.adapter.ts │ │ │ │ ├── dfx-dex.adapter.ts │ │ │ │ ├── frankencoin.adapter.ts │ │ │ │ ├── kraken.adapter.ts │ │ │ │ ├── liquidity-pipeline.adapter.ts │ │ │ │ ├── optimism-l2-bridge.adapter.ts │ │ │ │ └── polygon-l2-bridge.adapter.ts │ │ │ └── balances │ │ │ │ ├── bank.adapter.ts │ │ │ │ ├── blockchain.adapter.ts │ │ │ │ └── exchange.adapter.ts │ │ ├── controllers │ │ │ ├── balance.controller.ts │ │ │ ├── order.controller.ts │ │ │ ├── pipeline.controller.ts │ │ │ └── rule.controller.ts │ │ ├── dto │ │ │ ├── input │ │ │ │ ├── liquidity-management-action.dto.ts │ │ │ │ ├── liquidity-management-request.dto.ts │ │ │ │ ├── liquidity-management-rule-creation.dto.ts │ │ │ │ ├── liquidity-management-settings.dto.ts │ │ │ │ └── liquidity-management-update.dto.ts │ │ │ └── output │ │ │ │ ├── liquidity-management-rule-output.dto.ts │ │ │ │ └── mappers │ │ │ │ └── liquidity-management-rule-output-dto.mapper.ts │ │ ├── entities │ │ │ ├── liquidity-balance.entity.ts │ │ │ ├── liquidity-management-action.entity.ts │ │ │ ├── liquidity-management-order.entity.ts │ │ │ ├── liquidity-management-pipeline.entity.ts │ │ │ └── liquidity-management-rule.entity.ts │ │ ├── enums │ │ │ └── index.ts │ │ ├── exceptions │ │ │ ├── order-failed.exception.ts │ │ │ ├── order-not-necessary.exception.ts │ │ │ └── order-not-processable.exception.ts │ │ ├── factories │ │ │ ├── liquidity-action-integration.factory.ts │ │ │ ├── liquidity-balance-integration.factory.ts │ │ │ └── liquidity-management-rule.factory.ts │ │ ├── interfaces │ │ │ └── index.ts │ │ ├── liquidity-management.module.ts │ │ ├── repositories │ │ │ ├── liquidity-balance.repository.ts │ │ │ ├── liquidity-management-action.repository.ts │ │ │ ├── liquidity-management-order.repository.ts │ │ │ ├── liquidity-management-pipeline.repository.ts │ │ │ └── liquidity-management-rule.repository.ts │ │ ├── services │ │ │ ├── liquidity-management-balance.service.ts │ │ │ ├── liquidity-management-pipeline.service.ts │ │ │ ├── liquidity-management-rule.service.ts │ │ │ └── liquidity-management.service.ts │ │ ├── specifications │ │ │ └── liquidity-management-rule-init.specification.ts │ │ └── validators │ │ │ ├── liquidity-actions-all-steps-match.validator.ts │ │ │ ├── liquidity-actions-first-step.validator.ts │ │ │ └── liquidity-actions-no-duplicate-steps.validator.ts │ ├── monitoring │ │ ├── metric.observer.ts │ │ ├── monitor-connection-pool.service.ts │ │ ├── monitoring.controller.ts │ │ ├── monitoring.module.ts │ │ ├── monitoring.service.ts │ │ ├── observers │ │ │ ├── aml.observer.ts │ │ │ ├── bank.observer.ts │ │ │ ├── banking-bot.observer.ts │ │ │ ├── checkout.observer.ts │ │ │ ├── exchange.observer.ts │ │ │ ├── external-services.observer.ts │ │ │ ├── liquidity.observer.ts │ │ │ ├── node-balance.observer.ts │ │ │ ├── node-health.observer.ts │ │ │ ├── payment.observer.ts │ │ │ └── user.observer.ts │ │ ├── system-state-snapshot.entity.ts │ │ └── system-state-snapshot.repository.ts │ ├── payment-link │ │ ├── controllers │ │ │ ├── c2b-payment-link.controller.ts │ │ │ ├── payment-link.controller.ts │ │ │ └── payment-link.gateway.ts │ │ ├── dto │ │ │ ├── create-invoice-payment.dto.ts │ │ │ ├── create-payment-link-payment.dto.ts │ │ │ ├── create-payment-link.dto.ts │ │ │ ├── get-payment-link-history.dto.ts │ │ │ ├── payment-link-config.dto.ts │ │ │ ├── payment-link-dto.mapper.ts │ │ │ ├── payment-link-recipient-address.dto.ts │ │ │ ├── payment-link-recipient.dto.ts │ │ │ ├── payment-link.dto.ts │ │ │ ├── payment-recipient-mapper.ts │ │ │ ├── payment-recipient.dto.ts │ │ │ ├── payment-request.mapper.ts │ │ │ ├── update-payment-link-payment.dto.ts │ │ │ └── update-payment-link.dto.ts │ │ ├── entities │ │ │ ├── payment-activation.entity.ts │ │ │ ├── payment-link-payment.entity.ts │ │ │ ├── payment-link.config.ts │ │ │ ├── payment-link.entity.ts │ │ │ └── payment-quote.entity.ts │ │ ├── enums │ │ │ └── index.ts │ │ ├── guards │ │ │ └── jwt-or-payment-link-key.guard.ts │ │ ├── payment-link-payment.module.ts │ │ ├── payment-link.module.ts │ │ ├── repositories │ │ │ ├── payment-activation.repository.ts │ │ │ ├── payment-link-payment.repository.ts │ │ │ ├── payment-link.repository.ts │ │ │ └── payment-quote.repository.ts │ │ ├── services │ │ │ ├── c2b-payment-link.service.ts │ │ │ ├── ocp-sticker.service.ts │ │ │ ├── payment-activation.service.ts │ │ │ ├── payment-cron.service.ts │ │ │ ├── payment-link-fee.service.ts │ │ │ ├── payment-link-payment.service.ts │ │ │ ├── payment-link.service.ts │ │ │ ├── payment-quote.service.ts │ │ │ └── payment-webhook.service.ts │ │ └── share │ │ │ └── c2b-payment-link.provider.ts │ ├── referral │ │ ├── process │ │ │ ├── ref.controller.ts │ │ │ ├── ref.entity.ts │ │ │ ├── ref.repository.ts │ │ │ └── ref.service.ts │ │ ├── referral.module.ts │ │ └── reward │ │ │ ├── dto │ │ │ └── update-ref-reward.dto.ts │ │ │ ├── ref-reward.controller.ts │ │ │ ├── ref-reward.entity.ts │ │ │ ├── ref-reward.repository.ts │ │ │ └── services │ │ │ ├── ref-reward-dex.service.ts │ │ │ ├── ref-reward-job.service.ts │ │ │ ├── ref-reward-notification.service.ts │ │ │ ├── ref-reward-out.service.ts │ │ │ └── ref-reward.service.ts │ ├── route │ │ ├── dto │ │ │ ├── create-route.dto.ts │ │ │ └── update-route.dto.ts │ │ ├── route.controller.ts │ │ ├── route.entity.ts │ │ ├── route.module.ts │ │ ├── route.repository.ts │ │ └── route.service.ts │ ├── sell-crypto │ │ ├── process │ │ │ ├── __mocks__ │ │ │ │ └── buy-fiat.entity.mock.ts │ │ │ ├── __tests__ │ │ │ │ └── buy-fiat.service.spec.ts │ │ │ ├── buy-fiat.controller.ts │ │ │ ├── buy-fiat.entity.ts │ │ │ ├── buy-fiat.repository.ts │ │ │ ├── dto │ │ │ │ └── update-buy-fiat.dto.ts │ │ │ └── services │ │ │ │ ├── buy-fiat-job.service.ts │ │ │ │ ├── buy-fiat-notification.service.ts │ │ │ │ ├── buy-fiat-preparation.service.ts │ │ │ │ ├── buy-fiat-registration.service.ts │ │ │ │ └── buy-fiat.service.ts │ │ ├── route │ │ │ ├── __mocks__ │ │ │ │ └── sell.entity.mock.ts │ │ │ ├── __tests__ │ │ │ │ └── sell.controller.spec.ts │ │ │ ├── dto │ │ │ │ ├── __mocks__ │ │ │ │ │ └── sell-history.dto.mock.ts │ │ │ │ ├── confirm.dto.ts │ │ │ │ ├── create-sell.dto.ts │ │ │ │ ├── get-sell-payment-info.dto.ts │ │ │ │ ├── get-sell-quote.dto.ts │ │ │ │ ├── sell-history.dto.ts │ │ │ │ ├── sell-payment-info.dto.ts │ │ │ │ ├── sell-quote.dto.ts │ │ │ │ ├── sell.dto.ts │ │ │ │ └── update-sell.dto.ts │ │ │ ├── sell.controller.ts │ │ │ ├── sell.entity.ts │ │ │ ├── sell.repository.ts │ │ │ └── sell.service.ts │ │ └── sell-crypto.module.ts │ ├── staking │ │ ├── entities │ │ │ ├── crypto-staking.entity.ts │ │ │ ├── staking-ref-reward.entity.ts │ │ │ ├── staking-reward.entity.ts │ │ │ └── staking.entity.ts │ │ ├── repositories │ │ │ ├── crypto-staking.repository.ts │ │ │ ├── staking-ref-reward.repository.ts │ │ │ ├── staking-reward.repository.ts │ │ │ └── staking.repository.ts │ │ ├── services │ │ │ └── staking.service.ts │ │ └── staking.module.ts │ ├── statistic │ │ ├── dto │ │ │ └── statistic.dto.ts │ │ ├── statistic.controller.ts │ │ ├── statistic.module.ts │ │ └── statistic.service.ts │ ├── trading │ │ ├── controllers │ │ │ └── trading-rule.controller.ts │ │ ├── dto │ │ │ ├── trading.dto.ts │ │ │ └── update-trading-rule.dto.ts │ │ ├── entities │ │ │ ├── trading-order.entity.ts │ │ │ └── trading-rule.entity.ts │ │ ├── enums │ │ │ └── index.ts │ │ ├── exceptions │ │ │ └── waiting-for-liquidity.exception.ts │ │ ├── repositories │ │ │ ├── trading-order.respository.ts │ │ │ └── trading-rule.respository.ts │ │ ├── services │ │ │ ├── trading-job.service.ts │ │ │ ├── trading-order.service.ts │ │ │ ├── trading-rule.service.ts │ │ │ └── trading.service.ts │ │ └── trading.module.ts │ └── transaction │ │ ├── transaction-util.module.ts │ │ └── transaction-util.service.ts │ ├── generic │ ├── admin │ │ ├── admin.controller.ts │ │ ├── admin.module.ts │ │ ├── admin.service.ts │ │ └── dto │ │ │ ├── payout-request.dto.ts │ │ │ ├── send-letter.dto.ts │ │ │ └── send-mail.dto.ts │ ├── forwarding │ │ ├── controllers │ │ │ ├── __tests__ │ │ │ │ └── lnurl-forward.spec.ts │ │ │ ├── lnurld-forward.controller.ts │ │ │ ├── lnurlp-forward.controller.ts │ │ │ ├── lnurlw-forward.controller.ts │ │ │ └── payment-forward.controller.ts │ │ ├── dto │ │ │ ├── __mocks__ │ │ │ │ ├── lnurlp.dto.mock.ts │ │ │ │ └── lnurlw.dto.mock.ts │ │ │ └── payment.dto.ts │ │ ├── forwarding.module.ts │ │ └── services │ │ │ └── lnurl-forward.service.ts │ ├── generic.module.ts │ ├── gs │ │ ├── dto │ │ │ ├── db-query.dto.ts │ │ │ └── support-data.dto.ts │ │ ├── gs-evm.controller.ts │ │ ├── gs-evm.service.ts │ │ ├── gs.controller.ts │ │ ├── gs.module.ts │ │ └── gs.service.ts │ ├── kyc │ │ ├── config │ │ │ └── financial-questions.ts │ │ ├── controllers │ │ │ ├── kyc-admin.controller.ts │ │ │ ├── kyc-client.controller.ts │ │ │ └── kyc.controller.ts │ │ ├── dto │ │ │ ├── ident-result-data.dto.ts │ │ │ ├── ident-result.dto.ts │ │ │ ├── ident.dto.ts │ │ │ ├── input │ │ │ │ ├── create-kyc-log.dto.ts │ │ │ │ ├── dilisense-data.dto.ts │ │ │ │ ├── kyc-data.dto.ts │ │ │ │ ├── kyc-financial-in.dto.ts │ │ │ │ ├── start-2fa.dto.ts │ │ │ │ ├── update-kyc-step.dto.ts │ │ │ │ ├── update-name-check-log.dto.ts │ │ │ │ └── verify-2fa.dto.ts │ │ │ ├── kyc-error.enum.ts │ │ │ ├── kyc-file.dto.ts │ │ │ ├── kyc-webhook-trigger.dto.ts │ │ │ ├── manual-ident-result.dto.ts │ │ │ ├── mapper │ │ │ │ ├── kyc-file.mapper.ts │ │ │ │ ├── kyc-info.mapper.ts │ │ │ │ └── kyc-step.mapper.ts │ │ │ ├── output │ │ │ │ ├── kyc-financial-out.dto.ts │ │ │ │ ├── kyc-info.dto.ts │ │ │ │ ├── kyc-merged.dto.ts │ │ │ │ └── setup-2fa.dto.ts │ │ │ └── sum-sub.dto.ts │ │ ├── entities │ │ │ ├── kyc-file-log.entity.ts │ │ │ ├── kyc-file.entity.ts │ │ │ ├── kyc-log.entity.ts │ │ │ ├── kyc-step.entity.ts │ │ │ ├── mail-change-log.entity.ts │ │ │ ├── manual-log.entity.ts │ │ │ ├── merge-log.entity.ts │ │ │ ├── name-check-log.entity.ts │ │ │ ├── step-log.entity.ts │ │ │ └── totp-auth-log.entity.ts │ │ ├── enums │ │ │ ├── content-type.enum.ts │ │ │ ├── file-category.enum.ts │ │ │ ├── kyc-step-name.enum.ts │ │ │ ├── kyc.enum.ts │ │ │ └── review-status.enum.ts │ │ ├── kyc.module.ts │ │ ├── repositories │ │ │ ├── kyc-file.repository.ts │ │ │ ├── kyc-log.repository.ts │ │ │ ├── kyc-step.repository.ts │ │ │ ├── name-check-log.repository.ts │ │ │ ├── step-log.repository.ts │ │ │ └── tfa-log.repository.ts │ │ └── services │ │ │ ├── integration │ │ │ ├── dilisense.service.ts │ │ │ ├── financial.service.ts │ │ │ ├── ident.service.ts │ │ │ ├── kyc-document.service.ts │ │ │ └── sum-sub.service.ts │ │ │ ├── kyc-admin.service.ts │ │ │ ├── kyc-client.service.ts │ │ │ ├── kyc-file.service.ts │ │ │ ├── kyc-log.service.ts │ │ │ ├── kyc-notification.service.ts │ │ │ ├── kyc.service.ts │ │ │ ├── name-check.service.ts │ │ │ └── tfa.service.ts │ └── user │ │ ├── models │ │ ├── account-merge │ │ │ ├── account-merge.entity.ts │ │ │ ├── account-merge.repository.ts │ │ │ └── account-merge.service.ts │ │ ├── auth │ │ │ ├── __tests__ │ │ │ │ └── lnurl-auth.spec.ts │ │ │ ├── auth-alby.service.ts │ │ │ ├── auth-lnurl.controller.ts │ │ │ ├── auth-lnurl.service.ts │ │ │ ├── auth.controller.ts │ │ │ ├── auth.service.ts │ │ │ └── dto │ │ │ │ ├── auth-credentials.dto.ts │ │ │ │ ├── auth-lnurl.dto.ts │ │ │ │ ├── auth-mail.dto.ts │ │ │ │ ├── auth-response.dto.ts │ │ │ │ ├── challenge.dto.ts │ │ │ │ ├── merge-response.dto.ts │ │ │ │ ├── redirect-response.dto.ts │ │ │ │ ├── sign-message.dto.ts │ │ │ │ └── verify-sign-message.dto.ts │ │ ├── bank-data │ │ │ ├── bank-data.controller.ts │ │ │ ├── bank-data.entity.ts │ │ │ ├── bank-data.repository.ts │ │ │ ├── bank-data.service.ts │ │ │ └── dto │ │ │ │ ├── create-bank-data.dto.ts │ │ │ │ └── update-bank-data.dto.ts │ │ ├── custody-provider │ │ │ ├── __mocks__ │ │ │ │ └── custody-provider.entity.mock.ts │ │ │ ├── custody-provider.controller.ts │ │ │ ├── custody-provider.entity.ts │ │ │ ├── custody-provider.repository.ts │ │ │ ├── custody-provider.service.ts │ │ │ └── dto │ │ │ │ └── custody-provider.dto.ts │ │ ├── kyc │ │ │ ├── dto │ │ │ │ ├── kyc-data-transfer.dto.ts │ │ │ │ ├── kyc-data.dto.ts │ │ │ │ ├── kyc-file.dto.ts │ │ │ │ └── kyc-info.dto.ts │ │ │ ├── kyc.controller.ts │ │ │ └── kyc.service.ts │ │ ├── organization │ │ │ ├── dto │ │ │ │ └── organization.dto.ts │ │ │ ├── organization.entity.ts │ │ │ ├── organization.repository.ts │ │ │ └── organization.service.ts │ │ ├── user-data-relation │ │ │ ├── dto │ │ │ │ ├── create-user-data-relation.dto.ts │ │ │ │ ├── update-user-data-relation.dto.ts │ │ │ │ └── user-data-relation.enum.ts │ │ │ ├── user-data-relation.controller.ts │ │ │ ├── user-data-relation.entity.ts │ │ │ ├── user-data-relation.repository.ts │ │ │ └── user-data-relation.service.ts │ │ ├── user-data │ │ │ ├── __mocks__ │ │ │ │ └── user-data.entity.mock.ts │ │ │ ├── account-type.enum.ts │ │ │ ├── dto │ │ │ │ ├── create-user-data.dto.ts │ │ │ │ ├── update-user-data.dto.ts │ │ │ │ └── upload-file.dto.ts │ │ │ ├── is-dfx-phone.validator.ts │ │ │ ├── kyc-identification-type.enum.ts │ │ │ ├── user-data-job.service.ts │ │ │ ├── user-data-notification.service.ts │ │ │ ├── user-data.controller.ts │ │ │ ├── user-data.entity.ts │ │ │ ├── user-data.repository.ts │ │ │ └── user-data.service.ts │ │ ├── user │ │ │ ├── __mocks__ │ │ │ │ └── user.entity.mock.ts │ │ │ ├── dto │ │ │ │ ├── alby.dto.ts │ │ │ │ ├── api-key.dto.ts │ │ │ │ ├── download-user-data.dto.ts │ │ │ │ ├── linked-user.dto.ts │ │ │ │ ├── ref-info-query.dto.ts │ │ │ │ ├── update-address.dto.ts │ │ │ │ ├── update-user-admin.dto.ts │ │ │ │ ├── update-user.dto.ts │ │ │ │ ├── user-dto.mapper.ts │ │ │ │ ├── user-name.dto.ts │ │ │ │ ├── user-v2.dto.ts │ │ │ │ ├── user.dto.ts │ │ │ │ ├── verify-mail.dto.ts │ │ │ │ └── volume-query.dto.ts │ │ │ ├── tests │ │ │ │ └── user.service.spec.ts │ │ │ ├── user-job.service.ts │ │ │ ├── user.controller.ts │ │ │ ├── user.entity.ts │ │ │ ├── user.repository.ts │ │ │ └── user.service.ts │ │ └── wallet │ │ │ ├── __mocks__ │ │ │ └── wallet.entity.mock.ts │ │ │ ├── dto │ │ │ └── wallet.dto.ts │ │ │ ├── wallet.controller.ts │ │ │ ├── wallet.entity.ts │ │ │ ├── wallet.repository.ts │ │ │ └── wallet.service.ts │ │ ├── services │ │ └── webhook │ │ │ ├── dto │ │ │ ├── account-changed-webhook.dto.ts │ │ │ ├── create-webhook.dto.ts │ │ │ ├── kyc-webhook.dto.ts │ │ │ ├── payment-webhook.dto.ts │ │ │ └── webhook.dto.ts │ │ │ ├── mapper │ │ │ └── webhook-data.mapper.ts │ │ │ ├── webhook-notification.service.ts │ │ │ ├── webhook.entity.ts │ │ │ ├── webhook.repository.ts │ │ │ └── webhook.service.ts │ │ └── user.module.ts │ ├── subdomains.module.ts │ └── supporting │ ├── address-pool │ ├── address-pool.module.ts │ ├── deposit │ │ ├── __mocks__ │ │ │ └── deposit.entity.mock.ts │ │ ├── deposit.controller.ts │ │ ├── deposit.entity.ts │ │ ├── deposit.repository.ts │ │ ├── deposit.service.ts │ │ └── dto │ │ │ ├── create-deposit.dto.ts │ │ │ ├── deposit-dto.mapper.ts │ │ │ └── deposit.dto.ts │ └── route │ │ ├── deposit-route.entity.ts │ │ └── deposit-route.repository.ts │ ├── bank-tx │ ├── bank-tx-repeat │ │ ├── bank-tx-repeat.controller.ts │ │ ├── bank-tx-repeat.entity.ts │ │ ├── bank-tx-repeat.repository.ts │ │ ├── bank-tx-repeat.service.ts │ │ └── dto │ │ │ └── update-bank-tx-repeat.dto.ts │ ├── bank-tx-return │ │ ├── bank-tx-return.controller.ts │ │ ├── bank-tx-return.entity.ts │ │ ├── bank-tx-return.repository.ts │ │ ├── bank-tx-return.service.ts │ │ └── dto │ │ │ └── update-bank-tx-return.dto.ts │ ├── bank-tx.module.ts │ └── bank-tx │ │ ├── __mocks__ │ │ ├── bank-tx-batch.entity.mock.ts │ │ └── bank-tx.entity.mock.ts │ │ ├── __tests__ │ │ └── bank-tx.entity.spec.ts │ │ ├── bank-tx.controller.ts │ │ ├── dto │ │ ├── sepa-entry.dto.ts │ │ ├── sepa-file.dto.ts │ │ ├── sepa.dto.ts │ │ └── update-bank-tx.dto.ts │ │ ├── entities │ │ ├── bank-tx-batch.entity.ts │ │ └── bank-tx.entity.ts │ │ ├── repositories │ │ ├── bank-tx-batch.repository.ts │ │ └── bank-tx.repository.ts │ │ └── services │ │ ├── bank-tx-batch.service.ts │ │ ├── bank-tx.service.ts │ │ └── sepa-parser.service.ts │ ├── bank │ ├── bank-account │ │ ├── __mocks__ │ │ │ └── bank-account.entity.mock.ts │ │ ├── bank-account.controller.ts │ │ ├── bank-account.entity.ts │ │ ├── bank-account.repository.ts │ │ ├── bank-account.service.ts │ │ ├── dto │ │ │ ├── bank-account.dto.ts │ │ │ ├── create-bank-account.dto.ts │ │ │ └── update-bank-account.dto.ts │ │ └── is-dfx-iban.validator.ts │ ├── bank.module.ts │ └── bank │ │ ├── __mocks__ │ │ └── bank.entity.mock.ts │ │ ├── __tests__ │ │ └── bank.service.spec.ts │ │ ├── bank.controller.ts │ │ ├── bank.entity.ts │ │ ├── bank.repository.ts │ │ ├── bank.service.ts │ │ └── dto │ │ ├── bank.dto.ts │ │ └── bank.mapper.ts │ ├── common │ └── strategy-registry.ts │ ├── dex │ ├── dex.controller.ts │ ├── dex.module.ts │ ├── docs │ │ ├── DEX_Module.drawio │ │ └── DEX_Module.jpg │ ├── entities │ │ ├── __mocks__ │ │ │ └── liquidity-order.entity.mock.ts │ │ ├── __tests__ │ │ │ └── liquidity-order.entity.spec.ts │ │ └── liquidity-order.entity.ts │ ├── exceptions │ │ ├── liquidity-order-not-ready.exception.ts │ │ ├── not-enough-liquidity.exception.ts │ │ ├── price-slippage.exception.ts │ │ ├── transaction-not-found.exception.ts │ │ └── transfer-not-required.exception.ts │ ├── factories │ │ ├── __tests__ │ │ │ └── liquidity-order.factory.spec.ts │ │ └── liquidity-order.factory.ts │ ├── interfaces │ │ ├── __mocks__ │ │ │ └── liquidity-request.mock.ts │ │ └── index.ts │ ├── repositories │ │ └── liquidity-order.repository.ts │ ├── services │ │ ├── base │ │ │ └── dex-evm.service.ts │ │ ├── dex-arbitrum.service.ts │ │ ├── dex-base.service.ts │ │ ├── dex-bitcoin.service.ts │ │ ├── dex-bsc.service.ts │ │ ├── dex-ethereum.service.ts │ │ ├── dex-gnosis.service.ts │ │ ├── dex-lightning.service.ts │ │ ├── dex-monero.service.ts │ │ ├── dex-optimism.service.ts │ │ ├── dex-polygon.service.ts │ │ ├── dex-solana.service.ts │ │ └── dex.service.ts │ ├── strategies │ │ ├── check-liquidity │ │ │ ├── __tests__ │ │ │ │ └── check-liquidity.registry.spec.ts │ │ │ ├── impl │ │ │ │ ├── arbitrum-coin.strategy.ts │ │ │ │ ├── arbitrum-token.strategy.ts │ │ │ │ ├── base-coin.strategy.ts │ │ │ │ ├── base-token.strategy.ts │ │ │ │ ├── base │ │ │ │ │ ├── check-liquidity.strategy-registry.ts │ │ │ │ │ ├── check-liquidity.strategy.ts │ │ │ │ │ ├── evm-coin.strategy.ts │ │ │ │ │ └── evm-token.strategy.ts │ │ │ │ ├── bitcoin.strategy.ts │ │ │ │ ├── bsc-coin.strategy.ts │ │ │ │ ├── bsc-token.strategy.ts │ │ │ │ ├── ethereum-coin.strategy.ts │ │ │ │ ├── ethereum-token.strategy.ts │ │ │ │ ├── gnosis-coin.strategy.ts │ │ │ │ ├── gnosis-token.strategy.ts │ │ │ │ ├── lightning.strategy.ts │ │ │ │ ├── monero.strategy.ts │ │ │ │ ├── optimism-coin.strategy.ts │ │ │ │ ├── optimism-token.strategy.ts │ │ │ │ ├── polygon-coin.strategy.ts │ │ │ │ ├── polygon-token.strategy.ts │ │ │ │ ├── solana-coin.strategy.ts │ │ │ │ └── solana-token.strategy.ts │ │ │ └── utils │ │ │ │ └── check-liquidity.util.ts │ │ ├── purchase-liquidity │ │ │ ├── __tests__ │ │ │ │ └── purchase-liquidity.registry.spec.ts │ │ │ └── impl │ │ │ │ ├── arbitrum-coin.strategy.ts │ │ │ │ ├── arbitrum-token.strategy.ts │ │ │ │ ├── base-coin.strategy.ts │ │ │ │ ├── base-token.strategy.ts │ │ │ │ ├── base │ │ │ │ ├── no-purchase.strategy.ts │ │ │ │ ├── purchase-liquidity.strategy-registry.ts │ │ │ │ ├── purchase-liquidity.strategy.ts │ │ │ │ └── purchase.strategy.ts │ │ │ │ ├── bitcoin.strategy.ts │ │ │ │ ├── bsc-coin.strategy.ts │ │ │ │ ├── bsc-token.strategy.ts │ │ │ │ ├── ethereum-coin.strategy.ts │ │ │ │ ├── ethereum-token.strategy.ts │ │ │ │ ├── gnosis-coin.strategy.ts │ │ │ │ ├── gnosis-token.strategy.ts │ │ │ │ ├── lightning.strategy.ts │ │ │ │ ├── monero.strategy.ts │ │ │ │ ├── optimism-coin.strategy.ts │ │ │ │ ├── optimism-token.strategy.ts │ │ │ │ ├── polygon-coin.strategy.ts │ │ │ │ ├── polygon-token.strategy.ts │ │ │ │ ├── solana-coin.strategy.ts │ │ │ │ └── solana-token.strategy.ts │ │ ├── sell-liquidity │ │ │ └── impl │ │ │ │ ├── arbitrum-coin.strategy.ts │ │ │ │ ├── arbitrum-token.strategy.ts │ │ │ │ ├── base-coin.strategy.ts │ │ │ │ ├── base-token.strategy.ts │ │ │ │ ├── base │ │ │ │ ├── evm-coin.strategy.ts │ │ │ │ ├── evm-token.strategy.ts │ │ │ │ ├── sell-liquidity.strategy-registry.ts │ │ │ │ └── sell-liquidity.strategy.ts │ │ │ │ ├── bitcoin.strategy.ts │ │ │ │ ├── bsc-coin.strategy.ts │ │ │ │ ├── bsc-token.strategy.ts │ │ │ │ ├── ethereum-coin.strategy.ts │ │ │ │ ├── ethereum-token.strategy.ts │ │ │ │ ├── gnosis-coin.strategy.ts │ │ │ │ ├── gnosis-token.strategy.ts │ │ │ │ ├── monero.strategy.ts │ │ │ │ ├── optimism-coin.strategy.ts │ │ │ │ ├── optimism-token.strategy.ts │ │ │ │ ├── polygon-coin.strategy.ts │ │ │ │ ├── polygon-token.strategy.ts │ │ │ │ ├── solana-coin.strategy.ts │ │ │ │ └── solana-token.strategy.ts │ │ └── supplementary │ │ │ └── impl │ │ │ ├── arbitrum.strategy.ts │ │ │ ├── base.strategy.ts │ │ │ ├── base │ │ │ ├── evm.strategy.ts │ │ │ ├── supplementary.strategy-registry.ts │ │ │ └── supplementary.strategy.ts │ │ │ ├── bitcoin.strategy.ts │ │ │ ├── bsc.strategy.ts │ │ │ ├── ethereum.strategy.ts │ │ │ ├── gnosis.strategy.ts │ │ │ ├── monero.strategy.ts │ │ │ ├── optimism.strategy.ts │ │ │ ├── polygon.strategy.ts │ │ │ └── solana.strategy.ts │ └── utils │ │ └── dex.util.ts │ ├── fiat-output │ ├── __mocks__ │ │ └── fiat-output.entity.mock.ts │ ├── __tests__ │ │ └── fiat-output-job.service.spec.ts │ ├── dto │ │ ├── create-fiat-output.dto.ts │ │ ├── ep2-report.dto.ts │ │ └── update-fiat-output.dto.ts │ ├── ep2-report.service.ts │ ├── fiat-output-job.service.ts │ ├── fiat-output.controller.ts │ ├── fiat-output.entity.ts │ ├── fiat-output.module.ts │ ├── fiat-output.repository.ts │ └── fiat-output.service.ts │ ├── fiat-payin │ ├── __mocks__ │ │ └── checkout-tx.entity.mock.ts │ ├── entities │ │ └── checkout-tx.entity.ts │ ├── fiat-payin.module.ts │ ├── repositories │ │ └── checkout-tx.repository.ts │ └── services │ │ ├── checkout-tx.service.ts │ │ └── fiat-payin-sync.service.ts │ ├── log │ ├── __mocks__ │ │ └── log.entity.mock.ts │ ├── __tests__ │ │ └── log-job.service.spec.ts │ ├── dto │ │ ├── create-log.dto.ts │ │ └── log.dto.ts │ ├── log-job.module.ts │ ├── log-job.service.ts │ ├── log.controller.ts │ ├── log.entity.ts │ ├── log.module.ts │ ├── log.repository.ts │ └── log.service.ts │ ├── notification │ ├── dto │ │ └── update-notification.dto.ts │ ├── entities │ │ ├── mail │ │ │ ├── base │ │ │ │ └── mail.ts │ │ │ ├── error-monitoring-mail.ts │ │ │ ├── internal-mail.ts │ │ │ ├── personal-mail.ts │ │ │ ├── user-mail-v2.ts │ │ │ └── user-mail.ts │ │ └── notification.entity.ts │ ├── enums │ │ └── index.ts │ ├── factories │ │ └── mail.factory.ts │ ├── interfaces │ │ └── index.ts │ ├── notification.controller.ts │ ├── notification.module.ts │ ├── repositories │ │ └── notification.repository.ts │ ├── services │ │ ├── mail.service.ts │ │ ├── notification-job.service.ts │ │ └── notification.service.ts │ └── templates │ │ ├── generic.hbs │ │ ├── internal.hbs │ │ ├── newsletter.hbs │ │ ├── onChainLabs.hbs │ │ ├── personal.hbs │ │ ├── user-v2.hbs │ │ └── user.hbs │ ├── payin │ ├── controllers │ │ └── payin-webhook.controller.ts │ ├── entities │ │ ├── __mocks__ │ │ │ └── crypto-input.entity.mock.ts │ │ └── crypto-input.entity.ts │ ├── enums │ │ └── index.ts │ ├── interfaces │ │ └── index.ts │ ├── payin-webhook.module.ts │ ├── payin.module.ts │ ├── repositories │ │ └── payin.repository.ts │ ├── services │ │ ├── base │ │ │ ├── payin-bitcoin-based.service.ts │ │ │ └── payin-evm.service.ts │ │ ├── payin-arbitrum.service.ts │ │ ├── payin-base.service.ts │ │ ├── payin-bitcoin.service.ts │ │ ├── payin-bsc.service.ts │ │ ├── payin-ethereum.service.ts │ │ ├── payin-gnosis.service.ts │ │ ├── payin-lightning.service.ts │ │ ├── payin-monero.service.ts │ │ ├── payin-notification.service.ts │ │ ├── payin-optimism.service.ts │ │ ├── payin-polygon.service.ts │ │ ├── payin-solana.service.ts │ │ ├── payin-webhhook.service.ts │ │ └── payin.service.ts │ └── strategies │ │ ├── register │ │ ├── __tests__ │ │ │ └── register.registry.spec.ts │ │ └── impl │ │ │ ├── arbitrum.strategy.ts │ │ │ ├── base.strategy.ts │ │ │ ├── base │ │ │ ├── evm.strategy.ts │ │ │ ├── register.strategy-registry.ts │ │ │ └── register.strategy.ts │ │ │ ├── binance-pay.strategy.ts │ │ │ ├── bitcoin.strategy.ts │ │ │ ├── bsc.strategy.ts │ │ │ ├── ethereum.strategy.ts │ │ │ ├── gnosis.strategy.ts │ │ │ ├── lightning.strategy.ts │ │ │ ├── monero.strategy.ts │ │ │ ├── optimism.strategy.ts │ │ │ ├── polygon.strategy.ts │ │ │ └── solana.strategy.ts │ │ └── send │ │ ├── __tests__ │ │ └── send.registry.spec.ts │ │ └── impl │ │ ├── arbitrum-coin.strategy.ts │ │ ├── arbitrum-token.strategy.ts │ │ ├── base-coin.strategy.ts │ │ ├── base-token.strategy.ts │ │ ├── base │ │ ├── bitcoin-based.strategy.ts │ │ ├── evm-coin.strategy.ts │ │ ├── evm.strategy.ts │ │ ├── evm.token.strategy.ts │ │ ├── send.strategy-registry.ts │ │ ├── send.strategy.ts │ │ └── solana.strategy.ts │ │ ├── binance-pay.strategy.ts │ │ ├── bitcoin.strategy.ts │ │ ├── bsc-coin.strategy.ts │ │ ├── bsc-token.strategy.ts │ │ ├── ethereum-coin.strategy.ts │ │ ├── ethereum-token.strategy.ts │ │ ├── gnosis-coin.strategy.ts │ │ ├── gnosis-token.strategy.ts │ │ ├── lightning.strategy.ts │ │ ├── monero.strategy.ts │ │ ├── optimism-coin.strategy.ts │ │ ├── optimism-token.strategy.ts │ │ ├── polygon-coin.strategy.ts │ │ ├── polygon-token.strategy.ts │ │ ├── solana-coin.strategy.ts │ │ └── solana-token.strategy.ts │ ├── payment │ ├── __mocks__ │ │ ├── fee.entity.mock.ts │ │ ├── internal-fee.dto.mock.ts │ │ ├── transaction-request.entity.mock.ts │ │ └── transaction.entity.mock.ts │ ├── controllers │ │ ├── fee.controller.ts │ │ └── special-external-account.controller.ts │ ├── dto │ │ ├── fee.dto.ts │ │ ├── input │ │ │ ├── create-fee.dto.ts │ │ │ ├── create-special-external-account.dto.ts │ │ │ ├── create-transaction.dto.ts │ │ │ └── update-transaction-internal.dto.ts │ │ ├── payment-method.enum.ts │ │ ├── transaction-helper │ │ │ ├── min-amount.dto.ts │ │ │ ├── quote-error.enum.ts │ │ │ ├── transaction-details.dto.ts │ │ │ ├── tx-spec.dto.ts │ │ │ └── tx-statement-details.dto.ts │ │ └── transaction.dto.ts │ ├── entities │ │ ├── blockchain-fee.entity.ts │ │ ├── fee.entity.ts │ │ ├── special-external-account.entity.ts │ │ ├── transaction-request.entity.ts │ │ ├── transaction-specification.entity.ts │ │ └── transaction.entity.ts │ ├── exceptions │ │ └── fee-limit-exceeded.exception.ts │ ├── payment.module.ts │ ├── repositories │ │ ├── blockchain-fee.repository.ts │ │ ├── fee.repository.ts │ │ ├── special-external-account.repository.ts │ │ ├── transaction-request.repository.ts │ │ ├── transaction-specification.repository.ts │ │ └── transaction.repository.ts │ ├── services │ │ ├── fee.service.ts │ │ ├── special-external-account.service.ts │ │ ├── swiss-qr.service.ts │ │ ├── transaction-helper.ts │ │ ├── transaction-notification.service.ts │ │ ├── transaction-request.service.ts │ │ └── transaction.service.ts │ └── transaction.module.ts │ ├── payout │ ├── entities │ │ ├── __mocks__ │ │ │ └── payout-order.entity.mock.ts │ │ ├── __tests__ │ │ │ └── payout-order.entity.spec.ts │ │ └── payout-order.entity.ts │ ├── factories │ │ ├── __tests__ │ │ │ └── payout-order.factory.spec.ts │ │ └── payout-order.factory.ts │ ├── interfaces │ │ ├── __mocks__ │ │ │ └── payout-request.mock.ts │ │ └── index.ts │ ├── payout.controller.ts │ ├── payout.module.ts │ ├── repositories │ │ └── payout-order.repository.ts │ ├── services │ │ ├── base │ │ │ └── payout-bitcoin-based.service.ts │ │ ├── payout-arbitrum.service.ts │ │ ├── payout-base.service.ts │ │ ├── payout-bitcoin.service.ts │ │ ├── payout-bsc.service.ts │ │ ├── payout-ethereum.service.ts │ │ ├── payout-evm.service.ts │ │ ├── payout-gnosis.service.ts │ │ ├── payout-lightning.service.ts │ │ ├── payout-log.service.ts │ │ ├── payout-monero.service.ts │ │ ├── payout-optimism.service.ts │ │ ├── payout-polygon.service.ts │ │ ├── payout-solana.service.ts │ │ └── payout.service.ts │ └── strategies │ │ ├── payout │ │ ├── __tests__ │ │ │ ├── payout-bitcoin-based.strategy.spec.ts │ │ │ └── payout.registry.spec.ts │ │ └── impl │ │ │ ├── arbitrum-coin.strategy.ts │ │ │ ├── arbitrum-token.strategy.ts │ │ │ ├── base-coin.strategy.ts │ │ │ ├── base-token.strategy.ts │ │ │ ├── base │ │ │ ├── bitcoin-based.strategy.ts │ │ │ ├── evm.strategy.ts │ │ │ ├── payout.strategy-registry.ts │ │ │ ├── payout.strategy.ts │ │ │ └── solana.strategy.ts │ │ │ ├── bitcoin.strategy.ts │ │ │ ├── bsc-coin.strategy.ts │ │ │ ├── bsc-token.strategy.ts │ │ │ ├── ethereum-coin.strategy.ts │ │ │ ├── ethereum-token.strategy.ts │ │ │ ├── gnosis-coin.strategy.ts │ │ │ ├── gnosis-token.strategy.ts │ │ │ ├── lightning.strategy.ts │ │ │ ├── monero.strategy.ts │ │ │ ├── optimism-coin.strategy.ts │ │ │ ├── optimism-token.strategy.ts │ │ │ ├── polygon-coin.strategy.ts │ │ │ ├── polygon-token.strategy.ts │ │ │ ├── solana-coin.strategy.ts │ │ │ └── solana-token.strategy.ts │ │ └── prepare │ │ ├── __tests__ │ │ └── prepare.registry.spec.ts │ │ └── impl │ │ ├── arbitrum.strategy.ts │ │ ├── base.strategy.ts │ │ ├── base │ │ ├── auto-confirm.strategy.ts │ │ ├── evm.strategy.ts │ │ ├── prepare.strategy-registry.ts │ │ └── prepare.strategy.ts │ │ ├── bitcoin.strategy.ts │ │ ├── bsc.strategy.ts │ │ ├── ethereum.strategy.ts │ │ ├── gnosis.strategy.ts │ │ ├── lightning.strategy.ts │ │ ├── monero.strategy.ts │ │ ├── optimism.strategy.ts │ │ ├── polygon.strategy.ts │ │ └── solana.strategy.ts │ ├── pricing │ ├── domain │ │ ├── entities │ │ │ ├── asset-price.entity.ts │ │ │ ├── price-rule.entity.ts │ │ │ └── price.ts │ │ ├── exceptions │ │ │ └── price-invalid.exception.ts │ │ └── interfaces │ │ │ └── index.ts │ ├── dto │ │ ├── price-request-raw.ts │ │ └── price-request.ts │ ├── pricing.controller.ts │ ├── pricing.module.ts │ ├── repositories │ │ ├── asset-price.repository.ts │ │ └── price-rule.repository.ts │ └── services │ │ ├── asset-prices.service.ts │ │ ├── fiat-prices.service.ts │ │ ├── integration │ │ ├── coin-gecko.service.ts │ │ ├── currency.service.ts │ │ ├── fixer.service.ts │ │ ├── pricing-constant.service.ts │ │ ├── pricing-deuro.service.ts │ │ ├── pricing-dex.service.ts │ │ ├── pricing-ebel2x.service.ts │ │ ├── pricing-frankencoin.service.ts │ │ └── pricing-provider.ts │ │ └── pricing.service.ts │ ├── support-issue │ ├── dto │ │ ├── create-support-issue.dto.ts │ │ ├── create-support-message.dto.ts │ │ ├── get-support-issue.dto.ts │ │ ├── limit-request.dto.ts │ │ ├── support-issue-dto.mapper.ts │ │ ├── support-issue.dto.ts │ │ ├── support-log.dto.ts │ │ ├── update-limit-request.dto.ts │ │ └── update-support-issue.dto.ts │ ├── entities │ │ ├── limit-request-log.entity.ts │ │ ├── limit-request.entity.ts │ │ ├── support-issue-log.entity.ts │ │ ├── support-issue.entity.ts │ │ ├── support-log.entity.ts │ │ └── support-message.entity.ts │ ├── enums │ │ ├── department.enum.ts │ │ ├── support-issue.enum.ts │ │ └── support-log.enum.ts │ ├── limit-request.controller.ts │ ├── repositories │ │ ├── limit-request.repository.ts │ │ ├── support-issue.repository.ts │ │ ├── support-log.repository.ts │ │ └── support-message.repository.ts │ ├── services │ │ ├── limit-request-notification.service.ts │ │ ├── limit-request.service.ts │ │ ├── support-document.service.ts │ │ ├── support-issue-notification.service.ts │ │ ├── support-issue.service.ts │ │ └── support-log.service.ts │ ├── support-issue.controller.ts │ └── support-issue.module.ts │ └── supporting.module.ts ├── test ├── app.e2e-spec.ts └── jest-e2e.json ├── thunder-tests ├── collections │ ├── tc_col_dfx-api.json │ ├── tc_col_ocean-api.json │ └── tc_col_olkypay-api.json ├── environments │ ├── tc_env_dev-admin.json │ ├── tc_env_dev-beta.json │ ├── tc_env_dev-user.json │ ├── tc_env_loc-admin.json │ ├── tc_env_loc-user.json │ └── tc_env_prd.json ├── test-files │ └── test.json ├── thunderActivity.json └── thunderclient.json ├── tsconfig.build.json ├── tsconfig.json └── typings └── lnurl.d.ts /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Release Checklist 2 | 3 | #### Pre-Release 4 | 5 | - [ ] Check migrations 6 | - No database related infos (sqldb-xxx) 7 | - Impact on GS (new/removed columns) 8 | - [ ] Check for linter errors (in PR) 9 | - [ ] Test basic user operations (on [DFX services](https://dev.app.dfx.swiss)) 10 | - Login/logout 11 | - Buy/sell payment request 12 | - KYC page 13 | 14 | #### Post-Release 15 | 16 | - Test basic user operations 17 | - Monitor application insights log 18 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all", 4 | "printWidth": 120 5 | } -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "streetsidesoftware.code-spell-checker", 5 | "sonarsource.sonarlint-vscode", 6 | "rangav.vscode-thunder-client" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:latest AS builder 2 | WORKDIR /app 3 | COPY ./package.json ./ 4 | RUN npm install 5 | COPY . . 6 | RUN npm run build 7 | 8 | FROM node:latest 9 | WORKDIR /app 10 | COPY --from=builder /app ./ 11 | EXPOSE 3000:3000 12 | CMD [ "npm", "run", "start" ] -------------------------------------------------------------------------------- /assets/ocp-bitcoin-focus-sticker_de.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DFXswiss/api/07117f76faf5bd2260f7a8a1ec28d01adad100bf/assets/ocp-bitcoin-focus-sticker_de.png -------------------------------------------------------------------------------- /assets/ocp-bitcoin-focus-sticker_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DFXswiss/api/07117f76faf5bd2260f7a8a1ec28d01adad100bf/assets/ocp-bitcoin-focus-sticker_en.png -------------------------------------------------------------------------------- /assets/ocp-bitcoin-focus-sticker_fr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DFXswiss/api/07117f76faf5bd2260f7a8a1ec28d01adad100bf/assets/ocp-bitcoin-focus-sticker_fr.png -------------------------------------------------------------------------------- /assets/ocp-bitcoin-focus-sticker_it.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DFXswiss/api/07117f76faf5bd2260f7a8a1ec28d01adad100bf/assets/ocp-bitcoin-focus-sticker_it.png -------------------------------------------------------------------------------- /assets/ocp-classic-sticker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DFXswiss/api/07117f76faf5bd2260f7a8a1ec28d01adad100bf/assets/ocp-classic-sticker.png -------------------------------------------------------------------------------- /assets/ocp_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DFXswiss/api/07117f76faf5bd2260f7a8a1ec28d01adad100bf/assets/ocp_logo.png -------------------------------------------------------------------------------- /infrastructure/config/btc/bitcoin.conf: -------------------------------------------------------------------------------- 1 | server=1 2 | rest=1 3 | #txindex=1 4 | 5 | rpcallowip=0.0.0.0/0 6 | rpcbind=0.0.0.0 7 | rpcport=8332 8 | 9 | rpcauth=[RPC_AUTH] 10 | 11 | wallet=[WALLET] 12 | addresstype=p2sh-segwit 13 | 14 | zmqpubrawblock=tcp://0.0.0.0:28332 15 | zmqpubrawtx=tcp://0.0.0.0:28333 16 | -------------------------------------------------------------------------------- /infrastructure/config/docker/docker-compose.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | cat << EOF > .env 4 | MACAROON=$(xxd -ps -u -c 1000 volumes/lightning/data/chain/bitcoin/mainnet/admin.macaroon) 5 | EOF 6 | 7 | docker compose -f docker-compose-bitcoin.yml up -d 8 | docker compose -f docker-compose-monero.yml up -d 9 | docker compose -f docker-compose-frankencoin.yml up -d 10 | -------------------------------------------------------------------------------- /infrastructure/config/lightning/lnd/pwd.txt: -------------------------------------------------------------------------------- 1 | [PASSWORD] -------------------------------------------------------------------------------- /infrastructure/config/lightning/thunderhub/accounts.yml: -------------------------------------------------------------------------------- 1 | accounts: 2 | - name: [NAME] 3 | serverUrl: lnd:10009 4 | macaroonPath: /app/.lnd/data/chain/bitcoin/mainnet/admin.macaroon 5 | certificatePath: /app/.lnd/tls.cert 6 | password: [PASSWORD] 7 | -------------------------------------------------------------------------------- /infrastructure/config/lightning/thunderhub/thunderhub.env: -------------------------------------------------------------------------------- 1 | PORT=3000 2 | 3 | LOG_LEVEL='debug' 4 | LOG_JSON=true 5 | 6 | MEMPOOL_URL='https://mempool.space' 7 | 8 | THEME='dark' 9 | CURRENCY='sat' 10 | 11 | ACCOUNT_CONFIG_PATH='/app/accounts.yml' 12 | 13 | SSO_SERVER_URL='lnd:10009' 14 | SSO_CERT_PATH='/app/.lnd/tls.cert' 15 | SSO_MACAROON_PATH='/app/.lnd/data/chain/bitcoin/mainnet' 16 | 17 | DISABLE_TWOFA=true 18 | -------------------------------------------------------------------------------- /infrastructure/config/nginx/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 443 ssl; 3 | listen [::]:443 ssl; 4 | 5 | server_name localhost; 6 | 7 | ssl_certificate /app/.lnd/tls.cert; 8 | ssl_certificate_key /app/.lnd/tls.key; 9 | 10 | location / { 11 | proxy_pass http://thunderhub:3000; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /infrastructure/scripts/check-node-state.sh: -------------------------------------------------------------------------------- 1 | nodes=( "inp" "dex" "out" "int" "ref") 2 | 3 | for i in "${nodes[@]}" 4 | do 5 | shareName=$(az webapp config storage-account list -g rg-dfx-api-$1 -n app-dfx-node-$i-$1 --query "[0].value.shareName") 6 | if [[ $shareName == *a\" ]] 7 | then 8 | echo "$i: A" 9 | else 10 | echo "$i: B" 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /infrastructure/scripts/nodes.sh: -------------------------------------------------------------------------------- 1 | az webapp $1 --resource-group rg-dfx-api-$2 --name app-dfx-node-inp-$2 --slot stg 2 | az webapp $1 --resource-group rg-dfx-api-$2 --name app-dfx-node-dex-$2 --slot stg 3 | 4 | az webapp $1 --resource-group rg-dfx-api-$2 --name app-dfx-node-inp-$2 5 | az webapp $1 --resource-group rg-dfx-api-$2 --name app-dfx-node-dex-$2 6 | -------------------------------------------------------------------------------- /infrastructure/scripts/runBackup-exclude-file.txt: -------------------------------------------------------------------------------- 1 | ./volumes/bitcoin/blocks 2 | ./volumes/bitcoin/chainstate 3 | ./volumes/bitcoin/indexes 4 | ./volumes/bitmonero/lmdb 5 | -------------------------------------------------------------------------------- /infrastructure/scripts/setupEnv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd ~ 4 | mkdir volumes 5 | 6 | cd ~/volumes 7 | mkdir bitcoin lightning lnbits thunderhub nginx 8 | mkdir bitmonero 9 | mkdir frankencoin 10 | 11 | mkdir bitcoin/wallets 12 | mkdir nginx/www 13 | mkdir frankencoin/ponder 14 | -------------------------------------------------------------------------------- /infrastructure/scripts/swap-nodes.sh: -------------------------------------------------------------------------------- 1 | az webapp deployment slot swap --resource-group rg-dfx-api-$1 --name app-dfx-node-inp-$1 --slot stg 2 | az webapp deployment slot swap --resource-group rg-dfx-api-$1 --name app-dfx-node-dex-$1 --slot stg 3 | -------------------------------------------------------------------------------- /migration/1630752818367-assetChainId.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class assetChainId1630752818367 { 4 | name = 'assetChainId1630752818367' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."asset" ADD "chainId" int`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."asset" DROP COLUMN "chainId"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1631406679976-AddedKycCustomerId.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddedKycCustomerId1631406679976 { 4 | name = 'AddedKycCustomerId1631406679976' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "kycCustomerId" int`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "kycCustomerId"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1638523518369-AddedBtcAmount.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddedBtcAmount1638523518369 { 4 | name = 'AddedBtcAmount1638523518369' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."crypto_input" ADD "btcAmount" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."crypto_input" DROP COLUMN "btcAmount"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1642166757868-AddedCustomerId.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddedCustomerId1642166757868 { 4 | name = 'AddedCustomerId1642166757868' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "kycCustomerId" int`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "kycCustomerId"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1642188863002-AddedSettings.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddedSettings1642188863002 { 4 | name = 'AddedSettings1642188863002' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`CREATE TABLE "setting" ("key" nvarchar(256) NOT NULL, "value" nvarchar(MAX) NOT NULL, CONSTRAINT "PK_1c4c95d773004250c157a744d6e" PRIMARY KEY ("key"))`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`DROP TABLE "setting"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1642275049526-FixedSpelling.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class FixedSpelling1642275049526 { 4 | name = 'FixedSpelling1642275049526' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`EXEC sp_rename "bank_data.bankname", "bankName"`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`EXEC sp_rename "bank_data.bankName", "bankname"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1643904788026-AddedKycStatusChangeDate.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddedKycStatusChangeDate1643904788026 { 4 | name = 'AddedKycStatusChangeDate1643904788026' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "kycStatusChangeDate" datetime2`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "kycStatusChangeDate"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1644245381979-AddedCfpVotes.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddedCfpVotes1644245381979 { 4 | name = 'AddedCfpVotes1644245381979' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user" ADD "cfpVotes" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user" DROP COLUMN "cfpVotes"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1644277595687-AddedSecondSpiderUrl.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddedSecondSpiderUrl1644277595687 { 4 | name = 'AddedSecondSpiderUrl1644277595687' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."spider_data" ADD "secondUrl" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."spider_data" DROP COLUMN "secondUrl"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1644330803237-RemovedSpiderVersion.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class RemovedSpiderVersion1644330803237 { 4 | name = 'RemovedSpiderVersion1644330803237' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "spider_data" DROP COLUMN "version"`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "spider_data" ADD "version" nvarchar(256) NOT NULL`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1644923304230-AdaptedKycHash.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AdaptedKycHash1644923304230 { 4 | name = 'AdaptedKycHash1644923304230' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "kycHash" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "kycHash"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1645027900566-UniqueRef.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class UniqueRef1645027900566 { 4 | name = 'UniqueRef1645027900566' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user" ADD CONSTRAINT "UQ_994e7684ed41b9e4abb1bf3d198" UNIQUE ("ref")`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user" DROP CONSTRAINT "UQ_994e7684ed41b9e4abb1bf3d198"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1646056717919-StakingRewardType.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class StakingRewardType1646056717919 { 4 | name = 'StakingRewardType1646056717919' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."staking_reward" ADD "payoutType" nvarchar(256) NOT NULL`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."staking_reward" DROP COLUMN "payoutType"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1646302953368-AddedIndividualBuyFee.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddedIndividualBuyFee1646302953368 { 4 | name = 'AddedIndividualBuyFee1646302953368' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user" ADD "buyFee" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user" DROP COLUMN "buyFee"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1647250807785-AddedStakingStart.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddedStakingStart1647250807785 { 4 | name = 'AddedStakingStart1647250807785' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user" ADD "stakingStart" datetime2`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user" DROP COLUMN "stakingStart"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1647620456307-apiKeyCT.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class apiKeyCT1647620456307 { 4 | name = 'apiKeyCT1647620456307' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user" ADD "apiKeyCT" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user" DROP COLUMN "apiKeyCT"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1648287465315-UserDataRoots.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class UserDataRoots1648287465315 { 4 | name = 'UserDataRoots1648287465315' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "riskRoots" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "riskRoots"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1650105288039-AddSpiderExport.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddSpiderExport1650105288039 { 4 | name = 'AddSpiderExport1650105288039' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "spider_data" ADD "chatbotExport" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "spider_data" DROP COLUMN "chatbotExport"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1650984785735-Added2ndOutTxId.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class Added2ndOutTxId1650984785735 { 4 | name = 'Added2ndOutTxId1650984785735' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."crypto_staking" ADD "outTxId2" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."crypto_staking" DROP COLUMN "outTxId2"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1652133330298-AddIpCountry.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddIpCountry1652133330298 { 4 | name = 'AddIpCountry1652133330298' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "user" ADD "ipCountry" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "ipCountry"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1653675386990-AddIdentPdf.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddIdentPdf1653675386990 { 4 | name = 'AddIdentPdf1653675386990' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "spider_data" ADD "identPdf" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "spider_data" DROP COLUMN "identPdf"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1655213220947-UniqueKycHash.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class UniqueKycHash1655213220947 { 4 | name = 'UniqueKycHash1655213220947' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ae1f8052958afa82055fdef34f" ON "dbo"."user_data" ("kycHash") WHERE kycHash IS NOT NULL`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`DROP INDEX "IDX_ae1f8052958afa82055fdef34f" ON "dbo"."user_data"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1657277336514-SignatureNotUnique.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class SignatureNotUnique1657277336514 { 4 | name = 'SignatureNotUnique1657277336514' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user" DROP CONSTRAINT "UQ_b4b0b4550275499cb58bde188e0"`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user" ADD CONSTRAINT "UQ_b4b0b4550275499cb58bde188e0" UNIQUE ("signature")`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1658763007658-apiKeyCTUniqueIndex.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class apiKeyCTUniqueIndex1658763007658 { 4 | name = 'apiKeyCTUniqueIndex1658763007658' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`CREATE UNIQUE INDEX "IDX_94963fb28ad1772d4a1c9903c6" ON "dbo"."user" ("apiKeyCT") WHERE apiKeyCT IS NOT NULL`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`DROP INDEX "IDX_94963fb28ad1772d4a1c9903c6" ON "dbo"."user"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1660746952871-userFilterCode.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class userFilterCode1660746952871 { 4 | name = 'userFilterCode1660746952871' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user" ADD "apiFilterCT" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user" DROP COLUMN "apiFilterCT"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1661433580045-VideoIdRename.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class VideoIdRename1661433580045 { 4 | name = 'VideoIdRename1661433580045' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`EXEC sp_rename "dbo.spider_data.identTransactionId", "identIdentificationIds"`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`EXEC sp_rename "dbo.spider_data.identIdentificationIds", "identTransactionId"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1661805067683-AddAba.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddAba1661805067683 { 4 | name = 'AddAba1661805067683' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "bank_tx" ADD "aba" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "bank_tx" DROP COLUMN "aba"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1662077975490-renameAccountNumber.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class renameAccountNumber1662077975490 { 4 | name = 'renameAccountNumber1662077975490' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`EXEC sp_rename "bank_account.acountNumber", "accountNumber"`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`EXEC sp_rename "bank_account.accountNumber", "acountNumber"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1663343755659-addAmlReason.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addAmlReason1663343755659 { 4 | name = 'addAmlReason1663343755659' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."buy_crypto" ADD "amlReason" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."buy_crypto" DROP COLUMN "amlReason"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1664983634440-renameWalletDescription.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class renameWalletDescription1664983634440 { 4 | name = 'renameWalletDescription1664983634440' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`EXEC sp_rename "wallet.description", "name"`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`EXEC sp_rename "wallet.name", "description"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1665408086368-assetChainId.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class assetChainId1665408086368 { 4 | name = 'assetChainId1665408086368' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "asset" ALTER COLUMN "chainId" nvarchar(255)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "asset" ALTER COLUMN "chainId" int`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1666880270785-AddNullableForwardFeeAmount.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddNullableForwardFeeAmount1666880270785 { 4 | name = 'AddNullableForwardFeeAmount1666880270785' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "crypto_input" ADD "forwardFeeAmount" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "crypto_input" DROP COLUMN "forwardFeeAmount"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1668150169114-AddKycType.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddKycType1668150169114 { 4 | name = 'AddKycType1668150169114' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "user_data" ADD "kycType" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "user_data" DROP COLUMN "kycType"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1668509150637-statusInBuyCrypto.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require('typeorm'); 2 | 3 | module.exports = class statusInBuyCrypto1668509150637 { 4 | name = 'statusInBuyCrypto1668509150637'; 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "buy_crypto" ADD "status" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "buy_crypto" DROP COLUMN "status"`); 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /migration/1668519616316-addCustomKyc.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addCustomKyc1668519616316 { 4 | name = 'addCustomKyc1668519616316' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."wallet" ADD "customKyc" nvarchar(255)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."wallet" DROP COLUMN "customKyc"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1673444810025-cardano-signature.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require('typeorm'); 2 | 3 | module.exports = class cardanoSignature1673444810025 { 4 | name = 'cardanoSignature1673444810025'; 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user" ALTER COLUMN "signature" nvarchar(700) NOT NULL`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user" ALTER COLUMN "signature" nvarchar(256) NOT NULL`); 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /migration/1673605795897-CryptoInputTxType.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class CryptoInputTxType1673605795897 { 4 | name = 'CryptoInputTxType1673605795897' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."crypto_input" ADD "txType" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."crypto_input" DROP COLUMN "txType"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1673945356653-UniqueNameNotNull.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class UniqueNameNotNull1673945356653 { 4 | name = 'UniqueNameNotNull1673945356653' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."asset" ALTER COLUMN "uniqueName" nvarchar(256) NOT NULL`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."asset" ALTER COLUMN "uniqueName" nvarchar(256)`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1675256828822-lmRulesReactivation.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class lmRulesReactivation1675256828822 { 4 | name = 'lmRulesReactivation1675256828822' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "liquidity_management_rule" ADD "reactivationTime" int`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "liquidity_management_rule" DROP COLUMN "reactivationTime"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1676295102612-payoutOrderIndex.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class payoutOrderIndex1676295102612 { 4 | name = 'payoutOrderIndex1676295102612' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`CREATE UNIQUE INDEX "IDX_2e398e934dbc29eea57a2f55ad" ON "payout_order" ("context", "correlationId") `); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`DROP INDEX "IDX_2e398e934dbc29eea57a2f55ad" ON "payout_order"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1677703052796-ip-log-address.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class ipLogAddress1677703052796 { 4 | name = 'ipLogAddress1677703052796' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "ip_log" ALTER COLUMN "address" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "ip_log" ALTER COLUMN "address" nvarchar(256) NOT NULL`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1677706598544-ip-log-address-remove.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class ipLogAddressRemove1677706598544 { 4 | name = 'ipLogAddressRemove1677706598544' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "ip_log" ALTER COLUMN "address" nvarchar(256) NOT NULL`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "ip_log" ALTER COLUMN "address" nvarchar(256)`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1678101398721-buyCryptoFeeExtension.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class buyCryptoFeeExtension1678101398721 { 4 | name = 'buyCryptoFeeExtension1678101398721' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "buy_crypto_fee" ADD "allowedTotalFeePercent" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "buy_crypto_fee" DROP COLUMN "allowedTotalFeePercent"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1678203329136-liquidityAmountEstimation.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require('typeorm'); 2 | 3 | module.exports = class liquidityAmountEstimation1678203329136 { 4 | name = 'liquidityAmountEstimation1678203329136'; 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "liquidity_order" ADD "estimatedTargetAmount" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "liquidity_order" DROP COLUMN "estimatedTargetAmount"`); 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /migration/1684743418738-AssetApproxPrice.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require('typeorm'); 2 | 3 | module.exports = class AssetApproxPrice1684743418738 { 4 | name = 'AssetApproxPrice1684743418738'; 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "asset" ADD "approxPriceUsd" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "asset" DROP COLUMN "approxPriceUsd"`); 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /migration/1685745426886-exchangeTxAddressMax.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class exchangeTxAddressMax1685745426886 { 4 | name = 'exchangeTxAddressMax1685745426886' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."exchange_tx" ALTER COLUMN "address" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."exchange_tx" ALTER COLUMN "address" nvarchar(256)`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1686151116788-addBuyCryptoChargebackTxId.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addBuyCryptoChargebackTxId1686151116788 { 4 | name = 'addBuyCryptoChargebackTxId1686151116788' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."buy_crypto" ADD "chargebackCryptoTxId" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."buy_crypto" DROP COLUMN "chargebackCryptoTxId"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1686668014082-addUserDataIdentificationType.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addUserDataIdentificationType1686668014082 { 4 | name = 'addUserDataIdentificationType1686668014082' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "identificationType" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "identificationType"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1686836193039-addUserDataInternalAmlNote.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addUserDataInternalAmlNote1686836193039 { 4 | name = 'addUserDataInternalAmlNote1686836193039' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "internalAmlNote" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "internalAmlNote"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1691142414745-AddWalletIdentMethod.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require('typeorm'); 2 | 3 | module.exports = class AddWalletIdentMethod1691142414745 { 4 | name = 'AddWalletIdentMethod1691142414745'; 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."wallet" ADD "identMethod" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."wallet" DROP COLUMN "identMethod"`); 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /migration/1694431107346-removeUserCfpVotes.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class removeUserCfpVotes1694431107346 { 4 | name = 'removeUserCfpVotes1694431107346' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user" DROP COLUMN "cfpVotes"`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user" ADD "cfpVotes" nvarchar(MAX)`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1698078756376-CheckoutTxExpiresNullable.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class CheckoutTxExpiresNullable1698078756376 { 4 | name = 'CheckoutTxExpiresNullable1698078756376' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."checkout_tx" ALTER COLUMN "expiresOn" datetime2`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."checkout_tx" ALTER COLUMN "expiresOn" datetime2 NOT NULL`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1700237877955-addApiKey.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addApiKey1700237877955 { 4 | name = 'addApiKey1700237877955' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."wallet" ADD "apiKey" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."wallet" DROP COLUMN "apiKey"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1700772785883-addMinTxVolume.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addMinTxVolume1700772785883 { 4 | name = 'addMinTxVolume1700772785883' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."fee" ADD "minTxVolume" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."fee" DROP COLUMN "minTxVolume"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1701424853056-addRelatedUsers.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addRelatedUsers1701424853056 { 4 | name = 'addRelatedUsers1701424853056' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "relatedUsers" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "relatedUsers"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1702387425806-addKycStepsReminderSentDate.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addKycStepsReminderSentDate1702387425806 { 4 | name = 'addKycStepsReminderSentDate1702387425806' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."kyc_step" ADD "reminderSentDate" datetime2`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."kyc_step" DROP COLUMN "reminderSentDate"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1702560534941-addUserApproved.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addUserApproved1702560534941 { 4 | name = 'addUserApproved1702560534941' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user" ADD "approved" bit`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user" DROP COLUMN "approved"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1702649945339-addVerifiedName.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addVerifiedName1702649945339 { 4 | name = 'addVerifiedName1702649945339' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "verifiedName" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "verifiedName"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1702910132205-addBankDataType.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addBankDataType1702910132205 { 4 | name = 'addBankDataType1702910132205' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."bank_data" ADD "type" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."bank_data" DROP COLUMN "type"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1706520096880-addOlkypayAllowed.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addOlkypayAllowed1706520096880 { 4 | name = 'addOlkypayAllowed1706520096880' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "olkypayAllowed" bit`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "olkypayAllowed"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1707474941775-addUserDataCryptoCryptoAllowed.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addUserDataCryptoCryptoAllowed1707474941775 { 4 | name = 'addUserDataCryptoCryptoAllowed1707474941775' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "cryptoCryptoAllowed" bit`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "cryptoCryptoAllowed"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1707566483072-addFeeFiats.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addFeeFiats1707566483072 { 4 | name = 'addFeeFiats1707566483072' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."fee" ADD "fiats" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."fee" DROP COLUMN "fiats"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1707842967880-bankDataNameNullable.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class bankDataNameNullable1707842967880 { 4 | name = 'bankDataNameNullable1707842967880' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."bank_data" ALTER COLUMN "name" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."bank_data" ALTER COLUMN "name" nvarchar(256) NOT NULL`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1708438339667-AssetChfPrice.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AssetChfPrice1708438339667 { 4 | name = 'AssetChfPrice1708438339667' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."asset" ADD "approxPriceChf" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."asset" DROP COLUMN "approxPriceChf"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1708443094666-FiatChfPrice.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class FiatChfPrice1708443094666 { 4 | name = 'FiatChfPrice1708443094666' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."fiat" ADD "approxPriceChf" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."fiat" DROP COLUMN "approxPriceChf"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1709154274442-TxRequestFix.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class TxRequestFix1709154274442 { 4 | name = 'TxRequestFix1709154274442' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."transaction_request" ALTER COLUMN "paymentRequest" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."transaction_request" ALTER COLUMN "paymentRequest" nvarchar(255)`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1710147158334-checkoutTxApprovedNullable.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class checkoutTxApprovedNullable1710147158334 { 4 | name = 'checkoutTxApprovedNullable1710147158334' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."checkout_tx" ALTER COLUMN "approved" bit`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."checkout_tx" ALTER COLUMN "approved" bit NOT NULL`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1710952208059-LimitRequestTextLength.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class LimitRequestTextLength1710952208059 { 4 | name = 'LimitRequestTextLength1710952208059' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."limit_request" ALTER COLUMN "fundOriginText" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."limit_request" ALTER COLUMN "fundOriginText" nvarchar(256)`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1711018262474-changeUserSignatureLength.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class changeUserSignatureLength1711018262474 { 4 | name = 'changeUserSignatureLength1711018262474' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user" ALTER COLUMN "signature" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user" ALTER COLUMN "signature" nvarchar(700)`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1712837309998-removeCryptoCryptoAllowed.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class removeCryptoCryptoAllowed1712837309998 { 4 | name = 'removeCryptoCryptoAllowed1712837309998' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "cryptoCryptoAllowed"`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "cryptoCryptoAllowed" bit`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1712912069605-SenderAccount.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class SenderAccount1712912069605 { 4 | name = 'SenderAccount1712912069605' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."bank_tx" ADD "senderAccount" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."bank_tx" DROP COLUMN "senderAccount"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1713784635813-addTransactionUid.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addTransactionUid1713784635813 { 4 | name = 'addTransactionUid1713784635813' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."transaction" ADD "uid" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."transaction" DROP COLUMN "uid"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1716378941373-addBankDataComment.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addBankDataComment1716378941373 { 4 | name = 'addBankDataComment1716378941373' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."bank_data" ADD "comment" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."bank_data" DROP COLUMN "comment"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1716379249107-addKycStepComment.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addKycStepComment1716379249107 { 4 | name = 'addKycStepComment1716379249107' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."kyc_step" ADD "comment" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."kyc_step" DROP COLUMN "comment"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1716448529870-LmActionTag.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class LmActionTag1716448529870 { 4 | name = 'LmActionTag1716448529870' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."liquidity_management_action" ADD "tag" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."liquidity_management_action" DROP COLUMN "tag"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1718370557278-WebhookDataIdentifier.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class WebhookDataIdentifier1718370557278 { 4 | name = 'WebhookDataIdentifier1718370557278' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."webhook" ADD "identifier" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."webhook" DROP COLUMN "identifier"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1718874027084-AddAssetFinancialType.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddAssetFinancialType1718874027084 { 4 | name = 'AddAssetFinancialType1718874027084' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."asset" ADD "financialType" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."asset" DROP COLUMN "financialType"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1718892189636-SupportIssueInformation.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class SupportIssueInformation1718892189636 { 4 | name = 'SupportIssueInformation1718892189636' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."support_issue" ADD "information" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."support_issue" DROP COLUMN "information"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1719318163610-AddNetworkStartFeeAmount.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddNetworkStartFeeAmount1719318163610 { 4 | name = 'AddNetworkStartFeeAmount1719318163610' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."buy_crypto" ADD "networkStartFeeAmount" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."buy_crypto" DROP COLUMN "networkStartFeeAmount"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1719957070772-AddBuyCryptoChargebackIban.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddBuyCryptoChargebackIban1719957070772 { 4 | name = 'AddBuyCryptoChargebackIban1719957070772' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."buy_crypto" ADD "chargebackIban" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."buy_crypto" DROP COLUMN "chargebackIban"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1720789084318-AssetDecimals.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AssetDecimals1720789084318 { 4 | name = 'AssetDecimals1720789084318' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."asset" ADD "decimals" int`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."asset" DROP COLUMN "decimals"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1721121807418-TradingAmountInNullable.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class TradingAmountInNullable1721121807418 { 4 | name = 'TradingAmountInNullable1721121807418' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."trading_order" ALTER COLUMN "amountIn" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."trading_order" ALTER COLUMN "amountIn" float NOT NULL`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1723033123342-bankDataManualCheck.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class bankDataManualCheck1723033123342 { 4 | name = 'bankDataManualCheck1723033123342' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."bank_data" ADD "manualCheck" bit`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."bank_data" DROP COLUMN "manualCheck"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1723809890294-AddPaymentQuoteWebhook.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddPaymentQuoteWebhook1723809890294 { 4 | name = 'AddPaymentQuoteWebhook1723809890294' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "payment_link" ADD "webhookUrl" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "payment_link" DROP COLUMN "webhookUrl"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1723914432929-AddPaymentLinksName.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddPaymentLinksName1723914432929 { 4 | name = 'AddPaymentLinksName1723914432929' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "paymentLinksName" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "paymentLinksName"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1725021580953-UserAddressType.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class UserAddressType1725021580953 { 4 | name = 'UserAddressType1725021580953' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user" ADD "addressType" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user" DROP COLUMN "addressType"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1726223659967-SupportMessageNullable.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class SupportMessageNullable1726223659967 { 4 | name = 'SupportMessageNullable1726223659967' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "support_message" ALTER COLUMN "message" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "support_message" ALTER COLUMN "message" nvarchar(MAX) NOT NULL`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1726241282692-SupportIssueUId.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class SupportIssueUId1726241282692 { 4 | name = 'SupportIssueUId1726241282692' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "support_issue" ADD "uid" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "support_issue" DROP COLUMN "uid"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1726484428228-AddKycLogEventDate.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddKycLogEventDate1726484428228 { 4 | name = 'AddKycLogEventDate1726484428228' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."kyc_log" ADD "eventDate" datetime2`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."kyc_log" DROP COLUMN "eventDate"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1727073411626-addSymbol3Country.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddSymbol3Country1727073411626 { 4 | name = 'AddSymbol3Country1727073411626' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "country" ADD "symbol3" nvarchar(10)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "country" DROP COLUMN "symbol3"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1727443350989-MergeReason.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class MergeReason1727443350989 { 4 | name = 'MergeReason1727443350989' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "account_merge" ADD "reason" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "account_merge" DROP COLUMN "reason"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1729093904453-FeeFinancialType.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class FeeFinancialType1729093904453 { 4 | name = 'FeeFinancialType1729093904453' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."fee" ADD "financialTypes" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."fee" DROP COLUMN "financialTypes"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1730705112313-AddSenderAddresses.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddSenderAddresses1730705112313 { 4 | name = 'AddSenderAddresses1730705112313' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "crypto_input" ADD "senderAddresses" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "crypto_input" DROP COLUMN "senderAddresses"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1731963190430-ChangeSpecialCode.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class ChangeSpecialCode1731963190430 { 4 | name = 'ChangeSpecialCode1731963190430' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`EXEC sp_rename "dbo.fee.discountCode", "specialCode"`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`EXEC sp_rename "dbo.fee.specialCode", "discountCode"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1732580379505-AddMinConfirmation.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddMinConfirmation1732580379505 { 4 | name = 'AddMinConfirmation1732580379505' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "transaction_specification" ADD "minConfirmations" int`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "transaction_specification" DROP COLUMN "minConfirmations"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1732808206829-RemoveMasterKeyWallet.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class RemoveMasterKeyWallet1732808206829 { 4 | name = 'RemoveMasterKeyWallet1732808206829' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "wallet" DROP COLUMN "masterKey"`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "wallet" ADD "masterKey" nvarchar(256)`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1736008113726-addUserDataAmlListStatus.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class addUserDataAmlListStatus1736008113726 { 4 | name = 'addUserDataAmlListStatus1736008113726' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "amlListStatus" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "amlListStatus"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1736346664324-addForeignName.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddForeignName1736346664324 { 4 | name = 'AddForeignName1736346664324' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "country" ADD "foreignName" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "country" DROP COLUMN "foreignName"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1737809090150-UserDataPostAmlCheck.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class UserDataPostAmlCheck1737809090150 { 4 | name = 'UserDataPostAmlCheck1737809090150' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "postAmlCheck" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "postAmlCheck"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1738681331278-FiatOutputReport.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class FiatOutputReport1738681331278 { 4 | name = 'FiatOutputReport1738681331278' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "fiat_output" ADD "reportCreated" bit`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "fiat_output" DROP COLUMN "reportCreated"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1739643604085-AddFeeExcludingAssets.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddFeeExcludingAssets1739643604085 { 4 | name = 'AddFeeExcludingAssets1739643604085' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."fee" ADD "excludedAssets" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."fee" DROP COLUMN "excludedAssets"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1739907449972-AddAmountChf.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddAmountChf1739907449972 { 4 | name = 'AddAmountChf1739907449972' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "exchange_tx" ADD "amountChf" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "exchange_tx" DROP COLUMN "amountChf"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1740490560669-TravelRulePdf.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class TravelRulePdf1740490560669 { 4 | name = 'TravelRulePdf1740490560669' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "user" ADD "travelRulePdfDate" datetime2`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "travelRulePdfDate"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1740864893515-RemoveUserDataRiskState.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class RemoveUserDataRiskState1740864893515 { 4 | name = 'RemoveUserDataRiskState1740864893515' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "riskState"`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "riskState" nvarchar(256)`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1742992597290-LmOrderOutputAmount.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class LmOrderOutputAmount1742992597290 { 4 | name = 'LmOrderOutputAmount1742992597290' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "liquidity_management_order" ADD "outputAmount" float`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "liquidity_management_order" DROP COLUMN "outputAmount"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1744028086488-AddFeeExcludedUserDatas.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddFeeExcludedUserDatas1744028086488 { 4 | name = 'AddFeeExcludedUserDatas1744028086488' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."fee" ADD "excludedUserDatas" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."fee" DROP COLUMN "excludedUserDatas"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1746739483764-AddUserDataModerator.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddUserDataModerator1746739483764 { 4 | name = 'AddUserDataModerator1746739483764' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" ADD "moderator" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."user_data" DROP COLUMN "moderator"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1746783044276-RemoveKycLogSync.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class RemoveKycLogSync1746783044276 { 4 | name = 'RemoveKycLogSync1746783044276' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."kyc_log" DROP COLUMN "synced"`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."kyc_log" ADD "synced" bit`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1747037678344-AddKycFileSubType.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddKycFileSubType1747037678344 { 4 | name = 'AddKycFileSubType1747037678344' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."kyc_file" ADD "subType" nvarchar(256)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."kyc_file" DROP COLUMN "subType"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1747381205530-PaymentLinkLabel.js: -------------------------------------------------------------------------------- 1 | module.exports = class PaymentLinkLabel1747381205530 { 2 | name = 'PaymentLinkLabel1747381205530' 3 | 4 | async up(queryRunner) { 5 | await queryRunner.query(`ALTER TABLE "payment_link" ADD "label" nvarchar(256)`); 6 | } 7 | 8 | async down(queryRunner) { 9 | await queryRunner.query(`ALTER TABLE "payment_link" DROP COLUMN "label"`); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /migration/1749673095988-AddWalletMailConfig.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddWalletMailConfig1749673095988 { 4 | name = 'AddWalletMailConfig1749673095988' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."wallet" ADD "mailConfig" nvarchar(MAX)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."wallet" DROP COLUMN "mailConfig"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1750087655189-AddLimitRequestAcceptedLimit.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddLimitRequestAcceptedLimit1750087655189 { 4 | name = 'AddLimitRequestAcceptedLimit1750087655189' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."limit_request" ADD "acceptedLimit" int`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."limit_request" DROP COLUMN "acceptedLimit"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/1751809890624-AddBankDataStatus.js: -------------------------------------------------------------------------------- 1 | const { MigrationInterface, QueryRunner } = require("typeorm"); 2 | 3 | module.exports = class AddBankDataStatus1751809890624 { 4 | name = 'AddBankDataStatus1751809890624' 5 | 6 | async up(queryRunner) { 7 | await queryRunner.query(`ALTER TABLE "dbo"."bank_data" ADD "status" nvarchar(255)`); 8 | } 9 | 10 | async down(queryRunner) { 11 | await queryRunner.query(`ALTER TABLE "dbo"."bank_data" DROP COLUMN "status"`); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /migration/generate.sh: -------------------------------------------------------------------------------- 1 | typeorm migration:generate migration/$1 -o -d migration/dev-data-source.ts 2 | -------------------------------------------------------------------------------- /nest-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "collection": "@nestjs/schematics", 3 | "sourceRoot": "src", 4 | "compilerOptions": { 5 | "assets": [ 6 | { "include": "subdomains/supporting/notification/templates/**/*.hbs", "outDir": "dist/src/" }, 7 | { "include": "shared/i18n/**/*", "outDir": "dist/src/" } 8 | ], 9 | "watchAssets": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/config/config.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { ConfigService } from 'src/config/config'; 3 | import { ConfigModule as ConfigurationModule } from '@nestjs/config'; 4 | 5 | @Module({ 6 | imports: [ConfigurationModule.forRoot()], 7 | providers: [ConfigService], 8 | exports: [ConfigService], 9 | }) 10 | export class ConfigModule {} 11 | -------------------------------------------------------------------------------- /src/integration/alchemy/dto/alchemy-asset-transfers.dto.ts: -------------------------------------------------------------------------------- 1 | import { AssetTransfersWithMetadataResult } from 'alchemy-sdk'; 2 | import { Blockchain } from 'src/integration/blockchain/shared/enums/blockchain.enum'; 3 | 4 | export interface AlchemyAssetTransfersDto { 5 | blockchain: Blockchain; 6 | assetTransfers: AssetTransfersWithMetadataResult[]; 7 | } 8 | -------------------------------------------------------------------------------- /src/integration/alchemy/dto/alchemy-create-webhook.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { IsEnum, IsNotEmpty } from 'class-validator'; 3 | import { Blockchain } from 'src/integration/blockchain/shared/enums/blockchain.enum'; 4 | 5 | export class CreateWebhookDto { 6 | @ApiProperty() 7 | @IsNotEmpty() 8 | @IsEnum(Blockchain) 9 | blockchain: Blockchain; 10 | 11 | @ApiProperty() 12 | @IsNotEmpty() 13 | addresses: string[]; 14 | } 15 | -------------------------------------------------------------------------------- /src/integration/alchemy/dto/alchemy-transaction.dto.ts: -------------------------------------------------------------------------------- 1 | export interface AlchemyTransactionDto { 2 | fromAddress: string; 3 | toAddress: string; 4 | blockNum: string; 5 | hash: string; 6 | rawContract: { 7 | rawValue: string; 8 | decimals: number; 9 | address: string; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /src/integration/bank/bank.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { SharedModule } from 'src/shared/shared.module'; 3 | import { IbanService } from './services/iban.service'; 4 | import { OlkypayService } from './services/olkypay.service'; 5 | import { RevolutService } from './services/revolut.service'; 6 | 7 | @Module({ 8 | imports: [SharedModule], 9 | controllers: [], 10 | providers: [IbanService, OlkypayService, RevolutService], 11 | exports: [IbanService, OlkypayService, RevolutService], 12 | }) 13 | export class BankIntegrationModule {} 14 | -------------------------------------------------------------------------------- /src/integration/binance-pay/binance-pay.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { SharedModule } from 'src/shared/shared.module'; 3 | import { BinancePayService } from './services/binance-pay.service'; 4 | 5 | @Module({ 6 | imports: [SharedModule], 7 | controllers: [], 8 | providers: [BinancePayService], 9 | exports: [BinancePayService], 10 | }) 11 | export class BinancePayModule {} 12 | -------------------------------------------------------------------------------- /src/integration/blockchain/arbitrum/arbitrum.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { AlchemyModule } from 'src/integration/alchemy/alchemy.module'; 3 | import { SharedModule } from 'src/shared/shared.module'; 4 | import { ArbitrumService } from './arbitrum.service'; 5 | 6 | @Module({ 7 | imports: [SharedModule, AlchemyModule], 8 | providers: [ArbitrumService], 9 | exports: [ArbitrumService], 10 | }) 11 | export class ArbitrumModule {} 12 | -------------------------------------------------------------------------------- /src/integration/blockchain/arweave/arweave.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { ArweaveService } from './services/arweave.service'; 3 | 4 | @Module({ 5 | imports: [], 6 | controllers: [], 7 | providers: [ArweaveService], 8 | exports: [ArweaveService], 9 | }) 10 | export class ArweaveModule {} 11 | -------------------------------------------------------------------------------- /src/integration/blockchain/base/base.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { AlchemyModule } from 'src/integration/alchemy/alchemy.module'; 3 | import { SharedModule } from 'src/shared/shared.module'; 4 | import { BaseService } from './base.service'; 5 | 6 | @Module({ 7 | imports: [SharedModule, AlchemyModule], 8 | controllers: [], 9 | providers: [BaseService], 10 | exports: [BaseService], 11 | }) 12 | export class BaseModule {} 13 | -------------------------------------------------------------------------------- /src/integration/blockchain/bitcoin/node/dto/command.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsBoolean, IsNotEmpty, IsOptional, IsString } from 'class-validator'; 2 | 3 | export class CommandDto { 4 | @IsNotEmpty() 5 | @IsString() 6 | command: string; 7 | 8 | @IsOptional() 9 | @IsBoolean() 10 | noAutoUnlock?: boolean; 11 | } 12 | -------------------------------------------------------------------------------- /src/integration/blockchain/bsc/bsc.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { AlchemyModule } from 'src/integration/alchemy/alchemy.module'; 3 | import { SharedModule } from 'src/shared/shared.module'; 4 | import { BscService } from './bsc.service'; 5 | 6 | @Module({ 7 | imports: [SharedModule, AlchemyModule], 8 | providers: [BscService], 9 | exports: [BscService], 10 | }) 11 | export class BscModule {} 12 | -------------------------------------------------------------------------------- /src/integration/blockchain/deuro/controllers/deuro.controller.ts: -------------------------------------------------------------------------------- 1 | import { Controller, Get } from '@nestjs/common'; 2 | import { ApiTags } from '@nestjs/swagger'; 3 | import { DEuroService } from '../deuro.service'; 4 | import { DEuroInfoDto } from '../dto/deuro.dto'; 5 | 6 | @ApiTags('DEuro') 7 | @Controller('deuro') 8 | export class DEuroController { 9 | constructor(private readonly service: DEuroService) {} 10 | 11 | @Get('info') 12 | async getInfo(): Promise { 13 | return this.service.getDEuroInfo(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/integration/blockchain/deuro/deuro.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { SharedModule } from 'src/shared/shared.module'; 3 | import { LogModule } from 'src/subdomains/supporting/log/log.module'; 4 | import { DEuroController } from './controllers/deuro.controller'; 5 | import { DEuroService } from './deuro.service'; 6 | 7 | @Module({ 8 | imports: [SharedModule, LogModule], 9 | controllers: [DEuroController], 10 | providers: [DEuroService], 11 | exports: [DEuroService], 12 | }) 13 | export class DEuroModule {} 14 | -------------------------------------------------------------------------------- /src/integration/blockchain/ebel2x/ebel2x.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { AlchemyModule } from 'src/integration/alchemy/alchemy.module'; 3 | import { SharedModule } from 'src/shared/shared.module'; 4 | import { Ebel2xService } from './ebel2x.service'; 5 | 6 | @Module({ 7 | imports: [SharedModule, AlchemyModule], 8 | controllers: [], 9 | providers: [Ebel2xService], 10 | exports: [Ebel2xService], 11 | }) 12 | export class Ebel2xModule {} 13 | -------------------------------------------------------------------------------- /src/integration/blockchain/ethereum/ethereum-client.ts: -------------------------------------------------------------------------------- 1 | import { EvmClient, EvmClientParams } from '../shared/evm/evm-client'; 2 | 3 | export class EthereumClient extends EvmClient { 4 | constructor(params: EvmClientParams) { 5 | super(params); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/integration/blockchain/ethereum/ethereum.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { AlchemyModule } from 'src/integration/alchemy/alchemy.module'; 3 | import { SharedModule } from 'src/shared/shared.module'; 4 | import { EthereumService } from './ethereum.service'; 5 | 6 | @Module({ 7 | imports: [SharedModule, AlchemyModule], 8 | providers: [EthereumService], 9 | exports: [EthereumService], 10 | }) 11 | export class EthereumModule {} 12 | -------------------------------------------------------------------------------- /src/integration/blockchain/gnosis/gnosis.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { AlchemyModule } from 'src/integration/alchemy/alchemy.module'; 3 | import { SharedModule } from 'src/shared/shared.module'; 4 | import { GnosisService } from './gnosis.service'; 5 | 6 | @Module({ 7 | imports: [SharedModule, AlchemyModule], 8 | controllers: [], 9 | providers: [GnosisService], 10 | exports: [GnosisService], 11 | }) 12 | export class GnosisModule {} 13 | -------------------------------------------------------------------------------- /src/integration/blockchain/liquid/liquid-helper.ts: -------------------------------------------------------------------------------- 1 | import { fromConfidential, isConfidential } from 'liquidjs-lib/src/address'; 2 | 3 | export class LiquidHelper { 4 | static getUnconfidentialAddress(address: string): string { 5 | return isConfidential(address) ? fromConfidential(address).unconfidentialAddress : address; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/integration/blockchain/monero/monero.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { SharedModule } from 'src/shared/shared.module'; 3 | import { MoneroService } from './services/monero.service'; 4 | 5 | @Module({ 6 | imports: [SharedModule], 7 | controllers: [], 8 | providers: [MoneroService], 9 | exports: [MoneroService], 10 | }) 11 | export class MoneroModule {} 12 | -------------------------------------------------------------------------------- /src/integration/blockchain/optimism/optimism.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { AlchemyModule } from 'src/integration/alchemy/alchemy.module'; 3 | import { SharedModule } from 'src/shared/shared.module'; 4 | import { OptimismService } from './optimism.service'; 5 | 6 | @Module({ 7 | imports: [SharedModule, AlchemyModule], 8 | providers: [OptimismService], 9 | exports: [OptimismService], 10 | }) 11 | export class OptimismModule {} 12 | -------------------------------------------------------------------------------- /src/integration/blockchain/polygon/polygon.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { AlchemyModule } from 'src/integration/alchemy/alchemy.module'; 3 | import { SharedModule } from 'src/shared/shared.module'; 4 | import { PolygonService } from './polygon.service'; 5 | 6 | @Module({ 7 | imports: [SharedModule, AlchemyModule], 8 | controllers: [], 9 | providers: [PolygonService], 10 | exports: [PolygonService], 11 | }) 12 | export class PolygonModule {} 13 | -------------------------------------------------------------------------------- /src/integration/blockchain/shared/dto/blockchain-token-balance.dto.ts: -------------------------------------------------------------------------------- 1 | export interface BlockchainTokenBalance { 2 | owner: string; 3 | contractAddress: string; 4 | balance: number; 5 | } 6 | -------------------------------------------------------------------------------- /src/integration/blockchain/shared/dto/frankencoin-based.dto.ts: -------------------------------------------------------------------------------- 1 | export interface CollateralWithTotalBalance { 2 | address: string; 3 | symbol: string; 4 | totalBalance: number; 5 | } 6 | -------------------------------------------------------------------------------- /src/integration/blockchain/shared/evm/domain/wallet-account.ts: -------------------------------------------------------------------------------- 1 | export interface WalletAccount { 2 | seed: string; 3 | index: number; 4 | } 5 | -------------------------------------------------------------------------------- /src/integration/blockchain/shared/evm/dto/evm-approval.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsInt, IsNotEmpty, IsNumber, IsString } from 'class-validator'; 2 | 3 | export class EvmBridgeApproval { 4 | @IsNotEmpty() 5 | @IsNumber() 6 | l1AssetId: number; 7 | 8 | @IsNotEmpty() 9 | @IsNumber() 10 | l2AssetId: number; 11 | } 12 | 13 | export class EvmContractApproval { 14 | @IsNotEmpty() 15 | @IsInt() 16 | assetId: number; 17 | 18 | @IsNotEmpty() 19 | @IsString() 20 | contractAddress: string; 21 | } 22 | -------------------------------------------------------------------------------- /src/integration/blockchain/shared/evm/dto/evm-coin-transaction.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsEnum, IsNotEmpty, IsNumber, IsString } from 'class-validator'; 2 | import { Blockchain } from 'src/integration/blockchain/shared/enums/blockchain.enum'; 3 | 4 | export class EvmCoinTransactionDto { 5 | @IsNotEmpty() 6 | @IsString() 7 | fromAddress: string; 8 | 9 | @IsNotEmpty() 10 | @IsString() 11 | toAddress: string; 12 | 13 | @IsNotEmpty() 14 | @IsNumber() 15 | amount: number; 16 | 17 | @IsNotEmpty() 18 | @IsEnum(Blockchain) 19 | blockchain: Blockchain; 20 | } 21 | -------------------------------------------------------------------------------- /src/integration/blockchain/shared/evm/dto/evm-raw-input-data.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsEnum, IsNotEmpty, IsString } from 'class-validator'; 2 | import { Blockchain } from 'src/integration/blockchain/shared/enums/blockchain.enum'; 3 | 4 | export class EvmRawInputDataDto { 5 | @IsNotEmpty() 6 | @IsEnum(Blockchain) 7 | blockchain: Blockchain; 8 | 9 | @IsNotEmpty() 10 | @IsString() 11 | contractAddress: string; 12 | 13 | @IsNotEmpty() 14 | @IsString() 15 | signer: string; 16 | 17 | @IsNotEmpty() 18 | @IsString() 19 | callData: string; 20 | } 21 | -------------------------------------------------------------------------------- /src/integration/blockchain/shared/evm/dto/evm-raw-transaction.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsEnum, IsNotEmpty, IsObject } from 'class-validator'; 2 | import { ethers } from 'ethers'; 3 | import { Blockchain } from 'src/integration/blockchain/shared/enums/blockchain.enum'; 4 | 5 | export class EvmRawTransactionDto { 6 | @IsNotEmpty() 7 | @IsObject() 8 | request: ethers.providers.TransactionRequest; 9 | 10 | @IsNotEmpty() 11 | @IsEnum(Blockchain) 12 | blockchain: Blockchain; 13 | } 14 | -------------------------------------------------------------------------------- /src/integration/blockchain/shared/evm/evm.service.ts: -------------------------------------------------------------------------------- 1 | import { BlockchainService } from '../util/blockchain.service'; 2 | import { EvmClient, EvmClientParams } from './evm-client'; 3 | 4 | export abstract class EvmService extends BlockchainService { 5 | private readonly client: EvmClient; 6 | 7 | constructor(client: new (params) => EvmClient, params: EvmClientParams) { 8 | super(); 9 | this.client = new client(params); 10 | } 11 | 12 | getDefaultClient(): T { 13 | return this.client as T; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/integration/blockchain/shared/frankencoin/frankencoin-based.dto.ts: -------------------------------------------------------------------------------- 1 | export interface FrankencoinBasedCollateralDto { 2 | collateral: string; 3 | collateralSymbol: string; 4 | collateralBalance: string; 5 | collateralDecimals: number; 6 | } 7 | -------------------------------------------------------------------------------- /src/integration/blockchain/shared/util/blockchain.service.ts: -------------------------------------------------------------------------------- 1 | import { BlockchainClient } from './blockchain-client'; 2 | 3 | export abstract class BlockchainService { 4 | abstract getDefaultClient(): BlockchainClient; 5 | } 6 | -------------------------------------------------------------------------------- /src/integration/blockchain/solana/solana.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { SharedModule } from 'src/shared/shared.module'; 3 | import { SolanaService } from './services/solana.service'; 4 | 5 | @Module({ 6 | imports: [SharedModule], 7 | controllers: [], 8 | providers: [SolanaService], 9 | exports: [SolanaService], 10 | }) 11 | export class SolanaModule {} 12 | -------------------------------------------------------------------------------- /src/integration/checkout/checkout.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { CheckoutService } from './services/checkout.service'; 3 | 4 | @Module({ 5 | imports: [], 6 | controllers: [], 7 | providers: [CheckoutService], 8 | exports: [CheckoutService], 9 | }) 10 | export class CheckoutModule {} 11 | -------------------------------------------------------------------------------- /src/integration/exchange/dto/__mocks__/exchange-tx.entity.mock.ts: -------------------------------------------------------------------------------- 1 | import { ExchangeTx } from '../../entities/exchange-tx.entity'; 2 | 3 | const defaultExchangeTx: Partial = { 4 | id: 1, 5 | }; 6 | 7 | export function createDefaultExchangeTx(): ExchangeTx { 8 | return createCustomExchangeTx({}); 9 | } 10 | 11 | export function createCustomExchangeTx(customValues: Partial): ExchangeTx { 12 | return Object.assign(new ExchangeTx(), { ...defaultExchangeTx, ...customValues }); 13 | } 14 | -------------------------------------------------------------------------------- /src/integration/exchange/dto/trade-order.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { IsNotEmpty, IsString, IsNumber } from 'class-validator'; 3 | 4 | export class TradeOrder { 5 | @ApiProperty() 6 | @IsNotEmpty() 7 | @IsString() 8 | from: string; 9 | 10 | @ApiProperty() 11 | @IsNotEmpty() 12 | @IsString() 13 | to: string; 14 | 15 | @ApiProperty() 16 | @IsNotEmpty() 17 | @IsNumber() 18 | amount: number; 19 | } 20 | -------------------------------------------------------------------------------- /src/integration/exchange/dto/trade-result.dto.ts: -------------------------------------------------------------------------------- 1 | import { TradeResponse } from './trade-response.dto'; 2 | 3 | export enum TradeStatus { 4 | OPEN = 'open', 5 | CLOSED = 'closed', 6 | FAILED = 'failed', 7 | } 8 | 9 | export interface TradeResult { 10 | exchange: string; 11 | status: TradeStatus; 12 | from: string; 13 | to: string; 14 | orders: string[]; 15 | trade?: TradeResponse; 16 | error?: Error; 17 | } 18 | -------------------------------------------------------------------------------- /src/integration/exchange/enums/exchange.enum.ts: -------------------------------------------------------------------------------- 1 | export enum ExchangeName { 2 | BINANCE = 'Binance', 3 | KRAKEN = 'Kraken', 4 | XT = 'XT', 5 | } 6 | -------------------------------------------------------------------------------- /src/integration/exchange/exceptions/trade-changed.exception.ts: -------------------------------------------------------------------------------- 1 | export class TradeChangedException extends Error { 2 | constructor(public readonly id: string) { 3 | super(); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/integration/exchange/repositories/exchange-tx.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { ExchangeTx } from '../entities/exchange-tx.entity'; 5 | 6 | @Injectable() 7 | export class ExchangeTxRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(ExchangeTx, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/integration/exchange/services/exchange-registry.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { StrategyRegistry } from 'src/subdomains/supporting/common/strategy-registry'; 3 | import { ExchangeService } from './exchange.service'; 4 | 5 | @Injectable() 6 | export class ExchangeRegistryService extends StrategyRegistry { 7 | protected getKey(key: string): string { 8 | return key.toLowerCase(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/integration/geolocation/geo-location.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { GeoLocationService } from './geo-location.service'; 3 | 4 | @Module({ 5 | imports: [], 6 | controllers: [], 7 | providers: [GeoLocationService], 8 | exports: [GeoLocationService], 9 | }) 10 | export class GeoLocationModule {} 11 | -------------------------------------------------------------------------------- /src/integration/geolocation/geo-location.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import GeoIp from 'geoip-lite2'; 3 | 4 | @Injectable() 5 | export class GeoLocationService { 6 | getCountry(ip: string): string { 7 | const geoLocation = GeoIp.lookup(ip); 8 | return geoLocation?.country; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/integration/ikna/dto/ikna-sanction-result.dto.ts: -------------------------------------------------------------------------------- 1 | import { IknaAddressTag } from './ikna-address-tag.dto'; 2 | 3 | export interface IknaSanctionResult { 4 | testedAddress: string; 5 | isSanctioned: boolean | null; 6 | sanctionedAddress?: string; 7 | sanctionedAddressTags?: IknaAddressTag[]; 8 | } 9 | -------------------------------------------------------------------------------- /src/integration/ikna/ikna.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { SharedModule } from 'src/shared/shared.module'; 3 | import { IknaController } from './controllers/ikna.controller'; 4 | import { IknaService } from './services/ikna.service'; 5 | 6 | @Module({ 7 | imports: [SharedModule], 8 | controllers: [IknaController], 9 | providers: [IknaService], 10 | exports: [], 11 | }) 12 | export class IknaModule {} 13 | -------------------------------------------------------------------------------- /src/integration/letter/letter.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { SharedModule } from 'src/shared/shared.module'; 3 | import { LetterService } from './letter.service'; 4 | 5 | @Module({ 6 | imports: [SharedModule], 7 | controllers: [], 8 | providers: [LetterService], 9 | exports: [LetterService], 10 | }) 11 | export class LetterModule {} 12 | -------------------------------------------------------------------------------- /src/integration/lightning/dto/verifymessage-response.dto.ts: -------------------------------------------------------------------------------- 1 | export interface VerifyMessageResponseDto { 2 | valid: boolean; 3 | pubkey: string; 4 | } 5 | -------------------------------------------------------------------------------- /src/integration/lightning/dto/verifymessage.dto.ts: -------------------------------------------------------------------------------- 1 | export interface VerifyMessageDto { 2 | msg: string; 3 | signature: string; 4 | } 5 | -------------------------------------------------------------------------------- /src/integration/lightning/lightning.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { SharedModule } from 'src/shared/shared.module'; 3 | import { LightningService } from './services/lightning.service'; 4 | 5 | @Module({ 6 | imports: [SharedModule], 7 | controllers: [], 8 | providers: [LightningService], 9 | exports: [LightningService], 10 | }) 11 | export class LightningModule {} 12 | -------------------------------------------------------------------------------- /src/integration/railgun/railgun.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { RailgunService } from './railgun.service'; 3 | 4 | @Module({ 5 | providers: [RailgunService], 6 | exports: [RailgunService], 7 | }) 8 | export class RailgunModule {} 9 | -------------------------------------------------------------------------------- /src/integration/sift/sift.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { SharedModule } from 'src/shared/shared.module'; 3 | import { SiftService } from './services/sift.service'; 4 | 5 | @Module({ 6 | imports: [SharedModule], 7 | controllers: [], 8 | providers: [SiftService], 9 | exports: [SiftService], 10 | }) 11 | export class SiftModule {} 12 | -------------------------------------------------------------------------------- /src/integration/tatum/tatum.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { SharedModule } from 'src/shared/shared.module'; 3 | import { TatumController } from './controllers/tatum.controller'; 4 | import { TatumWebhookService } from './services/tatum-webhook.service'; 5 | 6 | @Module({ 7 | imports: [SharedModule], 8 | controllers: [TatumController], 9 | providers: [TatumWebhookService], 10 | exports: [TatumWebhookService], 11 | }) 12 | export class TatumModule {} 13 | -------------------------------------------------------------------------------- /src/shared/auth/get-jwt.decorator.ts: -------------------------------------------------------------------------------- 1 | import { createParamDecorator, ExecutionContext } from '@nestjs/common'; 2 | import { JwtPayload } from 'src/shared/auth/jwt-payload.interface'; 3 | 4 | export const GetJwt = createParamDecorator( 5 | (_data, ctx: ExecutionContext): JwtPayload => { 6 | const req = ctx.switchToHttp().getRequest(); 7 | return req.user; 8 | }, 9 | ); 10 | -------------------------------------------------------------------------------- /src/shared/auth/optional.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { AuthGuard } from '@nestjs/passport'; 3 | 4 | @Injectable() 5 | export class OptionalJwtAuthGuard extends AuthGuard('jwt') { 6 | // Override handleRequest so it never throws an error 7 | handleRequest(_err: any, user: any, _info: any, _context: any) { 8 | return user; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/shared/auth/user-role.enum.ts: -------------------------------------------------------------------------------- 1 | export enum UserRole { 2 | // user roles 3 | ACCOUNT = 'Account', 4 | USER = 'User', 5 | VIP = 'VIP', 6 | BETA = 'Beta', 7 | ADMIN = 'Admin', 8 | SUPPORT = 'Support', 9 | COMPLIANCE = 'Compliance', 10 | CUSTODY = 'Custody', 11 | 12 | // service roles 13 | BANKING_BOT = 'BankingBot', 14 | 15 | // external kyc client company roles 16 | KYC_CLIENT_COMPANY = 'KycClientCompany', 17 | } 18 | -------------------------------------------------------------------------------- /src/shared/dto/announcement.dto.ts: -------------------------------------------------------------------------------- 1 | export class AnnouncementDto { 2 | lang: { [lang: string]: string }; 3 | version: string; 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /src/shared/dto/entity.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { IsInt, IsNotEmpty } from 'class-validator'; 3 | 4 | export class EntityDto { 5 | @ApiProperty() 6 | @IsNotEmpty() 7 | @IsInt() 8 | id: number; 9 | } 10 | -------------------------------------------------------------------------------- /src/shared/dto/error.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | 3 | export class ErrorDto { 4 | @ApiProperty() 5 | error: string; 6 | 7 | @ApiProperty() 8 | message: string; 9 | 10 | @ApiProperty() 11 | statusCode: number; 12 | } 13 | -------------------------------------------------------------------------------- /src/shared/dto/flag.dto.ts: -------------------------------------------------------------------------------- 1 | export enum Network { 2 | MAIN_NET = 'MainNet', 3 | TEST_NET = 'TestNet', 4 | PLAYGROUND = 'Playground', 5 | LOCAL = 'Local', 6 | } 7 | 8 | export enum Platform { 9 | IOS = 'ios', 10 | ANDROID = 'android', 11 | WEB = 'web', 12 | } 13 | 14 | export class FlagDto { 15 | id: string; 16 | name: string; 17 | stage: 'beta' | 'public'; 18 | version: string; 19 | description: string; 20 | networks: Network[]; 21 | platforms: Platform[]; 22 | } 23 | -------------------------------------------------------------------------------- /src/shared/i18n/de/payment.json: -------------------------------------------------------------------------------- 1 | { 2 | "sticker": { 3 | "pay_with_crypto": "Scannen und bezahlen mit" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/shared/i18n/en/payment.json: -------------------------------------------------------------------------------- 1 | { 2 | "sticker": { 3 | "pay_with_crypto": "Scan and pay with" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/shared/i18n/fr/payment.json: -------------------------------------------------------------------------------- 1 | { 2 | "sticker": { 3 | "pay_with_crypto": "Scannez et payez avec" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/shared/i18n/it/payment.json: -------------------------------------------------------------------------------- 1 | { 2 | "sticker": { 3 | "pay_with_crypto": "Scansiona e paga con" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/shared/i18n/sq/payment.json: -------------------------------------------------------------------------------- 1 | { 2 | "sticker": { 3 | "pay_with_crypto": "Skanoni dhe paguani me" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/shared/models/asset/asset.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { CachedRepository } from 'src/shared/repositories/cached.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Asset } from './asset.entity'; 5 | 6 | @Injectable() 7 | export class AssetRepository extends CachedRepository { 8 | constructor(manager: EntityManager) { 9 | super(Asset, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/shared/models/asset/dto/asset-query.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiPropertyOptional } from '@nestjs/swagger'; 2 | import { IsOptional, IsString } from 'class-validator'; 3 | 4 | export class AssetQueryDto { 5 | @ApiPropertyOptional({ type: String, description: 'Comma-separated blockchain list' }) 6 | @IsOptional() 7 | @IsString() 8 | blockchains?: string; 9 | 10 | // hidden flag 11 | @IsOptional() 12 | @IsString() 13 | includePrivate: string; 14 | } 15 | -------------------------------------------------------------------------------- /src/shared/models/asset/dto/update-asset.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsBoolean, IsOptional, IsString } from 'class-validator'; 2 | 3 | export class UpdateAssetDto { 4 | @IsOptional() 5 | @IsString() 6 | financialType: string; 7 | 8 | @IsOptional() 9 | @IsBoolean() 10 | buyable: boolean; 11 | 12 | @IsOptional() 13 | @IsBoolean() 14 | sellable: boolean; 15 | } 16 | -------------------------------------------------------------------------------- /src/shared/models/country/country.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { CachedRepository } from 'src/shared/repositories/cached.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Country } from './country.entity'; 5 | 6 | @Injectable() 7 | export class CountryRepository extends CachedRepository { 8 | constructor(manager: EntityManager) { 9 | super(Country, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/shared/models/fiat/__mocks__/fiat.entity.mock.ts: -------------------------------------------------------------------------------- 1 | import { Fiat } from '../fiat.entity'; 2 | 3 | const defaultFiat: Partial = { 4 | id: 1, 5 | name: 'EUR', 6 | }; 7 | 8 | export function createDefaultFiat(): Fiat { 9 | return createCustomFiat({}); 10 | } 11 | 12 | export function createCustomFiat(customValues: Partial): Fiat { 13 | return Object.assign(new Fiat(), { ...defaultFiat, ...customValues }); 14 | } 15 | -------------------------------------------------------------------------------- /src/shared/models/fiat/fiat.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { CachedRepository } from 'src/shared/repositories/cached.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Fiat } from './fiat.entity'; 5 | 6 | @Injectable() 7 | export class FiatRepository extends CachedRepository { 8 | constructor(manager: EntityManager) { 9 | super(Fiat, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/shared/models/ip-log/ip-log.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { IpLog } from './ip-log.entity'; 5 | 6 | @Injectable() 7 | export class IpLogRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(IpLog, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/shared/models/language/__mocks__/language.entity.mock.ts: -------------------------------------------------------------------------------- 1 | import { Language } from '../language.entity'; 2 | 3 | const defaultLanguage: Partial = { 4 | id: 1, 5 | symbol: 'DE', 6 | name: 'Deutsch', 7 | updated: undefined, 8 | created: undefined, 9 | }; 10 | 11 | export function createDefaultLanguage(): Language { 12 | return createCustomLanguage({}); 13 | } 14 | 15 | export function createCustomLanguage(customValues: Partial): Language { 16 | return Object.assign(new Language(), { ...defaultLanguage, ...customValues }); 17 | } 18 | -------------------------------------------------------------------------------- /src/shared/models/language/dto/language.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | 3 | export class LanguageDto { 4 | @ApiProperty() 5 | id: number; 6 | 7 | @ApiProperty() 8 | name: string; 9 | 10 | @ApiProperty() 11 | symbol: string; 12 | 13 | @ApiProperty() 14 | foreignName: string; 15 | 16 | @ApiProperty() 17 | enable: boolean; 18 | } 19 | -------------------------------------------------------------------------------- /src/shared/models/language/language.entity.ts: -------------------------------------------------------------------------------- 1 | import { Entity, Column } from 'typeorm'; 2 | import { IEntity } from '../entity'; 3 | 4 | @Entity() 5 | export class Language extends IEntity { 6 | @Column({ unique: true, length: 10 }) 7 | symbol: string; 8 | 9 | @Column({ length: 256 }) 10 | name: string; 11 | 12 | @Column({ length: 256 }) 13 | foreignName: string; 14 | 15 | @Column({ default: true }) 16 | enable: boolean; 17 | } 18 | -------------------------------------------------------------------------------- /src/shared/models/language/language.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { CachedRepository } from 'src/shared/repositories/cached.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Language } from './language.entity'; 5 | 6 | @Injectable() 7 | export class LanguageRepository extends CachedRepository { 8 | constructor(manager: EntityManager) { 9 | super(Language, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/shared/models/setting/dto/custom-sign-up-fees.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsArray, IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator'; 2 | 3 | export class CustomSignUpFeesDto { 4 | @IsNotEmpty() 5 | @IsString() 6 | label: string; 7 | 8 | @IsOptional() 9 | @IsString() 10 | ref?: string; 11 | 12 | @IsOptional() 13 | @IsArray() 14 | fees?: number[]; 15 | 16 | @IsOptional() 17 | @IsNumber() 18 | wallet?: number; 19 | } 20 | -------------------------------------------------------------------------------- /src/shared/models/setting/dto/info-banner.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | 3 | export class InfoBannerDto { 4 | @ApiProperty() 5 | de: string; 6 | 7 | @ApiProperty() 8 | en: string; 9 | 10 | @ApiProperty() 11 | fr: string; 12 | 13 | @ApiProperty() 14 | it: string; 15 | } 16 | 17 | export interface InfoBannerSetting { 18 | from: string; 19 | to: string; 20 | content: InfoBannerDto; 21 | } 22 | -------------------------------------------------------------------------------- /src/shared/models/setting/dto/update-process.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsEnum, IsNotEmpty } from 'class-validator'; 2 | import { Process } from 'src/shared/services/process.service'; 3 | 4 | export class UpdateProcessDto { 5 | @IsNotEmpty() 6 | @IsEnum(Process) 7 | process: Process; 8 | } 9 | -------------------------------------------------------------------------------- /src/shared/models/setting/setting.entity.ts: -------------------------------------------------------------------------------- 1 | import { Column, Entity } from 'typeorm'; 2 | import { IEntity } from '../entity'; 3 | 4 | @Entity() 5 | export class Setting extends IEntity { 6 | @Column({ length: 256, unique: true }) 7 | key: string; 8 | 9 | @Column({ length: 'MAX' }) 10 | value: string; 11 | } 12 | -------------------------------------------------------------------------------- /src/shared/models/setting/setting.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Setting } from './setting.entity'; 5 | 6 | @Injectable() 7 | export class SettingRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(Setting, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/shared/utils/custom-cron-expression.ts: -------------------------------------------------------------------------------- 1 | export enum CustomCronExpression { 2 | EVERY_MINUTE_AT_30_SECONDS = '30 * * * * *', 3 | EVERY_15_SECONDS = '*/15 * * * * *', 4 | EVERY_15_MINUTES = '0 */15 * * * *', 5 | } 6 | -------------------------------------------------------------------------------- /src/shared/utils/parallel-queue.ts: -------------------------------------------------------------------------------- 1 | import { QueueHandler } from './queue-handler'; 2 | 3 | export function ParallelQueue(maxWorker: number) { 4 | const queue = QueueHandler.createParallelQueueHandler(maxWorker); 5 | 6 | return function (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) { 7 | const method = descriptor.value; 8 | 9 | descriptor.value = function (...args: any[]) { 10 | return queue.handle(async () => method.apply(this, args)); 11 | }; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /src/shared/utils/test.shared.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { PassportModule } from '@nestjs/passport'; 3 | 4 | @Module({ 5 | imports: [PassportModule.register({ defaultStrategy: 'jwt', session: true })], 6 | controllers: [], 7 | providers: [], 8 | exports: [PassportModule], 9 | }) 10 | export class TestSharedModule {} 11 | -------------------------------------------------------------------------------- /src/shared/utils/test.util.ts: -------------------------------------------------------------------------------- 1 | import { Provider } from '@nestjs/common'; 2 | import { ConfigService, Configuration } from 'src/config/config'; 3 | import { DeepPartial } from 'typeorm'; 4 | 5 | export class TestUtil { 6 | static provideConfig(config: DeepPartial = {}): Provider { 7 | const conf = { ...new Configuration(), ...config } as Configuration; 8 | return { provide: ConfigService, useValue: new ConfigService(conf) }; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/core/aml/entities/sanction.entity.ts: -------------------------------------------------------------------------------- 1 | import { IEntity } from 'src/shared/models/entity'; 2 | import { Column, Entity } from 'typeorm'; 3 | 4 | @Entity() 5 | export class Sanction extends IEntity { 6 | @Column() 7 | currency: string; 8 | 9 | @Column() 10 | address: string; 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/aml/enums/aml-list-status.enum.ts: -------------------------------------------------------------------------------- 1 | export enum AmlListStatus { 2 | ACTIVE = 'Active', 3 | DEACTIVATED = 'Deactivated', 4 | } 5 | -------------------------------------------------------------------------------- /src/subdomains/core/aml/enums/check-status.enum.ts: -------------------------------------------------------------------------------- 1 | export enum CheckStatus { 2 | PASS = 'Pass', 3 | FAIL = 'Fail', 4 | PENDING = 'Pending', 5 | GSHEET = 'GSheet', 6 | UNNECESSARY = 'Unnecessary', 7 | } 8 | -------------------------------------------------------------------------------- /src/subdomains/core/aml/repositories/sanction.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Sanction } from '../entities/sanction.entity'; 5 | 6 | @Injectable() 7 | export class SanctionRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(Sanction, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/buy-crypto/process/exceptions/abort-batch-creation.exception.ts: -------------------------------------------------------------------------------- 1 | export class MissingBuyCryptoLiquidityException extends Error { 2 | constructor(message: string) { 3 | super(message); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/subdomains/core/buy-crypto/process/repositories/buy-crypto-batch.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { BuyCryptoBatch } from '../entities/buy-crypto-batch.entity'; 5 | 6 | @Injectable() 7 | export class BuyCryptoBatchRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(BuyCryptoBatch, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/buy-crypto/routes/buy/buy.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Buy } from './buy.entity'; 5 | 6 | @Injectable() 7 | export class BuyRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(Buy, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/buy-crypto/routes/buy/dto/buy-history.dto.ts: -------------------------------------------------------------------------------- 1 | import { HistoryDtoDeprecated } from 'src/subdomains/core/history/dto/history.dto'; 2 | 3 | export class BuyHistoryDto extends HistoryDtoDeprecated {} 4 | -------------------------------------------------------------------------------- /src/subdomains/core/buy-crypto/routes/buy/dto/create-buy.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { Type } from 'class-transformer'; 3 | import { IsNotEmptyObject, ValidateNested } from 'class-validator'; 4 | import { EntityDto } from 'src/shared/dto/entity.dto'; 5 | import { Asset } from 'src/shared/models/asset/asset.entity'; 6 | 7 | export class CreateBuyDto { 8 | @ApiProperty({ type: EntityDto }) 9 | @IsNotEmptyObject() 10 | @ValidateNested() 11 | @Type(() => EntityDto) 12 | asset: Asset; 13 | } 14 | -------------------------------------------------------------------------------- /src/subdomains/core/buy-crypto/routes/buy/dto/pdf.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | 3 | export class PdfDto { 4 | @ApiProperty({ description: 'Base64 encoded PDF' }) 5 | pdfData: string; 6 | } 7 | -------------------------------------------------------------------------------- /src/subdomains/core/buy-crypto/routes/buy/dto/update-buy.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { IsBoolean, IsNotEmpty } from 'class-validator'; 3 | 4 | export class UpdateBuyDto { 5 | @ApiProperty() 6 | @IsNotEmpty() 7 | @IsBoolean() 8 | active: boolean; 9 | } 10 | -------------------------------------------------------------------------------- /src/subdomains/core/buy-crypto/routes/swap/dto/update-swap.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { IsBoolean, IsNotEmpty } from 'class-validator'; 3 | 4 | export class UpdateSwapDto { 5 | @ApiProperty() 6 | @IsNotEmpty() 7 | @IsBoolean() 8 | active: boolean; 9 | } 10 | -------------------------------------------------------------------------------- /src/subdomains/core/buy-crypto/routes/swap/swap.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Swap } from './swap.entity'; 5 | 6 | @Injectable() 7 | export class SwapRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(Swap, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/custody/dto/output/custody-auth.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | 3 | export class CustodyAuthDto { 4 | @ApiProperty({ description: 'Access token of DFX API' }) 5 | accessToken: string; 6 | } 7 | -------------------------------------------------------------------------------- /src/subdomains/core/custody/repositories/custody-balance.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { CustodyBalance } from '../entities/custody-balance.entity'; 5 | 6 | @Injectable() 7 | export class CustodyBalanceRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(CustodyBalance, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/custody/repositories/custody-order-step.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { CustodyOrderStep } from '../entities/custody-order-step.entity'; 5 | 6 | @Injectable() 7 | export class CustodyOrderStepRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(CustodyOrderStep, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/custody/repositories/custody-order.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { CustodyOrder } from '../entities/custody-order.entity'; 5 | 6 | @Injectable() 7 | export class CustodyOrderRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(CustodyOrder, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/history/dto/transaction-filter.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiPropertyOptional } from '@nestjs/swagger'; 2 | import { Type } from 'class-transformer'; 3 | import { IsDate, IsOptional } from 'class-validator'; 4 | 5 | export class TransactionFilter { 6 | @ApiPropertyOptional() 7 | @IsOptional() 8 | @IsDate() 9 | @Type(() => Date) 10 | from?: Date; 11 | 12 | @ApiPropertyOptional() 13 | @IsOptional() 14 | @IsDate() 15 | @Type(() => Date) 16 | to?: Date; 17 | } 18 | -------------------------------------------------------------------------------- /src/subdomains/core/history/dto/transaction-refund.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { Transform } from 'class-transformer'; 3 | import { IsNotEmpty, IsString } from 'class-validator'; 4 | import { Util } from 'src/shared/utils/util'; 5 | 6 | export class TransactionRefundDto { 7 | @ApiProperty({ description: 'Refund address or refund IBAN' }) 8 | @IsNotEmpty() 9 | @IsString() 10 | @Transform(Util.trimAll) 11 | @Transform(Util.sanitize) 12 | refundTarget: string; 13 | } 14 | -------------------------------------------------------------------------------- /src/subdomains/core/liquidity-management/dto/input/liquidity-management-request.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsBoolean, IsInt, IsNotEmpty, IsNumber, IsOptional } from 'class-validator'; 2 | 3 | export class LiquidityManagementRequestDto { 4 | @IsNotEmpty() 5 | @IsInt() 6 | assetId: number; 7 | 8 | @IsNotEmpty() 9 | @IsNumber() 10 | minAmount: number; 11 | 12 | @IsOptional() 13 | @IsNumber() 14 | maxAmount?: number; 15 | 16 | @IsNotEmpty() 17 | @IsBoolean() 18 | targetOptimal: boolean; 19 | } 20 | -------------------------------------------------------------------------------- /src/subdomains/core/liquidity-management/dto/input/liquidity-management-settings.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsInt, IsOptional } from 'class-validator'; 2 | 3 | export class LiquidityManagementRuleSettingsDto { 4 | @IsOptional() 5 | @IsInt() 6 | reactivationTime?: number; 7 | } 8 | -------------------------------------------------------------------------------- /src/subdomains/core/liquidity-management/exceptions/order-failed.exception.ts: -------------------------------------------------------------------------------- 1 | // order failed - stop the pipeline 2 | export class OrderFailedException extends Error { 3 | constructor(message: string) { 4 | super(message); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/subdomains/core/liquidity-management/exceptions/order-not-necessary.exception.ts: -------------------------------------------------------------------------------- 1 | // order not necessary - requirements already fulfilled 2 | export class OrderNotNecessaryException extends Error { 3 | constructor(message: string) { 4 | super(message); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/subdomains/core/liquidity-management/exceptions/order-not-processable.exception.ts: -------------------------------------------------------------------------------- 1 | // order currently not processable - pipeline should continue with next step 2 | export class OrderNotProcessableException extends Error { 3 | constructor(message: string) { 4 | super(message); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/subdomains/core/liquidity-management/repositories/liquidity-balance.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { LiquidityBalance } from '../entities/liquidity-balance.entity'; 5 | 6 | @Injectable() 7 | export class LiquidityBalanceRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(LiquidityBalance, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/monitoring/system-state-snapshot.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { SystemStateSnapshot } from './system-state-snapshot.entity'; 5 | 6 | @Injectable() 7 | export class SystemStateSnapshotRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(SystemStateSnapshot, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/payment-link/dto/payment-recipient-mapper.ts: -------------------------------------------------------------------------------- 1 | import { FiatDtoMapper } from 'src/shared/models/fiat/dto/fiat-dto.mapper'; 2 | import { Sell } from 'src/subdomains/core/sell-crypto/route/sell.entity'; 3 | import { PaymentRecipientDto } from './payment-recipient.dto'; 4 | 5 | export class PaymentRecipientMapper { 6 | static toDto(sell: Sell): PaymentRecipientDto { 7 | return { 8 | id: sell.id, 9 | currency: FiatDtoMapper.toDto(sell.fiat), 10 | }; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/subdomains/core/payment-link/dto/payment-recipient.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { FiatDto } from 'src/shared/models/fiat/dto/fiat.dto'; 3 | 4 | export class PaymentRecipientDto { 5 | @ApiProperty() 6 | id: number; 7 | 8 | @ApiProperty({ type: FiatDto }) 9 | currency: FiatDto; 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/core/payment-link/dto/update-payment-link-payment.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsOptional, IsString } from 'class-validator'; 2 | 3 | export class UpdatePaymentLinkPaymentDto { 4 | @IsOptional() 5 | @IsString() 6 | deviceId: string; 7 | 8 | @IsOptional() 9 | @IsString() 10 | deviceCommand: string; 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/payment-link/repositories/payment-activation.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { PaymentActivation } from '../entities/payment-activation.entity'; 5 | 6 | @Injectable() 7 | export class PaymentActivationRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(PaymentActivation, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/payment-link/repositories/payment-link-payment.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { PaymentLinkPayment } from '../entities/payment-link-payment.entity'; 5 | 6 | @Injectable() 7 | export class PaymentLinkPaymentRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(PaymentLinkPayment, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/payment-link/repositories/payment-quote.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { PaymentQuote } from '../entities/payment-quote.entity'; 5 | 6 | @Injectable() 7 | export class PaymentQuoteRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(PaymentQuote, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/referral/process/ref.entity.ts: -------------------------------------------------------------------------------- 1 | import { IEntity } from 'src/shared/models/entity'; 2 | import { Entity, Column } from 'typeorm'; 3 | 4 | @Entity() 5 | export class Ref extends IEntity { 6 | @Column({ length: 256, unique: true }) 7 | ip: string; 8 | 9 | @Column({ length: 256, nullable: true }) 10 | ref?: string; 11 | 12 | @Column({ length: 256, nullable: true }) 13 | origin?: string; 14 | } 15 | -------------------------------------------------------------------------------- /src/subdomains/core/referral/reward/dto/update-ref-reward.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsEnum, IsOptional } from 'class-validator'; 2 | import { RewardStatus } from '../ref-reward.entity'; 3 | 4 | export class UpdateRefRewardDto { 5 | @IsOptional() 6 | @IsEnum(RewardStatus) 7 | status: RewardStatus; 8 | } 9 | -------------------------------------------------------------------------------- /src/subdomains/core/referral/reward/ref-reward.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { RefReward } from './ref-reward.entity'; 5 | 6 | @Injectable() 7 | export class RefRewardRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(RefReward, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/route/dto/create-route.dto.ts: -------------------------------------------------------------------------------- 1 | import { Buy } from '../../buy-crypto/routes/buy/buy.entity'; 2 | import { Swap } from '../../buy-crypto/routes/swap/swap.entity'; 3 | import { Sell } from '../../sell-crypto/route/sell.entity'; 4 | 5 | export class CreateRouteDto { 6 | buy?: Buy; 7 | sell?: Sell; 8 | swap?: Swap; 9 | } 10 | -------------------------------------------------------------------------------- /src/subdomains/core/route/dto/update-route.dto.ts: -------------------------------------------------------------------------------- 1 | import { Transform } from 'class-transformer'; 2 | import { IsOptional, IsString } from 'class-validator'; 3 | import { Util } from 'src/shared/utils/util'; 4 | 5 | export class UpdateRouteDto { 6 | @IsOptional() 7 | @IsString() 8 | @Transform(Util.sanitize) 9 | label: string; 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/core/route/route.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Route } from './route.entity'; 5 | 6 | @Injectable() 7 | export class RouteRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(Route, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/sell-crypto/process/buy-fiat.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { BuyFiat } from './buy-fiat.entity'; 5 | 6 | @Injectable() 7 | export class BuyFiatRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(BuyFiat, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/sell-crypto/route/dto/sell-history.dto.ts: -------------------------------------------------------------------------------- 1 | import { HistoryDtoDeprecated } from '../../../history/dto/history.dto'; 2 | 3 | export class SellHistoryDto extends HistoryDtoDeprecated {} 4 | -------------------------------------------------------------------------------- /src/subdomains/core/sell-crypto/route/dto/update-sell.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { IsBoolean, IsNotEmpty } from 'class-validator'; 3 | 4 | export class UpdateSellDto { 5 | @ApiProperty() 6 | @IsNotEmpty() 7 | @IsBoolean() 8 | active: boolean; 9 | } 10 | -------------------------------------------------------------------------------- /src/subdomains/core/sell-crypto/route/sell.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Sell } from './sell.entity'; 5 | 6 | @Injectable() 7 | export class SellRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(Sell, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/staking/repositories/crypto-staking.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { CryptoStaking } from '../entities/crypto-staking.entity'; 5 | 6 | @Injectable() 7 | export class CryptoStakingRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(CryptoStaking, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/staking/repositories/staking-ref-reward.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { StakingRefReward } from '../entities/staking-ref-reward.entity'; 5 | 6 | @Injectable() 7 | export class StakingRefRewardRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(StakingRefReward, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/staking/repositories/staking-reward.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { StakingReward } from '../entities/staking-reward.entity'; 5 | 6 | @Injectable() 7 | export class StakingRewardRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(StakingReward, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/staking/repositories/staking.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Staking } from '../entities/staking.entity'; 5 | 6 | @Injectable() 7 | export class StakingRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(Staking, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/trading/dto/trading.dto.ts: -------------------------------------------------------------------------------- 1 | import { FeeAmount } from '@uniswap/v3-sdk'; 2 | import { Asset } from 'src/shared/models/asset/asset.entity'; 3 | 4 | export interface TradingInfo { 5 | price1: number; 6 | price2: number; 7 | price3: number; 8 | priceImpact: number; 9 | poolFee: FeeAmount; 10 | assetIn?: Asset; 11 | assetOut?: Asset; 12 | amountIn?: number; 13 | amountExpected?: number; 14 | tradeRequired: boolean; 15 | message?: string; 16 | } 17 | -------------------------------------------------------------------------------- /src/subdomains/core/trading/enums/index.ts: -------------------------------------------------------------------------------- 1 | export enum TradingRuleStatus { 2 | ACTIVE = 'Active', 3 | INACTIVE = 'Inactive', 4 | PAUSED = 'Paused', 5 | PROCESSING = 'Processing', 6 | } 7 | 8 | export enum TradingOrderStatus { 9 | CREATED = 'Created', 10 | IN_PROGRESS = 'InProgress', 11 | COMPLETE = 'Complete', 12 | FAILED = 'Failed', 13 | IGNORED = 'Ignored', 14 | } 15 | -------------------------------------------------------------------------------- /src/subdomains/core/trading/exceptions/waiting-for-liquidity.exception.ts: -------------------------------------------------------------------------------- 1 | export class WaitingForLiquidityException extends Error { 2 | constructor(message: string) { 3 | super(message); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/subdomains/core/trading/repositories/trading-order.respository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { TradingOrder } from '../entities/trading-order.entity'; 5 | 6 | @Injectable() 7 | export class TradingOrderRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(TradingOrder, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/core/trading/repositories/trading-rule.respository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { TradingRule } from '../entities/trading-rule.entity'; 5 | 6 | @Injectable() 7 | export class TradingRuleRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(TradingRule, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/generic/forwarding/dto/payment.dto.ts: -------------------------------------------------------------------------------- 1 | import { PaymentLinkPaymentStatus } from 'src/subdomains/core/payment-link/enums'; 2 | 3 | export class PaymentDto { 4 | status: PaymentLinkPaymentStatus; 5 | } 6 | -------------------------------------------------------------------------------- /src/subdomains/generic/generic.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { AdminModule } from './admin/admin.module'; 3 | import { ForwardingModule } from './forwarding/forwarding.module'; 4 | import { GsModule } from './gs/gs.module'; 5 | import { KycModule } from './kyc/kyc.module'; 6 | import { UserModule } from './user/user.module'; 7 | 8 | @Module({ 9 | imports: [AdminModule, UserModule, GsModule, KycModule, ForwardingModule], 10 | controllers: [], 11 | providers: [], 12 | exports: [], 13 | }) 14 | export class GenericModule {} 15 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/dto/ident-result-data.dto.ts: -------------------------------------------------------------------------------- 1 | export enum IdentType { 2 | SUM_SUB = 'Sumsub', 3 | ID_NOW = 'IdNow', 4 | MANUAL = 'Manual', 5 | } 6 | 7 | export interface IdentResultData { 8 | type: IdentType; 9 | firstname: string; 10 | lastname: string; 11 | birthname: string; 12 | documentType: string; 13 | documentNumber: string; 14 | kycType: string; 15 | birthday: Date; 16 | nationality: string; 17 | success: boolean; 18 | } 19 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/dto/input/start-2fa.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiPropertyOptional } from '@nestjs/swagger'; 2 | import { IsEnum, IsNotEmpty } from 'class-validator'; 3 | import { TfaLevel } from '../../services/tfa.service'; 4 | 5 | export class Start2faDto { 6 | @ApiPropertyOptional({ enum: TfaLevel, description: '2FA level' }) 7 | @IsNotEmpty() 8 | @IsEnum(TfaLevel) 9 | level: TfaLevel = TfaLevel.STRICT; 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/dto/input/update-kyc-step.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator'; 2 | import { ReviewStatus } from '../../enums/review-status.enum'; 3 | 4 | export class UpdateKycStepDto { 5 | @IsNotEmpty() 6 | @IsEnum(ReviewStatus) 7 | status: ReviewStatus; 8 | 9 | @IsOptional() 10 | @IsString() 11 | result?: string; 12 | 13 | @IsOptional() 14 | @IsString() 15 | comment?: string; 16 | } 17 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/dto/input/update-name-check-log.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsEnum, IsNotEmpty, IsString } from 'class-validator'; 2 | import { RiskEvaluation } from '../../entities/name-check-log.entity'; 3 | 4 | export class UpdateNameCheckLogDto { 5 | @IsNotEmpty() 6 | @IsEnum(RiskEvaluation) 7 | riskEvaluation: RiskEvaluation; 8 | 9 | @IsNotEmpty() 10 | @IsString() 11 | comment: string; 12 | } 13 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/dto/input/verify-2fa.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { IsNotEmpty, IsString } from 'class-validator'; 3 | 4 | export class Verify2faDto { 5 | @ApiProperty({ description: '2FA token' }) 6 | @IsNotEmpty() 7 | @IsString() 8 | token: string; 9 | } 10 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/dto/kyc-webhook-trigger.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsInt, IsNotEmpty, IsOptional, IsString, ValidateIf } from 'class-validator'; 2 | 3 | export class KycWebhookTriggerDto { 4 | @ValidateIf((b: KycWebhookTriggerDto) => Boolean(b.userDataId || !b.kycStepId)) 5 | @IsNotEmpty() 6 | @IsInt() 7 | userDataId: number; 8 | 9 | @ValidateIf((b: KycWebhookTriggerDto) => Boolean(b.kycStepId || !b.userDataId)) 10 | @IsNotEmpty() 11 | @IsInt() 12 | kycStepId: number; 13 | 14 | @IsOptional() 15 | @IsString() 16 | reason?: string; 17 | } 18 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/dto/output/kyc-merged.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { ErrorDto } from 'src/shared/dto/error.dto'; 3 | 4 | export class MergedDto extends ErrorDto { 5 | @ApiProperty() 6 | switchToCode: string; 7 | } 8 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/dto/output/setup-2fa.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; 2 | 3 | export enum TfaType { 4 | APP = 'App', 5 | MAIL = 'Mail', 6 | } 7 | 8 | export class Setup2faDto { 9 | @ApiProperty({ enum: TfaType }) 10 | type: TfaType; 11 | 12 | @ApiPropertyOptional() 13 | secret?: string; 14 | 15 | @ApiPropertyOptional() 16 | uri?: string; 17 | } 18 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/entities/kyc-file-log.entity.ts: -------------------------------------------------------------------------------- 1 | import { ChildEntity } from 'typeorm'; 2 | import { KycLog } from './kyc-log.entity'; 3 | 4 | @ChildEntity() 5 | export class KycFileLog extends KycLog {} 6 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/entities/mail-change-log.entity.ts: -------------------------------------------------------------------------------- 1 | import { ChildEntity } from 'typeorm'; 2 | import { KycLog } from './kyc-log.entity'; 3 | 4 | @ChildEntity() 5 | export class MailChangeLog extends KycLog {} 6 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/entities/manual-log.entity.ts: -------------------------------------------------------------------------------- 1 | import { ChildEntity } from 'typeorm'; 2 | import { KycLog } from './kyc-log.entity'; 3 | 4 | @ChildEntity() 5 | export class ManualLog extends KycLog {} 6 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/entities/merge-log.entity.ts: -------------------------------------------------------------------------------- 1 | import { ChildEntity } from 'typeorm'; 2 | import { KycLog } from './kyc-log.entity'; 3 | 4 | @ChildEntity() 5 | export class MergeLog extends KycLog {} 6 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/entities/step-log.entity.ts: -------------------------------------------------------------------------------- 1 | import { ChildEntity, Column, ManyToOne } from 'typeorm'; 2 | import { ReviewStatus } from '../enums/review-status.enum'; 3 | import { KycLog } from './kyc-log.entity'; 4 | import { KycStep } from './kyc-step.entity'; 5 | 6 | @ChildEntity() 7 | export class StepLog extends KycLog { 8 | @ManyToOne(() => KycStep, (s) => s.logs, { onDelete: 'CASCADE' }) 9 | kycStep: KycStep; 10 | 11 | @Column() 12 | status: ReviewStatus; 13 | } 14 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/entities/totp-auth-log.entity.ts: -------------------------------------------------------------------------------- 1 | import { ChildEntity, Column } from 'typeorm'; 2 | import { KycLog } from './kyc-log.entity'; 3 | 4 | @ChildEntity() 5 | export class TfaLog extends KycLog { 6 | @Column() 7 | ipAddress: string; 8 | } 9 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/enums/content-type.enum.ts: -------------------------------------------------------------------------------- 1 | export enum ContentType { 2 | PNG = 'image/png', 3 | JPEG = 'image/jpeg', 4 | JPG = 'image/jpg', 5 | JSON = 'application/json', 6 | PDF = 'application/pdf', 7 | TEXT = 'text/plain', 8 | XML = 'text/xml', 9 | ZIP = 'application/zip', 10 | MP3 = 'audio/mpeg', 11 | MP4 = 'video/mp4', 12 | } 13 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/enums/file-category.enum.ts: -------------------------------------------------------------------------------- 1 | export enum FileCategory { 2 | USER = 'user', 3 | SPIDER = 'spider', 4 | } 5 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/repositories/kyc-file.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { KycFile } from '../entities/kyc-file.entity'; 5 | 6 | @Injectable() 7 | export class KycFileRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(KycFile, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/repositories/kyc-log.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { KycLog } from '../entities/kyc-log.entity'; 5 | 6 | @Injectable() 7 | export class KycLogRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(KycLog, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/repositories/kyc-step.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { KycStep } from '../entities/kyc-step.entity'; 5 | 6 | @Injectable() 7 | export class KycStepRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(KycStep, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/repositories/name-check-log.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { NameCheckLog } from '../entities/name-check-log.entity'; 5 | 6 | @Injectable() 7 | export class NameCheckLogRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(NameCheckLog, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/repositories/step-log.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { StepLog } from '../entities/step-log.entity'; 5 | 6 | @Injectable() 7 | export class StepLogRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(StepLog, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/generic/kyc/repositories/tfa-log.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { TfaLog } from '../entities/totp-auth-log.entity'; 5 | 6 | @Injectable() 7 | export class TfaLogRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(TfaLog, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/account-merge/account-merge.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { AccountMerge } from './account-merge.entity'; 5 | 6 | @Injectable() 7 | export class AccountMergeRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(AccountMerge, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/auth/dto/auth-response.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | 3 | export class AuthResponseDto { 4 | @ApiProperty({ 5 | description: 'Access token of DFX API', 6 | }) 7 | accessToken: string; 8 | } 9 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/auth/dto/challenge.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | 3 | export class ChallengeDto { 4 | @ApiProperty({ 5 | description: 'Challenge to sign', 6 | }) 7 | challenge: string; 8 | } 9 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/auth/dto/merge-response.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; 2 | 3 | export class MergeResponseDto { 4 | @ApiProperty({ 5 | description: 'KYC hash', 6 | }) 7 | kycHash: string; 8 | 9 | @ApiPropertyOptional({ 10 | description: 'Updated access token', 11 | }) 12 | accessToken?: string; 13 | } 14 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/auth/dto/redirect-response.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | 3 | export class RedirectResponseDto { 4 | @ApiProperty({ 5 | description: 'Redirect URL', 6 | }) 7 | redirectUrl: string; 8 | } 9 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/auth/dto/sign-message.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { Blockchain } from 'src/integration/blockchain/shared/enums/blockchain.enum'; 3 | 4 | export class SignMessageDto { 5 | @ApiProperty({ 6 | description: 'Message to sign', 7 | }) 8 | message: string; 9 | 10 | @ApiProperty({ 11 | description: 'List of blockchains', 12 | isArray: true, 13 | enum: Blockchain, 14 | }) 15 | blockchains: Blockchain[]; 16 | } 17 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/auth/dto/verify-sign-message.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | 3 | export class VerifySignMessageDto { 4 | @ApiProperty({ description: 'Result of message signature verification' }) 5 | isValid: boolean; 6 | } 7 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/custody-provider/custody-provider.entity.ts: -------------------------------------------------------------------------------- 1 | import { IEntity } from 'src/shared/models/entity'; 2 | import { Column, Entity } from 'typeorm'; 3 | 4 | @Entity() 5 | export class CustodyProvider extends IEntity { 6 | @Column({ length: 256 }) 7 | name: string; 8 | 9 | @Column({ length: 256, nullable: true }) 10 | mail: string; 11 | 12 | @Column({ length: 256, unique: true }) 13 | masterKey: string; 14 | } 15 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/custody-provider/custody-provider.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { CachedRepository } from 'src/shared/repositories/cached.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { CustodyProvider } from './custody-provider.entity'; 5 | 6 | @Injectable() 7 | export class CustodyProviderRepository extends CachedRepository { 8 | constructor(manager: EntityManager) { 9 | super(CustodyProvider, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/custody-provider/dto/custody-provider.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; 2 | 3 | export class CustodyProviderDto { 4 | @IsNotEmpty() 5 | @IsString() 6 | name: string; 7 | 8 | @IsOptional() 9 | @IsString() 10 | mail: string; 11 | 12 | @IsNotEmpty() 13 | @IsString() 14 | masterKey: string; 15 | } 16 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/kyc/dto/kyc-data-transfer.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { IsNotEmpty, IsString } from 'class-validator'; 3 | 4 | export class KycDataTransferDto { 5 | @ApiProperty({ deprecated: true }) 6 | @IsNotEmpty() 7 | @IsString() 8 | walletName: string; 9 | } 10 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/kyc/dto/kyc-data.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { KycWebhookStatus } from '../../../services/webhook/dto/kyc-webhook.dto'; 3 | 4 | export class KycDataDto { 5 | @ApiProperty({ deprecated: true }) 6 | id: string; 7 | 8 | @ApiProperty({ enum: KycWebhookStatus, deprecated: true }) 9 | kycStatus: KycWebhookStatus; 10 | 11 | @ApiProperty({ deprecated: true }) 12 | kycHash: string; 13 | } 14 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/kyc/dto/kyc-file.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | 3 | export enum KycDocumentType { 4 | IDENTIFICATION = 'Identification', 5 | CHATBOT = 'Chatbot', 6 | INCORPORATION_CERTIFICATE = 'IncorporationCertificate', 7 | } 8 | 9 | export class KycFileDto { 10 | @ApiProperty({ enum: KycDocumentType, deprecated: true }) 11 | type: KycDocumentType; 12 | 13 | @ApiProperty({ deprecated: true }) 14 | contentType: string; 15 | } 16 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/organization/organization.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Organization } from './organization.entity'; 5 | 6 | @Injectable() 7 | export class OrganizationRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(Organization, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/user-data-relation/dto/update-user-data-relation.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsEnum, IsOptional } from 'class-validator'; 2 | import { SignatoryState } from './user-data-relation.enum'; 3 | 4 | export class UpdateUserDataRelationDto { 5 | @IsOptional() 6 | @IsEnum(SignatoryState) 7 | signatory?: SignatoryState; 8 | } 9 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/user-data-relation/dto/user-data-relation.enum.ts: -------------------------------------------------------------------------------- 1 | export enum UserDataRelationState { 2 | CONVERSION_PARTNER = 'ConversionPartner', 3 | BENEFICIAL_OWNER = 'BeneficialOwner', 4 | CONTRACTING_PARTNER = 'ContractingPartner', 5 | CONTROL_HOLDER = 'ControlHolder', 6 | WIFE = 'Wife', 7 | HUSBAND = 'Husband', 8 | SIGNATORY_ONLY = 'SignatoryOnly', 9 | } 10 | 11 | export enum SignatoryState { 12 | NO = 'No', 13 | SINGLE = 'Single', 14 | COLLECTIVE = 'Collective', 15 | } 16 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/user-data-relation/user-data-relation.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { UserDataRelation } from './user-data-relation.entity'; 5 | 6 | @Injectable() 7 | export class UserDataRelationRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(UserDataRelation, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/user-data/account-type.enum.ts: -------------------------------------------------------------------------------- 1 | export enum AccountType { 2 | PERSONAL = 'Personal', 3 | ORGANIZATION = 'Organization', 4 | SOLE_PROPRIETORSHIP = 'SoleProprietorship', 5 | } 6 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/user-data/kyc-identification-type.enum.ts: -------------------------------------------------------------------------------- 1 | export enum KycIdentificationType { 2 | ONLINE_ID = 'OnlineId', 3 | VIDEO_ID = 'VideoId', 4 | MANUAL = 'Manual', 5 | } 6 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/user/dto/alby.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { IsNotEmpty, IsUrl } from 'class-validator'; 3 | import { OptionalSignUpDto } from '../../auth/dto/auth-credentials.dto'; 4 | 5 | export class AlbySignupDto extends OptionalSignUpDto { 6 | @ApiProperty() 7 | @IsNotEmpty() 8 | @IsUrl() 9 | redirectUri: string; 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/user/dto/api-key.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | 3 | export class ApiKeyDto { 4 | @ApiProperty() 5 | key: string; 6 | 7 | @ApiProperty() 8 | secret: string; 9 | } 10 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/user/dto/download-user-data.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { IsArray, IsNotEmpty } from 'class-validator'; 3 | 4 | export class DownloadUserDataDto { 5 | @ApiProperty() 6 | @IsNotEmpty() 7 | @IsArray() 8 | userDataIds: number[]; 9 | } 10 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/user/dto/update-address.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiPropertyOptional } from '@nestjs/swagger'; 2 | import { Transform } from 'class-transformer'; 3 | import { IsOptional, IsString } from 'class-validator'; 4 | import { Util } from 'src/shared/utils/util'; 5 | 6 | export class UpdateAddressDto { 7 | @ApiPropertyOptional() 8 | @IsOptional() 9 | @IsString() 10 | @Transform(Util.sanitize) 11 | label?: string; 12 | } 13 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/user/dto/user-name.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { Transform } from 'class-transformer'; 3 | import { IsNotEmpty, IsString } from 'class-validator'; 4 | import { Util } from 'src/shared/utils/util'; 5 | 6 | export class UserNameDto { 7 | @ApiProperty() 8 | @IsNotEmpty() 9 | @IsString() 10 | @Transform(Util.sanitize) 11 | firstName: string; 12 | 13 | @ApiProperty() 14 | @IsNotEmpty() 15 | @IsString() 16 | @Transform(Util.sanitize) 17 | lastName: string; 18 | } 19 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/user/dto/verify-mail.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { IsNotEmpty, IsString } from 'class-validator'; 3 | 4 | export class VerifyMailDto { 5 | @ApiProperty({ description: 'Email verification token' }) 6 | @IsNotEmpty() 7 | @IsString() 8 | token: string; 9 | } 10 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/user/dto/volume-query.dto.ts: -------------------------------------------------------------------------------- 1 | import { Type } from 'class-transformer'; 2 | import { IsDate, IsNotEmpty, IsOptional, IsString } from 'class-validator'; 3 | 4 | export class VolumeQuery { 5 | @IsOptional() 6 | @IsDate() 7 | @Type(() => Date) 8 | from: Date = new Date(0); 9 | 10 | @IsOptional() 11 | @IsDate() 12 | @Type(() => Date) 13 | to: Date = new Date(); 14 | 15 | @IsNotEmpty() 16 | @IsString() 17 | userId: string; 18 | } 19 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/models/wallet/__mocks__/wallet.entity.mock.ts: -------------------------------------------------------------------------------- 1 | import { Wallet } from '../wallet.entity'; 2 | 3 | export function createDefaultWallet(): Wallet { 4 | return createCustomWallet({}); 5 | } 6 | 7 | export function createCustomWallet(customValues: Partial): Wallet { 8 | const { address } = customValues; 9 | const keys = Object.keys(customValues); 10 | 11 | const entity = new Wallet(); 12 | 13 | entity.address = keys.includes('address') ? address : 'x0ZZZYYY'; 14 | 15 | return entity; 16 | } 17 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/services/webhook/dto/create-webhook.dto.ts: -------------------------------------------------------------------------------- 1 | import { UserData } from '../../../models/user-data/user-data.entity'; 2 | import { User } from '../../../models/user/user.entity'; 3 | import { Wallet } from '../../../models/wallet/wallet.entity'; 4 | import { WebhookType } from './webhook.dto'; 5 | 6 | export interface CreateWebhookInput { 7 | type: WebhookType; 8 | identifier: string; 9 | data: string; 10 | reason?: string; 11 | user?: User; 12 | userData: UserData; 13 | wallet: Wallet; 14 | } 15 | -------------------------------------------------------------------------------- /src/subdomains/generic/user/services/webhook/webhook.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Webhook } from './webhook.entity'; 5 | 6 | @Injectable() 7 | export class WebhookRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(Webhook, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/address-pool/deposit/deposit.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Deposit } from './deposit.entity'; 5 | 6 | @Injectable() 7 | export class DepositRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(Deposit, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/address-pool/deposit/dto/create-deposit.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { IsEnum, IsInt, IsNotEmpty } from 'class-validator'; 3 | import { Blockchain } from 'src/integration/blockchain/shared/enums/blockchain.enum'; 4 | 5 | export class CreateDepositDto { 6 | @ApiProperty() 7 | @IsNotEmpty() 8 | @IsEnum(Blockchain) 9 | blockchain: Blockchain; 10 | 11 | @ApiProperty() 12 | @IsNotEmpty() 13 | @IsInt() 14 | count: number; 15 | } 16 | -------------------------------------------------------------------------------- /src/subdomains/supporting/address-pool/deposit/dto/deposit.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | import { Blockchain } from 'src/integration/blockchain/shared/enums/blockchain.enum'; 3 | 4 | export class DepositDto { 5 | @ApiProperty() 6 | id: number; 7 | 8 | @ApiProperty() 9 | address: string; 10 | 11 | @ApiProperty({ enum: Blockchain, deprecated: true }) 12 | blockchain: Blockchain; 13 | 14 | @ApiProperty({ enum: Blockchain, isArray: true }) 15 | blockchains: Blockchain[]; 16 | } 17 | -------------------------------------------------------------------------------- /src/subdomains/supporting/address-pool/route/deposit-route.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { DepositRoute } from './deposit-route.entity'; 5 | 6 | @Injectable() 7 | export class DepositRouteRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(DepositRoute, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/bank-tx/bank-tx-repeat/bank-tx-repeat.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { BankTxRepeat } from './bank-tx-repeat.entity'; 5 | 6 | @Injectable() 7 | export class BankTxRepeatRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(BankTxRepeat, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/bank-tx/bank-tx-return/bank-tx-return.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { BankTxReturn } from './bank-tx-return.entity'; 5 | 6 | @Injectable() 7 | export class BankTxReturnRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(BankTxReturn, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/bank-tx/bank-tx-return/dto/update-bank-tx-return.dto.ts: -------------------------------------------------------------------------------- 1 | import { IsNumber, IsOptional, IsString } from 'class-validator'; 2 | 3 | export class UpdateBankTxReturnDto { 4 | @IsOptional() 5 | @IsString() 6 | info?: string; 7 | 8 | @IsOptional() 9 | @IsNumber() 10 | amountInChf?: number; 11 | 12 | @IsOptional() 13 | @IsNumber() 14 | amountInEur?: number; 15 | 16 | @IsOptional() 17 | @IsNumber() 18 | amountInUsd?: number; 19 | } 20 | -------------------------------------------------------------------------------- /src/subdomains/supporting/bank-tx/bank-tx/__mocks__/bank-tx-batch.entity.mock.ts: -------------------------------------------------------------------------------- 1 | import { BankTxBatch } from '../entities/bank-tx-batch.entity'; 2 | 3 | const defaultBankTxBatch: Partial = { 4 | transactions: [], 5 | }; 6 | 7 | export function createDefaultBankTxBatch(): BankTxBatch { 8 | return createCustomBankTxBatch({}); 9 | } 10 | 11 | export function createCustomBankTxBatch(customValues: Partial): BankTxBatch { 12 | return Object.assign(new BankTxBatch(), { ...defaultBankTxBatch, ...customValues }); 13 | } 14 | -------------------------------------------------------------------------------- /src/subdomains/supporting/bank-tx/bank-tx/repositories/bank-tx-batch.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { BankTxBatch } from '../entities/bank-tx-batch.entity'; 5 | 6 | @Injectable() 7 | export class BankTxBatchRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(BankTxBatch, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/bank/bank-account/__mocks__/bank-account.entity.mock.ts: -------------------------------------------------------------------------------- 1 | import { BankAccount } from '../bank-account.entity'; 2 | 3 | const defaultBankAccount: Partial = { 4 | iban: 'DE89370400440532013000', 5 | sctInst: true, 6 | }; 7 | 8 | export function createDefaultBankAccount(): BankAccount { 9 | return createCustomBankAccount({}); 10 | } 11 | 12 | export function createCustomBankAccount(customValues: Partial): BankAccount { 13 | return Object.assign(new BankAccount(), { ...defaultBankAccount, ...customValues }); 14 | } 15 | -------------------------------------------------------------------------------- /src/subdomains/supporting/bank/bank-account/bank-account.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { BankAccount } from './bank-account.entity'; 5 | 6 | @Injectable() 7 | export class BankAccountRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(BankAccount, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/bank/bank/bank.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { CachedRepository } from 'src/shared/repositories/cached.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Bank } from './bank.entity'; 5 | 6 | @Injectable() 7 | export class BankRepository extends CachedRepository { 8 | constructor(manager: EntityManager) { 9 | super(Bank, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/bank/bank/dto/bank.mapper.ts: -------------------------------------------------------------------------------- 1 | import { Bank } from '../bank.entity'; 2 | import { BankDto } from './bank.dto'; 3 | 4 | export class BankMapper { 5 | static toDto(bank: Bank): BankDto { 6 | const dto: BankDto = { 7 | name: bank.name, 8 | iban: bank.iban, 9 | bic: bank.bic, 10 | currency: bank.currency, 11 | }; 12 | 13 | return Object.assign(new BankDto(), dto); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/subdomains/supporting/common/strategy-registry.ts: -------------------------------------------------------------------------------- 1 | export abstract class StrategyRegistry { 2 | private readonly registry: Map = new Map(); 3 | 4 | add(key: K, strategy: S) { 5 | this.registry.set(this.getKey(key), strategy); 6 | } 7 | 8 | remove(key: K) { 9 | this.registry.delete(this.getKey(key)); 10 | } 11 | 12 | get(key: K): S { 13 | return this.registry.get(this.getKey(key)); 14 | } 15 | 16 | protected getKey(key: K): string { 17 | return JSON.stringify(key); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/subdomains/supporting/dex/docs/DEX_Module.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DFXswiss/api/07117f76faf5bd2260f7a8a1ec28d01adad100bf/src/subdomains/supporting/dex/docs/DEX_Module.jpg -------------------------------------------------------------------------------- /src/subdomains/supporting/dex/exceptions/liquidity-order-not-ready.exception.ts: -------------------------------------------------------------------------------- 1 | export class LiquidityOrderNotReadyException extends Error { 2 | constructor(message: string) { 3 | super(message); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/subdomains/supporting/dex/exceptions/not-enough-liquidity.exception.ts: -------------------------------------------------------------------------------- 1 | export class NotEnoughLiquidityException extends Error { 2 | constructor(message: string) { 3 | super(message); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/subdomains/supporting/dex/exceptions/price-slippage.exception.ts: -------------------------------------------------------------------------------- 1 | export class PriceSlippageException extends Error { 2 | constructor(message: string) { 3 | super(message); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/subdomains/supporting/dex/exceptions/transaction-not-found.exception.ts: -------------------------------------------------------------------------------- 1 | export class TransactionNotFoundException extends Error { 2 | constructor(message: string) { 3 | super(message); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/subdomains/supporting/dex/exceptions/transfer-not-required.exception.ts: -------------------------------------------------------------------------------- 1 | export class TransferNotRequiredException extends Error { 2 | constructor(message: string) { 3 | super(message); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/subdomains/supporting/dex/repositories/liquidity-order.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { LiquidityOrder } from '../entities/liquidity-order.entity'; 5 | 6 | @Injectable() 7 | export class LiquidityOrderRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(LiquidityOrder, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/dex/strategies/sell-liquidity/impl/base/evm-coin.strategy.ts: -------------------------------------------------------------------------------- 1 | import { SellLiquidityStrategy } from './sell-liquidity.strategy'; 2 | 3 | export abstract class EvmCoinStrategy extends SellLiquidityStrategy {} 4 | -------------------------------------------------------------------------------- /src/subdomains/supporting/dex/strategies/sell-liquidity/impl/base/evm-token.strategy.ts: -------------------------------------------------------------------------------- 1 | import { SellLiquidityStrategy } from './sell-liquidity.strategy'; 2 | 3 | export abstract class EvmTokenStrategy extends SellLiquidityStrategy {} 4 | -------------------------------------------------------------------------------- /src/subdomains/supporting/dex/utils/dex.util.ts: -------------------------------------------------------------------------------- 1 | import { Asset } from 'src/shared/models/asset/asset.entity'; 2 | 3 | export class DexUtil { 4 | static parseAssetPair(asset: Asset): [string, string] { 5 | const assetPair = asset.dexName.split('-'); 6 | 7 | if (assetPair.length !== 2) { 8 | throw new Error(`Provided asset is not a liquidity pool pair. dexName: ${asset.dexName}`); 9 | } 10 | 11 | return [assetPair[0], assetPair[1]]; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/subdomains/supporting/fiat-output/__mocks__/fiat-output.entity.mock.ts: -------------------------------------------------------------------------------- 1 | import { FiatOutput } from '../fiat-output.entity'; 2 | 3 | const defaultFiatOutput: Partial = {}; 4 | 5 | export function createDefaultFiatOutput(): FiatOutput { 6 | return createCustomFiatOutput({}); 7 | } 8 | 9 | export function createCustomFiatOutput(customValues: Partial): FiatOutput { 10 | return Object.assign(new FiatOutput(), { ...defaultFiatOutput, ...customValues }); 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/fiat-output/fiat-output.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { FiatOutput } from './fiat-output.entity'; 5 | 6 | @Injectable() 7 | export class FiatOutputRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(FiatOutput, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/fiat-payin/__mocks__/checkout-tx.entity.mock.ts: -------------------------------------------------------------------------------- 1 | import { CheckoutTx } from '../entities/checkout-tx.entity'; 2 | 3 | const defaultCheckoutTx: Partial = { 4 | id: 1, 5 | amount: 100, 6 | }; 7 | 8 | export function createDefaultCheckoutTx(): CheckoutTx { 9 | return createCustomCheckoutTx({}); 10 | } 11 | 12 | export function createCustomCheckoutTx(customValues: Partial): CheckoutTx { 13 | return Object.assign(new CheckoutTx(), { ...defaultCheckoutTx, ...customValues }); 14 | } 15 | -------------------------------------------------------------------------------- /src/subdomains/supporting/fiat-payin/repositories/checkout-tx.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { CheckoutTx } from '../entities/checkout-tx.entity'; 5 | 6 | @Injectable() 7 | export class CheckoutTxRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(CheckoutTx, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/log/__mocks__/log.entity.mock.ts: -------------------------------------------------------------------------------- 1 | import { Log, LogSeverity } from '../log.entity'; 2 | 3 | const defaultLog: Partial = { 4 | id: 1, 5 | system: '', 6 | subsystem: '', 7 | severity: LogSeverity.INFO, 8 | message: '', 9 | }; 10 | 11 | export function createDefaultLog(): Log { 12 | return createCustomLog({}); 13 | } 14 | 15 | export function createCustomLog(customValues: Partial): Log { 16 | return Object.assign(new Log(), { ...defaultLog, ...customValues }); 17 | } 18 | -------------------------------------------------------------------------------- /src/subdomains/supporting/notification/dto/update-notification.dto.ts: -------------------------------------------------------------------------------- 1 | export interface UpdateNotificationDto { 2 | isComplete: boolean; 3 | error?: string; 4 | } 5 | -------------------------------------------------------------------------------- /src/subdomains/supporting/notification/repositories/notification.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Notification } from '../entities/notification.entity'; 5 | 6 | @Injectable() 7 | export class NotificationRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(Notification, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/notification/templates/generic.hbs: -------------------------------------------------------------------------------- 1 |

{{salutation}}

2 |

{{{body}}}

3 |

4 |

Thanks,

5 |

Your DFX team

-------------------------------------------------------------------------------- /src/subdomains/supporting/payin/enums/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DFXswiss/api/07117f76faf5bd2260f7a8a1ec28d01adad100bf/src/subdomains/supporting/payin/enums/index.ts -------------------------------------------------------------------------------- /src/subdomains/supporting/payin/interfaces/index.ts: -------------------------------------------------------------------------------- 1 | import { Asset } from 'src/shared/models/asset/asset.entity'; 2 | import { BlockchainAddress } from 'src/shared/models/blockchain-address'; 3 | import { PayInType } from '../entities/crypto-input.entity'; 4 | 5 | export interface PayInEntry { 6 | senderAddresses: string; 7 | receiverAddress: BlockchainAddress; 8 | txId: string; 9 | txType: PayInType | null; 10 | txSequence?: number; 11 | blockHeight: number | null; 12 | amount: number; 13 | asset: Asset | null; 14 | } 15 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payin/payin-webhook.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { SharedModule } from 'src/shared/shared.module'; 3 | import { PayInWebhookController } from './controllers/payin-webhook.controller'; 4 | import { PayInWebHookService } from './services/payin-webhhook.service'; 5 | 6 | @Module({ 7 | imports: [SharedModule], 8 | controllers: [PayInWebhookController], 9 | providers: [PayInWebHookService], 10 | exports: [PayInWebHookService], 11 | }) 12 | export class PayInWebhookModule {} 13 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payin/repositories/payin.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { CryptoInput } from '../entities/crypto-input.entity'; 5 | 6 | @Injectable() 7 | export class PayInRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(CryptoInput, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payin/services/base/payin-bitcoin-based.service.ts: -------------------------------------------------------------------------------- 1 | import { CryptoInput } from '../../entities/crypto-input.entity'; 2 | 3 | export abstract class PayInBitcoinBasedService { 4 | abstract checkHealthOrThrow(); 5 | abstract sendTransfer(input: CryptoInput): Promise<{ outTxId: string; feeAmount: number }>; 6 | } 7 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payin/services/payin-arbitrum.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { ArbitrumService } from 'src/integration/blockchain/arbitrum/arbitrum.service'; 3 | import { PayInEvmService } from './base/payin-evm.service'; 4 | 5 | @Injectable() 6 | export class PayInArbitrumService extends PayInEvmService { 7 | constructor(arbitrumService: ArbitrumService) { 8 | super(arbitrumService); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payin/services/payin-base.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseService } from 'src/integration/blockchain/base/base.service'; 3 | import { PayInEvmService } from './base/payin-evm.service'; 4 | 5 | @Injectable() 6 | export class PayInBaseService extends PayInEvmService { 7 | constructor(baseService: BaseService) { 8 | super(baseService); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payin/services/payin-bsc.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BscService } from 'src/integration/blockchain/bsc/bsc.service'; 3 | import { PayInEvmService } from './base/payin-evm.service'; 4 | 5 | @Injectable() 6 | export class PayInBscService extends PayInEvmService { 7 | constructor(bscService: BscService) { 8 | super(bscService); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payin/services/payin-ethereum.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { EthereumService } from 'src/integration/blockchain/ethereum/ethereum.service'; 3 | import { PayInEvmService } from './base/payin-evm.service'; 4 | 5 | @Injectable() 6 | export class PayInEthereumService extends PayInEvmService { 7 | constructor(ethereumService: EthereumService) { 8 | super(ethereumService); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payin/services/payin-gnosis.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { GnosisService } from 'src/integration/blockchain/gnosis/gnosis.service'; 3 | import { PayInEvmService } from './base/payin-evm.service'; 4 | 5 | @Injectable() 6 | export class PayInGnosisService extends PayInEvmService { 7 | constructor(gnosisService: GnosisService) { 8 | super(gnosisService); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payin/services/payin-optimism.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { OptimismService } from 'src/integration/blockchain/optimism/optimism.service'; 3 | import { PayInEvmService } from './base/payin-evm.service'; 4 | 5 | @Injectable() 6 | export class PayInOptimismService extends PayInEvmService { 7 | constructor(optimismService: OptimismService) { 8 | super(optimismService); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payin/services/payin-polygon.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { PolygonService } from 'src/integration/blockchain/polygon/polygon.service'; 3 | import { PayInEvmService } from './base/payin-evm.service'; 4 | 5 | @Injectable() 6 | export class PayInPolygonService extends PayInEvmService { 7 | constructor(polygonService: PolygonService) { 8 | super(polygonService); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payment/__mocks__/fee.entity.mock.ts: -------------------------------------------------------------------------------- 1 | import { Fee } from '../entities/fee.entity'; 2 | 3 | const defaultFee: Partial = { 4 | id: 1, 5 | }; 6 | 7 | export function createDefaultFee(): Fee { 8 | return createCustomFee({}); 9 | } 10 | 11 | export function createCustomFee(customValues: Partial): Fee { 12 | return Object.assign(new Fee(), { ...defaultFee, ...customValues }); 13 | } 14 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payment/dto/payment-method.enum.ts: -------------------------------------------------------------------------------- 1 | export enum FiatPaymentMethod { 2 | BANK = 'Bank', 3 | INSTANT = 'Instant', 4 | CARD = 'Card', 5 | } 6 | 7 | export enum CryptoPaymentMethod { 8 | CRYPTO = 'Crypto', 9 | } 10 | 11 | export type PaymentMethod = FiatPaymentMethod | CryptoPaymentMethod; 12 | 13 | export const PaymentMethodSwagger = [...Object.values(FiatPaymentMethod), ...Object.values(CryptoPaymentMethod)]; 14 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payment/dto/transaction-helper/min-amount.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiProperty } from '@nestjs/swagger'; 2 | 3 | export class MinAmount { 4 | @ApiProperty() 5 | amount: number; 6 | 7 | @ApiProperty() 8 | asset: string; 9 | } 10 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payment/dto/transaction-helper/quote-error.enum.ts: -------------------------------------------------------------------------------- 1 | export enum QuoteError { 2 | AMOUNT_TOO_LOW = 'AmountTooLow', 3 | AMOUNT_TOO_HIGH = 'AmountTooHigh', 4 | BANK_TRANSACTION_MISSING = 'BankTransactionMissing', 5 | KYC_REQUIRED = 'KycRequired', 6 | KYC_DATA_REQUIRED = 'KycDataRequired', 7 | KYC_REQUIRED_INSTANT = 'KycRequiredInstant', 8 | LIMIT_EXCEEDED = 'LimitExceeded', 9 | NATIONALITY_NOT_ALLOWED = 'NationalityNotAllowed', 10 | NAME_REQUIRED = 'NameRequired', 11 | VIDEO_IDENT_REQUIRED = 'VideoIdentRequired', 12 | } 13 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payment/dto/transaction-helper/tx-spec.dto.ts: -------------------------------------------------------------------------------- 1 | export interface TxMinSpec { 2 | minVolume: number; 3 | minFee: number; 4 | } 5 | 6 | export interface TxSpec { 7 | volume: { 8 | min: number; 9 | max: number; 10 | }; 11 | fee: { 12 | min: number; 13 | fixed: number; 14 | bankFixed: number; 15 | network: number; 16 | networkStart: number; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payment/entities/blockchain-fee.entity.ts: -------------------------------------------------------------------------------- 1 | import { Asset } from 'src/shared/models/asset/asset.entity'; 2 | import { IEntity } from 'src/shared/models/entity'; 3 | import { Column, Entity, JoinColumn, OneToOne } from 'typeorm'; 4 | 5 | @Entity() 6 | export class BlockchainFee extends IEntity { 7 | @OneToOne(() => Asset, { nullable: false, eager: true }) 8 | @JoinColumn() 9 | asset: Asset; 10 | 11 | @Column({ type: 'float' }) 12 | amount: number; // CHF 13 | } 14 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payment/exceptions/fee-limit-exceeded.exception.ts: -------------------------------------------------------------------------------- 1 | export class FeeLimitExceededException extends Error { 2 | constructor(message: string) { 3 | super(message); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payment/repositories/blockchain-fee.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { CachedRepository } from 'src/shared/repositories/cached.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { BlockchainFee } from '../entities/blockchain-fee.entity'; 5 | 6 | @Injectable() 7 | export class BlockchainFeeRepository extends CachedRepository { 8 | constructor(manager: EntityManager) { 9 | super(BlockchainFee, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payment/repositories/fee.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { CachedRepository } from 'src/shared/repositories/cached.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Fee } from '../entities/fee.entity'; 5 | 6 | @Injectable() 7 | export class FeeRepository extends CachedRepository { 8 | constructor(manager: EntityManager) { 9 | super(Fee, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payment/repositories/special-external-account.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { CachedRepository } from 'src/shared/repositories/cached.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { SpecialExternalAccount } from '../entities/special-external-account.entity'; 5 | 6 | @Injectable() 7 | export class SpecialExternalAccountRepository extends CachedRepository { 8 | constructor(manager: EntityManager) { 9 | super(SpecialExternalAccount, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payment/repositories/transaction-request.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { TransactionRequest } from '../entities/transaction-request.entity'; 5 | 6 | @Injectable() 7 | export class TransactionRequestRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(TransactionRequest, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payment/repositories/transaction.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { Transaction } from '../entities/transaction.entity'; 5 | 6 | @Injectable() 7 | export class TransactionRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(Transaction, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payout/interfaces/index.ts: -------------------------------------------------------------------------------- 1 | import { Asset } from 'src/shared/models/asset/asset.entity'; 2 | import { PayoutOrderContext } from '../entities/payout-order.entity'; 3 | 4 | export interface PayoutRequest { 5 | context: PayoutOrderContext; 6 | correlationId: string; 7 | asset: Asset; 8 | amount: number; 9 | destinationAddress: string; 10 | } 11 | 12 | export interface FeeResult { 13 | asset: Asset; 14 | amount: number; 15 | } 16 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payout/repositories/payout-order.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { PayoutOrder } from '../entities/payout-order.entity'; 5 | 6 | @Injectable() 7 | export class PayoutOrderRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(PayoutOrder, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payout/services/base/payout-bitcoin-based.service.ts: -------------------------------------------------------------------------------- 1 | import { PayoutOrderContext } from '../../entities/payout-order.entity'; 2 | 3 | export type PayoutGroup = { addressTo: string; amount: number }[]; 4 | 5 | export abstract class PayoutBitcoinBasedService { 6 | abstract isHealthy(context: PayoutOrderContext): Promise; 7 | abstract getPayoutCompletionData(context: PayoutOrderContext, payoutTxId: string): Promise<[boolean, number]>; 8 | } 9 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payout/services/payout-arbitrum.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { ArbitrumService } from 'src/integration/blockchain/arbitrum/arbitrum.service'; 3 | import { PayoutEvmService } from './payout-evm.service'; 4 | 5 | @Injectable() 6 | export class PayoutArbitrumService extends PayoutEvmService { 7 | constructor(arbitrumService: ArbitrumService) { 8 | super(arbitrumService); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payout/services/payout-bsc.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BscService } from 'src/integration/blockchain/bsc/bsc.service'; 3 | import { PayoutEvmService } from './payout-evm.service'; 4 | 5 | @Injectable() 6 | export class PayoutBscService extends PayoutEvmService { 7 | constructor(bscService: BscService) { 8 | super(bscService); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payout/services/payout-ethereum.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { EthereumService } from 'src/integration/blockchain/ethereum/ethereum.service'; 3 | import { PayoutEvmService } from './payout-evm.service'; 4 | 5 | @Injectable() 6 | export class PayoutEthereumService extends PayoutEvmService { 7 | constructor(ethereumService: EthereumService) { 8 | super(ethereumService); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payout/services/payout-polygon.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { PolygonService } from 'src/integration/blockchain/polygon/polygon.service'; 3 | import { PayoutEvmService } from './payout-evm.service'; 4 | 5 | @Injectable() 6 | export class PayoutPolygonService extends PayoutEvmService { 7 | constructor(polygonService: PolygonService) { 8 | super(polygonService); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/subdomains/supporting/payout/strategies/prepare/impl/base/evm.strategy.ts: -------------------------------------------------------------------------------- 1 | import { PayoutOrderRepository } from '../../../../repositories/payout-order.repository'; 2 | import { AutoConfirmStrategy } from './auto-confirm.strategy'; 3 | 4 | export abstract class EvmStrategy extends AutoConfirmStrategy { 5 | constructor(payoutOrderRepo: PayoutOrderRepository) { 6 | super(payoutOrderRepo); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/subdomains/supporting/pricing/domain/exceptions/price-invalid.exception.ts: -------------------------------------------------------------------------------- 1 | export class PriceInvalidException extends Error { 2 | constructor(message: string) { 3 | super(message); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/subdomains/supporting/pricing/domain/interfaces/index.ts: -------------------------------------------------------------------------------- 1 | import { PricingProvider } from '../../services/integration/pricing-provider'; 2 | import { PriceSource } from '../entities/price-rule.entity'; 3 | 4 | export type PricingProviderMap = { [s in PriceSource]: PricingProvider }; 5 | -------------------------------------------------------------------------------- /src/subdomains/supporting/pricing/dto/price-request-raw.ts: -------------------------------------------------------------------------------- 1 | import { IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator'; 2 | import { PriceSource } from '../domain/entities/price-rule.entity'; 3 | 4 | export class PriceRequestRaw { 5 | @IsNotEmpty() 6 | @IsEnum(PriceSource) 7 | source: PriceSource; 8 | 9 | @IsNotEmpty() 10 | @IsString() 11 | from: string; 12 | 13 | @IsNotEmpty() 14 | @IsString() 15 | to: string; 16 | 17 | @IsOptional() 18 | @IsString() 19 | param: string; 20 | } 21 | -------------------------------------------------------------------------------- /src/subdomains/supporting/pricing/repositories/asset-price.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { AssetPrice } from '../domain/entities/asset-price.entity'; 5 | 6 | @Injectable() 7 | export class AssetPriceRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(AssetPrice, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/pricing/repositories/price-rule.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { PriceRule } from '../domain/entities/price-rule.entity'; 5 | 6 | @Injectable() 7 | export class PriceRuleRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(PriceRule, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/support-issue/dto/get-support-issue.dto.ts: -------------------------------------------------------------------------------- 1 | import { ApiPropertyOptional } from '@nestjs/swagger'; 2 | import { Transform } from 'class-transformer'; 3 | import { IsInt, IsOptional } from 'class-validator'; 4 | 5 | export class GetSupportIssueFilter { 6 | @ApiPropertyOptional() 7 | @IsOptional() 8 | @Transform(({ value }) => (value != null ? +value : value)) 9 | @IsInt() 10 | fromMessageId?: number; 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/support-issue/entities/limit-request-log.entity.ts: -------------------------------------------------------------------------------- 1 | import { ChildEntity, Column, ManyToOne } from 'typeorm'; 2 | import { LimitRequest, LimitRequestDecision } from './limit-request.entity'; 3 | import { SupportLog } from './support-log.entity'; 4 | 5 | @ChildEntity() 6 | export class LimitRequestLog extends SupportLog { 7 | @ManyToOne(() => LimitRequest, (s) => s.logs, { onDelete: 'CASCADE' }) 8 | limitRequest: LimitRequest; 9 | 10 | @Column({ length: 256, nullable: true }) 11 | decision?: LimitRequestDecision; 12 | } 13 | -------------------------------------------------------------------------------- /src/subdomains/supporting/support-issue/enums/department.enum.ts: -------------------------------------------------------------------------------- 1 | export enum Department { 2 | SUPPORT = 'Support', 3 | COMPLIANCE = 'Compliance', 4 | MARKETING = 'Marketing', 5 | COOPERATION = 'Cooperation', 6 | } 7 | -------------------------------------------------------------------------------- /src/subdomains/supporting/support-issue/enums/support-log.enum.ts: -------------------------------------------------------------------------------- 1 | export enum SupportLogType { 2 | SUPPORT = 'SupportLog', 3 | LIMIT_REQUEST = 'LimitRequestLog', 4 | } 5 | -------------------------------------------------------------------------------- /src/subdomains/supporting/support-issue/repositories/limit-request.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { LimitRequest } from '../entities/limit-request.entity'; 5 | 6 | @Injectable() 7 | export class LimitRequestRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(LimitRequest, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/support-issue/repositories/support-issue.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { SupportIssue } from '../entities/support-issue.entity'; 5 | 6 | @Injectable() 7 | export class SupportIssueRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(SupportIssue, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/support-issue/repositories/support-log.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { SupportLog } from '../entities/support-log.entity'; 5 | 6 | @Injectable() 7 | export class SupportLogRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(SupportLog, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/subdomains/supporting/support-issue/repositories/support-message.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { BaseRepository } from 'src/shared/repositories/base.repository'; 3 | import { EntityManager } from 'typeorm'; 4 | import { SupportMessage } from '../entities/support-message.entity'; 5 | 6 | @Injectable() 7 | export class SupportMessageRepository extends BaseRepository { 8 | constructor(manager: EntityManager) { 9 | super(SupportMessage, manager); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/jest-e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "moduleFileExtensions": ["js", "json", "ts"], 3 | "rootDir": ".", 4 | "testEnvironment": "node", 5 | "testRegex": ".e2e-spec.ts$", 6 | "transform": { 7 | "^.+\\.(t|j)s$": "ts-jest" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /thunder-tests/environments/tc_env_dev-admin.json: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "fcc53e18-bf68-472a-92ae-cbf20f6e66a1", 3 | "name": "dev (Admin)", 4 | "default": true, 5 | "sortNum": 27500, 6 | "created": "2022-12-20T10:57:51.081Z", 7 | "modified": "2022-12-20T10:57:51.081Z", 8 | "data": [ 9 | { 10 | "name": "url", 11 | "value": "https://app-dfx-api-dev.azurewebsites.net" 12 | } 13 | ], 14 | "envFile": "env/dev.admin.env" 15 | } -------------------------------------------------------------------------------- /thunder-tests/environments/tc_env_dev-beta.json: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "e5266aee-6640-4e0a-8772-501440b494e5", 3 | "name": "dev (Beta)", 4 | "default": false, 5 | "sortNum": 26250, 6 | "created": "2022-12-20T10:57:52.578Z", 7 | "modified": "2022-12-20T10:57:52.578Z", 8 | "data": [ 9 | { 10 | "name": "url", 11 | "value": "https://app-dfx-api-dev.azurewebsites.net" 12 | } 13 | ], 14 | "envFile": "env/dev.beta.env" 15 | } -------------------------------------------------------------------------------- /thunder-tests/environments/tc_env_dev-user.json: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "2a38c886-5352-4c8d-8279-8de45bea87c3", 3 | "name": "dev (User)", 4 | "default": false, 5 | "sortNum": 25000, 6 | "created": "2022-12-20T10:57:12.631Z", 7 | "modified": "2022-12-20T10:57:12.631Z", 8 | "data": [ 9 | { 10 | "name": "url", 11 | "value": "https://app-dfx-api-dev.azurewebsites.net" 12 | } 13 | ], 14 | "envFile": "env/dev.user.env" 15 | } -------------------------------------------------------------------------------- /thunder-tests/environments/tc_env_loc-admin.json: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "1f2cc1f8-90ed-439a-9753-1f609ddf7ac5", 3 | "name": "loc (Admin)", 4 | "default": false, 5 | "sortNum": 23750, 6 | "created": "2022-12-20T10:52:17.609Z", 7 | "modified": "2022-12-20T10:52:17.609Z", 8 | "data": [ 9 | { 10 | "name": "url", 11 | "value": "http://localhost:3000" 12 | } 13 | ], 14 | "envFile": "env/loc.admin.env" 15 | } -------------------------------------------------------------------------------- /thunder-tests/environments/tc_env_loc-user.json: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "e3f21c97-c599-484f-843f-d2aa58dfb213", 3 | "name": "loc (User)", 4 | "default": false, 5 | "sortNum": 22500, 6 | "created": "2022-12-20T10:50:32.444Z", 7 | "modified": "2022-12-20T10:50:32.444Z", 8 | "data": [ 9 | { 10 | "name": "url", 11 | "value": "http://localhost:3000" 12 | } 13 | ], 14 | "envFile": "env/loc.user.env" 15 | } -------------------------------------------------------------------------------- /thunder-tests/test-files/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "test": "incorporation certificate" 3 | } -------------------------------------------------------------------------------- /thunder-tests/thunderActivity.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /typings/lnurl.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'lnurl' { 2 | export function encode(str: string): string; 3 | export function decode(lnurl: string): string; 4 | } 5 | --------------------------------------------------------------------------------