We are pleased to announce that Aioha may now be used to sign transactions through Wax Typescript library.
Wax is a next generation feature rich library for Hive. It provides a developer-friendly interface to low level hived C++ functions in Python and Typescript.
Why Aioha and Wax?
By using Aioha as transaction signer, you can integrate 5 authentication providers (and more incoming) into your Wax-powered Hive app and leverage Aioha features such as:
- Common interface across authentication providers
- Lightweight (56 KiB uncompressed, 15 KiB gzipped main bundle)
- Built-in login persistence
- Account switcher
- Framework specific provider and UI
Usage
import { createHiveChain } from '@hiveio/wax'
import { initAioha, WaxAiohaSigner } from '@aioha/aioha'
const aioha = initAioha()
const chain = await createHiveChain()
const tx = await chain.createTransaction()
// push some operations here...
await tx.sign(WaxAiohaSigner.for(aioha, 'active'))
await chain.broadcast(tx)
Caveats
As of writing this, most if not all providers produce signatures using the legacy serialization method, while Wax prefers the newer method supported as of HF26 which saves 4 bytes per asset/NAI value in the transaction.
In addition, Aioha primarily uses the legacy transaction JSON format (array tuple of ["operation_name", {...body}]
) while Wax primarily uses the newer JSON format of {"type": "operation_name", value: {...body}}
.
We plan to address them in the next major breaking release of Aioha.
Other changes in v1.7
- Plaintext key provider fixes:
- User class variable not set upon login
- dhive endpoint not changed upon calling
setApi()
- Fix user specified API not passed in when constructing transaction header to sign
- Fix
signTx()
result typing - Move mostly unused JSON-RPC extensions to extras as optional import to reduce main bundle size
Bundle sizes
Bundle Name | Uncompressed Size | gzipped |
---|---|---|
bundle.js | 56 KiB | 15 KiB |
ledger.bundle.js | 146 KiB | 44 KiB |
hiveauth-aes.bundle.js | 11.5 KiB | 4.5 KiB |
Total | 214 KiB | 64 KiB |
Links
Landing page and docs: https://aioha.dev
Github: https://github.com/aioha-hive
NPM: https://www.npmjs.com/package/@aioha/aioha
Sting: https://chat.peakd.com/t/hive-169420/0