Skip to content

Commit 30e9057

Browse files
committed
docs: update 'Mithril client library WASM' developer doc
With new unstable features implementation.
1 parent ccb0b10 commit 30e9057

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

docs/website/root/manual/developer-docs/nodes/mithril-client-library-wasm.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ broadcast_channel.onmessage = (e) => {
9494

9595
await initMithrilClient();
9696

97-
let client = await new MithrilClient(
98-
aggregator_endpoint,
99-
genesis_verification_key,
100-
);
97+
let client = new MithrilClient(aggregator_endpoint, genesis_verification_key, {
98+
// The following option activates the unstable features of the client.
99+
// Unstable features will trigger an error if this option is not set.
100+
unstable: true,
101+
});
101102
let mithril_stake_distributions_list =
102103
await client.list_mithril_stake_distributions();
103104
console.log("stake distributions:", mithril_stake_distributions_list);
@@ -187,7 +188,7 @@ wget -q -O - https://aggregator.pre-release-preview.api.mithril.network/aggregat
187188
:::
188189

189190
```js
190-
const proof = await client.unstable.get_cardano_transaction_proofs([
191+
const proof = await client.get_cardano_transaction_proofs([
191192
"CARDANO_TRANSACTION_HASH_1",
192193
"CARDANO_TRANSACTION_HASH_2",
193194
]);
@@ -203,7 +204,7 @@ console.log(
203204
);
204205

205206
let valid_cardano_transaction_proof =
206-
await client.unstable.verify_cardano_transaction_proof_then_compute_message(
207+
await client.verify_cardano_transaction_proof_then_compute_message(
207208
proof,
208209
proof_certificate,
209210
);
@@ -233,11 +234,11 @@ wget -q -O - https://aggregator.testing-preview.api.mithril.network/aggregator |
233234

234235
```js
235236
let cardano_stake_distributions_list =
236-
await client.unstable.list_cardano_stake_distributions();
237+
await client.list_cardano_stake_distributions();
237238
console.log("cardano stake distributions:", cardano_stake_distributions_list);
238239

239240
let last_cardano_stake_distribution =
240-
await client.unstable.get_cardano_stake_distribution(
241+
await client.get_cardano_stake_distribution(
241242
cardano_stake_distributions_list[0].hash,
242243
);
243244
console.log(
@@ -259,7 +260,7 @@ console.log(
259260
);
260261

261262
let cardano_stake_distribution_message =
262-
await client.unstable.compute_cardano_stake_distribution_message(
263+
await client.compute_cardano_stake_distribution_message(
263264
certificate,
264265
last_cardano_stake_distribution,
265266
);

0 commit comments

Comments
 (0)