mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 02:07:56 +00:00
Initial rebrand: @polkadot -> @pezkuwi (14 packages)
- Package namespace: @polkadot/* -> @pezkuwi/* - Repository: polkadot-js/common -> pezkuwichain/pezkuwi-common - Author: Pezkuwi Team <team@pezkuwichain.io> Core packages: - @pezkuwi/util (utilities) - @pezkuwi/util-crypto (crypto primitives) - @pezkuwi/keyring (account management) - @pezkuwi/networks (chain metadata) - @pezkuwi/hw-ledger (Ledger hardware wallet) - @pezkuwi/x-* (10 polyfill packages) Total: 14 packages Upstream: polkadot-js/common v14.0.1
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Bundler tests</title>
|
||||
<style>
|
||||
pre {
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
|
||||
pre.header {
|
||||
background: #ddd;
|
||||
margin-top: 1.5rem;
|
||||
padding: 0.25rem 0.75rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
function log (label, result) {
|
||||
const pre = document.createElement('pre');
|
||||
|
||||
if (typeof result !== 'undefined') {
|
||||
pre.innerHTML = `${label.padStart(24)} = ${result}`;
|
||||
} else {
|
||||
pre.innerHTML = label;
|
||||
pre.className = 'header';
|
||||
}
|
||||
|
||||
document.body.appendChild(pre);
|
||||
}
|
||||
</script>
|
||||
<script src="packages/util/build/bundle-polkadot-util.js"></script>
|
||||
<script>
|
||||
log('polkadotUtil');
|
||||
|
||||
const { bnToBn, u8aToHex } = polkadotUtil;
|
||||
|
||||
log('u8aToHex', u8aToHex(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8])));
|
||||
log('bnToBn', bnToBn(123).addn(1).toString());
|
||||
</script>
|
||||
<script src="packages/util-crypto/build/bundle-polkadot-util-crypto.js"></script>
|
||||
<script>
|
||||
log('polkadotUtilCrypto');
|
||||
|
||||
const { blake2AsHex, randomAsHex, selectableNetworks } = polkadotUtilCrypto;
|
||||
|
||||
log('blake2AsHex', blake2AsHex(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8])));
|
||||
log('blake2AsHex (js)', blake2AsHex(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]), 256, null, true));
|
||||
log('randomAsHex', randomAsHex());
|
||||
log('selectableNetworks', selectableNetworks.map(({ displayName }) => displayName).join('; '));
|
||||
</script>
|
||||
<script src="packages/keyring/build/bundle-polkadot-keyring.js"></script>
|
||||
<script>
|
||||
log('polkadotKeyring');
|
||||
|
||||
const { Keyring } = polkadotKeyring;
|
||||
const { cryptoWaitReady } = polkadotUtilCrypto;
|
||||
|
||||
cryptoWaitReady().then(() => {
|
||||
const keyring = new Keyring({ type: 'sr25519' });
|
||||
const alice = keyring.addFromUri('//Alice');
|
||||
|
||||
log('alice.address', alice.address);
|
||||
log('signature', u8aToHex(alice.sign('hello world')));
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user