@keetanetwork/anchor 0.0.23 → 0.0.25
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/lib/certificates.d.ts +1 -4
- package/lib/certificates.d.ts.map +1 -1
- package/lib/certificates.js +14 -148
- package/lib/certificates.js.map +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +2 -1
- package/lib/error.js.map +1 -1
- package/lib/http-server/common.d.ts +11 -0
- package/lib/http-server/common.d.ts.map +1 -1
- package/lib/http-server/common.js +110 -1
- package/lib/http-server/common.js.map +1 -1
- package/lib/http-server/index.js +2 -2
- package/lib/http-server/index.js.map +1 -1
- package/lib/resolver.d.ts +28 -8
- package/lib/resolver.d.ts.map +1 -1
- package/lib/resolver.js +543 -302
- package/lib/resolver.js.map +1 -1
- package/lib/utils/asn1.d.ts +13 -0
- package/lib/utils/asn1.d.ts.map +1 -1
- package/lib/utils/asn1.js +1973 -0
- package/lib/utils/asn1.js.map +1 -1
- package/lib/utils/external.d.ts.map +1 -1
- package/lib/utils/external.js +2 -9
- package/lib/utils/external.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/services/asset-movement/client.d.ts +21 -11
- package/services/asset-movement/client.d.ts.map +1 -1
- package/services/asset-movement/client.js +396 -89
- package/services/asset-movement/client.js.map +1 -1
- package/services/asset-movement/common.d.ts +410 -35
- package/services/asset-movement/common.d.ts.map +1 -1
- package/services/asset-movement/common.js +10176 -1492
- package/services/asset-movement/common.js.map +1 -1
- package/services/asset-movement/server.d.ts +25 -14
- package/services/asset-movement/server.d.ts.map +1 -1
- package/services/asset-movement/server.js +247 -75
- package/services/asset-movement/server.js.map +1 -1
- package/services/fx/common.js +3 -3
- package/services/fx/server.d.ts +1 -1
- package/services/fx/server.d.ts.map +1 -1
- package/services/fx/server.js +1 -1
- package/services/fx/server.js.map +1 -1
- package/services/kyc/common.generated.js +2 -2
- package/services/kyc/iso20022.generated.js +54 -54
- package/services/kyc/iso20022.generated.js.map +1 -1
- package/services/kyc/server.d.ts +1 -1
- package/services/kyc/server.d.ts.map +1 -1
- package/services/kyc/server.js +1 -1
- package/services/kyc/server.js.map +1 -1
- package/services/kyc/utils/generate-kyc-schema.js +6 -34
- package/services/kyc/utils/generate-kyc-schema.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/services/fx/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,qBAAqB,MAAM,gCAAgC,CAAC;AACxE,OAAO,QAAQ,MAAM,+BAA+B,CAAC;AACrD,OAAO,EACN,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,kCAAkC,EAClC,yBAAyB,EACzB,MAAM,EACN,MAAM,aAAa,CAAC;AAWrB,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AA4DrD,CAAC;AAEF,KAAK,UAAU,mBAAmB,CAAC,aAAqD;IACvF,MAAM,MAAM,GAAqB;QAChC,aAAa,CAAC,OAAO,CAAC,IAAI;QAC1B,aAAa,CAAC,OAAO,CAAC,EAAE;QACxB,aAAa,CAAC,OAAO,CAAC,MAAM;QAC5B,aAAa,CAAC,OAAO,CAAC,QAAQ;QAC9B,aAAa,CAAC,OAAO;QACrB,aAAa,CAAC,eAAe;QAC7B,aAAa,CAAC,IAAI,CAAC,KAAK;QACxB,aAAa,CAAC,IAAI,CAAC,MAAM;KACzB,CAAC;IAEF,OAAM,CAAC,MAAM,CAAC,CAAC;AAgBhB,CAAC;AAED,KAAK,UAAU,mBAAmB,CAAC,MAA+B,EAAE,aAAqD;IACxH,MAAM,aAAa,GAAG,MAAM,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAE7D,OAAM,CAAC;QACN,GAAG,aAAa;QAChB,MAAM,EAAE,MAA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AG,CAAC,eAAe,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE;YACzD,cAAc,EAAE,CAAC,IAAI,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE;YACrE,iBAAiB,EAAE,CAAC,IAAI,GAAG,CAAC,wBAAwB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,OAAO;SACrF,CAAC;QAEF,OAAM,CAAC;YACN,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE;YACxB,UAAU,EAAE,UAAU;SACtB,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import * as KeetaAnchorHTTPServer from '../../lib/http-server/index.js';\nimport KeetaNet from '@keetanetwork/keetanet-client';\nimport {\n\tKeetaAnchorUserError\n} from '../../lib/error.js';\nimport {\n\tassertConversionInputCanonicalJSON,\n\tassertConversionQuoteJSON,\n\tErrors\n} from './common.js';\nimport type {\n\tConversionInputCanonicalJSON,\n\tKeetaFXAnchorEstimateResponse,\n\tKeetaFXAnchorExchangeResponse,\n\tKeetaFXAnchorQuote,\n\tKeetaFXAnchorQuoteJSON,\n\tKeetaFXAnchorQuoteResponse,\n\tKeetaNetAccount,\n\tKeetaNetStorageAccount\n} from './common.ts';\nimport * as Signing from '../../lib/utils/signing.js';\nimport type { AssertNever } from '../../lib/utils/never.ts';\nimport type { ServiceMetadata } from '../../lib/resolver.js';\n\nexport interface KeetaAnchorFXServerConfig extends KeetaAnchorHTTPServer.KeetaAnchorHTTPServerConfig {\n\t/**\n\t * The data to use for the index page (optional)\n\t */\n\thomepage?: string | (() => Promise<string> | string);\n\n\t/**\n\t * The account to use for performing swaps for a given pair\n\t *\n\t * This may be either a function or a KeetaNet Account instance.\n\t */\n\taccount: KeetaNetAccount | KeetaNetStorageAccount | ((request: ConversionInputCanonicalJSON) => Promise<KeetaNetAccount | KeetaNetStorageAccount> | KeetaNetAccount | KeetaNetStorageAccount);\n\t/**\n\t * Account which can be used to sign transactions\n\t * for the account above (if not supplied the\n\t * account will be used).\n\t *\n\t * This may be either a function or a KeetaNet Account instance.\n\t */\n\tsigner?: InstanceType<typeof KeetaNet.lib.Account> | ((request: ConversionInputCanonicalJSON) => Promise<InstanceType<typeof KeetaNet.lib.Account>> | InstanceType<typeof KeetaNet.lib.Account>);\n\n\t/**\n\t * Account which performs the signing and validation of quotes\n\t */\n\tquoteSigner: Signing.SignableAccount;\n\n\t/**\n\t * Configuration for FX handling\n\t */\n\tfx: {\n\t\t/**\n\t\t * Supported conversions\n\t\t */\n\t\tfrom?: NonNullable<ServiceMetadata['services']['fx']>[string]['from'];\n\t\t/**\n\t\t * Handle the conversion request of one token to another\n\t\t *\n\t\t * This is used to handle quotes and estimates\n\t\t */\n\t\tgetConversionRateAndFee: (request: ConversionInputCanonicalJSON) => Promise<Omit<KeetaFXAnchorQuote, 'request' | 'signed' >>;\n\t\t/**\n\t\t * Optional callback to validate a quote before completing an exchange\n\t\t *\n\t\t * This allows the FX Server operator to reject quotes that are no longer\n\t\t * acceptable (e.g., due to price changes, expiry, or other business logic)\n\t\t *\n\t\t * @param quote The quote to validate\n\t\t * @returns true to accept the quote and proceed with the exchange, false to reject it\n\t\t */\n\t\tvalidateQuote?: (quote: KeetaFXAnchorQuoteJSON) => Promise<boolean> | boolean;\n\t};\n\n\t/**\n\t * The network client to use for submitting blocks\n\t */\n\tclient: { client: KeetaNet.Client; network: bigint; networkAlias: typeof KeetaNet.Client.Config.networksArray[number] } | KeetaNet.UserClient;\n};\n\nasync function formatQuoteSignable(unsignedQuote: Omit<KeetaFXAnchorQuoteJSON, 'signed'>): Promise<Signing.Signable> {\n\tconst retval: Signing.Signable = [\n\t\tunsignedQuote.request.from,\n\t\tunsignedQuote.request.to,\n\t\tunsignedQuote.request.amount,\n\t\tunsignedQuote.request.affinity,\n\t\tunsignedQuote.account,\n\t\tunsignedQuote.convertedAmount,\n\t\tunsignedQuote.cost.token,\n\t\tunsignedQuote.cost.amount\n\t];\n\n\treturn(retval);\n\n\t/**\n\t * This is a static assertion to ensure that this function is updated\n\t * if new fields are added to the KeetaFXAnchorQuote type to ensure\n\t * that we are always signing all the fields.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\ttype _ignore_static_assert = AssertNever<\n\t\t// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n\t\tAssertNever<keyof Omit<typeof unsignedQuote['request'], 'from' | 'to' | 'amount' | 'affinity'>> &\n\t\t// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents,@typescript-eslint/no-duplicate-type-constituents\n\t\tAssertNever<keyof Omit<typeof unsignedQuote['cost'], 'token' | 'amount'>> &\n\t\t// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents,@typescript-eslint/no-duplicate-type-constituents\n\t\tAssertNever<keyof Omit<typeof unsignedQuote, 'request' | 'convertedAmount' | 'cost' | 'account'>>\n\t>;\n}\n\nasync function generateSignedQuote(signer: Signing.SignableAccount, unsignedQuote: Omit<KeetaFXAnchorQuoteJSON, 'signed'>): Promise<KeetaFXAnchorQuoteJSON> {\n\tconst signableQuote = await formatQuoteSignable(unsignedQuote);\n\tconst signed = await Signing.SignData(signer, signableQuote);\n\n\treturn({\n\t\t...unsignedQuote,\n\t\tsigned: signed\n\t});\n}\n\nasync function verifySignedData(signedBy: Signing.VerifableAccount, quote: KeetaFXAnchorQuoteJSON): Promise<boolean> {\n\tconst signableQuote = await formatQuoteSignable(quote);\n\n\treturn(await Signing.VerifySignedData(signedBy, signableQuote, quote.signed));\n}\n\nasync function requestToAccounts(config: KeetaAnchorFXServerConfig, request: ConversionInputCanonicalJSON): Promise<{ signer: Signing.SignableAccount; account: KeetaNetAccount | KeetaNetStorageAccount; }> {\n\tconst account = KeetaNet.lib.Account.isInstance(config.account) ? config.account : await config.account(request);\n\tlet signer: Signing.SignableAccount | null = null;\n\tif (config.signer !== undefined) {\n\t\tsigner = (KeetaNet.lib.Account.isInstance(config.signer) ? config.signer : await config.signer(request)).assertAccount();\n\t}\n\n\tif (signer === null) {\n\t\tsigner = account.assertAccount();\n\t}\n\n\tif (!account.isAccount() && !account.isStorage()) {\n\t\tthrow(new Error('FX Account should be an Account or Storage Account'))\n\t}\n\n\treturn({\n\t\tsigner: signer,\n\t\taccount: account\n\t});\n}\n\nexport class KeetaNetFXAnchorHTTPServer extends KeetaAnchorHTTPServer.KeetaNetAnchorHTTPServer<KeetaAnchorFXServerConfig> implements Required<KeetaAnchorFXServerConfig> {\n\treadonly homepage: NonNullable<KeetaAnchorFXServerConfig['homepage']>;\n\treadonly client: KeetaAnchorFXServerConfig['client'];\n\treadonly account: KeetaAnchorFXServerConfig['account'];\n\treadonly signer: NonNullable<KeetaAnchorFXServerConfig['signer']>;\n\treadonly quoteSigner: KeetaAnchorFXServerConfig['quoteSigner'];\n\treadonly fx: KeetaAnchorFXServerConfig['fx'];\n\n\tconstructor(config: KeetaAnchorFXServerConfig) {\n\t\tsuper(config);\n\n\t\tthis.homepage = config.homepage ?? '';\n\t\tthis.client = config.client;\n\t\tthis.fx = config.fx;\n\t\tthis.account = config.account;\n\t\tthis.signer = config.signer ?? config.account;\n\t\tthis.quoteSigner = config.quoteSigner;\n\t}\n\n\tprotected async initRoutes(config: KeetaAnchorFXServerConfig): Promise<KeetaAnchorHTTPServer.Routes> {\n\t\tconst routes: KeetaAnchorHTTPServer.Routes = {};\n\n\t\t/**\n\t\t * If a homepage is provided, setup the route for it\n\t\t */\n\t\tif ('homepage' in config) {\n\t\t\troutes['GET /'] = async function() {\n\t\t\t\tlet homepageData: string;\n\t\t\t\tif (typeof config.homepage === 'string') {\n\t\t\t\t\thomepageData = config.homepage;\n\t\t\t\t} else {\n\t\t\t\t\tif (!config.homepage) {\n\t\t\t\t\t\tthrow(new Error('internal error: No homepage function provided'));\n\t\t\t\t\t}\n\n\t\t\t\t\thomepageData = await config.homepage();\n\t\t\t\t}\n\n\t\t\t\treturn({\n\t\t\t\t\toutput: homepageData,\n\t\t\t\t\tcontentType: 'text/html'\n\t\t\t\t});\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Setup the request handler for an estimate request\n\t\t */\n\t\troutes['POST /api/getEstimate'] = async function(_ignore_params, postData) {\n\t\t\tif (!postData || typeof postData !== 'object') {\n\t\t\t\tthrow(new Error('No POST data provided'));\n\t\t\t}\n\t\t\tif (!('request' in postData)) {\n\t\t\t\tthrow(new Error('POST data missing request'));\n\t\t\t}\n\n\t\t\tconst conversion = assertConversionInputCanonicalJSON(postData.request);\n\t\t\tconst rateAndFee = await config.fx.getConversionRateAndFee(conversion);\n\t\t\tconst estimateResponse: KeetaFXAnchorEstimateResponse = {\n\t\t\t\tok: true,\n\t\t\t\testimate: KeetaNet.lib.Utils.Conversion.toJSONSerializable({\n\t\t\t\t\trequest: conversion,\n\t\t\t\t\tconvertedAmount: rateAndFee.convertedAmount,\n\t\t\t\t\texpectedCost: {\n\t\t\t\t\t\tmin: rateAndFee.cost.amount,\n\t\t\t\t\t\tmax: rateAndFee.cost.amount,\n\t\t\t\t\t\ttoken: rateAndFee.cost.token\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t};\n\n\t\t\treturn({\n\t\t\t\toutput: JSON.stringify(estimateResponse)\n\t\t\t});\n\t\t}\n\n\t\troutes['POST /api/getQuote'] = async function(_ignore_params, postData) {\n\t\t\tif (!postData || typeof postData !== 'object') {\n\t\t\t\tthrow(new Error('No POST data provided'));\n\t\t\t}\n\t\t\tif (!('request' in postData)) {\n\t\t\t\tthrow(new Error('POST data missing request'));\n\t\t\t}\n\n\t\t\tconst conversion = assertConversionInputCanonicalJSON(postData.request);\n\t\t\tconst rateAndFee = await config.fx.getConversionRateAndFee(conversion);\n\n\t\t\tconst unsignedQuote: Omit<KeetaFXAnchorQuoteJSON, 'signed'> = KeetaNet.lib.Utils.Conversion.toJSONSerializable({\n\t\t\t\trequest: conversion,\n\t\t\t\t...rateAndFee\n\t\t\t});\n\n\t\t\tconst signedQuote = await generateSignedQuote(config.quoteSigner, unsignedQuote);\n\t\t\tconst quoteResponse: KeetaFXAnchorQuoteResponse = {\n\t\t\t\tok: true,\n\t\t\t\tquote: signedQuote\n\t\t\t};\n\n\t\t\treturn({\n\t\t\t\toutput: JSON.stringify(quoteResponse)\n\t\t\t});\n\t\t}\n\n\t\troutes['POST /api/createExchange'] = async function(_ignore_params, postData) {\n\t\t\tif (!postData || typeof postData !== 'object') {\n\t\t\t\tthrow(new Error('No POST data provided'));\n\t\t\t}\n\n\t\t\tif (!('request' in postData)) {\n\t\t\t\tthrow(new Error('POST data missing request'));\n\t\t\t}\n\t\t\tconst request = postData.request;\n\t\t\tif (!request || typeof request !== 'object') {\n\t\t\t\tthrow(new Error('Request is not an object'));\n\t\t\t}\n\n\t\t\tif (!('quote' in request)) {\n\t\t\t\tthrow(new Error('Quote is missing from request'));\n\t\t\t}\n\t\t\tif (!('block' in request) || typeof request.block !== 'string') {\n\t\t\t\tthrow(new Error('Block was not provided in exchange request'));\n\t\t\t}\n\n\t\t\tconst quote = assertConversionQuoteJSON(request.quote);\n\t\t\tconst isValidQuote = await verifySignedData(config.quoteSigner, quote);\n\t\t\tif (!isValidQuote) {\n\t\t\t\tthrow(new Error('Invalid quote signature'));\n\t\t\t}\n\n\t\t\t/* Validate the quote using the optional callback */\n\t\t\tif (config.fx.validateQuote !== undefined) {\n\t\t\t\tconst isAcceptable = await config.fx.validateQuote(quote);\n\t\t\t\tif (!isAcceptable) {\n\t\t\t\t\tthrow(new Errors.QuoteValidationFailed());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst block = new KeetaNet.lib.Block(request.block);\n\t\t\tlet userClient: KeetaNet.UserClient;\n\t\t\tif (KeetaNet.UserClient.isInstance(config.client)) {\n\t\t\t\tuserClient = config.client;\n\t\t\t} else {\n\t\t\t\tconst { account, signer } = await requestToAccounts(config, quote.request);\n\n\t\t\t\tuserClient = new KeetaNet.UserClient({\n\t\t\t\t\tclient: config.client.client,\n\t\t\t\t\tnetwork: config.client.network,\n\t\t\t\t\tnetworkAlias: config.client.networkAlias,\n\t\t\t\t\taccount: account,\n\t\t\t\t\tsigner: signer\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/* Get Expected Amount and Token to Verify Swap */\n\t\t\tconst expectedToken = KeetaNet.lib.Account.fromPublicKeyString(quote.request.from);\n\t\t\tlet expectedAmount = quote.request.affinity === 'from' ? BigInt(quote.request.amount) : BigInt(quote.convertedAmount);\n\t\t\t/* If cost is required verify the amounts and token. */\n\t\t\tif (BigInt(quote.cost.amount) > 0) {\n\t\t\t\t/* If swap token matches the cost token the add the amount since they should be combined in one block and will be checked in `acceptSwapRequest` */\n\t\t\t\tif (expectedToken.comparePublicKey(quote.cost.token)) {\n\t\t\t\t\texpectedAmount += BigInt(quote.cost.amount);\n\t\t\t\t/* If token is different then check block operations for matching amount and token */\n\t\t\t\t} else {\n\t\t\t\t\tlet requestIncludesCost = false;\n\t\t\t\t\tfor (const operation of block.operations) {\n\t\t\t\t\t\tif (operation.type === KeetaNet.lib.Block.OperationType.SEND) {\n\t\t\t\t\t\t\tconst recipientMatches = operation.to.comparePublicKey(quote.account);\n\t\t\t\t\t\t\tconst tokenMatches = operation.token.comparePublicKey(quote.cost.token);\n\t\t\t\t\t\t\tconst amountMatches = operation.amount === BigInt(quote.cost.amount);\n\t\t\t\t\t\t\tif (recipientMatches && tokenMatches && amountMatches) {\n\t\t\t\t\t\t\t\trequestIncludesCost = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!requestIncludesCost) {\n\t\t\t\t\t\tthrow(new Error('Exchange missing required cost'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Verify Request and Generate the Accept Swap Block */\n\t\t\tconst swapBlocks = await userClient.acceptSwapRequest({ block, expected: { token: expectedToken, amount: BigInt(expectedAmount) }});\n\t\t\tconst publishOptions: Parameters<typeof userClient.client.transmit>[1] = {};\n\t\t\tif (userClient.config.generateFeeBlock !== undefined) {\n\t\t\t\tpublishOptions.generateFeeBlock = userClient.config.generateFeeBlock;\n\t\t\t}\n\t\t\tconst publishResult = await userClient.client.transmit(swapBlocks, publishOptions);\n\t\t\tif (!publishResult.publish) {\n\t\t\t\tthrow(new Error('Exchange Publish Failed'));\n\t\t\t}\n\t\t\tconst exchangeResponse: KeetaFXAnchorExchangeResponse = {\n\t\t\t\tok: true,\n\t\t\t\texchangeID: block.hash.toString()\n\t\t\t};\n\n\t\t\treturn({\n\t\t\t\toutput: JSON.stringify(exchangeResponse)\n\t\t\t});\n\t\t}\n\n\t\troutes['GET /api/getExchangeStatus/:id'] = async function(params) {\n\t\t\tif (params === undefined || params === null) {\n\t\t\t\tthrow(new KeetaAnchorUserError('Expected params'));\n\t\t\t}\n\t\t\tconst exchangeID = params.get('id');\n\t\t\tif (typeof exchangeID !== 'string') {\n\t\t\t\tthrow(new Error('Missing exchangeID in params'));\n\t\t\t}\n\t\t\tconst blockLookup = await config.client.client.getVoteStaple(exchangeID);\n\t\t\tif (blockLookup === null) {\n\t\t\t\tthrow(new Error('Block Not Found'));\n\t\t\t}\n\t\t\tconst exchangeResponse: KeetaFXAnchorExchangeResponse = {\n\t\t\t\tok: true,\n\t\t\t\texchangeID: exchangeID\n\t\t\t};\n\n\t\t\treturn({\n\t\t\t\toutput: JSON.stringify(exchangeResponse)\n\t\t\t});\n\t\t}\n\n\t\treturn(routes);\n\t}\n\n\t/**\n\t * Return the servers endpoints and possible currency conversions metadata\n\t */\n\tasync serviceMetadata(): Promise<NonNullable<ServiceMetadata['services']['fx']>[string]> {\n\t\tconst operations: NonNullable<ServiceMetadata['services']['fx']>[string]['operations'] = {\n\t\t\tgetEstimate: (new URL('/api/getEstimate', this.url)).toString(),\n\t\t\tgetQuote: (new URL('/api/getQuote', this.url)).toString(),\n\t\t\tcreateExchange: (new URL('/api/createExchange', this.url)).toString(),\n\t\t\tgetExchangeStatus: (new URL('/api/getExchangeStatus', this.url)).toString() + '/{id}'\n\t\t};\n\n\t\treturn({\n\t\t\tfrom: this.fx.from ?? [],\n\t\t\toperations: operations\n\t\t});\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/services/fx/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,qBAAqB,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACN,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,kCAAkC,EAClC,yBAAyB,EACzB,MAAM,EACN,MAAM,aAAa,CAAC;AAWrB,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AA4DrD,CAAC;AAEF,KAAK,UAAU,mBAAmB,CAAC,aAAqD;IACvF,MAAM,MAAM,GAAqB;QAChC,aAAa,CAAC,OAAO,CAAC,IAAI;QAC1B,aAAa,CAAC,OAAO,CAAC,EAAE;QACxB,aAAa,CAAC,OAAO,CAAC,MAAM;QAC5B,aAAa,CAAC,OAAO,CAAC,QAAQ;QAC9B,aAAa,CAAC,OAAO;QACrB,aAAa,CAAC,eAAe;QAC7B,aAAa,CAAC,IAAI,CAAC,KAAK;QACxB,aAAa,CAAC,IAAI,CAAC,MAAM;KACzB,CAAC;IAEF,OAAM,CAAC,MAAM,CAAC,CAAC;AAgBhB,CAAC;AAED,KAAK,UAAU,mBAAmB,CAAC,MAA+B,EAAE,aAAqD;IACxH,MAAM,aAAa,GAAG,MAAM,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAE7D,OAAM,CAAC;QACN,GAAG,aAAa;QAChB,MAAM,EAAE,MAAM;KACd,CAAC,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,QAAkC,EAAE,KA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AAc,EAAE,CAAC,IAAI,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE;YACrE,iBAAiB,EAAE,CAAC,IAAI,GAAG,CAAC,wBAAwB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,OAAO;SACrF,CAAC;QAEF,OAAM,CAAC;YACN,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE;YACxB,UAAU,EAAE,UAAU;SACtB,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import * as KeetaAnchorHTTPServer from '../../lib/http-server/index.js';\nimport { KeetaNet } from '../../client/index.js';\nimport {\n\tKeetaAnchorUserError\n} from '../../lib/error.js';\nimport {\n\tassertConversionInputCanonicalJSON,\n\tassertConversionQuoteJSON,\n\tErrors\n} from './common.js';\nimport type {\n\tConversionInputCanonicalJSON,\n\tKeetaFXAnchorEstimateResponse,\n\tKeetaFXAnchorExchangeResponse,\n\tKeetaFXAnchorQuote,\n\tKeetaFXAnchorQuoteJSON,\n\tKeetaFXAnchorQuoteResponse,\n\tKeetaNetAccount,\n\tKeetaNetStorageAccount\n} from './common.ts';\nimport * as Signing from '../../lib/utils/signing.js';\nimport type { AssertNever } from '../../lib/utils/never.ts';\nimport type { ServiceMetadata } from '../../lib/resolver.js';\n\nexport interface KeetaAnchorFXServerConfig extends KeetaAnchorHTTPServer.KeetaAnchorHTTPServerConfig {\n\t/**\n\t * The data to use for the index page (optional)\n\t */\n\thomepage?: string | (() => Promise<string> | string);\n\n\t/**\n\t * The account to use for performing swaps for a given pair\n\t *\n\t * This may be either a function or a KeetaNet Account instance.\n\t */\n\taccount: KeetaNetAccount | KeetaNetStorageAccount | ((request: ConversionInputCanonicalJSON) => Promise<KeetaNetAccount | KeetaNetStorageAccount> | KeetaNetAccount | KeetaNetStorageAccount);\n\t/**\n\t * Account which can be used to sign transactions\n\t * for the account above (if not supplied the\n\t * account will be used).\n\t *\n\t * This may be either a function or a KeetaNet Account instance.\n\t */\n\tsigner?: InstanceType<typeof KeetaNet.lib.Account> | ((request: ConversionInputCanonicalJSON) => Promise<InstanceType<typeof KeetaNet.lib.Account>> | InstanceType<typeof KeetaNet.lib.Account>);\n\n\t/**\n\t * Account which performs the signing and validation of quotes\n\t */\n\tquoteSigner: Signing.SignableAccount;\n\n\t/**\n\t * Configuration for FX handling\n\t */\n\tfx: {\n\t\t/**\n\t\t * Supported conversions\n\t\t */\n\t\tfrom?: NonNullable<ServiceMetadata['services']['fx']>[string]['from'];\n\t\t/**\n\t\t * Handle the conversion request of one token to another\n\t\t *\n\t\t * This is used to handle quotes and estimates\n\t\t */\n\t\tgetConversionRateAndFee: (request: ConversionInputCanonicalJSON) => Promise<Omit<KeetaFXAnchorQuote, 'request' | 'signed' >>;\n\t\t/**\n\t\t * Optional callback to validate a quote before completing an exchange\n\t\t *\n\t\t * This allows the FX Server operator to reject quotes that are no longer\n\t\t * acceptable (e.g., due to price changes, expiry, or other business logic)\n\t\t *\n\t\t * @param quote The quote to validate\n\t\t * @returns true to accept the quote and proceed with the exchange, false to reject it\n\t\t */\n\t\tvalidateQuote?: (quote: KeetaFXAnchorQuoteJSON) => Promise<boolean> | boolean;\n\t};\n\n\t/**\n\t * The network client to use for submitting blocks\n\t */\n\tclient: { client: KeetaNet.Client; network: bigint; networkAlias: typeof KeetaNet.Client.Config.networksArray[number] } | KeetaNet.UserClient;\n};\n\nasync function formatQuoteSignable(unsignedQuote: Omit<KeetaFXAnchorQuoteJSON, 'signed'>): Promise<Signing.Signable> {\n\tconst retval: Signing.Signable = [\n\t\tunsignedQuote.request.from,\n\t\tunsignedQuote.request.to,\n\t\tunsignedQuote.request.amount,\n\t\tunsignedQuote.request.affinity,\n\t\tunsignedQuote.account,\n\t\tunsignedQuote.convertedAmount,\n\t\tunsignedQuote.cost.token,\n\t\tunsignedQuote.cost.amount\n\t];\n\n\treturn(retval);\n\n\t/**\n\t * This is a static assertion to ensure that this function is updated\n\t * if new fields are added to the KeetaFXAnchorQuote type to ensure\n\t * that we are always signing all the fields.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\ttype _ignore_static_assert = AssertNever<\n\t\t// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n\t\tAssertNever<keyof Omit<typeof unsignedQuote['request'], 'from' | 'to' | 'amount' | 'affinity'>> &\n\t\t// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents,@typescript-eslint/no-duplicate-type-constituents\n\t\tAssertNever<keyof Omit<typeof unsignedQuote['cost'], 'token' | 'amount'>> &\n\t\t// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents,@typescript-eslint/no-duplicate-type-constituents\n\t\tAssertNever<keyof Omit<typeof unsignedQuote, 'request' | 'convertedAmount' | 'cost' | 'account'>>\n\t>;\n}\n\nasync function generateSignedQuote(signer: Signing.SignableAccount, unsignedQuote: Omit<KeetaFXAnchorQuoteJSON, 'signed'>): Promise<KeetaFXAnchorQuoteJSON> {\n\tconst signableQuote = await formatQuoteSignable(unsignedQuote);\n\tconst signed = await Signing.SignData(signer, signableQuote);\n\n\treturn({\n\t\t...unsignedQuote,\n\t\tsigned: signed\n\t});\n}\n\nasync function verifySignedData(signedBy: Signing.VerifableAccount, quote: KeetaFXAnchorQuoteJSON): Promise<boolean> {\n\tconst signableQuote = await formatQuoteSignable(quote);\n\n\treturn(await Signing.VerifySignedData(signedBy, signableQuote, quote.signed));\n}\n\nasync function requestToAccounts(config: KeetaAnchorFXServerConfig, request: ConversionInputCanonicalJSON): Promise<{ signer: Signing.SignableAccount; account: KeetaNetAccount | KeetaNetStorageAccount; }> {\n\tconst account = KeetaNet.lib.Account.isInstance(config.account) ? config.account : await config.account(request);\n\tlet signer: Signing.SignableAccount | null = null;\n\tif (config.signer !== undefined) {\n\t\tsigner = (KeetaNet.lib.Account.isInstance(config.signer) ? config.signer : await config.signer(request)).assertAccount();\n\t}\n\n\tif (signer === null) {\n\t\tsigner = account.assertAccount();\n\t}\n\n\tif (!account.isAccount() && !account.isStorage()) {\n\t\tthrow(new Error('FX Account should be an Account or Storage Account'))\n\t}\n\n\treturn({\n\t\tsigner: signer,\n\t\taccount: account\n\t});\n}\n\nexport class KeetaNetFXAnchorHTTPServer extends KeetaAnchorHTTPServer.KeetaNetAnchorHTTPServer<KeetaAnchorFXServerConfig> implements Required<KeetaAnchorFXServerConfig> {\n\treadonly homepage: NonNullable<KeetaAnchorFXServerConfig['homepage']>;\n\treadonly client: KeetaAnchorFXServerConfig['client'];\n\treadonly account: KeetaAnchorFXServerConfig['account'];\n\treadonly signer: NonNullable<KeetaAnchorFXServerConfig['signer']>;\n\treadonly quoteSigner: KeetaAnchorFXServerConfig['quoteSigner'];\n\treadonly fx: KeetaAnchorFXServerConfig['fx'];\n\n\tconstructor(config: KeetaAnchorFXServerConfig) {\n\t\tsuper(config);\n\n\t\tthis.homepage = config.homepage ?? '';\n\t\tthis.client = config.client;\n\t\tthis.fx = config.fx;\n\t\tthis.account = config.account;\n\t\tthis.signer = config.signer ?? config.account;\n\t\tthis.quoteSigner = config.quoteSigner;\n\t}\n\n\tprotected async initRoutes(config: KeetaAnchorFXServerConfig): Promise<KeetaAnchorHTTPServer.Routes> {\n\t\tconst routes: KeetaAnchorHTTPServer.Routes = {};\n\n\t\t/**\n\t\t * If a homepage is provided, setup the route for it\n\t\t */\n\t\tif ('homepage' in config) {\n\t\t\troutes['GET /'] = async function() {\n\t\t\t\tlet homepageData: string;\n\t\t\t\tif (typeof config.homepage === 'string') {\n\t\t\t\t\thomepageData = config.homepage;\n\t\t\t\t} else {\n\t\t\t\t\tif (!config.homepage) {\n\t\t\t\t\t\tthrow(new Error('internal error: No homepage function provided'));\n\t\t\t\t\t}\n\n\t\t\t\t\thomepageData = await config.homepage();\n\t\t\t\t}\n\n\t\t\t\treturn({\n\t\t\t\t\toutput: homepageData,\n\t\t\t\t\tcontentType: 'text/html'\n\t\t\t\t});\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Setup the request handler for an estimate request\n\t\t */\n\t\troutes['POST /api/getEstimate'] = async function(_ignore_params, postData) {\n\t\t\tif (!postData || typeof postData !== 'object') {\n\t\t\t\tthrow(new Error('No POST data provided'));\n\t\t\t}\n\t\t\tif (!('request' in postData)) {\n\t\t\t\tthrow(new Error('POST data missing request'));\n\t\t\t}\n\n\t\t\tconst conversion = assertConversionInputCanonicalJSON(postData.request);\n\t\t\tconst rateAndFee = await config.fx.getConversionRateAndFee(conversion);\n\t\t\tconst estimateResponse: KeetaFXAnchorEstimateResponse = {\n\t\t\t\tok: true,\n\t\t\t\testimate: KeetaNet.lib.Utils.Conversion.toJSONSerializable({\n\t\t\t\t\trequest: conversion,\n\t\t\t\t\tconvertedAmount: rateAndFee.convertedAmount,\n\t\t\t\t\texpectedCost: {\n\t\t\t\t\t\tmin: rateAndFee.cost.amount,\n\t\t\t\t\t\tmax: rateAndFee.cost.amount,\n\t\t\t\t\t\ttoken: rateAndFee.cost.token\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t};\n\n\t\t\treturn({\n\t\t\t\toutput: JSON.stringify(estimateResponse)\n\t\t\t});\n\t\t}\n\n\t\troutes['POST /api/getQuote'] = async function(_ignore_params, postData) {\n\t\t\tif (!postData || typeof postData !== 'object') {\n\t\t\t\tthrow(new Error('No POST data provided'));\n\t\t\t}\n\t\t\tif (!('request' in postData)) {\n\t\t\t\tthrow(new Error('POST data missing request'));\n\t\t\t}\n\n\t\t\tconst conversion = assertConversionInputCanonicalJSON(postData.request);\n\t\t\tconst rateAndFee = await config.fx.getConversionRateAndFee(conversion);\n\n\t\t\tconst unsignedQuote: Omit<KeetaFXAnchorQuoteJSON, 'signed'> = KeetaNet.lib.Utils.Conversion.toJSONSerializable({\n\t\t\t\trequest: conversion,\n\t\t\t\t...rateAndFee\n\t\t\t});\n\n\t\t\tconst signedQuote = await generateSignedQuote(config.quoteSigner, unsignedQuote);\n\t\t\tconst quoteResponse: KeetaFXAnchorQuoteResponse = {\n\t\t\t\tok: true,\n\t\t\t\tquote: signedQuote\n\t\t\t};\n\n\t\t\treturn({\n\t\t\t\toutput: JSON.stringify(quoteResponse)\n\t\t\t});\n\t\t}\n\n\t\troutes['POST /api/createExchange'] = async function(_ignore_params, postData) {\n\t\t\tif (!postData || typeof postData !== 'object') {\n\t\t\t\tthrow(new Error('No POST data provided'));\n\t\t\t}\n\n\t\t\tif (!('request' in postData)) {\n\t\t\t\tthrow(new Error('POST data missing request'));\n\t\t\t}\n\t\t\tconst request = postData.request;\n\t\t\tif (!request || typeof request !== 'object') {\n\t\t\t\tthrow(new Error('Request is not an object'));\n\t\t\t}\n\n\t\t\tif (!('quote' in request)) {\n\t\t\t\tthrow(new Error('Quote is missing from request'));\n\t\t\t}\n\t\t\tif (!('block' in request) || typeof request.block !== 'string') {\n\t\t\t\tthrow(new Error('Block was not provided in exchange request'));\n\t\t\t}\n\n\t\t\tconst quote = assertConversionQuoteJSON(request.quote);\n\t\t\tconst isValidQuote = await verifySignedData(config.quoteSigner, quote);\n\t\t\tif (!isValidQuote) {\n\t\t\t\tthrow(new Error('Invalid quote signature'));\n\t\t\t}\n\n\t\t\t/* Validate the quote using the optional callback */\n\t\t\tif (config.fx.validateQuote !== undefined) {\n\t\t\t\tconst isAcceptable = await config.fx.validateQuote(quote);\n\t\t\t\tif (!isAcceptable) {\n\t\t\t\t\tthrow(new Errors.QuoteValidationFailed());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst block = new KeetaNet.lib.Block(request.block);\n\t\t\tlet userClient: KeetaNet.UserClient;\n\t\t\tif (KeetaNet.UserClient.isInstance(config.client)) {\n\t\t\t\tuserClient = config.client;\n\t\t\t} else {\n\t\t\t\tconst { account, signer } = await requestToAccounts(config, quote.request);\n\n\t\t\t\tuserClient = new KeetaNet.UserClient({\n\t\t\t\t\tclient: config.client.client,\n\t\t\t\t\tnetwork: config.client.network,\n\t\t\t\t\tnetworkAlias: config.client.networkAlias,\n\t\t\t\t\taccount: account,\n\t\t\t\t\tsigner: signer\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/* Get Expected Amount and Token to Verify Swap */\n\t\t\tconst expectedToken = KeetaNet.lib.Account.fromPublicKeyString(quote.request.from);\n\t\t\tlet expectedAmount = quote.request.affinity === 'from' ? BigInt(quote.request.amount) : BigInt(quote.convertedAmount);\n\t\t\t/* If cost is required verify the amounts and token. */\n\t\t\tif (BigInt(quote.cost.amount) > 0) {\n\t\t\t\t/* If swap token matches the cost token the add the amount since they should be combined in one block and will be checked in `acceptSwapRequest` */\n\t\t\t\tif (expectedToken.comparePublicKey(quote.cost.token)) {\n\t\t\t\t\texpectedAmount += BigInt(quote.cost.amount);\n\t\t\t\t/* If token is different then check block operations for matching amount and token */\n\t\t\t\t} else {\n\t\t\t\t\tlet requestIncludesCost = false;\n\t\t\t\t\tfor (const operation of block.operations) {\n\t\t\t\t\t\tif (operation.type === KeetaNet.lib.Block.OperationType.SEND) {\n\t\t\t\t\t\t\tconst recipientMatches = operation.to.comparePublicKey(quote.account);\n\t\t\t\t\t\t\tconst tokenMatches = operation.token.comparePublicKey(quote.cost.token);\n\t\t\t\t\t\t\tconst amountMatches = operation.amount === BigInt(quote.cost.amount);\n\t\t\t\t\t\t\tif (recipientMatches && tokenMatches && amountMatches) {\n\t\t\t\t\t\t\t\trequestIncludesCost = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!requestIncludesCost) {\n\t\t\t\t\t\tthrow(new Error('Exchange missing required cost'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Verify Request and Generate the Accept Swap Block */\n\t\t\tconst swapBlocks = await userClient.acceptSwapRequest({ block, expected: { token: expectedToken, amount: BigInt(expectedAmount) }});\n\t\t\tconst publishOptions: Parameters<typeof userClient.client.transmit>[1] = {};\n\t\t\tif (userClient.config.generateFeeBlock !== undefined) {\n\t\t\t\tpublishOptions.generateFeeBlock = userClient.config.generateFeeBlock;\n\t\t\t}\n\t\t\tconst publishResult = await userClient.client.transmit(swapBlocks, publishOptions);\n\t\t\tif (!publishResult.publish) {\n\t\t\t\tthrow(new Error('Exchange Publish Failed'));\n\t\t\t}\n\t\t\tconst exchangeResponse: KeetaFXAnchorExchangeResponse = {\n\t\t\t\tok: true,\n\t\t\t\texchangeID: block.hash.toString()\n\t\t\t};\n\n\t\t\treturn({\n\t\t\t\toutput: JSON.stringify(exchangeResponse)\n\t\t\t});\n\t\t}\n\n\t\troutes['GET /api/getExchangeStatus/:id'] = async function(params) {\n\t\t\tif (params === undefined || params === null) {\n\t\t\t\tthrow(new KeetaAnchorUserError('Expected params'));\n\t\t\t}\n\t\t\tconst exchangeID = params.get('id');\n\t\t\tif (typeof exchangeID !== 'string') {\n\t\t\t\tthrow(new Error('Missing exchangeID in params'));\n\t\t\t}\n\t\t\tconst blockLookup = await config.client.client.getVoteStaple(exchangeID);\n\t\t\tif (blockLookup === null) {\n\t\t\t\tthrow(new Error('Block Not Found'));\n\t\t\t}\n\t\t\tconst exchangeResponse: KeetaFXAnchorExchangeResponse = {\n\t\t\t\tok: true,\n\t\t\t\texchangeID: exchangeID\n\t\t\t};\n\n\t\t\treturn({\n\t\t\t\toutput: JSON.stringify(exchangeResponse)\n\t\t\t});\n\t\t}\n\n\t\treturn(routes);\n\t}\n\n\t/**\n\t * Return the servers endpoints and possible currency conversions metadata\n\t */\n\tasync serviceMetadata(): Promise<NonNullable<ServiceMetadata['services']['fx']>[string]> {\n\t\tconst operations: NonNullable<ServiceMetadata['services']['fx']>[string]['operations'] = {\n\t\t\tgetEstimate: (new URL('/api/getEstimate', this.url)).toString(),\n\t\t\tgetQuote: (new URL('/api/getQuote', this.url)).toString(),\n\t\t\tcreateExchange: (new URL('/api/createExchange', this.url)).toString(),\n\t\t\tgetExchangeStatus: (new URL('/api/getExchangeStatus', this.url)).toString() + '/{id}'\n\t\t};\n\n\t\treturn({\n\t\t\tfrom: this.fx.from ?? [],\n\t\t\toperations: operations\n\t\t});\n\t}\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as __typia_transform__assertGuard from "typia/lib/internal/_assertGuard.js";
|
|
2
2
|
import { createAssert } from 'typia';
|
|
3
|
-
export const assertCreateVerificationRequest = (() => { const _iv2 = new Set(["840", "533", "356", "578", "108", "132", "116", "124", "136", "152", "156", "170", "174", "554", "188", "192", "203", "208", "262", "214", "818", "222", "232", "748", "238", "242", "270", "292", "320", "826", "324", "328", "332", "340", "344", "348", "352", "360", "364", "368", "376", "388", "392", "400", "398", "404", "408", "410", "414", "417", "418", "422", "426", "710", "430", "434", "756", "446", "807", "454", "458", "462", "480", "484", "498", "496", "504", "104", "516", "524", "558", "566", "512", "586", "598", "600", "604", "608", "634", "643", "646", "654", "882", "682", "690", "694", "702", "706", "728", "144", "752", "760", "834", "764", "776", "780", "788", "800", "784", "858", "860", "548", "704", "AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW", "004", "248", "008", "012", "016", "020", "024", "660", "010", "028", "032", "051", "036", "040", "031", "044", "048", "050", "052", "112", "056", "084", "204", "060", "064", "068", "535", "070", "072", "074", "076", "086", "096", "100", "854", "120", "140", "148", "162", "166", "178", "180", "184", "384", "191", "531", "196", "212", "218", "226", "233", "231", "234", "246", "250", "254", "258", "260", "266", "268", "276", "288", "300", "304", "308", "312", "316", "831", "624", "334", "336", "372", "833", "380", "832", "296", "428", "438", "440", "442", "450", "466", "470", "584", "474", "478", "175", "583", "492", "499", "500", "508", "520", "528", "540", "562", "570", "574", "580", "585", "591", "612", "616", "620", "630", "638", "642", "652", "659", "662", "663", "666", "670", "674", "678", "686", "688", "534", "703", "705", "090", "239", "724", "729", "740", "744", "158", "762", "626", "768", "772", "792", "795", "796", "798", "804", "581", "862", "092", "850", "876", "732", "887", "894", "716"]); const _iv3 = new Set(["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]); const _iv4 = new Set(["BTN", "MKD", "SLE", "CHE", "AFG", "ALA", "ALB", "DZA", "ASM", "AND", "AGO", "AIA", "ATA", "ATG", "ARG", "ARM", "ABW", "AUS", "AUT", "AZE", "BHS", "BHR", "BGD", "BRB", "BLR", "BEL", "BLZ", "BEN", "BMU", "BOL", "BES", "BIH", "BWA", "BVT", "BRA", "IOT", "BRN", "BGR", "BFA", "BDI", "CPV", "KHM", "CMR", "CAN", "CYM", "CAF", "TCD", "CHL", "CHN", "CXR", "CCK", "COL", "COM", "COG", "COD", "COK", "CRI", "CIV", "HRV", "CUB", "CUW", "CYP", "CZE", "DNK", "DJI", "DMA", "DOM", "ECU", "EGY", "SLV", "GNQ", "ERI", "EST", "SWZ", "ETH", "FLK", "FRO", "FJI", "FIN", "FRA", "GUF", "PYF", "ATF", "GAB", "GMB", "GEO", "DEU", "GHA", "GIB", "GRC", "GRL", "GRD", "GLP", "GUM", "GTM", "GGY", "GIN", "GNB", "GUY", "HTI", "HMD", "VAT", "HND", "HKG", "HUN", "ISL", "IND", "IDN", "IRN", "IRQ", "IRL", "IMN", "ISR", "ITA", "JAM", "JPN", "JEY", "JOR", "KAZ", "KEN", "KIR", "PRK", "KOR", "KWT", "KGZ", "LAO", "LVA", "LBN", "LSO", "LBR", "LBY", "LIE", "LTU", "LUX", "MAC", "MDG", "MWI", "MYS", "MDV", "MLI", "MLT", "MHL", "MTQ", "MRT", "MUS", "MYT", "MEX", "FSM", "MDA", "MCO", "MNG", "MNE", "MSR", "MAR", "MOZ", "MMR", "NAM", "NRU", "NPL", "NLD", "NCL", "NZL", "NIC", "NER", "NGA", "NIU", "NFK", "MNP", "NOR", "OMN", "PAK", "PLW", "PAN", "PNG", "PRY", "PER", "PHL", "PCN", "POL", "PRT", "PRI", "QAT", "REU", "ROU", "RUS", "RWA", "BLM", "SHN", "KNA", "LCA", "MAF", "SPM", "VCT", "WSM", "SMR", "STP", "SAU", "SEN", "SRB", "SYC", "SGP", "SXM", "SVK", "SVN", "SLB", "SOM", "ZAF", "SGS", "SSD", "ESP", "LKA", "SDN", "SUR", "SJM", "SWE", "SYR", "TWN", "TJK", "TZA", "THA", "TLS", "TGO", "TKL", "TON", "TTO", "TUN", "TUR", "TKM", "TCA", "TUV", "UGA", "UKR", "ARE", "GBR", "USA", "UMI", "URY", "UZB", "VUT", "VEN", "VNM", "VGB", "VIR", "WLF", "ESH", "YEM", "ZMB", "ZWE"]); const _iv5 = new Set(["840", "533", "356", "578", "108", "132", "116", "124", "136", "152", "156", "170", "174", "554", "188", "192", "203", "208", "262", "214", "818", "222", "232", "748", "238", "242", "270", "292", "320", "826", "324", "328", "332", "340", "344", "348", "352", "360", "364", "368", "376", "388", "392", "400", "398", "404", "408", "410", "414", "417", "418", "422", "426", "710", "430", "434", "756", "446", "807", "454", "458", "462", "480", "484", "498", "496", "504", "104", "516", "524", "558", "566", "512", "586", "598", "600", "604", "608", "634", "643", "646", "654", "882", "682", "690", "694", "702", "706", "728", "144", "752", "760", "834", "764", "776", "780", "788", "800", "784", "858", "860", "548", "704", "004", "248", "008", "012", "016", "020", "024", "660", "010", "028", "032", "051", "036", "040", "031", "044", "048", "050", "052", "112", "056", "084", "204", "060", "064", "068", "535", "070", "072", "074", "076", "086", "096", "100", "854", "120", "140", "148", "162", "166", "178", "180", "184", "384", "191", "531", "196", "212", "218", "226", "233", "231", "234", "246", "250", "254", "258", "260", "266", "268", "276", "288", "300", "304", "308", "312", "316", "831", "624", "334", "336", "372", "833", "380", "832", "296", "428", "438", "440", "442", "450", "466", "470", "584", "474", "478", "175", "583", "492", "499", "500", "508", "520", "528", "540", "562", "570", "574", "580", "585", "591", "612", "616", "620", "630", "638", "642", "652", "659", "662", "663", "666", "670", "674", "678", "686", "688", "534", "703", "705", "090", "239", "724", "729", "740", "744", "158", "762", "626", "768", "772", "792", "795", "796", "798", "804", "581", "862", "092", "850", "876", "732", "887", "894", "716"]); const _av7 = new Set(["840", "533", "356", "578", "108", "132", "116", "124", "136", "152", "156", "170", "174", "554", "188", "192", "203", "208", "262", "214", "818", "222", "232", "748", "238", "242", "270", "292", "320", "826", "324", "328", "332", "340", "344", "348", "352", "360", "364", "368", "376", "388", "392", "400", "398", "404", "408", "410", "414", "417", "418", "422", "426", "710", "430", "434", "756", "446", "807", "454", "458", "462", "480", "484", "498", "496", "504", "104", "516", "524", "558", "566", "512", "586", "598", "600", "604", "608", "634", "643", "646", "654", "882", "682", "690", "694", "702", "706", "728", "144", "752", "760", "834", "764", "776", "780", "788", "800", "784", "858", "860", "548", "704", "AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW", "004", "248", "008", "012", "016", "020", "024", "660", "010", "028", "032", "051", "036", "040", "031", "044", "048", "050", "052", "112", "056", "084", "204", "060", "064", "068", "535", "070", "072", "074", "076", "086", "096", "100", "854", "120", "140", "148", "162", "166", "178", "180", "184", "384", "191", "531", "196", "212", "218", "226", "233", "231", "234", "246", "250", "254", "258", "260", "266", "268", "276", "288", "300", "304", "308", "312", "316", "831", "624", "334", "336", "372", "833", "380", "832", "296", "428", "438", "440", "442", "450", "466", "470", "584", "474", "478", "175", "583", "492", "499", "500", "508", "520", "528", "540", "562", "570", "574", "580", "585", "591", "612", "616", "620", "630", "638", "642", "652", "659", "662", "663", "666", "670", "674", "678", "686", "688", "534", "703", "705", "090", "239", "724", "729", "740", "744", "158", "762", "626", "768", "772", "792", "795", "796", "798", "804", "581", "862", "092", "850", "876", "732", "887", "894", "716"]); const _av8 = new Set(["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]); const _av9 = new Set(["BTN", "MKD", "SLE", "CHE", "AFG", "ALA", "ALB", "DZA", "ASM", "AND", "AGO", "AIA", "ATA", "ATG", "ARG", "ARM", "ABW", "AUS", "AUT", "AZE", "BHS", "BHR", "BGD", "BRB", "BLR", "BEL", "BLZ", "BEN", "BMU", "BOL", "BES", "BIH", "BWA", "BVT", "BRA", "IOT", "BRN", "BGR", "BFA", "BDI", "CPV", "KHM", "CMR", "CAN", "CYM", "CAF", "TCD", "CHL", "CHN", "CXR", "CCK", "COL", "COM", "COG", "COD", "COK", "CRI", "CIV", "HRV", "CUB", "CUW", "CYP", "CZE", "DNK", "DJI", "DMA", "DOM", "ECU", "EGY", "SLV", "GNQ", "ERI", "EST", "SWZ", "ETH", "FLK", "FRO", "FJI", "FIN", "FRA", "GUF", "PYF", "ATF", "GAB", "GMB", "GEO", "DEU", "GHA", "GIB", "GRC", "GRL", "GRD", "GLP", "GUM", "GTM", "GGY", "GIN", "GNB", "GUY", "HTI", "HMD", "VAT", "HND", "HKG", "HUN", "ISL", "IND", "IDN", "IRN", "IRQ", "IRL", "IMN", "ISR", "ITA", "JAM", "JPN", "JEY", "JOR", "KAZ", "KEN", "KIR", "PRK", "KOR", "KWT", "KGZ", "LAO", "LVA", "LBN", "LSO", "LBR", "LBY", "LIE", "LTU", "LUX", "MAC", "MDG", "MWI", "MYS", "MDV", "MLI", "MLT", "MHL", "MTQ", "MRT", "MUS", "MYT", "MEX", "FSM", "MDA", "MCO", "MNG", "MNE", "MSR", "MAR", "MOZ", "MMR", "NAM", "NRU", "NPL", "NLD", "NCL", "NZL", "NIC", "NER", "NGA", "NIU", "NFK", "MNP", "NOR", "OMN", "PAK", "PLW", "PAN", "PNG", "PRY", "PER", "PHL", "PCN", "POL", "PRT", "PRI", "QAT", "REU", "ROU", "RUS", "RWA", "BLM", "SHN", "KNA", "LCA", "MAF", "SPM", "VCT", "WSM", "SMR", "STP", "SAU", "SEN", "SRB", "SYC", "SGP", "SXM", "SVK", "SVN", "SLB", "SOM", "ZAF", "SGS", "SSD", "ESP", "LKA", "SDN", "SUR", "SJM", "SWE", "SYR", "TWN", "TJK", "TZA", "THA", "TLS", "TGO", "TKL", "TON", "TTO", "TUN", "TUR", "TKM", "TCA", "TUV", "UGA", "UKR", "ARE", "GBR", "USA", "UMI", "URY", "UZB", "VUT", "VEN", "VNM", "VGB", "VIR", "WLF", "ESH", "YEM", "ZMB", "ZWE"]); const _av10 = new Set(["840", "533", "356", "578", "108", "132", "116", "124", "136", "152", "156", "170", "174", "554", "188", "192", "203", "208", "262", "214", "818", "222", "232", "748", "238", "242", "270", "292", "320", "826", "324", "328", "332", "340", "344", "348", "352", "360", "364", "368", "376", "388", "392", "400", "398", "404", "408", "410", "414", "417", "418", "422", "426", "710", "430", "434", "756", "446", "807", "454", "458", "462", "480", "484", "498", "496", "504", "104", "516", "524", "558", "566", "512", "586", "598", "600", "604", "608", "634", "643", "646", "654", "882", "682", "690", "694", "702", "706", "728", "144", "752", "760", "834", "764", "776", "780", "788", "800", "784", "858", "860", "548", "704", "004", "248", "008", "012", "016", "020", "024", "660", "010", "028", "032", "051", "036", "040", "031", "044", "048", "050", "052", "112", "056", "084", "204", "060", "064", "068", "535", "070", "072", "074", "076", "086", "096", "100", "854", "120", "140", "148", "162", "166", "178", "180", "184", "384", "191", "531", "196", "212", "218", "226", "233", "231", "234", "246", "250", "254", "258", "260", "266", "268", "276", "288", "300", "304", "308", "312", "316", "831", "624", "334", "336", "372", "833", "380", "832", "296", "428", "438", "440", "442", "450", "466", "470", "584", "474", "478", "175", "583", "492", "499", "500", "508", "520", "528", "540", "562", "570", "574", "580", "585", "591", "612", "616", "620", "630", "638", "642", "652", "659", "662", "663", "666", "670", "674", "678", "686", "688", "534", "703", "705", "090", "239", "724", "729", "740", "744", "158", "762", "626", "768", "772", "792", "795", "796", "798", "804", "581", "862", "092", "850", "876", "732", "887", "894", "716"]); const _io0 = input => Array.isArray(input.countryCodes) && input.countryCodes.every(elem => null !== elem && undefined !== elem && (true === _iv2.has(elem) || "object" === typeof elem && null !== elem && _io1(elem))) && ("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_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_aq(.*)/).test(input.account) || RegExp(/^keeta_ar(.*)/).test(input.account) || RegExp(/^keeta_as(.*)/).test(input.account) || RegExp(/^tyblocks_at(.*)/).test(input.account) || RegExp(/^tyblocks_aq(.*)/).test(input.account) || RegExp(/^tyblocks_ar(.*)/).test(input.account) || RegExp(/^tyblocks_as(.*)/).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) || 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_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_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))) && ("object" === typeof input.signed && null !== input.signed && _io4(input.signed)); const _io1 = input => true && true === _iv3.has(input.code) && "string" === typeof input.name && true === _iv4.has(input.longCode) && true === _iv5.has(input.numericCode) && "string" === typeof input.dialCode && (undefined === input.region || "object" === typeof input.region && null !== input.region && false === Array.isArray(input.region) && _io2(input.region)); const _io2 = input => (undefined === input.primary || "object" === typeof input.primary && null !== input.primary && _io3(input.primary)) && (undefined === input.subRegion || "object" === typeof input.subRegion && null !== input.subRegion && _io3(input.subRegion)) && (undefined === input.intermediateRegion || "object" === typeof input.intermediateRegion && null !== input.intermediateRegion && _io3(input.intermediateRegion)); const _io3 = input => "string" === typeof input.name && "string" === typeof input.code; const _io4 = input => "string" === typeof input.nonce && "string" === typeof input.timestamp && "string" === typeof input.signature; const _ao0 = (input, _path, _exceptionable = true) => ((Array.isArray(input.countryCodes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
3
|
+
export const assertCreateVerificationRequest = (() => { const _iv2 = new Set(["840", "533", "356", "578", "108", "132", "116", "124", "136", "152", "156", "170", "174", "554", "188", "192", "203", "208", "262", "214", "818", "222", "232", "748", "238", "242", "270", "292", "320", "826", "324", "328", "332", "340", "344", "348", "352", "360", "364", "368", "376", "388", "392", "400", "398", "404", "408", "410", "414", "417", "418", "422", "426", "710", "430", "434", "756", "446", "807", "454", "458", "462", "480", "484", "498", "496", "504", "104", "516", "524", "558", "566", "512", "586", "598", "600", "604", "608", "634", "643", "646", "654", "882", "682", "690", "694", "702", "706", "728", "144", "752", "760", "834", "764", "776", "780", "788", "800", "784", "858", "860", "548", "704", "AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW", "004", "248", "008", "012", "016", "020", "024", "660", "010", "028", "032", "051", "036", "040", "031", "044", "048", "050", "052", "112", "056", "084", "204", "060", "064", "068", "535", "070", "072", "074", "076", "086", "096", "100", "854", "120", "140", "148", "162", "166", "178", "180", "184", "384", "191", "531", "196", "212", "218", "226", "233", "231", "234", "246", "250", "254", "258", "260", "266", "268", "276", "288", "300", "304", "308", "312", "316", "831", "624", "334", "336", "372", "833", "380", "832", "296", "428", "438", "440", "442", "450", "466", "470", "584", "474", "478", "175", "583", "492", "499", "500", "508", "520", "528", "540", "562", "570", "574", "580", "585", "591", "612", "616", "620", "630", "638", "642", "652", "659", "662", "663", "666", "670", "674", "678", "686", "688", "534", "703", "705", "090", "239", "724", "729", "740", "744", "158", "762", "626", "768", "772", "792", "795", "796", "798", "804", "581", "862", "092", "850", "876", "732", "887", "894", "716"]); const _iv3 = new Set(["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]); const _iv4 = new Set(["BTN", "MKD", "SLE", "CHE", "AFG", "ALA", "ALB", "DZA", "ASM", "AND", "AGO", "AIA", "ATA", "ATG", "ARG", "ARM", "ABW", "AUS", "AUT", "AZE", "BHS", "BHR", "BGD", "BRB", "BLR", "BEL", "BLZ", "BEN", "BMU", "BOL", "BES", "BIH", "BWA", "BVT", "BRA", "IOT", "BRN", "BGR", "BFA", "BDI", "CPV", "KHM", "CMR", "CAN", "CYM", "CAF", "TCD", "CHL", "CHN", "CXR", "CCK", "COL", "COM", "COG", "COD", "COK", "CRI", "CIV", "HRV", "CUB", "CUW", "CYP", "CZE", "DNK", "DJI", "DMA", "DOM", "ECU", "EGY", "SLV", "GNQ", "ERI", "EST", "SWZ", "ETH", "FLK", "FRO", "FJI", "FIN", "FRA", "GUF", "PYF", "ATF", "GAB", "GMB", "GEO", "DEU", "GHA", "GIB", "GRC", "GRL", "GRD", "GLP", "GUM", "GTM", "GGY", "GIN", "GNB", "GUY", "HTI", "HMD", "VAT", "HND", "HKG", "HUN", "ISL", "IND", "IDN", "IRN", "IRQ", "IRL", "IMN", "ISR", "ITA", "JAM", "JPN", "JEY", "JOR", "KAZ", "KEN", "KIR", "PRK", "KOR", "KWT", "KGZ", "LAO", "LVA", "LBN", "LSO", "LBR", "LBY", "LIE", "LTU", "LUX", "MAC", "MDG", "MWI", "MYS", "MDV", "MLI", "MLT", "MHL", "MTQ", "MRT", "MUS", "MYT", "MEX", "FSM", "MDA", "MCO", "MNG", "MNE", "MSR", "MAR", "MOZ", "MMR", "NAM", "NRU", "NPL", "NLD", "NCL", "NZL", "NIC", "NER", "NGA", "NIU", "NFK", "MNP", "NOR", "OMN", "PAK", "PLW", "PAN", "PNG", "PRY", "PER", "PHL", "PCN", "POL", "PRT", "PRI", "QAT", "REU", "ROU", "RUS", "RWA", "BLM", "SHN", "KNA", "LCA", "MAF", "SPM", "VCT", "WSM", "SMR", "STP", "SAU", "SEN", "SRB", "SYC", "SGP", "SXM", "SVK", "SVN", "SLB", "SOM", "ZAF", "SGS", "SSD", "ESP", "LKA", "SDN", "SUR", "SJM", "SWE", "SYR", "TWN", "TJK", "TZA", "THA", "TLS", "TGO", "TKL", "TON", "TTO", "TUN", "TUR", "TKM", "TCA", "TUV", "UGA", "UKR", "ARE", "GBR", "USA", "UMI", "URY", "UZB", "VUT", "VEN", "VNM", "VGB", "VIR", "WLF", "ESH", "YEM", "ZMB", "ZWE"]); const _iv5 = new Set(["840", "533", "356", "578", "108", "132", "116", "124", "136", "152", "156", "170", "174", "554", "188", "192", "203", "208", "262", "214", "818", "222", "232", "748", "238", "242", "270", "292", "320", "826", "324", "328", "332", "340", "344", "348", "352", "360", "364", "368", "376", "388", "392", "400", "398", "404", "408", "410", "414", "417", "418", "422", "426", "710", "430", "434", "756", "446", "807", "454", "458", "462", "480", "484", "498", "496", "504", "104", "516", "524", "558", "566", "512", "586", "598", "600", "604", "608", "634", "643", "646", "654", "882", "682", "690", "694", "702", "706", "728", "144", "752", "760", "834", "764", "776", "780", "788", "800", "784", "858", "860", "548", "704", "004", "248", "008", "012", "016", "020", "024", "660", "010", "028", "032", "051", "036", "040", "031", "044", "048", "050", "052", "112", "056", "084", "204", "060", "064", "068", "535", "070", "072", "074", "076", "086", "096", "100", "854", "120", "140", "148", "162", "166", "178", "180", "184", "384", "191", "531", "196", "212", "218", "226", "233", "231", "234", "246", "250", "254", "258", "260", "266", "268", "276", "288", "300", "304", "308", "312", "316", "831", "624", "334", "336", "372", "833", "380", "832", "296", "428", "438", "440", "442", "450", "466", "470", "584", "474", "478", "175", "583", "492", "499", "500", "508", "520", "528", "540", "562", "570", "574", "580", "585", "591", "612", "616", "620", "630", "638", "642", "652", "659", "662", "663", "666", "670", "674", "678", "686", "688", "534", "703", "705", "090", "239", "724", "729", "740", "744", "158", "762", "626", "768", "772", "792", "795", "796", "798", "804", "581", "862", "092", "850", "876", "732", "887", "894", "716"]); const _av7 = new Set(["840", "533", "356", "578", "108", "132", "116", "124", "136", "152", "156", "170", "174", "554", "188", "192", "203", "208", "262", "214", "818", "222", "232", "748", "238", "242", "270", "292", "320", "826", "324", "328", "332", "340", "344", "348", "352", "360", "364", "368", "376", "388", "392", "400", "398", "404", "408", "410", "414", "417", "418", "422", "426", "710", "430", "434", "756", "446", "807", "454", "458", "462", "480", "484", "498", "496", "504", "104", "516", "524", "558", "566", "512", "586", "598", "600", "604", "608", "634", "643", "646", "654", "882", "682", "690", "694", "702", "706", "728", "144", "752", "760", "834", "764", "776", "780", "788", "800", "784", "858", "860", "548", "704", "AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW", "004", "248", "008", "012", "016", "020", "024", "660", "010", "028", "032", "051", "036", "040", "031", "044", "048", "050", "052", "112", "056", "084", "204", "060", "064", "068", "535", "070", "072", "074", "076", "086", "096", "100", "854", "120", "140", "148", "162", "166", "178", "180", "184", "384", "191", "531", "196", "212", "218", "226", "233", "231", "234", "246", "250", "254", "258", "260", "266", "268", "276", "288", "300", "304", "308", "312", "316", "831", "624", "334", "336", "372", "833", "380", "832", "296", "428", "438", "440", "442", "450", "466", "470", "584", "474", "478", "175", "583", "492", "499", "500", "508", "520", "528", "540", "562", "570", "574", "580", "585", "591", "612", "616", "620", "630", "638", "642", "652", "659", "662", "663", "666", "670", "674", "678", "686", "688", "534", "703", "705", "090", "239", "724", "729", "740", "744", "158", "762", "626", "768", "772", "792", "795", "796", "798", "804", "581", "862", "092", "850", "876", "732", "887", "894", "716"]); const _av8 = new Set(["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "SZ", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MK", "MP", "NO", "OM", "PK", "PW", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"]); const _av9 = new Set(["BTN", "MKD", "SLE", "CHE", "AFG", "ALA", "ALB", "DZA", "ASM", "AND", "AGO", "AIA", "ATA", "ATG", "ARG", "ARM", "ABW", "AUS", "AUT", "AZE", "BHS", "BHR", "BGD", "BRB", "BLR", "BEL", "BLZ", "BEN", "BMU", "BOL", "BES", "BIH", "BWA", "BVT", "BRA", "IOT", "BRN", "BGR", "BFA", "BDI", "CPV", "KHM", "CMR", "CAN", "CYM", "CAF", "TCD", "CHL", "CHN", "CXR", "CCK", "COL", "COM", "COG", "COD", "COK", "CRI", "CIV", "HRV", "CUB", "CUW", "CYP", "CZE", "DNK", "DJI", "DMA", "DOM", "ECU", "EGY", "SLV", "GNQ", "ERI", "EST", "SWZ", "ETH", "FLK", "FRO", "FJI", "FIN", "FRA", "GUF", "PYF", "ATF", "GAB", "GMB", "GEO", "DEU", "GHA", "GIB", "GRC", "GRL", "GRD", "GLP", "GUM", "GTM", "GGY", "GIN", "GNB", "GUY", "HTI", "HMD", "VAT", "HND", "HKG", "HUN", "ISL", "IND", "IDN", "IRN", "IRQ", "IRL", "IMN", "ISR", "ITA", "JAM", "JPN", "JEY", "JOR", "KAZ", "KEN", "KIR", "PRK", "KOR", "KWT", "KGZ", "LAO", "LVA", "LBN", "LSO", "LBR", "LBY", "LIE", "LTU", "LUX", "MAC", "MDG", "MWI", "MYS", "MDV", "MLI", "MLT", "MHL", "MTQ", "MRT", "MUS", "MYT", "MEX", "FSM", "MDA", "MCO", "MNG", "MNE", "MSR", "MAR", "MOZ", "MMR", "NAM", "NRU", "NPL", "NLD", "NCL", "NZL", "NIC", "NER", "NGA", "NIU", "NFK", "MNP", "NOR", "OMN", "PAK", "PLW", "PAN", "PNG", "PRY", "PER", "PHL", "PCN", "POL", "PRT", "PRI", "QAT", "REU", "ROU", "RUS", "RWA", "BLM", "SHN", "KNA", "LCA", "MAF", "SPM", "VCT", "WSM", "SMR", "STP", "SAU", "SEN", "SRB", "SYC", "SGP", "SXM", "SVK", "SVN", "SLB", "SOM", "ZAF", "SGS", "SSD", "ESP", "LKA", "SDN", "SUR", "SJM", "SWE", "SYR", "TWN", "TJK", "TZA", "THA", "TLS", "TGO", "TKL", "TON", "TTO", "TUN", "TUR", "TKM", "TCA", "TUV", "UGA", "UKR", "ARE", "GBR", "USA", "UMI", "URY", "UZB", "VUT", "VEN", "VNM", "VGB", "VIR", "WLF", "ESH", "YEM", "ZMB", "ZWE"]); const _av10 = new Set(["840", "533", "356", "578", "108", "132", "116", "124", "136", "152", "156", "170", "174", "554", "188", "192", "203", "208", "262", "214", "818", "222", "232", "748", "238", "242", "270", "292", "320", "826", "324", "328", "332", "340", "344", "348", "352", "360", "364", "368", "376", "388", "392", "400", "398", "404", "408", "410", "414", "417", "418", "422", "426", "710", "430", "434", "756", "446", "807", "454", "458", "462", "480", "484", "498", "496", "504", "104", "516", "524", "558", "566", "512", "586", "598", "600", "604", "608", "634", "643", "646", "654", "882", "682", "690", "694", "702", "706", "728", "144", "752", "760", "834", "764", "776", "780", "788", "800", "784", "858", "860", "548", "704", "004", "248", "008", "012", "016", "020", "024", "660", "010", "028", "032", "051", "036", "040", "031", "044", "048", "050", "052", "112", "056", "084", "204", "060", "064", "068", "535", "070", "072", "074", "076", "086", "096", "100", "854", "120", "140", "148", "162", "166", "178", "180", "184", "384", "191", "531", "196", "212", "218", "226", "233", "231", "234", "246", "250", "254", "258", "260", "266", "268", "276", "288", "300", "304", "308", "312", "316", "831", "624", "334", "336", "372", "833", "380", "832", "296", "428", "438", "440", "442", "450", "466", "470", "584", "474", "478", "175", "583", "492", "499", "500", "508", "520", "528", "540", "562", "570", "574", "580", "585", "591", "612", "616", "620", "630", "638", "642", "652", "659", "662", "663", "666", "670", "674", "678", "686", "688", "534", "703", "705", "090", "239", "724", "729", "740", "744", "158", "762", "626", "768", "772", "792", "795", "796", "798", "804", "581", "862", "092", "850", "876", "732", "887", "894", "716"]); const _io0 = input => Array.isArray(input.countryCodes) && input.countryCodes.every(elem => null !== elem && undefined !== elem && (true === _iv2.has(elem) || "object" === typeof elem && null !== elem && _io1(elem))) && ("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_aq(.*)/).test(input.account) || RegExp(/^keeta_ar(.*)/).test(input.account) || RegExp(/^keeta_as(.*)/).test(input.account) || RegExp(/^tyblocks_at(.*)/).test(input.account) || RegExp(/^tyblocks_aq(.*)/).test(input.account) || RegExp(/^tyblocks_ar(.*)/).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))) && ("object" === typeof input.signed && null !== input.signed && _io4(input.signed)); const _io1 = input => true && true === _iv3.has(input.code) && "string" === typeof input.name && true === _iv4.has(input.longCode) && true === _iv5.has(input.numericCode) && "string" === typeof input.dialCode && (undefined === input.region || "object" === typeof input.region && null !== input.region && false === Array.isArray(input.region) && _io2(input.region)); const _io2 = input => (undefined === input.primary || "object" === typeof input.primary && null !== input.primary && _io3(input.primary)) && (undefined === input.subRegion || "object" === typeof input.subRegion && null !== input.subRegion && _io3(input.subRegion)) && (undefined === input.intermediateRegion || "object" === typeof input.intermediateRegion && null !== input.intermediateRegion && _io3(input.intermediateRegion)); const _io3 = input => "string" === typeof input.name && "string" === typeof input.code; const _io4 = input => "string" === typeof input.nonce && "string" === typeof input.timestamp && "string" === typeof input.signature; const _ao0 = (input, _path, _exceptionable = true) => ((Array.isArray(input.countryCodes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
4
4
|
method: "createAssert",
|
|
5
5
|
path: _path + ".countryCodes",
|
|
6
6
|
expected: "Array<CountrySearchInput>",
|
|
@@ -30,7 +30,7 @@ export const assertCreateVerificationRequest = (() => { const _iv2 = new Set(["8
|
|
|
30
30
|
path: _path + ".countryCodes",
|
|
31
31
|
expected: "Array<CountrySearchInput>",
|
|
32
32
|
value: input.countryCodes
|
|
33
|
-
}, _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(/^
|
|
33
|
+
}, _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_aq(.*)/).test(input.account) || RegExp(/^keeta_ar(.*)/).test(input.account) || RegExp(/^keeta_as(.*)/).test(input.account) || RegExp(/^tyblocks_at(.*)/).test(input.account) || RegExp(/^tyblocks_aq(.*)/).test(input.account) || RegExp(/^tyblocks_ar(.*)/).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, {
|
|
34
34
|
method: "createAssert",
|
|
35
35
|
path: _path + ".account",
|
|
36
36
|
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}`)",
|
|
@@ -32,8 +32,8 @@ export const GenericOrganizationIdentificationSchema = {
|
|
|
32
32
|
type: 'struct',
|
|
33
33
|
fieldNames: ['id', 'issuer', 'schemeName'],
|
|
34
34
|
contains: {
|
|
35
|
-
id: { type: '
|
|
36
|
-
issuer: { optional: { type: '
|
|
35
|
+
id: { type: 'string', kind: 'utf8' },
|
|
36
|
+
issuer: { optional: { type: 'string', kind: 'utf8' } },
|
|
37
37
|
schemeName: { optional: OrganizationIdentificationSchemeNameChoiceSchema }
|
|
38
38
|
}
|
|
39
39
|
};
|
|
@@ -42,8 +42,8 @@ export const GenericPersonIdentificationSchema = {
|
|
|
42
42
|
type: 'struct',
|
|
43
43
|
fieldNames: ['id', 'issuer', 'schemeName'],
|
|
44
44
|
contains: {
|
|
45
|
-
id: { type: '
|
|
46
|
-
issuer: { optional: { type: '
|
|
45
|
+
id: { type: 'string', kind: 'utf8' },
|
|
46
|
+
issuer: { optional: { type: 'string', kind: 'utf8' } },
|
|
47
47
|
schemeName: { optional: PersonIdentificationSchemeNameChoiceSchema }
|
|
48
48
|
}
|
|
49
49
|
};
|
|
@@ -52,8 +52,8 @@ export const OtherContactSchema = {
|
|
|
52
52
|
type: 'struct',
|
|
53
53
|
fieldNames: ['channelType', 'id'],
|
|
54
54
|
contains: {
|
|
55
|
-
channelType: { type: '
|
|
56
|
-
id: { optional: { type: '
|
|
55
|
+
channelType: { type: 'string', kind: 'utf8' },
|
|
56
|
+
id: { optional: { type: 'string', kind: 'utf8' } }
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
// Generated ASN.1 schemas for ISO 20022 sequence-of-choice types
|
|
@@ -115,16 +115,16 @@ export const AddressSchema = {
|
|
|
115
115
|
type: 'struct',
|
|
116
116
|
fieldNames: ['addressLines', 'addressType', 'buildingNumber', 'country', 'countrySubDivision', 'department', 'postalCode', 'streetName', 'subDepartment', 'townName'],
|
|
117
117
|
contains: {
|
|
118
|
-
addressLines: { optional: {
|
|
118
|
+
addressLines: { optional: { sequenceOf: { type: 'string', kind: 'utf8' } } },
|
|
119
119
|
addressType: { optional: AddressTypeSchema },
|
|
120
|
-
buildingNumber: { optional: { type: '
|
|
121
|
-
country: { optional: { type: '
|
|
122
|
-
countrySubDivision: { optional: { type: '
|
|
123
|
-
department: { optional: { type: '
|
|
124
|
-
postalCode: { optional: { type: '
|
|
125
|
-
streetName: { optional: { type: '
|
|
126
|
-
subDepartment: { optional: { type: '
|
|
127
|
-
townName: { optional: { type: '
|
|
120
|
+
buildingNumber: { optional: { type: 'string', kind: 'utf8' } },
|
|
121
|
+
country: { optional: { type: 'string', kind: 'utf8' } },
|
|
122
|
+
countrySubDivision: { optional: { type: 'string', kind: 'utf8' } },
|
|
123
|
+
department: { optional: { type: 'string', kind: 'utf8' } },
|
|
124
|
+
postalCode: { optional: { type: 'string', kind: 'utf8' } },
|
|
125
|
+
streetName: { optional: { type: 'string', kind: 'utf8' } },
|
|
126
|
+
subDepartment: { optional: { type: 'string', kind: 'utf8' } },
|
|
127
|
+
townName: { optional: { type: 'string', kind: 'utf8' } }
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
export const DateAndPlaceOfBirthFields = ['birthDate', 'cityOfBirth', 'countryOfBirth', 'provinceOfBirth'];
|
|
@@ -132,10 +132,10 @@ export const DateAndPlaceOfBirthSchema = {
|
|
|
132
132
|
type: 'struct',
|
|
133
133
|
fieldNames: ['birthDate', 'cityOfBirth', 'countryOfBirth', 'provinceOfBirth'],
|
|
134
134
|
contains: {
|
|
135
|
-
birthDate:
|
|
136
|
-
cityOfBirth: { type: '
|
|
137
|
-
countryOfBirth: { type: '
|
|
138
|
-
provinceOfBirth: { optional: { type: '
|
|
135
|
+
birthDate: ASN1.ValidateASN1.IsDate,
|
|
136
|
+
cityOfBirth: { type: 'string', kind: 'utf8' },
|
|
137
|
+
countryOfBirth: { type: 'string', kind: 'utf8' },
|
|
138
|
+
provinceOfBirth: { optional: { type: 'string', kind: 'utf8' } }
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
141
|
export const EntityTypeFields = ['organization', 'person'];
|
|
@@ -143,8 +143,8 @@ export const EntityTypeSchema = {
|
|
|
143
143
|
type: 'struct',
|
|
144
144
|
fieldNames: ['organization', 'person'],
|
|
145
145
|
contains: {
|
|
146
|
-
organization: { optional: {
|
|
147
|
-
person: { optional: {
|
|
146
|
+
organization: { optional: { sequenceOf: GenericOrganizationIdentificationSchema } },
|
|
147
|
+
person: { optional: { sequenceOf: GenericPersonIdentificationSchema } }
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
150
|
export const ContactDetailsFields = ['department', 'emailAddress', 'emailPurpose', 'faxNumber', 'fullName', 'jobResponsibility', 'jobTitle', 'mobileNumber', 'namePrefix', 'other', 'phoneNumber', 'preferredMethod'];
|
|
@@ -152,18 +152,18 @@ export const ContactDetailsSchema = {
|
|
|
152
152
|
type: 'struct',
|
|
153
153
|
fieldNames: ['department', 'emailAddress', 'emailPurpose', 'faxNumber', 'fullName', 'jobResponsibility', 'jobTitle', 'mobileNumber', 'namePrefix', 'other', 'phoneNumber', 'preferredMethod'],
|
|
154
154
|
contains: {
|
|
155
|
-
department: { optional: { type: '
|
|
156
|
-
emailAddress: { optional: { type: '
|
|
157
|
-
emailPurpose: { optional: { type: '
|
|
158
|
-
faxNumber: { optional: { type: '
|
|
159
|
-
fullName: { optional: { type: '
|
|
160
|
-
jobResponsibility: { optional: { type: '
|
|
161
|
-
jobTitle: { optional: { type: '
|
|
162
|
-
mobileNumber: { optional: { type: '
|
|
163
|
-
namePrefix: { optional: { type: '
|
|
164
|
-
other: { optional: {
|
|
165
|
-
phoneNumber: { optional: { type: '
|
|
166
|
-
preferredMethod: { optional: { type: '
|
|
155
|
+
department: { optional: { type: 'string', kind: 'utf8' } },
|
|
156
|
+
emailAddress: { optional: { type: 'string', kind: 'utf8' } },
|
|
157
|
+
emailPurpose: { optional: { type: 'string', kind: 'utf8' } },
|
|
158
|
+
faxNumber: { optional: { type: 'string', kind: 'utf8' } },
|
|
159
|
+
fullName: { optional: { type: 'string', kind: 'utf8' } },
|
|
160
|
+
jobResponsibility: { optional: { type: 'string', kind: 'utf8' } },
|
|
161
|
+
jobTitle: { optional: { type: 'string', kind: 'utf8' } },
|
|
162
|
+
mobileNumber: { optional: { type: 'string', kind: 'utf8' } },
|
|
163
|
+
namePrefix: { optional: { type: 'string', kind: 'utf8' } },
|
|
164
|
+
other: { optional: { sequenceOf: OtherContactSchema } },
|
|
165
|
+
phoneNumber: { optional: { type: 'string', kind: 'utf8' } },
|
|
166
|
+
preferredMethod: { optional: { type: 'string', kind: 'utf8' } }
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
169
|
export const DocumentFields = ['documentNumber', 'front', 'back', 'selfie', 'fullName', 'firstName', 'lastName', 'dob', 'gender', 'address', 'expiresAt', 'issuedAt', 'issuingState', 'issuingCountry', 'refNumber', 'nationality', 'curp', 'claveDeElector', 'classifiedDocumentType', 'curpValidationResponse', 'sambaActivityHistoryResponse'];
|
|
@@ -171,27 +171,27 @@ export const DocumentSchema = {
|
|
|
171
171
|
type: 'struct',
|
|
172
172
|
fieldNames: ['documentNumber', 'front', 'back', 'selfie', 'fullName', 'firstName', 'lastName', 'dob', 'gender', 'address', 'expiresAt', 'issuedAt', 'issuingState', 'issuingCountry', 'refNumber', 'nationality', 'curp', 'claveDeElector', 'classifiedDocumentType', 'curpValidationResponse', 'sambaActivityHistoryResponse'],
|
|
173
173
|
contains: {
|
|
174
|
-
documentNumber: { type: '
|
|
175
|
-
front: { optional:
|
|
176
|
-
back: { optional:
|
|
177
|
-
selfie: { optional:
|
|
178
|
-
fullName: { optional: { type: '
|
|
179
|
-
firstName: { optional: { type: '
|
|
180
|
-
lastName: { optional: { type: '
|
|
181
|
-
dob: { optional:
|
|
182
|
-
gender: { optional: { type: '
|
|
183
|
-
address: { optional:
|
|
184
|
-
expiresAt: { optional:
|
|
185
|
-
issuedAt: { optional:
|
|
186
|
-
issuingState: { optional: { type: '
|
|
187
|
-
issuingCountry: { optional: { type: '
|
|
188
|
-
refNumber: { optional: { type: '
|
|
189
|
-
nationality: { optional: { type: '
|
|
190
|
-
curp: { optional: { type: '
|
|
191
|
-
claveDeElector: { optional: { type: '
|
|
192
|
-
classifiedDocumentType: { optional: { type: '
|
|
193
|
-
curpValidationResponse: { optional: { type: '
|
|
194
|
-
sambaActivityHistoryResponse: { optional: { type: '
|
|
174
|
+
documentNumber: { type: 'string', kind: 'utf8' },
|
|
175
|
+
front: { optional: ReferenceSchema },
|
|
176
|
+
back: { optional: ReferenceSchema },
|
|
177
|
+
selfie: { optional: ReferenceSchema },
|
|
178
|
+
fullName: { optional: { type: 'string', kind: 'utf8' } },
|
|
179
|
+
firstName: { optional: { type: 'string', kind: 'utf8' } },
|
|
180
|
+
lastName: { optional: { type: 'string', kind: 'utf8' } },
|
|
181
|
+
dob: { optional: ASN1.ValidateASN1.IsDate },
|
|
182
|
+
gender: { optional: { type: 'string', kind: 'utf8' } },
|
|
183
|
+
address: { optional: AddressSchema },
|
|
184
|
+
expiresAt: { optional: ASN1.ValidateASN1.IsDate },
|
|
185
|
+
issuedAt: { optional: ASN1.ValidateASN1.IsDate },
|
|
186
|
+
issuingState: { optional: { type: 'string', kind: 'utf8' } },
|
|
187
|
+
issuingCountry: { optional: { type: 'string', kind: 'utf8' } },
|
|
188
|
+
refNumber: { optional: { type: 'string', kind: 'utf8' } },
|
|
189
|
+
nationality: { optional: { type: 'string', kind: 'utf8' } },
|
|
190
|
+
curp: { optional: { type: 'string', kind: 'utf8' } },
|
|
191
|
+
claveDeElector: { optional: { type: 'string', kind: 'utf8' } },
|
|
192
|
+
classifiedDocumentType: { optional: { type: 'string', kind: 'utf8' } },
|
|
193
|
+
curpValidationResponse: { optional: { type: 'string', kind: 'utf8' } },
|
|
194
|
+
sambaActivityHistoryResponse: { optional: { type: 'string', kind: 'utf8' } }
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
197
|
export const CertificateAttributeOIDDB = {
|