GOOS=js GOARCH=wasm go build -o dcr.wasm .Then you can use the generated dcr.wasm file and wasm_exec.js file to copy and use. wasm_exec.js is located at: $(go env GOROOT)/misc/wasm/wasm_exec.js
The following functions can be extracted and used from the wasm file::
- deriveAddress(pubKeyHex string, network string) return (address string)
- buildUnsignedTx(inputs []Array, outputs []Array, lockTime number, expiry number, network string) return (unsignedTxHex string, hashesToSign []string)
- getPkScript(address string, network string) return (scriptVersion number, scriptPubKey string)
- applySignatures(unsignedTxHex string, signatures []string, pubKeyHex string) return (signedTxHex string)