@imtbl/sdk 0.1.5-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_widgets.d.ts +312 -16
- package/dist/checkout_widgets.js +83 -51
- package/dist/immutablex_client.js +2 -2
- package/dist/index.cjs +82 -50
- package/dist/index.d.ts +284 -16
- package/dist/index.js +85 -53
- package/dist/passport.js +2 -2
- package/package.json +1 -1
|
@@ -547,6 +547,34 @@ declare class Web3Provider extends JsonRpcProvider {
|
|
|
547
547
|
send(method: string, params: Array<any>): Promise<any>;
|
|
548
548
|
}
|
|
549
549
|
|
|
550
|
+
/**
|
|
551
|
+
* Interface representing token information.
|
|
552
|
+
* @property {string} name - The token name.
|
|
553
|
+
* @property {string} symbol - The token symbol.
|
|
554
|
+
* @property {number} decimals - The token decimals.
|
|
555
|
+
* @property {string} [address] - The token contract address.
|
|
556
|
+
* @property {string} [icon] - The token icon URL/data:image.
|
|
557
|
+
*/
|
|
558
|
+
interface TokenInfo {
|
|
559
|
+
name: string;
|
|
560
|
+
symbol: string;
|
|
561
|
+
decimals: number;
|
|
562
|
+
address?: string;
|
|
563
|
+
icon?: string;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Interface representing the information of a network.
|
|
567
|
+
* @property {string} name - The name of the network.
|
|
568
|
+
* @property {number} chainId - The ID of the network.
|
|
569
|
+
* @property {TokenInfo} nativeCurrency - The info of the network's native currency.
|
|
570
|
+
* @property {boolean} isSupported - Flag indicating if the network is supported by the application.
|
|
571
|
+
*/
|
|
572
|
+
interface NetworkInfo {
|
|
573
|
+
name: string;
|
|
574
|
+
chainId: number;
|
|
575
|
+
nativeCurrency: TokenInfo;
|
|
576
|
+
isSupported: boolean;
|
|
577
|
+
}
|
|
550
578
|
/**
|
|
551
579
|
* Enum representing the list of default supported providers.
|
|
552
580
|
*/
|
|
@@ -14863,195 +14891,463 @@ declare global {
|
|
|
14863
14891
|
}
|
|
14864
14892
|
}
|
|
14865
14893
|
|
|
14894
|
+
/**
|
|
14895
|
+
* Enum representing the events emitted by the widgets.
|
|
14896
|
+
*/
|
|
14866
14897
|
declare enum IMTBLWidgetEvents {
|
|
14867
14898
|
IMTBL_CONNECT_WIDGET_EVENT = "imtbl-connect-widget",
|
|
14868
14899
|
IMTBL_WALLET_WIDGET_EVENT = "imtbl-wallet-widget",
|
|
14869
14900
|
IMTBL_SWAP_WIDGET_EVENT = "imtbl-swap-widget",
|
|
14870
14901
|
IMTBL_BRIDGE_WIDGET_EVENT = "imtbl-bridge-widget",
|
|
14871
|
-
IMTBL_BUY_WIDGET_EVENT = "imtbl-buy-widget"
|
|
14902
|
+
IMTBL_BUY_WIDGET_EVENT = "imtbl-buy-widget",
|
|
14903
|
+
IMTBL_ONRAMP_WIDGET_EVENT = "imtbl-onramp-widget"
|
|
14872
14904
|
}
|
|
14905
|
+
/**
|
|
14906
|
+
* Enum representing possible Connect Widget event types.
|
|
14907
|
+
*/
|
|
14873
14908
|
declare enum ConnectEventType {
|
|
14874
14909
|
SUCCESS = "success",
|
|
14875
14910
|
FAILURE = "failure",
|
|
14876
14911
|
CLOSE_WIDGET = "close-widget"
|
|
14877
14912
|
}
|
|
14913
|
+
/**
|
|
14914
|
+
* Represents an event object emitted by the Connect Widget.
|
|
14915
|
+
* @property {BuyEventType} type - The type of the event.
|
|
14916
|
+
* @property {T} data - The data contained in the event.
|
|
14917
|
+
*/
|
|
14878
14918
|
type ConnectEvent<T> = {
|
|
14879
14919
|
type: ConnectEventType;
|
|
14880
14920
|
data: T;
|
|
14881
14921
|
};
|
|
14922
|
+
/**
|
|
14923
|
+
* Type representing a Connect Widget event with type SUCCESS.
|
|
14924
|
+
* @property {ConnectionProviders} providerPreference - The user's preferred connection provider.
|
|
14925
|
+
*/
|
|
14882
14926
|
type ConnectionSuccess = {
|
|
14883
14927
|
providerPreference: ConnectionProviders;
|
|
14884
14928
|
};
|
|
14929
|
+
/**
|
|
14930
|
+
* Type representing a Connect Widget event with type FAILURE.
|
|
14931
|
+
* @property {string} reason - A description of the reason for the failed connection attempt.
|
|
14932
|
+
*/
|
|
14885
14933
|
type ConnectionFailed = {
|
|
14886
14934
|
reason: string;
|
|
14887
14935
|
};
|
|
14936
|
+
/**
|
|
14937
|
+
* Enum representing possible Wallet Widget event types.
|
|
14938
|
+
*/
|
|
14888
14939
|
declare enum WalletEventType {
|
|
14889
14940
|
CLOSE_WIDGET = "close-widget",
|
|
14890
|
-
NETWORK_SWITCH = "network-switch"
|
|
14941
|
+
NETWORK_SWITCH = "network-switch",
|
|
14942
|
+
ADD_COINS = "add-coins",
|
|
14943
|
+
REQUEST_SWAP = "request-swap",
|
|
14944
|
+
REQUEST_BRIDGE = "request-bridge",
|
|
14945
|
+
REQUEST_ONRAMP = "request-onramp"
|
|
14891
14946
|
}
|
|
14947
|
+
/**
|
|
14948
|
+
* Type representing the data emitted by the network switch event.
|
|
14949
|
+
* @property {string} network - The name of the selected network.
|
|
14950
|
+
* @property {number} chainId - The chain ID of the selected network.
|
|
14951
|
+
*/
|
|
14892
14952
|
type WalletNetworkSwitchEvent = {
|
|
14893
14953
|
network: string;
|
|
14894
14954
|
chainId: number;
|
|
14895
14955
|
};
|
|
14956
|
+
type WalletAddCoinsEvent = {
|
|
14957
|
+
network?: NetworkInfo;
|
|
14958
|
+
token?: TokenInfo;
|
|
14959
|
+
tokenAmount?: string;
|
|
14960
|
+
};
|
|
14961
|
+
type WalletRequestSwapEvent = {
|
|
14962
|
+
fromTokenAddress: string;
|
|
14963
|
+
toTokenAddress: string;
|
|
14964
|
+
amount: string;
|
|
14965
|
+
};
|
|
14966
|
+
type WalletRequestBridgeEvent = {
|
|
14967
|
+
fromNetwork: string;
|
|
14968
|
+
tokenAddress: string;
|
|
14969
|
+
amount: string;
|
|
14970
|
+
};
|
|
14971
|
+
type WalletRequestOnrampEvent = {
|
|
14972
|
+
tokenAddress: string;
|
|
14973
|
+
amount: string;
|
|
14974
|
+
};
|
|
14975
|
+
/**
|
|
14976
|
+
* Represents an event object emitted by the Wallet Widget.
|
|
14977
|
+
* @property {WalletEventType} type - The type of the event.
|
|
14978
|
+
* @property {T} data - The data contained in the event.
|
|
14979
|
+
*/
|
|
14896
14980
|
type WalletEvent<T> = {
|
|
14897
14981
|
type: WalletEventType;
|
|
14898
14982
|
data: T;
|
|
14899
14983
|
};
|
|
14984
|
+
/**
|
|
14985
|
+
* Represents an event object emitted by the Swap Widget.
|
|
14986
|
+
* @property {SwapEventType} type - The type of the event.
|
|
14987
|
+
* @property {T} data - The data contained in the event.
|
|
14988
|
+
*/
|
|
14900
14989
|
type SwapEvent<T> = {
|
|
14901
14990
|
type: SwapEventType;
|
|
14902
14991
|
data: T;
|
|
14903
14992
|
};
|
|
14993
|
+
/**
|
|
14994
|
+
* Enum representing possible Swap Widget event types.
|
|
14995
|
+
*/
|
|
14904
14996
|
declare enum SwapEventType {
|
|
14905
14997
|
SUCCESS = "success",
|
|
14906
14998
|
FAILURE = "failure"
|
|
14907
14999
|
}
|
|
15000
|
+
/**
|
|
15001
|
+
* Type representing a Swap Widget with type SUCCESS.
|
|
15002
|
+
* @property {number} timestamp - The timestamp of the successful swap.
|
|
15003
|
+
*/
|
|
14908
15004
|
type SwapSuccess = {
|
|
14909
15005
|
timestamp: number;
|
|
14910
15006
|
};
|
|
15007
|
+
/**
|
|
15008
|
+
* Type representing a Swap Widget with type FAILURE.
|
|
15009
|
+
* @property {string} reason - The reason why the swap failed.
|
|
15010
|
+
* @property {number} timestamp - The timestamp of the failed swap.
|
|
15011
|
+
*/
|
|
14911
15012
|
type SwapFailed = {
|
|
14912
15013
|
reason: string;
|
|
14913
15014
|
timestamp: number;
|
|
14914
15015
|
};
|
|
15016
|
+
/**
|
|
15017
|
+
* Represents an event object emitted by the Bridge Widget.
|
|
15018
|
+
* @property {BridgeEventType} type - The type of the event.
|
|
15019
|
+
* @property {T} data - The data associated with the event.
|
|
15020
|
+
*/
|
|
14915
15021
|
type BridgeEvent<T> = {
|
|
14916
15022
|
type: BridgeEventType;
|
|
14917
15023
|
data: T;
|
|
14918
15024
|
};
|
|
15025
|
+
/**
|
|
15026
|
+
* Enum of possible Bridge Widget event types.
|
|
15027
|
+
*/
|
|
14919
15028
|
declare enum BridgeEventType {
|
|
14920
15029
|
CLOSE_WIDGET = "close-widget",
|
|
14921
15030
|
SUCCESS = "success",
|
|
14922
15031
|
FAILURE = "failure"
|
|
14923
15032
|
}
|
|
15033
|
+
/**
|
|
15034
|
+
* Type representing a Bridge Widget event with type SUCCESS
|
|
15035
|
+
* @property {number} timestamp - The UNIX timestamp (in milliseconds) when the event occurred.
|
|
15036
|
+
*/
|
|
14924
15037
|
type BridgeSuccess = {
|
|
14925
15038
|
timestamp: number;
|
|
14926
15039
|
};
|
|
15040
|
+
/**
|
|
15041
|
+
* Type representing a Bridge Widget event with type FAILURE
|
|
15042
|
+
* @property {string} reason - The reason for the failure.
|
|
15043
|
+
* @property {number} timestamp - The UNIX timestamp (in milliseconds) when the event occurred.
|
|
15044
|
+
*/
|
|
14927
15045
|
type BridgeFailed = {
|
|
14928
15046
|
reason: string;
|
|
14929
15047
|
timestamp: number;
|
|
14930
15048
|
};
|
|
15049
|
+
/**
|
|
15050
|
+
* Represents an event object emitted by the Buy Widget.
|
|
15051
|
+
* @property {BuyEventType} type - The type of the event.
|
|
15052
|
+
* @property {T} data - The data contained in the event.
|
|
15053
|
+
*/
|
|
14931
15054
|
type BuyEvent<T> = {
|
|
14932
15055
|
type: BuyEventType;
|
|
14933
15056
|
data: T;
|
|
14934
15057
|
};
|
|
15058
|
+
/**
|
|
15059
|
+
* Enum representing possible Buy Widget event types.
|
|
15060
|
+
*/
|
|
14935
15061
|
declare enum BuyEventType {
|
|
14936
15062
|
SUCCESS = "success",
|
|
14937
15063
|
FAILURE = "failure",
|
|
14938
15064
|
NOT_CONNECTED = "not_connected",
|
|
14939
15065
|
CLOSE = "close"
|
|
14940
15066
|
}
|
|
15067
|
+
/**
|
|
15068
|
+
* Type representing a Buy Widget event with type CLOSE.
|
|
15069
|
+
*/
|
|
14941
15070
|
type BuyClose = {};
|
|
15071
|
+
/**
|
|
15072
|
+
* Type representing a Buy Widget event with type NOT_CONNECTED.
|
|
15073
|
+
* @property {string} providerPreference - The preferred provider used for the connection within the Buy Widget.
|
|
15074
|
+
*/
|
|
14942
15075
|
type BuyNotConnected = {
|
|
14943
15076
|
providerPreference: string;
|
|
14944
15077
|
};
|
|
15078
|
+
/**
|
|
15079
|
+
* Type representing a Buy Widget event with type SUCCESS.
|
|
15080
|
+
* @property {number} timestamp - The timestamp of the successful buy.
|
|
15081
|
+
*/
|
|
14945
15082
|
type BuySuccess = {
|
|
14946
15083
|
timestamp: number;
|
|
14947
15084
|
};
|
|
15085
|
+
/**
|
|
15086
|
+
* Type representing a Buy Widget event with type FAILURE.
|
|
15087
|
+
* @property {string} reason - The reason why the buy failed.
|
|
15088
|
+
* @property {number} timestamp - The timestamp of the failed buy.
|
|
15089
|
+
*/
|
|
14948
15090
|
type BuyFailed = {
|
|
14949
15091
|
reason: string;
|
|
14950
15092
|
timestamp: number;
|
|
14951
15093
|
};
|
|
14952
|
-
|
|
15094
|
+
type OnRampEvent<T> = {
|
|
15095
|
+
type: OnRampEventType;
|
|
15096
|
+
data: T;
|
|
15097
|
+
};
|
|
15098
|
+
declare enum OnRampEventType {
|
|
15099
|
+
}
|
|
15100
|
+
/**
|
|
15101
|
+
* Props for the Connect Widget component
|
|
15102
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15103
|
+
* @property {string} theme - The theme to use.
|
|
15104
|
+
*/
|
|
15105
|
+
interface ImtblConnectProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14953
15106
|
providerPreference: string;
|
|
14954
15107
|
theme: string;
|
|
14955
15108
|
}
|
|
14956
|
-
|
|
15109
|
+
/**
|
|
15110
|
+
* Props for the Wallet Widget component
|
|
15111
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15112
|
+
* @property {string} theme - The theme to use.
|
|
15113
|
+
*/
|
|
15114
|
+
interface ImtblWalletProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14957
15115
|
providerPreference: string;
|
|
15116
|
+
isOnRampEnabled?: string;
|
|
15117
|
+
isSwapEnabled?: string;
|
|
15118
|
+
isBridgeEnabled?: string;
|
|
14958
15119
|
theme: string;
|
|
14959
15120
|
}
|
|
14960
|
-
|
|
15121
|
+
/**
|
|
15122
|
+
* Props for the Swap Widget component
|
|
15123
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15124
|
+
* @property {string} theme - The theme to use.
|
|
15125
|
+
* @property {string} amount - The amount to swap.
|
|
15126
|
+
* @property {string} fromContractAddress - The contract address of the source token.
|
|
15127
|
+
* @property {string} toContractAddress - The contract address of the destination token.
|
|
15128
|
+
*/
|
|
15129
|
+
interface ImtblSwapProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14961
15130
|
providerPreference: string;
|
|
14962
15131
|
theme: string;
|
|
14963
15132
|
amount: string;
|
|
14964
15133
|
fromContractAddress: string;
|
|
14965
15134
|
toContractAddress: string;
|
|
14966
15135
|
}
|
|
14967
|
-
|
|
15136
|
+
/**
|
|
15137
|
+
* Props for the Bridge Widget component
|
|
15138
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15139
|
+
* @property {string} theme - The theme to use.
|
|
15140
|
+
* @property {string} fromContractAddress - The contract address of the source token.
|
|
15141
|
+
* @property {string} fromNetwork - The network of the source token.
|
|
15142
|
+
* @property {string} amount - The amount to bridge.
|
|
15143
|
+
*/
|
|
15144
|
+
interface ImtblBridgeProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14968
15145
|
providerPreference: string;
|
|
14969
15146
|
theme: string;
|
|
14970
15147
|
fromContractAddress: string;
|
|
14971
15148
|
fromNetwork: string;
|
|
14972
15149
|
amount: string;
|
|
14973
15150
|
}
|
|
14974
|
-
|
|
15151
|
+
/**
|
|
15152
|
+
* Props for the Example Widget component
|
|
15153
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15154
|
+
* @property {string} theme - The theme to use.
|
|
15155
|
+
* @experimental
|
|
15156
|
+
*/
|
|
15157
|
+
interface ImtblExampleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14975
15158
|
providerPreference: string;
|
|
14976
15159
|
theme: string;
|
|
14977
15160
|
}
|
|
14978
|
-
|
|
15161
|
+
/**
|
|
15162
|
+
* Props for the Buy Widget component
|
|
15163
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15164
|
+
* @property {string} theme - The theme to use.
|
|
15165
|
+
* @property {string} orderId - The id of the order to buy.
|
|
15166
|
+
*/
|
|
15167
|
+
interface ImtblBuyProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14979
15168
|
providerPreference: string;
|
|
14980
15169
|
theme: string;
|
|
14981
15170
|
orderId: string;
|
|
14982
15171
|
}
|
|
14983
|
-
|
|
15172
|
+
/**
|
|
15173
|
+
* Props for the TransitionExample Widget component
|
|
15174
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15175
|
+
* @property {string} theme - The theme to use.
|
|
15176
|
+
*/
|
|
15177
|
+
interface ImtblTransitionExampleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14984
15178
|
providerPreference: string;
|
|
14985
15179
|
theme: string;
|
|
14986
15180
|
}
|
|
14987
|
-
|
|
15181
|
+
/**
|
|
15182
|
+
* Props for the InnerWidgetExample Widget component
|
|
15183
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15184
|
+
* @property {string} theme - The theme to use.
|
|
15185
|
+
*/
|
|
15186
|
+
interface ImtblInnerWidgetExampleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14988
15187
|
providerPreference: string;
|
|
14989
15188
|
theme: string;
|
|
14990
15189
|
}
|
|
14991
|
-
|
|
15190
|
+
/**
|
|
15191
|
+
* Props for the OuterWidgetExample Widget component
|
|
15192
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15193
|
+
* @property {string} theme - The theme to use.
|
|
15194
|
+
*/
|
|
15195
|
+
interface ImtblOuterWidgetExampleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14992
15196
|
providerPreference: string;
|
|
14993
15197
|
theme: string;
|
|
14994
15198
|
}
|
|
15199
|
+
/**
|
|
15200
|
+
* Enum representing the networks supported by Checkout.
|
|
15201
|
+
*/
|
|
14995
15202
|
declare enum Network {
|
|
14996
15203
|
ETHEREUM = "Ethereum",
|
|
14997
15204
|
GOERLI = "Goerli",
|
|
14998
15205
|
POLYGON = "Polygon"
|
|
14999
15206
|
}
|
|
15207
|
+
/**
|
|
15208
|
+
* Enum representing the themes for the Checkout widgets.
|
|
15209
|
+
*/
|
|
15000
15210
|
declare enum WidgetTheme {
|
|
15001
15211
|
LIGHT = "light",
|
|
15002
15212
|
DARK = "dark",
|
|
15003
15213
|
CUSTOM = "custom"
|
|
15004
15214
|
}
|
|
15215
|
+
/**
|
|
15216
|
+
* Enum representing the default Web3 providers supported by the Checkout widgets.
|
|
15217
|
+
*/
|
|
15005
15218
|
declare enum WidgetConnectionProviders {
|
|
15006
15219
|
METAMASK = "metamask"
|
|
15007
15220
|
}
|
|
15221
|
+
/**
|
|
15222
|
+
* Enum representing list of Checkout Widgets DOM tags.
|
|
15223
|
+
*/
|
|
15008
15224
|
declare enum CheckoutWidgetTagNames {
|
|
15009
15225
|
CONNECT = "imtbl-connect",
|
|
15010
15226
|
WALLET = "imtbl-wallet",
|
|
15011
15227
|
SWAP = "imtbl-swap",
|
|
15012
15228
|
BUY = "imtbl-buy",
|
|
15013
15229
|
BRIDGE = "imtbl-bridge",
|
|
15014
|
-
|
|
15230
|
+
EXAMPLE = "imtbl-example"
|
|
15015
15231
|
}
|
|
15232
|
+
/**
|
|
15233
|
+
* Represents the configuration options for the Checkout Widgets.
|
|
15234
|
+
* @property {WidgetTheme} theme - The theme of the Checkout Widget.
|
|
15235
|
+
*/
|
|
15016
15236
|
type CheckoutWidgetsConfig = {
|
|
15017
15237
|
theme?: WidgetTheme;
|
|
15018
15238
|
};
|
|
15239
|
+
/**
|
|
15240
|
+
* Interface representing the props for the Bridge Widget component.
|
|
15241
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Bridge Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
15242
|
+
* @property {string} fromContractAddress - The contract address to send tokens from.
|
|
15243
|
+
* @property {string} amount - The amount of tokens to send.
|
|
15244
|
+
* @property {Network} fromNetwork - The network to send tokens from.
|
|
15245
|
+
*/
|
|
15019
15246
|
interface BridgeReactProps {
|
|
15020
15247
|
providerPreference: WidgetConnectionProviders;
|
|
15021
15248
|
fromContractAddress?: string;
|
|
15022
15249
|
amount?: string;
|
|
15023
15250
|
fromNetwork?: Network;
|
|
15024
15251
|
}
|
|
15252
|
+
/**
|
|
15253
|
+
* A React functional component that renders the Checkout Bridge Widget.
|
|
15254
|
+
* @param {BridgeReactProps} props - The props for the Bridge Widget component.
|
|
15255
|
+
* @returns {JSX.Element} - The rendered Bridge Widget component.
|
|
15256
|
+
*/
|
|
15025
15257
|
declare function BridgeReact(props: BridgeReactProps): JSX.Element;
|
|
15258
|
+
/**
|
|
15259
|
+
* Interface representing the props for the Buy Widget component.
|
|
15260
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Buy Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
15261
|
+
* @property {string} orderId - The ID that identifies the open buy order associated to the assets to buy.
|
|
15262
|
+
*/
|
|
15026
15263
|
interface BuyReactProps {
|
|
15027
15264
|
providerPreference: WidgetConnectionProviders;
|
|
15028
15265
|
orderId: string;
|
|
15029
15266
|
}
|
|
15267
|
+
/**
|
|
15268
|
+
* A React functional component that renders the Checkout Buy Widget.
|
|
15269
|
+
* @param {BuyReactProps} props - The props for the Buy Widget component.
|
|
15270
|
+
* @returns {JSX.Element} - The rendered Buy Widget component.
|
|
15271
|
+
*/
|
|
15030
15272
|
declare function BuyReact(props: BuyReactProps): JSX.Element;
|
|
15031
|
-
|
|
15032
|
-
|
|
15033
|
-
|
|
15273
|
+
/**
|
|
15274
|
+
* Interface representing the props for the Connect Widget component.
|
|
15275
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Connect Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
15276
|
+
*/
|
|
15034
15277
|
interface ConnectReactProps {
|
|
15035
15278
|
providerPreference?: WidgetConnectionProviders;
|
|
15036
15279
|
}
|
|
15280
|
+
/**
|
|
15281
|
+
* A React functional component that renders the Checkout Connect Widget.
|
|
15282
|
+
* @param {ConnectReactProps} props - The props for the Connect Widget component.
|
|
15283
|
+
* @returns {JSX.Element} - The rendered Connect Widget component.
|
|
15284
|
+
*/
|
|
15037
15285
|
declare function ConnectReact(props: ConnectReactProps): JSX.Element;
|
|
15286
|
+
/**
|
|
15287
|
+
* Interface representing the props for the Swap Widget component.
|
|
15288
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Swap Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
15289
|
+
* @property {string} fromContractAddress - The contract address to swap tokens from.
|
|
15290
|
+
* @property {string} amount - The amount of tokens to send.
|
|
15291
|
+
* @property {Network} toContractAddress - The contract address to swap tokens to.
|
|
15292
|
+
*/
|
|
15038
15293
|
interface SwapReactProps {
|
|
15039
15294
|
providerPreference: WidgetConnectionProviders;
|
|
15040
15295
|
fromContractAddress?: string;
|
|
15041
15296
|
amount?: string;
|
|
15042
15297
|
toContractAddress?: string;
|
|
15043
15298
|
}
|
|
15299
|
+
/**
|
|
15300
|
+
* A React functional component that renders the Checkout Swap Widget.
|
|
15301
|
+
* @param {SwapReactProps} props - The props for the Swap Widget component.
|
|
15302
|
+
* @returns {JSX.Element} - The rendered Swap Widget component.
|
|
15303
|
+
*/
|
|
15044
15304
|
declare function SwapReact(props: SwapReactProps): JSX.Element;
|
|
15305
|
+
/**
|
|
15306
|
+
* Interface representing the props for the Wallet Widget component.
|
|
15307
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Wallet Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
15308
|
+
*/
|
|
15045
15309
|
interface WalletReactProps {
|
|
15046
15310
|
providerPreference?: WidgetConnectionProviders;
|
|
15311
|
+
isOnRampEnabled?: boolean;
|
|
15312
|
+
isSwapEnabled?: boolean;
|
|
15313
|
+
isBridgeEnabled?: boolean;
|
|
15047
15314
|
}
|
|
15315
|
+
/**
|
|
15316
|
+
* A React functional component that renders the Checkout Wallet Widget.
|
|
15317
|
+
* @param {WalletReactProps} props - The props for the Wallet Widget component.
|
|
15318
|
+
* @returns {JSX.Element} - The rendered Wallet Widget component.
|
|
15319
|
+
*/
|
|
15048
15320
|
declare function WalletReact(props: WalletReactProps): JSX.Element;
|
|
15321
|
+
/**
|
|
15322
|
+
* Interface representing the props for the Example Widget component.
|
|
15323
|
+
* @experimental
|
|
15324
|
+
*/
|
|
15049
15325
|
interface ExampleReactProps {
|
|
15050
15326
|
providerPreference: WidgetConnectionProviders;
|
|
15051
15327
|
fromContractAddress?: string;
|
|
15052
15328
|
amount?: string;
|
|
15053
15329
|
fromNetwork?: Network;
|
|
15054
15330
|
}
|
|
15331
|
+
/**
|
|
15332
|
+
* A React functional component that renders the Checkout Example Widget.
|
|
15333
|
+
* @experimental
|
|
15334
|
+
*/
|
|
15055
15335
|
declare function ExampleReact(props: ExampleReactProps): JSX.Element;
|
|
15336
|
+
/**
|
|
15337
|
+
* CheckoutWidgets allows to inject the Checkout Widgets into your application.
|
|
15338
|
+
* @param {CheckoutWidgetsConfig|undefined} config - Checkout Widget global configurations.
|
|
15339
|
+
*/
|
|
15340
|
+
declare function CheckoutWidgets(config?: CheckoutWidgetsConfig): void;
|
|
15341
|
+
/**
|
|
15342
|
+
* UpdateConfig allows to update the configuration of an existing Checkout Widgets instance.
|
|
15343
|
+
* @param {CheckoutWidgetsConfig} config - new Checkout Widget global configurations.
|
|
15344
|
+
*/
|
|
15345
|
+
declare function UpdateConfig(config: CheckoutWidgetsConfig): void;
|
|
15346
|
+
/**
|
|
15347
|
+
* SetProvider allows to set the provider for an existing Checkout Widgets instance.
|
|
15348
|
+
* @param {CheckoutWidgetTagNames} tagName - target Checkout Widget widget.
|
|
15349
|
+
* @param {Web3Provider} provider - the provider to connect to the blockchain network.
|
|
15350
|
+
*/
|
|
15351
|
+
declare function SetProvider(tagName: CheckoutWidgetTagNames, provider: Web3Provider | null): void;
|
|
15056
15352
|
|
|
15057
|
-
export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeReact, BridgeReactProps, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuyReact, BuyReactProps, BuySuccess, CheckoutWidgetTagNames, CheckoutWidgets, CheckoutWidgetsConfig, ConnectEvent, ConnectEventType, ConnectReact, ConnectReactProps, ConnectionFailed, ConnectionSuccess, ExampleReact, ExampleReactProps, IMTBLWidgetEvents, ImtblBridgeProps, ImtblBuyProps, ImtblConnectProps, ImtblExampleProps, ImtblInnerWidgetExampleProps, ImtblOuterWidgetExampleProps, ImtblSwapProps, ImtblTransitionExampleProps, ImtblWalletProps, Network, SetProvider, SwapEvent, SwapEventType, SwapFailed, SwapReact, SwapReactProps, SwapSuccess, UpdateConfig, WalletEvent, WalletEventType, WalletNetworkSwitchEvent, WalletReact, WalletReactProps, WidgetConnectionProviders, WidgetTheme };
|
|
15353
|
+
export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeReact, BridgeReactProps, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuyReact, BuyReactProps, BuySuccess, CheckoutWidgetTagNames, CheckoutWidgets, CheckoutWidgetsConfig, ConnectEvent, ConnectEventType, ConnectReact, ConnectReactProps, ConnectionFailed, ConnectionSuccess, ExampleReact, ExampleReactProps, IMTBLWidgetEvents, ImtblBridgeProps, ImtblBuyProps, ImtblConnectProps, ImtblExampleProps, ImtblInnerWidgetExampleProps, ImtblOuterWidgetExampleProps, ImtblSwapProps, ImtblTransitionExampleProps, ImtblWalletProps, Network, OnRampEvent, OnRampEventType, SetProvider, SwapEvent, SwapEventType, SwapFailed, SwapReact, SwapReactProps, SwapSuccess, UpdateConfig, WalletAddCoinsEvent, WalletEvent, WalletEventType, WalletNetworkSwitchEvent, WalletReact, WalletReactProps, WalletRequestBridgeEvent, WalletRequestOnrampEvent, WalletRequestSwapEvent, WidgetConnectionProviders, WidgetTheme };
|