@@ -64,21 +64,16 @@ function format_tx_list(transactions_hashes) {
64
64
return "<ul>" + transactions_hashes . map ( ( tx ) => "<li>" + tx + "</li>" ) . join ( "" ) + "</ul>" ;
65
65
}
66
66
67
- function client_options_with_custom_headers ( ) {
68
- // The following header is set as an example.
69
- // It's used to demonstrate how to add headers.
70
- let http_headers_map = new Map ( ) ;
71
- http_headers_map . set ( "Content-Type" , "application/json" ) ;
72
-
73
- return {
74
- http_headers : http_headers_map ,
75
- } ;
76
- }
77
-
78
67
await initMithrilClient ( ) ;
79
68
80
- let client_options = client_options_with_custom_headers ( ) ;
81
- let client = new MithrilClient ( aggregator_endpoint , genesis_verification_key , client_options ) ;
69
+ let client = new MithrilClient ( aggregator_endpoint , genesis_verification_key , {
70
+ // The following header is set as an example.
71
+ // It's used to demonstrate how to add headers.
72
+ http_headers : new Map ( [ [ "Content-Type" , "application/json" ] ] ) ,
73
+ // The following option activates the unstable features of the client.
74
+ // Unstable features will trigger an error if this option is not set.
75
+ unstable : true ,
76
+ } ) ;
82
77
83
78
displayStepInDOM ( 1 , "Getting stake distributions list..." ) ;
84
79
let mithril_stake_distributions_list = await client . list_mithril_stake_distributions ( ) ;
@@ -135,7 +130,7 @@ displayMessageInDOM("Result", "Mithril stake distribution message validated 
135
130
console . log ( "valid_stake_distribution_message:" , valid_stake_distribution_message ) ;
136
131
137
132
displayStepInDOM ( 7 , "Getting transaction proof..." ) ;
138
- const proof = await client . unstable . get_cardano_transaction_proofs ( [
133
+ const proof = await client . get_cardano_transaction_proofs ( [
139
134
"eac09f970f47ef3ab378db9232914e146773853397e79b904f1a45123a23c21f" ,
140
135
"81fe7a5dab42867ef309b6d7210158bf99331884ac3c3b6c7188a8c9c18d5974" ,
141
136
"320c13f4a3e51f6f4f66fcd9007e02bf658aa4ee9a88a509028d867d3b8a8e9a" ,
@@ -157,7 +152,7 @@ displayMessageInDOM("Result", "certificate chain verified ✓");
157
152
console . log ( "verify_certificate_chain OK, last_certificate_from_chain:" , proof_certificate ) ;
158
153
159
154
displayStepInDOM ( 10 , "Validating Cardano transaction proof message..." ) ;
160
- let protocol_message = await client . unstable . verify_cardano_transaction_proof_then_compute_message (
155
+ let protocol_message = await client . verify_cardano_transaction_proof_then_compute_message (
161
156
proof ,
162
157
proof_certificate ,
163
158
) ;
0 commit comments