text: !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).decode={})}(this,function(e){function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var t=function(e,r,t){try{try{return Promise.resolve(Number(e))}catch(e){throw new Error("Decode Number Error : "+t.join("."))}}catch(e){return Promise.reject(e)}},n=function(e){return Promise.resolve(e)},o=function(e,r,t){try{return Promise.resolve(e.fields.reduce(function(e,n){try{return Promise.resolve(e).then(function(o){return e=o,Promise.resolve(u(n.value,r,[].concat(t,[n.name]))).then(function(r){return e[n.name]=r,e})})}catch(e){return Promise.reject(e)}},Promise.resolve({}))).then(function(t){var n=e.id&&c(r,e.id);return n?Promise.resolve(n(t)):t})}catch(e){return Promise.reject(e)}},i={UInt:t,Int:t,UInt8:t,Int8:t,UInt16:t,Int16:t,UInt32:t,Int32:t,UInt64:t,Int64:t,UInt128:t,Int128:t,UInt256:t,Int256:t,Word8:t,Word16:t,Word32:t,Word64:t,UFix64:t,Fix64:t,String:n,Character:n,Bool:n,Address:n,Void:function(){return Promise.resolve(null)},Optional:function(e,r,t){return Promise.resolve(e?u(e,r,t):null)},Reference:function(e){try{return Promise.resolve({address:e.address,type:e.type})}catch(e){return Promise.reject(e)}},Array:function(e,r,t){try{return Promise.resolve(Promise.all(e.map(function(e){return new Promise(function(n){try{return Promise.resolve(u(e,r,[].concat(t,[e.type]))).then(n)}catch(e){return Promise.reject(e)}})})))}catch(e){return Promise.reject(e)}},Dictionary:function(e,r,t){try{return Promise.resolve(e.reduce(function(e,n){try{return Promise.resolve(e).then(function(o){return e=o,Promise.resolve(u(n.key,r,[].concat(t,[n.key]))).then(function(o){return Promise.resolve(u(n.value,r,[].concat(t,[n.key]))).then(function(r){return e[o]=r,e})})})}catch(e){return Promise.reject(e)}},Promise.resolve({})))}catch(e){return Promise.reject(e)}},Event:o,Resource:o,Struct:o},c=function(e,r){var t=Object.keys(e).find(function(e){return/^\/.*\/$/.test(e)?new RegExp(e.substring(1,e.length-1)).test(r):e===r});return r&&t&&e[t]},u=function(e,r,t){try{var n=c(r,e.type);if(!n)throw new Error("Undefined Decoder Error: "+e.type+"@"+t.join("."));return Promise.resolve(n(e.value,r,t))}catch(e){return Promise.reject(e)}},s=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n=[]);var o=r({},i,{},t);return Promise.resolve(u(e,o,n))};e.decode=s,e.decodeResponse=function(e,t){void 0===t&&(t={});try{var n=r({},i,{},t),o=Buffer.from(e.encodedData).toString("utf8"),c=JSON.parse(o);return Promise.resolve(s(c,n))}catch(e){return Promise.reject(e)}}});
  //# sourceMappingURL=decode.umd.js.map
  