@imtbl/sdk 1.47.10-alpha.5 → 1.48.0-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.
Files changed (53) hide show
  1. package/dist/{blockchain_data-cWzsr5wl.js → blockchain_data-DmBo09Ub.js} +2 -2
  2. package/dist/blockchain_data.js +3 -3
  3. package/dist/browser/checkout/{AddFundsWidget-CRB4FIQA.js → AddFundsWidget-B76vjzLe.js} +2 -2
  4. package/dist/browser/checkout/{BridgeWidget-DQWytFMq.js → BridgeWidget-26FpSkDM.js} +892 -5
  5. package/dist/browser/checkout/{CheckoutWidget-2YWKTPOw.js → CheckoutWidget-A0lpxQW5.js} +1 -1
  6. package/dist/browser/checkout/{OnRampWidget-Gp9PjJdg.js → OnRampWidget-BpHfHW9m.js} +19 -3
  7. package/dist/browser/checkout/{SaleWidget-KTxWf98O.js → SaleWidget-2NLt4vHC.js} +8 -8
  8. package/dist/browser/checkout/{SpendingCapHero-D5yi8Bqy.js → SpendingCapHero-CFYmjAC9.js} +1 -1
  9. package/dist/browser/checkout/{SwapWidget-DRFyJjEa.js → SwapWidget-jOf_i-tX.js} +191 -226
  10. package/dist/browser/checkout/{TopUpView-CKizPnH0.js → TopUpView-CCWR_Ywt.js} +1 -1
  11. package/dist/browser/checkout/{WalletWidget-BenJO1Gt.js → WalletWidget-DX6XyHRZ.js} +3 -3
  12. package/dist/browser/checkout/{auto-track-yKpxFpit.js → auto-track-HlFDs4AF.js} +1 -1
  13. package/dist/browser/checkout/{balance-Dpnr5wqM.js → balance-CxYIjdr3.js} +2 -2
  14. package/dist/browser/checkout/{index-B4PflMJG.js → index-B98fdYSj.js} +1150 -7300
  15. package/dist/browser/checkout/{index-CwvAErsc.js → index-C8MSufU0.js} +2 -2
  16. package/dist/browser/checkout/{index-COqbxbY_.js → index-CDckawJL.js} +1 -1
  17. package/dist/browser/checkout/{index-DlDjB9wn.js → index-DA2uO4yr.js} +1 -1
  18. package/dist/browser/checkout/{index-ZniBNFXw.js → index-DArhMjiX.js} +1 -1
  19. package/dist/browser/checkout/{index-D5C65gfz.js → index-Gzx2b9iM.js} +1 -1
  20. package/dist/browser/checkout/{index-CtXbWWJf.js → index-SW1XTDNB.js} +1 -1
  21. package/dist/browser/checkout/{index-PQUGtdAp.js → index-b14pM-Uq.js} +1 -1
  22. package/dist/browser/checkout/{index.umd-Bs9q0s4U.js → index.umd-YT5yUs2O.js} +1 -1
  23. package/dist/browser/checkout/{retry-C8XS-Xeo.js → retry-B5JRrQBT.js} +1 -1
  24. package/dist/browser/checkout/sdk.js +22 -22
  25. package/dist/browser/checkout/widgets-esm.js +1 -1
  26. package/dist/browser/checkout/widgets.js +1640 -6927
  27. package/dist/{checkout-CXpTQLRS.js → checkout-BFNKSC1p.js} +23 -7
  28. package/dist/checkout.d.ts +27 -2
  29. package/dist/checkout.js +5 -5
  30. package/dist/{config-B9pm_o2B.js → config-DdiXqLnW.js} +1 -1
  31. package/dist/config.js +1 -1
  32. package/dist/{index-Cd1_4hIm.js → index-CRCX_kjh.js} +1 -1
  33. package/dist/{index-E33r6dfY.js → index-CV4zecZ4.js} +3 -3
  34. package/dist/{index-PfNmrnl8.js → index-DZ3iNNYG.js} +4 -4
  35. package/dist/{index-BFR3TJ6T.js → index-I5hCRizU.js} +1 -1
  36. package/dist/{index-B73Nr-3V.js → index-YU2e3sgJ.js} +1 -1
  37. package/dist/{index-OqfbhlAB.js → index-n1s55SSO.js} +1 -1
  38. package/dist/index.browser.js +4 -4
  39. package/dist/index.browser.js.map +1 -1
  40. package/dist/index.cjs +24 -8
  41. package/dist/index.d.ts +29 -2
  42. package/dist/index.js +14 -14
  43. package/dist/{minting_backend-BoiGA7Ww.js → minting_backend-D0xUp3hC.js} +3 -3
  44. package/dist/minting_backend.js +5 -5
  45. package/dist/{orderbook-CcN997JC.js → orderbook-C3Fya1eb.js} +1 -1
  46. package/dist/orderbook.js +2 -2
  47. package/dist/{passport-DpdFVU6c.js → passport-DnEOV22D.js} +3 -3
  48. package/dist/passport.js +4 -4
  49. package/dist/{webhook-CHM4Pnle.js → webhook-CLXVoP8g.js} +1 -1
  50. package/dist/webhook.js +2 -2
  51. package/dist/{x-CxXemjdw.js → x-BNrl5-72.js} +3 -3
  52. package/dist/x.js +4 -4
  53. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { bF as axios, j as jsx, _ as _objectWithoutProperties, ap as cloneElementWithCssProp, o as Body, k as _defineProperty, J as CheckoutErrorType, bG as IMMUTABLE_API_BASE_URL, r as reactExports, I as IMTBLWidgetEvents, b1 as BridgeEventType, n as jsxs, bH as ShimmerBox, M as MenuItem, aM as Stack, l as useTranslation, d as Button, a as Box, bI as PASSPORT_URL, ag as Link, bJ as getChainIdBySlug, P as getChainImage, bK as networkName, O as FramedImage, be as Icon, t as useAnalytics, U as UserJourney, aO as Divider, V as ViewContext, aC as Fragment, p as ViewActions, a8 as useWalletConnect, aa as isWalletConnectProvider, bd as Logo, bL as RawImage, bM as AXELAR_SCAN_URL, G as isNativeToken, W as getTokenImageByAddress, bN as getNativeSymbolByChainSlug, X as calculateCryptoToFiat, E as EventTargetContext, w as isPassportProvider, y as getL1ChainId, T as TokenFilterTypes, x as getL2ChainId, bO as WalletProviderRdns, bP as Web3Provider, bQ as useInjectedProviders, Y as HeaderNavigation, a1 as FooterLogo, bR as WalletDrawer, a2 as SimpleLayout, bS as getChainSlugById, bT as JsonRpcProvider, bU as DEFAULT_TRANSACTIONS_RETRY_POLICY, aj as LoadingView, aY as ChainId, bV as getChainNameById, u as useTheme, a6 as Heading, a4 as getWalletProviderNameByProvider, bW as isAddressSanctioned, K as SharedViews, bX as isMetaMaskProvider, a3 as WalletProviderName, a7 as Drawer, B as ButtCon, $ as ButtonNavigationStyles, A as tokenValueFormat, v as formatZeroAmount, bg as NATIVE, bi as amountInputValidation, b7 as getRemoteImage, bc as CloudImage, bY as ETH_TOKEN_SYMBOL, as as BigNumber, ar as Contract, bZ as GasEstimateType, bm as DEFAULT_TOKEN_DECIMALS, bh as DEFAULT_QUOTE_REFRESH_INTERVAL, b_ as addChainChangedListener, b$ as removeChainChangedListener, bo as IMX_TOKEN_SYMBOL, c0 as dist, c1 as CHECKOUT_CDN_BASE_URL, ab as heroBackGroundStyles, ac as heroImageStyles, c2 as Badge, ae as SimpleTextBody, bp as FooterButton, c3 as getEthTokenImage, c4 as WITHDRAWAL_CLAIM_GAS_LIMIT, bf as getDefaultTokenImage, ah as viewReducer, ai as initialViewState, c5 as BridgeConfiguration, br as ImmutableConfiguration, c6 as TokenBridge, bs as StatusView, aK as StatusType, ak as ErrorView, c7 as ServiceUnavailableErrorView, c8 as ServiceType, c9 as ETH_SEPOLIA_TO_ZKEVM_TESTNET, ca as ETH_SEPOLIA_TO_ZKEVM_DEVNET, cb as ETH_MAINNET_TO_ZKEVM_MAINNET } from './index-B4PflMJG.js';
2
- import { B as BridgeWidgetViews, C as CryptoFiatContext, f as formatUnits, a as CryptoFiatActions, p as parseUnits, T as TopUpView, b as CryptoFiatProvider } from './TopUpView-CKizPnH0.js';
3
- import { T as TokenImage, r as retry, u as useInterval } from './retry-C8XS-Xeo.js';
4
- import { A as Accordion, S as SelectForm, T as TextInputForm, a as TransactionRejected, g as getAllowedBalances, F as Fees, N as NetworkSwitchDrawer, W as WalletApproveHero } from './balance-Dpnr5wqM.js';
1
+ import { bz as axios, bA as defineReadOnly, bB as getStatic, bC as Signer, bD as Provider, bE as getAddress, bF as Logger, bG as getContractAddress, bH as Interface, bI as shallowCopy, bJ as VoidSigner, bK as Indexed, bL as deepCopy, bM as isHexString, bN as checkResultErrors, bO as resolveProperties, ar as BigNumber, bP as accessListify, bQ as arrayify, j as jsx, _ as _objectWithoutProperties, ap as cloneElementWithCssProp, o as Body, k as _defineProperty, J as CheckoutErrorType, bR as IMMUTABLE_API_BASE_URL, r as reactExports, I as IMTBLWidgetEvents, b0 as BridgeEventType, n as jsxs, bS as ShimmerBox, M as MenuItem, aL as Stack, l as useTranslation, d as Button, a as Box, bT as PASSPORT_URL, ag as Link, bU as getChainIdBySlug, P as getChainImage, bV as networkName, O as FramedImage, bd as Icon, t as useAnalytics, U as UserJourney, aN as Divider, V as ViewContext, aB as Fragment, p as ViewActions, a8 as useWalletConnect, aa as isWalletConnectProvider, bc as Logo, bW as RawImage, bX as AXELAR_SCAN_URL, G as isNativeToken, W as getTokenImageByAddress, bY as getNativeSymbolByChainSlug, X as calculateCryptoToFiat, E as EventTargetContext, w as isPassportProvider, y as getL1ChainId, T as TokenFilterTypes, x as getL2ChainId, bZ as WalletProviderRdns, b_ as Web3Provider, b$ as useInjectedProviders, Y as HeaderNavigation, a1 as FooterLogo, c0 as WalletDrawer, a2 as SimpleLayout, c1 as getChainSlugById, c2 as JsonRpcProvider, c3 as DEFAULT_TRANSACTIONS_RETRY_POLICY, aj as LoadingView, aX as ChainId, c4 as getChainNameById, u as useTheme, a6 as Heading, a4 as getWalletProviderNameByProvider, c5 as isAddressSanctioned, K as SharedViews, c6 as isMetaMaskProvider, a3 as WalletProviderName, a7 as Drawer, B as ButtCon, $ as ButtonNavigationStyles, A as tokenValueFormat, v as formatZeroAmount, bf as NATIVE, bh as amountInputValidation, b6 as getRemoteImage, bb as CloudImage, c7 as ETH_TOKEN_SYMBOL, c8 as GasEstimateType, bl as DEFAULT_TOKEN_DECIMALS, bg as DEFAULT_QUOTE_REFRESH_INTERVAL, c9 as addChainChangedListener, ca as removeChainChangedListener, bn as IMX_TOKEN_SYMBOL, cb as dist, cc as CHECKOUT_CDN_BASE_URL, ab as heroBackGroundStyles, ac as heroImageStyles, cd as Badge, ae as SimpleTextBody, bo as FooterButton, ce as getEthTokenImage, cf as WITHDRAWAL_CLAIM_GAS_LIMIT, be as getDefaultTokenImage, ah as viewReducer, ai as initialViewState, cg as BridgeConfiguration, ch as ImmutableConfiguration, ci as TokenBridge, bq as StatusView, aJ as StatusType, ak as ErrorView, cj as ServiceUnavailableErrorView, ck as ServiceType, cl as ETH_SEPOLIA_TO_ZKEVM_TESTNET, cm as ETH_SEPOLIA_TO_ZKEVM_DEVNET, cn as ETH_MAINNET_TO_ZKEVM_MAINNET } from './index-B98fdYSj.js';
2
+ import { B as BridgeWidgetViews, C as CryptoFiatContext, f as formatUnits, a as CryptoFiatActions, p as parseUnits, T as TopUpView, b as CryptoFiatProvider } from './TopUpView-CCWR_Ywt.js';
3
+ import { T as TokenImage, r as retry, u as useInterval } from './retry-B5JRrQBT.js';
4
+ import { A as Accordion, S as SelectForm, T as TextInputForm, a as TransactionRejected, g as getAllowedBalances, F as Fees, N as NetworkSwitchDrawer, W as WalletApproveHero } from './balance-CxYIjdr3.js';
5
5
 
6
6
  // This module is intended to unwrap Axios default export as named.
7
7
  // Keep top-level export same with static properties
@@ -25,6 +25,888 @@ const {
25
25
  mergeConfig
26
26
  } = axios;
27
27
 
28
+ const version = "contracts/5.7.0";
29
+
30
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
32
+ return new (P || (P = Promise))(function (resolve, reject) {
33
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
34
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
36
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
37
+ });
38
+ };
39
+ const logger = new Logger(version);
40
+ function resolveName(resolver, nameOrPromise) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const name = yield nameOrPromise;
43
+ if (typeof (name) !== "string") {
44
+ logger.throwArgumentError("invalid address or ENS name", "name", name);
45
+ }
46
+ // If it is already an address, just use it (after adding checksum)
47
+ try {
48
+ return getAddress(name);
49
+ }
50
+ catch (error) { }
51
+ if (!resolver) {
52
+ logger.throwError("a provider or signer is needed to resolve ENS names", Logger.errors.UNSUPPORTED_OPERATION, {
53
+ operation: "resolveName"
54
+ });
55
+ }
56
+ const address = yield resolver.resolveName(name);
57
+ if (address == null) {
58
+ logger.throwArgumentError("resolver or addr is not configured for ENS name", "name", name);
59
+ }
60
+ return address;
61
+ });
62
+ }
63
+ // Recursively replaces ENS names with promises to resolve the name and resolves all properties
64
+ function resolveAddresses(resolver, value, paramType) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ if (Array.isArray(paramType)) {
67
+ return yield Promise.all(paramType.map((paramType, index) => {
68
+ return resolveAddresses(resolver, ((Array.isArray(value)) ? value[index] : value[paramType.name]), paramType);
69
+ }));
70
+ }
71
+ if (paramType.type === "address") {
72
+ return yield resolveName(resolver, value);
73
+ }
74
+ if (paramType.type === "tuple") {
75
+ return yield resolveAddresses(resolver, value, paramType.components);
76
+ }
77
+ if (paramType.baseType === "array") {
78
+ if (!Array.isArray(value)) {
79
+ return Promise.reject(logger.makeError("invalid value for array", Logger.errors.INVALID_ARGUMENT, {
80
+ argument: "value",
81
+ value
82
+ }));
83
+ }
84
+ return yield Promise.all(value.map((v) => resolveAddresses(resolver, v, paramType.arrayChildren)));
85
+ }
86
+ return value;
87
+ });
88
+ }
89
+ function populateTransaction(contract, fragment, args) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ // If an extra argument is given, it is overrides
92
+ let overrides = {};
93
+ if (args.length === fragment.inputs.length + 1 && typeof (args[args.length - 1]) === "object") {
94
+ overrides = shallowCopy(args.pop());
95
+ }
96
+ // Make sure the parameter count matches
97
+ logger.checkArgumentCount(args.length, fragment.inputs.length, "passed to contract");
98
+ // Populate "from" override (allow promises)
99
+ if (contract.signer) {
100
+ if (overrides.from) {
101
+ // Contracts with a Signer are from the Signer's frame-of-reference;
102
+ // but we allow overriding "from" if it matches the signer
103
+ overrides.from = resolveProperties({
104
+ override: resolveName(contract.signer, overrides.from),
105
+ signer: contract.signer.getAddress()
106
+ }).then((check) => __awaiter(this, void 0, void 0, function* () {
107
+ if (getAddress(check.signer) !== check.override) {
108
+ logger.throwError("Contract with a Signer cannot override from", Logger.errors.UNSUPPORTED_OPERATION, {
109
+ operation: "overrides.from"
110
+ });
111
+ }
112
+ return check.override;
113
+ }));
114
+ }
115
+ else {
116
+ overrides.from = contract.signer.getAddress();
117
+ }
118
+ }
119
+ else if (overrides.from) {
120
+ overrides.from = resolveName(contract.provider, overrides.from);
121
+ //} else {
122
+ // Contracts without a signer can override "from", and if
123
+ // unspecified the zero address is used
124
+ //overrides.from = AddressZero;
125
+ }
126
+ // Wait for all dependencies to be resolved (prefer the signer over the provider)
127
+ const resolved = yield resolveProperties({
128
+ args: resolveAddresses(contract.signer || contract.provider, args, fragment.inputs),
129
+ address: contract.resolvedAddress,
130
+ overrides: (resolveProperties(overrides) || {})
131
+ });
132
+ // The ABI coded transaction
133
+ const data = contract.interface.encodeFunctionData(fragment, resolved.args);
134
+ const tx = {
135
+ data: data,
136
+ to: resolved.address
137
+ };
138
+ // Resolved Overrides
139
+ const ro = resolved.overrides;
140
+ // Populate simple overrides
141
+ if (ro.nonce != null) {
142
+ tx.nonce = BigNumber.from(ro.nonce).toNumber();
143
+ }
144
+ if (ro.gasLimit != null) {
145
+ tx.gasLimit = BigNumber.from(ro.gasLimit);
146
+ }
147
+ if (ro.gasPrice != null) {
148
+ tx.gasPrice = BigNumber.from(ro.gasPrice);
149
+ }
150
+ if (ro.maxFeePerGas != null) {
151
+ tx.maxFeePerGas = BigNumber.from(ro.maxFeePerGas);
152
+ }
153
+ if (ro.maxPriorityFeePerGas != null) {
154
+ tx.maxPriorityFeePerGas = BigNumber.from(ro.maxPriorityFeePerGas);
155
+ }
156
+ if (ro.from != null) {
157
+ tx.from = ro.from;
158
+ }
159
+ if (ro.type != null) {
160
+ tx.type = ro.type;
161
+ }
162
+ if (ro.accessList != null) {
163
+ tx.accessList = accessListify(ro.accessList);
164
+ }
165
+ // If there was no "gasLimit" override, but the ABI specifies a default, use it
166
+ if (tx.gasLimit == null && fragment.gas != null) {
167
+ // Compute the intrinsic gas cost for this transaction
168
+ // @TODO: This is based on the yellow paper as of Petersburg; this is something
169
+ // we may wish to parameterize in v6 as part of the Network object. Since this
170
+ // is always a non-nil to address, we can ignore G_create, but may wish to add
171
+ // similar logic to the ContractFactory.
172
+ let intrinsic = 21000;
173
+ const bytes = arrayify(data);
174
+ for (let i = 0; i < bytes.length; i++) {
175
+ intrinsic += 4;
176
+ if (bytes[i]) {
177
+ intrinsic += 64;
178
+ }
179
+ }
180
+ tx.gasLimit = BigNumber.from(fragment.gas).add(intrinsic);
181
+ }
182
+ // Populate "value" override
183
+ if (ro.value) {
184
+ const roValue = BigNumber.from(ro.value);
185
+ if (!roValue.isZero() && !fragment.payable) {
186
+ logger.throwError("non-payable method cannot override value", Logger.errors.UNSUPPORTED_OPERATION, {
187
+ operation: "overrides.value",
188
+ value: overrides.value
189
+ });
190
+ }
191
+ tx.value = roValue;
192
+ }
193
+ if (ro.customData) {
194
+ tx.customData = shallowCopy(ro.customData);
195
+ }
196
+ if (ro.ccipReadEnabled) {
197
+ tx.ccipReadEnabled = !!ro.ccipReadEnabled;
198
+ }
199
+ // Remove the overrides
200
+ delete overrides.nonce;
201
+ delete overrides.gasLimit;
202
+ delete overrides.gasPrice;
203
+ delete overrides.from;
204
+ delete overrides.value;
205
+ delete overrides.type;
206
+ delete overrides.accessList;
207
+ delete overrides.maxFeePerGas;
208
+ delete overrides.maxPriorityFeePerGas;
209
+ delete overrides.customData;
210
+ delete overrides.ccipReadEnabled;
211
+ // Make sure there are no stray overrides, which may indicate a
212
+ // typo or using an unsupported key.
213
+ const leftovers = Object.keys(overrides).filter((key) => (overrides[key] != null));
214
+ if (leftovers.length) {
215
+ logger.throwError(`cannot override ${leftovers.map((l) => JSON.stringify(l)).join(",")}`, Logger.errors.UNSUPPORTED_OPERATION, {
216
+ operation: "overrides",
217
+ overrides: leftovers
218
+ });
219
+ }
220
+ return tx;
221
+ });
222
+ }
223
+ function buildPopulate(contract, fragment) {
224
+ return function (...args) {
225
+ return populateTransaction(contract, fragment, args);
226
+ };
227
+ }
228
+ function buildEstimate(contract, fragment) {
229
+ const signerOrProvider = (contract.signer || contract.provider);
230
+ return function (...args) {
231
+ return __awaiter(this, void 0, void 0, function* () {
232
+ if (!signerOrProvider) {
233
+ logger.throwError("estimate require a provider or signer", Logger.errors.UNSUPPORTED_OPERATION, {
234
+ operation: "estimateGas"
235
+ });
236
+ }
237
+ const tx = yield populateTransaction(contract, fragment, args);
238
+ return yield signerOrProvider.estimateGas(tx);
239
+ });
240
+ };
241
+ }
242
+ function addContractWait(contract, tx) {
243
+ const wait = tx.wait.bind(tx);
244
+ tx.wait = (confirmations) => {
245
+ return wait(confirmations).then((receipt) => {
246
+ receipt.events = receipt.logs.map((log) => {
247
+ let event = deepCopy(log);
248
+ let parsed = null;
249
+ try {
250
+ parsed = contract.interface.parseLog(log);
251
+ }
252
+ catch (e) { }
253
+ // Successfully parsed the event log; include it
254
+ if (parsed) {
255
+ event.args = parsed.args;
256
+ event.decode = (data, topics) => {
257
+ return contract.interface.decodeEventLog(parsed.eventFragment, data, topics);
258
+ };
259
+ event.event = parsed.name;
260
+ event.eventSignature = parsed.signature;
261
+ }
262
+ // Useful operations
263
+ event.removeListener = () => { return contract.provider; };
264
+ event.getBlock = () => {
265
+ return contract.provider.getBlock(receipt.blockHash);
266
+ };
267
+ event.getTransaction = () => {
268
+ return contract.provider.getTransaction(receipt.transactionHash);
269
+ };
270
+ event.getTransactionReceipt = () => {
271
+ return Promise.resolve(receipt);
272
+ };
273
+ return event;
274
+ });
275
+ return receipt;
276
+ });
277
+ };
278
+ }
279
+ function buildCall(contract, fragment, collapseSimple) {
280
+ const signerOrProvider = (contract.signer || contract.provider);
281
+ return function (...args) {
282
+ return __awaiter(this, void 0, void 0, function* () {
283
+ // Extract the "blockTag" override if present
284
+ let blockTag = undefined;
285
+ if (args.length === fragment.inputs.length + 1 && typeof (args[args.length - 1]) === "object") {
286
+ const overrides = shallowCopy(args.pop());
287
+ if (overrides.blockTag != null) {
288
+ blockTag = yield overrides.blockTag;
289
+ }
290
+ delete overrides.blockTag;
291
+ args.push(overrides);
292
+ }
293
+ // If the contract was just deployed, wait until it is mined
294
+ if (contract.deployTransaction != null) {
295
+ yield contract._deployed(blockTag);
296
+ }
297
+ // Call a node and get the result
298
+ const tx = yield populateTransaction(contract, fragment, args);
299
+ const result = yield signerOrProvider.call(tx, blockTag);
300
+ try {
301
+ let value = contract.interface.decodeFunctionResult(fragment, result);
302
+ if (collapseSimple && fragment.outputs.length === 1) {
303
+ value = value[0];
304
+ }
305
+ return value;
306
+ }
307
+ catch (error) {
308
+ if (error.code === Logger.errors.CALL_EXCEPTION) {
309
+ error.address = contract.address;
310
+ error.args = args;
311
+ error.transaction = tx;
312
+ }
313
+ throw error;
314
+ }
315
+ });
316
+ };
317
+ }
318
+ function buildSend(contract, fragment) {
319
+ return function (...args) {
320
+ return __awaiter(this, void 0, void 0, function* () {
321
+ if (!contract.signer) {
322
+ logger.throwError("sending a transaction requires a signer", Logger.errors.UNSUPPORTED_OPERATION, {
323
+ operation: "sendTransaction"
324
+ });
325
+ }
326
+ // If the contract was just deployed, wait until it is mined
327
+ if (contract.deployTransaction != null) {
328
+ yield contract._deployed();
329
+ }
330
+ const txRequest = yield populateTransaction(contract, fragment, args);
331
+ const tx = yield contract.signer.sendTransaction(txRequest);
332
+ // Tweak the tx.wait so the receipt has extra properties
333
+ addContractWait(contract, tx);
334
+ return tx;
335
+ });
336
+ };
337
+ }
338
+ function buildDefault(contract, fragment, collapseSimple) {
339
+ if (fragment.constant) {
340
+ return buildCall(contract, fragment, collapseSimple);
341
+ }
342
+ return buildSend(contract, fragment);
343
+ }
344
+ function getEventTag(filter) {
345
+ if (filter.address && (filter.topics == null || filter.topics.length === 0)) {
346
+ return "*";
347
+ }
348
+ return (filter.address || "*") + "@" + (filter.topics ? filter.topics.map((topic) => {
349
+ if (Array.isArray(topic)) {
350
+ return topic.join("|");
351
+ }
352
+ return topic;
353
+ }).join(":") : "");
354
+ }
355
+ class RunningEvent {
356
+ constructor(tag, filter) {
357
+ defineReadOnly(this, "tag", tag);
358
+ defineReadOnly(this, "filter", filter);
359
+ this._listeners = [];
360
+ }
361
+ addListener(listener, once) {
362
+ this._listeners.push({ listener: listener, once: once });
363
+ }
364
+ removeListener(listener) {
365
+ let done = false;
366
+ this._listeners = this._listeners.filter((item) => {
367
+ if (done || item.listener !== listener) {
368
+ return true;
369
+ }
370
+ done = true;
371
+ return false;
372
+ });
373
+ }
374
+ removeAllListeners() {
375
+ this._listeners = [];
376
+ }
377
+ listeners() {
378
+ return this._listeners.map((i) => i.listener);
379
+ }
380
+ listenerCount() {
381
+ return this._listeners.length;
382
+ }
383
+ run(args) {
384
+ const listenerCount = this.listenerCount();
385
+ this._listeners = this._listeners.filter((item) => {
386
+ const argsCopy = args.slice();
387
+ // Call the callback in the next event loop
388
+ setTimeout(() => {
389
+ item.listener.apply(this, argsCopy);
390
+ }, 0);
391
+ // Reschedule it if it not "once"
392
+ return !(item.once);
393
+ });
394
+ return listenerCount;
395
+ }
396
+ prepareEvent(event) {
397
+ }
398
+ // Returns the array that will be applied to an emit
399
+ getEmit(event) {
400
+ return [event];
401
+ }
402
+ }
403
+ class ErrorRunningEvent extends RunningEvent {
404
+ constructor() {
405
+ super("error", null);
406
+ }
407
+ }
408
+ // @TODO Fragment should inherit Wildcard? and just override getEmit?
409
+ // or have a common abstract super class, with enough constructor
410
+ // options to configure both.
411
+ // A Fragment Event will populate all the properties that Wildcard
412
+ // will, and additionally dereference the arguments when emitting
413
+ class FragmentRunningEvent extends RunningEvent {
414
+ constructor(address, contractInterface, fragment, topics) {
415
+ const filter = {
416
+ address: address
417
+ };
418
+ let topic = contractInterface.getEventTopic(fragment);
419
+ if (topics) {
420
+ if (topic !== topics[0]) {
421
+ logger.throwArgumentError("topic mismatch", "topics", topics);
422
+ }
423
+ filter.topics = topics.slice();
424
+ }
425
+ else {
426
+ filter.topics = [topic];
427
+ }
428
+ super(getEventTag(filter), filter);
429
+ defineReadOnly(this, "address", address);
430
+ defineReadOnly(this, "interface", contractInterface);
431
+ defineReadOnly(this, "fragment", fragment);
432
+ }
433
+ prepareEvent(event) {
434
+ super.prepareEvent(event);
435
+ event.event = this.fragment.name;
436
+ event.eventSignature = this.fragment.format();
437
+ event.decode = (data, topics) => {
438
+ return this.interface.decodeEventLog(this.fragment, data, topics);
439
+ };
440
+ try {
441
+ event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
442
+ }
443
+ catch (error) {
444
+ event.args = null;
445
+ event.decodeError = error;
446
+ }
447
+ }
448
+ getEmit(event) {
449
+ const errors = checkResultErrors(event.args);
450
+ if (errors.length) {
451
+ throw errors[0].error;
452
+ }
453
+ const args = (event.args || []).slice();
454
+ args.push(event);
455
+ return args;
456
+ }
457
+ }
458
+ // A Wildcard Event will attempt to populate:
459
+ // - event The name of the event name
460
+ // - eventSignature The full signature of the event
461
+ // - decode A function to decode data and topics
462
+ // - args The decoded data and topics
463
+ class WildcardRunningEvent extends RunningEvent {
464
+ constructor(address, contractInterface) {
465
+ super("*", { address: address });
466
+ defineReadOnly(this, "address", address);
467
+ defineReadOnly(this, "interface", contractInterface);
468
+ }
469
+ prepareEvent(event) {
470
+ super.prepareEvent(event);
471
+ try {
472
+ const parsed = this.interface.parseLog(event);
473
+ event.event = parsed.name;
474
+ event.eventSignature = parsed.signature;
475
+ event.decode = (data, topics) => {
476
+ return this.interface.decodeEventLog(parsed.eventFragment, data, topics);
477
+ };
478
+ event.args = parsed.args;
479
+ }
480
+ catch (error) {
481
+ // No matching event
482
+ }
483
+ }
484
+ }
485
+ class BaseContract {
486
+ constructor(addressOrName, contractInterface, signerOrProvider) {
487
+ // @TODO: Maybe still check the addressOrName looks like a valid address or name?
488
+ //address = getAddress(address);
489
+ defineReadOnly(this, "interface", getStatic(new.target, "getInterface")(contractInterface));
490
+ if (signerOrProvider == null) {
491
+ defineReadOnly(this, "provider", null);
492
+ defineReadOnly(this, "signer", null);
493
+ }
494
+ else if (Signer.isSigner(signerOrProvider)) {
495
+ defineReadOnly(this, "provider", signerOrProvider.provider || null);
496
+ defineReadOnly(this, "signer", signerOrProvider);
497
+ }
498
+ else if (Provider.isProvider(signerOrProvider)) {
499
+ defineReadOnly(this, "provider", signerOrProvider);
500
+ defineReadOnly(this, "signer", null);
501
+ }
502
+ else {
503
+ logger.throwArgumentError("invalid signer or provider", "signerOrProvider", signerOrProvider);
504
+ }
505
+ defineReadOnly(this, "callStatic", {});
506
+ defineReadOnly(this, "estimateGas", {});
507
+ defineReadOnly(this, "functions", {});
508
+ defineReadOnly(this, "populateTransaction", {});
509
+ defineReadOnly(this, "filters", {});
510
+ {
511
+ const uniqueFilters = {};
512
+ Object.keys(this.interface.events).forEach((eventSignature) => {
513
+ const event = this.interface.events[eventSignature];
514
+ defineReadOnly(this.filters, eventSignature, (...args) => {
515
+ return {
516
+ address: this.address,
517
+ topics: this.interface.encodeFilterTopics(event, args)
518
+ };
519
+ });
520
+ if (!uniqueFilters[event.name]) {
521
+ uniqueFilters[event.name] = [];
522
+ }
523
+ uniqueFilters[event.name].push(eventSignature);
524
+ });
525
+ Object.keys(uniqueFilters).forEach((name) => {
526
+ const filters = uniqueFilters[name];
527
+ if (filters.length === 1) {
528
+ defineReadOnly(this.filters, name, this.filters[filters[0]]);
529
+ }
530
+ else {
531
+ logger.warn(`Duplicate definition of ${name} (${filters.join(", ")})`);
532
+ }
533
+ });
534
+ }
535
+ defineReadOnly(this, "_runningEvents", {});
536
+ defineReadOnly(this, "_wrappedEmits", {});
537
+ if (addressOrName == null) {
538
+ logger.throwArgumentError("invalid contract address or ENS name", "addressOrName", addressOrName);
539
+ }
540
+ defineReadOnly(this, "address", addressOrName);
541
+ if (this.provider) {
542
+ defineReadOnly(this, "resolvedAddress", resolveName(this.provider, addressOrName));
543
+ }
544
+ else {
545
+ try {
546
+ defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress(addressOrName)));
547
+ }
548
+ catch (error) {
549
+ // Without a provider, we cannot use ENS names
550
+ logger.throwError("provider is required to use ENS name as contract address", Logger.errors.UNSUPPORTED_OPERATION, {
551
+ operation: "new Contract"
552
+ });
553
+ }
554
+ }
555
+ // Swallow bad ENS names to prevent Unhandled Exceptions
556
+ this.resolvedAddress.catch((e) => { });
557
+ const uniqueNames = {};
558
+ const uniqueSignatures = {};
559
+ Object.keys(this.interface.functions).forEach((signature) => {
560
+ const fragment = this.interface.functions[signature];
561
+ // Check that the signature is unique; if not the ABI generation has
562
+ // not been cleaned or may be incorrectly generated
563
+ if (uniqueSignatures[signature]) {
564
+ logger.warn(`Duplicate ABI entry for ${JSON.stringify(signature)}`);
565
+ return;
566
+ }
567
+ uniqueSignatures[signature] = true;
568
+ // Track unique names; we only expose bare named functions if they
569
+ // are ambiguous
570
+ {
571
+ const name = fragment.name;
572
+ if (!uniqueNames[`%${name}`]) {
573
+ uniqueNames[`%${name}`] = [];
574
+ }
575
+ uniqueNames[`%${name}`].push(signature);
576
+ }
577
+ if (this[signature] == null) {
578
+ defineReadOnly(this, signature, buildDefault(this, fragment, true));
579
+ }
580
+ // We do not collapse simple calls on this bucket, which allows
581
+ // frameworks to safely use this without introspection as well as
582
+ // allows decoding error recovery.
583
+ if (this.functions[signature] == null) {
584
+ defineReadOnly(this.functions, signature, buildDefault(this, fragment, false));
585
+ }
586
+ if (this.callStatic[signature] == null) {
587
+ defineReadOnly(this.callStatic, signature, buildCall(this, fragment, true));
588
+ }
589
+ if (this.populateTransaction[signature] == null) {
590
+ defineReadOnly(this.populateTransaction, signature, buildPopulate(this, fragment));
591
+ }
592
+ if (this.estimateGas[signature] == null) {
593
+ defineReadOnly(this.estimateGas, signature, buildEstimate(this, fragment));
594
+ }
595
+ });
596
+ Object.keys(uniqueNames).forEach((name) => {
597
+ // Ambiguous names to not get attached as bare names
598
+ const signatures = uniqueNames[name];
599
+ if (signatures.length > 1) {
600
+ return;
601
+ }
602
+ // Strip off the leading "%" used for prototype protection
603
+ name = name.substring(1);
604
+ const signature = signatures[0];
605
+ // If overwriting a member property that is null, swallow the error
606
+ try {
607
+ if (this[name] == null) {
608
+ defineReadOnly(this, name, this[signature]);
609
+ }
610
+ }
611
+ catch (e) { }
612
+ if (this.functions[name] == null) {
613
+ defineReadOnly(this.functions, name, this.functions[signature]);
614
+ }
615
+ if (this.callStatic[name] == null) {
616
+ defineReadOnly(this.callStatic, name, this.callStatic[signature]);
617
+ }
618
+ if (this.populateTransaction[name] == null) {
619
+ defineReadOnly(this.populateTransaction, name, this.populateTransaction[signature]);
620
+ }
621
+ if (this.estimateGas[name] == null) {
622
+ defineReadOnly(this.estimateGas, name, this.estimateGas[signature]);
623
+ }
624
+ });
625
+ }
626
+ static getContractAddress(transaction) {
627
+ return getContractAddress(transaction);
628
+ }
629
+ static getInterface(contractInterface) {
630
+ if (Interface.isInterface(contractInterface)) {
631
+ return contractInterface;
632
+ }
633
+ return new Interface(contractInterface);
634
+ }
635
+ // @TODO: Allow timeout?
636
+ deployed() {
637
+ return this._deployed();
638
+ }
639
+ _deployed(blockTag) {
640
+ if (!this._deployedPromise) {
641
+ // If we were just deployed, we know the transaction we should occur in
642
+ if (this.deployTransaction) {
643
+ this._deployedPromise = this.deployTransaction.wait().then(() => {
644
+ return this;
645
+ });
646
+ }
647
+ else {
648
+ // @TODO: Once we allow a timeout to be passed in, we will wait
649
+ // up to that many blocks for getCode
650
+ // Otherwise, poll for our code to be deployed
651
+ this._deployedPromise = this.provider.getCode(this.address, blockTag).then((code) => {
652
+ if (code === "0x") {
653
+ logger.throwError("contract not deployed", Logger.errors.UNSUPPORTED_OPERATION, {
654
+ contractAddress: this.address,
655
+ operation: "getDeployed"
656
+ });
657
+ }
658
+ return this;
659
+ });
660
+ }
661
+ }
662
+ return this._deployedPromise;
663
+ }
664
+ // @TODO:
665
+ // estimateFallback(overrides?: TransactionRequest): Promise<BigNumber>
666
+ // @TODO:
667
+ // estimateDeploy(bytecode: string, ...args): Promise<BigNumber>
668
+ fallback(overrides) {
669
+ if (!this.signer) {
670
+ logger.throwError("sending a transactions require a signer", Logger.errors.UNSUPPORTED_OPERATION, { operation: "sendTransaction(fallback)" });
671
+ }
672
+ const tx = shallowCopy(overrides || {});
673
+ ["from", "to"].forEach(function (key) {
674
+ if (tx[key] == null) {
675
+ return;
676
+ }
677
+ logger.throwError("cannot override " + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });
678
+ });
679
+ tx.to = this.resolvedAddress;
680
+ return this.deployed().then(() => {
681
+ return this.signer.sendTransaction(tx);
682
+ });
683
+ }
684
+ // Reconnect to a different signer or provider
685
+ connect(signerOrProvider) {
686
+ if (typeof (signerOrProvider) === "string") {
687
+ signerOrProvider = new VoidSigner(signerOrProvider, this.provider);
688
+ }
689
+ const contract = new (this.constructor)(this.address, this.interface, signerOrProvider);
690
+ if (this.deployTransaction) {
691
+ defineReadOnly(contract, "deployTransaction", this.deployTransaction);
692
+ }
693
+ return contract;
694
+ }
695
+ // Re-attach to a different on-chain instance of this contract
696
+ attach(addressOrName) {
697
+ return new (this.constructor)(addressOrName, this.interface, this.signer || this.provider);
698
+ }
699
+ static isIndexed(value) {
700
+ return Indexed.isIndexed(value);
701
+ }
702
+ _normalizeRunningEvent(runningEvent) {
703
+ // Already have an instance of this event running; we can re-use it
704
+ if (this._runningEvents[runningEvent.tag]) {
705
+ return this._runningEvents[runningEvent.tag];
706
+ }
707
+ return runningEvent;
708
+ }
709
+ _getRunningEvent(eventName) {
710
+ if (typeof (eventName) === "string") {
711
+ // Listen for "error" events (if your contract has an error event, include
712
+ // the full signature to bypass this special event keyword)
713
+ if (eventName === "error") {
714
+ return this._normalizeRunningEvent(new ErrorRunningEvent());
715
+ }
716
+ // Listen for any event that is registered
717
+ if (eventName === "event") {
718
+ return this._normalizeRunningEvent(new RunningEvent("event", null));
719
+ }
720
+ // Listen for any event
721
+ if (eventName === "*") {
722
+ return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
723
+ }
724
+ // Get the event Fragment (throws if ambiguous/unknown event)
725
+ const fragment = this.interface.getEvent(eventName);
726
+ return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));
727
+ }
728
+ // We have topics to filter by...
729
+ if (eventName.topics && eventName.topics.length > 0) {
730
+ // Is it a known topichash? (throws if no matching topichash)
731
+ try {
732
+ const topic = eventName.topics[0];
733
+ if (typeof (topic) !== "string") {
734
+ throw new Error("invalid topic"); // @TODO: May happen for anonymous events
735
+ }
736
+ const fragment = this.interface.getEvent(topic);
737
+ return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));
738
+ }
739
+ catch (error) { }
740
+ // Filter by the unknown topichash
741
+ const filter = {
742
+ address: this.address,
743
+ topics: eventName.topics
744
+ };
745
+ return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));
746
+ }
747
+ return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
748
+ }
749
+ _checkRunningEvents(runningEvent) {
750
+ if (runningEvent.listenerCount() === 0) {
751
+ delete this._runningEvents[runningEvent.tag];
752
+ // If we have a poller for this, remove it
753
+ const emit = this._wrappedEmits[runningEvent.tag];
754
+ if (emit && runningEvent.filter) {
755
+ this.provider.off(runningEvent.filter, emit);
756
+ delete this._wrappedEmits[runningEvent.tag];
757
+ }
758
+ }
759
+ }
760
+ // Subclasses can override this to gracefully recover
761
+ // from parse errors if they wish
762
+ _wrapEvent(runningEvent, log, listener) {
763
+ const event = deepCopy(log);
764
+ event.removeListener = () => {
765
+ if (!listener) {
766
+ return;
767
+ }
768
+ runningEvent.removeListener(listener);
769
+ this._checkRunningEvents(runningEvent);
770
+ };
771
+ event.getBlock = () => { return this.provider.getBlock(log.blockHash); };
772
+ event.getTransaction = () => { return this.provider.getTransaction(log.transactionHash); };
773
+ event.getTransactionReceipt = () => { return this.provider.getTransactionReceipt(log.transactionHash); };
774
+ // This may throw if the topics and data mismatch the signature
775
+ runningEvent.prepareEvent(event);
776
+ return event;
777
+ }
778
+ _addEventListener(runningEvent, listener, once) {
779
+ if (!this.provider) {
780
+ logger.throwError("events require a provider or a signer with a provider", Logger.errors.UNSUPPORTED_OPERATION, { operation: "once" });
781
+ }
782
+ runningEvent.addListener(listener, once);
783
+ // Track this running event and its listeners (may already be there; but no hard in updating)
784
+ this._runningEvents[runningEvent.tag] = runningEvent;
785
+ // If we are not polling the provider, start polling
786
+ if (!this._wrappedEmits[runningEvent.tag]) {
787
+ const wrappedEmit = (log) => {
788
+ let event = this._wrapEvent(runningEvent, log, listener);
789
+ // Try to emit the result for the parameterized event...
790
+ if (event.decodeError == null) {
791
+ try {
792
+ const args = runningEvent.getEmit(event);
793
+ this.emit(runningEvent.filter, ...args);
794
+ }
795
+ catch (error) {
796
+ event.decodeError = error.error;
797
+ }
798
+ }
799
+ // Always emit "event" for fragment-base events
800
+ if (runningEvent.filter != null) {
801
+ this.emit("event", event);
802
+ }
803
+ // Emit "error" if there was an error
804
+ if (event.decodeError != null) {
805
+ this.emit("error", event.decodeError, event);
806
+ }
807
+ };
808
+ this._wrappedEmits[runningEvent.tag] = wrappedEmit;
809
+ // Special events, like "error" do not have a filter
810
+ if (runningEvent.filter != null) {
811
+ this.provider.on(runningEvent.filter, wrappedEmit);
812
+ }
813
+ }
814
+ }
815
+ queryFilter(event, fromBlockOrBlockhash, toBlock) {
816
+ const runningEvent = this._getRunningEvent(event);
817
+ const filter = shallowCopy(runningEvent.filter);
818
+ if (typeof (fromBlockOrBlockhash) === "string" && isHexString(fromBlockOrBlockhash, 32)) {
819
+ if (toBlock != null) {
820
+ logger.throwArgumentError("cannot specify toBlock with blockhash", "toBlock", toBlock);
821
+ }
822
+ filter.blockHash = fromBlockOrBlockhash;
823
+ }
824
+ else {
825
+ filter.fromBlock = ((fromBlockOrBlockhash != null) ? fromBlockOrBlockhash : 0);
826
+ filter.toBlock = ((toBlock != null) ? toBlock : "latest");
827
+ }
828
+ return this.provider.getLogs(filter).then((logs) => {
829
+ return logs.map((log) => this._wrapEvent(runningEvent, log, null));
830
+ });
831
+ }
832
+ on(event, listener) {
833
+ this._addEventListener(this._getRunningEvent(event), listener, false);
834
+ return this;
835
+ }
836
+ once(event, listener) {
837
+ this._addEventListener(this._getRunningEvent(event), listener, true);
838
+ return this;
839
+ }
840
+ emit(eventName, ...args) {
841
+ if (!this.provider) {
842
+ return false;
843
+ }
844
+ const runningEvent = this._getRunningEvent(eventName);
845
+ const result = (runningEvent.run(args) > 0);
846
+ // May have drained all the "once" events; check for living events
847
+ this._checkRunningEvents(runningEvent);
848
+ return result;
849
+ }
850
+ listenerCount(eventName) {
851
+ if (!this.provider) {
852
+ return 0;
853
+ }
854
+ if (eventName == null) {
855
+ return Object.keys(this._runningEvents).reduce((accum, key) => {
856
+ return accum + this._runningEvents[key].listenerCount();
857
+ }, 0);
858
+ }
859
+ return this._getRunningEvent(eventName).listenerCount();
860
+ }
861
+ listeners(eventName) {
862
+ if (!this.provider) {
863
+ return [];
864
+ }
865
+ if (eventName == null) {
866
+ const result = [];
867
+ for (let tag in this._runningEvents) {
868
+ this._runningEvents[tag].listeners().forEach((listener) => {
869
+ result.push(listener);
870
+ });
871
+ }
872
+ return result;
873
+ }
874
+ return this._getRunningEvent(eventName).listeners();
875
+ }
876
+ removeAllListeners(eventName) {
877
+ if (!this.provider) {
878
+ return this;
879
+ }
880
+ if (eventName == null) {
881
+ for (const tag in this._runningEvents) {
882
+ const runningEvent = this._runningEvents[tag];
883
+ runningEvent.removeAllListeners();
884
+ this._checkRunningEvents(runningEvent);
885
+ }
886
+ return this;
887
+ }
888
+ // Delete any listeners
889
+ const runningEvent = this._getRunningEvent(eventName);
890
+ runningEvent.removeAllListeners();
891
+ this._checkRunningEvents(runningEvent);
892
+ return this;
893
+ }
894
+ off(eventName, listener) {
895
+ if (!this.provider) {
896
+ return this;
897
+ }
898
+ const runningEvent = this._getRunningEvent(eventName);
899
+ runningEvent.removeListener(listener);
900
+ this._checkRunningEvents(runningEvent);
901
+ return this;
902
+ }
903
+ removeListener(eventName, listener) {
904
+ return this.off(eventName, listener);
905
+ }
906
+ }
907
+ class Contract extends BaseContract {
908
+ }
909
+
28
910
  function staticMiddleEllipsis(_ref) {
29
911
  var text = _ref.text,
30
912
  _ref$leftSideLength = _ref.leftSideLength,
@@ -3061,4 +3943,9 @@ function BridgeWidget({ checkout, web3Provider, config, amount, tokenAddress, })
3061
3943
  }, onActionClick: updateToTransactionsPage, statusType: StatusType.FAILURE, onCloseClick: () => sendBridgeWidgetCloseEvent(eventTarget), testId: "claim-withdrawal-fail-view" })), viewState.view.type === SharedViews.SERVICE_UNAVAILABLE_ERROR_VIEW && (jsx(ServiceUnavailableErrorView, { service: ServiceType.GENERIC, onCloseClick: () => sendBridgeWidgetCloseEvent(eventTarget) }))] }) }) }));
3062
3944
  }
3063
3945
 
3064
- export { BridgeWidget as default };
3946
+ var BridgeWidget$1 = /*#__PURE__*/Object.freeze({
3947
+ __proto__: null,
3948
+ default: BridgeWidget
3949
+ });
3950
+
3951
+ export { BridgeWidget as B, Contract as C, BridgeWidget$1 as a };