@swapkit/plugins 4.0.30 → 4.1.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.
@@ -0,0 +1,4 @@
1
+ var m={};l(m,{GardenPlugin:()=>r});module.exports=d(m);var e=require("@swapkit/helpers");var r=s({methods:({getWallet:n})=>({swap:async function({route:o}){let{meta:a,sellAsset:i,sellAmount:p}=o;if(!a.garden?.destinationAddress)throw new e.SwapKitError("plugin_garden_missing_meta_data",{meta:a});let t=e.AssetValue.from({asset:i,value:p});return await n(t.chain).transfer({assetValue:t,recipient:a.garden?.destinationAddress})}}),name:"garden",properties:{supportedSwapkitProviders:[e.ProviderName.GARDEN]}});
2
+
3
+ //# debugId=89F817725216A8AB64756E2164756E21
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/garden/plugin.ts"],
4
+ "sourcesContent": [
5
+ "import { AssetValue, type Chain, ProviderName, SwapKitError, type SwapParams } from \"@swapkit/helpers\";\nimport type { QuoteResponseRoute } from \"@swapkit/helpers/api\";\nimport { createPlugin } from \"../utils\";\n\nexport const GardenPlugin = createPlugin({\n methods: ({ getWallet }) => ({\n swap: async function gardenSwap({ route }: SwapParams<\"garden\", QuoteResponseRoute>) {\n const { meta, sellAsset, sellAmount } = route;\n\n if (!meta.garden?.destinationAddress) {\n throw new SwapKitError(\"plugin_garden_missing_meta_data\", { meta });\n }\n const sellAssetValue = AssetValue.from({ asset: sellAsset, value: sellAmount });\n\n const wallet = getWallet(sellAssetValue.chain as Exclude<Chain, Chain.Radix>);\n\n const txHash = await wallet.transfer({ assetValue: sellAssetValue, recipient: meta.garden?.destinationAddress });\n\n return txHash;\n },\n }),\n name: \"garden\",\n properties: { supportedSwapkitProviders: [ProviderName.GARDEN] },\n});\n"
6
+ ],
7
+ "mappings": "uDAAoF,IAApF,8BAIO,IAAM,EAAe,EAAa,CACvC,QAAS,EAAG,gBAAiB,CAC3B,KAAM,cAAyB,EAAG,SAAmD,CACnF,IAAQ,OAAM,YAAW,cAAe,EAExC,GAAI,CAAC,EAAK,QAAQ,mBAChB,MAAM,IAAI,eAAa,kCAAmC,CAAE,MAAK,CAAC,EAEpE,IAAM,EAAiB,aAAW,KAAK,CAAE,MAAO,EAAW,MAAO,CAAW,CAAC,EAM9E,OAFe,MAFA,EAAU,EAAe,KAAoC,EAEhD,SAAS,CAAE,WAAY,EAAgB,UAAW,EAAK,QAAQ,kBAAmB,CAAC,EAInH,GACA,KAAM,SACN,WAAY,CAAE,0BAA2B,CAAC,eAAa,MAAM,CAAE,CACjE,CAAC",
8
+ "debugId": "89F817725216A8AB64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import{c as t}from"../chunk-pqpwxyjh.js";import{AssetValue as i,ProviderName as p,SwapKitError as d}from"@swapkit/helpers";var l=t({methods:({getWallet:s})=>({swap:async function({route:r}){let{meta:e,sellAsset:n,sellAmount:o}=r;if(!e.garden?.destinationAddress)throw new d("plugin_garden_missing_meta_data",{meta:e});let a=i.from({asset:n,value:o});return await s(a.chain).transfer({assetValue:a,recipient:e.garden?.destinationAddress})}}),name:"garden",properties:{supportedSwapkitProviders:[p.GARDEN]}});export{l as GardenPlugin};
2
+
3
+ //# debugId=DD024CF9F09652EA64756E2164756E21
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/garden/plugin.ts"],
4
+ "sourcesContent": [
5
+ "import { AssetValue, type Chain, ProviderName, SwapKitError, type SwapParams } from \"@swapkit/helpers\";\nimport type { QuoteResponseRoute } from \"@swapkit/helpers/api\";\nimport { createPlugin } from \"../utils\";\n\nexport const GardenPlugin = createPlugin({\n methods: ({ getWallet }) => ({\n swap: async function gardenSwap({ route }: SwapParams<\"garden\", QuoteResponseRoute>) {\n const { meta, sellAsset, sellAmount } = route;\n\n if (!meta.garden?.destinationAddress) {\n throw new SwapKitError(\"plugin_garden_missing_meta_data\", { meta });\n }\n const sellAssetValue = AssetValue.from({ asset: sellAsset, value: sellAmount });\n\n const wallet = getWallet(sellAssetValue.chain as Exclude<Chain, Chain.Radix>);\n\n const txHash = await wallet.transfer({ assetValue: sellAssetValue, recipient: meta.garden?.destinationAddress });\n\n return txHash;\n },\n }),\n name: \"garden\",\n properties: { supportedSwapkitProviders: [ProviderName.GARDEN] },\n});\n"
6
+ ],
7
+ "mappings": "yCAAA,qBAAS,kBAAwB,kBAAc,yBAIxC,IAAM,EAAe,EAAa,CACvC,QAAS,EAAG,gBAAiB,CAC3B,KAAM,cAAyB,EAAG,SAAmD,CACnF,IAAQ,OAAM,YAAW,cAAe,EAExC,GAAI,CAAC,EAAK,QAAQ,mBAChB,MAAM,IAAI,EAAa,kCAAmC,CAAE,MAAK,CAAC,EAEpE,IAAM,EAAiB,EAAW,KAAK,CAAE,MAAO,EAAW,MAAO,CAAW,CAAC,EAM9E,OAFe,MAFA,EAAU,EAAe,KAAoC,EAEhD,SAAS,CAAE,WAAY,EAAgB,UAAW,EAAK,QAAQ,kBAAmB,CAAC,EAInH,GACA,KAAM,SACN,WAAY,CAAE,0BAA2B,CAAC,EAAa,MAAM,CAAE,CACjE,CAAC",
8
+ "debugId": "DD024CF9F09652EA64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,2 @@
1
+ export { GardenPlugin } from "./plugin";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/garden/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { ProviderName, type SwapParams } from "@swapkit/helpers";
2
+ import type { QuoteResponseRoute } from "@swapkit/helpers/api";
3
+ export declare const GardenPlugin: {
4
+ garden: (pluginParams: import("..").SwapKitPluginParams) => {
5
+ supportedSwapkitProviders: ProviderName[];
6
+ } & {
7
+ swap: ({ route }: SwapParams<"garden", QuoteResponseRoute>) => Promise<string>;
8
+ };
9
+ };
10
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/garden/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,YAAY,EAAgB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACvG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,eAAO,MAAM,YAAY;;;;0BAEsB,UAAU,CAAC,QAAQ,EAAE,kBAAkB,CAAC;;CAiBrF,CAAC"}
package/package.json CHANGED
@@ -4,8 +4,8 @@
4
4
  "@polkadot/keyring": "~13.5.0",
5
5
  "@polkadot/util": "~13.5.0",
6
6
  "@solana/web3.js": "~1.98.0",
7
- "@swapkit/helpers": "4.1.0",
8
- "@swapkit/toolboxes": "4.1.0",
7
+ "@swapkit/helpers": "4.2.0",
8
+ "@swapkit/toolboxes": "4.1.1",
9
9
  "ts-pattern": "~5.8.0"
10
10
  },
11
11
  "description": "SwapKit Plugin - Chainflip",
@@ -27,6 +27,11 @@
27
27
  "require": "./dist/evm/index.cjs",
28
28
  "types": "./dist/types/evm/index.d.ts"
29
29
  },
30
+ "./garden": {
31
+ "default": "./dist/garden/index.js",
32
+ "require": "./dist/garden/index.cjs",
33
+ "types": "./dist/types/garden/index.d.ts"
34
+ },
30
35
  "./near": {
31
36
  "default": "./dist/near/index.js",
32
37
  "require": "./dist/near/index.cjs",
@@ -61,5 +66,5 @@
61
66
  "type-check:go": "tsgo"
62
67
  },
63
68
  "type": "module",
64
- "version": "4.0.30"
69
+ "version": "4.1.0"
65
70
  }