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

Can't execute paid queries with the HashConnect Provider - No client operator is specified #111

Closed
ed-marquez opened this issue May 23, 2022 · 1 comment

Comments

@ed-marquez
Copy link

When trying either of the following paid queries with the HashPack provider or signer,

const aInfo = await signer.getAccountInfo();
const bInfo = await provider.getAccountInfo(accountId);

The result is as follows:

Error: `client` must have an `operator` or an explicit payment transaction must be provided
    at AccountInfoQuery._beforeExecute (Query.js:228:1)
    at AccountInfoQuery.execute (Executable.js:375:1)
    at HashConnectSigner.getAccountInfo (signer.ts:54:1)

My understanding is that free queries can be executed by the provider's client directly without sending them to the wallet. However, for paid queries that's not the case. Paid queries (and txns) should be sent to the wallet.
This is likely fixed by constructing the request using the account ID in the signer and passing that to the call method.

===============

For now, a workaround (not ideal) is passing the account ID and private key to the client operator in the provider. This requires hardcoding my private key in the application, which kinda defeats the purpose of the signer/provider architecture.

@teacoat
Copy link
Contributor

teacoat commented Sep 13, 2022

We reccomend using mirror nodes for queries - we have no plans of allowing these paid queries through hashconnect

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

No branches or pull requests

2 participants