diff options
| author | Adam Soltys <[email protected]> | 2022-09-05 20:44:26 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-09-05 20:44:26 -0700 |
| commit | 3ae34e6bf84d988c25254374768f2898865df857 (patch) | |
| tree | e08b5074b9c5ebb3375b3e28fd0aac220042c44d /routes | |
| parent | 39fd8f38c7c9e3d231f7347ea51f79812fd524da (diff) | |
| download | coinos-server-3ae34e6bf84d988c25254374768f2898865df857.tar.gz coinos-server-3ae34e6bf84d988c25254374768f2898865df857.zip | |
drop js extension
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/admin.js | 2 | ||||
| -rw-r--r-- | routes/assets.js | 6 | ||||
| -rw-r--r-- | routes/bitcoin/broadcast.js | 2 | ||||
| -rw-r--r-- | routes/bitcoin/fee.js | 2 | ||||
| -rw-r--r-- | routes/bitcoin/index.js | 10 | ||||
| -rw-r--r-- | routes/bitcoin/receive.js | 10 | ||||
| -rw-r--r-- | routes/bitcoin/send.js | 4 | ||||
| -rw-r--r-- | routes/bitcoin/sweep.js | 6 | ||||
| -rw-r--r-- | routes/funding.js | 4 | ||||
| -rw-r--r-- | routes/info.js | 2 | ||||
| -rw-r--r-- | routes/invoices.js | 6 | ||||
| -rw-r--r-- | routes/lightning/channelRequest.js | 2 | ||||
| -rw-r--r-- | routes/lightning/index.js | 10 | ||||
| -rw-r--r-- | routes/lightning/receive.js | 12 | ||||
| -rw-r--r-- | routes/liquid/broadcast.js | 2 | ||||
| -rw-r--r-- | routes/liquid/fee.js | 2 | ||||
| -rw-r--r-- | routes/liquid/index.js | 10 | ||||
| -rw-r--r-- | routes/liquid/receive.js | 12 | ||||
| -rw-r--r-- | routes/liquid/send.js | 4 | ||||
| -rw-r--r-- | routes/lnurl.js | 10 | ||||
| -rw-r--r-- | routes/payments.js | 26 | ||||
| -rw-r--r-- | routes/send.js | 8 | ||||
| -rw-r--r-- | routes/swaps.js | 6 | ||||
| -rw-r--r-- | routes/users.js | 10 |
24 files changed, 84 insertions, 84 deletions
diff --git a/routes/admin.js b/routes/admin.js index f63c64b3..918f9423 100644 --- a/routes/admin.js +++ b/routes/admin.js @@ -1,7 +1,7 @@ import express from 'express'; var router = express.Router(); -import * as parseInput from '../scripts/apiParse.js'; +import * as parseInput from '../scripts/apiParse'; import Sequelize from '@sequelize/core'; const Op = Sequelize.Op; diff --git a/routes/assets.js b/routes/assets.js index f942cf12..eaf15398 100644 --- a/routes/assets.js +++ b/routes/assets.js @@ -1,6 +1,6 @@ -import store from "$lib/store.js"; -import app from "$app.js"; -import { auth } from "$lib/passport.js"; +import store from "$lib/store"; +import app from "$app"; +import { auth } from "$lib/passport"; import axios from 'axios'; import crypto from 'crypto'; import fs from 'fs'; diff --git a/routes/bitcoin/broadcast.js b/routes/bitcoin/broadcast.js index 2bf61049..2e8c61b7 100644 --- a/routes/bitcoin/broadcast.js +++ b/routes/bitcoin/broadcast.js @@ -1,4 +1,4 @@ -import store from "$lib/store.js"; +import store from "$lib/store"; export default async (req, res) => { try { const { user } = req; diff --git a/routes/bitcoin/fee.js b/routes/bitcoin/fee.js index f701752d..fe0c7a26 100644 --- a/routes/bitcoin/fee.js +++ b/routes/bitcoin/fee.js @@ -1,4 +1,4 @@ -import buildTx from "$lib/buildtx.js"; +import buildTx from "$lib/buildtx"; export default async (req, res) => { let { user } = req; diff --git a/routes/bitcoin/index.js b/routes/bitcoin/index.js index 9d096e8f..58b0d193 100644 --- a/routes/bitcoin/index.js +++ b/routes/bitcoin/index.js @@ -1,8 +1,8 @@ -import broadcast from "./broadcast.js"; -import generate from "./generate.js"; -import sweep from "./sweep.js"; -import fee from "./fee.js"; -import send from "./send.js"; +import broadcast from "./broadcast"; +import generate from "./generate"; +import sweep from "./sweep"; +import fee from "./fee"; +import send from "./send"; export default { broadcast, diff --git a/routes/bitcoin/receive.js b/routes/bitcoin/receive.js index 1391a7d6..93341dc9 100644 --- a/routes/bitcoin/receive.js +++ b/routes/bitcoin/receive.js @@ -1,8 +1,8 @@ -import { rates } from "$lib/store.js"; -import { notify } from "$lib/notifications.js"; -import { callWebhook } from "$lib/webhooks.js"; +import { rates } from "$lib/store"; +import { notify } from "$lib/notifications"; +import { callWebhook } from "$lib/webhooks"; import reverse from 'buffer-reverse'; -import zmq from 'zeromq/v5-compat.js'; +import zmq from 'zeromq/v5-compat'; import { Op } from '@sequelize/core'; import { fromBase58 } from 'bip32'; import bitcoin from 'bitcoinjs-lib'; @@ -23,7 +23,7 @@ const network = const queue = {}; const seen = []; -import { computeConversionFee } from './conversionFee.js'; +import { computeConversionFee } from './conversionFee'; zmqRawTx.on("message", async (topic, message, sequence) => { const hex = message.toString("hex"); diff --git a/routes/bitcoin/send.js b/routes/bitcoin/send.js index 34f27ac8..a0ff3bb6 100644 --- a/routes/bitcoin/send.js +++ b/routes/bitcoin/send.js @@ -1,5 +1,5 @@ -import store from "$lib/store.js"; -import config from "$config/index.js"; +import store from "$lib/store"; +import config from "$config"; const btc = config.liquid.btcasset; import { computeConversionFee, diff --git a/routes/bitcoin/sweep.js b/routes/bitcoin/sweep.js index 4d399c0d..8bb51f14 100644 --- a/routes/bitcoin/sweep.js +++ b/routes/bitcoin/sweep.js @@ -1,9 +1,9 @@ -import config from "$config/index.js"; -import { prod } from "$lib/utils.js"; +import config from "$config"; +import { prod } from "$lib/utils"; import axios from "axios"; import bitcoin from "bitcoinjs-lib"; import coinselect from "coinselect"; -import split from "coinselect/split.js"; +import split from "coinselect/split"; const api = prod ? "https://blockstream.info/api" : config.bitcoin.electrs; const SATS = 100000000; diff --git a/routes/funding.js b/routes/funding.js index 6dc4939e..c8654a31 100644 --- a/routes/funding.js +++ b/routes/funding.js @@ -1,5 +1,5 @@ -import app from "$app.js"; -import config from "$config/index.js"; +import app from "$app"; +import config from "$config"; import mailgunFactory from 'mailgun-js'; const mailgun = mailgunFactory(config.mailgun); diff --git a/routes/info.js b/routes/info.js index 84f61fa1..06736b9a 100644 --- a/routes/info.js +++ b/routes/info.js @@ -1,4 +1,4 @@ -import app from "$app.js"; +import app from "$app"; import sequelize from '@sequelize/core'; const { Op } = sequelize; diff --git a/routes/invoices.js b/routes/invoices.js index 721fbc39..bb65f811 100644 --- a/routes/invoices.js +++ b/routes/invoices.js @@ -1,6 +1,6 @@ -import store from "$lib/store.js"; -import app from "$app.js"; -import { optionalAuth } from "$lib/passport.js"; +import store from "$lib/store"; +import app from "$app"; +import { optionalAuth } from "$lib/passport"; import { Op } from "@sequelize/core"; import axios from "axios"; diff --git a/routes/lightning/channelRequest.js b/routes/lightning/channelRequest.js index a2a29d4d..e8938929 100644 --- a/routes/lightning/channelRequest.js +++ b/routes/lightning/channelRequest.js @@ -1,4 +1,4 @@ -import { lnurlServer } from "$lnurl.js"; +import { lnurlServer } from "$lnurl"; export default async (req, res) => { let { localAmt, pushAmt } = req.body; diff --git a/routes/lightning/index.js b/routes/lightning/index.js index 5d82cb5b..97c7c056 100644 --- a/routes/lightning/index.js +++ b/routes/lightning/index.js @@ -1,8 +1,8 @@ -import channel from "./channel.js"; -import channelRequest from "./channelRequest.js"; -import invoice from "./invoice.js"; -import query from "./query.js"; -import send from "./send.js"; +import channel from "./channel"; +import channelRequest from "./channelRequest"; +import invoice from "./invoice"; +import query from "./query"; +import send from "./send"; export default { channel, diff --git a/routes/lightning/receive.js b/routes/lightning/receive.js index e5e93e91..790338d2 100644 --- a/routes/lightning/receive.js +++ b/routes/lightning/receive.js @@ -1,9 +1,9 @@ -import config from "$config/index.js"; -import { notify } from "$lib/notifications.js"; -import { callWebhook } from "$lib/webhooks.js"; -import { computeConversionFee } from './conversionFee.js'; -import { sendLiquid } from "$liquid/send.js"; -import ln from "$lib/ln.js"; +import config from "$config"; +import { notify } from "$lib/notifications"; +import { callWebhook } from "$lib/webhooks"; +import { computeConversionFee } from './conversionFee'; +import { sendLiquid } from "$liquid/send"; +import ln from "$lib/ln"; const handlePayment = async (msg) => { l("incoming lightning payment", msg.value, msg.payment_request, msg.settled); diff --git a/routes/liquid/broadcast.js b/routes/liquid/broadcast.js index 5d8e751b..e9cbcaf5 100644 --- a/routes/liquid/broadcast.js +++ b/routes/liquid/broadcast.js @@ -1,4 +1,4 @@ -import store from "$lib/store.js"; +import store from "$lib/store"; export default async (req, res) => { try { const { user } = req; diff --git a/routes/liquid/fee.js b/routes/liquid/fee.js index 055a60ed..e5b9ad74 100644 --- a/routes/liquid/fee.js +++ b/routes/liquid/fee.js @@ -1,4 +1,4 @@ -import buildTx from "$lib/buildliquidtx.js"; +import buildTx from "$lib/buildliquidtx"; liquidTx = async ({ address, asset, amount, feeRate, replaceable, user }) => { let tx, fee; diff --git a/routes/liquid/index.js b/routes/liquid/index.js index 2b6b72b9..6da18363 100644 --- a/routes/liquid/index.js +++ b/routes/liquid/index.js @@ -1,8 +1,8 @@ -import broadcast from "./broadcast.js"; -import generate from "./generate.js"; -// import fee from "./fee.js"; -import send from "./send.js"; -// import taxi from "./taxi.js"; +import broadcast from "./broadcast"; +import generate from "./generate"; +// import fee from "./fee"; +import send from "./send"; +// import taxi from "./taxi"; export default { broadcast, diff --git a/routes/liquid/receive.js b/routes/liquid/receive.js index 0d8fa22d..5f2d7718 100644 --- a/routes/liquid/receive.js +++ b/routes/liquid/receive.js @@ -1,9 +1,9 @@ -import store from "$lib/store.js"; -import { sendLiquid } from "./send.js"; -import { notify } from "$lib/notifications.js"; -import { callWebhook } from "$lib/webhooks.js"; +import store from "$lib/store"; +import { sendLiquid } from "./send"; +import { notify } from "$lib/notifications"; +import { callWebhook } from "$lib/webhooks"; import reverse from 'buffer-reverse'; -import zmq from 'zeromq/v5-compat.js'; +import zmq from 'zeromq/v5-compat'; import { Op } from '@sequelize/core'; import { fromBase58 } from 'bip32'; import bitcoin from 'bitcoinjs-lib'; @@ -14,7 +14,7 @@ const network = config.liquid.network === "mainnet" ? "liquid" : config.liquid.network ]; -import { computeConversionFee } from './conversionFee.js'; +import { computeConversionFee } from './conversionFee'; const getAccount = async (params, transaction) => { let account = await db.Account.findOne({ diff --git a/routes/liquid/send.js b/routes/liquid/send.js index 00fb9d10..70d858e6 100644 --- a/routes/liquid/send.js +++ b/routes/liquid/send.js @@ -1,5 +1,5 @@ -import store from "$lib/store.js"; -import config from "$config/index.js"; +import store from "$lib/store"; +import config from "$config"; const btc = config.liquid.btcasset; const lcad = config.liquid.cadasset; // import { Transaction } from 'liquidjs-lib'; diff --git a/routes/lnurl.js b/routes/lnurl.js index 62f83233..e7bdfd71 100644 --- a/routes/lnurl.js +++ b/routes/lnurl.js @@ -1,13 +1,13 @@ -import store from "$lib/store.js"; -import app from "$app.js"; -import config from "$config/index.js"; +import store from "$lib/store"; +import app from "$app"; +import config from "$config"; import axios from "axios"; import lnurl from "lnurl"; import jwt from "jsonwebtoken"; import qs from "query-string"; -import persist from "$lib/persist.js"; +import persist from "$lib/persist"; import bolt11 from "bolt11"; -import { optionalAuth, auth } from "$lib/passport.js"; +import { optionalAuth, auth } from "$lib/passport"; export const logins = persist("data/logins.json"); export const recipients = persist("data/recipients.json"); diff --git a/routes/payments.js b/routes/payments.js index 0bffffed..4d1debc0 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -1,17 +1,17 @@ -import store from "$lib/store.js"; -import bc from "$lib/bitcoin.js"; -import app from "$app.js"; -import config from "$config/index.js"; -import { auth, adminAuth, optionalAuth } from "$lib/passport.js"; +import store from "$lib/store"; +import bc from "$lib/bitcoin"; +import app from "$app"; +import config from "$config"; +import { auth, adminAuth, optionalAuth } from "$lib/passport"; import fs from "fs"; import { join } from "path"; import { Op } from "@sequelize/core"; -import send from "./send.js"; -import { warn } from "$lib/logging.js"; +import send from "./send"; +import { warn } from "$lib/logging"; -import btcRoutes from "./bitcoin/index.js"; -import lnRoutes from "./lightning/index.js"; -import lqRoutes from "./liquid/index.js"; +import btcRoutes from "./bitcoin/index"; +import lnRoutes from "./lightning/index"; +import lqRoutes from "./liquid/index"; app.post("/send", auth, send); app.post("/sendToTokenHolders", auth, async (req, res, next) => { @@ -57,7 +57,7 @@ if (config.lna) { app.post("/lightning/invoice", lnRoutes.invoice); app.post("/lightning/query", auth, lnRoutes.query); app.post("/lightning/send", auth, lnRoutes.send); - import("./lightning/receive.js"); + import("./lightning/receive"); } if (config.bitcoin) { @@ -66,7 +66,7 @@ if (config.bitcoin) { app.post("/bitcoin/sweep", auth, btcRoutes.sweep); app.post("/bitcoin/fee", auth, btcRoutes.fee); app.post("/bitcoin/send", auth, btcRoutes.send); - import("./bitcoin/receive.js"); + import("./bitcoin/receive"); setTimeout(async () => { try { @@ -86,7 +86,7 @@ if (config.liquid) { // app.post("/liquid/fee", auth, lqRoutes.fee); app.post("/liquid/send", auth, lqRoutes.send); // app.post("/taxi", auth, lqRoutes.taxi); - import("./liquid/receive.js"); + import("./liquid/receive"); setTimeout(async () => { try { diff --git a/routes/send.js b/routes/send.js index a55c70b4..67dbaca4 100644 --- a/routes/send.js +++ b/routes/send.js @@ -1,9 +1,9 @@ -import store from "$lib/store.js"; -import { callWebhook } from "$lib/webhooks.js"; +import store from "$lib/store"; +import { callWebhook } from "$lib/webhooks"; import axios from "axios"; import { v4 } from "uuid"; -import { notify } from "$lib/notifications.js"; -import { sendLiquid } from "./liquid/send.js"; +import { notify } from "$lib/notifications"; +import { sendLiquid } from "./liquid/send"; export default async (req, res, next) => { let { diff --git a/routes/swaps.js b/routes/swaps.js index fa8dbfab..9f7cfcbf 100644 --- a/routes/swaps.js +++ b/routes/swaps.js @@ -1,10 +1,10 @@ -import { rates } from "$lib/store.js"; +import { rates } from "$lib/store"; import axios from 'axios'; import crypto from 'crypto'; import fs from 'fs'; -import getAccount from '../lib/account.js'; +import getAccount from '../lib/account'; import { Op, col } from '@sequelize/core'; -import { rates } from "$lib/store.js"; +import { rates } from "$lib/store"; const shallow = a => { let b = {}; diff --git a/routes/users.js b/routes/users.js index cdc51174..7a8c6785 100644 --- a/routes/users.js +++ b/routes/users.js @@ -1,18 +1,18 @@ -import app from "$app.js"; -import { auth, optionalAuth } from "$lib/passport.js"; -import { getUser } from "$lib/utils.js"; +import app from "$app"; +import { auth, optionalAuth } from "$lib/passport"; +import { getUser } from "$lib/utils"; import axios from "axios"; import bcrypt from "bcrypt"; import jwt from "jsonwebtoken"; import { authenticator } from "otplib"; -import getAccount from "$lib/account.js"; +import getAccount from "$lib/account"; import Sequelize from "@sequelize/core"; import bitcoin from "bitcoinjs-lib"; // import liquid from 'liquidjs-lib'; import { fromBase58, fromPrivateKey } from "bip32"; import { Mutex } from "async-mutex"; import bip32 from "bip32"; -import whitelist from "$lib/whitelist.js"; +import whitelist from "$lib/whitelist"; const pick = (O, ...K) => K.reduce((o, k) => ((o[k] = O[k]), o), {}); |
