Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/partners/banxa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ function getFiatPaymentType(tx: BanxaTx): FiatPaymentType {
case 'Sofort Transfer':
return 'sofort'
case 'Checkout Credit Card':
case 'Primer Credit Card':
case 'WorldPay Credit Card':
return 'credit'
case 'ClearJunction Fast Pay':
Expand All @@ -325,6 +326,7 @@ function getFiatPaymentType(tx: BanxaTx): FiatPaymentType {
case 'PayID via Monoova':
return 'payid'
case 'WorldPay ApplePay':
case 'Primer Apple Pay':
return 'applepay'
case 'WorldPay GooglePay':
return 'googlepay'
Expand Down
3 changes: 2 additions & 1 deletion src/partners/bitaccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import fetch from 'node-fetch'

import { PartnerPlugin, PluginParams, PluginResult, StandardTx } from '../types'
import { datelog } from '../util'
import { queryDummy } from './dummy'

const asBitaccessTx = asObject({
trade_type: asValue<['buy', 'sell']>('buy', 'sell'),
Expand Down Expand Up @@ -117,7 +118,7 @@ export async function queryBitaccess(

export const bitaccess: PartnerPlugin = {
// queryFunc will take PluginSettings as arg and return PluginResult
queryFunc: queryBitaccess,
queryFunc: queryDummy,
// results in a PluginResult
pluginName: 'Bitaccess',
pluginId: 'bitaccess'
Expand Down
3 changes: 2 additions & 1 deletion src/partners/coinswitch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import fetch from 'node-fetch'

import { PartnerPlugin, PluginParams, PluginResult, StandardTx } from '../types'
import { datelog } from '../util'
import { queryDummy } from './dummy'

const asCoinSwitchTx = asObject({
status: asString,
Expand Down Expand Up @@ -97,7 +98,7 @@ export async function queryCoinSwitch(

export const coinswitch: PartnerPlugin = {
// queryFunc will take PluginSettings as arg and return PluginResult
queryFunc: queryCoinSwitch,
queryFunc: queryDummy,
// results in a PluginResult
pluginName: 'CoinSwitch',
pluginId: 'coinswitch'
Expand Down
10 changes: 10 additions & 0 deletions src/partners/dummy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { PluginParams, PluginResult } from '../types'

export async function queryDummy(
Comment thread
samholmes marked this conversation as resolved.
pluginParams: PluginParams
): Promise<PluginResult> {
return {
settings: { lastTimestamp: 0 },
transactions: []
}
}
3 changes: 2 additions & 1 deletion src/partners/faast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import fetch from 'node-fetch'

import { PartnerPlugin, PluginParams, PluginResult, StandardTx } from '../types'
import { datelog } from '../util'
import { queryDummy } from './dummy'

const asFaastTx = asObject({
swap_id: asString,
Expand Down Expand Up @@ -99,7 +100,7 @@ export async function queryFaast(

export const faast: PartnerPlugin = {
// queryFunc will take PluginSettings as arg and return PluginResult
queryFunc: queryFaast,
queryFunc: queryDummy,
// results in a PluginResult
pluginName: 'Faast',
pluginId: 'faast'
Expand Down
3 changes: 2 additions & 1 deletion src/partners/foxExchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import fetch from 'node-fetch'

import { PartnerPlugin, PluginParams, PluginResult, StandardTx } from '../types'
import { datelog } from '../util'
import { queryDummy } from './dummy'

const asFoxExchangeTx = asObject({
orderId: asString,
Expand Down Expand Up @@ -111,7 +112,7 @@ export async function queryFoxExchange(

export const foxExchange: PartnerPlugin = {
// queryFunc will take PluginSettings as arg and return PluginResult
queryFunc: queryFoxExchange,
queryFunc: queryDummy,
// results in a PluginResult
pluginName: 'FoxExchange',
pluginId: 'foxExchange'
Expand Down
3 changes: 2 additions & 1 deletion src/partners/gebo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { PartnerPlugin, PluginParams, PluginResult, StandardTx } from '../types'
import { datelog } from '../util'
import { queryDummy } from './dummy'

export async function queryGebo(
pluginParams: PluginParams
Expand All @@ -14,7 +15,7 @@ export async function queryGebo(

export const gebo: PartnerPlugin = {
// queryFunc will take PluginSettings as arg and return PluginResult
queryFunc: queryGebo,
queryFunc: queryDummy,
// results in a PluginResult
pluginName: 'Gebo',
pluginId: 'gebo'
Expand Down
3 changes: 2 additions & 1 deletion src/partners/ioniagiftcard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
Status
} from '../types'
import { datelog, retryFetch, smartIsoDateFromTimestamp, snooze } from '../util'
import { queryDummy } from './dummy'

const asIoniaStatus = asMaybe(asValue('complete'), 'other')

Expand Down Expand Up @@ -129,7 +130,7 @@ export const queryIoniaGiftCards = async (

export const ioniaGiftCards: PartnerPlugin = {
// queryFunc will take PluginSettings as arg and return PluginResult
queryFunc: queryIoniaGiftCards,
queryFunc: queryDummy,
// results in a PluginResult
pluginName: 'Ionia Gift Cards',
pluginId: 'ioniagiftcards'
Expand Down
3 changes: 2 additions & 1 deletion src/partners/ioniavisarewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
Status
} from '../types'
import { datelog, retryFetch, smartIsoDateFromTimestamp, snooze } from '../util'
import { queryDummy } from './dummy'

const asIoniaStatus = asMaybe(asValue('complete'), 'other')

Expand Down Expand Up @@ -129,7 +130,7 @@ export const queryIoniaVisaRewards = async (

export const ioniaVisaRewards: PartnerPlugin = {
// queryFunc will take PluginSettings as arg and return PluginResult
queryFunc: queryIoniaVisaRewards,
queryFunc: queryDummy,
// results in a PluginResult
pluginName: 'Ionia Visa Rewards',
pluginId: 'ioniavisarewards'
Expand Down
4 changes: 2 additions & 2 deletions src/partners/kado.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
asBoolean,
asDate,
asEither,
asNull,
asNumber,
asObject,
asString,
Expand All @@ -20,6 +19,7 @@ import {
StandardTx
} from '../types'
import { datelog, retryFetch, smartIsoDateFromTimestamp, snooze } from '../util'
import { queryDummy } from './dummy'

// Define cleaner for individual transactions in onRamps and offRamps
const asTxType = asValue('buy', 'sell')
Expand Down Expand Up @@ -120,7 +120,7 @@ export async function queryKado(
}

export const kado: PartnerPlugin = {
queryFunc: queryKado,
queryFunc: queryDummy,
pluginName: 'Kado',
pluginId: 'kado'
}
Expand Down
2 changes: 1 addition & 1 deletion src/partners/moonpay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const asMoonpayTx = asObject({
baseCurrency: asMoonpayCurrency,
baseCurrencyAmount: asNumber,
baseCurrencyId: asString,
cardType: asOptional(asValue('apple_pay', 'google_pay')),
cardType: asOptional(asValue('apple_pay', 'google_pay', 'card')),
country: asString,
createdAt: asDate,
cryptoTransactionId: asString,
Expand Down
11 changes: 7 additions & 4 deletions src/partners/paybis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const asUserCountry = asObject({
code: asString
})
const asUser = asObject({
id: asString,
email: asString,
// id: asString,
// email: asString,
country: asEither(asUserCountry, asNull)
})
// const asExchangeRate = asObject({
Expand Down Expand Up @@ -273,8 +273,7 @@ export function processPaybisTx(rawTx: unknown): StandardTx {
const payoutAmount = Number(receivedOriginal.amount)
const depositTxid = gateway === 'crypto_to_fiat' ? hash : undefined
const payoutTxid = gateway === 'fiat_to_crypto' ? hash : undefined

const direction = (gateway === 'fiat_to_crypto') == null ? 'buy' : 'sell'
const direction = gateway === 'fiat_to_crypto' ? 'buy' : 'sell'

const standardTx: StandardTx = {
status: statusMap[tx.status],
Expand Down Expand Up @@ -307,13 +306,17 @@ function getFiatPaymentType(
switch (name) {
case undefined:
return null
case 'Apple Pay':
return 'applepay'
case 'AstroPay':
return 'astropay'
case 'Credit/Debit Card':
return 'credit'
case 'FPX':
// Idk?
return 'fpx'
case 'Google Pay':
return 'googlepay'
case 'Giropay':
return 'giropay'
case 'Neteller':
Expand Down
3 changes: 2 additions & 1 deletion src/partners/safello.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { asArray, asNumber, asObject, asString, asUnknown } from 'cleaners'
import fetch from 'node-fetch'

import { PartnerPlugin, PluginParams, PluginResult, StandardTx } from '../types'
import { queryDummy } from './dummy'

const asSafelloTx = asObject({
completedDate: asString,
Expand Down Expand Up @@ -74,7 +75,7 @@ export async function querySafello(

export const safello: PartnerPlugin = {
// queryFunc will take PluginSettings as arg and return PluginResult
queryFunc: querySafello,
queryFunc: queryDummy,
// results in a PluginResult
pluginName: 'Safello',
pluginId: 'safello'
Expand Down
3 changes: 2 additions & 1 deletion src/partners/switchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import fetch from 'node-fetch'

import { PartnerPlugin, PluginParams, PluginResult, StandardTx } from '../types'
import { datelog, safeParseFloat } from '../util'
import { queryDummy } from './dummy'

const asSwitchainTx = asObject({
id: asString,
Expand Down Expand Up @@ -102,7 +103,7 @@ export async function querySwitchain(

export const switchain: PartnerPlugin = {
// queryFunc will take PluginSettings as arg and return PluginResult
queryFunc: querySwitchain,
queryFunc: queryDummy,
// results in a PluginResult
pluginName: 'Switchain',
pluginId: 'switchain'
Expand Down
2 changes: 1 addition & 1 deletion src/partners/thorchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export const thorchain = makeThorchainPlugin({
export const maya = makeThorchainPlugin({
pluginName: 'Maya',
pluginId: 'maya',
midgardUrl: 'midgard-maya.liquify.com'
midgardUrl: 'midgard.mayachain.info'
})

export function processThorchainTx(
Expand Down
3 changes: 2 additions & 1 deletion src/partners/totle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Web3 from 'web3'

import { PartnerPlugin, PluginParams, PluginResult, StandardTx } from '../types'
import { datelog, safeParseFloat } from '../util'
import { queryDummy } from './dummy'

const asCurrentBlockResult = asNumber

Expand Down Expand Up @@ -439,7 +440,7 @@ export async function queryTotle(

export const totle: PartnerPlugin = {
// queryFunc will take PluginSettings as arg and return PluginResult
queryFunc: queryTotle,
queryFunc: queryDummy,
// results in a PluginResult
pluginName: 'Totle',
pluginId: 'totle'
Expand Down