Currently, @iroha2/client provides a mechanism to inject the crypto instance into the library, so that all crypto-related functions will work after that:
import { setCrypto } from '@iroha2/client'
import { crypto } from '@iroha2/crypto-target-node'
setCrypto(crypto)
The proposal is to move this singleton to the @iroha2/crypto-core package, because it seems to make more sense:
import { setCryptoWasm } from '@iroha2/crypto-core'
import { cryptoWasm } from '@iroha2/crypto-target-node'
setCryptoWasm(cryptoWasm)
After that, it will be probably possible to move all "interface wrap" into the single core package, and each crypto-target-* package will be a simple WASM exporter
Benefits
More intuitive API: the crypto part is moved to the crypto package
Simpler code base - no complicated wrap bundling for each target
Drawbacks
There might be some unexpected limitations, needs research.
Description
Currently,
@iroha2/client
provides a mechanism to inject thecrypto
instance into the library, so that all crypto-related functions will work after that:The proposal is to move this singleton to the
@iroha2/crypto-core
package, because it seems to make more sense:After that, it will be probably possible to move all "interface wrap" into the single core package, and each
crypto-target-*
package will be a simple WASM exporterBenefits
Drawbacks
There might be some unexpected limitations, needs research.