Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Jul 24, 2024
1 parent 3755ff4 commit df4de10
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions helpers/servicePipes.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const getServicePipes = ({
// TODO: Make sure that extensions use the provider
{
supportedVersion: '0.0.0',
pipe:
makePipe:
({ wallets }) =>
services =>
pipe(
Expand Down Expand Up @@ -90,9 +90,9 @@ export const getServicePipes = ({
},
{
supportedVersion: '1.3.0-alpha.3',
pipe:
makePipe:
({ wallets }) =>
({ services }) =>
services =>
pipe(
filterSupportedStrategies(supportedStrategies),
// Remove opt in services unless marked as include, if supported
Expand Down
4 changes: 2 additions & 2 deletions helpers/walletPipes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export const getWalletPipe = ({
)

export const transformWalletServices =
(factory: ServicesPipeFactory) => (wallets: Wallet[]) =>
(servicePipeFactory: ServicesPipeFactory) => (wallets: Wallet[]) =>
pipe(
extractWalletServices(true),
(services: ServiceWithWallet[]) => factory({ wallets })(services),
servicePipeFactory({ wallets }),
collectWalletsFromServices(wallets)
)(wallets)

Expand Down
2 changes: 2 additions & 0 deletions pages/api/[network]/_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export async function getWalletsFromRequest(req: NextApiRequest) {
// Support emulator and use local service configuration
const netConfig = network === NETWORKS.EMULATOR ? NETWORKS.LOCAL : network

console.log(versionPipeFactory)

// Get the pipe for processing wallets
const walletPipe = getWalletPipe({
network: netConfig,
Expand Down
2 changes: 1 addition & 1 deletion pages/api/[network]/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { cors, getWalletsFromRequest, runMiddleware } from './_common'
async function handler(req, res) {
await runMiddleware(req, res, cors)

const discoveryWallets = getWalletsFromRequest(req)
const discoveryWallets = await getWalletsFromRequest(req)
return res.status(200).json(discoveryWallets)
}

Expand Down

0 comments on commit df4de10

Please sign in to comment.