@imtbl/sdk 0.44.4-alpha.1 → 0.45.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/sdk.js +5 -5
- package/dist/checkout.d.ts +2 -2
- package/dist/checkout.js +11 -8
- package/dist/index.browser.js +8 -8
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +2114 -2116
- package/dist/index.d.ts +209 -214
- package/dist/index.js +2116 -2117
- package/dist/passport.d.ts +2 -2
- package/dist/passport.js +4 -4
- package/dist/{immutablex_client.d.ts → x.d.ts} +155 -2
- package/dist/{provider.js → x.js} +522 -9
- package/package.json +7 -11
- package/dist/immutablex_client.js +0 -523
- package/dist/provider.d.ts +0 -979
package/dist/passport.d.ts
CHANGED
|
@@ -9846,7 +9846,7 @@ interface ImxOverrides {
|
|
|
9846
9846
|
interface ImxModuleConfiguration extends ModuleConfiguration<ImxOverrides> {
|
|
9847
9847
|
}
|
|
9848
9848
|
|
|
9849
|
-
declare class
|
|
9849
|
+
declare class IMXClient {
|
|
9850
9850
|
private immutableX;
|
|
9851
9851
|
depositsApi: DepositsApi$1;
|
|
9852
9852
|
mintsApi: MintsApi$1;
|
|
@@ -20972,7 +20972,7 @@ interface PassportOverrides {
|
|
|
20972
20972
|
magicProviderId: string;
|
|
20973
20973
|
passportDomain: string;
|
|
20974
20974
|
imxPublicApiDomain: string;
|
|
20975
|
-
immutableXClient:
|
|
20975
|
+
immutableXClient: IMXClient;
|
|
20976
20976
|
imxApiClients: ImxApiClients;
|
|
20977
20977
|
zkEvmRpcUrl: string;
|
|
20978
20978
|
relayerUrl: string;
|
package/dist/passport.js
CHANGED
|
@@ -8724,7 +8724,7 @@ class MultiRollupApiClients {
|
|
|
8724
8724
|
}
|
|
8725
8725
|
|
|
8726
8726
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8727
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.
|
|
8727
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.45.0' };
|
|
8728
8728
|
const createConfig = ({ basePath, headers, }) => {
|
|
8729
8729
|
if (!basePath.trim()) {
|
|
8730
8730
|
throw Error('basePath can not be empty');
|
|
@@ -8792,7 +8792,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
8792
8792
|
chainID,
|
|
8793
8793
|
coreContractAddress,
|
|
8794
8794
|
registrationContractAddress,
|
|
8795
|
-
sdkVersion: 'ts-immutable-sdk-0.
|
|
8795
|
+
sdkVersion: 'ts-immutable-sdk-0.45.0',
|
|
8796
8796
|
});
|
|
8797
8797
|
/**
|
|
8798
8798
|
* Sets `sdkVersion` at the time of build
|
|
@@ -8838,7 +8838,7 @@ class ImxConfiguration {
|
|
|
8838
8838
|
}
|
|
8839
8839
|
}
|
|
8840
8840
|
|
|
8841
|
-
class
|
|
8841
|
+
class IMXClient {
|
|
8842
8842
|
immutableX;
|
|
8843
8843
|
depositsApi;
|
|
8844
8844
|
mintsApi;
|
|
@@ -15518,7 +15518,7 @@ class Passport {
|
|
|
15518
15518
|
this.magicAdapter = new MagicAdapter(this.config);
|
|
15519
15519
|
this.confirmationScreen = new ConfirmationScreen(this.config);
|
|
15520
15520
|
this.immutableXClient = passportModuleConfiguration.overrides?.immutableXClient
|
|
15521
|
-
|| new
|
|
15521
|
+
|| new IMXClient({
|
|
15522
15522
|
baseConfig: passportModuleConfiguration.baseConfig,
|
|
15523
15523
|
});
|
|
15524
15524
|
this.multiRollupApiClients = new MultiRollupApiClients(this.config.multiRollupConfig);
|
|
@@ -2601,6 +2601,31 @@ interface CreateTransferRequestV1 {
|
|
|
2601
2601
|
'stark_signature': string;
|
|
2602
2602
|
}
|
|
2603
2603
|
|
|
2604
|
+
/**
|
|
2605
|
+
* Immutable X API
|
|
2606
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
2607
|
+
*
|
|
2608
|
+
* The version of the OpenAPI document: 3.0
|
|
2609
|
+
* Contact: support@immutable.com
|
|
2610
|
+
*
|
|
2611
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
2612
|
+
* https://openapi-generator.tech
|
|
2613
|
+
* Do not edit the class manually.
|
|
2614
|
+
*/
|
|
2615
|
+
/**
|
|
2616
|
+
*
|
|
2617
|
+
* @export
|
|
2618
|
+
* @interface CreateTransferResponse
|
|
2619
|
+
*/
|
|
2620
|
+
interface CreateTransferResponse {
|
|
2621
|
+
/**
|
|
2622
|
+
* List of transfer IDs
|
|
2623
|
+
* @type {Array<number>}
|
|
2624
|
+
* @memberof CreateTransferResponse
|
|
2625
|
+
*/
|
|
2626
|
+
'transfer_ids': Array<number>;
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2604
2629
|
/**
|
|
2605
2630
|
* Immutable X API
|
|
2606
2631
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
@@ -9770,7 +9795,7 @@ interface ImxOverrides {
|
|
|
9770
9795
|
interface ImxModuleConfiguration extends ModuleConfiguration<ImxOverrides> {
|
|
9771
9796
|
}
|
|
9772
9797
|
|
|
9773
|
-
declare class
|
|
9798
|
+
declare class IMXClient {
|
|
9774
9799
|
private immutableX;
|
|
9775
9800
|
depositsApi: DepositsApi;
|
|
9776
9801
|
mintsApi: MintsApi;
|
|
@@ -10116,4 +10141,132 @@ declare class ImmutableXClient {
|
|
|
10116
10141
|
getNftPrimaryTransactions(request: NftCheckoutPrimaryApiGetNftPrimaryTransactionsRequest): Promise<NftprimarytransactionListTransactionsResponse>;
|
|
10117
10142
|
}
|
|
10118
10143
|
|
|
10119
|
-
|
|
10144
|
+
interface IMXProvider {
|
|
10145
|
+
/**
|
|
10146
|
+
* Get the Signer address
|
|
10147
|
+
*
|
|
10148
|
+
* @return {Promise<string>} Returns a promise that resolves with the signer's address
|
|
10149
|
+
*/
|
|
10150
|
+
getAddress(): Promise<string>;
|
|
10151
|
+
/**
|
|
10152
|
+
* Register a User to Immutable X if they are not already registered
|
|
10153
|
+
*
|
|
10154
|
+
* @return {Promise<RegisterUserResponse>} Returns a promise that resolves with the user registration response
|
|
10155
|
+
*/
|
|
10156
|
+
registerOffchain(): Promise<RegisterUserResponse>;
|
|
10157
|
+
/**
|
|
10158
|
+
* Checks if a User is registered off-chain
|
|
10159
|
+
*
|
|
10160
|
+
* @return {Promise<boolean>} Returns a promise that resolves with true if the User is registered with IMX, false otherwise
|
|
10161
|
+
*/
|
|
10162
|
+
isRegisteredOffchain(): Promise<boolean>;
|
|
10163
|
+
/**
|
|
10164
|
+
* Checks if a User is registered on-chain
|
|
10165
|
+
*
|
|
10166
|
+
* @return {Promise<boolean>} Returns a promise that resolves with true if the User is registered, false otherwise
|
|
10167
|
+
*/
|
|
10168
|
+
isRegisteredOnchain(): Promise<boolean>;
|
|
10169
|
+
/**
|
|
10170
|
+
* Create an Order
|
|
10171
|
+
*
|
|
10172
|
+
* @param {UnsignedOrderRequest} request The unsigned order request to create an order
|
|
10173
|
+
* @return {Promise<CreateOrderResponse>} Returns a promise that resolves with the created Order
|
|
10174
|
+
*/
|
|
10175
|
+
createOrder(request: UnsignedOrderRequest): Promise<CreateOrderResponse>;
|
|
10176
|
+
/**
|
|
10177
|
+
* Cancel an Order
|
|
10178
|
+
*
|
|
10179
|
+
* @param {GetSignableCancelOrderRequest} request The signable cancel order request
|
|
10180
|
+
* @return {Promise<CancelOrderResponse>} Returns a promise that resolves with the cancelled Order
|
|
10181
|
+
*/
|
|
10182
|
+
cancelOrder(request: GetSignableCancelOrderRequest): Promise<CancelOrderResponse>;
|
|
10183
|
+
/**
|
|
10184
|
+
* Create a Trade
|
|
10185
|
+
*
|
|
10186
|
+
* @param {GetSignableTradeRequest} request The signable trade request
|
|
10187
|
+
* @return {Promise<CreateTradeResponse>} Returns a promise that resolves with the created Trade
|
|
10188
|
+
*/
|
|
10189
|
+
createTrade(request: GetSignableTradeRequest): Promise<CreateTradeResponse>;
|
|
10190
|
+
/**
|
|
10191
|
+
* Create a new Transfer request
|
|
10192
|
+
*
|
|
10193
|
+
* @param {UnsignedTransferRequest} request The unsigned transfer request
|
|
10194
|
+
* @return {Promise<CreateTransferResponseV1>} Returns a promise that resolves with the created Transfer
|
|
10195
|
+
*/
|
|
10196
|
+
transfer(request: UnsignedTransferRequest): Promise<CreateTransferResponseV1>;
|
|
10197
|
+
/**
|
|
10198
|
+
* Create a batch of NFT transfer requests
|
|
10199
|
+
*
|
|
10200
|
+
* @param {Array<NftTransferDetails>} request An array of NFT transfer details
|
|
10201
|
+
* @return {Promise<CreateTransferResponse>} Resolves a promise that resolves with the list of Transfer IDs
|
|
10202
|
+
*/
|
|
10203
|
+
batchNftTransfer(request: Array<NftTransferDetails>): Promise<CreateTransferResponse>;
|
|
10204
|
+
/**
|
|
10205
|
+
* Create a new Exchange transaction
|
|
10206
|
+
*
|
|
10207
|
+
* @param {UnsignedExchangeTransferRequest} request The unsigned exchange transfer request
|
|
10208
|
+
* @return {Promise<CreateTransferResponseV1>} Returns a promise that resolves with the created Exchange Transaction
|
|
10209
|
+
*/
|
|
10210
|
+
exchangeTransfer(request: UnsignedExchangeTransferRequest): Promise<CreateTransferResponseV1>;
|
|
10211
|
+
/**
|
|
10212
|
+
* Deposit either ETH, ERC20 or ERC721 tokens
|
|
10213
|
+
*
|
|
10214
|
+
* @param {TokenAmount} request The token type amount in its corresponding unit
|
|
10215
|
+
* @return {Promise<TransactionResponse>} Returns a promise that resolves with the transaction
|
|
10216
|
+
*/
|
|
10217
|
+
deposit(deposit: TokenAmount): Promise<TransactionResponse>;
|
|
10218
|
+
/**
|
|
10219
|
+
* Create a Withdrawal
|
|
10220
|
+
*
|
|
10221
|
+
* @param {TokenAmount} request The token type amount in its corresponding unit
|
|
10222
|
+
* @return {Promise<CreateWithdrawalResponse>} Returns a promise that resolves with the created Withdrawal
|
|
10223
|
+
*/
|
|
10224
|
+
prepareWithdrawal(request: TokenAmount): Promise<CreateWithdrawalResponse>;
|
|
10225
|
+
/**
|
|
10226
|
+
* Completes a Withdrawal
|
|
10227
|
+
*
|
|
10228
|
+
* @param {string} starkPublicKey The stark public key
|
|
10229
|
+
* @param {AnyToken} token The token to withdraw
|
|
10230
|
+
* @return {Promise<TransactionResponse>} Returns a promise that resolves with the transaction
|
|
10231
|
+
*/
|
|
10232
|
+
completeWithdrawal(starkPublicKey: string, token: AnyToken): Promise<TransactionResponse>;
|
|
10233
|
+
}
|
|
10234
|
+
|
|
10235
|
+
interface ProviderOverrides {
|
|
10236
|
+
immutableXConfig: ImmutableXConfiguration;
|
|
10237
|
+
}
|
|
10238
|
+
interface ProviderModuleConfiguration extends ModuleConfiguration<ProviderOverrides> {
|
|
10239
|
+
}
|
|
10240
|
+
declare class ProviderConfiguration {
|
|
10241
|
+
readonly immutableXConfig: ImmutableXConfiguration;
|
|
10242
|
+
readonly baseConfig: ImmutableConfiguration;
|
|
10243
|
+
constructor({ baseConfig, overrides }: ProviderModuleConfiguration);
|
|
10244
|
+
}
|
|
10245
|
+
|
|
10246
|
+
declare class GenericIMXProvider implements IMXProvider {
|
|
10247
|
+
private readonly config;
|
|
10248
|
+
private readonly signers;
|
|
10249
|
+
constructor(config: ProviderConfiguration, ethSigner: Signer, starkSigner: StarkSigner);
|
|
10250
|
+
getAddress(): Promise<string>;
|
|
10251
|
+
isRegisteredOffchain(): Promise<boolean>;
|
|
10252
|
+
registerOffchain(): Promise<RegisterUserResponse>;
|
|
10253
|
+
batchNftTransfer(request: Array<NftTransferDetails>): Promise<CreateTransferResponse>;
|
|
10254
|
+
cancelOrder(request: GetSignableCancelOrderRequest): Promise<CancelOrderResponse>;
|
|
10255
|
+
completeWithdrawal(starkPublicKey: string, token: AnyToken): Promise<TransactionResponse>;
|
|
10256
|
+
createOrder(request: UnsignedOrderRequest): Promise<CreateOrderResponse>;
|
|
10257
|
+
createTrade(request: GetSignableTradeRequest): Promise<CreateTradeResponse>;
|
|
10258
|
+
deposit(tokenAmount: TokenAmount): Promise<TransactionResponse>;
|
|
10259
|
+
exchangeTransfer(request: UnsignedExchangeTransferRequest): Promise<CreateTransferResponseV1>;
|
|
10260
|
+
isRegisteredOnchain(): Promise<boolean>;
|
|
10261
|
+
prepareWithdrawal(request: TokenAmount): Promise<CreateWithdrawalResponse>;
|
|
10262
|
+
transfer(request: UnsignedTransferRequest): Promise<CreateTransferResponseV1>;
|
|
10263
|
+
}
|
|
10264
|
+
|
|
10265
|
+
declare class MetaMaskIMXProvider extends GenericIMXProvider {
|
|
10266
|
+
private static imxSigner;
|
|
10267
|
+
static connect(config: ProviderConfiguration): Promise<MetaMaskIMXProvider>;
|
|
10268
|
+
static disconnect(): Promise<void>;
|
|
10269
|
+
static signMessage(message: string): Promise<string>;
|
|
10270
|
+
}
|
|
10271
|
+
|
|
10272
|
+
export { AnyToken, ERC20Amount, ERC20Token, ERC721Token, ETHAmount, ETHToken, ExchangeTokenAmount, GenericIMXProvider, IMXClient, IMXError, IMXProvider, ImxModuleConfiguration as ImxClientModuleConfiguration, WalletConnection as ImxClientWalletConnection, MetaMaskIMXProvider, NftTransferDetails, ProviderConfiguration, StarkSigner, TokenAmount, UnsignedExchangeTransferRequest, UnsignedMintRequest, UnsignedOrderRequest, UnsignedTransferRequest, WalletConnection, createStarkSigner as imxClientCreateStarkSigner, generateLegacyStarkPrivateKey as imxClientGenerateLegacyStarkPrivateKey };
|