@imtbl/sdk 0.27.15 → 0.28.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.
- package/dist/blockchain_data.js +1 -1
- package/dist/browser/checkout.js +2 -2
- package/dist/checkout_sdk.js +262 -80
- package/dist/checkout_widgets.js +1 -1
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +5 -5
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +298 -94
- package/dist/index.d.ts +117 -71
- package/dist/index.js +299 -95
- package/dist/orderbook.d.ts +109 -65
- package/dist/orderbook.js +101 -20
- package/dist/passport.js +36 -14
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5739,7 +5739,7 @@ interface CancelOrderRequest {
|
|
|
5739
5739
|
* @export
|
|
5740
5740
|
* @interface CancelOrderResponse
|
|
5741
5741
|
*/
|
|
5742
|
-
interface CancelOrderResponse
|
|
5742
|
+
interface CancelOrderResponse {
|
|
5743
5743
|
/**
|
|
5744
5744
|
* ID of the cancelled order
|
|
5745
5745
|
* @type {number}
|
|
@@ -12964,7 +12964,7 @@ declare class OrdersApi extends BaseAPI {
|
|
|
12964
12964
|
* @throws {RequiredError}
|
|
12965
12965
|
* @memberof OrdersApi
|
|
12966
12966
|
*/
|
|
12967
|
-
cancelOrder(requestParameters: OrdersApiCancelOrderRequest, options?: AxiosRequestConfig): Promise<AxiosResponse<CancelOrderResponse
|
|
12967
|
+
cancelOrder(requestParameters: OrdersApiCancelOrderRequest, options?: AxiosRequestConfig): Promise<AxiosResponse<CancelOrderResponse, any>>;
|
|
12968
12968
|
/**
|
|
12969
12969
|
* Cancel an order (V3)
|
|
12970
12970
|
* @summary Cancel an order (V3)
|
|
@@ -12973,7 +12973,7 @@ declare class OrdersApi extends BaseAPI {
|
|
|
12973
12973
|
* @throws {RequiredError}
|
|
12974
12974
|
* @memberof OrdersApi
|
|
12975
12975
|
*/
|
|
12976
|
-
cancelOrderV3(requestParameters: OrdersApiCancelOrderV3Request, options?: AxiosRequestConfig): Promise<AxiosResponse<CancelOrderResponse
|
|
12976
|
+
cancelOrderV3(requestParameters: OrdersApiCancelOrderV3Request, options?: AxiosRequestConfig): Promise<AxiosResponse<CancelOrderResponse, any>>;
|
|
12977
12977
|
/**
|
|
12978
12978
|
* Create an order. Use https://docs.x.immutable.com/reference#/operations/getSignableOrder to get request body params. This version of the endpoint is deprecated, the latest version can be found at https://docs.x.immutable.com/reference/#/operations/createOrderV3. Deprecation date - Mon, 01 May 2023 Sunset date - Fri, 01 Sept 2023
|
|
12979
12979
|
* @summary Create an order
|
|
@@ -14733,7 +14733,7 @@ interface IMXProvider {
|
|
|
14733
14733
|
* @param {GetSignableCancelOrderRequest} request The signable cancel order request
|
|
14734
14734
|
* @return {Promise<CancelOrderResponse>} Returns a promise that resolves with the cancelled Order
|
|
14735
14735
|
*/
|
|
14736
|
-
cancelOrder(request: GetSignableCancelOrderRequest): Promise<CancelOrderResponse
|
|
14736
|
+
cancelOrder(request: GetSignableCancelOrderRequest): Promise<CancelOrderResponse>;
|
|
14737
14737
|
/**
|
|
14738
14738
|
* Create a Trade
|
|
14739
14739
|
*
|
|
@@ -14793,7 +14793,7 @@ declare class GenericIMXProvider implements IMXProvider {
|
|
|
14793
14793
|
getAddress(): Promise<string>;
|
|
14794
14794
|
registerOffchain(): Promise<RegisterUserResponse>;
|
|
14795
14795
|
batchNftTransfer(request: Array<NftTransferDetails>): Promise<CreateTransferResponse>;
|
|
14796
|
-
cancelOrder(request: GetSignableCancelOrderRequest): Promise<CancelOrderResponse
|
|
14796
|
+
cancelOrder(request: GetSignableCancelOrderRequest): Promise<CancelOrderResponse>;
|
|
14797
14797
|
completeWithdrawal(starkPublicKey: string, token: AnyToken): Promise<TransactionResponse>;
|
|
14798
14798
|
createOrder(request: UnsignedOrderRequest): Promise<CreateOrderResponse>;
|
|
14799
14799
|
createTrade(request: GetSignableTradeRequest): Promise<CreateTradeResponse>;
|
|
@@ -15053,53 +15053,6 @@ interface OrderbookModuleConfiguration {
|
|
|
15053
15053
|
provider: JsonRpcProvider | Web3Provider;
|
|
15054
15054
|
}
|
|
15055
15055
|
|
|
15056
|
-
declare enum OrderType {
|
|
15057
|
-
FULL_OPEN = 0,
|
|
15058
|
-
PARTIAL_OPEN = 1,
|
|
15059
|
-
FULL_RESTRICTED = 2,
|
|
15060
|
-
PARTIAL_RESTRICTED = 3
|
|
15061
|
-
}
|
|
15062
|
-
declare enum ItemType$1 {
|
|
15063
|
-
NATIVE = 0,
|
|
15064
|
-
ERC20 = 1,
|
|
15065
|
-
ERC721 = 2,
|
|
15066
|
-
ERC1155 = 3,
|
|
15067
|
-
ERC721_WITH_CRITERIA = 4,
|
|
15068
|
-
ERC1155_WITH_CRITERIA = 5
|
|
15069
|
-
}
|
|
15070
|
-
|
|
15071
|
-
type OfferItem = {
|
|
15072
|
-
itemType: ItemType$1;
|
|
15073
|
-
token: string;
|
|
15074
|
-
identifierOrCriteria: string;
|
|
15075
|
-
startAmount: string;
|
|
15076
|
-
endAmount: string;
|
|
15077
|
-
};
|
|
15078
|
-
type ConsiderationItem = {
|
|
15079
|
-
itemType: ItemType$1;
|
|
15080
|
-
token: string;
|
|
15081
|
-
identifierOrCriteria: string;
|
|
15082
|
-
startAmount: string;
|
|
15083
|
-
endAmount: string;
|
|
15084
|
-
recipient: string;
|
|
15085
|
-
};
|
|
15086
|
-
type OrderParameters = {
|
|
15087
|
-
offerer: string;
|
|
15088
|
-
zone: string;
|
|
15089
|
-
orderType: OrderType;
|
|
15090
|
-
startTime: BigNumberish;
|
|
15091
|
-
endTime: BigNumberish;
|
|
15092
|
-
zoneHash: string;
|
|
15093
|
-
salt: string;
|
|
15094
|
-
offer: OfferItem[];
|
|
15095
|
-
consideration: ConsiderationItem[];
|
|
15096
|
-
totalOriginalConsiderationItems: BigNumberish;
|
|
15097
|
-
conduitKey: string;
|
|
15098
|
-
};
|
|
15099
|
-
type OrderComponents = OrderParameters & {
|
|
15100
|
-
counter: BigNumberish;
|
|
15101
|
-
};
|
|
15102
|
-
|
|
15103
15056
|
type ApiRequestOptions = {
|
|
15104
15057
|
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
|
|
15105
15058
|
readonly url: string;
|
|
@@ -15187,7 +15140,7 @@ declare namespace FailedOrderCancellation {
|
|
|
15187
15140
|
* Reason code indicating why the order failed to be cancelled
|
|
15188
15141
|
*/
|
|
15189
15142
|
enum reason_code {
|
|
15190
|
-
|
|
15143
|
+
FILLED = "FILLED"
|
|
15191
15144
|
}
|
|
15192
15145
|
}
|
|
15193
15146
|
|
|
@@ -15365,20 +15318,20 @@ type Chain = {
|
|
|
15365
15318
|
|
|
15366
15319
|
type ActiveOrderStatus = {
|
|
15367
15320
|
/**
|
|
15368
|
-
* The order status
|
|
15321
|
+
* The order status that indicates an order can be fulfilled.
|
|
15369
15322
|
*/
|
|
15370
15323
|
name: 'ACTIVE';
|
|
15371
15324
|
};
|
|
15372
15325
|
|
|
15373
15326
|
type CancelledOrderStatus = {
|
|
15374
15327
|
/**
|
|
15375
|
-
* The order status
|
|
15328
|
+
* The order status indicating a order is has been cancelled or about to be cancelled.
|
|
15376
15329
|
*/
|
|
15377
15330
|
name: 'CANCELLED';
|
|
15378
15331
|
/**
|
|
15379
15332
|
* Whether the cancellation of the order is pending
|
|
15380
15333
|
*/
|
|
15381
|
-
|
|
15334
|
+
pending: boolean;
|
|
15382
15335
|
/**
|
|
15383
15336
|
* Whether the cancellation was done on-chain or off-chain
|
|
15384
15337
|
*/
|
|
@@ -15396,30 +15349,46 @@ declare namespace CancelledOrderStatus {
|
|
|
15396
15349
|
|
|
15397
15350
|
type ExpiredOrderStatus = {
|
|
15398
15351
|
/**
|
|
15399
|
-
*
|
|
15352
|
+
* A terminal order status indicating that an order cannot be fulfilled due to expiry.
|
|
15400
15353
|
*/
|
|
15401
15354
|
name: 'EXPIRED';
|
|
15402
15355
|
};
|
|
15403
15356
|
|
|
15404
15357
|
type FilledOrderStatus = {
|
|
15405
15358
|
/**
|
|
15406
|
-
*
|
|
15359
|
+
* A terminal order status indicating that an order has been fulfilled.
|
|
15407
15360
|
*/
|
|
15408
15361
|
name: 'FILLED';
|
|
15409
15362
|
};
|
|
15410
15363
|
|
|
15411
15364
|
type InactiveOrderStatus = {
|
|
15412
15365
|
/**
|
|
15413
|
-
* The order status
|
|
15366
|
+
* The order status that indicates an order cannot be fulfilled.
|
|
15414
15367
|
*/
|
|
15415
15368
|
name: 'INACTIVE';
|
|
15369
|
+
/**
|
|
15370
|
+
* Whether the order offerer has sufficient approvals
|
|
15371
|
+
*/
|
|
15372
|
+
sufficient_approvals: boolean;
|
|
15373
|
+
/**
|
|
15374
|
+
* Whether the order offerer still has sufficient balance to complete the order
|
|
15375
|
+
*/
|
|
15376
|
+
sufficient_balances: boolean;
|
|
15416
15377
|
};
|
|
15417
15378
|
|
|
15418
15379
|
type PendingOrderStatus = {
|
|
15419
15380
|
/**
|
|
15420
|
-
* The order status
|
|
15381
|
+
* The order status that indicates the order is yet to be active due to various reasons.
|
|
15421
15382
|
*/
|
|
15422
15383
|
name: 'PENDING';
|
|
15384
|
+
/**
|
|
15385
|
+
* Whether the order has been evaluated after its creation
|
|
15386
|
+
*/
|
|
15387
|
+
evaluated: boolean;
|
|
15388
|
+
/**
|
|
15389
|
+
* Whether the order has reached its specified start time
|
|
15390
|
+
*/
|
|
15391
|
+
started: boolean;
|
|
15423
15392
|
};
|
|
15424
15393
|
|
|
15425
15394
|
/**
|
|
@@ -15724,6 +15693,53 @@ declare class OrdersService {
|
|
|
15724
15693
|
}): CancelablePromise<TradeResult$1>;
|
|
15725
15694
|
}
|
|
15726
15695
|
|
|
15696
|
+
declare enum OrderType {
|
|
15697
|
+
FULL_OPEN = 0,
|
|
15698
|
+
PARTIAL_OPEN = 1,
|
|
15699
|
+
FULL_RESTRICTED = 2,
|
|
15700
|
+
PARTIAL_RESTRICTED = 3
|
|
15701
|
+
}
|
|
15702
|
+
declare enum ItemType$1 {
|
|
15703
|
+
NATIVE = 0,
|
|
15704
|
+
ERC20 = 1,
|
|
15705
|
+
ERC721 = 2,
|
|
15706
|
+
ERC1155 = 3,
|
|
15707
|
+
ERC721_WITH_CRITERIA = 4,
|
|
15708
|
+
ERC1155_WITH_CRITERIA = 5
|
|
15709
|
+
}
|
|
15710
|
+
|
|
15711
|
+
type OfferItem = {
|
|
15712
|
+
itemType: ItemType$1;
|
|
15713
|
+
token: string;
|
|
15714
|
+
identifierOrCriteria: string;
|
|
15715
|
+
startAmount: string;
|
|
15716
|
+
endAmount: string;
|
|
15717
|
+
};
|
|
15718
|
+
type ConsiderationItem = {
|
|
15719
|
+
itemType: ItemType$1;
|
|
15720
|
+
token: string;
|
|
15721
|
+
identifierOrCriteria: string;
|
|
15722
|
+
startAmount: string;
|
|
15723
|
+
endAmount: string;
|
|
15724
|
+
recipient: string;
|
|
15725
|
+
};
|
|
15726
|
+
type OrderParameters = {
|
|
15727
|
+
offerer: string;
|
|
15728
|
+
zone: string;
|
|
15729
|
+
orderType: OrderType;
|
|
15730
|
+
startTime: BigNumberish;
|
|
15731
|
+
endTime: BigNumberish;
|
|
15732
|
+
zoneHash: string;
|
|
15733
|
+
salt: string;
|
|
15734
|
+
offer: OfferItem[];
|
|
15735
|
+
consideration: ConsiderationItem[];
|
|
15736
|
+
totalOriginalConsiderationItems: BigNumberish;
|
|
15737
|
+
conduitKey: string;
|
|
15738
|
+
};
|
|
15739
|
+
type OrderComponents = OrderParameters & {
|
|
15740
|
+
counter: BigNumberish;
|
|
15741
|
+
};
|
|
15742
|
+
|
|
15727
15743
|
interface ERC721Item {
|
|
15728
15744
|
type: 'ERC721';
|
|
15729
15745
|
contractAddress: string;
|
|
@@ -15753,6 +15769,9 @@ interface PrepareListingResponse {
|
|
|
15753
15769
|
orderComponents: OrderComponents;
|
|
15754
15770
|
orderHash: string;
|
|
15755
15771
|
}
|
|
15772
|
+
interface PrepareCancelOrdersResponse {
|
|
15773
|
+
signableAction: SignableAction;
|
|
15774
|
+
}
|
|
15756
15775
|
interface CreateListingParams {
|
|
15757
15776
|
orderComponents: OrderComponents;
|
|
15758
15777
|
orderHash: string;
|
|
@@ -15776,10 +15795,12 @@ interface Fee$1 extends FeeValue {
|
|
|
15776
15795
|
}
|
|
15777
15796
|
declare enum TransactionPurpose {
|
|
15778
15797
|
APPROVAL = "APPROVAL",
|
|
15779
|
-
FULFILL_ORDER = "FULFILL_ORDER"
|
|
15798
|
+
FULFILL_ORDER = "FULFILL_ORDER",
|
|
15799
|
+
CANCEL = "CANCEL"
|
|
15780
15800
|
}
|
|
15781
15801
|
declare enum SignablePurpose {
|
|
15782
|
-
CREATE_LISTING = "CREATE_LISTING"
|
|
15802
|
+
CREATE_LISTING = "CREATE_LISTING",
|
|
15803
|
+
OFF_CHAIN_CANCELLATION = "OFF_CHAIN_CANCELLATION"
|
|
15783
15804
|
}
|
|
15784
15805
|
declare enum ActionType {
|
|
15785
15806
|
TRANSACTION = "TRANSACTION",
|
|
@@ -15831,8 +15852,8 @@ interface FulfillOrderResponse {
|
|
|
15831
15852
|
expiration: string;
|
|
15832
15853
|
order: Order;
|
|
15833
15854
|
}
|
|
15834
|
-
interface
|
|
15835
|
-
|
|
15855
|
+
interface CancelOrdersOnChainResponse {
|
|
15856
|
+
cancellationAction: TransactionAction;
|
|
15836
15857
|
}
|
|
15837
15858
|
interface Order {
|
|
15838
15859
|
id: string;
|
|
@@ -15994,13 +16015,36 @@ declare class Orderbook {
|
|
|
15994
16015
|
fulfillOrder(listingId: string, takerAddress: string, takerFees: FeeValue[]): Promise<FulfillOrderResponse>;
|
|
15995
16016
|
fulfillBulkOrders(listings: Array<FulfillmentListing>, takerAddress: string): Promise<FulfillBulkOrdersResponse>;
|
|
15996
16017
|
/**
|
|
15997
|
-
*
|
|
15998
|
-
* the
|
|
15999
|
-
*
|
|
16018
|
+
* Cancelling orders is a gasless alternative to on-chain cancellation exposed with
|
|
16019
|
+
* `cancelOrdersOnChain`. For the orderbook to authenticate the cancellation, the creator
|
|
16020
|
+
* of the orders must sign an EIP712 message containing the orderIds
|
|
16021
|
+
* @param {string} orderIds - The orderIds to attempt to cancel.
|
|
16022
|
+
* @return {PrepareCancelOrdersResponse} The signable action to cancel the orders.
|
|
16023
|
+
*/
|
|
16024
|
+
prepareOrderCancellations(orderIds: string[]): Promise<PrepareCancelOrdersResponse>;
|
|
16025
|
+
/**
|
|
16026
|
+
* Cancelling orders is a gasless alternative to on-chain cancellation exposed with
|
|
16027
|
+
* `cancelOrdersOnChain`. Orders cancelled this way cannot be fulfilled and will be removed
|
|
16028
|
+
* from the orderbook. If there is pending fulfillment data outstanding for the order, its
|
|
16029
|
+
* cancellation will be pending until the fulfillment window has passed.
|
|
16030
|
+
* `prepareOffchainOrderCancellations` can be used to get the signable action that is signed
|
|
16031
|
+
* to get the signature required for this call.
|
|
16032
|
+
* @param {string[]} orderIds - The orderIds to attempt to cancel.
|
|
16033
|
+
* @param {string} accountAddress - The address of the account cancelling the orders.
|
|
16034
|
+
* @param {string} accountAddress - The address of the account cancelling the orders.
|
|
16035
|
+
* @return {CancelOrdersResult} The result of the off-chain cancellation request
|
|
16036
|
+
*/
|
|
16037
|
+
cancelOrders(orderIds: string[], accountAddress: string, signature: string): Promise<CancelOrdersResult>;
|
|
16038
|
+
/**
|
|
16039
|
+
* Get an unsigned order cancellation transaction. Orders can only be cancelled by
|
|
16040
|
+
* the account that created them. All of the orders must be from the same seaport contract.
|
|
16041
|
+
* If trying to cancel orders from multiple seaport contracts, group the orderIds by seaport
|
|
16042
|
+
* contract and call this method for each group.
|
|
16043
|
+
* @param {string[]} orderIds - The orderIds to cancel.
|
|
16000
16044
|
* @param {string} accountAddress - The address of the account cancelling the order.
|
|
16001
|
-
* @return {
|
|
16045
|
+
* @return {CancelOrdersOnChainResponse} The unsigned cancel order action
|
|
16002
16046
|
*/
|
|
16003
|
-
|
|
16047
|
+
cancelOrdersOnChain(orderIds: string[], accountAddress: string): Promise<CancelOrdersOnChainResponse>;
|
|
16004
16048
|
}
|
|
16005
16049
|
|
|
16006
16050
|
declare const constants: {
|
|
@@ -16010,7 +16054,7 @@ declare const constants: {
|
|
|
16010
16054
|
type orderbook_d_Action = Action;
|
|
16011
16055
|
type orderbook_d_ActionType = ActionType;
|
|
16012
16056
|
declare const orderbook_d_ActionType: typeof ActionType;
|
|
16013
|
-
type
|
|
16057
|
+
type orderbook_d_CancelOrdersOnChainResponse = CancelOrdersOnChainResponse;
|
|
16014
16058
|
type orderbook_d_CreateListingParams = CreateListingParams;
|
|
16015
16059
|
type orderbook_d_ERC20Item = ERC20Item;
|
|
16016
16060
|
type orderbook_d_ERC721Item = ERC721Item;
|
|
@@ -16034,6 +16078,7 @@ declare const orderbook_d_OrderStatusName: typeof OrderStatusName;
|
|
|
16034
16078
|
type orderbook_d_Orderbook = Orderbook;
|
|
16035
16079
|
declare const orderbook_d_Orderbook: typeof Orderbook;
|
|
16036
16080
|
type orderbook_d_Page = Page;
|
|
16081
|
+
type orderbook_d_PrepareCancelOrdersResponse = PrepareCancelOrdersResponse;
|
|
16037
16082
|
type orderbook_d_PrepareListingParams = PrepareListingParams;
|
|
16038
16083
|
type orderbook_d_PrepareListingResponse = PrepareListingResponse;
|
|
16039
16084
|
type orderbook_d_RoyaltyInfo = RoyaltyInfo;
|
|
@@ -16052,7 +16097,7 @@ declare namespace orderbook_d {
|
|
|
16052
16097
|
export {
|
|
16053
16098
|
orderbook_d_Action as Action,
|
|
16054
16099
|
orderbook_d_ActionType as ActionType,
|
|
16055
|
-
|
|
16100
|
+
orderbook_d_CancelOrdersOnChainResponse as CancelOrdersOnChainResponse,
|
|
16056
16101
|
orderbook_d_CreateListingParams as CreateListingParams,
|
|
16057
16102
|
orderbook_d_ERC20Item as ERC20Item,
|
|
16058
16103
|
orderbook_d_ERC721Item as ERC721Item,
|
|
@@ -16074,6 +16119,7 @@ declare namespace orderbook_d {
|
|
|
16074
16119
|
orderbook_d_OrderStatusName as OrderStatusName,
|
|
16075
16120
|
orderbook_d_Orderbook as Orderbook,
|
|
16076
16121
|
orderbook_d_Page as Page,
|
|
16122
|
+
orderbook_d_PrepareCancelOrdersResponse as PrepareCancelOrdersResponse,
|
|
16077
16123
|
orderbook_d_PrepareListingParams as PrepareListingParams,
|
|
16078
16124
|
orderbook_d_PrepareListingResponse as PrepareListingResponse,
|
|
16079
16125
|
orderbook_d_RoyaltyInfo as RoyaltyInfo,
|