{
  "version": 3,
  "sources": ["../src/houdini/plugin.ts"],
  "sourcesContent": [
    "/**\n * Modifications © 2026 Horizontal Systems.\n */\n\nimport { AssetValue, Chain, ProviderName, type SwapParams, USwapError } from \"@tcswap/helpers\";\nimport type { QuoteResponseRoute } from \"@tcswap/helpers/api\";\nimport { createPlugin } from \"../utils\";\n\n// Houdini Swap private route. The aggregator has already created the order on a non-dry quote:\n// `inboundAddress` is its deposit address and `sellAmount` the exact amount it expects, so the\n// swap is a plain transfer from the connected wallet. Nothing is approved or called on-chain —\n// the two exchange hops happen on Houdini's side, tracked by `meta.houdini.houdiniId`.\nexport const HoudiniPlugin = createPlugin({\n  methods: ({ getWallet }) => ({\n    async swap({ route }: SwapParams<\"houdini\", QuoteResponseRoute>) {\n      const { sellAsset, sellAmount, inboundAddress, memo, meta } = route;\n\n      if (!inboundAddress) {\n        throw new USwapError(\"core_swap_invalid_params\", { missing: [\"inboundAddress\"] });\n      }\n\n      if (!meta?.houdini?.houdiniId) {\n        throw new USwapError(\"core_swap_invalid_params\", { missing: [\"meta.houdini.houdiniId\"] });\n      }\n\n      const assetValue = await AssetValue.from({ asset: sellAsset, asyncTokenLookup: true, value: sellAmount });\n      const chain = assetValue.chain as Exclude<Chain, typeof Chain.Radix>;\n\n      // A deposit to a centralized venue is identified by its destination tag on chains that\n      // use one, and the toolboxes only carry a free-text memo on XRP. The aggregator refuses\n      // such orders before they reach here; this is the last line.\n      if (memo && chain === Chain.Ripple) {\n        throw new USwapError(\"core_swap_invalid_params\", { missing: [\"destinationTag\"] });\n      }\n\n      const wallet = getWallet(chain);\n\n      if (!wallet) {\n        throw new USwapError(\"core_wallet_connection_not_found\");\n      }\n\n      const txHash = await wallet.transfer({\n        assetValue,\n        recipient: inboundAddress,\n        sender: wallet.address,\n        ...(memo ? { memo } : {}),\n      });\n\n      return txHash as string;\n    },\n  }),\n  name: \"houdini\",\n  properties: { supportedUSwapProviders: [ProviderName.HOUDINI] as const },\n});\n"
  ],
  "mappings": "wDAI6E,IAA7E,6BAQO,IAAM,EAAgB,EAAa,CACxC,QAAS,EAAG,gBAAiB,MACrB,KAAI,EAAG,SAAoD,CAC/D,IAAQ,YAAW,aAAY,iBAAgB,OAAM,QAAS,EAE9D,GAAI,CAAC,EACH,MAAM,IAAI,aAAW,2BAA4B,CAAE,QAAS,CAAC,gBAAgB,CAAE,CAAC,EAGlF,GAAI,CAAC,GAAM,SAAS,UAClB,MAAM,IAAI,aAAW,2BAA4B,CAAE,QAAS,CAAC,wBAAwB,CAAE,CAAC,EAG1F,IAAM,EAAa,MAAM,aAAW,KAAK,CAAE,MAAO,EAAW,iBAAkB,GAAM,MAAO,CAAW,CAAC,EAClG,EAAQ,EAAW,MAKzB,GAAI,GAAQ,IAAU,QAAM,OAC1B,MAAM,IAAI,aAAW,2BAA4B,CAAE,QAAS,CAAC,gBAAgB,CAAE,CAAC,EAGlF,IAAM,EAAS,EAAU,CAAK,EAE9B,GAAI,CAAC,EACH,MAAM,IAAI,aAAW,kCAAkC,EAUzD,OAPe,MAAM,EAAO,SAAS,CACnC,aACA,UAAW,EACX,OAAQ,EAAO,WACX,EAAO,CAAE,MAAK,EAAI,CAAC,CACzB,CAAC,EAIL,GACA,KAAM,UACN,WAAY,CAAE,wBAAyB,CAAC,eAAa,OAAO,CAAW,CACzE,CAAC",
  "debugId": "3AEF422DA67C596964756E2164756E21",
  "names": []
}