@keetanetwork/anchor 0.0.39 → 0.0.40
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/client/index.d.ts +6 -0
- package/client/index.d.ts.map +1 -1
- package/client/index.js +7 -0
- package/client/index.js.map +1 -1
- package/lib/block-listener.d.ts +93 -0
- package/lib/block-listener.d.ts.map +1 -0
- package/lib/block-listener.js +259 -0
- package/lib/block-listener.js.map +1 -0
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +3 -1
- package/lib/error.js.map +1 -1
- package/lib/http-server/index.d.ts +14 -1
- package/lib/http-server/index.d.ts.map +1 -1
- package/lib/http-server/index.js +86 -7
- package/lib/http-server/index.js.map +1 -1
- package/lib/queue/index.d.ts +20 -5
- package/lib/queue/index.d.ts.map +1 -1
- package/lib/queue/index.js +52 -17
- package/lib/queue/index.js.map +1 -1
- package/lib/resolver.d.ts +57 -0
- package/lib/resolver.d.ts.map +1 -1
- package/lib/resolver.js +864 -250
- package/lib/resolver.js.map +1 -1
- package/npm-shrinkwrap.json +4 -4
- package/package.json +1 -1
- package/services/asset-movement/client.d.ts +9 -2
- package/services/asset-movement/client.d.ts.map +1 -1
- package/services/asset-movement/client.js +35 -2
- package/services/asset-movement/client.js.map +1 -1
- package/services/asset-movement/common.d.ts +1 -0
- package/services/asset-movement/common.d.ts.map +1 -1
- package/services/asset-movement/common.js +75 -0
- package/services/asset-movement/common.js.map +1 -1
- package/services/fx/common.d.ts +1 -1
- package/services/fx/common.js.map +1 -1
- package/services/fx/server.d.ts +37 -6
- package/services/fx/server.d.ts.map +1 -1
- package/services/fx/server.js +207 -66
- package/services/fx/server.js.map +1 -1
- package/services/storage/client.d.ts +322 -0
- package/services/storage/client.d.ts.map +1 -0
- package/services/storage/client.js +1058 -0
- package/services/storage/client.js.map +1 -0
- package/services/storage/common.d.ts +653 -0
- package/services/storage/common.d.ts.map +1 -0
- package/services/storage/common.generated.d.ts +17 -0
- package/services/storage/common.generated.d.ts.map +1 -0
- package/services/storage/common.generated.js +863 -0
- package/services/storage/common.generated.js.map +1 -0
- package/services/storage/common.js +587 -0
- package/services/storage/common.js.map +1 -0
- package/services/storage/lib/validators.d.ts +64 -0
- package/services/storage/lib/validators.d.ts.map +1 -0
- package/services/storage/lib/validators.js +82 -0
- package/services/storage/lib/validators.js.map +1 -0
- package/services/storage/server.d.ts +127 -0
- package/services/storage/server.d.ts.map +1 -0
- package/services/storage/server.js +626 -0
- package/services/storage/server.js.map +1 -0
- package/services/storage/test-utils.d.ts +70 -0
- package/services/storage/test-utils.d.ts.map +1 -0
- package/services/storage/test-utils.js +347 -0
- package/services/storage/test-utils.js.map +1 -0
- package/services/storage/utils.d.ts +3 -0
- package/services/storage/utils.d.ts.map +1 -0
- package/services/storage/utils.js +10 -0
- package/services/storage/utils.js.map +1 -0
- package/services/username/client.d.ts +145 -0
- package/services/username/client.d.ts.map +1 -0
- package/services/username/client.js +681 -0
- package/services/username/client.js.map +1 -0
- package/services/username/common.d.ts +136 -0
- package/services/username/common.d.ts.map +1 -0
- package/services/username/common.generated.d.ts +13 -0
- package/services/username/common.generated.d.ts.map +1 -0
- package/services/username/common.generated.js +256 -0
- package/services/username/common.generated.js.map +1 -0
- package/services/username/common.js +226 -0
- package/services/username/common.js.map +1 -0
- package/services/username/server.d.ts +51 -0
- package/services/username/server.d.ts.map +1 -0
- package/services/username/server.js +264 -0
- package/services/username/server.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/services/username/client.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,GAAG,IAAI,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAKrD,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,gBAAgB,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AC1D,MAAK,CAAC,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAC1C,CAAC;QAED,OAAM,CAAC;YACN,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;SACnB,CAAC,CAAC;IACJ,CAAC;CACD;AAED,eAAe,yBAAyB,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,CAAC","sourcesContent":["import { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';\nimport { getDefaultResolver } from '../../config.js';\nimport type {\n\tUserClient as KeetaNetUserClient\n} from '@keetanetwork/keetanet-client';\nimport type { Logger } from '../../lib/log/index.ts';\nimport Resolver from '../../lib/resolver.js';\nimport type { ServiceMetadata, ServiceMetadataAuthenticationType, ServiceMetadataEndpoint, ServiceSearchCriteria, SharedLookupCriteria } from '../../lib/resolver.ts';\nimport { createAssertEquals } from 'typia';\nimport type { BrandedString } from '../../lib/utils/brand.ts';\nimport { KeetaAnchorError, KeetaAnchorUserValidationError } from '../../lib/error.js';\nimport { SignData } from '../../lib/utils/signing.js';\nimport type {\n\tTransferUsernameOwnershipSignablePayload,\n\tKeetaUsernameAnchorClaimRequestPayload,\n\tKeetaUsernameAnchorUsernameWithAccount,\n\tKeetaUsernameAnchorSearchRequestParameters,\n\tKeetaUsernameAnchorResolveResponseJSON\n} from './common.js';\nimport {\n\tisKeetaUsernameAnchorResolveResponseJSON,\n\tisKeetaUsernameAnchorClaimResponseJSON,\n\tparseGloballyIdentifiableUsername,\n\tgetUsernameClaimSignable,\n\tvalidateUsernameDefault,\n\ttype KeetaNetAccount,\n\ttype GloballyIdentifiableUsername,\n\tisGloballyIdentifiableUsername,\n\tisKeetaNetPublicKeyString,\n\tErrors,\n\tgetUsernameTransferSignable,\n\tgetUsernameReleaseSignable,\n\tisKeetaUsernameAnchorReleaseResponseJSON,\n\tformatGloballyIdentifiableUsername,\n\tisKeetaUsernameAnchorSearchResponseJSON\n} from './common.js';\nimport type { ExtractOk, HTTPSignedField } from '../../lib/http-server/common.js';\nimport { assertNever } from '../../lib/utils/never.js';\n\nexport type KeetaUsernameAnchorClientConfig = {\n\tid?: string;\n\tlogger?: Logger | undefined;\n\tresolver?: Resolver;\n\tsigner?: InstanceType<typeof KeetaNetLib.Account>;\n\taccount?: InstanceType<typeof KeetaNetLib.Account>;\n} & Omit<NonNullable<Parameters<typeof getDefaultResolver>[1]>, 'client'>;\n\ntype ProviderID = BrandedString<'UsernameProviderID'>;\n\nconst KeetaUsernameAnchorClientAccessToken = Symbol('KeetaUsernameAnchorClientAccessToken');\n\nconst assertServiceMetadataEndpoint = createAssertEquals<ServiceMetadataEndpoint>();\n\nfunction typedUsernameServiceEntries<T extends object>(obj: T): [keyof T, T[keyof T]][] {\n\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\treturn(Object.entries(obj) as [keyof T, T[keyof T]][]);\n}\n\ntype KeetaUsernameAnchorOperations = {\n\t[operation in keyof NonNullable<ServiceMetadata['services']['username']>[string]['operations']]?: {\n\t\turl: (params?: { [key: string]: string; }) => URL;\n\t\toptions: {\n\t\t\tauthentication: ServiceMetadataAuthenticationType;\n\t\t};\n\t};\n};\n\ntype KeetaUsernameServiceInfo = {\n\toperations: {\n\t\t[operation in keyof KeetaUsernameAnchorOperations]: Promise<KeetaUsernameAnchorOperations[operation]>;\n\t};\n\tusernamePattern?: string;\n};\n\ntype GetEndpointsResult = {\n\t[id in ProviderID]: KeetaUsernameServiceInfo;\n};\n\n\ntype ClaimUsernameOptions = {\n\taccount?: KeetaNetAccount | undefined;\n\ttransfer?: {\n\t\tfrom: KeetaNetAccount | string;\n\t\tsigned?: HTTPSignedField;\n\t};\n};\n\nfunction validateURL(url: string | undefined): URL {\n\tif (!url) {\n\t\tthrow(new Error('Invalid URL: empty value'));\n\t}\n\n\treturn(new URL(url));\n}\n\nasync function getEndpoints(resolver: Resolver, criteria: ServiceSearchCriteria<'username'>, shared?: SharedLookupCriteria, logger?: Logger): Promise<GetEndpointsResult | null> {\n\tconst response = await resolver.lookup('username', criteria, shared);\n\tif (response === undefined) {\n\t\treturn(null);\n\t}\n\n\tconst serviceInfoPromises = Object.entries(response).map(async function([id, serviceInfo]): Promise<[ProviderID, KeetaUsernameServiceInfo]> {\n\t\tconst operations = await serviceInfo.operations('object');\n\t\tconst operationsFunctions: Partial<KeetaUsernameServiceInfo['operations']> = {};\n\t\tfor (const [key, operation] of Object.entries(operations)) {\n\t\t\tif (operation === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tObject.defineProperty(operationsFunctions, key, {\n\t\t\t\tget: async function() {\n\t\t\t\t\tconst endpoint = assertServiceMetadataEndpoint(await Resolver.Metadata.fullyResolveValuizable(operation));\n\n\t\t\t\t\tlet url: string;\n\t\t\t\t\tlet authentication: ServiceMetadataAuthenticationType = {\n\t\t\t\t\t\tmethod: 'keeta-account',\n\t\t\t\t\t\ttype: 'none'\n\t\t\t\t\t};\n\n\t\t\t\t\tif (typeof endpoint === 'string') {\n\t\t\t\t\t\turl = endpoint;\n\t\t\t\t\t} else {\n\t\t\t\t\t\turl = endpoint.url;\n\t\t\t\t\t\tif (endpoint.options?.authentication) {\n\t\t\t\t\t\t\tauthentication = endpoint.options.authentication;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn({\n\t\t\t\t\t\turl: function(params?: { [key: string]: string; }): URL {\n\t\t\t\t\t\t\tlet substitutedURL: string;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tsubstitutedURL = decodeURI(url);\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\tlogger?.debug('UsernameAnchor:getEndpoints', 'Failed to decode URI, using original URL for substitution', error, url);\n\t\t\t\t\t\t\t\tsubstitutedURL = url;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfor (const [paramKey, paramValue] of Object.entries(params ?? {})) {\n\t\t\t\t\t\t\t\tsubstitutedURL = substitutedURL.replace(`{${paramKey}}`, encodeURIComponent(paramValue));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn(validateURL(substitutedURL));\n\t\t\t\t\t\t},\n\t\t\t\t\t\toptions: { authentication }\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true\n\t\t\t});\n\t\t}\n\n\t\tif (!Object.prototype.hasOwnProperty.call(operationsFunctions, 'resolve')) {\n\t\t\tthrow(new Error('Username service is missing resolve operation'));\n\t\t}\n\n\t\treturn([\n\t\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t\tid as unknown as ProviderID,\n\t\t\t{\n\t\t\t\toperations: operationsFunctions,\n\t\t\t\t...(await (async () => {\n\t\t\t\t\tconst pattern = await serviceInfo.usernamePattern?.('string');\n\t\t\t\t\tif (pattern !== undefined) {\n\t\t\t\t\t\treturn({ usernamePattern: pattern });\n\t\t\t\t\t}\n\n\t\t\t\t\treturn({});\n\t\t\t\t})())\n\t\t\t}\n\t\t]);\n\t});\n\n\tif (serviceInfoPromises.length === 0) {\n\t\treturn(null);\n\t}\n\n\tconst entries = await Promise.all(serviceInfoPromises);\n\n\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\treturn(Object.fromEntries(entries) as GetEndpointsResult);\n}\n\ninterface KeetaUsernameAnchorBaseConfig {\n\tclient: KeetaNetUserClient;\n\tlogger?: Logger | undefined;\n\taccount?: InstanceType<typeof KeetaNetLib.Account> | undefined;\n\tsigner?: InstanceType<typeof KeetaNetLib.Account> | undefined;\n}\n\nclass KeetaUsernameAnchorBase {\n\tprotected readonly client: KeetaNetUserClient;\n\tprotected readonly logger?: Logger | undefined;\n\tprotected readonly account?: InstanceType<typeof KeetaNetLib.Account> | undefined;\n\tprotected readonly signer?: InstanceType<typeof KeetaNetLib.Account> | undefined;\n\n\tconstructor(config: KeetaUsernameAnchorBaseConfig) {\n\t\tthis.client = config.client;\n\t\tthis.logger = config.logger;\n\t\tthis.account = config.account;\n\t\tthis.signer = config.signer;\n\t}\n}\n\nexport interface KeetaUsernameAnchorUsernameWithAccountAndProvider extends KeetaUsernameAnchorUsernameWithAccount {\n\tproviderID: ProviderID;\n\tgloballyIdentifiableUsername: GloballyIdentifiableUsername;\n}\n\nclass KeetaUsernameAnchorProvider extends KeetaUsernameAnchorBase {\n\treadonly serviceInfo: KeetaUsernameServiceInfo;\n\treadonly providerID: ProviderID;\n\treadonly #usernamePattern?: RegExp;\n\tprivate readonly parent: KeetaUsernameAnchorClient;\n\n\tconstructor(serviceInfo: KeetaUsernameServiceInfo, providerID: ProviderID, parent: KeetaUsernameAnchorClient) {\n\t\tconst parentInternals = parent._internals(KeetaUsernameAnchorClientAccessToken);\n\t\tsuper(parentInternals);\n\n\t\tthis.serviceInfo = serviceInfo;\n\t\tthis.providerID = providerID;\n\t\tthis.parent = parent;\n\t\tif (serviceInfo.usernamePattern !== undefined) {\n\t\t\ttry {\n\t\t\t\tthis.#usernamePattern = new RegExp(serviceInfo.usernamePattern);\n\t\t\t} catch (error) {\n\t\t\t\tthrow(new Error(`Invalid usernamePattern metadata for provider ${String(providerID)}: ${error instanceof Error ? error.message : String(error)}`));\n\t\t\t}\n\t\t}\n\t}\n\n\tget usernamePattern(): string | undefined {\n\t\treturn(this.#usernamePattern?.source);\n\t}\n\n\t/**\n\t * Check if a username is valid according to the provider's username pattern if set and default validation.\n\t * @param username The username to check\n\t * @returns True if the username is valid, false otherwise\n\t */\n\tisUsernameValid(username: string): boolean {\n\t\ttry {\n\t\t\tvalidateUsernameDefault(username, {\n\t\t\t\tpattern: this.#usernamePattern,\n\t\t\t\tfieldPath: 'username'\n\t\t\t});\n\t\t\treturn(true);\n\t\t} catch (error) {\n\t\t\tif (error instanceof KeetaAnchorUserValidationError) {\n\t\t\t\treturn(false);\n\t\t\t}\n\n\t\t\tthrow(error);\n\t\t}\n\t}\n\n\t#assertProviderIssuedNameValid(username: string): void {\n\t\tvalidateUsernameDefault(username, {\n\t\t\tpattern: this.#usernamePattern,\n\t\t\tfieldPath: 'username'\n\t\t});\n\t}\n\n\tasync #getOperation<Name extends keyof KeetaUsernameAnchorOperations>(operationName: Name): Promise<NonNullable<KeetaUsernameAnchorOperations[Name]>> {\n\t\tconst operationGetter = this.serviceInfo.operations[operationName];\n\t\tif (operationGetter === undefined) {\n\t\t\tthrow(new Error(`Username provider does not support ${operationName} operation`));\n\t\t}\n\n\t\tconst endpoint = await operationGetter;\n\t\tif (endpoint === undefined) {\n\t\t\tthrow(new Error(`Username provider does not support ${operationName} operation`));\n\t\t}\n\n\t\tif (endpoint.options.authentication.method !== 'keeta-account') {\n\t\t\tthrow(new Error(`Unsupported authentication method: ${endpoint.options.authentication.method}`));\n\t\t}\n\n\t\treturn(endpoint);\n\t}\n\n\tasync #parseResponseError(data: unknown): Promise<Error> {\n\t\ttry {\n\t\t\treturn(await KeetaAnchorError.fromJSON(data));\n\t\t} catch (error) {\n\t\t\tthis.logger?.debug('UsernameAnchor', 'Failed to parse error response', error, data);\n\n\t\t\tif (typeof data === 'object' && data !== null && 'error' in data && typeof data.error === 'string') {\n\t\t\t\treturn(new Error(data.error));\n\t\t\t}\n\n\t\t\treturn(new Error('Username provider request failed'));\n\t\t}\n\t}\n\n\t#toKeetaUsernameAnchorUsernameWithAccountAndProvider(response: Pick<ExtractOk<KeetaUsernameAnchorResolveResponseJSON>, 'username' | 'account'>): KeetaUsernameAnchorUsernameWithAccountAndProvider {\n\t\treturn({\n\t\t\taccount: KeetaNetLib.Account.toAccount(response.account),\n\t\t\tusername: response.username,\n\t\t\tproviderID: this.providerID,\n\t\t\tgloballyIdentifiableUsername: formatGloballyIdentifiableUsername(response.username, String(this.providerID))\n\t\t});\n\t}\n\n\t/**\n\t * Resolve a username for a specific provider\n\t * @param input The value to lookup, can be a username, PublicKeyString, or an account\n\t * @returns The resolved account and username, or null if not found\n\t */\n\tasync resolve(input: string | KeetaNetAccount): Promise<KeetaUsernameAnchorUsernameWithAccountAndProvider | null> {\n\t\tlet toResolveString;\n\t\tif (typeof input === 'string') {\n\t\t\ttoResolveString = input;\n\t\t} else {\n\t\t\ttoResolveString = input.publicKeyString.get();\n\t\t}\n\t\tif (!(isKeetaNetPublicKeyString(toResolveString))) {\n\t\t\tthis.#assertProviderIssuedNameValid(toResolveString);\n\t\t}\n\n\t\tconst endpoint = await this.#getOperation('resolve');\n\t\tif (endpoint.options.authentication.type === 'required') {\n\t\t\tthrow(new Error('Username provider requires authentication which is not supported by the client'));\n\t\t}\n\n\t\tconst serviceURL = endpoint.url({ toResolve: toResolveString });\n\t\tconst response = await fetch(serviceURL);\n\n\t\tlet responseJSON: unknown;\n\t\ttry {\n\t\t\tresponseJSON = await response.json();\n\t\t} catch (error) {\n\t\t\tthrow(new Error(`Failed to parse username provider response as JSON: ${error}`));\n\t\t}\n\n\t\tif (!isKeetaUsernameAnchorResolveResponseJSON(responseJSON)) {\n\t\t\tthrow(new Error('Invalid response from username provider'));\n\t\t}\n\n\t\tif (!responseJSON.ok) {\n\t\t\tconst responseError = await this.#parseResponseError(responseJSON);\n\n\t\t\tif (Errors.UserNotFound.isInstance(responseError)) {\n\t\t\t\treturn(null);\n\t\t\t}\n\n\t\t\tthrow(responseError);\n\t\t}\n\n\t\tconst retval = this.#toKeetaUsernameAnchorUsernameWithAccountAndProvider(responseJSON);\n\n\t\tif (isKeetaNetPublicKeyString(toResolveString)) {\n\t\t\tif (!(retval.account.comparePublicKey(toResolveString))) {\n\t\t\t\tthrow(new Error('Resolved account does not match the requested account'));\n\t\t\t}\n\t\t} else {\n\t\t\tif (retval.username !== toResolveString) {\n\t\t\t\tthrow(new Error('Resolved username does not match the requested username'));\n\t\t\t}\n\t\t}\n\n\t\treturn(retval);\n\t}\n\n\t/**\n\t * Claim a username for a specific provider\n\t * @param usernameInput The username to claim\n\t * @param options The account to claim for, and options related to transfer if applicable\n\t * @returns True if the claim was successful, false otherwise\n\t */\n\tasync claimUsername(usernameInput: string, options?: ClaimUsernameOptions): Promise<boolean> {\n\t\tlet username: string;\n\t\tif (isGloballyIdentifiableUsername(usernameInput)) {\n\t\t\tconst parsed = parseGloballyIdentifiableUsername(usernameInput);\n\t\t\tif (parsed.providerID !== String(this.providerID)) {\n\t\t\t\tthrow(new Error(`Provider ID in username input does not match this provider's ID`));\n\t\t\t}\n\n\t\t\tusername = parsed.username;\n\t\t} else {\n\t\t\tusername = usernameInput;\n\t\t}\n\n\t\tthis.#assertProviderIssuedNameValid(username);\n\n\t\tconst endpoint = await this.#getOperation('claim');\n\n\t\tif (endpoint.options.authentication.type === 'none') {\n\t\t\tthrow(new Error('Username claim operation must require account authentication'));\n\t\t}\n\n\t\tconst accountToUse = options?.account ?? this.account ?? this.signer;\n\t\tif (!accountToUse) {\n\t\t\tthrow(new Error('Account is required to claim a username'));\n\t\t}\n\n\t\tconst request: KeetaUsernameAnchorClaimRequestPayload = {\n\t\t\tusername,\n\t\t\taccount: accountToUse\n\t\t}\n\n\t\tif (options?.transfer) {\n\t\t\tconst from = KeetaNetLib.Account.toAccount(options.transfer.from);\n\n\t\t\tlet signed = options.transfer.signed;\n\n\t\t\tif (!signed) {\n\t\t\t\tif (!from.hasPrivateKey) {\n\t\t\t\t\tthrow(new Error('Transfer \"from\" account must have a private key when signature is not provided'));\n\t\t\t\t}\n\n\t\t\t\tconst signable = getUsernameTransferSignable({\n\t\t\t\t\tusername,\n\t\t\t\t\tfrom: from,\n\t\t\t\t\tto: accountToUse\n\t\t\t\t});\n\n\t\t\t\tsigned = await SignData(from.assertAccount(), signable);\n\t\t\t}\n\n\t\t\trequest.transfer = { from, signed };\n\t\t}\n\n\t\tconst signed = await SignData(accountToUse.assertAccount(), getUsernameClaimSignable(request));\n\n\t\tconst response = await fetch(endpoint.url(), {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'Accept': 'application/json'\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tusername: username,\n\t\t\t\taccount: accountToUse.publicKeyString.get(),\n\t\t\t\ttransfer: request.transfer ? {\n\t\t\t\t\tfrom: request.transfer.from.publicKeyString.get(),\n\t\t\t\t\tsigned: request.transfer.signed\n\t\t\t\t} : undefined,\n\t\t\t\tsigned\n\t\t\t})\n\t\t});\n\n\t\tlet responseJSON: unknown;\n\t\ttry {\n\t\t\tresponseJSON = await response.json();\n\t\t} catch (error) {\n\t\t\tthrow(new Error(`Failed to parse username claim response as JSON: ${error}`));\n\t\t}\n\n\t\tif (!isKeetaUsernameAnchorClaimResponseJSON(responseJSON)) {\n\t\t\tthrow(new Error('Invalid response from username provider claim endpoint'));\n\t\t}\n\n\t\tif (!responseJSON.ok) {\n\t\t\tthrow(await this.#parseResponseError(responseJSON));\n\t\t}\n\n\t\treturn(responseJSON.ok);\n\t}\n\n\t/**\n\t * Release a username for a specific provider\n\t * @param options The account to claim for, and options related to transfer if applicable\n\t * @returns True if the claim was successful, false otherwise\n\t */\n\tasync releaseUsername(input?: { account?: KeetaNetAccount; }): Promise<boolean> {\n\t\tconst endpoint = await this.#getOperation('release');\n\n\t\tif (endpoint.options.authentication.type === 'none') {\n\t\t\tthrow(new Error('Username claim operation must require account authentication'));\n\t\t}\n\n\t\tconst accountToUse = input?.account ?? this.account ?? this.signer;\n\t\tif (!accountToUse) {\n\t\t\tthrow(new Error('Account is required to claim a username'));\n\t\t}\n\n\t\tconst signed = await SignData(accountToUse.assertAccount(), getUsernameReleaseSignable({ account: accountToUse }));\n\n\t\tconst response = await fetch(endpoint.url(), {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'Accept': 'application/json'\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\taccount: accountToUse.publicKeyString.get(),\n\t\t\t\tsigned\n\t\t\t})\n\t\t});\n\n\t\tlet responseJSON: unknown;\n\t\ttry {\n\t\t\tresponseJSON = await response.json();\n\t\t} catch (error) {\n\t\t\tthrow(new Error(`Failed to parse username claim response as JSON: ${error}`));\n\t\t}\n\n\t\tif (!isKeetaUsernameAnchorReleaseResponseJSON(responseJSON)) {\n\t\t\tthrow(new Error('Invalid response from username provider claim endpoint'));\n\t\t}\n\n\t\tif (!responseJSON.ok) {\n\t\t\tthrow(await this.#parseResponseError(responseJSON));\n\t\t}\n\n\t\treturn(responseJSON.ok);\n\t}\n\n\t/**\n\t * Release a username for a specific provider\n\t * @param options The account to claim for, and options related to transfer if applicable\n\t * @returns True if the claim was successful, false otherwise\n\t */\n\tasync search(parameters: KeetaUsernameAnchorSearchRequestParameters): Promise<{ results: KeetaUsernameAnchorUsernameWithAccountAndProvider[]; }> {\n\t\tconst endpoint = await this.#getOperation('search');\n\n\t\tif (endpoint.options.authentication.type !== 'none') {\n\t\t\tthrow(new Error('Username search operation does not currently support authenticated endpoints'));\n\t\t}\n\n\t\tconst urlWithParameters = (() => {\n\t\t\tconst reconstructed = new URL(endpoint.url().toString());\n\t\t\treconstructed.searchParams.set('search', parameters.search);\n\t\t\treturn(reconstructed);\n\t\t})();\n\n\t\tconst response = await fetch(urlWithParameters, {\n\t\t\tmethod: 'GET',\n\t\t\theaders: { 'Accept': 'application/json' }\n\t\t});\n\n\t\tlet responseJSON: unknown;\n\t\ttry {\n\t\t\tresponseJSON = await response.json();\n\t\t} catch (error) {\n\t\t\tthrow(new Error(`Failed to parse username claim response as JSON: ${error}`));\n\t\t}\n\n\t\tif (!isKeetaUsernameAnchorSearchResponseJSON(responseJSON)) {\n\t\t\tthrow(new Error('Invalid response from username provider claim endpoint'));\n\t\t}\n\n\t\tif (!responseJSON.ok) {\n\t\t\tthrow(await this.#parseResponseError(responseJSON));\n\t\t}\n\n\t\tconst results = responseJSON.results.map((result) => {\n\t\t\tthis.#assertProviderIssuedNameValid(result.username);\n\n\t\t\treturn(this.#toKeetaUsernameAnchorUsernameWithAccountAndProvider(result));\n\t\t});\n\n\t\treturn({ results });\n\t}\n}\n\nclass KeetaUsernameAnchorClient extends KeetaUsernameAnchorBase {\n\treadonly resolver: Resolver;\n\treadonly id: string;\n\n\tconstructor(client: KeetaNetUserClient, config: KeetaUsernameAnchorClientConfig = {}) {\n\t\tsuper({ client, logger: config.logger, account: config.account, signer: config.signer });\n\t\tthis.resolver = config.resolver ?? getDefaultResolver(client, config);\n\t\tthis.id = config.id ?? crypto.randomUUID();\n\t}\n\n\tasync #lookup(criteria: ServiceSearchCriteria<'username'> = {}, shared?: SharedLookupCriteria): Promise<KeetaUsernameAnchorProvider[] | null> {\n\t\tconst endpoints = await getEndpoints(this.resolver, criteria, shared, this.logger);\n\t\tif (endpoints === null) {\n\t\t\treturn(null);\n\t\t}\n\n\t\tconst providers = typedUsernameServiceEntries(endpoints).map(([providerID, serviceInfo]) => {\n\t\t\treturn(new KeetaUsernameAnchorProvider(serviceInfo, providerID, this));\n\t\t});\n\n\t\tif (providers.length === 0) {\n\t\t\treturn(null);\n\t\t}\n\n\t\treturn(providers);\n\t}\n\n\tasync getProvider(providerID: string, shared?: SharedLookupCriteria): Promise<KeetaUsernameAnchorProvider | null> {\n\t\tconst mergedSharedCriteria: SharedLookupCriteria = {\n\t\t\t...shared,\n\t\t\tproviderIDs: shared?.providerIDs !== undefined ? Array.from(new Set([...shared.providerIDs, providerID])) : [providerID]\n\t\t};\n\t\tconst providers = await this.#lookup({}, mergedSharedCriteria);\n\t\treturn(providers?.[0] ?? null);\n\t}\n\n\tasync #requireProvider(providerID: string, shared?: SharedLookupCriteria): Promise<KeetaUsernameAnchorProvider> {\n\t\tconst provider = await this.getProvider(providerID, shared);\n\t\tif (!provider) {\n\t\t\tthrow(new Error(`Username provider ${providerID} not found`));\n\t\t}\n\n\t\treturn(provider);\n\t}\n\n\t/**\n\t * Resolve a globally identifiable username via the appropriate provider.\n\t * @param username The globally identifiable username to resolve\n\t * @param shared Shared resolver lookup criteria\n\t * @returns The resolution result, or null if not found\n\t */\n\tasync resolve(username: GloballyIdentifiableUsername, shared?: SharedLookupCriteria): ReturnType<KeetaUsernameAnchorProvider['resolve']> {\n\t\tconst { username: normalizedUsername, providerID } = parseGloballyIdentifiableUsername(username);\n\t\tconst provider = await this.#requireProvider(providerID, shared);\n\n\t\treturn(await provider.resolve(normalizedUsername));\n\t}\n\n\t/**\n\t * Resolve against all username providers for the given input.\n\t * @param input The value to search for, either a globally identifiable username, a username, or an account\n\t * @param shared Shared lookup criteria\n\t * @returns A mapping of provider IDs to their resolution results, or null if no providers found a match\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n\tasync resolveMulti(input: string | KeetaNetAccount | GloballyIdentifiableUsername, shared?: SharedLookupCriteria): Promise<({\n\t\t[providerId: ProviderID]: Awaited<ReturnType<KeetaUsernameAnchorProvider['resolve']>>;\n\t}) | null> {\n\t\tif (isGloballyIdentifiableUsername(input)) {\n\t\t\tconst { providerID } = parseGloballyIdentifiableUsername(input);\n\t\t\tconst resolved = await this.resolve(input, shared);\n\t\t\tif (!resolved) {\n\t\t\t\treturn(null);\n\t\t\t}\n\n\t\t\treturn({\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t\t\t[providerID as unknown as ProviderID]: resolved\n\t\t\t});\n\t\t}\n\n\t\tconst providers = await this.#lookup({}, shared);\n\n\t\tif (!providers) {\n\t\t\treturn(null);\n\t\t}\n\n\t\tlet foundOne = false;\n\t\tconst response: {\n\t\t\t[providerId: ProviderID]: NonNullable<Awaited<ReturnType<KeetaUsernameAnchorProvider['resolve']>>>;\n\t\t} = {};\n\n\t\tawait Promise.all(providers.map(async (provider) => {\n\t\t\ttry {\n\t\t\t\tconst result = await provider.resolve(input);\n\t\t\t\tif (result !== null) {\n\t\t\t\t\tfoundOne = true;\n\t\t\t\t\tresponse[provider.providerID] = result;\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tthis.logger?.debug('UsernameAnchor:resolveMulti', `Error resolving username with provider ${String(provider.providerID)}`, error);\n\t\t\t}\n\t\t}));\n\n\t\tif (!foundOne) {\n\t\t\treturn(null);\n\t\t}\n\n\t\treturn(response);\n\t}\n\n\t/**\n\t * Resolve against all username providers for the given input.\n\t * @param input The value to search for, either a globally identifiable username, a username, or an account\n\t * @param shared Shared lookup criteria\n\t * @returns A mapping of provider IDs to their resolution results, or null if no providers found a match\n\t */\n\n\tasync search(parameters: KeetaUsernameAnchorSearchRequestParameters, responseType: 'separate', shared?: SharedLookupCriteria): Promise<({ [providerId: ProviderID]: Awaited<ReturnType<KeetaUsernameAnchorProvider['search']>>; }) | null>;\n\tasync search(parameters: KeetaUsernameAnchorSearchRequestParameters, responseType?: 'joined', shared?: SharedLookupCriteria): Promise<Awaited<ReturnType<KeetaUsernameAnchorProvider['search']>> | null>;\n\tasync search(parameters: KeetaUsernameAnchorSearchRequestParameters, responseType: 'joined' | 'separate' = 'joined', shared?: SharedLookupCriteria) {\n\t\tconst providers = await this.#lookup({}, shared);\n\n\t\tif (!providers) {\n\t\t\treturn(null);\n\t\t}\n\n\t\tconst response: {\n\t\t\t[providerId: ProviderID]: NonNullable<Awaited<ReturnType<KeetaUsernameAnchorProvider['search']>>>;\n\t\t} = {};\n\n\t\tawait Promise.all(providers.map(async (provider) => {\n\t\t\ttry {\n\t\t\t\tresponse[provider.providerID] = await provider.search(parameters);\n\t\t\t} catch (error) {\n\t\t\t\tthis.logger?.debug('UsernameAnchor:search', `Error resolving username with provider ${String(provider.providerID)}`, error);\n\t\t\t}\n\t\t}));\n\n\t\tif (responseType === 'separate') {\n\t\t\treturn(response);\n\t\t} else if (responseType === 'joined') {\n\t\t\tconst joinedResults: KeetaUsernameAnchorUsernameWithAccountAndProvider[] = [];\n\t\t\tfor (const providerResponse of Object.values(response)) {\n\t\t\t\t// For some reason TypeScript loses the type information here, even though it is correctly inferred in the loop above. We have to manually assert the type to get the correct typings for results.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t\t\tconst results = (providerResponse as typeof response[keyof typeof response]).results;\n\t\t\t\tjoinedResults.push(...results);\n\t\t\t}\n\n\t\t\treturn({ results: joinedResults });\n\t\t} else {\n\t\t\tassertNever(responseType);\n\t\t}\n\t}\n\n\t/**\n\t * Claim a globally identifiable username from the appropriate provider.\n\t * @param input The globally identifiable username to claim\n\t * @param options Claim options\n\t * @returns True if the claim was successful, false otherwise\n\t */\n\tasync claimUsername(input: GloballyIdentifiableUsername, options?: ClaimUsernameOptions, shared?: SharedLookupCriteria): ReturnType<KeetaUsernameAnchorProvider['claimUsername']> {\n\t\tconst { username, providerID } = parseGloballyIdentifiableUsername(input);\n\t\tconst provider = await this.#requireProvider(providerID, shared);\n\t\treturn(await provider.claimUsername(username, options));\n\t}\n\n\tasync signUsernameTransfer(request: Omit<TransferUsernameOwnershipSignablePayload, 'from'>, from?: KeetaNetAccount): Promise<HTTPSignedField> {\n\t\tconst accountToUse = from ?? this.signer ?? this.account;\n\t\tif (!accountToUse) {\n\t\t\tthrow(new Error('Signer or account is required to sign username transfer'));\n\t\t}\n\n\t\tconst signable = getUsernameTransferSignable({\n\t\t\t...request,\n\t\t\tfrom: accountToUse\n\t\t});\n\n\t\treturn(await SignData(accountToUse.assertAccount(), signable));\n\t}\n\n\t/** @internal */\n\t_internals(accessToken: symbol) {\n\t\tif (accessToken !== KeetaUsernameAnchorClientAccessToken) {\n\t\t\tthrow(new Error('invalid access token'));\n\t\t}\n\n\t\treturn({\n\t\t\tclient: this.client,\n\t\t\tlogger: this.logger,\n\t\t\tresolver: this.resolver,\n\t\t\taccount: this.account,\n\t\t\tsigner: this.signer\n\t\t});\n\t}\n}\n\nexport default KeetaUsernameAnchorClient;\nexport { KeetaUsernameAnchorProvider };\n"]}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';
|
|
2
|
+
import type { ToJSONSerializable } from '../../lib/utils/json.ts';
|
|
3
|
+
import type { HTTPSignedField } from '../../lib/http-server/common.js';
|
|
4
|
+
import type { Signable } from '../../lib/utils/signing.js';
|
|
5
|
+
import { KeetaAnchorUserError } from '../../lib/error.js';
|
|
6
|
+
export * from './common.generated.js';
|
|
7
|
+
export declare const USERNAME_DELIMITER = "$";
|
|
8
|
+
export declare const USERNAME_MIN_LENGTH = 1;
|
|
9
|
+
export declare const USERNAME_MAX_LENGTH = 256;
|
|
10
|
+
export type UsernameValidationReason = 'length' | 'latin1';
|
|
11
|
+
export interface UsernameValidationIssue {
|
|
12
|
+
reason: UsernameValidationReason;
|
|
13
|
+
message: string;
|
|
14
|
+
}
|
|
15
|
+
type ValidateUsernameOptions = {
|
|
16
|
+
pattern?: string | RegExp | undefined;
|
|
17
|
+
fieldPath?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function validateUsernameDefault(username: string, options?: ValidateUsernameOptions): void;
|
|
20
|
+
export type KeetaNetAccount = InstanceType<typeof KeetaNetLib.Account>;
|
|
21
|
+
export type GloballyIdentifiableUsername = `${string}${typeof USERNAME_DELIMITER}${string}`;
|
|
22
|
+
export interface UsernameComponents {
|
|
23
|
+
username: string;
|
|
24
|
+
providerID: string;
|
|
25
|
+
}
|
|
26
|
+
export interface KeetaUsernameAnchorAccountResolutionContext {
|
|
27
|
+
account: KeetaNetAccount;
|
|
28
|
+
}
|
|
29
|
+
export interface KeetaUsernameAnchorUsernameResolutionContext {
|
|
30
|
+
username: string;
|
|
31
|
+
}
|
|
32
|
+
export interface KeetaUsernameAnchorSearchRequestParameters {
|
|
33
|
+
search: string;
|
|
34
|
+
}
|
|
35
|
+
export interface KeetaUsernameAnchorUsernameWithAccount {
|
|
36
|
+
username: string;
|
|
37
|
+
account: KeetaNetAccount;
|
|
38
|
+
}
|
|
39
|
+
export type KeetaUsernameAnchorSearchResponse = ({
|
|
40
|
+
ok: true;
|
|
41
|
+
results: KeetaUsernameAnchorUsernameWithAccount[];
|
|
42
|
+
}) | ({
|
|
43
|
+
ok: false;
|
|
44
|
+
error: string;
|
|
45
|
+
});
|
|
46
|
+
export type KeetaUsernameAnchorSearchResponseJSON = ToJSONSerializable<KeetaUsernameAnchorSearchResponse>;
|
|
47
|
+
export type KeetaUsernameAnchorResolveResponse = ({
|
|
48
|
+
ok: true;
|
|
49
|
+
} & KeetaUsernameAnchorUsernameWithAccount) | ({
|
|
50
|
+
ok: false;
|
|
51
|
+
error: string;
|
|
52
|
+
});
|
|
53
|
+
export type KeetaUsernameAnchorResolveResponseJSON = ToJSONSerializable<KeetaUsernameAnchorResolveResponse>;
|
|
54
|
+
export interface KeetaUsernameAnchorClaimContext {
|
|
55
|
+
username: string;
|
|
56
|
+
account: KeetaNetAccount;
|
|
57
|
+
fromUser: KeetaNetAccount | null;
|
|
58
|
+
}
|
|
59
|
+
export interface KeetaUsernameAnchorClaimRequestPayload {
|
|
60
|
+
transfer?: Pick<TransferUsernameOwnershipSignablePayload, 'from'> & {
|
|
61
|
+
signed: HTTPSignedField;
|
|
62
|
+
};
|
|
63
|
+
username: string;
|
|
64
|
+
account: KeetaNetAccount;
|
|
65
|
+
}
|
|
66
|
+
export interface KeetaUsernameAnchorClaimRequest extends KeetaUsernameAnchorClaimRequestPayload {
|
|
67
|
+
signed: HTTPSignedField;
|
|
68
|
+
}
|
|
69
|
+
export type KeetaUsernameAnchorClaimRequestJSON = ToJSONSerializable<KeetaUsernameAnchorClaimRequest>;
|
|
70
|
+
export type KeetaUsernameAnchorClaimResponseJSON = ({
|
|
71
|
+
ok: true;
|
|
72
|
+
}) | ({
|
|
73
|
+
ok: false;
|
|
74
|
+
error: string;
|
|
75
|
+
});
|
|
76
|
+
export interface KeetaUsernameAnchorReleaseRequestPayload {
|
|
77
|
+
account: KeetaNetAccount;
|
|
78
|
+
}
|
|
79
|
+
export interface KeetaUsernameAnchorReleaseRequest extends KeetaUsernameAnchorReleaseRequestPayload {
|
|
80
|
+
signed: HTTPSignedField;
|
|
81
|
+
}
|
|
82
|
+
export type KeetaUsernameAnchorReleaseRequestJSON = ToJSONSerializable<KeetaUsernameAnchorReleaseRequest>;
|
|
83
|
+
export type KeetaUsernameAnchorReleaseResponseJSON = ({
|
|
84
|
+
ok: true;
|
|
85
|
+
}) | ({
|
|
86
|
+
ok: false;
|
|
87
|
+
error: string;
|
|
88
|
+
});
|
|
89
|
+
export declare function formatGloballyIdentifiableUsername(providerIssuedName: string, providerID: string): GloballyIdentifiableUsername;
|
|
90
|
+
export declare function isGloballyIdentifiableUsername(input: unknown): input is GloballyIdentifiableUsername;
|
|
91
|
+
export declare function parseGloballyIdentifiableUsername(input: GloballyIdentifiableUsername): UsernameComponents;
|
|
92
|
+
export declare function getUsernameClaimSignable(request: KeetaUsernameAnchorClaimRequestPayload): Signable;
|
|
93
|
+
export interface TransferUsernameOwnershipSignablePayload {
|
|
94
|
+
username: string;
|
|
95
|
+
to: KeetaNetAccount;
|
|
96
|
+
from: KeetaNetAccount;
|
|
97
|
+
}
|
|
98
|
+
export declare function getUsernameTransferSignable(payload: TransferUsernameOwnershipSignablePayload): Signable;
|
|
99
|
+
export declare function getUsernameReleaseSignable(payload: KeetaUsernameAnchorReleaseRequestPayload): Signable;
|
|
100
|
+
interface KeetaUsernameAnchorUsernameAlreadyTakenErrorProperties {
|
|
101
|
+
username: string;
|
|
102
|
+
}
|
|
103
|
+
type KeetaUsernameAnchorUsernameAlreadyTakenErrorJSON = ReturnType<KeetaAnchorUserError['toJSON']> & KeetaUsernameAnchorUsernameAlreadyTakenErrorProperties;
|
|
104
|
+
declare class KeetaUsernameAnchorUsernameAlreadyTakenError extends KeetaAnchorUserError implements KeetaUsernameAnchorUsernameAlreadyTakenErrorProperties {
|
|
105
|
+
static readonly name: string;
|
|
106
|
+
private readonly KeetaUsernameAnchorUsernameAlreadyTakenErrorObjectTypeID;
|
|
107
|
+
private static readonly KeetaUsernameAnchorUsernameAlreadyTakenErrorObjectTypeID;
|
|
108
|
+
readonly logLevel = "INFO";
|
|
109
|
+
readonly username: string;
|
|
110
|
+
constructor(properties: KeetaUsernameAnchorUsernameAlreadyTakenErrorProperties, message?: string);
|
|
111
|
+
static isInstance(input: unknown): input is KeetaUsernameAnchorUsernameAlreadyTakenError;
|
|
112
|
+
toJSON(): KeetaUsernameAnchorUsernameAlreadyTakenErrorJSON;
|
|
113
|
+
static fromJSON(input: unknown): Promise<KeetaUsernameAnchorUsernameAlreadyTakenError>;
|
|
114
|
+
}
|
|
115
|
+
interface KeetaUsernameAnchorUserNotFoundErrorProperties {
|
|
116
|
+
username?: string | undefined;
|
|
117
|
+
account?: KeetaNetAccount | undefined;
|
|
118
|
+
}
|
|
119
|
+
type KeetaUsernameAnchorUserNotFoundErrorJSON = ReturnType<KeetaAnchorUserError['toJSON']> & KeetaUsernameAnchorUserNotFoundErrorProperties;
|
|
120
|
+
declare class KeetaUsernameAnchorUserNotFoundError extends KeetaAnchorUserError implements KeetaUsernameAnchorUserNotFoundErrorProperties {
|
|
121
|
+
static readonly name: string;
|
|
122
|
+
private readonly KeetaUsernameAnchorUserNotFoundErrorObjectTypeID;
|
|
123
|
+
private static readonly KeetaUsernameAnchorUserNotFoundErrorObjectTypeID;
|
|
124
|
+
readonly logLevel = "INFO";
|
|
125
|
+
readonly username: string | undefined;
|
|
126
|
+
readonly account: KeetaNetAccount | undefined;
|
|
127
|
+
constructor(properties: KeetaUsernameAnchorUserNotFoundErrorProperties, message?: string);
|
|
128
|
+
static isInstance(input: unknown): input is KeetaUsernameAnchorUserNotFoundError;
|
|
129
|
+
toJSON(): KeetaUsernameAnchorUserNotFoundErrorJSON;
|
|
130
|
+
static fromJSON(input: unknown): Promise<KeetaUsernameAnchorUserNotFoundError>;
|
|
131
|
+
}
|
|
132
|
+
export declare const Errors: {
|
|
133
|
+
UsernameAlreadyTaken: typeof KeetaUsernameAnchorUsernameAlreadyTakenError;
|
|
134
|
+
UserNotFound: typeof KeetaUsernameAnchorUserNotFoundError;
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=common.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KAAK,IAAI,oCAAoC;IAIhF,MAAM,IAAI,wCAAwC;WAOrC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,oCAAoC,CAAC;CAuBpF;AAED,eAAO,MAAM,MAAM,EAAE;IACpB,oBAAoB,EAAE,OAAO,4CAA4C,CAAC;IAC1E,YAAY,EAAE,OAAO,oCAAoC,CAAC;CAI1D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createAssertEquals } from 'typia';
|
|
2
|
+
import type { KeetaUsernameAnchorClaimRequestJSON, KeetaUsernameAnchorClaimResponseJSON, KeetaUsernameAnchorReleaseRequestJSON, KeetaUsernameAnchorReleaseResponseJSON, KeetaUsernameAnchorSearchResponseJSON, KeetaUsernameAnchorResolveResponseJSON } from './common.ts';
|
|
3
|
+
import type { AccountPublicKeyString, IdentifierPublicKeyString } from '@keetanetwork/keetanet-client/lib/account.js';
|
|
4
|
+
export declare const assertKeetaUsernameAnchorClaimRequestJSON: ReturnType<typeof createAssertEquals<KeetaUsernameAnchorClaimRequestJSON>>;
|
|
5
|
+
export declare const assertKeetaUsernameAnchorReleaseRequestJSON: ReturnType<typeof createAssertEquals<KeetaUsernameAnchorReleaseRequestJSON>>;
|
|
6
|
+
export declare const isKeetaUsernameAnchorResolveResponseJSON: (input: unknown) => input is KeetaUsernameAnchorResolveResponseJSON;
|
|
7
|
+
export declare const isKeetaUsernameAnchorClaimResponseJSON: (input: unknown) => input is KeetaUsernameAnchorClaimResponseJSON;
|
|
8
|
+
export declare const isKeetaUsernameAnchorReleaseResponseJSON: (input: unknown) => input is KeetaUsernameAnchorReleaseResponseJSON;
|
|
9
|
+
export declare const isKeetaUsernameAnchorSearchResponseJSON: (input: unknown) => input is KeetaUsernameAnchorSearchResponseJSON;
|
|
10
|
+
type PublicKeyString = IdentifierPublicKeyString | AccountPublicKeyString;
|
|
11
|
+
export declare const isKeetaNetPublicKeyString: (input: unknown) => input is PublicKeyString;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=common.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.generated.d.ts","sourceRoot":"","sources":["../../../src/services/username/common.generated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAY,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EACX,mCAAmC,EACnC,oCAAoC,EACpC,qCAAqC,EACrC,sCAAsC,EACtC,qCAAqC,EACrC,sCAAsC,EACtC,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAEtH,eAAO,MAAM,yCAAyC,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,mCAAmC,CAAC,CAA6D,CAAC;AAC/L,eAAO,MAAM,2CAA2C,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,qCAAqC,CAAC,CAA+D,CAAC;AACrM,eAAO,MAAM,wCAAwC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,sCAA2F,CAAC;AAChL,eAAO,MAAM,sCAAsC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,oCAAuF,CAAC;AAC1K,eAAO,MAAM,wCAAwC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,sCAA2F,CAAC;AAChL,eAAO,MAAM,uCAAuC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,qCAAyF,CAAC;AAE7K,KAAK,eAAe,GAAG,yBAAyB,GAAG,sBAAsB,CAAC;AAC1E,eAAO,MAAM,yBAAyB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,eAA6C,CAAC"}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import * as __typia_transform__assertGuard from "typia/lib/internal/_assertGuard.js";
|
|
2
|
+
import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
|
|
3
|
+
import { createAssertEquals, createIs } from 'typia';
|
|
4
|
+
export const assertKeetaUsernameAnchorClaimRequestJSON = (() => { const _io0 = (input, _exceptionable = true) => "object" === typeof input.signed && null !== input.signed && _io1(input.signed, true && _exceptionable) && (undefined === input.transfer || "object" === typeof input.transfer && null !== input.transfer && _io2(input.transfer, true && _exceptionable)) && "string" === typeof input.username && ("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))) && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
5
|
+
if (["signed", "transfer", "username", "account"].some(prop => key === prop))
|
|
6
|
+
return true;
|
|
7
|
+
const value = input[key];
|
|
8
|
+
if (undefined === value)
|
|
9
|
+
return true;
|
|
10
|
+
return false;
|
|
11
|
+
})); const _io1 = (input, _exceptionable = true) => "string" === typeof input.nonce && "string" === typeof input.timestamp && "string" === typeof input.signature && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
12
|
+
if (["nonce", "timestamp", "signature"].some(prop => key === prop))
|
|
13
|
+
return true;
|
|
14
|
+
const value = input[key];
|
|
15
|
+
if (undefined === value)
|
|
16
|
+
return true;
|
|
17
|
+
return false;
|
|
18
|
+
})); const _io2 = (input, _exceptionable = true) => "string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from) || RegExp(/^keeta_aa(.*)/).test(input.from) || RegExp(/^keeta_ab(.*)/).test(input.from) || RegExp(/^keeta_ac(.*)/).test(input.from) || RegExp(/^keeta_ad(.*)/).test(input.from) || RegExp(/^tyblocks_aa(.*)/).test(input.from) || RegExp(/^tyblocks_ab(.*)/).test(input.from) || RegExp(/^tyblocks_ac(.*)/).test(input.from) || RegExp(/^tyblocks_ad(.*)/).test(input.from) || RegExp(/^keeta_ae(.*)/).test(input.from) || RegExp(/^keeta_af(.*)/).test(input.from) || RegExp(/^keeta_ag(.*)/).test(input.from) || RegExp(/^keeta_ah(.*)/).test(input.from) || RegExp(/^tyblocks_ae(.*)/).test(input.from) || RegExp(/^tyblocks_af(.*)/).test(input.from) || RegExp(/^tyblocks_ag(.*)/).test(input.from) || RegExp(/^tyblocks_ah(.*)/).test(input.from) || RegExp(/^keeta_ai(.*)/).test(input.from) || RegExp(/^keeta_aj(.*)/).test(input.from) || RegExp(/^keeta_ak(.*)/).test(input.from) || RegExp(/^keeta_al(.*)/).test(input.from) || RegExp(/^tyblocks_ai(.*)/).test(input.from) || RegExp(/^tyblocks_aj(.*)/).test(input.from) || RegExp(/^tyblocks_ak(.*)/).test(input.from) || RegExp(/^tyblocks_al(.*)/).test(input.from) || RegExp(/^keeta_at(.*)/).test(input.from) || RegExp(/^keeta_aq(.*)/).test(input.from) || RegExp(/^keeta_ar(.*)/).test(input.from) || RegExp(/^keeta_as(.*)/).test(input.from) || RegExp(/^tyblocks_at(.*)/).test(input.from) || RegExp(/^tyblocks_aq(.*)/).test(input.from) || RegExp(/^tyblocks_ar(.*)/).test(input.from) || RegExp(/^tyblocks_as(.*)/).test(input.from) || RegExp(/^keeta_ay(.*)/).test(input.from) || RegExp(/^keeta_az(.*)/).test(input.from) || RegExp(/^keeta_a2(.*)/).test(input.from) || RegExp(/^keeta_a3(.*)/).test(input.from) || RegExp(/^tyblocks_ay(.*)/).test(input.from) || RegExp(/^tyblocks_az(.*)/).test(input.from) || RegExp(/^tyblocks_a2(.*)/).test(input.from) || RegExp(/^tyblocks_a3(.*)/).test(input.from) || RegExp(/^keeta_a4(.*)/).test(input.from) || RegExp(/^keeta_a5(.*)/).test(input.from) || RegExp(/^keeta_a6(.*)/).test(input.from) || RegExp(/^keeta_a7(.*)/).test(input.from) || RegExp(/^tyblocks_a4(.*)/).test(input.from) || RegExp(/^tyblocks_a5(.*)/).test(input.from) || RegExp(/^tyblocks_a6(.*)/).test(input.from) || RegExp(/^tyblocks_a7(.*)/).test(input.from)) && ("object" === typeof input.signed && null !== input.signed && _io1(input.signed, true && _exceptionable)) && (2 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
19
|
+
if (["from", "signed"].some(prop => key === prop))
|
|
20
|
+
return true;
|
|
21
|
+
const value = input[key];
|
|
22
|
+
if (undefined === value)
|
|
23
|
+
return true;
|
|
24
|
+
return false;
|
|
25
|
+
})); const _ao0 = (input, _path, _exceptionable = true) => (("object" === typeof input.signed && null !== input.signed || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
26
|
+
method: "createAssertEquals",
|
|
27
|
+
path: _path + ".signed",
|
|
28
|
+
expected: "__type.o1",
|
|
29
|
+
value: input.signed
|
|
30
|
+
}, _errorFactory)) && _ao1(input.signed, _path + ".signed", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
31
|
+
method: "createAssertEquals",
|
|
32
|
+
path: _path + ".signed",
|
|
33
|
+
expected: "__type.o1",
|
|
34
|
+
value: input.signed
|
|
35
|
+
}, _errorFactory)) && (undefined === input.transfer || ("object" === typeof input.transfer && null !== input.transfer || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
36
|
+
method: "createAssertEquals",
|
|
37
|
+
path: _path + ".transfer",
|
|
38
|
+
expected: "(__type.o2 | undefined)",
|
|
39
|
+
value: input.transfer
|
|
40
|
+
}, _errorFactory)) && _ao2(input.transfer, _path + ".transfer", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
41
|
+
method: "createAssertEquals",
|
|
42
|
+
path: _path + ".transfer",
|
|
43
|
+
expected: "(__type.o2 | undefined)",
|
|
44
|
+
value: input.transfer
|
|
45
|
+
}, _errorFactory)) && ("string" === typeof input.username || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
46
|
+
method: "createAssertEquals",
|
|
47
|
+
path: _path + ".username",
|
|
48
|
+
expected: "string",
|
|
49
|
+
value: input.username
|
|
50
|
+
}, _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, {
|
|
51
|
+
method: "createAssertEquals",
|
|
52
|
+
path: _path + ".account",
|
|
53
|
+
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}`)",
|
|
54
|
+
value: input.account
|
|
55
|
+
}, _errorFactory)) && (3 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).every(key => {
|
|
56
|
+
if (["signed", "transfer", "username", "account"].some(prop => key === prop))
|
|
57
|
+
return true;
|
|
58
|
+
const value = input[key];
|
|
59
|
+
if (undefined === value)
|
|
60
|
+
return true;
|
|
61
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
62
|
+
method: "createAssertEquals",
|
|
63
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
64
|
+
expected: "undefined",
|
|
65
|
+
value: value
|
|
66
|
+
}, _errorFactory);
|
|
67
|
+
}))); const _ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.nonce || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
68
|
+
method: "createAssertEquals",
|
|
69
|
+
path: _path + ".nonce",
|
|
70
|
+
expected: "string",
|
|
71
|
+
value: input.nonce
|
|
72
|
+
}, _errorFactory)) && ("string" === typeof input.timestamp || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
73
|
+
method: "createAssertEquals",
|
|
74
|
+
path: _path + ".timestamp",
|
|
75
|
+
expected: "string",
|
|
76
|
+
value: input.timestamp
|
|
77
|
+
}, _errorFactory)) && ("string" === typeof input.signature || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
78
|
+
method: "createAssertEquals",
|
|
79
|
+
path: _path + ".signature",
|
|
80
|
+
expected: "string",
|
|
81
|
+
value: input.signature
|
|
82
|
+
}, _errorFactory)) && (3 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).every(key => {
|
|
83
|
+
if (["nonce", "timestamp", "signature"].some(prop => key === prop))
|
|
84
|
+
return true;
|
|
85
|
+
const value = input[key];
|
|
86
|
+
if (undefined === value)
|
|
87
|
+
return true;
|
|
88
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
89
|
+
method: "createAssertEquals",
|
|
90
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
91
|
+
expected: "undefined",
|
|
92
|
+
value: value
|
|
93
|
+
}, _errorFactory);
|
|
94
|
+
}))); const _ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.from && (RegExp(/^keeta_am(.*)/).test(input.from) || RegExp(/^keeta_an(.*)/).test(input.from) || RegExp(/^keeta_ao(.*)/).test(input.from) || RegExp(/^keeta_ap(.*)/).test(input.from) || RegExp(/^tyblocks_am(.*)/).test(input.from) || RegExp(/^tyblocks_an(.*)/).test(input.from) || RegExp(/^tyblocks_ao(.*)/).test(input.from) || RegExp(/^tyblocks_ap(.*)/).test(input.from) || RegExp(/^keeta_aa(.*)/).test(input.from) || RegExp(/^keeta_ab(.*)/).test(input.from) || RegExp(/^keeta_ac(.*)/).test(input.from) || RegExp(/^keeta_ad(.*)/).test(input.from) || RegExp(/^tyblocks_aa(.*)/).test(input.from) || RegExp(/^tyblocks_ab(.*)/).test(input.from) || RegExp(/^tyblocks_ac(.*)/).test(input.from) || RegExp(/^tyblocks_ad(.*)/).test(input.from) || RegExp(/^keeta_ae(.*)/).test(input.from) || RegExp(/^keeta_af(.*)/).test(input.from) || RegExp(/^keeta_ag(.*)/).test(input.from) || RegExp(/^keeta_ah(.*)/).test(input.from) || RegExp(/^tyblocks_ae(.*)/).test(input.from) || RegExp(/^tyblocks_af(.*)/).test(input.from) || RegExp(/^tyblocks_ag(.*)/).test(input.from) || RegExp(/^tyblocks_ah(.*)/).test(input.from) || RegExp(/^keeta_ai(.*)/).test(input.from) || RegExp(/^keeta_aj(.*)/).test(input.from) || RegExp(/^keeta_ak(.*)/).test(input.from) || RegExp(/^keeta_al(.*)/).test(input.from) || RegExp(/^tyblocks_ai(.*)/).test(input.from) || RegExp(/^tyblocks_aj(.*)/).test(input.from) || RegExp(/^tyblocks_ak(.*)/).test(input.from) || RegExp(/^tyblocks_al(.*)/).test(input.from) || RegExp(/^keeta_at(.*)/).test(input.from) || RegExp(/^keeta_aq(.*)/).test(input.from) || RegExp(/^keeta_ar(.*)/).test(input.from) || RegExp(/^keeta_as(.*)/).test(input.from) || RegExp(/^tyblocks_at(.*)/).test(input.from) || RegExp(/^tyblocks_aq(.*)/).test(input.from) || RegExp(/^tyblocks_ar(.*)/).test(input.from) || RegExp(/^tyblocks_as(.*)/).test(input.from) || RegExp(/^keeta_ay(.*)/).test(input.from) || RegExp(/^keeta_az(.*)/).test(input.from) || RegExp(/^keeta_a2(.*)/).test(input.from) || RegExp(/^keeta_a3(.*)/).test(input.from) || RegExp(/^tyblocks_ay(.*)/).test(input.from) || RegExp(/^tyblocks_az(.*)/).test(input.from) || RegExp(/^tyblocks_a2(.*)/).test(input.from) || RegExp(/^tyblocks_a3(.*)/).test(input.from) || RegExp(/^keeta_a4(.*)/).test(input.from) || RegExp(/^keeta_a5(.*)/).test(input.from) || RegExp(/^keeta_a6(.*)/).test(input.from) || RegExp(/^keeta_a7(.*)/).test(input.from) || RegExp(/^tyblocks_a4(.*)/).test(input.from) || RegExp(/^tyblocks_a5(.*)/).test(input.from) || RegExp(/^tyblocks_a6(.*)/).test(input.from) || RegExp(/^tyblocks_a7(.*)/).test(input.from)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
95
|
+
method: "createAssertEquals",
|
|
96
|
+
path: _path + ".from",
|
|
97
|
+
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}`)",
|
|
98
|
+
value: input.from
|
|
99
|
+
}, _errorFactory)) && (("object" === typeof input.signed && null !== input.signed || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
100
|
+
method: "createAssertEquals",
|
|
101
|
+
path: _path + ".signed",
|
|
102
|
+
expected: "__type.o1",
|
|
103
|
+
value: input.signed
|
|
104
|
+
}, _errorFactory)) && _ao1(input.signed, _path + ".signed", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
105
|
+
method: "createAssertEquals",
|
|
106
|
+
path: _path + ".signed",
|
|
107
|
+
expected: "__type.o1",
|
|
108
|
+
value: input.signed
|
|
109
|
+
}, _errorFactory)) && (2 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).every(key => {
|
|
110
|
+
if (["from", "signed"].some(prop => key === prop))
|
|
111
|
+
return true;
|
|
112
|
+
const value = input[key];
|
|
113
|
+
if (undefined === value)
|
|
114
|
+
return true;
|
|
115
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
116
|
+
method: "createAssertEquals",
|
|
117
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
118
|
+
expected: "undefined",
|
|
119
|
+
value: value
|
|
120
|
+
}, _errorFactory);
|
|
121
|
+
}))); const __is = (input, _exceptionable = true) => "object" === typeof input && null !== input && _io0(input, true); let _errorFactory; return (input, errorFactory) => {
|
|
122
|
+
if (false === __is(input)) {
|
|
123
|
+
_errorFactory = errorFactory;
|
|
124
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || __typia_transform__assertGuard._assertGuard(true, {
|
|
125
|
+
method: "createAssertEquals",
|
|
126
|
+
path: _path + "",
|
|
127
|
+
expected: "__type",
|
|
128
|
+
value: input
|
|
129
|
+
}, _errorFactory)) && _ao0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
130
|
+
method: "createAssertEquals",
|
|
131
|
+
path: _path + "",
|
|
132
|
+
expected: "__type",
|
|
133
|
+
value: input
|
|
134
|
+
}, _errorFactory))(input, "$input", true);
|
|
135
|
+
}
|
|
136
|
+
return input;
|
|
137
|
+
}; })();
|
|
138
|
+
export const assertKeetaUsernameAnchorReleaseRequestJSON = (() => { const _io0 = (input, _exceptionable = true) => "object" === typeof input.signed && null !== input.signed && _io1(input.signed, true && _exceptionable) && ("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))) && (2 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
139
|
+
if (["signed", "account"].some(prop => key === prop))
|
|
140
|
+
return true;
|
|
141
|
+
const value = input[key];
|
|
142
|
+
if (undefined === value)
|
|
143
|
+
return true;
|
|
144
|
+
return false;
|
|
145
|
+
})); const _io1 = (input, _exceptionable = true) => "string" === typeof input.nonce && "string" === typeof input.timestamp && "string" === typeof input.signature && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
146
|
+
if (["nonce", "timestamp", "signature"].some(prop => key === prop))
|
|
147
|
+
return true;
|
|
148
|
+
const value = input[key];
|
|
149
|
+
if (undefined === value)
|
|
150
|
+
return true;
|
|
151
|
+
return false;
|
|
152
|
+
})); const _ao0 = (input, _path, _exceptionable = true) => (("object" === typeof input.signed && null !== input.signed || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
153
|
+
method: "createAssertEquals",
|
|
154
|
+
path: _path + ".signed",
|
|
155
|
+
expected: "__type.o1",
|
|
156
|
+
value: input.signed
|
|
157
|
+
}, _errorFactory)) && _ao1(input.signed, _path + ".signed", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
158
|
+
method: "createAssertEquals",
|
|
159
|
+
path: _path + ".signed",
|
|
160
|
+
expected: "__type.o1",
|
|
161
|
+
value: input.signed
|
|
162
|
+
}, _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, {
|
|
163
|
+
method: "createAssertEquals",
|
|
164
|
+
path: _path + ".account",
|
|
165
|
+
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}`)",
|
|
166
|
+
value: input.account
|
|
167
|
+
}, _errorFactory)) && (2 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).every(key => {
|
|
168
|
+
if (["signed", "account"].some(prop => key === prop))
|
|
169
|
+
return true;
|
|
170
|
+
const value = input[key];
|
|
171
|
+
if (undefined === value)
|
|
172
|
+
return true;
|
|
173
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
174
|
+
method: "createAssertEquals",
|
|
175
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
176
|
+
expected: "undefined",
|
|
177
|
+
value: value
|
|
178
|
+
}, _errorFactory);
|
|
179
|
+
}))); const _ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.nonce || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
180
|
+
method: "createAssertEquals",
|
|
181
|
+
path: _path + ".nonce",
|
|
182
|
+
expected: "string",
|
|
183
|
+
value: input.nonce
|
|
184
|
+
}, _errorFactory)) && ("string" === typeof input.timestamp || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
185
|
+
method: "createAssertEquals",
|
|
186
|
+
path: _path + ".timestamp",
|
|
187
|
+
expected: "string",
|
|
188
|
+
value: input.timestamp
|
|
189
|
+
}, _errorFactory)) && ("string" === typeof input.signature || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
190
|
+
method: "createAssertEquals",
|
|
191
|
+
path: _path + ".signature",
|
|
192
|
+
expected: "string",
|
|
193
|
+
value: input.signature
|
|
194
|
+
}, _errorFactory)) && (3 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).every(key => {
|
|
195
|
+
if (["nonce", "timestamp", "signature"].some(prop => key === prop))
|
|
196
|
+
return true;
|
|
197
|
+
const value = input[key];
|
|
198
|
+
if (undefined === value)
|
|
199
|
+
return true;
|
|
200
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
201
|
+
method: "createAssertEquals",
|
|
202
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
203
|
+
expected: "undefined",
|
|
204
|
+
value: value
|
|
205
|
+
}, _errorFactory);
|
|
206
|
+
}))); const __is = (input, _exceptionable = true) => "object" === typeof input && null !== input && _io0(input, true); let _errorFactory; return (input, errorFactory) => {
|
|
207
|
+
if (false === __is(input)) {
|
|
208
|
+
_errorFactory = errorFactory;
|
|
209
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || __typia_transform__assertGuard._assertGuard(true, {
|
|
210
|
+
method: "createAssertEquals",
|
|
211
|
+
path: _path + "",
|
|
212
|
+
expected: "__type",
|
|
213
|
+
value: input
|
|
214
|
+
}, _errorFactory)) && _ao0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
215
|
+
method: "createAssertEquals",
|
|
216
|
+
path: _path + "",
|
|
217
|
+
expected: "__type",
|
|
218
|
+
value: input
|
|
219
|
+
}, _errorFactory))(input, "$input", true);
|
|
220
|
+
}
|
|
221
|
+
return input;
|
|
222
|
+
}; })();
|
|
223
|
+
export const isKeetaUsernameAnchorResolveResponseJSON = (() => { const _io0 = input => false === input.ok && "string" === typeof input.error; const _io1 = input => true === input.ok && "string" === typeof input.username && ("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))); const _iu0 = input => (() => {
|
|
224
|
+
if (false === input.ok)
|
|
225
|
+
return _io0(input);
|
|
226
|
+
else if (true === input.ok)
|
|
227
|
+
return _io1(input);
|
|
228
|
+
else
|
|
229
|
+
return false;
|
|
230
|
+
})(); return input => "object" === typeof input && null !== input && _iu0(input); })();
|
|
231
|
+
export const isKeetaUsernameAnchorClaimResponseJSON = (() => { const _io0 = input => true === input.ok; const _io1 = input => false === input.ok && "string" === typeof input.error; const _iu0 = input => (() => {
|
|
232
|
+
if (true === input.ok)
|
|
233
|
+
return _io0(input);
|
|
234
|
+
else if (false === input.ok)
|
|
235
|
+
return _io1(input);
|
|
236
|
+
else
|
|
237
|
+
return false;
|
|
238
|
+
})(); return input => "object" === typeof input && null !== input && _iu0(input); })();
|
|
239
|
+
export const isKeetaUsernameAnchorReleaseResponseJSON = (() => { const _io0 = input => true === input.ok; const _io1 = input => false === input.ok && "string" === typeof input.error; const _iu0 = input => (() => {
|
|
240
|
+
if (true === input.ok)
|
|
241
|
+
return _io0(input);
|
|
242
|
+
else if (false === input.ok)
|
|
243
|
+
return _io1(input);
|
|
244
|
+
else
|
|
245
|
+
return false;
|
|
246
|
+
})(); return input => "object" === typeof input && null !== input && _iu0(input); })();
|
|
247
|
+
export const isKeetaUsernameAnchorSearchResponseJSON = (() => { const _io0 = input => false === input.ok && "string" === typeof input.error; const _io1 = input => true === input.ok && (Array.isArray(input.results) && input.results.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io2 = input => "string" === typeof input.username && ("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))); const _iu0 = input => (() => {
|
|
248
|
+
if (false === input.ok)
|
|
249
|
+
return _io0(input);
|
|
250
|
+
else if (true === input.ok)
|
|
251
|
+
return _io1(input);
|
|
252
|
+
else
|
|
253
|
+
return false;
|
|
254
|
+
})(); return input => "object" === typeof input && null !== input && _iu0(input); })();
|
|
255
|
+
export const isKeetaNetPublicKeyString = (() => { return input => "string" === typeof input && (RegExp(/^keeta_am(.*)/).test(input) || RegExp(/^keeta_an(.*)/).test(input) || RegExp(/^keeta_ao(.*)/).test(input) || RegExp(/^keeta_ap(.*)/).test(input) || RegExp(/^tyblocks_am(.*)/).test(input) || RegExp(/^tyblocks_an(.*)/).test(input) || RegExp(/^tyblocks_ao(.*)/).test(input) || RegExp(/^tyblocks_ap(.*)/).test(input) || RegExp(/^keeta_aa(.*)/).test(input) || RegExp(/^keeta_ab(.*)/).test(input) || RegExp(/^keeta_ac(.*)/).test(input) || RegExp(/^keeta_ad(.*)/).test(input) || RegExp(/^tyblocks_aa(.*)/).test(input) || RegExp(/^tyblocks_ab(.*)/).test(input) || RegExp(/^tyblocks_ac(.*)/).test(input) || RegExp(/^tyblocks_ad(.*)/).test(input) || RegExp(/^keeta_ae(.*)/).test(input) || RegExp(/^keeta_af(.*)/).test(input) || RegExp(/^keeta_ag(.*)/).test(input) || RegExp(/^keeta_ah(.*)/).test(input) || RegExp(/^tyblocks_ae(.*)/).test(input) || RegExp(/^tyblocks_af(.*)/).test(input) || RegExp(/^tyblocks_ag(.*)/).test(input) || RegExp(/^tyblocks_ah(.*)/).test(input) || RegExp(/^keeta_ai(.*)/).test(input) || RegExp(/^keeta_aj(.*)/).test(input) || RegExp(/^keeta_ak(.*)/).test(input) || RegExp(/^keeta_al(.*)/).test(input) || RegExp(/^tyblocks_ai(.*)/).test(input) || RegExp(/^tyblocks_aj(.*)/).test(input) || RegExp(/^tyblocks_ak(.*)/).test(input) || RegExp(/^tyblocks_al(.*)/).test(input) || RegExp(/^keeta_at(.*)/).test(input) || RegExp(/^keeta_aq(.*)/).test(input) || RegExp(/^keeta_ar(.*)/).test(input) || RegExp(/^keeta_as(.*)/).test(input) || RegExp(/^tyblocks_at(.*)/).test(input) || RegExp(/^tyblocks_aq(.*)/).test(input) || RegExp(/^tyblocks_ar(.*)/).test(input) || RegExp(/^tyblocks_as(.*)/).test(input) || RegExp(/^keeta_ay(.*)/).test(input) || RegExp(/^keeta_az(.*)/).test(input) || RegExp(/^keeta_a2(.*)/).test(input) || RegExp(/^keeta_a3(.*)/).test(input) || RegExp(/^tyblocks_ay(.*)/).test(input) || RegExp(/^tyblocks_az(.*)/).test(input) || RegExp(/^tyblocks_a2(.*)/).test(input) || RegExp(/^tyblocks_a3(.*)/).test(input) || RegExp(/^keeta_a4(.*)/).test(input) || RegExp(/^keeta_a5(.*)/).test(input) || RegExp(/^keeta_a6(.*)/).test(input) || RegExp(/^keeta_a7(.*)/).test(input) || RegExp(/^tyblocks_a4(.*)/).test(input) || RegExp(/^tyblocks_a5(.*)/).test(input) || RegExp(/^tyblocks_a6(.*)/).test(input) || RegExp(/^tyblocks_a7(.*)/).test(input)); })();
|
|
256
|
+
//# sourceMappingURL=common.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.generated.js","sourceRoot":"","sources":["../../../src/services/username/common.generated.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAWrD,MAAM,CAAC,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAwI,CAAC;AAC/L,MAAM,CAAC,MAAM,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAA4I,CAAC;AACrM,MAAM,CAAC,MAAM,wCAAwC;;;;;;;sFAA0H,CAAC;AAChL,MAAM,CAAC,MAAM,sCAAsC;;;;;;;sFAAsH,CAAC;AAC1K,MAAM,CAAC,MAAM,wCAAwC;;;;;;;sFAA0H,CAAC;AAChL,MAAM,CAAC,MAAM,uCAAuC;;;;;;;sFAAwH,CAAC;AAG7K,MAAM,CAAC,MAAM,yBAAyB,yxEAA4E,CAAC","sourcesContent":["import { createAssertEquals, createIs } from 'typia';\nimport type {\n\tKeetaUsernameAnchorClaimRequestJSON,\n\tKeetaUsernameAnchorClaimResponseJSON,\n\tKeetaUsernameAnchorReleaseRequestJSON,\n\tKeetaUsernameAnchorReleaseResponseJSON,\n\tKeetaUsernameAnchorSearchResponseJSON,\n\tKeetaUsernameAnchorResolveResponseJSON\n} from './common.ts';\nimport type { AccountPublicKeyString, IdentifierPublicKeyString } from '@keetanetwork/keetanet-client/lib/account.js';\n\nexport const assertKeetaUsernameAnchorClaimRequestJSON: ReturnType<typeof createAssertEquals<KeetaUsernameAnchorClaimRequestJSON>> = createAssertEquals<KeetaUsernameAnchorClaimRequestJSON>();\nexport const assertKeetaUsernameAnchorReleaseRequestJSON: ReturnType<typeof createAssertEquals<KeetaUsernameAnchorReleaseRequestJSON>> = createAssertEquals<KeetaUsernameAnchorReleaseRequestJSON>();\nexport const isKeetaUsernameAnchorResolveResponseJSON: (input: unknown) => input is KeetaUsernameAnchorResolveResponseJSON = createIs<KeetaUsernameAnchorResolveResponseJSON>();\nexport const isKeetaUsernameAnchorClaimResponseJSON: (input: unknown) => input is KeetaUsernameAnchorClaimResponseJSON = createIs<KeetaUsernameAnchorClaimResponseJSON>();\nexport const isKeetaUsernameAnchorReleaseResponseJSON: (input: unknown) => input is KeetaUsernameAnchorReleaseResponseJSON = createIs<KeetaUsernameAnchorReleaseResponseJSON>();\nexport const isKeetaUsernameAnchorSearchResponseJSON: (input: unknown) => input is KeetaUsernameAnchorSearchResponseJSON = createIs<KeetaUsernameAnchorSearchResponseJSON>();\n\ntype PublicKeyString = IdentifierPublicKeyString | AccountPublicKeyString;\nexport const isKeetaNetPublicKeyString: (input: unknown) => input is PublicKeyString = createIs<PublicKeyString>();\n"]}
|