@liberfi.io/types 0.3.13 → 0.4.1

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,37 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/api/index.ts
21
+ var api_exports = {};
22
+ __export(api_exports, {
23
+ SwapMode: () => SwapMode
24
+ });
25
+ module.exports = __toCommonJS(api_exports);
26
+
27
+ // src/api/swap.ts
28
+ var SwapMode = /* @__PURE__ */ ((SwapMode2) => {
29
+ SwapMode2["EXACT_IN"] = "exact_in";
30
+ SwapMode2["EXACT_OUT"] = "exact_out";
31
+ return SwapMode2;
32
+ })(SwapMode || {});
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ SwapMode
36
+ });
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/index.ts","../../src/api/swap.ts"],"sourcesContent":["export * from \"./activity-options\";\nexport * from \"./client\";\nexport * from \"./cursor\";\nexport * from \"./pagination\";\nexport * from \"./subscription\";\nexport * from \"./swap\";\nexport * from \"./token-options\";\nexport * from \"./transaction\";\nexport * from \"./wallet-options\";\n","import { Chain } from \"../chains\";\n\nexport enum SwapMode {\n EXACT_IN = \"exact_in\",\n EXACT_OUT = \"exact_out\",\n}\n\n/**\n * DEX identifier used for route / mint address conversion. Open union — the\n * known values cover today's DEXes; new aggregators can be plugged in without\n * a library update.\n */\nexport type SwapDex = \"jupiter\" | \"kyberswap\" | (string & {});\n\nexport interface SwapParams {\n /** chain id */\n chain: Chain;\n /** DEX to use; if omitted, inferred from chain (Solana → jupiter, EVM → kyberswap). Mint conversion uses this. */\n dex?: SwapDex;\n /** user wallet address */\n userAddress: string;\n /** input token address */\n input: string;\n /** output token address */\n output: string;\n /** swap mode, e.g. ExactIn, ExactOut */\n mode: SwapMode;\n /** input token amount when mode is ExactIn, output token amount when mode is ExactOut */\n amount: string;\n /** slippage, range is 0-100 */\n slippage?: number;\n /** priority fee */\n priorityFee?: string;\n /** tip fee */\n tipFee?: string;\n /** whether to use anti-MEV */\n isAntiMev?: boolean;\n /** EIP-2612 permit data (EVM only, alternative to on-chain approve) */\n permit?: string;\n /** deadline timestamp in ms (EVM only) */\n deadline?: number;\n}\n\nexport interface SwapRoutePlan {\n /** protocol name / dex name etc. */\n name: string;\n /** input token address */\n input: string;\n /** input token amount */\n inputAmount: string;\n /** output token address */\n output: string;\n /** output token amount */\n outputAmount: string;\n /** fee quote token address */\n feeQuote?: string;\n /** fee amount */\n feeAmount?: string;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface SwapRoute {\n /** unsigned tx in base64 format */\n serializedTx: string;\n /** recent blockhash embedded in the unsigned Solana transaction */\n recentBlockhash?: string;\n /** last block height at which the embedded Solana blockhash remains valid */\n lastValidBlockHeight?: number;\n /** swap plans */\n plans: Array<SwapRoutePlan>;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAK,WAAL,kBAAKA,cAAL;AACL,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,eAAY;AAFF,SAAAA;AAAA,GAAA;","names":["SwapMode"]}
@@ -0,0 +1,10 @@
1
+ // src/api/swap.ts
2
+ var SwapMode = /* @__PURE__ */ ((SwapMode2) => {
3
+ SwapMode2["EXACT_IN"] = "exact_in";
4
+ SwapMode2["EXACT_OUT"] = "exact_out";
5
+ return SwapMode2;
6
+ })(SwapMode || {});
7
+ export {
8
+ SwapMode
9
+ };
10
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/swap.ts"],"sourcesContent":["import { Chain } from \"../chains\";\n\nexport enum SwapMode {\n EXACT_IN = \"exact_in\",\n EXACT_OUT = \"exact_out\",\n}\n\n/**\n * DEX identifier used for route / mint address conversion. Open union — the\n * known values cover today's DEXes; new aggregators can be plugged in without\n * a library update.\n */\nexport type SwapDex = \"jupiter\" | \"kyberswap\" | (string & {});\n\nexport interface SwapParams {\n /** chain id */\n chain: Chain;\n /** DEX to use; if omitted, inferred from chain (Solana → jupiter, EVM → kyberswap). Mint conversion uses this. */\n dex?: SwapDex;\n /** user wallet address */\n userAddress: string;\n /** input token address */\n input: string;\n /** output token address */\n output: string;\n /** swap mode, e.g. ExactIn, ExactOut */\n mode: SwapMode;\n /** input token amount when mode is ExactIn, output token amount when mode is ExactOut */\n amount: string;\n /** slippage, range is 0-100 */\n slippage?: number;\n /** priority fee */\n priorityFee?: string;\n /** tip fee */\n tipFee?: string;\n /** whether to use anti-MEV */\n isAntiMev?: boolean;\n /** EIP-2612 permit data (EVM only, alternative to on-chain approve) */\n permit?: string;\n /** deadline timestamp in ms (EVM only) */\n deadline?: number;\n}\n\nexport interface SwapRoutePlan {\n /** protocol name / dex name etc. */\n name: string;\n /** input token address */\n input: string;\n /** input token amount */\n inputAmount: string;\n /** output token address */\n output: string;\n /** output token amount */\n outputAmount: string;\n /** fee quote token address */\n feeQuote?: string;\n /** fee amount */\n feeAmount?: string;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n\nexport interface SwapRoute {\n /** unsigned tx in base64 format */\n serializedTx: string;\n /** recent blockhash embedded in the unsigned Solana transaction */\n recentBlockhash?: string;\n /** last block height at which the embedded Solana blockhash remains valid */\n lastValidBlockHeight?: number;\n /** swap plans */\n plans: Array<SwapRoutePlan>;\n /** extra infos by api provider */\n extra?: Record<string, unknown>;\n}\n"],"mappings":";AAEO,IAAK,WAAL,kBAAKA,cAAL;AACL,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,eAAY;AAFF,SAAAA;AAAA,GAAA;","names":["SwapMode"]}