11// Copyright 2025 IOTA Stiftung
22// SPDX-License-Identifier: Apache-2.0
33
4- use js_sys:: Uint8Array ;
5- use wasm_bindgen:: prelude:: * ;
6-
74use iota_interaction_ts:: wasm_error:: Result ;
5+ use js_sys:: Uint8Array ;
6+ use notarization:: core:: builder:: { Dynamic , Locked , NotarizationBuilder } ;
87use product_common:: bindings:: transaction:: WasmTransactionBuilder ;
8+ use wasm_bindgen:: prelude:: * ;
99
10- use notarization:: core:: builder:: { Locked , Dynamic , NotarizationBuilder } ;
11-
10+ use crate :: wasm_notarization:: { WasmCreateNotarizationDynamic , WasmCreateNotarizationLocked } ;
1211use crate :: wasm_time_lock:: WasmTimeLock ;
13- use crate :: wasm_notarization:: WasmCreateNotarizationLocked ;
14- use crate :: wasm_notarization:: WasmCreateNotarizationDynamic ;
1512
1613#[ wasm_bindgen( js_name = NotarizationBuilderLocked , inspectable) ]
1714pub struct WasmNotarizationBuilderLocked ( pub ( crate ) NotarizationBuilder < Locked > ) ;
@@ -24,24 +21,35 @@ impl Into<WasmNotarizationBuilderLocked> for NotarizationBuilder<Locked> {
2421
2522#[ wasm_bindgen( js_class = NotarizationBuilderLocked ) ]
2623impl WasmNotarizationBuilderLocked {
27-
2824 #[ wasm_bindgen( js_name = withBytesState) ]
29- pub fn with_bytes_state ( self , data : Uint8Array , metadata : Option < String > ) -> Self { self . 0 . with_bytes_state ( data. to_vec ( ) , metadata) . into ( ) }
25+ pub fn with_bytes_state ( self , data : Uint8Array , metadata : Option < String > ) -> Self {
26+ self . 0 . with_bytes_state ( data. to_vec ( ) , metadata) . into ( )
27+ }
3028
3129 #[ wasm_bindgen( js_name = withStringState) ]
32- pub fn with_string_state ( self , data : String , metadata : Option < String > ) -> Self { self . 0 . with_string_state ( data, metadata) . into ( ) }
30+ pub fn with_string_state ( self , data : String , metadata : Option < String > ) -> Self {
31+ self . 0 . with_string_state ( data, metadata) . into ( )
32+ }
3333
3434 #[ wasm_bindgen( js_name = withImmutableDescription) ]
35- pub fn with_immutable_description ( self , description : String ) -> Self { self . 0 . with_immutable_description ( description) . into ( ) }
35+ pub fn with_immutable_description ( self , description : String ) -> Self {
36+ self . 0 . with_immutable_description ( description) . into ( )
37+ }
3638
3739 #[ wasm_bindgen( js_name = withUpdatableMetadata) ]
38- pub fn with_updatable_metadata ( self , metadata : String ) -> Self { self . 0 . with_updatable_metadata ( metadata) . into ( ) }
40+ pub fn with_updatable_metadata ( self , metadata : String ) -> Self {
41+ self . 0 . with_updatable_metadata ( metadata) . into ( )
42+ }
3943
4044 #[ wasm_bindgen( ) ]
41- pub fn locked ( ) -> Self { NotarizationBuilder :: < Locked > :: locked ( ) . into ( ) }
45+ pub fn locked ( ) -> Self {
46+ NotarizationBuilder :: < Locked > :: locked ( ) . into ( )
47+ }
4248
4349 #[ wasm_bindgen( js_name = withDeleteLock) ]
44- pub fn with_delete_lock ( self , lock : WasmTimeLock ) -> Self { self . 0 . with_delete_lock ( lock. 0 ) . into ( ) }
50+ pub fn with_delete_lock ( self , lock : WasmTimeLock ) -> Self {
51+ self . 0 . with_delete_lock ( lock. 0 ) . into ( )
52+ }
4553
4654 #[ wasm_bindgen( ) ]
4755 pub fn finish ( self ) -> Result < WasmTransactionBuilder > {
@@ -62,22 +70,34 @@ impl Into<WasmNotarizationBuilderDynamic> for NotarizationBuilder<Dynamic> {
6270#[ wasm_bindgen( js_class = NotarizationBuilderDynamic ) ]
6371impl WasmNotarizationBuilderDynamic {
6472 #[ wasm_bindgen( js_name = withBytesState) ]
65- pub fn with_bytes_state ( self , data : Uint8Array , metadata : Option < String > ) -> Self { self . 0 . with_bytes_state ( data. to_vec ( ) , metadata) . into ( ) }
73+ pub fn with_bytes_state ( self , data : Uint8Array , metadata : Option < String > ) -> Self {
74+ self . 0 . with_bytes_state ( data. to_vec ( ) , metadata) . into ( )
75+ }
6676
6777 #[ wasm_bindgen( js_name = withStringState) ]
68- pub fn with_string_state ( self , data : String , metadata : Option < String > ) -> Self { self . 0 . with_string_state ( data, metadata) . into ( ) }
78+ pub fn with_string_state ( self , data : String , metadata : Option < String > ) -> Self {
79+ self . 0 . with_string_state ( data, metadata) . into ( )
80+ }
6981
7082 #[ wasm_bindgen( js_name = withImmutableDescription) ]
71- pub fn with_immutable_description ( self , description : String ) -> Self { self . 0 . with_immutable_description ( description) . into ( ) }
83+ pub fn with_immutable_description ( self , description : String ) -> Self {
84+ self . 0 . with_immutable_description ( description) . into ( )
85+ }
7286
7387 #[ wasm_bindgen( js_name = withUpdatableMetadata) ]
74- pub fn with_updatable_metadata ( self , metadata : String ) -> Self { self . 0 . with_updatable_metadata ( metadata) . into ( ) }
88+ pub fn with_updatable_metadata ( self , metadata : String ) -> Self {
89+ self . 0 . with_updatable_metadata ( metadata) . into ( )
90+ }
7591
7692 #[ wasm_bindgen( ) ]
77- pub fn dynamic ( ) -> Self { NotarizationBuilder :: < Dynamic > :: dynamic ( ) . into ( ) }
93+ pub fn dynamic ( ) -> Self {
94+ NotarizationBuilder :: < Dynamic > :: dynamic ( ) . into ( )
95+ }
7896
7997 #[ wasm_bindgen( js_name = withTransferLock) ]
80- pub fn with_transfer_lock ( self , lock : WasmTimeLock ) -> Self { self . 0 . with_transfer_lock ( lock. 0 ) . into ( ) }
98+ pub fn with_transfer_lock ( self , lock : WasmTimeLock ) -> Self {
99+ self . 0 . with_transfer_lock ( lock. 0 ) . into ( )
100+ }
81101
82102 #[ wasm_bindgen( ) ]
83103 pub fn finish ( self ) -> Result < WasmTransactionBuilder > {
0 commit comments