Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zksend] list created links after regenerate transaction #20469

Open
fl0ydj opened this issue Nov 28, 2024 · 2 comments
Open

[zksend] list created links after regenerate transaction #20469

fl0ydj opened this issue Nov 28, 2024 · 2 comments
Assignees
Labels

Comments

@fl0ydj
Copy link

fl0ydj commented Nov 28, 2024

Steps to Reproduce Issue

  1. Create link
  2. Regenerate it:
const { url, transaction } = await args.link.createRegenerateTransaction(currentAccount.address, {
        network: env.get(EnvVar.SUI_NETWORK_TYPE) as "mainnet" | "testnet",
        client,
      });
  1. List created links:
 const res = await listCreatedLinks({
          address: currentAccount?.address ?? "",
          network: env.get(EnvVar.SUI_NETWORK_TYPE) as "mainnet" | "testnet",
          cursor: cursor ?? undefined,
          client: suiClient,
        });

Expected Result

The regenerated link should be part of the returned results or at least a reference to it.

Actual Result

Only the old link is returned.

@fl0ydj
Copy link
Author

fl0ydj commented Dec 29, 2024

Feedback on this? :) Still happening afaik

@hayes-mysten
Copy link
Contributor

You can use getSentTransactionsWithLinks if you want to see both. Unfortunately there isn't currently a good way to create a combined list that can be paginated that contains both newly created links and regenerated links.

This method currently works by querying for transactions that use the new method in the zk_bag contract. RPCs don't currently support a way to filter by multiple move calls. If the flows for creating links and regenerating links used the same move call, we could query for that, but it would require changing the sdk and the contract to accommodate that.

getSentTransactionsWithLinks just returns all transactions from an addresses, and then finds the links created/regenerated in those transactions, but doesn't filter out transactions that don't interact with links at all.

Another option (which doesn't exist in the sdk today) would be to add another method that returns only the regenerated links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants