From c9ecf76e8b21667d367d11c55f6e3fae93fc9452 Mon Sep 17 00:00:00 2001 From: ZeroWave022 <36341766+ZeroWave022@users.noreply.github.com> Date: Sun, 30 Apr 2023 13:00:22 +0200 Subject: [PATCH 1/4] fix: Routes for transactions --- rest/v0/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest/v0/index.ts b/rest/v0/index.ts index 666c568..0e1f3a5 100644 --- a/rest/v0/index.ts +++ b/rest/v0/index.ts @@ -68,14 +68,14 @@ export const Routes = { * - GET `/account/wallets/transactions` - List of user's tips, deposits and withdrawals */ accountWalletTransactions() { - return '/account/wallets/transactions' as const; + return '/account/transactions' as const; }, /** * Route for: * - GET `/account/wallets/transactions/{id}` - Get a single tip, deposit or withdrawal by ID */ accountWalletTransaction(id: string) { - return `/account/wallets/transactions/${id}` as const; + return `/account/transactions/${id}` as const; }, /** * Route for: From a7ed6ecf858c5f3a31ef6e634ec87c4907049377 Mon Sep 17 00:00:00 2001 From: ZeroWave022 <36341766+ZeroWave022@users.noreply.github.com> Date: Sun, 30 Apr 2023 13:02:50 +0200 Subject: [PATCH 2/4] fix: Set some properties as possibly null --- payloads/v0/account.ts | 6 +++--- payloads/v0/currencies.ts | 2 +- rest/v0/account.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/payloads/v0/account.ts b/payloads/v0/account.ts index ce64799..c904cab 100644 --- a/payloads/v0/account.ts +++ b/payloads/v0/account.ts @@ -40,8 +40,8 @@ export enum APIService { export interface APIConnection { identifier: string; - username?: string; - avatar_url?: string; + username: string | null; + avatar_url: string | null; service: APIService; } @@ -52,7 +52,7 @@ export interface APIWallet { usd_value: APIMonetary; } -export interface APIWithdrawl { +export interface APIWithdrawal { id: string; txid: string; amount: APIMonetary; diff --git a/payloads/v0/currencies.ts b/payloads/v0/currencies.ts index b3921bb..0dc27e6 100644 --- a/payloads/v0/currencies.ts +++ b/payloads/v0/currencies.ts @@ -15,7 +15,7 @@ export interface APICoin { export interface APIExchangeRate { code: string; name: string; - usd_value?: APIMonetary; + usd_value: APIMonetary | null; } export interface APICryptoCurrencyUnit { diff --git a/rest/v0/account.ts b/rest/v0/account.ts index 0781bd4..e396d8f 100644 --- a/rest/v0/account.ts +++ b/rest/v0/account.ts @@ -3,7 +3,7 @@ import type { APITip, APITransaction, APIWallet, - APIWithdrawl, + APIWithdrawal, } from '../../payloads/v0/account'; import type { APICoin, @@ -106,7 +106,7 @@ export interface RESTPostAPIAccountWalletWithdrawalPath { */ export interface RESTPutAPIAccountWalletWithdrawalResult { id: string; - withdrawal: APIWithdrawl; + withdrawal: APIWithdrawal; balance: APIMonetary; } From 99c39170efef7d30b347b8745f3a353ebf671aa9 Mon Sep 17 00:00:00 2001 From: ZeroWave022 <36341766+ZeroWave022@users.noreply.github.com> Date: Sun, 30 Apr 2023 13:08:28 +0200 Subject: [PATCH 3/4] fix: Change jsdocs --- rest/v0/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest/v0/index.ts b/rest/v0/index.ts index 0e1f3a5..f979491 100644 --- a/rest/v0/index.ts +++ b/rest/v0/index.ts @@ -65,14 +65,14 @@ export const Routes = { }, /** * Route for: - * - GET `/account/wallets/transactions` - List of user's tips, deposits and withdrawals + * - GET `/account/transactions` - List of user's tips, deposits and withdrawals */ accountWalletTransactions() { return '/account/transactions' as const; }, /** * Route for: - * - GET `/account/wallets/transactions/{id}` - Get a single tip, deposit or withdrawal by ID + * - GET `/account/transactions/{id}` - Get a single tip, deposit or withdrawal by ID */ accountWalletTransaction(id: string) { return `/account/transactions/${id}` as const; From 07e9a43527dd5816a8c038df0dd14a818eed67a4 Mon Sep 17 00:00:00 2001 From: ZeroWave022 <36341766+ZeroWave022@users.noreply.github.com> Date: Sun, 30 Apr 2023 13:09:56 +0200 Subject: [PATCH 4/4] refactor: Rename functions --- rest/v0/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest/v0/index.ts b/rest/v0/index.ts index f979491..36189e6 100644 --- a/rest/v0/index.ts +++ b/rest/v0/index.ts @@ -67,14 +67,14 @@ export const Routes = { * Route for: * - GET `/account/transactions` - List of user's tips, deposits and withdrawals */ - accountWalletTransactions() { + accountTransactions() { return '/account/transactions' as const; }, /** * Route for: * - GET `/account/transactions/{id}` - Get a single tip, deposit or withdrawal by ID */ - accountWalletTransaction(id: string) { + accountTransaction(id: string) { return `/account/transactions/${id}` as const; }, /**