@uniswap/uniswapx-sdk
Advanced tools
Comparing version 2.0.1-alpha.3 to 2.0.1-alpha.4
@@ -5,3 +5,4 @@ import { SignatureLike } from "@ethersproject/bytes"; | ||
import { ResolvedUniswapXOrder } from "../utils/OrderQuoter"; | ||
import { DutchInput, DutchInputJSON, DutchOutput, DutchOutputJSON, OrderInfo, OrderResolutionOptions, UniswapXOrder } from "./types"; | ||
import { DutchInput, DutchInputJSON, DutchOutput, DutchOutputJSON, OffChainOrder, OrderInfo, OrderResolutionOptions } from "./types"; | ||
import { CustomOrderValidation } from "./validation"; | ||
export declare function id(text: string): string; | ||
@@ -22,3 +23,3 @@ export declare type DutchOrderInfo = OrderInfo & { | ||
}; | ||
export declare class DutchOrder extends UniswapXOrder { | ||
export declare class DutchOrder implements OffChainOrder { | ||
readonly info: DutchOrderInfo; | ||
@@ -52,5 +53,11 @@ readonly chainId: number; | ||
/** | ||
* @inheritdoc Order | ||
* Returns the resolved order with the given options | ||
* @return The resolved order | ||
*/ | ||
resolve(options: OrderResolutionOptions): ResolvedUniswapXOrder; | ||
/** | ||
* Returns the parsed validation | ||
* @return The parsed validation data for the order | ||
*/ | ||
get validation(): CustomOrderValidation; | ||
private toPermit; | ||
@@ -57,0 +64,0 @@ private witnessInfo; |
@@ -10,3 +10,3 @@ "use strict"; | ||
const dutchDecay_1 = require("../utils/dutchDecay"); | ||
const types_1 = require("./types"); | ||
const validation_1 = require("./validation"); | ||
function id(text) { | ||
@@ -57,5 +57,4 @@ return (0, utils_1.keccak256)((0, utils_1.toUtf8Bytes)(text)); | ||
]; | ||
class DutchOrder extends types_1.UniswapXOrder { | ||
class DutchOrder { | ||
constructor(info, chainId, _permit2Address) { | ||
super(); | ||
this.info = info; | ||
@@ -197,3 +196,4 @@ this.chainId = chainId; | ||
/** | ||
* @inheritdoc Order | ||
* Returns the resolved order with the given options | ||
* @return The resolved order | ||
*/ | ||
@@ -240,2 +240,9 @@ resolve(options) { | ||
} | ||
/** | ||
* Returns the parsed validation | ||
* @return The parsed validation data for the order | ||
*/ | ||
get validation() { | ||
return (0, validation_1.parseValidation)(this.info); | ||
} | ||
toPermit() { | ||
@@ -242,0 +249,0 @@ return { |
@@ -9,2 +9,3 @@ import { DutchOrder } from "./DutchOrder"; | ||
export * from "./V2DutchOrder"; | ||
export declare type Order = DutchOrder | RelayOrder | UnsignedV2DutchOrder | CosignedV2DutchOrder; | ||
export declare type UniswapXOrder = DutchOrder | UnsignedV2DutchOrder | CosignedV2DutchOrder; | ||
export declare type Order = UniswapXOrder | RelayOrder; |
import { SignatureLike } from "@ethersproject/bytes"; | ||
import { PermitBatchTransferFromData, PermitTransferFromData } from "@uniswap/permit2-sdk"; | ||
import { BigNumber } from "ethers"; | ||
import { ResolvedUniswapXOrder } from "../utils/OrderQuoter"; | ||
import { CustomOrderValidation } from "./validation"; | ||
export interface OffChainOrder { | ||
chainId: number; | ||
/** | ||
@@ -29,20 +28,2 @@ * Returns the abi encoded order | ||
} | ||
export declare abstract class UniswapXOrder implements OffChainOrder { | ||
abstract info: OrderInfo; | ||
abstract chainId: number; | ||
abstract serialize(): string; | ||
abstract getSigner(signature: SignatureLike): string; | ||
abstract permitData(): PermitTransferFromData; | ||
abstract hash(): string; | ||
/** | ||
* Returns the parsed validation | ||
* @return The parsed validation data for the order | ||
*/ | ||
get validation(): CustomOrderValidation; | ||
/** | ||
* Returns the resolved order with the given options | ||
* @return The resolved order | ||
*/ | ||
abstract resolve(options: OrderResolutionOptions): ResolvedUniswapXOrder; | ||
} | ||
export declare type TokenAmount = { | ||
@@ -49,0 +30,0 @@ readonly token: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UniswapXOrder = void 0; | ||
const validation_1 = require("./validation"); | ||
// Base class for a UniswapX order | ||
class UniswapXOrder { | ||
/** | ||
* Returns the parsed validation | ||
* @return The parsed validation data for the order | ||
*/ | ||
get validation() { | ||
return (0, validation_1.parseValidation)(this.info); | ||
} | ||
} | ||
exports.UniswapXOrder = UniswapXOrder; | ||
//# sourceMappingURL=types.js.map |
@@ -5,3 +5,4 @@ import { SignatureLike } from "@ethersproject/bytes"; | ||
import { ResolvedUniswapXOrder } from "../utils/OrderQuoter"; | ||
import { DutchInput, DutchInputJSON, DutchOutput, DutchOutputJSON, OrderInfo, OrderResolutionOptions, UniswapXOrder } from "./types"; | ||
import { DutchInput, DutchInputJSON, DutchOutput, DutchOutputJSON, OffChainOrder, OrderInfo, OrderResolutionOptions } from "./types"; | ||
import { CustomOrderValidation } from "./validation"; | ||
export declare type CosignerData = { | ||
@@ -41,3 +42,3 @@ decayStartTime: number; | ||
}; | ||
export declare class UnsignedV2DutchOrder extends UniswapXOrder { | ||
export declare class UnsignedV2DutchOrder implements OffChainOrder { | ||
readonly info: UnsignedV2DutchOrderInfo; | ||
@@ -73,5 +74,11 @@ readonly chainId: number; | ||
/** | ||
* @inheritdoc Order | ||
* Returns the resolved order with the given options | ||
* @return The resolved order | ||
*/ | ||
resolve(_options: OrderResolutionOptions): ResolvedUniswapXOrder; | ||
/** | ||
* Returns the parsed validation | ||
* @return The parsed validation data for the order | ||
*/ | ||
get validation(): CustomOrderValidation; | ||
private toPermit; | ||
@@ -78,0 +85,0 @@ private witnessInfo; |
@@ -8,3 +8,3 @@ "use strict"; | ||
const dutchDecay_1 = require("../utils/dutchDecay"); | ||
const types_1 = require("./types"); | ||
const validation_1 = require("./validation"); | ||
const COSIGNER_DATA_TUPLE_ABI = "tuple(uint256,uint256,address,uint256,uint256,uint256[])"; | ||
@@ -47,5 +47,4 @@ const V2_DUTCH_ORDER_TYPES = { | ||
]; | ||
class UnsignedV2DutchOrder extends types_1.UniswapXOrder { | ||
class UnsignedV2DutchOrder { | ||
constructor(info, chainId, _permit2Address) { | ||
super(); | ||
this.info = info; | ||
@@ -151,3 +150,4 @@ this.chainId = chainId; | ||
/** | ||
* @inheritdoc Order | ||
* Returns the resolved order with the given options | ||
* @return The resolved order | ||
*/ | ||
@@ -158,2 +158,9 @@ resolve(_options) { | ||
} | ||
/** | ||
* Returns the parsed validation | ||
* @return The parsed validation data for the order | ||
*/ | ||
get validation() { | ||
return (0, validation_1.parseValidation)(this.info); | ||
} | ||
toPermit() { | ||
@@ -160,0 +167,0 @@ return { |
import { OrderType } from "../constants"; | ||
import { Order } from "../order"; | ||
import { Order, RelayOrder, UniswapXOrder } from "../order"; | ||
declare abstract class OrderParser { | ||
@@ -26,3 +26,3 @@ abstract orderInfoOffset: number; | ||
*/ | ||
parseOrder(order: string, chainId: number): Order; | ||
parseOrder(order: string, chainId: number): UniswapXOrder; | ||
/** | ||
@@ -39,4 +39,4 @@ * Determine the order type of a UniswapX order | ||
*/ | ||
parseOrder(order: string, chainId: number): Order; | ||
parseOrder(order: string, chainId: number): RelayOrder; | ||
} | ||
export {}; |
import { BaseProvider } from "@ethersproject/providers"; | ||
import { OrderQuoter as OrderQuoterContract, RelayOrderReactor } from "../contracts"; | ||
import { OffChainOrder, RelayOrder, ResolvedRelayFee, TokenAmount, UniswapXOrder } from "../order"; | ||
import { Order, RelayOrder, ResolvedRelayFee, TokenAmount, UniswapXOrder } from "../order"; | ||
export declare enum OrderValidation { | ||
@@ -39,4 +39,4 @@ Expired = 0, | ||
} | ||
export interface OffchainSignedOrder { | ||
order: OffChainOrder; | ||
export interface SignedOrder { | ||
order: Order; | ||
signature: string; | ||
@@ -43,0 +43,0 @@ } |
{ | ||
"name": "@uniswap/uniswapx-sdk", | ||
"author": "Uniswap", | ||
"version": "2.0.1-alpha.3", | ||
"version": "2.0.1-alpha.4", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
1448205
19123