@dappworks/kit 0.4.194 → 0.4.196

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/wallet.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { AIem } from './chunk-5JMONDHE.mjs';
1
+ import { AIem } from './chunk-PGHFBAHW.mjs';
2
2
  import './chunk-7MDKCI65.mjs';
3
3
  import { StorageState, ObjectPool, PromiseHook } from './chunk-SJ33JAK7.mjs';
4
4
  import './chunk-OISBIKAQ.mjs';
@@ -12,7 +12,7 @@ import './chunk-K7LFG5BA.mjs';
12
12
  import { __commonJS, __spreadValues, __spreadProps, __toESM } from './chunk-2EXDWOHY.mjs';
13
13
  import { getDefaultConfig, useConnectModal, RainbowKitProvider, darkTheme, lightTheme } from '@rainbow-me/rainbowkit';
14
14
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
15
- import React6, { useEffect, useState } from 'react';
15
+ import React5, { forwardRef, useEffect, useState, createElement } from 'react';
16
16
  import { useWalletClient, useAccount, useSwitchChain, useConnect, useDisconnect, WagmiProvider } from 'wagmi';
17
17
  import EventEmitter from 'events';
18
18
  import { encodeFunctionData, hashMessage, hashTypedData } from 'viem';
@@ -22,9 +22,9 @@ import { reaction } from 'mobx';
22
22
  import { iotex as iotex$1, iotexTestnet as iotexTestnet$1 } from 'viem/chains';
23
23
  import { Checkbox, Tooltip, Button, Popover, PopoverTrigger, PopoverContent, Input, Table, TableHeader, TableColumn, TableBody, TableRow, TableCell } from '@nextui-org/react';
24
24
 
25
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/utils.js
25
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/utils.js
26
26
  var require_utils = __commonJS({
27
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/utils.js"(exports) {
27
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/utils.js"(exports) {
28
28
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
29
29
  function adopt(value) {
30
30
  return value instanceof P ? value : new P(function(resolve) {
@@ -133,9 +133,9 @@ var require_utils = __commonJS({
133
133
  }
134
134
  });
135
135
 
136
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/endpoint.js
136
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/endpoint.js
137
137
  var require_endpoint = __commonJS({
138
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/endpoint.js"(exports) {
138
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/endpoint.js"(exports) {
139
139
  Object.defineProperty(exports, "__esModule", { value: true });
140
140
  exports.getEndpoint = exports.deleteEndpoint = exports.putEndpoint = exports.postEndpoint = void 0;
141
141
  var utils_1 = require_utils();
@@ -170,18 +170,18 @@ var require_endpoint = __commonJS({
170
170
  }
171
171
  });
172
172
 
173
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/config.js
173
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/config.js
174
174
  var require_config = __commonJS({
175
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/config.js"(exports) {
175
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/config.js"(exports) {
176
176
  Object.defineProperty(exports, "__esModule", { value: true });
177
177
  exports.DEFAULT_BASE_URL = void 0;
178
178
  exports.DEFAULT_BASE_URL = "https://safe-client.safe.global";
179
179
  }
180
180
  });
181
181
 
182
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-info.js
182
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-info.js
183
183
  var require_safe_info = __commonJS({
184
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-info.js"(exports) {
184
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-info.js"(exports) {
185
185
  Object.defineProperty(exports, "__esModule", { value: true });
186
186
  exports.ImplementationVersionState = void 0;
187
187
  (function(ImplementationVersionState2) {
@@ -192,9 +192,9 @@ var require_safe_info = __commonJS({
192
192
  }
193
193
  });
194
194
 
195
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-apps.js
195
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-apps.js
196
196
  var require_safe_apps = __commonJS({
197
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-apps.js"(exports) {
197
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-apps.js"(exports) {
198
198
  Object.defineProperty(exports, "__esModule", { value: true });
199
199
  exports.SafeAppSocialPlatforms = exports.SafeAppFeatures = exports.SafeAppAccessPolicyTypes = void 0;
200
200
  (function(SafeAppAccessPolicyTypes2) {
@@ -212,9 +212,9 @@ var require_safe_apps = __commonJS({
212
212
  }
213
213
  });
214
214
 
215
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/transactions.js
215
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/transactions.js
216
216
  var require_transactions = __commonJS({
217
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/transactions.js"(exports) {
217
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/transactions.js"(exports) {
218
218
  Object.defineProperty(exports, "__esModule", { value: true });
219
219
  exports.LabelValue = exports.StartTimeValue = exports.DurationType = exports.DetailedExecutionInfoType = exports.TransactionListItemType = exports.ConflictType = exports.TransactionInfoType = exports.SettingsInfoType = exports.TransactionTokenType = exports.TransferDirection = exports.TransactionStatus = exports.Operation = void 0;
220
220
  (function(Operation3) {
@@ -289,9 +289,9 @@ var require_transactions = __commonJS({
289
289
  }
290
290
  });
291
291
 
292
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/chains.js
292
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/chains.js
293
293
  var require_chains = __commonJS({
294
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/chains.js"(exports) {
294
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/chains.js"(exports) {
295
295
  Object.defineProperty(exports, "__esModule", { value: true });
296
296
  exports.FEATURES = exports.GAS_PRICE_TYPE = exports.RPC_AUTHENTICATION = void 0;
297
297
  (function(RPC_AUTHENTICATION2) {
@@ -319,9 +319,9 @@ var require_chains = __commonJS({
319
319
  }
320
320
  });
321
321
 
322
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/common.js
322
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/common.js
323
323
  var require_common = __commonJS({
324
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/common.js"(exports) {
324
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/common.js"(exports) {
325
325
  Object.defineProperty(exports, "__esModule", { value: true });
326
326
  exports.TokenType = void 0;
327
327
  (function(TokenType3) {
@@ -332,16 +332,16 @@ var require_common = __commonJS({
332
332
  }
333
333
  });
334
334
 
335
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/master-copies.js
335
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/master-copies.js
336
336
  var require_master_copies = __commonJS({
337
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/master-copies.js"(exports) {
337
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/master-copies.js"(exports) {
338
338
  Object.defineProperty(exports, "__esModule", { value: true });
339
339
  }
340
340
  });
341
341
 
342
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/decoded-data.js
342
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/decoded-data.js
343
343
  var require_decoded_data = __commonJS({
344
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/decoded-data.js"(exports) {
344
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/decoded-data.js"(exports) {
345
345
  Object.defineProperty(exports, "__esModule", { value: true });
346
346
  exports.ConfirmationViewTypes = void 0;
347
347
  (function(ConfirmationViewTypes2) {
@@ -351,9 +351,9 @@ var require_decoded_data = __commonJS({
351
351
  }
352
352
  });
353
353
 
354
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-messages.js
354
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-messages.js
355
355
  var require_safe_messages = __commonJS({
356
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-messages.js"(exports) {
356
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-messages.js"(exports) {
357
357
  Object.defineProperty(exports, "__esModule", { value: true });
358
358
  exports.SafeMessageStatus = exports.SafeMessageListItemType = void 0;
359
359
  (function(SafeMessageListItemType2) {
@@ -367,9 +367,9 @@ var require_safe_messages = __commonJS({
367
367
  }
368
368
  });
369
369
 
370
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/notifications.js
370
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/notifications.js
371
371
  var require_notifications = __commonJS({
372
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/notifications.js"(exports) {
372
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/notifications.js"(exports) {
373
373
  Object.defineProperty(exports, "__esModule", { value: true });
374
374
  exports.DeviceType = void 0;
375
375
  (function(DeviceType2) {
@@ -380,16 +380,16 @@ var require_notifications = __commonJS({
380
380
  }
381
381
  });
382
382
 
383
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/relay.js
383
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/relay.js
384
384
  var require_relay = __commonJS({
385
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/relay.js"(exports) {
385
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/relay.js"(exports) {
386
386
  Object.defineProperty(exports, "__esModule", { value: true });
387
387
  }
388
388
  });
389
389
 
390
- // ../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/index.js
390
+ // node_modules/@safe-global/safe-gateway-typescript-sdk/dist/index.js
391
391
  var require_dist = __commonJS({
392
- "../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/index.js"(exports) {
392
+ "node_modules/@safe-global/safe-gateway-typescript-sdk/dist/index.js"(exports) {
393
393
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
394
394
  if (k2 === void 0)
395
395
  k2 = k;
@@ -749,55 +749,6 @@ var require_dist = __commonJS({
749
749
  exports.putAccountDataSettings = putAccountDataSettings;
750
750
  }
751
751
  });
752
- var matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
753
- var stringToIcon = (value, validate, allowSimpleName, provider = "") => {
754
- const colonSeparated = value.split(":");
755
- if (value.slice(0, 1) === "@") {
756
- if (colonSeparated.length < 2 || colonSeparated.length > 3) {
757
- return null;
758
- }
759
- provider = colonSeparated.shift().slice(1);
760
- }
761
- if (colonSeparated.length > 3 || !colonSeparated.length) {
762
- return null;
763
- }
764
- if (colonSeparated.length > 1) {
765
- const name2 = colonSeparated.pop();
766
- const prefix = colonSeparated.pop();
767
- const result = {
768
- // Allow provider without '@': "provider:prefix:name"
769
- provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
770
- prefix,
771
- name: name2
772
- };
773
- return validate && !validateIconName(result) ? null : result;
774
- }
775
- const name = colonSeparated[0];
776
- const dashSeparated = name.split("-");
777
- if (dashSeparated.length > 1) {
778
- const result = {
779
- provider,
780
- prefix: dashSeparated.shift(),
781
- name: dashSeparated.join("-")
782
- };
783
- return validate && !validateIconName(result) ? null : result;
784
- }
785
- if (allowSimpleName && provider === "") {
786
- const result = {
787
- provider,
788
- prefix: "",
789
- name
790
- };
791
- return validate && !validateIconName(result, allowSimpleName) ? null : result;
792
- }
793
- return null;
794
- };
795
- var validateIconName = (icon, allowSimpleName) => {
796
- if (!icon) {
797
- return false;
798
- }
799
- return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
800
- };
801
752
  var defaultIconDimensions = Object.freeze(
802
753
  {
803
754
  left: 0,
@@ -901,6 +852,55 @@ function parseIconSet(data, callback) {
901
852
  }
902
853
  return names;
903
854
  }
855
+ var matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
856
+ var stringToIcon = (value, validate, allowSimpleName, provider = "") => {
857
+ const colonSeparated = value.split(":");
858
+ if (value.slice(0, 1) === "@") {
859
+ if (colonSeparated.length < 2 || colonSeparated.length > 3) {
860
+ return null;
861
+ }
862
+ provider = colonSeparated.shift().slice(1);
863
+ }
864
+ if (colonSeparated.length > 3 || !colonSeparated.length) {
865
+ return null;
866
+ }
867
+ if (colonSeparated.length > 1) {
868
+ const name2 = colonSeparated.pop();
869
+ const prefix = colonSeparated.pop();
870
+ const result = {
871
+ // Allow provider without '@': "provider:prefix:name"
872
+ provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
873
+ prefix,
874
+ name: name2
875
+ };
876
+ return validate && !validateIconName(result) ? null : result;
877
+ }
878
+ const name = colonSeparated[0];
879
+ const dashSeparated = name.split("-");
880
+ if (dashSeparated.length > 1) {
881
+ const result = {
882
+ provider,
883
+ prefix: dashSeparated.shift(),
884
+ name: dashSeparated.join("-")
885
+ };
886
+ return validate && !validateIconName(result) ? null : result;
887
+ }
888
+ if (allowSimpleName && provider === "") {
889
+ const result = {
890
+ provider,
891
+ prefix: "",
892
+ name
893
+ };
894
+ return validate && !validateIconName(result, allowSimpleName) ? null : result;
895
+ }
896
+ return null;
897
+ };
898
+ var validateIconName = (icon, allowSimpleName) => {
899
+ if (!icon) {
900
+ return false;
901
+ }
902
+ return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
903
+ };
904
904
  var optionalPropertyDefaults = __spreadValues({
905
905
  provider: "",
906
906
  aliases: {},
@@ -1079,6 +1079,34 @@ function calculateSize(size, ratio, precision) {
1079
1079
  isNumber = !isNumber;
1080
1080
  }
1081
1081
  }
1082
+ function splitSVGDefs(content, tag = "defs") {
1083
+ let defs = "";
1084
+ const index = content.indexOf("<" + tag);
1085
+ while (index >= 0) {
1086
+ const start = content.indexOf(">", index);
1087
+ const end = content.indexOf("</" + tag);
1088
+ if (start === -1 || end === -1) {
1089
+ break;
1090
+ }
1091
+ const endEnd = content.indexOf(">", end);
1092
+ if (endEnd === -1) {
1093
+ break;
1094
+ }
1095
+ defs += content.slice(start + 1, end).trim();
1096
+ content = content.slice(0, index).trim() + content.slice(endEnd + 1);
1097
+ }
1098
+ return {
1099
+ defs,
1100
+ content
1101
+ };
1102
+ }
1103
+ function mergeDefsAndContent(defs, content) {
1104
+ return defs ? "<defs>" + defs + "</defs>" + content : content;
1105
+ }
1106
+ function wrapSVGContent(body, start, end) {
1107
+ const split = splitSVGDefs(body);
1108
+ return mergeDefsAndContent(split.defs, start + split.content + end);
1109
+ }
1082
1110
  var isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
1083
1111
  function iconToSVG(icon, customisations) {
1084
1112
  const fullIcon = __spreadValues(__spreadValues({}, defaultIconProps), icon);
@@ -1149,7 +1177,11 @@ function iconToSVG(icon, customisations) {
1149
1177
  }
1150
1178
  }
1151
1179
  if (transformations.length) {
1152
- body = '<g transform="' + transformations.join(" ") + '">' + body + "</g>";
1180
+ body = wrapSVGContent(
1181
+ body,
1182
+ '<g transform="' + transformations.join(" ") + '">',
1183
+ "</g>"
1184
+ );
1153
1185
  }
1154
1186
  });
1155
1187
  const customisationsWidth = fullCustomisations.width;
@@ -1173,9 +1205,11 @@ function iconToSVG(icon, customisations) {
1173
1205
  };
1174
1206
  setAttr("width", width);
1175
1207
  setAttr("height", height);
1176
- attributes.viewBox = box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString();
1208
+ const viewBox = [box.left, box.top, boxWidth, boxHeight];
1209
+ attributes.viewBox = viewBox.join(" ");
1177
1210
  return {
1178
1211
  attributes,
1212
+ viewBox,
1179
1213
  body
1180
1214
  };
1181
1215
  }
@@ -1794,6 +1828,7 @@ var browserCacheCountKey = browserCachePrefix + "-count";
1794
1828
  var browserCacheVersionKey = browserCachePrefix + "-version";
1795
1829
  var browserStorageHour = 36e5;
1796
1830
  var browserStorageCacheExpiration = 168;
1831
+ var browserStorageLimit = 50;
1797
1832
  function getStoredItem(func, key) {
1798
1833
  try {
1799
1834
  return func.getItem(key);
@@ -1945,7 +1980,7 @@ function storeInBrowserStorage(storage2, data) {
1945
1980
  set.delete(index = Array.from(set).shift());
1946
1981
  } else {
1947
1982
  index = getBrowserStorageItemsCount(func);
1948
- if (!setBrowserStorageItemsCount(func, index + 1)) {
1983
+ if (index >= browserStorageLimit || !setBrowserStorageItemsCount(func, index + 1)) {
1949
1984
  return;
1950
1985
  }
1951
1986
  }
@@ -2222,15 +2257,29 @@ var inlineDefaults = __spreadProps(__spreadValues({}, defaultExtendedIconCustomi
2222
2257
  function fixSize(value) {
2223
2258
  return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
2224
2259
  }
2225
- var render = (icon, props, inline, ref) => {
2226
- const defaultProps = inline ? inlineDefaults : defaultExtendedIconCustomisations;
2260
+ var render = (icon, props, name) => {
2261
+ const defaultProps = props.inline ? inlineDefaults : defaultExtendedIconCustomisations;
2227
2262
  const customisations = mergeCustomisations(defaultProps, props);
2228
2263
  const mode = props.mode || "svg";
2229
2264
  const style = {};
2230
2265
  const customStyle = props.style || {};
2231
- const componentProps = __spreadProps(__spreadValues({}, mode === "svg" ? svgDefaults : {}), {
2232
- ref
2233
- });
2266
+ const componentProps = __spreadValues({}, mode === "svg" ? svgDefaults : {});
2267
+ if (name) {
2268
+ const iconName = stringToIcon(name, false, true);
2269
+ if (iconName) {
2270
+ const classNames = ["iconify"];
2271
+ const props2 = [
2272
+ "provider",
2273
+ "prefix"
2274
+ ];
2275
+ for (const prop of props2) {
2276
+ if (iconName[prop]) {
2277
+ classNames.push("iconify--" + iconName[prop]);
2278
+ }
2279
+ }
2280
+ componentProps.className = classNames.join(" ");
2281
+ }
2282
+ }
2234
2283
  for (let key in props) {
2235
2284
  const value = props[key];
2236
2285
  if (value === void 0) {
@@ -2242,8 +2291,13 @@ var render = (icon, props, inline, ref) => {
2242
2291
  case "children":
2243
2292
  case "onLoad":
2244
2293
  case "mode":
2294
+ case "ssr":
2295
+ break;
2245
2296
  case "_ref":
2246
- case "_inline":
2297
+ componentProps.ref = value;
2298
+ break;
2299
+ case "className":
2300
+ componentProps[key] = (componentProps[key] ? componentProps[key] + " " : "") + value;
2247
2301
  break;
2248
2302
  case "inline":
2249
2303
  case "hFlip":
@@ -2293,7 +2347,7 @@ var render = (icon, props, inline, ref) => {
2293
2347
  componentProps.dangerouslySetInnerHTML = {
2294
2348
  __html: cleanUpInnerHTML(replaceIDs(item.body, id ? () => id + "ID" + localCounter++ : "iconifyReact"))
2295
2349
  };
2296
- return React6.createElement("svg", componentProps);
2350
+ return createElement("svg", componentProps);
2297
2351
  }
2298
2352
  const { body, width, height } = icon;
2299
2353
  const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
@@ -2306,7 +2360,7 @@ var render = (icon, props, inline, ref) => {
2306
2360
  "width": fixSize(renderAttribs.width),
2307
2361
  "height": fixSize(renderAttribs.height)
2308
2362
  }), commonProps), useMask ? monotoneProps : coloredProps), customStyle);
2309
- return React6.createElement("span", componentProps);
2363
+ return createElement("span", componentProps);
2310
2364
  };
2311
2365
  allowSimpleNames(true);
2312
2366
  setAPIModule("", fetchAPIModule);
@@ -2353,141 +2407,93 @@ if (typeof document !== "undefined" && typeof window !== "undefined") {
2353
2407
  }
2354
2408
  }
2355
2409
  }
2356
- var IconComponent = class extends React6.Component {
2357
- constructor(props) {
2358
- super(props);
2359
- this.state = {
2360
- // Render placeholder before component is mounted
2361
- icon: null
2410
+ function IconComponent(props) {
2411
+ const [mounted, setMounted] = useState(!!props.ssr);
2412
+ const [abort, setAbort] = useState({});
2413
+ function getInitialState(mounted2) {
2414
+ if (mounted2) {
2415
+ const name2 = props.icon;
2416
+ if (typeof name2 === "object") {
2417
+ return {
2418
+ name: "",
2419
+ data: name2
2420
+ };
2421
+ }
2422
+ const data2 = getIconData(name2);
2423
+ if (data2) {
2424
+ return {
2425
+ name: name2,
2426
+ data: data2
2427
+ };
2428
+ }
2429
+ }
2430
+ return {
2431
+ name: ""
2362
2432
  };
2363
2433
  }
2364
- /**
2365
- * Abort loading icon
2366
- */
2367
- _abortLoading() {
2368
- if (this._loading) {
2369
- this._loading.abort();
2370
- this._loading = null;
2371
- }
2372
- }
2373
- /**
2374
- * Update state
2375
- */
2376
- _setData(icon) {
2377
- if (this.state.icon !== icon) {
2378
- this.setState({
2379
- icon
2380
- });
2434
+ const [state, setState] = useState(getInitialState(!!props.ssr));
2435
+ function cleanup() {
2436
+ const callback = abort.callback;
2437
+ if (callback) {
2438
+ callback();
2439
+ setAbort({});
2381
2440
  }
2382
2441
  }
2383
- /**
2384
- * Check if icon should be loaded
2385
- */
2386
- _checkIcon(changed) {
2387
- const state = this.state;
2388
- const icon = this.props.icon;
2389
- if (typeof icon === "object" && icon !== null && typeof icon.body === "string") {
2390
- this._icon = "";
2391
- this._abortLoading();
2392
- if (changed || state.icon === null) {
2393
- this._setData({
2394
- data: icon
2395
- });
2396
- }
2397
- return;
2398
- }
2399
- let iconName;
2400
- if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) {
2401
- this._abortLoading();
2402
- this._setData(null);
2403
- return;
2442
+ function changeState(newState) {
2443
+ if (JSON.stringify(state) !== JSON.stringify(newState)) {
2444
+ cleanup();
2445
+ setState(newState);
2446
+ return true;
2404
2447
  }
2405
- const data = getIconData(iconName);
2406
- if (!data) {
2407
- if (!this._loading || this._loading.name !== icon) {
2408
- this._abortLoading();
2409
- this._icon = "";
2410
- this._setData(null);
2411
- if (data !== null) {
2412
- this._loading = {
2413
- name: icon,
2414
- abort: loadIcons([iconName], this._checkIcon.bind(this, false))
2415
- };
2416
- }
2417
- }
2448
+ }
2449
+ function updateState() {
2450
+ var _a;
2451
+ const name2 = props.icon;
2452
+ if (typeof name2 === "object") {
2453
+ changeState({
2454
+ name: "",
2455
+ data: name2
2456
+ });
2418
2457
  return;
2419
2458
  }
2420
- if (this._icon !== icon || state.icon === null) {
2421
- this._abortLoading();
2422
- this._icon = icon;
2423
- const classes = ["iconify"];
2424
- if (iconName.prefix !== "") {
2425
- classes.push("iconify--" + iconName.prefix);
2426
- }
2427
- if (iconName.provider !== "") {
2428
- classes.push("iconify--" + iconName.provider);
2429
- }
2430
- this._setData({
2431
- data,
2432
- classes
2433
- });
2434
- if (this.props.onLoad) {
2435
- this.props.onLoad(icon);
2459
+ const data2 = getIconData(name2);
2460
+ if (changeState({
2461
+ name: name2,
2462
+ data: data2
2463
+ })) {
2464
+ if (data2 === void 0) {
2465
+ const callback = loadIcons([name2], updateState);
2466
+ setAbort({
2467
+ callback
2468
+ });
2469
+ } else if (data2) {
2470
+ (_a = props.onLoad) === null || _a === void 0 ? void 0 : _a.call(props, name2);
2436
2471
  }
2437
2472
  }
2438
2473
  }
2439
- /**
2440
- * Component mounted
2441
- */
2442
- componentDidMount() {
2443
- this._checkIcon(false);
2444
- }
2445
- /**
2446
- * Component updated
2447
- */
2448
- componentDidUpdate(oldProps) {
2449
- if (oldProps.icon !== this.props.icon) {
2450
- this._checkIcon(true);
2451
- }
2452
- }
2453
- /**
2454
- * Abort loading
2455
- */
2456
- componentWillUnmount() {
2457
- this._abortLoading();
2458
- }
2459
- /**
2460
- * Render
2461
- */
2462
- render() {
2463
- const props = this.props;
2464
- const icon = this.state.icon;
2465
- if (icon === null) {
2466
- return props.children ? props.children : React6.createElement("span", {});
2467
- }
2468
- let newProps = props;
2469
- if (icon.classes) {
2470
- newProps = __spreadProps(__spreadValues({}, props), {
2471
- className: (typeof props.className === "string" ? props.className + " " : "") + icon.classes.join(" ")
2472
- });
2474
+ useEffect(() => {
2475
+ setMounted(true);
2476
+ return cleanup;
2477
+ }, []);
2478
+ useEffect(() => {
2479
+ if (mounted) {
2480
+ updateState();
2473
2481
  }
2474
- return render(__spreadValues(__spreadValues({}, defaultIconProps), icon.data), newProps, props._inline, props._ref);
2482
+ }, [props.icon, mounted]);
2483
+ const { name, data } = state;
2484
+ if (!data) {
2485
+ return props.children ? props.children : createElement("span", {});
2475
2486
  }
2476
- };
2477
- var Icon = React6.forwardRef(function Icon2(props, ref) {
2478
- const newProps = __spreadProps(__spreadValues({}, props), {
2479
- _ref: ref,
2480
- _inline: false
2481
- });
2482
- return React6.createElement(IconComponent, newProps);
2483
- });
2484
- React6.forwardRef(function InlineIcon2(props, ref) {
2485
- const newProps = __spreadProps(__spreadValues({}, props), {
2486
- _ref: ref,
2487
- _inline: true
2488
- });
2489
- return React6.createElement(IconComponent, newProps);
2490
- });
2487
+ return render(__spreadValues(__spreadValues({}, defaultIconProps), data), props, name);
2488
+ }
2489
+ var Icon = forwardRef((props, ref) => IconComponent(__spreadProps(__spreadValues({}, props), {
2490
+ _ref: ref
2491
+ })));
2492
+ forwardRef((props, ref) => IconComponent(__spreadProps(__spreadValues({
2493
+ inline: true
2494
+ }, props), {
2495
+ _ref: ref
2496
+ })));
2491
2497
 
2492
2498
  // module/Wallet/walletPluginStore.tsx
2493
2499
  var defaultRPCList = [
@@ -2613,15 +2619,15 @@ var WalletRpcStore = class {
2613
2619
  }
2614
2620
  scoreIcon(score) {
2615
2621
  if (score < 0) {
2616
- return /* @__PURE__ */ React6.createElement(Icon, { icon: "codicon:error", width: "18", height: "18", style: { color: "#FF0000" } });
2622
+ return /* @__PURE__ */ React5.createElement(Icon, { icon: "codicon:error", width: "18", height: "18", style: { color: "#FF0000" } });
2617
2623
  }
2618
2624
  if (score < 1) {
2619
- return /* @__PURE__ */ React6.createElement(Icon, { icon: "icon-park-solid:check-one", width: "18", height: "18", style: { color: "#289726" } });
2625
+ return /* @__PURE__ */ React5.createElement(Icon, { icon: "icon-park-solid:check-one", width: "18", height: "18", style: { color: "#289726" } });
2620
2626
  }
2621
2627
  if (score < 2) {
2622
- return /* @__PURE__ */ React6.createElement(Icon, { icon: "bxs:error", width: "18", height: "18", style: { color: "#FFA500" } });
2628
+ return /* @__PURE__ */ React5.createElement(Icon, { icon: "bxs:error", width: "18", height: "18", style: { color: "#FFA500" } });
2623
2629
  }
2624
- return /* @__PURE__ */ React6.createElement(Icon, { icon: "codicon:error", width: "18", height: "18", style: { color: "#FF0000" } });
2630
+ return /* @__PURE__ */ React5.createElement(Icon, { icon: "codicon:error", width: "18", height: "18", style: { color: "#FF0000" } });
2625
2631
  }
2626
2632
  get wallet() {
2627
2633
  return RootStore.Get(WalletStore);
@@ -2686,10 +2692,10 @@ var WalletHistoryStore = class {
2686
2692
  }
2687
2693
  };
2688
2694
 
2689
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/version.js
2695
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/version.js
2690
2696
  var getSDKVersion = () => "9.1.0";
2691
2697
 
2692
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/communication/utils.js
2698
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/communication/utils.js
2693
2699
  var dec2hex = (dec) => dec.toString(16).padStart(2, "0");
2694
2700
  var generateId = (len) => {
2695
2701
  const arr = new Uint8Array((len) / 2);
@@ -2703,7 +2709,7 @@ var generateRequestId = () => {
2703
2709
  return (/* @__PURE__ */ new Date()).getTime().toString(36);
2704
2710
  };
2705
2711
 
2706
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/communication/messageFormatter.js
2712
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/communication/messageFormatter.js
2707
2713
  var MessageFormatter = class {
2708
2714
  };
2709
2715
  MessageFormatter.makeRequest = (method, params) => {
@@ -2730,7 +2736,7 @@ MessageFormatter.makeErrorResponse = (id, error, version) => ({
2730
2736
  version
2731
2737
  });
2732
2738
 
2733
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/communication/methods.js
2739
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/communication/methods.js
2734
2740
  var Methods;
2735
2741
  (function(Methods2) {
2736
2742
  Methods2["sendTransactions"] = "sendTransactions";
@@ -2752,7 +2758,7 @@ var RestrictedMethods;
2752
2758
  RestrictedMethods2["requestAddressBook"] = "requestAddressBook";
2753
2759
  })(RestrictedMethods || (RestrictedMethods = {}));
2754
2760
 
2755
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/communication/index.js
2761
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/communication/index.js
2756
2762
  var PostMessageCommunicator = class {
2757
2763
  constructor(allowedOrigins = null, debugMode = false) {
2758
2764
  this.allowedOrigins = null;
@@ -2812,15 +2818,15 @@ var PostMessageCommunicator = class {
2812
2818
  };
2813
2819
  var communication_default = PostMessageCommunicator;
2814
2820
 
2815
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/types/sdk.js
2821
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/types/sdk.js
2816
2822
  var isObjectEIP712TypedData = (obj) => {
2817
2823
  return typeof obj === "object" && obj != null && "domain" in obj && "types" in obj && "message" in obj;
2818
2824
  };
2819
2825
 
2820
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/types/gateway.js
2826
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/types/gateway.js
2821
2827
  var import_safe_gateway_typescript_sdk = __toESM(require_dist(), 1);
2822
2828
 
2823
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/txs/index.js
2829
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/txs/index.js
2824
2830
  var TXs = class {
2825
2831
  constructor(communicator) {
2826
2832
  this.communicator = communicator;
@@ -2859,7 +2865,7 @@ var TXs = class {
2859
2865
  }
2860
2866
  };
2861
2867
 
2862
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/eth/constants.js
2868
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/eth/constants.js
2863
2869
  var RPC_CALLS = {
2864
2870
  eth_call: "eth_call",
2865
2871
  eth_gasPrice: "eth_gasPrice",
@@ -2876,7 +2882,7 @@ var RPC_CALLS = {
2876
2882
  safe_setSettings: "safe_setSettings"
2877
2883
  };
2878
2884
 
2879
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/eth/index.js
2885
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/eth/index.js
2880
2886
  var inputFormatters = {
2881
2887
  defaultBlockParam: (arg = "latest") => arg,
2882
2888
  returnFullTxObjectParam: (arg = false) => arg,
@@ -2952,11 +2958,11 @@ var Eth = class {
2952
2958
  }
2953
2959
  };
2954
2960
 
2955
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/safe/signatures.js
2961
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/safe/signatures.js
2956
2962
  var MAGIC_VALUE = "0x1626ba7e";
2957
2963
  var MAGIC_VALUE_BYTES = "0x20c13b0b";
2958
2964
 
2959
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/types/permissions.js
2965
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/types/permissions.js
2960
2966
  var PERMISSIONS_REQUEST_REJECTED = 4001;
2961
2967
  var PermissionsError = class _PermissionsError extends Error {
2962
2968
  constructor(message, code, data) {
@@ -2967,7 +2973,7 @@ var PermissionsError = class _PermissionsError extends Error {
2967
2973
  }
2968
2974
  };
2969
2975
 
2970
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/wallet/index.js
2976
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/wallet/index.js
2971
2977
  var Wallet = class {
2972
2978
  constructor(communicator) {
2973
2979
  this.communicator = communicator;
@@ -3002,7 +3008,7 @@ var Wallet = class {
3002
3008
  }
3003
3009
  };
3004
3010
 
3005
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/decorators/requirePermissions.js
3011
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/decorators/requirePermissions.js
3006
3012
  var hasPermission = (required, permissions) => permissions.some((permission) => permission.parentCapability === required);
3007
3013
  var requirePermission = () => (_, propertyKey, descriptor) => {
3008
3014
  const originalMethod = descriptor.value;
@@ -3021,7 +3027,7 @@ var requirePermission = () => (_, propertyKey, descriptor) => {
3021
3027
  };
3022
3028
  var requirePermissions_default = requirePermission;
3023
3029
 
3024
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/safe/index.js
3030
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/safe/index.js
3025
3031
  var __decorate = function(decorators, target, key, desc) {
3026
3032
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3027
3033
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -3220,7 +3226,7 @@ __decorate([
3220
3226
  requirePermissions_default()
3221
3227
  ], Safe.prototype, "requestAddressBook", null);
3222
3228
 
3223
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/sdk.js
3229
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/sdk.js
3224
3230
  var SafeAppsSDK = class {
3225
3231
  constructor(opts = {}) {
3226
3232
  const { allowedDomains = null, debug = false } = opts;
@@ -3233,23 +3239,23 @@ var SafeAppsSDK = class {
3233
3239
  };
3234
3240
  var sdk_default = SafeAppsSDK;
3235
3241
 
3236
- // ../../node_modules/@safe-global/safe-apps-sdk/dist/esm/index.js
3242
+ // node_modules/@safe-global/safe-apps-sdk/dist/esm/index.js
3237
3243
  var esm_default = sdk_default;
3238
3244
  var SuccessTxDialog = observer((props) => {
3239
- return /* @__PURE__ */ React6.createElement("div", { className: "flex-col gap-4 py-10" }, /* @__PURE__ */ React6.createElement("div", { className: "w-full flex items-center justify-center" }, /* @__PURE__ */ React6.createElement(Icon, { icon: "icon-park-solid:check-one", width: "48", height: "48", className: "text-green-500" })), /* @__PURE__ */ React6.createElement("div", { className: "text-2xl font-[900] text-center mt-4" }, props.msg), /* @__PURE__ */ React6.createElement(
3245
+ return /* @__PURE__ */ React5.createElement("div", { className: "flex-col gap-4 py-10" }, /* @__PURE__ */ React5.createElement("div", { className: "w-full flex items-center justify-center" }, /* @__PURE__ */ React5.createElement(Icon, { icon: "icon-park-solid:check-one", width: "48", height: "48", className: "text-green-500" })), /* @__PURE__ */ React5.createElement("div", { className: "text-2xl font-[900] text-center mt-4" }, props.msg), /* @__PURE__ */ React5.createElement(
3240
3246
  "div",
3241
3247
  {
3242
3248
  className: "flex items-center justify-center text-green-500 text-sm mt-6 gap-2 cursor-pointer hover:text-green-600 transition",
3243
3249
  onClick: (e) => window.open(`https://iotexscan.io/tx/${props.hash}`, "_blank")
3244
3250
  },
3245
3251
  "View on IoTeXScan ",
3246
- /* @__PURE__ */ React6.createElement(Icon, { icon: "material-symbols:chip-extraction-rounded", width: "18", height: "18" })
3252
+ /* @__PURE__ */ React5.createElement(Icon, { icon: "material-symbols:chip-extraction-rounded", width: "18", height: "18" })
3247
3253
  ));
3248
3254
  });
3249
3255
  var ShowSuccessTxDialog = ({ msg, hash }) => {
3250
3256
  RootStore.Get(DialogStore).setData({
3251
3257
  title: "",
3252
- content: /* @__PURE__ */ React6.createElement(SuccessTxDialog, { msg, hash }),
3258
+ content: /* @__PURE__ */ React5.createElement(SuccessTxDialog, { msg, hash }),
3253
3259
  isOpen: true
3254
3260
  });
3255
3261
  };
@@ -3405,13 +3411,16 @@ var WalletStore = class _WalletStore {
3405
3411
  return { account };
3406
3412
  }
3407
3413
  async prepare(chainId) {
3408
- const promise = new Promise(async (res, rej) => {
3414
+ return new Promise(async (res, rej) => {
3409
3415
  var _a, _b;
3410
3416
  try {
3411
3417
  if (this.account) {
3418
+ if (!chainId) {
3419
+ res(this);
3420
+ }
3412
3421
  if (Number((_a = this.chain) == null ? void 0 : _a.id) == Number(chainId)) {
3413
- res();
3414
- return;
3422
+ console.log("has and return ");
3423
+ res(this);
3415
3424
  }
3416
3425
  (_b = this.switchChain) == null ? void 0 : _b.call(this, { chainId: chainId != null ? chainId : 4689 });
3417
3426
  const interval = setInterval(() => {
@@ -3419,10 +3428,10 @@ var WalletStore = class _WalletStore {
3419
3428
  if (this.switchChain) {
3420
3429
  if (((_a2 = this.chain) == null ? void 0 : _a2.id) == chainId) {
3421
3430
  try {
3431
+ res(this);
3422
3432
  } catch (error) {
3423
3433
  }
3424
3434
  clearInterval(interval);
3425
- res();
3426
3435
  }
3427
3436
  }
3428
3437
  }, 1e3);
@@ -3431,7 +3440,7 @@ var WalletStore = class _WalletStore {
3431
3440
  const interval = setInterval(() => {
3432
3441
  if (this.account) {
3433
3442
  clearInterval(interval);
3434
- res();
3443
+ res(this);
3435
3444
  }
3436
3445
  }, 1e3);
3437
3446
  }
@@ -3439,8 +3448,6 @@ var WalletStore = class _WalletStore {
3439
3448
  rej(error);
3440
3449
  }
3441
3450
  });
3442
- await promise;
3443
- return this;
3444
3451
  }
3445
3452
  async waitForTransactionReceipt({ hash }) {
3446
3453
  if (this.isInSafeApp) {
@@ -3661,13 +3668,13 @@ var WalletProvider = ({
3661
3668
  }, [appName]);
3662
3669
  return (
3663
3670
  //@ts-ignore
3664
- /* @__PURE__ */ React6.createElement(WagmiProvider, { config, reconnectOnMount: true }, /* @__PURE__ */ React6.createElement(QueryClientProvider, { client: queryClient }, /* @__PURE__ */ React6.createElement(RainbowKitProvider, { locale: "en", theme: theme == "dark" ? darkTheme() : lightTheme() }, children, /* @__PURE__ */ React6.createElement(WalletConnect, null))))
3671
+ /* @__PURE__ */ React5.createElement(WagmiProvider, { config, reconnectOnMount: true }, /* @__PURE__ */ React5.createElement(QueryClientProvider, { client: queryClient }, /* @__PURE__ */ React5.createElement(RainbowKitProvider, { locale: "en", theme: theme == "dark" ? darkTheme() : lightTheme() }, children, /* @__PURE__ */ React5.createElement(WalletConnect, null))))
3665
3672
  );
3666
3673
  };
3667
3674
  var WalletConnect = () => {
3668
3675
  const wallet = RootStore.Get(WalletStore);
3669
3676
  wallet.use();
3670
- return /* @__PURE__ */ React6.createElement(React6.Fragment, null);
3677
+ return /* @__PURE__ */ React5.createElement(React5.Fragment, null);
3671
3678
  };
3672
3679
  var RpcList = observer(() => {
3673
3680
  var _a, _b;
@@ -3676,9 +3683,9 @@ var RpcList = observer(() => {
3676
3683
  useEffect(() => {
3677
3684
  rpcStore.testRpc();
3678
3685
  }, []);
3679
- return /* @__PURE__ */ React6.createElement("div", { className: "mb-3 mt-4" }, /* @__PURE__ */ React6.createElement("div", { className: "w-full flex mb-2 mt-2" }, /* @__PURE__ */ React6.createElement("div", { className: "flex items-center justify-center gap-2" }, /* @__PURE__ */ React6.createElement(Checkbox, { size: "sm", isSelected: rpcStore.isAutoSelectRpc.value, onValueChange: (e) => rpcStore.isAutoSelectRpc.save(e) }, "Auto select rpc"), /* @__PURE__ */ React6.createElement(Tooltip, { content: /* @__PURE__ */ React6.createElement("div", { className: "w-[300px]" }, "Once selected, if the current RPC cannot send a request, an available RPC will be automatically chosen.") }, /* @__PURE__ */ React6.createElement(Icon, { icon: "ph:question", width: "18", height: "18", className: "text-gray-500" }))), /* @__PURE__ */ React6.createElement(Button, { startContent: /* @__PURE__ */ React6.createElement(Icon, { icon: "tabler:test-pipe", width: "18", height: "18" }), className: "ml-auto", onClick: (e) => {
3686
+ return /* @__PURE__ */ React5.createElement("div", { className: "mb-3 mt-4" }, /* @__PURE__ */ React5.createElement("div", { className: "w-full flex mb-2 mt-2" }, /* @__PURE__ */ React5.createElement("div", { className: "flex items-center justify-center gap-2" }, /* @__PURE__ */ React5.createElement(Checkbox, { size: "sm", isSelected: rpcStore.isAutoSelectRpc.value, onValueChange: (e) => rpcStore.isAutoSelectRpc.save(e) }, "Auto select rpc"), /* @__PURE__ */ React5.createElement(Tooltip, { content: /* @__PURE__ */ React5.createElement("div", { className: "w-[300px]" }, "Once selected, if the current RPC cannot send a request, an available RPC will be automatically chosen.") }, /* @__PURE__ */ React5.createElement(Icon, { icon: "ph:question", width: "18", height: "18", className: "text-gray-500" }))), /* @__PURE__ */ React5.createElement(Button, { startContent: /* @__PURE__ */ React5.createElement(Icon, { icon: "tabler:test-pipe", width: "18", height: "18" }), className: "ml-auto", onClick: (e) => {
3680
3687
  rpcStore.testRpc();
3681
- } }, "Test"), /* @__PURE__ */ React6.createElement(Popover, { placement: "bottom", offset: 20, showArrow: true, isOpen: rpcStore.showCustomRpc, onOpenChange: (open) => rpcStore.showCustomRpc = open }, /* @__PURE__ */ React6.createElement(PopoverTrigger, null, /* @__PURE__ */ React6.createElement(Button, { color: "primary", startContent: /* @__PURE__ */ React6.createElement(Icon, { icon: "basil:add-solid", width: "18", height: "18" }), className: "ml-4" }, "Add custom rpc")), /* @__PURE__ */ React6.createElement(PopoverContent, null, /* @__PURE__ */ React6.createElement("div", { className: "px-1 py-2" }, /* @__PURE__ */ React6.createElement(
3688
+ } }, "Test"), /* @__PURE__ */ React5.createElement(Popover, { placement: "bottom", offset: 20, showArrow: true, isOpen: rpcStore.showCustomRpc, onOpenChange: (open) => rpcStore.showCustomRpc = open }, /* @__PURE__ */ React5.createElement(PopoverTrigger, null, /* @__PURE__ */ React5.createElement(Button, { color: "primary", startContent: /* @__PURE__ */ React5.createElement(Icon, { icon: "basil:add-solid", width: "18", height: "18" }), className: "ml-4" }, "Add custom rpc")), /* @__PURE__ */ React5.createElement(PopoverContent, null, /* @__PURE__ */ React5.createElement("div", { className: "px-1 py-2" }, /* @__PURE__ */ React5.createElement(
3682
3689
  Input,
3683
3690
  {
3684
3691
  type: "url",
@@ -3689,7 +3696,7 @@ var RpcList = observer(() => {
3689
3696
  rpcStore.customRpc = value;
3690
3697
  }
3691
3698
  }
3692
- ), /* @__PURE__ */ React6.createElement(Button, { color: "primary", isDisabled: !rpcStore.customRpc, onClick: (e) => rpcStore.addCustomRpc() }, "Save"))))), /* @__PURE__ */ React6.createElement(
3699
+ ), /* @__PURE__ */ React5.createElement(Button, { color: "primary", isDisabled: !rpcStore.customRpc, onClick: (e) => rpcStore.addCustomRpc() }, "Save"))))), /* @__PURE__ */ React5.createElement(
3693
3700
  Table,
3694
3701
  {
3695
3702
  color: "success",
@@ -3697,18 +3704,18 @@ var RpcList = observer(() => {
3697
3704
  defaultSelectedKeys: [rpcStore.curRpc.value],
3698
3705
  "aria-label": "Example static collection table"
3699
3706
  },
3700
- /* @__PURE__ */ React6.createElement(TableHeader, null, /* @__PURE__ */ React6.createElement(TableColumn, null, "RPC Server Address"), /* @__PURE__ */ React6.createElement(TableColumn, { align: "center" }, "Score"), /* @__PURE__ */ React6.createElement(TableColumn, { align: "center" }, "Height"), /* @__PURE__ */ React6.createElement(TableColumn, { align: "center" }, "Latency"), /* @__PURE__ */ React6.createElement(TableColumn, { align: "center" }, "Action")),
3701
- /* @__PURE__ */ React6.createElement(TableBody, null, (_b = (_a = rpcStore.rpcList) == null ? void 0 : _a.value) == null ? void 0 : _b.map((item, index) => {
3702
- return /* @__PURE__ */ React6.createElement(TableRow, { className: "cursor-pointer", key: item.name, onClick: (e) => {
3707
+ /* @__PURE__ */ React5.createElement(TableHeader, null, /* @__PURE__ */ React5.createElement(TableColumn, null, "RPC Server Address"), /* @__PURE__ */ React5.createElement(TableColumn, { align: "center" }, "Score"), /* @__PURE__ */ React5.createElement(TableColumn, { align: "center" }, "Height"), /* @__PURE__ */ React5.createElement(TableColumn, { align: "center" }, "Latency"), /* @__PURE__ */ React5.createElement(TableColumn, { align: "center" }, "Action")),
3708
+ /* @__PURE__ */ React5.createElement(TableBody, null, (_b = (_a = rpcStore.rpcList) == null ? void 0 : _a.value) == null ? void 0 : _b.map((item, index) => {
3709
+ return /* @__PURE__ */ React5.createElement(TableRow, { className: "cursor-pointer", key: item.name, onClick: (e) => {
3703
3710
  rpcStore.curRpc.save(item.name);
3704
3711
  RootStore.Get(ToastPlugin).success("Set rpc success");
3705
- } }, /* @__PURE__ */ React6.createElement(TableCell, null, item.name), /* @__PURE__ */ React6.createElement(TableCell, null, rpcStore.scoreIcon(item.latency)), /* @__PURE__ */ React6.createElement(TableCell, null, item.height), /* @__PURE__ */ React6.createElement(TableCell, { className: rpcStore.latencyColor(item.latency) }, item.latency, "s"), /* @__PURE__ */ React6.createElement(TableCell, null, /* @__PURE__ */ React6.createElement("div", { className: "relative flex items-center gap-2" }, /* @__PURE__ */ React6.createElement(Tooltip, { content: "Add to metamask" }, /* @__PURE__ */ React6.createElement("span", { className: "text-lg text-danger cursor-pointer active:opacity-50", onClick: (e) => {
3712
+ } }, /* @__PURE__ */ React5.createElement(TableCell, null, item.name), /* @__PURE__ */ React5.createElement(TableCell, null, rpcStore.scoreIcon(item.latency)), /* @__PURE__ */ React5.createElement(TableCell, null, item.height), /* @__PURE__ */ React5.createElement(TableCell, { className: rpcStore.latencyColor(item.latency) }, item.latency, "s"), /* @__PURE__ */ React5.createElement(TableCell, null, /* @__PURE__ */ React5.createElement("div", { className: "relative flex items-center gap-2" }, /* @__PURE__ */ React5.createElement(Tooltip, { content: "Add to metamask" }, /* @__PURE__ */ React5.createElement("span", { className: "text-lg text-danger cursor-pointer active:opacity-50", onClick: (e) => {
3706
3713
  e.stopPropagation();
3707
3714
  rpcStore.addToMetamask(item.name);
3708
- } }, /* @__PURE__ */ React6.createElement(Icon, { icon: "logos:metamask-icon", width: "18", height: "18" }))), item.custom && /* @__PURE__ */ React6.createElement(Tooltip, { content: "Remove" }, /* @__PURE__ */ React6.createElement("span", { className: "text-lg text-danger cursor-pointer active:opacity-50", onClick: (e) => {
3715
+ } }, /* @__PURE__ */ React5.createElement(Icon, { icon: "logos:metamask-icon", width: "18", height: "18" }))), item.custom && /* @__PURE__ */ React5.createElement(Tooltip, { content: "Remove" }, /* @__PURE__ */ React5.createElement("span", { className: "text-lg text-danger cursor-pointer active:opacity-50", onClick: (e) => {
3709
3716
  e.stopPropagation();
3710
3717
  rpcStore.removeRpc(item.name);
3711
- } }, /* @__PURE__ */ React6.createElement(Icon, { icon: "solar:trash-bin-minimalistic-broken", width: "20", height: "20" }))))));
3718
+ } }, /* @__PURE__ */ React5.createElement(Icon, { icon: "solar:trash-bin-minimalistic-broken", width: "20", height: "20" }))))));
3712
3719
  }))
3713
3720
  ));
3714
3721
  });