Skip to content

Commit

Permalink
Merge pull request #162 from thepower/fix/fixed_providers_list
Browse files Browse the repository at this point in the history
fix(container/upload): fixed providers list
  • Loading branch information
jackkru69 authored Sep 24, 2024
2 parents a649302 + b4b60b5 commit b897413
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/cli/src/commands/container/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,15 @@ export default class ContainerUpload extends BaseCommand {
const providersCount = await providerContract.scGet({ abi: abis.provider, functionName: 'totalSupply', args: [] });

const providers = await Promise.all(
[...Array(providersCount)].map(async (_, index) => {
Array.from({ length: Number(providersCount) }, (async (_, index) => {
const tokenIdBigint = await providerContract.scGet({ abi: abis.provider, functionName: 'tokenByIndex', args: [BigInt(index)] });

const tokenId = String(tokenIdBigint);

const name = await providerContract.scGet({ abi: abis.provider, functionName: 'name', args: [tokenIdBigint] });

return { name, tokenId };
}),
})),
);

const { providerId }: { providerId: number } = await prompt({
Expand Down

0 comments on commit b897413

Please sign in to comment.