Socket
Socket
Sign inDemoInstall

@uniswap/uniswapx-sdk

Package Overview
Dependencies
Maintainers
24
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uniswap/uniswapx-sdk - npm Package Compare versions

Comparing version 1.5.0-alpha.2 to 1.5.0-alpha.3

9

dist/src/builder/DutchOrderBuilder.js

@@ -19,9 +19,10 @@ "use strict";

this.permit2Address = permit2Address;
const mappedReactorAddress = constants_1.REACTOR_ADDRESS_MAPPING[chainId]
? constants_1.REACTOR_ADDRESS_MAPPING[chainId][constants_1.OrderType.Dutch]
: undefined;
if (reactorAddress) {
this.reactor(reactorAddress);
}
else if (constants_1.REACTOR_ADDRESS_MAPPING[chainId] &&
constants_1.REACTOR_ADDRESS_MAPPING[chainId][constants_1.OrderType.Dutch]) {
const reactorAddress = constants_1.REACTOR_ADDRESS_MAPPING[chainId][constants_1.OrderType.Dutch];
this.reactor(reactorAddress);
else if (mappedReactorAddress) {
this.reactor(mappedReactorAddress);
}

@@ -28,0 +29,0 @@ else {

export * from "./DutchOrderBuilder";
export * from "./V2DutchOrderBuilder";
export * from "./OrderBuilder";

@@ -5,3 +5,4 @@ "use strict";

tslib_1.__exportStar(require("./DutchOrderBuilder"), exports);
tslib_1.__exportStar(require("./V2DutchOrderBuilder"), exports);
tslib_1.__exportStar(require("./OrderBuilder"), exports);
//# sourceMappingURL=index.js.map

@@ -19,9 +19,10 @@ "use strict";

this.permit2Address = permit2Address;
const mappedReactorAddress = constants_1.REACTOR_ADDRESS_MAPPING[chainId]
? constants_1.REACTOR_ADDRESS_MAPPING[chainId][constants_1.OrderType.Dutch_V2]
: undefined;
if (reactorAddress) {
this.reactor(reactorAddress);
}
else if (constants_1.REACTOR_ADDRESS_MAPPING[chainId] &&
constants_1.REACTOR_ADDRESS_MAPPING[chainId][constants_1.OrderType.Dutch_V2]) {
const reactorAddress = constants_1.REACTOR_ADDRESS_MAPPING[chainId][constants_1.OrderType.Dutch_V2];
this.reactor(reactorAddress);
else if (mappedReactorAddress) {
this.reactor(mappedReactorAddress);
}

@@ -28,0 +29,0 @@ else {

@@ -15,7 +15,8 @@ export declare const PERMIT2_MAPPING: {

Dutch = "Dutch",
Dutch_V2 = "Dutch_V2"
Dutch_V2 = "Dutch_V2",
Limit = "Limit"
}
declare type Reactors = {
declare type Reactors = Partial<{
[key in OrderType]: string;
};
}>;
declare type ReactorMapping = {

@@ -26,3 +27,2 @@ readonly [key: number]: Reactors;

[key: string]: {
chainId: number;
orderType: OrderType;

@@ -29,0 +29,0 @@ };

@@ -29,2 +29,3 @@ "use strict";

OrderType["Dutch_V2"] = "Dutch_V2";
OrderType["Limit"] = "Limit";
})(OrderType = exports.OrderType || (exports.OrderType = {}));

@@ -51,7 +52,6 @@ exports.REACTOR_ADDRESS_MAPPING = {

exports.MULTICALL_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
exports.REVERSE_REACTOR_MAPPING = Object.entries(exports.REACTOR_ADDRESS_MAPPING).reduce((acc, [chainId, orderTypes]) => {
exports.REVERSE_REACTOR_MAPPING = Object.entries(exports.REACTOR_ADDRESS_MAPPING).reduce((acc, [_, orderTypes]) => {
for (const [orderType, reactorAddress] of Object.entries(orderTypes)) {
// lowercase for consistency when parsing orders
acc[reactorAddress.toLowerCase()] = {
chainId: parseInt(chainId),
orderType: OrderType[orderType],

@@ -58,0 +58,0 @@ };

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

import { Order } from "./types";
export * from "./DutchOrder";

@@ -6,6 +5,1 @@ export * from "./types";

export * from "./V2DutchOrder";
/**
* Parses a given serialized order
* @return Parsed order object
*/
export declare function parseOrder(order: string): Order;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseOrder = void 0;
const tslib_1 = require("tslib");
const constants_1 = require("../constants");
const errors_1 = require("../errors");
const utils_1 = require("../utils");
const DutchOrder_1 = require("./DutchOrder");
tslib_1.__exportStar(require("./DutchOrder"), exports);

@@ -13,26 +8,2 @@ tslib_1.__exportStar(require("./types"), exports);

tslib_1.__exportStar(require("./V2DutchOrder"), exports);
const FIRST_FIELD_OFFSET = 88;
const ADDRESS_LENGTH = 40;
/**
* Parses a given serialized order
* @return Parsed order object
*/
function parseOrder(order) {
// reactor address is always the first field in order
const reactor = "0x" +
(0, utils_1.stripHexPrefix)(order)
.slice(FIRST_FIELD_OFFSET, FIRST_FIELD_OFFSET + ADDRESS_LENGTH)
.toLowerCase();
if (!constants_1.REVERSE_REACTOR_MAPPING[reactor]) {
throw new errors_1.MissingConfiguration("reactor", reactor);
}
const { chainId, orderType } = constants_1.REVERSE_REACTOR_MAPPING[reactor];
switch (orderType) {
case constants_1.OrderType.Dutch:
return DutchOrder_1.DutchOrder.parse(order, chainId);
default:
throw new errors_1.MissingConfiguration("orderType", orderType);
}
}
exports.parseOrder = parseOrder;
//# sourceMappingURL=index.js.map

@@ -7,2 +7,3 @@ export * from "./OrderValidator";

export * from "./dutchDecay";
export * from "./order";
export declare function stripHexPrefix(a: string): string;

@@ -11,2 +11,3 @@ "use strict";

tslib_1.__exportStar(require("./dutchDecay"), exports);
tslib_1.__exportStar(require("./order"), exports);
function stripHexPrefix(a) {

@@ -13,0 +14,0 @@ if (a.startsWith("0x")) {

{
"name": "@uniswap/uniswapx-sdk",
"author": "Uniswap",
"version": "1.5.0-alpha.2",
"version": "1.5.0-alpha.3",
"license": "MIT",

@@ -6,0 +6,0 @@ "main": "dist/src/index.js",

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

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