diff --git a/src/api/subscriptions-common.ts b/src/api/subscriptions-common.ts new file mode 100644 index 0000000..d044cb5 --- /dev/null +++ b/src/api/subscriptions-common.ts @@ -0,0 +1,24 @@ +import { BACKEND_URL } from "@/constants" +import { http } from "./common" + +export interface SubscriptionOption { + type: string; + price: number | null; + payout_address: number | null; +} + +export async function getSubscriptionOptions( + authToken: string, +): Promise { + const url = `${BACKEND_URL}/api/v1/subscriptions/options` + const response = await http(url, { + method: "GET", + authToken, + }) + const data = await response.json() + if (response.status !== 200) { + throw new Error(data.message) + } else { + return data + } +} diff --git a/src/api/subscriptions.ts b/src/api/subscriptions-ethereum.ts similarity index 94% rename from src/api/subscriptions.ts rename to src/api/subscriptions-ethereum.ts index 9545255..7010af4 100644 --- a/src/api/subscriptions.ts +++ b/src/api/subscriptions-ethereum.ts @@ -71,28 +71,6 @@ export async function getSubscriptionAuthorization( } } -export interface SubscriptionOption { - type: string; - price: number | null; - payout_address: number | null; -} - -export async function getSubscriptionOptions( - authToken: string, -): Promise { - const url = `${BACKEND_URL}/api/v1/subscriptions/options` - const response = await http(url, { - method: "GET", - authToken, - }) - const data = await response.json() - if (response.status !== 200) { - throw new Error(data.message) - } else { - return data - } -} - export async function configureSubscriptions( contractAddress: string, signer: Signer, diff --git a/src/api/subscriptions-monero.ts b/src/api/subscriptions-monero.ts index a6d2737..09e9115 100644 --- a/src/api/subscriptions-monero.ts +++ b/src/api/subscriptions-monero.ts @@ -6,7 +6,7 @@ import { formatAmount, getPricePerMonth as _getPricePerMonth, getPricePerSec as _getPricePerSec, -} from "./subscriptions" +} from "./subscriptions-ethereum" import { Profile, User } from "./users" export function getPricePerSec(pricePerMonth: number): number { diff --git a/src/components/Subscription.vue b/src/components/SubscriptionEthereum.vue similarity index 99% rename from src/components/Subscription.vue rename to src/components/SubscriptionEthereum.vue index 92cf833..2018211 100644 --- a/src/components/Subscription.vue +++ b/src/components/SubscriptionEthereum.vue @@ -1,5 +1,4 @@