@imtbl/sdk 0.21.0 → 0.22.0-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.
@@ -838,11 +838,6 @@ type CreateListingRequestBody = {
838
838
  start_at: string;
839
839
  };
840
840
 
841
- type FulfillmentDataRequest = {
842
- order_id: string;
843
- fees: Array<Fee$1>;
844
- };
845
-
846
841
  /**
847
842
  * The chain details
848
843
  */
@@ -907,11 +902,16 @@ type Order$1 = {
907
902
  updated_at: string;
908
903
  };
909
904
 
910
- type FulfillmentDataResult = {
905
+ type FulfillableOrder = {
911
906
  extra_data: string;
912
907
  order: Order$1;
913
908
  };
914
909
 
910
+ type FulfillmentDataRequest = {
911
+ order_id: string;
912
+ fees: Array<Fee$1>;
913
+ };
914
+
915
915
  type ListingResult$1 = {
916
916
  result: Order$1;
917
917
  };
@@ -997,6 +997,17 @@ type TradeResult$1 = {
997
997
  result: Trade$1;
998
998
  };
999
999
 
1000
+ type UnfulfillableOrder = {
1001
+ /**
1002
+ * OrderID for the requested but unfulfillable order
1003
+ */
1004
+ order_id: string;
1005
+ /**
1006
+ * Nullable string containing error reason if the signing is unsuccessful for the order
1007
+ */
1008
+ reason: string;
1009
+ };
1010
+
1000
1011
  declare class OrdersService {
1001
1012
  readonly httpRequest: BaseHttpRequest;
1002
1013
  constructor(httpRequest: BaseHttpRequest);
@@ -1074,7 +1085,10 @@ declare class OrdersService {
1074
1085
  chainName: ChainName;
1075
1086
  requestBody: Array<FulfillmentDataRequest>;
1076
1087
  }): CancelablePromise<{
1077
- result: Array<FulfillmentDataResult>;
1088
+ result: {
1089
+ fulfillable_orders: Array<FulfillableOrder>;
1090
+ unfulfillable_orders: Array<UnfulfillableOrder>;
1091
+ };
1078
1092
  }>;
1079
1093
  /**
1080
1094
  * List all trades
package/dist/orderbook.js CHANGED
@@ -1324,11 +1324,14 @@ class Orderbook {
1324
1324
  })),
1325
1325
  },
1326
1326
  ]);
1327
- if (fulfillmentDataRes.result.length !== 1) {
1328
- throw new Error('unexpected fulfillment data result length');
1327
+ if (fulfillmentDataRes.result.unfulfillable_orders?.length > 0) {
1328
+ throw new Error(`Unable to prepare fulfillment date: ${fulfillmentDataRes.result.unfulfillable_orders[0].reason}`);
1329
1329
  }
1330
- const extraData = fulfillmentDataRes.result[0].extra_data;
1331
- const orderResult = fulfillmentDataRes.result[0].order;
1330
+ else if (fulfillmentDataRes.result.fulfillable_orders?.length !== 1) {
1331
+ throw new Error('unexpected fulfillable order result length');
1332
+ }
1333
+ const extraData = fulfillmentDataRes.result.fulfillable_orders[0].extra_data;
1334
+ const orderResult = fulfillmentDataRes.result.fulfillable_orders[0].order;
1332
1335
  if (orderResult.status !== OrderStatus.ACTIVE) {
1333
1336
  throw new Error(`Cannot fulfil order that is not active. Current status: ${orderResult.status}`);
1334
1337
  }
package/dist/passport.js CHANGED
@@ -1785,7 +1785,7 @@ class MultiRollupApiClients {
1785
1785
  }
1786
1786
 
1787
1787
  // eslint-disable-next-line @typescript-eslint/naming-convention
1788
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.21.0' };
1788
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.22.0-alpha.1' };
1789
1789
  const createConfig = ({ basePath, headers, }) => {
1790
1790
  if (!basePath.trim()) {
1791
1791
  throw Error('basePath can not be empty');
@@ -1841,7 +1841,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
1841
1841
  chainID,
1842
1842
  coreContractAddress,
1843
1843
  registrationContractAddress,
1844
- sdkVersion: 'ts-immutable-sdk-0.21.0',
1844
+ sdkVersion: 'ts-immutable-sdk-0.22.0-alpha.1',
1845
1845
  });
1846
1846
  /**
1847
1847
  * Sets `sdkVersion` at the time of build
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imtbl/sdk",
3
3
  "description": "Immutable Unified SDK",
4
- "version": "0.21.0",
4
+ "version": "0.22.0-alpha.1",
5
5
  "author": "Immutable",
6
6
  "browser": "./dist/index.browser.js",
7
7
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",
@@ -10,8 +10,6 @@
10
10
  "@0xsequence/config": "^0.43.34",
11
11
  "@ethersproject/abi": "^5.7.0",
12
12
  "@ethersproject/abstract-signer": "^5.7.0",
13
- "@ethersproject/bignumber": "^5.7.0",
14
- "@ethersproject/contracts": "^5.7.0",
15
13
  "@ethersproject/providers": "^5.7.2",
16
14
  "@ethersproject/wallet": "^5.7.0",
17
15
  "@imtbl/core-sdk": "^2.0.2",
@@ -27,8 +25,7 @@
27
25
  "enc-utils": "^3.0.0",
28
26
  "ethers": "^5.7.2",
29
27
  "magic-sdk": "^13.3.1",
30
- "oidc-client-ts": "^2.2.1",
31
- "typechain": "^8.1.1"
28
+ "oidc-client-ts": "^2.2.1"
32
29
  },
33
30
  "devDependencies": {
34
31
  "@imtbl/blockchain-data": "0.0.0",
@@ -36,9 +33,6 @@
36
33
  "@imtbl/checkout-widgets": "0.0.0",
37
34
  "@imtbl/config": "0.0.0",
38
35
  "@imtbl/cryptofiat": "0.0.0",
39
- "@imtbl/erc20": "0.0.0",
40
- "@imtbl/erc721": "0.0.0",
41
- "@imtbl/erc721-mint-by-id": "0.0.0",
42
36
  "@imtbl/generated-clients": "0.0.0",
43
37
  "@imtbl/guardian": "0.0.0",
44
38
  "@imtbl/immutablex-client": "0.0.0",
@@ -103,18 +97,6 @@
103
97
  "./checkout_widgets": {
104
98
  "types": "./dist/checkout_widgets.d.ts",
105
99
  "import": "./dist/checkout_widgets.js"
106
- },
107
- "./erc20": {
108
- "types": "./dist/erc20.d.ts",
109
- "import": "./dist/erc20.js"
110
- },
111
- "./erc721": {
112
- "types": "./dist/erc721.d.ts",
113
- "import": "./dist/erc721.js"
114
- },
115
- "./erc721_mint_by_id": {
116
- "types": "./dist/erc721_mint_by_id.d.ts",
117
- "import": "./dist/erc721_mint_by_id.js"
118
100
  }
119
101
  },
120
102
  "files": [
package/dist/erc20.d.ts DELETED
@@ -1,296 +0,0 @@
1
- declare type Bytes = ArrayLike<number>;
2
- declare type BytesLike = Bytes | string;
3
- interface Hexable {
4
- toHexString(): string;
5
- }
6
-
7
- declare type BigNumberish = BigNumber | Bytes | bigint | string | number;
8
- declare class BigNumber implements Hexable {
9
- readonly _hex: string;
10
- readonly _isBigNumber: boolean;
11
- constructor(constructorGuard: any, hex: string);
12
- fromTwos(value: number): BigNumber;
13
- toTwos(value: number): BigNumber;
14
- abs(): BigNumber;
15
- add(other: BigNumberish): BigNumber;
16
- sub(other: BigNumberish): BigNumber;
17
- div(other: BigNumberish): BigNumber;
18
- mul(other: BigNumberish): BigNumber;
19
- mod(other: BigNumberish): BigNumber;
20
- pow(other: BigNumberish): BigNumber;
21
- and(other: BigNumberish): BigNumber;
22
- or(other: BigNumberish): BigNumber;
23
- xor(other: BigNumberish): BigNumber;
24
- mask(value: number): BigNumber;
25
- shl(value: number): BigNumber;
26
- shr(value: number): BigNumber;
27
- eq(other: BigNumberish): boolean;
28
- lt(other: BigNumberish): boolean;
29
- lte(other: BigNumberish): boolean;
30
- gt(other: BigNumberish): boolean;
31
- gte(other: BigNumberish): boolean;
32
- isNegative(): boolean;
33
- isZero(): boolean;
34
- toNumber(): number;
35
- toBigInt(): bigint;
36
- toString(): string;
37
- toHexString(): string;
38
- toJSON(key?: string): any;
39
- static from(value: any): BigNumber;
40
- static isBigNumber(value: any): value is BigNumber;
41
- }
42
-
43
- declare type Deferrable<T> = {
44
- [K in keyof T]: T[K] | Promise<T[K]>;
45
- };
46
- declare class Description<T = any> {
47
- constructor(info: {
48
- [K in keyof T]: T[K];
49
- });
50
- }
51
-
52
- declare type Network = {
53
- name: string;
54
- chainId: number;
55
- ensAddress?: string;
56
- _defaultProvider?: (providers: any, options?: any) => any;
57
- };
58
-
59
- declare type AccessList = Array<{
60
- address: string;
61
- storageKeys: Array<string>;
62
- }>;
63
- declare type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
64
- interface Transaction {
65
- hash?: string;
66
- to?: string;
67
- from?: string;
68
- nonce: number;
69
- gasLimit: BigNumber;
70
- gasPrice?: BigNumber;
71
- data: string;
72
- value: BigNumber;
73
- chainId: number;
74
- r?: string;
75
- s?: string;
76
- v?: number;
77
- type?: number | null;
78
- accessList?: AccessList;
79
- maxPriorityFeePerGas?: BigNumber;
80
- maxFeePerGas?: BigNumber;
81
- }
82
-
83
- interface OnceBlockable {
84
- once(eventName: "block", handler: () => void): void;
85
- }
86
-
87
- declare type TransactionRequest = {
88
- to?: string;
89
- from?: string;
90
- nonce?: BigNumberish;
91
- gasLimit?: BigNumberish;
92
- gasPrice?: BigNumberish;
93
- data?: BytesLike;
94
- value?: BigNumberish;
95
- chainId?: number;
96
- type?: number;
97
- accessList?: AccessListish;
98
- maxPriorityFeePerGas?: BigNumberish;
99
- maxFeePerGas?: BigNumberish;
100
- customData?: Record<string, any>;
101
- ccipReadEnabled?: boolean;
102
- };
103
- interface TransactionResponse extends Transaction {
104
- hash: string;
105
- blockNumber?: number;
106
- blockHash?: string;
107
- timestamp?: number;
108
- confirmations: number;
109
- from: string;
110
- raw?: string;
111
- wait: (confirmations?: number) => Promise<TransactionReceipt>;
112
- }
113
- declare type BlockTag = string | number;
114
- interface _Block {
115
- hash: string;
116
- parentHash: string;
117
- number: number;
118
- timestamp: number;
119
- nonce: string;
120
- difficulty: number;
121
- _difficulty: BigNumber;
122
- gasLimit: BigNumber;
123
- gasUsed: BigNumber;
124
- miner: string;
125
- extraData: string;
126
- baseFeePerGas?: null | BigNumber;
127
- }
128
- interface Block extends _Block {
129
- transactions: Array<string>;
130
- }
131
- interface BlockWithTransactions extends _Block {
132
- transactions: Array<TransactionResponse>;
133
- }
134
- interface Log {
135
- blockNumber: number;
136
- blockHash: string;
137
- transactionIndex: number;
138
- removed: boolean;
139
- address: string;
140
- data: string;
141
- topics: Array<string>;
142
- transactionHash: string;
143
- logIndex: number;
144
- }
145
- interface TransactionReceipt {
146
- to: string;
147
- from: string;
148
- contractAddress: string;
149
- transactionIndex: number;
150
- root?: string;
151
- gasUsed: BigNumber;
152
- logsBloom: string;
153
- blockHash: string;
154
- transactionHash: string;
155
- logs: Array<Log>;
156
- blockNumber: number;
157
- confirmations: number;
158
- cumulativeGasUsed: BigNumber;
159
- effectiveGasPrice: BigNumber;
160
- byzantium: boolean;
161
- type: number;
162
- status?: number;
163
- }
164
- interface FeeData {
165
- lastBaseFeePerGas: null | BigNumber;
166
- maxFeePerGas: null | BigNumber;
167
- maxPriorityFeePerGas: null | BigNumber;
168
- gasPrice: null | BigNumber;
169
- }
170
- interface EventFilter {
171
- address?: string;
172
- topics?: Array<string | Array<string> | null>;
173
- }
174
- interface Filter extends EventFilter {
175
- fromBlock?: BlockTag;
176
- toBlock?: BlockTag;
177
- }
178
- declare abstract class ForkEvent extends Description {
179
- readonly expiry: number;
180
- readonly _isForkEvent?: boolean;
181
- static isForkEvent(value: any): value is ForkEvent;
182
- }
183
- declare type EventType = string | Array<string | Array<string>> | EventFilter | ForkEvent;
184
- declare type Listener = (...args: Array<any>) => void;
185
- declare abstract class Provider implements OnceBlockable {
186
- abstract getNetwork(): Promise<Network>;
187
- abstract getBlockNumber(): Promise<number>;
188
- abstract getGasPrice(): Promise<BigNumber>;
189
- getFeeData(): Promise<FeeData>;
190
- abstract getBalance(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<BigNumber>;
191
- abstract getTransactionCount(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<number>;
192
- abstract getCode(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
193
- abstract getStorageAt(addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
194
- abstract sendTransaction(signedTransaction: string | Promise<string>): Promise<TransactionResponse>;
195
- abstract call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
196
- abstract estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
197
- abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<Block>;
198
- abstract getBlockWithTransactions(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<BlockWithTransactions>;
199
- abstract getTransaction(transactionHash: string): Promise<TransactionResponse>;
200
- abstract getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
201
- abstract getLogs(filter: Filter): Promise<Array<Log>>;
202
- abstract resolveName(name: string | Promise<string>): Promise<null | string>;
203
- abstract lookupAddress(address: string | Promise<string>): Promise<null | string>;
204
- abstract on(eventName: EventType, listener: Listener): Provider;
205
- abstract once(eventName: EventType, listener: Listener): Provider;
206
- abstract emit(eventName: EventType, ...args: Array<any>): boolean;
207
- abstract listenerCount(eventName?: EventType): number;
208
- abstract listeners(eventName?: EventType): Array<Listener>;
209
- abstract off(eventName: EventType, listener?: Listener): Provider;
210
- abstract removeAllListeners(eventName?: EventType): Provider;
211
- addListener(eventName: EventType, listener: Listener): Provider;
212
- removeListener(eventName: EventType, listener: Listener): Provider;
213
- abstract waitForTransaction(transactionHash: string, confirmations?: number, timeout?: number): Promise<TransactionReceipt>;
214
- readonly _isProvider: boolean;
215
- constructor();
216
- static isProvider(value: any): value is Provider;
217
- }
218
-
219
- interface Overrides {
220
- gasLimit?: BigNumberish | Promise<BigNumberish>;
221
- gasPrice?: BigNumberish | Promise<BigNumberish>;
222
- maxFeePerGas?: BigNumberish | Promise<BigNumberish>;
223
- maxPriorityFeePerGas?: BigNumberish | Promise<BigNumberish>;
224
- nonce?: BigNumberish | Promise<BigNumberish>;
225
- type?: number;
226
- accessList?: AccessListish;
227
- customData?: Record<string, any>;
228
- ccipReadEnabled?: boolean;
229
- }
230
- interface PayableOverrides extends Overrides {
231
- value?: BigNumberish | Promise<BigNumberish>;
232
- }
233
- interface CallOverrides extends PayableOverrides {
234
- blockTag?: BlockTag | Promise<BlockTag>;
235
- from?: string | Promise<string>;
236
- }
237
- interface PopulatedTransaction {
238
- to?: string;
239
- from?: string;
240
- nonce?: number;
241
- gasLimit?: BigNumber;
242
- gasPrice?: BigNumber;
243
- data?: string;
244
- value?: BigNumber;
245
- chainId?: number;
246
- type?: number;
247
- accessList?: AccessList;
248
- maxFeePerGas?: BigNumber;
249
- maxPriorityFeePerGas?: BigNumber;
250
- customData?: Record<string, any>;
251
- ccipReadEnabled?: boolean;
252
- }
253
-
254
- /* Autogenerated file. Do not edit manually. */
255
- /* tslint:disable */
256
- /* eslint-disable */
257
-
258
-
259
- type PromiseOrValue<T> = T | Promise<T>;
260
-
261
- declare class ERC20 {
262
- private readonly contract;
263
- constructor(contractAddress: string);
264
- /**
265
- * @returns a promise that resolves with a BigNumber that represents the amount of tokens in existence
266
- */
267
- totalSupply(provider: Provider, overrides?: CallOverrides): Promise<BigNumber>;
268
- /**
269
- * @returns a promise that resolves with a BigNumber that represents the amount of tokens owned by account
270
- */
271
- balanceOf(provider: Provider, account: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>;
272
- /**
273
- * @returns a promise that resolves with a BigNumber that represents the remaining number of tokens that spender will be allowed to spend on behalf of owner through transferFrom
274
- */
275
- allowance(provider: Provider, owner: PromiseOrValue<string>, spender: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>;
276
- /**
277
- * @returns a promise that resolves with a populated transaction
278
- */
279
- populateTransfer(to: PromiseOrValue<string>, amount: PromiseOrValue<BigNumberish>, overrides?: Overrides & {
280
- from?: PromiseOrValue<string>;
281
- }): Promise<PopulatedTransaction>;
282
- /**
283
- * @returns a promise that resolves with a populated transaction
284
- */
285
- populateApprove(spender: PromiseOrValue<string>, amount: PromiseOrValue<BigNumberish>, overrides?: Overrides & {
286
- from?: PromiseOrValue<string>;
287
- }): Promise<PopulatedTransaction>;
288
- /**
289
- * @returns a promise that resolves with a populated transaction
290
- */
291
- populateTransferFrom(from: PromiseOrValue<string>, to: PromiseOrValue<string>, amount: PromiseOrValue<BigNumberish>, overrides?: Overrides & {
292
- from?: PromiseOrValue<string>;
293
- }): Promise<PopulatedTransaction>;
294
- }
295
-
296
- export { ERC20 };