edge-currency-accountbased 4.26.0 → 4.26.1
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.
- package/CHANGELOG.md +5 -0
- package/android/src/main/assets/edge-currency-accountbased/4163.chunk.js +3 -3
- package/android/src/main/assets/edge-currency-accountbased/zcash.chunk.js +3 -3
- package/lib/piratechain/PiratechainEngine.js +26 -15
- package/lib/zcash/ZcashEngine.js +23 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 4.26.1 (2024-10-14)
|
|
6
|
+
|
|
7
|
+
- changed: (Zcash/Piratechain) Await synchronizer initialization in public methods instead of throwing `synchronizer undefined`error
|
|
8
|
+
- fixed: (Zcash/Piratechain) Don't save sensitive initializer object to engine
|
|
9
|
+
|
|
5
10
|
## 4.26.0 (2024-10-03)
|
|
6
11
|
|
|
7
12
|
- changed: Add redundancy to Cardano queries
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[4163],{99649:function(j,k,u){"use strict";u.r(k),u.d(k,{PiratechainTools:function(){return A},makeCurrencyEngine:function(){return
|
|
2
|
-
${(0,v.T5)(t)}`)}catch(c){throw this.warn("FAILURE broadcastTx failed: ",c),c}return t})}getFreshAddress(){return h(this,null,function*(){const t=()=>h(this,null,function*(){
|
|
1
|
+
(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[4163],{99649:function(j,k,u){"use strict";u.r(k),u.d(k,{PiratechainTools:function(){return A},makeCurrencyEngine:function(){return R},makeCurrencyTools:function(){return M},updateInfoPayload:function(){return $}});var y=u(66001),I=u(90749),D=u(48287),E=u(36856),b=u(96542),v=u(44276),g=u(62071),w=u(82671),P=u(65828),H=u(26277),z=Object.defineProperty,C=Object.getOwnPropertySymbols,B=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,x=Reflect.get,S=(s,t,e)=>t in s?z(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,K=(s,t)=>{for(var e in t||(t={}))N.call(t,e)&&S(s,e,t[e]);if(C)for(var e of C(t))O.call(t,e)&&S(s,e,t[e]);return s},m=(s,t,e)=>x(B(s),e,t),h=(s,t,e)=>new Promise((n,r)=>{var o=a=>{try{l(e.next(a))}catch(c){r(c)}},i=a=>{try{l(e.throw(a))}catch(c){r(c)}},l=a=>a.done?n(a.value):Promise.resolve(a.value).then(o,i);l((e=e.apply(s,t)).next())});class p extends H.k{constructor(t,e,n,r,o){super(t,e,n,r);const{networkInfo:i}=t;this.pluginId=this.currencyInfo.pluginId,this.networkInfo=i,this.birthdayHeight=0,this.makeSynchronizer=o,this.synchronizerPromise=new Promise(l=>{this.synchronizerResolver=l}),this.queryMutex=!1,this.started=!1,this.progressRatio=0}setOtherData(t){this.otherData=(0,g.Gb)(t)}initData(){this.otherData.blockRange.first===0&&(this.otherData.blockRange={first:this.birthdayHeight,last:this.birthdayHeight}),this.initialNumBlocksToDownload=-1,this.synchronizerStatus="DISCONNECTED",this.availableZatoshi="0"}initSubscriptions(){this.synchronizer!=null&&(this.synchronizer.on("update",t=>h(this,null,function*(){const{lastDownloadedHeight:e,scanProgress:n,networkBlockHeight:r}=t;this.onUpdateBlockHeight(r),this.onUpdateProgress(e,n,r),yield this.queryAll()})),this.synchronizer.on("statusChanged",t=>h(this,null,function*(){this.synchronizerStatus=t.name,yield this.queryAll()})),this.synchronizer.on("error",t=>h(this,null,function*(){this.log.warn(`Synchronizer error: ${t.message}`),t.level==="critical"&&(yield this.killEngine(),this.lastUpdateFromSynchronizer=void 0,yield this.startEngine())})))}queryAll(){return h(this,null,function*(){if(this.lastUpdateFromSynchronizer=Date.now(),!this.queryMutex){this.queryMutex=!0;try{yield this.queryBalance(),yield this.queryTransactions(),this.onUpdateTransactions()}catch{}this.queryMutex=!1}})}onUpdateBlockHeight(t){this.walletLocalData.blockHeight!==t&&(this.walletLocalData.blockHeight=t,this.walletLocalDataDirty=!0,this.currencyEngineCallbacks.onBlockHeightChanged(this.walletLocalData.blockHeight))}onUpdateTransactions(){this.transactionsChangedArray.length>0&&(this.currencyEngineCallbacks.onTransactionsChanged(this.transactionsChangedArray),this.transactionsChangedArray=[])}onUpdateProgress(t,e,n){if(!this.addressesChecked&&!this.isSynced()){const r=e*.99,o=e*.8;this.tokenCheckBalanceStatus[this.currencyInfo.currencyCode]=r/100,this.tokenCheckTransactionsStatus[this.currencyInfo.currencyCode]=o/100;const i=(r+o)/2;i>this.progressRatio&&(this.progressRatio=i,this.log.warn(`Scan and download progress: ${Math.floor(i)}%`),this.updateOnAddressesChecked())}}startEngine(){return h(this,null,function*(){this.engineOn=!0,this.started=!0,yield m(p.prototype,this,"startEngine").call(this)})}isSynced(){return this.synchronizerStatus==="SYNCED"}queryBalance(){return h(this,null,function*(){if(!(!this.isSynced()||this.synchronizer==null))try{const t=yield this.synchronizer.getBalance();if(t.totalZatoshi==="-1")return;this.availableZatoshi=t.availableZatoshi,this.updateBalance(this.currencyInfo.currencyCode,t.totalZatoshi)}catch(t){this.warn("Failed to update balances",t),this.updateBalance(this.currencyInfo.currencyCode,"0")}})}queryTransactions(){return h(this,null,function*(){if(this.synchronizer!=null)try{let t=this.otherData.blockRange.first,e=this.otherData.blockRange.last;for(;this.isSynced()&&e<=this.walletLocalData.blockHeight;){if((yield this.synchronizer.getTransactions({first:t,last:e})).forEach(r=>this.processTransaction(r)),e===this.walletLocalData.blockHeight){t=this.walletLocalData.blockHeight,this.walletLocalDataDirty=!0,this.tokenCheckTransactionsStatus[this.currencyInfo.currencyCode]=1,this.updateOnAddressesChecked();break}t=e+1,e=e+this.networkInfo.transactionQueryLimit<this.walletLocalData.blockHeight?e+this.networkInfo.transactionQueryLimit:this.walletLocalData.blockHeight,this.otherData.blockRange={first:t,last:e},this.walletLocalDataDirty=!0}}catch(t){this.error(`Error querying ${this.currencyInfo.currencyCode} transactions `,t)}})}processTransaction(t){let e=t.value;const n=[];t.toAddress!=null?e=`-${(0,y.add)(e,this.networkInfo.defaultNetworkFee)}`:n.push(this.walletInfo.keys.publicKey);const r=t.memos.filter(i=>i!=="").map(i=>({memoName:"memo",type:"text",value:i})),o={blockHeight:t.minedHeight,currencyCode:this.currencyInfo.currencyCode,date:t.blockTimeInSeconds,isSend:e.startsWith("-"),memos:r,nativeAmount:e,networkFee:this.networkInfo.defaultNetworkFee,otherParams:{},ourReceiveAddresses:n,signedTx:"",tokenId:null,txid:t.rawTransactionId,walletId:this.walletId};this.addTransaction(this.currencyInfo.currencyCode,o)}syncNetwork(t){return h(this,null,function*(){if(!this.started)return 1e3;const e=(0,g.cl)(this.currencyInfo.pluginId)(t==null?void 0:t.privateKeys),{rpcNode:n}=this.networkInfo;this.birthdayHeight=e.birthdayHeight;try{this.synchronizerPromise=this.makeSynchronizer(K({mnemonicSeed:e.mnemonic,birthdayHeight:e.birthdayHeight,alias:P.xn.stringify(P.K3.parse(this.walletId))},n)),this.synchronizer=yield this.synchronizerPromise,this.synchronizerResolver(this.synchronizer)}catch(r){if(String(r)==="Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.")this.log.warn("SDK not present");else throw r}return this.initData(),this.initSubscriptions(),yield new Promise(r=>{this.stopSyncing=r})})}killEngine(){return h(this,null,function*(){var t;this.synchronizerPromise=new Promise(e=>{this.synchronizerResolver=e}),this.started=!1,this.stopSyncing!=null&&(yield this.stopSyncing(1e3),this.stopSyncing=void 0),yield(t=this.synchronizer)==null?void 0:t.stop(),yield m(p.prototype,this,"killEngine").call(this)})}clearBlockchainCache(){return h(this,null,function*(){yield m(p.prototype,this,"clearBlockchainCache").call(this)})}resyncBlockchain(){return h(this,null,function*(){var t;yield m(p.prototype,this,"killEngine").call(this),yield this.clearBlockchainCache(),yield this.startEngine(),(t=this.synchronizer)==null||t.rescan().catch(e=>this.warn("resyncBlockchain failed: ",e)),this.initData(),this.progressRatio=0,this.synchronizerStatus="SYNCING"})}getMaxSpendable(){return h(this,null,function*(){const t=(0,y.sub)(this.availableZatoshi,this.networkInfo.defaultNetworkFee);if((0,y.lte)(t,"0"))throw new w.k5({tokenId:null});return t})}makeSpend(t){return h(this,null,function*(){var e;if(!this.isSynced())throw new Error("Cannot spend until wallet is synced");const{edgeSpendInfo:n,currencyCode:r}=this.makeSpendCheck(t),{memos:o=[],tokenId:i}=n,l=n.spendTargets[0],{publicAddress:a,nativeAmount:c}=l;if(a==null)throw new Error("makeSpend Missing publicAddress");if(c==null)throw new w.ef;if((0,y.eq)(c,"0"))throw new w.ef;const f=(0,y.add)(c,this.networkInfo.defaultNetworkFee);if((0,y.gt)(f,(e=this.walletLocalData.totalBalances[this.currencyInfo.currencyCode])!=null?e:"0"))throw new w.k5({tokenId:i});if((0,y.gt)(f,this.availableZatoshi))throw new w.k5({tokenId:i});const V=(0,y.mul)(f,"-1");return{blockHeight:0,currencyCode:r,date:0,isSend:!0,memos:o,nativeAmount:V,networkFee:this.networkInfo.defaultNetworkFee,ourReceiveAddresses:[],signedTx:"",tokenId:i,txid:"",walletId:this.walletId}})}signTx(t){return h(this,null,function*(){return t})}broadcastTx(t,e){return h(this,null,function*(){var n;const{memos:r}=t,o=(0,g.cl)(this.pluginId)(e==null?void 0:e.privateKeys);if(t.spendTargets==null||t.spendTargets.length!==1)throw new Error("Invalid spend targets");const i=((n=r[0])==null?void 0:n.type)==="text"?r[0].value:"",l=t.spendTargets[0],a={zatoshi:(0,y.sub)((0,y.abs)(t.nativeAmount),t.networkFee),toAddress:l.publicAddress,memo:i,mnemonicSeed:o.mnemonic};try{const f=yield(yield this.synchronizerPromise).sendToAddress(a);t.txid=f.txId,t.signedTx=f.raw,t.date=Date.now()/1e3,this.warn(`SUCCESS broadcastTx
|
|
2
|
+
${(0,v.T5)(t)}`)}catch(c){throw this.warn("FAILURE broadcastTx failed: ",c),c}return t})}getFreshAddress(){return h(this,null,function*(){const t=()=>h(this,null,function*(){const e=yield this.synchronizerPromise,{saplingAddress:n}=yield e.deriveUnifiedAddress();return this.otherData.cachedAddress=n,this.walletLocalDataDirty=!0,{publicAddress:n}});return this.otherData.cachedAddress==null?yield t():(t().catch(e=>{throw e}),{publicAddress:this.otherData.cachedAddress})})}}function R(s,t,e,n){return h(this,null,function*(){const r=(0,g.xH)(e),{makeSynchronizer:o}=s.nativeIo["edge-currency-accountbased"].piratechain,i=new p(s,t,r,n,o);return yield i.loadEngine(),i})}var T=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,F=(s,t)=>{var e={};for(var n in s)U.call(s,n)&&t.indexOf(n)<0&&(e[n]=s[n]);if(s!=null&&T)for(var n of T(s))t.indexOf(n)<0&&L.call(s,n)&&(e[n]=s[n]);return e},d=(s,t,e)=>new Promise((n,r)=>{var o=a=>{try{l(e.next(a))}catch(c){r(c)}},i=a=>{try{l(e.throw(a))}catch(c){r(c)}},l=a=>a.done?n(a.value):Promise.resolve(a.value).then(o,i);l((e=e.apply(s,t)).next())});class A{constructor(t){const{builtinTokens:e,currencyInfo:n,io:r,networkInfo:o}=t;this.builtinTokens=e,this.currencyInfo=n,this.io=r,this.networkInfo=o;const i=t.nativeIo["edge-currency-accountbased"];if(i==null)throw new Error("Need opts");const{Tools:l}=i.piratechain;this.nativeTools=l}getDisplayPrivateKey(t){return d(this,null,function*(){const{pluginId:e}=this.currencyInfo,n=(0,g.cl)(e)(t.keys);return`Seed Phrase:
|
|
3
3
|
${n.mnemonic}
|
|
4
4
|
|
|
5
5
|
Birthday Height:
|
|
6
|
-
${n.birthdayHeight}`})}getDisplayPublicKey(t){return d(this,null,function*(){const{keys:e}=(0,
|
|
6
|
+
${n.birthdayHeight}`})}getDisplayPublicKey(t){return d(this,null,function*(){const{keys:e}=(0,g.xH)(t);return e.publicKey})}getNewWalletBirthdayBlockheight(){return d(this,null,function*(){return yield this.nativeTools.getBirthdayHeight(this.networkInfo.rpcNode.defaultHost,this.networkInfo.rpcNode.defaultPort)})}isValidAddress(t){return d(this,null,function*(){return yield this.nativeTools.isValidAddress(t)})}importPrivateKey(t){return d(this,arguments,function*(e,n={}){const{pluginId:r}=this.currencyInfo,o=(0,I.validateMnemonic)(e);if(e.split(" ").length!==24)throw new Error("Mnemonic must be 24 words");if(!o)throw new Error(`Invalid ${this.currencyInfo.currencyCode} mnemonic`);const i=yield this.getNewWalletBirthdayBlockheight();let l=i;const{birthdayHeight:a}=n;if(a!=null){(0,E.ym)(a);const c=parseInt(a);if(c>i)throw new Error("InvalidBirthdayHeight");l=c}return{[`${r}Mnemonic`]:e,[`${r}BirthdayHeight`]:l}})}createPrivateKey(t){return d(this,null,function*(){if(t!==this.currencyInfo.walletType)throw new Error("InvalidWalletType");const e=D.Buffer.from(this.io.random(32)).toString("hex"),n=(0,I.entropyToMnemonic)(e);return yield this.importPrivateKey(n)})}checkPublicKey(t){return d(this,null,function*(){try{return(0,g.QC)(t).publicKey.length>0}catch{return!1}})}derivePublicKey(t){return d(this,null,function*(){const{pluginId:e}=this.currencyInfo,n=(0,g.cl)(e)(t.keys);if(t.type!==this.currencyInfo.walletType)throw new Error("InvalidWalletType");const r=n.mnemonic;if(typeof r!="string")throw new Error("InvalidMnemonic");const o=yield this.nativeTools.deriveViewingKey(r,this.networkInfo.rpcNode.networkName);return{birthdayHeight:n.birthdayHeight,publicKey:o}})}parseUri(t,e,n){return d(this,null,function*(){const{pluginId:r}=this.currencyInfo,o={[r]:!0},{edgeParsedUri:i,edgeParsedUri:{publicAddress:l}}=yield(0,b.x)({currencyInfo:this.currencyInfo,uri:t,networks:o,builtinTokens:this.builtinTokens,currencyCode:e!=null?e:this.currencyInfo.currencyCode,customTokens:n});if(l==null||!(yield this.isValidAddress(l)))throw new Error("InvalidPublicAddressError");return i})}encodeUri(t){return d(this,arguments,function*(e,n=[]){const{pluginId:r}=this.currencyInfo,{nativeAmount:o,currencyCode:i,publicAddress:l}=e;if(!(yield this.isValidAddress(l)))throw new Error("InvalidPublicAddressError");let a;if(o!=null){const f=(0,v.FQ)(i!=null?i:this.currencyInfo.currencyCode,this.currencyInfo,n,this.builtinTokens);if(f==null)throw new Error("InternalErrorInvalidCurrencyCode");a=(0,y.div)(o,f.multiplier,18)}return(0,b.m)(e,`${r}`,a)})}}function M(s){return d(this,null,function*(){return new A(s)})}function $(s,t){return d(this,null,function*(){const e=F(t,[]);s.networkInfo=(0,v.wy)(s.networkInfo,e)})}},15340:function(){},79838:function(){}}]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[6478],{36823:function(X,
|
|
2
|
-
${(0,b.T5)(t)}`)}catch(s){throw this.warn("FAILURE broadcastTx failed: ",s),s}return t})}getFreshAddress(){return c(this,null,function*(){const t=()=>c(this,null,function*(){
|
|
1
|
+
(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[6478],{36823:function(X,P,u){"use strict";u.r(P),u.d(P,{ZcashTools:function(){return x},makeCurrencyEngine:function(){return V},makeCurrencyTools:function(){return J},updateInfoPayload:function(){return Q}});var d=u(66001),D=u(90749),N=u(48287),U=u(36856),E=u(96542),b=u(44276),p=u(175),v=u(82671),C=u(65828),Z=u(26277),K=Object.defineProperty,B=Object.getOwnPropertySymbols,M=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,L=Reflect.get,O=(a,t,e)=>t in a?K(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,$=(a,t)=>{for(var e in t||(t={}))R.call(t,e)&&O(a,e,t[e]);if(B)for(var e of B(t))F.call(t,e)&&O(a,e,t[e]);return a},T=(a,t,e)=>L(M(a),e,t),c=(a,t,e)=>new Promise((n,r)=>{var i=o=>{try{l(e.next(o))}catch(h){r(h)}},s=o=>{try{l(e.throw(o))}catch(h){r(h)}},l=o=>o.done?n(o.value):Promise.resolve(o.value).then(i,s);l((e=e.apply(a,t)).next())});const z="autoshield";class w extends Z.k{constructor(t,e,n,r,i){super(t,e,n,r);const{networkInfo:s}=t;this.pluginId=this.currencyInfo.pluginId,this.networkInfo=s,this.makeSynchronizer=i,this.synchronizerPromise=new Promise(l=>{this.synchronizerResolver=l}),this.balances={transparentAvailableZatoshi:"0",transparentTotalZatoshi:"0",saplingAvailableZatoshi:"0",saplingTotalZatoshi:"0",orchardAvailableZatoshi:"0",orchardTotalZatoshi:"0"},this.autoshielding={createAutoshieldTx:!1,threshold:(0,d.mul)(this.networkInfo.defaultNetworkFee,"2")}}setOtherData(t){this.otherData=(0,p.fS)(t)}initData(){this.otherData.isSdkInitializedOnDisk=!0,this.walletLocalDataDirty=!0,this.synchronizerStatus="DISCONNECTED",this.availableZatoshi="0",this.progressRatio={seenFirstUpdate:!1,percent:0,lastUpdate:0}}initSubscriptions(){this.synchronizer!=null&&(this.synchronizer.on("update",t=>c(this,null,function*(){const{scanProgress:e,networkBlockHeight:n}=t;this.onUpdateBlockHeight(n),this.onUpdateProgress(e),yield this.checkAutoshielding()})),this.synchronizer.on("statusChanged",t=>c(this,null,function*(){this.synchronizerStatus=t.name})),this.synchronizer.on("balanceChanged",t=>c(this,null,function*(){const{transparentAvailableZatoshi:e,transparentTotalZatoshi:n,saplingAvailableZatoshi:r,saplingTotalZatoshi:i,orchardAvailableZatoshi:s,orchardTotalZatoshi:l}=t;this.availableZatoshi=(0,d.add)(r,s),this.balances={transparentAvailableZatoshi:e,transparentTotalZatoshi:n,saplingAvailableZatoshi:r,saplingTotalZatoshi:i,orchardAvailableZatoshi:s,orchardTotalZatoshi:l};const o=(0,d.add)((0,d.add)(n,i),l);this.updateBalance(this.currencyInfo.currencyCode,o),yield this.checkAutoshielding()})),this.synchronizer.on("transactionsChanged",t=>c(this,null,function*(){const{transactions:e}=t;e.forEach(n=>{n.rawTransactionId===this.autoshielding.txid&&n.minedHeight>0&&(this.autoshielding.txid=void 0,this.autoshielding.createAutoshieldTx=!1),this.processTransaction(n)}),this.onUpdateTransactions()})),this.synchronizer.on("error",t=>c(this,null,function*(){this.log.warn(`Synchronizer error: ${t.message}`),t.level==="critical"&&(yield this.killEngine(),yield this.startEngine())})))}onUpdateBlockHeight(t){this.walletLocalData.blockHeight!==t&&(this.walletLocalData.blockHeight=t,this.walletLocalDataDirty=!0,this.currencyEngineCallbacks.onBlockHeightChanged(this.walletLocalData.blockHeight))}onUpdateTransactions(){this.transactionsChangedArray.length>0&&(this.currencyEngineCallbacks.onTransactionsChanged(this.transactionsChangedArray),this.transactionsChangedArray=[])}onUpdateProgress(t){!this.progressRatio.seenFirstUpdate&&(this.progressRatio.seenFirstUpdate=!0,t!==100)||(this.tokenCheckBalanceStatus[this.currencyInfo.currencyCode]=t/100,this.tokenCheckTransactionsStatus[this.currencyInfo.currencyCode]=t/100,t>this.progressRatio.percent&&(t===100||Date.now()-this.progressRatio.lastUpdate>1e3)&&(this.progressRatio.percent=t,this.progressRatio.lastUpdate=Date.now(),this.log.warn(`Scan and download progress: ${Math.floor(t)}%`),this.updateOnAddressesChecked()))}updateBalance(t,e){const n=this.walletLocalData.totalBalances[t];this.walletLocalData.totalBalances[t]==null&&(this.walletLocalData.totalBalances[t]="0"),(n==null||!(0,d.eq)(e,n))&&(this.walletLocalData.totalBalances[t]=e,this.walletLocalDataDirty=!0,this.warn(`${t}: token Address balance: ${e}`),this.currencyEngineCallbacks.onBalanceChanged(t,e))}startEngine(){return c(this,null,function*(){this.engineOn=!0,yield T(w.prototype,this,"startEngine").call(this)})}isSynced(){return this.synchronizerStatus==="SYNCED"}processTransaction(t){var e;const{rawTransactionId:n,raw:r,blockTimeInSeconds:i,minedHeight:s,value:l,fee:o,toAddress:h,memos:g}=t;let f=l;const A=o!=null?o:this.networkInfo.defaultNetworkFee;h!=null&&(f=`-${(0,d.add)(f,A)}`);const m=g.filter(k=>k!=="").map(k=>({memoName:"memo",type:"text",value:k}));this.otherData.missingAndroidShieldedMemosHack.includes(n)&&m.length===0&&m.push({memoName:"memo",type:"text",value:z}),((e=m[0])==null?void 0:e.value)===z&&(f=`-${A}`);const S=s===0?Math.max(i,Date.now()/1e3):i,I={blockHeight:s,currencyCode:this.currencyInfo.currencyCode,date:S,isSend:f.startsWith("-"),memos:m,nativeAmount:f,networkFee:A,otherParams:{},ourReceiveAddresses:[],signedTx:r!=null?r:"",tokenId:null,txid:n,walletId:this.walletId};this.addTransaction(this.currencyInfo.currencyCode,I)}checkAutoshielding(){return c(this,null,function*(){this.isSynced()&&!this.autoshielding.createAutoshieldTx&&(0,d.gt)(this.balances.transparentAvailableZatoshi,this.autoshielding.threshold)&&(this.autoshielding.createAutoshieldTx=!0,yield this.restartSyncNetwork())})}syncNetwork(t){return c(this,null,function*(){if(!this.engineOn)return 1e3;const e=(0,p.f9)(this.currencyInfo.pluginId)(t==null?void 0:t.privateKeys);if(this.synchronizer==null){const{rpcNode:n}=this.networkInfo;this.synchronizerPromise=this.makeSynchronizer($({mnemonicSeed:e.mnemonic,birthdayHeight:e.birthdayHeight,alias:C.xn.stringify(C.K3.parse(this.walletId)),newWallet:!this.otherData.isSdkInitializedOnDisk},n)),this.synchronizer=yield this.synchronizerPromise,this.synchronizerResolver(this.synchronizer),this.initData(),this.initSubscriptions()}return this.synchronizer!=null&&this.autoshielding.createAutoshieldTx?yield new Promise(n=>{var r;this.log.warn("Autoshield transaction broadcasting..."),(r=this.synchronizer)==null||r.shieldFunds({seed:e.mnemonic,memo:z,threshold:this.autoshielding.threshold}).then(i=>{this.log.warn("Autoshield success",i.rawTransactionId),i.blockTimeInSeconds=Date.now()/1e3,this.autoshielding.txid=i.rawTransactionId,this.otherData.missingAndroidShieldedMemosHack.push(i.rawTransactionId),this.walletLocalDataDirty=!0,this.processTransaction(i),this.onUpdateTransactions()}).catch(i=>{this.autoshielding.createAutoshieldTx=!1,this.log.error("Autoshield failed: ",i)}).finally(()=>{this.stopSyncing=n})}):yield new Promise(n=>{this.stopSyncing=n})})}killEngine(){return c(this,null,function*(){var t;this.synchronizerPromise=new Promise(e=>{this.synchronizerResolver=e}),yield T(w.prototype,this,"killEngine").call(this),yield this.restartSyncNetwork(),yield(t=this.synchronizer)==null?void 0:t.stop(),this.synchronizer=void 0})}restartSyncNetwork(){return c(this,null,function*(){this.stopSyncing!=null&&(yield this.stopSyncing(1e3),this.stopSyncing=void 0)})}clearBlockchainCache(){return c(this,null,function*(){yield T(w.prototype,this,"clearBlockchainCache").call(this)})}resyncBlockchain(){return c(this,null,function*(){var t;yield T(w.prototype,this,"killEngine").call(this),yield this.clearBlockchainCache(),yield this.startEngine(),yield(t=this.synchronizer)==null?void 0:t.rescan().catch(e=>this.warn("resyncBlockchain failed: ",e)),this.initData(),this.synchronizerStatus="SYNCING"})}getMaxSpendable(t){return c(this,null,function*(){var e,n;const{memos:r=[],spendTargets:i}=t,{publicAddress:s}=i[0];if(s==null)throw new Error("makeSpend Missing publicAddress");const l=yield this.synchronizerPromise;try{yield l.proposeTransfer({toAddress:s,zatoshi:this.availableZatoshi,memo:(n=(e=r[0])==null?void 0:e.value)!=null?n:""})}catch(o){const h=j(String(o));return(0,d.sub)(this.availableZatoshi,h)}return this.availableZatoshi})}makeSpend(t){return c(this,null,function*(){var e,n,r;const{edgeSpendInfo:i,currencyCode:s}=this.makeSpendCheck(t),{memos:l=[],tokenId:o}=i,h=i.spendTargets[0],{publicAddress:g,nativeAmount:f}=h;if(g==null)throw new Error("makeSpend Missing publicAddress");if(f==null)throw new v.ef;if((0,d.eq)(f,"0"))throw new v.ef;if((0,d.gt)(f,this.availableZatoshi))throw new v.k5({tokenId:o});const m=yield(yield this.synchronizerPromise).proposeTransfer({toAddress:g,zatoshi:f,memo:(n=(e=l[0])==null?void 0:e.value)!=null?n:""}),S=m.totalFee,I=(0,d.add)(f,S);if((0,d.gt)(I,(r=this.walletLocalData.totalBalances[this.currencyInfo.currencyCode])!=null?r:"0"))throw new v.k5({tokenId:o});if((0,d.gt)(I,this.availableZatoshi))throw new v.k5({tokenId:o});const k=(0,d.mul)(I,"-1");return{blockHeight:0,currencyCode:s,date:0,isSend:!0,memos:l,nativeAmount:k,networkFee:S,otherParams:{proposalBase64:m.proposalBase64},ourReceiveAddresses:[],signedTx:"",tokenId:o,txid:"",walletId:this.walletId}})}signTx(t){return c(this,null,function*(){return t})}broadcastTx(t,e){return c(this,null,function*(){const{proposalBase64:n}=(0,b.Je)(t);if(n==null)throw new Error("Missing proposalBase64 from makeSpend");const r=(0,p.f9)(this.pluginId)(e==null?void 0:e.privateKeys),i={proposalBase64:n,mnemonicSeed:r.mnemonic};try{const l=yield(yield this.synchronizerPromise).createTransfer(i);t.txid=l,t.date=Date.now()/1e3,this.warn(`SUCCESS broadcastTx
|
|
2
|
+
${(0,b.T5)(t)}`)}catch(s){throw this.warn("FAILURE broadcastTx failed: ",s),s}return t})}getFreshAddress(){return c(this,null,function*(){const t=()=>c(this,null,function*(){const e=yield this.synchronizerPromise,{unifiedAddress:n}=yield e.deriveUnifiedAddress();return this.otherData.cachedAddress=n,this.walletLocalDataDirty=!0,{publicAddress:n}});return this.otherData.cachedAddress==null?yield t():(t().catch(e=>{throw e}),{publicAddress:this.otherData.cachedAddress})})}}function V(a,t,e,n){return c(this,null,function*(){const r=(0,p.mS)(e),{makeSynchronizer:i}=a.nativeIo["edge-currency-accountbased"].zcash,s=new w(a,t,r,n,i);return yield s.loadEngine(),s})}const j=a=>{const t=/(\d+)/g,e=a.match(t);if(e==null||e.length!==2)throw new Error("Error parsing proposeTransfer error string");const n=parseInt(e[0]).toString();return(0,d.sub)(parseInt(e[1]).toString(),n)};var H=Object.getOwnPropertySymbols,W=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,Y=(a,t)=>{var e={};for(var n in a)W.call(a,n)&&t.indexOf(n)<0&&(e[n]=a[n]);if(a!=null&&H)for(var n of H(a))t.indexOf(n)<0&&G.call(a,n)&&(e[n]=a[n]);return e},y=(a,t,e)=>new Promise((n,r)=>{var i=o=>{try{l(e.next(o))}catch(h){r(h)}},s=o=>{try{l(e.throw(o))}catch(h){r(h)}},l=o=>o.done?n(o.value):Promise.resolve(o.value).then(i,s);l((e=e.apply(a,t)).next())});class x{constructor(t){const{builtinTokens:e,currencyInfo:n,io:r,networkInfo:i}=t;this.builtinTokens=e,this.currencyInfo=n,this.io=r,this.networkInfo=i;const s=t.nativeIo["edge-currency-accountbased"];if(s==null)throw new Error("Need opts");const{Tools:l}=s.zcash;this.nativeTools=l}getDisplayPrivateKey(t){return y(this,null,function*(){const{pluginId:e}=this.currencyInfo,n=(0,p.f9)(e)(t.keys);return`Seed Phrase:
|
|
3
3
|
${n.mnemonic}
|
|
4
4
|
|
|
5
5
|
Birthday Height:
|
|
6
|
-
${n.birthdayHeight}`})}getDisplayPublicKey(t){return y(this,null,function*(){const{keys:e}=(0,p.mS)(t);return e.publicKey})}getNewWalletBirthdayBlockheight(){return y(this,null,function*(){return yield this.nativeTools.getBirthdayHeight(this.networkInfo.rpcNode.defaultHost,this.networkInfo.rpcNode.defaultPort)})}isValidAddress(t){return y(this,null,function*(){return yield this.nativeTools.isValidAddress(t)})}importPrivateKey(t){return y(this,arguments,function*(e,n={}){const{pluginId:r}=this.currencyInfo,i=(0,D.validateMnemonic)(e);if(e.split(" ").length!==24)throw new Error("Mnemonic must be 24 words");if(!i)throw new Error(`Invalid ${this.currencyInfo.currencyCode} mnemonic`);const s=yield this.getNewWalletBirthdayBlockheight();let l=s;const{birthdayHeight:o}=n;if(o!=null){(0,U.ym)(o);const
|
|
6
|
+
${n.birthdayHeight}`})}getDisplayPublicKey(t){return y(this,null,function*(){const{keys:e}=(0,p.mS)(t);return e.publicKey})}getNewWalletBirthdayBlockheight(){return y(this,null,function*(){return yield this.nativeTools.getBirthdayHeight(this.networkInfo.rpcNode.defaultHost,this.networkInfo.rpcNode.defaultPort)})}isValidAddress(t){return y(this,null,function*(){return yield this.nativeTools.isValidAddress(t)})}importPrivateKey(t){return y(this,arguments,function*(e,n={}){const{pluginId:r}=this.currencyInfo,i=(0,D.validateMnemonic)(e);if(e.split(" ").length!==24)throw new Error("Mnemonic must be 24 words");if(!i)throw new Error(`Invalid ${this.currencyInfo.currencyCode} mnemonic`);const s=yield this.getNewWalletBirthdayBlockheight();let l=s;const{birthdayHeight:o}=n;if(o!=null){(0,U.ym)(o);const h=parseInt(o);if(h>s)throw new Error("InvalidBirthdayHeight");l=h}return{[`${r}Mnemonic`]:e,[`${r}BirthdayHeight`]:l}})}createPrivateKey(t){return y(this,null,function*(){if(t!==this.currencyInfo.walletType)throw new Error("InvalidWalletType");const e=N.Buffer.from(this.io.random(32)).toString("hex"),n=(0,D.entropyToMnemonic)(e);return yield this.importPrivateKey(n)})}checkPublicKey(t){return y(this,null,function*(){try{return(0,p.tH)(t),!0}catch{return!1}})}derivePublicKey(t){return y(this,null,function*(){const{pluginId:e}=this.currencyInfo,n=(0,p.f9)(e)(t.keys);if(t.type!==this.currencyInfo.walletType)throw new Error("InvalidWalletType");const r=n.mnemonic;if(typeof r!="string")throw new Error("InvalidMnemonic");const i=yield this.nativeTools.deriveViewingKey(r,this.networkInfo.rpcNode.networkName);return{birthdayHeight:n.birthdayHeight,publicKey:i}})}parseUri(t,e,n){return y(this,null,function*(){const{pluginId:r}=this.currencyInfo,i={[r]:!0},{edgeParsedUri:s,edgeParsedUri:{publicAddress:l}}=yield(0,E.x)({currencyInfo:this.currencyInfo,uri:t,networks:i,builtinTokens:this.builtinTokens,currencyCode:e!=null?e:this.currencyInfo.currencyCode,customTokens:n});if(l==null||!(yield this.isValidAddress(l)))throw new Error("InvalidPublicAddressError");return s})}encodeUri(t){return y(this,arguments,function*(e,n=[]){const{pluginId:r}=this.currencyInfo,{nativeAmount:i,currencyCode:s,publicAddress:l}=e;if(!(yield this.isValidAddress(l)))throw new Error("InvalidPublicAddressError");let o;if(i!=null){const g=(0,b.FQ)(s!=null?s:this.currencyInfo.currencyCode,this.currencyInfo,n,this.builtinTokens);if(g==null)throw new Error("InternalErrorInvalidCurrencyCode");o=(0,d.div)(i,g.multiplier,18)}return(0,E.m)(e,`${r}`,o)})}}function J(a){return y(this,null,function*(){return new x(a)})}function Q(a,t){return y(this,null,function*(){const e=Y(t,[]);a.networkInfo=(0,b.wy)(a.networkInfo,e)})}},15340:function(){},79838:function(){}}]);
|
|
@@ -55,6 +55,8 @@ var _piratechainTypes = require('./piratechainTypes');
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
+
|
|
59
|
+
|
|
58
60
|
|
|
59
61
|
constructor(
|
|
60
62
|
env,
|
|
@@ -67,7 +69,11 @@ var _piratechainTypes = require('./piratechainTypes');
|
|
|
67
69
|
const { networkInfo } = env
|
|
68
70
|
this.pluginId = this.currencyInfo.pluginId
|
|
69
71
|
this.networkInfo = networkInfo
|
|
72
|
+
this.birthdayHeight = 0
|
|
70
73
|
this.makeSynchronizer = makeSynchronizer
|
|
74
|
+
this.synchronizerPromise = new Promise(resolve => {
|
|
75
|
+
this.synchronizerResolver = resolve
|
|
76
|
+
})
|
|
71
77
|
this.queryMutex = false
|
|
72
78
|
|
|
73
79
|
this.started = false
|
|
@@ -79,13 +85,11 @@ var _piratechainTypes = require('./piratechainTypes');
|
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
initData() {
|
|
82
|
-
const { birthdayHeight } = this.initializer
|
|
83
|
-
|
|
84
88
|
// walletLocalData
|
|
85
89
|
if (this.otherData.blockRange.first === 0) {
|
|
86
90
|
this.otherData.blockRange = {
|
|
87
|
-
first: birthdayHeight,
|
|
88
|
-
last: birthdayHeight
|
|
91
|
+
first: this.birthdayHeight,
|
|
92
|
+
last: this.birthdayHeight
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
95
|
|
|
@@ -293,15 +297,19 @@ var _piratechainTypes = require('./piratechainTypes');
|
|
|
293
297
|
)(_optionalChain([opts, 'optionalAccess', _ => _.privateKeys]))
|
|
294
298
|
|
|
295
299
|
const { rpcNode } = this.networkInfo
|
|
296
|
-
this.
|
|
297
|
-
mnemonicSeed: piratechainPrivateKeys.mnemonic,
|
|
298
|
-
birthdayHeight: piratechainPrivateKeys.birthdayHeight,
|
|
299
|
-
alias: _rfc4648.base16.stringify(_rfc4648.base64.parse(this.walletId)),
|
|
300
|
-
...rpcNode
|
|
301
|
-
}
|
|
300
|
+
this.birthdayHeight = piratechainPrivateKeys.birthdayHeight
|
|
302
301
|
|
|
303
302
|
try {
|
|
304
|
-
this.
|
|
303
|
+
// Replace this.synchronizerPromise with a fresh promise. The old promise might have already been resolved
|
|
304
|
+
this.synchronizerPromise = this.makeSynchronizer({
|
|
305
|
+
mnemonicSeed: piratechainPrivateKeys.mnemonic,
|
|
306
|
+
birthdayHeight: piratechainPrivateKeys.birthdayHeight,
|
|
307
|
+
alias: _rfc4648.base16.stringify(_rfc4648.base64.parse(this.walletId)),
|
|
308
|
+
...rpcNode
|
|
309
|
+
})
|
|
310
|
+
this.synchronizer = await this.synchronizerPromise
|
|
311
|
+
// People might be waiting on the old promise, so resolve that
|
|
312
|
+
this.synchronizerResolver(this.synchronizer)
|
|
305
313
|
} catch (e) {
|
|
306
314
|
// The synchronizer cannot start if it isn't present.
|
|
307
315
|
if (
|
|
@@ -320,6 +328,9 @@ var _piratechainTypes = require('./piratechainTypes');
|
|
|
320
328
|
}
|
|
321
329
|
|
|
322
330
|
async killEngine() {
|
|
331
|
+
this.synchronizerPromise = new Promise(resolve => {
|
|
332
|
+
this.synchronizerResolver = resolve
|
|
333
|
+
})
|
|
323
334
|
this.started = false
|
|
324
335
|
if (this.stopSyncing != null) {
|
|
325
336
|
await this.stopSyncing(1000)
|
|
@@ -418,7 +429,6 @@ var _piratechainTypes = require('./piratechainTypes');
|
|
|
418
429
|
edgeTransaction,
|
|
419
430
|
opts
|
|
420
431
|
) {
|
|
421
|
-
if (this.synchronizer == null) throw new Error('Synchronizer undefined')
|
|
422
432
|
const { memos } = edgeTransaction
|
|
423
433
|
const piratechainPrivateKeys = _piratechainTypes.asPiratechainPrivateKeys.call(void 0, this.pluginId)(
|
|
424
434
|
_optionalChain([opts, 'optionalAccess', _10 => _10.privateKeys])
|
|
@@ -442,7 +452,8 @@ var _piratechainTypes = require('./piratechainTypes');
|
|
|
442
452
|
}
|
|
443
453
|
|
|
444
454
|
try {
|
|
445
|
-
const
|
|
455
|
+
const synchronizer = await this.synchronizerPromise
|
|
456
|
+
const signedTx = await synchronizer.sendToAddress(txParams)
|
|
446
457
|
edgeTransaction.txid = signedTx.txId
|
|
447
458
|
edgeTransaction.signedTx = signedTx.raw
|
|
448
459
|
edgeTransaction.date = Date.now() / 1000
|
|
@@ -456,8 +467,8 @@ var _piratechainTypes = require('./piratechainTypes');
|
|
|
456
467
|
|
|
457
468
|
async getFreshAddress() {
|
|
458
469
|
const getSynchronizerAddresses = async () => {
|
|
459
|
-
|
|
460
|
-
const { saplingAddress } = await
|
|
470
|
+
const synchronizer = await this.synchronizerPromise
|
|
471
|
+
const { saplingAddress } = await synchronizer.deriveUnifiedAddress()
|
|
461
472
|
this.otherData.cachedAddress = saplingAddress
|
|
462
473
|
this.walletLocalDataDirty = true
|
|
463
474
|
return {
|
package/lib/zcash/ZcashEngine.js
CHANGED
|
@@ -47,7 +47,6 @@ const AUTOSHIELD_MEMO = 'autoshield'
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
|
|
51
50
|
|
|
52
51
|
|
|
53
52
|
|
|
@@ -59,6 +58,8 @@ const AUTOSHIELD_MEMO = 'autoshield'
|
|
|
59
58
|
|
|
60
59
|
|
|
61
60
|
|
|
61
|
+
|
|
62
|
+
|
|
62
63
|
|
|
63
64
|
|
|
64
65
|
|
|
@@ -76,6 +77,9 @@ const AUTOSHIELD_MEMO = 'autoshield'
|
|
|
76
77
|
this.pluginId = this.currencyInfo.pluginId
|
|
77
78
|
this.networkInfo = networkInfo
|
|
78
79
|
this.makeSynchronizer = makeSynchronizer
|
|
80
|
+
this.synchronizerPromise = new Promise(resolve => {
|
|
81
|
+
this.synchronizerResolver = resolve
|
|
82
|
+
})
|
|
79
83
|
this.balances = {
|
|
80
84
|
transparentAvailableZatoshi: '0',
|
|
81
85
|
transparentTotalZatoshi: '0',
|
|
@@ -340,15 +344,18 @@ const AUTOSHIELD_MEMO = 'autoshield'
|
|
|
340
344
|
|
|
341
345
|
if (this.synchronizer == null) {
|
|
342
346
|
const { rpcNode } = this.networkInfo
|
|
343
|
-
|
|
347
|
+
|
|
348
|
+
// Replace this.synchronizerPromise with a fresh promise. The old promise might have already been resolved
|
|
349
|
+
this.synchronizerPromise = this.makeSynchronizer({
|
|
344
350
|
mnemonicSeed: zcashPrivateKeys.mnemonic,
|
|
345
351
|
birthdayHeight: zcashPrivateKeys.birthdayHeight,
|
|
346
352
|
alias: _rfc4648.base16.stringify(_rfc4648.base64.parse(this.walletId)),
|
|
347
353
|
newWallet: !this.otherData.isSdkInitializedOnDisk,
|
|
348
354
|
...rpcNode
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
|
|
355
|
+
})
|
|
356
|
+
this.synchronizer = await this.synchronizerPromise
|
|
357
|
+
// People might be waiting on the old promise, so resolve that
|
|
358
|
+
this.synchronizerResolver(this.synchronizer)
|
|
352
359
|
this.initData()
|
|
353
360
|
this.initSubscriptions()
|
|
354
361
|
}
|
|
@@ -392,6 +399,9 @@ const AUTOSHIELD_MEMO = 'autoshield'
|
|
|
392
399
|
}
|
|
393
400
|
|
|
394
401
|
async killEngine() {
|
|
402
|
+
this.synchronizerPromise = new Promise(resolve => {
|
|
403
|
+
this.synchronizerResolver = resolve
|
|
404
|
+
})
|
|
395
405
|
await super.killEngine()
|
|
396
406
|
await this.restartSyncNetwork()
|
|
397
407
|
await _optionalChain([this, 'access', _13 => _13.synchronizer, 'optionalAccess', _14 => _14.stop, 'call', _15 => _15()])
|
|
@@ -428,10 +438,10 @@ const AUTOSHIELD_MEMO = 'autoshield'
|
|
|
428
438
|
if (publicAddress == null) {
|
|
429
439
|
throw new Error('makeSpend Missing publicAddress')
|
|
430
440
|
}
|
|
431
|
-
|
|
441
|
+
const synchronizer = await this.synchronizerPromise
|
|
432
442
|
try {
|
|
433
443
|
// We anticipate this to fail and return an error message we cna parse the spendable amount from
|
|
434
|
-
await
|
|
444
|
+
await synchronizer.proposeTransfer({
|
|
435
445
|
toAddress: publicAddress,
|
|
436
446
|
zatoshi: this.availableZatoshi,
|
|
437
447
|
memo: _nullishCoalesce(_optionalChain([memos, 'access', _21 => _21[0], 'optionalAccess', _22 => _22.value]), () => ( ''))
|
|
@@ -459,8 +469,8 @@ const AUTOSHIELD_MEMO = 'autoshield'
|
|
|
459
469
|
throw new (0, _types.InsufficientFundsError)({ tokenId })
|
|
460
470
|
}
|
|
461
471
|
|
|
462
|
-
|
|
463
|
-
const proposal = await
|
|
472
|
+
const synchronizer = await this.synchronizerPromise
|
|
473
|
+
const proposal = await synchronizer.proposeTransfer({
|
|
464
474
|
toAddress: publicAddress,
|
|
465
475
|
zatoshi: nativeAmount,
|
|
466
476
|
memo: _nullishCoalesce(_optionalChain([memos, 'access', _23 => _23[0], 'optionalAccess', _24 => _24.value]), () => ( ''))
|
|
@@ -519,7 +529,6 @@ const AUTOSHIELD_MEMO = 'autoshield'
|
|
|
519
529
|
edgeTransaction,
|
|
520
530
|
opts
|
|
521
531
|
) {
|
|
522
|
-
if (this.synchronizer == null) throw new Error('Synchronizer undefined')
|
|
523
532
|
const { proposalBase64 } = _utils.getOtherParams.call(void 0, edgeTransaction)
|
|
524
533
|
if (proposalBase64 == null) {
|
|
525
534
|
throw new Error('Missing proposalBase64 from makeSpend')
|
|
@@ -534,7 +543,8 @@ const AUTOSHIELD_MEMO = 'autoshield'
|
|
|
534
543
|
}
|
|
535
544
|
|
|
536
545
|
try {
|
|
537
|
-
const
|
|
546
|
+
const synchronizer = await this.synchronizerPromise
|
|
547
|
+
const txid = await synchronizer.createTransfer(txParams)
|
|
538
548
|
edgeTransaction.txid = txid
|
|
539
549
|
edgeTransaction.date = Date.now() / 1000
|
|
540
550
|
this.warn(`SUCCESS broadcastTx\n${_utils.cleanTxLogs.call(void 0, edgeTransaction)}`)
|
|
@@ -547,8 +557,8 @@ const AUTOSHIELD_MEMO = 'autoshield'
|
|
|
547
557
|
|
|
548
558
|
async getFreshAddress() {
|
|
549
559
|
const getSynchronizerAddresses = async () => {
|
|
550
|
-
|
|
551
|
-
const { unifiedAddress } = await
|
|
560
|
+
const synchronizer = await this.synchronizerPromise
|
|
561
|
+
const { unifiedAddress } = await synchronizer.deriveUnifiedAddress()
|
|
552
562
|
this.otherData.cachedAddress = unifiedAddress
|
|
553
563
|
this.walletLocalDataDirty = true
|
|
554
564
|
|