@avalabs/fusion-sdk 0.16.0 → 0.17.0

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.
Files changed (151) hide show
  1. package/dist/constants.cjs +1 -1
  2. package/dist/constants.cjs.map +1 -1
  3. package/dist/constants.d.cts +21 -1
  4. package/dist/constants.d.ts +21 -1
  5. package/dist/constants.js +1 -1
  6. package/dist/constants.js.map +1 -1
  7. package/dist/errors.cjs +1 -1
  8. package/dist/errors.cjs.map +1 -1
  9. package/dist/errors.js +1 -1
  10. package/dist/errors.js.map +1 -1
  11. package/dist/mod.cjs +1 -1
  12. package/dist/mod.d.cts +7 -5
  13. package/dist/mod.d.ts +7 -5
  14. package/dist/mod.js +1 -1
  15. package/dist/transfer-manager.cjs +1 -1
  16. package/dist/transfer-manager.cjs.map +1 -1
  17. package/dist/transfer-manager.js +1 -1
  18. package/dist/transfer-manager.js.map +1 -1
  19. package/dist/transfer-service/_evm-gas.cjs +1 -1
  20. package/dist/transfer-service/_evm-gas.js +1 -1
  21. package/dist/transfer-service/_utils.cjs +1 -1
  22. package/dist/transfer-service/_utils.cjs.map +1 -1
  23. package/dist/transfer-service/_utils.js +1 -1
  24. package/dist/transfer-service/_utils.js.map +1 -1
  25. package/dist/transfer-service/avalanche-cct/_handlers/analyze-support.cjs +2 -0
  26. package/dist/transfer-service/avalanche-cct/_handlers/analyze-support.cjs.map +1 -0
  27. package/dist/transfer-service/avalanche-cct/_handlers/analyze-support.js +2 -0
  28. package/dist/transfer-service/avalanche-cct/_handlers/analyze-support.js.map +1 -0
  29. package/dist/transfer-service/avalanche-cct/_handlers/estimate-native-fee.cjs +2 -0
  30. package/dist/transfer-service/avalanche-cct/_handlers/estimate-native-fee.cjs.map +1 -0
  31. package/dist/transfer-service/avalanche-cct/_handlers/estimate-native-fee.js +2 -0
  32. package/dist/transfer-service/avalanche-cct/_handlers/estimate-native-fee.js.map +1 -0
  33. package/dist/transfer-service/avalanche-cct/_handlers/get-bridgeable-assets.cjs +2 -0
  34. package/dist/transfer-service/avalanche-cct/_handlers/get-bridgeable-assets.cjs.map +1 -0
  35. package/dist/transfer-service/avalanche-cct/_handlers/get-bridgeable-assets.js +2 -0
  36. package/dist/transfer-service/avalanche-cct/_handlers/get-bridgeable-assets.js.map +1 -0
  37. package/dist/transfer-service/avalanche-cct/_handlers/get-minimum-transfer-amount.cjs +2 -0
  38. package/dist/transfer-service/avalanche-cct/_handlers/get-minimum-transfer-amount.cjs.map +1 -0
  39. package/dist/transfer-service/avalanche-cct/_handlers/get-minimum-transfer-amount.js +2 -0
  40. package/dist/transfer-service/avalanche-cct/_handlers/get-minimum-transfer-amount.js.map +1 -0
  41. package/dist/transfer-service/avalanche-cct/_handlers/get-supported-chains.cjs +2 -0
  42. package/dist/transfer-service/avalanche-cct/_handlers/get-supported-chains.cjs.map +1 -0
  43. package/dist/transfer-service/avalanche-cct/_handlers/get-supported-chains.js +2 -0
  44. package/dist/transfer-service/avalanche-cct/_handlers/get-supported-chains.js.map +1 -0
  45. package/dist/transfer-service/avalanche-cct/_handlers/stream-quotes.cjs +2 -0
  46. package/dist/transfer-service/avalanche-cct/_handlers/stream-quotes.cjs.map +1 -0
  47. package/dist/transfer-service/avalanche-cct/_handlers/stream-quotes.js +2 -0
  48. package/dist/transfer-service/avalanche-cct/_handlers/stream-quotes.js.map +1 -0
  49. package/dist/transfer-service/avalanche-cct/_handlers/track-transfer.cjs +2 -0
  50. package/dist/transfer-service/avalanche-cct/_handlers/track-transfer.cjs.map +1 -0
  51. package/dist/transfer-service/avalanche-cct/_handlers/track-transfer.js +2 -0
  52. package/dist/transfer-service/avalanche-cct/_handlers/track-transfer.js.map +1 -0
  53. package/dist/transfer-service/avalanche-cct/_handlers/transfer-asset.cjs +2 -0
  54. package/dist/transfer-service/avalanche-cct/_handlers/transfer-asset.cjs.map +1 -0
  55. package/dist/transfer-service/avalanche-cct/_handlers/transfer-asset.js +2 -0
  56. package/dist/transfer-service/avalanche-cct/_handlers/transfer-asset.js.map +1 -0
  57. package/dist/transfer-service/avalanche-cct/_type-guards.cjs +2 -0
  58. package/dist/transfer-service/avalanche-cct/_type-guards.cjs.map +1 -0
  59. package/dist/transfer-service/avalanche-cct/_type-guards.js +2 -0
  60. package/dist/transfer-service/avalanche-cct/_type-guards.js.map +1 -0
  61. package/dist/transfer-service/avalanche-cct/_utils/addresses.cjs +2 -0
  62. package/dist/transfer-service/avalanche-cct/_utils/addresses.cjs.map +1 -0
  63. package/dist/transfer-service/avalanche-cct/_utils/addresses.js +2 -0
  64. package/dist/transfer-service/avalanche-cct/_utils/addresses.js.map +1 -0
  65. package/dist/transfer-service/avalanche-cct/_utils/fees.cjs +2 -0
  66. package/dist/transfer-service/avalanche-cct/_utils/fees.cjs.map +1 -0
  67. package/dist/transfer-service/avalanche-cct/_utils/fees.js +2 -0
  68. package/dist/transfer-service/avalanche-cct/_utils/fees.js.map +1 -0
  69. package/dist/transfer-service/avalanche-cct/_utils/p-chain.cjs +2 -0
  70. package/dist/transfer-service/avalanche-cct/_utils/p-chain.cjs.map +1 -0
  71. package/dist/transfer-service/avalanche-cct/_utils/p-chain.js +2 -0
  72. package/dist/transfer-service/avalanche-cct/_utils/p-chain.js.map +1 -0
  73. package/dist/transfer-service/avalanche-cct/_utils/polling.cjs +2 -0
  74. package/dist/transfer-service/avalanche-cct/_utils/polling.cjs.map +1 -0
  75. package/dist/transfer-service/avalanche-cct/_utils/polling.js +2 -0
  76. package/dist/transfer-service/avalanche-cct/_utils/polling.js.map +1 -0
  77. package/dist/transfer-service/avalanche-cct/_utils/transactions.cjs +2 -0
  78. package/dist/transfer-service/avalanche-cct/_utils/transactions.cjs.map +1 -0
  79. package/dist/transfer-service/avalanche-cct/_utils/transactions.js +2 -0
  80. package/dist/transfer-service/avalanche-cct/_utils/transactions.js.map +1 -0
  81. package/dist/transfer-service/avalanche-cct/_utils.cjs +2 -0
  82. package/dist/transfer-service/avalanche-cct/_utils.cjs.map +1 -0
  83. package/dist/transfer-service/avalanche-cct/_utils.js +2 -0
  84. package/dist/transfer-service/avalanche-cct/_utils.js.map +1 -0
  85. package/dist/transfer-service/avalanche-cct/avalanche-cct-service.cjs +2 -0
  86. package/dist/transfer-service/avalanche-cct/avalanche-cct-service.cjs.map +1 -0
  87. package/dist/transfer-service/avalanche-cct/avalanche-cct-service.js +2 -0
  88. package/dist/transfer-service/avalanche-cct/avalanche-cct-service.js.map +1 -0
  89. package/dist/transfer-service/avalanche-cct/constants.cjs +2 -0
  90. package/dist/transfer-service/avalanche-cct/constants.cjs.map +1 -0
  91. package/dist/transfer-service/avalanche-cct/constants.js +2 -0
  92. package/dist/transfer-service/avalanche-cct/constants.js.map +1 -0
  93. package/dist/transfer-service/avalanche-cct/types.d.cts +33 -0
  94. package/dist/transfer-service/avalanche-cct/types.d.ts +33 -0
  95. package/dist/transfer-service/avalanche-evm/_handlers/get-bridgeable-assets.cjs +1 -1
  96. package/dist/transfer-service/avalanche-evm/_handlers/get-bridgeable-assets.cjs.map +1 -1
  97. package/dist/transfer-service/avalanche-evm/_handlers/get-bridgeable-assets.js +1 -1
  98. package/dist/transfer-service/avalanche-evm/_handlers/get-bridgeable-assets.js.map +1 -1
  99. package/dist/transfer-service/avalanche-evm/_handlers/transfer-asset.cjs +1 -1
  100. package/dist/transfer-service/avalanche-evm/_handlers/transfer-asset.js +1 -1
  101. package/dist/transfer-service/avalanche-evm/_utils/wrap.cjs +1 -1
  102. package/dist/transfer-service/avalanche-evm/_utils/wrap.js +1 -1
  103. package/dist/transfer-service/fetch-utilities.cjs +1 -1
  104. package/dist/transfer-service/fetch-utilities.cjs.map +1 -1
  105. package/dist/transfer-service/fetch-utilities.js +1 -1
  106. package/dist/transfer-service/fetch-utilities.js.map +1 -1
  107. package/dist/transfer-service/lombard/btc-to-btcb/_handlers/get-bridgeable-assets.cjs +1 -1
  108. package/dist/transfer-service/lombard/btc-to-btcb/_handlers/get-bridgeable-assets.cjs.map +1 -1
  109. package/dist/transfer-service/lombard/btc-to-btcb/_handlers/get-bridgeable-assets.js +1 -1
  110. package/dist/transfer-service/lombard/btc-to-btcb/_handlers/get-bridgeable-assets.js.map +1 -1
  111. package/dist/transfer-service/lombard/btcb-to-btc/_handlers/get-bridgeable-assets.cjs +1 -1
  112. package/dist/transfer-service/lombard/btcb-to-btc/_handlers/get-bridgeable-assets.cjs.map +1 -1
  113. package/dist/transfer-service/lombard/btcb-to-btc/_handlers/get-bridgeable-assets.js +1 -1
  114. package/dist/transfer-service/lombard/btcb-to-btc/_handlers/get-bridgeable-assets.js.map +1 -1
  115. package/dist/transfer-service/markr/_handlers/estimate-native-fee.cjs +1 -1
  116. package/dist/transfer-service/markr/_handlers/estimate-native-fee.js +1 -1
  117. package/dist/transfer-service/markr/_handlers/get-bridgeable-assets.cjs +1 -1
  118. package/dist/transfer-service/markr/_handlers/get-bridgeable-assets.cjs.map +1 -1
  119. package/dist/transfer-service/markr/_handlers/get-bridgeable-assets.js +1 -1
  120. package/dist/transfer-service/markr/_handlers/get-bridgeable-assets.js.map +1 -1
  121. package/dist/transfer-service/markr/_handlers/track-transfer.cjs +1 -1
  122. package/dist/transfer-service/markr/_handlers/track-transfer.js +1 -1
  123. package/dist/transfer-service/markr/_handlers/transfer-asset.cjs +1 -1
  124. package/dist/transfer-service/markr/_handlers/transfer-asset.js +1 -1
  125. package/dist/transfer-service/markr/markr-service.cjs.map +1 -1
  126. package/dist/transfer-service/markr/markr-service.js.map +1 -1
  127. package/dist/transfer-service/wrap-unwrap/_handlers/get-bridgeable-assets.cjs +1 -1
  128. package/dist/transfer-service/wrap-unwrap/_handlers/get-bridgeable-assets.cjs.map +1 -1
  129. package/dist/transfer-service/wrap-unwrap/_handlers/get-bridgeable-assets.js +1 -1
  130. package/dist/transfer-service/wrap-unwrap/_handlers/get-bridgeable-assets.js.map +1 -1
  131. package/dist/transfer-service/wrap-unwrap/_handlers/transfer-asset.cjs +1 -1
  132. package/dist/transfer-service/wrap-unwrap/_handlers/transfer-asset.js +1 -1
  133. package/dist/types/asset.d.cts +18 -2
  134. package/dist/types/asset.d.ts +18 -2
  135. package/dist/types/service.d.cts +95 -7
  136. package/dist/types/service.d.ts +95 -7
  137. package/dist/types/transfer-manager.d.cts +19 -10
  138. package/dist/types/transfer-manager.d.ts +19 -10
  139. package/dist/types/utility-types.d.cts +8 -1
  140. package/dist/types/utility-types.d.ts +8 -1
  141. package/dist/utils/asset-id.cjs +1 -1
  142. package/dist/utils/asset-id.cjs.map +1 -1
  143. package/dist/utils/asset-id.js +1 -1
  144. package/dist/utils/asset-id.js.map +1 -1
  145. package/dist/utils/bridgeable-assets.cjs +2 -0
  146. package/dist/utils/bridgeable-assets.cjs.map +1 -0
  147. package/dist/utils/bridgeable-assets.d.cts +16 -0
  148. package/dist/utils/bridgeable-assets.d.ts +16 -0
  149. package/dist/utils/bridgeable-assets.js +2 -0
  150. package/dist/utils/bridgeable-assets.js.map +1 -0
  151. package/package.json +5 -3
@@ -1 +1 @@
1
- {"version":3,"file":"get-bridgeable-assets.js","names":[],"sources":["../../../../src/transfer-service/wrap-unwrap/_handlers/get-bridgeable-assets.ts"],"sourcesContent":["import { ServiceType, TokenType } from '../../../constants';\nimport type { GetBridgeableAssetsProps, TransferService } from '../../../types/service';\nimport type { BridgeableUiAsset } from '../../../types/asset';\nimport type { Caip2ChainId } from '../../../types/caip';\nimport type { WrapChainConfig } from '../constants';\n\nexport function getBridgeableAssetsFactory({\n chainConfigs,\n}: {\n chainConfigs: ReadonlyMap<Caip2ChainId, WrapChainConfig>;\n}): TransferService['getBridgeableAssets'] {\n return async ({\n sourceAsset,\n sourceChainId,\n targetChainId,\n }: GetBridgeableAssetsProps): Promise<readonly BridgeableUiAsset[]> => {\n if (sourceChainId !== targetChainId) {\n return [];\n }\n const config = chainConfigs.get(sourceChainId);\n if (!config) {\n return [];\n }\n if (sourceAsset.type === TokenType.NATIVE) {\n return [{ ...config.wrappedAsset, bridgeProviders: [ServiceType.WRAP_UNWRAP] }];\n }\n if (\n sourceAsset.type === TokenType.ERC20 &&\n sourceAsset.address.toLowerCase() === config.wrappedAsset.address.toLowerCase()\n ) {\n return [{ ...config.nativeAsset, bridgeProviders: [ServiceType.WRAP_UNWRAP] }];\n }\n return [];\n };\n}\n"],"mappings":"mEAMA,SAAgB,EAA2B,CACzC,gBAGyC,CACzC,OAAO,MAAO,CACZ,cACA,gBACA,mBACqE,CACrE,GAAI,IAAkB,EACpB,MAAO,EAAE,CAEX,IAAM,EAAS,EAAa,IAAI,EAAc,CAa9C,OAZK,EAGD,EAAY,OAAS,EAAU,OAC1B,CAAC,CAAE,GAAG,EAAO,aAAc,gBAAiB,CAAC,EAAY,YAAY,CAAE,CAAC,CAG/E,EAAY,OAAS,EAAU,OAC/B,EAAY,QAAQ,aAAa,GAAK,EAAO,aAAa,QAAQ,aAAa,CAExE,CAAC,CAAE,GAAG,EAAO,YAAa,gBAAiB,CAAC,EAAY,YAAY,CAAE,CAAC,CAEzE,EAAE,CAXA,EAAE"}
1
+ {"version":3,"file":"get-bridgeable-assets.js","names":[],"sources":["../../../../src/transfer-service/wrap-unwrap/_handlers/get-bridgeable-assets.ts"],"sourcesContent":["import { ServiceType, TokenType } from '../../../constants';\nimport type { GetBridgeableAssetsProps, GetBridgeableAssetsResult, TransferService } from '../../../types/service';\nimport type { Caip2ChainId } from '../../../types/caip';\nimport { getAssetId } from '../../../utils/asset-id';\nimport type { WrapChainConfig } from '../constants';\n\nconst DEFAULT_PAGE = 1;\nconst DEFAULT_LIMIT = 100;\n\nconst paginateAssets = ({\n assets,\n limit,\n page,\n}: {\n assets: GetBridgeableAssetsResult['assets'];\n limit: number;\n page: number;\n}): GetBridgeableAssetsResult => {\n const startIndex = (page - 1) * limit;\n const pageAssets = assets.slice(startIndex, startIndex + limit);\n const hasMore = startIndex + pageAssets.length < assets.length;\n\n return {\n assets: pageAssets,\n meta: {\n currentPage: page,\n hasMore,\n ...(hasMore ? { nextPage: page + 1 } : {}),\n },\n };\n};\n\nexport function getBridgeableAssetsFactory({\n chainConfigs,\n}: {\n chainConfigs: ReadonlyMap<Caip2ChainId, WrapChainConfig>;\n}): TransferService['getBridgeableAssets'] {\n return async ({\n sourceAsset,\n sourceChainId,\n targetChainId,\n limit,\n page,\n }: GetBridgeableAssetsProps): Promise<GetBridgeableAssetsResult> => {\n const pageLimit = limit ?? DEFAULT_LIMIT;\n const currentPage = page ?? DEFAULT_PAGE;\n\n if (sourceChainId !== targetChainId) {\n return paginateAssets({ assets: [], limit: pageLimit, page: currentPage });\n }\n const config = chainConfigs.get(sourceChainId);\n if (!config) {\n return paginateAssets({ assets: [], limit: pageLimit, page: currentPage });\n }\n if (sourceAsset.type === TokenType.NATIVE) {\n return paginateAssets({\n assets: [\n {\n ...config.wrappedAsset,\n id: getAssetId(targetChainId, config.wrappedAsset),\n bridgeProviders: [ServiceType.WRAP_UNWRAP],\n },\n ],\n limit: pageLimit,\n page: currentPage,\n });\n }\n if (\n sourceAsset.type === TokenType.ERC20 &&\n sourceAsset.address.toLowerCase() === config.wrappedAsset.address.toLowerCase()\n ) {\n return paginateAssets({\n assets: [\n {\n ...config.nativeAsset,\n id: getAssetId(targetChainId, config.nativeAsset),\n bridgeProviders: [ServiceType.WRAP_UNWRAP],\n },\n ],\n limit: pageLimit,\n page: currentPage,\n });\n }\n return paginateAssets({ assets: [], limit: pageLimit, page: currentPage });\n };\n}\n"],"mappings":"2HAMA,MAGM,GAAkB,CACtB,SACA,QACA,UAK+B,CAC/B,IAAM,GAAc,EAAO,GAAK,EAC1B,EAAa,EAAO,MAAM,EAAY,EAAa,EAAM,CACzD,EAAU,EAAa,EAAW,OAAS,EAAO,OAExD,MAAO,CACL,OAAQ,EACR,KAAM,CACJ,YAAa,EACb,UACA,GAAI,EAAU,CAAE,SAAU,EAAO,EAAG,CAAG,EAAE,CAC1C,CACF,EAGH,SAAgB,EAA2B,CACzC,gBAGyC,CACzC,OAAO,MAAO,CACZ,cACA,gBACA,gBACA,QACA,UACkE,CAClE,IAAM,EAAY,GAAS,IACrB,EAAc,GAAQ,EAE5B,GAAI,IAAkB,EACpB,OAAO,EAAe,CAAE,OAAQ,EAAE,CAAE,MAAO,EAAW,KAAM,EAAa,CAAC,CAE5E,IAAM,EAAS,EAAa,IAAI,EAAc,CAiC9C,OAhCK,EAGD,EAAY,OAAS,EAAU,OAC1B,EAAe,CACpB,OAAQ,CACN,CACE,GAAG,EAAO,aACV,GAAI,EAAW,EAAe,EAAO,aAAa,CAClD,gBAAiB,CAAC,EAAY,YAAY,CAC3C,CACF,CACD,MAAO,EACP,KAAM,EACP,CAAC,CAGF,EAAY,OAAS,EAAU,OAC/B,EAAY,QAAQ,aAAa,GAAK,EAAO,aAAa,QAAQ,aAAa,CAExE,EAAe,CACpB,OAAQ,CACN,CACE,GAAG,EAAO,YACV,GAAI,EAAW,EAAe,EAAO,YAAY,CACjD,gBAAiB,CAAC,EAAY,YAAY,CAC3C,CACF,CACD,MAAO,EACP,KAAM,EACP,CAAC,CAEG,EAAe,CAAE,OAAQ,EAAE,CAAE,MAAO,EAAW,KAAM,EAAa,CAAC,CA/BjE,EAAe,CAAE,OAAQ,EAAE,CAAE,MAAO,EAAW,KAAM,EAAa,CAAC"}
@@ -1,2 +1,2 @@
1
- require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../constants.cjs`),t=require(`../../../errors.cjs`),n=require(`../../../utils/caip.cjs`),r=require(`../../_utils.cjs`),i=require(`../_utils.cjs`),a=require(`../../_transfer-utilities.cjs`);let o=require(`viem`);function s({chainConfigs:s,environment:c,evmSigner:l}){return async({quote:u,gasSettings:d,onStepChange:f})=>{if(u.serviceType!==e.ServiceType.WRAP_UNWRAP)throw new t.SdkError(t.ErrorReason.INCORRECT_PROVIDER_PROVIDED,t.ErrorCode.INVALID_PARAMS);let p=Math.floor(Date.now()/1e3);if(u.expiresAt<=p)throw new t.SdkError(t.ErrorReason.QUOTE_EXPIRED,t.ErrorCode.INVALID_PARAMS);let m=u.fromAddress;if(!(0,o.isAddress)(m))throw new t.SdkError(t.ErrorReason.INVALID_PARAMS,t.ErrorCode.INVALID_PARAMS,{details:`fromAddress is not a valid EVM address.`});let h=u.sourceChain.chainId,g=i.getWrapDirection(u.assetIn,u.assetOut,h,s);if(!g)throw new t.SdkError(t.ErrorReason.INVALID_PARAMS,t.ErrorCode.INVALID_PARAMS,{details:`Quote does not represent a valid wrap/unwrap pair.`});let _=i.getWrapperContractAddress(h,s),v=g===`wrap`,y=i.encodeWrapUnwrapData(g,u.amountIn),b=r.getEvmClientForChain({chain:u.sourceChain}),x=await i.estimateWrapUnwrapGas({direction:g,amountIn:u.amountIn,contractAddress:_,fromAddress:m,client:b,estimateGasMarginBps:d?.estimateGasMarginBps}),S={chainId:n.caip2ToEip155HexChainId(u.sourceChain.chainId),data:y,from:m,gas:x,to:_,value:v?u.amountIn:0n,...d?.maxFeePerGas===void 0?null:{maxFeePerGas:d.maxFeePerGas,maxPriorityFeePerGas:d.maxPriorityFeePerGas}},C={currentSignature:1,currentSignatureReason:e.TransferSignatureReason.WrapToken,quote:u,requiredSignatures:1};f?.(C);let w=Date.now();return a.sourcePendingTransferFromQuote(u,{environment:c,txHash:await l.sign(S,async e=>b.sendRawTransaction({serializedTransaction:e}),C),startedAtMs:w,requiredConfirmationCount:1})}}exports.transferAssetFactory=s;
1
+ require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../constants.cjs`),t=require(`../../../errors.cjs`),n=require(`../../../utils/caip.cjs`),r=require(`../../_transfer-utilities.cjs`),i=require(`../../_utils.cjs`),a=require(`../_utils.cjs`);let o=require(`viem`);function s({chainConfigs:s,environment:c,evmSigner:l}){return async({quote:u,gasSettings:d,onStepChange:f})=>{if(u.serviceType!==e.ServiceType.WRAP_UNWRAP)throw new t.SdkError(t.ErrorReason.INCORRECT_PROVIDER_PROVIDED,t.ErrorCode.INVALID_PARAMS);let p=Math.floor(Date.now()/1e3);if(u.expiresAt<=p)throw new t.SdkError(t.ErrorReason.QUOTE_EXPIRED,t.ErrorCode.INVALID_PARAMS);let m=u.fromAddress;if(!(0,o.isAddress)(m))throw new t.SdkError(t.ErrorReason.INVALID_PARAMS,t.ErrorCode.INVALID_PARAMS,{details:`fromAddress is not a valid EVM address.`});let h=u.sourceChain.chainId,g=a.getWrapDirection(u.assetIn,u.assetOut,h,s);if(!g)throw new t.SdkError(t.ErrorReason.INVALID_PARAMS,t.ErrorCode.INVALID_PARAMS,{details:`Quote does not represent a valid wrap/unwrap pair.`});let _=a.getWrapperContractAddress(h,s),v=g===`wrap`,y=a.encodeWrapUnwrapData(g,u.amountIn),b=i.getEvmClientForChain({chain:u.sourceChain}),x=await a.estimateWrapUnwrapGas({direction:g,amountIn:u.amountIn,contractAddress:_,fromAddress:m,client:b,estimateGasMarginBps:d?.estimateGasMarginBps}),S={chainId:n.caip2ToEip155HexChainId(u.sourceChain.chainId),data:y,from:m,gas:x,to:_,value:v?u.amountIn:0n,...d?.maxFeePerGas===void 0?null:{maxFeePerGas:d.maxFeePerGas,maxPriorityFeePerGas:d.maxPriorityFeePerGas}},C={currentSignature:1,currentSignatureReason:e.TransferSignatureReason.WrapToken,quote:u,requiredSignatures:1};f?.(C);let w=Date.now();return r.sourcePendingTransferFromQuote(u,{environment:c,txHash:await l.sign(S,async e=>b.sendRawTransaction({serializedTransaction:e}),C),startedAtMs:w,requiredConfirmationCount:1})}}exports.transferAssetFactory=s;
2
2
  //# sourceMappingURL=transfer-asset.cjs.map
@@ -1,2 +1,2 @@
1
- import{ServiceType as e,TransferSignatureReason as t}from"../../../constants.js";import{ErrorCode as n,ErrorReason as r,SdkError as i}from"../../../errors.js";import{caip2ToEip155HexChainId as a}from"../../../utils/caip.js";import{getEvmClientForChain as o}from"../../_utils.js";import{encodeWrapUnwrapData as s,estimateWrapUnwrapGas as c,getWrapDirection as l,getWrapperContractAddress as u}from"../_utils.js";import{sourcePendingTransferFromQuote as d}from"../../_transfer-utilities.js";import{isAddress as f}from"viem";function p({chainConfigs:p,environment:m,evmSigner:h}){return async({quote:g,gasSettings:_,onStepChange:v})=>{if(g.serviceType!==e.WRAP_UNWRAP)throw new i(r.INCORRECT_PROVIDER_PROVIDED,n.INVALID_PARAMS);let y=Math.floor(Date.now()/1e3);if(g.expiresAt<=y)throw new i(r.QUOTE_EXPIRED,n.INVALID_PARAMS);let b=g.fromAddress;if(!f(b))throw new i(r.INVALID_PARAMS,n.INVALID_PARAMS,{details:`fromAddress is not a valid EVM address.`});let x=g.sourceChain.chainId,S=l(g.assetIn,g.assetOut,x,p);if(!S)throw new i(r.INVALID_PARAMS,n.INVALID_PARAMS,{details:`Quote does not represent a valid wrap/unwrap pair.`});let C=u(x,p),w=S===`wrap`,T=s(S,g.amountIn),E=o({chain:g.sourceChain}),D=await c({direction:S,amountIn:g.amountIn,contractAddress:C,fromAddress:b,client:E,estimateGasMarginBps:_?.estimateGasMarginBps}),O={chainId:a(g.sourceChain.chainId),data:T,from:b,gas:D,to:C,value:w?g.amountIn:0n,..._?.maxFeePerGas===void 0?null:{maxFeePerGas:_.maxFeePerGas,maxPriorityFeePerGas:_.maxPriorityFeePerGas}},k={currentSignature:1,currentSignatureReason:t.WrapToken,quote:g,requiredSignatures:1};v?.(k);let A=Date.now();return d(g,{environment:m,txHash:await h.sign(O,async e=>E.sendRawTransaction({serializedTransaction:e}),k),startedAtMs:A,requiredConfirmationCount:1})}}export{p as transferAssetFactory};
1
+ import{ServiceType as e,TransferSignatureReason as t}from"../../../constants.js";import{ErrorCode as n,ErrorReason as r,SdkError as i}from"../../../errors.js";import{caip2ToEip155HexChainId as a}from"../../../utils/caip.js";import{sourcePendingTransferFromQuote as o}from"../../_transfer-utilities.js";import{getEvmClientForChain as s}from"../../_utils.js";import{encodeWrapUnwrapData as c,estimateWrapUnwrapGas as l,getWrapDirection as u,getWrapperContractAddress as d}from"../_utils.js";import{isAddress as f}from"viem";function p({chainConfigs:p,environment:m,evmSigner:h}){return async({quote:g,gasSettings:_,onStepChange:v})=>{if(g.serviceType!==e.WRAP_UNWRAP)throw new i(r.INCORRECT_PROVIDER_PROVIDED,n.INVALID_PARAMS);let y=Math.floor(Date.now()/1e3);if(g.expiresAt<=y)throw new i(r.QUOTE_EXPIRED,n.INVALID_PARAMS);let b=g.fromAddress;if(!f(b))throw new i(r.INVALID_PARAMS,n.INVALID_PARAMS,{details:`fromAddress is not a valid EVM address.`});let x=g.sourceChain.chainId,S=u(g.assetIn,g.assetOut,x,p);if(!S)throw new i(r.INVALID_PARAMS,n.INVALID_PARAMS,{details:`Quote does not represent a valid wrap/unwrap pair.`});let C=d(x,p),w=S===`wrap`,T=c(S,g.amountIn),E=s({chain:g.sourceChain}),D=await l({direction:S,amountIn:g.amountIn,contractAddress:C,fromAddress:b,client:E,estimateGasMarginBps:_?.estimateGasMarginBps}),O={chainId:a(g.sourceChain.chainId),data:T,from:b,gas:D,to:C,value:w?g.amountIn:0n,..._?.maxFeePerGas===void 0?null:{maxFeePerGas:_.maxFeePerGas,maxPriorityFeePerGas:_.maxPriorityFeePerGas}},k={currentSignature:1,currentSignatureReason:t.WrapToken,quote:g,requiredSignatures:1};v?.(k);let A=Date.now();return o(g,{environment:m,txHash:await h.sign(O,async e=>E.sendRawTransaction({serializedTransaction:e}),k),startedAtMs:A,requiredConfirmationCount:1})}}export{p as transferAssetFactory};
2
2
  //# sourceMappingURL=transfer-asset.js.map
@@ -57,10 +57,26 @@ type DestinationInfo = Record<string, {
57
57
  address: string;
58
58
  bridgeProviders: ServiceType[];
59
59
  }>;
60
+ /**
61
+ * Asset augmented with optional provider-specific metadata.
62
+ * `extras` is passed through by bridgeable-asset APIs without SDK-specific interpretation.
63
+ */
64
+ type AssetWithExtras = Asset & {
65
+ readonly extras?: Record<string, unknown>;
66
+ };
67
+ /**
68
+ * Asset shape used by bridgeable-assets APIs.
69
+ *
70
+ * - `id` is generated via `getAssetId(chainId, asset)`.
71
+ * - `extras` is an optional bag for provider-specific metadata.
72
+ */
73
+ type BridgeableAsset = AssetWithExtras & {
74
+ readonly id: string;
75
+ };
60
76
  /** Asset enriched with bridge providers that support it as a destination. */
61
- type BridgeableUiAsset = Asset & {
77
+ type BridgeableUiAsset = BridgeableAsset & {
62
78
  readonly bridgeProviders: readonly ServiceType[];
63
79
  };
64
80
  //#endregion
65
- export { Asset, BridgeableUiAsset, ChainAssetMap, DestinationInfo, Erc20Asset, NativeAsset, SplAsset, TransferableAsset };
81
+ export { Asset, AssetWithExtras, BridgeableAsset, BridgeableUiAsset, ChainAssetMap, DestinationInfo, Erc20Asset, NativeAsset, SplAsset, TransferableAsset };
66
82
  //# sourceMappingURL=asset.d.cts.map
@@ -57,10 +57,26 @@ type DestinationInfo = Record<string, {
57
57
  address: string;
58
58
  bridgeProviders: ServiceType[];
59
59
  }>;
60
+ /**
61
+ * Asset augmented with optional provider-specific metadata.
62
+ * `extras` is passed through by bridgeable-asset APIs without SDK-specific interpretation.
63
+ */
64
+ type AssetWithExtras = Asset & {
65
+ readonly extras?: Record<string, unknown>;
66
+ };
67
+ /**
68
+ * Asset shape used by bridgeable-assets APIs.
69
+ *
70
+ * - `id` is generated via `getAssetId(chainId, asset)`.
71
+ * - `extras` is an optional bag for provider-specific metadata.
72
+ */
73
+ type BridgeableAsset = AssetWithExtras & {
74
+ readonly id: string;
75
+ };
60
76
  /** Asset enriched with bridge providers that support it as a destination. */
61
- type BridgeableUiAsset = Asset & {
77
+ type BridgeableUiAsset = BridgeableAsset & {
62
78
  readonly bridgeProviders: readonly ServiceType[];
63
79
  };
64
80
  //#endregion
65
- export { Asset, BridgeableUiAsset, ChainAssetMap, DestinationInfo, Erc20Asset, NativeAsset, SplAsset, TransferableAsset };
81
+ export { Asset, AssetWithExtras, BridgeableAsset, BridgeableUiAsset, ChainAssetMap, DestinationInfo, Erc20Asset, NativeAsset, SplAsset, TransferableAsset };
66
82
  //# sourceMappingURL=asset.d.ts.map
@@ -1,12 +1,14 @@
1
1
  import { Caip2ChainId } from "./caip.cjs";
2
2
  import { BitcoinFunctions } from "./bitcoin.cjs";
3
3
  import { FeeRateTier } from "./fee.cjs";
4
- import { EVM_SERVICE_TYPES, ServiceType } from "../constants.cjs";
5
- import { Asset, BridgeableUiAsset, ChainAssetMap, NativeAsset } from "./asset.cjs";
4
+ import { AvalancheBlockchainAlias, EVM_SERVICE_TYPES, ServiceType } from "../constants.cjs";
5
+ import { Asset, AssetWithExtras, BridgeableUiAsset, ChainAssetMap, NativeAsset } from "./asset.cjs";
6
6
  import { Quote, QuoterProps, ServiceQuoteEventHandler } from "./quote.cjs";
7
+ import { ArrayElement } from "./utility-types.cjs";
8
+ import { GetAtomicUtxosCallback, GetCoreEthAddressCallback, GetUtxosCallback, GetWalletAddressesForChainAliasCallback, GetWalletChangeAddressForChainAliasCallback } from "../transfer-service/avalanche-cct/types.cjs";
7
9
  import { Transfer, TransferStepDetails } from "./transfer.cjs";
8
10
  import { BtcSigner, EvmSigner, EvmSignerWithMessage, SolanaSigner } from "./signer.cjs";
9
- import { ArrayElement } from "./utility-types.cjs";
11
+ import { UnsignedTx } from "@avalabs/avalanchejs";
10
12
 
11
13
  //#region src/types/service.d.ts
12
14
  /** Optional EIP-1559-style gas settings. */
@@ -121,11 +123,40 @@ interface EstimateNativeFeeOptions {
121
123
  maxPriorityFeePerGas?: bigint;
122
124
  }>;
123
125
  }
126
+ /**
127
+ * Asset search input used by bridgeable-assets queries.
128
+ *
129
+ * - `type: 'address'` means `value` is matched as an on-chain asset address.
130
+ * - `type: 'keyword'` means `value` is matched against asset name/symbol text.
131
+ */
132
+ interface AssetSearchQuery {
133
+ readonly type: "address" | "keyword";
134
+ readonly value: string;
135
+ }
124
136
  interface GetBridgeableAssetsProps {
137
+ /** Maximum number of assets requested per page. Must be a positive integer. */
138
+ readonly limit?: number;
139
+ /** 1-based page index for service-level pagination. */
140
+ readonly page?: number;
141
+ /**
142
+ * Optional query used to search by address or keyword (name/symbol).
143
+ * Currently, search filtering is only applied by the Markr service.
144
+ */
145
+ readonly search?: AssetSearchQuery;
125
146
  readonly sourceAsset: Asset;
126
147
  readonly sourceChainId: Caip2ChainId;
127
148
  readonly targetChainId: Caip2ChainId;
128
149
  }
150
+ interface GetBridgeableAssetsResult {
151
+ /** Assets for the requested page. */
152
+ readonly assets: readonly BridgeableUiAsset[];
153
+ /** Service pagination metadata for this response page. */
154
+ readonly meta: {
155
+ readonly currentPage: number;
156
+ readonly hasMore: boolean;
157
+ readonly nextPage?: number;
158
+ };
159
+ }
129
160
  /**
130
161
  * Mapping of services supported chains, and their corresponding supported destination chains.
131
162
  */
@@ -165,12 +196,56 @@ interface TransferService {
165
196
  result: Promise<Transfer>;
166
197
  };
167
198
  /** Return assets receivable on targetChainId for the given source, via this service. */
168
- getBridgeableAssets(props: GetBridgeableAssetsProps): Promise<readonly BridgeableUiAsset[]>;
199
+ getBridgeableAssets(props: GetBridgeableAssetsProps): Promise<GetBridgeableAssetsResult>;
169
200
  /** Execute the quote, emitting `onStepChange` for signature steps. */
170
201
  transferAsset(props: TransferAssetProps): Promise<Transfer>;
171
202
  /** Concrete discriminator for this service. */
172
203
  type: ServiceType;
173
204
  }
205
+ type AvalancheSendTxFunction = (unsignedTx: UnsignedTx, txType: "export" | "import", chainAlias: AvalancheBlockchainAlias) => Promise<string>;
206
+ type AvalancheCctInitializer = {
207
+ type: ServiceType.AVALANCHE_CCT;
208
+ /**
209
+ * Sends a fully built Avalanche export/import transaction and returns its transaction hash.
210
+ *
211
+ * You must implement signing and broadcasting on your side using the connected wallet/account
212
+ * for the provided chain alias.
213
+ */
214
+ avalancheSendTx: AvalancheSendTxFunction;
215
+ /**
216
+ * Maps an EVM C-Chain hex address (for example `0x...`) to the equivalent Coreth bech32 address.
217
+ *
218
+ * You must provide the address conversion from your wallet/provider stack so the SDK can route
219
+ * C-Chain imports/exports that require bech32 address format.
220
+ */
221
+ getCoreEthAddress: GetCoreEthAddressCallback;
222
+ /**
223
+ * Returns atomic UTXOs that are pending import into `destinationChain` from `sourceChain`.
224
+ *
225
+ * You must query Avalanche APIs/wallet state and return only currently importable atomic UTXOs
226
+ * for the specified source/destination chain pair.
227
+ */
228
+ getAtomicUtxos: GetAtomicUtxosCallback;
229
+ /**
230
+ * Returns spendable UTXOs for the provided P-Chain or X-Chain alias.
231
+ *
232
+ * You must load the wallet's current UTXO set for that chain so export transactions can be built.
233
+ */
234
+ getUtxos: GetUtxosCallback;
235
+ /**
236
+ * Returns addresses on the provided chain alias that are controlled by the connected wallet.
237
+ *
238
+ * You must provide all wallet-owned addresses relevant for transaction input ownership/signing checks.
239
+ */
240
+ getWalletAddressesForChainAlias: GetWalletAddressesForChainAliasCallback;
241
+ /**
242
+ * Returns the change address for the provided chain alias.
243
+ *
244
+ * You must return a valid wallet-controlled address that should receive change outputs
245
+ * when UTXO-based transactions are constructed.
246
+ */
247
+ getWalletChangeAddressForChainAlias: GetWalletChangeAddressForChainAliasCallback;
248
+ };
174
249
  /** EVM-family service initializer. */
175
250
  type EvmServiceInitializer = {
176
251
  type: ArrayElement<typeof EVM_SERVICE_TYPES>;
@@ -200,10 +275,23 @@ type MarkrServiceInitializer = {
200
275
  * Returns the assets available to receive on targetChainId via Markr cross-chain swaps.
201
276
  * The SDK calls this during getBridgeableAssets.
202
277
  * Similar to the bitcoinFunctions pattern, this decouples the SDK from any specific token registry.
278
+ * Any provider-specific metadata can be supplied via BridgeableAsset.extras and is passed through to consumers.
203
279
  */
204
- getTargetChainAssets: (targetChainId: Caip2ChainId) => Promise<readonly Asset[]>;
280
+ getTargetChainAssets: (queryProps: {
281
+ /** Optional query used to search by address or keyword (name/symbol). */search?: AssetSearchQuery;
282
+ limit: number;
283
+ page: number;
284
+ targetChainId: Caip2ChainId;
285
+ }) => Promise<{
286
+ readonly assets: readonly AssetWithExtras[];
287
+ readonly meta: {
288
+ readonly currentPage: number;
289
+ readonly hasMore: boolean;
290
+ readonly nextPage: number | undefined;
291
+ };
292
+ }>;
205
293
  };
206
- type ServiceInitializer = EvmServiceInitializer | LombardServiceInitializer | MarkrServiceInitializer;
294
+ type ServiceInitializer = AvalancheCctInitializer | EvmServiceInitializer | LombardServiceInitializer | MarkrServiceInitializer;
207
295
  //#endregion
208
- export { EstimateNativeFeeOptions, EvmServiceInitializer, GasSettings, GetBridgeableAssetsProps, GetMinimumTransferAmountProps, GetSupportedChainsResult, LombardServiceInitializer, MarkrServiceInitializer, MutableGetSupportedChainsResult, NativeFeeEstimate, ServiceInitializer, TrackTransferProps, TransferAssetProps, TransferService };
296
+ export { AssetSearchQuery, AvalancheCctInitializer, AvalancheSendTxFunction, EstimateNativeFeeOptions, EvmServiceInitializer, GasSettings, GetBridgeableAssetsProps, GetBridgeableAssetsResult, GetMinimumTransferAmountProps, GetSupportedChainsResult, LombardServiceInitializer, MarkrServiceInitializer, MutableGetSupportedChainsResult, NativeFeeEstimate, ServiceInitializer, TrackTransferProps, TransferAssetProps, TransferService };
209
297
  //# sourceMappingURL=service.d.cts.map
@@ -1,12 +1,14 @@
1
1
  import { Caip2ChainId } from "./caip.js";
2
2
  import { BitcoinFunctions } from "./bitcoin.js";
3
3
  import { FeeRateTier } from "./fee.js";
4
- import { EVM_SERVICE_TYPES, ServiceType } from "../constants.js";
5
- import { Asset, BridgeableUiAsset, ChainAssetMap, NativeAsset } from "./asset.js";
4
+ import { AvalancheBlockchainAlias, EVM_SERVICE_TYPES, ServiceType } from "../constants.js";
5
+ import { Asset, AssetWithExtras, BridgeableUiAsset, ChainAssetMap, NativeAsset } from "./asset.js";
6
6
  import { Quote, QuoterProps, ServiceQuoteEventHandler } from "./quote.js";
7
+ import { ArrayElement } from "./utility-types.js";
8
+ import { GetAtomicUtxosCallback, GetCoreEthAddressCallback, GetUtxosCallback, GetWalletAddressesForChainAliasCallback, GetWalletChangeAddressForChainAliasCallback } from "../transfer-service/avalanche-cct/types.js";
7
9
  import { Transfer, TransferStepDetails } from "./transfer.js";
8
10
  import { BtcSigner, EvmSigner, EvmSignerWithMessage, SolanaSigner } from "./signer.js";
9
- import { ArrayElement } from "./utility-types.js";
11
+ import { UnsignedTx } from "@avalabs/avalanchejs";
10
12
 
11
13
  //#region src/types/service.d.ts
12
14
  /** Optional EIP-1559-style gas settings. */
@@ -121,11 +123,40 @@ interface EstimateNativeFeeOptions {
121
123
  maxPriorityFeePerGas?: bigint;
122
124
  }>;
123
125
  }
126
+ /**
127
+ * Asset search input used by bridgeable-assets queries.
128
+ *
129
+ * - `type: 'address'` means `value` is matched as an on-chain asset address.
130
+ * - `type: 'keyword'` means `value` is matched against asset name/symbol text.
131
+ */
132
+ interface AssetSearchQuery {
133
+ readonly type: "address" | "keyword";
134
+ readonly value: string;
135
+ }
124
136
  interface GetBridgeableAssetsProps {
137
+ /** Maximum number of assets requested per page. Must be a positive integer. */
138
+ readonly limit?: number;
139
+ /** 1-based page index for service-level pagination. */
140
+ readonly page?: number;
141
+ /**
142
+ * Optional query used to search by address or keyword (name/symbol).
143
+ * Currently, search filtering is only applied by the Markr service.
144
+ */
145
+ readonly search?: AssetSearchQuery;
125
146
  readonly sourceAsset: Asset;
126
147
  readonly sourceChainId: Caip2ChainId;
127
148
  readonly targetChainId: Caip2ChainId;
128
149
  }
150
+ interface GetBridgeableAssetsResult {
151
+ /** Assets for the requested page. */
152
+ readonly assets: readonly BridgeableUiAsset[];
153
+ /** Service pagination metadata for this response page. */
154
+ readonly meta: {
155
+ readonly currentPage: number;
156
+ readonly hasMore: boolean;
157
+ readonly nextPage?: number;
158
+ };
159
+ }
129
160
  /**
130
161
  * Mapping of services supported chains, and their corresponding supported destination chains.
131
162
  */
@@ -165,12 +196,56 @@ interface TransferService {
165
196
  result: Promise<Transfer>;
166
197
  };
167
198
  /** Return assets receivable on targetChainId for the given source, via this service. */
168
- getBridgeableAssets(props: GetBridgeableAssetsProps): Promise<readonly BridgeableUiAsset[]>;
199
+ getBridgeableAssets(props: GetBridgeableAssetsProps): Promise<GetBridgeableAssetsResult>;
169
200
  /** Execute the quote, emitting `onStepChange` for signature steps. */
170
201
  transferAsset(props: TransferAssetProps): Promise<Transfer>;
171
202
  /** Concrete discriminator for this service. */
172
203
  type: ServiceType;
173
204
  }
205
+ type AvalancheSendTxFunction = (unsignedTx: UnsignedTx, txType: "export" | "import", chainAlias: AvalancheBlockchainAlias) => Promise<string>;
206
+ type AvalancheCctInitializer = {
207
+ type: ServiceType.AVALANCHE_CCT;
208
+ /**
209
+ * Sends a fully built Avalanche export/import transaction and returns its transaction hash.
210
+ *
211
+ * You must implement signing and broadcasting on your side using the connected wallet/account
212
+ * for the provided chain alias.
213
+ */
214
+ avalancheSendTx: AvalancheSendTxFunction;
215
+ /**
216
+ * Maps an EVM C-Chain hex address (for example `0x...`) to the equivalent Coreth bech32 address.
217
+ *
218
+ * You must provide the address conversion from your wallet/provider stack so the SDK can route
219
+ * C-Chain imports/exports that require bech32 address format.
220
+ */
221
+ getCoreEthAddress: GetCoreEthAddressCallback;
222
+ /**
223
+ * Returns atomic UTXOs that are pending import into `destinationChain` from `sourceChain`.
224
+ *
225
+ * You must query Avalanche APIs/wallet state and return only currently importable atomic UTXOs
226
+ * for the specified source/destination chain pair.
227
+ */
228
+ getAtomicUtxos: GetAtomicUtxosCallback;
229
+ /**
230
+ * Returns spendable UTXOs for the provided P-Chain or X-Chain alias.
231
+ *
232
+ * You must load the wallet's current UTXO set for that chain so export transactions can be built.
233
+ */
234
+ getUtxos: GetUtxosCallback;
235
+ /**
236
+ * Returns addresses on the provided chain alias that are controlled by the connected wallet.
237
+ *
238
+ * You must provide all wallet-owned addresses relevant for transaction input ownership/signing checks.
239
+ */
240
+ getWalletAddressesForChainAlias: GetWalletAddressesForChainAliasCallback;
241
+ /**
242
+ * Returns the change address for the provided chain alias.
243
+ *
244
+ * You must return a valid wallet-controlled address that should receive change outputs
245
+ * when UTXO-based transactions are constructed.
246
+ */
247
+ getWalletChangeAddressForChainAlias: GetWalletChangeAddressForChainAliasCallback;
248
+ };
174
249
  /** EVM-family service initializer. */
175
250
  type EvmServiceInitializer = {
176
251
  type: ArrayElement<typeof EVM_SERVICE_TYPES>;
@@ -200,10 +275,23 @@ type MarkrServiceInitializer = {
200
275
  * Returns the assets available to receive on targetChainId via Markr cross-chain swaps.
201
276
  * The SDK calls this during getBridgeableAssets.
202
277
  * Similar to the bitcoinFunctions pattern, this decouples the SDK from any specific token registry.
278
+ * Any provider-specific metadata can be supplied via BridgeableAsset.extras and is passed through to consumers.
203
279
  */
204
- getTargetChainAssets: (targetChainId: Caip2ChainId) => Promise<readonly Asset[]>;
280
+ getTargetChainAssets: (queryProps: {
281
+ /** Optional query used to search by address or keyword (name/symbol). */search?: AssetSearchQuery;
282
+ limit: number;
283
+ page: number;
284
+ targetChainId: Caip2ChainId;
285
+ }) => Promise<{
286
+ readonly assets: readonly AssetWithExtras[];
287
+ readonly meta: {
288
+ readonly currentPage: number;
289
+ readonly hasMore: boolean;
290
+ readonly nextPage: number | undefined;
291
+ };
292
+ }>;
205
293
  };
206
- type ServiceInitializer = EvmServiceInitializer | LombardServiceInitializer | MarkrServiceInitializer;
294
+ type ServiceInitializer = AvalancheCctInitializer | EvmServiceInitializer | LombardServiceInitializer | MarkrServiceInitializer;
207
295
  //#endregion
208
- export { EstimateNativeFeeOptions, EvmServiceInitializer, GasSettings, GetBridgeableAssetsProps, GetMinimumTransferAmountProps, GetSupportedChainsResult, LombardServiceInitializer, MarkrServiceInitializer, MutableGetSupportedChainsResult, NativeFeeEstimate, ServiceInitializer, TrackTransferProps, TransferAssetProps, TransferService };
296
+ export { AssetSearchQuery, AvalancheCctInitializer, AvalancheSendTxFunction, EstimateNativeFeeOptions, EvmServiceInitializer, GasSettings, GetBridgeableAssetsProps, GetBridgeableAssetsResult, GetMinimumTransferAmountProps, GetSupportedChainsResult, LombardServiceInitializer, MarkrServiceInitializer, MutableGetSupportedChainsResult, NativeFeeEstimate, ServiceInitializer, TrackTransferProps, TransferAssetProps, TransferService };
209
297
  //# sourceMappingURL=service.d.ts.map
@@ -2,10 +2,10 @@ import { Caip2ChainId } from "./caip.cjs";
2
2
  import { Environment, ServiceType } from "../constants.cjs";
3
3
  import { Asset, BridgeableUiAsset } from "./asset.cjs";
4
4
  import { Quote, QuoterInterface, QuoterProps } from "./quote.cjs";
5
+ import { Fetch } from "./utility-types.cjs";
5
6
  import { SdkError } from "../errors.cjs";
6
7
  import { Transfer } from "./transfer.cjs";
7
- import { Fetch } from "./utility-types.cjs";
8
- import { EstimateNativeFeeOptions, GetMinimumTransferAmountProps, GetSupportedChainsResult, NativeFeeEstimate, ServiceInitializer, TrackTransferProps, TransferAssetProps } from "./service.cjs";
8
+ import { EstimateNativeFeeOptions, GetBridgeableAssetsProps, GetMinimumTransferAmountProps, GetSupportedChainsResult, NativeFeeEstimate, ServiceInitializer, TrackTransferProps, TransferAssetProps } from "./service.cjs";
9
9
  import { QuoterOptions } from "../quoter/quoter.cjs";
10
10
 
11
11
  //#region src/types/transfer-manager.d.ts
@@ -55,19 +55,28 @@ interface TransferManager {
55
55
  /** Estimate the native fee for executing the provided quote. */
56
56
  estimateNativeFee(quote: Quote, options?: EstimateNativeFeeOptions): Promise<NativeFeeEstimate>;
57
57
  /**
58
- * Returns all assets possibly receivable on targetChainId for the given source asset,
59
- * across all configured bridge and swap providers. Assets are enriched with logoUri
60
- * where available.
58
+ * Returns a single page of combined bridgeable assets for the given source/target route.
59
+ * This API is designed for React Query `useInfiniteQuery`:
60
+ *
61
+ * - pass `pageParam` to this method as `page`
62
+ * - use `result.assets` as the current page payload
63
+ * - use `result.meta.nextPage` in `getNextPageParam`
64
+ *
65
+ * `search` is forwarded to all configured services, but currently only Markr
66
+ * applies search filtering in service implementations.
61
67
  *
62
68
  * Note: inclusion in this list does not guarantee a quote will succeed — for some
63
69
  * providers (e.g. Markr) routes are discovered at quote time and may not always be
64
70
  * available.
65
71
  */
66
- getBridgeableAssets(props: {
67
- sourceAsset: Asset;
68
- sourceChainId: Caip2ChainId;
69
- targetChainId: Caip2ChainId;
70
- }): Promise<readonly BridgeableUiAsset[]>;
72
+ getBridgeableAssets(props: GetBridgeableAssetsProps): Promise<{
73
+ readonly assets: readonly BridgeableUiAsset[];
74
+ readonly meta: {
75
+ readonly currentPage: number;
76
+ readonly hasMore: boolean;
77
+ readonly nextPage?: number;
78
+ };
79
+ }>;
71
80
  /**
72
81
  * Minimum supported source amount for a given pair.
73
82
  *
@@ -2,10 +2,10 @@ import { Caip2ChainId } from "./caip.js";
2
2
  import { Environment, ServiceType } from "../constants.js";
3
3
  import { Asset, BridgeableUiAsset } from "./asset.js";
4
4
  import { Quote, QuoterInterface, QuoterProps } from "./quote.js";
5
+ import { Fetch } from "./utility-types.js";
5
6
  import { SdkError } from "../errors.js";
6
7
  import { Transfer } from "./transfer.js";
7
- import { Fetch } from "./utility-types.js";
8
- import { EstimateNativeFeeOptions, GetMinimumTransferAmountProps, GetSupportedChainsResult, NativeFeeEstimate, ServiceInitializer, TrackTransferProps, TransferAssetProps } from "./service.js";
8
+ import { EstimateNativeFeeOptions, GetBridgeableAssetsProps, GetMinimumTransferAmountProps, GetSupportedChainsResult, NativeFeeEstimate, ServiceInitializer, TrackTransferProps, TransferAssetProps } from "./service.js";
9
9
  import { QuoterOptions } from "../quoter/quoter.js";
10
10
 
11
11
  //#region src/types/transfer-manager.d.ts
@@ -55,19 +55,28 @@ interface TransferManager {
55
55
  /** Estimate the native fee for executing the provided quote. */
56
56
  estimateNativeFee(quote: Quote, options?: EstimateNativeFeeOptions): Promise<NativeFeeEstimate>;
57
57
  /**
58
- * Returns all assets possibly receivable on targetChainId for the given source asset,
59
- * across all configured bridge and swap providers. Assets are enriched with logoUri
60
- * where available.
58
+ * Returns a single page of combined bridgeable assets for the given source/target route.
59
+ * This API is designed for React Query `useInfiniteQuery`:
60
+ *
61
+ * - pass `pageParam` to this method as `page`
62
+ * - use `result.assets` as the current page payload
63
+ * - use `result.meta.nextPage` in `getNextPageParam`
64
+ *
65
+ * `search` is forwarded to all configured services, but currently only Markr
66
+ * applies search filtering in service implementations.
61
67
  *
62
68
  * Note: inclusion in this list does not guarantee a quote will succeed — for some
63
69
  * providers (e.g. Markr) routes are discovered at quote time and may not always be
64
70
  * available.
65
71
  */
66
- getBridgeableAssets(props: {
67
- sourceAsset: Asset;
68
- sourceChainId: Caip2ChainId;
69
- targetChainId: Caip2ChainId;
70
- }): Promise<readonly BridgeableUiAsset[]>;
72
+ getBridgeableAssets(props: GetBridgeableAssetsProps): Promise<{
73
+ readonly assets: readonly BridgeableUiAsset[];
74
+ readonly meta: {
75
+ readonly currentPage: number;
76
+ readonly hasMore: boolean;
77
+ readonly nextPage?: number;
78
+ };
79
+ }>;
71
80
  /**
72
81
  * Minimum supported source amount for a given pair.
73
82
  *
@@ -8,6 +8,13 @@
8
8
  */
9
9
  type ArrayElement<A> = A extends readonly (infer T)[] ? T : never;
10
10
  /**
11
+ * Utility type to create a branded type, which is a subtype of the original
12
+ * type but with an additional unique brand property to prevent accidental interchangeability.
13
+ */
14
+ type Brand<K, T> = K & {
15
+ readonly __brand: T;
16
+ };
17
+ /**
11
18
  * Utility type to make all properties of a type mutable (non-readonly).
12
19
  */
13
20
  type Mutable<T> = { -readonly [P in keyof T]: T[P] };
@@ -17,5 +24,5 @@ type Mutable<T> = { -readonly [P in keyof T]: T[P] };
17
24
  type DeepMutable<T> = { -readonly [P in keyof T]: T[P] extends object ? DeepMutable<T[P]> : T[P] };
18
25
  type Fetch = typeof globalThis.fetch;
19
26
  //#endregion
20
- export { ArrayElement, DeepMutable, Fetch, Mutable };
27
+ export { ArrayElement, Brand, DeepMutable, Fetch, Mutable };
21
28
  //# sourceMappingURL=utility-types.d.cts.map
@@ -8,6 +8,13 @@
8
8
  */
9
9
  type ArrayElement<A> = A extends readonly (infer T)[] ? T : never;
10
10
  /**
11
+ * Utility type to create a branded type, which is a subtype of the original
12
+ * type but with an additional unique brand property to prevent accidental interchangeability.
13
+ */
14
+ type Brand<K, T> = K & {
15
+ readonly __brand: T;
16
+ };
17
+ /**
11
18
  * Utility type to make all properties of a type mutable (non-readonly).
12
19
  */
13
20
  type Mutable<T> = { -readonly [P in keyof T]: T[P] };
@@ -17,5 +24,5 @@ type Mutable<T> = { -readonly [P in keyof T]: T[P] };
17
24
  type DeepMutable<T> = { -readonly [P in keyof T]: T[P] extends object ? DeepMutable<T[P]> : T[P] };
18
25
  type Fetch = typeof globalThis.fetch;
19
26
  //#endregion
20
- export { ArrayElement, DeepMutable, Fetch, Mutable };
27
+ export { ArrayElement, Brand, DeepMutable, Fetch, Mutable };
21
28
  //# sourceMappingURL=utility-types.d.ts.map
@@ -1,2 +1,2 @@
1
- const e=require(`../constants.cjs`);function t(t,n){return n.type===e.TokenType.NATIVE?`${t}:${n.type}`:`${t}:${n.type}:${n.address.toLowerCase()}`}exports.getAssetId=t;
1
+ const e=require(`../constants.cjs`);function t(t,n){return n.type===e.TokenType.NATIVE?`${t}::${n.type}`:`${t}::${n.type}::${n.address.toLowerCase()}`}exports.getAssetId=t;
2
2
  //# sourceMappingURL=asset-id.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-id.cjs","names":["TokenType"],"sources":["../../src/utils/asset-id.ts"],"sourcesContent":["import { TokenType } from '../constants';\nimport type { Asset } from '../types/asset';\nimport type { Caip2ChainId } from '../types/caip';\n\n/**\n * Returns a unique string identifier for an asset on a given chain.\n *\n * Format:\n * - Native assets: `{chainId}:native`\n * - Token assets: `{chainId}:{tokenType}:{lowercaseAddress}`\n */\nexport function getAssetId(chainId: Caip2ChainId, asset: Asset): string {\n if (asset.type === TokenType.NATIVE) {\n return `${chainId}:${asset.type}`;\n }\n\n return `${chainId}:${asset.type}:${asset.address.toLowerCase()}`;\n}\n"],"mappings":"oCAWA,SAAgB,EAAW,EAAuB,EAAsB,CAKtE,OAJI,EAAM,OAASA,EAAAA,UAAU,OACpB,GAAG,EAAQ,GAAG,EAAM,OAGtB,GAAG,EAAQ,GAAG,EAAM,KAAK,GAAG,EAAM,QAAQ,aAAa"}
1
+ {"version":3,"file":"asset-id.cjs","names":["TokenType"],"sources":["../../src/utils/asset-id.ts"],"sourcesContent":["import { TokenType } from '../constants';\nimport type { Asset } from '../types/asset';\nimport type { Caip2ChainId } from '../types/caip';\n\n/**\n * Returns a unique string identifier for an asset on a given chain.\n *\n * Format:\n * - Native assets: `{chainId}::native`\n * - Token assets: `{chainId}::{tokenType}::{lowercaseAddress}`\n */\nexport function getAssetId(chainId: Caip2ChainId, asset: Asset): string {\n if (asset.type === TokenType.NATIVE) {\n return `${chainId}::${asset.type}`;\n }\n\n return `${chainId}::${asset.type}::${asset.address.toLowerCase()}`;\n}\n"],"mappings":"oCAWA,SAAgB,EAAW,EAAuB,EAAsB,CAKtE,OAJI,EAAM,OAASA,EAAAA,UAAU,OACpB,GAAG,EAAQ,IAAI,EAAM,OAGvB,GAAG,EAAQ,IAAI,EAAM,KAAK,IAAI,EAAM,QAAQ,aAAa"}
@@ -1,2 +1,2 @@
1
- import{TokenType as e}from"../constants.js";function t(t,n){return n.type===e.NATIVE?`${t}:${n.type}`:`${t}:${n.type}:${n.address.toLowerCase()}`}export{t as getAssetId};
1
+ import{TokenType as e}from"../constants.js";function t(t,n){return n.type===e.NATIVE?`${t}::${n.type}`:`${t}::${n.type}::${n.address.toLowerCase()}`}export{t as getAssetId};
2
2
  //# sourceMappingURL=asset-id.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-id.js","names":[],"sources":["../../src/utils/asset-id.ts"],"sourcesContent":["import { TokenType } from '../constants';\nimport type { Asset } from '../types/asset';\nimport type { Caip2ChainId } from '../types/caip';\n\n/**\n * Returns a unique string identifier for an asset on a given chain.\n *\n * Format:\n * - Native assets: `{chainId}:native`\n * - Token assets: `{chainId}:{tokenType}:{lowercaseAddress}`\n */\nexport function getAssetId(chainId: Caip2ChainId, asset: Asset): string {\n if (asset.type === TokenType.NATIVE) {\n return `${chainId}:${asset.type}`;\n }\n\n return `${chainId}:${asset.type}:${asset.address.toLowerCase()}`;\n}\n"],"mappings":"4CAWA,SAAgB,EAAW,EAAuB,EAAsB,CAKtE,OAJI,EAAM,OAAS,EAAU,OACpB,GAAG,EAAQ,GAAG,EAAM,OAGtB,GAAG,EAAQ,GAAG,EAAM,KAAK,GAAG,EAAM,QAAQ,aAAa"}
1
+ {"version":3,"file":"asset-id.js","names":[],"sources":["../../src/utils/asset-id.ts"],"sourcesContent":["import { TokenType } from '../constants';\nimport type { Asset } from '../types/asset';\nimport type { Caip2ChainId } from '../types/caip';\n\n/**\n * Returns a unique string identifier for an asset on a given chain.\n *\n * Format:\n * - Native assets: `{chainId}::native`\n * - Token assets: `{chainId}::{tokenType}::{lowercaseAddress}`\n */\nexport function getAssetId(chainId: Caip2ChainId, asset: Asset): string {\n if (asset.type === TokenType.NATIVE) {\n return `${chainId}::${asset.type}`;\n }\n\n return `${chainId}::${asset.type}::${asset.address.toLowerCase()}`;\n}\n"],"mappings":"4CAWA,SAAgB,EAAW,EAAuB,EAAsB,CAKtE,OAJI,EAAM,OAAS,EAAU,OACpB,GAAG,EAAQ,IAAI,EAAM,OAGvB,GAAG,EAAQ,IAAI,EAAM,KAAK,IAAI,EAAM,QAAQ,aAAa"}
@@ -0,0 +1,2 @@
1
+ const e=require(`../constants.cjs`),t=t=>{let n=new Map,r=[];for(let i of t){let t=n.get(i.id);if(!t){n.set(i.id,{...i,bridgeProviders:[...new Set(i.bridgeProviders)]}),r.push(i.id);continue}let a=t.extras!==void 0||i.extras!==void 0?{...t.extras??{},...i.extras??{}}:void 0,o=i.bridgeProviders.includes(e.ServiceType.MARKR)?i:t;n.set(i.id,{...o,bridgeProviders:[...new Set([...t.bridgeProviders,...i.bridgeProviders])],...a===void 0?{}:{extras:a}})}return r.map(e=>n.get(e)).filter(e=>e!==void 0)};exports.dedupeBridgeableAssets=t;
2
+ //# sourceMappingURL=bridgeable-assets.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridgeable-assets.cjs","names":["ServiceType"],"sources":["../../src/utils/bridgeable-assets.ts"],"sourcesContent":["import { ServiceType } from '../constants';\nimport type { BridgeableUiAsset } from '../types/asset';\n\n/**\n * Deduplicates bridgeable assets by ID while preserving first-seen order.\n *\n * When duplicates are found:\n * - bridgeProviders are merged as a unique set (first-seen order)\n * - extras are shallow merged ({ ...existing.extras, ...incoming.extras })\n * - if the incoming duplicate includes MARKR, MARKR is treated as authoritative\n * for name/symbol/logoUri/address fields\n */\nexport const dedupeBridgeableAssets = (assets: readonly BridgeableUiAsset[]): readonly BridgeableUiAsset[] => {\n const merged = new Map<string, BridgeableUiAsset>();\n const orderedIds: string[] = [];\n\n for (const asset of assets) {\n const existing = merged.get(asset.id);\n\n if (!existing) {\n merged.set(asset.id, {\n ...asset,\n bridgeProviders: [...new Set(asset.bridgeProviders)],\n });\n orderedIds.push(asset.id);\n continue;\n }\n\n const mergedExtras =\n existing.extras !== undefined || asset.extras !== undefined\n ? {\n ...(existing.extras ?? {}),\n ...(asset.extras ?? {}),\n }\n : undefined;\n const incomingFromMarkr = asset.bridgeProviders.includes(ServiceType.MARKR);\n const canonicalAsset = incomingFromMarkr ? asset : existing;\n\n merged.set(asset.id, {\n ...canonicalAsset,\n bridgeProviders: [...new Set([...existing.bridgeProviders, ...asset.bridgeProviders])],\n ...(mergedExtras !== undefined ? { extras: mergedExtras } : {}),\n });\n }\n\n return orderedIds.map((id) => merged.get(id)).filter((asset): asset is BridgeableUiAsset => asset !== undefined);\n};\n"],"mappings":"oCAYa,EAA0B,GAAuE,CAC5G,IAAM,EAAS,IAAI,IACb,EAAuB,EAAE,CAE/B,IAAK,IAAM,KAAS,EAAQ,CAC1B,IAAM,EAAW,EAAO,IAAI,EAAM,GAAG,CAErC,GAAI,CAAC,EAAU,CACb,EAAO,IAAI,EAAM,GAAI,CACnB,GAAG,EACH,gBAAiB,CAAC,GAAG,IAAI,IAAI,EAAM,gBAAgB,CAAC,CACrD,CAAC,CACF,EAAW,KAAK,EAAM,GAAG,CACzB,SAGF,IAAM,EACJ,EAAS,SAAW,IAAA,IAAa,EAAM,SAAW,IAAA,GAC9C,CACE,GAAI,EAAS,QAAU,EAAE,CACzB,GAAI,EAAM,QAAU,EAAE,CACvB,CACD,IAAA,GAEA,EADoB,EAAM,gBAAgB,SAASA,EAAAA,YAAY,MAAM,CAChC,EAAQ,EAEnD,EAAO,IAAI,EAAM,GAAI,CACnB,GAAG,EACH,gBAAiB,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAS,gBAAiB,GAAG,EAAM,gBAAgB,CAAC,CAAC,CACtF,GAAI,IAAiB,IAAA,GAAuC,EAAE,CAA7B,CAAE,OAAQ,EAAc,CAC1D,CAAC,CAGJ,OAAO,EAAW,IAAK,GAAO,EAAO,IAAI,EAAG,CAAC,CAAC,OAAQ,GAAsC,IAAU,IAAA,GAAU"}
@@ -0,0 +1,16 @@
1
+ import { BridgeableUiAsset } from "../types/asset.cjs";
2
+
3
+ //#region src/utils/bridgeable-assets.d.ts
4
+ /**
5
+ * Deduplicates bridgeable assets by ID while preserving first-seen order.
6
+ *
7
+ * When duplicates are found:
8
+ * - bridgeProviders are merged as a unique set (first-seen order)
9
+ * - extras are shallow merged ({ ...existing.extras, ...incoming.extras })
10
+ * - if the incoming duplicate includes MARKR, MARKR is treated as authoritative
11
+ * for name/symbol/logoUri/address fields
12
+ */
13
+ declare const dedupeBridgeableAssets: (assets: readonly BridgeableUiAsset[]) => readonly BridgeableUiAsset[];
14
+ //#endregion
15
+ export { dedupeBridgeableAssets };
16
+ //# sourceMappingURL=bridgeable-assets.d.cts.map
@@ -0,0 +1,16 @@
1
+ import { BridgeableUiAsset } from "../types/asset.js";
2
+
3
+ //#region src/utils/bridgeable-assets.d.ts
4
+ /**
5
+ * Deduplicates bridgeable assets by ID while preserving first-seen order.
6
+ *
7
+ * When duplicates are found:
8
+ * - bridgeProviders are merged as a unique set (first-seen order)
9
+ * - extras are shallow merged ({ ...existing.extras, ...incoming.extras })
10
+ * - if the incoming duplicate includes MARKR, MARKR is treated as authoritative
11
+ * for name/symbol/logoUri/address fields
12
+ */
13
+ declare const dedupeBridgeableAssets: (assets: readonly BridgeableUiAsset[]) => readonly BridgeableUiAsset[];
14
+ //#endregion
15
+ export { dedupeBridgeableAssets };
16
+ //# sourceMappingURL=bridgeable-assets.d.ts.map
@@ -0,0 +1,2 @@
1
+ import{ServiceType as e}from"../constants.js";const t=t=>{let n=new Map,r=[];for(let i of t){let t=n.get(i.id);if(!t){n.set(i.id,{...i,bridgeProviders:[...new Set(i.bridgeProviders)]}),r.push(i.id);continue}let a=t.extras!==void 0||i.extras!==void 0?{...t.extras??{},...i.extras??{}}:void 0,o=i.bridgeProviders.includes(e.MARKR)?i:t;n.set(i.id,{...o,bridgeProviders:[...new Set([...t.bridgeProviders,...i.bridgeProviders])],...a===void 0?{}:{extras:a}})}return r.map(e=>n.get(e)).filter(e=>e!==void 0)};export{t as dedupeBridgeableAssets};
2
+ //# sourceMappingURL=bridgeable-assets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridgeable-assets.js","names":[],"sources":["../../src/utils/bridgeable-assets.ts"],"sourcesContent":["import { ServiceType } from '../constants';\nimport type { BridgeableUiAsset } from '../types/asset';\n\n/**\n * Deduplicates bridgeable assets by ID while preserving first-seen order.\n *\n * When duplicates are found:\n * - bridgeProviders are merged as a unique set (first-seen order)\n * - extras are shallow merged ({ ...existing.extras, ...incoming.extras })\n * - if the incoming duplicate includes MARKR, MARKR is treated as authoritative\n * for name/symbol/logoUri/address fields\n */\nexport const dedupeBridgeableAssets = (assets: readonly BridgeableUiAsset[]): readonly BridgeableUiAsset[] => {\n const merged = new Map<string, BridgeableUiAsset>();\n const orderedIds: string[] = [];\n\n for (const asset of assets) {\n const existing = merged.get(asset.id);\n\n if (!existing) {\n merged.set(asset.id, {\n ...asset,\n bridgeProviders: [...new Set(asset.bridgeProviders)],\n });\n orderedIds.push(asset.id);\n continue;\n }\n\n const mergedExtras =\n existing.extras !== undefined || asset.extras !== undefined\n ? {\n ...(existing.extras ?? {}),\n ...(asset.extras ?? {}),\n }\n : undefined;\n const incomingFromMarkr = asset.bridgeProviders.includes(ServiceType.MARKR);\n const canonicalAsset = incomingFromMarkr ? asset : existing;\n\n merged.set(asset.id, {\n ...canonicalAsset,\n bridgeProviders: [...new Set([...existing.bridgeProviders, ...asset.bridgeProviders])],\n ...(mergedExtras !== undefined ? { extras: mergedExtras } : {}),\n });\n }\n\n return orderedIds.map((id) => merged.get(id)).filter((asset): asset is BridgeableUiAsset => asset !== undefined);\n};\n"],"mappings":"8CAYA,MAAa,EAA0B,GAAuE,CAC5G,IAAM,EAAS,IAAI,IACb,EAAuB,EAAE,CAE/B,IAAK,IAAM,KAAS,EAAQ,CAC1B,IAAM,EAAW,EAAO,IAAI,EAAM,GAAG,CAErC,GAAI,CAAC,EAAU,CACb,EAAO,IAAI,EAAM,GAAI,CACnB,GAAG,EACH,gBAAiB,CAAC,GAAG,IAAI,IAAI,EAAM,gBAAgB,CAAC,CACrD,CAAC,CACF,EAAW,KAAK,EAAM,GAAG,CACzB,SAGF,IAAM,EACJ,EAAS,SAAW,IAAA,IAAa,EAAM,SAAW,IAAA,GAC9C,CACE,GAAI,EAAS,QAAU,EAAE,CACzB,GAAI,EAAM,QAAU,EAAE,CACvB,CACD,IAAA,GAEA,EADoB,EAAM,gBAAgB,SAAS,EAAY,MAAM,CAChC,EAAQ,EAEnD,EAAO,IAAI,EAAM,GAAI,CACnB,GAAG,EACH,gBAAiB,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAS,gBAAiB,GAAG,EAAM,gBAAgB,CAAC,CAAC,CACtF,GAAI,IAAiB,IAAA,GAAuC,EAAE,CAA7B,CAAE,OAAQ,EAAc,CAC1D,CAAC,CAGJ,OAAO,EAAW,IAAK,GAAO,EAAO,IAAI,EAAG,CAAC,CAAC,OAAQ,GAAsC,IAAU,IAAA,GAAU"}