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

Allow optional Polygon private key for read-only operations #404

Open
aurelticot opened this issue Mar 1, 2024 · 0 comments
Open

Allow optional Polygon private key for read-only operations #404

aurelticot opened this issue Mar 1, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@aurelticot
Copy link
Member

Instantiating an account in "web3" mode requires a Polygon private key.

When we don't want to create or revoke DIDs and we are sure the account exists, we want to be able to use it for all operations not requiring writing on the blockchain, without passing the private key.

if (callType == 'web3' && !web3Config.privateKey) {
throw new Error('Web3 transactions must specify `web3config.privateKey`')
}

Should also check here:

if (this.signer === undefined) {
if ( web3Config.privateKey )
this.signer = new Wallet(web3Config.privateKey, this.contract.provider)
else
throw new Error('either Signer or privateKey is required to initialize')
}

@aurelticot aurelticot added the enhancement New feature or request label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant