@imtbl/sdk 0.8.0-alpha → 0.9.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.
@@ -1,271 +0,0 @@
1
- import { OrderbookOverrides } from 'config/config';
2
- import { ListingResult, ListListingsResult, OrdersService } from 'openapi/sdk';
3
- import { ListListingsParams as ListListingsParams$1, PrepareListingParams as PrepareListingParams$1, PrepareListingResponse as PrepareListingResponse$1, CreateListingParams as CreateListingParams$1, FulfillOrderResponse as FulfillOrderResponse$1, CancelOrderResponse as CancelOrderResponse$1 } from 'types';
4
-
5
- declare enum Environment {
6
- PRODUCTION = "production",
7
- SANDBOX = "sandbox"
8
- }
9
- declare class ImmutableConfiguration {
10
- readonly environment: Environment;
11
- readonly apiKey?: string;
12
- constructor(options: {
13
- environment: Environment;
14
- apiKey?: string;
15
- });
16
- }
17
- interface ModuleConfiguration<T> {
18
- baseConfig: ImmutableConfiguration;
19
- overrides?: T;
20
- }
21
-
22
- /**
23
- * zkEVM orderbook SDK
24
- * @constructor
25
- * @param {OrderbookModuleConfiguration} config - Configuration for Immutable services.
26
- */
27
- declare class Orderbook {
28
- private apiClient;
29
- private seaport;
30
- private orderbookConfig;
31
- constructor(config: ModuleConfiguration<OrderbookOverrides>);
32
- /**
33
- * Get an order by ID
34
- * @param {string} listingId - The listingId to find.
35
- * @return {ListingResult} The returned order result.
36
- */
37
- getListing(listingId: string): Promise<ListingResult>;
38
- /**
39
- * List orders. This method is used to get a list of orders filtered by conditions specified
40
- * in the params object.
41
- * @param {ListOrderParams} listOrderParams - Filtering, ordering and page parameters.
42
- * @return {Orders} The paged orders.
43
- */
44
- listListings(listOrderParams: ListListingsParams$1): Promise<ListListingsResult>;
45
- /**
46
- * Get required transactions and messages for signing prior to creating a listing
47
- * through the createListing method
48
- * @param {PrepareListingParams} prepareListingParams - Details about the listing to be created.
49
- * @return {PrepareListingResponse} PrepareListingResponse includes
50
- * the unsigned approval transaction, the typed order message for signing and
51
- * the order components that can be submitted to `createListing` with a signature.
52
- */
53
- prepareListing({ makerAddress, sell, buy, orderExpiry, }: PrepareListingParams$1): Promise<PrepareListingResponse$1>;
54
- /**
55
- * Create an order
56
- * @param {CreateListingParams} createListingParams - create an order with the given params.
57
- * @return {ListingResult} The result of the order created in the Immutable services.
58
- */
59
- createListing(createListingParams: CreateListingParams$1): Promise<ListingResult>;
60
- /**
61
- * Get unsigned transactions that can be submitted to fulfil an open order. If the approval
62
- * transaction exists it must be signed and submitted to the chain before the fulfilment
63
- * transaction can be submitted or it will be reverted.
64
- * @param {string} listingId - The listingId to fulfil.
65
- * @param {string} fulfillerAddress - The address of the account fulfilling the order.
66
- * @return {FulfillOrderResponse} Approval and fulfilment transactions.
67
- */
68
- fulfillOrder(listingId: string, takerAddress: string): Promise<FulfillOrderResponse$1>;
69
- /**
70
- * Get an unsigned cancel order transaction. Orders can only be cancelled by
71
- * the account that created them.
72
- * @param {string} listingId - The listingId to cancel.
73
- * @param {string} accountAddress - The address of the account cancelling the order.
74
- * @return {CancelOrderResponse} The unsigned cancel order transaction
75
- */
76
- cancelOrder(listingId: string, accountAddress: string): Promise<CancelOrderResponse$1>;
77
- }
78
-
79
- declare type Bytes = ArrayLike<number>;
80
- declare type BytesLike = Bytes | string;
81
- interface Hexable {
82
- toHexString(): string;
83
- }
84
-
85
- declare type BigNumberish = BigNumber | Bytes | bigint | string | number;
86
- declare class BigNumber implements Hexable {
87
- readonly _hex: string;
88
- readonly _isBigNumber: boolean;
89
- constructor(constructorGuard: any, hex: string);
90
- fromTwos(value: number): BigNumber;
91
- toTwos(value: number): BigNumber;
92
- abs(): BigNumber;
93
- add(other: BigNumberish): BigNumber;
94
- sub(other: BigNumberish): BigNumber;
95
- div(other: BigNumberish): BigNumber;
96
- mul(other: BigNumberish): BigNumber;
97
- mod(other: BigNumberish): BigNumber;
98
- pow(other: BigNumberish): BigNumber;
99
- and(other: BigNumberish): BigNumber;
100
- or(other: BigNumberish): BigNumber;
101
- xor(other: BigNumberish): BigNumber;
102
- mask(value: number): BigNumber;
103
- shl(value: number): BigNumber;
104
- shr(value: number): BigNumber;
105
- eq(other: BigNumberish): boolean;
106
- lt(other: BigNumberish): boolean;
107
- lte(other: BigNumberish): boolean;
108
- gt(other: BigNumberish): boolean;
109
- gte(other: BigNumberish): boolean;
110
- isNegative(): boolean;
111
- isZero(): boolean;
112
- toNumber(): number;
113
- toBigInt(): bigint;
114
- toString(): string;
115
- toHexString(): string;
116
- toJSON(key?: string): any;
117
- static from(value: any): BigNumber;
118
- static isBigNumber(value: any): value is BigNumber;
119
- }
120
-
121
- declare type AccessList = Array<{
122
- address: string;
123
- storageKeys: Array<string>;
124
- }>;
125
-
126
- interface TypedDataDomain {
127
- name?: string;
128
- version?: string;
129
- chainId?: BigNumberish;
130
- verifyingContract?: string;
131
- salt?: BytesLike;
132
- }
133
- interface TypedDataField {
134
- name: string;
135
- type: string;
136
- }
137
-
138
- interface PopulatedTransaction {
139
- to?: string;
140
- from?: string;
141
- nonce?: number;
142
- gasLimit?: BigNumber;
143
- gasPrice?: BigNumber;
144
- data?: string;
145
- value?: BigNumber;
146
- chainId?: number;
147
- type?: number;
148
- accessList?: AccessList;
149
- maxFeePerGas?: BigNumber;
150
- maxPriorityFeePerGas?: BigNumber;
151
- customData?: Record<string, any>;
152
- ccipReadEnabled?: boolean;
153
- }
154
-
155
- declare enum OrderType {
156
- FULL_OPEN = 0,
157
- PARTIAL_OPEN = 1,
158
- FULL_RESTRICTED = 2,
159
- PARTIAL_RESTRICTED = 3
160
- }
161
- declare enum ItemType {
162
- NATIVE = 0,
163
- ERC20 = 1,
164
- ERC721 = 2,
165
- ERC1155 = 3,
166
- ERC721_WITH_CRITERIA = 4,
167
- ERC1155_WITH_CRITERIA = 5
168
- }
169
-
170
- type OfferItem = {
171
- itemType: ItemType;
172
- token: string;
173
- identifierOrCriteria: string;
174
- startAmount: string;
175
- endAmount: string;
176
- };
177
- type ConsiderationItem = {
178
- itemType: ItemType;
179
- token: string;
180
- identifierOrCriteria: string;
181
- startAmount: string;
182
- endAmount: string;
183
- recipient: string;
184
- };
185
- type OrderParameters = {
186
- offerer: string;
187
- zone: string;
188
- orderType: OrderType;
189
- startTime: BigNumberish;
190
- endTime: BigNumberish;
191
- zoneHash: string;
192
- salt: string;
193
- offer: OfferItem[];
194
- consideration: ConsiderationItem[];
195
- totalOriginalConsiderationItems: BigNumberish;
196
- conduitKey: string;
197
- };
198
- type OrderComponents = OrderParameters & {
199
- counter: BigNumberish;
200
- };
201
-
202
- interface ERC721Item {
203
- type: 'ERC721';
204
- contractAddress: string;
205
- tokenId: string;
206
- }
207
- interface ERC20Item {
208
- type: 'ERC20';
209
- contractAddress: string;
210
- amount: string;
211
- }
212
- interface NativeItem {
213
- type: 'NATIVE';
214
- amount: string;
215
- }
216
- interface RoyaltyInfo {
217
- recipient: string;
218
- amountRequired: string;
219
- }
220
- interface PrepareListingParams {
221
- makerAddress: string;
222
- sell: ERC721Item;
223
- buy: ERC20Item | NativeItem;
224
- orderExpiry?: Date;
225
- }
226
- interface PrepareListingResponse {
227
- actions: Action[];
228
- orderComponents: OrderComponents;
229
- orderHash: string;
230
- }
231
- interface CreateListingParams {
232
- orderComponents: OrderComponents;
233
- orderHash: string;
234
- orderSignature: string;
235
- }
236
- type ListListingsParams = Omit<Parameters<typeof OrdersService.prototype.listListings>[0], 'chainName'>;
237
- declare enum TransactionPurpose {
238
- APPROVAL = "APPROVAL",
239
- FULFILL_ORDER = "FULFILL_ORDER"
240
- }
241
- declare enum SignablePurpose {
242
- CREATE_LISTING = "CREATE_LISTING"
243
- }
244
- declare enum ActionType {
245
- TRANSACTION = "TRANSACTION",
246
- SIGNABLE = "SIGNABLE"
247
- }
248
- type TransactionBuilder = () => Promise<PopulatedTransaction>;
249
- interface TransactionAction {
250
- type: ActionType.TRANSACTION;
251
- purpose: TransactionPurpose;
252
- buildTransaction: TransactionBuilder;
253
- }
254
- interface SignableAction {
255
- type: ActionType.SIGNABLE;
256
- purpose: SignablePurpose;
257
- message: {
258
- domain: TypedDataDomain;
259
- types: Record<string, TypedDataField[]>;
260
- value: Record<string, any>;
261
- };
262
- }
263
- type Action = TransactionAction | SignableAction;
264
- interface FulfillOrderResponse {
265
- actions: Action[];
266
- }
267
- interface CancelOrderResponse {
268
- unsignedCancelOrderTransaction: PopulatedTransaction;
269
- }
270
-
271
- export { Action, ActionType, CancelOrderResponse, CreateListingParams, ERC20Item, ERC721Item, FulfillOrderResponse, ListListingsParams, NativeItem, Orderbook, PrepareListingParams, PrepareListingResponse, RoyaltyInfo, SignableAction, SignablePurpose, TransactionAction, TransactionBuilder, TransactionPurpose };