Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@paraswap/core

Package Overview
Dependencies
Maintainers
7
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paraswap/core - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

56

build/constants.d.ts

@@ -5,3 +5,3 @@ export declare enum SwapSide {

}
export declare enum ContractMethod {
export declare enum ContractMethodV5 {
swapOnUniswap = "swapOnUniswap",

@@ -31,3 +31,55 @@ buyOnUniswap = "buyOnUniswap",

}
export declare enum ContractMethodV6 {
swapExactAmountIn = "swapExactAmountIn",
swapExactAmountOut = "swapExactAmountOut",
swapExactAmountInOnUniswapV2 = "swapExactAmountInOnUniswapV2",
swapExactAmountOutOnUniswapV2 = "swapExactAmountOutOnUniswapV2",
swapExactAmountInOnUniswapV3 = "swapExactAmountInOnUniswapV3",
swapExactAmountOutOnUniswapV3 = "swapExactAmountOutOnUniswapV3",
swapExactAmountInOnBalancerV2 = "swapExactAmountInOnBalancerV2",
swapExactAmountOutOnBalancerV2 = "swapExactAmountOutOnBalancerV2",
swapExactAmountInOnCurveV1 = "swapExactAmountInOnCurveV1",
swapExactAmountInOnCurveV2 = "swapExactAmountInOnCurveV2",
swapExactAmountInOutOnAugustusRFQTryBatchFill = "swapExactAmountInOutOnAugustusRFQTryBatchFill",
swapExactAmountInOutOnMakerPSM = "swapExactAmountInOutOnMakerPSM"
}
export declare const ContractMethod: {
swapExactAmountIn: ContractMethodV6.swapExactAmountIn;
swapExactAmountOut: ContractMethodV6.swapExactAmountOut;
swapExactAmountInOnUniswapV2: ContractMethodV6.swapExactAmountInOnUniswapV2;
swapExactAmountOutOnUniswapV2: ContractMethodV6.swapExactAmountOutOnUniswapV2;
swapExactAmountInOnUniswapV3: ContractMethodV6.swapExactAmountInOnUniswapV3;
swapExactAmountOutOnUniswapV3: ContractMethodV6.swapExactAmountOutOnUniswapV3;
swapExactAmountInOnBalancerV2: ContractMethodV6.swapExactAmountInOnBalancerV2;
swapExactAmountOutOnBalancerV2: ContractMethodV6.swapExactAmountOutOnBalancerV2;
swapExactAmountInOnCurveV1: ContractMethodV6.swapExactAmountInOnCurveV1;
swapExactAmountInOnCurveV2: ContractMethodV6.swapExactAmountInOnCurveV2;
swapExactAmountInOutOnAugustusRFQTryBatchFill: ContractMethodV6.swapExactAmountInOutOnAugustusRFQTryBatchFill;
swapExactAmountInOutOnMakerPSM: ContractMethodV6.swapExactAmountInOutOnMakerPSM;
swapOnUniswap: ContractMethodV5.swapOnUniswap;
buyOnUniswap: ContractMethodV5.buyOnUniswap;
swapOnUniswapFork: ContractMethodV5.swapOnUniswapFork;
buyOnUniswapFork: ContractMethodV5.buyOnUniswapFork;
swapOnUniswapV2Fork: ContractMethodV5.swapOnUniswapV2Fork;
buyOnUniswapV2Fork: ContractMethodV5.buyOnUniswapV2Fork;
simpleBuy: ContractMethodV5.simpleBuy;
simpleSwap: ContractMethodV5.simpleSwap;
multiSwap: ContractMethodV5.multiSwap;
megaSwap: ContractMethodV5.megaSwap;
protectedMultiSwap: ContractMethodV5.protectedMultiSwap;
protectedMegaSwap: ContractMethodV5.protectedMegaSwap;
protectedSimpleSwap: ContractMethodV5.protectedSimpleSwap;
protectedSimpleBuy: ContractMethodV5.protectedSimpleBuy;
swapOnZeroXv2: ContractMethodV5.swapOnZeroXv2;
swapOnZeroXv4: ContractMethodV5.swapOnZeroXv4;
buy: ContractMethodV5.buy;
directUniV3Swap: ContractMethodV5.directUniV3Swap;
directUniV3Buy: ContractMethodV5.directUniV3Buy;
directCurveV1Swap: ContractMethodV5.directCurveV1Swap;
directCurveV2Swap: ContractMethodV5.directCurveV2Swap;
directBalancerV2GivenInSwap: ContractMethodV5.directBalancerV2GivenInSwap;
directBalancerV2GivenOutSwap: ContractMethodV5.directBalancerV2GivenOutSwap;
};
export declare type ContractMethod = ContractMethodV5 | ContractMethodV6;
export declare const DirectContractMethodsWithFeeModel: ContractMethod[];
export declare const DirectContractMethods: ContractMethod[];
export declare const DirectContractMethods: (ContractMethodV5 | ContractMethodV6)[];

108

build/constants.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DirectContractMethods = exports.DirectContractMethodsWithFeeModel = exports.ContractMethod = exports.SwapSide = void 0;
exports.DirectContractMethods = exports.DirectContractMethodsWithFeeModel = exports.ContractMethod = exports.ContractMethodV6 = exports.ContractMethodV5 = exports.SwapSide = void 0;
var SwapSide;

@@ -9,46 +9,72 @@ (function (SwapSide) {

})(SwapSide = exports.SwapSide || (exports.SwapSide = {}));
var ContractMethod;
(function (ContractMethod) {
ContractMethod["swapOnUniswap"] = "swapOnUniswap";
ContractMethod["buyOnUniswap"] = "buyOnUniswap";
ContractMethod["swapOnUniswapFork"] = "swapOnUniswapFork";
ContractMethod["buyOnUniswapFork"] = "buyOnUniswapFork";
ContractMethod["swapOnUniswapV2Fork"] = "swapOnUniswapV2Fork";
ContractMethod["buyOnUniswapV2Fork"] = "buyOnUniswapV2Fork";
ContractMethod["simpleBuy"] = "simpleBuy";
ContractMethod["simpleSwap"] = "simpleSwap";
ContractMethod["multiSwap"] = "multiSwap";
ContractMethod["megaSwap"] = "megaSwap";
ContractMethod["protectedMultiSwap"] = "protectedMultiSwap";
ContractMethod["protectedMegaSwap"] = "protectedMegaSwap";
ContractMethod["protectedSimpleSwap"] = "protectedSimpleSwap";
ContractMethod["protectedSimpleBuy"] = "protectedSimpleBuy";
ContractMethod["swapOnZeroXv2"] = "swapOnZeroXv2";
ContractMethod["swapOnZeroXv4"] = "swapOnZeroXv4";
ContractMethod["buy"] = "buy";
ContractMethod["directUniV3Swap"] = "directUniV3Swap";
ContractMethod["directUniV3Buy"] = "directUniV3Buy";
ContractMethod["directCurveV1Swap"] = "directCurveV1Swap";
ContractMethod["directCurveV2Swap"] = "directCurveV2Swap";
ContractMethod["directBalancerV2GivenInSwap"] = "directBalancerV2GivenInSwap";
ContractMethod["directBalancerV2GivenOutSwap"] = "directBalancerV2GivenOutSwap";
})(ContractMethod = exports.ContractMethod || (exports.ContractMethod = {}));
var ContractMethodV5;
(function (ContractMethodV5) {
ContractMethodV5["swapOnUniswap"] = "swapOnUniswap";
ContractMethodV5["buyOnUniswap"] = "buyOnUniswap";
ContractMethodV5["swapOnUniswapFork"] = "swapOnUniswapFork";
ContractMethodV5["buyOnUniswapFork"] = "buyOnUniswapFork";
ContractMethodV5["swapOnUniswapV2Fork"] = "swapOnUniswapV2Fork";
ContractMethodV5["buyOnUniswapV2Fork"] = "buyOnUniswapV2Fork";
ContractMethodV5["simpleBuy"] = "simpleBuy";
ContractMethodV5["simpleSwap"] = "simpleSwap";
ContractMethodV5["multiSwap"] = "multiSwap";
ContractMethodV5["megaSwap"] = "megaSwap";
ContractMethodV5["protectedMultiSwap"] = "protectedMultiSwap";
ContractMethodV5["protectedMegaSwap"] = "protectedMegaSwap";
ContractMethodV5["protectedSimpleSwap"] = "protectedSimpleSwap";
ContractMethodV5["protectedSimpleBuy"] = "protectedSimpleBuy";
ContractMethodV5["swapOnZeroXv2"] = "swapOnZeroXv2";
ContractMethodV5["swapOnZeroXv4"] = "swapOnZeroXv4";
ContractMethodV5["buy"] = "buy";
ContractMethodV5["directUniV3Swap"] = "directUniV3Swap";
ContractMethodV5["directUniV3Buy"] = "directUniV3Buy";
ContractMethodV5["directCurveV1Swap"] = "directCurveV1Swap";
ContractMethodV5["directCurveV2Swap"] = "directCurveV2Swap";
ContractMethodV5["directBalancerV2GivenInSwap"] = "directBalancerV2GivenInSwap";
ContractMethodV5["directBalancerV2GivenOutSwap"] = "directBalancerV2GivenOutSwap";
})(ContractMethodV5 = exports.ContractMethodV5 || (exports.ContractMethodV5 = {}));
var ContractMethodV6;
(function (ContractMethodV6) {
ContractMethodV6["swapExactAmountIn"] = "swapExactAmountIn";
ContractMethodV6["swapExactAmountOut"] = "swapExactAmountOut";
ContractMethodV6["swapExactAmountInOnUniswapV2"] = "swapExactAmountInOnUniswapV2";
ContractMethodV6["swapExactAmountOutOnUniswapV2"] = "swapExactAmountOutOnUniswapV2";
ContractMethodV6["swapExactAmountInOnUniswapV3"] = "swapExactAmountInOnUniswapV3";
ContractMethodV6["swapExactAmountOutOnUniswapV3"] = "swapExactAmountOutOnUniswapV3";
ContractMethodV6["swapExactAmountInOnBalancerV2"] = "swapExactAmountInOnBalancerV2";
ContractMethodV6["swapExactAmountOutOnBalancerV2"] = "swapExactAmountOutOnBalancerV2";
ContractMethodV6["swapExactAmountInOnCurveV1"] = "swapExactAmountInOnCurveV1";
ContractMethodV6["swapExactAmountInOnCurveV2"] = "swapExactAmountInOnCurveV2";
ContractMethodV6["swapExactAmountInOutOnAugustusRFQTryBatchFill"] = "swapExactAmountInOutOnAugustusRFQTryBatchFill";
ContractMethodV6["swapExactAmountInOutOnMakerPSM"] = "swapExactAmountInOutOnMakerPSM";
})(ContractMethodV6 = exports.ContractMethodV6 || (exports.ContractMethodV6 = {}));
exports.ContractMethod = { ...ContractMethodV5, ...ContractMethodV6 };
exports.DirectContractMethodsWithFeeModel = [
ContractMethod.directUniV3Swap,
ContractMethod.directUniV3Buy,
ContractMethod.directCurveV1Swap,
ContractMethod.directCurveV2Swap,
ContractMethod.directBalancerV2GivenInSwap,
ContractMethod.directBalancerV2GivenOutSwap,
ContractMethodV5.directUniV3Swap,
ContractMethodV5.directUniV3Buy,
ContractMethodV5.directCurveV1Swap,
ContractMethodV5.directCurveV2Swap,
ContractMethodV5.directBalancerV2GivenInSwap,
ContractMethodV5.directBalancerV2GivenOutSwap,
ContractMethodV6.swapExactAmountInOnUniswapV2,
ContractMethodV6.swapExactAmountOutOnUniswapV2,
ContractMethodV6.swapExactAmountInOnUniswapV3,
ContractMethodV6.swapExactAmountOutOnUniswapV3,
ContractMethodV6.swapExactAmountInOnBalancerV2,
ContractMethodV6.swapExactAmountOutOnBalancerV2,
ContractMethodV6.swapExactAmountInOnCurveV1,
ContractMethodV6.swapExactAmountInOnCurveV2,
];
exports.DirectContractMethods = [
ContractMethod.swapOnUniswap,
ContractMethod.buyOnUniswap,
ContractMethod.swapOnUniswapFork,
ContractMethod.buyOnUniswapFork,
ContractMethod.swapOnUniswapV2Fork,
ContractMethod.buyOnUniswapV2Fork,
ContractMethod.swapOnZeroXv2,
ContractMethod.swapOnZeroXv4,
ContractMethodV5.swapOnUniswap,
ContractMethodV5.buyOnUniswap,
ContractMethodV5.swapOnUniswapFork,
ContractMethodV5.buyOnUniswapFork,
ContractMethodV5.swapOnUniswapV2Fork,
ContractMethodV5.buyOnUniswapV2Fork,
ContractMethodV5.swapOnZeroXv2,
ContractMethodV5.swapOnZeroXv4,
ContractMethodV6.swapExactAmountInOutOnAugustusRFQTryBatchFill,
ContractMethodV6.swapExactAmountInOutOnMakerPSM,
].concat(exports.DirectContractMethodsWithFeeModel);
//# sourceMappingURL=constants.js.map

@@ -1,2 +0,2 @@

export { Address, NumberAsString, Adapters, OptimalRoute, OptimalSwap, OptimalSwapExchange, OptionalRate, OptimalRate, } from "./types";
export { SwapSide, ContractMethod, DirectContractMethods } from "./constants";
export { Address, NumberAsString, Adapters, OptimalRoute, OptimalSwap, OptimalSwapExchange, OptionalRate, OptimalRate, ParaSwapVersion } from './types';
export { SwapSide, ContractMethod, ContractMethodV5, ContractMethodV6, DirectContractMethods } from './constants';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DirectContractMethods = exports.ContractMethod = exports.SwapSide = void 0;
exports.DirectContractMethods = exports.ContractMethodV6 = exports.ContractMethodV5 = exports.ContractMethod = exports.SwapSide = exports.ParaSwapVersion = void 0;
var types_1 = require("./types");
Object.defineProperty(exports, "ParaSwapVersion", { enumerable: true, get: function () { return types_1.ParaSwapVersion; } });
var constants_1 = require("./constants");
Object.defineProperty(exports, "SwapSide", { enumerable: true, get: function () { return constants_1.SwapSide; } });
Object.defineProperty(exports, "ContractMethod", { enumerable: true, get: function () { return constants_1.ContractMethod; } });
Object.defineProperty(exports, "ContractMethodV5", { enumerable: true, get: function () { return constants_1.ContractMethodV5; } });
Object.defineProperty(exports, "ContractMethodV6", { enumerable: true, get: function () { return constants_1.ContractMethodV6; } });
Object.defineProperty(exports, "DirectContractMethods", { enumerable: true, get: function () { return constants_1.DirectContractMethods; } });
//# sourceMappingURL=index.js.map

@@ -62,2 +62,7 @@ import { SwapSide } from './constants';

hmac: string;
version: ParaSwapVersion;
};
export declare enum ParaSwapVersion {
V5 = "5",
V6 = "6"
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ParaSwapVersion = void 0;
var ParaSwapVersion;
(function (ParaSwapVersion) {
ParaSwapVersion["V5"] = "5";
ParaSwapVersion["V6"] = "6";
})(ParaSwapVersion = exports.ParaSwapVersion || (exports.ParaSwapVersion = {}));
//# sourceMappingURL=types.js.map
{
"name": "@paraswap/core",
"version": "1.1.0",
"version": "2.0.0",
"description": "Common library used between different paraswap packages",

@@ -5,0 +5,0 @@ "main": "build/index.js",

export enum SwapSide {
BUY = "BUY",
SELL = "SELL",
BUY = 'BUY',
SELL = 'SELL',
}
export enum ContractMethod {
swapOnUniswap = "swapOnUniswap",
buyOnUniswap = "buyOnUniswap",
swapOnUniswapFork = "swapOnUniswapFork",
buyOnUniswapFork = "buyOnUniswapFork",
swapOnUniswapV2Fork = "swapOnUniswapV2Fork",
buyOnUniswapV2Fork = "buyOnUniswapV2Fork",
simpleBuy = "simpleBuy",
simpleSwap = "simpleSwap",
multiSwap = "multiSwap",
megaSwap = "megaSwap",
protectedMultiSwap = "protectedMultiSwap",
protectedMegaSwap = "protectedMegaSwap",
protectedSimpleSwap = "protectedSimpleSwap",
protectedSimpleBuy = "protectedSimpleBuy",
swapOnZeroXv2 = "swapOnZeroXv2",
swapOnZeroXv4 = "swapOnZeroXv4",
buy = "buy", // TODO: remove this in future
export enum ContractMethodV5 {
swapOnUniswap = 'swapOnUniswap',
buyOnUniswap = 'buyOnUniswap',
swapOnUniswapFork = 'swapOnUniswapFork',
buyOnUniswapFork = 'buyOnUniswapFork',
swapOnUniswapV2Fork = 'swapOnUniswapV2Fork',
buyOnUniswapV2Fork = 'buyOnUniswapV2Fork',
simpleBuy = 'simpleBuy',
simpleSwap = 'simpleSwap',
multiSwap = 'multiSwap',
megaSwap = 'megaSwap',
protectedMultiSwap = 'protectedMultiSwap',
protectedMegaSwap = 'protectedMegaSwap',
protectedSimpleSwap = 'protectedSimpleSwap',
protectedSimpleBuy = 'protectedSimpleBuy',
swapOnZeroXv2 = 'swapOnZeroXv2',
swapOnZeroXv4 = 'swapOnZeroXv4',
buy = 'buy', // TODO: remove this in future
directUniV3Swap = "directUniV3Swap",
directUniV3Buy = "directUniV3Buy",
directCurveV1Swap = "directCurveV1Swap",
directCurveV2Swap = "directCurveV2Swap",
directBalancerV2GivenInSwap = "directBalancerV2GivenInSwap",
directBalancerV2GivenOutSwap = "directBalancerV2GivenOutSwap",
directUniV3Swap = 'directUniV3Swap',
directUniV3Buy = 'directUniV3Buy',
directCurveV1Swap = 'directCurveV1Swap',
directCurveV2Swap = 'directCurveV2Swap',
directBalancerV2GivenInSwap = 'directBalancerV2GivenInSwap',
directBalancerV2GivenOutSwap = 'directBalancerV2GivenOutSwap',
}
export enum ContractMethodV6 {
swapExactAmountIn = 'swapExactAmountIn',
swapExactAmountOut = 'swapExactAmountOut',
swapExactAmountInOnUniswapV2 = 'swapExactAmountInOnUniswapV2',
swapExactAmountOutOnUniswapV2 = 'swapExactAmountOutOnUniswapV2',
swapExactAmountInOnUniswapV3 = 'swapExactAmountInOnUniswapV3',
swapExactAmountOutOnUniswapV3 = 'swapExactAmountOutOnUniswapV3',
swapExactAmountInOnBalancerV2 = 'swapExactAmountInOnBalancerV2',
swapExactAmountOutOnBalancerV2 = 'swapExactAmountOutOnBalancerV2',
swapExactAmountInOnCurveV1 = 'swapExactAmountInOnCurveV1',
swapExactAmountInOnCurveV2 = 'swapExactAmountInOnCurveV2',
swapExactAmountInOutOnAugustusRFQTryBatchFill = 'swapExactAmountInOutOnAugustusRFQTryBatchFill',
swapExactAmountInOutOnMakerPSM = 'swapExactAmountInOutOnMakerPSM',
}
export const ContractMethod = { ...ContractMethodV5, ...ContractMethodV6 };
export type ContractMethod = ContractMethodV5 | ContractMethodV6;
export const DirectContractMethodsWithFeeModel: ContractMethod[] = [
ContractMethod.directUniV3Swap,
ContractMethod.directUniV3Buy,
ContractMethod.directCurveV1Swap,
ContractMethod.directCurveV2Swap,
ContractMethod.directBalancerV2GivenInSwap,
ContractMethod.directBalancerV2GivenOutSwap,
ContractMethodV5.directUniV3Swap,
ContractMethodV5.directUniV3Buy,
ContractMethodV5.directCurveV1Swap,
ContractMethodV5.directCurveV2Swap,
ContractMethodV5.directBalancerV2GivenInSwap,
ContractMethodV5.directBalancerV2GivenOutSwap,
ContractMethodV6.swapExactAmountInOnUniswapV2,
ContractMethodV6.swapExactAmountOutOnUniswapV2,
ContractMethodV6.swapExactAmountInOnUniswapV3,
ContractMethodV6.swapExactAmountOutOnUniswapV3,
ContractMethodV6.swapExactAmountInOnBalancerV2,
ContractMethodV6.swapExactAmountOutOnBalancerV2,
ContractMethodV6.swapExactAmountInOnCurveV1,
ContractMethodV6.swapExactAmountInOnCurveV2,
];
export const DirectContractMethods: ContractMethod[] = [
ContractMethod.swapOnUniswap,
ContractMethod.buyOnUniswap,
ContractMethod.swapOnUniswapFork,
ContractMethod.buyOnUniswapFork,
ContractMethod.swapOnUniswapV2Fork,
ContractMethod.buyOnUniswapV2Fork,
ContractMethod.swapOnZeroXv2,
ContractMethod.swapOnZeroXv4,
].concat(DirectContractMethodsWithFeeModel);
export const DirectContractMethods = [
ContractMethodV5.swapOnUniswap,
ContractMethodV5.buyOnUniswap,
ContractMethodV5.swapOnUniswapFork,
ContractMethodV5.buyOnUniswapFork,
ContractMethodV5.swapOnUniswapV2Fork,
ContractMethodV5.buyOnUniswapV2Fork,
ContractMethodV5.swapOnZeroXv2,
ContractMethodV5.swapOnZeroXv4,
ContractMethodV6.swapExactAmountInOutOnAugustusRFQTryBatchFill,
ContractMethodV6.swapExactAmountInOutOnMakerPSM,
].concat(DirectContractMethodsWithFeeModel);

@@ -10,4 +10,5 @@ export {

OptimalRate,
} from "./types";
ParaSwapVersion
} from './types';
export { SwapSide, ContractMethod, DirectContractMethods } from "./constants";
export { SwapSide, ContractMethod, ContractMethodV5, ContractMethodV6, DirectContractMethods } from './constants';

@@ -66,2 +66,8 @@ import { SwapSide } from './constants';

hmac: string;
version: ParaSwapVersion;
};
export enum ParaSwapVersion {
V5 = '5',
V6 = '6',
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc