@@ -160,26 +160,34 @@ public async Task<string> SendTransaction(ThirdwebTransactionInput transaction)
160160 signature : signature ,
161161 authorization : this . Authorization != null && ! await Utils . IsDelegatedAccount ( this . Client , this . ChainId , userWalletAddress ) ? this . Authorization : null
162162 ) ;
163- throw new NotImplementedException ( $ "EIP-7702 transaction execution is not done, here's the queue id: { response . QueueId } ") ;
164- // string txHash = null;
165- // var ct = new CancellationTokenSource(this.Client.FetchTimeoutOptions.GetTimeout(TimeoutType.Other));
166- // try
167- // {
168- // while (txHash == null)
169- // {
170- // ct.Token.ThrowIfCancellationRequested();
171-
172- // var txReceipt = await BundlerClient.TwGetTransactionReceipt(client: this.Client, url: $"{this.ChainId}.bundler.thirdweb.com", requestId: 7702, queueId).ConfigureAwait(false);
173-
174- // txHash = txReceipt?.Receipt?.TransactionHash;
175- // await ThirdwebTask.Delay(100, ct.Token).ConfigureAwait(false);
176- // }
177- // }
178- // catch (OperationCanceledException)
179- // {
180- // throw new Exception($"EIP-7702 sponsored transaction timed out with queue id: {queueId}");
181- // }
182- // break;
163+ var queueId = response ? . QueueId ;
164+ string txHash = null ;
165+ var ct = new CancellationTokenSource ( this . Client . FetchTimeoutOptions . GetTimeout ( TimeoutType . Other ) ) ;
166+ try
167+ {
168+ while ( txHash == null )
169+ {
170+ ct . Token . ThrowIfCancellationRequested ( ) ;
171+
172+ var hashResponse = await BundlerClient
173+ . TwGetTransactionHash (
174+ client : this . Client ,
175+ // url: $"{this.ChainId}.bundler.thirdweb.com",
176+ url : "http://localhost:8787?chain=11155111" ,
177+ requestId : 7702 ,
178+ queueId
179+ )
180+ . ConfigureAwait ( false ) ;
181+
182+ txHash = hashResponse ? . TransactionHash ;
183+ await ThirdwebTask . Delay ( 100 , ct . Token ) . ConfigureAwait ( false ) ;
184+ }
185+ return txHash ;
186+ }
187+ catch ( OperationCanceledException )
188+ {
189+ throw new Exception ( $ "EIP-7702 sponsored transaction timed out with queue id: { queueId } ") ;
190+ }
183191 case ExecutionMode . EOA :
184192 // Add up values of all calls
185193 BigInteger totalValue = 0 ;
0 commit comments