diff --git a/apps/auth/.eslintrc.json b/apps/auth/.eslintrc.json new file mode 100644 index 000000000..0cf7eaf64 --- /dev/null +++ b/apps/auth/.eslintrc.json @@ -0,0 +1,50 @@ +{ + "extends": [ + "next/core-web-vitals", + "plugin:storybook/recommended", + "plugin:import/typescript", + "plugin:@typescript-eslint/recommended", + "prettier" + ], + "plugins": ["@typescript-eslint", "import", "prettier"], + "rules": { + "@typescript-eslint/no-extra-semi": "off", + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/prefer-for-of": "error", + "@typescript-eslint/unified-signatures": "error", + "import/no-deprecated": "error", + "import/no-extraneous-dependencies": "error", + "import/no-unassigned-import": "error", + "import/no-unresolved": "off", + "import/order": ["error", { "newlines-between": "always-and-inside-groups" }], + "arrow-body-style": "off", + "prefer-arrow-callback": "error", + "no-duplicate-imports": "error", + "no-empty-function": "error", + "no-empty": ["error", { "allowEmptyCatch": true }], + "no-new-wrappers": "error", + "no-param-reassign": "error", + "no-return-await": "error", + "no-sequences": "error", + "no-throw-literal": "error", + "no-void": "error", + "@typescript-eslint/explicit-module-boundary-types": "off", + "no-async-promise-executor": "off", + "prettier/prettier": [ + "error", + { + "semi": false, + "trailingComma": "all", + "printWidth": 90, + "quoteProps": "consistent", + "singleQuote": false, + "tabWidth": 2, + "useTabs": false, + "bracketSpacing": true, + "arrowParens": "always", + "proseWrap": "preserve", + "endOfLine": "lf" + } + ] + } +} diff --git a/apps/auth/.gitignore b/apps/auth/.gitignore new file mode 100644 index 000000000..2e53351ed --- /dev/null +++ b/apps/auth/.gitignore @@ -0,0 +1,45 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn/install-state.gz + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + +# browserstack-cypress +log +*.log +tmpBstackPackages +results +build_artifacts +screenshots +downloads diff --git a/apps/auth/.prettierrc.js b/apps/auth/.prettierrc.js new file mode 100644 index 000000000..bacbcd169 --- /dev/null +++ b/apps/auth/.prettierrc.js @@ -0,0 +1,13 @@ +module.exports = { + semi: false, + trailingComma: "all", + printWidth: 90, + quoteProps: "consistent", + singleQuote: false, + tabWidth: 2, + useTabs: false, + bracketSpacing: true, + arrowParens: "always", + proseWrap: "preserve", + endOfLine: "lf", +} diff --git a/apps/auth/.storybook/faker.ts b/apps/auth/.storybook/faker.ts new file mode 100644 index 000000000..755511c09 --- /dev/null +++ b/apps/auth/.storybook/faker.ts @@ -0,0 +1,6 @@ +import { faker } from "@faker-js/faker"; + +// Set a global seed for deterministic results on UI +faker.seed(12345); + +export default faker; diff --git a/apps/auth/.storybook/main.ts b/apps/auth/.storybook/main.ts new file mode 100644 index 000000000..bfa66fcd6 --- /dev/null +++ b/apps/auth/.storybook/main.ts @@ -0,0 +1,36 @@ +import type { StorybookConfig } from "@storybook/nextjs" + +const config: StorybookConfig = { + stories: ["../**/*.mdx", "../**/*.stories.@(js|jsx|mjs|ts|tsx)"], + features: { + experimentalRSC: true, + }, + addons: [ + "@storybook/addon-onboarding", + "@storybook/addon-links", + "@storybook/addon-essentials", + "@chromatic-com/storybook", + "@storybook/addon-interactions", + "@storybook/addon-postcss", + ], + framework: { + name: "@storybook/nextjs", + options: {}, + }, + webpackFinal: async (config) => { + const imageRule = config.module?.rules?.find((rule) => { + const test = (rule as { test: RegExp }).test + if (!test) { + return false + } + return test.test(".svg") + }) as { [key: string]: any } + imageRule.exclude = /\.svg$/ + config.module?.rules?.push({ + test: /\.svg$/, + use: ["@svgr/webpack"], + }) + return config + }, +} +export default config diff --git a/apps/auth/.storybook/mocks.ts b/apps/auth/.storybook/mocks.ts new file mode 100644 index 000000000..205af2bb3 --- /dev/null +++ b/apps/auth/.storybook/mocks.ts @@ -0,0 +1,11 @@ +export const regularChartOfAccountsMockData = JSON.parse(`{ "data": { "chartOfAccounts": { "name": "Chart of Accounts", "categories": [{ "name": "Revenue", "accounts": [{ "__typename": "AccountSet", "id": "00000000-0000-0000-0000-140000000002", "name": "Credit Facilities Interest Revenue Control Account", "hasSubAccounts": false }, { "__typename": "AccountSet", "id": "00000000-0000-0000-0000-140000000001", "name": "Interest Revenue Control Account", "hasSubAccounts": false }], "__typename": "StatementCategory" }, { "name": "Expenses", "accounts": [], "__typename": "StatementCategory" }, { "name": "Liabilities", "accounts": [{ "__typename": "AccountSet", "id": "00000000-0000-0000-0000-120000000001", "name": "Customer Checking Control Account", "hasSubAccounts": false }], "__typename": "StatementCategory" }, { "name": "Equity", "accounts": [{ "__typename": "Account", "id": "a39ffa0a-9e20-ca4f-1034-4b750ee063f5", "name": "Bank Shareholder Equity" }], "__typename": "StatementCategory" }, { "name": "Assets", "accounts": [{ "__typename": "AccountSet", "id": "00000000-0000-0000-0000-110000000001", "name": "Loans Principal Receivable Control Account", "hasSubAccounts": false }, { "__typename": "AccountSet", "id": "00000000-0000-0000-0000-110000000002", "name": "Loans Interest Receivable Control Account", "hasSubAccounts": false }, { "__typename": "Account", "id": "8f04fc5b-2009-dce1-4100-d89c9826c99b", "name": "Bank Deposits from Users Omnibus Account" }, { "__typename": "AccountSet", "id": "00000000-0000-0000-0000-110000000003", "name": "Credit Facilities Disbursed Receivable Control Account", "hasSubAccounts": false }, { "__typename": "Account", "id": "06c2a8af-0583-f80f-7450-26beb9b73f5c", "name": "Bank Reserve from Shareholders" }, { "__typename": "AccountSet", "id": "00000000-0000-0000-0000-110000000004", "name": "Credit Facilities Interest Receivable Control Account", "hasSubAccounts": false }], "__typename": "StatementCategory" }], "__typename": "ChartOfAccounts" } } }`); + +export const offBalanceSheetChartOfAccountsMockData = JSON.parse(`{"data":{"offBalanceSheetChartOfAccounts":{"name":"Off-Balance-Sheet Chart of Accounts","categories":[{"name":"Liabilities (Off-Balance-Sheet)","accounts":[{"__typename":"AccountSet","id":"10000000-0000-0000-0000-210000000002","name":"Credit Facilities Collateral Control Account","hasSubAccounts":false},{"__typename":"Account","id":"69e7ad74-91a4-8a72-6b8e-13a1d2f9bd2b","name":"Omnibus account for credit facility"},{"__typename":"AccountSet","id":"10000000-0000-0000-0000-210000000001","name":"Loans Collateral Control Account","hasSubAccounts":false}],"__typename":"StatementCategory"},{"name":"Assets (Off-Balance-Sheet)","accounts":[{"__typename":"AccountSet","id":"10000000-0000-0000-0000-110000000001","name":"Credit Facility Control Account","hasSubAccounts":false},{"__typename":"Account","id":"cedece5e-f303-cdcb-4158-717cd52a4d53","name":"Omnibus account for BTC collateral"}],"__typename":"StatementCategory"}],"__typename":"ChartOfAccounts"}}}`); + +export const balanceSheetMockData = JSON.parse(`{"data":{"balanceSheet":{"name":"Balance Sheet","balance":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":120483795,"credit":120483795,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":120404865,"credit":120404865,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":78930,"credit":78930,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":120483795,"credit":120483795,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":120404865,"credit":120404865,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":78930,"credit":78930,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"categories":[{"name":"Liabilities","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":120365400,"netDebit":-120365400,"netCredit":120365400,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":120365400,"netDebit":-120365400,"netCredit":120365400,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":120365400,"netDebit":-120365400,"netCredit":120365400,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":120365400,"netDebit":-120365400,"netCredit":120365400,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"accounts":[{"__typename":"AccountSet","id":"00000000-0000-0000-0000-120000000001","name":"Customer Checking Control Account","hasSubAccounts":false,"amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":120365400,"netDebit":-120365400,"netCredit":120365400,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":120365400,"netDebit":-120365400,"netCredit":120365400,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":120365400,"netDebit":-120365400,"netCredit":120365400,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":120365400,"netDebit":-120365400,"netCredit":120365400,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"}}],"__typename":"StatementCategory"},{"name":"Equity","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":39465,"credit":78930,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":39465,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":39465,"credit":78930,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":39465,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"accounts":[{"__typename":"Account","id":"a39ffa0a-9e20-ca4f-1034-4b750ee063f5","name":"Bank Shareholder Equity","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"}},{"__typename":"AccountSet","id":"00000000-0000-0000-0000-100000000004","name":"Net Income","hasSubAccounts":false,"amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":39465,"credit":78930,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":39465,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":39465,"credit":78930,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":39465,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"}}],"__typename":"StatementCategory"},{"name":"Assets","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":120444330,"credit":39465,"netDebit":120404865,"netCredit":-120404865,"__typename":"UsdAccountAmounts"},"settled":{"debit":120404865,"credit":0,"netDebit":120404865,"netCredit":-120404865,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":120444330,"credit":39465,"netDebit":120404865,"netCredit":-120404865,"__typename":"UsdAccountAmounts"},"settled":{"debit":120404865,"credit":0,"netDebit":120404865,"netCredit":-120404865,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"accounts":[{"__typename":"AccountSet","id":"00000000-0000-0000-0000-110000000001","name":"Loans Principal Receivable Control Account","hasSubAccounts":false,"amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"}},{"__typename":"AccountSet","id":"00000000-0000-0000-0000-110000000002","name":"Loans Interest Receivable Control Account","hasSubAccounts":false,"amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"}},{"__typename":"Account","id":"8f04fc5b-2009-dce1-4100-d89c9826c99b","name":"Bank Deposits from Users Omnibus Account","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"}},{"__typename":"AccountSet","id":"00000000-0000-0000-0000-110000000003","name":"Credit Facilities Disbursed Receivable Control Account","hasSubAccounts":false,"amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":120365400,"credit":0,"netDebit":120365400,"netCredit":-120365400,"__typename":"UsdAccountAmounts"},"settled":{"debit":120365400,"credit":0,"netDebit":120365400,"netCredit":-120365400,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":120365400,"credit":0,"netDebit":120365400,"netCredit":-120365400,"__typename":"UsdAccountAmounts"},"settled":{"debit":120365400,"credit":0,"netDebit":120365400,"netCredit":-120365400,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"}},{"__typename":"Account","id":"06c2a8af-0583-f80f-7450-26beb9b73f5c","name":"Bank Reserve from Shareholders","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"}},{"__typename":"AccountSet","id":"00000000-0000-0000-0000-110000000004","name":"Credit Facilities Interest Receivable Control Account","hasSubAccounts":false,"amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":78930,"credit":39465,"netDebit":39465,"netCredit":-39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":39465,"credit":0,"netDebit":39465,"netCredit":-39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":78930,"credit":39465,"netDebit":39465,"netCredit":-39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":39465,"credit":0,"netDebit":39465,"netCredit":-39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"}}],"__typename":"StatementCategory"}],"__typename":"BalanceSheet"}}}`) + +export const profitLossMockData = JSON.parse(`{"data":{"profitAndLossStatement":{"name":"Net Income","net":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":39465,"credit":78930,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":39465,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":39465,"credit":78930,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":39465,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"categories":[{"name":"Revenue","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":39465,"credit":78930,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":39465,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":39465,"credit":78930,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":39465,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"accounts":[{"__typename":"AccountSet","id":"00000000-0000-0000-0000-140000000002","name":"Credit Facilities Interest Revenue Control Account","hasSubAccounts":false,"amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":39465,"credit":78930,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":39465,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":39465,"credit":78930,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":39465,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"}},{"__typename":"AccountSet","id":"00000000-0000-0000-0000-140000000001","name":"Interest Revenue Control Account","hasSubAccounts":false,"amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"}}],"__typename":"StatementCategory"},{"name":"Expenses","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"accounts":[],"__typename":"StatementCategory"}],"__typename":"ProfitAndLossStatement"}}}`) + +export const onBalanceSheetTrialBalanceMockData = JSON.parse(`{"data":{"trialBalance":{"name":"Trial Balance","total":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":120483795,"credit":120483795,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":120404865,"credit":120404865,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":78930,"credit":78930,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":120483795,"credit":120483795,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":120404865,"credit":120404865,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":78930,"credit":78930,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"subAccounts":[{"name":"Loans Principal Receivable Control Account","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"AccountSet"},{"name":"Credit Facilities Interest Revenue Control Account","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":39465,"credit":78930,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":39465,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":39465,"credit":78930,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":39465,"netDebit":-39465,"netCredit":39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"AccountSet"},{"name":"Credit Facilities Interest Receivable Control Account","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":78930,"credit":39465,"netDebit":39465,"netCredit":-39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":39465,"credit":0,"netDebit":39465,"netCredit":-39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":78930,"credit":39465,"netDebit":39465,"netCredit":-39465,"__typename":"UsdAccountAmounts"},"settled":{"debit":39465,"credit":0,"netDebit":39465,"netCredit":-39465,"__typename":"UsdAccountAmounts"},"pending":{"debit":39465,"credit":39465,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"AccountSet"},{"name":"Bank Deposits from Users Omnibus Account","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"Account"},{"name":"Credit Facilities Disbursed Receivable Control Account","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":120365400,"credit":0,"netDebit":120365400,"netCredit":-120365400,"__typename":"UsdAccountAmounts"},"settled":{"debit":120365400,"credit":0,"netDebit":120365400,"netCredit":-120365400,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":120365400,"credit":0,"netDebit":120365400,"netCredit":-120365400,"__typename":"UsdAccountAmounts"},"settled":{"debit":120365400,"credit":0,"netDebit":120365400,"netCredit":-120365400,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"AccountSet"},{"name":"Bank Reserve from Shareholders","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"Account"},{"name":"Customer Checking Control Account","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":120365400,"netDebit":-120365400,"netCredit":120365400,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":120365400,"netDebit":-120365400,"netCredit":120365400,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":120365400,"netDebit":-120365400,"netCredit":120365400,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":120365400,"netDebit":-120365400,"netCredit":120365400,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"AccountSet"},{"name":"Interest Revenue Control Account","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"AccountSet"},{"name":"Bank Shareholder Equity","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"Account"},{"name":"Loans Interest Receivable Control Account","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"AccountSet"}],"__typename":"TrialBalance"}}}`) + +export const offBalanceSheetTrialBalanceMockData = JSON.parse(`{"data":{"offBalanceSheetTrialBalance":{"name":"Off-Balance-Sheet Trial Balance","total":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":17000000000,"credit":17000000000,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":17000000000,"credit":17000000000,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":17000000000,"credit":17000000000,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":17000000000,"credit":17000000000,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":1120365400,"credit":1120365400,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":1120365400,"credit":1120365400,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":1120365400,"credit":1120365400,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":1120365400,"credit":1120365400,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"subAccounts":[{"name":"Omnibus account for BTC collateral","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":17000000000,"credit":0,"netDebit":17000000000,"netCredit":-17000000000,"__typename":"BtcAccountAmounts"},"settled":{"debit":17000000000,"credit":0,"netDebit":17000000000,"netCredit":-17000000000,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":17000000000,"credit":0,"netDebit":17000000000,"netCredit":-17000000000,"__typename":"BtcAccountAmounts"},"settled":{"debit":17000000000,"credit":0,"netDebit":17000000000,"netCredit":-17000000000,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"Account"},{"name":"Loans Collateral Control Account","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"AccountSet"},{"name":"Credit Facility Control Account","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":1000000000,"credit":120365400,"netDebit":879634600,"netCredit":-879634600,"__typename":"UsdAccountAmounts"},"settled":{"debit":1000000000,"credit":120365400,"netDebit":879634600,"netCredit":-879634600,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":1000000000,"credit":120365400,"netDebit":879634600,"netCredit":-879634600,"__typename":"UsdAccountAmounts"},"settled":{"debit":1000000000,"credit":120365400,"netDebit":879634600,"netCredit":-879634600,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"AccountSet"},{"name":"Credit Facilities Collateral Control Account","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":17000000000,"netDebit":-17000000000,"netCredit":17000000000,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":17000000000,"netDebit":-17000000000,"netCredit":17000000000,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":17000000000,"netDebit":-17000000000,"netCredit":17000000000,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":17000000000,"netDebit":-17000000000,"netCredit":17000000000,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"AccountSet"},{"name":"Omnibus account for credit facility","amounts":{"btc":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"closingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"amount":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"BtcAccountAmounts"},"__typename":"LayeredBtcAccountAmounts"},"__typename":"BtcAccountAmountsInPeriod"},"usd":{"openingBalance":{"all":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"settled":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"closingBalance":{"all":{"debit":120365400,"credit":1000000000,"netDebit":-879634600,"netCredit":879634600,"__typename":"UsdAccountAmounts"},"settled":{"debit":120365400,"credit":1000000000,"netDebit":-879634600,"netCredit":879634600,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"amount":{"all":{"debit":120365400,"credit":1000000000,"netDebit":-879634600,"netCredit":879634600,"__typename":"UsdAccountAmounts"},"settled":{"debit":120365400,"credit":1000000000,"netDebit":-879634600,"netCredit":879634600,"__typename":"UsdAccountAmounts"},"pending":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"encumbrance":{"debit":0,"credit":0,"netDebit":0,"netCredit":0,"__typename":"UsdAccountAmounts"},"__typename":"LayeredUsdAccountAmounts"},"__typename":"UsdAccountAmountsInPeriod"},"__typename":"AccountAmountsByCurrency"},"__typename":"Account"}],"__typename":"TrialBalance"}}}`); diff --git a/apps/auth/.storybook/preview.tsx b/apps/auth/.storybook/preview.tsx new file mode 100644 index 000000000..9b98bdbef --- /dev/null +++ b/apps/auth/.storybook/preview.tsx @@ -0,0 +1,86 @@ +import React from "react" +import type { Preview } from "@storybook/react" +import { MockedProvider } from "@apollo/client/testing" +import "../app/globals.css" +import { AppSidebar } from "../components/app-sidebar" +import { SidebarInset, SidebarProvider } from "../ui/sidebar" +import { + AvatarDocument, + GetRealtimePriceUpdatesDocument, + Role, +} from "../lib/graphql/generated" +import { mockRealtimePrice } from "../lib/graphql/generated/mocks" +import { AppLayout } from "../app/app-layout" + +const defaultMocks = [ + { + request: { query: AvatarDocument }, + result: { + data: { + me: { + user: { + userId: "usr_123", + email: "test@example.com", + roles: [Role.Admin], + }, + }, + }, + }, + }, + { + request: { query: GetRealtimePriceUpdatesDocument }, + result: { + data: { + realtimePrice: mockRealtimePrice({ + usdCentsPerBtc: 100000, + }), + }, + }, + }, +] + +const StorybookWrapper = ({ children, mocks = [] }) => ( +
+ + + + + {children} + + + +
+) + +const preview: Preview = { + parameters: { + nextjs: { + appDirectory: true, + }, + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/i, + }, + }, + }, + decorators: [ + (Story, context) => { + if (context.title.startsWith("Pages/")) { + const storyMocks = context?.args?.mocks || [] + return ( + + + + ) + } + return ( +
+ +
+ ) + }, + ], +} + +export default preview diff --git a/apps/auth/Dockerfile b/apps/auth/Dockerfile new file mode 100644 index 000000000..edb27677f --- /dev/null +++ b/apps/auth/Dockerfile @@ -0,0 +1,38 @@ +# Base image +FROM node:20-alpine AS base + +FROM base AS builder +RUN apk add --no-cache libc6-compat +WORKDIR /app +RUN corepack enable pnpm +COPY apps/admin-panel . +RUN pnpm install --frozen-lockfile +RUN pnpm run build + +FROM base AS runner +WORKDIR /app + +ENV NODE_ENV production +RUN addgroup --system --gid 1001 nodejs +RUN adduser --system --uid 1001 nextjs + +COPY --from=builder /app/public ./public + +# Set the correct permission for prerender cache +RUN mkdir .next +RUN chown nextjs:nodejs .next + +# Automatically leverage output traces to reduce image size +# https://nextjs.org/docs/advanced-features/output-file-tracing +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static + +USER nextjs + +EXPOSE 3000 + +ENV PORT 3000 + +# server.js is created by next build from the standalone output +# https://nextjs.org/docs/pages/api-reference/next-config-js/output +CMD HOSTNAME="0.0.0.0" node server.js diff --git a/apps/auth/README.md b/apps/auth/README.md new file mode 100644 index 000000000..7accced55 --- /dev/null +++ b/apps/auth/README.md @@ -0,0 +1,20 @@ +This is a [Next.js](https://nextjs.org/) project + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +``` + +### Steps to log in to the admin panel locally: + +1. Go to `http://localhost:4455/admin-panel` URL to open the admin panel login. +2. Enter the email. For now, we have two allowed emails: `admin@galoy.io`. +3. Open MailHog to get the email magic link: `http://localhost:8025/`. +4. Click on the magic link to log in to the admin panel. diff --git a/apps/admin-panel/app/api/auth/[...nextauth]/options.ts b/apps/auth/app/api/auth/[...nextauth]/options.ts similarity index 100% rename from apps/admin-panel/app/api/auth/[...nextauth]/options.ts rename to apps/auth/app/api/auth/[...nextauth]/options.ts diff --git a/apps/admin-panel/app/api/auth/[...nextauth]/route.ts b/apps/auth/app/api/auth/[...nextauth]/route.ts similarity index 100% rename from apps/admin-panel/app/api/auth/[...nextauth]/route.ts rename to apps/auth/app/api/auth/[...nextauth]/route.ts diff --git a/apps/auth/app/api/health/route.ts b/apps/auth/app/api/health/route.ts new file mode 100644 index 000000000..ca62c7df3 --- /dev/null +++ b/apps/auth/app/api/health/route.ts @@ -0,0 +1,7 @@ +import { NextResponse } from "next/server" + +export async function GET() { + return NextResponse.json({ + status: "ok", + }) +} diff --git a/apps/auth/browserstack.json b/apps/auth/browserstack.json new file mode 100644 index 000000000..4f70ef717 --- /dev/null +++ b/apps/auth/browserstack.json @@ -0,0 +1,41 @@ +{ + "auth": { + "username": "SET ENV: BROWSERSTACK_USERNAME", + "access_key": "SET ENV: BROWSERSTACK_ACCESS_KEY" + }, + "browsers": [ + { + "browser": "chrome", + "os": "Windows 11", + "versions": [ + "latest" + ] + } + ], + "run_settings": { + "cypress_config_file": "cypress.config.ts", + "project_name": "Lana Bank Admin Panel", + "build_name": "Lana Bank Admin Panel", + "parallels": 1, + "npm_dependencies": { + "typescript": "^4", + "browserstack-cypress-cli": "latest", + "cypress": "latest" + }, + "exclude": [ + "node_modules/**/*", + ".git/**/*", + ".next/**/*" + ], + "headed": true, + "resolution": "2560x1440", + "downloads": [ + "./results", + "./cypress/screenshots" + ] + }, + "connection_settings": { + "local": false + }, + "disable_usage_reporting": false +} diff --git a/apps/auth/codegen.yml b/apps/auth/codegen.yml new file mode 100644 index 000000000..f8592bdaa --- /dev/null +++ b/apps/auth/codegen.yml @@ -0,0 +1,212 @@ +overwrite: true +schema: + - "../../lana/admin-server/src/graphql/schema.graphql" + - "./lib/graphql/local-schema.gql" +documents: + - "app/**/*.{ts,tsx}" + - "lib/**/*.{ts,tsx}" + - "components/**/*.{ts,tsx}" + - "hooks/**/*.{ts,tsx}" + - "services/**/*.{ts,tsx}" +generates: + ./lib/graphql/generated/index.ts: + plugins: + - typescript + - typescript-operations + - typescript-react-apollo + - add: + content: "// this file is autogenerated by codegen" + - add: + content: "\/* eslint-disable *\/" + config: + scalars: + UUID: string + UsdCents: "types#UsdCents" + Satoshis: "types#Satoshis" + SignedUsdCents: "types#SignedUsdCents" + SignedSatoshis: "types#SignedSatoshis" + ./lib/graphql/generated/mocks.ts: + plugins: + - add: + content: | + /* eslint-disable */ + // @ts-nocheck + import { + UsdCents, + Satoshis, + SignedUsdCents, + SignedSatoshis, + } from 'types'; + + faker.seed(12345); + + const getRandomEnumValue = >(enumObj: T): T[keyof T] => { + const enumValues = Object.values(enumObj).filter(v => typeof v === 'string') as T[keyof T][]; + return faker.helpers.arrayElement(enumValues); + }; + + // Generate mock values dynamically + const generateMockValue = { + uuid: () => faker.string.uuid(), + email: () => faker.internet.email(), + telegramId: () => faker.string.alphanumeric(10), + name: () => faker.person.fullName(), + url: () => faker.internet.url(), + description: () => faker.lorem.paragraph(), + timestamp: () => faker.date.recent().toISOString(), + reference: () => faker.string.alphanumeric(12), + filename: () => faker.system.fileName(), + boolean: () => faker.datatype.boolean(), + usdCents: () => faker.number.int({ min: 0, max: 1000000 }) as UsdCents, + satoshis: () => faker.number.int({ min: 0, max: 100000000 }) as Satoshis, + signedUsdCents: () => faker.number.int({ min: -1000000, max: 1000000 }) as SignedUsdCents, + signedSatoshis: () => faker.number.int({ min: -100000000, max: 100000000 }) as SignedSatoshis, + int: () => faker.number.int({ min: 0, max: 1000 }), + cursor: () => faker.string.alphanumeric(20), + deniedReason: () => null, + applicantId: () => faker.datatype.boolean() ? faker.string.uuid() : null + }; + + const mockEnums = { + accountStatus: () => getRandomEnumValue(AccountStatus), + approvalProcessStatus: () => getRandomEnumValue(ApprovalProcessStatus), + approvalProcessType: () => getRandomEnumValue(ApprovalProcessType), + collateralAction: () => getRandomEnumValue(CollateralAction), + collateralizationState: () => getRandomEnumValue(CollateralizationState), + creditFacilityStatus: () => getRandomEnumValue(CreditFacilityStatus), + disbursalStatus: () => getRandomEnumValue(DisbursalStatus), + documentStatus: () => getRandomEnumValue(DocumentStatus), + interestInterval: () => getRandomEnumValue(InterestInterval), + kycLevel: () => getRandomEnumValue(KycLevel), + period: () => getRandomEnumValue(Period), + reportProgress: () => getRandomEnumValue(ReportProgress), + role: () => getRandomEnumValue(Role), + sortDirection: () => getRandomEnumValue(SortDirection), + withdrawalStatus: () => getRandomEnumValue(WithdrawalStatus) + }; + + - typescript-mock-data: + typesFile: "./index.ts" + prefix: "mock" + terminateCircularRelationships: true + maxDepth: 2 + dynamicValues: true + scalars: + UUID: "generateMockValue.uuid()" + UsdCents: "generateMockValue.usdCents()" + Satoshis: "generateMockValue.satoshis()" + SignedUsdCents: "generateMockValue.signedUsdCents()" + SignedSatoshis: "generateMockValue.signedSatoshis()" + Timestamp: "generateMockValue.timestamp()" + AnnualRatePct: "generateMockValue.int()" + CVLPct: "generateMockValue.int()" + DisbursalIdx: "generateMockValue.int()" + fieldGeneration: + _all: + email: "generateMockValue.email()" + name: "generateMockValue.name()" + reference: "generateMockValue.reference()" + url: "generateMockValue.url()" + description: "generateMockValue.description()" + filename: "generateMockValue.filename()" + createdAt: "generateMockValue.timestamp()" + updatedAt: "generateMockValue.timestamp()" + activatedAt: "generateMockValue.timestamp()" + expiresAt: "generateMockValue.timestamp()" + recordedAt: "generateMockValue.timestamp()" + votedAt: "generateMockValue.timestamp()" + telegramId: "generateMockValue.telegramId()" + hasSubAccounts: "generateMockValue.boolean()" + canBeCompleted: "generateMockValue.boolean()" + stillEligible: "generateMockValue.boolean()" + didVote: "generateMockValue.boolean()" + didApprove: "generateMockValue.boolean()" + didDeny: "generateMockValue.boolean()" + authorized: "generateMockValue.boolean()" + success: "generateMockValue.boolean()" + cursor: "generateMockValue.cursor()" + deniedReason: "generateMockValue.deniedReason()" + applicantId: "generateMockValue.applicantId()" + + Customer: + status: "mockEnums.accountStatus()" + level: "mockEnums.kycLevel()" + + CreditFacility: + status: "mockEnums.creditFacilityStatus()" + collateralizationState: "mockEnums.collateralizationState()" + facilityAmount: "generateMockValue.usdCents()" + collateral: "generateMockValue.satoshis()" + + Withdrawal: + status: "mockEnums.withdrawalStatus()" + amount: "generateMockValue.usdCents()" + + ApprovalProcess: + status: "mockEnums.approvalProcessStatus()" + approvalProcessType: "mockEnums.approvalProcessType()" + + Document: + status: "mockEnums.documentStatus()" + + User: + roles: "...faker.helpers.arrayElements(Object.values(Role).filter(v => typeof v === 'string'))" + + Committee: + threshold: "generateMockValue.int()" + + Dashboard: + activeFacilities: "generateMockValue.int()" + pendingFacilities: "generateMockValue.int()" + totalDisbursed: "generateMockValue.usdCents()" + totalCollateral: "generateMockValue.satoshis()" + + PageInfo: + hasPreviousPage: "generateMockValue.boolean()" + hasNextPage: "generateMockValue.boolean()" + startCursor: "generateMockValue.cursor()" + endCursor: "generateMockValue.cursor()" + + RealtimePrice: + usdCentsPerBtc: "generateMockValue.usdCents()" + + Checking: + settled: "generateMockValue.usdCents()" + pending: "generateMockValue.usdCents()" + + Collateral: + btcBalance: "generateMockValue.satoshis()" + + Duration: + period: "mockEnums.period()" + units: "faker.helpers.arrayElement([6, 12, 24])" + + FacilityCVL: + total: "generateMockValue.int()" + disbursed: "generateMockValue.int()" + + CreditFacilitiesFilter: + status: "mockEnums.creditFacilityStatus()" + collateralizationState: "mockEnums.collateralizationState()" + + TermValues: + annualRate: "faker.number.int({ min: 5, max: 20 })" + accrualInterval: "mockEnums.interestInterval()" + incurrenceInterval: "mockEnums.interestInterval()" + liquidationCvl: "faker.number.int({ min: 85, max: 88 })" + marginCallCvl: "faker.number.int({ min: 90, max: 92 })" + initialCvl: "faker.number.int({ min: 95, max: 98 })" + Report: + status: "mockEnums.reportProgress()" + + BtcAccountAmounts: + debit: "generateMockValue.satoshis()" + credit: "generateMockValue.satoshis()" + netDebit: "generateMockValue.signedSatoshis()" + netCredit: "generateMockValue.signedSatoshis()" + + UsdAccountAmounts: + debit: "generateMockValue.usdCents()" + credit: "generateMockValue.usdCents()" + netDebit: "generateMockValue.signedUsdCents()" + netCredit: "generateMockValue.signedUsdCents()" diff --git a/apps/auth/components.json b/apps/auth/components.json new file mode 100644 index 000000000..03d554a8a --- /dev/null +++ b/apps/auth/components.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "tailwind.config.ts", + "css": "app/globals.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/ui", + "utils": "@/lib/utils", + "ui": "@/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "iconLibrary": "lucide" +} \ No newline at end of file diff --git a/apps/auth/cypress.config.ts b/apps/auth/cypress.config.ts new file mode 100644 index 000000000..524208247 --- /dev/null +++ b/apps/auth/cypress.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from "cypress" + +export default defineConfig({ + e2e: { + baseUrl: + process.env.BACKEND_ENV === "development" + ? "http://localhost:4455/admin-panel" + : "https://admin.staging.lava.galoy.io", + defaultCommandTimeout: 10000, + requestTimeout: 10000, + video: true, + env: { + MAGIC_LINK: process.env.MAGIC_LINK, + }, + }, +}) diff --git a/apps/auth/env.ts b/apps/auth/env.ts new file mode 100644 index 000000000..9a94f9cc6 --- /dev/null +++ b/apps/auth/env.ts @@ -0,0 +1,45 @@ +import { createEnv } from "@t3-oss/env-nextjs" +import { z } from "zod" + +export const env = createEnv({ + shared: { + NEXT_PUBLIC_CORE_ADMIN_URL: z + .string() + .url() + .default("http://localhost:4455/admin/graphql"), + + // NEXTAUTH_* are just here for documentation. they need to be injected in .env for NEXTAUTH to pick them up + NEXTAUTH_SECRET: z.string().min(8).default("nextAuthSecret"), + NEXTAUTH_URL: z.string().url().default("http://localhost:4455/admin-panel/api/auth"), + NEXTAUTH_INTERNAL_URL: z + .string() + .url() + .default("http://localhost:4455/admin-panel/api/auth"), + + NEXT_PUBLIC_BASE_PATH: z.string().default("/"), + }, + server: { + CHECK_USER_ALLOWED_CALLBACK_URL: z + .string() + .default("http://localhost:5253/user/callback"), + EMAIL_FROM: z.string().default("no-reply@lana-bank.com"), + EMAIL_SERVER: z.string().default("smtp://localhost:1025"), + NEXT_AUTH_DATABASE_URL: z + .string() + .url() + .default("postgres://dbuser:secret@localhost:5435/default?sslmode=disable"), + }, + runtimeEnv: { + CHECK_USER_ALLOWED_CALLBACK_URL: process.env.USER_ALLOWED_CALLBACK_URL, + NEXT_PUBLIC_CORE_ADMIN_URL: process.env.NEXT_PUBLIC_CORE_ADMIN_URL, + NEXT_PUBLIC_BASE_PATH: process.env.NEXT_PUBLIC_BASE_PATH, + NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET, + NEXTAUTH_URL: process.env.NEXTAUTH_URL, + NEXTAUTH_INTERNAL_URL: process.env.NEXTAUTH_INTERNAL_URL, + NEXT_AUTH_DATABASE_URL: process.env.NEXT_AUTH_DATABASE_URL, + EMAIL_SERVER: process.env.EMAIL_SERVER, + EMAIL_FROM: process.env.EMAIL_FROM, + }, +}) + +export const basePath = env.NEXT_PUBLIC_BASE_PATH === "/" ? "" : env.NEXT_PUBLIC_BASE_PATH diff --git a/apps/auth/instrumentation.ts b/apps/auth/instrumentation.ts new file mode 100644 index 000000000..e804d5d15 --- /dev/null +++ b/apps/auth/instrumentation.ts @@ -0,0 +1,26 @@ +export async function register() { + if (process.env.NEXT_RUNTIME === "nodejs") { + const { pool } = await import("@/lib/auth/db") + const createTableQuery = ` + CREATE TABLE IF NOT EXISTS verification_token ( + identifier TEXT NOT NULL, + expires TIMESTAMPTZ NOT NULL, + token TEXT NOT NULL, + PRIMARY KEY (identifier, token) + ); + ` + try { + const client = await pool.connect() + try { + await client.query(createTableQuery) + console.log("Table created successfully or already exists") + } finally { + client.release() + } + } catch (err) { + console.error("Error creating table", err) + } finally { + pool.end() + } + } +} diff --git a/apps/auth/middleware.ts b/apps/auth/middleware.ts new file mode 100644 index 000000000..a7e521f3b --- /dev/null +++ b/apps/auth/middleware.ts @@ -0,0 +1,22 @@ +import { NextRequest, NextResponse } from "next/server" + +export { default } from "next-auth/middleware" + +export const config = { + matcher: [ + /* + * Match all request paths except for the ones starting with: + * - api (API routes) + * - _next/static (static files) + * - _next/image (image optimization files) + * - favicon.ico (favicon file) + */ + "/((?!api|_next/static|_next/image|favicon.ico).*)", + ], +} + +export function middleware(request: NextRequest) { + const headers = new Headers(request.headers) + headers.set("x-current-path", request.nextUrl.pathname) + return NextResponse.next({ headers }) +} diff --git a/apps/auth/next.config.mjs b/apps/auth/next.config.mjs new file mode 100644 index 000000000..0f3d38f91 --- /dev/null +++ b/apps/auth/next.config.mjs @@ -0,0 +1,20 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + webpack: (config) => { + config.module.rules.push({ + test: /\.svg$/i, + use: ["@svgr/webpack"], + }) + return config + }, + experimental: { + instrumentationHook: true, + }, + output: "standalone", + basePath: process.env.NEXT_PUBLIC_BASE_PATH, + compiler: { + reactRemoveProperties: false, + }, +} + +export default nextConfig