diff options
Diffstat (limited to 'packages/taler-util/src/wallet-types.ts')
-rw-r--r-- | packages/taler-util/src/wallet-types.ts | 318 |
1 files changed, 175 insertions, 143 deletions
diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts index 9575e6d7d..24a48b415 100644 --- a/packages/taler-util/src/wallet-types.ts +++ b/packages/taler-util/src/wallet-types.ts @@ -48,11 +48,13 @@ import { } from "./codec.js"; import { CurrencySpecification, + TalerMerchantApi, TemplateParams, WithdrawalOperationStatus, + canonicalizeBaseUrl, } from "./index.js"; import { VersionMatchResult } from "./libtool-version.js"; -import { PaytoUri } from "./payto.js"; +import { PaytoString, PaytoUri, codecForPaytoString } from "./payto.js"; import { AgeCommitmentProof } from "./taler-crypto.js"; import { TalerErrorCode } from "./taler-error-codes.js"; import { @@ -149,6 +151,27 @@ function codecForTombstoneIdStr(): Codec<TombstoneIdStr> { }; } +export function codecForCanonBaseUrl(): Codec<string> { + return { + decode(x: any, c?: Context): string { + if (typeof x === "string") { + const canon = canonicalizeBaseUrl(x); + if (x !== canon) { + throw new DecodingError( + `expected canonicalized base URL at ${renderContext( + c, + )} but got value '${x}'`, + ); + } + return x; + } + throw new DecodingError( + `expected base URL at ${renderContext(c)} but got type ${typeof x}`, + ); + }, + }; +} + /** * Response for the create reserve request to the wallet. */ @@ -206,11 +229,13 @@ interface GetPlanForWalletInitiatedOperation { export interface ConvertAmountRequest { amount: AmountString; type: TransactionAmountMode; + depositPaytoUri: PaytoString; } export const codecForConvertAmountRequest = buildCodecForObject<ConvertAmountRequest>() .property("amount", codecForAmountString()) + .property("depositPaytoUri", codecForPaytoString()) .property( "type", codecForEither( @@ -294,15 +319,10 @@ interface GetPlanForPaymentRequest extends GetPlanToCompleteOperation { maxDepositFee: AmountString; } -// interface GetPlanForTipRequest extends GetPlanForOperationBase { -// type: TransactionType.Tip; -// } -// interface GetPlanForRefundRequest extends GetPlanForOperationBase { -// type: TransactionType.Refund; -// } interface GetPlanForPullDebitRequest extends GetPlanToCompleteOperation { type: TransactionType.PeerPullDebit; } + interface GetPlanForPushCreditRequest extends GetPlanToCompleteOperation { type: TransactionType.PeerPushCredit; } @@ -470,6 +490,7 @@ export interface PartialWalletRunConfig { builtin?: Partial<WalletRunConfig["builtin"]>; testing?: Partial<WalletRunConfig["testing"]>; features?: Partial<WalletRunConfig["features"]>; + lazyTaskLoop?: Partial<WalletRunConfig["lazyTaskLoop"]>; } export interface WalletRunConfig { @@ -504,6 +525,16 @@ export interface WalletRunConfig { features: { allowHttp: boolean; }; + + /** + * Start processing tasks only when explicitly required, even after + * init has been called. + * + * Useful when the wallet is started to make single read-only request, + * as otherwise wallet-core starts making network request and process + * unrelated pending tasks. + */ + lazyTaskLoop: boolean; } export interface InitRequest { @@ -745,71 +776,6 @@ export interface PrepareRefundResult { info: OrderShortInfo; } -export interface PrepareTipResult { - /** - * Unique ID for the tip assigned by the wallet. - * Typically different from the merchant-generated tip ID. - * - * @deprecated use transactionId instead - */ - walletRewardId: string; - - /** - * Tip transaction ID. - */ - transactionId: TransactionIdStr; - - /** - * Has the tip already been accepted? - */ - accepted: boolean; - - /** - * Amount that the merchant gave. - */ - rewardAmountRaw: AmountString; - - /** - * Amount that arrived at the wallet. - * Might be lower than the raw amount due to fees. - */ - rewardAmountEffective: AmountString; - - /** - * Base URL of the merchant backend giving then tip. - */ - merchantBaseUrl: string; - - /** - * Base URL of the exchange that is used to withdraw the tip. - * Determined by the merchant, the wallet/user has no choice here. - */ - exchangeBaseUrl: string; - - /** - * Time when the tip will expire. After it expired, it can't be picked - * up anymore. - */ - expirationTimestamp: TalerProtocolTimestamp; -} - -export interface AcceptTipResponse { - transactionId: TransactionIdStr; - next_url?: string; -} - -export const codecForPrepareTipResult = (): Codec<PrepareTipResult> => - buildCodecForObject<PrepareTipResult>() - .property("accepted", codecForBoolean()) - .property("rewardAmountRaw", codecForAmountString()) - .property("rewardAmountEffective", codecForAmountString()) - .property("exchangeBaseUrl", codecForString()) - .property("merchantBaseUrl", codecForString()) - .property("expirationTimestamp", codecForTimestamp) - .property("walletRewardId", codecForString()) - .property("transactionId", codecForTransactionIdStr()) - .build("PrepareRewardResult"); - export interface BenchmarkResult { time: { [s: string]: number }; repetitions: number; @@ -1020,7 +986,8 @@ export interface PreparePayResultAlreadyConfirmed { export interface BankWithdrawDetails { status: WithdrawalOperationStatus; - amount: AmountJson; + currency: string; + amount: AmountJson | undefined; senderWire?: string; suggestedExchange?: string; confirmTransferUrl?: string; @@ -1063,7 +1030,7 @@ export interface TalerErrorDetail { /** * Minimal information needed about a planchet for unblinding a signature. * - * Can be a withdrawal/tipping/refresh planchet. + * Can be a withdrawal/refresh planchet. */ export interface PlanchetUnblindInfo { denomPub: DenominationPubKey; @@ -1470,7 +1437,7 @@ export const codecForFeesByOperations = (): Codec< export const codecForExchangeFullDetails = (): Codec<ExchangeFullDetails> => buildCodecForObject<ExchangeFullDetails>() .property("currency", codecForString()) - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("paytoUris", codecForList(codecForString())) .property("auditors", codecForList(codecForExchangeAuditor())) .property("wireInfo", codecForWireInfo()) @@ -1485,7 +1452,7 @@ export const codecForExchangeFullDetails = (): Codec<ExchangeFullDetails> => export const codecForExchangeListItem = (): Codec<ExchangeListItem> => buildCodecForObject<ExchangeListItem>() .property("currency", codecForString()) - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("masterPub", codecOptional(codecForString())) .property("paytoUris", codecForList(codecForString())) .property("tosStatus", codecForAny()) @@ -1709,7 +1676,7 @@ export interface TestPayArgs { export const codecForTestPayArgs = (): Codec<TestPayArgs> => buildCodecForObject<TestPayArgs>() - .property("merchantBaseUrl", codecForString()) + .property("merchantBaseUrl", codecForCanonBaseUrl()) .property("merchantAuthToken", codecOptional(codecForString())) .property("amount", codecForAmountString()) .property("summary", codecForString()) @@ -1727,12 +1694,12 @@ export interface IntegrationTestArgs { export const codecForIntegrationTestArgs = (): Codec<IntegrationTestArgs> => buildCodecForObject<IntegrationTestArgs>() - .property("exchangeBaseUrl", codecForString()) - .property("merchantBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) + .property("merchantBaseUrl", codecForCanonBaseUrl()) .property("merchantAuthToken", codecOptional(codecForString())) .property("amountToSpend", codecForAmountString()) .property("amountToWithdraw", codecForAmountString()) - .property("corebankApiBaseUrl", codecForString()) + .property("corebankApiBaseUrl", codecForCanonBaseUrl()) .build("IntegrationTestArgs"); export interface IntegrationTestV2Args { @@ -1744,10 +1711,10 @@ export interface IntegrationTestV2Args { export const codecForIntegrationTestV2Args = (): Codec<IntegrationTestV2Args> => buildCodecForObject<IntegrationTestV2Args>() - .property("exchangeBaseUrl", codecForString()) - .property("merchantBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) + .property("merchantBaseUrl", codecForCanonBaseUrl()) .property("merchantAuthToken", codecOptional(codecForString())) - .property("corebankApiBaseUrl", codecForString()) + .property("corebankApiBaseUrl", codecForCanonBaseUrl()) .build("IntegrationTestV2Args"); export interface GetExchangeEntryByUrlRequest { @@ -1757,7 +1724,7 @@ export interface GetExchangeEntryByUrlRequest { export const codecForGetExchangeEntryByUrlRequest = (): Codec<GetExchangeEntryByUrlRequest> => buildCodecForObject<GetExchangeEntryByUrlRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .build("GetExchangeEntryByUrlRequest"); export type GetExchangeEntryByUrlResponse = ExchangeListItem; @@ -1769,15 +1736,12 @@ export interface AddExchangeRequest { * @deprecated use a separate API call to start a forced exchange update instead */ forceUpdate?: boolean; - - masterPub?: string; } export const codecForAddExchangeRequest = (): Codec<AddExchangeRequest> => buildCodecForObject<AddExchangeRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("forceUpdate", codecOptional(codecForBoolean())) - .property("masterPub", codecOptional(codecForString())) .build("AddExchangeRequest"); export interface UpdateExchangeEntryRequest { @@ -1788,7 +1752,7 @@ export interface UpdateExchangeEntryRequest { export const codecForUpdateExchangeEntryRequest = (): Codec<UpdateExchangeEntryRequest> => buildCodecForObject<UpdateExchangeEntryRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("force", codecOptional(codecForBoolean())) .build("UpdateExchangeEntryRequest"); @@ -1799,7 +1763,7 @@ export interface GetExchangeResourcesRequest { export const codecForGetExchangeResourcesRequest = (): Codec<GetExchangeResourcesRequest> => buildCodecForObject<GetExchangeResourcesRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .build("GetExchangeResourcesRequest"); export interface GetExchangeResourcesResponse { @@ -1813,7 +1777,7 @@ export interface DeleteExchangeRequest { export const codecForDeleteExchangeRequest = (): Codec<DeleteExchangeRequest> => buildCodecForObject<DeleteExchangeRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("purge", codecOptional(codecForBoolean())) .build("DeleteExchangeRequest"); @@ -1824,7 +1788,7 @@ export interface ForceExchangeUpdateRequest { export const codecForForceExchangeUpdateRequest = (): Codec<AddExchangeRequest> => buildCodecForObject<AddExchangeRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .build("AddExchangeRequest"); export interface GetExchangeTosRequest { @@ -1835,7 +1799,7 @@ export interface GetExchangeTosRequest { export const codecForGetExchangeTosRequest = (): Codec<GetExchangeTosRequest> => buildCodecForObject<GetExchangeTosRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("acceptedFormat", codecOptional(codecForList(codecForString()))) .property("acceptLanguage", codecOptional(codecForString())) .build("GetExchangeTosRequest"); @@ -1858,7 +1822,7 @@ export interface AcceptManualWithdrawalRequest { export const codecForAcceptManualWithdrawalRequest = (): Codec<AcceptManualWithdrawalRequest> => buildCodecForObject<AcceptManualWithdrawalRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("amount", codecForAmountString()) .property("restrictAge", codecOptional(codecForNumber())) .property("forceReservePriv", codecOptional(codecForString())) @@ -1883,26 +1847,69 @@ export interface GetWithdrawalDetailsForAmountRequest { clientCancellationId?: string; } +export interface PrepareBankIntegratedWithdrawalRequest { + talerWithdrawUri: string; + selectedExchange?: string; +} + +export const codecForPrepareBankIntegratedWithdrawalRequest = + (): Codec<PrepareBankIntegratedWithdrawalRequest> => + buildCodecForObject<PrepareBankIntegratedWithdrawalRequest>() + .property("talerWithdrawUri", codecForString()) + .property("selectedExchange", codecOptional(codecForString())) + .build("PrepareBankIntegratedWithdrawalRequest"); + +export interface PrepareBankIntegratedWithdrawalResponse { + transactionId?: string; + info: WithdrawUriInfoResponse; +} + +export interface ConfirmWithdrawalRequest { + transactionId: string; + exchangeBaseUrl: string; + amount: AmountString; + forcedDenomSel?: ForcedDenomSel; + restrictAge?: number; +} + +export const codecForConfirmWithdrawalRequestRequest = + (): Codec<ConfirmWithdrawalRequest> => + buildCodecForObject<ConfirmWithdrawalRequest>() + .property("transactionId", codecForString()) + .property("amount", codecForAmountString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) + .property("forcedDenomSel", codecForAny()) + .property("restrictAge", codecOptional(codecForNumber())) + .build("ConfirmWithdrawalRequest"); + export interface AcceptBankIntegratedWithdrawalRequest { talerWithdrawUri: string; exchangeBaseUrl: string; forcedDenomSel?: ForcedDenomSel; + /** + * Amount to withdraw. + * If the bank's withdrawal operation uses a fixed amount, + * this field must either be left undefined or its value must match + * the amount from the withdrawal operation. + */ + amount?: AmountString; restrictAge?: number; } export const codecForAcceptBankIntegratedWithdrawalRequest = (): Codec<AcceptBankIntegratedWithdrawalRequest> => buildCodecForObject<AcceptBankIntegratedWithdrawalRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("talerWithdrawUri", codecForString()) .property("forcedDenomSel", codecForAny()) + .property("amount", codecOptional(codecForAmountString())) .property("restrictAge", codecOptional(codecForNumber())) .build("AcceptBankIntegratedWithdrawalRequest"); export const codecForGetWithdrawalDetailsForAmountRequest = (): Codec<GetWithdrawalDetailsForAmountRequest> => buildCodecForObject<GetWithdrawalDetailsForAmountRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("amount", codecForAmountString()) .property("restrictAge", codecOptional(codecForNumber())) .property("clientCancellationId", codecOptional(codecForString())) @@ -1915,7 +1922,7 @@ export interface AcceptExchangeTosRequest { export const codecForAcceptExchangeTosRequest = (): Codec<AcceptExchangeTosRequest> => buildCodecForObject<AcceptExchangeTosRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .build("AcceptExchangeTosRequest"); export interface ForgetExchangeTosRequest { @@ -1925,7 +1932,7 @@ export interface ForgetExchangeTosRequest { export const codecForForgetExchangeTosRequest = (): Codec<ForgetExchangeTosRequest> => buildCodecForObject<ForgetExchangeTosRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .build("ForgetExchangeTosRequest"); export interface AcceptRefundRequest { @@ -1949,8 +1956,10 @@ export const codecForApplyRefundFromPurchaseIdRequest = export interface GetWithdrawalDetailsForUriRequest { talerWithdrawUri: string; + /** + * @deprecated not used + */ restrictAge?: number; - notifyChangeFromPendingTimeoutMs?: number; } export const codecForGetWithdrawalDetailsForUri = @@ -1958,10 +1967,6 @@ export const codecForGetWithdrawalDetailsForUri = buildCodecForObject<GetWithdrawalDetailsForUriRequest>() .property("talerWithdrawUri", codecForString()) .property("restrictAge", codecOptional(codecForNumber())) - .property( - "notifyChangeFromPendingTimeoutMs", - codecOptional(codecForNumber()), - ) .build("GetWithdrawalDetailsForUriRequest"); export interface ListKnownBankAccountsRequest { @@ -2034,7 +2039,7 @@ export interface SharePaymentRequest { } export const codecForSharePaymentRequest = (): Codec<SharePaymentRequest> => buildCodecForObject<SharePaymentRequest>() - .property("merchantBaseUrl", codecForString()) + .property("merchantBaseUrl", codecForCanonBaseUrl()) .property("orderId", codecForString()) .build("SharePaymentRequest"); @@ -2046,6 +2051,21 @@ export const codecForSharePaymentResult = (): Codec<SharePaymentResult> => .property("privatePayUri", codecForString()) .build("SharePaymentResult"); +export interface CheckPayTemplateRequest { + talerPayTemplateUri: string; +} + +export type CheckPayTemplateReponse = { + templateDetails: TalerMerchantApi.WalletTemplateDetails; + supportedCurrencies: string[]; +}; + +export const codecForCheckPayTemplateRequest = + (): Codec<CheckPayTemplateRequest> => + buildCodecForObject<CheckPayTemplateRequest>() + .property("talerPayTemplateUri", codecForString()) + .build("CheckPayTemplateRequest"); + export interface PreparePayTemplateRequest { talerPayTemplateUri: string; templateParams?: TemplateParams; @@ -2183,9 +2203,9 @@ export const codecForWithdrawTestBalance = (): Codec<WithdrawTestBalanceRequest> => buildCodecForObject<WithdrawTestBalanceRequest>() .property("amount", codecForAmountString()) - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("forcedDenomSel", codecForAny()) - .property("corebankApiBaseUrl", codecForString()) + .property("corebankApiBaseUrl", codecForCanonBaseUrl()) .build("WithdrawTestBalanceRequest"); export interface SetCoinSuspendedRequest { @@ -2246,32 +2266,6 @@ export const codecForStartRefundQueryRequest = .property("transactionId", codecForTransactionIdStr()) .build("StartRefundQueryRequest"); -export interface PrepareRewardRequest { - talerRewardUri: string; -} - -export const codecForPrepareRewardRequest = (): Codec<PrepareRewardRequest> => - buildCodecForObject<PrepareRewardRequest>() - .property("talerRewardUri", codecForString()) - .build("PrepareRewardRequest"); - -export interface AcceptRewardRequest { - /** - * @deprecated use transactionId - */ - walletRewardId?: string; - /** - * it will be required when "walletRewardId" is removed - */ - transactionId?: TransactionIdStr; -} - -export const codecForAcceptTipRequest = (): Codec<AcceptRewardRequest> => - buildCodecForObject<AcceptRewardRequest>() - .property("walletRewardId", codecOptional(codecForString())) - .property("transactionId", codecOptional(codecForTransactionIdStr())) - .build("AcceptRewardRequest"); - export interface FailTransactionRequest { transactionId: TransactionIdStr; } @@ -2369,7 +2363,8 @@ export interface WithdrawUriInfoResponse { operationId: string; status: WithdrawalOperationStatus; confirmTransferUrl?: string; - amount: AmountString; + currency: string; + amount: AmountString | undefined; defaultExchangeBaseUrl?: string; possibleExchanges: ExchangeListItem[]; } @@ -2388,8 +2383,9 @@ export const codecForWithdrawUriInfoResponse = codecForConstString("confirmed"), ), ) - .property("amount", codecForAmountString()) - .property("defaultExchangeBaseUrl", codecOptional(codecForString())) + .property("amount", codecOptional(codecForAmountString())) + .property("currency", codecForString()) + .property("defaultExchangeBaseUrl", codecOptional(codecForCanonBaseUrl())) .property("possibleExchanges", codecForList(codecForExchangeListItem())) .build("WithdrawUriInfoResponse"); @@ -2754,7 +2750,7 @@ export interface CheckPeerPushDebitRequest { export const codecForCheckPeerPushDebitRequest = (): Codec<CheckPeerPushDebitRequest> => buildCodecForObject<CheckPeerPushDebitRequest>() - .property("exchangeBaseUrl", codecOptional(codecForString())) + .property("exchangeBaseUrl", codecOptional(codecForCanonBaseUrl())) .property("amount", codecForAmountString()) .build("CheckPeerPushDebitRequest"); @@ -2893,7 +2889,7 @@ export const codecForPreparePeerPullPaymentRequest = (): Codec<CheckPeerPullCreditRequest> => buildCodecForObject<CheckPeerPullCreditRequest>() .property("amount", codecForAmountString()) - .property("exchangeBaseUrl", codecOptional(codecForString())) + .property("exchangeBaseUrl", codecOptional(codecForCanonBaseUrl())) .build("CheckPeerPullCreditRequest"); export interface CheckPeerPullCreditResponse { @@ -2916,7 +2912,7 @@ export const codecForInitiatePeerPullPaymentRequest = (): Codec<InitiatePeerPullCreditRequest> => buildCodecForObject<InitiatePeerPullCreditRequest>() .property("partialContractTerms", codecForPeerContractTerms()) - .property("exchangeBaseUrl", codecOptional(codecForString())) + .property("exchangeBaseUrl", codecOptional(codecForCanonBaseUrl())) .build("InitiatePeerPullCreditRequest"); export interface InitiatePeerPullCreditResponse { @@ -2931,6 +2927,20 @@ export interface InitiatePeerPullCreditResponse { transactionId: TransactionIdStr; } +export interface CanonicalizeBaseUrlRequest { + url: string; +} + +export const codecForCanonicalizeBaseUrlRequest = + (): Codec<CanonicalizeBaseUrlRequest> => + buildCodecForObject<CanonicalizeBaseUrlRequest>() + .property("url", codecForString()) + .build("CanonicalizeBaseUrlRequest"); + +export interface CanonicalizeBaseUrlResponse { + url: string; +} + export interface ValidateIbanRequest { iban: string; } @@ -3045,6 +3055,18 @@ export interface TestingWaitTransactionRequest { txState: TransactionState; } +export interface TestingGetReserveHistoryRequest { + reservePub: string; + exchangeBaseUrl: string; +} + +export const codecForTestingGetReserveHistoryRequest = + (): Codec<TestingGetReserveHistoryRequest> => + buildCodecForObject<TestingGetReserveHistoryRequest>() + .property("reservePub", codecForString()) + .property("exchangeBaseUrl", codecForString()) + .build("TestingGetReserveHistoryRequest"); + export interface TestingGetDenomStatsRequest { exchangeBaseUrl: string; } @@ -3058,7 +3080,7 @@ export interface TestingGetDenomStatsResponse { export const codecForTestingGetDenomStatsRequest = (): Codec<TestingGetDenomStatsRequest> => buildCodecForObject<TestingGetDenomStatsRequest>() - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .build("TestingGetDenomStatsRequest"); export interface WithdrawalExchangeAccountDetails { @@ -3178,7 +3200,7 @@ export const codecForAddGlobalCurrencyExchangeRequest = (): Codec<AddGlobalCurrencyExchangeRequest> => buildCodecForObject<AddGlobalCurrencyExchangeRequest>() .property("currency", codecForString()) - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("exchangeMasterPub", codecForString()) .build("AddGlobalCurrencyExchangeRequest"); @@ -3192,7 +3214,7 @@ export const codecForRemoveGlobalCurrencyExchangeRequest = (): Codec<RemoveGlobalCurrencyExchangeRequest> => buildCodecForObject<RemoveGlobalCurrencyExchangeRequest>() .property("currency", codecForString()) - .property("exchangeBaseUrl", codecForString()) + .property("exchangeBaseUrl", codecForCanonBaseUrl()) .property("exchangeMasterPub", codecForString()) .build("RemoveGlobalCurrencyExchangeRequest"); @@ -3206,7 +3228,7 @@ export const codecForAddGlobalCurrencyAuditorRequest = (): Codec<AddGlobalCurrencyAuditorRequest> => buildCodecForObject<AddGlobalCurrencyAuditorRequest>() .property("currency", codecForString()) - .property("auditorBaseUrl", codecForString()) + .property("auditorBaseUrl", codecForCanonBaseUrl()) .property("auditorPub", codecForString()) .build("AddGlobalCurrencyAuditorRequest"); @@ -3220,7 +3242,7 @@ export const codecForRemoveGlobalCurrencyAuditorRequest = (): Codec<RemoveGlobalCurrencyAuditorRequest> => buildCodecForObject<RemoveGlobalCurrencyAuditorRequest>() .property("currency", codecForString()) - .property("auditorBaseUrl", codecForString()) + .property("auditorBaseUrl", codecForCanonBaseUrl()) .property("auditorPub", codecForString()) .build("RemoveGlobalCurrencyAuditorRequest"); @@ -3329,3 +3351,13 @@ export const codecForSyncTermsOfServiceResponse = .property("annual_fee", codecForAmountString()) .property("version", codecForString()) .build("SyncTermsOfServiceResponse"); + +export interface HintNetworkAvailabilityRequest { + isNetworkAvailable: boolean; +} + +export const codecForHintNetworkAvailabilityRequest = + (): Codec<HintNetworkAvailabilityRequest> => + buildCodecForObject<HintNetworkAvailabilityRequest>() + .property("isNetworkAvailable", codecForBoolean()) + .build("HintNetworkAvailabilityRequest"); |