@imtbl/sdk 0.1.3 → 0.1.5-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 +986 -0
- package/dist/checkout_sdk.js +626 -0
- package/dist/checkout_widgets.d.ts +15057 -0
- package/dist/checkout_widgets.js +251 -0
- package/dist/immutablex_client.d.ts +9 -9
- package/dist/immutablex_client.js +34 -31
- package/dist/index.cjs +2144 -174
- package/dist/index.d.ts +15302 -17
- package/dist/index.js +2134 -177
- package/dist/passport.d.ts +9935 -154
- package/dist/passport.js +661 -141
- package/dist/provider.d.ts +962 -0
- package/dist/provider.js +1139 -0
- package/package.json +15 -3
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import 'react';
|
|
3
|
+
|
|
4
|
+
function $parcel$export(e, n, v, s) {
|
|
5
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
6
|
+
}
|
|
7
|
+
var $207ed853f11d19d5$exports = {};
|
|
8
|
+
|
|
9
|
+
$parcel$export($207ed853f11d19d5$exports, "IMTBLWidgetEvents", () => $207ed853f11d19d5$export$5a0ace85cae72d45);
|
|
10
|
+
let $207ed853f11d19d5$export$5a0ace85cae72d45;
|
|
11
|
+
(function(IMTBLWidgetEvents) {
|
|
12
|
+
IMTBLWidgetEvents["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
|
|
13
|
+
IMTBLWidgetEvents["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
|
|
14
|
+
IMTBLWidgetEvents["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
|
|
15
|
+
IMTBLWidgetEvents["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
|
|
16
|
+
IMTBLWidgetEvents["IMTBL_BUY_WIDGET_EVENT"] = "imtbl-buy-widget";
|
|
17
|
+
})($207ed853f11d19d5$export$5a0ace85cae72d45 || ($207ed853f11d19d5$export$5a0ace85cae72d45 = {}));
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
var $a85ecdbd885c58ad$exports = {};
|
|
21
|
+
|
|
22
|
+
$parcel$export($a85ecdbd885c58ad$exports, "ConnectEventType", () => $a85ecdbd885c58ad$export$e72e7f9969a47dd3);
|
|
23
|
+
let $a85ecdbd885c58ad$export$e72e7f9969a47dd3;
|
|
24
|
+
(function(ConnectEventType) {
|
|
25
|
+
ConnectEventType["SUCCESS"] = "success";
|
|
26
|
+
ConnectEventType["FAILURE"] = "failure";
|
|
27
|
+
ConnectEventType["CLOSE_WIDGET"] = "close-widget";
|
|
28
|
+
})($a85ecdbd885c58ad$export$e72e7f9969a47dd3 || ($a85ecdbd885c58ad$export$e72e7f9969a47dd3 = {}));
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
var $77b6aac5c353d4a9$exports = {};
|
|
32
|
+
|
|
33
|
+
$parcel$export($77b6aac5c353d4a9$exports, "WalletEventType", () => $77b6aac5c353d4a9$export$d9be06b70b28c742);
|
|
34
|
+
//wallet widget events
|
|
35
|
+
let $77b6aac5c353d4a9$export$d9be06b70b28c742;
|
|
36
|
+
(function(WalletEventType) {
|
|
37
|
+
WalletEventType["CLOSE_WIDGET"] = "close-widget";
|
|
38
|
+
WalletEventType["NETWORK_SWITCH"] = "network-switch";
|
|
39
|
+
})($77b6aac5c353d4a9$export$d9be06b70b28c742 || ($77b6aac5c353d4a9$export$d9be06b70b28c742 = {}));
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
var $53d219e7f6bf0cd6$exports = {};
|
|
43
|
+
|
|
44
|
+
$parcel$export($53d219e7f6bf0cd6$exports, "SwapEventType", () => $53d219e7f6bf0cd6$export$140a49745ab55563);
|
|
45
|
+
let $53d219e7f6bf0cd6$export$140a49745ab55563;
|
|
46
|
+
(function(SwapEventType) {
|
|
47
|
+
SwapEventType["SUCCESS"] = "success";
|
|
48
|
+
SwapEventType["FAILURE"] = "failure";
|
|
49
|
+
})($53d219e7f6bf0cd6$export$140a49745ab55563 || ($53d219e7f6bf0cd6$export$140a49745ab55563 = {}));
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
var $15cc9e120aa6f3bf$exports = {};
|
|
53
|
+
|
|
54
|
+
$parcel$export($15cc9e120aa6f3bf$exports, "BridgeEventType", () => $15cc9e120aa6f3bf$export$d1bfa21f7c76447a);
|
|
55
|
+
let $15cc9e120aa6f3bf$export$d1bfa21f7c76447a;
|
|
56
|
+
(function(BridgeEventType) {
|
|
57
|
+
BridgeEventType["CLOSE_WIDGET"] = "close-widget";
|
|
58
|
+
BridgeEventType["SUCCESS"] = "success";
|
|
59
|
+
BridgeEventType["FAILURE"] = "failure";
|
|
60
|
+
})($15cc9e120aa6f3bf$export$d1bfa21f7c76447a || ($15cc9e120aa6f3bf$export$d1bfa21f7c76447a = {}));
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
var $98cbcca465beec95$exports = {};
|
|
64
|
+
|
|
65
|
+
$parcel$export($98cbcca465beec95$exports, "BuyEventType", () => $98cbcca465beec95$export$90db5fe1be5993c1);
|
|
66
|
+
let $98cbcca465beec95$export$90db5fe1be5993c1;
|
|
67
|
+
(function(BuyEventType) {
|
|
68
|
+
BuyEventType["SUCCESS"] = "success";
|
|
69
|
+
BuyEventType["FAILURE"] = "failure";
|
|
70
|
+
BuyEventType["NOT_CONNECTED"] = "not_connected";
|
|
71
|
+
BuyEventType["CLOSE"] = "close";
|
|
72
|
+
})($98cbcca465beec95$export$90db5fe1be5993c1 || ($98cbcca465beec95$export$90db5fe1be5993c1 = {}));
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
var $14d7a2bbb79e0dae$exports = {};
|
|
76
|
+
|
|
77
|
+
$parcel$export($14d7a2bbb79e0dae$exports, "Network", () => $14d7a2bbb79e0dae$export$95be4ae94445245a);
|
|
78
|
+
$parcel$export($14d7a2bbb79e0dae$exports, "WidgetTheme", () => $14d7a2bbb79e0dae$export$c88931fdc51854eb);
|
|
79
|
+
$parcel$export($14d7a2bbb79e0dae$exports, "WidgetConnectionProviders", () => $14d7a2bbb79e0dae$export$2f61dde3bdc320cb);
|
|
80
|
+
$parcel$export($14d7a2bbb79e0dae$exports, "CheckoutWidgetTagNames", () => $14d7a2bbb79e0dae$export$75be0f6af9650f2c);
|
|
81
|
+
let $14d7a2bbb79e0dae$export$95be4ae94445245a;
|
|
82
|
+
(function(Network) {
|
|
83
|
+
Network["ETHEREUM"] = "Ethereum";
|
|
84
|
+
Network["GOERLI"] = "Goerli";
|
|
85
|
+
Network["POLYGON"] = "Polygon";
|
|
86
|
+
})($14d7a2bbb79e0dae$export$95be4ae94445245a || ($14d7a2bbb79e0dae$export$95be4ae94445245a = {}));
|
|
87
|
+
let $14d7a2bbb79e0dae$export$c88931fdc51854eb;
|
|
88
|
+
(function(WidgetTheme) {
|
|
89
|
+
WidgetTheme["LIGHT"] = "light";
|
|
90
|
+
WidgetTheme["DARK"] = "dark";
|
|
91
|
+
WidgetTheme["CUSTOM"] = "custom";
|
|
92
|
+
})($14d7a2bbb79e0dae$export$c88931fdc51854eb || ($14d7a2bbb79e0dae$export$c88931fdc51854eb = {}));
|
|
93
|
+
let $14d7a2bbb79e0dae$export$2f61dde3bdc320cb;
|
|
94
|
+
(function(WidgetConnectionProviders) {
|
|
95
|
+
WidgetConnectionProviders["METAMASK"] = "metamask";
|
|
96
|
+
})($14d7a2bbb79e0dae$export$2f61dde3bdc320cb || ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb = {}));
|
|
97
|
+
let $14d7a2bbb79e0dae$export$75be0f6af9650f2c;
|
|
98
|
+
(function(CheckoutWidgetTagNames) {
|
|
99
|
+
CheckoutWidgetTagNames["CONNECT"] = "imtbl-connect";
|
|
100
|
+
CheckoutWidgetTagNames["WALLET"] = "imtbl-wallet";
|
|
101
|
+
CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
|
|
102
|
+
CheckoutWidgetTagNames["BUY"] = "imtbl-buy";
|
|
103
|
+
CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
|
|
104
|
+
CheckoutWidgetTagNames["EXAMPLe"] = "imtbl-example";
|
|
105
|
+
})($14d7a2bbb79e0dae$export$75be0f6af9650f2c || ($14d7a2bbb79e0dae$export$75be0f6af9650f2c = {}));
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
var $1f969328e5988c99$exports = {};
|
|
109
|
+
|
|
110
|
+
$parcel$export($1f969328e5988c99$exports, "BridgeReact", () => $1f969328e5988c99$export$30f61ebf204c69f6);
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
function $1f969328e5988c99$export$30f61ebf204c69f6(props) {
|
|
115
|
+
const { providerPreference: providerPreference , fromContractAddress: fromContractAddress , amount: amount , fromNetwork: fromNetwork } = props;
|
|
116
|
+
const config = window.ImtblCheckoutWidgetConfig;
|
|
117
|
+
return /*#__PURE__*/ (jsx)("imtbl-bridge", {
|
|
118
|
+
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
119
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK,
|
|
120
|
+
fromContractAddress: fromContractAddress ?? "",
|
|
121
|
+
fromNetwork: fromNetwork ?? "",
|
|
122
|
+
amount: amount ?? ""
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
var $f22931ca9e2f35b6$exports = {};
|
|
128
|
+
|
|
129
|
+
$parcel$export($f22931ca9e2f35b6$exports, "BuyReact", () => $f22931ca9e2f35b6$export$d13582032b79b401);
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
function $f22931ca9e2f35b6$export$d13582032b79b401(props) {
|
|
134
|
+
const { providerPreference: providerPreference , orderId: orderId } = props;
|
|
135
|
+
const config = window.ImtblCheckoutWidgetConfig;
|
|
136
|
+
return /*#__PURE__*/ (jsx)("imtbl-buy", {
|
|
137
|
+
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
138
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK,
|
|
139
|
+
orderId: orderId
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
var $fa90757d8d7a0962$exports = {};
|
|
145
|
+
|
|
146
|
+
$parcel$export($fa90757d8d7a0962$exports, "CheckoutWidgets", () => $fa90757d8d7a0962$export$af210a0808087845);
|
|
147
|
+
$parcel$export($fa90757d8d7a0962$exports, "UpdateConfig", () => $fa90757d8d7a0962$export$bf1548ba7e61c17f);
|
|
148
|
+
$parcel$export($fa90757d8d7a0962$exports, "SetProvider", () => $fa90757d8d7a0962$export$931068bc678f0d73);
|
|
149
|
+
function $fa90757d8d7a0962$export$af210a0808087845(config) {
|
|
150
|
+
var checkoutWidgetJS = document.createElement("script");
|
|
151
|
+
checkoutWidgetJS.setAttribute("src", "http://localhost:3000/lib/js/imtbl-checkout.js");
|
|
152
|
+
document.head.appendChild(checkoutWidgetJS);
|
|
153
|
+
window.ImtblCheckoutWidgetConfig = config;
|
|
154
|
+
}
|
|
155
|
+
function $fa90757d8d7a0962$export$bf1548ba7e61c17f(config) {
|
|
156
|
+
window.ImtblCheckoutWidgetConfig = config;
|
|
157
|
+
}
|
|
158
|
+
function $fa90757d8d7a0962$export$931068bc678f0d73(tagName, provider) {
|
|
159
|
+
if (!provider) {
|
|
160
|
+
console.error("no provider parsed");
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const elements = document.getElementsByTagName(tagName);
|
|
164
|
+
const widget = elements[0];
|
|
165
|
+
let attempts = 0;
|
|
166
|
+
const maxAttempts = 10;
|
|
167
|
+
let timer;
|
|
168
|
+
const attemptToSetProvider = ()=>{
|
|
169
|
+
try {
|
|
170
|
+
widget.setProvider(provider);
|
|
171
|
+
window.clearInterval(timer);
|
|
172
|
+
} catch (err) {
|
|
173
|
+
attempts++;
|
|
174
|
+
if (attempts >= maxAttempts) {
|
|
175
|
+
window.clearInterval(timer);
|
|
176
|
+
console.error("failed to set the provider");
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
timer = window.setInterval(attemptToSetProvider, 10);
|
|
181
|
+
attemptToSetProvider();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
var $f2083cd30e2f5c56$exports = {};
|
|
186
|
+
|
|
187
|
+
$parcel$export($f2083cd30e2f5c56$exports, "ConnectReact", () => $f2083cd30e2f5c56$export$49d62957f420a1e2);
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
function $f2083cd30e2f5c56$export$49d62957f420a1e2(props) {
|
|
192
|
+
const { providerPreference: providerPreference } = props;
|
|
193
|
+
const config = window.ImtblCheckoutWidgetConfig;
|
|
194
|
+
return /*#__PURE__*/ (jsx)("imtbl-connect", {
|
|
195
|
+
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
196
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
var $a4fbb8e3a6aeff58$exports = {};
|
|
202
|
+
|
|
203
|
+
$parcel$export($a4fbb8e3a6aeff58$exports, "SwapReact", () => $a4fbb8e3a6aeff58$export$971e031379577f4);
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
function $a4fbb8e3a6aeff58$export$971e031379577f4(props) {
|
|
208
|
+
const { providerPreference: providerPreference , fromContractAddress: fromContractAddress , amount: amount , toContractAddress: toContractAddress } = props;
|
|
209
|
+
const config = window.ImtblCheckoutWidgetConfig;
|
|
210
|
+
return /*#__PURE__*/ (jsx)("imtbl-swap", {
|
|
211
|
+
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
212
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK,
|
|
213
|
+
fromContractAddress: fromContractAddress ?? "",
|
|
214
|
+
toContractAddress: toContractAddress ?? "",
|
|
215
|
+
amount: amount ?? ""
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
var $89d55ace0f8f1c07$exports = {};
|
|
221
|
+
|
|
222
|
+
$parcel$export($89d55ace0f8f1c07$exports, "WalletReact", () => $89d55ace0f8f1c07$export$ceaac94f34dba154);
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
function $89d55ace0f8f1c07$export$ceaac94f34dba154(props) {
|
|
227
|
+
const { providerPreference: providerPreference } = props;
|
|
228
|
+
const config = window.ImtblCheckoutWidgetConfig;
|
|
229
|
+
return /*#__PURE__*/ (jsx)("imtbl-wallet", {
|
|
230
|
+
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
231
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
var $d087956fd1002f80$exports = {};
|
|
237
|
+
|
|
238
|
+
$parcel$export($d087956fd1002f80$exports, "ExampleReact", () => $d087956fd1002f80$export$fa517eee6594d26c);
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
function $d087956fd1002f80$export$fa517eee6594d26c(props) {
|
|
243
|
+
const { providerPreference: providerPreference , fromContractAddress: fromContractAddress , amount: amount , fromNetwork: fromNetwork } = props;
|
|
244
|
+
const config = window.ImtblCheckoutWidgetConfig;
|
|
245
|
+
return /*#__PURE__*/ (jsx)("imtbl-example", {
|
|
246
|
+
providerPreference: providerPreference ?? ($14d7a2bbb79e0dae$export$2f61dde3bdc320cb).METAMASK,
|
|
247
|
+
theme: config.theme ?? ($14d7a2bbb79e0dae$export$c88931fdc51854eb).DARK
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export { $15cc9e120aa6f3bf$export$d1bfa21f7c76447a as BridgeEventType, $1f969328e5988c99$export$30f61ebf204c69f6 as BridgeReact, $98cbcca465beec95$export$90db5fe1be5993c1 as BuyEventType, $f22931ca9e2f35b6$export$d13582032b79b401 as BuyReact, $14d7a2bbb79e0dae$export$75be0f6af9650f2c as CheckoutWidgetTagNames, $fa90757d8d7a0962$export$af210a0808087845 as CheckoutWidgets, $a85ecdbd885c58ad$export$e72e7f9969a47dd3 as ConnectEventType, $f2083cd30e2f5c56$export$49d62957f420a1e2 as ConnectReact, $d087956fd1002f80$export$fa517eee6594d26c as ExampleReact, $207ed853f11d19d5$export$5a0ace85cae72d45 as IMTBLWidgetEvents, $14d7a2bbb79e0dae$export$95be4ae94445245a as Network, $fa90757d8d7a0962$export$931068bc678f0d73 as SetProvider, $53d219e7f6bf0cd6$export$140a49745ab55563 as SwapEventType, $a4fbb8e3a6aeff58$export$971e031379577f4 as SwapReact, $fa90757d8d7a0962$export$bf1548ba7e61c17f as UpdateConfig, $77b6aac5c353d4a9$export$d9be06b70b28c742 as WalletEventType, $89d55ace0f8f1c07$export$ceaac94f34dba154 as WalletReact, $14d7a2bbb79e0dae$export$2f61dde3bdc320cb as WidgetConnectionProviders, $14d7a2bbb79e0dae$export$c88931fdc51854eb as WidgetTheme };
|
|
@@ -9985,7 +9985,7 @@ declare class ImmutableXClient {
|
|
|
9985
9985
|
getDeposit(request: DepositsApiGetDepositRequest): Promise<Deposit>;
|
|
9986
9986
|
/**
|
|
9987
9987
|
* Get a list of Deposits
|
|
9988
|
-
* @param request - optional
|
|
9988
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
9989
9989
|
* @returns a promise that resolves with the requested list of Deposits
|
|
9990
9990
|
* @throws {@link index.IMXError}
|
|
9991
9991
|
*/
|
|
@@ -10006,7 +10006,7 @@ declare class ImmutableXClient {
|
|
|
10006
10006
|
getAsset(request: AssetsApiGetAssetRequest): Promise<Asset>;
|
|
10007
10007
|
/**
|
|
10008
10008
|
* Get a list of Assets
|
|
10009
|
-
* @param request - optional
|
|
10009
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10010
10010
|
* @returns a promise that resolves with the requested list of Assets
|
|
10011
10011
|
* @throws {@link index.IMXError}
|
|
10012
10012
|
*/
|
|
@@ -10035,7 +10035,7 @@ declare class ImmutableXClient {
|
|
|
10035
10035
|
listCollectionFilters(request: CollectionsApiListCollectionFiltersRequest): Promise<CollectionFilter>;
|
|
10036
10036
|
/**
|
|
10037
10037
|
* Get a list of Collections
|
|
10038
|
-
* @param request - optional
|
|
10038
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10039
10039
|
* @returns a promise that resolves with the requested list of Collections
|
|
10040
10040
|
* @throws {@link index.IMXError}
|
|
10041
10041
|
*/
|
|
@@ -10161,7 +10161,7 @@ declare class ImmutableXClient {
|
|
|
10161
10161
|
getMint(request: MintsApiGetMintRequest): Promise<Mint[]>;
|
|
10162
10162
|
/**
|
|
10163
10163
|
* Get a list of Mints
|
|
10164
|
-
* @param request optional
|
|
10164
|
+
* @param request optional object containing the parameters to be provided in the API request
|
|
10165
10165
|
* @returns a promise that resolves with the requested list of Mints
|
|
10166
10166
|
* @throws {@link index.IMXError}
|
|
10167
10167
|
*/
|
|
@@ -10176,7 +10176,7 @@ declare class ImmutableXClient {
|
|
|
10176
10176
|
mint(ethSigner: Signer, request: UnsignedMintRequest): Promise<MintTokensResponse>;
|
|
10177
10177
|
/**
|
|
10178
10178
|
* Get a list of Withdrawals
|
|
10179
|
-
* @param request - optional
|
|
10179
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10180
10180
|
* @returns a promise that resolves with the requested list of Withdrawals
|
|
10181
10181
|
* @throws {@link index.IMXError}
|
|
10182
10182
|
*/
|
|
@@ -10197,7 +10197,7 @@ declare class ImmutableXClient {
|
|
|
10197
10197
|
getOrder(request: OrdersApiGetOrderRequest): Promise<Order>;
|
|
10198
10198
|
/**
|
|
10199
10199
|
* Get a list of Orders
|
|
10200
|
-
* @param request - optional
|
|
10200
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10201
10201
|
* @returns a promise that resolves with the requested list of Orders
|
|
10202
10202
|
* @throws {@link index.IMXError}
|
|
10203
10203
|
*/
|
|
@@ -10211,7 +10211,7 @@ declare class ImmutableXClient {
|
|
|
10211
10211
|
getTrade(request: TradesApiGetTradeRequest): Promise<Trade>;
|
|
10212
10212
|
/**
|
|
10213
10213
|
* Get a list of Trades
|
|
10214
|
-
* @param request - optional
|
|
10214
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10215
10215
|
* @returns a promise that resolves with the requested list of Trades
|
|
10216
10216
|
* @throws {@link index.IMXError}
|
|
10217
10217
|
*/
|
|
@@ -10225,7 +10225,7 @@ declare class ImmutableXClient {
|
|
|
10225
10225
|
getToken(request: TokensApiGetTokenRequest): Promise<TokenDetails>;
|
|
10226
10226
|
/**
|
|
10227
10227
|
* Get a list of Tokens
|
|
10228
|
-
* @param request - optional
|
|
10228
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10229
10229
|
* @returns a promise that resolves with the requested list of Tokens
|
|
10230
10230
|
* @throws {@link index.IMXError}
|
|
10231
10231
|
*/
|
|
@@ -10239,7 +10239,7 @@ declare class ImmutableXClient {
|
|
|
10239
10239
|
getTransfer(request: TransfersApiGetTransferRequest): Promise<Transfer>;
|
|
10240
10240
|
/**
|
|
10241
10241
|
* Get a list of Transfers
|
|
10242
|
-
* @param request - optional
|
|
10242
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
10243
10243
|
* @returns a promise that resolves with the requested list of Transfers
|
|
10244
10244
|
* @throws {@link index.IMXError}
|
|
10245
10245
|
*/
|
|
@@ -7,26 +7,26 @@ var Environment;
|
|
|
7
7
|
Environment["SANDBOX"] = "sandbox";
|
|
8
8
|
})(Environment || (Environment = {}));
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
10
|
+
/**
|
|
11
|
+
* Set `sdkVersion` on config
|
|
12
|
+
*/
|
|
13
|
+
const production = () => Config.createConfig({
|
|
14
|
+
basePath: 'https://api.x.immutable.com',
|
|
15
|
+
chainID: 1,
|
|
16
|
+
coreContractAddress: '0x5FDCCA53617f4d2b9134B29090C87D01058e27e9',
|
|
17
|
+
registrationContractAddress: '0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c',
|
|
18
|
+
sdkVersion: 'ts-immutable-sdk-0.1.5-alpha',
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Set `sdkVersion` on config
|
|
22
|
+
*/
|
|
23
|
+
const sandbox = () => Config.createConfig({
|
|
24
|
+
basePath: 'https://api.sandbox.x.immutable.com',
|
|
25
|
+
chainID: 5,
|
|
26
|
+
coreContractAddress: '0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623',
|
|
27
|
+
registrationContractAddress: '0x1C97Ada273C9A52253f463042f29117090Cd7D83',
|
|
28
|
+
sdkVersion: 'ts-immutable-sdk-0.1.5-alpha',
|
|
29
|
+
});
|
|
30
30
|
class ImxConfiguration {
|
|
31
31
|
immutableXConfig;
|
|
32
32
|
baseConfig;
|
|
@@ -38,13 +38,16 @@ class ImxConfiguration {
|
|
|
38
38
|
else {
|
|
39
39
|
switch (baseConfig.environment) {
|
|
40
40
|
case Environment.SANDBOX: {
|
|
41
|
-
this.immutableXConfig =
|
|
41
|
+
this.immutableXConfig = sandbox();
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
case Environment.PRODUCTION: {
|
|
45
|
-
this.immutableXConfig =
|
|
45
|
+
this.immutableXConfig = production();
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
|
+
default: {
|
|
49
|
+
this.immutableXConfig = sandbox();
|
|
50
|
+
}
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
}
|
|
@@ -99,7 +102,7 @@ class ImmutableXClient {
|
|
|
99
102
|
}
|
|
100
103
|
/**
|
|
101
104
|
* Get a list of Deposits
|
|
102
|
-
* @param request - optional
|
|
105
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
103
106
|
* @returns a promise that resolves with the requested list of Deposits
|
|
104
107
|
* @throws {@link index.IMXError}
|
|
105
108
|
*/
|
|
@@ -126,7 +129,7 @@ class ImmutableXClient {
|
|
|
126
129
|
}
|
|
127
130
|
/**
|
|
128
131
|
* Get a list of Assets
|
|
129
|
-
* @param request - optional
|
|
132
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
130
133
|
* @returns a promise that resolves with the requested list of Assets
|
|
131
134
|
* @throws {@link index.IMXError}
|
|
132
135
|
*/
|
|
@@ -163,7 +166,7 @@ class ImmutableXClient {
|
|
|
163
166
|
}
|
|
164
167
|
/**
|
|
165
168
|
* Get a list of Collections
|
|
166
|
-
* @param request - optional
|
|
169
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
167
170
|
* @returns a promise that resolves with the requested list of Collections
|
|
168
171
|
* @throws {@link index.IMXError}
|
|
169
172
|
*/
|
|
@@ -319,7 +322,7 @@ class ImmutableXClient {
|
|
|
319
322
|
}
|
|
320
323
|
/**
|
|
321
324
|
* Get a list of Mints
|
|
322
|
-
* @param request optional
|
|
325
|
+
* @param request optional object containing the parameters to be provided in the API request
|
|
323
326
|
* @returns a promise that resolves with the requested list of Mints
|
|
324
327
|
* @throws {@link index.IMXError}
|
|
325
328
|
*/
|
|
@@ -338,7 +341,7 @@ class ImmutableXClient {
|
|
|
338
341
|
}
|
|
339
342
|
/**
|
|
340
343
|
* Get a list of Withdrawals
|
|
341
|
-
* @param request - optional
|
|
344
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
342
345
|
* @returns a promise that resolves with the requested list of Withdrawals
|
|
343
346
|
* @throws {@link index.IMXError}
|
|
344
347
|
*/
|
|
@@ -365,7 +368,7 @@ class ImmutableXClient {
|
|
|
365
368
|
}
|
|
366
369
|
/**
|
|
367
370
|
* Get a list of Orders
|
|
368
|
-
* @param request - optional
|
|
371
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
369
372
|
* @returns a promise that resolves with the requested list of Orders
|
|
370
373
|
* @throws {@link index.IMXError}
|
|
371
374
|
*/
|
|
@@ -383,7 +386,7 @@ class ImmutableXClient {
|
|
|
383
386
|
}
|
|
384
387
|
/**
|
|
385
388
|
* Get a list of Trades
|
|
386
|
-
* @param request - optional
|
|
389
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
387
390
|
* @returns a promise that resolves with the requested list of Trades
|
|
388
391
|
* @throws {@link index.IMXError}
|
|
389
392
|
*/
|
|
@@ -401,7 +404,7 @@ class ImmutableXClient {
|
|
|
401
404
|
}
|
|
402
405
|
/**
|
|
403
406
|
* Get a list of Tokens
|
|
404
|
-
* @param request - optional
|
|
407
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
405
408
|
* @returns a promise that resolves with the requested list of Tokens
|
|
406
409
|
* @throws {@link index.IMXError}
|
|
407
410
|
*/
|
|
@@ -419,7 +422,7 @@ class ImmutableXClient {
|
|
|
419
422
|
}
|
|
420
423
|
/**
|
|
421
424
|
* Get a list of Transfers
|
|
422
|
-
* @param request - optional
|
|
425
|
+
* @param request - optional object containing the parameters to be provided in the API request
|
|
423
426
|
* @returns a promise that resolves with the requested list of Transfers
|
|
424
427
|
* @throws {@link index.IMXError}
|
|
425
428
|
*/
|