Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix(llamapay): Fix llamapay early return when address has no balance (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wpoulin authored Nov 8, 2022
1 parent c9b92e2 commit 4a35810
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/apps/llamapay/common/llamapay.stream.api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export class LlamapayStreamApiClient {
variables: { id: address, network: _network },
});

if (!streamsResponse.user) return null;

return [...streamsResponse.user.streams];
}
}
2 changes: 1 addition & 1 deletion src/apps/llamapay/ethereum/llamapay.balance-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class EthereumLlamapayBalanceFetcher implements BalanceFetcher {
async getBalances(address: string) {
const multicall = this.appToolkit.getMulticall(network);
const streams = await this.apiClient.getStreams(address, network);
if (streams.length === 0) return presentBalanceFetcherResponse([{ label: 'Streams', assets: [] }]);
if (streams === null) return presentBalanceFetcherResponse([{ label: 'Streams', assets: [] }]);

const tokenLoader = this.appToolkit.getTokenDependencySelector({
tags: { network, context: LLAMAPAY_DEFINITION.id },
Expand Down
9 changes: 7 additions & 2 deletions src/apps/llamapay/llamapay.definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { Network } from '~types/network.interface';
export const LLAMAPAY_DEFINITION = appDefinition({
id: 'llamapay',
name: 'Llamapay',
description: 'LlamaPay is a multi-chain protocol that allows you to automate transactions and stream them by the second.',
description:
'LlamaPay is a multi-chain protocol that allows you to automate transactions and stream them by the second.',
url: 'https://llamapay.io/',

groups: {
Expand All @@ -19,7 +20,11 @@ export const LLAMAPAY_DEFINITION = appDefinition({

tags: [AppTag.PAYMENTS],
keywords: [],
links: {},
links: {
discord: 'https://discord.com/invite/buPFYXzDDd',
github: 'https://github.com/LlamaPay',
twitter: 'https://twitter.com/llamapay_io/',
},

supportedNetworks: {
[Network.ETHEREUM_MAINNET]: [AppAction.VIEW],
Expand Down

0 comments on commit 4a35810

Please sign in to comment.