+ /**
+ * Encodes the given decoded address into slp addr format.
+ * @private
+ * @param {object} decoded
+ * @returns {string}
+ */
+ function encodeAsSlpaddr (decoded) {
+ var prefix = decoded.network === Network.Mainnet ? 'simpleledger' : 'slptest'
+ var type = decoded.type === Type.P2PKH ? 'P2PKH' : 'P2SH'
+ var hash = Uint8Array.from(decoded.hash)
+ return cashaddr.encode(prefix, type, hash)
+ }
+