@@ -133,7 +133,7 @@ public static async Task<SmartWallet> Create(
133
133
ThirdwebContract factoryContract = null ;
134
134
ThirdwebContract accountContract = null ;
135
135
136
- if ( ! Utils . IsZkSync ( chainId ) )
136
+ if ( ! await Utils . IsZkSync ( personalWallet . Client , chainId ) . ConfigureAwait ( false ) )
137
137
{
138
138
var entryPointAbi = entryPointVersion == 6 ? Constants . ENTRYPOINT_V06_ABI : Constants . ENTRYPOINT_V07_ABI ;
139
139
var factoryAbi = entryPointVersion == 6 ? Constants . FACTORY_V06_ABI : Constants . FACTORY_V07_ABI ;
@@ -195,10 +195,10 @@ public async Task SwitchNetwork(BigInteger chainId)
195
195
}
196
196
197
197
this . _chainId = chainId ;
198
-
199
198
this . _bundlerUrl = this . _bundlerUrl . Contains ( ".thirdweb.com" ) ? $ "https://{ chainId } .bundler.thirdweb.com/v2" : this . _bundlerUrl ;
200
199
this . _paymasterUrl = this . _paymasterUrl . Contains ( ".thirdweb.com" ) ? $ "https://{ chainId } .bundler.thirdweb.com/v2" : this . _paymasterUrl ;
201
- if ( ! Utils . IsZkSync ( chainId ) )
200
+
201
+ if ( ! await Utils . IsZkSync ( this . Client , chainId ) . ConfigureAwait ( false ) )
202
202
{
203
203
this . _entryPointContract = await ThirdwebContract . Create ( this . Client , this . _entryPointContract . Address , chainId , this . _entryPointContract . Abi ) . ConfigureAwait ( false ) ;
204
204
this . _factoryContract = await ThirdwebContract . Create ( this . Client , this . _factoryContract . Address , chainId , this . _factoryContract . Abi ) . ConfigureAwait ( false ) ;
@@ -208,7 +208,7 @@ public async Task SwitchNetwork(BigInteger chainId)
208
208
209
209
public async Task < bool > IsDeployed ( )
210
210
{
211
- if ( Utils . IsZkSync ( this . _chainId ) )
211
+ if ( await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) )
212
212
{
213
213
return true ;
214
214
}
@@ -226,11 +226,13 @@ public async Task<string> SendTransaction(ThirdwebTransactionInput transactionIn
226
226
227
227
await this . SwitchNetwork ( transactionInput . ChainId . Value ) . ConfigureAwait ( false ) ;
228
228
229
- var transaction = await ThirdwebTransaction . Create ( Utils . IsZkSync ( this . _chainId ) ? this . _personalAccount : this , transactionInput ) . ConfigureAwait ( false ) ;
229
+ var transaction = await ThirdwebTransaction
230
+ . Create ( await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) ? this . _personalAccount : this , transactionInput )
231
+ . ConfigureAwait ( false ) ;
230
232
transaction = await ThirdwebTransaction . Prepare ( transaction ) . ConfigureAwait ( false ) ;
231
233
transactionInput = transaction . Input ;
232
234
233
- if ( Utils . IsZkSync ( this . _chainId ) )
235
+ if ( await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) )
234
236
{
235
237
if ( this . _gasless )
236
238
{
@@ -668,7 +670,7 @@ private static UserOperationHexifiedV7 EncodeUserOperation(UserOperationV7 userO
668
670
669
671
public async Task ForceDeploy ( )
670
672
{
671
- if ( Utils . IsZkSync ( this . _chainId ) )
673
+ if ( await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) )
672
674
{
673
675
return ;
674
676
}
@@ -700,7 +702,9 @@ public Task<IThirdwebWallet> GetPersonalWallet()
700
702
701
703
public async Task < string > GetAddress ( )
702
704
{
703
- return Utils . IsZkSync ( this . _chainId ) ? await this . _personalAccount . GetAddress ( ) . ConfigureAwait ( false ) : this . _accountContract . Address . ToChecksumAddress ( ) ;
705
+ return await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false )
706
+ ? await this . _personalAccount . GetAddress ( ) . ConfigureAwait ( false )
707
+ : this . _accountContract . Address . ToChecksumAddress ( ) ;
704
708
}
705
709
706
710
public Task < string > EthSign ( byte [ ] rawMessage )
@@ -725,7 +729,7 @@ public Task<string> PersonalSign(byte[] rawMessage)
725
729
726
730
public async Task < string > PersonalSign ( string message )
727
731
{
728
- if ( Utils . IsZkSync ( this . _chainId ) )
732
+ if ( await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) )
729
733
{
730
734
return await this . _personalAccount . PersonalSign ( message ) . ConfigureAwait ( false ) ;
731
735
}
@@ -800,7 +804,7 @@ public async Task<bool> IsValidSignature(string message, string signature)
800
804
801
805
public async Task < List < string > > GetAllAdmins ( )
802
806
{
803
- if ( Utils . IsZkSync ( this . _chainId ) )
807
+ if ( await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) )
804
808
{
805
809
throw new InvalidOperationException ( "Account Permissions are not supported in ZkSync" ) ;
806
810
}
@@ -811,7 +815,7 @@ public async Task<List<string>> GetAllAdmins()
811
815
812
816
public async Task < List < SignerPermissions > > GetAllActiveSigners ( )
813
817
{
814
- if ( Utils . IsZkSync ( this . _chainId ) )
818
+ if ( await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) )
815
819
{
816
820
throw new InvalidOperationException ( "Account Permissions are not supported in ZkSync" ) ;
817
821
}
@@ -830,7 +834,7 @@ public async Task<ThirdwebTransactionReceipt> CreateSessionKey(
830
834
string reqValidityEndTimestamp
831
835
)
832
836
{
833
- if ( Utils . IsZkSync ( this . _chainId ) )
837
+ if ( await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) )
834
838
{
835
839
throw new InvalidOperationException ( "Account Permissions are not supported in ZkSync" ) ;
836
840
}
@@ -863,14 +867,14 @@ string reqValidityEndTimestamp
863
867
864
868
public async Task < ThirdwebTransactionReceipt > RevokeSessionKey ( string signerAddress )
865
869
{
866
- return Utils . IsZkSync ( this . _chainId )
870
+ return await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false )
867
871
? throw new InvalidOperationException ( "Account Permissions are not supported in ZkSync" )
868
872
: await this . CreateSessionKey ( signerAddress , new List < string > ( ) , "0" , "0" , "0" , "0" , Utils . GetUnixTimeStampIn10Years ( ) . ToString ( ) ) . ConfigureAwait ( false ) ;
869
873
}
870
874
871
875
public async Task < ThirdwebTransactionReceipt > AddAdmin ( string admin )
872
876
{
873
- if ( Utils . IsZkSync ( this . _chainId ) )
877
+ if ( await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) )
874
878
{
875
879
throw new InvalidOperationException ( "Account Permissions are not supported in ZkSync" ) ;
876
880
}
@@ -902,7 +906,7 @@ public async Task<ThirdwebTransactionReceipt> AddAdmin(string admin)
902
906
903
907
public async Task < ThirdwebTransactionReceipt > RemoveAdmin ( string admin )
904
908
{
905
- if ( Utils . IsZkSync ( this . _chainId ) )
909
+ if ( await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) )
906
910
{
907
911
throw new InvalidOperationException ( "Account Permissions are not supported in ZkSync" ) ;
908
912
}
@@ -953,7 +957,7 @@ public async Task<BigInteger> EstimateUserOperationGas(ThirdwebTransactionInput
953
957
{
954
958
await this . SwitchNetwork ( transaction . ChainId . Value ) . ConfigureAwait ( false ) ;
955
959
956
- if ( Utils . IsZkSync ( this . _chainId ) )
960
+ if ( await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) )
957
961
{
958
962
throw new Exception ( "User Operations are not supported in ZkSync" ) ;
959
963
}
@@ -982,7 +986,7 @@ public async Task<string> SignTransaction(ThirdwebTransactionInput transaction)
982
986
{
983
987
await this . SwitchNetwork ( transaction . ChainId . Value ) . ConfigureAwait ( false ) ;
984
988
985
- if ( Utils . IsZkSync ( this . _chainId ) )
989
+ if ( await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) )
986
990
{
987
991
throw new Exception ( "Offline Signing is not supported in ZkSync" ) ;
988
992
}
@@ -1006,7 +1010,7 @@ public async Task<string> SignTransaction(ThirdwebTransactionInput transaction)
1006
1010
1007
1011
public async Task < bool > IsConnected ( )
1008
1012
{
1009
- return Utils . IsZkSync ( this . _chainId ) ? await this . _personalAccount . IsConnected ( ) . ConfigureAwait ( false ) : this . _accountContract != null ;
1013
+ return await Utils . IsZkSync ( this . Client , this . _chainId ) . ConfigureAwait ( false ) ? await this . _personalAccount . IsConnected ( ) . ConfigureAwait ( false ) : this . _accountContract != null ;
1010
1014
}
1011
1015
1012
1016
public Task Disconnect ( )
0 commit comments