@uniswap/v4-sdk
Version:
⚒️ An SDK for building applications on top of Uniswap V4
69 lines • 3.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TICK_SPACINGS = exports.FeeAmount = exports.PositionFunctions = exports.CANNOT_BURN = exports.NO_SQRT_PRICE = exports.ZERO_LIQUIDITY = exports.NATIVE_NOT_SET = exports.EMPTY_HOOK = exports.SQRT_PRICE_1_1 = exports.OPEN_DELTA = exports.MIN_SLIPPAGE_DECREASE = exports.TICK_SPACING_SIXTY = exports.TICK_SPACING_TEN = exports.FEE_AMOUNT_HIGHEST = exports.FEE_AMOUNT_MEDIUM = exports.FEE_AMOUNT_LOW = exports.Q192 = exports.Q96 = exports.EMPTY_BYTES = exports.ONE_ETHER = exports.ONE = exports.ZERO = exports.NEGATIVE_ONE = exports.ADDRESS_ZERO = void 0;
const tslib_1 = require("tslib");
const jsbi_1 = tslib_1.__importDefault(require("jsbi"));
const ethers_1 = require("ethers");
const v3_sdk_1 = require("@uniswap/v3-sdk");
// constants used internally but not expected to be used externally
exports.ADDRESS_ZERO = ethers_1.constants.AddressZero;
exports.NEGATIVE_ONE = jsbi_1.default.BigInt(-1);
exports.ZERO = jsbi_1.default.BigInt(0);
exports.ONE = jsbi_1.default.BigInt(1);
exports.ONE_ETHER = jsbi_1.default.exponentiate(jsbi_1.default.BigInt(10), jsbi_1.default.BigInt(18));
exports.EMPTY_BYTES = '0x';
// used in liquidity amount math
exports.Q96 = jsbi_1.default.exponentiate(jsbi_1.default.BigInt(2), jsbi_1.default.BigInt(96));
exports.Q192 = jsbi_1.default.exponentiate(exports.Q96, jsbi_1.default.BigInt(2));
// pool setup
exports.FEE_AMOUNT_LOW = 100;
exports.FEE_AMOUNT_MEDIUM = 3000;
exports.FEE_AMOUNT_HIGHEST = 10000;
exports.TICK_SPACING_TEN = 10;
exports.TICK_SPACING_SIXTY = 60;
// used in position manager math
exports.MIN_SLIPPAGE_DECREASE = 0;
// used when unwrapping weth in positon manager
exports.OPEN_DELTA = ethers_1.constants.Zero;
// default prices
exports.SQRT_PRICE_1_1 = (0, v3_sdk_1.encodeSqrtRatioX96)(1, 1);
// default hook addresses
exports.EMPTY_HOOK = '0x0000000000000000000000000000000000000000';
// error constants
exports.NATIVE_NOT_SET = 'NATIVE_NOT_SET';
exports.ZERO_LIQUIDITY = 'ZERO_LIQUIDITY';
exports.NO_SQRT_PRICE = 'NO_SQRT_PRICE';
exports.CANNOT_BURN = 'CANNOT_BURN';
/**
* Function fragments that exist on the PositionManager contract.
*/
var PositionFunctions;
(function (PositionFunctions) {
PositionFunctions["INITIALIZE_POOL"] = "initializePool";
PositionFunctions["MODIFY_LIQUIDITIES"] = "modifyLiquidities";
// Inherited from PermitForwarder
PositionFunctions["PERMIT_BATCH"] = "0x002a3e3a";
// Inherited from ERC721Permit
PositionFunctions["ERC721PERMIT_PERMIT"] = "0x0f5730f1";
})(PositionFunctions = exports.PositionFunctions || (exports.PositionFunctions = {}));
/**
* The default factory enabled fee amounts, denominated in hundredths of bips.
*/
var FeeAmount;
(function (FeeAmount) {
FeeAmount[FeeAmount["LOWEST"] = 100] = "LOWEST";
FeeAmount[FeeAmount["LOW"] = 500] = "LOW";
FeeAmount[FeeAmount["MEDIUM"] = 3000] = "MEDIUM";
FeeAmount[FeeAmount["HIGH"] = 10000] = "HIGH";
})(FeeAmount = exports.FeeAmount || (exports.FeeAmount = {}));
/**
* The default factory tick spacings by fee amount.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
exports.TICK_SPACINGS = {
[FeeAmount.LOWEST]: 1,
[FeeAmount.LOW]: 10,
[FeeAmount.MEDIUM]: 60,
[FeeAmount.HIGH]: 200,
};
//# sourceMappingURL=internalConstants.js.map