@reservoir0x/relay-sdk
Version:
Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.
25 lines • 864 B
JavaScript
import {} from 'axios';
import { axios } from '../utils/axios.js';
import { getClient } from '../client.js';
import { APIError } from '../utils/index.js';
/**
* Method to get app fee balances for a wallet
* @param parameters - {@link GetAppFeesParameters}
*/
export async function getAppFees(parameters) {
const { wallet } = parameters;
const client = getClient();
if (!client.baseApiUrl || !client.baseApiUrl.length) {
throw new ReferenceError('RelayClient missing api url configuration');
}
const request = {
url: `${client.baseApiUrl}/app-fees/${wallet}/balances`,
method: 'get'
};
const res = await axios.request(request);
if (res.status !== 200) {
throw new APIError(res?.data?.message, res.status, res.data);
}
return res.data.balances || [];
}
//# sourceMappingURL=getAppFees.js.map