@@ -96,7 +96,6 @@ public static async Task SwitchNetwork(int chainId)
9696 taskMap [ taskId ] = task ;
9797 ThirdwebSwitchNetwork ( taskId , chainId , jsCallback ) ;
9898 await task . Task ;
99- return ;
10099 }
101100
102101 public static async Task < T > InvokeRoute < T > ( string route , string [ ] body )
@@ -116,6 +115,21 @@ public static async Task<T> InvokeRoute<T>(string route, string[] body)
116115 return JsonConvert . DeserializeObject < Result < T > > ( result ) . result ;
117116 }
118117
118+ public static async Task FundWallet ( FundWalletOptions payload )
119+ {
120+ if ( Application . isEditor )
121+ {
122+ Debug . LogWarning ( "Interacting with the thirdweb SDK is not supported in the editor. Please build and run the app instead." ) ;
123+ return ;
124+ }
125+ var msg = Utils . ToJson ( payload ) ;
126+ string taskId = Guid . NewGuid ( ) . ToString ( ) ;
127+ var task = new TaskCompletionSource < string > ( ) ;
128+ taskMap [ taskId ] = task ;
129+ ThirdwebFundWallet ( taskId , msg , jsCallback ) ;
130+ await task . Task ;
131+ }
132+
119133 [ DllImport ( "__Internal" ) ]
120134 private static extern string ThirdwebInvoke ( string taskId , string route , string payload , Action < string , string , string > cb ) ;
121135 [ DllImport ( "__Internal" ) ]
@@ -126,5 +140,7 @@ public static async Task<T> InvokeRoute<T>(string route, string[] body)
126140 private static extern string ThirdwebDisconnect ( string taskId , Action < string , string , string > cb ) ;
127141 [ DllImport ( "__Internal" ) ]
128142 private static extern string ThirdwebSwitchNetwork ( string taskId , int chainId , Action < string , string , string > cb ) ;
143+ [ DllImport ( "__Internal" ) ]
144+ private static extern string ThirdwebFundWallet ( string taskId , string payload , Action < string , string , string > cb ) ;
129145 }
130146}
0 commit comments