{"version":3,"file":"base-58.cjs","sources":["../../../../src/utils/encoding/base-58.js"],"sourcesContent":["import bs58 from 'bs58';\nimport { ensureString } from '../types/string';\nimport { normalizeToU8a } from '../types/bytes';\nimport { catchFnErrorWith } from '../error';\n\n/**\n * Encodes supplied bytes as base58 string.\n * @param {Uint8Array} bytes\n * @returns {string}\n */\nexport const encodeAsBase58 = (bytes) => bs58.encode(normalizeToU8a(bytes));\n/**\n * Decodes bytes of the supplied base58 string.\n * @param {string} string\n * @returns {Uint8Array}\n */\nexport const decodeFromBase58 = catchFnErrorWith(\n  'Invalid base58btc string',\n  (string) => bs58.decode(ensureString(string)),\n);\n"],"names":["bs58","normalizeToU8a","catchFnErrorWith","ensureString"],"mappings":";;;;;;;;;AAKA;AACA;AACA;AACA;AACA;AACY,MAAC,cAAc,GAAG,CAAC,KAAK,KAAKA,oBAAI,CAAC,MAAM,CAACC,oBAAc,CAAC,KAAK,CAAC;AAC1E;AACA;AACA;AACA;AACA;AACY,MAAC,gBAAgB,GAAGC,sBAAgB;AAChD,EAAE,0BAA0B;AAC5B,EAAE,CAAC,MAAM,KAAKF,oBAAI,CAAC,MAAM,CAACG,kBAAY,CAAC,MAAM,CAAC,CAAC;AAC/C;;;;;"}