import * as __typia_transform__assertGuard from "typia/lib/internal/_assertGuard.js";
import { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';
import { createAssert, createIs } from 'typia';
import { KeetaAnchorUserError } from '../../lib/error.js';
/**
 * Parses a cost token from its serialized public key string form,
 * reconstituting a KeetaNetToken instance.
 */
export function parseFXCostToken(input) {
    if (KeetaNetLib.Account.isInstance(input)) {
        return (input);
    }
    return (KeetaNetLib.Account.fromPublicKeyString(input).assertKeyType(KeetaNetLib.Account.AccountKeyAlgorithm.TOKEN));
}
export const isKeetaFXAnchorEstimateResponse = (() => { const _io0 = input => true === input.ok && ("object" === typeof input.estimate && null !== input.estimate && _iu0(input.estimate)); const _io1 = input => "object" === typeof input.request && null !== input.request && _io2(input.request) && "string" === typeof input.convertedAmount && ("object" === typeof input.expectedCost && null !== input.expectedCost && _io3(input.expectedCost)) && false === input.canPerformExchange && (undefined === input.convertedAmountBound || "string" === typeof input.convertedAmountBound); const _io2 = input => "string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from)) && ("string" === typeof input.to && (RegExp(/^keeta_am(.*)/).test(input.to) || RegExp(/^keeta_an(.*)/).test(input.to) || RegExp(/^keeta_ao(.*)/).test(input.to) || RegExp(/^keeta_ap(.*)/).test(input.to) || RegExp(/^tyblocks_am(.*)/).test(input.to) || RegExp(/^tyblocks_an(.*)/).test(input.to) || RegExp(/^tyblocks_ao(.*)/).test(input.to) || RegExp(/^tyblocks_ap(.*)/).test(input.to))) && "string" === typeof input.amount && ("from" === input.affinity || "to" === input.affinity) && (undefined === input.preferredCostAsset || "string" === typeof input.preferredCostAsset && (RegExp(/^keeta_am(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_an(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ap(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_am(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_an(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ap(.*)/).test(input.preferredCostAsset))); const _io3 = input => "string" === typeof input.min && "string" === typeof input.max && ("string" === typeof input.token && (RegExp(/^keeta_am(.*)/).test(input.token) || RegExp(/^keeta_an(.*)/).test(input.token) || RegExp(/^keeta_ao(.*)/).test(input.token) || RegExp(/^keeta_ap(.*)/).test(input.token) || RegExp(/^tyblocks_am(.*)/).test(input.token) || RegExp(/^tyblocks_an(.*)/).test(input.token) || RegExp(/^tyblocks_ao(.*)/).test(input.token) || RegExp(/^tyblocks_ap(.*)/).test(input.token))); const _io4 = input => "object" === typeof input.request && null !== input.request && _io2(input.request) && "string" === typeof input.convertedAmount && ("object" === typeof input.expectedCost && null !== input.expectedCost && _io3(input.expectedCost)) && false === input.requiresQuote && ("string" === typeof input.account && (RegExp(/^keeta_am(.*)/).test(input.account) || RegExp(/^keeta_an(.*)/).test(input.account) || RegExp(/^keeta_ao(.*)/).test(input.account) || RegExp(/^keeta_ap(.*)/).test(input.account) || RegExp(/^tyblocks_am(.*)/).test(input.account) || RegExp(/^tyblocks_an(.*)/).test(input.account) || RegExp(/^tyblocks_ao(.*)/).test(input.account) || RegExp(/^tyblocks_ap(.*)/).test(input.account) || RegExp(/^keeta_aa(.*)/).test(input.account) || RegExp(/^keeta_ab(.*)/).test(input.account) || RegExp(/^keeta_ac(.*)/).test(input.account) || RegExp(/^keeta_ad(.*)/).test(input.account) || RegExp(/^tyblocks_aa(.*)/).test(input.account) || RegExp(/^tyblocks_ab(.*)/).test(input.account) || RegExp(/^tyblocks_ac(.*)/).test(input.account) || RegExp(/^tyblocks_ad(.*)/).test(input.account) || RegExp(/^keeta_ae(.*)/).test(input.account) || RegExp(/^keeta_af(.*)/).test(input.account) || RegExp(/^keeta_ag(.*)/).test(input.account) || RegExp(/^keeta_ah(.*)/).test(input.account) || RegExp(/^tyblocks_ae(.*)/).test(input.account) || RegExp(/^tyblocks_af(.*)/).test(input.account) || RegExp(/^tyblocks_ag(.*)/).test(input.account) || RegExp(/^tyblocks_ah(.*)/).test(input.account) || RegExp(/^keeta_ai(.*)/).test(input.account) || RegExp(/^keeta_aj(.*)/).test(input.account) || RegExp(/^keeta_ak(.*)/).test(input.account) || RegExp(/^keeta_al(.*)/).test(input.account) || RegExp(/^tyblocks_ai(.*)/).test(input.account) || RegExp(/^tyblocks_aj(.*)/).test(input.account) || RegExp(/^tyblocks_ak(.*)/).test(input.account) || RegExp(/^tyblocks_al(.*)/).test(input.account) || RegExp(/^keeta_at(.*)/).test(input.account) || RegExp(/^keeta_ar(.*)/).test(input.account) || RegExp(/^keeta_aq(.*)/).test(input.account) || RegExp(/^keeta_as(.*)/).test(input.account) || RegExp(/^tyblocks_at(.*)/).test(input.account) || RegExp(/^tyblocks_ar(.*)/).test(input.account) || RegExp(/^tyblocks_aq(.*)/).test(input.account) || RegExp(/^tyblocks_as(.*)/).test(input.account) || RegExp(/^keeta_ay(.*)/).test(input.account) || RegExp(/^keeta_az(.*)/).test(input.account) || RegExp(/^keeta_a2(.*)/).test(input.account) || RegExp(/^keeta_a3(.*)/).test(input.account) || RegExp(/^tyblocks_ay(.*)/).test(input.account) || RegExp(/^tyblocks_az(.*)/).test(input.account) || RegExp(/^tyblocks_a2(.*)/).test(input.account) || RegExp(/^tyblocks_a3(.*)/).test(input.account) || RegExp(/^keeta_a4(.*)/).test(input.account) || RegExp(/^keeta_a5(.*)/).test(input.account) || RegExp(/^keeta_a6(.*)/).test(input.account) || RegExp(/^keeta_a7(.*)/).test(input.account) || RegExp(/^tyblocks_a4(.*)/).test(input.account) || RegExp(/^tyblocks_a5(.*)/).test(input.account) || RegExp(/^tyblocks_a6(.*)/).test(input.account) || RegExp(/^tyblocks_a7(.*)/).test(input.account))) && (undefined === input.convertedAmountBound || "string" === typeof input.convertedAmountBound) && (undefined === input.canPerformExchange || true === input.canPerformExchange); const _io5 = input => "object" === typeof input.request && null !== input.request && _io2(input.request) && "string" === typeof input.convertedAmount && ("object" === typeof input.expectedCost && null !== input.expectedCost && _io3(input.expectedCost)) && (undefined === input.convertedAmountBound || "string" === typeof input.convertedAmountBound) && (undefined === input.canPerformExchange || true === input.canPerformExchange) && (undefined === input.requiresQuote || true === input.requiresQuote); const _io6 = input => false === input.ok && "string" === typeof input.error; const _iu0 = input => (() => {
    if (false === input.canPerformExchange)
        return _io1(input);
    else if (false === input.requiresQuote)
        return _io4(input);
    else
        return _io5(input);
})(); const _iu1 = input => (() => {
    if (true === input.ok)
        return _io0(input);
    else if (false === input.ok)
        return _io6(input);
    else
        return false;
})(); return input => "object" === typeof input && null !== input && _iu1(input); })();
export const isKeetaFXAnchorQuoteResponse = (() => { const _io0 = input => true === input.ok && ("object" === typeof input.quote && null !== input.quote && _io1(input.quote)); const _io1 = input => "object" === typeof input.request && null !== input.request && _io2(input.request) && ("string" === typeof input.account && (RegExp(/^keeta_am(.*)/).test(input.account) || RegExp(/^keeta_an(.*)/).test(input.account) || RegExp(/^keeta_ao(.*)/).test(input.account) || RegExp(/^keeta_ap(.*)/).test(input.account) || RegExp(/^tyblocks_am(.*)/).test(input.account) || RegExp(/^tyblocks_an(.*)/).test(input.account) || RegExp(/^tyblocks_ao(.*)/).test(input.account) || RegExp(/^tyblocks_ap(.*)/).test(input.account) || RegExp(/^keeta_aa(.*)/).test(input.account) || RegExp(/^keeta_ab(.*)/).test(input.account) || RegExp(/^keeta_ac(.*)/).test(input.account) || RegExp(/^keeta_ad(.*)/).test(input.account) || RegExp(/^tyblocks_aa(.*)/).test(input.account) || RegExp(/^tyblocks_ab(.*)/).test(input.account) || RegExp(/^tyblocks_ac(.*)/).test(input.account) || RegExp(/^tyblocks_ad(.*)/).test(input.account) || RegExp(/^keeta_ae(.*)/).test(input.account) || RegExp(/^keeta_af(.*)/).test(input.account) || RegExp(/^keeta_ag(.*)/).test(input.account) || RegExp(/^keeta_ah(.*)/).test(input.account) || RegExp(/^tyblocks_ae(.*)/).test(input.account) || RegExp(/^tyblocks_af(.*)/).test(input.account) || RegExp(/^tyblocks_ag(.*)/).test(input.account) || RegExp(/^tyblocks_ah(.*)/).test(input.account) || RegExp(/^keeta_ai(.*)/).test(input.account) || RegExp(/^keeta_aj(.*)/).test(input.account) || RegExp(/^keeta_ak(.*)/).test(input.account) || RegExp(/^keeta_al(.*)/).test(input.account) || RegExp(/^tyblocks_ai(.*)/).test(input.account) || RegExp(/^tyblocks_aj(.*)/).test(input.account) || RegExp(/^tyblocks_ak(.*)/).test(input.account) || RegExp(/^tyblocks_al(.*)/).test(input.account) || RegExp(/^keeta_at(.*)/).test(input.account) || RegExp(/^keeta_ar(.*)/).test(input.account) || RegExp(/^keeta_aq(.*)/).test(input.account) || RegExp(/^keeta_as(.*)/).test(input.account) || RegExp(/^tyblocks_at(.*)/).test(input.account) || RegExp(/^tyblocks_ar(.*)/).test(input.account) || RegExp(/^tyblocks_aq(.*)/).test(input.account) || RegExp(/^tyblocks_as(.*)/).test(input.account) || RegExp(/^keeta_ay(.*)/).test(input.account) || RegExp(/^keeta_az(.*)/).test(input.account) || RegExp(/^keeta_a2(.*)/).test(input.account) || RegExp(/^keeta_a3(.*)/).test(input.account) || RegExp(/^tyblocks_ay(.*)/).test(input.account) || RegExp(/^tyblocks_az(.*)/).test(input.account) || RegExp(/^tyblocks_a2(.*)/).test(input.account) || RegExp(/^tyblocks_a3(.*)/).test(input.account) || RegExp(/^keeta_a4(.*)/).test(input.account) || RegExp(/^keeta_a5(.*)/).test(input.account) || RegExp(/^keeta_a6(.*)/).test(input.account) || RegExp(/^keeta_a7(.*)/).test(input.account) || RegExp(/^tyblocks_a4(.*)/).test(input.account) || RegExp(/^tyblocks_a5(.*)/).test(input.account) || RegExp(/^tyblocks_a6(.*)/).test(input.account) || RegExp(/^tyblocks_a7(.*)/).test(input.account))) && "string" === typeof input.convertedAmount && ("object" === typeof input.cost && null !== input.cost && _io3(input.cost)) && ("object" === typeof input.signed && null !== input.signed && _io4(input.signed)); const _io2 = input => "string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from)) && ("string" === typeof input.to && (RegExp(/^keeta_am(.*)/).test(input.to) || RegExp(/^keeta_an(.*)/).test(input.to) || RegExp(/^keeta_ao(.*)/).test(input.to) || RegExp(/^keeta_ap(.*)/).test(input.to) || RegExp(/^tyblocks_am(.*)/).test(input.to) || RegExp(/^tyblocks_an(.*)/).test(input.to) || RegExp(/^tyblocks_ao(.*)/).test(input.to) || RegExp(/^tyblocks_ap(.*)/).test(input.to))) && "string" === typeof input.amount && ("from" === input.affinity || "to" === input.affinity) && (undefined === input.preferredCostAsset || "string" === typeof input.preferredCostAsset && (RegExp(/^keeta_am(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_an(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ap(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_am(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_an(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ap(.*)/).test(input.preferredCostAsset))); const _io3 = input => "string" === typeof input.amount && ("string" === typeof input.token && (RegExp(/^keeta_am(.*)/).test(input.token) || RegExp(/^keeta_an(.*)/).test(input.token) || RegExp(/^keeta_ao(.*)/).test(input.token) || RegExp(/^keeta_ap(.*)/).test(input.token) || RegExp(/^tyblocks_am(.*)/).test(input.token) || RegExp(/^tyblocks_an(.*)/).test(input.token) || RegExp(/^tyblocks_ao(.*)/).test(input.token) || RegExp(/^tyblocks_ap(.*)/).test(input.token))); const _io4 = input => "string" === typeof input.nonce && "string" === typeof input.timestamp && "string" === typeof input.signature; const _io5 = input => false === input.ok && "string" === typeof input.error; const _iu0 = input => (() => {
    if (true === input.ok)
        return _io0(input);
    else if (false === input.ok)
        return _io5(input);
    else
        return false;
})(); return input => "object" === typeof input && null !== input && _iu0(input); })();
export const isKeetaFXAnchorExchangeResponse = (() => { const _io0 = input => "string" === typeof input.exchangeID && ("failed" === input.status || "pending" === input.status) && true === input.ok; const _io1 = input => "string" === typeof input.exchangeID && "completed" === input.status && "string" === typeof input.blockhash && true === input.ok; const _io2 = input => (undefined === input.exchangeID || "string" === typeof input.exchangeID) && (undefined === input.status || "failed" === input.status || "pending" === input.status) && false === input.ok && "string" === typeof input.error; const _io3 = input => (undefined === input.exchangeID || "string" === typeof input.exchangeID) && (undefined === input.status || "completed" === input.status) && (undefined === input.blockhash || "string" === typeof input.blockhash) && false === input.ok && "string" === typeof input.error; const _iu0 = input => (() => {
    if (_io0(input))
        return _io0(input);
    if (_io1(input))
        return _io1(input);
    if (_io2(input))
        return _io2(input);
    if (_io3(input))
        return _io3(input);
    return false;
})(); return input => "object" === typeof input && null !== input && _iu0(input); })();
export const assertKeetaNetTokenPublicKeyString = (() => { const __is = input => "string" === typeof input && (RegExp(/^keeta_am(.*)/).test(input) || RegExp(/^keeta_an(.*)/).test(input) || RegExp(/^keeta_ao(.*)/).test(input) || RegExp(/^keeta_ap(.*)/).test(input) || RegExp(/^tyblocks_am(.*)/).test(input) || RegExp(/^tyblocks_an(.*)/).test(input) || RegExp(/^tyblocks_ao(.*)/).test(input) || RegExp(/^tyblocks_ap(.*)/).test(input)); let _errorFactory; return (input, errorFactory) => {
    if (false === __is(input)) {
        _errorFactory = errorFactory;
        ((input, _path, _exceptionable = true) => "string" === typeof input && (RegExp(/^keeta_am(.*)/).test(input) || RegExp(/^keeta_an(.*)/).test(input) || RegExp(/^keeta_ao(.*)/).test(input) || RegExp(/^keeta_ap(.*)/).test(input) || RegExp(/^tyblocks_am(.*)/).test(input) || RegExp(/^tyblocks_an(.*)/).test(input) || RegExp(/^tyblocks_ao(.*)/).test(input) || RegExp(/^tyblocks_ap(.*)/).test(input)) || __typia_transform__assertGuard._assertGuard(true, {
            method: "createAssert",
            path: _path + "",
            expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}`)",
            value: input
        }, _errorFactory))(input, "$input", true);
    }
    return input;
}; })();
export const assertConversionInputCanonicalJSON = (() => { const _io0 = input => "string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from)) && ("string" === typeof input.to && (RegExp(/^keeta_am(.*)/).test(input.to) || RegExp(/^keeta_an(.*)/).test(input.to) || RegExp(/^keeta_ao(.*)/).test(input.to) || RegExp(/^keeta_ap(.*)/).test(input.to) || RegExp(/^tyblocks_am(.*)/).test(input.to) || RegExp(/^tyblocks_an(.*)/).test(input.to) || RegExp(/^tyblocks_ao(.*)/).test(input.to) || RegExp(/^tyblocks_ap(.*)/).test(input.to))) && "string" === typeof input.amount && ("from" === input.affinity || "to" === input.affinity) && (undefined === input.preferredCostAsset || "string" === typeof input.preferredCostAsset && (RegExp(/^keeta_am(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_an(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ap(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_am(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_an(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ap(.*)/).test(input.preferredCostAsset))); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".from",
    expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}`)",
    value: input.from
}, _errorFactory)) && ("string" === typeof input.to && (RegExp(/^keeta_am(.*)/).test(input.to) || RegExp(/^keeta_an(.*)/).test(input.to) || RegExp(/^keeta_ao(.*)/).test(input.to) || RegExp(/^keeta_ap(.*)/).test(input.to) || RegExp(/^tyblocks_am(.*)/).test(input.to) || RegExp(/^tyblocks_an(.*)/).test(input.to) || RegExp(/^tyblocks_ao(.*)/).test(input.to) || RegExp(/^tyblocks_ap(.*)/).test(input.to)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".to",
    expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}`)",
    value: input.to
}, _errorFactory)) && ("string" === typeof input.amount || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".amount",
    expected: "string",
    value: input.amount
}, _errorFactory)) && ("from" === input.affinity || "to" === input.affinity || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".affinity",
    expected: "(\"from\" | \"to\")",
    value: input.affinity
}, _errorFactory)) && (undefined === input.preferredCostAsset || "string" === typeof input.preferredCostAsset && (RegExp(/^keeta_am(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_an(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ap(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_am(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_an(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ap(.*)/).test(input.preferredCostAsset)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".preferredCostAsset",
    expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}` | undefined)",
    value: input.preferredCostAsset
}, _errorFactory)); const __is = input => "object" === typeof input && null !== input && _io0(input); let _errorFactory; return (input, errorFactory) => {
    if (false === __is(input)) {
        _errorFactory = errorFactory;
        ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || __typia_transform__assertGuard._assertGuard(true, {
            method: "createAssert",
            path: _path + "",
            expected: "{ from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { preferredCostAsset?: TokenPublicKeyString; }",
            value: input
        }, _errorFactory)) && _ao0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
            method: "createAssert",
            path: _path + "",
            expected: "{ from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { preferredCostAsset?: TokenPublicKeyString; }",
            value: input
        }, _errorFactory))(input, "$input", true);
    }
    return input;
}; })();
export const assertKeetaFXAnchorClientCreateExchangeRequestJSON = (() => { const _io0 = input => "string" === typeof input.block && ("object" === typeof input.quote && null !== input.quote && _io1(input.quote)) && (null !== input.request && undefined === input.request); const _io1 = input => "object" === typeof input.request && null !== input.request && _io2(input.request) && ("string" === typeof input.account && (RegExp(/^keeta_am(.*)/).test(input.account) || RegExp(/^keeta_an(.*)/).test(input.account) || RegExp(/^keeta_ao(.*)/).test(input.account) || RegExp(/^keeta_ap(.*)/).test(input.account) || RegExp(/^tyblocks_am(.*)/).test(input.account) || RegExp(/^tyblocks_an(.*)/).test(input.account) || RegExp(/^tyblocks_ao(.*)/).test(input.account) || RegExp(/^tyblocks_ap(.*)/).test(input.account) || RegExp(/^keeta_aa(.*)/).test(input.account) || RegExp(/^keeta_ab(.*)/).test(input.account) || RegExp(/^keeta_ac(.*)/).test(input.account) || RegExp(/^keeta_ad(.*)/).test(input.account) || RegExp(/^tyblocks_aa(.*)/).test(input.account) || RegExp(/^tyblocks_ab(.*)/).test(input.account) || RegExp(/^tyblocks_ac(.*)/).test(input.account) || RegExp(/^tyblocks_ad(.*)/).test(input.account) || RegExp(/^keeta_ae(.*)/).test(input.account) || RegExp(/^keeta_af(.*)/).test(input.account) || RegExp(/^keeta_ag(.*)/).test(input.account) || RegExp(/^keeta_ah(.*)/).test(input.account) || RegExp(/^tyblocks_ae(.*)/).test(input.account) || RegExp(/^tyblocks_af(.*)/).test(input.account) || RegExp(/^tyblocks_ag(.*)/).test(input.account) || RegExp(/^tyblocks_ah(.*)/).test(input.account) || RegExp(/^keeta_ai(.*)/).test(input.account) || RegExp(/^keeta_aj(.*)/).test(input.account) || RegExp(/^keeta_ak(.*)/).test(input.account) || RegExp(/^keeta_al(.*)/).test(input.account) || RegExp(/^tyblocks_ai(.*)/).test(input.account) || RegExp(/^tyblocks_aj(.*)/).test(input.account) || RegExp(/^tyblocks_ak(.*)/).test(input.account) || RegExp(/^tyblocks_al(.*)/).test(input.account) || RegExp(/^keeta_at(.*)/).test(input.account) || RegExp(/^keeta_ar(.*)/).test(input.account) || RegExp(/^keeta_aq(.*)/).test(input.account) || RegExp(/^keeta_as(.*)/).test(input.account) || RegExp(/^tyblocks_at(.*)/).test(input.account) || RegExp(/^tyblocks_ar(.*)/).test(input.account) || RegExp(/^tyblocks_aq(.*)/).test(input.account) || RegExp(/^tyblocks_as(.*)/).test(input.account) || RegExp(/^keeta_ay(.*)/).test(input.account) || RegExp(/^keeta_az(.*)/).test(input.account) || RegExp(/^keeta_a2(.*)/).test(input.account) || RegExp(/^keeta_a3(.*)/).test(input.account) || RegExp(/^tyblocks_ay(.*)/).test(input.account) || RegExp(/^tyblocks_az(.*)/).test(input.account) || RegExp(/^tyblocks_a2(.*)/).test(input.account) || RegExp(/^tyblocks_a3(.*)/).test(input.account) || RegExp(/^keeta_a4(.*)/).test(input.account) || RegExp(/^keeta_a5(.*)/).test(input.account) || RegExp(/^keeta_a6(.*)/).test(input.account) || RegExp(/^keeta_a7(.*)/).test(input.account) || RegExp(/^tyblocks_a4(.*)/).test(input.account) || RegExp(/^tyblocks_a5(.*)/).test(input.account) || RegExp(/^tyblocks_a6(.*)/).test(input.account) || RegExp(/^tyblocks_a7(.*)/).test(input.account))) && "string" === typeof input.convertedAmount && ("object" === typeof input.cost && null !== input.cost && _io3(input.cost)) && ("object" === typeof input.signed && null !== input.signed && _io4(input.signed)); const _io2 = input => "string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from)) && ("string" === typeof input.to && (RegExp(/^keeta_am(.*)/).test(input.to) || RegExp(/^keeta_an(.*)/).test(input.to) || RegExp(/^keeta_ao(.*)/).test(input.to) || RegExp(/^keeta_ap(.*)/).test(input.to) || RegExp(/^tyblocks_am(.*)/).test(input.to) || RegExp(/^tyblocks_an(.*)/).test(input.to) || RegExp(/^tyblocks_ao(.*)/).test(input.to) || RegExp(/^tyblocks_ap(.*)/).test(input.to))) && "string" === typeof input.amount && ("from" === input.affinity || "to" === input.affinity) && (undefined === input.preferredCostAsset || "string" === typeof input.preferredCostAsset && (RegExp(/^keeta_am(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_an(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ap(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_am(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_an(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ap(.*)/).test(input.preferredCostAsset))); const _io3 = input => "string" === typeof input.amount && ("string" === typeof input.token && (RegExp(/^keeta_am(.*)/).test(input.token) || RegExp(/^keeta_an(.*)/).test(input.token) || RegExp(/^keeta_ao(.*)/).test(input.token) || RegExp(/^keeta_ap(.*)/).test(input.token) || RegExp(/^tyblocks_am(.*)/).test(input.token) || RegExp(/^tyblocks_an(.*)/).test(input.token) || RegExp(/^tyblocks_ao(.*)/).test(input.token) || RegExp(/^tyblocks_ap(.*)/).test(input.token))); const _io4 = input => "string" === typeof input.nonce && "string" === typeof input.timestamp && "string" === typeof input.signature; const _io5 = input => "string" === typeof input.block && (null !== input.quote && undefined === input.quote) && ("object" === typeof input.request && null !== input.request && _io6(input.request)); const _io6 = input => "string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from)) && ("string" === typeof input.to && (RegExp(/^keeta_am(.*)/).test(input.to) || RegExp(/^keeta_an(.*)/).test(input.to) || RegExp(/^keeta_ao(.*)/).test(input.to) || RegExp(/^keeta_ap(.*)/).test(input.to) || RegExp(/^tyblocks_am(.*)/).test(input.to) || RegExp(/^tyblocks_an(.*)/).test(input.to) || RegExp(/^tyblocks_ao(.*)/).test(input.to) || RegExp(/^tyblocks_ap(.*)/).test(input.to))) && "string" === typeof input.amount && ("from" === input.affinity || "to" === input.affinity) && (undefined === input.preferredCostAsset || "string" === typeof input.preferredCostAsset && (RegExp(/^keeta_am(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_an(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ap(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_am(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_an(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ap(.*)/).test(input.preferredCostAsset))); const _iu0 = input => (() => {
    if ("object" === typeof input.request && null !== input.request && _io6(input.request))
        return _io5(input);
    else if ("object" === typeof input.quote && null !== input.quote && _io1(input.quote))
        return _io0(input);
    else
        return false;
})(); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.block || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".block",
    expected: "string",
    value: input.block
}, _errorFactory)) && (("object" === typeof input.quote && null !== input.quote || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".quote",
    expected: "{ request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { preferredCostAsset?: TokenPublicKeyString; }; account: TokenPublicKeyString | ... 5 more ... | MultisigPublicKeyString; convertedAmount: string; cost: { ...; } & {}; signed: HTTPSignedField; } & {}",
    value: input.quote
}, _errorFactory)) && _ao1(input.quote, _path + ".quote", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".quote",
    expected: "{ request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { preferredCostAsset?: TokenPublicKeyString; }; account: TokenPublicKeyString | ... 5 more ... | MultisigPublicKeyString; convertedAmount: string; cost: { ...; } & {}; signed: HTTPSignedField; } & {}",
    value: input.quote
}, _errorFactory)) && ((null !== input.request || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".request",
    expected: "undefined",
    value: input.request
}, _errorFactory)) && (undefined === input.request || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".request",
    expected: "undefined",
    value: input.request
}, _errorFactory))); const _ao1 = (input, _path, _exceptionable = true) => (("object" === typeof input.request && null !== input.request || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".request",
    expected: "{ from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { preferredCostAsset?: TokenPublicKeyString; }",
    value: input.request
}, _errorFactory)) && _ao2(input.request, _path + ".request", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".request",
    expected: "{ from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { preferredCostAsset?: TokenPublicKeyString; }",
    value: input.request
}, _errorFactory)) && ("string" === typeof input.account && (RegExp(/^keeta_am(.*)/).test(input.account) || RegExp(/^keeta_an(.*)/).test(input.account) || RegExp(/^keeta_ao(.*)/).test(input.account) || RegExp(/^keeta_ap(.*)/).test(input.account) || RegExp(/^tyblocks_am(.*)/).test(input.account) || RegExp(/^tyblocks_an(.*)/).test(input.account) || RegExp(/^tyblocks_ao(.*)/).test(input.account) || RegExp(/^tyblocks_ap(.*)/).test(input.account) || RegExp(/^keeta_aa(.*)/).test(input.account) || RegExp(/^keeta_ab(.*)/).test(input.account) || RegExp(/^keeta_ac(.*)/).test(input.account) || RegExp(/^keeta_ad(.*)/).test(input.account) || RegExp(/^tyblocks_aa(.*)/).test(input.account) || RegExp(/^tyblocks_ab(.*)/).test(input.account) || RegExp(/^tyblocks_ac(.*)/).test(input.account) || RegExp(/^tyblocks_ad(.*)/).test(input.account) || RegExp(/^keeta_ae(.*)/).test(input.account) || RegExp(/^keeta_af(.*)/).test(input.account) || RegExp(/^keeta_ag(.*)/).test(input.account) || RegExp(/^keeta_ah(.*)/).test(input.account) || RegExp(/^tyblocks_ae(.*)/).test(input.account) || RegExp(/^tyblocks_af(.*)/).test(input.account) || RegExp(/^tyblocks_ag(.*)/).test(input.account) || RegExp(/^tyblocks_ah(.*)/).test(input.account) || RegExp(/^keeta_ai(.*)/).test(input.account) || RegExp(/^keeta_aj(.*)/).test(input.account) || RegExp(/^keeta_ak(.*)/).test(input.account) || RegExp(/^keeta_al(.*)/).test(input.account) || RegExp(/^tyblocks_ai(.*)/).test(input.account) || RegExp(/^tyblocks_aj(.*)/).test(input.account) || RegExp(/^tyblocks_ak(.*)/).test(input.account) || RegExp(/^tyblocks_al(.*)/).test(input.account) || RegExp(/^keeta_at(.*)/).test(input.account) || RegExp(/^keeta_ar(.*)/).test(input.account) || RegExp(/^keeta_aq(.*)/).test(input.account) || RegExp(/^keeta_as(.*)/).test(input.account) || RegExp(/^tyblocks_at(.*)/).test(input.account) || RegExp(/^tyblocks_ar(.*)/).test(input.account) || RegExp(/^tyblocks_aq(.*)/).test(input.account) || RegExp(/^tyblocks_as(.*)/).test(input.account) || RegExp(/^keeta_ay(.*)/).test(input.account) || RegExp(/^keeta_az(.*)/).test(input.account) || RegExp(/^keeta_a2(.*)/).test(input.account) || RegExp(/^keeta_a3(.*)/).test(input.account) || RegExp(/^tyblocks_ay(.*)/).test(input.account) || RegExp(/^tyblocks_az(.*)/).test(input.account) || RegExp(/^tyblocks_a2(.*)/).test(input.account) || RegExp(/^tyblocks_a3(.*)/).test(input.account) || RegExp(/^keeta_a4(.*)/).test(input.account) || RegExp(/^keeta_a5(.*)/).test(input.account) || RegExp(/^keeta_a6(.*)/).test(input.account) || RegExp(/^keeta_a7(.*)/).test(input.account) || RegExp(/^tyblocks_a4(.*)/).test(input.account) || RegExp(/^tyblocks_a5(.*)/).test(input.account) || RegExp(/^tyblocks_a6(.*)/).test(input.account) || RegExp(/^tyblocks_a7(.*)/).test(input.account)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".account",
    expected: "(`keeta_a2${string}` | `keeta_a3${string}` | `keeta_a4${string}` | `keeta_a5${string}` | `keeta_a6${string}` | `keeta_a7${string}` | `keeta_aa${string}` | `keeta_ab${string}` | `keeta_ac${string}` | `keeta_ad${string}` | `keeta_ae${string}` | `keeta_af${string}` | `keeta_ag${string}` | `keeta_ah${string}` | `keeta_ai${string}` | `keeta_aj${string}` | `keeta_ak${string}` | `keeta_al${string}` | `keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `keeta_aq${string}` | `keeta_ar${string}` | `keeta_as${string}` | `keeta_at${string}` | `keeta_ay${string}` | `keeta_az${string}` | `tyblocks_a2${string}` | `tyblocks_a3${string}` | `tyblocks_a4${string}` | `tyblocks_a5${string}` | `tyblocks_a6${string}` | `tyblocks_a7${string}` | `tyblocks_aa${string}` | `tyblocks_ab${string}` | `tyblocks_ac${string}` | `tyblocks_ad${string}` | `tyblocks_ae${string}` | `tyblocks_af${string}` | `tyblocks_ag${string}` | `tyblocks_ah${string}` | `tyblocks_ai${string}` | `tyblocks_aj${string}` | `tyblocks_ak${string}` | `tyblocks_al${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}` | `tyblocks_aq${string}` | `tyblocks_ar${string}` | `tyblocks_as${string}` | `tyblocks_at${string}` | `tyblocks_ay${string}` | `tyblocks_az${string}`)",
    value: input.account
}, _errorFactory)) && ("string" === typeof input.convertedAmount || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".convertedAmount",
    expected: "string",
    value: input.convertedAmount
}, _errorFactory)) && (("object" === typeof input.cost && null !== input.cost || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".cost",
    expected: "{ amount: string; token: TokenPublicKeyString; } & {}",
    value: input.cost
}, _errorFactory)) && _ao3(input.cost, _path + ".cost", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".cost",
    expected: "{ amount: string; token: TokenPublicKeyString; } & {}",
    value: input.cost
}, _errorFactory)) && (("object" === typeof input.signed && null !== input.signed || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".signed",
    expected: "HTTPSignedField",
    value: input.signed
}, _errorFactory)) && _ao4(input.signed, _path + ".signed", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".signed",
    expected: "HTTPSignedField",
    value: input.signed
}, _errorFactory)); const _ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".from",
    expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}`)",
    value: input.from
}, _errorFactory)) && ("string" === typeof input.to && (RegExp(/^keeta_am(.*)/).test(input.to) || RegExp(/^keeta_an(.*)/).test(input.to) || RegExp(/^keeta_ao(.*)/).test(input.to) || RegExp(/^keeta_ap(.*)/).test(input.to) || RegExp(/^tyblocks_am(.*)/).test(input.to) || RegExp(/^tyblocks_an(.*)/).test(input.to) || RegExp(/^tyblocks_ao(.*)/).test(input.to) || RegExp(/^tyblocks_ap(.*)/).test(input.to)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".to",
    expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}`)",
    value: input.to
}, _errorFactory)) && ("string" === typeof input.amount || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".amount",
    expected: "string",
    value: input.amount
}, _errorFactory)) && ("from" === input.affinity || "to" === input.affinity || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".affinity",
    expected: "(\"from\" | \"to\")",
    value: input.affinity
}, _errorFactory)) && (undefined === input.preferredCostAsset || "string" === typeof input.preferredCostAsset && (RegExp(/^keeta_am(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_an(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ap(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_am(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_an(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ap(.*)/).test(input.preferredCostAsset)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".preferredCostAsset",
    expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}` | undefined)",
    value: input.preferredCostAsset
}, _errorFactory)); const _ao3 = (input, _path, _exceptionable = true) => ("string" === typeof input.amount || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".amount",
    expected: "string",
    value: input.amount
}, _errorFactory)) && ("string" === typeof input.token && (RegExp(/^keeta_am(.*)/).test(input.token) || RegExp(/^keeta_an(.*)/).test(input.token) || RegExp(/^keeta_ao(.*)/).test(input.token) || RegExp(/^keeta_ap(.*)/).test(input.token) || RegExp(/^tyblocks_am(.*)/).test(input.token) || RegExp(/^tyblocks_an(.*)/).test(input.token) || RegExp(/^tyblocks_ao(.*)/).test(input.token) || RegExp(/^tyblocks_ap(.*)/).test(input.token)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".token",
    expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}`)",
    value: input.token
}, _errorFactory)); const _ao4 = (input, _path, _exceptionable = true) => ("string" === typeof input.nonce || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".nonce",
    expected: "string",
    value: input.nonce
}, _errorFactory)) && ("string" === typeof input.timestamp || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".timestamp",
    expected: "string",
    value: input.timestamp
}, _errorFactory)) && ("string" === typeof input.signature || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".signature",
    expected: "string",
    value: input.signature
}, _errorFactory)); const _ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.block || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".block",
    expected: "string",
    value: input.block
}, _errorFactory)) && ((null !== input.quote || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".quote",
    expected: "undefined",
    value: input.quote
}, _errorFactory)) && (undefined === input.quote || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".quote",
    expected: "undefined",
    value: input.quote
}, _errorFactory))) && (("object" === typeof input.request && null !== input.request || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".request",
    expected: "{ from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { preferredCostAsset?: TokenPublicKeyString; }.o1",
    value: input.request
}, _errorFactory)) && _ao6(input.request, _path + ".request", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".request",
    expected: "{ from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { preferredCostAsset?: TokenPublicKeyString; }.o1",
    value: input.request
}, _errorFactory)); const _ao6 = (input, _path, _exceptionable = true) => ("string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".from",
    expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}`)",
    value: input.from
}, _errorFactory)) && ("string" === typeof input.to && (RegExp(/^keeta_am(.*)/).test(input.to) || RegExp(/^keeta_an(.*)/).test(input.to) || RegExp(/^keeta_ao(.*)/).test(input.to) || RegExp(/^keeta_ap(.*)/).test(input.to) || RegExp(/^tyblocks_am(.*)/).test(input.to) || RegExp(/^tyblocks_an(.*)/).test(input.to) || RegExp(/^tyblocks_ao(.*)/).test(input.to) || RegExp(/^tyblocks_ap(.*)/).test(input.to)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".to",
    expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}`)",
    value: input.to
}, _errorFactory)) && ("string" === typeof input.amount || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".amount",
    expected: "string",
    value: input.amount
}, _errorFactory)) && ("from" === input.affinity || "to" === input.affinity || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".affinity",
    expected: "(\"from\" | \"to\")",
    value: input.affinity
}, _errorFactory)) && (undefined === input.preferredCostAsset || "string" === typeof input.preferredCostAsset && (RegExp(/^keeta_am(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_an(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^keeta_ap(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_am(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_an(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ao(.*)/).test(input.preferredCostAsset) || RegExp(/^tyblocks_ap(.*)/).test(input.preferredCostAsset)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
    method: "createAssert",
    path: _path + ".preferredCostAsset",
    expected: "(`keeta_am${string}` | `keeta_an${string}` | `keeta_ao${string}` | `keeta_ap${string}` | `tyblocks_am${string}` | `tyblocks_an${string}` | `tyblocks_ao${string}` | `tyblocks_ap${string}` | undefined)",
    value: input.preferredCostAsset
}, _errorFactory)); const _au0 = (input, _path, _exceptionable = true) => (() => {
    if ("object" === typeof input.request && null !== input.request && _ao6(input.request, _path + ".request", false && _exceptionable))
        return _ao5(input, _path, true && _exceptionable);
    else if ("object" === typeof input.quote && null !== input.quote && _ao1(input.quote, _path + ".quote", false && _exceptionable))
        return _ao0(input, _path, true && _exceptionable);
    else
        return __typia_transform__assertGuard._assertGuard(_exceptionable, {
            method: "createAssert",
            path: _path,
            expected: "({ block: string; } & { quote?: undefined; request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { ...; }; } | { block: string; } & { quote: { request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { ...; }; account: TokenPublicKeyString | ... 5 more ... | MultisigPublicKeyString; convertedAmount: string; cost: { ...; } & {}; signed: HTTPSignedField; } & {}; request?: un...)",
            value: input
        }, _errorFactory);
})(); const __is = input => "object" === typeof input && null !== input && _iu0(input); let _errorFactory; return (input, errorFactory) => {
    if (false === __is(input)) {
        _errorFactory = errorFactory;
        ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || __typia_transform__assertGuard._assertGuard(true, {
            method: "createAssert",
            path: _path + "",
            expected: "({ block: string; } & { quote: { request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { ...; }; account: TokenPublicKeyString | ... 5 more ... | MultisigPublicKeyString; convertedAmount: string; cost: { ...; } & {}; signed: HTTPSignedField; } & {}; request?: un... | { block: string; } & { quote?: undefined; request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { ...; }; })",
            value: input
        }, _errorFactory)) && _au0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
            method: "createAssert",
            path: _path + "",
            expected: "({ block: string; } & { quote: { request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { ...; }; account: TokenPublicKeyString | ... 5 more ... | MultisigPublicKeyString; convertedAmount: string; cost: { ...; } & {}; signed: HTTPSignedField; } & {}; request?: un... | { block: string; } & { quote?: undefined; request: { from: TokenPublicKeyString; to: TokenPublicKeyString; amount: string; affinity: \"from\" | \"to\"; } & { ...; }; })",
            value: input
        }, _errorFactory))(input, "$input", true);
    }
    return input;
}; })();
class KeetaFXAnchorQuoteValidationFailedError extends KeetaAnchorUserError {
    static name = 'KeetaFXAnchorQuoteValidationFailedError';
    KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID;
    static KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID = 'a8f3c2d1-9b4e-4f2a-8c1d-5e6f7a8b9c0d';
    constructor(message) {
        super(message ?? 'Quote validation failed');
        this.statusCode = 400;
        Object.defineProperty(this, 'KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID', {
            value: KeetaFXAnchorQuoteValidationFailedError.KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID,
            enumerable: false
        });
    }
    static isInstance(input) {
        return (this.hasPropWithValue(input, 'KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID', KeetaFXAnchorQuoteValidationFailedError.KeetaFXAnchorQuoteValidationFailedErrorObjectTypeID));
    }
    static async fromJSON(input) {
        const { message, other } = this.extractErrorProperties(input, this);
        const error = new this(message);
        error.restoreFromJSON(other);
        return (error);
    }
}
class KeetaFXAnchorQuoteRequiredError extends KeetaAnchorUserError {
    static name = 'KeetaFXAnchorQuoteRequiredError';
    KeetaFXAnchorQuoteRequiredErrorObjectTypeID;
    static KeetaFXAnchorQuoteRequiredErrorObjectTypeID = '9f22067f-52b3-40f2-84c1-ad9285260980';
    constructor(message) {
        super(message ?? 'Quote required to perform exchange');
        this.statusCode = 400;
        Object.defineProperty(this, 'KeetaFXAnchorQuoteRequiredErrorObjectTypeID', {
            value: KeetaFXAnchorQuoteRequiredError.KeetaFXAnchorQuoteRequiredErrorObjectTypeID,
            enumerable: false
        });
    }
    static isInstance(input) {
        return (this.hasPropWithValue(input, 'KeetaFXAnchorQuoteRequiredErrorObjectTypeID', KeetaFXAnchorQuoteRequiredError.KeetaFXAnchorQuoteRequiredErrorObjectTypeID));
    }
    static async fromJSON(input) {
        const { message, other } = this.extractErrorProperties(input, this);
        const error = new this(message);
        error.restoreFromJSON(other);
        return (error);
    }
}
class KeetaFXAnchorQuoteIssuanceDisabledError extends KeetaAnchorUserError {
    static name = 'KeetaFXAnchorQuoteIssuanceDisabledError';
    KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID;
    static KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID = 'a0f70c0b-6e17-41f0-825a-d086983209e1';
    constructor(message) {
        super(message ?? 'Anchor cannot issue quotes');
        this.statusCode = 501;
        Object.defineProperty(this, 'KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID', {
            value: KeetaFXAnchorQuoteIssuanceDisabledError.KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID,
            enumerable: false
        });
    }
    static isInstance(input) {
        return (this.hasPropWithValue(input, 'KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID', KeetaFXAnchorQuoteIssuanceDisabledError.KeetaFXAnchorQuoteIssuanceDisabledErrorObjectTypeID));
    }
    static async fromJSON(input) {
        const { message, other } = this.extractErrorProperties(input, this);
        const error = new this(message);
        error.restoreFromJSON(other);
        return (error);
    }
}
export const Errors = {
    /**
     * The quote validation failed
     */
    QuoteValidationFailed: KeetaFXAnchorQuoteValidationFailedError,
    /**
     * Quote is required to perform the exchange
     */
    QuoteRequired: KeetaFXAnchorQuoteRequiredError,
    /**
     * The anchor cannot issue quotes
     */
    QuoteIssuanceDisabled: KeetaFXAnchorQuoteIssuanceDisabledError
};
//# sourceMappingURL=common.js.map