diff options
Diffstat (limited to 'bank/index.js')
-rw-r--r-- | bank/index.js | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/bank/index.js b/bank/index.js index 86a1bf29a..3c1e2e280 100644 --- a/bank/index.js +++ b/bank/index.js @@ -11815,6 +11815,32 @@ function parseWithdrawUri(s5) { return void 0; return r3.body; } +function parseAddExchangeUriWithError(s5) { + const pi = parseProtoInfoWithError(s5, "add-exchange"); + if (pi.type === "fail") { + return pi; + } + const parts = pi.body.rest.split("/"); + if (parts.length < 2) { + return opKnownTalerFailure(TalerErrorCode.WALLET_TALER_URI_MALFORMED, { + code: TalerErrorCode.WALLET_TALER_URI_MALFORMED + }); + } + const host = parts[0].toLowerCase(); + const pathSegments = parts.slice(1, parts.length - 1); + const p4 = [host, ...pathSegments].join("/"); + const result = { + type: TalerUriAction.AddExchange, + exchangeBaseUrl: canonicalizeBaseUrl(`${pi.body.innerProto}://${p4}/`) + }; + return opFixedSuccess(result); +} +function parseAddExchangeUri(s5) { + const r3 = parseAddExchangeUriWithError(s5); + if (r3.type === "fail") + return void 0; + return r3.body; +} var TalerUriType; (function(TalerUriType2) { TalerUriType2["TalerPay"] = "taler-pay"; @@ -11840,6 +11866,7 @@ var TalerUriAction; TalerUriAction2["Restore"] = "restore"; TalerUriAction2["DevExperiment"] = "dev-experiment"; TalerUriAction2["WithdrawExchange"] = "withdraw-exchange"; + TalerUriAction2["AddExchange"] = "add-exchange"; })(TalerUriAction || (TalerUriAction = {})); function parseProtoInfo(s5, action) { const pfxPlain = `taler://${action}/`; @@ -11891,7 +11918,8 @@ var parsers = { [TalerUriAction.Refund]: parseRefundUri, [TalerUriAction.Withdraw]: parseWithdrawUri, [TalerUriAction.DevExperiment]: parseDevExperimentUri, - [TalerUriAction.WithdrawExchange]: parseWithdrawExchangeUri + [TalerUriAction.WithdrawExchange]: parseWithdrawExchangeUri, + [TalerUriAction.AddExchange]: parseAddExchangeUri }; function parseTalerUri(string) { const https = string.startsWith("taler://"); @@ -11935,6 +11963,9 @@ function stringifyTalerUri(uri) { case TalerUriAction.WithdrawExchange: { return stringifyWithdrawExchange(uri); } + case TalerUriAction.AddExchange: { + return stringifyAddExchange(uri); + } } } function parsePayUri(s5) { @@ -12141,6 +12172,10 @@ function stringifyWithdrawExchange({ exchangeBaseUrl, exchangePub, amount }) { }); return `${proto}://withdraw-exchange/${path}${exchangePub ?? ""}${query}`; } +function stringifyAddExchange({ exchangeBaseUrl }) { + const { proto, path } = getUrlInfo(exchangeBaseUrl); + return `${proto}://add-exchange/${path}`; +} function stringifyDevExperimentUri({ devExperimentId }) { return `taler://dev-experiment/${devExperimentId}`; } @@ -32475,7 +32510,7 @@ var AccountPage = utils_exports.compose( // src/pages/BankFrame.tsx init_preact_module(); init_hooks_module(); -var GIT_HASH = true ? "a08ad2c631da0283a5e10189d06977a96665afae" : void 0; +var GIT_HASH = true ? "de32e0217c54f26a54813f56c378155bcacf4416" : void 0; var VERSION = true ? "0.9.3-dev.29" : void 0; function BankFrame({ children, |