@keetanetwork/anchor 0.0.52 → 0.0.58
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/asset.d.ts +18 -4
- package/lib/asset.d.ts.map +1 -1
- package/lib/asset.js +18 -0
- package/lib/asset.js.map +1 -1
- package/lib/chaining-graph.cli.d.ts +2 -0
- package/lib/chaining-graph.cli.d.ts.map +1 -0
- package/lib/chaining-graph.cli.js +257 -0
- package/lib/chaining-graph.cli.js.map +1 -0
- package/lib/chaining.d.ts +247 -0
- package/lib/chaining.d.ts.map +1 -0
- package/lib/chaining.js +1187 -0
- package/lib/chaining.js.map +1 -0
- package/lib/metadata.types.d.ts +28 -0
- package/lib/metadata.types.d.ts.map +1 -0
- package/lib/metadata.types.generated.d.ts +3 -0
- package/lib/metadata.types.generated.d.ts.map +1 -0
- package/lib/metadata.types.generated.js +15 -0
- package/lib/metadata.types.generated.js.map +1 -0
- package/lib/metadata.types.js +50 -0
- package/lib/metadata.types.js.map +1 -0
- package/lib/resolver.d.ts +15 -19
- package/lib/resolver.d.ts.map +1 -1
- package/lib/resolver.js +1101 -469
- package/lib/resolver.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/services/asset-movement/client.d.ts +12 -5
- package/services/asset-movement/client.d.ts.map +1 -1
- package/services/asset-movement/client.js +190 -9
- package/services/asset-movement/client.js.map +1 -1
- package/services/asset-movement/common.d.ts +119 -60
- package/services/asset-movement/common.d.ts.map +1 -1
- package/services/asset-movement/common.generated.d.ts +48 -0
- package/services/asset-movement/common.generated.d.ts.map +1 -0
- package/services/asset-movement/common.generated.js +37425 -0
- package/services/asset-movement/common.generated.js.map +1 -0
- package/services/asset-movement/common.js +22 -35368
- package/services/asset-movement/common.js.map +1 -1
- package/services/asset-movement/lib/location.d.ts +10 -1
- package/services/asset-movement/lib/location.d.ts.map +1 -1
- package/services/asset-movement/lib/location.generated.d.ts +2 -1
- package/services/asset-movement/lib/location.generated.d.ts.map +1 -1
- package/services/asset-movement/lib/location.generated.js +23 -0
- package/services/asset-movement/lib/location.generated.js.map +1 -1
- package/services/asset-movement/lib/location.js +3 -0
- package/services/asset-movement/lib/location.js.map +1 -1
- package/services/asset-movement/server.d.ts +17 -6
- package/services/asset-movement/server.d.ts.map +1 -1
- package/services/asset-movement/server.js +47 -2
- package/services/asset-movement/server.js.map +1 -1
- package/services/fx/client.d.ts +3 -2
- package/services/fx/client.d.ts.map +1 -1
- package/services/fx/client.js +8 -3
- package/services/fx/client.js.map +1 -1
- package/services/fx/server.d.ts +2 -1
- package/services/fx/server.d.ts.map +1 -1
- package/services/fx/server.js +3 -0
- package/services/fx/server.js.map +1 -1
- package/services/storage/clients/contacts.generated.js +142 -90
- package/services/storage/clients/contacts.generated.js.map +1 -1
- package/services/storage/common.d.ts +61 -16
- package/services/storage/common.d.ts.map +1 -1
- package/services/storage/common.js.map +1 -1
- package/services/storage/server.d.ts.map +1 -1
- package/services/storage/server.js +35 -22
- package/services/storage/server.js.map +1 -1
- package/services/storage/test-utils.d.ts +7 -2
- package/services/storage/test-utils.d.ts.map +1 -1
- package/services/storage/test-utils.js +22 -4
- package/services/storage/test-utils.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/services/asset-movement/common.ts"],"names":[],"mappings":";;AAGA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAKnE,OAAO,KAAK,QAAQ,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,oCAAoC,EAAE,MAAM,mBAAmB,CAAC;AAGzE,OAAO,EAAE,kCAAkC,EAAE,MAAM,oBAAoB,CAAC;AAExE,cAAc,yCAAyC,CAAC;AAExD,cAAc,mBAAmB,CAAC;AAmBlC,OAAO,EACN,UAAU,EACV,aAAa,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CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;SAC7F,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEpE,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,EAAE,CAAC;YACxB,MAAK,CAAC,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAC,CAAC;QAC5G,CAAC;QAED,MAAM,MAAM,GAAG,sEAAsE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAElG,MAAM,KAAK,GAAG,IAAI,IAAI,CACrB;YACC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,OAAO,EAAE,MAAM,CAAC,OAAO;SACvB,EACD,OAAO,CACP,CAAC;QAEF,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAM,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;;AAGF,MAAM,CAAC,MAAM,MAAM,GAIf;IACH;;OAEG;IACH,cAAc,EAAE,2CAA2C;IAE3D;;OAEG;IACH,mBAAmB,EAAE,gDAAgD;IAErE;;OAEG;IACH,qBAAqB,EAAE,kDAAkD;CACzE,CAAC","sourcesContent":["import type { ServiceMetadata } from '../../lib/resolver.ts';\nimport type * as CurrencyInfo from '@keetanetwork/currency-info';\nimport type { AccountKeyAlgorithm, IdentifierKeyAlgorithm, TokenPublicKeyString } from '@keetanetwork/keetanet-client/lib/account.js';\nimport { createAssert, createAssertEquals, createIs } from 'typia';\nimport type { ToJSONSerializable } from '@keetanetwork/keetanet-client/lib/utils/conversion.js';\nimport type { HTTPSignedField } from '../../lib/http-server/common.js';\nimport type { Signable } from '../../lib/utils/signing.js';\nimport type { SharableCertificateAttributes } from '../../lib/certificates.js';\nimport * as KeetaNet from '@keetanetwork/keetanet-client';\nimport { KeetaAnchorUserError } from '../../lib/error.js';\nimport type { AssetLocationLike, AssetLocationString, AssetLocationInput, AssetLocationCanonical } from './lib/location.js';\nimport { convertAssetLocationInputToCanonical } from './lib/location.js';\nimport type { BankAccountAddressObfuscated, BankAccountAddressResolved, MobileWalletAddressObfuscated, MobileWalletAddressResolved, MonthYearDateInput, PhysicalAddress } from './lib/data/addresses/types.generated.js';\nimport type { HexString, KeetaNetAccount, MovableAsset, MovableAssetSearchCanonical, CurrencySearchCanonical } from '../../lib/asset.js';\nimport { convertAssetSearchInputToCanonical } from '../../lib/asset.js';\n\nexport * from './lib/data/addresses/types.generated.js';\n\nexport * from './lib/location.js';\n\nexport type {\n\tHexString,\n\tKeetaNetAccount,\n\tKeetaNetTokenPublicKeyString,\n\tEVMAsset,\n\tTronAsset,\n\tSolanaAsset,\n\tChainAssetString,\n\tMovableAssetSearchInput,\n\tMovableAssetSearchCanonical,\n\tMovableAsset,\n\tCurrencySearchCanonical,\n\tCurrencySearchInput,\n\tTokenSearchInput,\n\tTokenSearchCanonical\n} from '../../lib/asset.js';\n\nexport {\n\ttoEVMAsset,\n\tparseEVMAsset,\n\tisEVMAsset,\n\ttoTronAsset,\n\tparseTronAsset,\n\tisTronAsset,\n\ttoSolanaAsset,\n\tparseSolanaAsset,\n\tisSolanaAsset,\n\tconvertAssetSearchInputToCanonical\n} from '../../lib/asset.js';\n\nexport type ISOCountryCode = CurrencyInfo.ISOCountryCode;\n\ntype RailOrRails = Rail | Rail[];\n\n/**\n * Search criteria for filtering asset movement rails when searching for supported rails for a given transfer.\n * This can be either a single rail or an array of rails, and can be specified for inbound, outbound or common rails.\n *\n * If a single rail or array of rails is provided, it will be applied to both inbound and outbound rails.\n * If separate inbound and outbound rails are provided, they will be applied to their respective directions.\n *\n * For both methods, this will look for providers that support at least one of the specified rails in the respective direction(s).\n * For example, if { inbound: ['ACH', 'WIRE'] } is provided, it will match providers that support either ACH or WIRE inbound rails.\n */\nexport type AssetMovementRailSearchInput = RailOrRails | ({ inbound: RailOrRails; outbound?: RailOrRails } | { inbound?: RailOrRails; outbound: RailOrRails });\n\nexport type ProviderSearchInput = {\n\tasset?: MovableAsset | AssetPair;\n\tfrom?: AssetLocationInput;\n\tto?: AssetLocationInput;\n\trail?: AssetMovementRailSearchInput;\n}\n\n// A given asset should have a location and ID for the contract or public key for that asset\nexport interface Asset {\n\tlocation?: AssetLocationString;\n\t/**\n\t * Keeta token public key string, evm contract address, or a currency code\n\t */\n\tid: string;\n}\n\nexport type FiatRails = 'ACH' | 'ACH_DEBIT' | 'WIRE' | 'PIX_PUSH' | 'SPEI_PUSH' | 'WIRE_INTL_PUSH' | 'SEPA_PUSH' | 'MOBILE_WALLET' | 'INTERAC_PUSH' | 'FPS_PUSH' | 'CARD_PUSH' | 'CARD_PULL' | 'HK_FPS_PUSH' | 'BCR_PAY_PUSH' | 'DUIT_NOW_PUSH' | 'PAY_NOW_PUSH' | 'UPI_PUSH';\nexport type CryptoRails = 'KEETA_SEND' | 'EVM_SEND' | 'EVM_CALL' | 'SOLANA_SEND' | 'BITCOIN_SEND' | 'TRON_SEND';\nexport type Rail = FiatRails | CryptoRails;\n\n// Rails can be inbound, outbound or common (inbound and outbound)\nexport interface AssetWithRails extends Asset {\n\trails: (({\n\t\tinbound: RailOrRailWithExtendedDetails[];\n\t\toutbound?: RailOrRailWithExtendedDetails[];\n\t} | {\n\t\tinbound?: RailOrRailWithExtendedDetails[];\n\t\toutbound: RailOrRailWithExtendedDetails[];\n\t} | {\n\t\tinbound?: never;\n\t\toutbound?: never;\n\t}) & {\n\t\tcommon?: RailOrRailWithExtendedDetails[];\n\t});\n};\n\n// A given asset path should consist of exactly one tuple of locations\nexport interface AssetPath {\n\t/**\n\t * The asset or asset pair for this path, with from and to locations supporting the assets in the pair\n\t */\n\tpair: [ AssetWithRails, AssetWithRails ];\n\n\t/**\n\t * KYC providers which this Asset Movement Provider\n\t * supports (DN) -- if not specified,\n\t * then it does not require KYC.\n\t */\n\tkycProviders?: string[];\n};\n\nexport type AssetMetadataTargetValue = TokenPublicKeyString | CurrencySearchCanonical | `$${string}`;\nexport interface SupportedAssetsMetadata {\n\tasset: AssetMetadataTargetValue | [ AssetMetadataTargetValue, AssetMetadataTargetValue ];\n\tpaths: AssetPath[];\n}\n\n/**\n * This is the type of content that can be rendered directly in a client application.\n *\n * There is no guarantee on if/how this content will be displayed, so it should not be used for critical information, rather as a way to provide the user additional context about a transfer.\n */\nexport type ClientRenderableContent = { type: 'markdown' | 'plaintext'; content: string; };\n\nexport interface RailWithExtendedDetails {\n\trail: Rail;\n\n\t/**\n\t * An estimate of the time it will take for a transfer using this rail to complete, in milliseconds. This can be a single number or a tuple representing an estimated range [min, max].\n\t */\n\testimatedTransferTimeMs?: number | [ minEstimateMs: number, maxEstimateMs: number ];\n\n\t/**\n\t * Minimum/Maximum transfer value details for this rail, if applicable.\n\t */\n\testimatedTransferValueRange?: {\n\t\t/**\n\t\t * Min/max transfer value range, as a string in the asset's smallest unit (e.g. cents for USD, or 1/(10**6) for USDC).\n\t\t */\n\t\tvalue: [ string | undefined, string | undefined ];\n\n\t\t/**\n\t\t * The asset in which the min transfer value is denominated. If omitted, it is assumed to be the same as the source asset being transferred.\n\t\t */\n\t\tasset?: MovableAssetSearchCanonical;\n\t}\n\n\t/**\n\t * Fee estimate details for this rail, if applicable.\n\t */\n\testimatedFee?: {\n\t\tfixedFee?: {\n\t\t\t/**\n\t\t\t * Transfer fixed fee, as a string in the asset's smallest unit (e.g. cents for USD, or 1/(10**6) for USDC).\n\t\t\t */\n\t\t\tvalue: string;\n\n\t\t\t/**\n\t\t\t * The asset in which the fixed fee is denominated. If omitted, it is assumed to be the same as the source asset being transferred.\n\t\t\t */\n\t\t\tasset?: MovableAssetSearchCanonical;\n\t\t}\n\n\t\t/**\n\t\t * Estimated transfer variable fee in basis points (bps). 1 bps = 0.01%\n\t\t */\n\t\tvariableFeeBps?: number;\n\t}\n\n\t/**\n\t * Supported operations for this rail\n\t */\n\tsupportedOperations?: {\n\t\t/**\n\t\t * Whether this rail supports creating persistent forwarding addresses for (unmanaged) transfers\n\t\t */\n\t\tcreatePersistentForwarding?: boolean;\n\n\t\t/**\n\t\t * Whether this rail supports initiating (managed) transfers\n\t\t */\n\t\tinitiateTransfer?: boolean;\n\t}\n}\n\nexport type RailOrRailWithExtendedDetails = Rail | RailWithExtendedDetails;\n\n\nexport function commonJSONStringify(input: unknown): string {\n\treturn(JSON.stringify(input, function(_, value: unknown) {\n\t\tif (typeof value === 'bigint') {\n\t\t\treturn(String(value));\n\t\t} else if (KeetaNet.lib.Account.isInstance(value)) {\n\t\t\treturn(value.publicKeyString.get());\n\t\t}\n\n\t\treturn(value);\n\t}));\n}\n\ntype SignableObjectInput =\n\t// PhysicalAddress/MonthYearDateInput/RecipientResolved should not be needed here, but due to a TypeScript issue we need to reference it directly because it cannot satisfy the index signature otherwise.\n\tPhysicalAddress | MonthYearDateInput | RecipientResolved |\n\t{ [key: string | number | symbol]: SignableObjectInput } |\n\tSignableObjectInput[] |\n\tSignable[number] |\n\tundefined |\n\tnull |\n\tboolean;\n\n/**\n * The maximum queue length for the commonToSignable function to prevent DoS attacks\n */\nconst TO_SIGNABLE_MAX_QUEUE_LENGTH = 250;\n\nfunction commonToSignable(item: SignableObjectInput): Signable {\n\tconst queue: [ string, SignableObjectInput ][] = [[ '', item ]];\n\tconst result: [ string, Signable[number] ][] = [];\n\n\twhile (queue.length > 0) {\n\t\tconst next = queue.shift();\n\n\t\tif (!next) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [ prefix, current ] = next;\n\t\tif (current === null || current === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (typeof current === 'boolean') {\n\t\t\tresult.push([ prefix, current ? 1 : 0 ]);\n\t\t} else if (Array.isArray(current)) {\n\t\t\tfor (let i = 0; i < current.length; i++) {\n\t\t\t\tqueue.push([ `${prefix}[${i}]`, current[i] ]);\n\t\t\t}\n\t\t} else if (typeof current === 'object') {\n\t\t\tfor (const [ key, value ] of Object.entries(current)) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t\t\tqueue.push([ prefix ? `${prefix}.${key}` : key, value as SignableObjectInput ]);\n\t\t\t}\n\t\t} else {\n\t\t\tresult.push([ prefix, current ]);\n\t\t}\n\n\t\tif (queue.length > TO_SIGNABLE_MAX_QUEUE_LENGTH) {\n\t\t\tthrow(new KeetaAnchorUserError('Too much data to sign in commonToSignable'));\n\t\t}\n\t}\n\n\tresult.sort((a, b) => {\n\t\treturn(a[0].localeCompare(b[0], 'en-US', {\n\t\t\tusage: 'sort',\n\t\t\tnumeric: true,\n\t\t\tsensitivity: 'case',\n\t\t\tignorePunctuation: false\n\t\t}));\n\t});\n\n\treturn(result.map(item => item[1]));\n}\n\nexport type AssetPair<From extends MovableAsset = MovableAsset, To extends MovableAsset = MovableAsset> = { from: From; to: To; };\nexport type AssetOrPair = MovableAsset | AssetPair;\n\nexport type AssetPairCanonical<From extends MovableAssetSearchCanonical = MovableAssetSearchCanonical, To extends MovableAssetSearchCanonical = MovableAssetSearchCanonical> = { from: From; to: To; };\nexport type AssetOrPairCanonical = MovableAssetSearchCanonical | AssetPairCanonical;\n\nfunction isAssetPairLike(input: unknown): input is AssetPair {\n\treturn(typeof input === 'object' && input !== null && 'from' in input && 'to' in input);\n}\n\nexport function toAssetPair(input: AssetOrPair): AssetPair {\n\tif (isAssetPairLike(input)) {\n\t\treturn(input);\n\t}\n\n\treturn({ from: input, to: input });\n}\n\n\nexport function convertAssetOrPairSearchInputToCanonical(input: MovableAsset): MovableAssetSearchCanonical;\nexport function convertAssetOrPairSearchInputToCanonical(input: AssetPair): AssetPairCanonical;\nexport function convertAssetOrPairSearchInputToCanonical(input: AssetOrPair): AssetOrPairCanonical;\nexport function convertAssetOrPairSearchInputToCanonical(input: AssetOrPair): AssetOrPairCanonical {\n\tif (isAssetPairLike(input)) {\n\t\treturn({\n\t\t\tfrom: convertAssetSearchInputToCanonical(input.from),\n\t\t\tto: convertAssetSearchInputToCanonical(input.to)\n\t\t});\n\t} else {\n\t\treturn(convertAssetSearchInputToCanonical(input));\n\t}\n}\n\n\nexport type Operations = NonNullable<ServiceMetadata['services']['assetMovement']>[string]['operations'];\nexport type OperationNames = keyof Operations;\n\nexport type RecipientResolved = AddressResolved | { type: 'persistent-address'; persistentAddressId: string; };\n\n/**\n * Optional deposit message to include with the transfer, ex: for wire this is a reference note.\n */\ntype AddressDepositMessage = string;\n\ntype ConvertToExternalRequest<\n\tInternal extends object,\n\tOverrides extends object,\n\tSigned = { signed?: HTTPSignedField | undefined }\n> =\n\tToJSONSerializable<Omit<Internal, keyof Overrides>> &\n\tOverrides &\n\tSigned;\n\n/**\n * The client-side request type for initiating an asset transfer via the Keeta Asset Movement Anchor service\n */\nexport type KeetaAssetMovementAnchorInitiateTransferClientRequest = {\n\t/**\n\t * Optional KeetaNet account to use for signing the request\n\t */\n\taccount?: KeetaNetAccount | undefined;\n\n\t/**\n\t * The asset or asset pair to transfer, if a pair is given the from and to locations must support both assets in the pair\n\t */\n\tasset: AssetOrPair;\n\n\t/**\n\t * The source location for the asset transfer\n\t */\n\tfrom: { location: AssetLocationLike; };\n\n\t/**\n\t * The destination location and recipient for the asset transfer\n\t */\n\tto: {\n\t\tlocation: AssetLocationLike;\n\t\trecipient: RecipientResolved;\n\t\tdepositMessage?: AddressDepositMessage;\n\t};\n\n\t/**\n\t * The amount of the asset to transfer, as a string in the asset's smallest unit (e.g. cents for USD).\n\t */\n\tvalue: string | bigint;\n\n\t/**\n\t * Optional list of allowed rails for the transfer, the service should throw an error if none of the allowed rails are available\n\t */\n\tallowedRails?: Rail[];\n}\n\n/**\n * The serialized HTTP Body for the {@link KeetaAssetMovementAnchorInitiateTransferClientRequest} request\n */\nexport type KeetaAssetMovementAnchorInitiateTransferRequest = ConvertToExternalRequest<KeetaAssetMovementAnchorInitiateTransferClientRequest, {\n\tasset: AssetOrPairCanonical;\n\tfrom: { location: AssetLocationCanonical; };\n\tto: { location: AssetLocationCanonical; recipient: RecipientResolved; depositMessage?: AddressDepositMessage; };\n}>;\n\nexport function getKeetaAssetMovementAnchorInitiateTransferRequestSigningData(input: KeetaAssetMovementAnchorInitiateTransferClientRequest | KeetaAssetMovementAnchorInitiateTransferRequest): Signable {\n\treturn(commonToSignable({\n\t\tasset: convertAssetOrPairSearchInputToCanonical(input.asset),\n\t\tfrom: { location: convertAssetLocationInputToCanonical(input.from.location) },\n\t\tto: { location: convertAssetLocationInputToCanonical(input.to.location), recipient: input.to.recipient },\n\t\tvalue: String(input.value)\n\t}));\n}\n\n/**\n * Fee line item type in an asset transfer fee breakdown, showing the purpose of each fee line item.\n */\nexport type AssetFeeLineItemType = 'RAIL' | 'NETWORK' | 'PROVIDER' | 'VALUE_VARIABLE' | 'OTHER';\n\n/**\n * Breakdown of fees for an asset transfer, including line items and total amounts.\n */\nexport type AssetFeeBreakdown = {\n\tlineItems: {\n\t\t/**\n\t\t * The amount of the fee line item, as a string in the asset's smallest unit (e.g. cents for USD).\n\t\t */\n\t\tvalue: string;\n\n\t\t/**\n\t\t * The purpose of the fee line item. @see AssetFeeLineItemType\n\t\t */\n\t\tpurpose: AssetFeeLineItemType;\n\n\t\t/**\n\t\t * The asset in which the fee line item is denominated. If omitted, it is assumed to be the same as the asset being transferred.\n\t\t */\n\t\tasset?: MovableAssetSearchCanonical;\n\t}[];\n\t/**\n\t * The total fee amount priced in a canonical asset. If omitted, the total is assumed to be in the asset being transferred.\n\t */\n\ttotalPricedIn?: MovableAssetSearchCanonical;\n\n\t/**\n\t * The total fee amount, as a string in the asset's smallest unit (e.g. cents for USD).\n\t */\n\ttotal: string;\n};\n\n/**\n * An instruction on how to complete a transfer, ex: where to send tokens, or where to wire USD.\n */\nexport type AssetTransferInstructions = ({\n\ttype: 'KEETA_SEND';\n\n\t/**\n\t * The location from which to send the asset for this instruction, this will only be a keeta chain location.\n\t */\n\tlocation: AssetLocationLike;\n\n\t/**\n\t * The keeta public key address to send to\n\t */\n\tsendToAddress: string;\n\n\t/**\n\t * Amount to send, as a string in the asset's smallest unit.\n\t */\n\tvalue: string;\n\n\t/**\n\t * The token address to send.\n\t */\n\ttokenAddress: string;\n\n\t/**\n\t * If provided, the value to put in the external keeta transfer.\n\t */\n\texternal?: string;\n} | {\n\ttype: 'EVM_SEND';\n\t/**\n\t * The EVM location from which to send the asset for this instruction.\n\t */\n\tlocation: AssetLocationLike;\n\n\t/**\n\t * EVM address to send to\n\t */\n\tsendToAddress: HexString;\n\n\t/**\n\t * Amount to send, as a string in the asset's smallest unit.\n\t */\n\tvalue: string;\n\n\t/**\n\t * The EVM token contract address to send.\n\t */\n\ttokenAddress: HexString;\n} | {\n\t/**\n\t * An EVM contract call instruction, used for assets that require contract interaction to transfer (ex: ERC20 contract deposit() method).\n\t */\n\ttype: 'EVM_CALL';\n\n\t/**\n\t * The EVM location on which the contract call should be made.\n\t */\n\tlocation: AssetLocationLike;\n\n\t/**\n\t * The EVM contract address to call.\n\t */\n\tcontractAddress: HexString;\n\n\t/**\n\t * The method name to call on the contract. Should be either the full method signature (ex: deposit(uint256 value)), or the hashed method ID.\n\t */\n\tcontractMethodName: string;\n\n\t/**\n\t * The arguments to pass to the contract method, as an array of strings.\n\t */\n\tcontractMethodArgs: string[];\n} | {\n\ttype: FiatRails;\n\n\t/**\n\t * The resolved bank account address details to send funds to\n\t */\n\taccount: BankAccountAddressResolved;\n\n\tdepositMessage?: AddressDepositMessage;\n\n\t/**\n\t * Amount to send, as a string in the asset's smallest unit (e.g. cents for USD).\n\t */\n\tvalue: string;\n} | {\n\ttype: 'TRON_SEND';\n\tlocation: AssetLocationLike;\n\n\t/**\n\t * Tron address to send to\n\t */\n\tsendToAddress: string;\n\n\t/**\n\t * Amount to send, as a string in the asset's smallest unit (e.g. SUN for TRX).\n\t */\n\tvalue: string;\n\n\t/**\n\t * TRC20 token contract address if non-TRX.\n\t * Omitting will indicate native TRX.\n\t */\n\ttokenAddress?: string;\n} | {\n\ttype: 'BITCOIN_SEND';\n\tlocation: AssetLocationLike;\n\n\t/**\n\t * Bitcoin address to send to\n\t */\n\tsendToAddress: string;\n\n\t/**\n\t * Amount in sats to send, as a string\n\t */\n\tvalue: string;\n} | {\n\ttype: 'SOLANA_SEND';\n\tlocation: AssetLocationLike;\n\n\t/**\n\t * Solana recipient address (base58 pubkey).\n\t */\n\tsendToAddress: string;\n\n\t/**\n\t * Amount to send, as a string (e.g. in lamports or\n\t * normalized units, depending on your convention).\n\t */\n\tvalue: string;\n\n\t/**\n\t * SPL token mint address if non-native SOL.\n\t * Omitting will indicate native SOL.\n\t */\n\ttokenMintAddress?: string;\n}) & ({\n\t/**\n\t * assetFee is an advisory fee estimate for the fee that will be incurred when the instruction is executed.\n\t * This can be a total value or a breakdown of line items for the executed transfer.\n\t */\n\tassetFee: string | AssetFeeBreakdown;\n\n\t/**\n\t * If provided, this is the total amount the recipient should expect to receive after fees are deducted, formatted in the destination asset's smallest unit.\n\t */\n\ttotalReceiveAmount?: string;\n\n\t/**\n\t * If provided, this is the ID of a persistent address created/used for this transfer instruction.\n\t */\n\tpersistentAddressId?: string;\n});\n\nexport type KeetaAssetMovementAnchorInitiateTransferResponse = ({\n\tok: true;\n\tid: string;\n\tinstructionChoices: AssetTransferInstructions[];\n}) | ({\n\tok: false;\n\terror: string;\n})\n\nexport interface KeetaAssetMovementAnchorGetTransferStatusClientRequest {\n\taccount?: KeetaNetAccount;\n\tid: string;\n}\n\nexport interface KeetaAssetMovementAnchorGetTransferStatusRequest {\n\tid: string;\n}\n\nexport function getKeetaAssetMovementAnchorGetTransferStatusRequestSigningData(input: KeetaAssetMovementAnchorGetTransferStatusRequest): Signable {\n\treturn([ 'get-transaction', input.id ]);\n}\n\ntype TransactionStatus = string;\n\nexport type TransactionId = {\n\tid: string;\n\tnonce: string;\n};\n\ntype TransactionIds<T extends string> = {\n\t[type in T]: TransactionId | null;\n};\n\n/**\n * Representation of an asset movement transaction in the Asset Movement Anchor's system.\n */\nexport type KeetaAssetMovementTransaction = {\n\t/**\n\t * The unique (per anchor) identifier for the asset movement transaction.\n\t *\n\t * This ID is opaque and has no meaning outside of a specific anchor's system.\n\t */\n\tid: string;\n\n\t/**\n\t * The current status of the asset movement transaction.\n\t */\n\tstatus: TransactionStatus;\n\n\t/**\n\t * The asset being moved in the transaction.\n\t */\n\tasset: AssetOrPair;\n\n\t/**\n\t * Information about the source of the asset movement.\n\t */\n\tfrom: {\n\t\t/**\n\t\t * The location of the source of the movement.\n\t\t */\n\t\tlocation: AssetLocationString;\n\n\t\t/**\n\t\t * The value that was sent/to be sent on the source.\n\t\t */\n\t\tvalue: string;\n\n\t\t/**\n\t\t * A list of transaction IDs related to the source chain.\n\t\t */\n\t\ttransactions: TransactionIds<'persistentForwarding' | 'deposit' | 'finalization'>;\n\t};\n\n\t/**\n\t * Information about the destination of the asset movement.\n\t */\n\tto: {\n\t\t/**\n\t\t * The location of the destination of the movement.\n\t\t */\n\t\tlocation: AssetLocationString;\n\n\t\t/**\n\t\t * The value that was received/to be received on the destination.\n\t\t */\n\t\tvalue: string;\n\n\t\t/**\n\t\t * A list of transaction IDs related to the destination chain.\n\t\t */\n\t\ttransactions: TransactionIds<'withdraw'>;\n\t};\n\n\t/**\n\t * Information related to the fee charged for the asset movement.\n\t */\n\tfee: {\n\t\tasset: MovableAsset;\n\t\tvalue: string;\n\t} | null;\n\n\t/**\n\t * Additional details about this rail that (optionally) can be rendered in the client application.\n\t *\n\t * Ex: If there is a proprietary block explorer for a chain involved in the transfer, this field could contain a URL to view the transaction on that explorer.\n\t */\n\tadditionalTransferDetails?: ClientRenderableContent;\n\n\t/**\n\t * Timestamp for when the transaction was created\n\t */\n\tcreatedAt: string;\n\n\t/**\n\t * Timestamp for when the transaction was last updated\n\t */\n\tupdatedAt: string;\n}\n\nexport type KeetaAssetMovementAnchorGetTransferStatusResponse = ({\n\tok: true;\n\ttransaction: KeetaAssetMovementTransaction;\n} | {\n\tok: false;\n\terror: string;\n});\n\ntype CryptoAddress = string;\ntype AddressResolved = BankAccountAddressResolved | MobileWalletAddressResolved | CryptoAddress;\ntype AddressObfuscated = BankAccountAddressObfuscated | MobileWalletAddressObfuscated | CryptoAddress;\n\nexport type PersistentAddressTemplateData = {\n\tid: string;\n\tlocation: AssetLocationLike;\n\tasset: MovableAsset;\n\taddress: AddressObfuscated;\n}\n\nexport type KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateClientRequest = {\n\taccount?: KeetaNetAccount;\n\tasset: MovableAsset;\n\tlocation: AssetLocationLike;\n\taddress: AddressResolved;\n}\n\n\nexport type KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateRequest = ConvertToExternalRequest<KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateClientRequest, {\n\tasset: AssetOrPairCanonical;\n\tlocation: AssetLocationCanonical;\n\taddress: AddressResolved;\n}>;\n\nexport function getKeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateRequestSigningData(input: KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateClientRequest | KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateRequest): Signable {\n\tconst pair = toAssetPair(input.asset);\n\treturn(commonToSignable({\n\t\tasset: { from: convertAssetSearchInputToCanonical(pair.from), to: convertAssetSearchInputToCanonical(pair.to) },\n\t\tlocation: convertAssetLocationInputToCanonical(input.location),\n\t\taddress: input.address\n\t}));\n}\n\n\nexport type KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateResponse = (({\n\tok: true;\n} & PersistentAddressTemplateData) | {\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaAssetMovementAnchorListForwardingAddressTemplateClientRequest = {\n\taccount?: KeetaNetAccount;\n\tasset?: MovableAsset[];\n\tlocation?: AssetLocationLike[];\n\tpagination?: PaginationQuery;\n}\n\nexport type KeetaAssetMovementAnchorListForwardingAddressTemplateRequest = ToJSONSerializable<Pick<KeetaAssetMovementAnchorListForwardingAddressTemplateClientRequest, 'account' | 'pagination'>> & {\n\tasset?: MovableAssetSearchCanonical[] | undefined;\n\tlocation?: AssetLocationCanonical[] | undefined;\n\tsigned?: HTTPSignedField;\n}\n\nexport function getKeetaAssetMovementAnchorListForwardingAddressTemplateRequestSigningData(_ignore_input: KeetaAssetMovementAnchorListForwardingAddressTemplateClientRequest | KeetaAssetMovementAnchorListForwardingAddressTemplateRequest): Signable {\n\treturn([ 'list-templates' ]);\n}\n\n\nexport type KeetaAssetMovementAnchorListForwardingAddressTemplateResponse = (({\n\tok: true;\n\ttemplates: PersistentAddressTemplateData[];\n} & PaginationResponseInformation) | {\n\tok: false;\n\terror: string;\n});\n\n\nexport type KeetaPersistentForwardingAddressDetails = {\n\tid?: string;\n\taddress: AddressObfuscated | AddressResolved;\n\tdepositMessage?: AddressDepositMessage;\n\tasset?: AssetOrPair;\n\tsourceLocation?: AssetLocationLike;\n\tdestinationLocation?: AssetLocationLike;\n\tdestinationAddress?: AddressResolved | AddressObfuscated;\n\toutgoingRail?: Rail;\n\tincomingRail?: Rail[];\n}\n\nexport type KeetaAssetMovementAnchorCreatePersistentForwardingClientRequest = {\n\taccount?: KeetaNetAccount;\n\tsourceLocation: AssetLocationLike;\n\tasset: AssetOrPair;\n\toutgoingRail?: Rail;\n} & ({\n\tdestinationLocation: AssetLocationLike;\n\tdestinationAddress: AddressResolved;\n} | {\n\tpersistentAddressTemplateId: string;\n});\n\nexport type KeetaAssetMovementAnchorCreatePersistentForwardingRequest = {\n\taccount?: ToJSONSerializable<KeetaNetAccount> | undefined;\n\tsigned?: HTTPSignedField;\n\tsourceLocation: AssetLocationCanonical;\n\tasset: AssetOrPairCanonical;\n\toutgoingRail?: Rail | undefined;\n} & ({\n\tdestinationLocation: AssetLocationCanonical;\n\tdestinationAddress: AddressResolved;\n} | {\n\tpersistentAddressTemplateId: string;\n});\n\nexport function getKeetaAssetMovementAnchorCreatePersistentForwardingRequestSigningData(input: KeetaAssetMovementAnchorCreatePersistentForwardingClientRequest | KeetaAssetMovementAnchorCreatePersistentForwardingRequest): Signable {\n\treturn(commonToSignable({\n\t\tsourceLocation: convertAssetLocationInputToCanonical(input.sourceLocation),\n\t\tasset: convertAssetOrPairSearchInputToCanonical(input.asset),\n\t\toutgoingRail: input.outgoingRail,\n\t\t...('destinationLocation' in input ? {\n\t\t\tdestinationLocation: convertAssetLocationInputToCanonical(input.destinationLocation),\n\t\t\tdestinationAddress: input.destinationAddress\n\t\t} : {\n\t\t\tpersistentAddressTemplateId: input.persistentAddressTemplateId\n\t\t})\n\t}))\n}\n\nexport type KeetaAssetMovementAnchorCreatePersistentForwardingResponse = (({\n\tok: true;\n} & KeetaPersistentForwardingAddressDetails) | {\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaAssetMovementAnchorListPersistentForwardingClientRequest = {\n\taccount?: KeetaNetAccount;\n\tsigned?: HTTPSignedField | undefined;\n\tsearch?: {\n\t\tsourceLocation?: AssetLocationLike;\n\t\tdestinationLocation?: AssetLocationLike;\n\t\tasset?: MovableAsset;\n\t\tdestinationAddress?: string;\n\t\tpersistentAddressTemplateId?: string;\n\t}[];\n\tpagination?: PaginationQuery;\n}\n\nexport type KeetaAssetMovementAnchorListPersistentForwardingRequest = {\n\taccount?: ToJSONSerializable<KeetaNetAccount> | undefined;\n\tsigned?: HTTPSignedField | undefined;\n\tsearch?: {\n\t\tsourceLocation?: AssetLocationCanonical | undefined;\n\t\tdestinationLocation?: AssetLocationCanonical | undefined;\n\t\tasset?: MovableAssetSearchCanonical | undefined;\n\t\tdestinationAddress?: string | undefined;\n\t\tpersistentAddressTemplateId?: string | undefined;\n\t}[] | undefined;\n\tpagination?: PaginationQuery | undefined;\n}\n\nexport type KeetaAssetMovementAnchorListPersistentForwardingResponse = (({\n\tok: true;\n\taddresses: KeetaPersistentForwardingAddressDetails[];\n} & PaginationResponseInformation) | {\n\tok: false;\n\terror: string;\n});\n\nexport function getKeetaAssetMovementAnchorListPersistentForwardingRequestSigningData(_ignore_input: KeetaAssetMovementAnchorListPersistentForwardingClientRequest | KeetaAssetMovementAnchorListPersistentForwardingRequest): Signable {\n\treturn([ 'list-persistent-forwarding-addresses' ]);\n}\n\ntype PaginationQuery = {\n\tlimit?: number;\n\toffset?: number;\n}\n\ntype PaginationResponseInformation = {\n\ttotal: string;\n}\n\nexport type KeetaAssetMovementAnchorlistTransactionsClientRequest = {\n\taccount?: KeetaNetAccount;\n\tpersistentAddresses?: ({ location: AssetLocationLike; } & ({ persistentAddress?: string; persistentAddressTemplate: string; } | { persistentAddress: string; persistentAddressTemplate?: string; }))[];\n\tfrom?: { location: AssetLocationLike; userAddress?: string; asset?: MovableAsset; };\n\tto?: { location: AssetLocationLike; userAddress?: string; asset?: MovableAsset; };\n\ttransactions?: { location: AssetLocationLike; transaction: Partial<TransactionId>; }[] | undefined;\n\tpagination?: PaginationQuery;\n}\n\nexport type KeetaAssetMovementAnchorlistTransactionsRequest = {\n\taccount?: ToJSONSerializable<KeetaNetAccount> | undefined;\n\tsigned?: HTTPSignedField | undefined;\n\tpersistentAddresses?: ({ location: AssetLocationCanonical; } & ({ persistentAddress?: string | undefined; persistentAddressTemplate: string; } | { persistentAddress: string; persistentAddressTemplate?: string | undefined; }))[] | undefined;\n\tfrom?: { location: AssetLocationCanonical; userAddress?: string | undefined; asset?: MovableAsset | undefined; } | undefined;\n\tto?: { location: AssetLocationCanonical; userAddress?: string | undefined; asset?: MovableAsset | undefined; } | undefined;\n\ttransactions?: { location: AssetLocationCanonical; transaction: Partial<TransactionId>; }[] | undefined;\n\tpagination?: PaginationQuery | undefined;\n}\n\nexport function getKeetaAssetMovementAnchorlistTransactionsRequestSigningData(_ignore_input: KeetaAssetMovementAnchorlistTransactionsClientRequest | KeetaAssetMovementAnchorlistTransactionsRequest): Signable {\n\treturn([ 'list-transactions' ]);\n}\n\nexport type KeetaAssetMovementAnchorlistPersistentForwardingTransactionsResponse = (({\n\tok: true;\n\ttransactions: KeetaAssetMovementTransaction[];\n} & PaginationResponseInformation) | {\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaAssetMovementAnchorShareKYCClientRequest = {\n\taccount: KeetaNetAccount;\n\tattributes: string | SharableCertificateAttributes;\n\ttosAgreement?: { id: string; };\n}\n\nexport type KeetaAssetMovementAnchorShareKYCRequest = ConvertToExternalRequest<KeetaAssetMovementAnchorShareKYCClientRequest, {\n\tattributes: string;\n}, { signed: HTTPSignedField }>;\n\nexport function getKeetaAssetMovementAnchorShareKYCRequestSigningData(_ignore_input: KeetaAssetMovementAnchorShareKYCClientRequest | KeetaAssetMovementAnchorShareKYCRequest): Signable {\n\treturn([ 'share-kyc' ]);\n}\n\nexport type KeetaAssetMovementAnchorShareKYCResponse = (({\n\tok: true;\n} & ({\n\tisPending?: false;\n} | {\n\tisPending: true;\n\tpromiseURL?: string;\n})) | {\n\tok: false;\n\terror: string;\n});\n\nexport const assertKeetaSupportedAssetsMetadata: (input: unknown) => SupportedAssetsMetadata[] = createAssert<SupportedAssetsMetadata[]>();\nexport const assertKeetaAssetMovementAnchorCreatePersistentForwardingRequest: (input: unknown) => KeetaAssetMovementAnchorCreatePersistentForwardingRequest = createAssert<KeetaAssetMovementAnchorCreatePersistentForwardingRequest>();\nexport const assertKeetaAssetMovementAnchorCreatePersistentForwardingResponse: (input: unknown) => KeetaAssetMovementAnchorCreatePersistentForwardingResponse = createAssertEquals<KeetaAssetMovementAnchorCreatePersistentForwardingResponse>();\nexport const assertKeetaAssetMovementAnchorInitiateTransferRequest: (input: unknown) => KeetaAssetMovementAnchorInitiateTransferRequest = createAssert<KeetaAssetMovementAnchorInitiateTransferRequest>();\nexport const assertKeetaAssetMovementAnchorInitiateTransferResponse: (input: unknown) => KeetaAssetMovementAnchorInitiateTransferResponse = createAssertEquals<KeetaAssetMovementAnchorInitiateTransferResponse>();\nexport const assertKeetaAssetMovementAnchorGetTransferStatusRequest: (input: unknown) => KeetaAssetMovementAnchorGetTransferStatusRequest = createAssert<KeetaAssetMovementAnchorGetTransferStatusRequest>();\nexport const assertKeetaAssetMovementAnchorGetTransferStatusResponse: (input: unknown) => KeetaAssetMovementAnchorGetTransferStatusResponse = createAssertEquals<KeetaAssetMovementAnchorGetTransferStatusResponse>();\nexport const assertKeetaAssetMovementAnchorlistTransactionsRequest: (input: unknown) => KeetaAssetMovementAnchorlistTransactionsRequest = createAssert<KeetaAssetMovementAnchorlistTransactionsRequest>();\nexport const assertKeetaAssetMovementAnchorListPersistentForwardingRequest: (input: unknown) => KeetaAssetMovementAnchorListPersistentForwardingRequest = createAssert<KeetaAssetMovementAnchorListPersistentForwardingRequest>();\nexport const assertKeetaAssetMovementAnchorListPersistentForwardingResponse: (input: unknown) => KeetaAssetMovementAnchorListPersistentForwardingResponse = createAssertEquals<KeetaAssetMovementAnchorListPersistentForwardingResponse>();\nexport const assertKeetaAssetMovementAnchorlistPersistentForwardingTransactionsResponse: (input: unknown) => KeetaAssetMovementAnchorlistPersistentForwardingTransactionsResponse = createAssertEquals<KeetaAssetMovementAnchorlistPersistentForwardingTransactionsResponse>();\nexport const assertKeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateRequest: (input: unknown) => KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateRequest = createAssert<KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateRequest>();\nexport const assertKeetaAssetMovementAnchorListForwardingAddressTemplateRequest: (input: unknown) => KeetaAssetMovementAnchorListForwardingAddressTemplateRequest = createAssert<KeetaAssetMovementAnchorListForwardingAddressTemplateRequest>();\nexport const assertKeetaAssetMovementAnchorListForwardingAddressTemplateResponse: (input: unknown) => KeetaAssetMovementAnchorListForwardingAddressTemplateResponse = createAssertEquals<KeetaAssetMovementAnchorListForwardingAddressTemplateResponse>();\nexport const assertKeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateResponse: (input: unknown) => KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateResponse = createAssertEquals<KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateResponse>();\nexport const assertBankAccountAddressObfuscated: (input: unknown) => BankAccountAddressObfuscated = createAssert<BankAccountAddressObfuscated>();\nexport const assertBankAccountAddressResolved: (input: unknown) => BankAccountAddressResolved = createAssert<BankAccountAddressResolved>();\nexport const assertKeetaAssetMovementAnchorShareKYCRequest: (input: unknown) => KeetaAssetMovementAnchorShareKYCRequest = createAssert<KeetaAssetMovementAnchorShareKYCRequest>();\nexport const assertKeetaAssetMovementAnchorShareKYCResponse: (input: unknown) => KeetaAssetMovementAnchorShareKYCResponse = createAssertEquals<KeetaAssetMovementAnchorShareKYCResponse>();\n\nexport const isKeetaAssetMovementAnchorInitiateTransferRequest: (input: unknown) => input is KeetaAssetMovementAnchorInitiateTransferRequest = createIs<KeetaAssetMovementAnchorInitiateTransferRequest>();\nexport const isKeetaAssetMovementAnchorGetTransferStatusRequest: (input: unknown) => input is KeetaAssetMovementAnchorGetTransferStatusRequest = createIs<KeetaAssetMovementAnchorGetTransferStatusRequest>();\nexport const isKeetaAssetMovementAnchorListForwardingAddressTemplateRequest: (input: unknown) => input is KeetaAssetMovementAnchorListForwardingAddressTemplateRequest = createIs<KeetaAssetMovementAnchorListForwardingAddressTemplateRequest>();\nexport const isKeetaAssetMovementAnchorListForwardingAddressTemplateResponse: (input: unknown) => input is KeetaAssetMovementAnchorListForwardingAddressTemplateResponse = createIs<KeetaAssetMovementAnchorListForwardingAddressTemplateResponse>();\nexport const isKeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateResponse: (input: unknown) => input is KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateResponse = createIs<KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateResponse>();\nexport const isKeetaAssetMovementAnchorCreatePersistentForwardingResponse: (input: unknown) => input is KeetaAssetMovementAnchorCreatePersistentForwardingResponse = createIs<KeetaAssetMovementAnchorCreatePersistentForwardingResponse>();\nexport const isKeetaAssetMovementAnchorInitiateTransferResponse: (input: unknown) => input is KeetaAssetMovementAnchorInitiateTransferResponse = createIs<KeetaAssetMovementAnchorInitiateTransferResponse>();\nexport const isKeetaAssetMovementAnchorGetExchangeStatusResponse: (input: unknown) => input is KeetaAssetMovementAnchorGetTransferStatusResponse = createIs<KeetaAssetMovementAnchorGetTransferStatusResponse>();\nexport const isKeetaAssetMovementAnchorlistPersistentForwardingTransactionsResponse: (input: unknown) => input is KeetaAssetMovementAnchorlistPersistentForwardingTransactionsResponse = createIs<KeetaAssetMovementAnchorlistPersistentForwardingTransactionsResponse>();\nexport const isKeetaAssetMovementAnchorShareKYCResponse: (input: unknown) => input is KeetaAssetMovementAnchorShareKYCResponse = createIs<KeetaAssetMovementAnchorShareKYCResponse>();\nexport const isKeetaAssetMovementAnchorListPersistentForwardingResponse: (input: unknown) => input is KeetaAssetMovementAnchorListPersistentForwardingResponse = createIs<KeetaAssetMovementAnchorListPersistentForwardingResponse>();\n\ntype Account = InstanceType<typeof KeetaNet.lib.Account<Exclude<AccountKeyAlgorithm, IdentifierKeyAlgorithm>>>;\n\ntype KeetaAssetMovementAnchorKYCExternalURLFlow = {\n\ttype: 'url-flow';\n\turl: string;\n}\n\nexport interface KeetaAssetMovementAnchorKYCShareNeededErrorJSONProperties {\n\ttosFlow: KeetaAssetMovementAnchorKYCExternalURLFlow | undefined;\n\tneededAttributes: string[] | undefined;\n\tshareWithPrincipals: ReturnType<Account['publicKeyString']['get']>[];\n\tacceptedIssuers: { name: string; value: string; }[][];\n}\n\nexport const assertKeetaAssetMovementAnchorKYCShareNeededErrorJSONProperties: (input: unknown) => KeetaAssetMovementAnchorKYCShareNeededErrorJSONProperties = createAssertEquals<KeetaAssetMovementAnchorKYCShareNeededErrorJSONProperties>();\n\ntype KeetaAssetMovementAnchorKYCShareNeededErrorJSON = ReturnType<KeetaAnchorUserError['toJSON']> & KeetaAssetMovementAnchorKYCShareNeededErrorJSONProperties;\n\nclass KeetaAssetMovementAnchorKYCShareNeededError extends KeetaAnchorUserError {\n\tstatic override readonly name: string = 'KeetaAssetMovementAnchorKYCShareNeededError';\n\tprivate readonly KeetaAssetMovementAnchorKYCShareNeededErrorObjectTypeID!: string;\n\tprivate static readonly KeetaAssetMovementAnchorKYCShareNeededErrorObjectTypeID = '3f4d6acd-8915-40de-94fa-4c6c48c01623';\n\n\treadonly shareWithPrincipals: Account[];\n\treadonly neededAttributes: string[] | undefined;\n\treadonly tosFlow: KeetaAssetMovementAnchorKYCExternalURLFlow | undefined;\n\treadonly acceptedIssuers: { name: string; value: string; }[][];\n\n\tconstructor(args: {\n\t\tneededAttributes?: string[] | undefined;\n\t\tshareWithPrincipals: Account[];\n\t\ttosFlow?: KeetaAssetMovementAnchorKYCExternalURLFlow | undefined;\n\t\tacceptedIssuers: { name: string; value: string; }[][];\n\t}, message?: string) {\n\t\tsuper(message ?? 'User Not Onboarded to Asset Movement Service');\n\t\tthis.statusCode = 403;\n\n\t\tObject.defineProperty(this, 'KeetaAssetMovementAnchorKYCShareNeededErrorObjectTypeID', {\n\t\t\tvalue: KeetaAssetMovementAnchorKYCShareNeededError.KeetaAssetMovementAnchorKYCShareNeededErrorObjectTypeID,\n\t\t\tenumerable: false\n\t\t});\n\n\t\tthis.neededAttributes = args.neededAttributes;\n\t\tthis.tosFlow = args.tosFlow;\n\t\tthis.shareWithPrincipals = args.shareWithPrincipals;\n\t\tthis.acceptedIssuers = args.acceptedIssuers;\n\t}\n\n\tstatic isInstance(input: unknown): input is KeetaAssetMovementAnchorKYCShareNeededError {\n\t\treturn(this.hasPropWithValue(input, 'KeetaAssetMovementAnchorKYCShareNeededErrorObjectTypeID', KeetaAssetMovementAnchorKYCShareNeededError.KeetaAssetMovementAnchorKYCShareNeededErrorObjectTypeID));\n\t}\n\n\n\tasErrorResponse(contentType: 'text/plain' | 'application/json'): { error: string; statusCode: number; contentType: string } {\n\t\tconst { tosFlow, neededAttributes, shareWithPrincipals, acceptedIssuers } = this.toJSON();\n\n\t\tlet message = this.message;\n\t\tif (contentType === 'application/json') {\n\t\t\tmessage = JSON.stringify({\n\t\t\t\tok: false,\n\t\t\t\tname: this.name,\n\t\t\t\tcode: 'KEETA_ANCHOR_ASSET_MOVEMENT_KYC_SHARE_NEEDED',\n\t\t\t\tdata: { tosFlow, neededAttributes, shareWithPrincipals, acceptedIssuers },\n\t\t\t\terror: this.message\n\t\t\t});\n\t\t}\n\n\t\treturn({\n\t\t\terror: message,\n\t\t\tstatusCode: this.statusCode,\n\t\t\tcontentType: contentType\n\t\t});\n\t}\n\n\ttoJSON(): KeetaAssetMovementAnchorKYCShareNeededErrorJSON {\n\t\treturn({\n\t\t\t...super.toJSON(),\n\t\t\ttosFlow: this.tosFlow,\n\t\t\tneededAttributes: this.neededAttributes,\n\t\t\tshareWithPrincipals: this.shareWithPrincipals.map(function(account) {\n\t\t\t\treturn(account.publicKeyString.get());\n\t\t\t}),\n\t\t\tacceptedIssuers: this.acceptedIssuers\n\t\t});\n\t}\n\n\tstatic async fromJSON(input: unknown): Promise<KeetaAssetMovementAnchorKYCShareNeededError> {\n\t\tconst { message, other } = this.extractErrorProperties(input, this);\n\n\t\tif (!('data' in other)) {\n\t\t\tthrow(new Error('Invalid KeetaAssetMovementAnchorKYCShareNeededError JSON: missing data property'));\n\t\t}\n\n\t\tconst parsed = assertKeetaAssetMovementAnchorKYCShareNeededErrorJSONProperties(other.data);\n\n\t\tconst error = new this(\n\t\t\t{\n\t\t\t\tshareWithPrincipals: parsed.shareWithPrincipals.map(function(pubKeyString) {\n\t\t\t\t\treturn(KeetaNet.lib.Account.fromPublicKeyString(pubKeyString).assertAccount());\n\t\t\t\t}),\n\t\t\t\tneededAttributes: parsed.neededAttributes,\n\t\t\t\ttosFlow: parsed.tosFlow,\n\t\t\t\tacceptedIssuers: parsed.acceptedIssuers\n\t\t\t},\n\t\t\tmessage\n\t\t);\n\n\t\terror.restoreFromJSON(other);\n\t\treturn(error);\n\t}\n}\n\nexport interface KeetaAssetMovementAnchorAdditionalKYCNeededErrorJSONProperties {\n\ttoCompleteFlow: KeetaAssetMovementAnchorKYCExternalURLFlow | undefined;\n}\n\nexport const assertKeetaAssetMovementAnchorAdditionalKYCNeededErrorJSONProperties: (input: unknown) => KeetaAssetMovementAnchorAdditionalKYCNeededErrorJSONProperties = createAssertEquals<KeetaAssetMovementAnchorAdditionalKYCNeededErrorJSONProperties>();\n\ntype KeetaAssetMovementAnchorAdditionalKYCNeededErrorJSON = ReturnType<KeetaAnchorUserError['toJSON']> & KeetaAssetMovementAnchorAdditionalKYCNeededErrorJSONProperties;\n\nclass KeetaAssetMovementAnchorAdditionalKYCNeededError extends KeetaAnchorUserError {\n\tstatic override readonly name: string = 'KeetaAssetMovementAnchorAdditionalKYCNeededError';\n\tprivate readonly KeetaAssetMovementAnchorAdditionalKYCNeededErrorObjectTypeID!: string;\n\tprivate static readonly KeetaAssetMovementAnchorAdditionalKYCNeededErrorObjectTypeID = '3f4d6acd-8915-40de-94fa-4c6c48c01623';\n\n\treadonly toCompleteFlow: KeetaAssetMovementAnchorKYCExternalURLFlow | undefined;\n\n\tconstructor(args: KeetaAssetMovementAnchorAdditionalKYCNeededErrorJSONProperties, message?: string) {\n\t\tsuper(message ?? 'User requires additional KYC to proceed with asset movement');\n\t\tthis.statusCode = 403;\n\n\t\tObject.defineProperty(this, 'KeetaAssetMovementAnchorAdditionalKYCNeededErrorObjectTypeID', {\n\t\t\tvalue: KeetaAssetMovementAnchorAdditionalKYCNeededError.KeetaAssetMovementAnchorAdditionalKYCNeededErrorObjectTypeID,\n\t\t\tenumerable: false\n\t\t});\n\n\t\tthis.toCompleteFlow = args.toCompleteFlow;\n\t}\n\n\tstatic isInstance(input: unknown): input is KeetaAssetMovementAnchorAdditionalKYCNeededError {\n\t\treturn(this.hasPropWithValue(input, 'KeetaAssetMovementAnchorAdditionalKYCNeededErrorObjectTypeID', KeetaAssetMovementAnchorAdditionalKYCNeededError.KeetaAssetMovementAnchorAdditionalKYCNeededErrorObjectTypeID));\n\t}\n\n\n\tasErrorResponse(contentType: 'text/plain' | 'application/json'): { error: string; statusCode: number; contentType: string } {\n\t\tconst { toCompleteFlow } = this.toJSON();\n\n\t\tlet message = this.message;\n\t\tif (contentType === 'application/json') {\n\t\t\tmessage = JSON.stringify({\n\t\t\t\tok: false,\n\t\t\t\tname: this.name,\n\t\t\t\tcode: 'KEETA_ANCHOR_ASSET_MOVEMENT_ADDITIONAL_KYC_NEEDED',\n\t\t\t\tdata: { toCompleteFlow },\n\t\t\t\terror: this.message\n\t\t\t});\n\t\t}\n\n\t\treturn({\n\t\t\terror: message,\n\t\t\tstatusCode: this.statusCode,\n\t\t\tcontentType: contentType\n\t\t});\n\t}\n\n\ttoJSON(): KeetaAssetMovementAnchorAdditionalKYCNeededErrorJSON {\n\t\treturn({\n\t\t\t...super.toJSON(),\n\t\t\ttoCompleteFlow: this.toCompleteFlow\n\t\t});\n\t}\n\n\tstatic async fromJSON(input: unknown): Promise<KeetaAssetMovementAnchorAdditionalKYCNeededError> {\n\t\tconst { message, other } = this.extractErrorProperties(input, this);\n\n\t\tif (!('data' in other)) {\n\t\t\tthrow(new Error('Invalid KeetaAssetMovementAnchorAdditionalKYCNeededError JSON: missing data property'));\n\t\t}\n\n\t\tconst parsed = assertKeetaAssetMovementAnchorAdditionalKYCNeededErrorJSONProperties(other.data);\n\n\t\tconst error = new this(\n\t\t\t{\n\t\t\t\ttoCompleteFlow: parsed.toCompleteFlow\n\t\t\t},\n\t\t\tmessage\n\t\t);\n\n\t\terror.restoreFromJSON(other);\n\t\treturn(error);\n\t}\n}\n\n\nexport interface KeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties {\n\tforAsset?: AssetOrPair | undefined;\n\tforRail?: Rail | undefined;\n}\n\nexport const assertKeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties: (input: unknown) => KeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties = createAssertEquals<KeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties>();\n\ntype KeetaAssetMovementAnchorOperationNotSupportedErrorJSON = ReturnType<KeetaAnchorUserError['toJSON']> & KeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties;\n\nclass KeetaAssetMovementAnchorOperationNotSupportedError extends KeetaAnchorUserError implements KeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties {\n\tstatic override readonly name: string = 'KeetaAssetMovementAnchorOperationNotSupportedError';\n\tprivate readonly KeetaAssetMovementAnchorOperationNotSupportedErrorObjectTypeID!: string;\n\tprivate static readonly KeetaAssetMovementAnchorOperationNotSupportedErrorObjectTypeID = 'b613cd80-57ac-4be5-ad4a-bb8644d50de6';\n\n\treadonly forAsset: AssetOrPair | undefined;\n\treadonly forRail: Rail | undefined;\n\n\tconstructor(args: KeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties, message?: string) {\n\t\tsuper(message ?? `Operation not supported`);\n\t\tthis.statusCode = 400;\n\n\t\tObject.defineProperty(this, 'KeetaAssetMovementAnchorOperationNotSupportedErrorObjectTypeID', {\n\t\t\tvalue: KeetaAssetMovementAnchorOperationNotSupportedError.KeetaAssetMovementAnchorOperationNotSupportedErrorObjectTypeID,\n\t\t\tenumerable: false\n\t\t});\n\n\t\tthis.forAsset = args.forAsset;\n\t\tthis.forRail = args.forRail;\n\t}\n\n\tstatic isInstance(input: unknown): input is KeetaAssetMovementAnchorOperationNotSupportedError {\n\t\treturn(this.hasPropWithValue(input, 'KeetaAssetMovementAnchorOperationNotSupportedErrorObjectTypeID', KeetaAssetMovementAnchorOperationNotSupportedError.KeetaAssetMovementAnchorOperationNotSupportedErrorObjectTypeID));\n\t}\n\n\tasErrorResponse(contentType: 'text/plain' | 'application/json'): { error: string; statusCode: number; contentType: string } {\n\t\tconst { forAsset, forRail } = this.toJSON();\n\n\t\tlet message = this.message;\n\t\tif (contentType === 'application/json') {\n\t\t\tmessage = JSON.stringify({\n\t\t\t\tok: false,\n\t\t\t\tname: this.name,\n\t\t\t\tcode: 'KEETA_ANCHOR_ASSET_MOVEMENT_OPERATION_NOT_SUPPORTED',\n\t\t\t\tdata: { forAsset, forRail },\n\t\t\t\terror: this.message\n\t\t\t});\n\t\t}\n\n\t\treturn({\n\t\t\terror: message,\n\t\t\tstatusCode: this.statusCode,\n\t\t\tcontentType: contentType\n\t\t});\n\t}\n\n\ttoJSON(): KeetaAssetMovementAnchorOperationNotSupportedErrorJSON {\n\t\treturn({\n\t\t\t...super.toJSON(),\n\t\t\tforRail: this.forRail,\n\t\t\tforAsset: this.forAsset ? convertAssetOrPairSearchInputToCanonical(this.forAsset) : undefined\n\t\t});\n\t}\n\n\tstatic async fromJSON(input: unknown): Promise<KeetaAssetMovementAnchorOperationNotSupportedError> {\n\t\tconst { message, other } = this.extractErrorProperties(input, this);\n\n\t\tif (!('data' in other)) {\n\t\t\tthrow(new Error('Invalid KeetaAssetMovementAnchorOperationNotSupportedError JSON: missing data property'));\n\t\t}\n\n\t\tconst parsed = assertKeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties(other.data);\n\n\t\tconst error = new this(\n\t\t\t{\n\t\t\t\tforAsset: parsed.forAsset,\n\t\t\t\tforRail: parsed.forRail\n\t\t\t},\n\t\t\tmessage\n\t\t);\n\n\t\terror.restoreFromJSON(other);\n\t\treturn(error);\n\t}\n}\n\nexport const Errors: {\n\tKYCShareNeeded: typeof KeetaAssetMovementAnchorKYCShareNeededError;\n\tAdditionalKYCNeeded: typeof KeetaAssetMovementAnchorAdditionalKYCNeededError;\n\tOperationNotSupported: typeof KeetaAssetMovementAnchorOperationNotSupportedError;\n} = {\n\t/**\n\t * The user is required to share KYC details\n\t */\n\tKYCShareNeeded: KeetaAssetMovementAnchorKYCShareNeededError,\n\n\t/**\n\t * The user is required to complete additional KYC steps\n\t */\n\tAdditionalKYCNeeded: KeetaAssetMovementAnchorAdditionalKYCNeededError,\n\n\t/**\n\t * The requested operation is not supported\n\t */\n\tOperationNotSupported: KeetaAssetMovementAnchorOperationNotSupportedError\n};\n"]}
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/services/asset-movement/common.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,QAAQ,MAAM,+BAA+B,CAAC;AAC1D,OAA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CAAC,CAAC;IACJ,CAAC;IAED,MAAM;QACL,OAAM,CAAC;YACN,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,wCAAwC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;SAC7F,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEpE,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,EAAE,CAAC;YACxB,MAAK,CAAC,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAC,CAAC;QAC5G,CAAC;QAED,MAAM,MAAM,GAAG,sEAAsE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAElG,MAAM,KAAK,GAAG,IAAI,IAAI,CACrB;YACC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,OAAO,EAAE,MAAM,CAAC,OAAO;SACvB,EACD,OAAO,CACP,CAAC;QAEF,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAM,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;;AAGF,MAAM,CAAC,MAAM,MAAM,GAIf;IACH;;OAEG;IACH,cAAc,EAAE,2CAA2C;IAE3D;;OAEG;IACH,mBAAmB,EAAE,gDAAgD;IAErE;;OAEG;IACH,qBAAqB,EAAE,kDAAkD;CACzE,CAAC","sourcesContent":["import type { ServiceMetadata } from '../../lib/resolver.ts';\nimport type * as CurrencyInfo from '@keetanetwork/currency-info';\nimport type { AccountKeyAlgorithm, GenericAccount, IdentifierKeyAlgorithm, TokenPublicKeyString } from '@keetanetwork/keetanet-client/lib/account.js';\nimport type { JSONSerializable, ToJSONSerializable } from '@keetanetwork/keetanet-client/lib/utils/conversion.js';\nimport type { HTTPSignedField } from '../../lib/http-server/common.js';\nimport type { Signable } from '../../lib/utils/signing.js';\nimport type { SharableCertificateAttributes } from '../../lib/certificates.js';\nimport * as KeetaNet from '@keetanetwork/keetanet-client';\nimport { KeetaAnchorUserError } from '../../lib/error.js';\nimport type { AssetLocationLike, AssetLocationString, AssetLocationInput, AssetLocationCanonical, ChainLocationString } from './lib/location.js';\nimport { convertAssetLocationInputToCanonical } from './lib/location.js';\nimport type { BankAccountAddressObfuscated, BankAccountAddressResolved, MobileWalletAddressObfuscated, MobileWalletAddressResolved, MonthYearDateInput, PhysicalAddress } from './lib/data/addresses/types.generated.js';\nimport type { HexString, KeetaNetAccount, MovableAsset, MovableAssetSearchCanonical, CurrencySearchCanonical, ExternalChainLocationType, ExternalChainAsset } from '../../lib/asset.js';\nimport { convertAssetSearchInputToCanonical } from '../../lib/asset.js';\nimport { assertKeetaAssetMovementAnchorAdditionalKYCNeededErrorJSONProperties, assertKeetaAssetMovementAnchorKYCShareNeededErrorJSONProperties, assertKeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties } from './common.generated.js';\nimport type { ClientRenderableContent } from '../../lib/metadata.types.js';\nimport type { TokenMetadata } from '../../lib/token-metadata.js';\n\nexport * from './lib/data/addresses/types.generated.js';\n\nexport * from './lib/location.js';\n\nexport * from './common.generated.js';\n\nexport type {\n\tHexString,\n\tKeetaNetAccount,\n\tKeetaNetTokenPublicKeyString,\n\tEVMAsset,\n\tTronAsset,\n\tSolanaAsset,\n\tChainAssetString,\n\tMovableAssetSearchInput,\n\tMovableAssetSearchCanonical,\n\tMovableAsset,\n\tCurrencySearchCanonical,\n\tCurrencySearchInput,\n\tTokenSearchInput,\n\tTokenSearchCanonical\n} from '../../lib/asset.js';\n\nexport {\n\ttoEVMAsset,\n\tparseEVMAsset,\n\tisEVMAsset,\n\ttoTronAsset,\n\tparseTronAsset,\n\tisTronAsset,\n\ttoSolanaAsset,\n\tparseSolanaAsset,\n\tisSolanaAsset,\n\tconvertAssetSearchInputToCanonical,\n\tisExternalChainAsset\n} from '../../lib/asset.js';\n\nexport type ISOCountryCode = CurrencyInfo.ISOCountryCode;\n\ntype RailOrRails = Rail | Rail[];\n\n/**\n * Search criteria for filtering asset movement rails when searching for supported rails for a given transfer.\n * This can be either a single rail or an array of rails, and can be specified for inbound, outbound or common rails.\n *\n * If a single rail or array of rails is provided, it will be applied to both inbound and outbound rails.\n * If separate inbound and outbound rails are provided, they will be applied to their respective directions.\n *\n * For both methods, this will look for providers that support at least one of the specified rails in the respective direction(s).\n * For example, if { inbound: ['ACH', 'WIRE'] } is provided, it will match providers that support either ACH or WIRE inbound rails.\n */\nexport type AssetMovementRailSearchInput = RailOrRails | ({ inbound: RailOrRails; outbound?: RailOrRails } | { inbound?: RailOrRails; outbound: RailOrRails });\n\nexport type ProviderSearchInput = {\n\tasset?: MovableAsset | AssetPair;\n\tfrom?: AssetLocationInput;\n\tto?: AssetLocationInput;\n\trail?: AssetMovementRailSearchInput;\n}\n\n// A given asset should have a location and ID for the contract or public key for that asset\nexport interface Asset {\n\tlocation?: AssetLocationString;\n\t/**\n\t * Keeta token public key string, external chain asset, ticker, or a currency code\n\t */\n\tid: AssetMetadataTargetValue;\n}\n\nexport type FiatPullRails = 'ACH_DEBIT' | 'CARD_PULL';\nexport type FiatPushRails = 'ACH' | 'WIRE' | 'PIX_PUSH' | 'SPEI_PUSH' | 'WIRE_INTL_PUSH' | 'SEPA_PUSH' | 'MOBILE_WALLET' | 'INTERAC_PUSH' | 'FPS_PUSH' | 'CARD_PUSH' | 'HK_FPS_PUSH' | 'BCR_PAY_PUSH' | 'DUIT_NOW_PUSH' | 'PAY_NOW_PUSH' | 'UPI_PUSH';\nexport type FiatRails = FiatPullRails | FiatPushRails;\nexport type CryptoRails = 'KEETA_SEND' | 'EVM_SEND' | 'EVM_CALL' | 'SOLANA_SEND' | 'BITCOIN_SEND' | 'TRON_SEND';\nexport type Rail = FiatRails | CryptoRails;\n\n// Rails can be inbound, outbound or common (inbound and outbound)\nexport interface AssetWithRails extends Asset {\n\trails: (({\n\t\tinbound: RailOrRailWithExtendedDetails[];\n\t\toutbound?: RailOrRailWithExtendedDetails[];\n\t} | {\n\t\tinbound?: RailOrRailWithExtendedDetails[];\n\t\toutbound: RailOrRailWithExtendedDetails[];\n\t} | {\n\t\tinbound?: never;\n\t\toutbound?: never;\n\t}) & {\n\t\tcommon?: RailOrRailWithExtendedDetails[];\n\t});\n};\n\n// A given asset path should consist of exactly one tuple of locations\nexport interface AssetPath {\n\t/**\n\t * The asset or asset pair for this path, with from and to locations supporting the assets in the pair\n\t */\n\tpair: [ AssetWithRails, AssetWithRails ];\n\n\t/**\n\t * KYC providers which this Asset Movement Provider\n\t * supports (DN) -- if not specified,\n\t * then it does not require KYC.\n\t */\n\tkycProviders?: string[];\n};\n\nexport interface AnchorTokenLocationMetadata extends TokenMetadata {\n\tdisplayName?: string;\n\tticker?: `$${string}`;\n}\n\nexport type PerChainLocationMetadata<Chain extends ExternalChainLocationType = ExternalChainLocationType> = {\n\tassets?: {\n\t\t[AssetId in ExternalChainAsset<Chain>]?: AnchorTokenLocationMetadata | undefined;\n\t}\n};\n\nexport type AnchorCustomLocationMetadata = {\n\t[Chain in ExternalChainLocationType]?: {\n\t\t[Location in ChainLocationString<Chain>]?: PerChainLocationMetadata<Chain> | undefined;\n\t};\n}[ExternalChainLocationType];\n\nexport type AssetMetadataTargetValue = TokenPublicKeyString | CurrencySearchCanonical | `$${string}` | ExternalChainAsset;\nexport interface SupportedAssetsMetadata {\n\tasset: AssetMetadataTargetValue | [ AssetMetadataTargetValue, AssetMetadataTargetValue ];\n\tpaths: AssetPath[];\n}\n\n\nexport interface RailWithExtendedDetails {\n\trail: Rail;\n\n\t/**\n\t * An estimate of the time it will take for a transfer using this rail to complete, in milliseconds. This can be a single number or a tuple representing an estimated range [min, max].\n\t */\n\testimatedTransferTimeMs?: number | [ minEstimateMs: number, maxEstimateMs: number ];\n\n\t/**\n\t * Minimum/Maximum transfer value details for this rail, if applicable.\n\t */\n\testimatedTransferValueRange?: {\n\t\t/**\n\t\t * Min/max transfer value range, as a string in the asset's smallest unit (e.g. cents for USD, or 1/(10**6) for USDC).\n\t\t */\n\t\tvalue: [ string | undefined, string | undefined ];\n\n\t\t/**\n\t\t * The asset in which the min transfer value is denominated. If omitted, it is assumed to be the same as the source asset being transferred.\n\t\t */\n\t\tasset?: MovableAssetSearchCanonical;\n\t}\n\n\t/**\n\t * Fee estimate details for this rail, if applicable.\n\t */\n\testimatedFee?: {\n\t\tfixedFee?: {\n\t\t\t/**\n\t\t\t * Transfer fixed fee, as a string in the asset's smallest unit (e.g. cents for USD, or 1/(10**6) for USDC).\n\t\t\t */\n\t\t\tvalue: string;\n\n\t\t\t/**\n\t\t\t * The asset in which the fixed fee is denominated. If omitted, it is assumed to be the same as the source asset being transferred.\n\t\t\t */\n\t\t\tasset?: MovableAssetSearchCanonical;\n\t\t}\n\n\t\t/**\n\t\t * Estimated transfer variable fee in basis points (bps). 1 bps = 0.01%\n\t\t */\n\t\tvariableFeeBps?: number;\n\t}\n\n\t/**\n\t * Supported operations for this rail\n\t */\n\tsupportedOperations?: {\n\t\t/**\n\t\t * Whether this rail supports creating persistent forwarding addresses for (unmanaged) transfers\n\t\t */\n\t\tcreatePersistentForwarding?: boolean;\n\n\t\t/**\n\t\t * Whether this rail supports initiating (managed) transfers\n\t\t */\n\t\tinitiateTransfer?: boolean;\n\t}\n}\n\nexport type RailOrRailWithExtendedDetails = Rail | RailWithExtendedDetails;\n\n\nexport function commonJSONStringify(input: unknown): string {\n\treturn(JSON.stringify(input, function(_, value: unknown) {\n\t\tif (typeof value === 'bigint') {\n\t\t\treturn(String(value));\n\t\t} else if (KeetaNet.lib.Account.isInstance(value)) {\n\t\t\treturn(value.publicKeyString.get());\n\t\t}\n\n\t\treturn(value);\n\t}));\n}\n\ntype SignableObjectInput =\n\t// PhysicalAddress/MonthYearDateInput/RecipientResolved should not be needed here, but due to a TypeScript issue we need to reference it directly because it cannot satisfy the index signature otherwise.\n\tPhysicalAddress | MonthYearDateInput | RecipientResolved |\n\t{ [key: string | number | symbol]: SignableObjectInput } |\n\tSignableObjectInput[] |\n\tSignable[number] |\n\tundefined |\n\tnull |\n\tboolean;\n\n/**\n * The maximum queue length for the commonToSignable function to prevent DoS attacks\n */\nconst TO_SIGNABLE_MAX_QUEUE_LENGTH = 250;\n\nfunction commonToSignable(item: SignableObjectInput): Signable {\n\tconst queue: [ string, SignableObjectInput ][] = [[ '', item ]];\n\tconst result: [ string, Signable[number] ][] = [];\n\n\twhile (queue.length > 0) {\n\t\tconst next = queue.shift();\n\n\t\tif (!next) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [ prefix, current ] = next;\n\t\tif (current === null || current === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (typeof current === 'boolean') {\n\t\t\tresult.push([ prefix, current ? 1 : 0 ]);\n\t\t} else if (Array.isArray(current)) {\n\t\t\tfor (let i = 0; i < current.length; i++) {\n\t\t\t\tqueue.push([ `${prefix}[${i}]`, current[i] ]);\n\t\t\t}\n\t\t} else if (typeof current === 'object') {\n\t\t\tfor (const [ key, value ] of Object.entries(current)) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t\t\tqueue.push([ prefix ? `${prefix}.${key}` : key, value as SignableObjectInput ]);\n\t\t\t}\n\t\t} else {\n\t\t\tresult.push([ prefix, current ]);\n\t\t}\n\n\t\tif (queue.length > TO_SIGNABLE_MAX_QUEUE_LENGTH) {\n\t\t\tthrow(new KeetaAnchorUserError('Too much data to sign in commonToSignable'));\n\t\t}\n\t}\n\n\tresult.sort((a, b) => {\n\t\treturn(a[0].localeCompare(b[0], 'en-US', {\n\t\t\tusage: 'sort',\n\t\t\tnumeric: true,\n\t\t\tsensitivity: 'case',\n\t\t\tignorePunctuation: false\n\t\t}));\n\t});\n\n\treturn(result.map(item => item[1]));\n}\n\nexport type AssetPair<From extends MovableAsset = MovableAsset, To extends MovableAsset = MovableAsset> = { from: From; to: To; };\nexport type AssetOrPair = MovableAsset | AssetPair;\n\nexport type AssetPairCanonical<From extends MovableAssetSearchCanonical = MovableAssetSearchCanonical, To extends MovableAssetSearchCanonical = MovableAssetSearchCanonical> = { from: From; to: To; };\nexport type AssetOrPairCanonical = MovableAssetSearchCanonical | AssetPairCanonical;\n\nfunction isAssetPairLike(input: unknown): input is AssetPair {\n\treturn(typeof input === 'object' && input !== null && 'from' in input && 'to' in input);\n}\n\nexport function toAssetPair(input: AssetOrPair): AssetPair {\n\tif (isAssetPairLike(input)) {\n\t\treturn(input);\n\t}\n\n\treturn({ from: input, to: input });\n}\n\n\nexport function convertAssetOrPairSearchInputToCanonical(input: MovableAsset): MovableAssetSearchCanonical;\nexport function convertAssetOrPairSearchInputToCanonical(input: AssetPair): AssetPairCanonical;\nexport function convertAssetOrPairSearchInputToCanonical(input: AssetOrPair): AssetOrPairCanonical;\nexport function convertAssetOrPairSearchInputToCanonical(input: AssetOrPair): AssetOrPairCanonical {\n\tif (isAssetPairLike(input)) {\n\t\treturn({\n\t\t\tfrom: convertAssetSearchInputToCanonical(input.from),\n\t\t\tto: convertAssetSearchInputToCanonical(input.to)\n\t\t});\n\t} else {\n\t\treturn(convertAssetSearchInputToCanonical(input));\n\t}\n}\n\n\nexport type Operations = NonNullable<ServiceMetadata['services']['assetMovement']>[string]['operations'];\nexport type OperationNames = keyof Operations;\n\nexport type PersistentAddressRecipient = { type: 'persistent-address'; persistentAddressId: string; };\nexport type PersistentAddressTemplateRecipient = { type: 'persistent-address-template'; persistentAddressTemplateId: string; };\nexport type PersistentAddressOrTemplateRecipient = PersistentAddressRecipient | PersistentAddressTemplateRecipient;\nexport type RecipientResolved = AddressResolved | PersistentAddressOrTemplateRecipient;\n\n/**\n * Optional deposit message to include with the transfer, ex: for wire this is a reference note.\n */\ntype AddressDepositMessage = string;\n\ntype ConvertToExternalRequest<\n\tInternal extends object,\n\tOverrides,\n\tSigned = { signed?: HTTPSignedField | undefined }\n> =\n\tToJSONSerializable<Omit<Internal, keyof Overrides>> &\n\tOverrides &\n\tSigned;\n\n/**\n * The client-side request type for initiating an asset transfer via the Keeta Asset Movement Anchor service\n */\nexport type KeetaAssetMovementAnchorInitiateTransferClientRequest = {\n\t/**\n\t * Optional KeetaNet account to use for signing the request\n\t */\n\taccount?: KeetaNetAccount | undefined;\n\n\t/**\n\t * The asset or asset pair to transfer, if a pair is given the from and to locations must support both assets in the pair\n\t */\n\tasset: AssetOrPair;\n\n\t/**\n\t * The source location for the asset transfer\n\t */\n\tfrom: { location: AssetLocationLike; };\n\n\t/**\n\t * The destination location and recipient for the asset transfer\n\t */\n\tto: {\n\t\tlocation: AssetLocationLike;\n\t\trecipient: RecipientResolved;\n\t\tdepositMessage?: AddressDepositMessage;\n\t};\n\n\t/**\n\t * The amount of the asset to transfer, as a string in the asset's smallest unit (e.g. cents for USD).\n\t */\n\tvalue: string | bigint;\n\n\t/**\n\t * Optional list of allowed rails for the transfer, the service should throw an error if none of the allowed rails are available\n\t */\n\tallowedRails?: Rail[];\n}\n\n/**\n * The serialized HTTP Body for the {@link KeetaAssetMovementAnchorInitiateTransferClientRequest} request\n */\nexport type KeetaAssetMovementAnchorInitiateTransferRequest = ConvertToExternalRequest<KeetaAssetMovementAnchorInitiateTransferClientRequest, {\n\tasset: AssetOrPairCanonical;\n\tfrom: { location: AssetLocationCanonical; };\n\tto: { location: AssetLocationCanonical; recipient: RecipientResolved; depositMessage?: AddressDepositMessage; };\n}>;\n\nexport function getKeetaAssetMovementAnchorInitiateTransferRequestSigningData(input: KeetaAssetMovementAnchorInitiateTransferClientRequest | KeetaAssetMovementAnchorInitiateTransferRequest): Signable {\n\treturn(commonToSignable({\n\t\tasset: convertAssetOrPairSearchInputToCanonical(input.asset),\n\t\tfrom: { location: convertAssetLocationInputToCanonical(input.from.location) },\n\t\tto: { location: convertAssetLocationInputToCanonical(input.to.location), recipient: input.to.recipient },\n\t\tvalue: String(input.value)\n\t}));\n}\n\n/**\n * Fee line item type in an asset transfer fee breakdown, showing the purpose of each fee line item.\n */\nexport type AssetFeeLineItemType = 'RAIL' | 'NETWORK' | 'PROVIDER' | 'VALUE_VARIABLE' | 'OTHER';\n\n/**\n * Breakdown of fees for an asset transfer, including line items and total amounts.\n */\nexport type AssetFeeBreakdown = {\n\tlineItems: {\n\t\t/**\n\t\t * The amount of the fee line item, as a string in the asset's smallest unit (e.g. cents for USD).\n\t\t */\n\t\tvalue: string;\n\n\t\t/**\n\t\t * The purpose of the fee line item. @see AssetFeeLineItemType\n\t\t */\n\t\tpurpose: AssetFeeLineItemType;\n\n\t\t/**\n\t\t * The asset in which the fee line item is denominated. If omitted, it is assumed to be the same as the asset being transferred.\n\t\t */\n\t\tasset?: MovableAssetSearchCanonical;\n\t}[];\n\t/**\n\t * The total fee amount priced in a canonical asset. If omitted, the total is assumed to be in the asset being transferred.\n\t */\n\ttotalPricedIn?: MovableAssetSearchCanonical;\n\n\t/**\n\t * The total fee amount, as a string in the asset's smallest unit (e.g. cents for USD).\n\t */\n\ttotal: string;\n};\n\n/**\n * An instruction on how to complete a transfer, ex: where to send tokens, or where to wire USD.\n */\nexport type AssetTransferInstructions = ({\n\ttype: 'KEETA_SEND';\n\n\t/**\n\t * The location from which to send the asset for this instruction, this will only be a keeta chain location.\n\t */\n\tlocation: AssetLocationLike;\n\n\t/**\n\t * The keeta wallet address to send to\n\t */\n\tsendToAddress: ReturnType<GenericAccount['publicKeyString']['get']>;\n\n\t/**\n\t * Amount to send, as a string in the asset's smallest unit.\n\t */\n\tvalue: string;\n\n\t/**\n\t * The token address to send.\n\t */\n\ttokenAddress: TokenPublicKeyString;\n\n\t/**\n\t * If provided, the value to put in the external field of the send operation.\n\t */\n\texternal?: string;\n} | {\n\ttype: 'EVM_SEND';\n\t/**\n\t * The EVM location from which to send the asset for this instruction.\n\t */\n\tlocation: AssetLocationLike;\n\n\t/**\n\t * EVM address to send to\n\t */\n\tsendToAddress: HexString;\n\n\t/**\n\t * Amount to send, as a string in the asset's smallest unit.\n\t */\n\tvalue: string;\n\n\t/**\n\t * The EVM token contract address to send.\n\t */\n\ttokenAddress: HexString;\n} | {\n\t/**\n\t * An EVM contract call instruction, used for assets that require contract interaction to transfer (ex: ERC20 contract deposit() method).\n\t */\n\ttype: 'EVM_CALL';\n\n\t/**\n\t * The EVM location on which the contract call should be made.\n\t */\n\tlocation: AssetLocationLike;\n\n\t/**\n\t * The EVM contract address to call.\n\t */\n\tcontractAddress: HexString;\n\n\t/**\n\t * The method name to call on the contract. Should be either the full method signature (ex: deposit(uint256 value)), or the hashed method ID.\n\t */\n\tcontractMethodName: string;\n\n\t/**\n\t * The arguments to pass to the contract method, as an array of strings.\n\t */\n\tcontractMethodArgs: string[];\n} | {\n\ttype: FiatPushRails;\n\n\t/**\n\t * The resolved bank account address details to send funds to\n\t */\n\taccount: BankAccountAddressResolved;\n\n\tdepositMessage?: AddressDepositMessage;\n\n\t/**\n\t * Amount to send, as a string in the asset's smallest unit (e.g. cents for USD).\n\t */\n\tvalue: string;\n} |\n/**\n * Instructions when pulling funds from a persistent address.\n * If the user wants to execute this instruction, they will need to call the executeInstruction endpoint with the transfer id\n */\n{\n\ttype: FiatPullRails;\n\n\t/**\n\t * The previously created persistent address template or persistent address to pull funds from\n\t */\n\tpullFrom: PersistentAddressOrTemplateRecipient;\n} | {\n\ttype: 'TRON_SEND';\n\tlocation: AssetLocationLike;\n\n\t/**\n\t * Tron address to send to\n\t */\n\tsendToAddress: string;\n\n\t/**\n\t * Amount to send, as a string in the asset's smallest unit (e.g. SUN for TRX).\n\t */\n\tvalue: string;\n\n\t/**\n\t * TRC20 token contract address if non-TRX.\n\t * Omitting will indicate native TRX.\n\t */\n\ttokenAddress?: string;\n} | {\n\ttype: 'BITCOIN_SEND';\n\tlocation: AssetLocationLike;\n\n\t/**\n\t * Bitcoin address to send to\n\t */\n\tsendToAddress: string;\n\n\t/**\n\t * Amount in sats to send, as a string\n\t */\n\tvalue: string;\n} | {\n\ttype: 'SOLANA_SEND';\n\tlocation: AssetLocationLike;\n\n\t/**\n\t * Solana recipient address (base58 pubkey).\n\t */\n\tsendToAddress: string;\n\n\t/**\n\t * Amount to send, as a string (e.g. in lamports or\n\t * normalized units, depending on your convention).\n\t */\n\tvalue: string;\n\n\t/**\n\t * SPL token mint address if non-native SOL.\n\t * Omitting will indicate native SOL.\n\t */\n\ttokenMintAddress?: string;\n}) & ({\n\t/**\n\t * assetFee is an advisory fee estimate for the fee that will be incurred when the instruction is executed.\n\t * This can be a total value or a breakdown of line items for the executed transfer.\n\t */\n\tassetFee: string | AssetFeeBreakdown;\n\n\t/**\n\t * If provided, this is the total amount the recipient should expect to receive after fees are deducted, formatted in the destination asset's smallest unit.\n\t */\n\ttotalReceiveAmount?: string;\n\n\t/**\n\t * If provided, this is the ID of a persistent address created/used for this transfer instruction.\n\t */\n\tpersistentAddressId?: string;\n});\n\nexport type KeetaAssetMovementAnchorInitiateTransferResponse = ({\n\tok: true;\n\tid: string;\n\tinstructionChoices: AssetTransferInstructions[];\n}) | ({\n\tok: false;\n\terror: string;\n})\n\nexport interface KeetaAssetMovementAnchorExecuteTransferClientRequest {\n\taccount?: KeetaNetAccount;\n\t/**\n\t * The ID of the transfer to execute the instruction for, which was returned in the initiate transfer response\n\t */\n\tid: string;\n\n\t/**\n\t * The instruction to execute\n\t */\n\tinstruction: Pick<Extract<AssetTransferInstructions, { type: FiatPullRails; }>, 'pullFrom' | 'type'>;\n}\n\nexport type KeetaAssetMovementAnchorExecuteTransferRequest = ConvertToExternalRequest<Omit<KeetaAssetMovementAnchorExecuteTransferClientRequest, 'id'>, unknown>;\n\nexport function getKeetaAssetMovementAnchorExecuteTransferRequestSigningData(input: (KeetaAssetMovementAnchorExecuteTransferRequest | KeetaAssetMovementAnchorExecuteTransferClientRequest) & { id: string; }): Signable {\n\treturn(commonToSignable({\n\t\tid: input.id,\n\t\tinstruction: input.instruction\n\t}));\n}\n\nexport type KeetaAssetMovementAnchorExecuteTransferResponse = KeetaAssetMovementAnchorGetTransferStatusResponse;\n\nexport interface KeetaAssetMovementAnchorGetTransferStatusClientRequest {\n\taccount?: KeetaNetAccount;\n\tid: string;\n}\n\nexport interface KeetaAssetMovementAnchorGetTransferStatusRequest {\n\tid: string;\n}\n\nexport function getKeetaAssetMovementAnchorGetTransferStatusRequestSigningData(input: KeetaAssetMovementAnchorGetTransferStatusRequest): Signable {\n\treturn([ 'get-transaction', input.id ]);\n}\n\ntype TransactionStatus = string;\n\nexport type TransactionId = {\n\tid: string;\n\tnonce: string;\n};\n\ntype TransactionIds<T extends string> = {\n\t[type in T]: TransactionId | null;\n};\n\n/**\n * Representation of an asset movement transaction in the Asset Movement Anchor's system.\n */\nexport type KeetaAssetMovementTransaction = {\n\t/**\n\t * The unique (per anchor) identifier for the asset movement transaction.\n\t *\n\t * This ID is opaque and has no meaning outside of a specific anchor's system.\n\t */\n\tid: string;\n\n\t/**\n\t * The current status of the asset movement transaction.\n\t */\n\tstatus: TransactionStatus;\n\n\t/**\n\t * The asset being moved in the transaction.\n\t */\n\tasset: AssetOrPair;\n\n\t/**\n\t * Information about the source of the asset movement.\n\t */\n\tfrom: {\n\t\t/**\n\t\t * The location of the source of the movement.\n\t\t */\n\t\tlocation: AssetLocationString;\n\n\t\t/**\n\t\t * The value that was sent/to be sent on the source.\n\t\t */\n\t\tvalue: string;\n\n\t\t/**\n\t\t * A list of transaction IDs related to the source chain.\n\t\t */\n\t\ttransactions: TransactionIds<'persistentForwarding' | 'deposit' | 'finalization'>;\n\t};\n\n\t/**\n\t * Information about the destination of the asset movement.\n\t */\n\tto: {\n\t\t/**\n\t\t * The location of the destination of the movement.\n\t\t */\n\t\tlocation: AssetLocationString;\n\n\t\t/**\n\t\t * The value that was received/to be received on the destination.\n\t\t */\n\t\tvalue: string;\n\n\t\t/**\n\t\t * A list of transaction IDs related to the destination chain.\n\t\t */\n\t\ttransactions: TransactionIds<'withdraw'>;\n\t};\n\n\t/**\n\t * Information related to the fee charged for the asset movement.\n\t */\n\tfee: {\n\t\tasset: MovableAsset;\n\t\tvalue: string;\n\t} | null;\n\n\t/**\n\t * Additional details about this rail that (optionally) can be rendered in the client application.\n\t *\n\t * Ex: If there is a proprietary block explorer for a chain involved in the transfer, this field could contain a URL to view the transaction on that explorer.\n\t */\n\tadditionalTransferDetails?: ClientRenderableContent;\n\n\t/**\n\t * Timestamp for when the transaction was created\n\t */\n\tcreatedAt: string;\n\n\t/**\n\t * Timestamp for when the transaction was last updated\n\t */\n\tupdatedAt: string;\n}\n\nexport type KeetaAssetMovementAnchorGetTransferStatusResponse = ({\n\tok: true;\n\ttransaction: KeetaAssetMovementTransaction;\n} | {\n\tok: false;\n\terror: string;\n});\n\ntype CryptoAddress = string;\ntype AddressResolved = BankAccountAddressResolved | MobileWalletAddressResolved | CryptoAddress;\ntype AddressObfuscated = BankAccountAddressObfuscated | MobileWalletAddressObfuscated | CryptoAddress;\n\nexport type PersistentAddressTemplateData = {\n\tid: string;\n\tlocation: AssetLocationLike;\n\tasset: MovableAsset;\n\taddress: AddressObfuscated;\n}\n\nexport type KeetaAssetMovementAnchorInitiatePersistentForwardingAddressTemplateClientRequest = {\n\taccount?: KeetaNetAccount;\n\tasset: MovableAsset;\n\tlocation: AssetLocationLike;\n}\n\nexport type KeetaAssetMovementAnchorInitiatePersistentForwardingAddressTemplateRequest = ConvertToExternalRequest<KeetaAssetMovementAnchorInitiatePersistentForwardingAddressTemplateClientRequest, {\n\tasset: AssetOrPairCanonical;\n\tlocation: AssetLocationCanonical;\n}>;\n\nexport function getKeetaAssetMovementAnchorInitiatePersistentForwardingAddressTemplateRequestSigningData(input: KeetaAssetMovementAnchorInitiatePersistentForwardingAddressTemplateClientRequest | KeetaAssetMovementAnchorInitiatePersistentForwardingAddressTemplateRequest): Signable {\n\tconst pair = toAssetPair(input.asset);\n\treturn(commonToSignable({\n\t\tasset: { from: convertAssetSearchInputToCanonical(pair.from), to: convertAssetSearchInputToCanonical(pair.to) },\n\t\tlocation: convertAssetLocationInputToCanonical(input.location)\n\t}));\n}\n\nexport type PersistentForwardingTemplateSessionData = {\n\ttype: 'plaid';\n\tplaidLinkToken: string;\n} | {\n\ttype: 'other';\n\t[key: string]: JSONSerializable;\n};\n\nexport type KeetaAssetMovementAnchorInitiatePersistentForwardingAddressTemplateResponse = ({\n\tok: true;\n\tid: string;\n\texpiresAt: string;\n\tdata: PersistentForwardingTemplateSessionData;\n} | {\n\tok: false;\n\terror: string;\n});\n\nexport type PersistentForwardingTemplateCompletionData = {\n\ttype: 'plaid';\n\tplaidPublicToken: string;\n\tplaidAccountId: string;\n} | {\n\ttype: 'other';\n\t[key: string]: JSONSerializable;\n};\n\nexport type KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateClientRequest = {\n\taccount?: KeetaNetAccount;\n\tasset: MovableAsset;\n\tlocation: AssetLocationLike;\n\taddress: AddressResolved;\n} | {\n\taccount?: KeetaNetAccount;\n\tid?: string;\n\tdata: PersistentForwardingTemplateCompletionData;\n}\n\nexport type KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateRequest =\n\tConvertToExternalRequest<{ account?: KeetaNetAccount; asset: MovableAsset; location: AssetLocationLike; address: AddressResolved; }, {\n\t\tasset: AssetOrPairCanonical;\n\t\tlocation: AssetLocationCanonical;\n\t\taddress: AddressResolved;\n\t}> |\n\tConvertToExternalRequest<{ account?: KeetaNetAccount; id?: string; data: PersistentForwardingTemplateCompletionData; }, unknown>;\n\nexport function getKeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateRequestSigningData(input: KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateClientRequest | KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateRequest): Signable {\n\tif ('data' in input) {\n\t\treturn(commonToSignable({\n\t\t\tid: input.id,\n\t\t\tdata: input.data\n\t\t}));\n\t}\n\tconst pair = toAssetPair(input.asset);\n\treturn(commonToSignable({\n\t\tasset: { from: convertAssetSearchInputToCanonical(pair.from), to: convertAssetSearchInputToCanonical(pair.to) },\n\t\tlocation: convertAssetLocationInputToCanonical(input.location),\n\t\taddress: input.address\n\t}));\n}\n\n\nexport type KeetaAssetMovementAnchorCreatePersistentForwardingAddressTemplateResponse = (({\n\tok: true;\n} & PersistentAddressTemplateData) | {\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaAssetMovementAnchorListForwardingAddressTemplateClientRequest = {\n\taccount?: KeetaNetAccount;\n\tasset?: MovableAsset[];\n\tlocation?: AssetLocationLike[];\n\tpagination?: PaginationQuery;\n}\n\nexport type KeetaAssetMovementAnchorListForwardingAddressTemplateRequest = ToJSONSerializable<Pick<KeetaAssetMovementAnchorListForwardingAddressTemplateClientRequest, 'account' | 'pagination'>> & {\n\tasset?: MovableAssetSearchCanonical[] | undefined;\n\tlocation?: AssetLocationCanonical[] | undefined;\n\tsigned?: HTTPSignedField;\n}\n\nexport function getKeetaAssetMovementAnchorListForwardingAddressTemplateRequestSigningData(_ignore_input: KeetaAssetMovementAnchorListForwardingAddressTemplateClientRequest | KeetaAssetMovementAnchorListForwardingAddressTemplateRequest): Signable {\n\treturn([ 'list-templates' ]);\n}\n\n\nexport type KeetaAssetMovementAnchorListForwardingAddressTemplateResponse = (({\n\tok: true;\n\ttemplates: PersistentAddressTemplateData[];\n} & PaginationResponseInformation) | {\n\tok: false;\n\terror: string;\n});\n\n\nexport type KeetaPersistentForwardingAddressDetails = {\n\tid?: string;\n\taddress: AddressObfuscated | AddressResolved;\n\tdepositMessage?: AddressDepositMessage;\n\tasset?: AssetOrPair;\n\tsourceLocation?: AssetLocationLike;\n\tdestinationLocation?: AssetLocationLike;\n\tdestinationAddress?: AddressResolved | AddressObfuscated;\n\toutgoingRail?: Rail;\n\tincomingRail?: Rail[];\n}\n\nexport type KeetaAssetMovementAnchorCreatePersistentForwardingClientRequest = {\n\taccount?: KeetaNetAccount;\n\tsourceLocation: AssetLocationLike;\n\tasset: AssetOrPair;\n\toutgoingRail?: Rail;\n} & ({\n\tdestinationLocation: AssetLocationLike;\n\tdestinationAddress: AddressResolved;\n} | {\n\tpersistentAddressTemplateId: string;\n});\n\nexport type KeetaAssetMovementAnchorCreatePersistentForwardingRequest = {\n\taccount?: ToJSONSerializable<KeetaNetAccount> | undefined;\n\tsigned?: HTTPSignedField;\n\tsourceLocation: AssetLocationCanonical;\n\tasset: AssetOrPairCanonical;\n\toutgoingRail?: Rail | undefined;\n} & ({\n\tdestinationLocation: AssetLocationCanonical;\n\tdestinationAddress: AddressResolved;\n} | {\n\tpersistentAddressTemplateId: string;\n});\n\nexport function getKeetaAssetMovementAnchorCreatePersistentForwardingRequestSigningData(input: KeetaAssetMovementAnchorCreatePersistentForwardingClientRequest | KeetaAssetMovementAnchorCreatePersistentForwardingRequest): Signable {\n\treturn(commonToSignable({\n\t\tsourceLocation: convertAssetLocationInputToCanonical(input.sourceLocation),\n\t\tasset: convertAssetOrPairSearchInputToCanonical(input.asset),\n\t\toutgoingRail: input.outgoingRail,\n\t\t...('destinationLocation' in input ? {\n\t\t\tdestinationLocation: convertAssetLocationInputToCanonical(input.destinationLocation),\n\t\t\tdestinationAddress: input.destinationAddress\n\t\t} : {\n\t\t\tpersistentAddressTemplateId: input.persistentAddressTemplateId\n\t\t})\n\t}))\n}\n\nexport type KeetaAssetMovementAnchorCreatePersistentForwardingResponse = (({\n\tok: true;\n} & KeetaPersistentForwardingAddressDetails) | {\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaAssetMovementAnchorListPersistentForwardingClientRequest = {\n\taccount?: KeetaNetAccount;\n\tsigned?: HTTPSignedField | undefined;\n\tsearch?: {\n\t\tsourceLocation?: AssetLocationLike;\n\t\tdestinationLocation?: AssetLocationLike;\n\t\tasset?: MovableAsset;\n\t\tdestinationAddress?: string;\n\t\tpersistentAddressTemplateId?: string;\n\t}[];\n\tpagination?: PaginationQuery;\n}\n\nexport type KeetaAssetMovementAnchorListPersistentForwardingRequest = {\n\taccount?: ToJSONSerializable<KeetaNetAccount> | undefined;\n\tsigned?: HTTPSignedField | undefined;\n\tsearch?: {\n\t\tsourceLocation?: AssetLocationCanonical | undefined;\n\t\tdestinationLocation?: AssetLocationCanonical | undefined;\n\t\tasset?: MovableAssetSearchCanonical | undefined;\n\t\tdestinationAddress?: string | undefined;\n\t\tpersistentAddressTemplateId?: string | undefined;\n\t}[] | undefined;\n\tpagination?: PaginationQuery | undefined;\n}\n\nexport type KeetaAssetMovementAnchorListPersistentForwardingResponse = (({\n\tok: true;\n\taddresses: KeetaPersistentForwardingAddressDetails[];\n} & PaginationResponseInformation) | {\n\tok: false;\n\terror: string;\n});\n\nexport function getKeetaAssetMovementAnchorListPersistentForwardingRequestSigningData(_ignore_input: KeetaAssetMovementAnchorListPersistentForwardingClientRequest | KeetaAssetMovementAnchorListPersistentForwardingRequest): Signable {\n\treturn([ 'list-persistent-forwarding-addresses' ]);\n}\n\ntype PaginationQuery = {\n\tlimit?: number;\n\toffset?: number;\n}\n\ntype PaginationResponseInformation = {\n\ttotal: string;\n}\n\nexport type KeetaAssetMovementAnchorlistTransactionsClientRequest = {\n\taccount?: KeetaNetAccount;\n\tpersistentAddresses?: ({ location: AssetLocationLike; } & ({ persistentAddress?: string; persistentAddressTemplate: string; } | { persistentAddress: string; persistentAddressTemplate?: string; }))[];\n\tfrom?: { location: AssetLocationLike; userAddress?: string; asset?: MovableAsset; };\n\tto?: { location: AssetLocationLike; userAddress?: string; asset?: MovableAsset; };\n\ttransactions?: { location: AssetLocationLike; transaction: Partial<TransactionId>; }[] | undefined;\n\tpagination?: PaginationQuery;\n}\n\nexport type KeetaAssetMovementAnchorlistTransactionsRequest = {\n\taccount?: ToJSONSerializable<KeetaNetAccount> | undefined;\n\tsigned?: HTTPSignedField | undefined;\n\tpersistentAddresses?: ({ location: AssetLocationCanonical; } & ({ persistentAddress?: string | undefined; persistentAddressTemplate: string; } | { persistentAddress: string; persistentAddressTemplate?: string | undefined; }))[] | undefined;\n\tfrom?: { location: AssetLocationCanonical; userAddress?: string | undefined; asset?: MovableAsset | undefined; } | undefined;\n\tto?: { location: AssetLocationCanonical; userAddress?: string | undefined; asset?: MovableAsset | undefined; } | undefined;\n\ttransactions?: { location: AssetLocationCanonical; transaction: Partial<TransactionId>; }[] | undefined;\n\tpagination?: PaginationQuery | undefined;\n}\n\nexport function getKeetaAssetMovementAnchorlistTransactionsRequestSigningData(_ignore_input: KeetaAssetMovementAnchorlistTransactionsClientRequest | KeetaAssetMovementAnchorlistTransactionsRequest): Signable {\n\treturn([ 'list-transactions' ]);\n}\n\nexport type KeetaAssetMovementAnchorlistPersistentForwardingTransactionsResponse = (({\n\tok: true;\n\ttransactions: KeetaAssetMovementTransaction[];\n} & PaginationResponseInformation) | {\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaAssetMovementAnchorShareKYCClientRequest = {\n\taccount: KeetaNetAccount;\n\tattributes: string | SharableCertificateAttributes;\n\ttosAgreement?: { id: string; };\n}\n\nexport type KeetaAssetMovementAnchorShareKYCRequest = ConvertToExternalRequest<KeetaAssetMovementAnchorShareKYCClientRequest, {\n\tattributes: string;\n}, { signed: HTTPSignedField }>;\n\nexport function getKeetaAssetMovementAnchorShareKYCRequestSigningData(_ignore_input: KeetaAssetMovementAnchorShareKYCClientRequest | KeetaAssetMovementAnchorShareKYCRequest): Signable {\n\treturn([ 'share-kyc' ]);\n}\n\nexport type KeetaAssetMovementAnchorShareKYCResponse = (({\n\tok: true;\n} & ({\n\tisPending?: false;\n} | {\n\tisPending: true;\n\tpromiseURL?: string;\n})) | {\n\tok: false;\n\terror: string;\n});\n\ntype Account = InstanceType<typeof KeetaNet.lib.Account<Exclude<AccountKeyAlgorithm, IdentifierKeyAlgorithm>>>;\n\ntype KeetaAssetMovementAnchorKYCExternalURLFlow = {\n\ttype: 'url-flow';\n\turl: string;\n}\n\nexport interface KeetaAssetMovementAnchorKYCShareNeededErrorJSONProperties {\n\ttosFlow: KeetaAssetMovementAnchorKYCExternalURLFlow | undefined;\n\tneededAttributes: string[] | undefined;\n\tshareWithPrincipals: ReturnType<Account['publicKeyString']['get']>[];\n\tacceptedIssuers: { name: string; value: string; }[][];\n}\n\n\ntype KeetaAssetMovementAnchorKYCShareNeededErrorJSON = ReturnType<KeetaAnchorUserError['toJSON']> & KeetaAssetMovementAnchorKYCShareNeededErrorJSONProperties;\n\nclass KeetaAssetMovementAnchorKYCShareNeededError extends KeetaAnchorUserError {\n\tstatic override readonly name: string = 'KeetaAssetMovementAnchorKYCShareNeededError';\n\tprivate readonly KeetaAssetMovementAnchorKYCShareNeededErrorObjectTypeID!: string;\n\tprivate static readonly KeetaAssetMovementAnchorKYCShareNeededErrorObjectTypeID = '3f4d6acd-8915-40de-94fa-4c6c48c01623';\n\n\treadonly shareWithPrincipals: Account[];\n\treadonly neededAttributes: string[] | undefined;\n\treadonly tosFlow: KeetaAssetMovementAnchorKYCExternalURLFlow | undefined;\n\treadonly acceptedIssuers: { name: string; value: string; }[][];\n\n\tconstructor(args: {\n\t\tneededAttributes?: string[] | undefined;\n\t\tshareWithPrincipals: Account[];\n\t\ttosFlow?: KeetaAssetMovementAnchorKYCExternalURLFlow | undefined;\n\t\tacceptedIssuers: { name: string; value: string; }[][];\n\t}, message?: string) {\n\t\tsuper(message ?? 'User Not Onboarded to Asset Movement Service');\n\t\tthis.statusCode = 403;\n\n\t\tObject.defineProperty(this, 'KeetaAssetMovementAnchorKYCShareNeededErrorObjectTypeID', {\n\t\t\tvalue: KeetaAssetMovementAnchorKYCShareNeededError.KeetaAssetMovementAnchorKYCShareNeededErrorObjectTypeID,\n\t\t\tenumerable: false\n\t\t});\n\n\t\tthis.neededAttributes = args.neededAttributes;\n\t\tthis.tosFlow = args.tosFlow;\n\t\tthis.shareWithPrincipals = args.shareWithPrincipals;\n\t\tthis.acceptedIssuers = args.acceptedIssuers;\n\t}\n\n\tstatic isInstance(input: unknown): input is KeetaAssetMovementAnchorKYCShareNeededError {\n\t\treturn(this.hasPropWithValue(input, 'KeetaAssetMovementAnchorKYCShareNeededErrorObjectTypeID', KeetaAssetMovementAnchorKYCShareNeededError.KeetaAssetMovementAnchorKYCShareNeededErrorObjectTypeID));\n\t}\n\n\n\tasErrorResponse(contentType: 'text/plain' | 'application/json'): { error: string; statusCode: number; contentType: string } {\n\t\tconst { tosFlow, neededAttributes, shareWithPrincipals, acceptedIssuers } = this.toJSON();\n\n\t\tlet message = this.message;\n\t\tif (contentType === 'application/json') {\n\t\t\tmessage = JSON.stringify({\n\t\t\t\tok: false,\n\t\t\t\tname: this.name,\n\t\t\t\tcode: 'KEETA_ANCHOR_ASSET_MOVEMENT_KYC_SHARE_NEEDED',\n\t\t\t\tdata: { tosFlow, neededAttributes, shareWithPrincipals, acceptedIssuers },\n\t\t\t\terror: this.message\n\t\t\t});\n\t\t}\n\n\t\treturn({\n\t\t\terror: message,\n\t\t\tstatusCode: this.statusCode,\n\t\t\tcontentType: contentType\n\t\t});\n\t}\n\n\ttoJSON(): KeetaAssetMovementAnchorKYCShareNeededErrorJSON {\n\t\treturn({\n\t\t\t...super.toJSON(),\n\t\t\ttosFlow: this.tosFlow,\n\t\t\tneededAttributes: this.neededAttributes,\n\t\t\tshareWithPrincipals: this.shareWithPrincipals.map(function(account) {\n\t\t\t\treturn(account.publicKeyString.get());\n\t\t\t}),\n\t\t\tacceptedIssuers: this.acceptedIssuers\n\t\t});\n\t}\n\n\tstatic async fromJSON(input: unknown): Promise<KeetaAssetMovementAnchorKYCShareNeededError> {\n\t\tconst { message, other } = this.extractErrorProperties(input, this);\n\n\t\tif (!('data' in other)) {\n\t\t\tthrow(new Error('Invalid KeetaAssetMovementAnchorKYCShareNeededError JSON: missing data property'));\n\t\t}\n\n\t\tconst parsed = assertKeetaAssetMovementAnchorKYCShareNeededErrorJSONProperties(other.data);\n\n\t\tconst error = new this(\n\t\t\t{\n\t\t\t\tshareWithPrincipals: parsed.shareWithPrincipals.map(function(pubKeyString) {\n\t\t\t\t\treturn(KeetaNet.lib.Account.fromPublicKeyString(pubKeyString).assertAccount());\n\t\t\t\t}),\n\t\t\t\tneededAttributes: parsed.neededAttributes,\n\t\t\t\ttosFlow: parsed.tosFlow,\n\t\t\t\tacceptedIssuers: parsed.acceptedIssuers\n\t\t\t},\n\t\t\tmessage\n\t\t);\n\n\t\terror.restoreFromJSON(other);\n\t\treturn(error);\n\t}\n}\n\nexport interface KeetaAssetMovementAnchorAdditionalKYCNeededErrorJSONProperties {\n\ttoCompleteFlow: KeetaAssetMovementAnchorKYCExternalURLFlow | undefined;\n}\n\n\ntype KeetaAssetMovementAnchorAdditionalKYCNeededErrorJSON = ReturnType<KeetaAnchorUserError['toJSON']> & KeetaAssetMovementAnchorAdditionalKYCNeededErrorJSONProperties;\n\nclass KeetaAssetMovementAnchorAdditionalKYCNeededError extends KeetaAnchorUserError {\n\tstatic override readonly name: string = 'KeetaAssetMovementAnchorAdditionalKYCNeededError';\n\tprivate readonly KeetaAssetMovementAnchorAdditionalKYCNeededErrorObjectTypeID!: string;\n\tprivate static readonly KeetaAssetMovementAnchorAdditionalKYCNeededErrorObjectTypeID = '3f4d6acd-8915-40de-94fa-4c6c48c01623';\n\n\treadonly toCompleteFlow: KeetaAssetMovementAnchorKYCExternalURLFlow | undefined;\n\n\tconstructor(args: KeetaAssetMovementAnchorAdditionalKYCNeededErrorJSONProperties, message?: string) {\n\t\tsuper(message ?? 'User requires additional KYC to proceed with asset movement');\n\t\tthis.statusCode = 403;\n\n\t\tObject.defineProperty(this, 'KeetaAssetMovementAnchorAdditionalKYCNeededErrorObjectTypeID', {\n\t\t\tvalue: KeetaAssetMovementAnchorAdditionalKYCNeededError.KeetaAssetMovementAnchorAdditionalKYCNeededErrorObjectTypeID,\n\t\t\tenumerable: false\n\t\t});\n\n\t\tthis.toCompleteFlow = args.toCompleteFlow;\n\t}\n\n\tstatic isInstance(input: unknown): input is KeetaAssetMovementAnchorAdditionalKYCNeededError {\n\t\treturn(this.hasPropWithValue(input, 'KeetaAssetMovementAnchorAdditionalKYCNeededErrorObjectTypeID', KeetaAssetMovementAnchorAdditionalKYCNeededError.KeetaAssetMovementAnchorAdditionalKYCNeededErrorObjectTypeID));\n\t}\n\n\n\tasErrorResponse(contentType: 'text/plain' | 'application/json'): { error: string; statusCode: number; contentType: string } {\n\t\tconst { toCompleteFlow } = this.toJSON();\n\n\t\tlet message = this.message;\n\t\tif (contentType === 'application/json') {\n\t\t\tmessage = JSON.stringify({\n\t\t\t\tok: false,\n\t\t\t\tname: this.name,\n\t\t\t\tcode: 'KEETA_ANCHOR_ASSET_MOVEMENT_ADDITIONAL_KYC_NEEDED',\n\t\t\t\tdata: { toCompleteFlow },\n\t\t\t\terror: this.message\n\t\t\t});\n\t\t}\n\n\t\treturn({\n\t\t\terror: message,\n\t\t\tstatusCode: this.statusCode,\n\t\t\tcontentType: contentType\n\t\t});\n\t}\n\n\ttoJSON(): KeetaAssetMovementAnchorAdditionalKYCNeededErrorJSON {\n\t\treturn({\n\t\t\t...super.toJSON(),\n\t\t\ttoCompleteFlow: this.toCompleteFlow\n\t\t});\n\t}\n\n\tstatic async fromJSON(input: unknown): Promise<KeetaAssetMovementAnchorAdditionalKYCNeededError> {\n\t\tconst { message, other } = this.extractErrorProperties(input, this);\n\n\t\tif (!('data' in other)) {\n\t\t\tthrow(new Error('Invalid KeetaAssetMovementAnchorAdditionalKYCNeededError JSON: missing data property'));\n\t\t}\n\n\t\tconst parsed = assertKeetaAssetMovementAnchorAdditionalKYCNeededErrorJSONProperties(other.data);\n\n\t\tconst error = new this(\n\t\t\t{\n\t\t\t\ttoCompleteFlow: parsed.toCompleteFlow\n\t\t\t},\n\t\t\tmessage\n\t\t);\n\n\t\terror.restoreFromJSON(other);\n\t\treturn(error);\n\t}\n}\n\n\nexport interface KeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties {\n\tforAsset?: AssetOrPair | undefined;\n\tforRail?: Rail | undefined;\n}\n\n\ntype KeetaAssetMovementAnchorOperationNotSupportedErrorJSON = ReturnType<KeetaAnchorUserError['toJSON']> & KeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties;\n\nclass KeetaAssetMovementAnchorOperationNotSupportedError extends KeetaAnchorUserError implements KeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties {\n\tstatic override readonly name: string = 'KeetaAssetMovementAnchorOperationNotSupportedError';\n\tprivate readonly KeetaAssetMovementAnchorOperationNotSupportedErrorObjectTypeID!: string;\n\tprivate static readonly KeetaAssetMovementAnchorOperationNotSupportedErrorObjectTypeID = 'b613cd80-57ac-4be5-ad4a-bb8644d50de6';\n\n\treadonly forAsset: AssetOrPair | undefined;\n\treadonly forRail: Rail | undefined;\n\n\tconstructor(args: KeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties, message?: string) {\n\t\tsuper(message ?? `Operation not supported`);\n\t\tthis.statusCode = 400;\n\n\t\tObject.defineProperty(this, 'KeetaAssetMovementAnchorOperationNotSupportedErrorObjectTypeID', {\n\t\t\tvalue: KeetaAssetMovementAnchorOperationNotSupportedError.KeetaAssetMovementAnchorOperationNotSupportedErrorObjectTypeID,\n\t\t\tenumerable: false\n\t\t});\n\n\t\tthis.forAsset = args.forAsset;\n\t\tthis.forRail = args.forRail;\n\t}\n\n\tstatic isInstance(input: unknown): input is KeetaAssetMovementAnchorOperationNotSupportedError {\n\t\treturn(this.hasPropWithValue(input, 'KeetaAssetMovementAnchorOperationNotSupportedErrorObjectTypeID', KeetaAssetMovementAnchorOperationNotSupportedError.KeetaAssetMovementAnchorOperationNotSupportedErrorObjectTypeID));\n\t}\n\n\tasErrorResponse(contentType: 'text/plain' | 'application/json'): { error: string; statusCode: number; contentType: string } {\n\t\tconst { forAsset, forRail } = this.toJSON();\n\n\t\tlet message = this.message;\n\t\tif (contentType === 'application/json') {\n\t\t\tmessage = JSON.stringify({\n\t\t\t\tok: false,\n\t\t\t\tname: this.name,\n\t\t\t\tcode: 'KEETA_ANCHOR_ASSET_MOVEMENT_OPERATION_NOT_SUPPORTED',\n\t\t\t\tdata: { forAsset, forRail },\n\t\t\t\terror: this.message\n\t\t\t});\n\t\t}\n\n\t\treturn({\n\t\t\terror: message,\n\t\t\tstatusCode: this.statusCode,\n\t\t\tcontentType: contentType\n\t\t});\n\t}\n\n\ttoJSON(): KeetaAssetMovementAnchorOperationNotSupportedErrorJSON {\n\t\treturn({\n\t\t\t...super.toJSON(),\n\t\t\tforRail: this.forRail,\n\t\t\tforAsset: this.forAsset ? convertAssetOrPairSearchInputToCanonical(this.forAsset) : undefined\n\t\t});\n\t}\n\n\tstatic async fromJSON(input: unknown): Promise<KeetaAssetMovementAnchorOperationNotSupportedError> {\n\t\tconst { message, other } = this.extractErrorProperties(input, this);\n\n\t\tif (!('data' in other)) {\n\t\t\tthrow(new Error('Invalid KeetaAssetMovementAnchorOperationNotSupportedError JSON: missing data property'));\n\t\t}\n\n\t\tconst parsed = assertKeetaAssetMovementAnchorOperationNotSupportedErrorJSONProperties(other.data);\n\n\t\tconst error = new this(\n\t\t\t{\n\t\t\t\tforAsset: parsed.forAsset,\n\t\t\t\tforRail: parsed.forRail\n\t\t\t},\n\t\t\tmessage\n\t\t);\n\n\t\terror.restoreFromJSON(other);\n\t\treturn(error);\n\t}\n}\n\nexport const Errors: {\n\tKYCShareNeeded: typeof KeetaAssetMovementAnchorKYCShareNeededError;\n\tAdditionalKYCNeeded: typeof KeetaAssetMovementAnchorAdditionalKYCNeededError;\n\tOperationNotSupported: typeof KeetaAssetMovementAnchorOperationNotSupportedError;\n} = {\n\t/**\n\t * The user is required to share KYC details\n\t */\n\tKYCShareNeeded: KeetaAssetMovementAnchorKYCShareNeededError,\n\n\t/**\n\t * The user is required to complete additional KYC steps\n\t */\n\tAdditionalKYCNeeded: KeetaAssetMovementAnchorAdditionalKYCNeededError,\n\n\t/**\n\t * The requested operation is not supported\n\t */\n\tOperationNotSupported: KeetaAssetMovementAnchorOperationNotSupportedError\n};\n"]}
|
|
@@ -59,7 +59,15 @@ export declare function isChainLocation<T extends ChainLocationType>(input: Asse
|
|
|
59
59
|
export type AssetLocation = ChainLocation | BankLocation | MobileWalletLocation;
|
|
60
60
|
export type BankAccountType = BankAccountAddressObfuscated['accountType'];
|
|
61
61
|
export type MobileWalletAccountType = MobileWalletAddressObfuscated['accountType'];
|
|
62
|
-
|
|
62
|
+
type ChainLocationIDType = {
|
|
63
|
+
[K in 'keeta' | 'evm']: bigint;
|
|
64
|
+
} & {
|
|
65
|
+
[K in 'solana' | 'bitcoin' | 'tron']: string;
|
|
66
|
+
};
|
|
67
|
+
export type ChainLocationString<T extends ChainLocationType = ChainLocationType> = {
|
|
68
|
+
[K in T]: `chain:${K}:${ChainLocationIDType[K]}`;
|
|
69
|
+
}[T];
|
|
70
|
+
export type AssetLocationString = ChainLocationString | `bank-account:${BankAccountType}` | `mobile-wallet:${MobileWalletAccountType}`;
|
|
63
71
|
export type AssetLocationLike = AssetLocation | AssetLocationString;
|
|
64
72
|
export type AssetLocationInput = AssetLocation | AssetLocationString;
|
|
65
73
|
export type AssetLocationCanonical = AssetLocationString;
|
|
@@ -67,5 +75,6 @@ export declare function convertAssetLocationToString(input: AssetLocationLike):
|
|
|
67
75
|
export declare function toAssetLocationFromString(input: string): AssetLocation;
|
|
68
76
|
export declare function convertAssetLocationInputToCanonical(input: AssetLocationInput): AssetLocationCanonical;
|
|
69
77
|
export declare function toAssetLocation(input: AssetLocationInput): AssetLocation;
|
|
78
|
+
export declare function isAssetLocationEqual(a: AssetLocationInput, b: AssetLocationInput): boolean;
|
|
70
79
|
export {};
|
|
71
80
|
//# sourceMappingURL=location.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../../src/services/asset-movement/lib/location.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAGhG,UAAU,YAAY,CAAC,IAAI,SAAS,OAAO,GAAG,cAAc,GAAG,eAAe;IAC7E,IAAI,EAAE,IAAI,CAAC;CACX;AA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,CAAC,CAAC;AAEL,MAAM,MAAM,mBAAmB,GAC9B,mBAAmB,GACnB,gBAAgB,eAAe,EAAE,GACjC,iBAAiB,uBAAuB,EAAE,CAAC;AAE5C,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,mBAAmB,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,mBAAmB,CAAC;AACrE,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAEzD,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,iBAAiB,GAAG,mBAAmB,CA0B1F;AAqBD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CA4FtE;AAED,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,kBAAkB,GAAG,sBAAsB,CAQtG;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAMxE;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,kBAAkB,EAAE,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAE1F"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { BankAccountType, MobileWalletAccountType, PickChainLocation } from "./location.js";
|
|
1
|
+
import type { AssetLocationLike, BankAccountType, MobileWalletAccountType, PickChainLocation } from "./location.js";
|
|
2
2
|
export declare const isTronNetworkAlias: (input: unknown) => input is PickChainLocation<'tron'>['chain']['networkAlias'];
|
|
3
3
|
export declare const assertBankAccountType: (input: unknown) => BankAccountType;
|
|
4
4
|
export declare const assertMobileWalletAccountType: (input: unknown) => MobileWalletAccountType;
|
|
5
|
+
export declare const isAssetLocationLike: (input: unknown) => input is AssetLocationLike;
|
|
5
6
|
//# sourceMappingURL=location.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.generated.d.ts","sourceRoot":"","sources":["../../../../src/services/asset-movement/lib/location.generated.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"location.generated.d.ts","sourceRoot":"","sources":["../../../../src/services/asset-movement/lib/location.generated.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEpH,eAAO,MAAM,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,cAAc,CAAkE,CAAC;AAClL,eAAO,MAAM,qBAAqB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,eAAiD,CAAC;AAC1G,eAAO,MAAM,6BAA6B,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,uBAAiE,CAAC;AAClI,eAAO,MAAM,mBAAmB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,iBAAiD,CAAC"}
|
|
@@ -25,4 +25,27 @@ export const assertMobileWalletAccountType = (() => { const _iv1 = new Set(["air
|
|
|
25
25
|
}
|
|
26
26
|
return input;
|
|
27
27
|
}; })();
|
|
28
|
+
export const isAssetLocationLike = (() => { const _iv1 = new Set(["bank-account:bcr-pay", "bank-account:card", "bank-account:clabe", "bank-account:duit-now", "bank-account:fps", "bank-account:hk-fps", "bank-account:iban-swift", "bank-account:interac", "bank-account:pay-now", "bank-account:pix", "bank-account:upi", "bank-account:us", "mobile-wallet:airtel-money", "mobile-wallet:bkash", "mobile-wallet:easy-paisa", "mobile-wallet:finja-wallet", "mobile-wallet:jazz-cash", "mobile-wallet:mtn-mobile-money", "mobile-wallet:nagad", "mobile-wallet:naya-pay", "mobile-wallet:paypal", "mobile-wallet:rocket", "mobile-wallet:sada-pay", "mobile-wallet:venmo"]); const _iv2 = new Set(["bcr-pay", "card", "clabe", "duit-now", "fps", "hk-fps", "iban-swift", "interac", "pay-now", "pix", "upi", "us"]); const _iv3 = new Set(["airtel-money", "bkash", "easy-paisa", "finja-wallet", "jazz-cash", "mtn-mobile-money", "nagad", "naya-pay", "paypal", "rocket", "sada-pay", "venmo"]); const _io0 = input => "chain" === input.type && ("object" === typeof input.chain && null !== input.chain && _iu0(input.chain)); const _io1 = input => "keeta" === input.type && "bigint" === typeof input.networkId; const _io2 = input => "evm" === input.type && "bigint" === typeof input.chainId; const _io3 = input => "solana" === input.type && "string" === typeof input.genesisHash; const _io4 = input => "bitcoin" === input.type && "string" === typeof input.magicBytes; const _io5 = input => "tron" === input.type && (null !== input.networkAlias && undefined !== input.networkAlias && ("mainnet" === input.networkAlias || "shasta" === input.networkAlias || "nile" === input.networkAlias || "string" === typeof input.networkAlias && RegExp(/^custom:(.*)/).test(input.networkAlias))); const _io6 = input => "object" === typeof input.account && null !== input.account && _io7(input.account) && "bank-account" === input.type; const _io7 = input => true === _iv2.has(input.type); const _io8 = input => "object" === typeof input.account && null !== input.account && _io9(input.account) && "mobile-wallet" === input.type; const _io9 = input => true === _iv3.has(input.type); const _iu0 = input => (() => {
|
|
29
|
+
if ("keeta" === input.type)
|
|
30
|
+
return _io1(input);
|
|
31
|
+
else if ("evm" === input.type)
|
|
32
|
+
return _io2(input);
|
|
33
|
+
else if ("solana" === input.type)
|
|
34
|
+
return _io3(input);
|
|
35
|
+
else if ("bitcoin" === input.type)
|
|
36
|
+
return _io4(input);
|
|
37
|
+
else if ("tron" === input.type)
|
|
38
|
+
return _io5(input);
|
|
39
|
+
else
|
|
40
|
+
return false;
|
|
41
|
+
})(); const _iu1 = input => (() => {
|
|
42
|
+
if ("chain" === input.type)
|
|
43
|
+
return _io0(input);
|
|
44
|
+
else if ("mobile-wallet" === input.type)
|
|
45
|
+
return _io8(input);
|
|
46
|
+
else if ("bank-account" === input.type)
|
|
47
|
+
return _io6(input);
|
|
48
|
+
else
|
|
49
|
+
return false;
|
|
50
|
+
})(); return input => null !== input && undefined !== input && (true === _iv1.has(input) || "string" === typeof input && (RegExp(/^chain:keeta:[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/).test(input) || RegExp(/^chain:evm:[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/).test(input) || RegExp(/^chain:solana:(.*)/).test(input) || RegExp(/^chain:bitcoin:(.*)/).test(input) || RegExp(/^chain:tron:(.*)/).test(input)) || "object" === typeof input && null !== input && _iu1(input)); })();
|
|
28
51
|
//# sourceMappingURL=location.generated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.generated.js","sourceRoot":"","sources":["../../../../src/services/asset-movement/lib/location.generated.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG/C,MAAM,CAAC,MAAM,kBAAkB,6MAAkJ,CAAC;AAClL,MAAM,CAAC,MAAM,qBAAqB;;;;;;;;;;;OAAuE,CAAC;AAC1G,MAAM,CAAC,MAAM,6BAA6B;;;;;;;;;;;OAAuF,CAAC","sourcesContent":["import { createAssert, createIs } from \"typia\";\nimport type { BankAccountType, MobileWalletAccountType, PickChainLocation } from \"./location.js\";\n\nexport const isTronNetworkAlias: (input: unknown) => input is PickChainLocation<'tron'>['chain']['networkAlias'] = createIs<PickChainLocation<'tron'>['chain']['networkAlias']>();\nexport const assertBankAccountType: (input: unknown) => BankAccountType = createAssert<BankAccountType>();\nexport const assertMobileWalletAccountType: (input: unknown) => MobileWalletAccountType = createAssert<MobileWalletAccountType>();\n"]}
|
|
1
|
+
{"version":3,"file":"location.generated.js","sourceRoot":"","sources":["../../../../src/services/asset-movement/lib/location.generated.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG/C,MAAM,CAAC,MAAM,kBAAkB,6MAAkJ,CAAC;AAClL,MAAM,CAAC,MAAM,qBAAqB;;;;;;;;;;;OAAuE,CAAC;AAC1G,MAAM,CAAC,MAAM,6BAA6B;;;;;;;;;;;OAAuF,CAAC;AAClI,MAAM,CAAC,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;mdAAgF,CAAC","sourcesContent":["import { createAssert, createIs } from \"typia\";\nimport type { AssetLocationLike, BankAccountType, MobileWalletAccountType, PickChainLocation } from \"./location.js\";\n\nexport const isTronNetworkAlias: (input: unknown) => input is PickChainLocation<'tron'>['chain']['networkAlias'] = createIs<PickChainLocation<'tron'>['chain']['networkAlias']>();\nexport const assertBankAccountType: (input: unknown) => BankAccountType = createAssert<BankAccountType>();\nexport const assertMobileWalletAccountType: (input: unknown) => MobileWalletAccountType = createAssert<MobileWalletAccountType>();\nexport const isAssetLocationLike: (input: unknown) => input is AssetLocationLike = createIs<AssetLocationLike>();\n"]}
|
|
@@ -164,4 +164,7 @@ export function toAssetLocation(input) {
|
|
|
164
164
|
return (input);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
+
export function isAssetLocationEqual(a, b) {
|
|
168
|
+
return (convertAssetLocationInputToCanonical(a) === convertAssetLocationInputToCanonical(b));
|
|
169
|
+
}
|
|
167
170
|
//# sourceMappingURL=location.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../../../src/services/asset-movement/lib/location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAgEnH,MAAM,UAAU,eAAe,CAA8B,KAAoB,EAAE,SAAa;IAC/F,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC5B,OAAM,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAED,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IACxC,CAAC;IA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,CAAC,4CAA4C,CAAC,CAAC,CAAC;QAChE,CAAC;QAED,OAAM,CAAC;YACN,IAAI,EAAE,eAAe;YACrB,OAAO,EAAE,EAAE,IAAI,EAAE,6BAA6B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;SAC1D,CAAC,CAAC;IACJ,CAAC;SAAM,CAAC;QACP,MAAK,CAAC,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAClD,CAAC;AACF,CAAC;AAED,MAAM,UAAU,oCAAoC,CAAC,KAAyB;IAC7E,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAM,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACxD,OAAM,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,MAAK,CAAC,IAAI,KAAK,CAAC,oCAAoC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC;AACtE,CAAC;AAGD,MAAM,UAAU,eAAe,CAAC,KAAyB;IACxD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAM,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,CAAC;SAAM,CAAC;QACP,OAAM,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;AACF,CAAC","sourcesContent":["import { assertNever } from \"../../../lib/utils/never.js\";\nimport type { BankAccountAddressObfuscated, MobileWalletAddressObfuscated } from \"../common.js\";\nimport { assertBankAccountType, assertMobileWalletAccountType, isTronNetworkAlias } from \"./location.generated.js\";\n\ninterface BaseLocation<Type extends 'chain' | 'bank-account' | 'mobile-wallet'> {\n\ttype: Type;\n}\n\nexport interface BankLocation extends BaseLocation<'bank-account'> {\n\taccount: {\n\t\ttype: BankAccountType;\n\t}\n}\n\nexport interface MobileWalletLocation extends BaseLocation<'mobile-wallet'> {\n\taccount: {\n\t\ttype: MobileWalletAccountType;\n\t}\n}\n\ninterface BaseChainLocation<Data> extends BaseLocation<'chain'> {\n\ttype: 'chain';\n\tchain: Data;\n}\n\nexport type ChainLocation = {\n\ttype: 'chain';\n\tchain: {\n\t\ttype: 'keeta';\n\t\t/**\n\t\t * The network ID representing the Keeta network to interact with\n\t\t */\n\t\tnetworkId: bigint;\n\t} | {\n\t\ttype: 'evm';\n\t\t/**\n\t\t * The chain ID representing the EVM-based network to interact with\n\t\t */\n\t\tchainId: bigint;\n\t} | {\n\t\ttype: 'solana';\n\t\t/**\n\t\t * The genesis hash representing Solana network/cluster to interact with\n\t\t */\n\t\tgenesisHash: string;\n\t} | {\n\t\ttype: 'bitcoin';\n\t\t/**\n\t\t * The \"magic bytes\" representing the bitcoin network to interact with\n\t\t */\n\t\tmagicBytes: string;\n\t} | {\n\t\ttype: 'tron';\n\t\t/**\n\t\t * The network alias representing the Tron network to interact with\n\t\t * Note: this is not the chain ID, but a human-readable alias because tron does not use chain/network IDs or any similar way to differentiate networks\n\t\t */\n\t\tnetworkAlias: 'mainnet' | 'shasta' | 'nile' | `custom:${string}`;\n\t}\n};\n\n\nexport type ChainLocationType = ChainLocation['chain']['type'];\n\nexport type PickChainLocation<T extends ChainLocationType = ChainLocationType> = BaseChainLocation<Extract<ChainLocation['chain'], { type: T }>>;\n\nexport function isChainLocation<T extends ChainLocationType>(input: AssetLocation, chainType?: T): input is PickChainLocation<T> {\n\tif (input.type !== 'chain') {\n\t\treturn(false);\n\t}\n\n\tif (chainType !== undefined) {\n\t\treturn(input.chain.type === chainType);\n\t}\n\n\treturn(true);\n}\n\nexport type AssetLocation = ChainLocation | BankLocation | MobileWalletLocation;\n\nexport type BankAccountType = BankAccountAddressObfuscated['accountType'];\nexport type MobileWalletAccountType = MobileWalletAddressObfuscated['accountType'];\n\nexport type AssetLocationString =\n\t`chain:${'keeta' | 'evm'}:${bigint}` | `chain:${'solana' | 'bitcoin' | 'tron'}:${string}` |\n\t`bank-account:${BankAccountType}` |\n\t`mobile-wallet:${MobileWalletAccountType}`;\n\nexport type AssetLocationLike = AssetLocation | AssetLocationString;\n\nexport type AssetLocationInput = AssetLocation | AssetLocationString;\nexport type AssetLocationCanonical = AssetLocationString;\n\nexport function convertAssetLocationToString(input: AssetLocationLike): AssetLocationString {\n\tif (typeof input === 'string') {\n\t\treturn(input);\n\t}\n\n\tif (input.type === 'chain') {\n\t\tif (input.chain.type === 'keeta') {\n\t\t\treturn(`chain:keeta:${input.chain.networkId}`);\n\t\t} else if (input.chain.type === 'evm') {\n\t\t\treturn(`chain:evm:${input.chain.chainId}`);\n\t\t} else if (input.chain.type === 'solana') {\n\t\t\treturn(`chain:solana:${input.chain.genesisHash}`);\n\t\t} else if (input.chain.type === 'bitcoin') {\n\t\t\treturn(`chain:bitcoin:${input.chain.magicBytes}`);\n\t\t} else if (input.chain.type === 'tron') {\n\t\t\treturn(`chain:tron:${input.chain.networkAlias}`);\n\t\t} else {\n\t\t\tassertNever(input.chain);\n\t\t}\n\t} else if (input.type === 'bank-account') {\n\t\treturn(`bank-account:${assertBankAccountType(input.account.type)}`);\n\t} else if (input.type === 'mobile-wallet') {\n\t\treturn(`mobile-wallet:${assertMobileWalletAccountType(input.account.type)}`);\n\t} else {\n\t\tthrow(new Error(`Invalid AssetLocation type: ${JSON.stringify(input)}`));\n\t}\n}\n\nfunction validateSolanaGenesisHash(hash: string): boolean {\n\t// Basic validation: Solana genesis hashes are typically 44-character base58 strings\n\tconst genesisHashRegex = /^(?=.{43,44}$)[1-9A-HJ-NP-Za-km-z]+$/;\n\treturn(genesisHashRegex.test(hash));\n}\n\nfunction validateBitcoinMagicBytes(magicBytes: string): boolean {\n\tif (magicBytes.length !== 8) {\n\t\treturn(false);\n\t}\n\n\ttry {\n\t\tconst buffer = Buffer.from(magicBytes, 'hex');\n\t\treturn(buffer.length === 4);\n\t} catch {\n\t\treturn(false);\n\t}\n}\n\nexport function toAssetLocationFromString(input: string): AssetLocation {\n\tconst [ kind, ...parts ] = input.split(':');\n\n\tif (kind === 'chain') {\n\t\tif (parts.length !== 2) {\n\t\t\tthrow(new Error('Invalid AssetLocation chain string'));\n\t\t}\n\n\t\tconst chainType = parts[0];\n\t\tif (!parts[1] || typeof parts[1] !== 'string') {\n\t\t\tthrow(new Error('Invalid chain id in AssetLocation string'));\n\t\t}\n\n\n\t\treturn({\n\t\t\ttype: 'chain',\n\t\t\tchain: (() => {\n\t\t\t\tif (chainType === 'keeta' || chainType === 'evm') {\n\t\t\t\t\tconst chainId = BigInt(parts[1]);\n\n\t\t\t\t\tif (chainId < 0n) {\n\t\t\t\t\t\tthrow(new Error(`Invalid chain id in AssetLocation string: ${parts[1]}`));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (chainType === 'keeta') {\n\t\t\t\t\t\treturn({\n\t\t\t\t\t\t\ttype: 'keeta',\n\t\t\t\t\t\t\tnetworkId: chainId\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (chainType === 'evm') {\n\t\t\t\t\t\treturn({\n\t\t\t\t\t\t\ttype: 'evm',\n\t\t\t\t\t\t\tchainId: chainId\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else if (chainType === 'solana') {\n\t\t\t\t\tconst genesisHash = parts[1];\n\t\t\t\t\tif (!validateSolanaGenesisHash(genesisHash)) {\n\t\t\t\t\t\tthrow(new Error(`Invalid Solana genesis hash in AssetLocation string: ${genesisHash}`));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn({\n\t\t\t\t\t\ttype: 'solana',\n\t\t\t\t\t\tgenesisHash: genesisHash\n\t\t\t\t\t});\n\t\t\t\t} else if (chainType === 'bitcoin') {\n\t\t\t\t\tconst magicBytes = parts[1];\n\n\t\t\t\t\tif (!validateBitcoinMagicBytes(magicBytes)) {\n\t\t\t\t\t\tthrow(new Error(`Invalid Bitcoin magic bytes in AssetLocation string: ${magicBytes}`));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn({\n\t\t\t\t\t\ttype: 'bitcoin',\n\t\t\t\t\t\tmagicBytes: magicBytes\n\t\t\t\t\t});\n\t\t\t\t} else if (chainType === 'tron') {\n\t\t\t\t\tconst networkAlias = parts[1];\n\t\t\t\t\tif (!isTronNetworkAlias(networkAlias)) {\n\t\t\t\t\t\tthrow(new Error(`Invalid Tron network alias in AssetLocation string: ${networkAlias}`));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn({\n\t\t\t\t\t\ttype: 'tron',\n\t\t\t\t\t\tnetworkAlias: networkAlias\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthrow(new Error(`Invalid chain type in AssetLocation string: ${chainType}`));\n\t\t\t})()\n\t\t});\n\t} else if (kind === 'bank-account') {\n\t\tif (parts.length !== 1) {\n\t\t\tthrow(new Error('Invalid AssetLocation bank-account string'));\n\t\t}\n\n\t\treturn({\n\t\t\ttype: 'bank-account',\n\t\t\taccount: { type: assertBankAccountType(parts[0]) }\n\t\t});\n\t} else if (kind === 'mobile-wallet') {\n\t\tif (parts.length !== 1) {\n\t\t\tthrow(new Error('Invalid AssetLocation mobile-wallet string'));\n\t\t}\n\n\t\treturn({\n\t\t\ttype: 'mobile-wallet',\n\t\t\taccount: { type: assertMobileWalletAccountType(parts[0]) }\n\t\t});\n\t} else {\n\t\tthrow(new Error('Invalid AssetLocation string'));\n\t}\n}\n\nexport function convertAssetLocationInputToCanonical(input: AssetLocationInput): AssetLocationCanonical {\n\tif (typeof input === 'string') {\n\t\treturn(input);\n\t} else if (typeof input === 'object' && input !== null) {\n\t\treturn(convertAssetLocationToString(input));\n\t}\n\n\tthrow(new Error(`Invalid AssetLocationInput type: ${typeof input}`));\n}\n\n\nexport function toAssetLocation(input: AssetLocationInput): AssetLocation {\n\tif (typeof input === 'string') {\n\t\treturn(toAssetLocationFromString(input));\n\t} else {\n\t\treturn(input);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../../../src/services/asset-movement/lib/location.ts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CAAC,CAAC,CAAC;IAC1C,CAAC;SAAM,CAAC;QACP,OAAM,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;AACF,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,CAAqB,EAAE,CAAqB;IAChF,OAAM,CAAC,oCAAoC,CAAC,CAAC,CAAC,KAAK,oCAAoC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7F,CAAC","sourcesContent":["import { assertNever } from \"../../../lib/utils/never.js\";\nimport type { BankAccountAddressObfuscated, MobileWalletAddressObfuscated } from \"../common.js\";\nimport { assertBankAccountType, assertMobileWalletAccountType, isTronNetworkAlias } from \"./location.generated.js\";\n\ninterface BaseLocation<Type extends 'chain' | 'bank-account' | 'mobile-wallet'> {\n\ttype: Type;\n}\n\nexport interface BankLocation extends BaseLocation<'bank-account'> {\n\taccount: {\n\t\ttype: BankAccountType;\n\t}\n}\n\nexport interface MobileWalletLocation extends BaseLocation<'mobile-wallet'> {\n\taccount: {\n\t\ttype: MobileWalletAccountType;\n\t}\n}\n\ninterface BaseChainLocation<Data> extends BaseLocation<'chain'> {\n\ttype: 'chain';\n\tchain: Data;\n}\n\nexport type ChainLocation = {\n\ttype: 'chain';\n\tchain: {\n\t\ttype: 'keeta';\n\t\t/**\n\t\t * The network ID representing the Keeta network to interact with\n\t\t */\n\t\tnetworkId: bigint;\n\t} | {\n\t\ttype: 'evm';\n\t\t/**\n\t\t * The chain ID representing the EVM-based network to interact with\n\t\t */\n\t\tchainId: bigint;\n\t} | {\n\t\ttype: 'solana';\n\t\t/**\n\t\t * The genesis hash representing Solana network/cluster to interact with\n\t\t */\n\t\tgenesisHash: string;\n\t} | {\n\t\ttype: 'bitcoin';\n\t\t/**\n\t\t * The \"magic bytes\" representing the bitcoin network to interact with\n\t\t */\n\t\tmagicBytes: string;\n\t} | {\n\t\ttype: 'tron';\n\t\t/**\n\t\t * The network alias representing the Tron network to interact with\n\t\t * Note: this is not the chain ID, but a human-readable alias because tron does not use chain/network IDs or any similar way to differentiate networks\n\t\t */\n\t\tnetworkAlias: 'mainnet' | 'shasta' | 'nile' | `custom:${string}`;\n\t}\n};\n\n\nexport type ChainLocationType = ChainLocation['chain']['type'];\n\nexport type PickChainLocation<T extends ChainLocationType = ChainLocationType> = BaseChainLocation<Extract<ChainLocation['chain'], { type: T }>>;\n\nexport function isChainLocation<T extends ChainLocationType>(input: AssetLocation, chainType?: T): input is PickChainLocation<T> {\n\tif (input.type !== 'chain') {\n\t\treturn(false);\n\t}\n\n\tif (chainType !== undefined) {\n\t\treturn(input.chain.type === chainType);\n\t}\n\n\treturn(true);\n}\n\nexport type AssetLocation = ChainLocation | BankLocation | MobileWalletLocation;\n\nexport type BankAccountType = BankAccountAddressObfuscated['accountType'];\nexport type MobileWalletAccountType = MobileWalletAddressObfuscated['accountType'];\n\ntype ChainLocationIDType = {\n\t[K in 'keeta' | 'evm']: bigint;\n} & {\n\t[K in 'solana' | 'bitcoin' | 'tron']: string;\n};\n\nexport type ChainLocationString<T extends ChainLocationType = ChainLocationType> = {\n\t[K in T]: `chain:${K}:${ChainLocationIDType[K]}`\n}[T];\n\nexport type AssetLocationString =\n\tChainLocationString |\n\t`bank-account:${BankAccountType}` |\n\t`mobile-wallet:${MobileWalletAccountType}`;\n\nexport type AssetLocationLike = AssetLocation | AssetLocationString;\n\nexport type AssetLocationInput = AssetLocation | AssetLocationString;\nexport type AssetLocationCanonical = AssetLocationString;\n\nexport function convertAssetLocationToString(input: AssetLocationLike): AssetLocationString {\n\tif (typeof input === 'string') {\n\t\treturn(input);\n\t}\n\n\tif (input.type === 'chain') {\n\t\tif (input.chain.type === 'keeta') {\n\t\t\treturn(`chain:keeta:${input.chain.networkId}`);\n\t\t} else if (input.chain.type === 'evm') {\n\t\t\treturn(`chain:evm:${input.chain.chainId}`);\n\t\t} else if (input.chain.type === 'solana') {\n\t\t\treturn(`chain:solana:${input.chain.genesisHash}`);\n\t\t} else if (input.chain.type === 'bitcoin') {\n\t\t\treturn(`chain:bitcoin:${input.chain.magicBytes}`);\n\t\t} else if (input.chain.type === 'tron') {\n\t\t\treturn(`chain:tron:${input.chain.networkAlias}`);\n\t\t} else {\n\t\t\tassertNever(input.chain);\n\t\t}\n\t} else if (input.type === 'bank-account') {\n\t\treturn(`bank-account:${assertBankAccountType(input.account.type)}`);\n\t} else if (input.type === 'mobile-wallet') {\n\t\treturn(`mobile-wallet:${assertMobileWalletAccountType(input.account.type)}`);\n\t} else {\n\t\tthrow(new Error(`Invalid AssetLocation type: ${JSON.stringify(input)}`));\n\t}\n}\n\nfunction validateSolanaGenesisHash(hash: string): boolean {\n\t// Basic validation: Solana genesis hashes are typically 44-character base58 strings\n\tconst genesisHashRegex = /^(?=.{43,44}$)[1-9A-HJ-NP-Za-km-z]+$/;\n\treturn(genesisHashRegex.test(hash));\n}\n\nfunction validateBitcoinMagicBytes(magicBytes: string): boolean {\n\tif (magicBytes.length !== 8) {\n\t\treturn(false);\n\t}\n\n\ttry {\n\t\tconst buffer = Buffer.from(magicBytes, 'hex');\n\t\treturn(buffer.length === 4);\n\t} catch {\n\t\treturn(false);\n\t}\n}\n\nexport function toAssetLocationFromString(input: string): AssetLocation {\n\tconst [ kind, ...parts ] = input.split(':');\n\n\tif (kind === 'chain') {\n\t\tif (parts.length !== 2) {\n\t\t\tthrow(new Error('Invalid AssetLocation chain string'));\n\t\t}\n\n\t\tconst chainType = parts[0];\n\t\tif (!parts[1] || typeof parts[1] !== 'string') {\n\t\t\tthrow(new Error('Invalid chain id in AssetLocation string'));\n\t\t}\n\n\n\t\treturn({\n\t\t\ttype: 'chain',\n\t\t\tchain: (() => {\n\t\t\t\tif (chainType === 'keeta' || chainType === 'evm') {\n\t\t\t\t\tconst chainId = BigInt(parts[1]);\n\n\t\t\t\t\tif (chainId < 0n) {\n\t\t\t\t\t\tthrow(new Error(`Invalid chain id in AssetLocation string: ${parts[1]}`));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (chainType === 'keeta') {\n\t\t\t\t\t\treturn({\n\t\t\t\t\t\t\ttype: 'keeta',\n\t\t\t\t\t\t\tnetworkId: chainId\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (chainType === 'evm') {\n\t\t\t\t\t\treturn({\n\t\t\t\t\t\t\ttype: 'evm',\n\t\t\t\t\t\t\tchainId: chainId\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else if (chainType === 'solana') {\n\t\t\t\t\tconst genesisHash = parts[1];\n\t\t\t\t\tif (!validateSolanaGenesisHash(genesisHash)) {\n\t\t\t\t\t\tthrow(new Error(`Invalid Solana genesis hash in AssetLocation string: ${genesisHash}`));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn({\n\t\t\t\t\t\ttype: 'solana',\n\t\t\t\t\t\tgenesisHash: genesisHash\n\t\t\t\t\t});\n\t\t\t\t} else if (chainType === 'bitcoin') {\n\t\t\t\t\tconst magicBytes = parts[1];\n\n\t\t\t\t\tif (!validateBitcoinMagicBytes(magicBytes)) {\n\t\t\t\t\t\tthrow(new Error(`Invalid Bitcoin magic bytes in AssetLocation string: ${magicBytes}`));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn({\n\t\t\t\t\t\ttype: 'bitcoin',\n\t\t\t\t\t\tmagicBytes: magicBytes\n\t\t\t\t\t});\n\t\t\t\t} else if (chainType === 'tron') {\n\t\t\t\t\tconst networkAlias = parts[1];\n\t\t\t\t\tif (!isTronNetworkAlias(networkAlias)) {\n\t\t\t\t\t\tthrow(new Error(`Invalid Tron network alias in AssetLocation string: ${networkAlias}`));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn({\n\t\t\t\t\t\ttype: 'tron',\n\t\t\t\t\t\tnetworkAlias: networkAlias\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthrow(new Error(`Invalid chain type in AssetLocation string: ${chainType}`));\n\t\t\t})()\n\t\t});\n\t} else if (kind === 'bank-account') {\n\t\tif (parts.length !== 1) {\n\t\t\tthrow(new Error('Invalid AssetLocation bank-account string'));\n\t\t}\n\n\t\treturn({\n\t\t\ttype: 'bank-account',\n\t\t\taccount: { type: assertBankAccountType(parts[0]) }\n\t\t});\n\t} else if (kind === 'mobile-wallet') {\n\t\tif (parts.length !== 1) {\n\t\t\tthrow(new Error('Invalid AssetLocation mobile-wallet string'));\n\t\t}\n\n\t\treturn({\n\t\t\ttype: 'mobile-wallet',\n\t\t\taccount: { type: assertMobileWalletAccountType(parts[0]) }\n\t\t});\n\t} else {\n\t\tthrow(new Error('Invalid AssetLocation string'));\n\t}\n}\n\nexport function convertAssetLocationInputToCanonical(input: AssetLocationInput): AssetLocationCanonical {\n\tif (typeof input === 'string') {\n\t\treturn(input);\n\t} else if (typeof input === 'object' && input !== null) {\n\t\treturn(convertAssetLocationToString(input));\n\t}\n\n\tthrow(new Error(`Invalid AssetLocationInput type: ${typeof input}`));\n}\n\n\nexport function toAssetLocation(input: AssetLocationInput): AssetLocation {\n\tif (typeof input === 'string') {\n\t\treturn(toAssetLocationFromString(input));\n\t} else {\n\t\treturn(input);\n\t}\n}\n\nexport function isAssetLocationEqual(a: AssetLocationInput, b: AssetLocationInput): boolean {\n\treturn(convertAssetLocationInputToCanonical(a) === convertAssetLocationInputToCanonical(b));\n}\n"]}
|