@imtbl/sdk 0.1.4-alpha → 0.1.6-alpha
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/checkout_sdk.d.ts +57 -3
- package/dist/checkout_sdk.js +22 -5
- package/dist/checkout_widgets.d.ts +907 -12
- package/dist/checkout_widgets.js +225 -142
- package/dist/immutablex_client.d.ts +9 -9
- package/dist/immutablex_client.js +34 -31
- package/dist/index.cjs +414 -166
- package/dist/index.d.ts +396 -23
- package/dist/index.js +417 -178
- package/dist/passport.d.ts +9 -9
- package/dist/passport.js +233 -202
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -10360,7 +10360,7 @@ declare class ImmutableXClient {
|
|
|
10360
10360
|
getDeposit(request: DepositsApiGetDepositRequest): Promise<Deposit>;
|
|
10361
10361
|
/**
|
|
10362
10362
|
* Get a list of Deposits
|
|
10363
|
-
* @param request - optional
|
|
10363
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10364
10364
|
* @returns a promise that resolves with the requested list of Deposits
|
|
10365
10365
|
* @throws {@link index.IMXError}
|
|
10366
10366
|
*/
|
|
@@ -10381,7 +10381,7 @@ declare class ImmutableXClient {
|
|
|
10381
10381
|
getAsset(request: AssetsApiGetAssetRequest): Promise<Asset>;
|
|
10382
10382
|
/**
|
|
10383
10383
|
* Get a list of Assets
|
|
10384
|
-
* @param request - optional
|
|
10384
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10385
10385
|
* @returns a promise that resolves with the requested list of Assets
|
|
10386
10386
|
* @throws {@link index.IMXError}
|
|
10387
10387
|
*/
|
|
@@ -10410,7 +10410,7 @@ declare class ImmutableXClient {
|
|
|
10410
10410
|
listCollectionFilters(request: CollectionsApiListCollectionFiltersRequest): Promise<CollectionFilter>;
|
|
10411
10411
|
/**
|
|
10412
10412
|
* Get a list of Collections
|
|
10413
|
-
* @param request - optional
|
|
10413
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10414
10414
|
* @returns a promise that resolves with the requested list of Collections
|
|
10415
10415
|
* @throws {@link index.IMXError}
|
|
10416
10416
|
*/
|
|
@@ -10536,7 +10536,7 @@ declare class ImmutableXClient {
|
|
|
10536
10536
|
getMint(request: MintsApiGetMintRequest): Promise<Mint[]>;
|
|
10537
10537
|
/**
|
|
10538
10538
|
* Get a list of Mints
|
|
10539
|
-
* @param request optional
|
|
10539
|
+
* @param request optional object containing the parameters to be provided in the API request
|
|
10540
10540
|
* @returns a promise that resolves with the requested list of Mints
|
|
10541
10541
|
* @throws {@link index.IMXError}
|
|
10542
10542
|
*/
|
|
@@ -10551,7 +10551,7 @@ declare class ImmutableXClient {
|
|
|
10551
10551
|
mint(ethSigner: Signer, request: UnsignedMintRequest): Promise<MintTokensResponse>;
|
|
10552
10552
|
/**
|
|
10553
10553
|
* Get a list of Withdrawals
|
|
10554
|
-
* @param request - optional
|
|
10554
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10555
10555
|
* @returns a promise that resolves with the requested list of Withdrawals
|
|
10556
10556
|
* @throws {@link index.IMXError}
|
|
10557
10557
|
*/
|
|
@@ -10572,7 +10572,7 @@ declare class ImmutableXClient {
|
|
|
10572
10572
|
getOrder(request: OrdersApiGetOrderRequest): Promise<Order>;
|
|
10573
10573
|
/**
|
|
10574
10574
|
* Get a list of Orders
|
|
10575
|
-
* @param request - optional
|
|
10575
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10576
10576
|
* @returns a promise that resolves with the requested list of Orders
|
|
10577
10577
|
* @throws {@link index.IMXError}
|
|
10578
10578
|
*/
|
|
@@ -10586,7 +10586,7 @@ declare class ImmutableXClient {
|
|
|
10586
10586
|
getTrade(request: TradesApiGetTradeRequest): Promise<Trade>;
|
|
10587
10587
|
/**
|
|
10588
10588
|
* Get a list of Trades
|
|
10589
|
-
* @param request - optional
|
|
10589
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10590
10590
|
* @returns a promise that resolves with the requested list of Trades
|
|
10591
10591
|
* @throws {@link index.IMXError}
|
|
10592
10592
|
*/
|
|
@@ -10600,7 +10600,7 @@ declare class ImmutableXClient {
|
|
|
10600
10600
|
getToken(request: TokensApiGetTokenRequest): Promise<TokenDetails>;
|
|
10601
10601
|
/**
|
|
10602
10602
|
* Get a list of Tokens
|
|
10603
|
-
* @param request - optional
|
|
10603
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10604
10604
|
* @returns a promise that resolves with the requested list of Tokens
|
|
10605
10605
|
* @throws {@link index.IMXError}
|
|
10606
10606
|
*/
|
|
@@ -10614,7 +10614,7 @@ declare class ImmutableXClient {
|
|
|
10614
10614
|
getTransfer(request: TransfersApiGetTransferRequest): Promise<Transfer>;
|
|
10615
10615
|
/**
|
|
10616
10616
|
* Get a list of Transfers
|
|
10617
|
-
* @param request - optional
|
|
10617
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10618
10618
|
* @returns a promise that resolves with the requested list of Transfers
|
|
10619
10619
|
* @throws {@link index.IMXError}
|
|
10620
10620
|
*/
|
|
@@ -10888,7 +10888,7 @@ interface TokenInfo {
|
|
|
10888
10888
|
*/
|
|
10889
10889
|
interface GetTokenAllowListParams {
|
|
10890
10890
|
type: TokenFilterTypes;
|
|
10891
|
-
chainId
|
|
10891
|
+
chainId?: ChainId;
|
|
10892
10892
|
exclude?: TokenFilter[];
|
|
10893
10893
|
}
|
|
10894
10894
|
/**
|
|
@@ -11146,6 +11146,57 @@ declare enum WalletFilterTypes {
|
|
|
11146
11146
|
DESKTOP = "desktop",
|
|
11147
11147
|
MOBILE = "mobile"
|
|
11148
11148
|
}
|
|
11149
|
+
/**
|
|
11150
|
+
* Enum representing the types of token filters available.
|
|
11151
|
+
*/
|
|
11152
|
+
declare enum SupportedFiatCurrencies {
|
|
11153
|
+
USD = "USD"
|
|
11154
|
+
}
|
|
11155
|
+
/**
|
|
11156
|
+
* Interface representing the parameters for {@link Checkout.convertTokenToFiat}.
|
|
11157
|
+
* @property {BigNumber} amount - The the amount of token we are converting.
|
|
11158
|
+
* @property {TokenInfo} token - The token we are converting from.
|
|
11159
|
+
* @property {SupportedFiatCurrencies} fiatSymbol - The fiat currency we are converting to.
|
|
11160
|
+
*/
|
|
11161
|
+
interface ConvertTokensToFiatParams {
|
|
11162
|
+
amounts: {
|
|
11163
|
+
[key: string]: {
|
|
11164
|
+
amount: BigNumber;
|
|
11165
|
+
token: TokenInfo;
|
|
11166
|
+
};
|
|
11167
|
+
};
|
|
11168
|
+
fiatSymbol: SupportedFiatCurrencies;
|
|
11169
|
+
}
|
|
11170
|
+
/**
|
|
11171
|
+
* Interface representing the result of a specific token to fiat conversion.
|
|
11172
|
+
* @property {TokenInfo} token - The token that we converted from.
|
|
11173
|
+
* @property {string} fiatSymbol - The fiat currency we converted to.
|
|
11174
|
+
* @property {number} quotedAt - The unix timestamp for when the quote was generated.
|
|
11175
|
+
* @property {number} quote - The quote at the given timestamp.
|
|
11176
|
+
* @property {BigNumber} amount - The amount we converted.
|
|
11177
|
+
* @property {number} convertedAmount - The converted amount.
|
|
11178
|
+
*/
|
|
11179
|
+
interface TokenToFiatConversionResult extends FiatConversionQuote {
|
|
11180
|
+
token: TokenInfo;
|
|
11181
|
+
fiatSymbol: string;
|
|
11182
|
+
amount: BigNumber;
|
|
11183
|
+
convertedAmount: number;
|
|
11184
|
+
}
|
|
11185
|
+
/**
|
|
11186
|
+
* Interface representing the result of {@link Checkout.convertTokenToFiat}.
|
|
11187
|
+
*/
|
|
11188
|
+
interface ConvertTokensToFiatResult {
|
|
11189
|
+
[key: string]: TokenToFiatConversionResult;
|
|
11190
|
+
}
|
|
11191
|
+
/**
|
|
11192
|
+
* Interface representing the result of a specific token to fiat conversion.
|
|
11193
|
+
* @property {number} quotedAt - The unix timestamp for when the quote was generated.
|
|
11194
|
+
* @property {number} quote - The quote at the given timestamp.
|
|
11195
|
+
*/
|
|
11196
|
+
interface FiatConversionQuote {
|
|
11197
|
+
quote: number;
|
|
11198
|
+
quotedAt: number;
|
|
11199
|
+
}
|
|
11149
11200
|
/**
|
|
11150
11201
|
* The different types of errors that can be returned by the checkout process.
|
|
11151
11202
|
*/
|
|
@@ -11160,7 +11211,10 @@ declare enum CheckoutErrorType {
|
|
|
11160
11211
|
PROVIDER_REQUEST_MISSING_ERROR = "PROVIDER_REQUEST_MISSING_ERROR",
|
|
11161
11212
|
PROVIDER_REQUEST_FAILED_ERROR = "PROVIDER_REQUEST_FAILED_ERROR",
|
|
11162
11213
|
USER_REJECTED_REQUEST_ERROR = "USER_REJECTED_REQUEST_ERROR",
|
|
11163
|
-
TRANSACTION_ERROR = "TRANSACTION_ERROR"
|
|
11214
|
+
TRANSACTION_ERROR = "TRANSACTION_ERROR",
|
|
11215
|
+
FIAT_CONVERSION_ERROR = "FIAT_CONVERSION_ERROR",
|
|
11216
|
+
TOKEN_NOT_SUPPORTED_ERROR = "TOKEN_NOT_SUPPORTED_ERROR",
|
|
11217
|
+
FIAT_CURRENCY_NOT_SUPPORTED_ERROR = "FIAT_CURRENCY_NOT_SUPPORTED_ERROR"
|
|
11164
11218
|
}
|
|
11165
11219
|
/**
|
|
11166
11220
|
* The type signature for an error.
|
|
@@ -25557,144 +25611,463 @@ declare global {
|
|
|
25557
25611
|
}
|
|
25558
25612
|
}
|
|
25559
25613
|
|
|
25614
|
+
/**
|
|
25615
|
+
* Enum representing the events emitted by the widgets.
|
|
25616
|
+
*/
|
|
25560
25617
|
declare enum IMTBLWidgetEvents {
|
|
25561
25618
|
IMTBL_CONNECT_WIDGET_EVENT = "imtbl-connect-widget",
|
|
25562
25619
|
IMTBL_WALLET_WIDGET_EVENT = "imtbl-wallet-widget",
|
|
25563
25620
|
IMTBL_SWAP_WIDGET_EVENT = "imtbl-swap-widget",
|
|
25564
25621
|
IMTBL_BRIDGE_WIDGET_EVENT = "imtbl-bridge-widget",
|
|
25565
|
-
IMTBL_BUY_WIDGET_EVENT = "imtbl-buy-widget"
|
|
25622
|
+
IMTBL_BUY_WIDGET_EVENT = "imtbl-buy-widget",
|
|
25623
|
+
IMTBL_ONRAMP_WIDGET_EVENT = "imtbl-onramp-widget"
|
|
25566
25624
|
}
|
|
25625
|
+
/**
|
|
25626
|
+
* Enum representing possible Connect Widget event types.
|
|
25627
|
+
*/
|
|
25567
25628
|
declare enum ConnectEventType {
|
|
25568
25629
|
SUCCESS = "success",
|
|
25569
25630
|
FAILURE = "failure",
|
|
25570
25631
|
CLOSE_WIDGET = "close-widget"
|
|
25571
25632
|
}
|
|
25633
|
+
/**
|
|
25634
|
+
* Represents an event object emitted by the Connect Widget.
|
|
25635
|
+
* @property {BuyEventType} type - The type of the event.
|
|
25636
|
+
* @property {T} data - The data contained in the event.
|
|
25637
|
+
*/
|
|
25572
25638
|
type ConnectEvent<T> = {
|
|
25573
25639
|
type: ConnectEventType;
|
|
25574
25640
|
data: T;
|
|
25575
25641
|
};
|
|
25642
|
+
/**
|
|
25643
|
+
* Type representing a Connect Widget event with type SUCCESS.
|
|
25644
|
+
* @property {ConnectionProviders} providerPreference - The user's preferred connection provider.
|
|
25645
|
+
*/
|
|
25576
25646
|
type ConnectionSuccess = {
|
|
25577
25647
|
providerPreference: ConnectionProviders;
|
|
25578
25648
|
};
|
|
25649
|
+
/**
|
|
25650
|
+
* Type representing a Connect Widget event with type FAILURE.
|
|
25651
|
+
* @property {string} reason - A description of the reason for the failed connection attempt.
|
|
25652
|
+
*/
|
|
25579
25653
|
type ConnectionFailed = {
|
|
25580
25654
|
reason: string;
|
|
25581
25655
|
};
|
|
25656
|
+
/**
|
|
25657
|
+
* Enum representing possible Wallet Widget event types.
|
|
25658
|
+
*/
|
|
25582
25659
|
declare enum WalletEventType {
|
|
25583
25660
|
CLOSE_WIDGET = "close-widget",
|
|
25584
|
-
NETWORK_SWITCH = "network-switch"
|
|
25661
|
+
NETWORK_SWITCH = "network-switch",
|
|
25662
|
+
ADD_COINS = "add-coins",
|
|
25663
|
+
REQUEST_SWAP = "request-swap",
|
|
25664
|
+
REQUEST_BRIDGE = "request-bridge",
|
|
25665
|
+
REQUEST_ONRAMP = "request-onramp"
|
|
25585
25666
|
}
|
|
25667
|
+
/**
|
|
25668
|
+
* Type representing the data emitted by the network switch event.
|
|
25669
|
+
* @property {string} network - The name of the selected network.
|
|
25670
|
+
* @property {number} chainId - The chain ID of the selected network.
|
|
25671
|
+
*/
|
|
25586
25672
|
type WalletNetworkSwitchEvent = {
|
|
25587
25673
|
network: string;
|
|
25588
25674
|
chainId: number;
|
|
25589
25675
|
};
|
|
25676
|
+
type WalletAddCoinsEvent = {
|
|
25677
|
+
network?: NetworkInfo;
|
|
25678
|
+
token?: TokenInfo;
|
|
25679
|
+
tokenAmount?: string;
|
|
25680
|
+
};
|
|
25681
|
+
type WalletRequestSwapEvent = {
|
|
25682
|
+
fromTokenAddress: string;
|
|
25683
|
+
toTokenAddress: string;
|
|
25684
|
+
amount: string;
|
|
25685
|
+
};
|
|
25686
|
+
type WalletRequestBridgeEvent = {
|
|
25687
|
+
fromNetwork: string;
|
|
25688
|
+
tokenAddress: string;
|
|
25689
|
+
amount: string;
|
|
25690
|
+
};
|
|
25691
|
+
type WalletRequestOnrampEvent = {
|
|
25692
|
+
tokenAddress: string;
|
|
25693
|
+
amount: string;
|
|
25694
|
+
};
|
|
25695
|
+
/**
|
|
25696
|
+
* Represents an event object emitted by the Wallet Widget.
|
|
25697
|
+
* @property {WalletEventType} type - The type of the event.
|
|
25698
|
+
* @property {T} data - The data contained in the event.
|
|
25699
|
+
*/
|
|
25590
25700
|
type WalletEvent<T> = {
|
|
25591
25701
|
type: WalletEventType;
|
|
25592
25702
|
data: T;
|
|
25593
25703
|
};
|
|
25704
|
+
/**
|
|
25705
|
+
* Represents an event object emitted by the Swap Widget.
|
|
25706
|
+
* @property {SwapEventType} type - The type of the event.
|
|
25707
|
+
* @property {T} data - The data contained in the event.
|
|
25708
|
+
*/
|
|
25594
25709
|
type SwapEvent<T> = {
|
|
25595
25710
|
type: SwapEventType;
|
|
25596
25711
|
data: T;
|
|
25597
25712
|
};
|
|
25713
|
+
/**
|
|
25714
|
+
* Enum representing possible Swap Widget event types.
|
|
25715
|
+
*/
|
|
25598
25716
|
declare enum SwapEventType {
|
|
25599
25717
|
SUCCESS = "success",
|
|
25600
25718
|
FAILURE = "failure"
|
|
25601
25719
|
}
|
|
25720
|
+
/**
|
|
25721
|
+
* Type representing a Swap Widget with type SUCCESS.
|
|
25722
|
+
* @property {number} timestamp - The timestamp of the successful swap.
|
|
25723
|
+
*/
|
|
25602
25724
|
type SwapSuccess = {
|
|
25603
25725
|
timestamp: number;
|
|
25604
25726
|
};
|
|
25727
|
+
/**
|
|
25728
|
+
* Type representing a Swap Widget with type FAILURE.
|
|
25729
|
+
* @property {string} reason - The reason why the swap failed.
|
|
25730
|
+
* @property {number} timestamp - The timestamp of the failed swap.
|
|
25731
|
+
*/
|
|
25605
25732
|
type SwapFailed = {
|
|
25606
25733
|
reason: string;
|
|
25607
25734
|
timestamp: number;
|
|
25608
25735
|
};
|
|
25736
|
+
/**
|
|
25737
|
+
* Represents an event object emitted by the Bridge Widget.
|
|
25738
|
+
* @property {BridgeEventType} type - The type of the event.
|
|
25739
|
+
* @property {T} data - The data associated with the event.
|
|
25740
|
+
*/
|
|
25609
25741
|
type BridgeEvent<T> = {
|
|
25610
25742
|
type: BridgeEventType;
|
|
25611
25743
|
data: T;
|
|
25612
25744
|
};
|
|
25745
|
+
/**
|
|
25746
|
+
* Enum of possible Bridge Widget event types.
|
|
25747
|
+
*/
|
|
25613
25748
|
declare enum BridgeEventType {
|
|
25614
25749
|
CLOSE_WIDGET = "close-widget",
|
|
25615
25750
|
SUCCESS = "success",
|
|
25616
25751
|
FAILURE = "failure"
|
|
25617
25752
|
}
|
|
25753
|
+
/**
|
|
25754
|
+
* Type representing a Bridge Widget event with type SUCCESS
|
|
25755
|
+
* @property {number} timestamp - The UNIX timestamp (in milliseconds) when the event occurred.
|
|
25756
|
+
*/
|
|
25618
25757
|
type BridgeSuccess = {
|
|
25619
25758
|
timestamp: number;
|
|
25620
25759
|
};
|
|
25760
|
+
/**
|
|
25761
|
+
* Type representing a Bridge Widget event with type FAILURE
|
|
25762
|
+
* @property {string} reason - The reason for the failure.
|
|
25763
|
+
* @property {number} timestamp - The UNIX timestamp (in milliseconds) when the event occurred.
|
|
25764
|
+
*/
|
|
25621
25765
|
type BridgeFailed = {
|
|
25622
25766
|
reason: string;
|
|
25623
25767
|
timestamp: number;
|
|
25624
25768
|
};
|
|
25769
|
+
/**
|
|
25770
|
+
* Represents an event object emitted by the Buy Widget.
|
|
25771
|
+
* @property {BuyEventType} type - The type of the event.
|
|
25772
|
+
* @property {T} data - The data contained in the event.
|
|
25773
|
+
*/
|
|
25625
25774
|
type BuyEvent<T> = {
|
|
25626
25775
|
type: BuyEventType;
|
|
25627
25776
|
data: T;
|
|
25628
25777
|
};
|
|
25778
|
+
/**
|
|
25779
|
+
* Enum representing possible Buy Widget event types.
|
|
25780
|
+
*/
|
|
25629
25781
|
declare enum BuyEventType {
|
|
25630
25782
|
SUCCESS = "success",
|
|
25631
25783
|
FAILURE = "failure",
|
|
25632
25784
|
NOT_CONNECTED = "not_connected",
|
|
25633
25785
|
CLOSE = "close"
|
|
25634
25786
|
}
|
|
25787
|
+
/**
|
|
25788
|
+
* Type representing a Buy Widget event with type CLOSE.
|
|
25789
|
+
*/
|
|
25635
25790
|
type BuyClose = {};
|
|
25791
|
+
/**
|
|
25792
|
+
* Type representing a Buy Widget event with type NOT_CONNECTED.
|
|
25793
|
+
* @property {string} providerPreference - The preferred provider used for the connection within the Buy Widget.
|
|
25794
|
+
*/
|
|
25636
25795
|
type BuyNotConnected = {
|
|
25637
25796
|
providerPreference: string;
|
|
25638
25797
|
};
|
|
25798
|
+
/**
|
|
25799
|
+
* Type representing a Buy Widget event with type SUCCESS.
|
|
25800
|
+
* @property {number} timestamp - The timestamp of the successful buy.
|
|
25801
|
+
*/
|
|
25639
25802
|
type BuySuccess = {
|
|
25640
25803
|
timestamp: number;
|
|
25641
25804
|
};
|
|
25805
|
+
/**
|
|
25806
|
+
* Type representing a Buy Widget event with type FAILURE.
|
|
25807
|
+
* @property {string} reason - The reason why the buy failed.
|
|
25808
|
+
* @property {number} timestamp - The timestamp of the failed buy.
|
|
25809
|
+
*/
|
|
25642
25810
|
type BuyFailed = {
|
|
25643
25811
|
reason: string;
|
|
25644
25812
|
timestamp: number;
|
|
25645
25813
|
};
|
|
25646
|
-
|
|
25814
|
+
type OnRampEvent<T> = {
|
|
25815
|
+
type: OnRampEventType;
|
|
25816
|
+
data: T;
|
|
25817
|
+
};
|
|
25818
|
+
declare enum OnRampEventType {
|
|
25819
|
+
}
|
|
25820
|
+
/**
|
|
25821
|
+
* Props for the Connect Widget component
|
|
25822
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
25823
|
+
* @property {string} theme - The theme to use.
|
|
25824
|
+
*/
|
|
25825
|
+
interface ImtblConnectProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
25647
25826
|
providerPreference: string;
|
|
25648
25827
|
theme: string;
|
|
25649
25828
|
}
|
|
25650
|
-
|
|
25829
|
+
/**
|
|
25830
|
+
* Props for the Wallet Widget component
|
|
25831
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
25832
|
+
* @property {string} theme - The theme to use.
|
|
25833
|
+
*/
|
|
25834
|
+
interface ImtblWalletProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
25651
25835
|
providerPreference: string;
|
|
25836
|
+
isOnRampEnabled?: string;
|
|
25837
|
+
isSwapEnabled?: string;
|
|
25838
|
+
isBridgeEnabled?: string;
|
|
25652
25839
|
theme: string;
|
|
25653
25840
|
}
|
|
25654
|
-
|
|
25841
|
+
/**
|
|
25842
|
+
* Props for the Swap Widget component
|
|
25843
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
25844
|
+
* @property {string} theme - The theme to use.
|
|
25845
|
+
* @property {string} amount - The amount to swap.
|
|
25846
|
+
* @property {string} fromContractAddress - The contract address of the source token.
|
|
25847
|
+
* @property {string} toContractAddress - The contract address of the destination token.
|
|
25848
|
+
*/
|
|
25849
|
+
interface ImtblSwapProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
25655
25850
|
providerPreference: string;
|
|
25656
25851
|
theme: string;
|
|
25657
25852
|
amount: string;
|
|
25658
25853
|
fromContractAddress: string;
|
|
25659
25854
|
toContractAddress: string;
|
|
25660
25855
|
}
|
|
25661
|
-
|
|
25856
|
+
/**
|
|
25857
|
+
* Props for the Bridge Widget component
|
|
25858
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
25859
|
+
* @property {string} theme - The theme to use.
|
|
25860
|
+
* @property {string} fromContractAddress - The contract address of the source token.
|
|
25861
|
+
* @property {string} fromNetwork - The network of the source token.
|
|
25862
|
+
* @property {string} amount - The amount to bridge.
|
|
25863
|
+
*/
|
|
25864
|
+
interface ImtblBridgeProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
25662
25865
|
providerPreference: string;
|
|
25663
25866
|
theme: string;
|
|
25664
25867
|
fromContractAddress: string;
|
|
25665
25868
|
fromNetwork: string;
|
|
25666
25869
|
amount: string;
|
|
25667
25870
|
}
|
|
25668
|
-
|
|
25871
|
+
/**
|
|
25872
|
+
* Props for the Example Widget component
|
|
25873
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
25874
|
+
* @property {string} theme - The theme to use.
|
|
25875
|
+
* @experimental
|
|
25876
|
+
*/
|
|
25877
|
+
interface ImtblExampleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
25669
25878
|
providerPreference: string;
|
|
25670
25879
|
theme: string;
|
|
25671
25880
|
}
|
|
25672
|
-
|
|
25881
|
+
/**
|
|
25882
|
+
* Props for the Buy Widget component
|
|
25883
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
25884
|
+
* @property {string} theme - The theme to use.
|
|
25885
|
+
* @property {string} orderId - The id of the order to buy.
|
|
25886
|
+
*/
|
|
25887
|
+
interface ImtblBuyProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
25673
25888
|
providerPreference: string;
|
|
25674
25889
|
theme: string;
|
|
25675
25890
|
orderId: string;
|
|
25676
25891
|
}
|
|
25677
|
-
|
|
25892
|
+
/**
|
|
25893
|
+
* Props for the TransitionExample Widget component
|
|
25894
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
25895
|
+
* @property {string} theme - The theme to use.
|
|
25896
|
+
*/
|
|
25897
|
+
interface ImtblTransitionExampleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
25678
25898
|
providerPreference: string;
|
|
25679
25899
|
theme: string;
|
|
25680
25900
|
}
|
|
25681
|
-
|
|
25901
|
+
/**
|
|
25902
|
+
* Props for the InnerWidgetExample Widget component
|
|
25903
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
25904
|
+
* @property {string} theme - The theme to use.
|
|
25905
|
+
*/
|
|
25906
|
+
interface ImtblInnerWidgetExampleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
25682
25907
|
providerPreference: string;
|
|
25683
25908
|
theme: string;
|
|
25684
25909
|
}
|
|
25685
|
-
|
|
25910
|
+
/**
|
|
25911
|
+
* Props for the OuterWidgetExample Widget component
|
|
25912
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
25913
|
+
* @property {string} theme - The theme to use.
|
|
25914
|
+
*/
|
|
25915
|
+
interface ImtblOuterWidgetExampleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
25686
25916
|
providerPreference: string;
|
|
25687
25917
|
theme: string;
|
|
25688
25918
|
}
|
|
25919
|
+
/**
|
|
25920
|
+
* Enum representing the networks supported by Checkout.
|
|
25921
|
+
*/
|
|
25689
25922
|
declare enum Network {
|
|
25690
25923
|
ETHEREUM = "Ethereum",
|
|
25691
25924
|
GOERLI = "Goerli",
|
|
25692
25925
|
POLYGON = "Polygon"
|
|
25693
25926
|
}
|
|
25927
|
+
/**
|
|
25928
|
+
* Enum representing the themes for the Checkout widgets.
|
|
25929
|
+
*/
|
|
25694
25930
|
declare enum WidgetTheme {
|
|
25695
25931
|
LIGHT = "light",
|
|
25696
25932
|
DARK = "dark",
|
|
25697
25933
|
CUSTOM = "custom"
|
|
25698
25934
|
}
|
|
25935
|
+
/**
|
|
25936
|
+
* Enum representing the default Web3 providers supported by the Checkout widgets.
|
|
25937
|
+
*/
|
|
25938
|
+
declare enum WidgetConnectionProviders {
|
|
25939
|
+
METAMASK = "metamask"
|
|
25940
|
+
}
|
|
25941
|
+
/**
|
|
25942
|
+
* Enum representing list of Checkout Widgets DOM tags.
|
|
25943
|
+
*/
|
|
25944
|
+
declare enum CheckoutWidgetTagNames {
|
|
25945
|
+
CONNECT = "imtbl-connect",
|
|
25946
|
+
WALLET = "imtbl-wallet",
|
|
25947
|
+
SWAP = "imtbl-swap",
|
|
25948
|
+
BUY = "imtbl-buy",
|
|
25949
|
+
BRIDGE = "imtbl-bridge",
|
|
25950
|
+
EXAMPLE = "imtbl-example"
|
|
25951
|
+
}
|
|
25952
|
+
/**
|
|
25953
|
+
* Represents the configuration options for the Checkout Widgets.
|
|
25954
|
+
* @property {WidgetTheme} theme - The theme of the Checkout Widget.
|
|
25955
|
+
*/
|
|
25956
|
+
type CheckoutWidgetsConfig = {
|
|
25957
|
+
theme?: WidgetTheme;
|
|
25958
|
+
};
|
|
25959
|
+
/**
|
|
25960
|
+
* Interface representing the props for the Bridge Widget component.
|
|
25961
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Bridge Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
25962
|
+
* @property {string} fromContractAddress - The contract address to send tokens from.
|
|
25963
|
+
* @property {string} amount - The amount of tokens to send.
|
|
25964
|
+
* @property {Network} fromNetwork - The network to send tokens from.
|
|
25965
|
+
*/
|
|
25966
|
+
interface BridgeReactProps {
|
|
25967
|
+
providerPreference: WidgetConnectionProviders;
|
|
25968
|
+
fromContractAddress?: string;
|
|
25969
|
+
amount?: string;
|
|
25970
|
+
fromNetwork?: Network;
|
|
25971
|
+
}
|
|
25972
|
+
/**
|
|
25973
|
+
* A React functional component that renders the Checkout Bridge Widget.
|
|
25974
|
+
* @param {BridgeReactProps} props - The props for the Bridge Widget component.
|
|
25975
|
+
* @returns {JSX.Element} - The rendered Bridge Widget component.
|
|
25976
|
+
*/
|
|
25977
|
+
declare function BridgeReact(props: BridgeReactProps): JSX.Element;
|
|
25978
|
+
/**
|
|
25979
|
+
* Interface representing the props for the Buy Widget component.
|
|
25980
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Buy Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
25981
|
+
* @property {string} orderId - The ID that identifies the open buy order associated to the assets to buy.
|
|
25982
|
+
*/
|
|
25983
|
+
interface BuyReactProps {
|
|
25984
|
+
providerPreference: WidgetConnectionProviders;
|
|
25985
|
+
orderId: string;
|
|
25986
|
+
}
|
|
25987
|
+
/**
|
|
25988
|
+
* A React functional component that renders the Checkout Buy Widget.
|
|
25989
|
+
* @param {BuyReactProps} props - The props for the Buy Widget component.
|
|
25990
|
+
* @returns {JSX.Element} - The rendered Buy Widget component.
|
|
25991
|
+
*/
|
|
25992
|
+
declare function BuyReact(props: BuyReactProps): JSX.Element;
|
|
25993
|
+
/**
|
|
25994
|
+
* Interface representing the props for the Connect Widget component.
|
|
25995
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Connect Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
25996
|
+
*/
|
|
25997
|
+
interface ConnectReactProps {
|
|
25998
|
+
providerPreference?: WidgetConnectionProviders;
|
|
25999
|
+
}
|
|
26000
|
+
/**
|
|
26001
|
+
* A React functional component that renders the Checkout Connect Widget.
|
|
26002
|
+
* @param {ConnectReactProps} props - The props for the Connect Widget component.
|
|
26003
|
+
* @returns {JSX.Element} - The rendered Connect Widget component.
|
|
26004
|
+
*/
|
|
26005
|
+
declare function ConnectReact(props: ConnectReactProps): JSX.Element;
|
|
26006
|
+
/**
|
|
26007
|
+
* Interface representing the props for the Swap Widget component.
|
|
26008
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Swap Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
26009
|
+
* @property {string} fromContractAddress - The contract address to swap tokens from.
|
|
26010
|
+
* @property {string} amount - The amount of tokens to send.
|
|
26011
|
+
* @property {Network} toContractAddress - The contract address to swap tokens to.
|
|
26012
|
+
*/
|
|
26013
|
+
interface SwapReactProps {
|
|
26014
|
+
providerPreference: WidgetConnectionProviders;
|
|
26015
|
+
fromContractAddress?: string;
|
|
26016
|
+
amount?: string;
|
|
26017
|
+
toContractAddress?: string;
|
|
26018
|
+
}
|
|
26019
|
+
/**
|
|
26020
|
+
* A React functional component that renders the Checkout Swap Widget.
|
|
26021
|
+
* @param {SwapReactProps} props - The props for the Swap Widget component.
|
|
26022
|
+
* @returns {JSX.Element} - The rendered Swap Widget component.
|
|
26023
|
+
*/
|
|
26024
|
+
declare function SwapReact(props: SwapReactProps): JSX.Element;
|
|
26025
|
+
/**
|
|
26026
|
+
* Interface representing the props for the Wallet Widget component.
|
|
26027
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Wallet Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
26028
|
+
*/
|
|
26029
|
+
interface WalletReactProps {
|
|
26030
|
+
providerPreference?: WidgetConnectionProviders;
|
|
26031
|
+
isOnRampEnabled?: boolean;
|
|
26032
|
+
isSwapEnabled?: boolean;
|
|
26033
|
+
isBridgeEnabled?: boolean;
|
|
26034
|
+
}
|
|
26035
|
+
/**
|
|
26036
|
+
* A React functional component that renders the Checkout Wallet Widget.
|
|
26037
|
+
* @param {WalletReactProps} props - The props for the Wallet Widget component.
|
|
26038
|
+
* @returns {JSX.Element} - The rendered Wallet Widget component.
|
|
26039
|
+
*/
|
|
26040
|
+
declare function WalletReact(props: WalletReactProps): JSX.Element;
|
|
26041
|
+
/**
|
|
26042
|
+
* Interface representing the props for the Example Widget component.
|
|
26043
|
+
* @experimental
|
|
26044
|
+
*/
|
|
26045
|
+
interface ExampleReactProps {
|
|
26046
|
+
providerPreference: WidgetConnectionProviders;
|
|
26047
|
+
fromContractAddress?: string;
|
|
26048
|
+
amount?: string;
|
|
26049
|
+
fromNetwork?: Network;
|
|
26050
|
+
}
|
|
26051
|
+
/**
|
|
26052
|
+
* A React functional component that renders the Checkout Example Widget.
|
|
26053
|
+
* @experimental
|
|
26054
|
+
*/
|
|
26055
|
+
declare function ExampleReact(props: ExampleReactProps): JSX.Element;
|
|
26056
|
+
/**
|
|
26057
|
+
* CheckoutWidgets allows to inject the Checkout Widgets into your application.
|
|
26058
|
+
* @param {CheckoutWidgetsConfig|undefined} config - Checkout Widget global configurations.
|
|
26059
|
+
*/
|
|
26060
|
+
declare function CheckoutWidgets(config?: CheckoutWidgetsConfig): void;
|
|
26061
|
+
/**
|
|
26062
|
+
* UpdateConfig allows to update the configuration of an existing Checkout Widgets instance.
|
|
26063
|
+
* @param {CheckoutWidgetsConfig} config - new Checkout Widget global configurations.
|
|
26064
|
+
*/
|
|
26065
|
+
declare function UpdateConfig(config: CheckoutWidgetsConfig): void;
|
|
26066
|
+
/**
|
|
26067
|
+
* SetProvider allows to set the provider for an existing Checkout Widgets instance.
|
|
26068
|
+
* @param {CheckoutWidgetTagNames} tagName - target Checkout Widget widget.
|
|
26069
|
+
* @param {Web3Provider} provider - the provider to connect to the blockchain network.
|
|
26070
|
+
*/
|
|
26071
|
+
declare function SetProvider(tagName: CheckoutWidgetTagNames, provider: Web3Provider | null): void;
|
|
25699
26072
|
|
|
25700
|
-
export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuySuccess, ChainId, CheckConnectionParams, CheckConnectionResult, Checkout, CheckoutErrorType, ConnectEvent, ConnectEventType, ConnectParams, ConnectResult, ConnectionFailed, ConnectionProviders, ConnectionSuccess, Environment, ErrorType, GenericIMXProvider, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetNetworkParams, GetTokenAllowListParams, GetTokenAllowListResult, GetWalletAllowListParams, GetWalletAllowListResult, IMTBLWidgetEvents, IMXProvider, ImmutableConfiguration, ImmutableXClient, ImtblBridgeProps, ImtblBuyProps, ImtblConnectProps, ImtblExampleProps, ImtblInnerWidgetExampleProps, ImtblOuterWidgetExampleProps, ImtblSwapProps, ImtblTransitionExampleProps, ImtblWalletProps, ImxModuleConfiguration as ImxClientModuleConfiguration, WalletConnection as ImxClientWalletConnection, MetaMaskIMXProvider, ModuleConfiguration, Network, NetworkFilter, NetworkFilterTypes, NetworkInfo, Passport, PassportError, PassportModuleConfiguration, ProviderConfiguration, SendTransactionParams, SendTransactionResult, SwapEvent, SwapEventType, SwapFailed, SwapSuccess, SwitchNetworkParams, SwitchNetworkResult, TokenFilter, TokenFilterTypes, TokenInfo, Transaction, WalletEvent, WalletEventType, WalletFilter, WalletFilterTypes, WalletInfo, WalletNetworkSwitchEvent, WidgetTheme, createStarkSigner as imxClientCreateStarkSigner, generateLegacyStarkPrivateKey as imxClientGenerateLegacyStarkPrivateKey };
|
|
26073
|
+
export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeReact, BridgeReactProps, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuyReact, BuyReactProps, BuySuccess, ChainId, CheckConnectionParams, CheckConnectionResult, Checkout, CheckoutErrorType, CheckoutWidgetTagNames, CheckoutWidgets, CheckoutWidgetsConfig, ConnectEvent, ConnectEventType, ConnectParams, ConnectReact, ConnectReactProps, ConnectResult, ConnectionFailed, ConnectionProviders, ConnectionSuccess, ConvertTokensToFiatParams, ConvertTokensToFiatResult, Environment, ErrorType, ExampleReact, ExampleReactProps, GenericIMXProvider, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetNetworkParams, GetTokenAllowListParams, GetTokenAllowListResult, GetWalletAllowListParams, GetWalletAllowListResult, IMTBLWidgetEvents, IMXProvider, ImmutableConfiguration, ImmutableXClient, ImtblBridgeProps, ImtblBuyProps, ImtblConnectProps, ImtblExampleProps, ImtblInnerWidgetExampleProps, ImtblOuterWidgetExampleProps, ImtblSwapProps, ImtblTransitionExampleProps, ImtblWalletProps, ImxModuleConfiguration as ImxClientModuleConfiguration, WalletConnection as ImxClientWalletConnection, MetaMaskIMXProvider, ModuleConfiguration, Network, NetworkFilter, NetworkFilterTypes, NetworkInfo, OnRampEvent, OnRampEventType, Passport, PassportError, PassportModuleConfiguration, ProviderConfiguration, SendTransactionParams, SendTransactionResult, SetProvider, SupportedFiatCurrencies, SwapEvent, SwapEventType, SwapFailed, SwapReact, SwapReactProps, SwapSuccess, SwitchNetworkParams, SwitchNetworkResult, TokenFilter, TokenFilterTypes, TokenInfo, TokenToFiatConversionResult, Transaction, UpdateConfig, WalletAddCoinsEvent, WalletEvent, WalletEventType, WalletFilter, WalletFilterTypes, WalletInfo, WalletNetworkSwitchEvent, WalletReact, WalletReactProps, WalletRequestBridgeEvent, WalletRequestOnrampEvent, WalletRequestSwapEvent, WidgetConnectionProviders, WidgetTheme, createStarkSigner as imxClientCreateStarkSigner, generateLegacyStarkPrivateKey as imxClientGenerateLegacyStarkPrivateKey };
|