@imtbl/sdk 0.6.0-alpha → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +8 -61
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +2808 -24564
- package/dist/index.d.ts +6381 -24798
- package/dist/index.js +2998 -24748
- package/dist/passport.js +2 -2
- package/package.json +1 -25
- package/dist/blockchain_data.d.ts +0 -1971
- package/dist/blockchain_data.js +0 -2528
- package/dist/browser/checkout.js +0 -2
- package/dist/checkout_sdk.d.ts +0 -1188
- package/dist/checkout_sdk.js +0 -16556
- package/dist/checkout_widgets.d.ts +0 -15382
- package/dist/checkout_widgets.js +0 -276
- package/dist/erc20.d.ts +0 -296
- package/dist/erc20.js +0 -371
- package/dist/erc721_permissioned_mintable.d.ts +0 -486
- package/dist/erc721_permissioned_mintable.js +0 -1364
- package/dist/orderbook.d.ts +0 -252
- package/dist/orderbook.js +0 -1983
package/dist/checkout_widgets.js
DELETED
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useEffect } from '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
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.6.0-alpha";
|
|
8
|
-
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
9
|
-
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function $430e3eda76fa4d5f$export$46b1ae20f762ad4c(version) {
|
|
13
|
-
const defaultPackageVersion = ($d663162fd5a0853f$export$1169f5475725171b)();
|
|
14
|
-
if (version === undefined) return defaultPackageVersion;
|
|
15
|
-
// Pre-production release
|
|
16
|
-
// TODO: https://immutable.atlassian.net/browse/WT-1501
|
|
17
|
-
if (version.major === undefined || version.minor === undefined || version.patch === undefined || version.prerelease === undefined) return defaultPackageVersion;
|
|
18
|
-
if (version.major < 0) return defaultPackageVersion;
|
|
19
|
-
if (version.minor < 0) return defaultPackageVersion;
|
|
20
|
-
if (version.patch < 0) return defaultPackageVersion;
|
|
21
|
-
if (version.prerelease !== "alpha") return defaultPackageVersion;
|
|
22
|
-
if (version.major === 0 && version.minor === 0 && version.patch === 0) return defaultPackageVersion;
|
|
23
|
-
let validatedVersion = defaultPackageVersion;
|
|
24
|
-
if (!Number.isNaN(version.major) && version.major >= 0) validatedVersion = version.major.toString();
|
|
25
|
-
if (!Number.isNaN(version.minor)) validatedVersion += `.${version.minor.toString()}`;
|
|
26
|
-
if (!Number.isNaN(version.patch)) validatedVersion += `.${version.patch.toString()}`;
|
|
27
|
-
// TODO: https://immutable.atlassian.net/browse/WT-1501
|
|
28
|
-
// Ensure this is gated by `version.prerelease !== undefined`
|
|
29
|
-
// once we go to prod with checkout.
|
|
30
|
-
validatedVersion += `-${version.prerelease}`;
|
|
31
|
-
if (version.build !== undefined && version.build > 0) validatedVersion += `.${version.build}`;
|
|
32
|
-
return validatedVersion;
|
|
33
|
-
}
|
|
34
|
-
function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
35
|
-
if (window === undefined) {
|
|
36
|
-
// eslint-disable-next-line no-console
|
|
37
|
-
console.error("missing window object: please run Checkout client side");
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if (document === undefined) {
|
|
41
|
-
// eslint-disable-next-line no-console
|
|
42
|
-
console.error("missing document object: please run Checkout client side");
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const checkoutWidgetJS = document.createElement("script");
|
|
46
|
-
const validVersion = $430e3eda76fa4d5f$export$46b1ae20f762ad4c(config?.version);
|
|
47
|
-
let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout.js`;
|
|
48
|
-
if (($d663162fd5a0853f$export$83bf90b30cdfd29f)()) cdnUrl = "http://localhost:3000/lib/js/imtbl-checkout.js";
|
|
49
|
-
checkoutWidgetJS.setAttribute("src", cdnUrl);
|
|
50
|
-
document.head.appendChild(checkoutWidgetJS);
|
|
51
|
-
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
52
|
-
}
|
|
53
|
-
function $430e3eda76fa4d5f$export$bf1548ba7e61c17f(config) {
|
|
54
|
-
if (window === undefined) {
|
|
55
|
-
// eslint-disable-next-line no-console
|
|
56
|
-
console.error("missing document object: please run Checkout client side");
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var $207ed853f11d19d5$exports = {};
|
|
64
|
-
|
|
65
|
-
$parcel$export($207ed853f11d19d5$exports, "IMTBLWidgetEvents", () => $207ed853f11d19d5$export$5a0ace85cae72d45);
|
|
66
|
-
var $207ed853f11d19d5$export$5a0ace85cae72d45;
|
|
67
|
-
(function(IMTBLWidgetEvents) {
|
|
68
|
-
IMTBLWidgetEvents["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
|
|
69
|
-
IMTBLWidgetEvents["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
|
|
70
|
-
IMTBLWidgetEvents["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
|
|
71
|
-
IMTBLWidgetEvents["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
|
|
72
|
-
})($207ed853f11d19d5$export$5a0ace85cae72d45 || ($207ed853f11d19d5$export$5a0ace85cae72d45 = {}));
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
var $a85ecdbd885c58ad$exports = {};
|
|
76
|
-
|
|
77
|
-
$parcel$export($a85ecdbd885c58ad$exports, "ConnectEventType", () => $a85ecdbd885c58ad$export$e72e7f9969a47dd3);
|
|
78
|
-
var $a85ecdbd885c58ad$export$e72e7f9969a47dd3;
|
|
79
|
-
(function(ConnectEventType) {
|
|
80
|
-
ConnectEventType["CLOSE_WIDGET"] = "close-widget";
|
|
81
|
-
ConnectEventType["SUCCESS"] = "success";
|
|
82
|
-
ConnectEventType["FAILURE"] = "failure";
|
|
83
|
-
})($a85ecdbd885c58ad$export$e72e7f9969a47dd3 || ($a85ecdbd885c58ad$export$e72e7f9969a47dd3 = {}));
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
var $77b6aac5c353d4a9$exports = {};
|
|
87
|
-
|
|
88
|
-
$parcel$export($77b6aac5c353d4a9$exports, "WalletEventType", () => $77b6aac5c353d4a9$export$d9be06b70b28c742);
|
|
89
|
-
var $77b6aac5c353d4a9$export$d9be06b70b28c742;
|
|
90
|
-
(function(WalletEventType) {
|
|
91
|
-
WalletEventType["CLOSE_WIDGET"] = "close-widget";
|
|
92
|
-
WalletEventType["NETWORK_SWITCH"] = "network-switch";
|
|
93
|
-
WalletEventType["DISCONNECT_WALLET"] = "disconnect-wallet";
|
|
94
|
-
})($77b6aac5c353d4a9$export$d9be06b70b28c742 || ($77b6aac5c353d4a9$export$d9be06b70b28c742 = {}));
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
var $53d219e7f6bf0cd6$exports = {};
|
|
98
|
-
|
|
99
|
-
$parcel$export($53d219e7f6bf0cd6$exports, "SwapEventType", () => $53d219e7f6bf0cd6$export$140a49745ab55563);
|
|
100
|
-
/**
|
|
101
|
-
* Enum representing possible Swap Widget event types.
|
|
102
|
-
*/ var $53d219e7f6bf0cd6$export$140a49745ab55563;
|
|
103
|
-
(function(SwapEventType) {
|
|
104
|
-
SwapEventType["CLOSE_WIDGET"] = "close-widget";
|
|
105
|
-
SwapEventType["SUCCESS"] = "success";
|
|
106
|
-
SwapEventType["FAILURE"] = "failure";
|
|
107
|
-
SwapEventType["REJECTED"] = "rejected";
|
|
108
|
-
})($53d219e7f6bf0cd6$export$140a49745ab55563 || ($53d219e7f6bf0cd6$export$140a49745ab55563 = {}));
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
var $15cc9e120aa6f3bf$exports = {};
|
|
112
|
-
|
|
113
|
-
$parcel$export($15cc9e120aa6f3bf$exports, "BridgeEventType", () => $15cc9e120aa6f3bf$export$d1bfa21f7c76447a);
|
|
114
|
-
/**
|
|
115
|
-
* Enum of possible Bridge Widget event types.
|
|
116
|
-
*/ var $15cc9e120aa6f3bf$export$d1bfa21f7c76447a;
|
|
117
|
-
(function(BridgeEventType) {
|
|
118
|
-
BridgeEventType["CLOSE_WIDGET"] = "close-widget";
|
|
119
|
-
BridgeEventType["SUCCESS"] = "success";
|
|
120
|
-
BridgeEventType["FAILURE"] = "failure";
|
|
121
|
-
})($15cc9e120aa6f3bf$export$d1bfa21f7c76447a || ($15cc9e120aa6f3bf$export$d1bfa21f7c76447a = {}));
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
var $ad06b030b1a3ba34$exports = {};
|
|
125
|
-
|
|
126
|
-
$parcel$export($ad06b030b1a3ba34$exports, "OrchestrationEventType", () => $ad06b030b1a3ba34$export$b80d2daf830437b9);
|
|
127
|
-
/**
|
|
128
|
-
* Enum representing different types of orchestration events.
|
|
129
|
-
*/ var $ad06b030b1a3ba34$export$b80d2daf830437b9;
|
|
130
|
-
(function(OrchestrationEventType) {
|
|
131
|
-
OrchestrationEventType["REQUEST_CONNECT"] = "request-connect";
|
|
132
|
-
OrchestrationEventType["REQUEST_WALLET"] = "request-wallet";
|
|
133
|
-
OrchestrationEventType["REQUEST_SWAP"] = "request-swap";
|
|
134
|
-
OrchestrationEventType["REQUEST_BRIDGE"] = "request-bridge";
|
|
135
|
-
OrchestrationEventType["REQUEST_ONRAMP"] = "request-onramp";
|
|
136
|
-
})($ad06b030b1a3ba34$export$b80d2daf830437b9 || ($ad06b030b1a3ba34$export$b80d2daf830437b9 = {}));
|
|
137
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
138
|
-
|
|
139
|
-
var $045213b18e9f1f94$exports = {};
|
|
140
|
-
|
|
141
|
-
$parcel$export($045213b18e9f1f94$exports, "WidgetTheme", () => $045213b18e9f1f94$export$c88931fdc51854eb);
|
|
142
|
-
$parcel$export($045213b18e9f1f94$exports, "CheckoutWidgetTagNames", () => $045213b18e9f1f94$export$75be0f6af9650f2c);
|
|
143
|
-
/**
|
|
144
|
-
* Enum representing the themes for the Checkout widgets.
|
|
145
|
-
*/ var $045213b18e9f1f94$export$c88931fdc51854eb;
|
|
146
|
-
(function(WidgetTheme) {
|
|
147
|
-
WidgetTheme["LIGHT"] = "light";
|
|
148
|
-
WidgetTheme["DARK"] = "dark";
|
|
149
|
-
WidgetTheme["CUSTOM"] = "custom";
|
|
150
|
-
})($045213b18e9f1f94$export$c88931fdc51854eb || ($045213b18e9f1f94$export$c88931fdc51854eb = {}));
|
|
151
|
-
var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
152
|
-
(function(CheckoutWidgetTagNames) {
|
|
153
|
-
CheckoutWidgetTagNames["CONNECT"] = "imtbl-connect";
|
|
154
|
-
CheckoutWidgetTagNames["WALLET"] = "imtbl-wallet";
|
|
155
|
-
CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
|
|
156
|
-
CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
|
|
157
|
-
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
var $1f969328e5988c99$exports = {};
|
|
161
|
-
|
|
162
|
-
$parcel$export($1f969328e5988c99$exports, "BridgeReact", () => $1f969328e5988c99$export$30f61ebf204c69f6);
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
function $77ec335383336bdd$export$931068bc678f0d73(tagName, provider) {
|
|
166
|
-
if (!provider) {
|
|
167
|
-
// eslint-disable-next-line no-console
|
|
168
|
-
console.error("no provider parsed");
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
if (window === undefined) {
|
|
172
|
-
// eslint-disable-next-line no-console
|
|
173
|
-
console.error("missing window object: please run Checkout client side");
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
let attempts = 0;
|
|
177
|
-
const maxAttempts = 10;
|
|
178
|
-
let timer;
|
|
179
|
-
const attemptToSetProvider = ()=>{
|
|
180
|
-
try {
|
|
181
|
-
const elements = document.getElementsByTagName(tagName);
|
|
182
|
-
const widget = elements[0];
|
|
183
|
-
widget.setProvider(provider);
|
|
184
|
-
window.clearInterval(timer);
|
|
185
|
-
} catch (err) {
|
|
186
|
-
attempts++;
|
|
187
|
-
if (attempts >= maxAttempts) {
|
|
188
|
-
window.clearInterval(timer);
|
|
189
|
-
// eslint-disable-next-line no-console
|
|
190
|
-
console.error("failed to set the provider");
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
timer = window.setInterval(attemptToSetProvider, 10);
|
|
195
|
-
attemptToSetProvider();
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
function $1f969328e5988c99$export$30f61ebf204c69f6(props) {
|
|
201
|
-
const { walletProvider: walletProvider, fromContractAddress: fromContractAddress, amount: amount, provider: provider } = props;
|
|
202
|
-
(useEffect)(()=>{
|
|
203
|
-
if (provider) ($77ec335383336bdd$export$931068bc678f0d73)(($045213b18e9f1f94$export$75be0f6af9650f2c).BRIDGE, provider);
|
|
204
|
-
}, [
|
|
205
|
-
provider
|
|
206
|
-
]);
|
|
207
|
-
const config = window.ImtblCheckoutWidgetConfig;
|
|
208
|
-
return /*#__PURE__*/ (jsx)("imtbl-bridge", {
|
|
209
|
-
widgetConfig: config,
|
|
210
|
-
walletProvider: walletProvider,
|
|
211
|
-
fromContractAddress: fromContractAddress ?? "",
|
|
212
|
-
amount: amount ?? ""
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
var $f2083cd30e2f5c56$exports = {};
|
|
218
|
-
|
|
219
|
-
$parcel$export($f2083cd30e2f5c56$exports, "ConnectReact", () => $f2083cd30e2f5c56$export$49d62957f420a1e2);
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
function $f2083cd30e2f5c56$export$49d62957f420a1e2() {
|
|
223
|
-
const config = window.ImtblCheckoutWidgetConfig;
|
|
224
|
-
return /*#__PURE__*/ (jsx)("imtbl-connect", {
|
|
225
|
-
widgetConfig: config
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
var $a4fbb8e3a6aeff58$exports = {};
|
|
231
|
-
|
|
232
|
-
$parcel$export($a4fbb8e3a6aeff58$exports, "SwapReact", () => $a4fbb8e3a6aeff58$export$971e031379577f4);
|
|
233
|
-
/* eslint-disable max-len */
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
function $a4fbb8e3a6aeff58$export$971e031379577f4(props) {
|
|
238
|
-
const { walletProvider: walletProvider, fromContractAddress: fromContractAddress, amount: amount, toContractAddress: toContractAddress, provider: provider } = props;
|
|
239
|
-
(useEffect)(()=>{
|
|
240
|
-
if (provider) ($77ec335383336bdd$export$931068bc678f0d73)(($045213b18e9f1f94$export$75be0f6af9650f2c).SWAP, provider);
|
|
241
|
-
}, [
|
|
242
|
-
provider
|
|
243
|
-
]);
|
|
244
|
-
const config = window.ImtblCheckoutWidgetConfig;
|
|
245
|
-
return /*#__PURE__*/ (jsx)("imtbl-swap", {
|
|
246
|
-
widgetConfig: config,
|
|
247
|
-
walletProvider: walletProvider,
|
|
248
|
-
fromContractAddress: fromContractAddress ?? "",
|
|
249
|
-
toContractAddress: toContractAddress ?? "",
|
|
250
|
-
amount: amount ?? ""
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
var $89d55ace0f8f1c07$exports = {};
|
|
256
|
-
|
|
257
|
-
$parcel$export($89d55ace0f8f1c07$exports, "WalletReact", () => $89d55ace0f8f1c07$export$ceaac94f34dba154);
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
function $89d55ace0f8f1c07$export$ceaac94f34dba154(props) {
|
|
263
|
-
const { walletProvider: walletProvider, provider: provider } = props;
|
|
264
|
-
(useEffect)(()=>{
|
|
265
|
-
if (provider) ($77ec335383336bdd$export$931068bc678f0d73)(($045213b18e9f1f94$export$75be0f6af9650f2c).WALLET, provider);
|
|
266
|
-
}, [
|
|
267
|
-
provider
|
|
268
|
-
]);
|
|
269
|
-
const config = window.ImtblCheckoutWidgetConfig;
|
|
270
|
-
return /*#__PURE__*/ (jsx)("imtbl-wallet", {
|
|
271
|
-
widgetConfig: config,
|
|
272
|
-
walletProvider: walletProvider
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
export { $15cc9e120aa6f3bf$export$d1bfa21f7c76447a as BridgeEventType, $1f969328e5988c99$export$30f61ebf204c69f6 as BridgeReact, $045213b18e9f1f94$export$75be0f6af9650f2c as CheckoutWidgetTagNames, $430e3eda76fa4d5f$export$af210a0808087845 as CheckoutWidgets, $a85ecdbd885c58ad$export$e72e7f9969a47dd3 as ConnectEventType, $f2083cd30e2f5c56$export$49d62957f420a1e2 as ConnectReact, $207ed853f11d19d5$export$5a0ace85cae72d45 as IMTBLWidgetEvents, $ad06b030b1a3ba34$export$b80d2daf830437b9 as OrchestrationEventType, $53d219e7f6bf0cd6$export$140a49745ab55563 as SwapEventType, $a4fbb8e3a6aeff58$export$971e031379577f4 as SwapReact, $430e3eda76fa4d5f$export$bf1548ba7e61c17f as UpdateConfig, $77b6aac5c353d4a9$export$d9be06b70b28c742 as WalletEventType, $89d55ace0f8f1c07$export$ceaac94f34dba154 as WalletReact, $045213b18e9f1f94$export$c88931fdc51854eb as WidgetTheme };
|
package/dist/erc20.d.ts
DELETED
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
declare type Bytes = ArrayLike<number>;
|
|
2
|
-
declare type BytesLike = Bytes | string;
|
|
3
|
-
interface Hexable {
|
|
4
|
-
toHexString(): string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
declare type BigNumberish = BigNumber | Bytes | bigint | string | number;
|
|
8
|
-
declare class BigNumber implements Hexable {
|
|
9
|
-
readonly _hex: string;
|
|
10
|
-
readonly _isBigNumber: boolean;
|
|
11
|
-
constructor(constructorGuard: any, hex: string);
|
|
12
|
-
fromTwos(value: number): BigNumber;
|
|
13
|
-
toTwos(value: number): BigNumber;
|
|
14
|
-
abs(): BigNumber;
|
|
15
|
-
add(other: BigNumberish): BigNumber;
|
|
16
|
-
sub(other: BigNumberish): BigNumber;
|
|
17
|
-
div(other: BigNumberish): BigNumber;
|
|
18
|
-
mul(other: BigNumberish): BigNumber;
|
|
19
|
-
mod(other: BigNumberish): BigNumber;
|
|
20
|
-
pow(other: BigNumberish): BigNumber;
|
|
21
|
-
and(other: BigNumberish): BigNumber;
|
|
22
|
-
or(other: BigNumberish): BigNumber;
|
|
23
|
-
xor(other: BigNumberish): BigNumber;
|
|
24
|
-
mask(value: number): BigNumber;
|
|
25
|
-
shl(value: number): BigNumber;
|
|
26
|
-
shr(value: number): BigNumber;
|
|
27
|
-
eq(other: BigNumberish): boolean;
|
|
28
|
-
lt(other: BigNumberish): boolean;
|
|
29
|
-
lte(other: BigNumberish): boolean;
|
|
30
|
-
gt(other: BigNumberish): boolean;
|
|
31
|
-
gte(other: BigNumberish): boolean;
|
|
32
|
-
isNegative(): boolean;
|
|
33
|
-
isZero(): boolean;
|
|
34
|
-
toNumber(): number;
|
|
35
|
-
toBigInt(): bigint;
|
|
36
|
-
toString(): string;
|
|
37
|
-
toHexString(): string;
|
|
38
|
-
toJSON(key?: string): any;
|
|
39
|
-
static from(value: any): BigNumber;
|
|
40
|
-
static isBigNumber(value: any): value is BigNumber;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
declare type Deferrable<T> = {
|
|
44
|
-
[K in keyof T]: T[K] | Promise<T[K]>;
|
|
45
|
-
};
|
|
46
|
-
declare class Description<T = any> {
|
|
47
|
-
constructor(info: {
|
|
48
|
-
[K in keyof T]: T[K];
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
declare type Network = {
|
|
53
|
-
name: string;
|
|
54
|
-
chainId: number;
|
|
55
|
-
ensAddress?: string;
|
|
56
|
-
_defaultProvider?: (providers: any, options?: any) => any;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
declare type AccessList = Array<{
|
|
60
|
-
address: string;
|
|
61
|
-
storageKeys: Array<string>;
|
|
62
|
-
}>;
|
|
63
|
-
declare type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
|
|
64
|
-
interface Transaction {
|
|
65
|
-
hash?: string;
|
|
66
|
-
to?: string;
|
|
67
|
-
from?: string;
|
|
68
|
-
nonce: number;
|
|
69
|
-
gasLimit: BigNumber;
|
|
70
|
-
gasPrice?: BigNumber;
|
|
71
|
-
data: string;
|
|
72
|
-
value: BigNumber;
|
|
73
|
-
chainId: number;
|
|
74
|
-
r?: string;
|
|
75
|
-
s?: string;
|
|
76
|
-
v?: number;
|
|
77
|
-
type?: number | null;
|
|
78
|
-
accessList?: AccessList;
|
|
79
|
-
maxPriorityFeePerGas?: BigNumber;
|
|
80
|
-
maxFeePerGas?: BigNumber;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
interface OnceBlockable {
|
|
84
|
-
once(eventName: "block", handler: () => void): void;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
declare type TransactionRequest = {
|
|
88
|
-
to?: string;
|
|
89
|
-
from?: string;
|
|
90
|
-
nonce?: BigNumberish;
|
|
91
|
-
gasLimit?: BigNumberish;
|
|
92
|
-
gasPrice?: BigNumberish;
|
|
93
|
-
data?: BytesLike;
|
|
94
|
-
value?: BigNumberish;
|
|
95
|
-
chainId?: number;
|
|
96
|
-
type?: number;
|
|
97
|
-
accessList?: AccessListish;
|
|
98
|
-
maxPriorityFeePerGas?: BigNumberish;
|
|
99
|
-
maxFeePerGas?: BigNumberish;
|
|
100
|
-
customData?: Record<string, any>;
|
|
101
|
-
ccipReadEnabled?: boolean;
|
|
102
|
-
};
|
|
103
|
-
interface TransactionResponse extends Transaction {
|
|
104
|
-
hash: string;
|
|
105
|
-
blockNumber?: number;
|
|
106
|
-
blockHash?: string;
|
|
107
|
-
timestamp?: number;
|
|
108
|
-
confirmations: number;
|
|
109
|
-
from: string;
|
|
110
|
-
raw?: string;
|
|
111
|
-
wait: (confirmations?: number) => Promise<TransactionReceipt>;
|
|
112
|
-
}
|
|
113
|
-
declare type BlockTag = string | number;
|
|
114
|
-
interface _Block {
|
|
115
|
-
hash: string;
|
|
116
|
-
parentHash: string;
|
|
117
|
-
number: number;
|
|
118
|
-
timestamp: number;
|
|
119
|
-
nonce: string;
|
|
120
|
-
difficulty: number;
|
|
121
|
-
_difficulty: BigNumber;
|
|
122
|
-
gasLimit: BigNumber;
|
|
123
|
-
gasUsed: BigNumber;
|
|
124
|
-
miner: string;
|
|
125
|
-
extraData: string;
|
|
126
|
-
baseFeePerGas?: null | BigNumber;
|
|
127
|
-
}
|
|
128
|
-
interface Block extends _Block {
|
|
129
|
-
transactions: Array<string>;
|
|
130
|
-
}
|
|
131
|
-
interface BlockWithTransactions extends _Block {
|
|
132
|
-
transactions: Array<TransactionResponse>;
|
|
133
|
-
}
|
|
134
|
-
interface Log {
|
|
135
|
-
blockNumber: number;
|
|
136
|
-
blockHash: string;
|
|
137
|
-
transactionIndex: number;
|
|
138
|
-
removed: boolean;
|
|
139
|
-
address: string;
|
|
140
|
-
data: string;
|
|
141
|
-
topics: Array<string>;
|
|
142
|
-
transactionHash: string;
|
|
143
|
-
logIndex: number;
|
|
144
|
-
}
|
|
145
|
-
interface TransactionReceipt {
|
|
146
|
-
to: string;
|
|
147
|
-
from: string;
|
|
148
|
-
contractAddress: string;
|
|
149
|
-
transactionIndex: number;
|
|
150
|
-
root?: string;
|
|
151
|
-
gasUsed: BigNumber;
|
|
152
|
-
logsBloom: string;
|
|
153
|
-
blockHash: string;
|
|
154
|
-
transactionHash: string;
|
|
155
|
-
logs: Array<Log>;
|
|
156
|
-
blockNumber: number;
|
|
157
|
-
confirmations: number;
|
|
158
|
-
cumulativeGasUsed: BigNumber;
|
|
159
|
-
effectiveGasPrice: BigNumber;
|
|
160
|
-
byzantium: boolean;
|
|
161
|
-
type: number;
|
|
162
|
-
status?: number;
|
|
163
|
-
}
|
|
164
|
-
interface FeeData {
|
|
165
|
-
lastBaseFeePerGas: null | BigNumber;
|
|
166
|
-
maxFeePerGas: null | BigNumber;
|
|
167
|
-
maxPriorityFeePerGas: null | BigNumber;
|
|
168
|
-
gasPrice: null | BigNumber;
|
|
169
|
-
}
|
|
170
|
-
interface EventFilter {
|
|
171
|
-
address?: string;
|
|
172
|
-
topics?: Array<string | Array<string> | null>;
|
|
173
|
-
}
|
|
174
|
-
interface Filter extends EventFilter {
|
|
175
|
-
fromBlock?: BlockTag;
|
|
176
|
-
toBlock?: BlockTag;
|
|
177
|
-
}
|
|
178
|
-
declare abstract class ForkEvent extends Description {
|
|
179
|
-
readonly expiry: number;
|
|
180
|
-
readonly _isForkEvent?: boolean;
|
|
181
|
-
static isForkEvent(value: any): value is ForkEvent;
|
|
182
|
-
}
|
|
183
|
-
declare type EventType = string | Array<string | Array<string>> | EventFilter | ForkEvent;
|
|
184
|
-
declare type Listener = (...args: Array<any>) => void;
|
|
185
|
-
declare abstract class Provider implements OnceBlockable {
|
|
186
|
-
abstract getNetwork(): Promise<Network>;
|
|
187
|
-
abstract getBlockNumber(): Promise<number>;
|
|
188
|
-
abstract getGasPrice(): Promise<BigNumber>;
|
|
189
|
-
getFeeData(): Promise<FeeData>;
|
|
190
|
-
abstract getBalance(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<BigNumber>;
|
|
191
|
-
abstract getTransactionCount(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<number>;
|
|
192
|
-
abstract getCode(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
193
|
-
abstract getStorageAt(addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
194
|
-
abstract sendTransaction(signedTransaction: string | Promise<string>): Promise<TransactionResponse>;
|
|
195
|
-
abstract call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
196
|
-
abstract estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
|
|
197
|
-
abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<Block>;
|
|
198
|
-
abstract getBlockWithTransactions(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<BlockWithTransactions>;
|
|
199
|
-
abstract getTransaction(transactionHash: string): Promise<TransactionResponse>;
|
|
200
|
-
abstract getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
|
|
201
|
-
abstract getLogs(filter: Filter): Promise<Array<Log>>;
|
|
202
|
-
abstract resolveName(name: string | Promise<string>): Promise<null | string>;
|
|
203
|
-
abstract lookupAddress(address: string | Promise<string>): Promise<null | string>;
|
|
204
|
-
abstract on(eventName: EventType, listener: Listener): Provider;
|
|
205
|
-
abstract once(eventName: EventType, listener: Listener): Provider;
|
|
206
|
-
abstract emit(eventName: EventType, ...args: Array<any>): boolean;
|
|
207
|
-
abstract listenerCount(eventName?: EventType): number;
|
|
208
|
-
abstract listeners(eventName?: EventType): Array<Listener>;
|
|
209
|
-
abstract off(eventName: EventType, listener?: Listener): Provider;
|
|
210
|
-
abstract removeAllListeners(eventName?: EventType): Provider;
|
|
211
|
-
addListener(eventName: EventType, listener: Listener): Provider;
|
|
212
|
-
removeListener(eventName: EventType, listener: Listener): Provider;
|
|
213
|
-
abstract waitForTransaction(transactionHash: string, confirmations?: number, timeout?: number): Promise<TransactionReceipt>;
|
|
214
|
-
readonly _isProvider: boolean;
|
|
215
|
-
constructor();
|
|
216
|
-
static isProvider(value: any): value is Provider;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
interface Overrides {
|
|
220
|
-
gasLimit?: BigNumberish | Promise<BigNumberish>;
|
|
221
|
-
gasPrice?: BigNumberish | Promise<BigNumberish>;
|
|
222
|
-
maxFeePerGas?: BigNumberish | Promise<BigNumberish>;
|
|
223
|
-
maxPriorityFeePerGas?: BigNumberish | Promise<BigNumberish>;
|
|
224
|
-
nonce?: BigNumberish | Promise<BigNumberish>;
|
|
225
|
-
type?: number;
|
|
226
|
-
accessList?: AccessListish;
|
|
227
|
-
customData?: Record<string, any>;
|
|
228
|
-
ccipReadEnabled?: boolean;
|
|
229
|
-
}
|
|
230
|
-
interface PayableOverrides extends Overrides {
|
|
231
|
-
value?: BigNumberish | Promise<BigNumberish>;
|
|
232
|
-
}
|
|
233
|
-
interface CallOverrides extends PayableOverrides {
|
|
234
|
-
blockTag?: BlockTag | Promise<BlockTag>;
|
|
235
|
-
from?: string | Promise<string>;
|
|
236
|
-
}
|
|
237
|
-
interface PopulatedTransaction {
|
|
238
|
-
to?: string;
|
|
239
|
-
from?: string;
|
|
240
|
-
nonce?: number;
|
|
241
|
-
gasLimit?: BigNumber;
|
|
242
|
-
gasPrice?: BigNumber;
|
|
243
|
-
data?: string;
|
|
244
|
-
value?: BigNumber;
|
|
245
|
-
chainId?: number;
|
|
246
|
-
type?: number;
|
|
247
|
-
accessList?: AccessList;
|
|
248
|
-
maxFeePerGas?: BigNumber;
|
|
249
|
-
maxPriorityFeePerGas?: BigNumber;
|
|
250
|
-
customData?: Record<string, any>;
|
|
251
|
-
ccipReadEnabled?: boolean;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/* Autogenerated file. Do not edit manually. */
|
|
255
|
-
/* tslint:disable */
|
|
256
|
-
/* eslint-disable */
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
type PromiseOrValue<T> = T | Promise<T>;
|
|
260
|
-
|
|
261
|
-
declare class ERC20 {
|
|
262
|
-
private readonly contract;
|
|
263
|
-
constructor(contractAddress: string);
|
|
264
|
-
/**
|
|
265
|
-
* @returns a promise that resolves with a BigNumber that represents the amount of tokens in existence
|
|
266
|
-
*/
|
|
267
|
-
totalSupply(provider: Provider, overrides?: CallOverrides): Promise<BigNumber>;
|
|
268
|
-
/**
|
|
269
|
-
* @returns a promise that resolves with a BigNumber that represents the amount of tokens owned by account
|
|
270
|
-
*/
|
|
271
|
-
balanceOf(provider: Provider, account: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>;
|
|
272
|
-
/**
|
|
273
|
-
* @returns a promise that resolves with a BigNumber that represents the remaining number of tokens that spender will be allowed to spend on behalf of owner through transferFrom
|
|
274
|
-
*/
|
|
275
|
-
allowance(provider: Provider, owner: PromiseOrValue<string>, spender: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>;
|
|
276
|
-
/**
|
|
277
|
-
* @returns a promise that resolves with a populated transaction
|
|
278
|
-
*/
|
|
279
|
-
populateTransfer(to: PromiseOrValue<string>, amount: PromiseOrValue<BigNumberish>, overrides?: Overrides & {
|
|
280
|
-
from?: PromiseOrValue<string>;
|
|
281
|
-
}): Promise<PopulatedTransaction>;
|
|
282
|
-
/**
|
|
283
|
-
* @returns a promise that resolves with a populated transaction
|
|
284
|
-
*/
|
|
285
|
-
populateApprove(spender: PromiseOrValue<string>, amount: PromiseOrValue<BigNumberish>, overrides?: Overrides & {
|
|
286
|
-
from?: PromiseOrValue<string>;
|
|
287
|
-
}): Promise<PopulatedTransaction>;
|
|
288
|
-
/**
|
|
289
|
-
* @returns a promise that resolves with a populated transaction
|
|
290
|
-
*/
|
|
291
|
-
populateTransferFrom(from: PromiseOrValue<string>, to: PromiseOrValue<string>, amount: PromiseOrValue<BigNumberish>, overrides?: Overrides & {
|
|
292
|
-
from?: PromiseOrValue<string>;
|
|
293
|
-
}): Promise<PopulatedTransaction>;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export { ERC20 };
|