@ultrade/shared 1.0.27 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/browser/common/index.js +1 -7
  2. package/dist/browser/{common/utils/social.js → constants/env.js} +1 -1
  3. package/dist/browser/constants/index.js +1 -1
  4. package/dist/browser/enums/index.js +1 -1
  5. package/dist/browser/helpers/algo.helper.js +1 -1
  6. package/dist/browser/helpers/assert.helper.js +1 -1
  7. package/dist/browser/helpers/atomic.helper.js +1 -1
  8. package/dist/browser/helpers/balance.helper.js +1 -1
  9. package/dist/browser/helpers/codex/common.helper.js +2 -2
  10. package/dist/browser/helpers/codex/index.js +2 -2
  11. package/dist/browser/helpers/codex/mbr.helper.js +1 -1
  12. package/dist/browser/helpers/codex/mna.helper.js +1 -1
  13. package/dist/browser/helpers/codex/order.helper.js +1 -1
  14. package/dist/browser/helpers/codex/setGlobal.helper.js +1 -1
  15. package/dist/browser/{common/mappers/codexBalance.mapper.js → helpers/codex/tokens.js} +1 -1
  16. package/dist/browser/helpers/codex/transfer.helper.js +2 -2
  17. package/dist/browser/helpers/codex/txn.helper.js +1 -1
  18. package/dist/browser/helpers/codex.helper.js +6 -6
  19. package/dist/browser/helpers/eth.helper.js +2 -2
  20. package/dist/browser/helpers/order.helper.js +1 -1
  21. package/dist/browser/helpers/pair.helper.js +1 -1
  22. package/dist/browser/helpers/pointSystem.helper.js +1 -1
  23. package/dist/browser/helpers/withdraw.helper.js +2 -2
  24. package/dist/browser/interfaces/index.js +1 -1
  25. package/dist/browser/services/index.js +11 -0
  26. package/dist/browser/types/index.js +1 -1
  27. package/dist/{src/common → common}/index.d.ts +0 -1
  28. package/dist/{src/common → common}/utils/index.d.ts +3 -0
  29. package/dist/constants/env.d.ts +6 -0
  30. package/dist/{src/constants → constants}/index.d.ts +1 -0
  31. package/dist/constants/social.d.ts +4 -0
  32. package/dist/{src/enums → enums}/db/index.d.ts +1 -0
  33. package/dist/enums/db/pending-actions.enum.d.ts +6 -0
  34. package/dist/{src/enums → enums}/index.d.ts +2 -0
  35. package/dist/enums/points.enum.d.ts +4 -0
  36. package/dist/enums/socket.enum.d.ts +18 -0
  37. package/dist/{src/helpers → helpers}/codex/common.helper.d.ts +2 -5
  38. package/dist/{src/helpers → helpers}/codex/index.d.ts +2 -0
  39. package/dist/helpers/codex/tokens.d.ts +5 -0
  40. package/dist/{src/common/utils → helpers}/decode.d.ts +1 -1
  41. package/dist/interfaces/algostreamer/index.d.ts +49 -0
  42. package/dist/{src/interfaces → interfaces}/index.d.ts +2 -0
  43. package/dist/{src/interfaces → interfaces}/order.interface.d.ts +1 -0
  44. package/dist/interfaces/socket.interface.d.ts +16 -0
  45. package/dist/node/common/index.js +1 -1
  46. package/dist/node/constants/env.js +1 -0
  47. package/dist/node/constants/index.js +1 -1
  48. package/dist/node/enums/index.js +1 -1
  49. package/dist/node/helpers/algo.helper.js +1 -1
  50. package/dist/node/helpers/assert.helper.js +1 -1
  51. package/dist/node/helpers/atomic.helper.js +1 -1
  52. package/dist/node/helpers/balance.helper.js +1 -1
  53. package/dist/node/helpers/codex/common.helper.js +2 -2
  54. package/dist/node/helpers/codex/index.js +2 -2
  55. package/dist/node/helpers/codex/mbr.helper.js +1 -1
  56. package/dist/node/helpers/codex/mna.helper.js +1 -1
  57. package/dist/node/helpers/codex/order.helper.js +1 -1
  58. package/dist/node/helpers/codex/setGlobal.helper.js +1 -1
  59. package/dist/node/helpers/codex/tokens.js +1 -0
  60. package/dist/node/helpers/codex/transfer.helper.js +2 -2
  61. package/dist/node/helpers/codex/txn.helper.js +1 -1
  62. package/dist/node/helpers/codex.helper.js +6 -6
  63. package/dist/node/helpers/eth.helper.js +2 -2
  64. package/dist/node/helpers/order.helper.js +1 -1
  65. package/dist/node/helpers/pair.helper.js +1 -1
  66. package/dist/node/helpers/pointSystem.helper.js +1 -1
  67. package/dist/node/helpers/withdraw.helper.js +2 -2
  68. package/dist/node/interfaces/index.js +1 -1
  69. package/dist/node/services/index.js +1 -0
  70. package/dist/node/types/index.js +1 -1
  71. package/dist/services/index.d.ts +2 -0
  72. package/dist/services/pairParam.service.d.ts +14 -0
  73. package/dist/services/tmc.service.d.ts +33 -0
  74. package/dist/{src/types → types}/api/request.types.d.ts +10 -10
  75. package/dist/{src/types → types}/settings.type.d.ts +3 -3
  76. package/package.json +39 -5
  77. package/dist/browser/common/big-number.helper.js +0 -11
  78. package/dist/browser/common/mappers/codexAsset.mapper.js +0 -11
  79. package/dist/browser/common/mappers/index.js +0 -11
  80. package/dist/browser/common/mappers/trade.mapper.js +0 -11
  81. package/dist/browser/common/utils/assert.js +0 -11
  82. package/dist/browser/common/utils/index.js +0 -11
  83. package/dist/browser/common/utils/stat.js +0 -11
  84. package/dist/browser/helpers/vaa.helper.js +0 -11
  85. package/dist/node/common/big-number.helper.js +0 -1
  86. package/dist/node/common/mappers/codexAsset.mapper.js +0 -1
  87. package/dist/node/common/mappers/codexBalance.mapper.js +0 -1
  88. package/dist/node/common/mappers/index.js +0 -1
  89. package/dist/node/common/mappers/trade.mapper.js +0 -1
  90. package/dist/node/common/utils/assert.js +0 -1
  91. package/dist/node/common/utils/index.js +0 -1
  92. package/dist/node/common/utils/social.js +0 -1
  93. package/dist/node/common/utils/stat.js +0 -1
  94. package/dist/node/helpers/vaa.helper.js +0 -0
  95. package/dist/src/helpers/vaa.helper.d.ts +0 -0
  96. /package/dist/browser/{common → helpers}/auth.helper.js +0 -0
  97. /package/dist/browser/{common/utils → helpers}/decode.js +0 -0
  98. /package/dist/{src/common → common}/big-number.helper.d.ts +0 -0
  99. /package/dist/{src/common → common}/mappers/codexAsset.mapper.d.ts +0 -0
  100. /package/dist/{src/common → common}/mappers/codexBalance.mapper.d.ts +0 -0
  101. /package/dist/{src/common → common}/mappers/index.d.ts +0 -0
  102. /package/dist/{src/common → common}/mappers/trade.mapper.d.ts +0 -0
  103. /package/dist/{src/common → common}/utils/assert.d.ts +0 -0
  104. /package/dist/{src/common → common}/utils/social.d.ts +0 -0
  105. /package/dist/{src/common → common}/utils/stat.d.ts +0 -0
  106. /package/dist/{src/constants → constants}/auth.d.ts +0 -0
  107. /package/dist/{src/constants → constants}/cctp.d.ts +0 -0
  108. /package/dist/{src/constants → constants}/codex.d.ts +0 -0
  109. /package/dist/{src/constants → constants}/frontend.d.ts +0 -0
  110. /package/dist/{src/constants → constants}/response.d.ts +0 -0
  111. /package/dist/{src/constants → constants}/settings.d.ts +0 -0
  112. /package/dist/{src/constants → constants}/withdrawalWalletsMessage.d.ts +0 -0
  113. /package/dist/{src/enums → enums}/chains.enum.d.ts +0 -0
  114. /package/dist/{src/enums → enums}/db/account/index.d.ts +0 -0
  115. /package/dist/{src/enums → enums}/db/affiliate.enum.d.ts +0 -0
  116. /package/dist/{src/enums → enums}/db/available-pair-settings.enum.d.ts +0 -0
  117. /package/dist/{src/enums → enums}/db/common.enum.d.ts +0 -0
  118. /package/dist/{src/enums → enums}/db/component/index.d.ts +0 -0
  119. /package/dist/{src/enums → enums}/db/market-maker.enum.d.ts +0 -0
  120. /package/dist/{src/enums → enums}/db/notification-center/userNotification.enum.d.ts +0 -0
  121. /package/dist/{src/enums → enums}/db/order-side.enum.d.ts +0 -0
  122. /package/dist/{src/enums → enums}/db/order-status.enum.d.ts +0 -0
  123. /package/dist/{src/enums → enums}/db/order-type.enum.d.ts +0 -0
  124. /package/dist/{src/enums → enums}/db/relayer.enum.d.ts +0 -0
  125. /package/dist/{src/enums → enums}/db/setting-type.enum.d.ts +0 -0
  126. /package/dist/{src/enums → enums}/db/social-action.enum.d.ts +0 -0
  127. /package/dist/{src/enums → enums}/db/social-prompt.enum.d.ts +0 -0
  128. /package/dist/{src/enums → enums}/db/social.enum.d.ts +0 -0
  129. /package/dist/{src/enums → enums}/db/state-type.enum.d.ts +0 -0
  130. /package/dist/{src/enums → enums}/db/trade.enums.d.ts +0 -0
  131. /package/dist/{src/enums → enums}/db/tradingKeyType.enum.d.ts +0 -0
  132. /package/dist/{src/enums → enums}/db/upgrade.enum.d.ts +0 -0
  133. /package/dist/{src/enums → enums}/db/withdrawal-wallet.enum.d.ts +0 -0
  134. /package/dist/{src/enums → enums}/maintenanceMode.enum.d.ts +0 -0
  135. /package/dist/{src/enums → enums}/notification.enum.d.ts +0 -0
  136. /package/dist/{src/enums → enums}/rabbitMq.d.ts +0 -0
  137. /package/dist/{src/enums → enums}/settings.enum.d.ts +0 -0
  138. /package/dist/{src/enums → enums}/social.enum.d.ts +0 -0
  139. /package/dist/{src/helpers → helpers}/Encoding.d.ts +0 -0
  140. /package/dist/{src/helpers → helpers}/algo.helper.d.ts +0 -0
  141. /package/dist/{src/helpers → helpers}/assert.helper.d.ts +0 -0
  142. /package/dist/{src/helpers → helpers}/atomic.helper.d.ts +0 -0
  143. /package/dist/{src/common → helpers}/auth.helper.d.ts +0 -0
  144. /package/dist/{src/helpers → helpers}/balance.helper.d.ts +0 -0
  145. /package/dist/{src/helpers → helpers}/codex/mbr.helper.d.ts +0 -0
  146. /package/dist/{src/helpers → helpers}/codex/mna.helper.d.ts +0 -0
  147. /package/dist/{src/helpers → helpers}/codex/order.helper.d.ts +0 -0
  148. /package/dist/{src/helpers → helpers}/codex/setGlobal.helper.d.ts +0 -0
  149. /package/dist/{src/helpers → helpers}/codex/transfer.helper.d.ts +0 -0
  150. /package/dist/{src/helpers → helpers}/codex/txn.helper.d.ts +0 -0
  151. /package/dist/{src/helpers → helpers}/codex.helper.d.ts +0 -0
  152. /package/dist/{src/helpers → helpers}/eth.helper.d.ts +0 -0
  153. /package/dist/{src/helpers → helpers}/index.d.ts +0 -0
  154. /package/dist/{src/helpers → helpers}/interval.helpers.d.ts +0 -0
  155. /package/dist/{src/helpers → helpers}/liquidity.helper.d.ts +0 -0
  156. /package/dist/{src/helpers → helpers}/order.helper.d.ts +0 -0
  157. /package/dist/{src/helpers → helpers}/pair.helper.d.ts +0 -0
  158. /package/dist/{src/helpers → helpers}/pointSystem.helper.d.ts +0 -0
  159. /package/dist/{src/helpers → helpers}/ticker.helpers.d.ts +0 -0
  160. /package/dist/{src/helpers → helpers}/withdraw.helper.d.ts +0 -0
  161. /package/dist/{src/interfaces → interfaces}/accountInfo.interface.d.ts +0 -0
  162. /package/dist/{src/interfaces → interfaces}/api/affiliate.interface.d.ts +0 -0
  163. /package/dist/{src/interfaces → interfaces}/api/index.d.ts +0 -0
  164. /package/dist/{src/interfaces → interfaces}/cache.interface.d.ts +0 -0
  165. /package/dist/{src/interfaces → interfaces}/db/baseModel.interface.d.ts +0 -0
  166. /package/dist/{src/interfaces → interfaces}/db/hummingbot/index.d.ts +0 -0
  167. /package/dist/{src/interfaces → interfaces}/db/index.d.ts +0 -0
  168. /package/dist/{src/interfaces → interfaces}/db/market/index.d.ts +0 -0
  169. /package/dist/{src/interfaces → interfaces}/db/marketing/index.d.ts +0 -0
  170. /package/dist/{src/interfaces → interfaces}/db/notification_center/index.d.ts +0 -0
  171. /package/dist/{src/interfaces → interfaces}/db/relayer/index.d.ts +0 -0
  172. /package/dist/{src/interfaces → interfaces}/db/social/index.d.ts +0 -0
  173. /package/dist/{src/interfaces → interfaces}/db/softDeleteModel.interface.d.ts +0 -0
  174. /package/dist/{src/interfaces → interfaces}/db/white_label/index.d.ts +0 -0
  175. /package/dist/{src/interfaces → interfaces}/db/withdrawal_wallets/index.d.ts +0 -0
  176. /package/dist/{src/interfaces → interfaces}/dto/index.d.ts +0 -0
  177. /package/dist/{src/interfaces → interfaces}/emailService.interface.d.ts +0 -0
  178. /package/dist/{src/interfaces → interfaces}/kmsService.interface.d.ts +0 -0
  179. /package/dist/{src/interfaces → interfaces}/last-look-trade.interface.d.ts +0 -0
  180. /package/dist/{src/interfaces → interfaces}/market.interface.d.ts +0 -0
  181. /package/dist/{src/interfaces → interfaces}/pagination.interface.d.ts +0 -0
  182. /package/dist/{src/interfaces → interfaces}/pair.interface.d.ts +0 -0
  183. /package/dist/{src/interfaces → interfaces}/query.interface.d.ts +0 -0
  184. /package/dist/{src/interfaces → interfaces}/services/accountCache.interface.d.ts +0 -0
  185. /package/dist/{src/interfaces → interfaces}/services/algod.interface.d.ts +0 -0
  186. /package/dist/{src/interfaces → interfaces}/services/balances.interface.d.ts +0 -0
  187. /package/dist/{src/interfaces → interfaces}/services/coin-market-cap.interface.d.ts +0 -0
  188. /package/dist/{src/interfaces → interfaces}/services/index.d.ts +0 -0
  189. /package/dist/{src/interfaces → interfaces}/services/price-model.interface.d.ts +0 -0
  190. /package/dist/{src/interfaces → interfaces}/services/price-service.interface.d.ts +0 -0
  191. /package/dist/{src/interfaces → interfaces}/services/socialActivity.interface.d.ts +0 -0
  192. /package/dist/{src/interfaces → interfaces}/services/tmc.interface.d.ts +0 -0
  193. /package/dist/{src/interfaces → interfaces}/settings.interface.d.ts +0 -0
  194. /package/dist/{src/interfaces → interfaces}/streaming.interface.d.ts +0 -0
  195. /package/dist/{src/interfaces → interfaces}/timestream.interface.d.ts +0 -0
  196. /package/dist/{src/interfaces → interfaces}/trading.interface.d.ts +0 -0
  197. /package/dist/{src/interfaces → interfaces}/tradingKey.interface.d.ts +0 -0
  198. /package/dist/{src/interfaces → interfaces}/transfer.interface.d.ts +0 -0
  199. /package/dist/{src/interfaces → interfaces}/wallet.interface.d.ts +0 -0
  200. /package/dist/{src/interfaces → interfaces}/withdrawalWallets.interface.d.ts +0 -0
  201. /package/dist/node/{common → helpers}/auth.helper.js +0 -0
  202. /package/dist/node/{common/utils → helpers}/decode.js +0 -0
  203. /package/dist/{src/types → types}/algo-order.type.d.ts +0 -0
  204. /package/dist/{src/types → types}/amm/amm.d.ts +0 -0
  205. /package/dist/{src/types → types}/balance-result.types.d.ts +0 -0
  206. /package/dist/{src/types → types}/codex.types.d.ts +0 -0
  207. /package/dist/{src/types → types}/hummingbots.types.d.ts +0 -0
  208. /package/dist/{src/types → types}/index.d.ts +0 -0
  209. /package/dist/{src/types → types}/notification.type.d.ts +0 -0
  210. /package/dist/{src/types → types}/state.type.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- function Q(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}var x=Q,N=$;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);function Z(t){if(x===setTimeout)return setTimeout(t,0);if((x===Q||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function xr(t){if(N===clearTimeout)return clearTimeout(t);if((N===$||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(t);try{return N(t)}catch{try{return N.call(null,t)}catch{return N.call(this,t)}}}var g=[],y=!1,O,U=-1;function Nr(){!y||!O||(y=!1,O.length?g=O.concat(g):U=-1,g.length&&j())}function j(){if(!y){var t=Z(Nr);y=!0;for(var r=g.length;r;){for(O=g,g=[];++U<r;)O&&O[U].run();U=-1,r=g.length}O=null,y=!1,xr(t)}}function Or(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];g.push(new rr(t,r)),g.length===1&&!y&&Z(j)}function rr(t,r){this.fun=t,this.array=r}rr.prototype.run=function(){this.fun.apply(null,this.array)};var Dr="browser",Cr="browser",wr=!0,Lr={},Sr=[],yr="",Pr={},vr={},Mr={};function D(){}var Ur=D,kr=D,Br=D,Fr=D,Yr=D,Gr=D,Hr=D;function Kr(t){throw new Error("process.binding is not supported")}function Wr(){return"/"}function Vr(t){throw new Error("process.chdir is not supported")}function Xr(){return 0}var S=globalThis.performance||{},qr=S.now||S.mozNow||S.msNow||S.oNow||S.webkitNow||function(){return new Date().getTime()};function zr(t){var r=qr.call(S)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Jr=new Date;function Qr(){var t=new Date,r=t-Jr;return r/1e3}var s={nextTick:Or,title:Dr,browser:wr,env:Lr,argv:Sr,version:yr,versions:Pr,on:Ur,addListener:kr,once:Br,off:Fr,removeListener:Yr,removeAllListeners:Gr,emit:Hr,binding:Kr,cwd:Wr,chdir:Vr,umask:Xr,hrtime:zr,platform:Cr,release:vr,config:Mr,uptime:Qr},J={};Object.keys(J).forEach(t=>{let r=t.split("."),e=s;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=J[t]:e=e[o]||(e[o]={})}});var A=[],b=[],$r=typeof Uint8Array<"u"?Uint8Array:Array,V=!1;function or(){V=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],b[t.charCodeAt(r)]=r;b[45]=62,b[95]=63}function Zr(t){V||or();var r,e,n,o,a,p,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,p=new $r(c*3/4-a),n=a>0?c-4:c;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)o=b[t.charCodeAt(r)]<<18|b[t.charCodeAt(r+1)]<<12|b[t.charCodeAt(r+2)]<<6|b[t.charCodeAt(r+3)],p[u++]=o>>16&255,p[u++]=o>>8&255,p[u++]=o&255;return a===2?(o=b[t.charCodeAt(r)]<<2|b[t.charCodeAt(r+1)]>>4,p[u++]=o&255):a===1&&(o=b[t.charCodeAt(r)]<<10|b[t.charCodeAt(r+1)]<<4|b[t.charCodeAt(r+2)]>>2,p[u++]=o>>8&255,p[u++]=o&255),p}function jr(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function re(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(jr(n));return o.join("")}function er(t){V||or();for(var r,e=t.length,n=e%3,o="",a=[],p=16383,c=0,u=e-n;c<u;c+=p)a.push(re(t,c,c+p>u?u:c+p));return n===1?(r=t[e-1],o+=A[r>>2],o+=A[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=A[r>>10],o+=A[r>>4&63],o+=A[r<<2&63],o+="="),a.push(o),a.join("")}i.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function k(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function I(t,r){if(k()<r)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=i.prototype):(t===null&&(t=new i(r)),t.length=r),t}function i(t,r,e){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return X(this,t)}return ir(this,t,r,e)}i.poolSize=8192;i._augment=function(t){return t.__proto__=i.prototype,t};function ir(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?ne(t,r,e,n):typeof r=="string"?te(t,r,e):oe(t,r)}i.from=function(t,r,e){return ir(null,t,r,e)};i.kMaxLength=k();i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]);function ar(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ee(t,r,e,n){return ar(r),r<=0?I(t,r):e!==void 0?typeof n=="string"?I(t,r).fill(e,n):I(t,r).fill(e):I(t,r)}i.alloc=function(t,r,e){return ee(null,t,r,e)};function X(t,r){if(ar(r),t=I(t,r<0?0:q(r)|0),!i.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}i.allocUnsafe=function(t){return X(null,t)};i.allocUnsafeSlow=function(t){return X(null,t)};function te(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=pr(r,e)|0;t=I(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function W(t,r){var e=r.length<0?0:q(r.length)|0;t=I(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function ne(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),i.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=i.prototype):t=W(t,r),t}function oe(t,r){if(R(r)){var e=q(r.length)|0;return t=I(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ie(r.length)?I(t,0):W(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return W(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function q(t){if(t>=k())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k().toString(16)+" bytes");return t|0}i.isBuffer=xe;function R(t){return!!(t!=null&&t._isBuffer)}i.compare=function(r,e){if(!R(r)||!R(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,p=Math.min(n,o);a<p;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};i.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};i.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return i.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=i.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var p=r[n];if(!R(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(o,a),a+=p.length}return o};function pr(t,r){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return hr(t).length;default:if(n)return B(t).length;r=(""+r).toLowerCase(),n=!0}}i.byteLength=pr;function ie(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return me(this,r,e);case"utf8":case"utf-8":return ur(this,r,e);case"ascii":return _e(this,r,e);case"latin1":case"binary":return he(this,r,e);case"base64":return Ee(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Te(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function C(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}i.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)C(this,e,e+1);return this};i.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)C(this,e,e+3),C(this,e+1,e+2);return this};i.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)C(this,e,e+7),C(this,e+1,e+6),C(this,e+2,e+5),C(this,e+3,e+4);return this};i.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ur(this,0,r):ie.apply(this,arguments)};i.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:i.compare(this,r)===0};i.prototype.compare=function(r,e,n,o,a){if(!R(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var p=a-o,c=n-e,u=Math.min(p,c),l=this.slice(o,a),_=r.slice(e,n),E=0;E<u;++E)if(l[E]!==_[E]){p=l[E],c=_[E];break}return p<c?-1:c<p?1:0};function sr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=i.from(r,n)),R(r))return r.length===0?-1:tr(t,r,e,n,o);if(typeof r=="number")return r=r&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):tr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function tr(t,r,e,n,o){var a=1,p=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,p/=2,c/=2,e/=2}function u(f,L){return a===1?f[L]:f.readUInt16BE(L*a)}var l;if(o){var _=-1;for(l=e;l<p;l++)if(u(t,l)===u(r,_===-1?0:l-_)){if(_===-1&&(_=l),l-_+1===c)return _*a}else _!==-1&&(l-=l-_),_=-1}else for(e+c>p&&(e=p-c),l=e;l>=0;l--){for(var E=!0,d=0;d<c;d++)if(u(t,l+d)!==u(r,d)){E=!1;break}if(E)return l}return-1}i.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};i.prototype.indexOf=function(r,e,n){return sr(this,r,e,n,!0)};i.prototype.lastIndexOf=function(r,e,n){return sr(this,r,e,n,!1)};function ae(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var p=0;p<n;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;t[e+p]=c}return p}function pe(t,r,e,n){return G(B(r,t.length-e),t,e,n)}function cr(t,r,e,n){return G(Re(r),t,e,n)}function se(t,r,e,n){return cr(t,r,e,n)}function ce(t,r,e,n){return G(hr(r),t,e,n)}function ue(t,r,e,n){return G(ge(r,t.length-e),t,e,n)}i.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var p=!1;;)switch(o){case"hex":return ae(this,r,e,n);case"utf8":case"utf-8":return pe(this,r,e,n);case"ascii":return cr(this,r,e,n);case"latin1":case"binary":return se(this,r,e,n);case"base64":return ce(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),p=!0}};i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ee(t,r,e){return r===0&&e===t.length?er(t):er(t.slice(r,e))}function ur(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],p=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var u,l,_,E;switch(c){case 1:a<128&&(p=a);break;case 2:u=t[o+1],(u&192)===128&&(E=(a&31)<<6|u&63,E>127&&(p=E));break;case 3:u=t[o+1],l=t[o+2],(u&192)===128&&(l&192)===128&&(E=(a&15)<<12|(u&63)<<6|l&63,E>2047&&(E<55296||E>57343)&&(p=E));break;case 4:u=t[o+1],l=t[o+2],_=t[o+3],(u&192)===128&&(l&192)===128&&(_&192)===128&&(E=(a&15)<<18|(u&63)<<12|(l&63)<<6|_&63,E>65535&&E<1114112&&(p=E))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),o+=c}return le(n)}var nr=4096;function le(t){var r=t.length;if(r<=nr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=nr));return e}function _e(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function he(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function me(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=Ae(t[a]);return o}function Te(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}i.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(i.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=i.prototype;else{var a=e-r;o=new i(a,void 0);for(var p=0;p<a;++p)o[p]=this[p+r]}return o};function h(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return o};i.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};i.prototype.readUInt8=function(r,e){return e||h(r,1,this.length),this[r]};i.prototype.readUInt16LE=function(r,e){return e||h(r,2,this.length),this[r]|this[r+1]<<8};i.prototype.readUInt16BE=function(r,e){return e||h(r,2,this.length),this[r]<<8|this[r+1]};i.prototype.readUInt32LE=function(r,e){return e||h(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};i.prototype.readUInt32BE=function(r,e){return e||h(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};i.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};i.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=e,a=1,p=this[r+--o];o>0&&(a*=256);)p+=this[r+--o]*a;return a*=128,p>=a&&(p-=Math.pow(2,8*e)),p};i.prototype.readInt8=function(r,e){return e||h(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};i.prototype.readInt16LE=function(r,e){e||h(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};i.prototype.readInt16BE=function(r,e){e||h(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};i.prototype.readInt32LE=function(r,e){return e||h(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};i.prototype.readInt32BE=function(r,e){return e||h(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};i.prototype.readFloatLE=function(r,e){return e||h(r,4,this.length),H(this,r,!0,23,4)};i.prototype.readFloatBE=function(r,e){return e||h(r,4,this.length),H(this,r,!1,23,4)};i.prototype.readDoubleLE=function(r,e){return e||h(r,8,this.length),H(this,r,!0,52,8)};i.prototype.readDoubleBE=function(r,e){return e||h(r,8,this.length),H(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=1,c=0;for(this[e]=r&255;++c<n&&(p*=256);)this[e+c]=r/p&255;return e+n};i.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=n-1,c=1;for(this[e+p]=r&255;--p>=0&&(c*=256);)this[e+p]=r/c&255;return e+n};i.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function F(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}i.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};i.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};function Y(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}i.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Y(this,r,e,!0),e+4};i.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Y(this,r,e,!1),e+4};i.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=0,c=1,u=0;for(this[e]=r&255;++p<n&&(c*=256);)r<0&&u===0&&this[e+p-1]!==0&&(u=1),this[e+p]=(r/c>>0)-u&255;return e+n};i.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=n-1,c=1,u=0;for(this[e+p]=r&255;--p>=0&&(c*=256);)r<0&&u===0&&this[e+p+1]!==0&&(u=1),this[e+p]=(r/c>>0)-u&255;return e+n};i.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};i.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};i.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};i.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Y(this,r,e,!0),e+4};i.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Y(this,r,e,!1),e+4};function Er(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function lr(t,r,e,n,o){return o||Er(t,r,e,4,34028234663852886e22,-34028234663852886e22),Tr(t,r,e,n,23,4),e+4}i.prototype.writeFloatLE=function(r,e,n){return lr(this,r,e,!0,n)};i.prototype.writeFloatBE=function(r,e,n){return lr(this,r,e,!1,n)};function _r(t,r,e,n,o){return o||Er(t,r,e,8,17976931348623157e292,-17976931348623157e292),Tr(t,r,e,n,52,8),e+8}i.prototype.writeDoubleLE=function(r,e,n){return _r(this,r,e,!0,n)};i.prototype.writeDoubleBE=function(r,e,n){return _r(this,r,e,!1,n)};i.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,p;if(this===r&&n<e&&e<o)for(p=a-1;p>=0;--p)r[p+e]=this[p+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(p=0;p<a;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};i.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!i.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var c=R(r)?r:B(new i(r,o).toString()),u=c.length;for(p=0;p<n-e;++p)this[p+e]=c[p%u]}return this};var fe=/[^+\/0-9A-Za-z-_]/g;function be(t){if(t=de(t).replace(fe,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function de(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ae(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(p+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function Re(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ge(t,r){for(var e,n,o,a=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function hr(t){return Zr(be(t))}function G(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Ie(t){return t!==t}function xe(t){return t!=null&&(!!t._isBuffer||mr(t)||Ne(t))}function mr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ne(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&mr(t.slice(0,0))}function H(t,r,e,n,o){var a,p,c=o*8-n-1,u=(1<<c)-1,l=u>>1,_=-7,E=e?o-1:0,d=e?-1:1,f=t[r+E];for(E+=d,a=f&(1<<-_)-1,f>>=-_,_+=c;_>0;a=a*256+t[r+E],E+=d,_-=8);for(p=a&(1<<-_)-1,a>>=-_,_+=n;_>0;p=p*256+t[r+E],E+=d,_-=8);if(a===0)a=1-l;else{if(a===u)return p?NaN:(f?-1:1)*(1/0);p=p+Math.pow(2,n),a=a-l}return(f?-1:1)*p*Math.pow(2,a-n)}function Tr(t,r,e,n,o,a){var p,c,u,l=a*8-o-1,_=(1<<l)-1,E=_>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,L=n?1:-1,Ir=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=_):(p=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-p))<1&&(p--,u*=2),p+E>=1?r+=d/u:r+=d*Math.pow(2,1-E),r*u>=2&&(p++,u/=2),p+E>=_?(c=0,p=_):p+E>=1?(c=(r*u-1)*Math.pow(2,o),p=p+E):(c=r*Math.pow(2,E-1)*Math.pow(2,o),p=0));o>=8;t[e+f]=c&255,f+=L,c/=256,o-=8);for(p=p<<o|c,l+=o;l>0;t[e+f]=p&255,f+=L,p/=256,l-=8);t[e+f-L]|=Ir*128}import z from"bignumber.js";z.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function fr(t,r){return M(t,r,"*")}function K(t,r){return!!M(t,r,">=")}function P(t,r){return!!M(t,r,">")}function w(t,r){return!!M(t,r,"==")}function Oe(t,r){return M(t,r,"mod")}function v(t,r){return w(Oe(t,r),0)}function M(t,r,e){switch(t=new z(String(t)),r=new z(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var br=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();var rt={SMALLESTUNIT:s.env.SMALLEST_UNIT},et={SMALLEST_UNITS:s.env.SMALLEST_UNIT};var it=`{"theme1":{"value":"${s.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${s.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${s.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Et=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var bt=s.env.REACT_APP_API_URL,dt=s.env.REACT_APP_SOCKET_URL,At=s.env.REACT_APP_ALGO_SERVER,Rt=s.env.REACT_APP_ALGO_SERVER_PORT||"",gt=s.env.REACT_APP_ALGOD_TOKEN||"",It=s.env.REACT_APP_DISPENSER_LINK,xt=s.env.REACT_APP_FRONTEND_LINK||"",Nt=s.env.REACT_APP_ALGO_EXPLORER_LINK,Ot=s.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,Dt=(s.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Ct=s.env.REACT_APP_USERBACK_ACCESS_TOKEN,wt=(s.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Lt=.001*10**6,St=.002*10**6;var yt=s.env.REACT_APP_MASTER_APP_ID||"406",Pt=s.env.REACT_APP_AGG_APP_ID||"408",De=Number(s.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",De);var Ce=s.env.REACT_APP_ALGO_NETWORK||"";var vt=Ce.toLowerCase()==="mainnet"?"mainnet":"testnet";var dr=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(dr||{}),Ar=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(Ar||{}),Zn={...dr,...Ar};var ui=(t,r)=>{gr("base",{address:String(t.baseTokenAddress),chainId:t.baseTokenChainId},r.baseAsset),gr("price",{address:String(t.priceTokenAddress),chainId:t.priceTokenChainId},r.priceAsset),Se(t,r)},gr=(t,r,e)=>{m(Number(r.chainId)===Number(e.chainId),`Invalid ${t}TokenChainId, must be ${e.chainId}`),m(e.chainId===1&&String(r.address)===String(e.address)||e.chainId===8&&Number(r.address)===Number(e.address)||br(r.address,e.address),`Invalid ${t}TokenAddress, must be ${e.address}`)},Ei=t=>{m(t.expiredTime>=Math.floor(Date.now()/1e3)+3600,"Expiration time shorter than 1 hour")},Se=(t,r)=>{if(m(w(1,t.version),`Invalid order message version. Current is ${1}`),m(w(t.decimalPrice,0)||w(fr(t.decimalPrice,10**18),t.price),"Invalid price or decimalPrice"),m(!isNaN(t.random),"Invalid random, must be a number"),m(t.random>0,"Invalid random, must be greater than 0"),m(t.random<=Number.MAX_SAFE_INTEGER,"Invalid random, must no more than 2^53-1"),m(t.expiredTime>=Math.floor(Date.now()/1e3),"Invalid expiration time"),m(["B","S"].includes(t.orderSide),"Invalid order side"),m(["L","P","I","M"].includes(t.orderType),"Invalid order type"),t.orderType==="M"&&t.orderSide==="S")m(w(t.price,0)&&P(t.amount,0),"Invalid market order amount or price"),m(v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size),"Invalid market order amount");else{if(t.orderType==="M"&&t.orderSide==="B"&&w(t.amount,0))throw new Error("Buy murket order by total is not implemented yet");t.orderType==="M"&&t.orderSide==="B"&&P(t.amount,0)?m(P(t.price,0)&&v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size),"Invalid buy market order by amount"):(m(P(t.price,0)&&P(t.amount,0),"Invalid order amount or price is zero"),m(v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size)&&v(t.price,r.min_price_increment),"Invalid order amount or price"))}},m=(t,r)=>{if(!t)throw new Error(r)};export{Se as assertOrder,ui as assertOrderData,Ei as assertOrderExpirationAtCreationMoment};
1
+ function $(){throw new Error("setTimeout has not been defined")}function Z(){throw new Error("clearTimeout has not been defined")}var x=$,N=Z;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);function j(t){if(x===setTimeout)return setTimeout(t,0);if((x===$||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function xr(t){if(N===clearTimeout)return clearTimeout(t);if((N===Z||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(t);try{return N(t)}catch{try{return N.call(null,t)}catch{return N.call(this,t)}}}var g=[],S=!1,O,M=-1;function Nr(){!S||!O||(S=!1,O.length?g=O.concat(g):M=-1,g.length&&rr())}function rr(){if(!S){var t=j(Nr);S=!0;for(var r=g.length;r;){for(O=g,g=[];++M<r;)O&&O[M].run();M=-1,r=g.length}O=null,S=!1,xr(t)}}function Or(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];g.push(new er(t,r)),g.length===1&&!S&&j(rr)}function er(t,r){this.fun=t,this.array=r}er.prototype.run=function(){this.fun.apply(null,this.array)};var Cr="browser",Dr="browser",Lr=!0,wr={},yr=[],Pr="",Sr={},vr={},Ur={};function C(){}var Mr=C,kr=C,Br=C,Fr=C,Yr=C,Gr=C,Hr=C;function Kr(t){throw new Error("process.binding is not supported")}function Wr(){return"/"}function Vr(t){throw new Error("process.chdir is not supported")}function Xr(){return 0}var P=globalThis.performance||{},qr=P.now||P.mozNow||P.msNow||P.oNow||P.webkitNow||function(){return new Date().getTime()};function zr(t){var r=qr.call(P)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Qr=new Date;function Jr(){var t=new Date,r=t-Qr;return r/1e3}var s={nextTick:Or,title:Cr,browser:Lr,env:wr,argv:yr,version:Pr,versions:Sr,on:Mr,addListener:kr,once:Br,off:Fr,removeListener:Yr,removeAllListeners:Gr,emit:Hr,binding:Kr,cwd:Wr,chdir:Vr,umask:Xr,hrtime:zr,platform:Dr,release:vr,config:Ur,uptime:Jr},J={};Object.keys(J).forEach(t=>{let r=t.split("."),e=s;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=J[t]:e=e[o]||(e[o]={})}});var A=[],b=[],$r=typeof Uint8Array<"u"?Uint8Array:Array,V=!1;function ir(){V=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],b[t.charCodeAt(r)]=r;b[45]=62,b[95]=63}function Zr(t){V||ir();var r,e,n,o,a,p,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,p=new $r(c*3/4-a),n=a>0?c-4:c;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)o=b[t.charCodeAt(r)]<<18|b[t.charCodeAt(r+1)]<<12|b[t.charCodeAt(r+2)]<<6|b[t.charCodeAt(r+3)],p[u++]=o>>16&255,p[u++]=o>>8&255,p[u++]=o&255;return a===2?(o=b[t.charCodeAt(r)]<<2|b[t.charCodeAt(r+1)]>>4,p[u++]=o&255):a===1&&(o=b[t.charCodeAt(r)]<<10|b[t.charCodeAt(r+1)]<<4|b[t.charCodeAt(r+2)]>>2,p[u++]=o>>8&255,p[u++]=o&255),p}function jr(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function re(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(jr(n));return o.join("")}function tr(t){V||ir();for(var r,e=t.length,n=e%3,o="",a=[],p=16383,c=0,u=e-n;c<u;c+=p)a.push(re(t,c,c+p>u?u:c+p));return n===1?(r=t[e-1],o+=A[r>>2],o+=A[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=A[r>>10],o+=A[r>>4&63],o+=A[r<<2&63],o+="="),a.push(o),a.join("")}i.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function k(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function I(t,r){if(k()<r)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=i.prototype):(t===null&&(t=new i(r)),t.length=r),t}function i(t,r,e){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return X(this,t)}return ar(this,t,r,e)}i.poolSize=8192;i._augment=function(t){return t.__proto__=i.prototype,t};function ar(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?ne(t,r,e,n):typeof r=="string"?te(t,r,e):oe(t,r)}i.from=function(t,r,e){return ar(null,t,r,e)};i.kMaxLength=k();i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]);function pr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ee(t,r,e,n){return pr(r),r<=0?I(t,r):e!==void 0?typeof n=="string"?I(t,r).fill(e,n):I(t,r).fill(e):I(t,r)}i.alloc=function(t,r,e){return ee(null,t,r,e)};function X(t,r){if(pr(r),t=I(t,r<0?0:q(r)|0),!i.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}i.allocUnsafe=function(t){return X(null,t)};i.allocUnsafeSlow=function(t){return X(null,t)};function te(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=sr(r,e)|0;t=I(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function W(t,r){var e=r.length<0?0:q(r.length)|0;t=I(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function ne(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),i.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=i.prototype):t=W(t,r),t}function oe(t,r){if(R(r)){var e=q(r.length)|0;return t=I(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ie(r.length)?I(t,0):W(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return W(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function q(t){if(t>=k())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k().toString(16)+" bytes");return t|0}i.isBuffer=xe;function R(t){return!!(t!=null&&t._isBuffer)}i.compare=function(r,e){if(!R(r)||!R(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,p=Math.min(n,o);a<p;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};i.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};i.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return i.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=i.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var p=r[n];if(!R(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(o,a),a+=p.length}return o};function sr(t,r){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return mr(t).length;default:if(n)return B(t).length;r=(""+r).toLowerCase(),n=!0}}i.byteLength=sr;function ie(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return me(this,r,e);case"utf8":case"utf-8":return Er(this,r,e);case"ascii":return _e(this,r,e);case"latin1":case"binary":return he(this,r,e);case"base64":return Ee(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Te(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function D(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}i.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)D(this,e,e+1);return this};i.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)D(this,e,e+3),D(this,e+1,e+2);return this};i.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};i.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Er(this,0,r):ie.apply(this,arguments)};i.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:i.compare(this,r)===0};i.prototype.compare=function(r,e,n,o,a){if(!R(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var p=a-o,c=n-e,u=Math.min(p,c),l=this.slice(o,a),_=r.slice(e,n),E=0;E<u;++E)if(l[E]!==_[E]){p=l[E],c=_[E];break}return p<c?-1:c<p?1:0};function cr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=i.from(r,n)),R(r))return r.length===0?-1:nr(t,r,e,n,o);if(typeof r=="number")return r=r&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):nr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function nr(t,r,e,n,o){var a=1,p=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,p/=2,c/=2,e/=2}function u(f,y){return a===1?f[y]:f.readUInt16BE(y*a)}var l;if(o){var _=-1;for(l=e;l<p;l++)if(u(t,l)===u(r,_===-1?0:l-_)){if(_===-1&&(_=l),l-_+1===c)return _*a}else _!==-1&&(l-=l-_),_=-1}else for(e+c>p&&(e=p-c),l=e;l>=0;l--){for(var E=!0,d=0;d<c;d++)if(u(t,l+d)!==u(r,d)){E=!1;break}if(E)return l}return-1}i.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};i.prototype.indexOf=function(r,e,n){return cr(this,r,e,n,!0)};i.prototype.lastIndexOf=function(r,e,n){return cr(this,r,e,n,!1)};function ae(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var p=0;p<n;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;t[e+p]=c}return p}function pe(t,r,e,n){return G(B(r,t.length-e),t,e,n)}function ur(t,r,e,n){return G(Re(r),t,e,n)}function se(t,r,e,n){return ur(t,r,e,n)}function ce(t,r,e,n){return G(mr(r),t,e,n)}function ue(t,r,e,n){return G(ge(r,t.length-e),t,e,n)}i.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var p=!1;;)switch(o){case"hex":return ae(this,r,e,n);case"utf8":case"utf-8":return pe(this,r,e,n);case"ascii":return ur(this,r,e,n);case"latin1":case"binary":return se(this,r,e,n);case"base64":return ce(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),p=!0}};i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ee(t,r,e){return r===0&&e===t.length?tr(t):tr(t.slice(r,e))}function Er(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],p=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var u,l,_,E;switch(c){case 1:a<128&&(p=a);break;case 2:u=t[o+1],(u&192)===128&&(E=(a&31)<<6|u&63,E>127&&(p=E));break;case 3:u=t[o+1],l=t[o+2],(u&192)===128&&(l&192)===128&&(E=(a&15)<<12|(u&63)<<6|l&63,E>2047&&(E<55296||E>57343)&&(p=E));break;case 4:u=t[o+1],l=t[o+2],_=t[o+3],(u&192)===128&&(l&192)===128&&(_&192)===128&&(E=(a&15)<<18|(u&63)<<12|(l&63)<<6|_&63,E>65535&&E<1114112&&(p=E))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),o+=c}return le(n)}var or=4096;function le(t){var r=t.length;if(r<=or)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=or));return e}function _e(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function he(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function me(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=Ae(t[a]);return o}function Te(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}i.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(i.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=i.prototype;else{var a=e-r;o=new i(a,void 0);for(var p=0;p<a;++p)o[p]=this[p+r]}return o};function h(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return o};i.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};i.prototype.readUInt8=function(r,e){return e||h(r,1,this.length),this[r]};i.prototype.readUInt16LE=function(r,e){return e||h(r,2,this.length),this[r]|this[r+1]<<8};i.prototype.readUInt16BE=function(r,e){return e||h(r,2,this.length),this[r]<<8|this[r+1]};i.prototype.readUInt32LE=function(r,e){return e||h(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};i.prototype.readUInt32BE=function(r,e){return e||h(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};i.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};i.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=e,a=1,p=this[r+--o];o>0&&(a*=256);)p+=this[r+--o]*a;return a*=128,p>=a&&(p-=Math.pow(2,8*e)),p};i.prototype.readInt8=function(r,e){return e||h(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};i.prototype.readInt16LE=function(r,e){e||h(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};i.prototype.readInt16BE=function(r,e){e||h(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};i.prototype.readInt32LE=function(r,e){return e||h(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};i.prototype.readInt32BE=function(r,e){return e||h(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};i.prototype.readFloatLE=function(r,e){return e||h(r,4,this.length),H(this,r,!0,23,4)};i.prototype.readFloatBE=function(r,e){return e||h(r,4,this.length),H(this,r,!1,23,4)};i.prototype.readDoubleLE=function(r,e){return e||h(r,8,this.length),H(this,r,!0,52,8)};i.prototype.readDoubleBE=function(r,e){return e||h(r,8,this.length),H(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=1,c=0;for(this[e]=r&255;++c<n&&(p*=256);)this[e+c]=r/p&255;return e+n};i.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=n-1,c=1;for(this[e+p]=r&255;--p>=0&&(c*=256);)this[e+p]=r/c&255;return e+n};i.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function F(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}i.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};i.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};function Y(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}i.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Y(this,r,e,!0),e+4};i.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Y(this,r,e,!1),e+4};i.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=0,c=1,u=0;for(this[e]=r&255;++p<n&&(c*=256);)r<0&&u===0&&this[e+p-1]!==0&&(u=1),this[e+p]=(r/c>>0)-u&255;return e+n};i.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=n-1,c=1,u=0;for(this[e+p]=r&255;--p>=0&&(c*=256);)r<0&&u===0&&this[e+p+1]!==0&&(u=1),this[e+p]=(r/c>>0)-u&255;return e+n};i.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};i.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};i.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};i.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Y(this,r,e,!0),e+4};i.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Y(this,r,e,!1),e+4};function lr(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function _r(t,r,e,n,o){return o||lr(t,r,e,4,34028234663852886e22,-34028234663852886e22),fr(t,r,e,n,23,4),e+4}i.prototype.writeFloatLE=function(r,e,n){return _r(this,r,e,!0,n)};i.prototype.writeFloatBE=function(r,e,n){return _r(this,r,e,!1,n)};function hr(t,r,e,n,o){return o||lr(t,r,e,8,17976931348623157e292,-17976931348623157e292),fr(t,r,e,n,52,8),e+8}i.prototype.writeDoubleLE=function(r,e,n){return hr(this,r,e,!0,n)};i.prototype.writeDoubleBE=function(r,e,n){return hr(this,r,e,!1,n)};i.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,p;if(this===r&&n<e&&e<o)for(p=a-1;p>=0;--p)r[p+e]=this[p+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(p=0;p<a;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};i.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!i.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var c=R(r)?r:B(new i(r,o).toString()),u=c.length;for(p=0;p<n-e;++p)this[p+e]=c[p%u]}return this};var fe=/[^+\/0-9A-Za-z-_]/g;function be(t){if(t=de(t).replace(fe,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function de(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ae(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(p+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function Re(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ge(t,r){for(var e,n,o,a=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function mr(t){return Zr(be(t))}function G(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Ie(t){return t!==t}function xe(t){return t!=null&&(!!t._isBuffer||Tr(t)||Ne(t))}function Tr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ne(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Tr(t.slice(0,0))}function H(t,r,e,n,o){var a,p,c=o*8-n-1,u=(1<<c)-1,l=u>>1,_=-7,E=e?o-1:0,d=e?-1:1,f=t[r+E];for(E+=d,a=f&(1<<-_)-1,f>>=-_,_+=c;_>0;a=a*256+t[r+E],E+=d,_-=8);for(p=a&(1<<-_)-1,a>>=-_,_+=n;_>0;p=p*256+t[r+E],E+=d,_-=8);if(a===0)a=1-l;else{if(a===u)return p?NaN:(f?-1:1)*(1/0);p=p+Math.pow(2,n),a=a-l}return(f?-1:1)*p*Math.pow(2,a-n)}function fr(t,r,e,n,o,a){var p,c,u,l=a*8-o-1,_=(1<<l)-1,E=_>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,y=n?1:-1,Ir=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=_):(p=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-p))<1&&(p--,u*=2),p+E>=1?r+=d/u:r+=d*Math.pow(2,1-E),r*u>=2&&(p++,u/=2),p+E>=_?(c=0,p=_):p+E>=1?(c=(r*u-1)*Math.pow(2,o),p=p+E):(c=r*Math.pow(2,E-1)*Math.pow(2,o),p=0));o>=8;t[e+f]=c&255,f+=y,c/=256,o-=8);for(p=p<<o|c,l+=o;l>0;t[e+f]=p&255,f+=y,p/=256,l-=8);t[e+f-y]|=Ir*128}import z from"bignumber.js";z.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function Q(t,r){return U(t,r,"*")}function K(t,r){return!!U(t,r,">=")}function L(t,r){return!!U(t,r,">")}function w(t,r){return!!U(t,r,"==")}function Oe(t,r){return U(t,r,"mod")}function v(t,r){return w(Oe(t,r),0)}function U(t,r,e){switch(t=new z(String(t)),r=new z(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var br=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();var ht={SMALLESTUNIT:s.env.SMALLEST_UNIT},mt={SMALLEST_UNITS:s.env.SMALLEST_UNIT};var dt=`{"theme1":{"value":"${s.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${s.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${s.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Nt=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var Pt=s.env.REACT_APP_API_URL,St=s.env.REACT_APP_SOCKET_URL,vt=s.env.REACT_APP_ALGO_SERVER,Ut=s.env.REACT_APP_ALGO_SERVER_PORT||"",Mt=s.env.REACT_APP_ALGOD_TOKEN||"",kt=s.env.REACT_APP_DISPENSER_LINK,Bt=s.env.REACT_APP_FRONTEND_LINK||"",Ft=s.env.REACT_APP_ALGO_EXPLORER_LINK,Yt=s.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,Gt=(s.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Ht=s.env.REACT_APP_USERBACK_ACCESS_TOKEN,Kt=(s.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Wt=.001*10**6,Vt=.002*10**6;var Xt=s.env.REACT_APP_MASTER_APP_ID||"406",qt=s.env.REACT_APP_AGG_APP_ID||"408",zt=Number(s.env.REACT_APP_CODEX_APP_ID||"467960617");var Ce=s.env.REACT_APP_ALGO_NETWORK||"";var Qt=Ce.toLowerCase()==="mainnet"?"mainnet":"testnet";var dr=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(dr||{}),Ar=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(Ar||{}),no={...dr,...Ar};var Ni={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"};var Vi=(t,r)=>{gr("base",{address:String(t.baseTokenAddress),chainId:t.baseTokenChainId},r.baseAsset),gr("price",{address:String(t.priceTokenAddress),chainId:t.priceTokenChainId},r.priceAsset),we(t,r)},gr=(t,r,e)=>{m(Number(r.chainId)===Number(e.chainId),`Invalid ${t}TokenChainId, must be ${e.chainId}`),m(e.chainId===1&&String(r.address)===String(e.address)||e.chainId===8&&Number(r.address)===Number(e.address)||br(r.address,e.address),`Invalid ${t}TokenAddress, must be ${e.address}`)},Xi=t=>{m(t.expiredTime>=Math.floor(Date.now()/1e3)+3600,"Expiration time shorter than 1 hour")},we=(t,r)=>{if(m(w(1,t.version),`Invalid order message version. Current is ${1}`),m(w(t.decimalPrice,0)||w(Q(t.decimalPrice,10**18),t.price),"Invalid price or decimalPrice"),m(!isNaN(t.random),"Invalid random, must be a number"),m(t.random>0,"Invalid random, must be greater than 0"),m(t.random<=Number.MAX_SAFE_INTEGER,"Invalid random, must no more than 2^53-1"),m(t.expiredTime>=Math.floor(Date.now()/1e3),"Invalid expiration time"),m(["B","S"].includes(t.orderSide),"Invalid order side"),m(["L","P","I","M"].includes(t.orderType),"Invalid order type"),t.orderType==="M"&&t.orderSide==="S")m(w(t.price,0)&&L(t.amount,0),"Invalid market order amount or price"),m(v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size),"Invalid market order amount");else{if(t.orderType==="M"&&t.orderSide==="B"&&w(t.amount,0))throw new Error("Buy murket order by total is not implemented yet");t.orderType==="M"&&t.orderSide==="B"&&L(t.amount,0)?m(L(t.price,0)&&v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size),"Invalid buy market order by amount"):(m(L(t.price,0)&&L(t.amount,0),"Invalid order amount or price is zero"),m(v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size)&&v(t.price,r.min_price_increment),"Invalid order amount or price"))}},m=(t,r)=>{if(!t)throw new Error(r)};export{we as assertOrder,Vi as assertOrderData,Xi as assertOrderExpirationAtCreationMoment};
2
2
  /*! Bundled license information:
3
3
 
4
4
  @esbuild-plugins/node-globals-polyfill/Buffer.js:
@@ -1,4 +1,4 @@
1
- function X(){throw new Error("setTimeout has not been defined")}function Q(){throw new Error("clearTimeout has not been defined")}var x=X,I=Q;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(I=clearTimeout);function q(t){if(x===setTimeout)return setTimeout(t,0);if((x===X||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function Tr(t){if(I===clearTimeout)return clearTimeout(t);if((I===Q||!I)&&clearTimeout)return I=clearTimeout,clearTimeout(t);try{return I(t)}catch{try{return I.call(null,t)}catch{return I.call(this,t)}}}var A=[],P=!1,w,D=-1;function gr(){!P||!w||(P=!1,w.length?A=w.concat(A):D=-1,A.length&&$())}function $(){if(!P){var t=q(gr);P=!0;for(var r=A.length;r;){for(w=A,A=[];++D<r;)w&&w[D].run();D=-1,r=A.length}w=null,P=!1,Tr(t)}}function br(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];A.push(new J(t,r)),A.length===1&&!P&&q($)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var mr="browser",dr="browser",Ar=!0,Rr={},xr=[],Ir="",wr={},Sr={},Nr={};function S(){}var Or=S,yr=S,Pr=S,Dr=S,Lr=S,Cr=S,vr=S;function Ur(t){throw new Error("process.binding is not supported")}function Mr(){return"/"}function Br(t){throw new Error("process.chdir is not supported")}function kr(){return 0}var y=globalThis.performance||{},Yr=y.now||y.mozNow||y.msNow||y.oNow||y.webkitNow||function(){return new Date().getTime()};function Fr(t){var r=Yr.call(y)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Gr=new Date;function Kr(){var t=new Date,r=t-Gr;return r/1e3}var E={nextTick:br,title:mr,browser:Ar,env:Rr,argv:xr,version:Ir,versions:wr,on:Or,addListener:yr,once:Pr,off:Dr,removeListener:Lr,removeAllListeners:Cr,emit:vr,binding:Ur,cwd:Mr,chdir:Br,umask:kr,hrtime:Fr,platform:dr,release:Sr,config:Nr,uptime:Kr},V={};Object.keys(V).forEach(t=>{let r=t.split("."),e=E;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=V[t]:e=e[i]||(e[i]={})}});var m=[],g=[],Hr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function rr(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)m[r]=t[r],g[t.charCodeAt(r)]=r;g[45]=62,g[95]=63}function Wr(t){Y||rr();var r,e,n,i,o,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Hr(c*3/4-o),n=o>0?c-4:c;var s=0;for(r=0,e=0;r<n;r+=4,e+=3)i=g[t.charCodeAt(r)]<<18|g[t.charCodeAt(r+1)]<<12|g[t.charCodeAt(r+2)]<<6|g[t.charCodeAt(r+3)],a[s++]=i>>16&255,a[s++]=i>>8&255,a[s++]=i&255;return o===2?(i=g[t.charCodeAt(r)]<<2|g[t.charCodeAt(r+1)]>>4,a[s++]=i&255):o===1&&(i=g[t.charCodeAt(r)]<<10|g[t.charCodeAt(r+1)]<<4|g[t.charCodeAt(r+2)]>>2,a[s++]=i>>8&255,a[s++]=i&255),a}function Vr(t){return m[t>>18&63]+m[t>>12&63]+m[t>>6&63]+m[t&63]}function Xr(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Vr(n));return i.join("")}function Z(t){Y||rr();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,c=0,s=e-n;c<s;c+=a)o.push(Xr(t,c,c+a>s?s:c+a));return n===1?(r=t[e-1],i+=m[r>>2],i+=m[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=m[r>>10],i+=m[r>>4&63],i+=m[r<<2&63],i+="="),o.push(i),o.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function L(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(t,r){if(L()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return F(this,t)}return er(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function er(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?$r(t,r,e,n):typeof r=="string"?qr(t,r,e):Jr(t,r)}u.from=function(t,r,e){return er(null,t,r,e)};u.kMaxLength=L();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function tr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Qr(t,r,e,n){return tr(r),r<=0?R(t,r):e!==void 0?typeof n=="string"?R(t,r).fill(e,n):R(t,r).fill(e):R(t,r)}u.alloc=function(t,r,e){return Qr(null,t,r,e)};function F(t,r){if(tr(r),t=R(t,r<0?0:G(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return F(null,t)};u.allocUnsafeSlow=function(t){return F(null,t)};function qr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=nr(r,e)|0;t=R(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function k(t,r){var e=r.length<0?0:G(r.length)|0;t=R(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function $r(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=k(t,r),t}function Jr(t,r){if(d(r)){var e=G(r.length)|0;return t=R(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||he(r.length)?R(t,0):k(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return k(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=L())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+L().toString(16)+" bytes");return t|0}u.isBuffer=Te;function d(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!d(r)||!d(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};u.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=u.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!d(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function nr(t,r){if(d(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return C(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return lr(t).length;default:if(n)return C(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=nr;function Zr(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return ue(this,r,e);case"utf8":case"utf-8":return ar(this,r,e);case"ascii":return oe(this,r,e);case"latin1":case"binary":return ae(this,r,e);case"base64":return ne(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function N(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)N(this,e,e+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)N(this,e,e+3),N(this,e+1,e+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)N(this,e,e+7),N(this,e+1,e+6),N(this,e+2,e+5),N(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ar(this,0,r):Zr.apply(this,arguments)};u.prototype.equals=function(r){if(!d(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,o){if(!d(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,c=n-e,s=Math.min(a,c),f=this.slice(i,o),p=r.slice(e,n),l=0;l<s;++l)if(f[l]!==p[l]){a=f[l],c=p[l];break}return a<c?-1:c<a?1:0};function ir(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),d(r))return r.length===0?-1:z(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):z(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function z(t,r,e,n,i){var o=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,a/=2,c/=2,e/=2}function s(T,O){return o===1?T[O]:T.readUInt16BE(O*o)}var f;if(i){var p=-1;for(f=e;f<a;f++)if(s(t,f)===s(r,p===-1?0:f-p)){if(p===-1&&(p=f),f-p+1===c)return p*o}else p!==-1&&(f-=f-p),p=-1}else for(e+c>a&&(e=a-c),f=e;f>=0;f--){for(var l=!0,b=0;b<c;b++)if(s(t,f+b)!==s(r,b)){l=!1;break}if(l)return f}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return ir(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return ir(this,r,e,n,!1)};function zr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function jr(t,r,e,n){return M(C(r,t.length-e),t,e,n)}function or(t,r,e,n){return M(pe(r),t,e,n)}function re(t,r,e,n){return or(t,r,e,n)}function ee(t,r,e,n){return M(lr(r),t,e,n)}function te(t,r,e,n){return M(_e(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return zr(this,r,e,n);case"utf8":case"utf-8":return jr(this,r,e,n);case"ascii":return or(this,r,e,n);case"latin1":case"binary":return re(this,r,e,n);case"base64":return ee(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(t,r,e){return r===0&&e===t.length?Z(t):Z(t.slice(r,e))}function ar(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=e){var s,f,p,l;switch(c){case 1:o<128&&(a=o);break;case 2:s=t[i+1],(s&192)===128&&(l=(o&31)<<6|s&63,l>127&&(a=l));break;case 3:s=t[i+1],f=t[i+2],(s&192)===128&&(f&192)===128&&(l=(o&15)<<12|(s&63)<<6|f&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:s=t[i+1],f=t[i+2],p=t[i+3],(s&192)===128&&(f&192)===128&&(p&192)===128&&(l=(o&15)<<18|(s&63)<<12|(f&63)<<6|p&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=c}return ie(n)}var j=4096;function ie(t){var r=t.length;if(r<=j)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=j));return e}function oe(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function ae(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function ue(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=fe(t[o]);return i}function ce(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var o=e-r;i=new u(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function _(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUInt8=function(r,e){return e||_(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||_(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||_(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||_(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||_(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||_(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||_(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||_(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||_(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||_(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||_(r,4,this.length),B(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||_(r,4,this.length),B(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||_(r,8,this.length),B(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||_(r,8,this.length),B(this,r,!1,52,8)};function h(t,r,e,n,i,o){if(!d(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;h(this,r,e,n,o,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;h(this,r,e,n,o,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function v(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};function U(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):U(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):U(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);h(this,r,e,n,o-1,-o)}var a=0,c=1,s=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&s===0&&this[e+a-1]!==0&&(s=1),this[e+a]=(r/c>>0)-s&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);h(this,r,e,n,o-1,-o)}var a=n-1,c=1,s=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&s===0&&this[e+a+1]!==0&&(s=1),this[e+a]=(r/c>>0)-s&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):U(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):U(this,r,e,!1),e+4};function ur(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function cr(t,r,e,n,i){return i||ur(t,r,e,4,34028234663852886e22,-34028234663852886e22),fr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return cr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return cr(this,r,e,!1,n)};function sr(t,r,e,n,i){return i||ur(t,r,e,8,17976931348623157e292,-17976931348623157e292),fr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return sr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return sr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=d(r)?r:C(new u(r,i).toString()),s=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%s]}return this};var se=/[^+\/0-9A-Za-z-_]/g;function le(t){if(t=Ee(t).replace(se,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ee(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function fe(t){return t<16?"0"+t.toString(16):t.toString(16)}function C(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function pe(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function _e(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function lr(t){return Wr(le(t))}function M(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function he(t){return t!==t}function Te(t){return t!=null&&(!!t._isBuffer||Er(t)||ge(t))}function Er(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function ge(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Er(t.slice(0,0))}function B(t,r,e,n,i){var o,a,c=i*8-n-1,s=(1<<c)-1,f=s>>1,p=-7,l=e?i-1:0,b=e?-1:1,T=t[r+l];for(l+=b,o=T&(1<<-p)-1,T>>=-p,p+=c;p>0;o=o*256+t[r+l],l+=b,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=a*256+t[r+l],l+=b,p-=8);if(o===0)o=1-f;else{if(o===s)return a?NaN:(T?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(T?-1:1)*a*Math.pow(2,o-n)}function fr(t,r,e,n,i,o){var a,c,s,f=o*8-i-1,p=(1<<f)-1,l=p>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=n?0:o-1,O=n?1:-1,hr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=p):(a=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-a))<1&&(a--,s*=2),a+l>=1?r+=b/s:r+=b*Math.pow(2,1-l),r*s>=2&&(a++,s/=2),a+l>=p?(c=0,a=p):a+l>=1?(c=(r*s-1)*Math.pow(2,i),a=a+l):(c=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+T]=c&255,T+=O,c/=256,i-=8);for(a=a<<i|c,f+=i;f>0;t[e+T]=a&255,T+=O,a/=256,f-=8);t[e+T-O]|=hr*128}import K from"bignumber.js";K.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function pr(t,r){return _r(t,r,"*")}function H(t,r){return _r(t,r,"/")}function _r(t,r,e){switch(t=new K(String(t)),r=new K(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var Fe={SMALLESTUNIT:E.env.SMALLEST_UNIT},Ge={SMALLEST_UNITS:E.env.SMALLEST_UNIT};var Ve=`{"theme1":{"value":"${E.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${E.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${E.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Ze=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var it=E.env.REACT_APP_API_URL,ot=E.env.REACT_APP_SOCKET_URL,at=E.env.REACT_APP_ALGO_SERVER,ut=E.env.REACT_APP_ALGO_SERVER_PORT||"",ct=E.env.REACT_APP_ALGOD_TOKEN||"",st=E.env.REACT_APP_DISPENSER_LINK,lt=E.env.REACT_APP_FRONTEND_LINK||"",Et=E.env.REACT_APP_ALGO_EXPLORER_LINK,ft=E.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,pt=(E.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",_t=E.env.REACT_APP_USERBACK_ACCESS_TOKEN,ht=(E.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Tt=.001*10**6,gt=.002*10**6;var bt=E.env.REACT_APP_MASTER_APP_ID||"406",mt=E.env.REACT_APP_AGG_APP_ID||"408",be=Number(E.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",be);var me=E.env.REACT_APP_ALGO_NETWORK||"";var dt=me.toLowerCase()==="mainnet"?"mainnet":"testnet";var Mt=t=>pr(t,10**18),Bt=(t,r)=>H(t,10**(18-r)),de=(t,r)=>H(t,10**r),kt=t=>de(t,18);export{Bt as defactorPrice,Mt as factorPrice,de as toDecimal,kt as toDecimalPrice};
1
+ function X(){throw new Error("setTimeout has not been defined")}function q(){throw new Error("clearTimeout has not been defined")}var I=X,x=q;typeof globalThis.setTimeout=="function"&&(I=setTimeout);typeof globalThis.clearTimeout=="function"&&(x=clearTimeout);function Q(t){if(I===setTimeout)return setTimeout(t,0);if((I===X||!I)&&setTimeout)return I=setTimeout,setTimeout(t,0);try{return I(t,0)}catch{try{return I.call(null,t,0)}catch{return I.call(this,t,0)}}}function br(t){if(x===clearTimeout)return clearTimeout(t);if((x===q||!x)&&clearTimeout)return x=clearTimeout,clearTimeout(t);try{return x(t)}catch{try{return x.call(null,t)}catch{return x.call(this,t)}}}var d=[],w=!1,N,P=-1;function Ar(){!w||!N||(w=!1,N.length?d=N.concat(d):P=-1,d.length&&z())}function z(){if(!w){var t=Q(Ar);w=!0;for(var r=d.length;r;){for(N=d,d=[];++P<r;)N&&N[P].run();P=-1,r=d.length}N=null,w=!1,br(t)}}function Rr(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];d.push(new J(t,r)),d.length===1&&!w&&Q(z)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var dr="browser",gr="browser",Ir=!0,xr={},Nr=[],Or="",Dr={},Cr={},Lr={};function O(){}var wr=O,Pr=O,yr=O,Sr=O,vr=O,Ur=O,Mr=O;function kr(t){throw new Error("process.binding is not supported")}function Br(){return"/"}function Fr(t){throw new Error("process.chdir is not supported")}function Yr(){return 0}var L=globalThis.performance||{},Gr=L.now||L.mozNow||L.msNow||L.oNow||L.webkitNow||function(){return new Date().getTime()};function Hr(t){var r=Gr.call(L)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Kr=new Date;function Wr(){var t=new Date,r=t-Kr;return r/1e3}var c={nextTick:Rr,title:dr,browser:Ir,env:xr,argv:Nr,version:Or,versions:Dr,on:wr,addListener:Pr,once:yr,off:Sr,removeListener:vr,removeAllListeners:Ur,emit:Mr,binding:kr,cwd:Br,chdir:Fr,umask:Yr,hrtime:Hr,platform:gr,release:Cr,config:Lr,uptime:Wr},V={};Object.keys(V).forEach(t=>{let r=t.split("."),e=c;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=V[t]:e=e[o]||(e[o]={})}});var A=[],f=[],Vr=typeof Uint8Array<"u"?Uint8Array:Array,F=!1;function rr(){F=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],f[t.charCodeAt(r)]=r;f[45]=62,f[95]=63}function Xr(t){F||rr();var r,e,n,o,a,p,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[s-2]==="="?2:t[s-1]==="="?1:0,p=new Vr(s*3/4-a),n=a>0?s-4:s;var E=0;for(r=0,e=0;r<n;r+=4,e+=3)o=f[t.charCodeAt(r)]<<18|f[t.charCodeAt(r+1)]<<12|f[t.charCodeAt(r+2)]<<6|f[t.charCodeAt(r+3)],p[E++]=o>>16&255,p[E++]=o>>8&255,p[E++]=o&255;return a===2?(o=f[t.charCodeAt(r)]<<2|f[t.charCodeAt(r+1)]>>4,p[E++]=o&255):a===1&&(o=f[t.charCodeAt(r)]<<10|f[t.charCodeAt(r+1)]<<4|f[t.charCodeAt(r+2)]>>2,p[E++]=o>>8&255,p[E++]=o&255),p}function qr(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function Qr(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(qr(n));return o.join("")}function $(t){F||rr();for(var r,e=t.length,n=e%3,o="",a=[],p=16383,s=0,E=e-n;s<E;s+=p)a.push(Qr(t,s,s+p>E?E:s+p));return n===1?(r=t[e-1],o+=A[r>>2],o+=A[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=A[r>>10],o+=A[r>>4&63],o+=A[r<<2&63],o+="="),a.push(o),a.join("")}i.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function y(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(t,r){if(y()<r)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=i.prototype):(t===null&&(t=new i(r)),t.length=r),t}function i(t,r,e){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return Y(this,t)}return er(this,t,r,e)}i.poolSize=8192;i._augment=function(t){return t.__proto__=i.prototype,t};function er(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?$r(t,r,e,n):typeof r=="string"?Jr(t,r,e):Zr(t,r)}i.from=function(t,r,e){return er(null,t,r,e)};i.kMaxLength=y();i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]);function tr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function zr(t,r,e,n){return tr(r),r<=0?g(t,r):e!==void 0?typeof n=="string"?g(t,r).fill(e,n):g(t,r).fill(e):g(t,r)}i.alloc=function(t,r,e){return zr(null,t,r,e)};function Y(t,r){if(tr(r),t=g(t,r<0?0:G(r)|0),!i.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}i.allocUnsafe=function(t){return Y(null,t)};i.allocUnsafeSlow=function(t){return Y(null,t)};function Jr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=nr(r,e)|0;t=g(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function B(t,r){var e=r.length<0?0:G(r.length)|0;t=g(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function $r(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),i.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=i.prototype):t=B(t,r),t}function Zr(t,r){if(R(r)){var e=G(r.length)|0;return t=g(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||fe(r.length)?g(t,0):B(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return B(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y().toString(16)+" bytes");return t|0}i.isBuffer=be;function R(t){return!!(t!=null&&t._isBuffer)}i.compare=function(r,e){if(!R(r)||!R(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,p=Math.min(n,o);a<p;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};i.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};i.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return i.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=i.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var p=r[n];if(!R(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(o,a),a+=p.length}return o};function nr(t,r){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Er(t).length;default:if(n)return S(t).length;r=(""+r).toLowerCase(),n=!0}}i.byteLength=nr;function jr(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return se(this,r,e);case"utf8":case"utf-8":return ar(this,r,e);case"ascii":return pe(this,r,e);case"latin1":case"binary":return ce(this,r,e);case"base64":return ie(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ee(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function D(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}i.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)D(this,e,e+1);return this};i.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)D(this,e,e+3),D(this,e+1,e+2);return this};i.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};i.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ar(this,0,r):jr.apply(this,arguments)};i.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:i.compare(this,r)===0};i.prototype.compare=function(r,e,n,o,a){if(!R(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var p=a-o,s=n-e,E=Math.min(p,s),l=this.slice(o,a),_=r.slice(e,n),u=0;u<E;++u)if(l[u]!==_[u]){p=l[u],s=_[u];break}return p<s?-1:s<p?1:0};function or(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=i.from(r,n)),R(r))return r.length===0?-1:Z(t,r,e,n,o);if(typeof r=="number")return r=r&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Z(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Z(t,r,e,n,o){var a=1,p=t.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,p/=2,s/=2,e/=2}function E(m,C){return a===1?m[C]:m.readUInt16BE(C*a)}var l;if(o){var _=-1;for(l=e;l<p;l++)if(E(t,l)===E(r,_===-1?0:l-_)){if(_===-1&&(_=l),l-_+1===s)return _*a}else _!==-1&&(l-=l-_),_=-1}else for(e+s>p&&(e=p-s),l=e;l>=0;l--){for(var u=!0,b=0;b<s;b++)if(E(t,l+b)!==E(r,b)){u=!1;break}if(u)return l}return-1}i.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};i.prototype.indexOf=function(r,e,n){return or(this,r,e,n,!0)};i.prototype.lastIndexOf=function(r,e,n){return or(this,r,e,n,!1)};function re(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var p=0;p<n;++p){var s=parseInt(r.substr(p*2,2),16);if(isNaN(s))return p;t[e+p]=s}return p}function ee(t,r,e,n){return M(S(r,t.length-e),t,e,n)}function ir(t,r,e,n){return M(Te(r),t,e,n)}function te(t,r,e,n){return ir(t,r,e,n)}function ne(t,r,e,n){return M(Er(r),t,e,n)}function oe(t,r,e,n){return M(me(r,t.length-e),t,e,n)}i.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var p=!1;;)switch(o){case"hex":return re(this,r,e,n);case"utf8":case"utf-8":return ee(this,r,e,n);case"ascii":return ir(this,r,e,n);case"latin1":case"binary":return te(this,r,e,n);case"base64":return ne(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),p=!0}};i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ie(t,r,e){return r===0&&e===t.length?$(t):$(t.slice(r,e))}function ar(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],p=null,s=a>239?4:a>223?3:a>191?2:1;if(o+s<=e){var E,l,_,u;switch(s){case 1:a<128&&(p=a);break;case 2:E=t[o+1],(E&192)===128&&(u=(a&31)<<6|E&63,u>127&&(p=u));break;case 3:E=t[o+1],l=t[o+2],(E&192)===128&&(l&192)===128&&(u=(a&15)<<12|(E&63)<<6|l&63,u>2047&&(u<55296||u>57343)&&(p=u));break;case 4:E=t[o+1],l=t[o+2],_=t[o+3],(E&192)===128&&(l&192)===128&&(_&192)===128&&(u=(a&15)<<18|(E&63)<<12|(l&63)<<6|_&63,u>65535&&u<1114112&&(p=u))}}p===null?(p=65533,s=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),o+=s}return ae(n)}var j=4096;function ae(t){var r=t.length;if(r<=j)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=j));return e}function pe(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function ce(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function se(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=he(t[a]);return o}function Ee(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}i.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(i.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=i.prototype;else{var a=e-r;o=new i(a,void 0);for(var p=0;p<a;++p)o[p]=this[p+r]}return o};function h(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return o};i.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};i.prototype.readUInt8=function(r,e){return e||h(r,1,this.length),this[r]};i.prototype.readUInt16LE=function(r,e){return e||h(r,2,this.length),this[r]|this[r+1]<<8};i.prototype.readUInt16BE=function(r,e){return e||h(r,2,this.length),this[r]<<8|this[r+1]};i.prototype.readUInt32LE=function(r,e){return e||h(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};i.prototype.readUInt32BE=function(r,e){return e||h(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};i.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};i.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=e,a=1,p=this[r+--o];o>0&&(a*=256);)p+=this[r+--o]*a;return a*=128,p>=a&&(p-=Math.pow(2,8*e)),p};i.prototype.readInt8=function(r,e){return e||h(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};i.prototype.readInt16LE=function(r,e){e||h(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};i.prototype.readInt16BE=function(r,e){e||h(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};i.prototype.readInt32LE=function(r,e){return e||h(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};i.prototype.readInt32BE=function(r,e){return e||h(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};i.prototype.readFloatLE=function(r,e){return e||h(r,4,this.length),k(this,r,!0,23,4)};i.prototype.readFloatBE=function(r,e){return e||h(r,4,this.length),k(this,r,!1,23,4)};i.prototype.readDoubleLE=function(r,e){return e||h(r,8,this.length),k(this,r,!0,52,8)};i.prototype.readDoubleBE=function(r,e){return e||h(r,8,this.length),k(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=1,s=0;for(this[e]=r&255;++s<n&&(p*=256);)this[e+s]=r/p&255;return e+n};i.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=n-1,s=1;for(this[e+p]=r&255;--p>=0&&(s*=256);)this[e+p]=r/s&255;return e+n};i.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function v(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}i.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};i.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};function U(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}i.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):U(this,r,e,!0),e+4};i.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):U(this,r,e,!1),e+4};i.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=0,s=1,E=0;for(this[e]=r&255;++p<n&&(s*=256);)r<0&&E===0&&this[e+p-1]!==0&&(E=1),this[e+p]=(r/s>>0)-E&255;return e+n};i.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=n-1,s=1,E=0;for(this[e+p]=r&255;--p>=0&&(s*=256);)r<0&&E===0&&this[e+p+1]!==0&&(E=1),this[e+p]=(r/s>>0)-E&255;return e+n};i.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};i.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};i.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};i.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):U(this,r,e,!0),e+4};i.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):U(this,r,e,!1),e+4};function pr(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function cr(t,r,e,n,o){return o||pr(t,r,e,4,34028234663852886e22,-34028234663852886e22),lr(t,r,e,n,23,4),e+4}i.prototype.writeFloatLE=function(r,e,n){return cr(this,r,e,!0,n)};i.prototype.writeFloatBE=function(r,e,n){return cr(this,r,e,!1,n)};function sr(t,r,e,n,o){return o||pr(t,r,e,8,17976931348623157e292,-17976931348623157e292),lr(t,r,e,n,52,8),e+8}i.prototype.writeDoubleLE=function(r,e,n){return sr(this,r,e,!0,n)};i.prototype.writeDoubleBE=function(r,e,n){return sr(this,r,e,!1,n)};i.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,p;if(this===r&&n<e&&e<o)for(p=a-1;p>=0;--p)r[p+e]=this[p+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(p=0;p<a;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};i.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!i.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var s=R(r)?r:S(new i(r,o).toString()),E=s.length;for(p=0;p<n-e;++p)this[p+e]=s[p%E]}return this};var ue=/[^+\/0-9A-Za-z-_]/g;function le(t){if(t=_e(t).replace(ue,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function _e(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function he(t){return t<16?"0"+t.toString(16):t.toString(16)}function S(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(p+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function Te(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function me(t,r){for(var e,n,o,a=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function Er(t){return Xr(le(t))}function M(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function fe(t){return t!==t}function be(t){return t!=null&&(!!t._isBuffer||ur(t)||Ae(t))}function ur(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ae(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ur(t.slice(0,0))}function k(t,r,e,n,o){var a,p,s=o*8-n-1,E=(1<<s)-1,l=E>>1,_=-7,u=e?o-1:0,b=e?-1:1,m=t[r+u];for(u+=b,a=m&(1<<-_)-1,m>>=-_,_+=s;_>0;a=a*256+t[r+u],u+=b,_-=8);for(p=a&(1<<-_)-1,a>>=-_,_+=n;_>0;p=p*256+t[r+u],u+=b,_-=8);if(a===0)a=1-l;else{if(a===E)return p?NaN:(m?-1:1)*(1/0);p=p+Math.pow(2,n),a=a-l}return(m?-1:1)*p*Math.pow(2,a-n)}function lr(t,r,e,n,o,a){var p,s,E,l=a*8-o-1,_=(1<<l)-1,u=_>>1,b=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:a-1,C=n?1:-1,fr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,p=_):(p=Math.floor(Math.log(r)/Math.LN2),r*(E=Math.pow(2,-p))<1&&(p--,E*=2),p+u>=1?r+=b/E:r+=b*Math.pow(2,1-u),r*E>=2&&(p++,E/=2),p+u>=_?(s=0,p=_):p+u>=1?(s=(r*E-1)*Math.pow(2,o),p=p+u):(s=r*Math.pow(2,u-1)*Math.pow(2,o),p=0));o>=8;t[e+m]=s&255,m+=C,s/=256,o-=8);for(p=p<<o|s,l+=o;l>0;t[e+m]=p&255,m+=C,p/=256,l-=8);t[e+m-C]|=fr*128}import H from"bignumber.js";H.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function _r(t,r){return hr(t,r,"*")}function K(t,r){return hr(t,r,"/")}function hr(t,r,e){switch(t=new H(String(t)),r=new H(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var Ge={SMALLESTUNIT:c.env.SMALLEST_UNIT},He={SMALLEST_UNITS:c.env.SMALLEST_UNIT};var Xe=`{"theme1":{"value":"${c.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Ze=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var it=c.env.REACT_APP_API_URL,at=c.env.REACT_APP_SOCKET_URL,pt=c.env.REACT_APP_ALGO_SERVER,ct=c.env.REACT_APP_ALGO_SERVER_PORT||"",st=c.env.REACT_APP_ALGOD_TOKEN||"",Et=c.env.REACT_APP_DISPENSER_LINK,ut=c.env.REACT_APP_FRONTEND_LINK||"",lt=c.env.REACT_APP_ALGO_EXPLORER_LINK,_t=c.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,ht=(c.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Tt=c.env.REACT_APP_USERBACK_ACCESS_TOKEN,mt=(c.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var ft=.001*10**6,bt=.002*10**6;var At=c.env.REACT_APP_MASTER_APP_ID||"406",Rt=c.env.REACT_APP_AGG_APP_ID||"408",dt=Number(c.env.REACT_APP_CODEX_APP_ID||"467960617");var Re=c.env.REACT_APP_ALGO_NETWORK||"";var gt=Re.toLowerCase()==="mainnet"?"mainnet":"testnet";var Tr=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(Tr||{}),mr=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(mr||{}),wn={...Tr,...mr};var Zo={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"};var Ti=t=>_r(t,10**18),mi=(t,r)=>K(t,10**(18-r)),de=(t,r)=>K(t,10**r),fi=t=>de(t,18);export{mi as defactorPrice,Ti as factorPrice,de as toDecimal,fi as toDecimalPrice};
2
2
  /*! Bundled license information:
3
3
 
4
4
  @esbuild-plugins/node-globals-polyfill/Buffer.js:
@@ -1,4 +1,4 @@
1
- function _r(){throw new Error("setTimeout has not been defined")}function yr(){throw new Error("clearTimeout has not been defined")}var D=_r,P=yr;typeof globalThis.setTimeout=="function"&&(D=setTimeout);typeof globalThis.clearTimeout=="function"&&(P=clearTimeout);function Ir(t){if(D===setTimeout)return setTimeout(t,0);if((D===_r||!D)&&setTimeout)return D=setTimeout,setTimeout(t,0);try{return D(t,0)}catch{try{return D.call(null,t,0)}catch{return D.call(this,t,0)}}}function Ie(t){if(P===clearTimeout)return clearTimeout(t);if((P===yr||!P)&&clearTimeout)return P=clearTimeout,clearTimeout(t);try{return P(t)}catch{try{return P.call(null,t)}catch{return P.call(this,t)}}}var B=[],F=!1,k,H=-1;function Re(){!F||!k||(F=!1,k.length?B=k.concat(B):H=-1,B.length&&Rr())}function Rr(){if(!F){var t=Ir(Re);F=!0;for(var r=B.length;r;){for(k=B,B=[];++H<r;)k&&k[H].run();H=-1,r=B.length}k=null,F=!1,Ie(t)}}function we(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];B.push(new wr(t,r)),B.length===1&&!F&&Ir(Rr)}function wr(t,r){this.fun=t,this.array=r}wr.prototype.run=function(){this.fun.apply(null,this.array)};var Ne="browser",Se="browser",Be=!0,Ce={},Oe=[],De="",Pe={},ke={},Ue={};function U(){}var Le=U,Me=U,ve=U,Fe=U,Ye=U,Ge=U,Ke=U;function We(t){throw new Error("process.binding is not supported")}function He(){return"/"}function Ve(t){throw new Error("process.chdir is not supported")}function $e(){return 0}var v=globalThis.performance||{},Xe=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function ze(t){var r=Xe.call(v)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var qe=new Date;function Je(){var t=new Date,r=t-qe;return r/1e3}var l={nextTick:we,title:Ne,browser:Be,env:Ce,argv:Oe,version:De,versions:Pe,on:Le,addListener:Me,once:ve,off:Fe,removeListener:Ye,removeAllListeners:Ge,emit:Ke,binding:We,cwd:He,chdir:Ve,umask:$e,hrtime:ze,platform:Se,release:ke,config:Ue,uptime:Je},Tr={};Object.keys(Tr).forEach(t=>{let r=t.split("."),e=l;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=Tr[t]:e=e[o]||(e[o]={})}});var R=[],y=[],je=typeof Uint8Array<"u"?Uint8Array:Array,cr=!1;function Cr(){cr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],y[t.charCodeAt(r)]=r;y[45]=62,y[95]=63}function Qe(t){cr||Cr();var r,e,n,o,a,i,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,i=new je(c*3/4-a),n=a>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=y[t.charCodeAt(r)]<<18|y[t.charCodeAt(r+1)]<<12|y[t.charCodeAt(r+2)]<<6|y[t.charCodeAt(r+3)],i[p++]=o>>16&255,i[p++]=o>>8&255,i[p++]=o&255;return a===2?(o=y[t.charCodeAt(r)]<<2|y[t.charCodeAt(r+1)]>>4,i[p++]=o&255):a===1&&(o=y[t.charCodeAt(r)]<<10|y[t.charCodeAt(r+1)]<<4|y[t.charCodeAt(r+2)]>>2,i[p++]=o>>8&255,i[p++]=o&255),i}function Ze(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function rt(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(Ze(n));return o.join("")}function Nr(t){cr||Cr();for(var r,e=t.length,n=e%3,o="",a=[],i=16383,c=0,p=e-n;c<p;c+=i)a.push(rt(t,c,c+i>p?p:c+i));return n===1?(r=t[e-1],o+=R[r>>2],o+=R[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=R[r>>10],o+=R[r>>4&63],o+=R[r<<2&63],o+="="),a.push(o),a.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function V(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(t,r){if(V()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ur(this,t)}return Or(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Or(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?nt(t,r,e,n):typeof r=="string"?tt(t,r,e):ot(t,r)}s.from=function(t,r,e){return Or(null,t,r,e)};s.kMaxLength=V();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Dr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function et(t,r,e,n){return Dr(r),r<=0?C(t,r):e!==void 0?typeof n=="string"?C(t,r).fill(e,n):C(t,r).fill(e):C(t,r)}s.alloc=function(t,r,e){return et(null,t,r,e)};function ur(t,r){if(Dr(r),t=C(t,r<0?0:pr(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return ur(null,t)};s.allocUnsafeSlow=function(t){return ur(null,t)};function tt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Pr(r,e)|0;t=C(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function sr(t,r){var e=r.length<0?0:pr(r.length)|0;t=C(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function nt(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=sr(t,r),t}function ot(t,r){if(w(r)){var e=pr(r.length)|0;return t=C(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||yt(r.length)?C(t,0):sr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return sr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function pr(t){if(t>=V())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V().toString(16)+" bytes");return t|0}s.isBuffer=It;function w(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!w(r)||!w(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,i=Math.min(n,o);a<i;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};s.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=s.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var i=r[n];if(!w(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(o,a),a+=i.length}return o};function Pr(t,r){if(w(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Yr(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=Pr;function it(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return gt(this,r,e);case"utf8":case"utf-8":return Lr(this,r,e);case"ascii":return dt(this,r,e);case"latin1":case"binary":return ft(this,r,e);case"base64":return lt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ht(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function L(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)L(this,e,e+1);return this};s.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)L(this,e,e+3),L(this,e+1,e+2);return this};s.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)L(this,e,e+7),L(this,e+1,e+6),L(this,e+2,e+5),L(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Lr(this,0,r):it.apply(this,arguments)};s.prototype.equals=function(r){if(!w(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,o,a){if(!w(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var i=a-o,c=n-e,p=Math.min(i,c),f=this.slice(o,a),d=r.slice(e,n),m=0;m<p;++m)if(f[m]!==d[m]){i=f[m],c=d[m];break}return i<c?-1:c<i?1:0};function kr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),w(r))return r.length===0?-1:Sr(t,r,e,n,o);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Sr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Sr(t,r,e,n,o){var a=1,i=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,i/=2,c/=2,e/=2}function p(g,_){return a===1?g[_]:g.readUInt16BE(_*a)}var f;if(o){var d=-1;for(f=e;f<i;f++)if(p(t,f)===p(r,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*a}else d!==-1&&(f-=f-d),d=-1}else for(e+c>i&&(e=i-c),f=e;f>=0;f--){for(var m=!0,h=0;h<c;h++)if(p(t,f+h)!==p(r,h)){m=!1;break}if(m)return f}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return kr(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return kr(this,r,e,n,!1)};function at(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var c=parseInt(r.substr(i*2,2),16);if(isNaN(c))return i;t[e+i]=c}return i}function st(t,r,e,n){return q($(r,t.length-e),t,e,n)}function Ur(t,r,e,n){return q(Tt(r),t,e,n)}function ct(t,r,e,n){return Ur(t,r,e,n)}function ut(t,r,e,n){return q(Yr(r),t,e,n)}function pt(t,r,e,n){return q(_t(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var i=!1;;)switch(o){case"hex":return at(this,r,e,n);case"utf8":case"utf-8":return st(this,r,e,n);case"ascii":return Ur(this,r,e,n);case"latin1":case"binary":return ct(this,r,e,n);case"base64":return ut(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pt(this,r,e,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function lt(t,r,e){return r===0&&e===t.length?Nr(t):Nr(t.slice(r,e))}function Lr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],i=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var p,f,d,m;switch(c){case 1:a<128&&(i=a);break;case 2:p=t[o+1],(p&192)===128&&(m=(a&31)<<6|p&63,m>127&&(i=m));break;case 3:p=t[o+1],f=t[o+2],(p&192)===128&&(f&192)===128&&(m=(a&15)<<12|(p&63)<<6|f&63,m>2047&&(m<55296||m>57343)&&(i=m));break;case 4:p=t[o+1],f=t[o+2],d=t[o+3],(p&192)===128&&(f&192)===128&&(d&192)===128&&(m=(a&15)<<18|(p&63)<<12|(f&63)<<6|d&63,m>65535&&m<1114112&&(i=m))}}i===null?(i=65533,c=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),o+=c}return mt(n)}var Br=4096;function mt(t){var r=t.length;if(r<=Br)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Br));return e}function dt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function ft(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function gt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=At(t[a]);return o}function ht(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=s.prototype;else{var a=e-r;o=new s(a,void 0);for(var i=0;i<a;++i)o[i]=this[i+r]}return o};function x(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return o};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};s.prototype.readUInt8=function(r,e){return e||x(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||x(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||x(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||x(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||x(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=e,a=1,i=this[r+--o];o>0&&(a*=256);)i+=this[r+--o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};s.prototype.readInt8=function(r,e){return e||x(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||x(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||x(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||x(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||x(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||x(r,4,this.length),J(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||x(r,4,this.length),J(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||x(r,8,this.length),J(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||x(r,8,this.length),J(this,r,!1,52,8)};function A(t,r,e,n,o,a){if(!w(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;A(this,r,e,n,a,0)}var i=1,c=0;for(this[e]=r&255;++c<n&&(i*=256);)this[e+c]=r/i&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;A(this,r,e,n,a,0)}var i=n-1,c=1;for(this[e+i]=r&255;--i>=0&&(c*=256);)this[e+i]=r/c&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function X(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):X(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):X(this,r,e,!1),e+2};function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):z(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):z(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);A(this,r,e,n,a-1,-a)}var i=0,c=1,p=0;for(this[e]=r&255;++i<n&&(c*=256);)r<0&&p===0&&this[e+i-1]!==0&&(p=1),this[e+i]=(r/c>>0)-p&255;return e+n};s.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);A(this,r,e,n,a-1,-a)}var i=n-1,c=1,p=0;for(this[e+i]=r&255;--i>=0&&(c*=256);)r<0&&p===0&&this[e+i+1]!==0&&(p=1),this[e+i]=(r/c>>0)-p&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):X(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):X(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):z(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):z(this,r,e,!1),e+4};function Mr(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function vr(t,r,e,n,o){return o||Mr(t,r,e,4,34028234663852886e22,-34028234663852886e22),Kr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return vr(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return vr(this,r,e,!1,n)};function Fr(t,r,e,n,o){return o||Mr(t,r,e,8,17976931348623157e292,-17976931348623157e292),Kr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Fr(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Fr(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,i;if(this===r&&n<e&&e<o)for(i=a-1;i>=0;--i)r[i+e]=this[i+n];else if(a<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)r[i+e]=this[i+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};s.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var i;if(typeof r=="number")for(i=e;i<n;++i)this[i]=r;else{var c=w(r)?r:$(new s(r,o).toString()),p=c.length;for(i=0;i<n-e;++i)this[i+e]=c[i%p]}return this};var xt=/[^+\/0-9A-Za-z-_]/g;function Et(t){if(t=bt(t).replace(xt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function bt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function At(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],i=0;i<n;++i){if(e=t.charCodeAt(i),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(i+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function Tt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function _t(t,r){for(var e,n,o,a=[],i=0;i<t.length&&!((r-=2)<0);++i)e=t.charCodeAt(i),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function Yr(t){return Qe(Et(t))}function q(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function yt(t){return t!==t}function It(t){return t!=null&&(!!t._isBuffer||Gr(t)||Rt(t))}function Gr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Rt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Gr(t.slice(0,0))}function J(t,r,e,n,o){var a,i,c=o*8-n-1,p=(1<<c)-1,f=p>>1,d=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,a=g&(1<<-d)-1,g>>=-d,d+=c;d>0;a=a*256+t[r+m],m+=h,d-=8);for(i=a&(1<<-d)-1,a>>=-d,d+=n;d>0;i=i*256+t[r+m],m+=h,d-=8);if(a===0)a=1-f;else{if(a===p)return i?NaN:(g?-1:1)*(1/0);i=i+Math.pow(2,n),a=a-f}return(g?-1:1)*i*Math.pow(2,a-n)}function Kr(t,r,e,n,o,a){var i,c,p,f=a*8-o-1,d=(1<<f)-1,m=d>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,_=n?1:-1,ar=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,i=d):(i=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-i))<1&&(i--,p*=2),i+m>=1?r+=h/p:r+=h*Math.pow(2,1-m),r*p>=2&&(i++,p/=2),i+m>=d?(c=0,i=d):i+m>=1?(c=(r*p-1)*Math.pow(2,o),i=i+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),i=0));o>=8;t[e+g]=c&255,g+=_,c/=256,o-=8);for(i=i<<o|c,f+=o;f>0;t[e+g]=i&255,g+=_,i/=256,f-=8);t[e+g-_]|=ar*128}import lr from"bignumber.js";lr.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function mr(t,r){return Wr(t,r,"*")}function G(t,r){return Wr(t,r,"/")}function Wr(t,r,e){switch(t=new lr(String(t)),r=new lr(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var Hr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(Hr||{}),K=Hr;var Vr=(o=>(o[o.Limit=0]="Limit",o[o.IOC=1]="IOC",o[o.POST=2]="POST",o[o.Market=3]="Market",o))(Vr||{}),j=Vr;var $r=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))($r||{}),Xr=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(Xr||{}),Mo={...$r,...Xr};var dr={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var Ji={SMALLESTUNIT:l.env.SMALLEST_UNIT},ji={SMALLEST_UNITS:l.env.SMALLEST_UNIT};var ea=`{"theme1":{"value":"${l.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${l.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${l.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var aa=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var da=l.env.REACT_APP_API_URL,fa=l.env.REACT_APP_SOCKET_URL,ga=l.env.REACT_APP_ALGO_SERVER,ha=l.env.REACT_APP_ALGO_SERVER_PORT||"",xa=l.env.REACT_APP_ALGOD_TOKEN||"",Ea=l.env.REACT_APP_DISPENSER_LINK,ba=l.env.REACT_APP_FRONTEND_LINK||"",Aa=l.env.REACT_APP_ALGO_EXPLORER_LINK,Ta=l.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,_a=(l.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",ya=l.env.REACT_APP_USERBACK_ACCESS_TOKEN,Ia=(l.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Ra=.001*10**6,wa=.002*10**6;var Na=l.env.REACT_APP_MASTER_APP_ID||"406",Sa=l.env.REACT_APP_AGG_APP_ID||"408",Nt=Number(l.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",Nt);var St=l.env.REACT_APP_ALGO_NETWORK||"";var Ba=St.toLowerCase()==="mainnet"?"mainnet":"testnet";var fr=(t,r)=>G(t,10**(18-r)),zr=(t,r)=>G(t,10**r);import _e from"algosdk";import*as Tn from"bs58";import yc from"algosdk";import*as Ee from"bs58";import pn from"algosdk";import ts,{decodeAddress as ns,encodeAddress as os}from"algosdk";var N=[],I=[],Ct=typeof Uint8Array<"u"?Uint8Array:Array,hr=!1;function Qr(){hr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)N[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function Ot(t){hr||Qr();var r,e,n,o,a,i,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,i=new Ct(c*3/4-a),n=a>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],i[p++]=o>>16&255,i[p++]=o>>8&255,i[p++]=o&255;return a===2?(o=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,i[p++]=o&255):a===1&&(o=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,i[p++]=o>>8&255,i[p++]=o&255),i}function Dt(t){return N[t>>18&63]+N[t>>12&63]+N[t>>6&63]+N[t&63]}function Pt(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(Dt(n));return o.join("")}function qr(t){hr||Qr();for(var r,e=t.length,n=e%3,o="",a=[],i=16383,c=0,p=e-n;c<p;c+=i)a.push(Pt(t,c,c+i>p?p:c+i));return n===1?(r=t[e-1],o+=N[r>>2],o+=N[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=N[r>>10],o+=N[r>>4&63],o+=N[r<<2&63],o+="="),a.push(o),a.join("")}function rr(t,r,e,n,o){var a,i,c=o*8-n-1,p=(1<<c)-1,f=p>>1,d=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,a=g&(1<<-d)-1,g>>=-d,d+=c;d>0;a=a*256+t[r+m],m+=h,d-=8);for(i=a&(1<<-d)-1,a>>=-d,d+=n;d>0;i=i*256+t[r+m],m+=h,d-=8);if(a===0)a=1-f;else{if(a===p)return i?NaN:(g?-1:1)*(1/0);i=i+Math.pow(2,n),a=a-f}return(g?-1:1)*i*Math.pow(2,a-n)}function Zr(t,r,e,n,o,a){var i,c,p,f=a*8-o-1,d=(1<<f)-1,m=d>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,_=n?1:-1,ar=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,i=d):(i=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-i))<1&&(i--,p*=2),i+m>=1?r+=h/p:r+=h*Math.pow(2,1-m),r*p>=2&&(i++,p/=2),i+m>=d?(c=0,i=d):i+m>=1?(c=(r*p-1)*Math.pow(2,o),i=i+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),i=0));o>=8;t[e+g]=c&255,g+=_,c/=256,o-=8);for(i=i<<o|c,f+=o;f>0;t[e+g]=i&255,g+=_,i/=256,f-=8);t[e+g-_]|=ar*128}var kt={}.toString,re=Array.isArray||function(t){return kt.call(t)=="[object Array]"};var Ut=50;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var ja=Q();function Q(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function O(t,r){if(Q()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return xr(this,t)}return ee(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function ee(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?vt(t,r,e,n):typeof r=="string"?Mt(t,r,e):Ft(t,r)}u.from=function(t,r,e){return ee(null,t,r,e)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function te(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Lt(t,r,e,n){return te(r),r<=0?O(t,r):e!==void 0?typeof n=="string"?O(t,r).fill(e,n):O(t,r).fill(e):O(t,r)}u.alloc=function(t,r,e){return Lt(null,t,r,e)};function xr(t,r){if(te(r),t=O(t,r<0?0:Er(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return xr(null,t)};u.allocUnsafeSlow=function(t){return xr(null,t)};function Mt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=ne(r,e)|0;t=O(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function gr(t,r){var e=r.length<0?0:Er(r.length)|0;t=O(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function vt(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=gr(t,r),t}function Ft(t,r){if(S(r)){var e=Er(r.length)|0;return t=O(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||on(r.length)?O(t,0):gr(t,r);if(r.type==="Buffer"&&re(r.data))return gr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Er(t){if(t>=Q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q().toString(16)+" bytes");return t|0}u.isBuffer=an;function S(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,i=Math.min(n,o);a<i;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};u.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(r,e){if(!re(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=u.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var i=r[n];if(!S(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(o,a),a+=i.length}return o};function ne(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return pe(t).length;default:if(n)return Z(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=ne;function Yt(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Jt(this,r,e);case"utf8":case"utf-8":return ae(this,r,e);case"ascii":return zt(this,r,e);case"latin1":case"binary":return qt(this,r,e);case"base64":return $t(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)M(this,e,e+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ae(this,0,r):Yt.apply(this,arguments)};u.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",e=Ut;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};u.prototype.compare=function(r,e,n,o,a){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var i=a-o,c=n-e,p=Math.min(i,c),f=this.slice(o,a),d=r.slice(e,n),m=0;m<p;++m)if(f[m]!==d[m]){i=f[m],c=d[m];break}return i<c?-1:c<i?1:0};function oe(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),S(r))return r.length===0?-1:Jr(t,r,e,n,o);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Jr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Jr(t,r,e,n,o){var a=1,i=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,i/=2,c/=2,e/=2}function p(g,_){return a===1?g[_]:g.readUInt16BE(_*a)}var f;if(o){var d=-1;for(f=e;f<i;f++)if(p(t,f)===p(r,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*a}else d!==-1&&(f-=f-d),d=-1}else for(e+c>i&&(e=i-c),f=e;f>=0;f--){for(var m=!0,h=0;h<c;h++)if(p(t,f+h)!==p(r,h)){m=!1;break}if(m)return f}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return oe(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return oe(this,r,e,n,!1)};function Gt(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var c=parseInt(r.substr(i*2,2),16);if(isNaN(c))return i;t[e+i]=c}return i}function Kt(t,r,e,n){return nr(Z(r,t.length-e),t,e,n)}function ie(t,r,e,n){return nr(tn(r),t,e,n)}function Wt(t,r,e,n){return ie(t,r,e,n)}function Ht(t,r,e,n){return nr(pe(r),t,e,n)}function Vt(t,r,e,n){return nr(nn(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var i=!1;;)switch(o){case"hex":return Gt(this,r,e,n);case"utf8":case"utf-8":return Kt(this,r,e,n);case"ascii":return ie(this,r,e,n);case"latin1":case"binary":return Wt(this,r,e,n);case"base64":return Ht(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vt(this,r,e,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $t(t,r,e){return r===0&&e===t.length?qr(t):qr(t.slice(r,e))}function ae(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],i=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var p,f,d,m;switch(c){case 1:a<128&&(i=a);break;case 2:p=t[o+1],(p&192)===128&&(m=(a&31)<<6|p&63,m>127&&(i=m));break;case 3:p=t[o+1],f=t[o+2],(p&192)===128&&(f&192)===128&&(m=(a&15)<<12|(p&63)<<6|f&63,m>2047&&(m<55296||m>57343)&&(i=m));break;case 4:p=t[o+1],f=t[o+2],d=t[o+3],(p&192)===128&&(f&192)===128&&(d&192)===128&&(m=(a&15)<<18|(p&63)<<12|(f&63)<<6|d&63,m>65535&&m<1114112&&(i=m))}}i===null?(i=65533,c=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),o+=c}return Xt(n)}var jr=4096;function Xt(t){var r=t.length;if(r<=jr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=jr));return e}function zt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function qt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Jt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=en(t[a]);return o}function jt(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(u.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=u.prototype;else{var a=e-r;o=new u(a,void 0);for(var i=0;i<a;++i)o[i]=this[i+r]}return o};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return o};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};u.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=e,a=1,i=this[r+--o];o>0&&(a*=256);)i+=this[r+--o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};u.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),rr(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),rr(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),rr(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),rr(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!S(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var i=1,c=0;for(this[e]=r&255;++c<n&&(i*=256);)this[e+c]=r/i&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var i=n-1,c=1;for(this[e+i]=r&255;--i>=0&&(c*=256);)this[e+i]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function er(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):er(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):er(this,r,e,!1),e+2};function tr(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):tr(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):tr(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var i=0,c=1,p=0;for(this[e]=r&255;++i<n&&(c*=256);)r<0&&p===0&&this[e+i-1]!==0&&(p=1),this[e+i]=(r/c>>0)-p&255;return e+n};u.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var i=n-1,c=1,p=0;for(this[e+i]=r&255;--i>=0&&(c*=256);)r<0&&p===0&&this[e+i+1]!==0&&(p=1),this[e+i]=(r/c>>0)-p&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):er(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):er(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):tr(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):tr(this,r,e,!1),e+4};function se(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ce(t,r,e,n,o){return o||se(t,r,e,4),Zr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return ce(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return ce(this,r,e,!1,n)};function ue(t,r,e,n,o){return o||se(t,r,e,8),Zr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return ue(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return ue(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,i;if(this===r&&n<e&&e<o)for(i=a-1;i>=0;--i)r[i+e]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)r[i+e]=this[i+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};u.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!u.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var i;if(typeof r=="number")for(i=e;i<n;++i)this[i]=r;else{var c=S(r)?r:Z(new u(r,o).toString()),p=c.length;for(i=0;i<n-e;++i)this[i+e]=c[i%p]}return this};var Qt=/[^+\/0-9A-Za-z-_]/g;function Zt(t){if(t=rn(t).replace(Qt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function rn(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function en(t){return t<16?"0"+t.toString(16):t.toString(16)}function Z(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],i=0;i<n;++i){if(e=t.charCodeAt(i),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(i+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function tn(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function nn(t,r){for(var e,n,o,a=[],i=0;i<t.length&&!((r-=2)<0);++i)e=t.charCodeAt(i),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function pe(t){return Ot(Zt(t))}function nr(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function on(t){return t!==t}function an(t){return t!=null&&(!!t._isBuffer||le(t)||sn(t))}function le(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function sn(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&le(t.slice(0,0))}import{encodeAddress as cn,decodeAddress as ps}from"algosdk";function Y(t){return t.reduce((r,e)=>Uint8Array.from([...r,...e]))}var me={V1_1:"v1_1",V2:"v2"},Ns={[me.V1_1]:{testnet:62368684,mainnet:552635992},[me.V2]:{testnet:148607e3,mainnet:1002541853}};var de=t=>pn.decodeAddress(t.toUpperCase()).publicKey;import*as b from"ethereumjs-util";function mn(t){return b.toUnsigned(new b.BN(String(t)))}function fe(t){let r=mn(t);if(r.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(b.setLengthLeft(r,32))}var ge=t=>new Uint8Array(b.setLengthLeft(or(t),32)),or=t=>s.from(dn(t),"hex"),dn=t=>t.startsWith("0x")?t.slice(2):t;var br=t=>new Uint8Array(b.keccak256(s.from(t)));var Ar=(t,r)=>r===8?de(t):r===1?Ee.decode(t):ge(t);import Pc from"algosdk";import Kc from"algosdk";import Jc from"algosdk";import au from"algosdk";import _u from"algosdk";var _n=(t,r)=>r===8?fe(+t):dr[t]?new Uint8Array(or(String(t))):Ar(String(t),r);var ye=(t,r)=>{let e=Te(t.address,t.chainId,r.address,r.chainId);return s.from(br(e)).toString("hex")},Te=(t,r,e,n)=>{let o=Ar(t,r),a=_e.encodeUint64(r),i=_e.encodeUint64(n),c=_n(e,n);return Y([o,a,c,i])};var yp=(t,{userId:r,chainId:e,price:n,side:o,type:a,amount:i,total:c,id:p})=>{let{baseAsset:f,priceAsset:d}=t,m={address:r,chainId:e},h=o===K.Buy?d:f;return{action:"order",actionId:p,account:m,token:h,amount:o===K.Buy?a===j.Market?fr(c,d.decimal):mr(zr(i,f.decimal),fr(n,d.decimal)):i,ts:Date.now()}},Ip=(t,r,e,n="0")=>({hash:ye(t,r),loginAddress:t.address,loginChainId:t.chainId,tokenId:r.address,tokenChainId:r.chainId,amount:e,lockedAmount:n});export{yp as mapToBalanceInfo,Ip as mapToCodexBalance};
1
+ function yr(){throw new Error("setTimeout has not been defined")}function Ir(){throw new Error("clearTimeout has not been defined")}var D=yr,P=Ir;typeof globalThis.setTimeout=="function"&&(D=setTimeout);typeof globalThis.clearTimeout=="function"&&(P=clearTimeout);function Rr(t){if(D===setTimeout)return setTimeout(t,0);if((D===yr||!D)&&setTimeout)return D=setTimeout,setTimeout(t,0);try{return D(t,0)}catch{try{return D.call(null,t,0)}catch{return D.call(this,t,0)}}}function Ie(t){if(P===clearTimeout)return clearTimeout(t);if((P===Ir||!P)&&clearTimeout)return P=clearTimeout,clearTimeout(t);try{return P(t)}catch{try{return P.call(null,t)}catch{return P.call(this,t)}}}var C=[],F=!1,k,V=-1;function Re(){!F||!k||(F=!1,k.length?C=k.concat(C):V=-1,C.length&&wr())}function wr(){if(!F){var t=Rr(Re);F=!0;for(var r=C.length;r;){for(k=C,C=[];++V<r;)k&&k[V].run();V=-1,r=C.length}k=null,F=!1,Ie(t)}}function we(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];C.push(new Nr(t,r)),C.length===1&&!F&&Rr(wr)}function Nr(t,r){this.fun=t,this.array=r}Nr.prototype.run=function(){this.fun.apply(null,this.array)};var Ne="browser",Se="browser",Ce=!0,Oe={},Be=[],De="",Pe={},ke={},Ue={};function U(){}var Le=U,Me=U,ve=U,Fe=U,Ye=U,Ge=U,We=U;function Ke(t){throw new Error("process.binding is not supported")}function He(){return"/"}function Ve(t){throw new Error("process.chdir is not supported")}function $e(){return 0}var v=globalThis.performance||{},Xe=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function ze(t){var r=Xe.call(v)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var qe=new Date;function Je(){var t=new Date,r=t-qe;return r/1e3}var p={nextTick:we,title:Ne,browser:Ce,env:Oe,argv:Be,version:De,versions:Pe,on:Le,addListener:Me,once:ve,off:Fe,removeListener:Ye,removeAllListeners:Ge,emit:We,binding:Ke,cwd:He,chdir:Ve,umask:$e,hrtime:ze,platform:Se,release:ke,config:Ue,uptime:Je},_r={};Object.keys(_r).forEach(t=>{let r=t.split("."),e=p;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=_r[t]:e=e[o]||(e[o]={})}});var R=[],y=[],je=typeof Uint8Array<"u"?Uint8Array:Array,ur=!1;function Br(){ur=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],y[t.charCodeAt(r)]=r;y[45]=62,y[95]=63}function Qe(t){ur||Br();var r,e,n,o,a,i,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,i=new je(c*3/4-a),n=a>0?c-4:c;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)o=y[t.charCodeAt(r)]<<18|y[t.charCodeAt(r+1)]<<12|y[t.charCodeAt(r+2)]<<6|y[t.charCodeAt(r+3)],i[l++]=o>>16&255,i[l++]=o>>8&255,i[l++]=o&255;return a===2?(o=y[t.charCodeAt(r)]<<2|y[t.charCodeAt(r+1)]>>4,i[l++]=o&255):a===1&&(o=y[t.charCodeAt(r)]<<10|y[t.charCodeAt(r+1)]<<4|y[t.charCodeAt(r+2)]>>2,i[l++]=o>>8&255,i[l++]=o&255),i}function Ze(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function rt(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(Ze(n));return o.join("")}function Sr(t){ur||Br();for(var r,e=t.length,n=e%3,o="",a=[],i=16383,c=0,l=e-n;c<l;c+=i)a.push(rt(t,c,c+i>l?l:c+i));return n===1?(r=t[e-1],o+=R[r>>2],o+=R[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=R[r>>10],o+=R[r>>4&63],o+=R[r<<2&63],o+="="),a.push(o),a.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function $(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function O(t,r){if($()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return pr(this,t)}return Dr(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Dr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?nt(t,r,e,n):typeof r=="string"?tt(t,r,e):ot(t,r)}s.from=function(t,r,e){return Dr(null,t,r,e)};s.kMaxLength=$();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Pr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function et(t,r,e,n){return Pr(r),r<=0?O(t,r):e!==void 0?typeof n=="string"?O(t,r).fill(e,n):O(t,r).fill(e):O(t,r)}s.alloc=function(t,r,e){return et(null,t,r,e)};function pr(t,r){if(Pr(r),t=O(t,r<0?0:lr(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return pr(null,t)};s.allocUnsafeSlow=function(t){return pr(null,t)};function tt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=kr(r,e)|0;t=O(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function cr(t,r){var e=r.length<0?0:lr(r.length)|0;t=O(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function nt(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=cr(t,r),t}function ot(t,r){if(w(r)){var e=lr(r.length)|0;return t=O(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||yt(r.length)?O(t,0):cr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return cr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function lr(t){if(t>=$())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$().toString(16)+" bytes");return t|0}s.isBuffer=It;function w(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!w(r)||!w(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,i=Math.min(n,o);a<i;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};s.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=s.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var i=r[n];if(!w(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(o,a),a+=i.length}return o};function kr(t,r){if(w(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return X(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Gr(t).length;default:if(n)return X(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=kr;function it(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return gt(this,r,e);case"utf8":case"utf-8":return Mr(this,r,e);case"ascii":return dt(this,r,e);case"latin1":case"binary":return ft(this,r,e);case"base64":return lt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ht(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function L(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)L(this,e,e+1);return this};s.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)L(this,e,e+3),L(this,e+1,e+2);return this};s.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)L(this,e,e+7),L(this,e+1,e+6),L(this,e+2,e+5),L(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Mr(this,0,r):it.apply(this,arguments)};s.prototype.equals=function(r){if(!w(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,o,a){if(!w(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var i=a-o,c=n-e,l=Math.min(i,c),f=this.slice(o,a),d=r.slice(e,n),m=0;m<l;++m)if(f[m]!==d[m]){i=f[m],c=d[m];break}return i<c?-1:c<i?1:0};function Ur(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),w(r))return r.length===0?-1:Cr(t,r,e,n,o);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Cr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Cr(t,r,e,n,o){var a=1,i=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,i/=2,c/=2,e/=2}function l(g,_){return a===1?g[_]:g.readUInt16BE(_*a)}var f;if(o){var d=-1;for(f=e;f<i;f++)if(l(t,f)===l(r,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*a}else d!==-1&&(f-=f-d),d=-1}else for(e+c>i&&(e=i-c),f=e;f>=0;f--){for(var m=!0,h=0;h<c;h++)if(l(t,f+h)!==l(r,h)){m=!1;break}if(m)return f}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return Ur(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Ur(this,r,e,n,!1)};function at(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var c=parseInt(r.substr(i*2,2),16);if(isNaN(c))return i;t[e+i]=c}return i}function st(t,r,e,n){return J(X(r,t.length-e),t,e,n)}function Lr(t,r,e,n){return J(Tt(r),t,e,n)}function ct(t,r,e,n){return Lr(t,r,e,n)}function ut(t,r,e,n){return J(Gr(r),t,e,n)}function pt(t,r,e,n){return J(_t(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var i=!1;;)switch(o){case"hex":return at(this,r,e,n);case"utf8":case"utf-8":return st(this,r,e,n);case"ascii":return Lr(this,r,e,n);case"latin1":case"binary":return ct(this,r,e,n);case"base64":return ut(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pt(this,r,e,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function lt(t,r,e){return r===0&&e===t.length?Sr(t):Sr(t.slice(r,e))}function Mr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],i=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var l,f,d,m;switch(c){case 1:a<128&&(i=a);break;case 2:l=t[o+1],(l&192)===128&&(m=(a&31)<<6|l&63,m>127&&(i=m));break;case 3:l=t[o+1],f=t[o+2],(l&192)===128&&(f&192)===128&&(m=(a&15)<<12|(l&63)<<6|f&63,m>2047&&(m<55296||m>57343)&&(i=m));break;case 4:l=t[o+1],f=t[o+2],d=t[o+3],(l&192)===128&&(f&192)===128&&(d&192)===128&&(m=(a&15)<<18|(l&63)<<12|(f&63)<<6|d&63,m>65535&&m<1114112&&(i=m))}}i===null?(i=65533,c=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),o+=c}return mt(n)}var Or=4096;function mt(t){var r=t.length;if(r<=Or)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Or));return e}function dt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function ft(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function gt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=At(t[a]);return o}function ht(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=s.prototype;else{var a=e-r;o=new s(a,void 0);for(var i=0;i<a;++i)o[i]=this[i+r]}return o};function x(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return o};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};s.prototype.readUInt8=function(r,e){return e||x(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||x(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||x(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||x(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||x(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=e,a=1,i=this[r+--o];o>0&&(a*=256);)i+=this[r+--o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};s.prototype.readInt8=function(r,e){return e||x(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||x(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||x(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||x(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||x(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||x(r,4,this.length),j(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||x(r,4,this.length),j(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||x(r,8,this.length),j(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||x(r,8,this.length),j(this,r,!1,52,8)};function A(t,r,e,n,o,a){if(!w(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;A(this,r,e,n,a,0)}var i=1,c=0;for(this[e]=r&255;++c<n&&(i*=256);)this[e+c]=r/i&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;A(this,r,e,n,a,0)}var i=n-1,c=1;for(this[e+i]=r&255;--i>=0&&(c*=256);)this[e+i]=r/c&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function z(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):z(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):z(this,r,e,!1),e+2};function q(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):q(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):q(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);A(this,r,e,n,a-1,-a)}var i=0,c=1,l=0;for(this[e]=r&255;++i<n&&(c*=256);)r<0&&l===0&&this[e+i-1]!==0&&(l=1),this[e+i]=(r/c>>0)-l&255;return e+n};s.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);A(this,r,e,n,a-1,-a)}var i=n-1,c=1,l=0;for(this[e+i]=r&255;--i>=0&&(c*=256);)r<0&&l===0&&this[e+i+1]!==0&&(l=1),this[e+i]=(r/c>>0)-l&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):z(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):z(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):q(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):q(this,r,e,!1),e+4};function vr(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Fr(t,r,e,n,o){return o||vr(t,r,e,4,34028234663852886e22,-34028234663852886e22),Kr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return Fr(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return Fr(this,r,e,!1,n)};function Yr(t,r,e,n,o){return o||vr(t,r,e,8,17976931348623157e292,-17976931348623157e292),Kr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Yr(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Yr(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,i;if(this===r&&n<e&&e<o)for(i=a-1;i>=0;--i)r[i+e]=this[i+n];else if(a<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)r[i+e]=this[i+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};s.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var i;if(typeof r=="number")for(i=e;i<n;++i)this[i]=r;else{var c=w(r)?r:X(new s(r,o).toString()),l=c.length;for(i=0;i<n-e;++i)this[i+e]=c[i%l]}return this};var xt=/[^+\/0-9A-Za-z-_]/g;function Et(t){if(t=bt(t).replace(xt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function bt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function At(t){return t<16?"0"+t.toString(16):t.toString(16)}function X(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],i=0;i<n;++i){if(e=t.charCodeAt(i),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(i+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function Tt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function _t(t,r){for(var e,n,o,a=[],i=0;i<t.length&&!((r-=2)<0);++i)e=t.charCodeAt(i),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function Gr(t){return Qe(Et(t))}function J(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function yt(t){return t!==t}function It(t){return t!=null&&(!!t._isBuffer||Wr(t)||Rt(t))}function Wr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Rt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Wr(t.slice(0,0))}function j(t,r,e,n,o){var a,i,c=o*8-n-1,l=(1<<c)-1,f=l>>1,d=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,a=g&(1<<-d)-1,g>>=-d,d+=c;d>0;a=a*256+t[r+m],m+=h,d-=8);for(i=a&(1<<-d)-1,a>>=-d,d+=n;d>0;i=i*256+t[r+m],m+=h,d-=8);if(a===0)a=1-f;else{if(a===l)return i?NaN:(g?-1:1)*(1/0);i=i+Math.pow(2,n),a=a-f}return(g?-1:1)*i*Math.pow(2,a-n)}function Kr(t,r,e,n,o,a){var i,c,l,f=a*8-o-1,d=(1<<f)-1,m=d>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,_=n?1:-1,sr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,i=d):(i=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+m>=1?r+=h/l:r+=h*Math.pow(2,1-m),r*l>=2&&(i++,l/=2),i+m>=d?(c=0,i=d):i+m>=1?(c=(r*l-1)*Math.pow(2,o),i=i+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),i=0));o>=8;t[e+g]=c&255,g+=_,c/=256,o-=8);for(i=i<<o|c,f+=o;f>0;t[e+g]=i&255,g+=_,i/=256,f-=8);t[e+g-_]|=sr*128}import mr from"bignumber.js";mr.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function Q(t,r){return Hr(t,r,"*")}function Y(t,r){return Hr(t,r,"/")}function Hr(t,r,e){switch(t=new mr(String(t)),r=new mr(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var Vr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(Vr||{}),K=Vr;var $r=(o=>(o[o.Limit=0]="Limit",o[o.IOC=1]="IOC",o[o.POST=2]="POST",o[o.Market=3]="Market",o))($r||{}),Z=$r;var Xr=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(Xr||{}),zr=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(zr||{}),Mo={...Xr,...zr};var dr={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var ca={SMALLESTUNIT:p.env.SMALLEST_UNIT},ua={SMALLEST_UNITS:p.env.SMALLEST_UNIT};var da=`{"theme1":{"value":"${p.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${p.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${p.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Ea=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var Ra=p.env.REACT_APP_API_URL,wa=p.env.REACT_APP_SOCKET_URL,Na=p.env.REACT_APP_ALGO_SERVER,Sa=p.env.REACT_APP_ALGO_SERVER_PORT||"",Ca=p.env.REACT_APP_ALGOD_TOKEN||"",Oa=p.env.REACT_APP_DISPENSER_LINK,Ba=p.env.REACT_APP_FRONTEND_LINK||"",Da=p.env.REACT_APP_ALGO_EXPLORER_LINK,Pa=p.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,ka=(p.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Ua=p.env.REACT_APP_USERBACK_ACCESS_TOKEN,La=(p.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Ma=.001*10**6,va=.002*10**6;var Fa=p.env.REACT_APP_MASTER_APP_ID||"406",Ya=p.env.REACT_APP_AGG_APP_ID||"408",Ga=Number(p.env.REACT_APP_CODEX_APP_ID||"467960617");var Nt=p.env.REACT_APP_ALGO_NETWORK||"";var Wa=Nt.toLowerCase()==="mainnet"?"mainnet":"testnet";var qa={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"};var fr=(t,r)=>Y(t,10**(18-r)),qr=(t,r)=>Y(t,10**r);import _e from"algosdk";import*as Tn from"bs58";import nu from"algosdk";import*as be from"bs58";import pn from"algosdk";import Ms,{decodeAddress as vs,encodeAddress as Fs}from"algosdk";var N=[],I=[],Ot=typeof Uint8Array<"u"?Uint8Array:Array,hr=!1;function Zr(){hr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)N[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function Bt(t){hr||Zr();var r,e,n,o,a,i,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,i=new Ot(c*3/4-a),n=a>0?c-4:c;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)o=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],i[l++]=o>>16&255,i[l++]=o>>8&255,i[l++]=o&255;return a===2?(o=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,i[l++]=o&255):a===1&&(o=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,i[l++]=o>>8&255,i[l++]=o&255),i}function Dt(t){return N[t>>18&63]+N[t>>12&63]+N[t>>6&63]+N[t&63]}function Pt(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(Dt(n));return o.join("")}function Jr(t){hr||Zr();for(var r,e=t.length,n=e%3,o="",a=[],i=16383,c=0,l=e-n;c<l;c+=i)a.push(Pt(t,c,c+i>l?l:c+i));return n===1?(r=t[e-1],o+=N[r>>2],o+=N[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=N[r>>10],o+=N[r>>4&63],o+=N[r<<2&63],o+="="),a.push(o),a.join("")}function tr(t,r,e,n,o){var a,i,c=o*8-n-1,l=(1<<c)-1,f=l>>1,d=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,a=g&(1<<-d)-1,g>>=-d,d+=c;d>0;a=a*256+t[r+m],m+=h,d-=8);for(i=a&(1<<-d)-1,a>>=-d,d+=n;d>0;i=i*256+t[r+m],m+=h,d-=8);if(a===0)a=1-f;else{if(a===l)return i?NaN:(g?-1:1)*(1/0);i=i+Math.pow(2,n),a=a-f}return(g?-1:1)*i*Math.pow(2,a-n)}function re(t,r,e,n,o,a){var i,c,l,f=a*8-o-1,d=(1<<f)-1,m=d>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,_=n?1:-1,sr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,i=d):(i=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+m>=1?r+=h/l:r+=h*Math.pow(2,1-m),r*l>=2&&(i++,l/=2),i+m>=d?(c=0,i=d):i+m>=1?(c=(r*l-1)*Math.pow(2,o),i=i+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),i=0));o>=8;t[e+g]=c&255,g+=_,c/=256,o-=8);for(i=i<<o|c,f+=o;f>0;t[e+g]=i&255,g+=_,i/=256,f-=8);t[e+g-_]|=sr*128}var kt={}.toString,ee=Array.isArray||function(t){return kt.call(t)=="[object Array]"};var Ut=50;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Ds=rr();function rr(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,r){if(rr()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return xr(this,t)}return te(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function te(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?vt(t,r,e,n):typeof r=="string"?Mt(t,r,e):Ft(t,r)}u.from=function(t,r,e){return te(null,t,r,e)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function ne(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Lt(t,r,e,n){return ne(r),r<=0?B(t,r):e!==void 0?typeof n=="string"?B(t,r).fill(e,n):B(t,r).fill(e):B(t,r)}u.alloc=function(t,r,e){return Lt(null,t,r,e)};function xr(t,r){if(ne(r),t=B(t,r<0?0:Er(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return xr(null,t)};u.allocUnsafeSlow=function(t){return xr(null,t)};function Mt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=oe(r,e)|0;t=B(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function gr(t,r){var e=r.length<0?0:Er(r.length)|0;t=B(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function vt(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=gr(t,r),t}function Ft(t,r){if(S(r)){var e=Er(r.length)|0;return t=B(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||on(r.length)?B(t,0):gr(t,r);if(r.type==="Buffer"&&ee(r.data))return gr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Er(t){if(t>=rr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+rr().toString(16)+" bytes");return t|0}u.isBuffer=an;function S(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,i=Math.min(n,o);a<i;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};u.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(r,e){if(!ee(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=u.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var i=r[n];if(!S(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(o,a),a+=i.length}return o};function oe(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return er(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return le(t).length;default:if(n)return er(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=oe;function Yt(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Jt(this,r,e);case"utf8":case"utf-8":return se(this,r,e);case"ascii":return zt(this,r,e);case"latin1":case"binary":return qt(this,r,e);case"base64":return $t(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)M(this,e,e+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?se(this,0,r):Yt.apply(this,arguments)};u.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",e=Ut;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};u.prototype.compare=function(r,e,n,o,a){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var i=a-o,c=n-e,l=Math.min(i,c),f=this.slice(o,a),d=r.slice(e,n),m=0;m<l;++m)if(f[m]!==d[m]){i=f[m],c=d[m];break}return i<c?-1:c<i?1:0};function ie(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),S(r))return r.length===0?-1:jr(t,r,e,n,o);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):jr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function jr(t,r,e,n,o){var a=1,i=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,i/=2,c/=2,e/=2}function l(g,_){return a===1?g[_]:g.readUInt16BE(_*a)}var f;if(o){var d=-1;for(f=e;f<i;f++)if(l(t,f)===l(r,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*a}else d!==-1&&(f-=f-d),d=-1}else for(e+c>i&&(e=i-c),f=e;f>=0;f--){for(var m=!0,h=0;h<c;h++)if(l(t,f+h)!==l(r,h)){m=!1;break}if(m)return f}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return ie(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return ie(this,r,e,n,!1)};function Gt(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var c=parseInt(r.substr(i*2,2),16);if(isNaN(c))return i;t[e+i]=c}return i}function Wt(t,r,e,n){return ir(er(r,t.length-e),t,e,n)}function ae(t,r,e,n){return ir(tn(r),t,e,n)}function Kt(t,r,e,n){return ae(t,r,e,n)}function Ht(t,r,e,n){return ir(le(r),t,e,n)}function Vt(t,r,e,n){return ir(nn(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var i=!1;;)switch(o){case"hex":return Gt(this,r,e,n);case"utf8":case"utf-8":return Wt(this,r,e,n);case"ascii":return ae(this,r,e,n);case"latin1":case"binary":return Kt(this,r,e,n);case"base64":return Ht(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vt(this,r,e,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $t(t,r,e){return r===0&&e===t.length?Jr(t):Jr(t.slice(r,e))}function se(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],i=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var l,f,d,m;switch(c){case 1:a<128&&(i=a);break;case 2:l=t[o+1],(l&192)===128&&(m=(a&31)<<6|l&63,m>127&&(i=m));break;case 3:l=t[o+1],f=t[o+2],(l&192)===128&&(f&192)===128&&(m=(a&15)<<12|(l&63)<<6|f&63,m>2047&&(m<55296||m>57343)&&(i=m));break;case 4:l=t[o+1],f=t[o+2],d=t[o+3],(l&192)===128&&(f&192)===128&&(d&192)===128&&(m=(a&15)<<18|(l&63)<<12|(f&63)<<6|d&63,m>65535&&m<1114112&&(i=m))}}i===null?(i=65533,c=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),o+=c}return Xt(n)}var Qr=4096;function Xt(t){var r=t.length;if(r<=Qr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Qr));return e}function zt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function qt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Jt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=en(t[a]);return o}function jt(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(u.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=u.prototype;else{var a=e-r;o=new u(a,void 0);for(var i=0;i<a;++i)o[i]=this[i+r]}return o};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return o};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};u.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],a=1,i=0;++i<e&&(a*=256);)o+=this[r+i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=e,a=1,i=this[r+--o];o>0&&(a*=256);)i+=this[r+--o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};u.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),tr(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),tr(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),tr(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),tr(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!S(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var i=1,c=0;for(this[e]=r&255;++c<n&&(i*=256);)this[e+c]=r/i&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var i=n-1,c=1;for(this[e+i]=r&255;--i>=0&&(c*=256);)this[e+i]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function nr(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):nr(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):nr(this,r,e,!1),e+2};function or(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):or(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):or(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var i=0,c=1,l=0;for(this[e]=r&255;++i<n&&(c*=256);)r<0&&l===0&&this[e+i-1]!==0&&(l=1),this[e+i]=(r/c>>0)-l&255;return e+n};u.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var i=n-1,c=1,l=0;for(this[e+i]=r&255;--i>=0&&(c*=256);)r<0&&l===0&&this[e+i+1]!==0&&(l=1),this[e+i]=(r/c>>0)-l&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):nr(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):nr(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):or(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):or(this,r,e,!1),e+4};function ce(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ue(t,r,e,n,o){return o||ce(t,r,e,4),re(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return ue(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return ue(this,r,e,!1,n)};function pe(t,r,e,n,o){return o||ce(t,r,e,8),re(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return pe(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return pe(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var a=o-n,i;if(this===r&&n<e&&e<o)for(i=a-1;i>=0;--i)r[i+e]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)r[i+e]=this[i+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};u.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!u.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var i;if(typeof r=="number")for(i=e;i<n;++i)this[i]=r;else{var c=S(r)?r:er(new u(r,o).toString()),l=c.length;for(i=0;i<n-e;++i)this[i+e]=c[i%l]}return this};var Qt=/[^+\/0-9A-Za-z-_]/g;function Zt(t){if(t=rn(t).replace(Qt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function rn(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function en(t){return t<16?"0"+t.toString(16):t.toString(16)}function er(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],i=0;i<n;++i){if(e=t.charCodeAt(i),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(i+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function tn(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function nn(t,r){for(var e,n,o,a=[],i=0;i<t.length&&!((r-=2)<0);++i)e=t.charCodeAt(i),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function le(t){return Bt(Zt(t))}function ir(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function on(t){return t!==t}function an(t){return t!=null&&(!!t._isBuffer||me(t)||sn(t))}function me(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function sn(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&me(t.slice(0,0))}import{encodeAddress as cn,decodeAddress as Vs}from"algosdk";function G(t){return t.reduce((r,e)=>Uint8Array.from([...r,...e]))}var de={V1_1:"v1_1",V2:"v2"},sc={[de.V1_1]:{testnet:62368684,mainnet:552635992},[de.V2]:{testnet:148607e3,mainnet:1002541853}};var fe=t=>pn.decodeAddress(t.toUpperCase()).publicKey;import*as b from"ethereumjs-util";function mn(t){return b.toUnsigned(new b.BN(String(t)))}function ge(t){let r=mn(t);if(r.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(b.setLengthLeft(r,32))}var he=t=>new Uint8Array(b.setLengthLeft(ar(t),32)),ar=t=>s.from(dn(t),"hex"),dn=t=>t.startsWith("0x")?t.slice(2):t;var br=t=>new Uint8Array(b.keccak256(s.from(t)));var Ar=(t,r)=>r===8?fe(t):r===1?be.decode(t):he(t);import du from"algosdk";import _u from"algosdk";import Ou from"algosdk";import Fu from"algosdk";import ju from"algosdk";import dp from"algosdk";var _n=(t,r)=>r===8?ge(+t):dr[t]?new Uint8Array(ar(String(t))):Ar(String(t),r);var ye=(t,r)=>{let e=Te(t.address,t.chainId,r.address,r.chainId);return s.from(br(e)).toString("hex")},Te=(t,r,e,n)=>{let o=Ar(t,r),a=_e.encodeUint64(r),i=_e.encodeUint64(n),c=_n(e,n);return G([o,a,c,i])};var hl=(t,{userId:r,chainId:e,price:n,side:o,type:a,amount:i,total:c,id:l})=>{let{baseAsset:f,priceAsset:d}=t,m={address:r,chainId:e},h=o===K.Buy?d:f;return{action:"order",actionId:l,account:m,token:h,amount:o===K.Buy?a===Z.Market?fr(c,d.decimal):Q(qr(i,f.decimal),fr(n,d.decimal)):i,ts:Date.now()}},xl=(t,r,e,n="0")=>({hash:ye(t,r),loginAddress:t.address,loginChainId:t.chainId,tokenId:r.address,tokenChainId:r.chainId,amount:e,lockedAmount:n});export{hl as mapToBalanceInfo,xl as mapToCodexBalance};
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *