This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Run database migrations with the power of bash | |
# | |
set -eu -o pipefail | |
cd "$(dirname "$0")/.." | |
if [ "$#" -lt 2 ]; then | |
1>&2 echo "Usage: $0 postgres://url/db <migration dir>" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Conseil from 'conseiljs'; | |
import { SoftSigner } from 'conseiljs-softsigner'; | |
import { ns } from '@sideshift/shared'; | |
import { | |
initializeConseil, | |
TezosRpcClient, | |
getTezosKeyStoreFromSecret, | |
createLogger, | |
} from '@sideshift/shared-node'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { middleware as whitelistMiddleware } from './utils/introspecton-whitelist'; | |
import { whitelist as introspectionWhitelist } from './utils/introspecton-whitelist/whitelist'; | |
// Your express app | |
// Whitelist GraphQL introspection responses | |
app.use(whitelistMiddleware(introspectionWhitelist)); | |
// Apollo middleware must be below whitelisting middleware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heroku logs -a YOUR_APP_NAME -t | sed 's/[^{]*//' | npx pino-pretty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pMap from 'p-map'; | |
import pRetry from 'p-retry'; | |
import { safePromise } from 'safep'; | |
import { chain, values, chunk, flatten } from 'lodash'; | |
import { fromEnv as configFromEnv, SlpDepositConfig } from './config'; | |
import { slpTokens } from '../shared/slp-tokens'; | |
import { runWorkerUntilShutdown } from '../shared/utils-node'; | |
import { getBitcoinRpc } from '../shared/rpcs'; | |
import { | |
toBchAddress, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Authorize linking the domain name sideshift.ai to the Liquid asset d5a8a7af573c0bfa59584a0553f8899dfbcde9f7d839db85d187909fb70e2876 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { fromEnv as configFromEnv } from './config'; | |
import { getRpc } from '../shared/rpcs'; | |
import { n, runWorkerUntilShutdown } from '../shared/utils'; | |
import { createDeposit, getConnection, Deposit, Quote } from '../shared/orm'; | |
import { safePromise } from 'safep'; | |
import { AxiosError } from 'axios'; | |
const config = configFromEnv(); | |
const depositMethod = config.depositMethod!; | |
const { node, asset } = depositMethod!; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jan 31 11:41:14am info app worker.1 assert(amount) | |
Jan 31 11:41:14am info app worker.1 at fetchDepositAddress (/app/src/web/backend/utils/address.js:146:5) | |
Jan 31 11:41:14am info app worker.1 at shift (/app/src/worker-shifty/start.js:72:32) | |
Jan 31 11:41:14am info app worker.1 at process._tickCallback (internal/process/next_tick.js:68:7) | |
Time gap of 5 minutes • Thursday, January 31st at 11:46 am | |
Jan 31 11:46:19am info app worker.1 19 deposit methods can send $5 | |
Jan 31 11:46:19am info app worker.1 16 deposit methods are possible to send automatically | |
Jan 31 11:46:19am info app worker.1 Picked the deposit method ltc (asset LTC) by random | |
Jan 31 11:46:19am info app worker.1 Picked the settle method bch (asset BCH) by random | |
Jan 31 11:46:19am info app worker.1 Creating quote... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { delayUnlessShutdown } = require('shutin'); | |
const { depositMethods, settleMethods } = require('../shared/facts'); | |
const { n } = require('../shared/utils'); | |
const { fetchRate, convert } = require('../shared/rates'); | |
const { sample, values, chain, keys } = require('lodash'); | |
const { fetchInventorySnapshot } = require('../shared/db'); | |
const pReduce = require('p-reduce'); | |
const { fetchDepositAddress } = require('../web/backend/utils/address'); | |
const payWith = require('../shared/pay'); | |
const { safePromise } = require('safep'); |
NewerOlder