UNPKG

@renegade-fi/core

Version:
22 lines 935 B
import { BACK_OF_QUEUE_WALLET_ROUTE } from "../constants.js"; import { BaseError } from "../errors/base.js"; import { getRelayerWithAuth } from "../utils/http.js"; import { getWalletId } from "./getWalletId.js"; export async function getBackOfQueueWallet(config, parameters = {}) { const { filterDefaults } = parameters; const { getBaseUrl } = config; const walletId = getWalletId(config); const res = await getRelayerWithAuth(config, getBaseUrl(BACK_OF_QUEUE_WALLET_ROUTE(walletId))); if (!res.wallet) { throw new BaseError("Back of queue wallet not found"); } if (filterDefaults) { return { ...res.wallet, balances: res.wallet.balances.filter((b) => b.amount || b.protocol_fee_balance || b.relayer_fee_balance), orders: res.wallet.orders.filter((o) => o.amount), }; } return res.wallet; } //# sourceMappingURL=getBackOfQueueWallet.js.map