NPM Wrap for zkbnb-js-sdk.
> npm i @bnb-chain/greenfield-zk-crypto
import {getEddsaCompressedPublicKey} from "@bnb-chain/greenfield-zk-crypto"
// set wasm path: CDN or your server path
window.__PUBLIC_ZKCRYPTO_WASM_PATH__ = 'zk wasm path';
;(async () => {
const res = await getEddsaCompressedPublicKey('foo');
console.log(res)
})()
<script src="https://cdn.jsdelivr.net/npm/@bnb-chain/greenfield-zk-crypto/dist/umd/index.js"></script>
<script>
// set wasm path
window.__PUBLIC_CROSS_WASM_PATH__ = 'https://cdn.jsdelivr.net/npm/@bnb-chain/greenfield-zk-crypto/dist/node/zk-crypto.wasm';
;(async () => {
const res = await getEddsaCompressedPublicKey('foo');
console.log(res)
})()
</script>
const { getEddsaCompressedPublicKey } = require("@bnb-chain/greenfield-zk-crypto");
;(async () => {
const res = await getEddsaCompressedPublicKey('foo');
})()