@uniswap/universal-router-sdk 1.4.2 → 1.5.0-beta.0

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.
Files changed (40) hide show
  1. package/dist/entities/Command.d.ts +13 -13
  2. package/dist/entities/NFTTrade.d.ts +44 -50
  3. package/dist/entities/index.d.ts +3 -3
  4. package/dist/entities/protocols/cryptopunk.d.ts +16 -16
  5. package/dist/entities/protocols/element-market.d.ts +44 -0
  6. package/dist/entities/protocols/foundation.d.ts +19 -19
  7. package/dist/entities/protocols/index.d.ts +10 -10
  8. package/dist/entities/protocols/looksRare.d.ts +44 -44
  9. package/dist/entities/protocols/nft20.d.ts +21 -21
  10. package/dist/entities/protocols/nftx.d.ts +20 -20
  11. package/dist/entities/protocols/seaport.d.ts +68 -63
  12. package/dist/entities/protocols/sudoswap.d.ts +27 -27
  13. package/dist/entities/protocols/uniswap.d.ts +15 -15
  14. package/dist/entities/protocols/unwrapWETH.d.ts +12 -13
  15. package/dist/entities/protocols/x2y2.d.ts +28 -28
  16. package/dist/index.d.ts +3 -3
  17. package/dist/swapRouter.d.ts +38 -41
  18. package/dist/test/forge/writeInterop.d.ts +1 -1
  19. package/dist/test/orders/element.d.ts +7 -0
  20. package/dist/test/orders/looksRare.d.ts +12 -15
  21. package/dist/test/orders/seaport.d.ts +5 -4
  22. package/dist/test/orders/seaportV1_4.d.ts +4 -4
  23. package/dist/test/orders/x2y2.d.ts +6 -6
  24. package/dist/test/utils/addresses.d.ts +7 -2
  25. package/dist/test/utils/hexToDecimalString.d.ts +2 -2
  26. package/dist/test/utils/permit2.d.ts +7 -17
  27. package/dist/test/utils/uniswapData.d.ts +23 -30
  28. package/dist/universal-router-sdk.cjs.development.js +124 -41
  29. package/dist/universal-router-sdk.cjs.development.js.map +1 -1
  30. package/dist/universal-router-sdk.cjs.production.min.js +1 -1
  31. package/dist/universal-router-sdk.cjs.production.min.js.map +1 -1
  32. package/dist/universal-router-sdk.esm.js +125 -43
  33. package/dist/universal-router-sdk.esm.js.map +1 -1
  34. package/dist/utils/constants.d.ts +13 -8
  35. package/dist/utils/expandTo18Decimals.d.ts +4 -4
  36. package/dist/utils/getNativeCurrencyValue.d.ts +2 -2
  37. package/dist/utils/inputTokens.d.ts +21 -0
  38. package/dist/utils/routerCommands.d.ts +51 -44
  39. package/package.json +4 -2
  40. package/dist/utils/permit2.d.ts +0 -6
@@ -1,13 +1,13 @@
1
- import { RoutePlanner } from '../utils/routerCommands'
2
- export declare type TradeConfig = {
3
- allowRevert: boolean
4
- }
5
- export declare enum RouterTradeType {
6
- UniswapTrade = 'UniswapTrade',
7
- NFTTrade = 'NFTTrade',
8
- UnwrapWETH = 'UnwrapWETH',
9
- }
10
- export interface Command {
11
- tradeType: RouterTradeType
12
- encode(planner: RoutePlanner, config: TradeConfig): void
13
- }
1
+ import { RoutePlanner } from '../utils/routerCommands';
2
+ export declare type TradeConfig = {
3
+ allowRevert: boolean;
4
+ };
5
+ export declare enum RouterTradeType {
6
+ UniswapTrade = "UniswapTrade",
7
+ NFTTrade = "NFTTrade",
8
+ UnwrapWETH = "UnwrapWETH"
9
+ }
10
+ export interface Command {
11
+ tradeType: RouterTradeType;
12
+ encode(planner: RoutePlanner, config: TradeConfig): void;
13
+ }
@@ -1,50 +1,44 @@
1
- import { BigNumber, BigNumberish } from 'ethers'
2
- import { SeaportData } from './protocols/seaport'
3
- import { FoundationData } from './protocols/foundation'
4
- import { NFTXData } from './protocols/nftx'
5
- import { NFT20Data } from './protocols/nft20'
6
- import { RoutePlanner } from '../utils/routerCommands'
7
- import { Command, RouterTradeType, TradeConfig } from './Command'
8
- import { LooksRareData } from './protocols/looksRare'
9
- import { SudoswapData } from './protocols/sudoswap'
10
- import { CryptopunkData } from './protocols/cryptopunk'
11
- import { X2Y2Data } from './protocols/x2y2'
12
- export declare type SupportedProtocolsData =
13
- | SeaportData
14
- | FoundationData
15
- | NFTXData
16
- | LooksRareData
17
- | X2Y2Data
18
- | CryptopunkData
19
- | NFT20Data
20
- | SudoswapData
21
- export declare abstract class NFTTrade<T> implements Command {
22
- readonly tradeType: RouterTradeType
23
- readonly orders: T[]
24
- readonly market: Market
25
- constructor(market: Market, orders: T[])
26
- abstract encode(planner: RoutePlanner, config: TradeConfig): void
27
- abstract getBuyItems(): BuyItem[]
28
- abstract getTotalPrice(): BigNumber
29
- }
30
- export declare type BuyItem = {
31
- tokenAddress: string
32
- tokenId: BigNumberish
33
- tokenType: TokenType
34
- amount?: BigNumberish
35
- }
36
- export declare enum Market {
37
- Foundation = 'foundation',
38
- LooksRare = 'looksrare',
39
- NFT20 = 'nft20',
40
- NFTX = 'nftx',
41
- Seaport = 'seaport',
42
- Sudoswap = 'Sudoswap',
43
- Cryptopunks = 'cryptopunks',
44
- X2Y2 = 'x2y2',
45
- }
46
- export declare enum TokenType {
47
- ERC721 = 'ERC721',
48
- ERC1155 = 'ERC1155',
49
- Cryptopunk = 'Cryptopunk',
50
- }
1
+ import { BigNumber, BigNumberish } from 'ethers';
2
+ import { SeaportData } from './protocols/seaport';
3
+ import { FoundationData } from './protocols/foundation';
4
+ import { NFTXData } from './protocols/nftx';
5
+ import { NFT20Data } from './protocols/nft20';
6
+ import { RoutePlanner } from '../utils/routerCommands';
7
+ import { Command, RouterTradeType, TradeConfig } from './Command';
8
+ import { LooksRareData } from './protocols/looksRare';
9
+ import { SudoswapData } from './protocols/sudoswap';
10
+ import { CryptopunkData } from './protocols/cryptopunk';
11
+ import { X2Y2Data } from './protocols/x2y2';
12
+ import { ElementData } from './protocols/element-market';
13
+ export declare type SupportedProtocolsData = SeaportData | FoundationData | NFTXData | LooksRareData | X2Y2Data | CryptopunkData | NFT20Data | SudoswapData | ElementData;
14
+ export declare abstract class NFTTrade<T> implements Command {
15
+ readonly tradeType: RouterTradeType;
16
+ readonly orders: T[];
17
+ readonly market: Market;
18
+ constructor(market: Market, orders: T[]);
19
+ abstract encode(planner: RoutePlanner, config: TradeConfig): void;
20
+ abstract getBuyItems(): BuyItem[];
21
+ abstract getTotalPrice(token?: string): BigNumber;
22
+ }
23
+ export declare type BuyItem = {
24
+ tokenAddress: string;
25
+ tokenId: BigNumberish;
26
+ tokenType: TokenType;
27
+ amount?: BigNumberish;
28
+ };
29
+ export declare enum Market {
30
+ Foundation = "foundation",
31
+ LooksRare = "looksrare",
32
+ NFT20 = "nft20",
33
+ NFTX = "nftx",
34
+ Seaport = "seaport",
35
+ Sudoswap = "Sudoswap",
36
+ Cryptopunks = "cryptopunks",
37
+ X2Y2 = "x2y2",
38
+ Element = "element"
39
+ }
40
+ export declare enum TokenType {
41
+ ERC721 = "ERC721",
42
+ ERC1155 = "ERC1155",
43
+ Cryptopunk = "Cryptopunk"
44
+ }
@@ -1,3 +1,3 @@
1
- export * from './protocols'
2
- export * from './NFTTrade'
3
- export * from './Command'
1
+ export * from './protocols';
2
+ export * from './NFTTrade';
3
+ export * from './Command';
@@ -1,16 +1,16 @@
1
- import { TradeConfig } from '../Command'
2
- import { NFTTrade, BuyItem } from '../NFTTrade'
3
- import { RoutePlanner } from '../../utils/routerCommands'
4
- import { BigNumber, BigNumberish } from 'ethers'
5
- export declare type CryptopunkData = {
6
- tokenId: BigNumberish
7
- recipient: string
8
- value: BigNumberish
9
- }
10
- export declare class CryptopunkTrade extends NFTTrade<CryptopunkData> {
11
- static CRYPTOPUNK_ADDRESS: string
12
- constructor(orders: CryptopunkData[])
13
- encode(planner: RoutePlanner, config: TradeConfig): void
14
- getBuyItems(): BuyItem[]
15
- getTotalPrice(): BigNumber
16
- }
1
+ import { TradeConfig } from '../Command';
2
+ import { NFTTrade, BuyItem } from '../NFTTrade';
3
+ import { RoutePlanner } from '../../utils/routerCommands';
4
+ import { BigNumber, BigNumberish } from 'ethers';
5
+ export declare type CryptopunkData = {
6
+ tokenId: BigNumberish;
7
+ recipient: string;
8
+ value: BigNumberish;
9
+ };
10
+ export declare class CryptopunkTrade extends NFTTrade<CryptopunkData> {
11
+ static CRYPTOPUNK_ADDRESS: string;
12
+ constructor(orders: CryptopunkData[]);
13
+ encode(planner: RoutePlanner, config: TradeConfig): void;
14
+ getBuyItems(): BuyItem[];
15
+ getTotalPrice(): BigNumber;
16
+ }
@@ -0,0 +1,44 @@
1
+ import { Interface } from '@ethersproject/abi';
2
+ import { BuyItem, NFTTrade } from '../NFTTrade';
3
+ import { TradeConfig } from '../Command';
4
+ import { RoutePlanner } from '../../utils/routerCommands';
5
+ import { BigNumber } from 'ethers';
6
+ export interface Fee {
7
+ recipient: string;
8
+ amount: string;
9
+ feeData: string;
10
+ }
11
+ declare type ElementPartialData = {
12
+ maker: string;
13
+ taker: string;
14
+ expiry: string;
15
+ nonce: string;
16
+ erc20Token: string;
17
+ erc20TokenAmount: string;
18
+ fees: Fee[];
19
+ };
20
+ export declare type ERC721SellOrder = ElementPartialData & {
21
+ nft: string;
22
+ nftId: string;
23
+ };
24
+ export declare type OrderSignature = {
25
+ signatureType: number;
26
+ v: number;
27
+ r: string;
28
+ s: string;
29
+ };
30
+ export declare type ElementData = {
31
+ order: ERC721SellOrder;
32
+ signature: OrderSignature;
33
+ recipient: string;
34
+ };
35
+ export declare class ElementTrade extends NFTTrade<ElementData> {
36
+ private static ETH_ADDRESS;
37
+ static INTERFACE: Interface;
38
+ constructor(orders: ElementData[]);
39
+ encode(planner: RoutePlanner, config: TradeConfig): void;
40
+ getBuyItems(): BuyItem[];
41
+ getTotalPrice(): BigNumber;
42
+ getOrderPriceIncludingFees(order: ERC721SellOrder): BigNumber;
43
+ }
44
+ export {};
@@ -1,19 +1,19 @@
1
- import { Interface } from '@ethersproject/abi'
2
- import { BuyItem, NFTTrade } from '../NFTTrade'
3
- import { TradeConfig } from '../Command'
4
- import { RoutePlanner } from '../../utils/routerCommands'
5
- import { BigNumber, BigNumberish } from 'ethers'
6
- export declare type FoundationData = {
7
- recipient: string
8
- tokenAddress: string
9
- tokenId: BigNumberish
10
- price: BigNumberish
11
- referrer: string
12
- }
13
- export declare class FoundationTrade extends NFTTrade<FoundationData> {
14
- static INTERFACE: Interface
15
- constructor(orders: FoundationData[])
16
- encode(planner: RoutePlanner, config: TradeConfig): void
17
- getBuyItems(): BuyItem[]
18
- getTotalPrice(): BigNumber
19
- }
1
+ import { Interface } from '@ethersproject/abi';
2
+ import { BuyItem, NFTTrade } from '../NFTTrade';
3
+ import { TradeConfig } from '../Command';
4
+ import { RoutePlanner } from '../../utils/routerCommands';
5
+ import { BigNumber, BigNumberish } from 'ethers';
6
+ export declare type FoundationData = {
7
+ recipient: string;
8
+ tokenAddress: string;
9
+ tokenId: BigNumberish;
10
+ price: BigNumberish;
11
+ referrer: string;
12
+ };
13
+ export declare class FoundationTrade extends NFTTrade<FoundationData> {
14
+ static INTERFACE: Interface;
15
+ constructor(orders: FoundationData[]);
16
+ encode(planner: RoutePlanner, config: TradeConfig): void;
17
+ getBuyItems(): BuyItem[];
18
+ getTotalPrice(): BigNumber;
19
+ }
@@ -1,10 +1,10 @@
1
- export * from './cryptopunk'
2
- export * from './foundation'
3
- export * from './looksRare'
4
- export * from './nft20'
5
- export * from './nftx'
6
- export * from './seaport'
7
- export * from './uniswap'
8
- export * from './sudoswap'
9
- export * from './x2y2'
10
- export * from './unwrapWETH'
1
+ export * from './cryptopunk';
2
+ export * from './foundation';
3
+ export * from './looksRare';
4
+ export * from './nft20';
5
+ export * from './nftx';
6
+ export * from './seaport';
7
+ export * from './uniswap';
8
+ export * from './sudoswap';
9
+ export * from './x2y2';
10
+ export * from './unwrapWETH';
@@ -1,44 +1,44 @@
1
- import { Interface } from '@ethersproject/abi'
2
- import { BuyItem, NFTTrade, TokenType } from '../NFTTrade'
3
- import { TradeConfig } from '../Command'
4
- import { RoutePlanner } from '../../utils/routerCommands'
5
- import { BigNumber, BigNumberish } from 'ethers'
6
- export declare type MakerOrder = {
7
- collection: string
8
- tokenId: BigNumberish
9
- isOrderAsk: true
10
- signer: string
11
- strategy: string
12
- currency: string
13
- amount: BigNumberish
14
- price: BigNumberish
15
- minPercentageToAsk: BigNumberish
16
- nonce: BigNumberish
17
- startTime: BigNumberish
18
- endTime: BigNumberish
19
- v: BigNumberish
20
- r: string
21
- s: string
22
- params: string
23
- }
24
- export declare type TakerOrder = {
25
- minPercentageToAsk: BigNumberish
26
- price: BigNumberish
27
- taker: string
28
- tokenId: BigNumberish
29
- isOrderAsk: boolean
30
- params: string
31
- }
32
- export declare type LooksRareData = {
33
- makerOrder: MakerOrder
34
- takerOrder: TakerOrder
35
- recipient: string
36
- tokenType: TokenType
37
- }
38
- export declare class LooksRareTrade extends NFTTrade<LooksRareData> {
39
- static INTERFACE: Interface
40
- constructor(orders: LooksRareData[])
41
- encode(planner: RoutePlanner, config: TradeConfig): void
42
- getBuyItems(): BuyItem[]
43
- getTotalPrice(): BigNumber
44
- }
1
+ import { Interface } from '@ethersproject/abi';
2
+ import { BuyItem, NFTTrade, TokenType } from '../NFTTrade';
3
+ import { TradeConfig } from '../Command';
4
+ import { RoutePlanner } from '../../utils/routerCommands';
5
+ import { BigNumber, BigNumberish } from 'ethers';
6
+ export declare type MakerOrder = {
7
+ collection: string;
8
+ tokenId: BigNumberish;
9
+ isOrderAsk: true;
10
+ signer: string;
11
+ strategy: string;
12
+ currency: string;
13
+ amount: BigNumberish;
14
+ price: BigNumberish;
15
+ minPercentageToAsk: BigNumberish;
16
+ nonce: BigNumberish;
17
+ startTime: BigNumberish;
18
+ endTime: BigNumberish;
19
+ v: BigNumberish;
20
+ r: string;
21
+ s: string;
22
+ params: string;
23
+ };
24
+ export declare type TakerOrder = {
25
+ minPercentageToAsk: BigNumberish;
26
+ price: BigNumberish;
27
+ taker: string;
28
+ tokenId: BigNumberish;
29
+ isOrderAsk: boolean;
30
+ params: string;
31
+ };
32
+ export declare type LooksRareData = {
33
+ makerOrder: MakerOrder;
34
+ takerOrder: TakerOrder;
35
+ recipient: string;
36
+ tokenType: TokenType;
37
+ };
38
+ export declare class LooksRareTrade extends NFTTrade<LooksRareData> {
39
+ static INTERFACE: Interface;
40
+ constructor(orders: LooksRareData[]);
41
+ encode(planner: RoutePlanner, config: TradeConfig): void;
42
+ getBuyItems(): BuyItem[];
43
+ getTotalPrice(): BigNumber;
44
+ }
@@ -1,21 +1,21 @@
1
- import { Interface } from '@ethersproject/abi'
2
- import { TradeConfig } from '../Command'
3
- import { NFTTrade, BuyItem } from '../NFTTrade'
4
- import { RoutePlanner } from '../../utils/routerCommands'
5
- import { BigNumber, BigNumberish } from 'ethers'
6
- export declare type NFT20Data = {
7
- tokenAddress: string
8
- tokenIds: BigNumberish[]
9
- tokenAmounts: BigNumberish[]
10
- recipient: string
11
- fee: BigNumberish
12
- isV3: boolean
13
- value: BigNumberish
14
- }
15
- export declare class NFT20Trade extends NFTTrade<NFT20Data> {
16
- static INTERFACE: Interface
17
- constructor(orders: NFT20Data[])
18
- encode(planner: RoutePlanner, config: TradeConfig): void
19
- getBuyItems(): BuyItem[]
20
- getTotalPrice(): BigNumber
21
- }
1
+ import { Interface } from '@ethersproject/abi';
2
+ import { TradeConfig } from '../Command';
3
+ import { NFTTrade, BuyItem } from '../NFTTrade';
4
+ import { RoutePlanner } from '../../utils/routerCommands';
5
+ import { BigNumber, BigNumberish } from 'ethers';
6
+ export declare type NFT20Data = {
7
+ tokenAddress: string;
8
+ tokenIds: BigNumberish[];
9
+ tokenAmounts: BigNumberish[];
10
+ recipient: string;
11
+ fee: BigNumberish;
12
+ isV3: boolean;
13
+ value: BigNumberish;
14
+ };
15
+ export declare class NFT20Trade extends NFTTrade<NFT20Data> {
16
+ static INTERFACE: Interface;
17
+ constructor(orders: NFT20Data[]);
18
+ encode(planner: RoutePlanner, config: TradeConfig): void;
19
+ getBuyItems(): BuyItem[];
20
+ getTotalPrice(): BigNumber;
21
+ }
@@ -1,20 +1,20 @@
1
- import { Interface } from '@ethersproject/abi'
2
- import { BuyItem, NFTTrade } from '../NFTTrade'
3
- import { TradeConfig } from '../Command'
4
- import { RoutePlanner } from '../../utils/routerCommands'
5
- import { BigNumber, BigNumberish } from 'ethers'
6
- export declare type NFTXData = {
7
- recipient: string
8
- vaultAddress: string
9
- vaultId: BigNumberish
10
- tokenAddress: string
11
- tokenIds: BigNumberish[]
12
- value: BigNumber
13
- }
14
- export declare class NFTXTrade extends NFTTrade<NFTXData> {
15
- static INTERFACE: Interface
16
- constructor(orders: NFTXData[])
17
- encode(planner: RoutePlanner, config: TradeConfig): void
18
- getBuyItems(): BuyItem[]
19
- getTotalPrice(): BigNumber
20
- }
1
+ import { Interface } from '@ethersproject/abi';
2
+ import { BuyItem, NFTTrade } from '../NFTTrade';
3
+ import { TradeConfig } from '../Command';
4
+ import { RoutePlanner } from '../../utils/routerCommands';
5
+ import { BigNumber, BigNumberish } from 'ethers';
6
+ export declare type NFTXData = {
7
+ recipient: string;
8
+ vaultAddress: string;
9
+ vaultId: BigNumberish;
10
+ tokenAddress: string;
11
+ tokenIds: BigNumberish[];
12
+ value: BigNumber;
13
+ };
14
+ export declare class NFTXTrade extends NFTTrade<NFTXData> {
15
+ static INTERFACE: Interface;
16
+ constructor(orders: NFTXData[]);
17
+ encode(planner: RoutePlanner, config: TradeConfig): void;
18
+ getBuyItems(): BuyItem[];
19
+ getTotalPrice(): BigNumber;
20
+ }
@@ -1,63 +1,68 @@
1
- import { BigNumber, BigNumberish } from 'ethers'
2
- import { Interface } from '@ethersproject/abi'
3
- import { BuyItem, NFTTrade } from '../NFTTrade'
4
- import { TradeConfig } from '../Command'
5
- import { RoutePlanner } from '../../utils/routerCommands'
6
- export declare enum SeaportVersion {
7
- V1_1 = 0,
8
- V1_4 = 1,
9
- }
10
- export declare type SeaportData = {
11
- items: Order[]
12
- recipient: string
13
- version: SeaportVersion
14
- }
15
- export declare type FulfillmentComponent = {
16
- orderIndex: BigNumberish
17
- itemIndex: BigNumberish
18
- }
19
- export declare type OfferItem = {
20
- itemType: BigNumberish
21
- token: string
22
- identifierOrCriteria: BigNumberish
23
- startAmount: BigNumberish
24
- endAmount: BigNumberish
25
- }
26
- export declare type ConsiderationItem = OfferItem & {
27
- recipient: string
28
- }
29
- export declare type Order = {
30
- parameters: OrderParameters
31
- signature: string
32
- }
33
- declare type OrderParameters = {
34
- offerer: string
35
- offer: OfferItem[]
36
- consideration: ConsiderationItem[]
37
- orderType: BigNumberish
38
- startTime: BigNumberish
39
- endTime: BigNumberish
40
- zoneHash: string
41
- zone: string
42
- salt: BigNumberish
43
- conduitKey: string
44
- totalOriginalConsiderationItems: BigNumberish
45
- }
46
- export declare type AdvancedOrder = Order & {
47
- numerator: BigNumber
48
- denominator: BigNumber
49
- extraData: string
50
- }
51
- export declare class SeaportTrade extends NFTTrade<SeaportData> {
52
- static INTERFACE: Interface
53
- static OPENSEA_CONDUIT_KEY: string
54
- constructor(orders: SeaportData[])
55
- encode(planner: RoutePlanner, config: TradeConfig): void
56
- getBuyItems(): BuyItem[]
57
- getTotalPrice(): BigNumber
58
- private commandMap
59
- private getConsiderationFulfillments
60
- private getAdvancedOrderParams
61
- private calculateValue
62
- }
63
- export {}
1
+ import { BigNumber, BigNumberish } from 'ethers';
2
+ import { Interface } from '@ethersproject/abi';
3
+ import { BuyItem, NFTTrade } from '../NFTTrade';
4
+ import { TradeConfig } from '../Command';
5
+ import { RoutePlanner } from '../../utils/routerCommands';
6
+ import { Permit2Permit } from '../../utils/inputTokens';
7
+ export declare type SeaportData = {
8
+ items: Order[];
9
+ recipient: string;
10
+ protocolAddress: string;
11
+ inputTokenProcessing?: InputTokenProcessing[];
12
+ };
13
+ export declare type InputTokenProcessing = {
14
+ token: string;
15
+ permit2Permit?: Permit2Permit;
16
+ protocolApproval: boolean;
17
+ permit2TransferFrom: boolean;
18
+ };
19
+ export declare type FulfillmentComponent = {
20
+ orderIndex: BigNumberish;
21
+ itemIndex: BigNumberish;
22
+ };
23
+ export declare type OfferItem = {
24
+ itemType: BigNumberish;
25
+ token: string;
26
+ identifierOrCriteria: BigNumberish;
27
+ startAmount: BigNumberish;
28
+ endAmount: BigNumberish;
29
+ };
30
+ export declare type ConsiderationItem = OfferItem & {
31
+ recipient: string;
32
+ };
33
+ export declare type Order = {
34
+ parameters: OrderParameters;
35
+ signature: string;
36
+ };
37
+ declare type OrderParameters = {
38
+ offerer: string;
39
+ offer: OfferItem[];
40
+ consideration: ConsiderationItem[];
41
+ orderType: BigNumberish;
42
+ startTime: BigNumberish;
43
+ endTime: BigNumberish;
44
+ zoneHash: string;
45
+ zone: string;
46
+ salt: BigNumberish;
47
+ conduitKey: string;
48
+ totalOriginalConsiderationItems: BigNumberish;
49
+ };
50
+ export declare type AdvancedOrder = Order & {
51
+ numerator: BigNumber;
52
+ denominator: BigNumber;
53
+ extraData: string;
54
+ };
55
+ export declare class SeaportTrade extends NFTTrade<SeaportData> {
56
+ static INTERFACE: Interface;
57
+ static OPENSEA_CONDUIT_KEY: string;
58
+ constructor(orders: SeaportData[]);
59
+ encode(planner: RoutePlanner, config: TradeConfig): void;
60
+ getBuyItems(): BuyItem[];
61
+ getTotalOrderPrice(order: SeaportData, token?: string): BigNumber;
62
+ getTotalPrice(token?: string): BigNumber;
63
+ private commandMap;
64
+ private getConsiderationFulfillments;
65
+ private getAdvancedOrderParams;
66
+ private calculateValue;
67
+ }
68
+ export {};
@@ -1,27 +1,27 @@
1
- import { Interface } from '@ethersproject/abi'
2
- import { BuyItem, NFTTrade } from '../NFTTrade'
3
- import { TradeConfig } from '../Command'
4
- import { RoutePlanner } from '../../utils/routerCommands'
5
- import { BigNumber, BigNumberish } from 'ethers'
6
- declare type PairSwap = {
7
- swapInfo: {
8
- pair: string
9
- nftIds: BigNumberish[]
10
- }
11
- tokenAddress: string
12
- maxCost: BigNumberish
13
- }
14
- export declare type SudoswapData = {
15
- swaps: PairSwap[]
16
- nftRecipient: string
17
- ethRecipient: string
18
- deadline: BigNumberish
19
- }
20
- export declare class SudoswapTrade extends NFTTrade<SudoswapData> {
21
- static INTERFACE: Interface
22
- constructor(orders: SudoswapData[])
23
- encode(planner: RoutePlanner, config: TradeConfig): void
24
- getBuyItems(): BuyItem[]
25
- getTotalPrice(): BigNumber
26
- }
27
- export {}
1
+ import { Interface } from '@ethersproject/abi';
2
+ import { BuyItem, NFTTrade } from '../NFTTrade';
3
+ import { TradeConfig } from '../Command';
4
+ import { RoutePlanner } from '../../utils/routerCommands';
5
+ import { BigNumber, BigNumberish } from 'ethers';
6
+ declare type PairSwap = {
7
+ swapInfo: {
8
+ pair: string;
9
+ nftIds: BigNumberish[];
10
+ };
11
+ tokenAddress: string;
12
+ maxCost: BigNumberish;
13
+ };
14
+ export declare type SudoswapData = {
15
+ swaps: PairSwap[];
16
+ nftRecipient: string;
17
+ ethRecipient: string;
18
+ deadline: BigNumberish;
19
+ };
20
+ export declare class SudoswapTrade extends NFTTrade<SudoswapData> {
21
+ static INTERFACE: Interface;
22
+ constructor(orders: SudoswapData[]);
23
+ encode(planner: RoutePlanner, config: TradeConfig): void;
24
+ getBuyItems(): BuyItem[];
25
+ getTotalPrice(): BigNumber;
26
+ }
27
+ export {};