File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
crates/sdk/src/verification_layer Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -794,6 +794,31 @@ pub async fn lock_balance_in_aligned(
794794 }
795795}
796796
797+ pub async fn get_unlock_block_time (
798+ user : Address ,
799+ eth_rpc_url : & str ,
800+ network : Network ,
801+ ) -> Result < u64 , errors:: BalanceError > {
802+ let eth_rpc_provider = Provider :: < Http > :: try_from ( eth_rpc_url)
803+ . map_err ( |e| errors:: BalanceError :: EthereumProviderError ( e. to_string ( ) ) ) ?;
804+
805+ let payment_service_address = network. get_batcher_payment_service_address ( ) ;
806+
807+ match batcher_payment_service ( eth_rpc_provider, payment_service_address) . await {
808+ Ok ( batcher_payment_service) => {
809+ let call = batcher_payment_service. user_unlock_block ( user) ;
810+
811+ let result = call
812+ . call ( )
813+ . await
814+ . map_err ( |e| errors:: BalanceError :: EthereumCallError ( e. to_string ( ) ) ) ?;
815+
816+ Ok ( result. as_u64 ( ) )
817+ }
818+ Err ( e) => Err ( errors:: BalanceError :: EthereumCallError ( e. to_string ( ) ) ) ,
819+ }
820+ }
821+
797822pub async fn withdraw_balance_from_aligned (
798823 signer : & SignerMiddleware < Provider < Http > , LocalWallet > ,
799824 network : Network ,
You can’t perform that action at this time.
0 commit comments