mirror of
https://github.com/modrinth/code.git
synced 2026-08-27 10:04:52 +00:00
refactor: remove useBaseFetch for @modrinth/api-client (#5596)
* Reapply "fix: start swapping useBaseFetch usages to api-client"
This reverts commit f4f33db701.
* fix: bugs
* fix: analytics
* fix: lint
This commit is contained in:
@@ -18,4 +18,45 @@ export class LabrinthPayoutV3Module extends AbstractModule {
|
||||
method: 'GET',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the authenticated user's transaction history (withdrawals and payouts)
|
||||
*
|
||||
* @returns Promise resolving to an array of transaction items
|
||||
*/
|
||||
public async getHistory(): Promise<Labrinth.Payout.v3.TransactionItem[]> {
|
||||
return this.client.request<Labrinth.Payout.v3.TransactionItem[]>('/payout/history', {
|
||||
api: 'labrinth',
|
||||
version: 3,
|
||||
method: 'GET',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available payout methods, optionally filtered by country
|
||||
*
|
||||
* @param country - Optional ISO country code to filter methods by supported countries
|
||||
* @returns Promise resolving to an array of payout methods
|
||||
*/
|
||||
public async getMethods(country?: string): Promise<Labrinth.Payout.v3.PayoutMethod[]> {
|
||||
return this.client.request<Labrinth.Payout.v3.PayoutMethod[]>('/payout/methods', {
|
||||
api: 'labrinth',
|
||||
version: 3,
|
||||
method: 'GET',
|
||||
params: country ? { country } : undefined,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel a pending payout
|
||||
*
|
||||
* @param id - The payout ID to cancel
|
||||
*/
|
||||
public async cancel(id: string): Promise<void> {
|
||||
return this.client.request<void>(`/payout/${id}`, {
|
||||
api: 'labrinth',
|
||||
version: 3,
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user