@imtbl/sdk 0.0.1-alpha → 0.0.1-alpha.2

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/index.d.ts CHANGED
@@ -1,24 +1,5 @@
1
1
  /// <reference path="global.d.ts" />
2
2
  /// <reference types="node" />
3
- import { StarkExConfiguration, ProviderConfiguration as ProviderConfiguration$1 } from 'config';
4
-
5
- declare enum Environment {
6
- PRODUCTION = "production",
7
- SANDBOX = "sandbox"
8
- }
9
- declare class ImmutableConfiguration {
10
- readonly environment: Environment;
11
- readonly apiKey?: string;
12
- constructor(options: {
13
- environment: Environment;
14
- apiKey?: string;
15
- });
16
- }
17
- interface ModuleConfiguration<T> {
18
- baseConfig: ImmutableConfiguration;
19
- overrides?: T;
20
- }
21
-
22
3
  declare type Bytes = ArrayLike<number>;
23
4
  declare type BytesLike = Bytes | string;
24
5
  interface Hexable {
@@ -835,7 +816,7 @@ interface ConfigurationParameters {
835
816
  baseOptions?: any;
836
817
  formDataCtor?: new () => any;
837
818
  }
838
- declare class Configuration {
819
+ declare class Configuration$1 {
839
820
  /**
840
821
  * parameter for apiKey security
841
822
  * @param name security name
@@ -906,8 +887,8 @@ declare class Configuration {
906
887
  declare class BaseAPI {
907
888
  protected basePath: string;
908
889
  protected axios: AxiosInstance;
909
- protected configuration: Configuration | undefined;
910
- constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
890
+ protected configuration: Configuration$1 | undefined;
891
+ constructor(configuration?: Configuration$1, basePath?: string, axios?: AxiosInstance);
911
892
  }
912
893
 
913
894
  /**
@@ -9112,14 +9093,30 @@ interface ImmutableXConfiguration {
9112
9093
  /**
9113
9094
  * The configuration for the API client
9114
9095
  */
9115
- apiConfiguration: Configuration;
9096
+ apiConfiguration: Configuration$1;
9116
9097
  /**
9117
9098
  * The configuration for the Ethereum network
9118
9099
  */
9119
9100
  ethConfiguration: EthConfiguration;
9120
9101
  }
9121
9102
 
9122
- declare const StarkExAPIFactory: (config: StarkExConfiguration) => {
9103
+ declare enum Environment {
9104
+ DEVELOPMENT = "development",
9105
+ SANDBOX = "sandbox",
9106
+ PRODUCTION = "production"
9107
+ }
9108
+ type StarkExConfig = ImmutableXConfiguration & {
9109
+ env: Environment;
9110
+ };
9111
+ declare class Configuration {
9112
+ private readonly starkExConfig;
9113
+ constructor(config: StarkExConfig);
9114
+ getStarkExConfig(): StarkExConfig;
9115
+ }
9116
+ declare const PRODUCTION: StarkExConfig;
9117
+ declare const SANDBOX: StarkExConfig;
9118
+
9119
+ declare const StarkExAPIFactory: (config: Configuration) => {
9123
9120
  depositsApi: DepositsApi;
9124
9121
  mintsApi: MintsApi;
9125
9122
  ordersApi: OrdersApi;
@@ -9226,7 +9223,7 @@ interface IMXProvider {
9226
9223
  declare class GenericIMXProvider implements IMXProvider {
9227
9224
  private readonly config;
9228
9225
  private readonly signers;
9229
- constructor(config: ProviderConfiguration$1, ethSigner: Signer, starkExSigner: StarkSigner);
9226
+ constructor(config: Configuration, ethSigner: Signer, starkExSigner: StarkSigner);
9230
9227
  getAddress(): Promise<string>;
9231
9228
  registerOffchain(): Promise<RegisterUserResponse>;
9232
9229
  batchNftTransfer(request: Array<NftTransferDetails>): Promise<CreateTransferResponse>;
@@ -9243,23 +9240,12 @@ declare class GenericIMXProvider implements IMXProvider {
9243
9240
 
9244
9241
  declare class MetaMaskIMXProvider extends GenericIMXProvider {
9245
9242
  private static imxSigner;
9246
- constructor(config: ProviderConfiguration$1, ethSigner: Signer, starkExSigner: StarkSigner);
9247
- static connect(config: ProviderConfiguration$1): Promise<MetaMaskIMXProvider>;
9243
+ constructor(config: Configuration, ethSigner: Signer, starkExSigner: StarkSigner);
9244
+ static connect(config: Configuration): Promise<MetaMaskIMXProvider>;
9248
9245
  static disconnect(): Promise<void>;
9249
9246
  static signMessage(message: string): Promise<string>;
9250
9247
  }
9251
9248
 
9252
- interface ProviderOverrides {
9253
- immutableXConfig: ImmutableXConfiguration;
9254
- }
9255
- interface ProviderModuleConfiguration extends ModuleConfiguration<ProviderOverrides> {
9256
- }
9257
- declare class ProviderConfiguration {
9258
- readonly immutableXConfig: ImmutableXConfiguration;
9259
- readonly baseConfig: ImmutableConfiguration;
9260
- constructor({ baseConfig, overrides }: ProviderModuleConfiguration);
9261
- }
9262
-
9263
9249
  declare enum PassportErrorType {
9264
9250
  AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR",
9265
9251
  INVALID_CONFIGURATION = "INVALID_CONFIGURATION",
@@ -9289,29 +9275,27 @@ declare enum Networks {
9289
9275
  PRODUCTION = "mainnet",
9290
9276
  SANDBOX = "goerli"
9291
9277
  }
9292
- interface OidcConfiguration {
9293
- clientId: string;
9294
- logoutRedirectUri: string;
9295
- redirectUri: string;
9296
- scope?: string;
9297
- audience?: string;
9298
- }
9299
- interface PassportOverrides {
9278
+ interface EnvironmentConfiguration {
9300
9279
  network: Networks;
9301
9280
  authenticationDomain: string;
9302
9281
  magicPublishableApiKey: string;
9303
9282
  magicProviderId: string;
9283
+ baseIMXApiPath: string;
9304
9284
  passportDomain: string;
9305
- imxApiBasePath: string;
9306
9285
  }
9307
- interface PassportModuleConfiguration extends ModuleConfiguration<PassportOverrides>, OidcConfiguration {
9286
+ interface OidcConfiguration {
9287
+ clientId: string;
9288
+ logoutRedirectUri: string;
9289
+ redirectUri: string;
9290
+ scope?: string;
9291
+ audience?: string;
9308
9292
  }
9309
9293
 
9310
9294
  declare class Passport {
9311
9295
  private authManager;
9312
9296
  private magicAdapter;
9313
9297
  private readonly config;
9314
- constructor(passportModuleConfiguration: PassportModuleConfiguration);
9298
+ constructor(environmentConfiguration: EnvironmentConfiguration, oidcConfiguration: OidcConfiguration);
9315
9299
  connectImx(): Promise<IMXProvider>;
9316
9300
  loginCallback(): Promise<void>;
9317
9301
  logout(): Promise<void>;
@@ -9321,17 +9305,10 @@ declare class Passport {
9321
9305
  private registerUser;
9322
9306
  }
9323
9307
 
9324
- declare class PassportConfiguration {
9325
- readonly network: Networks;
9326
- readonly authenticationDomain: string;
9327
- readonly passportDomain: string;
9328
- readonly magicPublishableApiKey: string;
9329
- readonly magicProviderId: string;
9330
- readonly imxApiBasePath: string;
9331
- readonly oidcConfiguration: OidcConfiguration;
9332
- readonly baseConfig: ImmutableConfiguration;
9333
- constructor({ baseConfig, overrides, ...oidcConfiguration }: PassportModuleConfiguration);
9334
- }
9308
+ declare const Config: {
9309
+ PRODUCTION: EnvironmentConfiguration;
9310
+ SANDBOX: EnvironmentConfiguration;
9311
+ };
9335
9312
 
9336
9313
  interface TokenInfo {
9337
9314
  name: string;
@@ -9341,21 +9318,11 @@ interface TokenInfo {
9341
9318
  icon?: string;
9342
9319
  }
9343
9320
  interface GetTokenAllowListParams {
9344
- type: TokenFilterTypes;
9345
9321
  chainId: ChainId;
9346
- exclude?: TokenFilter[];
9347
9322
  }
9348
9323
  interface GetTokenAllowListResult {
9349
9324
  tokens: TokenInfo[];
9350
9325
  }
9351
- declare enum TokenFilterTypes {
9352
- SWAP = "swap",
9353
- BRIDGE = "bridge",
9354
- ALL = "all"
9355
- }
9356
- interface TokenFilter {
9357
- address: string;
9358
- }
9359
9326
  declare enum ChainId {
9360
9327
  ETHEREUM = 1,
9361
9328
  GOERLI = 5,
@@ -9425,27 +9392,6 @@ interface Transaction {
9425
9392
  data: string;
9426
9393
  chainId: number;
9427
9394
  }
9428
- declare enum WalletFilterTypes {
9429
- ALL = "all",
9430
- DESKTOP = "desktop",
9431
- MOBILE = "mobile"
9432
- }
9433
- interface WalletFilter {
9434
- connectionProvider: ConnectionProviders;
9435
- }
9436
- interface GetWalletAllowListParams {
9437
- type: WalletFilterTypes;
9438
- exclude?: WalletFilter[];
9439
- }
9440
- interface WalletInfo {
9441
- connectionProvider: ConnectionProviders;
9442
- name: string;
9443
- description: string;
9444
- icon: string;
9445
- }
9446
- interface GetWalletAllowListResult {
9447
- allowedWallets: WalletInfo[];
9448
- }
9449
9395
  declare class Checkout {
9450
9396
  checkIsWalletConnected(params: CheckConnectionParams): Promise<CheckConnectionResult>;
9451
9397
  connect(params: ConnectParams): Promise<ConnectResult>;
@@ -9453,7 +9399,6 @@ declare class Checkout {
9453
9399
  getBalance(params: GetBalanceParams): Promise<GetBalanceResult>;
9454
9400
  getAllBalances(params: GetAllBalancesParams): Promise<GetAllBalancesResult>;
9455
9401
  getTokenAllowList(params: GetTokenAllowListParams): GetTokenAllowListResult;
9456
- getWalletsAllowList(params: GetWalletAllowListParams): Promise<GetWalletAllowListResult>;
9457
9402
  sendTransaction(params: SendTransactionParams): Promise<SendTransactionResult>;
9458
9403
  }
9459
9404
 
@@ -21823,9 +21768,7 @@ declare namespace React {
21823
21768
  interface DOMAttributes<T> {
21824
21769
  children?: ReactNode | undefined;
21825
21770
  dangerouslySetInnerHTML?: {
21826
- // Should be InnerHTML['innerHTML'].
21827
- // But unfortunately we're mixing renderer-specific type declarations.
21828
- __html: string | TrustedHTML;
21771
+ __html: string;
21829
21772
  } | undefined;
21830
21773
 
21831
21774
  // Clipboard Events
@@ -23895,4 +23838,4 @@ declare enum WidgetTheme {
23895
23838
  CUSTOM = "custom"
23896
23839
  }
23897
23840
 
23898
- export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuySuccess, ChainId, CheckConnectionParams, CheckConnectionResult, Checkout, ConnectEvent, ConnectEventType, ConnectParams, ConnectResult, ConnectionFailed, ConnectionProviders, ConnectionSuccess, Environment, GenericIMXProvider, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetTokenAllowListParams, GetTokenAllowListResult, GetWalletAllowListParams, GetWalletAllowListResult, IMTBLWidgetEvents, IMXProvider, ImmutableConfiguration, ImtblBridgeProps, ImtblBuyProps, ImtblConnectProps, ImtblExampleProps, ImtblSwapProps, ImtblWalletProps, MetaMaskIMXProvider, ModuleConfiguration, Network, NetworkInfo, Passport, PassportConfiguration, PassportError, ProviderConfiguration, SendTransactionParams, SendTransactionResult, StarkExAPIFactory, SwapEvent, SwapEventType, SwapFailed, SwapSuccess, SwitchNetworkParams, SwitchNetworkResult, TokenFilter, TokenFilterTypes, TokenInfo, WalletEvent, WalletEventType, WalletFilter, WalletFilterTypes, WalletInfo, WalletNetworkSwitchEvent, WidgetTheme };
23841
+ export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuySuccess, ChainId, CheckConnectionParams, CheckConnectionResult, Checkout, Config, Configuration, ConnectEvent, ConnectEventType, ConnectParams, ConnectResult, ConnectionFailed, ConnectionProviders, ConnectionSuccess, Environment, GenericIMXProvider, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetTokenAllowListParams, GetTokenAllowListResult, IMTBLWidgetEvents, IMXProvider, ImtblBridgeProps, ImtblBuyProps, ImtblConnectProps, ImtblExampleProps, ImtblSwapProps, ImtblWalletProps, MetaMaskIMXProvider, Network, NetworkInfo, PRODUCTION, Passport, PassportError, SANDBOX, SendTransactionParams, SendTransactionResult, StarkExAPIFactory, SwapEvent, SwapEventType, SwapFailed, SwapSuccess, SwitchNetworkParams, SwitchNetworkResult, TokenInfo, WalletEvent, WalletEventType, WalletNetworkSwitchEvent, WidgetTheme };