@imtbl/orderbook 2.0.0-alpha.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 (119) hide show
  1. package/LICENSE.md +176 -0
  2. package/README.md +71 -0
  3. package/dist/browser/index.js +2 -0
  4. package/dist/node/index.cjs +2 -0
  5. package/dist/node/index.js +2 -0
  6. package/dist/types/api-client/api-client-factory.d.ts +8 -0
  7. package/dist/types/api-client/api-client.d.ts +29 -0
  8. package/dist/types/api-client/api-client.test.d.ts +1 -0
  9. package/dist/types/api-client/index.d.ts +2 -0
  10. package/dist/types/config/config.d.ts +20 -0
  11. package/dist/types/config/index.d.ts +1 -0
  12. package/dist/types/constants.d.ts +3 -0
  13. package/dist/types/erc721/erc721-factory.d.ts +7 -0
  14. package/dist/types/erc721/erc721.d.ts +7 -0
  15. package/dist/types/erc721/erc721.test.d.ts +1 -0
  16. package/dist/types/erc721/index.d.ts +2 -0
  17. package/dist/types/index.d.ts +4 -0
  18. package/dist/types/openapi/mapper.d.ts +10 -0
  19. package/dist/types/openapi/sdk/OrderBookClient.d.ts +10 -0
  20. package/dist/types/openapi/sdk/core/ApiError.d.ts +10 -0
  21. package/dist/types/openapi/sdk/core/ApiRequestOptions.d.ts +13 -0
  22. package/dist/types/openapi/sdk/core/ApiResult.d.ts +7 -0
  23. package/dist/types/openapi/sdk/core/AxiosHttpRequest.d.ts +14 -0
  24. package/dist/types/openapi/sdk/core/BaseHttpRequest.d.ts +8 -0
  25. package/dist/types/openapi/sdk/core/CancelablePromise.d.ts +26 -0
  26. package/dist/types/openapi/sdk/core/OpenAPI.d.ts +16 -0
  27. package/dist/types/openapi/sdk/core/request.d.ts +11 -0
  28. package/dist/types/openapi/sdk/index.d.ts +53 -0
  29. package/dist/types/openapi/sdk/models/ActiveOrderStatus.d.ts +6 -0
  30. package/dist/types/openapi/sdk/models/AssetCollectionItem.d.ts +3 -0
  31. package/dist/types/openapi/sdk/models/BidResult.d.ts +4 -0
  32. package/dist/types/openapi/sdk/models/CancelOrdersRequestBody.d.ts +14 -0
  33. package/dist/types/openapi/sdk/models/CancelOrdersResult.d.ts +4 -0
  34. package/dist/types/openapi/sdk/models/CancelOrdersResultData.d.ts +15 -0
  35. package/dist/types/openapi/sdk/models/CancelledOrderStatus.d.ts +24 -0
  36. package/dist/types/openapi/sdk/models/Chain.d.ts +13 -0
  37. package/dist/types/openapi/sdk/models/ChainName.d.ts +4 -0
  38. package/dist/types/openapi/sdk/models/CollectionBidResult.d.ts +4 -0
  39. package/dist/types/openapi/sdk/models/CreateBidRequestBody.d.ts +37 -0
  40. package/dist/types/openapi/sdk/models/CreateCollectionBidRequestBody.d.ts +37 -0
  41. package/dist/types/openapi/sdk/models/CreateListingRequestBody.d.ts +36 -0
  42. package/dist/types/openapi/sdk/models/ERC1155CollectionItem.d.ts +14 -0
  43. package/dist/types/openapi/sdk/models/ERC1155Item.d.ts +18 -0
  44. package/dist/types/openapi/sdk/models/ERC20Item.d.ts +14 -0
  45. package/dist/types/openapi/sdk/models/ERC721CollectionItem.d.ts +14 -0
  46. package/dist/types/openapi/sdk/models/ERC721Item.d.ts +14 -0
  47. package/dist/types/openapi/sdk/models/Error.d.ts +13 -0
  48. package/dist/types/openapi/sdk/models/ExpiredOrderStatus.d.ts +6 -0
  49. package/dist/types/openapi/sdk/models/FailedOrderCancellation.d.ts +18 -0
  50. package/dist/types/openapi/sdk/models/Fee.d.ts +25 -0
  51. package/dist/types/openapi/sdk/models/FillStatus.d.ts +13 -0
  52. package/dist/types/openapi/sdk/models/FilledOrderStatus.d.ts +6 -0
  53. package/dist/types/openapi/sdk/models/FulfillableOrder.d.ts +9 -0
  54. package/dist/types/openapi/sdk/models/FulfillmentDataRequest.d.ts +13 -0
  55. package/dist/types/openapi/sdk/models/InactiveOrderStatus.d.ts +14 -0
  56. package/dist/types/openapi/sdk/models/Item.d.ts +7 -0
  57. package/dist/types/openapi/sdk/models/ListBidsResult.d.ts +6 -0
  58. package/dist/types/openapi/sdk/models/ListCollectionBidsResult.d.ts +6 -0
  59. package/dist/types/openapi/sdk/models/ListListingsResult.d.ts +6 -0
  60. package/dist/types/openapi/sdk/models/ListTradeResult.d.ts +6 -0
  61. package/dist/types/openapi/sdk/models/ListingResult.d.ts +4 -0
  62. package/dist/types/openapi/sdk/models/NativeItem.d.ts +10 -0
  63. package/dist/types/openapi/sdk/models/Order.d.ts +59 -0
  64. package/dist/types/openapi/sdk/models/OrderStatus.d.ts +10 -0
  65. package/dist/types/openapi/sdk/models/OrderStatusName.d.ts +11 -0
  66. package/dist/types/openapi/sdk/models/Page.d.ts +13 -0
  67. package/dist/types/openapi/sdk/models/PageCursor.d.ts +4 -0
  68. package/dist/types/openapi/sdk/models/PageSize.d.ts +4 -0
  69. package/dist/types/openapi/sdk/models/PendingOrderStatus.d.ts +14 -0
  70. package/dist/types/openapi/sdk/models/ProtocolData.d.ts +31 -0
  71. package/dist/types/openapi/sdk/models/Trade.d.ts +40 -0
  72. package/dist/types/openapi/sdk/models/TradeBlockchainMetadata.d.ts +21 -0
  73. package/dist/types/openapi/sdk/models/TradeResult.d.ts +4 -0
  74. package/dist/types/openapi/sdk/models/UnfulfillableOrder.d.ts +14 -0
  75. package/dist/types/openapi/sdk/services/OrdersService.d.ts +319 -0
  76. package/dist/types/orderbook.d.ts +193 -0
  77. package/dist/types/seaport/components.d.ts +8 -0
  78. package/dist/types/seaport/constants.d.ts +43 -0
  79. package/dist/types/seaport/index.d.ts +2 -0
  80. package/dist/types/seaport/lib/bulk-orders.d.ts +6 -0
  81. package/dist/types/seaport/lib/defaults.d.ts +14 -0
  82. package/dist/types/seaport/lib/merkle.d.ts +33 -0
  83. package/dist/types/seaport/lib/utils.d.ts +10 -0
  84. package/dist/types/seaport/map-to-immutable-order.d.ts +7 -0
  85. package/dist/types/seaport/map-to-seaport-order.d.ts +6 -0
  86. package/dist/types/seaport/seaport-lib-factory.d.ts +10 -0
  87. package/dist/types/seaport/seaport.d.ts +38 -0
  88. package/dist/types/seaport/seaport.test.d.ts +1 -0
  89. package/dist/types/seaport/transaction.d.ts +3 -0
  90. package/dist/types/test/bulk-listings.e2e.d.ts +1 -0
  91. package/dist/types/test/cancel.e2e.d.ts +1 -0
  92. package/dist/types/test/create.e2e.d.ts +1 -0
  93. package/dist/types/test/expiry.demo.d.ts +1 -0
  94. package/dist/types/test/fulfil.e2e.d.ts +1 -0
  95. package/dist/types/test/fulfill.demo.d.ts +1 -0
  96. package/dist/types/test/fulfillBulk.demo.d.ts +1 -0
  97. package/dist/types/test/helpers/actions.d.ts +3 -0
  98. package/dist/types/test/helpers/config.d.ts +2 -0
  99. package/dist/types/test/helpers/erc721.d.ts +6 -0
  100. package/dist/types/test/helpers/gas.d.ts +4 -0
  101. package/dist/types/test/helpers/index.d.ts +8 -0
  102. package/dist/types/test/helpers/order.d.ts +3 -0
  103. package/dist/types/test/helpers/provider.d.ts +2 -0
  104. package/dist/types/test/helpers/sign-and-submit.d.ts +7 -0
  105. package/dist/types/test/helpers/signers.d.ts +3 -0
  106. package/dist/types/test/helpers/test-token/TestERC721Token.d.ts +715 -0
  107. package/dist/types/test/helpers/test-token/TestERC721Token__factory.d.ts +1043 -0
  108. package/dist/types/test/helpers/test-token/common.d.ts +50 -0
  109. package/dist/types/test/helpers/test-token/index.d.ts +2 -0
  110. package/dist/types/test/helpers/token.d.ts +1 -0
  111. package/dist/types/test/list.e2e.d.ts +1 -0
  112. package/dist/types/typechain/types/ImmutableERC721Base.d.ts +486 -0
  113. package/dist/types/typechain/types/common.d.ts +50 -0
  114. package/dist/types/typechain/types/factories/ImmutableERC721Base__factory.d.ts +688 -0
  115. package/dist/types/typechain/types/factories/index.d.ts +1 -0
  116. package/dist/types/typechain/types/index.d.ts +3 -0
  117. package/dist/types/types.d.ts +367 -0
  118. package/dist/types/utils.d.ts +1 -0
  119. package/package.json +73 -0
@@ -0,0 +1,36 @@
1
+ import type { Fee } from './Fee';
2
+ import type { Item } from './Item';
3
+ import type { ProtocolData } from './ProtocolData';
4
+ export type CreateListingRequestBody = {
5
+ account_address: string;
6
+ order_hash: string;
7
+ /**
8
+ * Buy item for listing should either be NATIVE or ERC20 item
9
+ */
10
+ buy: Array<Item>;
11
+ /**
12
+ * Buy fees should only include maker marketplace fees and should be no more than two entries as more entires will incur more gas. It is best practice to have this as few as possible.
13
+ */
14
+ fees: Array<Fee>;
15
+ /**
16
+ * Time after which the Order is considered expired
17
+ */
18
+ end_at: string;
19
+ protocol_data: ProtocolData;
20
+ /**
21
+ * A random value added to the create Order request
22
+ */
23
+ salt: string;
24
+ /**
25
+ * Sell item for listing should be an ERC721 item
26
+ */
27
+ sell: Array<Item>;
28
+ /**
29
+ * Digital signature generated by the user for the specific Order
30
+ */
31
+ signature: string;
32
+ /**
33
+ * Time after which Order is considered active
34
+ */
35
+ start_at: string;
36
+ };
@@ -0,0 +1,14 @@
1
+ export type ERC1155CollectionItem = {
2
+ /**
3
+ * Token type user is offering, which in this case is ERC1155
4
+ */
5
+ type: 'ERC1155_COLLECTION';
6
+ /**
7
+ * Address of ERC1155 collection
8
+ */
9
+ contract_address: string;
10
+ /**
11
+ * A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).
12
+ */
13
+ amount: string;
14
+ };
@@ -0,0 +1,18 @@
1
+ export type ERC1155Item = {
2
+ /**
3
+ * Token type user is offering, which in this case is ERC1155
4
+ */
5
+ type: 'ERC1155';
6
+ /**
7
+ * Address of ERC1155 token
8
+ */
9
+ contract_address: string;
10
+ /**
11
+ * ID of ERC1155 token
12
+ */
13
+ token_id: string;
14
+ /**
15
+ * A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).
16
+ */
17
+ amount: string;
18
+ };
@@ -0,0 +1,14 @@
1
+ export type ERC20Item = {
2
+ /**
3
+ * Token type user is offering, which in this case is ERC20
4
+ */
5
+ type: 'ERC20';
6
+ /**
7
+ * Address of ERC20 token
8
+ */
9
+ contract_address: string;
10
+ /**
11
+ * A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).
12
+ */
13
+ amount: string;
14
+ };
@@ -0,0 +1,14 @@
1
+ export type ERC721CollectionItem = {
2
+ /**
3
+ * Token type user is offering, which in this case is ERC721
4
+ */
5
+ type: 'ERC721_COLLECTION';
6
+ /**
7
+ * Address of ERC721 collection
8
+ */
9
+ contract_address: string;
10
+ /**
11
+ * A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).
12
+ */
13
+ amount: string;
14
+ };
@@ -0,0 +1,14 @@
1
+ export type ERC721Item = {
2
+ /**
3
+ * Token type user is offering, which in this case is ERC721
4
+ */
5
+ type: 'ERC721';
6
+ /**
7
+ * Address of ERC721 token
8
+ */
9
+ contract_address: string;
10
+ /**
11
+ * ID of ERC721 token
12
+ */
13
+ token_id: string;
14
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Resource not found
3
+ */
4
+ export type Error = {
5
+ /**
6
+ * Error trace id
7
+ */
8
+ id?: string;
9
+ /**
10
+ * Error message
11
+ */
12
+ message: string;
13
+ };
@@ -0,0 +1,6 @@
1
+ export type ExpiredOrderStatus = {
2
+ /**
3
+ * A terminal order status indicating that an order cannot be fulfilled due to expiry.
4
+ */
5
+ name: 'EXPIRED';
6
+ };
@@ -0,0 +1,18 @@
1
+ export type FailedOrderCancellation = {
2
+ /**
3
+ * ID of the order which failed to be cancelled
4
+ */
5
+ order: string;
6
+ /**
7
+ * Reason code indicating why the order failed to be cancelled
8
+ */
9
+ reason_code: FailedOrderCancellation.reason_code;
10
+ };
11
+ export declare namespace FailedOrderCancellation {
12
+ /**
13
+ * Reason code indicating why the order failed to be cancelled
14
+ */
15
+ enum reason_code {
16
+ FILLED = "FILLED"
17
+ }
18
+ }
@@ -0,0 +1,25 @@
1
+ export type Fee = {
2
+ /**
3
+ * Fee payable to recipient upon settlement
4
+ */
5
+ amount: string;
6
+ /**
7
+ * Fee type
8
+ */
9
+ type: Fee.type;
10
+ /**
11
+ * Wallet address of fee recipient
12
+ */
13
+ recipient_address: string;
14
+ };
15
+ export declare namespace Fee {
16
+ /**
17
+ * Fee type
18
+ */
19
+ enum type {
20
+ ROYALTY = "ROYALTY",
21
+ MAKER_ECOSYSTEM = "MAKER_ECOSYSTEM",
22
+ TAKER_ECOSYSTEM = "TAKER_ECOSYSTEM",
23
+ PROTOCOL = "PROTOCOL"
24
+ }
25
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The ratio of the order that has been filled, an order that has been fully filled will have the same numerator and denominator values.
3
+ */
4
+ export type FillStatus = {
5
+ /**
6
+ * The numerator of the fill status
7
+ */
8
+ numerator: string;
9
+ /**
10
+ * The denominator of the fill status
11
+ */
12
+ denominator: string;
13
+ };
@@ -0,0 +1,6 @@
1
+ export type FilledOrderStatus = {
2
+ /**
3
+ * A terminal order status indicating that an order has been fulfilled.
4
+ */
5
+ name: 'FILLED';
6
+ };
@@ -0,0 +1,9 @@
1
+ import type { Order } from './Order';
2
+ export type FulfillableOrder = {
3
+ order: Order;
4
+ /**
5
+ * Token ID for the ERC721 or ERC1155 token when fulfilling a collection order
6
+ */
7
+ token_id?: string;
8
+ extra_data: string;
9
+ };
@@ -0,0 +1,13 @@
1
+ import type { Fee } from './Fee';
2
+ export type FulfillmentDataRequest = {
3
+ order_id: string;
4
+ /**
5
+ * Address of the intended account fulfilling the order
6
+ */
7
+ taker_address: string;
8
+ fees: Array<Fee>;
9
+ /**
10
+ * Token ID for the ERC721 or ERC1155 token when fulfilling a collection order
11
+ */
12
+ token_id?: string;
13
+ };
@@ -0,0 +1,14 @@
1
+ export type InactiveOrderStatus = {
2
+ /**
3
+ * The order status that indicates an order cannot be fulfilled.
4
+ */
5
+ name: 'INACTIVE';
6
+ /**
7
+ * Whether the order offerer has sufficient approvals
8
+ */
9
+ sufficient_approvals: boolean;
10
+ /**
11
+ * Whether the order offerer still has sufficient balance to complete the order
12
+ */
13
+ sufficient_balances: boolean;
14
+ };
@@ -0,0 +1,7 @@
1
+ import type { ERC1155CollectionItem } from './ERC1155CollectionItem';
2
+ import type { ERC1155Item } from './ERC1155Item';
3
+ import type { ERC20Item } from './ERC20Item';
4
+ import type { ERC721CollectionItem } from './ERC721CollectionItem';
5
+ import type { ERC721Item } from './ERC721Item';
6
+ import type { NativeItem } from './NativeItem';
7
+ export type Item = (NativeItem | ERC20Item | ERC721Item | ERC1155Item | ERC721CollectionItem | ERC1155CollectionItem);
@@ -0,0 +1,6 @@
1
+ import type { Order } from './Order';
2
+ import type { Page } from './Page';
3
+ export type ListBidsResult = {
4
+ page: Page;
5
+ result: Array<Order>;
6
+ };
@@ -0,0 +1,6 @@
1
+ import type { Order } from './Order';
2
+ import type { Page } from './Page';
3
+ export type ListCollectionBidsResult = {
4
+ page: Page;
5
+ result: Array<Order>;
6
+ };
@@ -0,0 +1,6 @@
1
+ import type { Order } from './Order';
2
+ import type { Page } from './Page';
3
+ export type ListListingsResult = {
4
+ page: Page;
5
+ result: Array<Order>;
6
+ };
@@ -0,0 +1,6 @@
1
+ import type { Page } from './Page';
2
+ import type { Trade } from './Trade';
3
+ export type ListTradeResult = {
4
+ page: Page;
5
+ result: Array<Trade>;
6
+ };
@@ -0,0 +1,4 @@
1
+ import type { Order } from './Order';
2
+ export type ListingResult = {
3
+ result: Order;
4
+ };
@@ -0,0 +1,10 @@
1
+ export type NativeItem = {
2
+ /**
3
+ * Token type user is offering, which in this case is the native IMX token
4
+ */
5
+ type: 'NATIVE';
6
+ /**
7
+ * A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).
8
+ */
9
+ amount: string;
10
+ };
@@ -0,0 +1,59 @@
1
+ import type { Chain } from './Chain';
2
+ import type { Fee } from './Fee';
3
+ import type { FillStatus } from './FillStatus';
4
+ import type { Item } from './Item';
5
+ import type { OrderStatus } from './OrderStatus';
6
+ import type { ProtocolData } from './ProtocolData';
7
+ export type Order = {
8
+ account_address: string;
9
+ buy: Array<Item>;
10
+ fees: Array<Fee>;
11
+ chain: Chain;
12
+ /**
13
+ * Time the Order is created
14
+ */
15
+ created_at: string;
16
+ /**
17
+ * Time after which the Order is considered expired
18
+ */
19
+ end_at: string;
20
+ /**
21
+ * Global Order identifier
22
+ */
23
+ id: string;
24
+ order_hash: string;
25
+ protocol_data: ProtocolData;
26
+ /**
27
+ * A random value added to the create Order request
28
+ */
29
+ salt: string;
30
+ sell: Array<Item>;
31
+ /**
32
+ * Digital signature generated by the user for the specific Order
33
+ */
34
+ signature: string;
35
+ /**
36
+ * Time after which Order is considered active
37
+ */
38
+ start_at: string;
39
+ status: OrderStatus;
40
+ /**
41
+ * Order type
42
+ */
43
+ type: Order.type;
44
+ /**
45
+ * Time the Order is last updated
46
+ */
47
+ updated_at: string;
48
+ fill_status: FillStatus;
49
+ };
50
+ export declare namespace Order {
51
+ /**
52
+ * Order type
53
+ */
54
+ enum type {
55
+ LISTING = "LISTING",
56
+ BID = "BID",
57
+ COLLECTION_BID = "COLLECTION_BID"
58
+ }
59
+ }
@@ -0,0 +1,10 @@
1
+ import type { ActiveOrderStatus } from './ActiveOrderStatus';
2
+ import type { CancelledOrderStatus } from './CancelledOrderStatus';
3
+ import type { ExpiredOrderStatus } from './ExpiredOrderStatus';
4
+ import type { FilledOrderStatus } from './FilledOrderStatus';
5
+ import type { InactiveOrderStatus } from './InactiveOrderStatus';
6
+ import type { PendingOrderStatus } from './PendingOrderStatus';
7
+ /**
8
+ * The Order status
9
+ */
10
+ export type OrderStatus = (CancelledOrderStatus | PendingOrderStatus | ActiveOrderStatus | InactiveOrderStatus | FilledOrderStatus | ExpiredOrderStatus);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The Order status
3
+ */
4
+ export declare enum OrderStatusName {
5
+ PENDING = "PENDING",
6
+ ACTIVE = "ACTIVE",
7
+ INACTIVE = "INACTIVE",
8
+ FILLED = "FILLED",
9
+ EXPIRED = "EXPIRED",
10
+ CANCELLED = "CANCELLED"
11
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Pagination properties
3
+ */
4
+ export type Page = {
5
+ /**
6
+ * First item as an encoded string
7
+ */
8
+ previous_cursor: string | null;
9
+ /**
10
+ * Last item as an encoded string
11
+ */
12
+ next_cursor: string | null;
13
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
3
+ */
4
+ export type PageCursor = string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Maximum number of items to return
3
+ */
4
+ export type PageSize = number;
@@ -0,0 +1,14 @@
1
+ export type PendingOrderStatus = {
2
+ /**
3
+ * The order status that indicates the order is yet to be active due to various reasons.
4
+ */
5
+ name: 'PENDING';
6
+ /**
7
+ * Whether the order has been evaluated after its creation
8
+ */
9
+ evaluated: boolean;
10
+ /**
11
+ * Whether the order has reached its specified start time
12
+ */
13
+ started: boolean;
14
+ };
@@ -0,0 +1,31 @@
1
+ export type ProtocolData = {
2
+ /**
3
+ * Seaport order type. Orders containing ERC721 tokens will need to pass in the order type as FULL_RESTRICTED while orders with ERC1155 tokens will need to pass in the order_type as PARTIAL_RESTRICTED
4
+ */
5
+ order_type: ProtocolData.order_type;
6
+ /**
7
+ * big.Int or uint256 string for order counter
8
+ */
9
+ counter: string;
10
+ /**
11
+ * Immutable zone address
12
+ */
13
+ zone_address: string;
14
+ /**
15
+ * Immutable Seaport contract address
16
+ */
17
+ seaport_address: string;
18
+ /**
19
+ * Immutable Seaport contract version
20
+ */
21
+ seaport_version: string;
22
+ };
23
+ export declare namespace ProtocolData {
24
+ /**
25
+ * Seaport order type. Orders containing ERC721 tokens will need to pass in the order type as FULL_RESTRICTED while orders with ERC1155 tokens will need to pass in the order_type as PARTIAL_RESTRICTED
26
+ */
27
+ enum order_type {
28
+ FULL_RESTRICTED = "FULL_RESTRICTED",
29
+ PARTIAL_RESTRICTED = "PARTIAL_RESTRICTED"
30
+ }
31
+ }
@@ -0,0 +1,40 @@
1
+ import type { Chain } from './Chain';
2
+ import type { Fee } from './Fee';
3
+ import type { Item } from './Item';
4
+ import type { TradeBlockchainMetadata } from './TradeBlockchainMetadata';
5
+ export type Trade = {
6
+ /**
7
+ * Buy items are transferred from the taker to the maker.
8
+ */
9
+ buy: Array<Item>;
10
+ /**
11
+ * Deprecated. Use maker and taker addresses instead of buyer and seller addresses.
12
+ */
13
+ buyer_address: string;
14
+ /**
15
+ * Deprecated. Use fees instead. The taker always pays the fees.
16
+ */
17
+ buyer_fees: Array<Fee>;
18
+ fees: Array<Fee>;
19
+ chain: Chain;
20
+ order_id: string;
21
+ blockchain_metadata: TradeBlockchainMetadata;
22
+ /**
23
+ * Time the on-chain trade event is indexed by the order book system
24
+ */
25
+ indexed_at: string;
26
+ /**
27
+ * Global Trade identifier
28
+ */
29
+ id: string;
30
+ /**
31
+ * Sell items are transferred from the maker to the taker.
32
+ */
33
+ sell: Array<Item>;
34
+ /**
35
+ * Deprecated. Use maker and taker addresses instead of buyer and seller addresses.
36
+ */
37
+ seller_address: string;
38
+ maker_address: string;
39
+ taker_address: string;
40
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The metadata related to the transaction in which the activity occurred
3
+ */
4
+ export type TradeBlockchainMetadata = {
5
+ /**
6
+ * The transaction hash of the trade
7
+ */
8
+ transaction_hash: string;
9
+ /**
10
+ * EVM block number (uint64 as string)
11
+ */
12
+ block_number: string;
13
+ /**
14
+ * Transaction index in a block (uint32 as string)
15
+ */
16
+ transaction_index: string;
17
+ /**
18
+ * The log index of the fulfillment event in a block (uint32 as string)
19
+ */
20
+ log_index: string;
21
+ };
@@ -0,0 +1,4 @@
1
+ import type { Trade } from './Trade';
2
+ export type TradeResult = {
3
+ result: Trade;
4
+ };
@@ -0,0 +1,14 @@
1
+ export type UnfulfillableOrder = {
2
+ /**
3
+ * OrderID for the requested but unfulfillable order
4
+ */
5
+ order_id: string;
6
+ /**
7
+ * Token ID for the ERC721 or ERC1155 token when fulfilling a collection order
8
+ */
9
+ token_id?: string;
10
+ /**
11
+ * Nullable string containing error reason if the signing is unsuccessful for the order
12
+ */
13
+ reason: string;
14
+ };