{`Withdrawal fees: ${withdrawFeeStr}`}
{`Rounding loss: ${overheadStr}`}
# Coins | Value | Withdraw Fee | Refresh Fee | Deposit fee | {uniq.map(row)}
---|
{"You are about to withdraw "} {amountToPretty(props.amount)} {" from your bank account into your wallet."}
); if (this.complexViewRequested() || !props.suggestedExchangeUrl) { return (Error: {this.statusString()}
{advancedButton}{`Withdraw fees: ${amountToPretty(totalCost)}`}
{advancedButton}Please wait...
} } confirmReserve() { this.confirmReserveImpl(this.reserveCreationInfo()!, this.url()!, this.props.amount, this.props.callback_url); } update() { this.timer.stop(); const doUpdate = () => { this.reserveCreationInfo(null); if (!this.url()) { this.statusString = i18n`Error: URL is empty`; m.redraw(true); return; } this.statusString(null); let parsedUrl = URI(this.url()!); if (parsedUrl.is("relative")) { this.statusString = i18n`Error: URL may not be relative`; this.forceUpdate(); return; } this.forceUpdate(); console.log("doing get exchange info"); getReserveCreationInfo(this.url()!, this.props.amount) .then((r: ReserveCreationInfo) => { console.log("get exchange info resolved"); this.isValidExchange = true; this.reserveCreationInfo(r); console.dir(r); }) .catch((e) => { console.log("get exchange info rejected"); if (e.hasOwnProperty("httpStatus")) { this.statusString(`Error: request failed with status ${e.httpStatus}`); } else if (e.hasOwnProperty("errorResponse")) { let resp = e.errorResponse; this.statusString(`Error: ${resp.error} (${resp.hint})`); } }); }; doUpdate(); console.log("got update", this.url()); } reset() { this.isValidExchange = false; this.statusString(null); this.reserveCreationInfo(null); } confirmReserveImpl(rci: ReserveCreationInfo, exchange: string, amount: AmountJson, callback_url: string) { const d = {exchange, amount}; const cb = (rawResp: any) => { if (!rawResp) { throw Error("empty response"); } // FIXME: filter out types that bank/exchange don't have in common let wire_details = rci.wireInfo; if (!rawResp.error) { const resp = CreateReserveResponse.checked(rawResp); let q: {[name: string]: string|number} = { wire_details: JSON.stringify(wire_details), exchange: resp.exchange, reserve_pub: resp.reservePub, amount_value: amount.value, amount_fraction: amount.fraction, amount_currency: amount.currency, }; let url = URI(callback_url).addQuery(q); if (!url.is("absolute")) { throw Error("callback url is not absolute"); } console.log("going to", url.href()); document.location.href = url.href(); } else { this.reset(); this.statusString( `Oops, something went wrong.` + `The wallet responded with error status (${rawResp.error}).`); } }; chrome.runtime.sendMessage({type: 'create-reserve', detail: d}, cb); } onUrlChanged(url: string) { this.reset(); this.url(url); this.timer.bump(); } viewComplex() { function *f(): IterableIteratorWithdraw fees: {amountToPretty(totalCost)}
; } yield ( ); yield ; yield (