@swapkit/plugins 4.0.19 → 4.0.20

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.
@@ -1,4 +1,4 @@
1
- var P={};k(P,{assetIdentifierToChainflipTicker:()=>b,ChainflipPlugin:()=>_,ChainflipBroker:()=>T});module.exports=D(P);var h=require("@polkadot/keyring"),f=require("@polkadot/util"),s=require("@swapkit/helpers"),b=new Map([["ARB.ETH","ArbEth"],["ARB.USDC-0XAF88D065E77C8CC2239327C5EDB3A432268E5831","ArbUsdc"],["BTC.BTC","Btc"],["DOT.DOT","Dot"],["ETH.ETH","Eth"],["ETH.FLIP-0X826180541412D574CF1336D22C0C0A287822678A","Flip"],["ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48","Usdc"],["ETH.USDT-0XDAC17F958D2EE523A2206206994597C13D831EC7","Usdt"],["SOL.SOL","Sol"],["SOL.USDC-EPJFWDD5AUFQSSQEM2QN1XZYBAPC8G4WEGGKZWYTDT1V","SolUsdc"]]),S=(e)=>()=>{let r=e.api.tx.swapping?.registerAsBroker?.();if(!r)throw new s.SwapKitError("chainflip_broker_register");return e.signAndBroadcast({address:e.getAddress(),tx:r})},B=(e)=>({feeAsset:r,recipient:t})=>{let o=r.chain===s.Chain.Polkadot,a=s.wrapWithThrow(()=>{return o?e.encodeAddress(e.decodeAddress(t),"hex"):t},"chainflip_broker_recipient_error");return new Promise((d)=>{let n=e.api.tx?.swapping?.withdraw?.(r.ticker.toLowerCase(),{[r.chain.toLowerCase()]:a});if(!n)throw new s.SwapKitError("chainflip_broker_withdraw");e.signAndBroadcast({callback:(p)=>{if(!p.status?.isFinalized)return;let l=p.events.find((x)=>x.event.method==="WithdrawalRequested");if(!l)throw new s.SwapKitError("chainflip_channel_error","Could not find 'WithdrawalRequested' event");let{event:{data:{egressId:u,egressAsset:c,egressAmount:m,egressFee:A,destinationAddress:C}}}=l.toHuman();d({destinationAddress:C,egressAmount:m,egressAsset:c,egressFee:A,egressId:u})},tx:n})})},E=(e)=>async({evmToolbox:r,stateChainAccount:t,assetValue:o})=>{let{chainflipGateway:a}=await import("@swapkit/helpers/contracts"),d=s.AssetValue.from({asset:"ETH.FLIP"});if(!o.eqAsset(d))throw new s.SwapKitError("chainflip_broker_fund_only_flip_supported");if(!e.validateAddress(t))throw new s.SwapKitError("chainflip_broker_fund_invalid_address");let n=f.isHex(t)?t:f.u8aToHex(h.decodeAddress(t));return r.call({abi:a,contractAddress:"0x6995ab7c4d7f4b03f467cf4c8e920427d9621dbd",funcName:"fundStateChainAccount",funcParams:[n,o.getBaseValue("string")]})},T=(e)=>({fundStateChainAccount:E(e),registerAsBroker:S(e),withdrawFee:B(e)});var i=require("@swapkit/helpers"),g=require("@swapkit/helpers/api");var _=w({methods:({getWallet:e})=>({swap:async function(t){if(!(t?.route?.buyAsset&&t.route.meta.chainflip))throw new i.SwapKitError("core_swap_invalid_params",{...t});let{route:{buyAsset:o,sellAsset:a,sellAmount:d,destinationAddress:n,meta:{chainflip:p}},maxBoostFeeBps:l=0}=t;if(!(a&&o))throw new i.SwapKitError("core_swap_asset_not_recognized");let u=await i.AssetValue.from({asset:a,asyncTokenLookup:!0,value:d}),c=e(u.chain);if(!c)throw new i.SwapKitError("core_wallet_connection_not_found");let{depositAddress:m}=await g.SwapKitApi.getChainflipDepositChannel({...p,destinationAddress:n||p.destinationAddress,maxBoostFeeBps:l||p.maxBoostFeeBps});return await c.transfer({assetValue:u,isProgramDerivedAddress:!0,recipient:m,sender:c.address})}}),name:"chainflip",properties:{supportedSwapkitProviders:[i.ProviderName.CHAINFLIP,i.ProviderName.CHAINFLIP_STREAMING]}});
1
+ var P={};k(P,{assetIdentifierToChainflipTicker:()=>b,ChainflipPlugin:()=>_,ChainflipBroker:()=>T});module.exports=D(P);var A=require("@polkadot/keyring"),u=require("@polkadot/util"),s=require("@swapkit/helpers"),b=new Map([["ARB.ETH","ArbEth"],["ARB.USDC-0XAF88D065E77C8CC2239327C5EDB3A432268E5831","ArbUsdc"],["BTC.BTC","Btc"],["DOT.DOT","Dot"],["ETH.ETH","Eth"],["ETH.FLIP-0X826180541412D574CF1336D22C0C0A287822678A","Flip"],["ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48","Usdc"],["ETH.USDT-0XDAC17F958D2EE523A2206206994597C13D831EC7","Usdt"],["SOL.SOL","Sol"],["SOL.USDC-EPJFWDD5AUFQSSQEM2QN1XZYBAPC8G4WEGGKZWYTDT1V","SolUsdc"]]),S=(e)=>()=>{let r=e.api.tx.swapping?.registerAsBroker?.();if(!r)throw new s.SwapKitError("chainflip_broker_register");return e.signAndBroadcast({address:e.getAddress(),tx:r})},B=(e)=>({feeAsset:r,recipient:t})=>{let a=r.chain===s.Chain.Polkadot,n=s.wrapWithThrow(()=>{return a?e.encodeAddress(e.decodeAddress(t),"hex"):t},"chainflip_broker_recipient_error");return new Promise((p)=>{let o=e.api.tx?.swapping?.withdraw?.(r.ticker.toLowerCase(),{[r.chain.toLowerCase()]:n});if(!o)throw new s.SwapKitError("chainflip_broker_withdraw");e.signAndBroadcast({callback:(c)=>{if(!c.status?.isFinalized)return;let d=c.events.find((x)=>x.event.method==="WithdrawalRequested");if(!d)throw new s.SwapKitError("chainflip_channel_error","Could not find 'WithdrawalRequested' event");let{event:{data:{egressId:l,egressAsset:f,egressAmount:m,egressFee:g,destinationAddress:C}}}=d.toHuman();p({destinationAddress:C,egressAmount:m,egressAsset:f,egressFee:g,egressId:l})},tx:o})})},E=(e)=>async({evmToolbox:r,stateChainAccount:t,assetValue:a})=>{let{chainflipGateway:n}=await import("@swapkit/helpers/contracts"),p=s.AssetValue.from({asset:"ETH.FLIP"});if(!a.eqAsset(p))throw new s.SwapKitError("chainflip_broker_fund_only_flip_supported");if(!e.validateAddress(t))throw new s.SwapKitError("chainflip_broker_fund_invalid_address");let o=u.isHex(t)?t:u.u8aToHex(A.decodeAddress(t));return r.call({abi:n,contractAddress:"0x6995ab7c4d7f4b03f467cf4c8e920427d9621dbd",funcName:"fundStateChainAccount",funcParams:[o,a.getBaseValue("string")]})},T=(e)=>({fundStateChainAccount:E(e),registerAsBroker:S(e),withdrawFee:B(e)});var i=require("@swapkit/helpers"),w=require("@swapkit/helpers/api");var _=h({methods:({getWallet:e})=>({swap:async function(t){if(!(t?.route?.buyAsset&&t.route.meta.chainflip))throw new i.SwapKitError("core_swap_invalid_params",{...t});let{route:{buyAsset:a,sellAsset:n,sellAmount:p,meta:{chainflip:o}},maxBoostFeeBps:c=0}=t;if(!(n&&a))throw new i.SwapKitError("core_swap_asset_not_recognized");let d=await i.AssetValue.from({asset:n,asyncTokenLookup:!0,value:p}),l=e(d.chain);if(!l)throw new i.SwapKitError("core_wallet_connection_not_found");let{depositAddress:f}=await w.SwapKitApi.getChainflipDepositChannel({...o,maxBoostFeeBps:c||o.maxBoostFeeBps});return await l.transfer({assetValue:d,isProgramDerivedAddress:!0,recipient:f,sender:l.address})}}),name:"chainflip",properties:{supportedSwapkitProviders:[i.ProviderName.CHAINFLIP,i.ProviderName.CHAINFLIP_STREAMING]}});
2
2
 
3
- //# debugId=EB6574E51CBC72D164756E2164756E21
3
+ //# debugId=B573473D11E2796A64756E2164756E21
4
4
  //# sourceMappingURL=index.cjs.map
@@ -3,9 +3,9 @@
3
3
  "sources": ["../src/chainflip/broker.ts", "../src/chainflip/plugin.ts"],
4
4
  "sourcesContent": [
5
5
  "import { decodeAddress } from \"@polkadot/keyring\";\nimport { isHex, u8aToHex } from \"@polkadot/util\";\nimport { AssetValue, Chain, SwapKitError, wrapWithThrow } from \"@swapkit/helpers\";\nimport type { getEvmToolbox } from \"@swapkit/toolboxes/evm\";\nimport type { getSubstrateToolbox } from \"@swapkit/toolboxes/substrate\";\n\nimport type { WithdrawFeeResponse } from \"./types\";\n\ntype ChainflipToolbox = Awaited<ReturnType<typeof getSubstrateToolbox<Chain.Chainflip>>>;\n\nexport const assetIdentifierToChainflipTicker = new Map<string, string>([\n [\"ARB.ETH\", \"ArbEth\"],\n [\"ARB.USDC-0XAF88D065E77C8CC2239327C5EDB3A432268E5831\", \"ArbUsdc\"],\n [\"BTC.BTC\", \"Btc\"],\n [\"DOT.DOT\", \"Dot\"],\n [\"ETH.ETH\", \"Eth\"],\n [\"ETH.FLIP-0X826180541412D574CF1336D22C0C0A287822678A\", \"Flip\"],\n [\"ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48\", \"Usdc\"],\n [\"ETH.USDT-0XDAC17F958D2EE523A2206206994597C13D831EC7\", \"Usdt\"],\n [\"SOL.SOL\", \"Sol\"],\n [\"SOL.USDC-EPJFWDD5AUFQSSQEM2QN1XZYBAPC8G4WEGGKZWYTDT1V\", \"SolUsdc\"],\n]);\n\nconst registerAsBroker = (toolbox: ChainflipToolbox) => () => {\n const extrinsic = toolbox.api.tx.swapping?.registerAsBroker?.();\n\n if (!extrinsic) {\n throw new SwapKitError(\"chainflip_broker_register\");\n }\n\n return toolbox.signAndBroadcast({ address: toolbox.getAddress(), tx: extrinsic });\n};\n\nconst withdrawFee =\n (toolbox: ChainflipToolbox) =>\n ({ feeAsset, recipient }: { feeAsset: AssetValue; recipient: string }) => {\n const isFeeChainPolkadot = feeAsset.chain === Chain.Polkadot;\n\n const recipientAddress = wrapWithThrow(() => {\n return isFeeChainPolkadot ? toolbox.encodeAddress(toolbox.decodeAddress(recipient), \"hex\") : recipient;\n }, \"chainflip_broker_recipient_error\");\n\n return new Promise<WithdrawFeeResponse>((resolve) => {\n const extrinsic = toolbox.api.tx?.swapping?.withdraw?.(feeAsset.ticker.toLowerCase(), {\n [feeAsset.chain.toLowerCase()]: recipientAddress,\n });\n\n if (!extrinsic) {\n throw new SwapKitError(\"chainflip_broker_withdraw\");\n }\n\n toolbox.signAndBroadcast({\n callback: (result) => {\n if (!result.status?.isFinalized) {\n return;\n }\n\n const withdrawEvent = result.events.find((event) => event.event.method === \"WithdrawalRequested\");\n\n if (!withdrawEvent) {\n throw new SwapKitError(\"chainflip_channel_error\", \"Could not find 'WithdrawalRequested' event\");\n }\n const {\n event: {\n data: { egressId, egressAsset, egressAmount, egressFee, destinationAddress },\n },\n } = withdrawEvent.toHuman() as any;\n resolve({ destinationAddress, egressAmount, egressAsset, egressFee, egressId });\n },\n tx: extrinsic,\n });\n });\n };\n\nconst fundStateChainAccount =\n (chainflipToolbox: ChainflipToolbox) =>\n async ({\n evmToolbox,\n stateChainAccount,\n assetValue,\n }: {\n evmToolbox: Awaited<ReturnType<typeof getEvmToolbox>>;\n stateChainAccount: string;\n assetValue: AssetValue;\n }) => {\n const { chainflipGateway } = await import(\"@swapkit/helpers/contracts\");\n\n const flipAssetValue = AssetValue.from({ asset: \"ETH.FLIP\" });\n\n if (!assetValue.eqAsset(flipAssetValue)) {\n throw new SwapKitError(\"chainflip_broker_fund_only_flip_supported\");\n }\n\n if (!chainflipToolbox.validateAddress(stateChainAccount)) {\n throw new SwapKitError(\"chainflip_broker_fund_invalid_address\");\n }\n\n const hexAddress = isHex(stateChainAccount) ? stateChainAccount : u8aToHex(decodeAddress(stateChainAccount));\n\n return evmToolbox.call<string>({\n abi: chainflipGateway,\n contractAddress: \"0x6995ab7c4d7f4b03f467cf4c8e920427d9621dbd\",\n funcName: \"fundStateChainAccount\",\n funcParams: [hexAddress, assetValue.getBaseValue(\"string\")],\n });\n };\n\nexport const ChainflipBroker = (chainflipToolbox: ChainflipToolbox) => ({\n fundStateChainAccount: fundStateChainAccount(chainflipToolbox),\n registerAsBroker: registerAsBroker(chainflipToolbox),\n withdrawFee: withdrawFee(chainflipToolbox),\n});\n",
6
- "import { AssetValue, type Chain, type CryptoChain, ProviderName, SwapKitError } from \"@swapkit/helpers\";\nimport { SwapKitApi } from \"@swapkit/helpers/api\";\nimport { createPlugin } from \"../utils\";\nimport type { RequestSwapDepositAddressParams } from \"./types\";\n\nexport const ChainflipPlugin = createPlugin({\n methods: ({ getWallet }) => ({\n swap: async function chainflipSwap(swapParams: RequestSwapDepositAddressParams) {\n if (!(swapParams?.route?.buyAsset && swapParams.route.meta.chainflip)) {\n throw new SwapKitError(\"core_swap_invalid_params\", { ...swapParams });\n }\n\n const {\n route: {\n buyAsset: buyAssetString,\n sellAsset: sellAssetString,\n sellAmount,\n destinationAddress: recipient,\n meta: { chainflip },\n },\n maxBoostFeeBps = 0,\n } = swapParams;\n\n if (!(sellAssetString && buyAssetString)) {\n throw new SwapKitError(\"core_swap_asset_not_recognized\");\n }\n\n const sellAsset = await AssetValue.from({ asset: sellAssetString, asyncTokenLookup: true, value: sellAmount });\n\n const wallet = getWallet(sellAsset.chain as Exclude<CryptoChain, Chain.Radix>);\n\n if (!wallet) {\n throw new SwapKitError(\"core_wallet_connection_not_found\");\n }\n\n const { depositAddress } = await SwapKitApi.getChainflipDepositChannel({\n ...chainflip,\n destinationAddress: recipient || chainflip.destinationAddress,\n maxBoostFeeBps: maxBoostFeeBps || chainflip.maxBoostFeeBps,\n });\n\n const tx = await wallet.transfer({\n assetValue: sellAsset,\n isProgramDerivedAddress: true,\n recipient: depositAddress,\n sender: wallet.address,\n });\n\n return tx;\n },\n }),\n name: \"chainflip\",\n properties: { supportedSwapkitProviders: [ProviderName.CHAINFLIP, ProviderName.CHAINFLIP_STREAMING] },\n});\n"
6
+ "import { AssetValue, type Chain, type CryptoChain, ProviderName, SwapKitError } from \"@swapkit/helpers\";\nimport { SwapKitApi } from \"@swapkit/helpers/api\";\nimport { createPlugin } from \"../utils\";\nimport type { RequestSwapDepositAddressParams } from \"./types\";\n\nexport const ChainflipPlugin = createPlugin({\n methods: ({ getWallet }) => ({\n swap: async function chainflipSwap(swapParams: RequestSwapDepositAddressParams) {\n if (!(swapParams?.route?.buyAsset && swapParams.route.meta.chainflip)) {\n throw new SwapKitError(\"core_swap_invalid_params\", { ...swapParams });\n }\n\n const {\n route: {\n buyAsset: buyAssetString,\n sellAsset: sellAssetString,\n sellAmount,\n meta: { chainflip },\n },\n maxBoostFeeBps = 0,\n } = swapParams;\n\n if (!(sellAssetString && buyAssetString)) {\n throw new SwapKitError(\"core_swap_asset_not_recognized\");\n }\n\n const sellAsset = await AssetValue.from({ asset: sellAssetString, asyncTokenLookup: true, value: sellAmount });\n\n const wallet = getWallet(sellAsset.chain as Exclude<CryptoChain, Chain.Radix>);\n\n if (!wallet) {\n throw new SwapKitError(\"core_wallet_connection_not_found\");\n }\n\n const { depositAddress } = await SwapKitApi.getChainflipDepositChannel({\n ...chainflip,\n maxBoostFeeBps: maxBoostFeeBps || chainflip.maxBoostFeeBps,\n });\n\n const tx = await wallet.transfer({\n assetValue: sellAsset,\n isProgramDerivedAddress: true,\n recipient: depositAddress,\n sender: wallet.address,\n });\n\n return tx;\n },\n }),\n name: \"chainflip\",\n properties: { supportedSwapkitProviders: [ProviderName.CHAINFLIP, ProviderName.CHAINFLIP_STREAMING] },\n});\n"
7
7
  ],
8
- "mappings": "uHAA8B,IAA9B,+BACA,4BACA,8BAQa,EAAmC,IAAI,IAAoB,CACtE,CAAC,UAAW,QAAQ,EACpB,CAAC,sDAAuD,SAAS,EACjE,CAAC,UAAW,KAAK,EACjB,CAAC,UAAW,KAAK,EACjB,CAAC,UAAW,KAAK,EACjB,CAAC,sDAAuD,MAAM,EAC9D,CAAC,sDAAuD,MAAM,EAC9D,CAAC,sDAAuD,MAAM,EAC9D,CAAC,UAAW,KAAK,EACjB,CAAC,wDAAyD,SAAS,CACrE,CAAC,EAEK,EAAmB,CAAC,IAA8B,IAAM,CAC5D,IAAM,EAAY,EAAQ,IAAI,GAAG,UAAU,mBAAmB,EAE9D,GAAI,CAAC,EACH,MAAM,IAAI,eAAa,2BAA2B,EAGpD,OAAO,EAAQ,iBAAiB,CAAE,QAAS,EAAQ,WAAW,EAAG,GAAI,CAAU,CAAC,GAG5E,EACJ,CAAC,IACD,EAAG,WAAU,eAA6D,CACxE,IAAM,EAAqB,EAAS,QAAU,QAAM,SAE9C,EAAmB,gBAAc,IAAM,CAC3C,OAAO,EAAqB,EAAQ,cAAc,EAAQ,cAAc,CAAS,E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B,EAAI,EAAoB,WAAS,gBAAc,CAAiB,CAAC,EAE3G,OAAO,EAAW,KAAa,CAC7B,IAAK,EACL,gBAAiB,6CACjB,SAAU,wBACV,WAAY,CAAC,EAAY,EAAW,aAAa,QAAQ,CAAC,CAC5D,CAAC,GAGQ,EAAkB,CAAC,KAAwC,CACtE,sBAAuB,EAAsB,CAAgB,EAC7D,iBAAkB,EAAiB,CAAgB,EACnD,YAAa,EAAY,CAAgB,CAC3C,GC/GqF,IAArF,8BACA,kCAIO,IAAM,EAAkB,EAAa,CAC1C,QAAS,EAAG,gBAAiB,CAC3B,KAAM,cAA4B,CAAC,EAA6C,CAC9E,GAAI,EAAE,GAAY,OAAO,UAAY,EAAW,MAAM,KAAK,WACzD,MAAM,IAAI,eAAa,2BAA4B,IAAK,CAAW,CAAC,EAGtE,IACE,OACE,SAAU,EACV,UAAW,EACX,aACA,MAAQ,cAEV,iBAAiB,GACf,EAEJ,GAAI,EAAE,GAAmB,GACvB,MAAM,IAAI,eAAa,gCAAgC,EAGzD,IAAM,EAAY,MAAM,aAAW,KAAK,CAAE,MAAO,EAAiB,iBAAkB,GAAM,MAAO,CAAW,CAAC,EAEvG,EAAS,EAAU,EAAU,KAA0C,EAE7E,GAAI,CAAC,EACH,MAAM,IAAI,eAAa,kCAAkC,EAG3D,IAAQ,kBAAmB,MAAM,aAAW,2BAA2B,IAClE,EACH,eAAgB,GAAkB,EAAU,cAC9C,CAAC,EASD,OAPW,MAAM,EAAO,SAAS,CAC/B,WAAY,EACZ,wBAAyB,GACzB,UAAW,EACX,OAAQ,EAAO,OACjB,CAAC,EAIL,GACA,KAAM,YACN,WAAY,CAAE,0BAA2B,CAAC,eAAa,UAAW,eAAa,mBAAmB,CAAE,CACtG,CAAC",
9
+ "debugId": "B573473D11E2796A64756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1,4 +1,4 @@
1
- import{a as C,b as x,c as h}from"../chunk-a0djqfqa.js";import{decodeAddress as y}from"@polkadot/keyring";import{isHex as b,u8aToHex as S}from"@polkadot/util";import{AssetValue as B,Chain as E,SwapKitError as d,wrapWithThrow as T}from"@swapkit/helpers";var I=new Map([["ARB.ETH","ArbEth"],["ARB.USDC-0XAF88D065E77C8CC2239327C5EDB3A432268E5831","ArbUsdc"],["BTC.BTC","Btc"],["DOT.DOT","Dot"],["ETH.ETH","Eth"],["ETH.FLIP-0X826180541412D574CF1336D22C0C0A287822678A","Flip"],["ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48","Usdc"],["ETH.USDT-0XDAC17F958D2EE523A2206206994597C13D831EC7","Usdt"],["SOL.SOL","Sol"],["SOL.USDC-EPJFWDD5AUFQSSQEM2QN1XZYBAPC8G4WEGGKZWYTDT1V","SolUsdc"]]),_=(e)=>()=>{let s=e.api.tx.swapping?.registerAsBroker?.();if(!s)throw new d("chainflip_broker_register");return e.signAndBroadcast({address:e.getAddress(),tx:s})},D=(e)=>({feeAsset:s,recipient:t})=>{let r=s.chain===E.Polkadot,i=T(()=>{return r?e.encodeAddress(e.decodeAddress(t),"hex"):t},"chainflip_broker_recipient_error");return new Promise((n)=>{let o=e.api.tx?.swapping?.withdraw?.(s.ticker.toLowerCase(),{[s.chain.toLowerCase()]:i});if(!o)throw new d("chainflip_broker_withdraw");e.signAndBroadcast({callback:(a)=>{if(!a.status?.isFinalized)return;let c=a.events.find((g)=>g.event.method==="WithdrawalRequested");if(!c)throw new d("chainflip_channel_error","Could not find 'WithdrawalRequested' event");let{event:{data:{egressId:l,egressAsset:p,egressAmount:u,egressFee:m,destinationAddress:w}}}=c.toHuman();n({destinationAddress:w,egressAmount:u,egressAsset:p,egressFee:m,egressId:l})},tx:o})})},k=(e)=>async({evmToolbox:s,stateChainAccount:t,assetValue:r})=>{let{chainflipGateway:i}=await import("@swapkit/helpers/contracts"),n=B.from({asset:"ETH.FLIP"});if(!r.eqAsset(n))throw new d("chainflip_broker_fund_only_flip_supported");if(!e.validateAddress(t))throw new d("chainflip_broker_fund_invalid_address");let o=b(t)?t:S(y(t));return s.call({abi:i,contractAddress:"0x6995ab7c4d7f4b03f467cf4c8e920427d9621dbd",funcName:"fundStateChainAccount",funcParams:[o,r.getBaseValue("string")]})},V=(e)=>({fundStateChainAccount:k(e),registerAsBroker:_(e),withdrawFee:D(e)});import{AssetValue as P,ProviderName as A,SwapKitError as f}from"@swapkit/helpers";import{SwapKitApi as F}from"@swapkit/helpers/api";var M=h({methods:({getWallet:e})=>({swap:async function(t){if(!(t?.route?.buyAsset&&t.route.meta.chainflip))throw new f("core_swap_invalid_params",{...t});let{route:{buyAsset:r,sellAsset:i,sellAmount:n,destinationAddress:o,meta:{chainflip:a}},maxBoostFeeBps:c=0}=t;if(!(i&&r))throw new f("core_swap_asset_not_recognized");let l=await P.from({asset:i,asyncTokenLookup:!0,value:n}),p=e(l.chain);if(!p)throw new f("core_wallet_connection_not_found");let{depositAddress:u}=await F.getChainflipDepositChannel({...a,destinationAddress:o||a.destinationAddress,maxBoostFeeBps:c||a.maxBoostFeeBps});return await p.transfer({assetValue:l,isProgramDerivedAddress:!0,recipient:u,sender:p.address})}}),name:"chainflip",properties:{supportedSwapkitProviders:[A.CHAINFLIP,A.CHAINFLIP_STREAMING]}});export{I as assetIdentifierToChainflipTicker,M as ChainflipPlugin,V as ChainflipBroker};
1
+ import{a as C,b as x,c as A}from"../chunk-a0djqfqa.js";import{decodeAddress as y}from"@polkadot/keyring";import{isHex as b,u8aToHex as S}from"@polkadot/util";import{AssetValue as B,Chain as E,SwapKitError as d,wrapWithThrow as T}from"@swapkit/helpers";var I=new Map([["ARB.ETH","ArbEth"],["ARB.USDC-0XAF88D065E77C8CC2239327C5EDB3A432268E5831","ArbUsdc"],["BTC.BTC","Btc"],["DOT.DOT","Dot"],["ETH.ETH","Eth"],["ETH.FLIP-0X826180541412D574CF1336D22C0C0A287822678A","Flip"],["ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48","Usdc"],["ETH.USDT-0XDAC17F958D2EE523A2206206994597C13D831EC7","Usdt"],["SOL.SOL","Sol"],["SOL.USDC-EPJFWDD5AUFQSSQEM2QN1XZYBAPC8G4WEGGKZWYTDT1V","SolUsdc"]]),_=(e)=>()=>{let s=e.api.tx.swapping?.registerAsBroker?.();if(!s)throw new d("chainflip_broker_register");return e.signAndBroadcast({address:e.getAddress(),tx:s})},D=(e)=>({feeAsset:s,recipient:t})=>{let i=s.chain===E.Polkadot,o=T(()=>{return i?e.encodeAddress(e.decodeAddress(t),"hex"):t},"chainflip_broker_recipient_error");return new Promise((a)=>{let r=e.api.tx?.swapping?.withdraw?.(s.ticker.toLowerCase(),{[s.chain.toLowerCase()]:o});if(!r)throw new d("chainflip_broker_withdraw");e.signAndBroadcast({callback:(l)=>{if(!l.status?.isFinalized)return;let n=l.events.find((g)=>g.event.method==="WithdrawalRequested");if(!n)throw new d("chainflip_channel_error","Could not find 'WithdrawalRequested' event");let{event:{data:{egressId:p,egressAsset:c,egressAmount:f,egressFee:h,destinationAddress:w}}}=n.toHuman();a({destinationAddress:w,egressAmount:f,egressAsset:c,egressFee:h,egressId:p})},tx:r})})},k=(e)=>async({evmToolbox:s,stateChainAccount:t,assetValue:i})=>{let{chainflipGateway:o}=await import("@swapkit/helpers/contracts"),a=B.from({asset:"ETH.FLIP"});if(!i.eqAsset(a))throw new d("chainflip_broker_fund_only_flip_supported");if(!e.validateAddress(t))throw new d("chainflip_broker_fund_invalid_address");let r=b(t)?t:S(y(t));return s.call({abi:o,contractAddress:"0x6995ab7c4d7f4b03f467cf4c8e920427d9621dbd",funcName:"fundStateChainAccount",funcParams:[r,i.getBaseValue("string")]})},V=(e)=>({fundStateChainAccount:k(e),registerAsBroker:_(e),withdrawFee:D(e)});import{AssetValue as P,ProviderName as m,SwapKitError as u}from"@swapkit/helpers";import{SwapKitApi as F}from"@swapkit/helpers/api";var M=A({methods:({getWallet:e})=>({swap:async function(t){if(!(t?.route?.buyAsset&&t.route.meta.chainflip))throw new u("core_swap_invalid_params",{...t});let{route:{buyAsset:i,sellAsset:o,sellAmount:a,meta:{chainflip:r}},maxBoostFeeBps:l=0}=t;if(!(o&&i))throw new u("core_swap_asset_not_recognized");let n=await P.from({asset:o,asyncTokenLookup:!0,value:a}),p=e(n.chain);if(!p)throw new u("core_wallet_connection_not_found");let{depositAddress:c}=await F.getChainflipDepositChannel({...r,maxBoostFeeBps:l||r.maxBoostFeeBps});return await p.transfer({assetValue:n,isProgramDerivedAddress:!0,recipient:c,sender:p.address})}}),name:"chainflip",properties:{supportedSwapkitProviders:[m.CHAINFLIP,m.CHAINFLIP_STREAMING]}});export{I as assetIdentifierToChainflipTicker,M as ChainflipPlugin,V as ChainflipBroker};
2
2
 
3
- //# debugId=EFACD6504FC976D164756E2164756E21
3
+ //# debugId=F1F0394D3A6FD8F564756E2164756E21
4
4
  //# sourceMappingURL=index.js.map
@@ -3,9 +3,9 @@
3
3
  "sources": ["../src/chainflip/broker.ts", "../src/chainflip/plugin.ts"],
4
4
  "sourcesContent": [
5
5
  "import { decodeAddress } from \"@polkadot/keyring\";\nimport { isHex, u8aToHex } from \"@polkadot/util\";\nimport { AssetValue, Chain, SwapKitError, wrapWithThrow } from \"@swapkit/helpers\";\nimport type { getEvmToolbox } from \"@swapkit/toolboxes/evm\";\nimport type { getSubstrateToolbox } from \"@swapkit/toolboxes/substrate\";\n\nimport type { WithdrawFeeResponse } from \"./types\";\n\ntype ChainflipToolbox = Awaited<ReturnType<typeof getSubstrateToolbox<Chain.Chainflip>>>;\n\nexport const assetIdentifierToChainflipTicker = new Map<string, string>([\n [\"ARB.ETH\", \"ArbEth\"],\n [\"ARB.USDC-0XAF88D065E77C8CC2239327C5EDB3A432268E5831\", \"ArbUsdc\"],\n [\"BTC.BTC\", \"Btc\"],\n [\"DOT.DOT\", \"Dot\"],\n [\"ETH.ETH\", \"Eth\"],\n [\"ETH.FLIP-0X826180541412D574CF1336D22C0C0A287822678A\", \"Flip\"],\n [\"ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48\", \"Usdc\"],\n [\"ETH.USDT-0XDAC17F958D2EE523A2206206994597C13D831EC7\", \"Usdt\"],\n [\"SOL.SOL\", \"Sol\"],\n [\"SOL.USDC-EPJFWDD5AUFQSSQEM2QN1XZYBAPC8G4WEGGKZWYTDT1V\", \"SolUsdc\"],\n]);\n\nconst registerAsBroker = (toolbox: ChainflipToolbox) => () => {\n const extrinsic = toolbox.api.tx.swapping?.registerAsBroker?.();\n\n if (!extrinsic) {\n throw new SwapKitError(\"chainflip_broker_register\");\n }\n\n return toolbox.signAndBroadcast({ address: toolbox.getAddress(), tx: extrinsic });\n};\n\nconst withdrawFee =\n (toolbox: ChainflipToolbox) =>\n ({ feeAsset, recipient }: { feeAsset: AssetValue; recipient: string }) => {\n const isFeeChainPolkadot = feeAsset.chain === Chain.Polkadot;\n\n const recipientAddress = wrapWithThrow(() => {\n return isFeeChainPolkadot ? toolbox.encodeAddress(toolbox.decodeAddress(recipient), \"hex\") : recipient;\n }, \"chainflip_broker_recipient_error\");\n\n return new Promise<WithdrawFeeResponse>((resolve) => {\n const extrinsic = toolbox.api.tx?.swapping?.withdraw?.(feeAsset.ticker.toLowerCase(), {\n [feeAsset.chain.toLowerCase()]: recipientAddress,\n });\n\n if (!extrinsic) {\n throw new SwapKitError(\"chainflip_broker_withdraw\");\n }\n\n toolbox.signAndBroadcast({\n callback: (result) => {\n if (!result.status?.isFinalized) {\n return;\n }\n\n const withdrawEvent = result.events.find((event) => event.event.method === \"WithdrawalRequested\");\n\n if (!withdrawEvent) {\n throw new SwapKitError(\"chainflip_channel_error\", \"Could not find 'WithdrawalRequested' event\");\n }\n const {\n event: {\n data: { egressId, egressAsset, egressAmount, egressFee, destinationAddress },\n },\n } = withdrawEvent.toHuman() as any;\n resolve({ destinationAddress, egressAmount, egressAsset, egressFee, egressId });\n },\n tx: extrinsic,\n });\n });\n };\n\nconst fundStateChainAccount =\n (chainflipToolbox: ChainflipToolbox) =>\n async ({\n evmToolbox,\n stateChainAccount,\n assetValue,\n }: {\n evmToolbox: Awaited<ReturnType<typeof getEvmToolbox>>;\n stateChainAccount: string;\n assetValue: AssetValue;\n }) => {\n const { chainflipGateway } = await import(\"@swapkit/helpers/contracts\");\n\n const flipAssetValue = AssetValue.from({ asset: \"ETH.FLIP\" });\n\n if (!assetValue.eqAsset(flipAssetValue)) {\n throw new SwapKitError(\"chainflip_broker_fund_only_flip_supported\");\n }\n\n if (!chainflipToolbox.validateAddress(stateChainAccount)) {\n throw new SwapKitError(\"chainflip_broker_fund_invalid_address\");\n }\n\n const hexAddress = isHex(stateChainAccount) ? stateChainAccount : u8aToHex(decodeAddress(stateChainAccount));\n\n return evmToolbox.call<string>({\n abi: chainflipGateway,\n contractAddress: \"0x6995ab7c4d7f4b03f467cf4c8e920427d9621dbd\",\n funcName: \"fundStateChainAccount\",\n funcParams: [hexAddress, assetValue.getBaseValue(\"string\")],\n });\n };\n\nexport const ChainflipBroker = (chainflipToolbox: ChainflipToolbox) => ({\n fundStateChainAccount: fundStateChainAccount(chainflipToolbox),\n registerAsBroker: registerAsBroker(chainflipToolbox),\n withdrawFee: withdrawFee(chainflipToolbox),\n});\n",
6
- "import { AssetValue, type Chain, type CryptoChain, ProviderName, SwapKitError } from \"@swapkit/helpers\";\nimport { SwapKitApi } from \"@swapkit/helpers/api\";\nimport { createPlugin } from \"../utils\";\nimport type { RequestSwapDepositAddressParams } from \"./types\";\n\nexport const ChainflipPlugin = createPlugin({\n methods: ({ getWallet }) => ({\n swap: async function chainflipSwap(swapParams: RequestSwapDepositAddressParams) {\n if (!(swapParams?.route?.buyAsset && swapParams.route.meta.chainflip)) {\n throw new SwapKitError(\"core_swap_invalid_params\", { ...swapParams });\n }\n\n const {\n route: {\n buyAsset: buyAssetString,\n sellAsset: sellAssetString,\n sellAmount,\n destinationAddress: recipient,\n meta: { chainflip },\n },\n maxBoostFeeBps = 0,\n } = swapParams;\n\n if (!(sellAssetString && buyAssetString)) {\n throw new SwapKitError(\"core_swap_asset_not_recognized\");\n }\n\n const sellAsset = await AssetValue.from({ asset: sellAssetString, asyncTokenLookup: true, value: sellAmount });\n\n const wallet = getWallet(sellAsset.chain as Exclude<CryptoChain, Chain.Radix>);\n\n if (!wallet) {\n throw new SwapKitError(\"core_wallet_connection_not_found\");\n }\n\n const { depositAddress } = await SwapKitApi.getChainflipDepositChannel({\n ...chainflip,\n destinationAddress: recipient || chainflip.destinationAddress,\n maxBoostFeeBps: maxBoostFeeBps || chainflip.maxBoostFeeBps,\n });\n\n const tx = await wallet.transfer({\n assetValue: sellAsset,\n isProgramDerivedAddress: true,\n recipient: depositAddress,\n sender: wallet.address,\n });\n\n return tx;\n },\n }),\n name: \"chainflip\",\n properties: { supportedSwapkitProviders: [ProviderName.CHAINFLIP, ProviderName.CHAINFLIP_STREAMING] },\n});\n"
6
+ "import { AssetValue, type Chain, type CryptoChain, ProviderName, SwapKitError } from \"@swapkit/helpers\";\nimport { SwapKitApi } from \"@swapkit/helpers/api\";\nimport { createPlugin } from \"../utils\";\nimport type { RequestSwapDepositAddressParams } from \"./types\";\n\nexport const ChainflipPlugin = createPlugin({\n methods: ({ getWallet }) => ({\n swap: async function chainflipSwap(swapParams: RequestSwapDepositAddressParams) {\n if (!(swapParams?.route?.buyAsset && swapParams.route.meta.chainflip)) {\n throw new SwapKitError(\"core_swap_invalid_params\", { ...swapParams });\n }\n\n const {\n route: {\n buyAsset: buyAssetString,\n sellAsset: sellAssetString,\n sellAmount,\n meta: { chainflip },\n },\n maxBoostFeeBps = 0,\n } = swapParams;\n\n if (!(sellAssetString && buyAssetString)) {\n throw new SwapKitError(\"core_swap_asset_not_recognized\");\n }\n\n const sellAsset = await AssetValue.from({ asset: sellAssetString, asyncTokenLookup: true, value: sellAmount });\n\n const wallet = getWallet(sellAsset.chain as Exclude<CryptoChain, Chain.Radix>);\n\n if (!wallet) {\n throw new SwapKitError(\"core_wallet_connection_not_found\");\n }\n\n const { depositAddress } = await SwapKitApi.getChainflipDepositChannel({\n ...chainflip,\n maxBoostFeeBps: maxBoostFeeBps || chainflip.maxBoostFeeBps,\n });\n\n const tx = await wallet.transfer({\n assetValue: sellAsset,\n isProgramDerivedAddress: true,\n recipient: depositAddress,\n sender: wallet.address,\n });\n\n return tx;\n },\n }),\n name: \"chainflip\",\n properties: { supportedSwapkitProviders: [ProviderName.CHAINFLIP, ProviderName.CHAINFLIP_STREAMING] },\n});\n"
7
7
  ],
8
- "mappings": "uDAAA,wBAAS,0BACT,gBAAS,cAAO,uBAChB,qBAAS,WAAY,kBAAO,mBAAc,yBAQnC,IAAM,EAAmC,IAAI,IAAoB,CACtE,CAAC,UAAW,QAAQ,EACpB,CAAC,sDAAuD,SAAS,EACjE,CAAC,UAAW,KAAK,EACjB,CAAC,UAAW,KAAK,EACjB,CAAC,UAAW,KAAK,EACjB,CAAC,sDAAuD,MAAM,EAC9D,CAAC,sDAAuD,MAAM,EAC9D,CAAC,sDAAuD,MAAM,EAC9D,CAAC,UAAW,KAAK,EACjB,CAAC,wDAAyD,SAAS,CACrE,CAAC,EAEK,EAAmB,CAAC,IAA8B,IAAM,CAC5D,IAAM,EAAY,EAAQ,IAAI,GAAG,UAAU,mBAAmB,EAE9D,GAAI,CAAC,EACH,MAAM,IAAI,EAAa,2BAA2B,EAGpD,OAAO,EAAQ,iBAAiB,CAAE,QAAS,EAAQ,WAAW,EAAG,GAAI,CAAU,CAAC,GAG5E,EACJ,CAAC,IACD,EAAG,WAAU,eAA6D,CACxE,IAAM,EAAqB,EAAS,QAAU,EAAM,SAE9C,EAAmB,EAAc,IAAM,CAC3C,OAAO,EAAqB,EAAQ,cAAc,EAAQ,cAAc,CAAS,EAAG,KAAK,EAAI,GAC5F,kCAAkC,EAErC,OAAO,IAAI,QAA6B,CAAC,IAAY,CACnD,IAAM,EAAY,EAAQ,IAAI,IAAI,UAAU,WAAW,EAAS,OAAO,YAAY,EAAG,EACnF,EAAS,MAAM,YAAY,GAAI,CAClC,CAAC,EAED,GAAI,CAAC,EACH,MAAM,IAA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,CAAC,CAC5D,CAAC,GAGQ,EAAkB,CAAC,KAAwC,CACtE,sBAAuB,EAAsB,CAAgB,EAC7D,iBAAkB,EAAiB,CAAgB,EACnD,YAAa,EAAY,CAAgB,CAC3C,GC/GA,qBAAS,kBAA0C,kBAAc,yBACjE,qBAAS,6BAIF,IAAM,EAAkB,EAAa,CAC1C,QAAS,EAAG,gBAAiB,CAC3B,KAAM,cAA4B,CAAC,EAA6C,CAC9E,GAAI,EAAE,GAAY,OAAO,UAAY,EAAW,MAAM,KAAK,WACzD,MAAM,IAAI,EAAa,2BAA4B,IAAK,CAAW,CAAC,EAGtE,IACE,OACE,SAAU,EACV,UAAW,EACX,aACA,MAAQ,cAEV,iBAAiB,GACf,EAEJ,GAAI,EAAE,GAAmB,GACvB,MAAM,IAAI,EAAa,gCAAgC,EAGzD,IAAM,EAAY,MAAM,EAAW,KAAK,CAAE,MAAO,EAAiB,iBAAkB,GAAM,MAAO,CAAW,CAAC,EAEvG,EAAS,EAAU,EAAU,KAA0C,EAE7E,GAAI,CAAC,EACH,MAAM,IAAI,EAAa,kCAAkC,EAG3D,IAAQ,kBAAmB,MAAM,EAAW,2BAA2B,IAClE,EACH,eAAgB,GAAkB,EAAU,cAC9C,CAAC,EASD,OAPW,MAAM,EAAO,SAAS,CAC/B,WAAY,EACZ,wBAAyB,GACzB,UAAW,EACX,OAAQ,EAAO,OACjB,CAAC,EAIL,GACA,KAAM,YACN,WAAY,CAAE,0BAA2B,CAAC,EAAa,UAAW,EAAa,mBAAmB,CAAE,CACtG,CAAC",
9
+ "debugId": "F1F0394D3A6FD8F564756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/chainflip/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,YAAY,EAAgB,MAAM,kBAAkB,CAAC;AAGxG,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,eAAO,MAAM,eAAe;;;;2BAEuB,+BAA+B;;CA8ChF,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/chainflip/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,YAAY,EAAgB,MAAM,kBAAkB,CAAC;AAGxG,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,eAAO,MAAM,eAAe;;;;2BAEuB,+BAA+B;;CA4ChF,CAAC"}
package/package.json CHANGED
@@ -61,5 +61,5 @@
61
61
  "type-check:go": "tsgo"
62
62
  },
63
63
  "type": "module",
64
- "version": "4.0.19"
64
+ "version": "4.0.20"
65
65
  }