@imtbl/sdk 0.13.1-alpha → 0.13.1-alpha.1
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.
- package/dist/blockchain_data.js +1 -1
- package/dist/browser/checkout.js +2 -2
- package/dist/checkout_sdk.js +119 -6
- package/dist/checkout_widgets.js +1 -1
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +8 -8
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +125 -10
- package/dist/index.d.ts +509 -91
- package/dist/index.js +125 -10
- package/dist/orderbook.d.ts +963 -71
- package/dist/orderbook.js +20 -3
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference path="global.d.ts" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import { BlockchainDataConfiguration, BlockchainDataModuleConfiguration as BlockchainDataModuleConfiguration$1, ProviderConfiguration as ProviderConfiguration$1, ExchangeContracts } from 'config';
|
|
4
|
-
import { OrderbookOverrides, OrderbookModuleConfiguration } from 'config/config';
|
|
5
|
-
import { ListingResult, ListListingsResult, Fee as Fee$1, OrdersService } from 'openapi/sdk';
|
|
6
|
-
import { ListListingsParams as ListListingsParams$1, PrepareListingParams as PrepareListingParams$1, PrepareListingResponse as PrepareListingResponse$1, CreateListingParams as CreateListingParams$1, FulfillOrderResponse as FulfillOrderResponse$1, CancelOrderResponse as CancelOrderResponse$2 } from 'types';
|
|
7
4
|
|
|
8
5
|
declare enum Environment {
|
|
9
6
|
PRODUCTION = "production",
|
|
@@ -682,7 +679,7 @@ interface BlockchainMetadata {
|
|
|
682
679
|
* @export
|
|
683
680
|
* @interface Chain
|
|
684
681
|
*/
|
|
685
|
-
interface Chain {
|
|
682
|
+
interface Chain$1 {
|
|
686
683
|
/**
|
|
687
684
|
* The id of chain
|
|
688
685
|
* @type {string}
|
|
@@ -726,7 +723,7 @@ interface Activity {
|
|
|
726
723
|
* @type {Chain}
|
|
727
724
|
* @memberof Activity
|
|
728
725
|
*/
|
|
729
|
-
'chain': Chain;
|
|
726
|
+
'chain': Chain$1;
|
|
730
727
|
/**
|
|
731
728
|
*
|
|
732
729
|
* @type {ActivityType}
|
|
@@ -794,7 +791,7 @@ interface ChainWithDetailsAllOf {
|
|
|
794
791
|
* @type ChainWithDetails
|
|
795
792
|
* @export
|
|
796
793
|
*/
|
|
797
|
-
type ChainWithDetails = Chain & ChainWithDetailsAllOf;
|
|
794
|
+
type ChainWithDetails = Chain$1 & ChainWithDetailsAllOf;
|
|
798
795
|
|
|
799
796
|
/**
|
|
800
797
|
* Immutable zkEVM API
|
|
@@ -840,7 +837,7 @@ interface Collection$1 {
|
|
|
840
837
|
* @type {Chain}
|
|
841
838
|
* @memberof Collection
|
|
842
839
|
*/
|
|
843
|
-
'chain': Chain;
|
|
840
|
+
'chain': Chain$1;
|
|
844
841
|
/**
|
|
845
842
|
* The name of the collection
|
|
846
843
|
* @type {string}
|
|
@@ -990,7 +987,7 @@ interface NFT {
|
|
|
990
987
|
* @type {Chain}
|
|
991
988
|
* @memberof NFT
|
|
992
989
|
*/
|
|
993
|
-
'chain': Chain;
|
|
990
|
+
'chain': Chain$1;
|
|
994
991
|
/**
|
|
995
992
|
* An `uint256` token id as string
|
|
996
993
|
* @type {string}
|
|
@@ -1203,7 +1200,7 @@ interface Token$1 {
|
|
|
1203
1200
|
* @type {Chain}
|
|
1204
1201
|
* @memberof Token
|
|
1205
1202
|
*/
|
|
1206
|
-
'chain': Chain;
|
|
1203
|
+
'chain': Chain$1;
|
|
1207
1204
|
/**
|
|
1208
1205
|
* The address of token contract
|
|
1209
1206
|
* @type {string}
|
|
@@ -1284,7 +1281,7 @@ interface GetTokenResult {
|
|
|
1284
1281
|
* @export
|
|
1285
1282
|
* @interface Page
|
|
1286
1283
|
*/
|
|
1287
|
-
interface Page {
|
|
1284
|
+
interface Page$1 {
|
|
1288
1285
|
/**
|
|
1289
1286
|
* First item as an encoded string
|
|
1290
1287
|
* @type {string}
|
|
@@ -1328,7 +1325,7 @@ interface ListActivitiesResult {
|
|
|
1328
1325
|
* @type {Page}
|
|
1329
1326
|
* @memberof ListActivitiesResult
|
|
1330
1327
|
*/
|
|
1331
|
-
'page': Page;
|
|
1328
|
+
'page': Page$1;
|
|
1332
1329
|
}
|
|
1333
1330
|
|
|
1334
1331
|
/**
|
|
@@ -1360,7 +1357,7 @@ interface ListChainsResult {
|
|
|
1360
1357
|
* @type {Page}
|
|
1361
1358
|
* @memberof ListChainsResult
|
|
1362
1359
|
*/
|
|
1363
|
-
'page': Page;
|
|
1360
|
+
'page': Page$1;
|
|
1364
1361
|
}
|
|
1365
1362
|
|
|
1366
1363
|
/**
|
|
@@ -1392,7 +1389,7 @@ interface ListCollectionsResult {
|
|
|
1392
1389
|
* @type {Page}
|
|
1393
1390
|
* @memberof ListCollectionsResult
|
|
1394
1391
|
*/
|
|
1395
|
-
'page': Page;
|
|
1392
|
+
'page': Page$1;
|
|
1396
1393
|
}
|
|
1397
1394
|
|
|
1398
1395
|
/**
|
|
@@ -1418,7 +1415,7 @@ interface NFTOwner {
|
|
|
1418
1415
|
* @type {Chain}
|
|
1419
1416
|
* @memberof NFTOwner
|
|
1420
1417
|
*/
|
|
1421
|
-
'chain': Chain;
|
|
1418
|
+
'chain': Chain$1;
|
|
1422
1419
|
/**
|
|
1423
1420
|
* The address of NFT contract
|
|
1424
1421
|
* @type {string}
|
|
@@ -1474,7 +1471,7 @@ interface ListNFTOwnersResult {
|
|
|
1474
1471
|
* @type {Page}
|
|
1475
1472
|
* @memberof ListNFTOwnersResult
|
|
1476
1473
|
*/
|
|
1477
|
-
'page': Page;
|
|
1474
|
+
'page': Page$1;
|
|
1478
1475
|
}
|
|
1479
1476
|
|
|
1480
1477
|
/**
|
|
@@ -1506,7 +1503,7 @@ interface ListNFTsResult {
|
|
|
1506
1503
|
* @type {Page}
|
|
1507
1504
|
* @memberof ListNFTsResult
|
|
1508
1505
|
*/
|
|
1509
|
-
'page': Page;
|
|
1506
|
+
'page': Page$1;
|
|
1510
1507
|
}
|
|
1511
1508
|
|
|
1512
1509
|
/**
|
|
@@ -1538,7 +1535,7 @@ interface ListTokensResult {
|
|
|
1538
1535
|
* @type {Page}
|
|
1539
1536
|
* @memberof ListTokensResult
|
|
1540
1537
|
*/
|
|
1541
|
-
'page': Page;
|
|
1538
|
+
'page': Page$1;
|
|
1542
1539
|
}
|
|
1543
1540
|
|
|
1544
1541
|
/**
|
|
@@ -2395,7 +2392,7 @@ interface Avatar {
|
|
|
2395
2392
|
content: string;
|
|
2396
2393
|
}>;
|
|
2397
2394
|
}
|
|
2398
|
-
declare class Resolver implements EnsResolver {
|
|
2395
|
+
declare class Resolver$1 implements EnsResolver {
|
|
2399
2396
|
readonly provider: BaseProvider;
|
|
2400
2397
|
readonly name: string;
|
|
2401
2398
|
readonly address: string;
|
|
@@ -2494,7 +2491,7 @@ declare class BaseProvider extends Provider$1 implements EnsProvider {
|
|
|
2494
2491
|
getLogs(filter: Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>): Promise<Array<Log>>;
|
|
2495
2492
|
getEtherPrice(): Promise<number>;
|
|
2496
2493
|
_getBlockTag(blockTag: BlockTag | Promise<BlockTag>): Promise<BlockTag>;
|
|
2497
|
-
getResolver(name: string): Promise<null | Resolver>;
|
|
2494
|
+
getResolver(name: string): Promise<null | Resolver$1>;
|
|
2498
2495
|
_getResolver(name: string, operation?: string): Promise<string>;
|
|
2499
2496
|
resolveName(name: string | Promise<string>): Promise<null | string>;
|
|
2500
2497
|
lookupAddress(address: string | Promise<string>): Promise<null | string>;
|
|
@@ -3451,7 +3448,7 @@ interface ApiRegisterPassportUserRequest {
|
|
|
3451
3448
|
* @export
|
|
3452
3449
|
* @interface Fee
|
|
3453
3450
|
*/
|
|
3454
|
-
interface Fee {
|
|
3451
|
+
interface Fee$2 {
|
|
3455
3452
|
/**
|
|
3456
3453
|
* Wallet address
|
|
3457
3454
|
* @type {string}
|
|
@@ -3544,7 +3541,7 @@ interface Asset {
|
|
|
3544
3541
|
* @type {Array<Fee>}
|
|
3545
3542
|
* @memberof Asset
|
|
3546
3543
|
*/
|
|
3547
|
-
'fees'?: Array<Fee>;
|
|
3544
|
+
'fees'?: Array<Fee$2>;
|
|
3548
3545
|
/**
|
|
3549
3546
|
* [DEPRECATED] Internal Immutable X Token ID
|
|
3550
3547
|
* @type {string}
|
|
@@ -3654,7 +3651,7 @@ interface AssetWithOrders {
|
|
|
3654
3651
|
* @type {Array<Fee>}
|
|
3655
3652
|
* @memberof AssetWithOrders
|
|
3656
3653
|
*/
|
|
3657
|
-
'fees'?: Array<Fee>;
|
|
3654
|
+
'fees'?: Array<Fee$2>;
|
|
3658
3655
|
/**
|
|
3659
3656
|
* [DEPRECATED] Internal Immutable X Token ID
|
|
3660
3657
|
* @type {string}
|
|
@@ -7086,7 +7083,7 @@ interface Mint$1 {
|
|
|
7086
7083
|
* @type {Array<Fee>}
|
|
7087
7084
|
* @memberof Mint
|
|
7088
7085
|
*/
|
|
7089
|
-
'fees'?: Array<Fee>;
|
|
7086
|
+
'fees'?: Array<Fee$2>;
|
|
7090
7087
|
/**
|
|
7091
7088
|
* Status of this mint
|
|
7092
7089
|
* @type {string}
|
|
@@ -7212,7 +7209,7 @@ declare type OrderSell = Token;
|
|
|
7212
7209
|
* @export
|
|
7213
7210
|
* @interface Order
|
|
7214
7211
|
*/
|
|
7215
|
-
interface Order {
|
|
7212
|
+
interface Order$1 {
|
|
7216
7213
|
/**
|
|
7217
7214
|
* Amount of the asset already sold by this order
|
|
7218
7215
|
* @type {string}
|
|
@@ -7310,7 +7307,7 @@ interface ListOrdersResponse {
|
|
|
7310
7307
|
* @type {Array<Order>}
|
|
7311
7308
|
* @memberof ListOrdersResponse
|
|
7312
7309
|
*/
|
|
7313
|
-
'result': Array<Order>;
|
|
7310
|
+
'result': Array<Order$1>;
|
|
7314
7311
|
}
|
|
7315
7312
|
|
|
7316
7313
|
/**
|
|
@@ -11082,7 +11079,7 @@ declare class OrdersApi extends BaseAPI {
|
|
|
11082
11079
|
* @throws {RequiredError}
|
|
11083
11080
|
* @memberof OrdersApi
|
|
11084
11081
|
*/
|
|
11085
|
-
getOrder(requestParameters: OrdersApiGetOrderRequest, options?: AxiosRequestConfig): Promise<AxiosResponse<Order, any>>;
|
|
11082
|
+
getOrder(requestParameters: OrdersApiGetOrderRequest, options?: AxiosRequestConfig): Promise<AxiosResponse<Order$1, any>>;
|
|
11086
11083
|
/**
|
|
11087
11084
|
* Get an order (V3)
|
|
11088
11085
|
* @summary Get an order (V3)
|
|
@@ -13048,71 +13045,20 @@ declare namespace passport_d {
|
|
|
13048
13045
|
};
|
|
13049
13046
|
}
|
|
13050
13047
|
|
|
13051
|
-
|
|
13052
|
-
|
|
13053
|
-
|
|
13054
|
-
|
|
13055
|
-
|
|
13056
|
-
|
|
13057
|
-
|
|
13058
|
-
|
|
13059
|
-
|
|
13060
|
-
|
|
13061
|
-
|
|
13062
|
-
|
|
13063
|
-
|
|
13064
|
-
*/
|
|
13065
|
-
config(): OrderbookModuleConfiguration;
|
|
13066
|
-
/**
|
|
13067
|
-
* Get an order by ID
|
|
13068
|
-
* @param {string} listingId - The listingId to find.
|
|
13069
|
-
* @return {ListingResult} The returned order result.
|
|
13070
|
-
*/
|
|
13071
|
-
getListing(listingId: string): Promise<ListingResult>;
|
|
13072
|
-
/**
|
|
13073
|
-
* List orders. This method is used to get a list of orders filtered by conditions specified
|
|
13074
|
-
* in the params object.
|
|
13075
|
-
* @param {ListListingsParams} listOrderParams - Filtering, ordering and page parameters.
|
|
13076
|
-
* @return {ListListingsResult} The paged orders.
|
|
13077
|
-
*/
|
|
13078
|
-
listListings(listOrderParams: ListListingsParams$1): Promise<ListListingsResult>;
|
|
13079
|
-
/**
|
|
13080
|
-
* Get required transactions and messages for signing prior to creating a listing
|
|
13081
|
-
* through the createListing method
|
|
13082
|
-
* @param {PrepareListingParams} prepareListingParams - Details about the listing to be created.
|
|
13083
|
-
* @return {PrepareListingResponse} PrepareListingResponse includes
|
|
13084
|
-
* the unsigned approval transaction, the typed order message for signing and
|
|
13085
|
-
* the order components that can be submitted to `createListing` with a signature.
|
|
13086
|
-
*/
|
|
13087
|
-
prepareListing({ makerAddress, sell, buy, orderExpiry, }: PrepareListingParams$1): Promise<PrepareListingResponse$1>;
|
|
13088
|
-
/**
|
|
13089
|
-
* Create an order
|
|
13090
|
-
* @param {CreateListingParams} createListingParams - create an order with the given params.
|
|
13091
|
-
* @return {ListingResult} The result of the order created in the Immutable services.
|
|
13092
|
-
*/
|
|
13093
|
-
createListing(createListingParams: CreateListingParams$1): Promise<ListingResult>;
|
|
13094
|
-
/**
|
|
13095
|
-
* Get unsigned transactions that can be submitted to fulfil an open order. If the approval
|
|
13096
|
-
* transaction exists it must be signed and submitted to the chain before the fulfilment
|
|
13097
|
-
* transaction can be submitted or it will be reverted.
|
|
13098
|
-
* @param {string} listingId - The listingId to fulfil.
|
|
13099
|
-
* @param {string} fulfillerAddress - The address of the account fulfilling the order.
|
|
13100
|
-
* @return {FulfillOrderResponse} Approval and fulfilment transactions.
|
|
13101
|
-
*/
|
|
13102
|
-
fulfillOrder(listingId: string, takerAddress: string, takerFee?: Fee$1): Promise<FulfillOrderResponse$1>;
|
|
13103
|
-
/**
|
|
13104
|
-
* Get an unsigned cancel order transaction. Orders can only be cancelled by
|
|
13105
|
-
* the account that created them.
|
|
13106
|
-
* @param {string} listingId - The listingId to cancel.
|
|
13107
|
-
* @param {string} accountAddress - The address of the account cancelling the order.
|
|
13108
|
-
* @return {CancelOrderResponse} The unsigned cancel order transaction
|
|
13109
|
-
*/
|
|
13110
|
-
cancelOrder(listingId: string, accountAddress: string): Promise<CancelOrderResponse$2>;
|
|
13048
|
+
interface OrderbookOverrides {
|
|
13049
|
+
provider?: JsonRpcProvider | Web3Provider;
|
|
13050
|
+
seaportContractAddress?: string;
|
|
13051
|
+
zoneContractAddress?: string;
|
|
13052
|
+
chainName?: string;
|
|
13053
|
+
apiEndpoint?: string;
|
|
13054
|
+
}
|
|
13055
|
+
interface OrderbookModuleConfiguration {
|
|
13056
|
+
seaportContractAddress: string;
|
|
13057
|
+
zoneContractAddress: string;
|
|
13058
|
+
apiEndpoint: string;
|
|
13059
|
+
chainName: string;
|
|
13060
|
+
provider: JsonRpcProvider | Web3Provider;
|
|
13111
13061
|
}
|
|
13112
|
-
|
|
13113
|
-
declare const constants: {
|
|
13114
|
-
estimatedFulfillmentGasGwei: number;
|
|
13115
|
-
};
|
|
13116
13062
|
|
|
13117
13063
|
declare enum OrderType {
|
|
13118
13064
|
FULL_OPEN = 0,
|
|
@@ -13161,6 +13107,387 @@ type OrderComponents = OrderParameters & {
|
|
|
13161
13107
|
counter: BigNumberish;
|
|
13162
13108
|
};
|
|
13163
13109
|
|
|
13110
|
+
type ApiRequestOptions = {
|
|
13111
|
+
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
|
|
13112
|
+
readonly url: string;
|
|
13113
|
+
readonly path?: Record<string, any>;
|
|
13114
|
+
readonly cookies?: Record<string, any>;
|
|
13115
|
+
readonly headers?: Record<string, any>;
|
|
13116
|
+
readonly query?: Record<string, any>;
|
|
13117
|
+
readonly formData?: Record<string, any>;
|
|
13118
|
+
readonly body?: any;
|
|
13119
|
+
readonly mediaType?: string;
|
|
13120
|
+
readonly responseHeader?: string;
|
|
13121
|
+
readonly errors?: Record<number, string>;
|
|
13122
|
+
};
|
|
13123
|
+
|
|
13124
|
+
interface OnCancel {
|
|
13125
|
+
readonly isResolved: boolean;
|
|
13126
|
+
readonly isRejected: boolean;
|
|
13127
|
+
readonly isCancelled: boolean;
|
|
13128
|
+
(cancelHandler: () => void): void;
|
|
13129
|
+
}
|
|
13130
|
+
declare class CancelablePromise<T> implements Promise<T> {
|
|
13131
|
+
readonly [Symbol.toStringTag]: string;
|
|
13132
|
+
private _isResolved;
|
|
13133
|
+
private _isRejected;
|
|
13134
|
+
private _isCancelled;
|
|
13135
|
+
private readonly _cancelHandlers;
|
|
13136
|
+
private readonly _promise;
|
|
13137
|
+
private _resolve?;
|
|
13138
|
+
private _reject?;
|
|
13139
|
+
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
|
|
13140
|
+
then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
13141
|
+
catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
|
|
13142
|
+
finally(onFinally?: (() => void) | null): Promise<T>;
|
|
13143
|
+
cancel(): void;
|
|
13144
|
+
get isCancelled(): boolean;
|
|
13145
|
+
}
|
|
13146
|
+
|
|
13147
|
+
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
|
13148
|
+
type Headers = Record<string, string>;
|
|
13149
|
+
type OpenAPIConfig = {
|
|
13150
|
+
BASE: string;
|
|
13151
|
+
VERSION: string;
|
|
13152
|
+
WITH_CREDENTIALS: boolean;
|
|
13153
|
+
CREDENTIALS: 'include' | 'omit' | 'same-origin';
|
|
13154
|
+
TOKEN?: string | Resolver<string>;
|
|
13155
|
+
USERNAME?: string | Resolver<string>;
|
|
13156
|
+
PASSWORD?: string | Resolver<string>;
|
|
13157
|
+
HEADERS?: Headers | Resolver<Headers>;
|
|
13158
|
+
ENCODE_PATH?: (path: string) => string;
|
|
13159
|
+
};
|
|
13160
|
+
|
|
13161
|
+
declare abstract class BaseHttpRequest {
|
|
13162
|
+
readonly config: OpenAPIConfig;
|
|
13163
|
+
constructor(config: OpenAPIConfig);
|
|
13164
|
+
abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
|
|
13165
|
+
}
|
|
13166
|
+
|
|
13167
|
+
/**
|
|
13168
|
+
* The name of chain
|
|
13169
|
+
*/
|
|
13170
|
+
type ChainName$1 = string;
|
|
13171
|
+
|
|
13172
|
+
type Fee$1 = {
|
|
13173
|
+
/**
|
|
13174
|
+
* Fee payable to recipient upon settlement
|
|
13175
|
+
*/
|
|
13176
|
+
amount: string;
|
|
13177
|
+
/**
|
|
13178
|
+
* Fee type
|
|
13179
|
+
*/
|
|
13180
|
+
fee_type: Fee$1.fee_type;
|
|
13181
|
+
/**
|
|
13182
|
+
* Wallet address of fee recipient
|
|
13183
|
+
*/
|
|
13184
|
+
recipient: string;
|
|
13185
|
+
};
|
|
13186
|
+
declare namespace Fee$1 {
|
|
13187
|
+
/**
|
|
13188
|
+
* Fee type
|
|
13189
|
+
*/
|
|
13190
|
+
enum fee_type {
|
|
13191
|
+
ROYALTY = "ROYALTY",
|
|
13192
|
+
MAKER_MARKETPLACE = "MAKER_MARKETPLACE",
|
|
13193
|
+
TAKER_MARKETPLACE = "TAKER_MARKETPLACE",
|
|
13194
|
+
PROTOCOL = "PROTOCOL"
|
|
13195
|
+
}
|
|
13196
|
+
}
|
|
13197
|
+
|
|
13198
|
+
type ERC20Item$2 = {
|
|
13199
|
+
/**
|
|
13200
|
+
* Token type user is offering, which in this case is ERC20
|
|
13201
|
+
*/
|
|
13202
|
+
item_type: 'ERC20';
|
|
13203
|
+
/**
|
|
13204
|
+
* Address of ERC20 token
|
|
13205
|
+
*/
|
|
13206
|
+
contract_address: string;
|
|
13207
|
+
/**
|
|
13208
|
+
* A string representing the starting 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).
|
|
13209
|
+
*/
|
|
13210
|
+
start_amount: string;
|
|
13211
|
+
};
|
|
13212
|
+
|
|
13213
|
+
type ERC721Item$2 = {
|
|
13214
|
+
/**
|
|
13215
|
+
* Token type user is offering, which in this case is ERC721
|
|
13216
|
+
*/
|
|
13217
|
+
item_type: 'ERC721';
|
|
13218
|
+
/**
|
|
13219
|
+
* Address of ERC721 token
|
|
13220
|
+
*/
|
|
13221
|
+
contract_address: string;
|
|
13222
|
+
/**
|
|
13223
|
+
* ID of ERC721 token
|
|
13224
|
+
*/
|
|
13225
|
+
token_id: string;
|
|
13226
|
+
};
|
|
13227
|
+
|
|
13228
|
+
type NativeItem$2 = {
|
|
13229
|
+
/**
|
|
13230
|
+
* Token type user is offering, which in this case is the native IMX token
|
|
13231
|
+
*/
|
|
13232
|
+
item_type: 'NATIVE';
|
|
13233
|
+
/**
|
|
13234
|
+
* A string representing the starting 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).
|
|
13235
|
+
*/
|
|
13236
|
+
start_amount: string;
|
|
13237
|
+
};
|
|
13238
|
+
|
|
13239
|
+
type Item = (NativeItem$2 | ERC20Item$2 | ERC721Item$2);
|
|
13240
|
+
|
|
13241
|
+
type ProtocolData = {
|
|
13242
|
+
/**
|
|
13243
|
+
* The Order type
|
|
13244
|
+
*/
|
|
13245
|
+
order_type: ProtocolData.order_type;
|
|
13246
|
+
/**
|
|
13247
|
+
* Immutable zone address
|
|
13248
|
+
*/
|
|
13249
|
+
zone_address: string;
|
|
13250
|
+
/**
|
|
13251
|
+
* big.Int or uint256 string for order counter
|
|
13252
|
+
*/
|
|
13253
|
+
counter: string;
|
|
13254
|
+
/**
|
|
13255
|
+
* Immutable Seaport contract address
|
|
13256
|
+
*/
|
|
13257
|
+
seaport_address: string;
|
|
13258
|
+
/**
|
|
13259
|
+
* Immutable Seaport contract version
|
|
13260
|
+
*/
|
|
13261
|
+
seaport_version: string;
|
|
13262
|
+
};
|
|
13263
|
+
declare namespace ProtocolData {
|
|
13264
|
+
/**
|
|
13265
|
+
* The Order type
|
|
13266
|
+
*/
|
|
13267
|
+
enum order_type {
|
|
13268
|
+
FULL_RESTRICTED = "FULL_RESTRICTED"
|
|
13269
|
+
}
|
|
13270
|
+
}
|
|
13271
|
+
|
|
13272
|
+
type CreateListingRequestBody = {
|
|
13273
|
+
account_address: string;
|
|
13274
|
+
order_hash: string;
|
|
13275
|
+
/**
|
|
13276
|
+
* Buy item for listing should either be NATIVE or ERC20 item
|
|
13277
|
+
*/
|
|
13278
|
+
buy: Array<Item>;
|
|
13279
|
+
fees: Array<Fee$1>;
|
|
13280
|
+
/**
|
|
13281
|
+
* Time after which the Order is considered expired
|
|
13282
|
+
*/
|
|
13283
|
+
end_time: string;
|
|
13284
|
+
protocol_data: ProtocolData;
|
|
13285
|
+
/**
|
|
13286
|
+
* A random value added to the create Order request
|
|
13287
|
+
*/
|
|
13288
|
+
salt: string;
|
|
13289
|
+
/**
|
|
13290
|
+
* Sell item for listing should be an ERC721 item
|
|
13291
|
+
*/
|
|
13292
|
+
sell: Array<Item>;
|
|
13293
|
+
/**
|
|
13294
|
+
* Digital signature generated by the user for the specific Order
|
|
13295
|
+
*/
|
|
13296
|
+
signature: string;
|
|
13297
|
+
/**
|
|
13298
|
+
* Time after which Order is considered active
|
|
13299
|
+
*/
|
|
13300
|
+
start_time: string;
|
|
13301
|
+
};
|
|
13302
|
+
|
|
13303
|
+
type FulfillmentDataRequest = {
|
|
13304
|
+
order_id: string;
|
|
13305
|
+
fee?: Fee$1;
|
|
13306
|
+
};
|
|
13307
|
+
|
|
13308
|
+
/**
|
|
13309
|
+
* The chain details
|
|
13310
|
+
*/
|
|
13311
|
+
type Chain = {
|
|
13312
|
+
/**
|
|
13313
|
+
* The id of chain
|
|
13314
|
+
*/
|
|
13315
|
+
id: string;
|
|
13316
|
+
/**
|
|
13317
|
+
* The name of chain
|
|
13318
|
+
*/
|
|
13319
|
+
name: string;
|
|
13320
|
+
};
|
|
13321
|
+
|
|
13322
|
+
/**
|
|
13323
|
+
* The Order status
|
|
13324
|
+
*/
|
|
13325
|
+
declare enum OrderStatus {
|
|
13326
|
+
PENDING = "PENDING",
|
|
13327
|
+
ACTIVE = "ACTIVE",
|
|
13328
|
+
INACTIVE = "INACTIVE",
|
|
13329
|
+
FILLED = "FILLED",
|
|
13330
|
+
CANCELLED = "CANCELLED",
|
|
13331
|
+
EXPIRED = "EXPIRED"
|
|
13332
|
+
}
|
|
13333
|
+
|
|
13334
|
+
type Order = {
|
|
13335
|
+
account_address: string;
|
|
13336
|
+
buy: Array<Item>;
|
|
13337
|
+
fees: Array<Fee$1>;
|
|
13338
|
+
chain: Chain;
|
|
13339
|
+
/**
|
|
13340
|
+
* Time the Order is created
|
|
13341
|
+
*/
|
|
13342
|
+
create_time: string;
|
|
13343
|
+
/**
|
|
13344
|
+
* Time after which the Order is considered expired
|
|
13345
|
+
*/
|
|
13346
|
+
end_time: string;
|
|
13347
|
+
/**
|
|
13348
|
+
* Global Order identifier
|
|
13349
|
+
*/
|
|
13350
|
+
id: string;
|
|
13351
|
+
protocol_data: ProtocolData;
|
|
13352
|
+
/**
|
|
13353
|
+
* A random value added to the create Order request
|
|
13354
|
+
*/
|
|
13355
|
+
salt: string;
|
|
13356
|
+
sell: Array<Item>;
|
|
13357
|
+
/**
|
|
13358
|
+
* Digital signature generated by the user for the specific Order
|
|
13359
|
+
*/
|
|
13360
|
+
signature: string;
|
|
13361
|
+
/**
|
|
13362
|
+
* Time after which Order is considered active
|
|
13363
|
+
*/
|
|
13364
|
+
start_time: string;
|
|
13365
|
+
status: OrderStatus;
|
|
13366
|
+
/**
|
|
13367
|
+
* Time the Order is last updated
|
|
13368
|
+
*/
|
|
13369
|
+
update_time: string;
|
|
13370
|
+
};
|
|
13371
|
+
|
|
13372
|
+
type FulfillmentDataResult = {
|
|
13373
|
+
extra_data: string;
|
|
13374
|
+
order: Order;
|
|
13375
|
+
};
|
|
13376
|
+
|
|
13377
|
+
type ListingResult = {
|
|
13378
|
+
result: Order;
|
|
13379
|
+
};
|
|
13380
|
+
|
|
13381
|
+
/**
|
|
13382
|
+
* Pagination properties
|
|
13383
|
+
*/
|
|
13384
|
+
type Page = {
|
|
13385
|
+
/**
|
|
13386
|
+
* First item as an encoded string
|
|
13387
|
+
*/
|
|
13388
|
+
previous_cursor: string | null;
|
|
13389
|
+
/**
|
|
13390
|
+
* Last item as an encoded string
|
|
13391
|
+
*/
|
|
13392
|
+
next_cursor: string | null;
|
|
13393
|
+
};
|
|
13394
|
+
|
|
13395
|
+
type ListListingsResult = {
|
|
13396
|
+
page: Page;
|
|
13397
|
+
result: Array<Order>;
|
|
13398
|
+
};
|
|
13399
|
+
|
|
13400
|
+
/**
|
|
13401
|
+
* Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
13402
|
+
*/
|
|
13403
|
+
type PageCursor = string;
|
|
13404
|
+
|
|
13405
|
+
/**
|
|
13406
|
+
* Maximum number of items to return
|
|
13407
|
+
*/
|
|
13408
|
+
type PageSize = number;
|
|
13409
|
+
|
|
13410
|
+
declare class OrdersService {
|
|
13411
|
+
readonly httpRequest: BaseHttpRequest;
|
|
13412
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
13413
|
+
/**
|
|
13414
|
+
* List all listings
|
|
13415
|
+
* List all listings
|
|
13416
|
+
* @returns ListListingsResult OK response.
|
|
13417
|
+
* @throws ApiError
|
|
13418
|
+
*/
|
|
13419
|
+
listListings({ chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, }: {
|
|
13420
|
+
chainName: ChainName$1;
|
|
13421
|
+
/**
|
|
13422
|
+
* Order status to filter by
|
|
13423
|
+
*/
|
|
13424
|
+
status?: OrderStatus;
|
|
13425
|
+
/**
|
|
13426
|
+
* Sell item contract address to filter by
|
|
13427
|
+
*/
|
|
13428
|
+
sellItemContractAddress?: string;
|
|
13429
|
+
/**
|
|
13430
|
+
* Buy item contract address to filter by
|
|
13431
|
+
*/
|
|
13432
|
+
buyItemContractAddress?: string;
|
|
13433
|
+
/**
|
|
13434
|
+
* Sell item token identifier to filter by
|
|
13435
|
+
*/
|
|
13436
|
+
sellItemTokenId?: string;
|
|
13437
|
+
/**
|
|
13438
|
+
* Maximum number of orders to return per page
|
|
13439
|
+
*/
|
|
13440
|
+
pageSize?: PageSize;
|
|
13441
|
+
/**
|
|
13442
|
+
* Order field to sort by
|
|
13443
|
+
*/
|
|
13444
|
+
sortBy?: 'created_at' | 'updated_at' | 'buy_item_amount';
|
|
13445
|
+
/**
|
|
13446
|
+
* Ascending or descending direction for sort
|
|
13447
|
+
*/
|
|
13448
|
+
sortDirection?: 'asc' | 'desc';
|
|
13449
|
+
/**
|
|
13450
|
+
* Page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
13451
|
+
*/
|
|
13452
|
+
pageCursor?: PageCursor;
|
|
13453
|
+
}): CancelablePromise<ListListingsResult>;
|
|
13454
|
+
/**
|
|
13455
|
+
* Create a listing
|
|
13456
|
+
* Create a listing
|
|
13457
|
+
* @returns ListingResult Created response.
|
|
13458
|
+
* @throws ApiError
|
|
13459
|
+
*/
|
|
13460
|
+
createListing({ chainName, requestBody, }: {
|
|
13461
|
+
chainName: ChainName$1;
|
|
13462
|
+
requestBody: CreateListingRequestBody;
|
|
13463
|
+
}): CancelablePromise<ListingResult>;
|
|
13464
|
+
/**
|
|
13465
|
+
* Get a single listing by ID
|
|
13466
|
+
* Get a single listing by ID
|
|
13467
|
+
* @returns ListingResult OK response.
|
|
13468
|
+
* @throws ApiError
|
|
13469
|
+
*/
|
|
13470
|
+
getListing({ chainName, listingId, }: {
|
|
13471
|
+
chainName: ChainName$1;
|
|
13472
|
+
/**
|
|
13473
|
+
* Global Order identifier
|
|
13474
|
+
*/
|
|
13475
|
+
listingId: string;
|
|
13476
|
+
}): CancelablePromise<ListingResult>;
|
|
13477
|
+
/**
|
|
13478
|
+
* Retrieve fulfillment data for orders
|
|
13479
|
+
* Retrieve signed fulfillment data based on the list of order IDs and corresponding fees.
|
|
13480
|
+
* @returns any Successful response
|
|
13481
|
+
* @throws ApiError
|
|
13482
|
+
*/
|
|
13483
|
+
fulfillmentData({ chainName, requestBody, }: {
|
|
13484
|
+
chainName: ChainName$1;
|
|
13485
|
+
requestBody: Array<FulfillmentDataRequest>;
|
|
13486
|
+
}): CancelablePromise<{
|
|
13487
|
+
result: Array<FulfillmentDataResult>;
|
|
13488
|
+
}>;
|
|
13489
|
+
}
|
|
13490
|
+
|
|
13164
13491
|
interface ERC721Item$1 {
|
|
13165
13492
|
type: 'ERC721';
|
|
13166
13493
|
contractAddress: string;
|
|
@@ -13194,9 +13521,20 @@ interface CreateListingParams {
|
|
|
13194
13521
|
orderComponents: OrderComponents;
|
|
13195
13522
|
orderHash: string;
|
|
13196
13523
|
orderSignature: string;
|
|
13197
|
-
makerFee?: Fee
|
|
13524
|
+
makerFee?: Fee;
|
|
13198
13525
|
}
|
|
13199
13526
|
type ListListingsParams = Omit<Parameters<typeof OrdersService.prototype.listListings>[0], 'chainName'>;
|
|
13527
|
+
declare enum FeeType {
|
|
13528
|
+
MAKER_MARKETPLACE = "MAKER_MARKETPLACE",
|
|
13529
|
+
TAKER_MARKETPLACE = "TAKER_MARKETPLACE",
|
|
13530
|
+
PROTOCOL = "PROTOCOL",
|
|
13531
|
+
ROYALTY = "ROYALTY"
|
|
13532
|
+
}
|
|
13533
|
+
interface Fee {
|
|
13534
|
+
type: FeeType;
|
|
13535
|
+
recipient: string;
|
|
13536
|
+
amount: string;
|
|
13537
|
+
}
|
|
13200
13538
|
declare enum TransactionPurpose {
|
|
13201
13539
|
APPROVAL = "APPROVAL",
|
|
13202
13540
|
FULFILL_ORDER = "FULFILL_ORDER"
|
|
@@ -13231,13 +13569,87 @@ interface CancelOrderResponse {
|
|
|
13231
13569
|
unsignedCancelOrderTransaction: PopulatedTransaction;
|
|
13232
13570
|
}
|
|
13233
13571
|
|
|
13572
|
+
/**
|
|
13573
|
+
* zkEVM orderbook SDK
|
|
13574
|
+
* @constructor
|
|
13575
|
+
* @param {OrderbookModuleConfiguration} config - Configuration for Immutable services.
|
|
13576
|
+
*/
|
|
13577
|
+
declare class Orderbook {
|
|
13578
|
+
private apiClient;
|
|
13579
|
+
private seaport;
|
|
13580
|
+
private orderbookConfig;
|
|
13581
|
+
constructor(config: ModuleConfiguration<OrderbookOverrides>);
|
|
13582
|
+
/**
|
|
13583
|
+
* Return the configuration for the orderbook module.
|
|
13584
|
+
* @return {OrderbookModuleConfiguration} The configuration for the orderbook module.
|
|
13585
|
+
*/
|
|
13586
|
+
config(): OrderbookModuleConfiguration;
|
|
13587
|
+
/**
|
|
13588
|
+
* Get an order by ID
|
|
13589
|
+
* @param {string} listingId - The listingId to find.
|
|
13590
|
+
* @return {ListingResult} The returned order result.
|
|
13591
|
+
*/
|
|
13592
|
+
getListing(listingId: string): Promise<ListingResult>;
|
|
13593
|
+
/**
|
|
13594
|
+
* List orders. This method is used to get a list of orders filtered by conditions specified
|
|
13595
|
+
* in the params object.
|
|
13596
|
+
* @param {ListListingsParams} listOrderParams - Filtering, ordering and page parameters.
|
|
13597
|
+
* @return {ListListingsResult} The paged orders.
|
|
13598
|
+
*/
|
|
13599
|
+
listListings(listOrderParams: ListListingsParams): Promise<ListListingsResult>;
|
|
13600
|
+
/**
|
|
13601
|
+
* Get required transactions and messages for signing prior to creating a listing
|
|
13602
|
+
* through the createListing method
|
|
13603
|
+
* @param {PrepareListingParams} prepareListingParams - Details about the listing to be created.
|
|
13604
|
+
* @return {PrepareListingResponse} PrepareListingResponse includes
|
|
13605
|
+
* the unsigned approval transaction, the typed order message for signing and
|
|
13606
|
+
* the order components that can be submitted to `createListing` with a signature.
|
|
13607
|
+
*/
|
|
13608
|
+
prepareListing({ makerAddress, sell, buy, orderExpiry, }: PrepareListingParams): Promise<PrepareListingResponse>;
|
|
13609
|
+
/**
|
|
13610
|
+
* Create an order
|
|
13611
|
+
* @param {CreateListingParams} createListingParams - create an order with the given params.
|
|
13612
|
+
* @return {ListingResult} The result of the order created in the Immutable services.
|
|
13613
|
+
*/
|
|
13614
|
+
createListing(createListingParams: CreateListingParams): Promise<ListingResult>;
|
|
13615
|
+
/**
|
|
13616
|
+
* Get unsigned transactions that can be submitted to fulfil an open order. If the approval
|
|
13617
|
+
* transaction exists it must be signed and submitted to the chain before the fulfilment
|
|
13618
|
+
* transaction can be submitted or it will be reverted.
|
|
13619
|
+
* @param {string} listingId - The listingId to fulfil.
|
|
13620
|
+
* @param {string} fulfillerAddress - The address of the account fulfilling the order.
|
|
13621
|
+
* @return {FulfillOrderResponse} Approval and fulfilment transactions.
|
|
13622
|
+
*/
|
|
13623
|
+
fulfillOrder(listingId: string, takerAddress: string, takerFee?: Fee): Promise<FulfillOrderResponse>;
|
|
13624
|
+
/**
|
|
13625
|
+
* Get an unsigned cancel order transaction. Orders can only be cancelled by
|
|
13626
|
+
* the account that created them.
|
|
13627
|
+
* @param {string} listingId - The listingId to cancel.
|
|
13628
|
+
* @param {string} accountAddress - The address of the account cancelling the order.
|
|
13629
|
+
* @return {CancelOrderResponse} The unsigned cancel order transaction
|
|
13630
|
+
*/
|
|
13631
|
+
cancelOrder(listingId: string, accountAddress: string): Promise<CancelOrderResponse>;
|
|
13632
|
+
}
|
|
13633
|
+
|
|
13634
|
+
declare const constants: {
|
|
13635
|
+
estimatedFulfillmentGasGwei: number;
|
|
13636
|
+
};
|
|
13637
|
+
|
|
13234
13638
|
type orderbook_d_Action = Action;
|
|
13235
13639
|
type orderbook_d_ActionType = ActionType;
|
|
13236
13640
|
declare const orderbook_d_ActionType: typeof ActionType;
|
|
13237
13641
|
type orderbook_d_CancelOrderResponse = CancelOrderResponse;
|
|
13238
13642
|
type orderbook_d_CreateListingParams = CreateListingParams;
|
|
13643
|
+
type orderbook_d_Fee = Fee;
|
|
13644
|
+
type orderbook_d_FeeType = FeeType;
|
|
13645
|
+
declare const orderbook_d_FeeType: typeof FeeType;
|
|
13239
13646
|
type orderbook_d_FulfillOrderResponse = FulfillOrderResponse;
|
|
13240
13647
|
type orderbook_d_ListListingsParams = ListListingsParams;
|
|
13648
|
+
type orderbook_d_ListListingsResult = ListListingsResult;
|
|
13649
|
+
type orderbook_d_ListingResult = ListingResult;
|
|
13650
|
+
type orderbook_d_Order = Order;
|
|
13651
|
+
type orderbook_d_OrderStatus = OrderStatus;
|
|
13652
|
+
declare const orderbook_d_OrderStatus: typeof OrderStatus;
|
|
13241
13653
|
type orderbook_d_Orderbook = Orderbook;
|
|
13242
13654
|
declare const orderbook_d_Orderbook: typeof Orderbook;
|
|
13243
13655
|
type orderbook_d_PrepareListingParams = PrepareListingParams;
|
|
@@ -13259,9 +13671,15 @@ declare namespace orderbook_d {
|
|
|
13259
13671
|
orderbook_d_CreateListingParams as CreateListingParams,
|
|
13260
13672
|
ERC20Item$1 as ERC20Item,
|
|
13261
13673
|
ERC721Item$1 as ERC721Item,
|
|
13674
|
+
orderbook_d_Fee as Fee,
|
|
13675
|
+
orderbook_d_FeeType as FeeType,
|
|
13262
13676
|
orderbook_d_FulfillOrderResponse as FulfillOrderResponse,
|
|
13263
13677
|
orderbook_d_ListListingsParams as ListListingsParams,
|
|
13678
|
+
orderbook_d_ListListingsResult as ListListingsResult,
|
|
13679
|
+
orderbook_d_ListingResult as ListingResult,
|
|
13264
13680
|
NativeItem$1 as NativeItem,
|
|
13681
|
+
orderbook_d_Order as Order,
|
|
13682
|
+
orderbook_d_OrderStatus as OrderStatus,
|
|
13265
13683
|
orderbook_d_Orderbook as Orderbook,
|
|
13266
13684
|
orderbook_d_PrepareListingParams as PrepareListingParams,
|
|
13267
13685
|
orderbook_d_PrepareListingResponse as PrepareListingResponse,
|