edge-currency-accountbased 2.2.3 → 2.3.0

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 (88) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/android/src/main/assets/edge-currency-accountbased/234.chunk.js +35 -0
  3. package/android/src/main/assets/edge-currency-accountbased/248.chunk.js +35 -0
  4. package/android/src/main/assets/edge-currency-accountbased/336.chunk.js +9 -0
  5. package/android/src/main/assets/edge-currency-accountbased/612.chunk.js +1 -0
  6. package/android/src/main/assets/edge-currency-accountbased/{945.chunk.js → 814.chunk.js} +8 -8
  7. package/android/src/main/assets/edge-currency-accountbased/935.chunk.js +1 -1
  8. package/android/src/main/assets/edge-currency-accountbased/94.chunk.js +8 -0
  9. package/android/src/main/assets/edge-currency-accountbased/algorand.chunk.js +2 -2
  10. package/android/src/main/assets/edge-currency-accountbased/bnb.chunk.js +4 -4
  11. package/android/src/main/assets/edge-currency-accountbased/edge-currency-accountbased.js +10 -10
  12. package/android/src/main/assets/edge-currency-accountbased/eos.chunk.js +12 -12
  13. package/android/src/main/assets/edge-currency-accountbased/ethereum.chunk.js +5 -5
  14. package/android/src/main/assets/edge-currency-accountbased/filecoin.chunk.js +1 -1
  15. package/android/src/main/assets/edge-currency-accountbased/fio.chunk.js +2 -2
  16. package/android/src/main/assets/edge-currency-accountbased/hedera.chunk.js +2 -2
  17. package/android/src/main/assets/edge-currency-accountbased/polkadot.chunk.js +2 -2
  18. package/android/src/main/assets/edge-currency-accountbased/ripple.chunk.js +5 -5
  19. package/android/src/main/assets/edge-currency-accountbased/solana.chunk.js +3 -3
  20. package/android/src/main/assets/edge-currency-accountbased/stellar.chunk.js +4 -4
  21. package/android/src/main/assets/edge-currency-accountbased/tezos.chunk.js +3 -3
  22. package/android/src/main/assets/edge-currency-accountbased/tron.chunk.js +1 -1
  23. package/android/src/main/assets/edge-currency-accountbased/zcash.chunk.js +2 -2
  24. package/lib/algorand/AlgorandEngine.js +46 -24
  25. package/lib/algorand/algorandInfo.js +8 -7
  26. package/lib/algorand/algorandTestnetInfo.js +8 -7
  27. package/lib/binance/BinanceEngine.js +19 -17
  28. package/lib/binance/binanceInfo.js +10 -7
  29. package/lib/common/types.js +10 -0
  30. package/lib/common/upgradeMemos.js +52 -0
  31. package/lib/common/utf8.js +32 -0
  32. package/lib/common/validateMemos.js +107 -0
  33. package/lib/eos/EosEngine.js +42 -41
  34. package/lib/eos/info/eosCommonInfo.js +10 -0
  35. package/lib/eos/info/eosInfo.js +15 -17
  36. package/lib/eos/info/telosInfo.js +15 -15
  37. package/lib/eos/info/waxInfo.js +15 -16
  38. package/lib/ethereum/EthereumEngine.js +13 -12
  39. package/lib/ethereum/EthereumNetwork.js +16 -14
  40. package/lib/ethereum/info/avalancheInfo.js +17 -7
  41. package/lib/ethereum/info/binancesmartchainInfo.js +9 -7
  42. package/lib/ethereum/info/celoInfo.js +9 -7
  43. package/lib/ethereum/info/ethDevInfo.js +9 -7
  44. package/lib/ethereum/info/ethereumCommonInfo.js +10 -0
  45. package/lib/ethereum/info/ethereumInfo.js +17 -7
  46. package/lib/ethereum/info/ethereumclassicInfo.js +9 -7
  47. package/lib/ethereum/info/ethereumpowInfo.js +9 -7
  48. package/lib/ethereum/info/fantomInfo.js +9 -7
  49. package/lib/ethereum/info/goerliInfo.js +9 -7
  50. package/lib/ethereum/info/kovanInfo.js +9 -7
  51. package/lib/ethereum/info/optimismInfo.js +9 -7
  52. package/lib/ethereum/info/polygonInfo.js +9 -7
  53. package/lib/ethereum/info/pulsechainInfo.js +9 -7
  54. package/lib/ethereum/info/rinkebyInfo.js +9 -7
  55. package/lib/ethereum/info/ropstenInfo.js +9 -7
  56. package/lib/ethereum/info/rskInfo.js +9 -7
  57. package/lib/ethereum/info/zksyncInfo.js +9 -7
  58. package/lib/filecoin/FilecoinEngine.js +125 -87
  59. package/lib/filecoin/Filfox.js +68 -1
  60. package/lib/filecoin/filecoinInfo.js +5 -7
  61. package/lib/fio/FioEngine.js +25 -17
  62. package/lib/fio/fioInfo.js +8 -6
  63. package/lib/hedera/HederaEngine.js +22 -18
  64. package/lib/hedera/hederaInfo.js +11 -8
  65. package/lib/hedera/hederaTestnetInfo.js +6 -6
  66. package/lib/polkadot/PolkadotEngine.js +15 -9
  67. package/lib/polkadot/info/liberlandInfo.js +3 -2
  68. package/lib/polkadot/info/liberlandTestnetInfo.js +3 -2
  69. package/lib/polkadot/info/polkadotInfo.js +8 -5
  70. package/lib/ripple/RippleEngine.js +53 -75
  71. package/lib/ripple/rippleInfo.js +16 -8
  72. package/lib/solana/SolanaEngine.js +17 -12
  73. package/lib/solana/solanaInfo.js +9 -5
  74. package/lib/stellar/StellarEngine.js +31 -22
  75. package/lib/stellar/stellarInfo.js +16 -7
  76. package/lib/tezos/TezosEngine.js +17 -11
  77. package/lib/tezos/tezosInfo.js +8 -5
  78. package/lib/tron/TronEngine.js +85 -68
  79. package/lib/tron/tronInfo.js +8 -7
  80. package/lib/zcash/ZcashEngine.js +23 -23
  81. package/lib/zcash/piratechainInfo.js +8 -6
  82. package/lib/zcash/zcashInfo.js +7 -6
  83. package/package.json +2 -2
  84. package/android/src/main/assets/edge-currency-accountbased/124.chunk.js +0 -35
  85. package/android/src/main/assets/edge-currency-accountbased/223.chunk.js +0 -9
  86. package/android/src/main/assets/edge-currency-accountbased/650.chunk.js +0 -1
  87. package/android/src/main/assets/edge-currency-accountbased/689.chunk.js +0 -8
  88. package/android/src/main/assets/edge-currency-accountbased/826.chunk.js +0 -35
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[650],{84650:function(F,K,D){D.d(K,{P:function(){return J}});var L=D(77591),Q=D.n(L),_=D(94935),p=D(20918),y=D(62177),I=D(76714),N=Object.defineProperty,R=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,P=(x,t,n)=>t in x?N(x,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):x[t]=n,B=(x,t)=>{for(var n in t||(t={}))U.call(t,n)&&P(x,n,t[n]);if(R)for(var n of R(t))$.call(t,n)&&P(x,n,t[n]);return x},d=(x,t,n)=>new Promise((s,o)=>{var c=u=>{try{m(n.next(u))}catch(T){o(T)}},r=u=>{try{m(n.throw(u))}catch(T){o(T)}},m=u=>u.done?s(u.value):Promise.resolve(u.value).then(c,r);m((n=n.apply(x,t)).next())});const j=1e4,W=1e3,M=3600*24;class J{constructor(t,n,s,o){this.allTokens=[],this.allTokensMap={},this.builtinTokens={},this.customTokens={},this.enabledTokenIds=[],this.enabledTokens=[];const{builtinTokens:c,currencyInfo:r}=t,{callbacks:m,customTokens:u,enabledTokenIds:T,log:C,walletLocalDisklet:v}=o;this.tools=n,this.log=C,this.warn=(O,S)=>this.log.warn(O+(0,I.HY)(S)),this.error=(O,S)=>this.log.error(O+(0,I.HY)(S)),this.engineOn=!1,this.addressesChecked=!1,this.tokenCheckBalanceStatus={},this.tokenCheckTransactionsStatus={},this.walletLocalDataDirty=!1,this.transactionsChangedArray=[],this.transactionList={},this.transactionListDirty=!1,this.transactionsLoaded=!1,this.txIdMap={},this.txIdList={},this.walletInfo=s,this.walletId=s.id,this.currencyInfo=r,this.timers={},this.otherData=void 0,this.minimumAddressBalance="0";const{currencyCode:b}=r;this.transactionList[b]=[],this.txIdMap[b]={},this.txIdList[b]=[],this.builtinTokens=c,this.changeCustomTokensSync(u),this.changeEnabledTokenIdsSync(T),o.userSettings!=null?this.currentSettings=o.userSettings:this.currentSettings=this.currencyInfo.defaultSettings,this.currencyEngineCallbacks=m,this.walletLocalDisklet=v,typeof this.walletInfo.keys.publicKey!="string"&&(this.walletInfo.keys.publicKey=s.keys.publicKey),this.walletLocalData={blockHeight:0,lastAddressQueryHeight:0,lastTransactionQueryHeight:{},lastTransactionDate:{},publicKey:"",totalBalances:{},lastCheckedTxsDropped:0,numUnconfirmedSpendTxs:0,numTransactions:{},unactivatedTokenIds:[],otherData:void 0},this.log(`Created Wallet Type ${this.walletInfo.type} for Currency Plugin ${this.currencyInfo.pluginId}`)}isSpendTx(t){if(t.nativeAmount!==""){if(t.nativeAmount.slice(0,1)==="-")return!0;if((0,L.gt)(t.nativeAmount,"0"))return!1}let n=!0;if(t.ourReceiveAddresses.length>0)for(const s of t.ourReceiveAddresses)s===this.walletLocalData.publicKey&&(n=!1);return n}setOtherData(t){throw new Error(`Unimplemented setOtherData for ${this.walletInfo.type}`)}loadTransactions(){return d(this,null,function*(){if(this.transactionsLoaded){this.log("Transactions already loaded");return}this.transactionsLoaded=!0;const t=this.walletLocalDisklet;let n;try{const r=yield t.getText(y.TD);n=JSON.parse(r)}catch{this.log("Could not load txidList file. Failure is ok on new device"),yield t.setText(y.TD,JSON.stringify(this.txIdList))}let s;try{const r=yield t.getText(y.DZ);s=JSON.parse(r)}catch{this.log("Could not load txidMap file. Failure is ok on new device"),yield t.setText(y.DZ,JSON.stringify(this.txIdMap))}let o;try{const r=yield t.getText(y.tC);o=JSON.parse(r)}catch(r){r.code==="ENOENT"?(this.log("Could not load transactionList file. Failure is ok on new device"),yield t.setText(y.tC,JSON.stringify(this.transactionList))):this.log.crash(r,this.walletLocalData)}let c=!0;for(const r of Object.keys(this.transactionList))if(this.transactionList[r]!=null&&this.transactionList[r].length>0){c=!1;break}if(c)this.transactionList=o!=null?o:this.transactionList,this.txIdList=n!=null?n:this.txIdList,this.txIdMap=s!=null?s:this.txIdMap;else if(o!=null)for(const r of Object.keys(o))for(const m of o[r])this.addTransaction(r,m);for(const r in this.transactionList)this.walletLocalData.numTransactions[r]=this.transactionList[r].length})}loadEngine(){return d(this,null,function*(){var t;const{walletInfo:n}=this,{currencyCode:s}=this.currencyInfo;this.walletInfo.keys.publicKey==null&&(this.walletInfo.keys.publicKey=n.keys.publicKey);const o=this.walletLocalDisklet;try{const c=yield o.getText(y.Pe);this.walletLocalData=(0,y.O2)(JSON.parse(c)),this.walletLocalData.publicKey=this.walletInfo.keys.publicKey}catch{try{this.log("No walletLocalData setup yet: Failure is ok"),this.walletLocalData=(0,y.O2)({}),this.walletLocalData.publicKey=this.walletInfo.keys.publicKey,yield o.setText(y.Pe,JSON.stringify(this.walletLocalData))}catch(r){throw this.error("Error writing to localDataStore. Engine not started: ",r),r}}this.setOtherData((t=this.walletLocalData.otherData)!=null?t:{}),this.walletLocalDataDirty=!(0,I.dQ)(this.otherData,this.walletLocalData.otherData),this.tokenCheckBalanceStatus[s]=0,this.tokenCheckTransactionsStatus[s]=0,this.doInitialBalanceCallback(),this.doInitialUnactivatedTokenIdsCallback()})}findTransaction(t,n){if(this.txIdMap[t]!=null){const s=this.txIdMap[t][n];if(typeof s=="number")return s}return-1}sortTxByDate(t,n){return n.date-t.date}addTransaction(t,n,s){this.log("executing addTransaction: ",n.txid),n.otherParams==null&&(n.otherParams={}),n.blockHeight<1&&(n.otherParams.lastSeenTime=s!=null?s:Math.round(Date.now()/1e3));const o=(0,I.f0)(n.txid),c=this.findTransaction(t,o);let r=!1;if(c===-1){if(this.isSpendTx(n)&&n.blockHeight===0&&(this.walletLocalData.numUnconfirmedSpendTxs++,this.walletLocalDataDirty=!0),r=!0,typeof this.transactionList[t]>"u")this.transactionList[t]=[];else if(this.transactionList[t].length>=W)return;this.transactionList[t].push(n),this.walletLocalData.numTransactions[t]=this.transactionList[t].length,this.walletLocalDataDirty=!0,this.transactionListDirty=!0,this.transactionsChangedArray.push(n),this.warn(`addTransaction new tx: ${n.txid}`)}else{const u=this.transactionList[t][c],{otherParams:T={}}=u,{otherParams:C={}}=n;(u.blockHeight<n.blockHeight||u.blockHeight===0&&n.blockHeight<0||u.blockHeight===n.blockHeight&&(u.networkFee!==n.networkFee||u.nativeAmount!==n.nativeAmount||T.lastSeenTime!==C.lastSeenTime||u.date!==n.date))&&(this.isSpendTx(n)&&n.blockHeight!==0&&u.blockHeight===0&&this.walletLocalData.numUnconfirmedSpendTxs--,u.date!==n.date&&(r=!0),this.warn(`addTransaction: update ${n.txid} height:${n.blockHeight}`),this.walletLocalDataDirty=!0,this.updateTransaction(t,n,c))}r&&this.sortTransactions(t)}sortTransactions(t){this.transactionList[t].sort(this.sortTxByDate);const n=[];let s=0;for(const o of this.transactionList[t])this.txIdMap[t]==null&&(this.txIdMap[t]={}),this.txIdMap[t][(0,I.f0)(o.txid)]=s,n.push((0,I.f0)(o.txid)),s++;this.txIdList[t]=n}checkDroppedTransactionsThrottled(){const t=Date.now()/1e3;t-this.walletLocalData.lastCheckedTxsDropped>M&&(this.checkDroppedTransactions(t),this.walletLocalData.lastCheckedTxsDropped=t,this.walletLocalDataDirty=!0,this.transactionsChangedArray.length>0&&(this.currencyEngineCallbacks.onTransactionsChanged(this.transactionsChangedArray),this.transactionsChangedArray=[]))}checkDroppedTransactions(t){let n=0;for(const s in this.transactionList)for(let o=0;o<this.transactionList[s].length;o++){const c=this.transactionList[s][o];if(c.blockHeight===0){const{otherParams:r={}}=c,m=r.lastSeenTime;t-m>M?(c.blockHeight=-1,c.nativeAmount="0",this.transactionsChangedArray.push(c)):this.isSpendTx(c)&&n++}}this.walletLocalData.numUnconfirmedSpendTxs=n,this.walletLocalDataDirty=!0}updateBalance(t,n){const s=this.walletLocalData.totalBalances[t];this.walletLocalData.totalBalances[t]==null&&(this.walletLocalData.totalBalances[t]="0"),(s==null||!(0,L.eq)(n,s))&&(this.walletLocalData.totalBalances[t]=n,this.walletLocalDataDirty=!0,this.warn(`${t}: token Address balance: ${n}`),this.currencyEngineCallbacks.onBalanceChanged(t,n)),this.tokenCheckBalanceStatus[t]=1,this.updateOnAddressesChecked()}updateTransaction(t,n,s){this.transactionList[t][s]=n,this.transactionListDirty=!0,this.transactionsChangedArray.push(n),this.warn(`updateTransaction: ${n.txid}`)}saveWalletLoop(){return d(this,null,function*(){const t=this.walletLocalDisklet,n=[];if(this.transactionListDirty){yield this.loadTransactions(),this.log("transactionListDirty. Saving...");let s=JSON.stringify(this.transactionList);n.push(t.setText(y.tC,s).catch(o=>{this.error("Error saving transactionList ",o)})),s=JSON.stringify(this.txIdList),n.push(t.setText(y.TD,s).catch(o=>{this.error("Error saving txIdList ",o)})),s=JSON.stringify(this.txIdMap),n.push(t.setText(y.DZ,s).catch(o=>{this.error("Error saving txIdMap ",o)})),yield Promise.all(n),this.transactionListDirty=!1}if(this.walletLocalDataDirty){this.log("walletLocalDataDirty. Saving..."),this.walletLocalData.otherData=this.otherData;const s=JSON.stringify(this.walletLocalData);yield t.setText(y.Pe,s).then(()=>{this.walletLocalDataDirty=!1}).catch(o=>{this.error("Error saving walletLocalData ",o)})}})}doInitialBalanceCallback(){var t;for(const n of this.enabledTokens)try{this.currencyEngineCallbacks.onBalanceChanged(n,(t=this.walletLocalData.totalBalances[n])!=null?t:"0")}catch(s){this.error(`doInitialBalanceCallback Error for currencyCode ${n}`,s)}}doInitialUnactivatedTokenIdsCallback(){try{this.walletLocalData.unactivatedTokenIds!=null&&this.walletLocalData.unactivatedTokenIds.length>0&&this.currencyEngineCallbacks.onUnactivatedTokenIdsChanged(this.walletLocalData.unactivatedTokenIds)}catch(t){this.error("doInitialUnactivatedTokenIdsCallback Error",t)}}addToLoop(t,n){return d(this,null,function*(){try{yield this[t]()}catch(s){this.error(`Error in Loop: ${t} `,s)}return this.engineOn&&(this.timers[t]=setTimeout(()=>{this.engineOn&&this.addToLoop(t,n).catch(s=>this.log(s.message))},n)),!0})}getTokenInfo(t){return this.allTokens.find(n=>n.currencyCode===t)}updateOnAddressesChecked(){var t,n;if(this.addressesChecked)return;const s=this.enabledTokens,o=1/s.length;let c=0,r=0;for(const m of s){const u=(t=this.tokenCheckBalanceStatus[m])!=null?t:0,T=(n=this.tokenCheckTransactionsStatus[m])!=null?n:0;c+=(u+T)/2*o,u===1&&T===1&&r++}r===s.length&&(c=1,this.addressesChecked=!0),this.log(`${this.walletId} syncRatio of: ${c}`),this.currencyEngineCallbacks.onAddressesChecked(c)}clearBlockchainCache(){return d(this,null,function*(){this.walletLocalData=(0,y.O2)({publicKey:this.walletLocalData.publicKey}),this.walletLocalDataDirty=!0,this.addressesChecked=!1,this.tokenCheckBalanceStatus={},this.tokenCheckTransactionsStatus={},this.transactionList={},this.txIdList={},this.txIdMap={},this.transactionListDirty=!0,this.setOtherData({}),yield this.saveWalletLoop()})}startEngine(){return d(this,null,function*(){this.addToLoop("saveWalletLoop",j).catch(()=>{})})}killEngine(){return d(this,null,function*(){this.engineOn=!1;for(const t in this.timers)clearTimeout(this.timers[t]);this.timers={}})}changeUserSettings(t){return d(this,null,function*(){this.currentSettings=t})}getBlockHeight(){return this.walletLocalData.blockHeight}changeCustomTokensSync(t){this.customTokens={};for(const n of Object.keys(t)){const s=t[n];try{(0,p.Rp)(s)}catch{this.log.warn(`Dropping custom token "${s.currencyCode}" / ${n}`);continue}this.customTokens[n]=s}this.allTokensMap=B(B({},this.customTokens),this.builtinTokens),this.allTokens=(0,p.ZS)(this.allTokensMap)}changeCustomTokens(t){return d(this,null,function*(){this.changeCustomTokensSync(t)})}changeEnabledTokenIdsSync(t){const{currencyCode:n}=this.currencyInfo,s=new Set,o=new Set;for(const c of t){const r=this.allTokensMap[c];r!=null&&(s.add(r.currencyCode),o.add(c))}this.enabledTokens=[...s,n],this.enabledTokenIds=[...o]}changeEnabledTokenIds(t){return d(this,null,function*(){this.changeEnabledTokenIdsSync(t)})}getBalance(t){const{currencyCode:n=this.currencyInfo.currencyCode}=t,s=this.walletLocalData.totalBalances[n];return s==null?"0":s}getNumTransactions(t){const{currencyCode:n=this.currencyInfo.currencyCode}=t;return this.walletLocalData.numTransactions[n]==null?0:this.walletLocalData.numTransactions[n]}getTransactions(t){return d(this,null,function*(){const{currencyCode:n=this.currencyInfo.currencyCode}=t;if(yield this.loadTransactions(),this.transactionList[n]==null)return[];let s=0,o=0;if(t===null)return this.transactionList[n].slice(0);t.startIndex!=null&&t.startIndex>0&&(s=t.startIndex,s>=this.transactionList[n].length&&(s=this.transactionList[n].length-1)),t.startEntries!=null&&t.startEntries>0&&(o=t.startEntries,o+s>this.transactionList[n].length&&(o=this.transactionList[n].length-s));let c=[];return o!==0?c=this.transactionList[n].slice(s,o+s):c=this.transactionList[n].slice(s),c})}getFreshAddress(t){return d(this,null,function*(){return{publicAddress:this.walletLocalData.publicKey}})}addGapLimitAddresses(t){return d(this,null,function*(){})}isAddressUsed(t){return d(this,null,function*(){return!1})}dumpData(){return d(this,null,function*(){return{walletId:this.walletId.split(" - ")[0],walletType:this.walletInfo.type,data:{pluginType:{pluginId:this.currencyInfo.pluginId},walletLocalData:this.walletLocalData}}})}makeSpendCheck(t){var n,s,o;const{skipChecks:c=!1}=t;for(const C of t.spendTargets)if(!c&&C.publicAddress===this.walletLocalData.publicKey)throw new _.l0;let r="";if(typeof t.currencyCode=="string"){if(r=t.currencyCode,r!==this.currencyInfo.currencyCode&&!this.enabledTokens.includes(r))throw new Error("Error: Token not supported or enabled")}else r=this.currencyInfo.currencyCode;const m=(n=this.walletLocalData.totalBalances[r])!=null?n:"0",u={};for(const C of t.spendTargets){const{nativeAmount:v}=C;v!=null&&(u[r]=(s=u[r])!=null?s:"0",u[r]=(0,L.add)(u[r],v))}for(const[C,v]of Object.entries(u)){const b=(o=this.walletLocalData.totalBalances[C])!=null?o:"0";if(!c&&(0,L.lt)(b,v))throw new _.C_}t.currencyCode=r;const T=(0,I.aL)(r,this.currencyInfo,this.allTokensMap);if(T==null)throw new Error("InternalErrorInvalidCurrencyCode");return{edgeSpendInfo:t,nativeBalance:m,currencyCode:r,denom:T,skipChecks:c}}checkRecipientMinimumBalance(t,n,s){return d(this,null,function*(){if((0,L.gte)(n,this.minimumAddressBalance))return;const o=yield t(s);if((0,L.lt)((0,L.add)(n,o),this.minimumAddressBalance)){const c=this.currencyInfo.denominations.find(m=>m.name===this.currencyInfo.currencyCode);if(c==null)throw new Error("Unknown denom");const r=(0,L.div)(this.minimumAddressBalance,c.multiplier);throw new Error(`Recipient address not activated. A minimum ${r} ${this.currencyInfo.currencyCode} transfer is required to send funds to this address`)}})}saveTx(t){return d(this,null,function*(){this.addTransaction(t.currencyCode,t),this.transactionsChangedArray.forEach(n=>this.warn(`executing back in saveTx and this.transactionsChangedArray is: ${(0,I.oX)(n)}`)),this.transactionsChangedArray.length>0&&this.currencyEngineCallbacks.onTransactionsChanged(this.transactionsChangedArray)})}resyncBlockchain(){return d(this,null,function*(){throw new Error("not implemented")})}makeSpend(t,n){return d(this,null,function*(){throw new Error("not implemented")})}signTx(t,n){return d(this,null,function*(){throw new Error("not implemented")})}broadcastTx(t,n){return d(this,null,function*(){throw new Error("not implemented")})}}},76714:function(F,K,D){D.d(K,{$9:function(){return M},EE:function(){return b},HB:function(){return n},HY:function(){return S},KT:function(){return d},NC:function(){return $},QJ:function(){return r},Qs:function(){return J},Sy:function(){return N},Vs:function(){return c},Wp:function(){return s},X0:function(){return W},Xp:function(){return u},Y7:function(){return V},Z8:function(){return j},aL:function(){return x},ah:function(){return P},dQ:function(){return X},f0:function(){return I},gc:function(){return B},jT:function(){return T},ml:function(){return o},nu:function(){return Z},oX:function(){return v},sD:function(){return m},vq:function(){return U},zR:function(){return O}});var L=D(77591),Q=D.n(L),_=D(48764),p=D(82448),y=(e,i,a)=>new Promise((l,f)=>{var g=k=>{try{w(a.next(k))}catch(E){f(E)}},h=k=>{try{w(a.throw(k))}catch(E){f(E)}},w=k=>k.done?l(k.value):Promise.resolve(k.value).then(g,h);w((a=a.apply(e,i)).next())});function I(e){return e.toLowerCase().replace("0x","")}function N(e){let i=e.length,a,l;for(;i!==0;)l=Math.floor(Math.random()*i),i-=1,a=e[i],e[i]=e[l],e[l]=a;return e}function R(e){return Object.keys(e).length!==0}function U(e){return/^[0-9A-F]+$/i.test(d(e))}function $(e){return(0,L.add)(e,"0",16)}function P(e){const i=e.replace("0x","");return _.Buffer.from(i,"hex")}function B(e,i){return 2*i-e.length>0?e.padStart(2*i,"0"):e}function d(e){return e.indexOf("0x")===0?e.substring(2):e}function j(e){const i=e.toLowerCase(),a=i.startsWith("0x")?i:`0x${i}`;return(0,L.add)(a,"0",10)}function W(e){return(0,L.add)(e,"0",16)}function M(e){return"0x"+_.Buffer.from(e).toString("hex")}function J(e,i,a){for(const l of i.denominations)if(l.name===e)return l;for(const l of a)for(const f of l.denominations)if(f.name===e)return f;for(const l of i.metaTokens)for(const f of l.denominations)if(f.name===e)return f}function x(e,i,a){for(const l of i.denominations)if(l.name===e)return l;for(const l of Object.keys(a)){const f=a[l];for(const g of f.denominations)if(g.name===e)return g}}const t=e=>y(void 0,null,function*(){return yield new Promise((i,a)=>setTimeout(a,e))}),n=e=>y(void 0,null,function*(){return yield new Promise(i=>setTimeout(i,e))});function s(e){return y(this,null,function*(){return yield new Promise((i,a)=>{let l=e.length;for(const f of e)f.then(g=>{i(g)},g=>{--l===0&&a(g)})})})}function o(e,i){return y(this,arguments,function*(a,l,f=a.length){const g={};return yield new Promise((h,w)=>{let k=0,E=0,z=!1;for(const G of a)G.then(H=>{const A=l(H);A!==void 0?(k++,g[A]!==void 0?g[A]++:g[A]=1,!z&&g[A]>=f&&(z=!0,h(H))):++E+k===a.length&&w(Error(`Could not resolve ${f} promises`))},H=>{++E+k===a.length&&w(H)})})})}function c(e,i){return y(this,arguments,function*(a,l,f=new Error(`Timeout of ${l}ms exceeded`)){return yield new Promise((g,h)=>{const w=setTimeout(()=>h(f),l);a.then(k=>{g(k),clearTimeout(w)},k=>{h(k),clearTimeout(w)})})})}function r(e,i=5e3){return y(this,null,function*(){let a=e.length;const l=[];for(const f of e){const g=l.length;l.push(f().catch(h=>{throw h.index=g,h})),a>1&&l.push(new Promise(h=>{n(i).then(()=>{h("async_waterfall_timed_out")})}));try{const h=yield Promise.race(l);if(h==="async_waterfall_timed_out"){const w=l.pop();w==null||w.then().catch(),--a}else return h}catch(h){const w=h.index;l.splice(w,1);const k=l.pop();if(k==null||k.then().catch(),--a,a===0)throw h}}})}function m(e,i){if(e.length<=i)return e;const a=[];for(let l=0;l<e.length&&a.length<i;++l){const f=(i-a.length)/(e.length-l);Math.random()<=f&&a.push(e[l])}return a}function u(e){const i=e.otherParams;if(i==null)throw new TypeError("Transaction is missing otherParams");return i}function T(){let e=!1;const i=[];return function(l){return y(this,null,function*(){e&&(yield new Promise(f=>i.push(()=>f(void 0))));try{return e=!0,yield l()}finally{e=!1;const f=i.shift();f!=null&&f()}})}}const C=(0,p.su)({txid:p.XC,spendTargets:(0,p.Zz)((0,p._2)((0,p.su)({currencyCode:p.XC,nativeAmount:p.XC,publicAddress:p.XC,uniqueIdentifier:(0,p.Zz)(p.XC)}))),signedTx:p.XC,otherParams:(0,p.Zz)((0,p.su)({gas:(0,p.Zz)(p.XC),gasPrice:(0,p.Zz)(p.XC),nonceUsed:(0,p.Zz)(p.XC)}))});function v(e){return JSON.stringify(C(e),null,2)}function b(e){const[i,a]=e.split("e");return a==null?e:(0,L.mul)(i,"1"+"0".repeat(parseInt(a))).toString()}function O(e){var i;return(i=e.fetchCors)!=null?i:e.fetch}function S(e){let i="";return e!=null&&(e.name!=null&&(i+=`${e.name} `),e.message!=null&&(i+=e.message)),i}function Z(...e){const i={};for(const a of e)if(a!=null)for(const l of Object.keys(a))a[l]!=null&&(i[l]=i[l]!=null&&typeof a[l]=="object"?Z(i[l],a[l]):a[l]);return i}function V(e){const[i,a]=e.split(".");return a==null?i:parseInt(a[0])>=5?(0,L.add)(i,"1"):i}const q=e=>console.log(JSON.stringify(e,null,2));function X(e,i){if(typeof e!="object"||typeof i!="object"||e==null||i==null)return e===i;const a=Array.isArray(e),l=Array.isArray(i);if(a!==l)return!1;if(a){if(e.length!==i.length)return!1;for(let h=0;h<e.length;++h)if(!X(e[h],i[h]))return!1;return!0}const f=Object.getOwnPropertyNames(e).filter(h=>e[h]!==void 0),g=Object.getOwnPropertyNames(i).filter(h=>i[h]!==void 0);if(f.length!==g.length)return!1;for(const h of f)if(!Object.prototype.hasOwnProperty.call(i,h)||!X(e[h],i[h]))return!1;return!0}const Y=(e,i)=>{for(const a of Object.keys(e)){if(typeof e[a]=="object"){if(typeof i[a]!="object"||!Y(e[a],i[a]))return!1;continue}if(e[a]!==i[a])return!1}return!0}}}]);
@@ -1,8 +0,0 @@
1
- (self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[689],{91094:function(B,M,A){var d=A(34155),w;/**
2
- * [js-sha3]{@link https://github.com/emn178/js-sha3}
3
- *
4
- * @version 0.8.0
5
- * @author Chen, Yi-Cyuan [emn178@gmail.com]
6
- * @copyright Chen, Yi-Cyuan 2015-2018
7
- * @license MIT
8
- */(function(){"use strict";var _="input is invalid type",Kt="finalize already called",F=typeof window=="object",y=F?window:{};y.JS_SHA3_NO_WINDOW&&(F=!1);var gt=!F&&typeof self=="object",Ut=!y.JS_SHA3_NO_NODE_JS&&typeof d=="object"&&d.versions&&d.versions.node;Ut?y=A.g:gt&&(y=self);var Zt=!y.JS_SHA3_NO_COMMON_JS&&!0&&B.exports,Qt=A.amdO,E=!y.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",b="0123456789abcdef".split(""),$t=[31,7936,2031616,520093696],Ht=[4,1024,262144,67108864],mt=[1,256,65536,16777216],qt=[6,1536,393216,100663296],p=[0,8,16,24],Pt=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],zt=[224,256,384,512],Dt=[128,256],Tt=["hex","buffer","arrayBuffer","array","digest"],Jt={128:168,256:136};(y.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),E&&(y.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var Wt=function(t,e,r){return function(n){return new h(t,e,t).update(n)[r]()}},jt=function(t,e,r){return function(n,a){return new h(t,e,a).update(n)[r]()}},Yt=function(t,e,r){return function(n,a,i,f){return v["cshake"+t].update(n,a,i,f)[r]()}},Vt=function(t,e,r){return function(n,a,i,f){return v["kmac"+t].update(n,a,i,f)[r]()}},R=function(t,e,r,n){for(var a=0;a<Tt.length;++a){var i=Tt[a];t[i]=e(r,n,i)}return t},Gt=function(t,e){var r=Wt(t,e,"hex");return r.create=function(){return new h(t,e,t)},r.update=function(n){return r.create().update(n)},R(r,Wt,t,e)},st=function(t,e){var r=jt(t,e,"hex");return r.create=function(n){return new h(t,e,n)},r.update=function(n,a){return r.create(a).update(n)},R(r,jt,t,e)},te=function(t,e){var r=Jt[t],n=Yt(t,e,"hex");return n.create=function(a,i,f){return!i&&!f?v["shake"+t].create(a):new h(t,e,a).bytepad([i,f],r)},n.update=function(a,i,f,o){return n.create(i,f,o).update(a)},R(n,Yt,t,e)},ee=function(t,e){var r=Jt[t],n=Vt(t,e,"hex");return n.create=function(a,i,f){return new Nt(t,e,i).bytepad(["KMAC",f],r).bytepad([a],r)},n.update=function(a,i,f,o){return n.create(a,f,o).update(i)},R(n,Vt,t,e)},Lt=[{name:"keccak",padding:mt,bits:zt,createMethod:Gt},{name:"sha3",padding:qt,bits:zt,createMethod:Gt},{name:"shake",padding:$t,bits:Dt,createMethod:st},{name:"cshake",padding:Ht,bits:Dt,createMethod:te},{name:"kmac",padding:Ht,bits:Dt,createMethod:ee}],v={},S=[],x=0;x<Lt.length;++x)for(var k=Lt[x],D=k.bits,C=0;C<D.length;++C){var It=k.name+"_"+D[C];if(S.push(It),v[It]=k.createMethod(D[C],k.padding),k.name!=="sha3"){var Xt=k.name+D[C];S.push(Xt),v[Xt]=v[It]}}function h(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(r&31)>>3;for(var n=0;n<50;++n)this.s[n]=0}h.prototype.update=function(t){if(this.finalized)throw new Error(Kt);var e,r=typeof t;if(r!=="string"){if(r==="object"){if(t===null)throw new Error(_);if(E&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!E||!ArrayBuffer.isView(t)))throw new Error(_)}else throw new Error(_);e=!0}for(var n=this.blocks,a=this.byteCount,i=t.length,f=this.blockCount,o=0,l=this.s,u,c;o<i;){if(this.reset)for(this.reset=!1,n[0]=this.block,u=1;u<f+1;++u)n[u]=0;if(e)for(u=this.start;o<i&&u<a;++o)n[u>>2]|=t[o]<<p[u++&3];else for(u=this.start;o<i&&u<a;++o)c=t.charCodeAt(o),c<128?n[u>>2]|=c<<p[u++&3]:c<2048?(n[u>>2]|=(192|c>>6)<<p[u++&3],n[u>>2]|=(128|c&63)<<p[u++&3]):c<55296||c>=57344?(n[u>>2]|=(224|c>>12)<<p[u++&3],n[u>>2]|=(128|c>>6&63)<<p[u++&3],n[u>>2]|=(128|c&63)<<p[u++&3]):(c=65536+((c&1023)<<10|t.charCodeAt(++o)&1023),n[u>>2]|=(240|c>>18)<<p[u++&3],n[u>>2]|=(128|c>>12&63)<<p[u++&3],n[u>>2]|=(128|c>>6&63)<<p[u++&3],n[u>>2]|=(128|c&63)<<p[u++&3]);if(this.lastByteIndex=u,u>=a){for(this.start=u-a,this.block=n[f],u=0;u<f;++u)l[u]^=n[u];O(l),this.reset=!0}else this.start=u}return this},h.prototype.encode=function(t,e){var r=t&255,n=1,a=[r];for(t=t>>8,r=t&255;r>0;)a.unshift(r),t=t>>8,r=t&255,++n;return e?a.push(n):a.unshift(n),this.update(a),a.length},h.prototype.encodeString=function(t){var e,r=typeof t;if(r!=="string"){if(r==="object"){if(t===null)throw new Error(_);if(E&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!E||!ArrayBuffer.isView(t)))throw new Error(_)}else throw new Error(_);e=!0}var n=0,a=t.length;if(e)n=a;else for(var i=0;i<t.length;++i){var f=t.charCodeAt(i);f<128?n+=1:f<2048?n+=2:f<55296||f>=57344?n+=3:(f=65536+((f&1023)<<10|t.charCodeAt(++i)&1023),n+=4)}return n+=this.encode(n*8),this.update(t),n},h.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var a=e-r%e,i=[];return i.length=a,this.update(i),this},h.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[e&3],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];O(n)}},h.prototype.toString=h.prototype.hex=function(){this.finalize();for(var t=this.blockCount,e=this.s,r=this.outputBlocks,n=this.extraBytes,a=0,i=0,f="",o;i<r;){for(a=0;a<t&&i<r;++a,++i)o=e[a],f+=b[o>>4&15]+b[o&15]+b[o>>12&15]+b[o>>8&15]+b[o>>20&15]+b[o>>16&15]+b[o>>28&15]+b[o>>24&15];i%t===0&&(O(e),a=0)}return n&&(o=e[a],f+=b[o>>4&15]+b[o&15],n>1&&(f+=b[o>>12&15]+b[o>>8&15]),n>2&&(f+=b[o>>20&15]+b[o>>16&15])),f},h.prototype.arrayBuffer=function(){this.finalize();var t=this.blockCount,e=this.s,r=this.outputBlocks,n=this.extraBytes,a=0,i=0,f=this.outputBits>>3,o;n?o=new ArrayBuffer(r+1<<2):o=new ArrayBuffer(f);for(var l=new Uint32Array(o);i<r;){for(a=0;a<t&&i<r;++a,++i)l[i]=e[a];i%t===0&&O(e)}return n&&(l[a]=e[a],o=o.slice(0,f)),o},h.prototype.buffer=h.prototype.arrayBuffer,h.prototype.digest=h.prototype.array=function(){this.finalize();for(var t=this.blockCount,e=this.s,r=this.outputBlocks,n=this.extraBytes,a=0,i=0,f=[],o,l;i<r;){for(a=0;a<t&&i<r;++a,++i)o=i<<2,l=e[a],f[o]=l&255,f[o+1]=l>>8&255,f[o+2]=l>>16&255,f[o+3]=l>>24&255;i%t===0&&O(e)}return n&&(o=i<<2,l=e[a],f[o]=l&255,n>1&&(f[o+1]=l>>8&255),n>2&&(f[o+2]=l>>16&255)),f};function Nt(t,e,r){h.call(this,t,e,r)}Nt.prototype=new h,Nt.prototype.finalize=function(){return this.encode(this.outputBits,!0),h.prototype.finalize.call(this)};var O=function(t){var e,r,n,a,i,f,o,l,u,c,I,N,K,g,U,H,P,z,T,J,W,j,Y,V,G,L,X,Z,Q,$,m,q,s,tt,et,rt,nt,at,ot,it,ft,ut,ct,ht,lt,bt,pt,dt,yt,vt,xt,At,_t,kt,Bt,wt,Ft,Et,St,Ct,Ot,Mt,Rt;for(n=0;n<48;n+=2)a=t[0]^t[10]^t[20]^t[30]^t[40],i=t[1]^t[11]^t[21]^t[31]^t[41],f=t[2]^t[12]^t[22]^t[32]^t[42],o=t[3]^t[13]^t[23]^t[33]^t[43],l=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],I=t[7]^t[17]^t[27]^t[37]^t[47],N=t[8]^t[18]^t[28]^t[38]^t[48],K=t[9]^t[19]^t[29]^t[39]^t[49],e=N^(f<<1|o>>>31),r=K^(o<<1|f>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=a^(l<<1|u>>>31),r=i^(u<<1|l>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=f^(c<<1|I>>>31),r=o^(I<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=l^(N<<1|K>>>31),r=u^(K<<1|N>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(a<<1|i>>>31),r=I^(i<<1|a>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,g=t[0],U=t[1],bt=t[11]<<4|t[10]>>>28,pt=t[10]<<4|t[11]>>>28,Z=t[20]<<3|t[21]>>>29,Q=t[21]<<3|t[20]>>>29,Ct=t[31]<<9|t[30]>>>23,Ot=t[30]<<9|t[31]>>>23,ut=t[40]<<18|t[41]>>>14,ct=t[41]<<18|t[40]>>>14,tt=t[2]<<1|t[3]>>>31,et=t[3]<<1|t[2]>>>31,H=t[13]<<12|t[12]>>>20,P=t[12]<<12|t[13]>>>20,dt=t[22]<<10|t[23]>>>22,yt=t[23]<<10|t[22]>>>22,$=t[33]<<13|t[32]>>>19,m=t[32]<<13|t[33]>>>19,Mt=t[42]<<2|t[43]>>>30,Rt=t[43]<<2|t[42]>>>30,kt=t[5]<<30|t[4]>>>2,Bt=t[4]<<30|t[5]>>>2,rt=t[14]<<6|t[15]>>>26,nt=t[15]<<6|t[14]>>>26,z=t[25]<<11|t[24]>>>21,T=t[24]<<11|t[25]>>>21,vt=t[34]<<15|t[35]>>>17,xt=t[35]<<15|t[34]>>>17,q=t[45]<<29|t[44]>>>3,s=t[44]<<29|t[45]>>>3,V=t[6]<<28|t[7]>>>4,G=t[7]<<28|t[6]>>>4,wt=t[17]<<23|t[16]>>>9,Ft=t[16]<<23|t[17]>>>9,at=t[26]<<25|t[27]>>>7,ot=t[27]<<25|t[26]>>>7,J=t[36]<<21|t[37]>>>11,W=t[37]<<21|t[36]>>>11,At=t[47]<<24|t[46]>>>8,_t=t[46]<<24|t[47]>>>8,ht=t[8]<<27|t[9]>>>5,lt=t[9]<<27|t[8]>>>5,L=t[18]<<20|t[19]>>>12,X=t[19]<<20|t[18]>>>12,Et=t[29]<<7|t[28]>>>25,St=t[28]<<7|t[29]>>>25,it=t[38]<<8|t[39]>>>24,ft=t[39]<<8|t[38]>>>24,j=t[48]<<14|t[49]>>>18,Y=t[49]<<14|t[48]>>>18,t[0]=g^~H&z,t[1]=U^~P&T,t[10]=V^~L&Z,t[11]=G^~X&Q,t[20]=tt^~rt&at,t[21]=et^~nt&ot,t[30]=ht^~bt&dt,t[31]=lt^~pt&yt,t[40]=kt^~wt&Et,t[41]=Bt^~Ft&St,t[2]=H^~z&J,t[3]=P^~T&W,t[12]=L^~Z&$,t[13]=X^~Q&m,t[22]=rt^~at&it,t[23]=nt^~ot&ft,t[32]=bt^~dt&vt,t[33]=pt^~yt&xt,t[42]=wt^~Et&Ct,t[43]=Ft^~St&Ot,t[4]=z^~J&j,t[5]=T^~W&Y,t[14]=Z^~$&q,t[15]=Q^~m&s,t[24]=at^~it&ut,t[25]=ot^~ft&ct,t[34]=dt^~vt&At,t[35]=yt^~xt&_t,t[44]=Et^~Ct&Mt,t[45]=St^~Ot&Rt,t[6]=J^~j&g,t[7]=W^~Y&U,t[16]=$^~q&V,t[17]=m^~s&G,t[26]=it^~ut&tt,t[27]=ft^~ct&et,t[36]=vt^~At&ht,t[37]=xt^~_t&lt,t[46]=Ct^~Mt&kt,t[47]=Ot^~Rt&Bt,t[8]=j^~g&H,t[9]=Y^~U&P,t[18]=q^~V&L,t[19]=s^~G&X,t[28]=ut^~tt&rt,t[29]=ct^~et&nt,t[38]=At^~ht&bt,t[39]=_t^~lt&pt,t[48]=Mt^~kt&wt,t[49]=Rt^~Bt&Ft,t[0]^=Pt[n],t[1]^=Pt[n+1]};if(Zt)B.exports=v;else{for(x=0;x<S.length;++x)y[S[x]]=v[S[x]];Qt&&(w=function(){return v}.call(M,A,M,B),w!==void 0&&(B.exports=w))}})()},35620:function(B,M,A){"use strict";A.d(M,{US:function(){return F},YU:function(){return w}});var d=A(79911);const w=d.base16,_=d.base32,Kt=d.base32hex,F=d.base64,y=d.base64url,gt=d.codec;var Ut=null}}]);
@@ -1,35 +0,0 @@
1
- "use strict";(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[826],{15179:function(xr,Ke,z){z.d(Ke,{lP:function(){return He},Hx:function(){return Zt},xR:function(){return B},Jj:function(){return g},c6:function(){return Je},Jz:function(){return _},VG:function(){return S},f1:function(){return j},_q:function(){return he},uQ:function(){return Y},AU:function(){return o},AQ:function(){return de},YW:function(){return K},pB:function(){return ht},zM:function(){return E}});var Ze=z(29931),Ye=z.n(Ze),_t=z(33715),Qe=z(13550),J=z.n(Qe),Ie=z(86266),ye=function(r,t){return ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},ye(r,t)};function Nr(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ye(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Te=function(){return Te=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Te.apply(this,arguments)};function Er(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e}function a(r,t,e,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,e,n);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(s=(i<3?c(s):i>3?c(t,e,s):c(t,e))||s);return i>3&&s&&Object.defineProperty(t,e,s),s}function Ir(r,t){return function(e,n){t(e,n,r)}}function Tr(r,t,e,n,i,s){function c(m){if(m!==void 0&&typeof m!="function")throw new TypeError("Function expected");return m}for(var u=n.kind,f=u==="getter"?"get":u==="setter"?"set":"value",l=!t&&r?n.static?r:r.prototype:null,b=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),v,x=!1,w=e.length-1;w>=0;w--){var d={};for(var h in n)d[h]=h==="access"?{}:n[h];for(var h in n.access)d.access[h]=n.access[h];d.addInitializer=function(m){if(x)throw new TypeError("Cannot add initializers after decoration has completed");s.push(c(m||null))};var p=(0,e[w])(u==="accessor"?{get:b.get,set:b.set}:b[f],d);if(u==="accessor"){if(p===void 0)continue;if(p===null||typeof p!="object")throw new TypeError("Object expected");(v=c(p.get))&&(b.get=v),(v=c(p.set))&&(b.set=v),(v=c(p.init))&&i.push(v)}else(v=c(p))&&(u==="field"?i.push(v):b[f]=v)}l&&Object.defineProperty(l,n.name,b),x=!0}function Br(r,t,e){for(var n=arguments.length>2,i=0;i<t.length;i++)e=n?t[i].call(r,e):t[i].call(r);return n?e:void 0}function Pr(r){return typeof r=="symbol"?r:"".concat(r)}function Rr(r,t,e){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:e?"".concat(e," ",t):t})}function Or(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}function Cr(r,t,e,n){function i(s){return s instanceof e?s:new e(function(c){c(s)})}return new(e||(e=Promise))(function(s,c){function u(b){try{l(n.next(b))}catch(v){c(v)}}function f(b){try{l(n.throw(b))}catch(v){c(v)}}function l(b){b.done?s(b.value):i(b.value).then(u,f)}l((n=n.apply(r,t||[])).next())})}function Vr(r,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(l){return function(b){return f([l,b])}}function f(l){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(e=0)),e;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){e.label=l[1];break}if(l[0]===6&&e.label<s[1]){e.label=s[1],s=l;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(l);break}s[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(r,e)}catch(b){l=[6,b],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var Be=Object.create?function(r,t,e,n){n===void 0&&(n=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,i)}:function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]};function jr(r,t){for(var e in r)e!=="default"&&!Object.prototype.hasOwnProperty.call(t,e)&&Be(t,r,e)}function Pe(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xe(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,s=[],c;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(c)throw c.error}}return s}function Ur(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(Xe(arguments[t]));return r}function Dr(){for(var r=0,t=0,e=arguments.length;t<e;t++)r+=arguments[t].length;for(var n=Array(r),i=0,t=0;t<e;t++)for(var s=arguments[t],c=0,u=s.length;c<u;c++,i++)n[i]=s[c];return n}function Wr(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return r.concat(s||Array.prototype.slice.call(t))}function Qt(r){return this instanceof Qt?(this.v=r,this):new Qt(r)}function Fr(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),i,s=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(x){n[x]&&(i[x]=function(w){return new Promise(function(d,h){s.push([x,w,d,h])>1||u(x,w)})})}function u(x,w){try{f(n[x](w))}catch(d){v(s[0][3],d)}}function f(x){x.value instanceof Qt?Promise.resolve(x.value.v).then(l,b):v(s[0][2],x)}function l(x){u("next",x)}function b(x){u("throw",x)}function v(x,w){x(w),s.shift(),s.length&&u(s[0][0],s[0][1])}}function $r(r){var t,e;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=r[i]?function(c){return(e=!e)?{value:Qt(r[i](c)),done:!1}:s?s(c):c}:s}}function qr(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof Pe=="function"?Pe(r):r[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(s){e[s]=r[s]&&function(c){return new Promise(function(u,f){c=r[s](c),i(u,f,c.done,c.value)})}}function i(s,c,u,f){Promise.resolve(f).then(function(l){s({value:l,done:u})},c)}}function Mr(r,t){return Object.defineProperty?Object.defineProperty(r,"raw",{value:t}):r.raw=t,r}var tr=Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t};function Lr(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.prototype.hasOwnProperty.call(r,e)&&Be(t,r,e);return tr(t,r),t}function Gr(r){return r&&r.__esModule?r:{default:r}}function zr(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)}function Jr(r,t,e,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,e):i?i.value=e:t.set(r,e),e}function Hr(r,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?t===r:r.has(t)}/**
2
- * EOSIO Core v0.6.8
3
- * https://github.com/greymass/eosio-core
4
- *
5
- * @license
6
- * Copyright (c) 2020 FFF00 Agents AB & Greymass Inc. All Rights Reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without modification,
9
- * are permitted provided that the following conditions are met:
10
- *
11
- * 1. Redistribution of source code must retain the above copyright notice, this
12
- * list of conditions and the following disclaimer.
13
- *
14
- * 2. Redistribution in binary form must reproduce the above copyright notice,
15
- * this list of conditions and the following disclaimer in the documentation
16
- * and/or other materials provided with the distribution.
17
- *
18
- * 3. Neither the name of the copyright holder nor the names of its contributors
19
- * may be used to endorse or promote products derived from this software without
20
- * specific prior written permission.
21
- *
22
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
26
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31
- * OF THE POSSIBILITY OF SUCH DAMAGE.
32
- *
33
- * YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR INTENDED FOR USE
34
- * IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY MILITARY FACILITY.
35
- */function Xt(r,t){const e=r.length;if(e!==t.length)return!1;for(let n=0;n<e;n++)if(r[n]!==t[n])return!1;return!0}function er(r,t){const e=r.length;if(e!==t.length)return!1;for(let n=0;n<e;n++)if(!r[n].equals(t[n]))return!1;return!0}const it={};function Re(){it.enc=new Array(255),it.dec={};for(let r=0;r<=255;++r){const t=r.toString(16).padStart(2,"0");it.enc[r]=t,it.dec[t]=r}}function Oe(r){it.enc||Re();const t=r.length,e=new Array(t);for(let n=0;n<t;++n)e[n]=it.enc[r[n]];return e.join("")}function rr(r){if(it.dec||Re(),typeof r!="string")throw new Error("Expected string containing hex digits");if(r.length%2)throw new Error("Odd number of hex digits");r=r.toLowerCase();const t=r.length/2,e=new Uint8Array(t);for(let n=0;n<t;n++){const i=it.dec[r[n*2]+r[n*2+1]];if(i===void 0)throw new Error("Expected hex string");e[n]=i}return e}function te(r){return Ye()(r)}let Ce=!1;function y(r,t){if(r instanceof t)return!0;if(r==null||typeof r!="object")return!1;const e=t.__className||t.abiName;if(!e)return!1;let n=r.constructor,i=!1;for(;n&&!i;){const s=n.__className||n.abiName;if(!s)break;i=e==s,n=Object.getPrototypeOf(n)}return i&&!Ce&&(console.warn(`Detected alien instance of ${e}, this usually means more than one version of @greymass/eosio has been included in your bundle.`),Ce=!0),i}class g{constructor(t=new Uint8Array){this.array=t}static from(t,e){return y(t,this)?t:typeof t=="string"?this.fromString(t,e):ArrayBuffer.isView(t)?new this(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)):y(t.array,Uint8Array)?new this(t.array):new this(new Uint8Array(t))}static fromString(t,e="hex"){if(e==="hex"){const n=rr(t);return new this(n)}else if(e=="utf8"){const n=new TextEncoder;return new this(n.encode(t))}else throw new Error(`Unknown encoding: ${e}`)}static fromABI(t){const e=t.readVaruint32();return new this(t.readArray(e))}static abiDefault(){return new g}static equal(t,e){return this.from(t).equals(this.from(e))}static random(t){return new this(te(t))}static isBytes(t){return!!(y(t,g)||y(t,Uint8Array)||Array.isArray(t)&&t.every(e=>typeof e=="number")||typeof t=="string"&&(/[\da-f]/i.test(t)||t===""))}get length(){return this.array.byteLength}get hexString(){return Oe(this.array)}get utf8String(){return new TextDecoder().decode(this.array)}append(t){t=g.from(t);const e=this.array.byteLength+t.array.byteLength,n=new ArrayBuffer(e),i=new Uint8Array(n);i.set(this.array),i.set(t.array,this.array.byteLength),this.array=i}appending(t){const e=new g(this.array);return e.append(t),e}zeropad(t,e=!1){const n=e?t:Math.max(t,this.array.byteLength),i=new ArrayBuffer(n),s=new Uint8Array(i);s.fill(0),e&&this.array.byteLength>n?s.set(this.array.slice(0,n),0):s.set(this.array,n-this.array.byteLength),this.array=s}zeropadded(t,e=!1){const n=new g(this.array);return n.zeropad(t,e),n}dropFirst(t=1){this.array=this.array.subarray(t)}droppingFirst(t=1){return new g(this.array.subarray(t))}copy(){const t=new ArrayBuffer(this.array.byteLength),e=new Uint8Array(t);return e.set(this.array),new g(e)}equals(t){return Xt(this.array,g.from(t).array)}toString(t="hex"){if(t==="hex")return this.hexString;if(t==="utf8")return this.utf8String;throw new Error(`Unknown encoding: ${t}`)}toABI(t){t.writeVaruint32(this.array.byteLength),t.writeArray(this.array)}toJSON(){return this.hexString}}g.abiName="bytes";class vt{constructor(t){const e=this.constructor.byteSize;if(t.byteLength!==e)throw new Error(`Checksum size mismatch, expected ${e} bytes got ${t.byteLength}`);this.array=t}static from(t){return y(t,this)?t:y(t,vt)?new this(t.array):new this(g.from(t).array)}static fromABI(t){return new this(t.readArray(this.byteSize))}static abiDefault(){return new this(new Uint8Array(this.byteSize))}equals(t){const e=this.constructor;try{return Xt(this.array,e.from(t).array)}catch{return!1}}get hexString(){return Oe(this.array)}toABI(t){t.writeArray(this.array)}toString(){return this.hexString}toJSON(){return this.toString()}}vt.abiName="__checksum";class T extends vt{static from(t){return super.from(t)}static hash(t){const e=new Uint8Array((0,_t.sha256)().update(g.from(t).array).digest());return new T(e)}}T.abiName="checksum256",T.byteSize=32;class At extends vt{static from(t){return super.from(t)}static hash(t){const e=new Uint8Array((0,_t.sha512)().update(g.from(t).array).digest());return new At(e)}}At.abiName="checksum512",At.byteSize=64;class pt extends vt{static from(t){return super.from(t)}static hash(t){const e=new Uint8Array((0,_t.ripemd160)().update(g.from(t).array).digest());return new pt(e)}}pt.abiName="checksum160",pt.byteSize=20;var _;(function(r){r.K1="K1",r.R1="R1",r.WA="WA"})(_||(_={})),function(r){function t(n){switch(n){case r.K1:return 0;case r.R1:return 1;case r.WA:return 2;default:throw new Error(`Unknown curve type: ${n}`)}}r.indexFor=t;function e(n){let i;switch(typeof n!="number"?i=r.indexFor(n):i=n,i){case 0:return r.K1;case 1:return r.R1;case 2:return r.WA;default:throw new Error("Unknown curve type")}}r.from=e}(_||(_={}));class A{constructor(t){const e=this.constructor;if(e.isSigned===void 0||e.byteWidth===void 0)throw new Error("Cannot instantiate abstract class Int");if(t.gt(e.max))throw new Error(`Number ${t} overflows ${e.abiName}`);if(t.lt(e.min))throw new Error(`Number ${t} underflows ${e.abiName}`);this.value=t}static get max(){return new(J())(2).pow(new(J())(this.byteWidth*8-(this.isSigned?1:0))).isubn(1)}static get min(){return this.isSigned?this.max.ineg().isubn(1):new(J())(0)}static add(t,e,n="truncate"){return A.operator(t,e,n,(i,s)=>i.add(s))}static sub(t,e,n){return A.operator(t,e,n,(i,s)=>i.sub(s))}static mul(t,e,n){return A.operator(t,e,n,(i,s)=>i.mul(s))}static div(t,e,n){return A.operator(t,e,n,(i,s)=>{if(s.isZero())throw new Error("Division by zero");return i.div(s)})}static divRound(t,e,n){return A.operator(t,e,n,(i,s)=>{if(s.isZero())throw new Error("Division by zero");return i.divRound(s)})}static divCeil(t,e,n){return A.operator(t,e,n,(i,s)=>{if(s.isZero())throw new Error("Division by zero");const c=i.divmod(s);return c.mod.isZero()?c.div:c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)})}static operator(t,e,n="truncate",i){const{a:s,b:c}=or(t,e),u=s.constructor,f=i(s.value,c.value);return u.from(f,n)}static from(t,e){if(y(t,this))return t;let n=this,i;if(y(t,A))n=t.constructor,i=t.value.clone();else if(t instanceof Uint8Array)i=new(J())(t,void 0,"le"),n.isSigned&&(i=i.fromTwos(n.byteWidth*8));else{if(typeof t=="string"&&!/[0-9]+/.test(t)||typeof t=="number"&&!Number.isFinite(t))throw new Error("Invalid number");i=J().isBN(t)?t.clone():new(J())(t,10),i.isNeg()&&!n.isSigned&&(n={byteWidth:n.byteWidth,isSigned:!0})}switch(e){case"clamp":i=nr(i,this.min,this.max);break;case"truncate":i=ir(i,n,this);break}return new this(i)}static fromABI(t){return this.from(t.readArray(this.byteWidth))}static abiDefault(){return this.from(0)}static random(){return this.from(te(this.byteWidth))}cast(t,e="truncate"){return this.constructor===t?this:t.from(this,e)}get byteArray(){const t=this.constructor;return(t.isSigned?this.value.toTwos(t.byteWidth*8):this.value).toArrayLike(Uint8Array,"le",t.byteWidth)}equals(t,e=!1){const n=this.constructor;if(e===!0&&y(t,A)){const i=t.constructor;if(n.byteWidth!==i.byteWidth||n.isSigned!==i.isSigned)return!1}try{return this.value.eq(n.from(t).value)}catch{return!1}}add(t){this.value=this.operator(t,A.add).value}adding(t){return this.operator(t,A.add)}subtract(t){this.value=this.operator(t,A.sub).value}subtracting(t){return this.operator(t,A.sub)}multiply(t){this.value=this.operator(t,A.mul).value}multiplying(t){return this.operator(t,A.mul)}divide(t,e){this.value=this.dividing(t,e).value}dividing(t,e){let n=A.div;switch(e){case"ceil":n=A.divCeil;break;case"round":n=A.divRound;break}return this.operator(t,n)}operator(t,e){let n;return y(t,A)?n=t:n=U.from(t,"truncate"),e(this,n).cast(this.constructor)}toNumber(){return this.value.toNumber()}toString(){return this.value.toString()}[Symbol.toPrimitive](t){return t==="number"?this.toNumber():this.toString()}toABI(t){t.writeArray(this.byteArray)}toJSON(){return this.value.bitLength()>32?this.value.toString():this.value.toNumber()}}A.abiName="__int";class ee extends A{}ee.abiName="int8",ee.byteWidth=1,ee.isSigned=!0;class re extends A{}re.abiName="int16",re.byteWidth=2,re.isSigned=!0;class et extends A{}et.abiName="int32",et.byteWidth=4,et.isSigned=!0;class U extends A{}U.abiName="int64",U.byteWidth=8,U.isSigned=!0;class ne extends A{}ne.abiName="int128",ne.byteWidth=16,ne.isSigned=!0;class ie extends A{}ie.abiName="uint8",ie.byteWidth=1,ie.isSigned=!1;class Ot extends A{}Ot.abiName="uint16",Ot.byteWidth=2,Ot.isSigned=!1;class V extends A{}V.abiName="uint32",V.byteWidth=4,V.isSigned=!1;class E extends A{}E.abiName="uint64",E.byteWidth=8,E.isSigned=!1;class ht extends A{}ht.abiName="uint128",ht.byteWidth=16,ht.isSigned=!1;class oe extends A{static fromABI(t){return new this(new(J())(t.readVarint32()))}toABI(t){t.writeVarint32(Number(this))}}oe.abiName="varint32",oe.byteWidth=32,oe.isSigned=!0;class se extends A{static fromABI(t){return new this(new(J())(t.readVaruint32()))}toABI(t){t.writeVaruint32(Number(this))}}se.abiName="varuint32",se.byteWidth=32,se.isSigned=!1;function nr(r,t,e){return J().min(J().max(r,t),e)}function ir(r,t,e){const n=r.isNeg()?255:0,s=(t.isSigned?r.toTwos(t.byteWidth*8):r).toArrayLike(Uint8Array,"le"),c=new Uint8Array(e.byteWidth);c.fill(n),c.set(s.slice(0,e.byteWidth));const u=new(J())(c,void 0,"le");return e.isSigned?u.fromTwos(e.byteWidth*8):u}function or(r,t){r=Ve(r),t=Ve(t);const e=r.constructor,n=t.constructor;return e!==n&&(e.isSigned===n.isSigned?e.byteWidth>n.byteWidth?t=t.cast(e):n.byteWidth>e.byteWidth&&(r=r.cast(n)):e.isSigned===!1&&e.byteWidth>=n.byteWidth?t=t.cast(e):n.isSigned===!1&&n.byteWidth>=e.byteWidth?r=r.cast(n):e.isSigned===!0&&e.max.gte(n.max)&&e.min.lte(n.min)?t=t.cast(e):n.isSigned===!0&&n.max.gte(e.max)&&n.min.lte(e.min)&&(r=r.cast(n))),{a:r,b:t}}function Ve(r){let t=r;return r.constructor.byteWidth<4&&(t=r.cast(et)),t}function me(r){const t=[],e=[],n=[],i=new Set,s=f=>{let l;return typeof f.type!="string"?l=c(f.type):l=f.type,f.array===!0&&(l+="[]"),f.optional===!0&&(l+="?"),f.extension===!0&&(l+="$"),l},c=f=>{if(f.abiName){if(f.abiName==="__struct")throw new Error("Misconfigured Struct subclass, did you forget @Struct.type?")}else throw new Error("Encountered non-conforming type");if(i.has(f))return f.abiName;if(i.add(f),f.abiAlias)n.push({new_type_name:f.abiName,type:s(f.abiAlias)});else if(f.abiFields){const l=f.abiFields.map(v=>({name:v.name,type:s(v)})),b={base:f.abiBase?c(f.abiBase):"",name:f.abiName,fields:l};t.push(b)}else if(f.abiVariant){const l={name:f.abiName,types:f.abiVariant.map(s)};e.push(l)}return f.abiName},u=c(r);return{abi:P.from({structs:t,variants:e,types:n}),types:Array.from(i),root:u}}function ae(r){let t=typeof r.type=="string"?r.type:r.type.abiName;return r.array===!0&&(t+="[]"),r.optional===!0&&(t+="?"),r.extension===!0&&(t+="$"),t}function sr(r){return typeof r!="string"&&r.abiName===void 0&&r.type!==void 0}function je(r){return typeof r=="string"?{type:r}:typeof r.abiName<"u"?{type:r}:r}const Ue={abiName:"string",abiDefault:()=>"",fromABI:r=>r.readString(),from:r=>r,toABI:(r,t)=>{t.writeString(r)}},De={abiName:"bool",abiDefault:()=>!1,fromABI:r=>r.readByte()===1,from:r=>r,toABI:(r,t)=>{t.writeByte(r===!0?1:0)}};function ar(){return[De,Ue,B,B.Symbol,B.SymbolCode,pe,g,pt,T,At,Dt,le,_e,fe,ne,re,et,U,ee,S,W,H,qe,de,ht,Ot,V,E,ie,oe,se]}function ge(r=[]){const t={},e=ar();for(const n of e)t[n.abiName]=n;for(const n of r){if(!n.abiName)throw new Error("Invalid type");t[n.abiName]=n}return t}function be(r){if(r.constructor&&r.constructor.abiName!==void 0)return r.constructor.abiName;if(Array.isArray(r)){const t=r.map(be),e=t[0];return!e||!t.every(n=>n===e)?void 0:e+"[]"}switch(typeof r){case"boolean":return"bool";case"string":return"string"}}function we(r,t="jsobj"){var e;if(r.constructor&&r.constructor.abiName!==void 0)return r.constructor;if(Array.isArray(r)){const i=r.map(c=>we(c,t)),s=i[0];return!s||!i.every(c=>c&&c.abiName===s.abiName)?void 0:s}const n=typeof r;if(n==="object"&&r!==null){const i=Object.keys(r).map(s=>({name:s,type:we(r[s],t+"_nested")}));return i.find(s=>!s.type)?void 0:(e=class extends o{},e.abiName=t,e.abiFields=i,e)}switch(n){case"boolean":return De;case"string":return Ue}}class We extends Error{constructor(t,e){const n=t.codingPath.map(({field:i,type:s})=>typeof i=="number"?i:`${i}<${s.typeName}>`).join(".");super(`Decoding error at ${n}: ${e.message}`),this.stack=e.stack,this.ctx=t,this.underlyingError=e}}We.__className="DecodingError";function yt(r){const t=je(r.type),e=ae(t),n=r.customTypes||[];let i;if(r.abi)i=P.from(r.abi);else try{let u;if(typeof t.type=="string"){const l=ge(n),b=new P.ResolvedType(t.type).name;if(u=l[b],!u)throw new Error(`Unknown type: ${t.type}`)}else u=t.type;const f=me(u);i=f.abi,n.push(...f.types)}catch(u){throw Error(`Unable to synthesize ABI for: ${e} (${u.message}). To decode non-class types you need to pass the ABI definition manually.`)}const s=i.resolveType(e);typeof t.type!="string"&&n.unshift(t.type);const c={types:ge(n),strictExtensions:r.strictExtensions||!1,codingPath:[{field:"root",type:s}]};try{if(r.data||r.data===""){let u;if(y(r.data,jt))u=r.data;else{const f=g.from(r.data);u=new jt(f.array)}return r.metadata&&(u.metadata=r.metadata),ce(s,u,c)}else{if(r.object!==void 0)return Ct(r.object,s,c);if(r.json)return Ct(JSON.parse(r.json),s,c);throw new Error("Nothing to decode, you must set one of data, json, object")}}catch(u){throw new We(c,u)}}const mt=Symbol("Resolved");function ce(r,t,e){if(e.codingPath.length>32)throw new Error("Maximum decoding depth exceeded");if(r.isExtension&&!t.canRead())return e.strictExtensions?Vt(r,e):null;if(r.isOptional&&t.readByte()===0)return null;if(r.isArray){const i=t.readVaruint32(),s=[];for(let c=0;c<i;c++)e.codingPath.push({field:c,type:r}),s.push(n()),e.codingPath.pop();return s}else return n();function n(){const i=e.types[r.name];if(i&&i.fromABI)return i.fromABI(t);if(r.ref){e.codingPath.push({field:"",type:r.ref});const s=ce(r.ref,t,e);return e.codingPath.pop(),s}else if(r.fields){const s=r.allFields;if(!s)throw new Error("Invalid struct fields");const c={};for(const u of s)e.codingPath.push({field:u.name,type:u.type}),c[u.name]=ce(u.type,t,e),e.codingPath.pop();return i?(c[mt]=!0,i.from(c)):c}else if(r.variant){const s=t.readByte(),c=r.variant[s];if(!c)throw new Error(`Unknown variant idx: ${s}`);e.codingPath.push({field:`v${s}`,type:c});const u=[c.typeName,ce(c,t,e)];return e.codingPath.pop(),i?i.from(u):u}else throw i?new Error("Invalid type"):new Error(r.name==="any"?"Unable to decode 'any' type from binary":"Unknown type")}}function Ct(r,t,e){if(r==null){if(t.isOptional)return null;if(t.isExtension)return e.strictExtensions?Vt(t,e):null;throw new Error(`Unexpectedly encountered ${r} for non-optional`)}else if(t.isArray){if(!Array.isArray(r))throw new Error("Expected array");const i=[],s=r.length;for(let c=0;c<s;c++)e.codingPath.push({field:c,type:t}),i.push(n(r[c])),e.codingPath.pop();return i}else return n(r);function n(i){const s=e.types[t.name];if(t.ref&&!s)return Ct(i,t.ref,e);if(t.fields){if(typeof i!="object")throw new Error("Expected object");if(typeof s=="function"&&y(i,s))return i;const c=t.allFields;if(!c)throw new Error("Invalid struct fields");const u={};for(const f of c)e.codingPath.push({field:f.name,type:f.type}),u[f.name]=Ct(i[f.name],f.type,e),e.codingPath.pop();return s?(u[mt]=!0,s.from(u)):u}else if(t.variant){let c;Array.isArray(i)&&i.length===2&&typeof i[0]=="string"?(c=i[0],i=i[1]):y(i,St)?(c=i.variantName,i=i.value):c=be(i);const u=t.variant.findIndex(b=>b.typeName===c);if(u===-1)throw new Error(`Unknown variant type: ${c}`);const f=t.variant[u];e.codingPath.push({field:`v${u}`,type:f});const l=[f.typeName,Ct(i,f,e)];return e.codingPath.pop(),s?(l[mt]=!0,s.from(l)):l}else{if(!s){if(t.name==="any")return i;throw new Error("Unknown type")}return s.from(i)}}}function Vt(r,t,e=new Set){if(r.isArray)return[];if(r.isOptional)return null;const n=t.types[r.name];if(n&&n.abiDefault)return n.abiDefault();if(e.has(r.name))throw new Error("Circular type reference");if(e.add(r.name),r.allFields){const i={};for(const s of r.allFields)t.codingPath.push({field:s.name,type:s.type}),i[s.name]=Vt(s.type,t,e),t.codingPath.pop();return n?(i[mt]=!0,n.from(i)):i}if(r.variant&&r.variant.length>0){const i=[r.variant[0].typeName,Vt(r.variant[0],t)];return n?(i[mt]=!0,n.from(i)):i}if(r.ref){t.codingPath.push({field:"",type:r.ref});const i=Vt(r.ref,t,e);return t.codingPath.pop(),i}throw new Error("Unable to determine default value")}class jt{constructor(t){this.array=t,this.pos=0,this.textDecoder=new TextDecoder("utf-8",{fatal:!0}),this.metadata={},this.data=new DataView(t.buffer,t.byteOffset,t.byteLength)}canRead(t=1){return!(this.pos+t>this.array.byteLength)}ensure(t){if(!this.canRead(t))throw new Error("Read past end of buffer")}setPosition(t){if(t<0||t>this.array.byteLength)throw new Error("Invalid position");this.pos=t}getPosition(){return this.pos}advance(t){this.ensure(t),this.pos+=t}readByte(){return this.ensure(1),this.array[this.pos++]}readFloat(t){this.ensure(t);let e;switch(t){case 4:e=this.data.getFloat32(this.pos,!0);break;case 8:e=this.data.getFloat64(this.pos,!0);break;default:throw new Error("Invalid float size")}return this.pos+=t,e}readVaruint32(){let t=0,e=0;for(;;){const n=this.readByte();if(t|=(n&127)<<e,e+=7,!(n&128))break}return t>>>0}readVarint32(){const t=this.readVaruint32();return t&1?~t>>1|2147483648:t>>>1}readArray(t){this.ensure(t);const e=this.array.subarray(this.pos,this.pos+t);return this.pos+=t,e}readString(){const t=this.readVaruint32();return this.textDecoder.decode(this.readArray(t))}}jt.__className="ABIDecoder";class Fe extends Error{constructor(t,e){const n=t.codingPath.map(({field:i,type:s})=>typeof i=="number"?i:`${i}<${s.typeName}>`).join(".");super(`Encoding error at ${n}: ${e.message}`),this.stack=e.stack,this.ctx=t,this.underlyingError=e}}Fe.__className="EncodingError";function M(r){let t,e;typeof r.type=="string"?e=r.type:r.type&&sr(r.type)?(typeof r.type.type!="string"&&(t=r.type.type),e=ae(r.type)):r.type&&r.type.abiName!==void 0?(t=r.type,e=r.type.abiName):(t=we(r.object),t&&(e=t.abiName,Array.isArray(r.object)&&(e+="[]")));const n=r.customTypes?r.customTypes.slice():[];if(t)n.unshift(t);else if(e){const f=new P.ResolvedType(e).name;t=n.find(l=>l.abiName===f)}let i;if(r.abi&&e)i=P.from(r.abi).resolveType(e);else if(t){const f=me(t);i=f.abi.resolveType(e||t.abiName),n.push(...f.types)}else if(e)i=new P.ResolvedType(e);else throw new Error("Unable to determine the type of the object to be encoded. To encode custom ABI types you must pass the type argument.");const s=ge(n),c=r.encoder||new $e;r.metadata&&(c.metadata=r.metadata);const u={types:s,encoder:c,codingPath:[{field:"root",type:i}]};try{ue(r.object,i,u)}catch(f){throw new Fe(u,f)}return g.from(c.getData())}function ue(r,t,e){const n=r!=null;if(t.isOptional&&(e.encoder.writeByte(n?1:0),!n))return;if(t.isArray){if(!Array.isArray(r))throw new Error(`Expected array for: ${t.typeName}`);const s=r.length;e.encoder.writeVaruint32(s);for(let c=0;c<s;c++)e.codingPath.push({field:c,type:t}),i(r[c]),e.codingPath.pop()}else i(r);function i(s){const c=e.types[t.name];if(t.ref&&!c){ue(s,t.ref,e);return}if(!n){if(t.isExtension)return;throw new Error(`Found ${s} for non-optional type: ${t.typeName}`)}if(c&&c.toABI)c.toABI(s,e.encoder);else if(typeof s.toABI=="function"&&s.constructor.abiName===t.name)s.toABI(e.encoder);else if(t.fields){if(typeof s!="object")throw new Error(`Expected object for: ${t.name}`);const u=t.allFields;if(!u)throw new Error("Invalid struct fields");for(const f of u)e.codingPath.push({field:f.name,type:f.type}),ue(s[f.name],f.type,e),e.codingPath.pop()}else if(t.variant){let u;Array.isArray(s)&&s.length===2&&typeof s[0]=="string"?(u=s[0],s=s[1]):y(s,St)?(u=s.variantName,s=s.value):u=be(s);const f=t.variant.findIndex(b=>b.typeName===u);if(f===-1){const b=t.variant.map(v=>`'${v.typeName}'`).join(", ");throw new Error(`Unknown variant type '${u}', expected one of ${b}`)}const l=t.variant[f];e.encoder.writeVaruint32(f),e.codingPath.push({field:`v${f}`,type:l}),ue(s,l,e),e.codingPath.pop()}else{if(!c)throw new Error(t.name==="any"?"Unable to encode any type to binary":"Unknown type");const u=c.from(s);if(!u.toABI)throw new Error(`Invalid type ${t.name}, no encoding methods implemented`);u.toABI(e.encoder)}}}class $e{constructor(t=1024){this.pageSize=t,this.pos=0,this.textEncoder=new TextEncoder,this.metadata={};const e=new ArrayBuffer(t);this.data=new DataView(e),this.array=new Uint8Array(e)}ensure(t){if(this.data.byteLength>=this.pos+t)return;const e=Math.ceil(t/this.pageSize),n=this.data.byteLength+this.pageSize*e,i=new ArrayBuffer(n),s=new DataView(i),c=new Uint8Array(i);c.set(this.array),this.data=s,this.array=c}writeByte(t){this.ensure(1),this.array[this.pos++]=t}writeArray(t){const e=t.length;this.ensure(e),this.array.set(t,this.pos),this.pos+=e}writeFloat(t,e){switch(this.ensure(e),e){case 4:this.data.setFloat32(this.pos,t,!0);break;case 8:this.data.setFloat64(this.pos,t,!0);break;default:throw new Error("Invalid float size")}this.pos+=e}writeVaruint32(t){for(this.ensure(4);;)if(t>>>7)this.array[this.pos++]=128|t&127,t=t>>>7;else{this.array[this.pos++]=t;break}}writeVarint32(t){this.writeVaruint32(t<<1^t>>31)}writeString(t){const e=this.textEncoder.encode(t);this.writeVaruint32(e.byteLength),this.writeArray(e)}getData(){return new Uint8Array(this.array.buffer,this.array.byteOffset,this.pos)}getBytes(){return new g(this.getData())}}$e.__className="ABIEncoder";class o{constructor(t){const e=this.constructor;for(const n of e.structFields)this[n.name]=t[n.name]}static from(t){return t[mt]===!0?new this(t):y(t,this)?t:yt({object:t,type:this})}static get structFields(){const t=[],e=n=>{n.abiBase&&e(n.abiBase);for(const i of n.abiFields||[])t.push(i)};return e(this),t}equals(t){const e=this.constructor;return t.constructor&&typeof t.constructor.abiName=="string"&&t.constructor.abiName!==e.abiName?!1:M({object:this}).equals(M({object:e.from(t)}))}toJSON(){const t=this.constructor,e={};for(const n of t.structFields)e[n.name]=this[n.name];return e}}o.abiName="__struct",function(r){const t=Symbol("FieldsOwner");function e(i){return function(s){return s.abiName=i,s}}r.type=e;function n(i,s={}){return(c,u)=>{const f=c.constructor;f.abiFields?f.abiFields[t]!==f&&(f.abiBase=f.abiFields[t],f.abiFields=[],f.abiFields[t]=f):(f.abiFields=[],f.abiFields[t]=f),f.abiFields.push({...s,name:u,type:i})}}r.field=n}(o||(o={}));function cr(r){return function(t){return t.abiAlias={type:Object.getPrototypeOf(t.prototype).constructor},t.abiName=r,t}}class St{constructor(t){const e=this.constructor.abiVariant;this.value=t[1];const n=e.map(ae).findIndex(i=>i===t[0]);if(0>n||e.length<=n)throw new Error(`Unknown variant ${t[0]}`);this.variantIdx=n}static from(t){return t[mt]?new this(t):y(t,this)?t:yt({object:t,type:this})}equals(t){const n=this.constructor.from(t);return this.variantIdx!==n.variantIdx?!1:M({object:this}).equals(M({object:n}))}get variantName(){const t=this.constructor.abiVariant[this.variantIdx];return ae(t)}toJSON(){return[this.variantName,this.value]}}St.abiName="__variant",St.abiVariant=[],function(r){function t(e,n){return function(i){return i.abiName=e,i.abiVariant=n.map(je),i}}r.type=t}(St||(St={}));class Ut{constructor(t){if(!Number.isFinite(t))throw new Error("Invalid number");this.value=t}static from(t){return y(t,this)?t:(typeof t=="string"?t=Number.parseFloat(t):y(t,Ut)&&(t=t.value),new this(t))}static fromABI(t){return new this(t.readFloat(this.byteWidth))}static abiDefault(){return this.from(0)}static random(){const t=te(this.byteWidth),e=new jt(t);return this.fromABI(e)}equals(t){const e=this.constructor;return this.value===e.from(t).value}toABI(t){const e=this.constructor;t.writeFloat(this.value,e.byteWidth)}toString(){return this.value.toString()}toJSON(){return this.toString()}}Ut.abiName="__float";class _e extends Ut{toString(){return this.value.toFixed(7)}}_e.abiName="float32",_e.byteWidth=4;class fe extends Ut{}fe.abiName="float64",fe.byteWidth=8;class le{constructor(t){if(t.array.length!==16)throw new Error("Invalid float128");this.data=t}static from(t){return y(t,this)?t:(typeof t=="string"&&t.startsWith("0x")&&(t=t.slice(2)),new this(g.from(t)))}static fromABI(t){return new this(new g(t.readArray(this.byteWidth)))}static random(){const t=te(16),e=new jt(t);return this.fromABI(e)}equals(t){const e=this.constructor;return this.data.equals(e.from(t).data)}toABI(t){t.writeArray(this.data.array)}toString(){return"0x"+this.data.hexString}toJSON(){return this.toString()}}le.abiName="float128",le.byteWidth=16;class S{constructor(t){this.value=t}get rawValue(){return this.value}static from(t){if(y(t,S))return t;if(typeof t=="string")return new S(ur(t));if(y(t,E))return new S(t);throw new Error("Invalid name")}static fromABI(t){return new S(E.fromABI(t))}static abiDefault(){return new this(E.from(0))}equals(t){return this.value.equals(S.from(t).value)}toString(){return fr(this.value)}toABI(t){this.value.toABI(t)}toJSON(){return this.toString()}}S.abiName="name",S.pattern=/^[a-z1-5.]{0,13}$/;function ur(r){function t(i){return i>="a".charCodeAt(0)&&i<="z".charCodeAt(0)?i-"a".charCodeAt(0)+6:i>="1".charCodeAt(0)&&i<="5".charCodeAt(0)?i-"1".charCodeAt(0)+1:0}const e=new Uint8Array(8);let n=63;for(let i=0;i<r.length;++i){let s=t(r.charCodeAt(i));n<5&&(s=s<<1);for(let c=4;c>=0;--c)n>=0&&(e[Math.floor(n/8)]|=(s>>c&1)<<n%8,--n)}return E.from(e)}function fr(r){const t=r.value.toArray("le",8);let e="";for(let n=63;n>=0;){let i=0;for(let s=0;s<5;++s)n>=0&&(i=i<<1|t[Math.floor(n/8)]>>n%8&1,--n);i>=6?e+=String.fromCharCode(i+"a".charCodeAt(0)-6):i>=1?e+=String.fromCharCode(i+"1".charCodeAt(0)-1):e+="."}for(;e.endsWith(".");)e=e.substr(0,e.length-1);return e}class kt{static from(t){return y(t,this)?t:y(t,kt)?this.fromMilliseconds(t.toMilliseconds()):y(t,Date)?this.fromDate(t):typeof t=="string"?this.fromString(t):this.fromInteger(t)}static fromString(t){const e=Date.parse(t+"Z");if(!Number.isFinite(e))throw new Error("Invalid date string");return this.fromMilliseconds(e)}static fromDate(t){return this.fromMilliseconds(t.getTime())}static abiDefault(){return this.from(0)}toABI(t){this.value.toABI(t)}equals(t){const e=this.constructor;return this.toMilliseconds()===e.from(t).toMilliseconds()}toMilliseconds(){throw new Error("Not implemented")}toDate(){return new Date(this.toMilliseconds())}toJSON(){return this.toString()}}kt.abiName="__time_point_base";class qe extends kt{constructor(t){super(),this.value=t}static fromMilliseconds(t){return new this(U.from(Math.round(t*1e3)))}static fromInteger(t){return new this(U.from(t))}static fromABI(t){return new this(U.fromABI(t))}toString(){return this.toDate().toISOString().slice(0,-1)}toMilliseconds(){return Number(this.value.dividing(1e3,"round"))}}qe.abiName="time_point";class de extends kt{constructor(t){super(),this.value=t}static fromMilliseconds(t){return new this(V.from(Math.round(t/1e3)))}static fromInteger(t){return new this(V.from(t))}static fromABI(t){return new this(V.fromABI(t))}toString(){return this.toDate().toISOString().slice(0,-5)}toMilliseconds(){return Number(this.value.cast(E).multiplying(1e3))}}de.abiName="time_point_sec";class pe extends kt{constructor(t){super(),this.value=t}static fromMilliseconds(t){return new this(V.from(Math.round((t-9466848e5)/500)))}static fromInteger(t){return new this(V.from(t))}static fromABI(t){return new this(V.fromABI(t))}toString(){return this.toDate().toISOString().slice(0,-1)}toMilliseconds(){return Number(this.value.cast(E).multiplying(500).adding(9466848e5))}}pe.abiName="block_timestamp_type";class P{constructor(t){this.version=t.version||P.version,this.types=t.types||[],this.variants=t.variants||[],this.structs=t.structs||[],this.actions=t.actions||[],this.tables=t.tables||[],this.ricardian_clauses=t.ricardian_clauses||[]}static from(t){return y(t,P)?t:typeof t=="string"?new P(JSON.parse(t)):new P(t)}static fromABI(t){const e=t.readString(),n=[],i=t.readVaruint32();for(let p=0;p<i;p++)n.push({new_type_name:t.readString(),type:t.readString()});const s=[],c=t.readVaruint32();for(let p=0;p<c;p++){const m=t.readString(),k=t.readString(),N=t.readVaruint32(),G=[];for(let dt=0;dt<N;dt++)G.push({name:t.readString(),type:t.readString()});s.push({base:k,name:m,fields:G})}const u=[],f=t.readVaruint32();for(let p=0;p<f;p++){const m=S.fromABI(t),k=t.readString(),N=t.readString();u.push({name:m,type:k,ricardian_contract:N})}const l=[],b=t.readVaruint32();for(let p=0;p<b;p++){const m=S.fromABI(t),k=t.readString(),N=[],G=t.readVaruint32();for(let Yt=0;Yt<G;Yt++)N.push(t.readString());const dt=[],Sr=t.readVaruint32();for(let Yt=0;Yt<Sr;Yt++)dt.push(t.readString());const kr=t.readString();l.push({name:m,index_type:k,key_names:N,key_types:dt,type:kr})}const v=[],x=t.readVaruint32();for(let p=0;p<x;p++){const m=t.readString(),k=t.readString();v.push({id:m,body:k})}const w=t.readVaruint32();for(let p=0;p<w;p++)t.advance(8),t.advance(t.readVaruint32());const d=t.readVaruint32();for(let p=0;p<d;p++)t.advance(2),t.advance(t.readVaruint32());const h=[];if(t.canRead()){const p=t.readVaruint32();for(let m=0;m<p;m++){const k=t.readString(),N=[],G=t.readVaruint32();for(let dt=0;dt<G;dt++)N.push(t.readString());h.push({name:k,types:N})}}return new P({version:e,types:n,structs:s,actions:u,tables:l,ricardian_clauses:v,variants:h})}toABI(t){t.writeString(this.version),t.writeVaruint32(this.types.length);for(const e of this.types)t.writeString(e.new_type_name),t.writeString(e.type);t.writeVaruint32(this.structs.length);for(const e of this.structs){t.writeString(e.name),t.writeString(e.base),t.writeVaruint32(e.fields.length);for(const n of e.fields)t.writeString(n.name),t.writeString(n.type)}t.writeVaruint32(this.actions.length);for(const e of this.actions)S.from(e.name).toABI(t),t.writeString(e.type),t.writeString(e.ricardian_contract);t.writeVaruint32(this.tables.length);for(const e of this.tables){S.from(e.name).toABI(t),t.writeString(e.index_type),t.writeVaruint32(e.key_names.length);for(const n of e.key_names)t.writeString(n);t.writeVaruint32(e.key_types.length);for(const n of e.key_types)t.writeString(n);t.writeString(e.type)}t.writeVaruint32(this.ricardian_clauses.length);for(const e of this.ricardian_clauses)t.writeString(e.id),t.writeString(e.body);t.writeVaruint32(0),t.writeVaruint32(0),t.writeVaruint32(this.variants.length);for(const e of this.variants){t.writeString(e.name),t.writeVaruint32(e.types.length);for(const n of e.types)t.writeString(n)}}resolveType(t){const e={};return this.resolve({name:t,types:e},{id:0})}resolveAll(){const t={},e={id:0};return{types:this.types.map(n=>this.resolve({name:n.new_type_name,types:t},e)),variants:this.variants.map(n=>this.resolve({name:n.name,types:t},e)),structs:this.structs.map(n=>this.resolve({name:n.name,types:t},e))}}resolve({name:t,types:e},n){const i=e[t];if(i)return i;const s=new P.ResolvedType(t,++n.id);e[s.typeName]=s;const c=this.types.find(l=>l.new_type_name==s.name);if(c)return s.ref=this.resolve({name:c.type,types:e},n),s;const u=this.getStruct(s.name);if(u)return u.base&&(s.base=this.resolve({name:u.base,types:e},n)),s.fields=u.fields.map(l=>({name:l.name,type:this.resolve({name:l.type,types:e},n)})),s;const f=this.getVariant(s.name);return f&&(s.variant=f.types.map(l=>this.resolve({name:l,types:e},n))),s}getStruct(t){return this.structs.find(e=>e.name==t)}getVariant(t){return this.variants.find(e=>e.name==t)}getActionType(t){const e=S.from(t).toString(),n=this.actions.find(i=>i.name.toString()===e);if(n)return n.type}equals(t){const e=P.from(t);return this.version!=e.version||this.types.length!=e.types.length||this.structs.length!=e.structs.length||this.actions.length!=e.actions.length||this.tables.length!=e.tables.length||this.ricardian_clauses.length!=e.ricardian_clauses.length||this.variants.length!=e.variants.length?!1:M({object:this}).equals(M({object:e}))}toJSON(){return{version:this.version,types:this.types,structs:this.structs,actions:this.actions,tables:this.tables,ricardian_clauses:this.ricardian_clauses,error_messages:[],abi_extensions:[],variants:this.variants}}}P.abiName="abi",P.version="eosio::abi/1.1",function(r){class t{constructor(n,i=0){let s=n;s.endsWith("$")?(s=s.slice(0,-1),this.isExtension=!0):this.isExtension=!1,s.endsWith("?")?(s=s.slice(0,-1),this.isOptional=!0):this.isOptional=!1,s.endsWith("[]")?(s=s.slice(0,-2),this.isArray=!0):this.isArray=!1,this.id=i,this.name=s}get typeName(){let n=this.name;return this.isArray&&(n+="[]"),this.isOptional&&(n+="?"),this.isExtension&&(n+="$"),n}get allFields(){let n=this;const i=[],s=new Set;do{if(!n.fields||s.has(n.name))return;for(let c=n.fields.length-1;c>=0;c--)i.unshift(n.fields[c]);s.add(n.name),n=n.base}while(n!==void 0);return i}}r.ResolvedType=t}(P||(P={}));class B{constructor(t,e){this.units=t,this.symbol=e}static from(t,e){if(y(t,B))return t;switch(typeof t){case"number":if(!e)throw new Error("Symbol is required when creating Asset from number");return this.fromFloat(t,e);case"string":return this.fromString(t);default:throw new Error("Invalid asset")}}static fromString(t){const e=(typeof t=="string"?t:"").split(" ");if(e.length!==2)throw new Error("Invalid asset string");const n=e[0].replace(".",""),i=(e[0].split(".")[1]||"").length,s=B.Symbol.fromParts(e[1],i);return new B(U.from(n),s)}static fromFloat(t,e){const n=B.Symbol.from(e);return new B(n.convertFloat(t),n)}static fromUnits(t,e){return new B(U.from(t),B.Symbol.from(e))}static fromABI(t){const e=U.fromABI(t),n=B.Symbol.fromABI(t);return new B(e,n)}static abiDefault(){return new this(U.from(0),B.Symbol.abiDefault())}equals(t){const{symbol:e,units:n}=B.from(t);return this.symbol.value.equals(e.value)&&this.units.equals(n)}get value(){return this.symbol.convertUnits(this.units)}set value(t){this.units=this.symbol.convertFloat(t)}toABI(t){this.units.toABI(t),this.symbol.toABI(t)}toString(){const t=this.units.toString().split("");let e=!1;t[0]==="-"&&(e=!0,t.shift());const n=this.symbol.precision;for(;t.length<=n;)t.unshift("0");n>0&&t.splice(t.length-n,0,".");let i=t.join("");return e&&(i="-"+i),i+" "+this.symbol.name}toJSON(){return this.toString()}}B.abiName="asset",function(r){class t{constructor(i){if(Me(i)>t.maxPrecision)throw new Error("Invalid asset symbol, precision too large");if(!t.symbolNamePattern.test(Le(i)))throw new Error("Invalid asset symbol, name must be uppercase A-Z");this.value=i}static from(i){if(y(i,t))return i;if(y(i,E))return new t(i);const s=i.split(",");if(s.length!==2)throw new Error("Invalid symbol string");const c=Number.parseInt(s[0]);return t.fromParts(s[1],c)}static fromParts(i,s){return new t(lr(i,s))}static fromABI(i){return new t(E.fromABI(i))}static abiDefault(){return this.from("4,SYS")}equals(i){return this.value.equals(t.from(i).value)}get name(){return Le(this.value)}get precision(){return Me(this.value)}get code(){return new e(E.from(this.value.value.clone().iushrn(8)))}toABI(i){this.value.toABI(i)}convertUnits(i){return i.value.toNumber()/Math.pow(10,this.precision)}convertFloat(i){return U.from(i.toFixed(this.precision).replace(".",""))}toString(){return`${this.precision},${this.name}`}toJSON(){return this.toString()}}t.abiName="symbol",t.symbolNamePattern=/^[A-Z]{0,7}$/,t.maxPrecision=18,r.Symbol=t;class e{constructor(i){this.value=i}static from(i){return y(i,e)?i:(typeof i=="string"&&(i=E.from(ze(i))),new this(E.from(i)))}static fromABI(i){return new e(E.fromABI(i))}static abiDefault(){return this.from("SYS")}equals(i){return this.value.equals(e.from(i).value)}toABI(i){this.value.toABI(i)}toString(){return Ge(this.value.value.toArray("be"))}toJSON(){return this.toString()}}e.abiName="symbol_code",r.SymbolCode=e}(B||(B={}));class Dt{constructor(t,e){this.quantity=t,this.contract=e}static from(t){return y(t,Dt)?t:new this(B.from(t.quantity),S.from(t.contract))}static fromABI(t){return new Dt(B.fromABI(t),S.fromABI(t))}equals(t){return this.quantity.equals(t.quantity)&&this.contract.equals(t.contract)}toABI(t){this.quantity.toABI(t),this.contract.toABI(t)}toJSON(){return{quantity:this.quantity,contract:this.contract}}}Dt.abiName="extended_asset";function Me(r){return r.value.and(E.from(255).value).toNumber()}function Le(r){const t=r.value.toArray("be").slice(0,-1);return Ge(t)}function Ge(r){return r.map(t=>String.fromCharCode(t)).reverse().join("")}function lr(r,t){const e=ze(r),n=new Uint8Array(e.length+1);return n[0]=t,n.set(e,1),E.from(n)}function ze(r){const t=Math.min(r.length,7),e=new Uint8Array(t);for(let n=0;n<t;n++)e[n]=r.charCodeAt(n);return e}var D;(function(r){let t;(function(d){d.E_CHECKSUM="E_CHECKSUM",d.E_INVALID="E_INVALID"})(t=r.ErrorCode||(r.ErrorCode={}));class e extends Error{constructor(h,p,m={}){super(h),this.code=p,this.info=m}}e.__className="DecodingError",r.DecodingError=e;const n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",i=new Int16Array(255).fill(-1);for(let d=0;d<58;++d)i[n.charCodeAt(d)]=d;function s(d,h){if(h==null)return v(d);const p=new Uint8Array(h);for(let m=0;m<d.length;++m){let k=i[d.charCodeAt(m)];if(k<0)throw new e("Invalid Base58 character encountered",t.E_INVALID,{char:d[m]});for(let N=0;N<h;++N){const G=p[N]*58+k;p[N]=G,k=G>>8}if(k)throw new e("Base58 value is out of range",t.E_INVALID)}return p.reverse(),new g(p)}r.decode=s;function c(d,h){const p=s(d,h!=null?h+4:h),m=p.array.subarray(0,-4),k=p.array.subarray(-4),N=w(m);if(!Xt(k,N))throw new e("Checksum mismatch",t.E_CHECKSUM,{actual:N,expected:k,data:m,hash:"double_sha256"});return new g(m)}r.decodeCheck=c;function u(d,h,p){const m=s(d,h!=null?h+4:h),k=m.array.subarray(0,-4),N=m.array.subarray(-4),G=x(k,p);if(!Xt(N,G))throw new e("Checksum mismatch",t.E_CHECKSUM,{actual:G,expected:N,data:k,hash:"ripemd160"});return new g(k)}r.decodeRipemd160Check=u;function f(d){d=g.from(d);const h=[];for(const p of d.array){let m=p;for(let k=0;k<h.length;++k){const N=(i[h[k]]<<8)+m;h[k]=n.charCodeAt(N%58),m=N/58|0}for(;m;)h.push(n.charCodeAt(m%58)),m=m/58|0}for(const p of d.array){if(p)break;h.push("1".charCodeAt(0))}return h.reverse(),String.fromCharCode(...h)}r.encode=f;function l(d){return d=g.from(d),d=d.appending(w(d.array)),f(d)}r.encodeCheck=l;function b(d,h){return d=g.from(d),d=d.appending(x(d.array,h)),f(d)}r.encodeRipemd160Check=b;function v(d){const h=[];for(let p=0;p<d.length;++p){let m=i[d.charCodeAt(p)];if(m<0)throw new e("Invalid Base58 character encountered",t.E_INVALID,{char:d[p]});for(let k=0;k<h.length;++k){const N=h[k]*58+m;h[k]=N&255,m=N>>8}m&&h.push(m)}for(const p of d)if(p==="1")h.push(0);else break;return h.reverse(),g.from(h)}function x(d,h){const p=(0,_t.ripemd160)().update(d);return h&&p.update(h),new Uint8Array(p.digest().slice(0,4))}function w(d){const h=(0,_t.sha256)().update(d).digest(),p=(0,_t.sha256)().update(h).digest();return new Uint8Array(p.slice(0,4))}})(D||(D={}));class W{constructor(t,e){this.type=t,this.data=e}static from(t){if(y(t,W))return t;if(typeof t=="object"&&t.type&&t.compressed)return new W(_.from(t.type),new g(t.compressed));if(typeof t!="string")throw new Error("Invalid public key");if(t.startsWith("PUB_")){const e=t.split("_");if(e.length!==3)throw new Error("Invalid public key string");const n=_.from(e[1]),i=n===_.K1||n===_.R1?33:void 0,s=D.decodeRipemd160Check(e[2],i,n);return new W(n,s)}else if(t.length>=50){const e=D.decodeRipemd160Check(t.slice(-50));return new W(_.K1,e)}else throw new Error("Invalid public key string")}static fromABI(t){const e=_.from(t.readByte());if(e==_.WA){const n=t.getPosition();t.advance(33),t.advance(1),t.advance(t.readVaruint32());const i=t.getPosition()-n;t.setPosition(n);const s=g.from(t.readArray(i));return new W(_.WA,s)}return new W(e,new g(t.readArray(33)))}equals(t){const e=W.from(t);return this.type===e.type&&this.data.equals(e.data)}toLegacyString(t="EOS"){if(this.type!==_.K1)throw new Error("Unable to create legacy formatted string for non-K1 key");return`${t}${D.encodeRipemd160Check(this.data)}`}toString(){return`PUB_${this.type}_${D.encodeRipemd160Check(this.data,this.type)}`}toABI(t){t.writeByte(_.indexFor(this.type)),t.writeArray(this.data.array)}toJSON(){return this.toString()}}W.abiName="public_key";const ve={};function xt(r){let t=ve[r];if(!t)if(r==="K1")t=ve[r]=new Ie.ec("secp256k1");else if(r==="R1")t=ve[r]=new Ie.ec("p256");else throw new Error(`Unknown curve type: ${r}`);return t}function dr(r,t,e){const n=xt(e),i=r[0]-31,s=r.subarray(1,33),c=r.subarray(33),u=n.recoverPubKey(t,{r:s,s:c},i);return new Uint8Array(u.encodeCompressed())}function pr(r,t,e,n){const i=xt(n),s=r.subarray(1,33),c=r.subarray(33);return i.verify(t,{r:s,s:c},e)}class H{constructor(t,e){this.type=t,this.data=e}static from(t){if(y(t,H))return t;if(typeof t=="object"&&t.r&&t.s){const e=new Uint8Array(65);let n=t.recid;const i=_.from(t.type);return(t.type===_.K1||t.type===_.R1)&&(n+=31),e[0]=n,e.set(t.r,1),e.set(t.s,33),new H(i,new g(e))}if(typeof t!="string")throw new Error("Invalid signature");if(t.startsWith("SIG_")){const e=t.split("_");if(e.length!==3)throw new Error("Invalid signature string");const n=_.from(e[1]),i=n===_.K1||n===_.R1?65:void 0,s=D.decodeRipemd160Check(e[2],i,n);return new H(n,s)}else throw new Error("Invalid signature string")}static fromABI(t){const e=_.from(t.readByte());if(e===_.WA){const n=t.getPosition();t.advance(65),t.advance(t.readVaruint32()),t.advance(t.readVaruint32());const i=t.getPosition()-n;t.setPosition(n);const s=g.from(t.readArray(i));return new H(_.WA,s)}return new H(e,new g(t.readArray(65)))}equals(t){const e=H.from(t);return this.type===e.type&&this.data.equals(e.data)}recoverDigest(t){t=T.from(t);const e=dr(this.data.array,t.array,this.type);return W.from({compressed:e,type:this.type})}recoverMessage(t){return this.recoverDigest(T.hash(t))}verifyDigest(t,e){return t=T.from(t),pr(this.data.array,t.array,e.data.array,this.type)}verifyMessage(t,e){return this.verifyDigest(T.hash(t),e)}toString(){return`SIG_${this.type}_${D.encodeRipemd160Check(this.data,this.type)}`}toABI(t){t.writeByte(_.indexFor(this.type)),t.writeArray(this.data.array)}toJSON(){return this.toString()}}H.abiName="signature";function hr(r,t){const i=xt(t).keyFromPrivate(r).getPublic();return new Uint8Array(i.encodeCompressed())}function yr(r,t,e){const n=xt(e),i=n.keyFromPrivate(r),s=n.keyFromPublic(t).getPublic();return i.derive(s).toArrayLike(Uint8Array,"be")}function mr(r,t,e){const i=xt(e).keyFromPrivate(r);let s,c,u;if(e==="K1"){let f=1;do s=i.sign(t,{canonical:!0,pers:[f++]}),c=s.r.toArrayLike(Uint8Array,"be",32),u=s.s.toArrayLike(Uint8Array,"be",32);while(!gr(c,u))}else s=i.sign(t,{canonical:!0}),c=s.r.toArrayLike(Uint8Array,"be",32),u=s.s.toArrayLike(Uint8Array,"be",32);return{type:e,r:c,s:u,recid:s.recoveryParam||0}}function gr(r,t){return!(r[0]&128)&&!(r[0]===0&&!(r[1]&128))&&!(t[0]&128)&&!(t[0]===0&&!(t[1]&128))}function br(r){return xt(r).genKeyPair().getPrivate().toArrayLike(Uint8Array,"be",32)}class he{constructor(t,e){if((t===_.K1||t===_.R1)&&e.length!==32)throw new Error("Invalid private key length");this.type=t,this.data=e}static from(t){return y(t,he)?t:this.fromString(t)}static fromString(t,e=!1){try{const{type:n,data:i}=wr(t);return new this(n,i)}catch(n){if(n.message=`Invalid private key (${n.message})`,e&&y(n,D.DecodingError)&&n.code===D.ErrorCode.E_CHECKSUM){const i=t.startsWith("PVT_R1")?_.R1:_.K1,s=new g(n.info.data);return s.length===33&&s.dropFirst(),s.zeropad(32,!0),new this(i,s)}throw n}}static generate(t){return new he(_.from(t),new g(br(t)))}signDigest(t){return t=T.from(t),H.from(mr(this.data.array,t.array,this.type))}signMessage(t){return this.signDigest(T.hash(t))}sharedSecret(t){const e=yr(this.data.array,t.data.array,this.type);return At.hash(e)}toPublic(){const t=hr(this.data.array,this.type);return W.from({compressed:t,type:this.type})}toWif(){if(this.type!==_.K1)throw new Error("Unable to generate WIF for non-k1 key");return D.encodeCheck(g.from([128]).appending(this.data))}toString(){return`PVT_${this.type}_${D.encodeRipemd160Check(this.data,this.type)}`}toJSON(){return this.toString()}}function wr(r){const t=typeof r;if(t!=="string")throw new Error(`Expected string, got ${t}`);if(r.startsWith("PVT_")){const e=r.split("_");if(e.length!==3)throw new Error("Invalid PVT format");const n=_.from(e[1]);let i;switch(n){case _.K1:case _.R1:i=32;break}const s=D.decodeRipemd160Check(e[2],i,n);return{type:n,data:s}}else{const e=_.K1,n=D.decodeCheck(r);if(n.array[0]!==128)throw new Error("Invalid WIF");return{type:e,data:n.droppingFirst()}}}var Ae;let Nt=Ae=class extends o{static from(t){if(typeof t=="string"){const e=t.split("@");if(e.length!==2&&e[0].length>0&&e[1].length>0)throw new Error("Invalid permission level string, should be in the format <actor>@<permission>");t={actor:e[0],permission:e[1]}}return super.from(t)}equals(t){const e=Ae.from(t);return this.actor.equals(e.actor)&&this.permission.equals(e.permission)}toString(){return`${this.actor}@${this.permission}`}};a([o.field("name")],Nt.prototype,"actor",void 0),a([o.field("name")],Nt.prototype,"permission",void 0),Nt=Ae=a([o.type("permission_level")],Nt);var Se;let rt=Se=class extends o{static from(t,e){const n=t.data;if(!g.isBytes(n)){let i;if(e)i=P.from(e).getActionType(t.name);else if(!n.constructor||n.constructor.abiName===void 0)throw new Error("Missing ABI definition when creating action with untyped action data");t={...t,data:M({object:n,type:i,abi:e})}}return super.from(t)}equals(t){const e=Se.from(t);return this.account.equals(e.account)&&this.name.equals(e.name)&&er(this.authorization,e.authorization)&&this.data.equals(e.data)}decodeData(t){if(typeof t=="string"||t.abiName)return yt({data:this.data,type:t});{const e=P.from(t),n=e.getActionType(this.name);if(!n)throw new Error(`Action ${this.name} does not exist in provided ABI`);return yt({data:this.data,type:n,abi:e})}}};a([o.field("name")],rt.prototype,"account",void 0),a([o.field("name")],rt.prototype,"name",void 0),a([o.field(Nt,{array:!0})],rt.prototype,"authorization",void 0),a([o.field("bytes")],rt.prototype,"data",void 0),rt=Se=a([o.type("action")],rt);var ke;let Wt=class extends o{};a([o.field("uint16")],Wt.prototype,"type",void 0),a([o.field("bytes")],Wt.prototype,"data",void 0),Wt=a([o.type("transaction_extension")],Wt);let Z=class extends o{static from(t){return super.from({max_net_usage_words:0,max_cpu_usage_ms:0,delay_sec:0,...t})}};a([o.field("time_point_sec")],Z.prototype,"expiration",void 0),a([o.field("uint16")],Z.prototype,"ref_block_num",void 0),a([o.field("uint32")],Z.prototype,"ref_block_prefix",void 0),a([o.field("varuint32")],Z.prototype,"max_net_usage_words",void 0),a([o.field("uint8")],Z.prototype,"max_cpu_usage_ms",void 0),a([o.field("varuint32")],Z.prototype,"delay_sec",void 0),Z=a([o.type("transaction_header")],Z);let K=ke=class extends Z{static from(t,e){const n=f=>{if(e)return Array.isArray(e)?e.filter(l=>S.from(l.contract).equals(f)).map(({abi:l})=>l)[0]:e},i=f=>rt.from(f,n(f.account)),s=(t.actions||[]).map(i),c=(t.context_free_actions||[]).map(i),u={transaction_extensions:[],...t,context_free_actions:c,actions:s};return super.from(u)}equals(t){const e=ke.from(t);return this.id.equals(e.id)}get id(){return T.hash(M({object:this}))}signingDigest(t){const e=this.signingData(t);return T.hash(e)}signingData(t){let e=g.from(T.from(t).array);return e=e.appending(M({object:this})),e=e.appending(new Uint8Array(32)),e}};a([o.field(rt,{array:!0})],K.prototype,"context_free_actions",void 0),a([o.field(rt,{array:!0})],K.prototype,"actions",void 0),a([o.field(Wt,{array:!0})],K.prototype,"transaction_extensions",void 0),K=ke=a([o.type("transaction")],K);let Y=class extends K{get transaction(){return K.from({...this,signatures:void 0,context_free_data:void 0})}get id(){return this.transaction.id}static from(t){return super.from({signatures:[],context_free_data:[],...t})}};a([o.field("signature[]")],Y.prototype,"signatures",void 0),a([o.field("bytes[]")],Y.prototype,"context_free_data",void 0),Y=a([o.type("signed_transaction")],Y);let j=class extends o{static from(t){return super.from({signatures:[],packed_context_free_data:"",compression:0,...t})}static fromSigned(t){const e=K.from(t);return this.from({signatures:t.signatures,packed_context_free_data:M({object:t.context_free_data,type:"bytes[]"}),packed_trx:M({object:e})})}getTransaction(){if(Number(this.compression)!==0)throw new Error("Transaction compression not supported yet");return yt({data:this.packed_trx,type:K})}getSignedTransaction(){const t=this.getTransaction();return Y.from({...t,signatures:this.signatures})}};a([o.field("signature[]")],j.prototype,"signatures",void 0),a([o.field("uint8")],j.prototype,"compression",void 0),a([o.field("bytes")],j.prototype,"packed_context_free_data",void 0),a([o.field("bytes")],j.prototype,"packed_trx",void 0),j=a([o.type("packed_transaction")],j);let gt=class extends o{};a([o.field("string")],gt.prototype,"status",void 0),a([o.field("uint32")],gt.prototype,"cpu_usage_us",void 0),a([o.field("uint32")],gt.prototype,"net_usage_words",void 0),gt=a([o.type("transaction_receipt")],gt);var xe;let Ft=class extends Ot{};Ft=a([cr("weight_type")],Ft);let $t=class extends o{};a([o.field(W)],$t.prototype,"key",void 0),a([o.field(Ft)],$t.prototype,"weight",void 0),$t=a([o.type("key_weight")],$t);let qt=class extends o{};a([o.field(Nt)],qt.prototype,"permission",void 0),a([o.field(Ft)],qt.prototype,"weight",void 0),qt=a([o.type("permission_level_weight")],qt);let Mt=class extends o{};a([o.field(V)],Mt.prototype,"wait_sec",void 0),a([o.field(Ft)],Mt.prototype,"weight",void 0),Mt=a([o.type("wait_weight")],Mt);let bt=xe=class extends o{static from(t){if(y(t,xe))return t;const e=super.from({keys:[],accounts:[],waits:[],...t});return e.sort(),e}get waitThreshold(){return this.waits.reduce((t,e)=>t+e.weight.toNumber(),0)}get keyThreshold(){return this.threshold.toNumber()-this.waitThreshold}keyWeight(t){const e=this.keys.find(({key:n})=>n.equals(t));return e?e.weight.toNumber():0}hasPermission(t,e=!1){const n=e?1:this.keyThreshold;return this.keyWeight(t)>=n}sort(){this.keys.sort((t,e)=>String(t.key).localeCompare(String(e.key))),this.accounts.sort((t,e)=>String(t.permission).localeCompare(String(e.permission))),this.waits.sort((t,e)=>String(t.wait_sec).localeCompare(String(e.wait_sec)))}};a([o.field(V)],bt.prototype,"threshold",void 0),a([o.field($t,{array:!0})],bt.prototype,"keys",void 0),a([o.field(qt,{array:!0})],bt.prototype,"accounts",void 0),a([o.field(Mt,{array:!0})],bt.prototype,"waits",void 0),bt=xe=a([o.type("authority")],bt);var ot;(function(r){r.encode=M,r.decode=yt;function t(i){return me(i).abi}r.synthesize=t;function e(i){return JSON.stringify(i)}r.stringify=e;function n(i){const s=c=>{switch(typeof c){case"boolean":case"number":case"string":return c;case"object":{if(c===null)return c;if(typeof c.toJSON=="function")return s(c.toJSON());if(Array.isArray(c))return c.map(s);const u={};for(const f of Object.keys(c))u[f]=s(c[f]);return u}}};return s(i)}r.objectify=n})(ot||(ot={}));class Je{constructor(t,e={}){if(t=t.trim(),t.endsWith("/")&&(t=t.slice(0,-1)),this.url=t,e.fetch)this.fetch=e.fetch;else if(typeof window<"u"&&window.fetch)this.fetch=window.fetch.bind(window);else if(typeof z.g<"u"&&z.g.fetch)this.fetch=z.g.fetch.bind(z.g);else throw new Error("Missing fetch")}async call(t,e){const n=this.url+t,i=await this.fetch(n,{method:"POST",body:e!==void 0?JSON.stringify(e):void 0}),s=await i.text();let c;try{c=JSON.parse(s)}catch{}const u={};for(const[f,l]of Object.entries(i.headers))u[f]=l;return{headers:u,status:i.status,json:c,text:s}}}let wt=class extends o{};a([o.field("name")],wt.prototype,"perm_name",void 0),a([o.field("name")],wt.prototype,"parent",void 0),a([o.field(bt)],wt.prototype,"required_auth",void 0),wt=a([o.type("account_permission")],wt);let st=class extends o{};a([o.field("int64")],st.prototype,"used",void 0),a([o.field("int64")],st.prototype,"available",void 0),a([o.field("int64")],st.prototype,"max",void 0),st=a([o.type("account_resource_limit")],st);let at=class extends o{};a([o.field("name")],at.prototype,"owner",void 0),a([o.field("asset")],at.prototype,"net_weight",void 0),a([o.field("asset")],at.prototype,"cpu_weight",void 0),a([o.field("uint64")],at.prototype,"ram_bytes",void 0),at=a([o.type("account_total_resources")],at);let ct=class extends o{};a([o.field("name")],ct.prototype,"from",void 0),a([o.field("name")],ct.prototype,"to",void 0),a([o.field("asset")],ct.prototype,"net_weight",void 0),a([o.field("asset")],ct.prototype,"cpu_weight",void 0),ct=a([o.type("account_self_delegated_bandwidth")],ct);let ut=class extends o{};a([o.field("name")],ut.prototype,"owner",void 0),a([o.field("time_point")],ut.prototype,"request_time",void 0),a([o.field("asset")],ut.prototype,"net_amount",void 0),a([o.field("asset")],ut.prototype,"cpu_amount",void 0),ut=a([o.type("account_refund_request")],ut);let L=class extends o{};a([o.field("name")],L.prototype,"owner",void 0),a([o.field("name")],L.prototype,"proxy",void 0),a([o.field("name",{array:!0})],L.prototype,"producers",void 0),a([o.field("int64",{optional:!0})],L.prototype,"staked",void 0),a([o.field("bool")],L.prototype,"is_proxy",void 0),a([o.field("uint32",{optional:!0})],L.prototype,"flags1",void 0),a([o.field("uint32")],L.prototype,"reserved2",void 0),a([o.field("string")],L.prototype,"reserved3",void 0),L=a([o.type("account_voter_info")],L);let ft=class extends o{};a([o.field("time_point",{optional:!0})],ft.prototype,"key",void 0),a([o.field("int64",{optional:!0})],ft.prototype,"value",void 0),a([o.field("time_point",{optional:!0})],ft.prototype,"first",void 0),a([o.field("int64",{optional:!0})],ft.prototype,"second",void 0),ft=a([o.type("account_rex_info_maturities")],ft);let Q=class extends o{};a([o.field("uint32")],Q.prototype,"version",void 0),a([o.field("name")],Q.prototype,"owner",void 0),a([o.field("asset")],Q.prototype,"vote_stake",void 0),a([o.field("asset")],Q.prototype,"rex_balance",void 0),a([o.field("int64")],Q.prototype,"matured_rex",void 0),a([o.field(ft,{array:!0})],Q.prototype,"rex_maturities",void 0),Q=a([o.type("account_rex_info")],Q);let I=class extends o{getPermission(t){const e=S.from(t),n=this.permissions.find(i=>i.perm_name.equals(e));if(!n)throw new Error(`Unknown permission ${e} on account ${this.account_name}.`);return n}};a([o.field("name")],I.prototype,"account_name",void 0),a([o.field("uint32")],I.prototype,"head_block_num",void 0),a([o.field("time_point")],I.prototype,"head_block_time",void 0),a([o.field("bool")],I.prototype,"privileged",void 0),a([o.field("time_point")],I.prototype,"last_code_update",void 0),a([o.field("time_point")],I.prototype,"created",void 0),a([o.field("asset?")],I.prototype,"core_liquid_balance",void 0),a([o.field("int64")],I.prototype,"ram_quota",void 0),a([o.field("int64")],I.prototype,"net_weight",void 0),a([o.field("int64")],I.prototype,"cpu_weight",void 0),a([o.field(st)],I.prototype,"net_limit",void 0),a([o.field(st)],I.prototype,"cpu_limit",void 0),a([o.field("uint64")],I.prototype,"ram_usage",void 0),a([o.field(wt,{array:!0})],I.prototype,"permissions",void 0),a([o.field(at,{optional:!0})],I.prototype,"total_resources",void 0),a([o.field(ct,{optional:!0})],I.prototype,"self_delegated_bandwidth",void 0),a([o.field(ut,{optional:!0})],I.prototype,"refund_request",void 0),a([o.field(L,{optional:!0})],I.prototype,"voter_info",void 0),a([o.field(Q,{optional:!0})],I.prototype,"rex_info",void 0),I=a([o.type("account_object")],I);let Et=class extends o{};a([o.field("name")],Et.prototype,"producer_name",void 0),a([o.field("public_key")],Et.prototype,"block_signing_key",void 0),Et=a([o.type("new_producers_entry")],Et);let It=class extends o{};a([o.field("uint32")],It.prototype,"version",void 0),a([o.field(Et,{array:!0})],It.prototype,"producers",void 0),It=a([o.type("new_producers")],It);let Lt=class extends o{};a([o.field("uint16")],Lt.prototype,"type",void 0),a([o.field("bytes")],Lt.prototype,"data",void 0),Lt=a([o.type("block_extension")],Lt);let Tt=class extends o{};a([o.field("uint16")],Tt.prototype,"type",void 0),a([o.field("bytes")],Tt.prototype,"data",void 0),Tt=a([o.type("header_extension")],Tt);class Ne{constructor(t,e){this.id=t,this.extra=e}static from(t){let e,n;return typeof t=="string"?(e=T.from(t),n={}):(e=T.from(t.id),n=t),new this(e,n)}get transaction(){if(this.extra.packed_trx)return ot.decode({data:this.extra.packed_trx,type:K})}get signatures(){if(this.extra.signatures)return this.extra.signatures.map(H.from)}equals(t){return this.id.equals(t.id)}toJSON(){return this.id}}Ne.abiName="trx_variant";let Gt=class extends gt{get id(){return this.trx.id}};a([o.field(Ne)],Gt.prototype,"trx",void 0),Gt=a([o.type("get_block_response_receipt")],Gt);let R=class extends o{};a([o.field("time_point")],R.prototype,"timestamp",void 0),a([o.field("name")],R.prototype,"producer",void 0),a([o.field("uint16")],R.prototype,"confirmed",void 0),a([o.field("checksum256")],R.prototype,"previous",void 0),a([o.field("checksum256")],R.prototype,"transaction_mroot",void 0),a([o.field("checksum256")],R.prototype,"action_mroot",void 0),a([o.field("uint32")],R.prototype,"schedule_version",void 0),a([o.field(It,{optional:!0})],R.prototype,"new_producers",void 0),a([o.field("header_extension",{optional:!0})],R.prototype,"header_extensions",void 0),a([o.field("any",{optional:!0})],R.prototype,"new_protocol_features",void 0),a([o.field("signature")],R.prototype,"producer_signature",void 0),a([o.field(Gt,{array:!0})],R.prototype,"transactions",void 0),a([o.field("block_extension",{optional:!0})],R.prototype,"block_extensions",void 0),a([o.field("checksum256")],R.prototype,"id",void 0),a([o.field("uint32")],R.prototype,"block_num",void 0),a([o.field("uint32")],R.prototype,"ref_block_prefix",void 0),R=a([o.type("get_block_response")],R);let Bt=class extends o{};a([o.field("name")],Bt.prototype,"producer_name",void 0),a([o.field("any")],Bt.prototype,"authority",void 0),Bt=a([o.type("active_schedule_producer_authority")],Bt);let Pt=class extends o{};a([o.field("name")],Pt.prototype,"producer_name",void 0),a([o.field(Bt)],Pt.prototype,"authority",void 0),Pt=a([o.type("active_schedule_producer")],Pt);let zt=class extends o{};a([o.field("uint32")],zt.prototype,"version",void 0),a([o.field(Pt,{array:!0})],zt.prototype,"producers",void 0),zt=a([o.type("active_schedule")],zt);let F=class extends o{};a([o.field("time_point")],F.prototype,"timestamp",void 0),a([o.field("name")],F.prototype,"producer",void 0),a([o.field("uint16")],F.prototype,"confirmed",void 0),a([o.field("checksum256")],F.prototype,"previous",void 0),a([o.field("checksum256")],F.prototype,"transaction_mroot",void 0),a([o.field("checksum256")],F.prototype,"action_mroot",void 0),a([o.field("uint32")],F.prototype,"schedule_version",void 0),a([o.field(Tt,{array:!0,optional:!0})],F.prototype,"header_extensions",void 0),a([o.field("signature")],F.prototype,"producer_signature",void 0),F=a([o.type("block_state_header")],F);let C=class extends o{};a([o.field("uint32")],C.prototype,"block_num",void 0),a([o.field("uint32")],C.prototype,"dpos_proposed_irreversible_blocknum",void 0),a([o.field("uint32")],C.prototype,"dpos_irreversible_blocknum",void 0),a([o.field("checksum256")],C.prototype,"id",void 0),a([o.field(F)],C.prototype,"header",void 0),a([o.field("any")],C.prototype,"active_schedule",void 0),a([o.field("any")],C.prototype,"blockroot_merkle",void 0),a([o.field("any")],C.prototype,"producer_to_last_produced",void 0),a([o.field("any")],C.prototype,"producer_to_last_implied_irb",void 0),a([o.field("any")],C.prototype,"valid_block_signing_authority",void 0),a([o.field("any")],C.prototype,"confirm_count",void 0),a([o.field("any")],C.prototype,"pending_schedule",void 0),a([o.field("any")],C.prototype,"activated_protocol_features",void 0),a([o.field("any")],C.prototype,"additional_signatures",void 0),C=a([o.type("get_block_header_state_response")],C);let O=class extends o{getTransactionHeader(t=120){const e=de.fromMilliseconds(this.head_block_time.toMilliseconds()+t*1e3),i=this.last_irreversible_block_id.array.subarray(8,12),s=new Uint32Array(i.buffer,i.byteOffset,1)[0];return Z.from({expiration:e,ref_block_num:Number(this.last_irreversible_block_num)&65535,ref_block_prefix:s})}};a([o.field("string")],O.prototype,"server_version",void 0),a([o.field("checksum256")],O.prototype,"chain_id",void 0),a([o.field("uint32")],O.prototype,"head_block_num",void 0),a([o.field("uint32")],O.prototype,"last_irreversible_block_num",void 0),a([o.field("checksum256")],O.prototype,"last_irreversible_block_id",void 0),a([o.field("checksum256")],O.prototype,"head_block_id",void 0),a([o.field("time_point")],O.prototype,"head_block_time",void 0),a([o.field("name")],O.prototype,"head_block_producer",void 0),a([o.field("uint64")],O.prototype,"virtual_block_cpu_limit",void 0),a([o.field("uint64")],O.prototype,"virtual_block_net_limit",void 0),a([o.field("uint64")],O.prototype,"block_cpu_limit",void 0),a([o.field("uint64")],O.prototype,"block_net_limit",void 0),a([o.field("string?")],O.prototype,"server_version_string",void 0),a([o.field("uint32?")],O.prototype,"fork_db_head_block_num",void 0),a([o.field("checksum256?")],O.prototype,"fork_db_head_block_id",void 0),O=a([o.type("get_info_response")],O);let nt=class extends o{};a([o.field("name")],nt.prototype,"code",void 0),a([o.field("name")],nt.prototype,"scope",void 0),a([o.field("name")],nt.prototype,"table",void 0),a([o.field("name")],nt.prototype,"payer",void 0),a([o.field("uint32")],nt.prototype,"count",void 0),nt=a([o.type("get_table_by_scope_response_row")],nt);let Rt=class extends o{};a([o.field(nt,{array:!0})],Rt.prototype,"rows",void 0),a([o.field("string")],Rt.prototype,"more",void 0),Rt=a([o.type("get_table_by_scope_response")],Rt);let X=class extends o{};a([o.field(E)],X.prototype,"global_action_seq",void 0),a([o.field(U)],X.prototype,"account_action_seq",void 0),a([o.field(V)],X.prototype,"block_num",void 0),a([o.field(pe)],X.prototype,"block_time",void 0),a([o.field("any")],X.prototype,"action_trace",void 0),a([o.field("boolean?")],X.prototype,"irrevirsible",void 0),X=a([o.type("ordered_action_result")],X);let lt=class extends o{};a([o.field(X,{array:!0})],lt.prototype,"actions",void 0),a([o.field(et)],lt.prototype,"last_irreversible_block",void 0),a([o.field(et)],lt.prototype,"head_block_num",void 0),a([o.field("boolean?")],lt.prototype,"time_limit_exceeded_error",void 0),lt=a([o.type("get_actions_response")],lt);let Ee=class extends o{};Ee=a([o.type("transaction_trace")],Ee);let $=class extends o{};a([o.field("any")],$.prototype,"actions",void 0),a([o.field("any")],$.prototype,"context_free_actions",void 0),a([o.field("any")],$.prototype,"context_free_data",void 0),a([o.field("number")],$.prototype,"delay_sec",void 0),a([o.field("string")],$.prototype,"expiration",void 0),a([o.field("number")],$.prototype,"max_cpu_usage_ms",void 0),a([o.field("number")],$.prototype,"max_net_usage_words",void 0),a([o.field("number")],$.prototype,"ref_block_num",void 0),a([o.field("number")],$.prototype,"ref_block_prefix",void 0),a([o.field("string",{array:!0})],$.prototype,"signatures",void 0),$=a([o.type("trx")],$);let Jt=class extends o{};a([o.field(gt)],Jt.prototype,"receipt",void 0),a([o.field("trx")],Jt.prototype,"trx",void 0),Jt=a([o.type("transaction_info")],Jt);let tt=class extends o{};a([o.field(T)],tt.prototype,"id",void 0),a([o.field(V)],tt.prototype,"block_num",void 0),a([o.field(pe)],tt.prototype,"block_time",void 0),a([o.field(V)],tt.prototype,"last_irreversible_block",void 0),a([o.field("any?")],tt.prototype,"traces",void 0),a([o.field("any")],tt.prototype,"trx",void 0),tt=a([o.type("get_transaction_response")],tt);let Ht=class extends o{};a([o.field("name",{array:!0})],Ht.prototype,"account_names",void 0),Ht=a([o.type("get_key_accounts_response")],Ht);let Kt=class extends o{};a([o.field("name",{array:!0})],Kt.prototype,"controlled_accounts",void 0),Kt=a([o.type("get_controlled_accounts_response")],Kt);let q=class extends o{};a([o.field("string")],q.prototype,"state",void 0),a([o.field("uint32")],q.prototype,"head_number",void 0),a([o.field("checksum256")],q.prototype,"head_id",void 0),a([o.field("time_point")],q.prototype,"head_timestamp",void 0),a([o.field("uint32")],q.prototype,"irreversible_number",void 0),a([o.field("checksum256")],q.prototype,"irreversible_id",void 0),a([o.field("time_point")],q.prototype,"irreversible_timestamp",void 0),a([o.field("checksum256")],q.prototype,"earliest_tracked_block_id",void 0),a([o.field("uint32")],q.prototype,"earliest_tracked_block_number",void 0),q=a([o.type("get_transaction_status_response")],q);var _r=Object.freeze({__proto__:null,get AccountPermission(){return wt},get AccountResourceLimit(){return st},get AccountTotalResources(){return at},get AccountSelfDelegatedBandwidth(){return ct},get AccountRefundRequest(){return ut},get AccountVoterInfo(){return L},get AccountRexInfoMaturities(){return ft},get AccountRexInfo(){return Q},get AccountObject(){return I},get NewProducersEntry(){return Et},get NewProducers(){return It},get BlockExtension(){return Lt},get HeaderExtension(){return Tt},TrxVariant:Ne,get GetBlockResponseTransactionReceipt(){return Gt},get GetBlockResponse(){return R},get ActiveScheduleProducerAuthority(){return Bt},get ActiveScheduleProducer(){return Pt},get ActiveSchedule(){return zt},get BlockStateHeader(){return F},get GetBlockHeaderStateResponse(){return C},get GetInfoResponse(){return O},get GetTableByScopeResponseRow(){return nt},get GetTableByScopeResponse(){return Rt},get OrderedActionsResult(){return X},get GetActionsResponse(){return lt},get TransactionTrace(){return Ee},get Trx(){return $},get TransactionInfo(){return Jt},get GetTransactionResponse(){return tt},get GetKeyAccountsResponse(){return Ht},get GetControlledAccountsResponse(){return Kt},get GetTransactionStatusResponse(){return q}});class vr{constructor(t){this.client=t}async get_abi(t){return this.client.call({path:"/v1/chain/get_abi",params:{account_name:S.from(t)}})}async get_account(t){return this.client.call({path:"/v1/chain/get_account",params:{account_name:S.from(t)},responseType:I})}async get_block(t){return this.client.call({path:"/v1/chain/get_block",params:{block_num_or_id:t},responseType:R})}async get_block_header_state(t){return this.client.call({path:"/v1/chain/get_block_header_state",params:{block_num_or_id:t},responseType:C})}async get_currency_balance(t,e,n){const i={account:S.from(e),code:S.from(t)};return n&&(i.symbol=n),this.client.call({path:"/v1/chain/get_currency_balance",params:i,responseType:"asset[]"})}async get_info(){return this.client.call({path:"/v1/chain/get_info",responseType:O})}async compute_transaction(t){return y(t,j)||(t=j.fromSigned(Y.from(t))),this.client.call({path:"/v1/chain/compute_transaction",params:{transaction:t}})}async push_transaction(t){return y(t,j)||(t=j.fromSigned(Y.from(t))),this.client.call({path:"/v1/chain/push_transaction",params:t})}async send_transaction(t){return y(t,j)||(t=j.fromSigned(Y.from(t))),this.client.call({path:"/v1/chain/send_transaction",params:t})}async send_transaction2(t,e){return y(t,j)||(t=j.fromSigned(Y.from(t))),this.client.call({path:"/v1/chain/send_transaction2",params:{return_failure_trace:!0,retry_trx:!1,retry_trx_num_blocks:0,transaction:t,...e}})}async get_table_rows(t){const e=t.type;let n=t.key_type;const i=t.lower_bound||t.upper_bound;!n&&i&&(y(i,E)?n="i64":y(i,ht)?n="i128":y(i,T)?n="sha256":y(i,pt)&&(n="ripemd160")),n||(n="name");let s=t.json;s===void 0&&(s=e===void 0);let c=t.upper_bound;c&&typeof c!="string"&&(c=String(c));let u=t.lower_bound;u&&typeof u!="string"&&(u=String(u));let f=t.scope;typeof f>"u"?f=String(S.from(t.code)):typeof f!="string"&&(f=String(f));let{rows:l,more:b,next_key:v}=await this.client.call({path:"/v1/chain/get_table_rows",params:{...t,code:S.from(t.code),table:S.from(t.table),limit:t.limit!==void 0?V.from(t.limit):void 0,scope:f,key_type:n,json:s,upper_bound:c,lower_bound:u}}),x;if(t.show_payer&&(x=[],l=l.map(({data:w,payer:d})=>(x.push(S.from(d)),w))),e&&(s?l=l.map(w=>typeof w=="string"&&g.isBytes(w)?ot.decode({data:g.from(w),type:e}):ot.decode({object:w,type:e})):l=l.map(w=>g.from(w)).map(w=>ot.decode({data:w,type:e}))),v&&v.length>0){let w;switch(n){case"i64":w=E;break;case"i128":w=ht;break;case"name":w=S;break;case"float64":w=fe;break;case"float128":w=le;break;case"sha256":w=T;break;case"ripemd160":w=pt;break;default:throw new Error(`Unsupported key type: ${n}`)}w===S?v=S.from(ot.decode({object:v,type:E})):v=ot.decode({object:v,type:w})}else v=void 0;return{rows:l,more:b,next_key:v,ram_payers:x}}async get_table_by_scope(t){return this.client.call({path:"/v1/chain/get_table_by_scope",params:t,responseType:Rt})}async get_transaction_status(t){return this.client.call({path:"/v1/chain/get_transaction_status",params:{id:T.from(t)},responseType:q})}}class Ar{constructor(t){this.client=t}async get_actions(t,e,n){return this.client.call({path:"/v1/history/get_actions",params:{account_name:S.from(t),pos:et.from(e),offset:et.from(n)},responseType:lt})}async get_transaction(t,e={}){return this.client.call({path:"/v1/history/get_transaction",params:{id:T.from(t),block_num_hint:e.blockNumHint&&V.from(e.blockNumHint),traces:e.excludeTraces===!0?!1:void 0},responseType:tt})}async get_key_accounts(t){return this.client.call({path:"/v1/history/get_key_accounts",params:{public_key:W.from(t)},responseType:Ht})}async get_controlled_accounts(t){return this.client.call({path:"/v1/history/get_controlled_accounts",params:{controlling_account:S.from(t)},responseType:Kt})}}class Zt extends Error{constructor(t,e){let n;e.json&&e.json.error?n=`${Zt.formatError(e.json.error)} at ${t}`:n=`HTTP ${e.status} at ${t}`,super(n),this.path=t,this.response=e}static formatError(t){return t.what==="unspecified"&&t.details[0].file&&t.details[0].file==="http_plugin.cpp"&&t.details[0].message.slice(0,11)==="unknown key"?"Account not found":t.what==="unspecified"&&t.details&&t.details.length>0?t.details[0].message:t.what&&t.what.length>0?t.what:"Unknown API error"}get error(){const{json:t}=this.response;return t?t.error:void 0}get name(){const{error:t}=this;return t?t.name:"unspecified"}get code(){const{error:t}=this;return t?t.code:0}get details(){const{error:t}=this;return t?t.details:[]}}Zt.__className="APIError";class He{constructor(t){if(this.v1={chain:new vr(this),history:new Ar(this)},t.provider)this.provider=t.provider;else if(t.url)this.provider=new Je(t.url,t);else throw new Error("Missing url or provider")}async call(t){const e=await this.provider.call(t.path,t.params),{json:n}=e;if(Math.floor(e.status/100)!==2||n&&typeof n.error=="object")throw new Zt(t.path,e);return t.responseType?yt({type:t.responseType,object:e.json}):e.json||e.text}}He.__className="APIClient";var Kr=Object.freeze({__proto__:null,v1:_r})}}]);