@@ -17,7 +17,6 @@ use crate::entity_id::{
1717} ;
1818use crate :: ledger_id:: RefLedgerId ;
1919use crate :: {
20- Client ,
2120 EntityId ,
2221 Error ,
2322 EvmAddress ,
@@ -26,6 +25,9 @@ use crate::{
2625 ToProtobuf ,
2726} ;
2827
28+ #[ cfg( not( target_arch = "wasm32" ) ) ]
29+ use crate :: Client ;
30+
2931/// A unique identifier for a cryptocurrency account on Hiero.
3032#[ derive( Copy , Hash , PartialEq , Eq , Clone ) ]
3133pub struct AccountId {
@@ -100,6 +102,7 @@ impl AccountId {
100102 ///
101103 /// # Errors
102104 /// - [`Error::CannotCreateChecksum`] if self has an `alias` or `evm_address`.
105+ #[ cfg( not( target_arch = "wasm32" ) ) ]
103106 pub fn to_string_with_checksum ( & self , client : & Client ) -> Result < String , Error > {
104107 if self . alias . is_some ( ) || self . evm_address . is_some ( ) {
105108 Err ( Error :: CannotCreateChecksum )
@@ -112,6 +115,7 @@ impl AccountId {
112115 ///
113116 /// # Errors
114117 /// - [`Error::BadEntityId`] if there is a checksum, and the checksum is not valid for the client's `ledger_id`.
118+ #[ cfg( not( target_arch = "wasm32" ) ) ]
115119 pub fn validate_checksum ( & self , client : & Client ) -> crate :: Result < ( ) > {
116120 if self . alias . is_some ( ) || self . evm_address . is_some ( ) {
117121 Ok ( ( ) )
@@ -122,6 +126,7 @@ impl AccountId {
122126}
123127
124128impl ValidateChecksums for AccountId {
129+ #[ cfg( not( target_arch = "wasm32" ) ) ]
125130 fn validate_checksums ( & self , ledger_id : & RefLedgerId ) -> Result < ( ) , Error > {
126131 if self . alias . is_some ( ) || self . evm_address . is_some ( ) {
127132 Ok ( ( ) )
@@ -135,6 +140,12 @@ impl ValidateChecksums for AccountId {
135140 )
136141 }
137142 }
143+
144+ #[ cfg( target_arch = "wasm32" ) ]
145+ fn validate_checksums ( & self , _ledger_id : & RefLedgerId ) -> Result < ( ) , Error > {
146+ // Checksum validation requires networking context, not available in WASM
147+ Ok ( ( ) )
148+ }
138149}
139150
140151impl Debug for AccountId {
0 commit comments