Closed regina-c closed 11 months ago
@regina-c thanks for opening this issue.
I noticed you do new ThirdwebSDK.fromPrivateKey(
in your code, but please note that fromPrivateKey
is a static method so no need to add new
in that call. Please, just do:
ThirdwebSDK.fromPrivateKey
or ThirdwebSDK.fromSigner
@regina-c thanks for opening this issue.
I noticed you do
new ThirdwebSDK.fromPrivateKey(
in your code, but please note thatfromPrivateKey
is a static method so no need to addnew
in that call. Please, just do:
ThirdwebSDK.fromPrivateKey
orThirdwebSDK.fromSigner
I had tried without new
in the call and it the same error still occurred.
@regina-c I just tried running:
const sdk = ThirdwebSDK.fromPrivateKey(
'my-private-key',
'ethereum',
);
const address = await sdk.wallet.getAddress();
console.log('address', address);
and it worked for me. Could you confirm the version of the sdk you're using?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I am getting a reference error when initialising the ThirdwebSDK - "Must call super constructor in derived class before accessing 'this' or returning from derived constructor". This only happen on my deployed site but it the same code I have using works fine on my localhost.
Not sure if anyone getting the same error and know how to troubleshoot this?
References: