@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,38 @@
1
+ import type { InputCriteria } from '@opensea/seaport-js/lib/types';
2
+ import { JsonRpcProvider } from 'ethers';
3
+ import { Order as OpenApiOrder } from '../openapi/sdk';
4
+ import { Action, ERC1155CollectionItem, ERC1155Item, ERC20Item, ERC721CollectionItem, ERC721Item, FulfillOrderResponse, NativeItem, PrepareBulkSeaportOrders, PrepareOrderResponse, TransactionAction } from '../types';
5
+ import { SeaportLibFactory } from './seaport-lib-factory';
6
+ export declare class Seaport {
7
+ private seaportLibFactory;
8
+ private provider;
9
+ private seaportContractAddress;
10
+ private zoneContractAddress;
11
+ private rateLimitingKey?;
12
+ constructor(seaportLibFactory: SeaportLibFactory, provider: JsonRpcProvider, seaportContractAddress: string, zoneContractAddress: string, rateLimitingKey?: string | undefined);
13
+ prepareBulkSeaportOrders(offerer: string, orderInputs: {
14
+ offerItem: ERC20Item | ERC721Item | ERC1155Item;
15
+ considerationItem: NativeItem | ERC20Item | ERC721Item | ERC1155Item | ERC721CollectionItem | ERC1155CollectionItem;
16
+ allowPartialFills: boolean;
17
+ orderStart: Date;
18
+ orderExpiry: Date;
19
+ }[]): Promise<PrepareBulkSeaportOrders>;
20
+ prepareSeaportOrder(offerer: string, offerItem: ERC20Item | ERC721Item | ERC1155Item, considerationItem: NativeItem | ERC20Item | ERC721Item | ERC1155Item | ERC721CollectionItem | ERC1155CollectionItem, allowPartialFills: boolean, orderStart: Date, orderExpiry: Date): Promise<PrepareOrderResponse>;
21
+ fulfillOrder(order: OpenApiOrder, account: string, extraData: string, unitsToFill?: string, considerationCriteria?: InputCriteria[]): Promise<FulfillOrderResponse>;
22
+ fulfillBulkOrders(fulfillingOrders: {
23
+ extraData: string;
24
+ order: OpenApiOrder;
25
+ unitsToFill?: string;
26
+ considerationCriteria?: InputCriteria[];
27
+ }[], account: string): Promise<{
28
+ actions: Action[];
29
+ expiration: string;
30
+ }>;
31
+ cancelOrders(orders: OpenApiOrder[], account: string): Promise<TransactionAction>;
32
+ private createSeaportOrders;
33
+ private createSeaportOrder;
34
+ private getTypedDataFromBulkOrderComponents;
35
+ private getTypedDataFromOrderComponents;
36
+ private getSeaportLib;
37
+ private static getExpirationISOTimeFromExtraData;
38
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { TransactionMethods } from '@opensea/seaport-js/lib/utils/usecase';
2
+ import { TransactionBuilder } from '../types';
3
+ export declare function prepareTransaction(transactionMethods: TransactionMethods, chainId: bigint, callerAddress: string): TransactionBuilder;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { Wallet } from 'ethers';
2
+ import { Action } from '../../types';
3
+ export declare function actionAll(actions: Action[], wallet: Wallet): Promise<string[]>;
@@ -0,0 +1,2 @@
1
+ import { OrderbookModuleConfiguration } from '../../config';
2
+ export declare function getConfigFromEnv(): OrderbookModuleConfiguration;
@@ -0,0 +1,6 @@
1
+ import { Wallet } from 'ethers';
2
+ import { TestERC721Token } from './test-token';
3
+ export interface TestTokenContract {
4
+ contract: TestERC721Token;
5
+ }
6
+ export declare function deployTestToken(deployer: Wallet, royaltyAddress?: string): Promise<TestTokenContract>;
@@ -0,0 +1,4 @@
1
+ export declare const GAS_OVERRIDES: {
2
+ maxFeePerGas: bigint;
3
+ maxPriorityFeePerGas: bigint;
4
+ };
@@ -0,0 +1,8 @@
1
+ export * from './config';
2
+ export * from './erc721';
3
+ export * from './order';
4
+ export * from './provider';
5
+ export * from './sign-and-submit';
6
+ export * from './signers';
7
+ export * from './test-token';
8
+ export * from './token';
@@ -0,0 +1,3 @@
1
+ import { Orderbook } from '../../orderbook';
2
+ import { Order, OrderStatusName } from '../../types';
3
+ export declare function waitForOrderToBeOfStatus(sdk: Orderbook, orderId: string, status: OrderStatusName, attemps?: number): Promise<Order>;
@@ -0,0 +1,2 @@
1
+ import { JsonRpcProvider } from 'ethers';
2
+ export declare function getLocalhostProvider(): JsonRpcProvider;
@@ -0,0 +1,7 @@
1
+ import { PreparedTransactionRequest, Signer, TypedDataDomain, Wallet } from 'ethers';
2
+ export declare function signAndSubmitTx(transaction: PreparedTransactionRequest, signer: Signer): Promise<void>;
3
+ export declare function signMessage({ domain, types, value, }: {
4
+ domain: TypedDataDomain;
5
+ types: any;
6
+ value: Record<string, any>;
7
+ }, signer: Wallet): Promise<string>;
@@ -0,0 +1,3 @@
1
+ import { Provider, Wallet } from 'ethers';
2
+ export declare function getOffererWallet(provider: Provider): Wallet;
3
+ export declare function getFulfillerWallet(provider: Provider): Wallet;