@imtbl/x-client 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 (82) hide show
  1. package/LICENSE.md +176 -0
  2. package/README.md +53 -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/IMXClient.d.ts +334 -0
  7. package/dist/types/config/config.test.d.ts +1 -0
  8. package/dist/types/config/index.d.ts +77 -0
  9. package/dist/types/contracts/@openzeppelin/contracts/index.d.ts +4 -0
  10. package/dist/types/contracts/@openzeppelin/contracts/token/ERC20/IERC20.d.ts +129 -0
  11. package/dist/types/contracts/@openzeppelin/contracts/token/ERC20/index.d.ts +1 -0
  12. package/dist/types/contracts/@openzeppelin/contracts/token/ERC721/IERC721.d.ts +199 -0
  13. package/dist/types/contracts/@openzeppelin/contracts/token/ERC721/index.d.ts +1 -0
  14. package/dist/types/contracts/@openzeppelin/contracts/token/index.d.ts +4 -0
  15. package/dist/types/contracts/@openzeppelin/contracts/utils/index.d.ts +2 -0
  16. package/dist/types/contracts/@openzeppelin/contracts/utils/introspection/IERC165.d.ts +29 -0
  17. package/dist/types/contracts/@openzeppelin/contracts/utils/introspection/index.d.ts +1 -0
  18. package/dist/types/contracts/@openzeppelin/index.d.ts +2 -0
  19. package/dist/types/contracts/common.d.ts +50 -0
  20. package/dist/types/contracts/contracts/index.d.ts +4 -0
  21. package/dist/types/contracts/contracts/v3/Core.d.ts +1088 -0
  22. package/dist/types/contracts/contracts/v3/Registration.d.ts +169 -0
  23. package/dist/types/contracts/contracts/v3/index.d.ts +2 -0
  24. package/dist/types/contracts/contracts/v4/CoreV4.d.ts +1650 -0
  25. package/dist/types/contracts/contracts/v4/RegistrationV4.d.ts +111 -0
  26. package/dist/types/contracts/contracts/v4/index.d.ts +2 -0
  27. package/dist/types/contracts/factories/@openzeppelin/contracts/index.d.ts +2 -0
  28. package/dist/types/contracts/factories/@openzeppelin/contracts/token/ERC20/IERC20__factory.d.ts +147 -0
  29. package/dist/types/contracts/factories/@openzeppelin/contracts/token/ERC20/index.d.ts +1 -0
  30. package/dist/types/contracts/factories/@openzeppelin/contracts/token/ERC721/IERC721__factory.d.ts +227 -0
  31. package/dist/types/contracts/factories/@openzeppelin/contracts/token/ERC721/index.d.ts +1 -0
  32. package/dist/types/contracts/factories/@openzeppelin/contracts/token/index.d.ts +2 -0
  33. package/dist/types/contracts/factories/@openzeppelin/contracts/utils/index.d.ts +1 -0
  34. package/dist/types/contracts/factories/@openzeppelin/contracts/utils/introspection/IERC165__factory.d.ts +21 -0
  35. package/dist/types/contracts/factories/@openzeppelin/contracts/utils/introspection/index.d.ts +1 -0
  36. package/dist/types/contracts/factories/@openzeppelin/index.d.ts +1 -0
  37. package/dist/types/contracts/factories/contracts/index.d.ts +2 -0
  38. package/dist/types/contracts/factories/contracts/v3/Core__factory.d.ts +1254 -0
  39. package/dist/types/contracts/factories/contracts/v3/Registration__factory.d.ts +214 -0
  40. package/dist/types/contracts/factories/contracts/v3/index.d.ts +2 -0
  41. package/dist/types/contracts/factories/contracts/v4/CoreV4__factory.d.ts +1890 -0
  42. package/dist/types/contracts/factories/contracts/v4/RegistrationV4__factory.d.ts +168 -0
  43. package/dist/types/contracts/factories/contracts/v4/index.d.ts +2 -0
  44. package/dist/types/contracts/factories/index.d.ts +2 -0
  45. package/dist/types/contracts/index.d.ts +19 -0
  46. package/dist/types/exportContracts.d.ts +2 -0
  47. package/dist/types/exportUtils.d.ts +1 -0
  48. package/dist/types/imx.test.d.ts +1 -0
  49. package/dist/types/index.d.ts +11 -0
  50. package/dist/types/types/api.d.ts +223 -0
  51. package/dist/types/types/errors.d.ts +9 -0
  52. package/dist/types/types/index.d.ts +6 -0
  53. package/dist/types/types/requests.d.ts +53 -0
  54. package/dist/types/types/signers.d.ts +37 -0
  55. package/dist/types/types/tokens.d.ts +51 -0
  56. package/dist/types/types/transfers.d.ts +17 -0
  57. package/dist/types/utils/convertToSignableToken.d.ts +8 -0
  58. package/dist/types/utils/crypto/crypto.d.ts +16 -0
  59. package/dist/types/utils/crypto/crypto.test.d.ts +1 -0
  60. package/dist/types/utils/crypto/index.d.ts +1 -0
  61. package/dist/types/utils/formatError.d.ts +7 -0
  62. package/dist/types/utils/formatError.test.d.ts +1 -0
  63. package/dist/types/utils/index.d.ts +5 -0
  64. package/dist/types/utils/stark/errors.d.ts +3 -0
  65. package/dist/types/utils/stark/getStarkPublicKeyFromImx.d.ts +12 -0
  66. package/dist/types/utils/stark/legacy/crypto/constants.d.ts +27 -0
  67. package/dist/types/utils/stark/legacy/crypto/crypto.d.ts +14 -0
  68. package/dist/types/utils/stark/legacy/crypto/index.d.ts +2 -0
  69. package/dist/types/utils/stark/legacy/crypto/points.d.ts +1 -0
  70. package/dist/types/utils/stark/legacy/crypto/types.d.ts +18 -0
  71. package/dist/types/utils/stark/starkCurve.d.ts +18 -0
  72. package/dist/types/utils/stark/starkCurve.test.d.ts +1 -0
  73. package/dist/types/utils/stark/starkSigner.d.ts +17 -0
  74. package/dist/types/utils/stark/starkSigner.test.d.ts +1 -0
  75. package/dist/types/workflows/errors.d.ts +3 -0
  76. package/dist/types/workflows/exchangeTransfers.d.ts +8 -0
  77. package/dist/types/workflows/index.d.ts +1 -0
  78. package/dist/types/workflows/minting.d.ts +4 -0
  79. package/dist/types/workflows/orders.d.ts +13 -0
  80. package/dist/types/workflows/trades.d.ts +8 -0
  81. package/dist/types/workflows/workflows.d.ts +29 -0
  82. package/package.json +70 -0
@@ -0,0 +1,334 @@
1
+ import { ImxConfiguration, ImxModuleConfiguration } from './config';
2
+ import type { AddMetadataSchemaToCollectionRequest, Asset, AssetsApi, AssetsApiGetAssetRequest, AssetsApiListAssetsRequest, Balance, BalancesApi, BalancesApiGetBalanceRequest, BalancesApiListBalancesRequest, Collection, CollectionFilter, CollectionsApi, CollectionsApiGetCollectionRequest, CollectionsApiListCollectionFiltersRequest, CollectionsApiListCollectionsRequest, CreateCollectionRequest, CreateMetadataRefreshRequest, CreateMetadataRefreshResponse, CreateTransferResponseV1, CurrencyWithLimits, Deposit, DepositsApi, DepositsApiGetDepositRequest, DepositsApiListDepositsRequest, EncodingApi, EthSigner, Exchange, ExchangeCreateExchangeAndURLResponse, ExchangesApi, ExchangesApiCreateExchangeRequest, ExchangesApiGetExchangeRequest, ExchangesApiGetExchangesRequest, GetMetadataRefreshErrorsResponse, GetMetadataRefreshes, GetMetadataRefreshResponse, GetTransactionsResponse, GetUsersApiResponse, ListAssetsResponse, ListBalancesResponse, ListCollectionsResponse, ListDepositsResponse, ListMintsResponse, ListOrdersResponseV3, ListTokensResponse, ListTradesResponse, ListTransfersResponse, ListWithdrawalsResponse, MetadataApi, MetadataApiGetMetadataSchemaRequest, MetadataRefreshesApi, MetadataSchemaProperty, MetadataSchemaRequest, Mint, MintsApi, MintsApiGetMintRequest, MintsApiListMintsRequest, MintTokensResponse, NftCheckoutPrimaryApi, NftCheckoutPrimaryApiCreateNftPrimaryRequest, NftCheckoutPrimaryApiGetCurrenciesNFTCheckoutPrimaryRequest, NftCheckoutPrimaryApiGetNftPrimaryTransactionRequest, NftCheckoutPrimaryApiGetNftPrimaryTransactionsRequest, NftprimarytransactionCreateResponse, NftprimarytransactionGetResponse, NftprimarytransactionListTransactionsResponse, OrdersApi, OrdersApiGetOrderV3Request, OrdersApiListOrdersV3Request, OrderV3, Project, ProjectsApi, SuccessResponse, TokenDetails, TokensApi, TokensApiGetTokenRequest, TokensApiListTokensRequest, Trade, TradesApi, TradesApiGetTradeV3Request, TradesApiListTradesV3Request, Transfer, TransfersApi, TransfersApiGetTransferRequest, TransfersApiListTransfersRequest, UnsignedExchangeTransferRequest, UnsignedMintRequest, UpdateCollectionRequest, UsersApi, WalletConnection, Withdrawal, WithdrawalsApi, WithdrawalsApiGetWithdrawalRequest, WithdrawalsApiListWithdrawalsRequest } from './types';
3
+ import { Workflows } from './workflows';
4
+ export declare class IMXClient {
5
+ private immutableX;
6
+ imxConfig: ImxConfiguration;
7
+ assetApi: AssetsApi;
8
+ balanceApi: BalancesApi;
9
+ collectionApi: CollectionsApi;
10
+ depositsApi: DepositsApi;
11
+ encodingApi: EncodingApi;
12
+ exchangeApi: ExchangesApi;
13
+ metadataApi: MetadataApi;
14
+ metadataRefreshesApi: MetadataRefreshesApi;
15
+ mintsApi: MintsApi;
16
+ nftCheckoutPrimaryApi: NftCheckoutPrimaryApi;
17
+ ordersApi: OrdersApi;
18
+ projectsApi: ProjectsApi;
19
+ tokensApi: TokensApi;
20
+ tradesApi: TradesApi;
21
+ transfersApi: TransfersApi;
22
+ usersApi: UsersApi;
23
+ withdrawalsApi: WithdrawalsApi;
24
+ workflows: Workflows;
25
+ constructor(config: ImxModuleConfiguration);
26
+ /**
27
+ * Get details of a Deposit with the given ID
28
+ * @param request - the request object containing the parameters to be provided in the API request
29
+ * @returns a promise that resolves with the requested Deposit
30
+ * @throws {@link IMXError}
31
+ */
32
+ getDeposit(request: DepositsApiGetDepositRequest): Promise<Deposit>;
33
+ /**
34
+ * Get a list of Deposits
35
+ * @param request - optional object containing the parameters to be provided in the API request
36
+ * @returns a promise that resolves with the requested list of Deposits
37
+ * @throws {@link IMXError}
38
+ */
39
+ listDeposits(request?: DepositsApiListDepositsRequest): Promise<ListDepositsResponse>;
40
+ /**
41
+ * Get Stark keys for a registered User
42
+ * @param ethAddress - the eth address of the User
43
+ * @returns a promise that resolves with the requested User
44
+ * @throws {@link IMXError}
45
+ */
46
+ getUser(ethAddress: string): Promise<GetUsersApiResponse>;
47
+ /**
48
+ * Get details of an Asset
49
+ * @param request - the request object containing the parameters to be provided in the API request
50
+ * @returns a promise that resolves with the requested Asset
51
+ * @throws {@link IMXError}
52
+ */
53
+ getAsset(request: AssetsApiGetAssetRequest): Promise<Asset>;
54
+ /**
55
+ * Get a list of Assets
56
+ * @param request - optional object containing the parameters to be provided in the API request
57
+ * @returns a promise that resolves with the requested list of Assets
58
+ * @throws {@link IMXError}
59
+ */
60
+ listAssets(request?: AssetsApiListAssetsRequest): Promise<ListAssetsResponse>;
61
+ /**
62
+ * Create a Collection
63
+ * @param ethSigner - the L1 signer
64
+ * @param request - the request object to be provided in the API request
65
+ * @returns a promise that resolves with the created Collection
66
+ * @throws {@link IMXError}
67
+ */
68
+ createCollection(ethSigner: EthSigner, request: CreateCollectionRequest): Promise<Collection>;
69
+ /**
70
+ * Get details of a Collection at the given address
71
+ * @param request - the request object containing the parameters to be provided in the API request
72
+ * @returns a promise that resolves with the requested Collection
73
+ * @throws {@link IMXError}
74
+ */
75
+ getCollection(request: CollectionsApiGetCollectionRequest): Promise<Collection>;
76
+ /**
77
+ * Get a list of Collection filters
78
+ * @param request - the request object containing the parameters to be provided in the API request
79
+ * @returns a promise that resolves with the requested list of Collection Filters
80
+ * @throws {@link IMXError}
81
+ */
82
+ listCollectionFilters(request: CollectionsApiListCollectionFiltersRequest): Promise<CollectionFilter[]>;
83
+ /**
84
+ * Get a list of Collections
85
+ * @param request - optional object containing the parameters to be provided in the API request
86
+ * @returns a promise that resolves with the requested list of Collections
87
+ * @throws {@link IMXError}
88
+ */
89
+ listCollections(request?: CollectionsApiListCollectionsRequest): Promise<ListCollectionsResponse>;
90
+ /**
91
+ * Update a Collection
92
+ * @param ethSigner - the L1 signer
93
+ * @param collectionAddress - the Collection contract address
94
+ * @param request - the request object containing the parameters to be provided in the API request
95
+ * @returns a promise that resolves with the updated Collection
96
+ * @throws {@link IMXError}
97
+ */
98
+ updateCollection(ethSigner: EthSigner, collectionAddress: string, request: UpdateCollectionRequest): Promise<Collection>;
99
+ /**
100
+ * Add metadata schema to Collection
101
+ * @param ethSigner - the L1 signer
102
+ * @param collectionAddress - the Collection contract address
103
+ * @param request - the request object containing the parameters to be provided in the API request
104
+ * @returns a promise that resolves with the SuccessResponse if successful
105
+ * @throws {@link IMXError}
106
+ */
107
+ addMetadataSchemaToCollection(ethSigner: EthSigner, collectionAddress: string, request: AddMetadataSchemaToCollectionRequest): Promise<SuccessResponse>;
108
+ /**
109
+ * Get Metadata schema
110
+ * @param request - the request object containing the parameters to be provided in the API request
111
+ * @returns a promise that resolves with the requested Metadata schema
112
+ * @throws {@link IMXError}
113
+ */
114
+ getMetadataSchema(request: MetadataApiGetMetadataSchemaRequest): Promise<MetadataSchemaProperty[]>;
115
+ /**
116
+ * Update metadata schema by name
117
+ * @param ethSigner - the L1 signer
118
+ * @param collectionAddress - the Collection contract address
119
+ * @param name - the Metadata schema name
120
+ * @param request - the request object containing the parameters to be provided in the API request
121
+ * @returns a promise that resolves with the {@link SuccessResponse}
122
+ * @throws {@link IMXError}
123
+ */
124
+ updateMetadataSchemaByName(ethSigner: EthSigner, collectionAddress: string, name: string, request: MetadataSchemaRequest): Promise<SuccessResponse>;
125
+ /**
126
+ * Get a list of metadata refreshes
127
+ * @param ethSigner - the L1 signer
128
+ * @param collectionAddress - the Collection contract address
129
+ * @param pageSize - the page size of the result
130
+ * @param cursor - the cursor
131
+ * @returns a promise that resolves with the requested metadata refreshes
132
+ * @throws {@link IMXError}
133
+ */
134
+ listMetadataRefreshes(ethSigner: EthSigner, collectionAddress?: string, pageSize?: number, cursor?: string): Promise<GetMetadataRefreshes>;
135
+ /**
136
+ * Get a list of metadata refresh errors
137
+ * @param ethSigner - the L1 signer
138
+ * @param refreshId - the metadata refresh ID
139
+ * @param pageSize - the page size of the result
140
+ * @param cursor - the cursor
141
+ * @returns a promise that resolves with the requested metadata refresh errors
142
+ * @throws {@link IMXError}
143
+ */
144
+ getMetadataRefreshErrors(ethSigner: EthSigner, refreshId: string, pageSize?: number, cursor?: string): Promise<GetMetadataRefreshErrorsResponse>;
145
+ /**
146
+ * Get a list of metadata refresh results
147
+ * @param ethSigner - the L1 signer
148
+ * @param refreshId - the metadata refresh ID
149
+ * @returns a promise that resolves with the requested metadata refresh results
150
+ * @throws {@link IMXError}
151
+ */
152
+ getMetadataRefreshResults(ethSigner: EthSigner, refreshId: string): Promise<GetMetadataRefreshResponse>;
153
+ /**
154
+ * Request a metadata refresh
155
+ * @param ethSigner - the L1 signer
156
+ * @param request the request object containing the parameters to be provided in the API request
157
+ * @returns a promise that resolves with the requested metadata refresh
158
+ * @throws {@link IMXError}
159
+ */
160
+ createMetadataRefresh(ethSigner: EthSigner, request: CreateMetadataRefreshRequest): Promise<CreateMetadataRefreshResponse>;
161
+ /**
162
+ * Get a Project
163
+ * @param ethSigner - the L1 signer
164
+ * @param id - the Project ID
165
+ * @returns a promise that resolves with the requested Project
166
+ * @throws {@link IMXError}
167
+ */
168
+ getProject(ethSigner: EthSigner, id: string): Promise<Project>;
169
+ /**
170
+ * Get the token Balances of the User
171
+ * @param request - the request object containing the parameters to be provided in the API request
172
+ * @returns a promise that resolves with the requested Balance
173
+ * @throws {@link IMXError}
174
+ */
175
+ getBalance(request: BalancesApiGetBalanceRequest): Promise<Balance>;
176
+ /**
177
+ * Get a list of Balances for given User
178
+ * @param request the request object containing the parameters to be provided in the API request
179
+ * @returns a promise that resolves with the requested list of Balances
180
+ * @throws {@link IMXError}
181
+ */
182
+ listBalances(request: BalancesApiListBalancesRequest): Promise<ListBalancesResponse>;
183
+ /**
184
+ * Get details of a Mint with the given ID
185
+ * @param request the request object containing the parameters to be provided in the API request
186
+ * @returns a promise that resolves with the requested Mint
187
+ * @throws {@link IMXError}
188
+ */
189
+ getMint(request: MintsApiGetMintRequest): Promise<Mint[]>;
190
+ /**
191
+ * Get a list of Mints
192
+ * @param request optional object containing the parameters to be provided in the API request
193
+ * @returns a promise that resolves with the requested list of Mints
194
+ * @throws {@link IMXError}
195
+ */
196
+ listMints(request?: MintsApiListMintsRequest): Promise<ListMintsResponse>;
197
+ /**
198
+ * Mint tokens in a batch with fees
199
+ * @param ethSigner - the L1 signer
200
+ * @param request - the request object to be provided in the API request
201
+ * @returns a promise that resolves with the minted tokens
202
+ * @throws {@link IMXError}
203
+ */
204
+ mint(ethSigner: EthSigner, request: UnsignedMintRequest): Promise<MintTokensResponse>;
205
+ /**
206
+ * Get a list of Withdrawals
207
+ * @param request - optional object containing the parameters to be provided in the API request
208
+ * @returns a promise that resolves with the requested list of Withdrawals
209
+ * @throws {@link IMXError}
210
+ */
211
+ listWithdrawals(request?: WithdrawalsApiListWithdrawalsRequest): Promise<ListWithdrawalsResponse>;
212
+ /**
213
+ * Get details of Withdrawal with the given ID
214
+ * @param request - the request object containing the parameters to be provided in the API request
215
+ * @returns a promise that resolves with the requested Withdrawal
216
+ * @throws {@link IMXError}
217
+ */
218
+ getWithdrawal(request: WithdrawalsApiGetWithdrawalRequest): Promise<Withdrawal>;
219
+ /**
220
+ * Get details of an Order with the given ID
221
+ * @param request - the request object containing the parameters to be provided in the API request
222
+ * @returns a promise that resolves with the requested Order
223
+ * @throws {@link IMXError}
224
+ */
225
+ getOrder(request: OrdersApiGetOrderV3Request): Promise<OrderV3>;
226
+ /**
227
+ * Get a list of Orders
228
+ * @param request - optional object containing the parameters to be provided in the API request
229
+ * @returns a promise that resolves with the requested list of Orders
230
+ * @throws {@link IMXError}
231
+ */
232
+ listOrders(request?: OrdersApiListOrdersV3Request): Promise<ListOrdersResponseV3>;
233
+ /**
234
+ * Get details of a Trade with the given ID
235
+ * @param request - the request object containing the parameters to be provided in the API request
236
+ * @returns a promise that resolves with the requested Trade
237
+ * @throws {@link IMXError}
238
+ */
239
+ getTrade(request: TradesApiGetTradeV3Request): Promise<Trade>;
240
+ /**
241
+ * Get a list of Trades
242
+ * @param request - optional object containing the parameters to be provided in the API request
243
+ * @returns a promise that resolves with the requested list of Trades
244
+ * @throws {@link IMXError}
245
+ */
246
+ listTrades(request?: TradesApiListTradesV3Request): Promise<ListTradesResponse>;
247
+ /**
248
+ * Get details of a Token
249
+ * @param request - the request object containing the parameters to be provided in the API request
250
+ * @returns a promise that resolves with the requested Token
251
+ * @throws {@link IMXError}
252
+ */
253
+ getToken(request: TokensApiGetTokenRequest): Promise<TokenDetails>;
254
+ /**
255
+ * Get a list of Tokens
256
+ * @param request - optional object containing the parameters to be provided in the API request
257
+ * @returns a promise that resolves with the requested list of Tokens
258
+ * @throws {@link IMXError}
259
+ */
260
+ listTokens(request?: TokensApiListTokensRequest): Promise<ListTokensResponse>;
261
+ /**
262
+ * Get details of a Transfer with the given ID
263
+ * @param request - the request object containing the parameters to be provided in the API request
264
+ * @returns a promise that resolves with the requested Transfer
265
+ * @throws {@link IMXError}
266
+ */
267
+ getTransfer(request: TransfersApiGetTransferRequest): Promise<Transfer>;
268
+ /**
269
+ * Get a list of Transfers
270
+ * @param request - optional object containing the parameters to be provided in the API request
271
+ * @returns a promise that resolves with the requested list of Transfers
272
+ * @throws {@link IMXError}
273
+ */
274
+ listTransfers(request?: TransfersApiListTransfersRequest): Promise<ListTransfersResponse>;
275
+ /**
276
+ * Create a new Exchange transaction
277
+ * @param request - the request object to be provided in the API request
278
+ * @returns a promise that resolves with the created Exchange Transaction
279
+ * @throws {@link IMXError}
280
+ */
281
+ createExchange(request: ExchangesApiCreateExchangeRequest): Promise<ExchangeCreateExchangeAndURLResponse>;
282
+ /**
283
+ * Get an Exchange transaction
284
+ * @param request - the request object to be provided in the API request
285
+ * @returns a promise that resolves with the Exchange Transaction
286
+ * @throws {@link IMXError}
287
+ */
288
+ getExchange(request: ExchangesApiGetExchangeRequest): Promise<Exchange>;
289
+ /**
290
+ * Get Exchange transactions
291
+ * @param request - the request object to be provided in the API request
292
+ * @returns a promise that resolves with Exchange Transactions
293
+ * @throws {@link IMXError}
294
+ */
295
+ getExchanges(request: ExchangesApiGetExchangesRequest): Promise<GetTransactionsResponse>;
296
+ /**
297
+ * Create a new Transfer request
298
+ * @param walletConnection - the pair of Eth/Stark signers
299
+ * @param request - the request object to be provided in the API request
300
+ * @returns a promise that resolves with the created Exchange Transfer
301
+ * @throws {@link IMXError}
302
+ */
303
+ exchangeTransfer(walletConnection: WalletConnection, request: UnsignedExchangeTransferRequest): Promise<CreateTransferResponseV1>;
304
+ /**
305
+ * Create a new nft primary transaction
306
+ * @param request - the request object to be provided in the API request
307
+ * @returns a promise that resolves with the created nft primary Transaction
308
+ * @throws {@link IMXError}
309
+ */
310
+ createNftPrimary(request: NftCheckoutPrimaryApiCreateNftPrimaryRequest): Promise<NftprimarytransactionCreateResponse>;
311
+ /**
312
+ * Get nft primary supported currencies and their limits
313
+ * @param request - the request object to be provided in the API request
314
+ * @returns a promise that resolves with nft primary Currencies
315
+ * @throws {@link IMXError}
316
+ */
317
+ getCurrenciesNFTCheckoutPrimary(request: NftCheckoutPrimaryApiGetCurrenciesNFTCheckoutPrimaryRequest): Promise<CurrencyWithLimits>;
318
+ /**
319
+ * Get nft primary transaction by transaction id
320
+ * @param request - the request object to be provided in the API request
321
+ * @returns a promise that resolves with nft primary transaction
322
+ * @throws {@link IMXError}
323
+ */
324
+ getNftPrimaryTransaction(request: NftCheckoutPrimaryApiGetNftPrimaryTransactionRequest): Promise<NftprimarytransactionGetResponse>;
325
+ /**
326
+ * Get list of nft primary transactions
327
+ * @param request - the request object to be provided in the API request
328
+ * @returns a promise that resolves with nft primary transaction
329
+ * @throws {@link IMXError}
330
+ */
331
+ getNftPrimaryTransactions(request: NftCheckoutPrimaryApiGetNftPrimaryTransactionsRequest): Promise<NftprimarytransactionListTransactionsResponse>;
332
+ }
333
+ export declare class ImmutableX extends IMXClient {
334
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,77 @@
1
+ import { imx } from '@imtbl/generated-clients';
2
+ import { Environment, ImmutableConfiguration, ModuleConfiguration } from '@imtbl/config';
3
+ export { Environment, ImmutableConfiguration } from '@imtbl/config';
4
+ export declare class ApiConfiguration extends imx.Configuration {
5
+ }
6
+ interface ImmutableXConfigurationParams {
7
+ basePath: string;
8
+ chainID: number;
9
+ coreContractAddress: string;
10
+ registrationContractAddress: string;
11
+ registrationV4ContractAddress?: string;
12
+ baseConfig?: ImmutableConfiguration;
13
+ }
14
+ export interface EthConfiguration {
15
+ coreContractAddress: string;
16
+ registrationContractAddress: string;
17
+ registrationV4ContractAddress?: string;
18
+ chainID: number;
19
+ }
20
+ interface ImxEnvironment extends EthConfiguration {
21
+ basePath: string;
22
+ headers?: Record<string, string>;
23
+ sdkVersion?: string;
24
+ baseConfig?: ImmutableConfiguration;
25
+ }
26
+ export interface ImmutableXConfiguration {
27
+ /**
28
+ * The configuration for the API client
29
+ */
30
+ apiConfiguration: ApiConfiguration;
31
+ /**
32
+ * The configuration for the Ethereum network
33
+ */
34
+ ethConfiguration: EthConfiguration;
35
+ }
36
+ /**
37
+ * @dev use createImmutableXConfiguration instead
38
+ */
39
+ export declare const createConfig: ({ coreContractAddress, registrationContractAddress, registrationV4ContractAddress, chainID, basePath, headers, sdkVersion, baseConfig, }: ImxEnvironment) => ImmutableXConfiguration;
40
+ /**
41
+ * createImmutableXConfiguration to create a custom ImmutableXConfiguration
42
+ * other than the production and sandbox defined below.
43
+ */
44
+ export declare const createImmutableXConfiguration: ({ basePath, chainID, coreContractAddress, registrationContractAddress, registrationV4ContractAddress, baseConfig, }: ImmutableXConfigurationParams) => ImmutableXConfiguration;
45
+ interface environmentConfig {
46
+ baseConfig?: ImmutableConfiguration;
47
+ }
48
+ export declare const production: ({ baseConfig }: environmentConfig) => ImmutableXConfiguration;
49
+ export declare const sandbox: ({ baseConfig }: environmentConfig) => ImmutableXConfiguration;
50
+ export interface ImxOverrides {
51
+ immutableXConfig: ImmutableXConfiguration;
52
+ }
53
+ export interface ImxModuleConfiguration extends ModuleConfiguration<ImxOverrides> {
54
+ }
55
+ export declare class ImxConfiguration {
56
+ readonly immutableXConfig: ImmutableXConfiguration;
57
+ readonly baseConfig: ImmutableConfiguration;
58
+ constructor({ baseConfig, overrides }: ImxModuleConfiguration);
59
+ }
60
+ export interface ConfigOptions {
61
+ environment: Environment;
62
+ apiKey?: string;
63
+ publishableKey?: string;
64
+ rateLimitingKey?: string;
65
+ }
66
+ /**
67
+ * @name imxClientConfig
68
+ * @description Helper method to create a standard ImxModuleConfiguration
69
+ * object for the IMXClient class. If you need to override the default
70
+ * configuration, manually construct the ImxModuleConfiguration object.
71
+ * @param configOptions {ConfigOptions} The configuration options
72
+ * @param configOptions.environment {Environment} The environment to connect to
73
+ * @param configOptions.apkKey {string} The API key from Immutable Hub
74
+ * @param configOptions.publishableKey {string} The publishable key from Immutable Hub
75
+ * @returns {ImxModuleConfiguration}
76
+ */
77
+ export declare const imxClientConfig: (configOptions: ConfigOptions) => ImxModuleConfiguration;
@@ -0,0 +1,4 @@
1
+ import type * as token from "./token";
2
+ export type { token };
3
+ import type * as utils from "./utils";
4
+ export type { utils };
@@ -0,0 +1,129 @@
1
+ import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "ethers";
2
+ import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "../../../../common";
3
+ export interface IERC20Interface extends Interface {
4
+ getFunction(nameOrSignature: "allowance" | "approve" | "balanceOf" | "totalSupply" | "transfer" | "transferFrom"): FunctionFragment;
5
+ getEvent(nameOrSignatureOrTopic: "Approval" | "Transfer"): EventFragment;
6
+ encodeFunctionData(functionFragment: "allowance", values: [AddressLike, AddressLike]): string;
7
+ encodeFunctionData(functionFragment: "approve", values: [AddressLike, BigNumberish]): string;
8
+ encodeFunctionData(functionFragment: "balanceOf", values: [AddressLike]): string;
9
+ encodeFunctionData(functionFragment: "totalSupply", values?: undefined): string;
10
+ encodeFunctionData(functionFragment: "transfer", values: [AddressLike, BigNumberish]): string;
11
+ encodeFunctionData(functionFragment: "transferFrom", values: [AddressLike, AddressLike, BigNumberish]): string;
12
+ decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result;
13
+ decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result;
14
+ decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result;
15
+ decodeFunctionResult(functionFragment: "totalSupply", data: BytesLike): Result;
16
+ decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result;
17
+ decodeFunctionResult(functionFragment: "transferFrom", data: BytesLike): Result;
18
+ }
19
+ export declare namespace ApprovalEvent {
20
+ type InputTuple = [
21
+ owner: AddressLike,
22
+ spender: AddressLike,
23
+ value: BigNumberish
24
+ ];
25
+ type OutputTuple = [owner: string, spender: string, value: bigint];
26
+ interface OutputObject {
27
+ owner: string;
28
+ spender: string;
29
+ value: bigint;
30
+ }
31
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
32
+ type Filter = TypedDeferredTopicFilter<Event>;
33
+ type Log = TypedEventLog<Event>;
34
+ type LogDescription = TypedLogDescription<Event>;
35
+ }
36
+ export declare namespace TransferEvent {
37
+ type InputTuple = [
38
+ from: AddressLike,
39
+ to: AddressLike,
40
+ value: BigNumberish
41
+ ];
42
+ type OutputTuple = [from: string, to: string, value: bigint];
43
+ interface OutputObject {
44
+ from: string;
45
+ to: string;
46
+ value: bigint;
47
+ }
48
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
49
+ type Filter = TypedDeferredTopicFilter<Event>;
50
+ type Log = TypedEventLog<Event>;
51
+ type LogDescription = TypedLogDescription<Event>;
52
+ }
53
+ export interface IERC20 extends BaseContract {
54
+ connect(runner?: ContractRunner | null): IERC20;
55
+ waitForDeployment(): Promise<this>;
56
+ interface: IERC20Interface;
57
+ queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
58
+ queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
59
+ on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
60
+ on<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
61
+ once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
62
+ once<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
63
+ listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
64
+ listeners(eventName?: string): Promise<Array<Listener>>;
65
+ removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
66
+ allowance: TypedContractMethod<[
67
+ owner: AddressLike,
68
+ spender: AddressLike
69
+ ], [
70
+ bigint
71
+ ], "view">;
72
+ approve: TypedContractMethod<[
73
+ spender: AddressLike,
74
+ amount: BigNumberish
75
+ ], [
76
+ boolean
77
+ ], "nonpayable">;
78
+ balanceOf: TypedContractMethod<[account: AddressLike], [bigint], "view">;
79
+ totalSupply: TypedContractMethod<[], [bigint], "view">;
80
+ transfer: TypedContractMethod<[
81
+ to: AddressLike,
82
+ amount: BigNumberish
83
+ ], [
84
+ boolean
85
+ ], "nonpayable">;
86
+ transferFrom: TypedContractMethod<[
87
+ from: AddressLike,
88
+ to: AddressLike,
89
+ amount: BigNumberish
90
+ ], [
91
+ boolean
92
+ ], "nonpayable">;
93
+ getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
94
+ getFunction(nameOrSignature: "allowance"): TypedContractMethod<[
95
+ owner: AddressLike,
96
+ spender: AddressLike
97
+ ], [
98
+ bigint
99
+ ], "view">;
100
+ getFunction(nameOrSignature: "approve"): TypedContractMethod<[
101
+ spender: AddressLike,
102
+ amount: BigNumberish
103
+ ], [
104
+ boolean
105
+ ], "nonpayable">;
106
+ getFunction(nameOrSignature: "balanceOf"): TypedContractMethod<[account: AddressLike], [bigint], "view">;
107
+ getFunction(nameOrSignature: "totalSupply"): TypedContractMethod<[], [bigint], "view">;
108
+ getFunction(nameOrSignature: "transfer"): TypedContractMethod<[
109
+ to: AddressLike,
110
+ amount: BigNumberish
111
+ ], [
112
+ boolean
113
+ ], "nonpayable">;
114
+ getFunction(nameOrSignature: "transferFrom"): TypedContractMethod<[
115
+ from: AddressLike,
116
+ to: AddressLike,
117
+ amount: BigNumberish
118
+ ], [
119
+ boolean
120
+ ], "nonpayable">;
121
+ getEvent(key: "Approval"): TypedContractEvent<ApprovalEvent.InputTuple, ApprovalEvent.OutputTuple, ApprovalEvent.OutputObject>;
122
+ getEvent(key: "Transfer"): TypedContractEvent<TransferEvent.InputTuple, TransferEvent.OutputTuple, TransferEvent.OutputObject>;
123
+ filters: {
124
+ "Approval(address,address,uint256)": TypedContractEvent<ApprovalEvent.InputTuple, ApprovalEvent.OutputTuple, ApprovalEvent.OutputObject>;
125
+ Approval: TypedContractEvent<ApprovalEvent.InputTuple, ApprovalEvent.OutputTuple, ApprovalEvent.OutputObject>;
126
+ "Transfer(address,address,uint256)": TypedContractEvent<TransferEvent.InputTuple, TransferEvent.OutputTuple, TransferEvent.OutputObject>;
127
+ Transfer: TypedContractEvent<TransferEvent.InputTuple, TransferEvent.OutputTuple, TransferEvent.OutputObject>;
128
+ };
129
+ }
@@ -0,0 +1 @@
1
+ export type { IERC20 } from "./IERC20";