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

fix(llamapay): Fix llamapay early return when address has no balance #1669

Merged
merged 2 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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