Skip to content

Commit

Permalink
feat(): replace more libsodium usages
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasGassmann committed Sep 2, 2022
1 parent 610c695 commit acbe47e
Show file tree
Hide file tree
Showing 23 changed files with 1,613 additions and 263 deletions.
28 changes: 28 additions & 0 deletions clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# rm -rf ./dist
# rm -rf ./node_modules

# rm -rf ./packages/beacon-blockchain-substrate/dist
# rm -rf ./packages/beacon-blockchain-tezos/dist
# rm -rf ./packages/beacon-blockchain-tezos-sapling/dist
# rm -rf ./packages/beacon-core/dist
# rm -rf ./packages/beacon-dapp/dist
# rm -rf ./packages/beacon-sdk/dist
# rm -rf ./packages/beacon-transport-matrix/dist
# rm -rf ./packages/beacon-transport-postmessage/dist
# rm -rf ./packages/beacon-types/dist
# rm -rf ./packages/beacon-ui/dist
# rm -rf ./packages/beacon-utils/dist
# rm -rf ./packages/beacon-wallet/dist

rm -rf ./packages/beacon-blockchain-substrate/node_modules
rm -rf ./packages/beacon-blockchain-tezos/node_modules
rm -rf ./packages/beacon-blockchain-tezos-sapling/node_modules
rm -rf ./packages/beacon-core/node_modules
rm -rf ./packages/beacon-dapp/node_modules
rm -rf ./packages/beacon-sdk/node_modules
rm -rf ./packages/beacon-transport-matrix/node_modules
rm -rf ./packages/beacon-transport-postmessage/node_modules
rm -rf ./packages/beacon-types/node_modules
rm -rf ./packages/beacon-ui/node_modules
rm -rf ./packages/beacon-utils/node_modules
rm -rf ./packages/beacon-wallet/node_modules
23 changes: 21 additions & 2 deletions examples/dapp.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
<button id="deserializeData">Deserialize Data</button>
<br /><br />
---
<textarea id="beacon-textbox-serialize"></textarea>
<button id="serializeData">Serialize Data</button>
<br /><br />
---
<br /><br />
<button id="reset">Reset and Refresh</button>
<br /><br />
Expand Down Expand Up @@ -150,7 +154,7 @@
beacon.setLogger(x)

// Initiate DAppClient
const client = new beacon.DAppClient({
const client = beacon.getDAppClientInstance({
name: 'Example DApp', // Name of the DApp,
disclaimerText: 'This is an optional <b>disclaimer</b>.'
// preferredNetwork: beacon.NetworkType.DELPHINET
Expand Down Expand Up @@ -489,7 +493,22 @@
document.getElementById('deserializeData').addEventListener('click', () => {
const value = document.getElementById('beacon-textbox').value
console.log('Deserializing:', value)
new beacon.Serializer().deserialize(value).then(console.log).catch(console.error)

new beacon.Serializer()
.deserialize(value)
.then((res) => {
console.log(res), console.log(JSON.stringify(res))
})
.catch(console.error)
})

// Add event listener to the button
document.getElementById('serializeData').addEventListener('click', () => {
const value = document.getElementById('beacon-textbox-serialize').value
console.log('Serializing:', value)
const parsed = JSON.parse(value)
console.log(parsed)
new beacon.Serializer().serialize(parsed).then(console.log).catch(console.error)
})
</script>
</body>
Expand Down
Loading

0 comments on commit acbe47e

Please sign in to comment.