@suilend/sui-fe-next 0.1.63 → 0.1.64
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/contexts/WalletContext.d.ts +11 -2
- package/contexts/WalletContext.jsx +108 -47
- package/lib/connector.d.ts +3 -0
- package/lib/connector.js +78 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -2,11 +2,18 @@ import { Dispatch, PropsWithChildren, SetStateAction } from "react";
|
|
|
2
2
|
import { DevInspectResults, SuiTransactionBlockResponse } from "@mysten/sui/client";
|
|
3
3
|
import { SignatureWithBytes } from "@mysten/sui/cryptography";
|
|
4
4
|
import { Transaction } from "@mysten/sui/transactions";
|
|
5
|
-
import {
|
|
5
|
+
import { IdentifierArray, WalletIcon, WalletWithRequiredFeatures } from "@mysten/wallet-standard";
|
|
6
6
|
export declare enum WalletType {
|
|
7
7
|
EXTENSION = "extension",
|
|
8
8
|
WEB = "web"
|
|
9
9
|
}
|
|
10
|
+
export type WalletAccount = {
|
|
11
|
+
address: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
icon?: WalletIcon;
|
|
14
|
+
chains: IdentifierArray;
|
|
15
|
+
features: IdentifierArray;
|
|
16
|
+
};
|
|
10
17
|
type WalletPlatform = "iOS" | "android" | "extension";
|
|
11
18
|
export type Wallet = {
|
|
12
19
|
name: string;
|
|
@@ -37,7 +44,9 @@ export interface WalletContext {
|
|
|
37
44
|
setIsConnectWalletDropdownOpen: Dispatch<SetStateAction<boolean>>;
|
|
38
45
|
wallets: Wallet[];
|
|
39
46
|
wallet?: Wallet;
|
|
40
|
-
connectWallet: (wallet: Wallet
|
|
47
|
+
connectWallet: (wallet: Wallet & {
|
|
48
|
+
walletConnect: boolean;
|
|
49
|
+
}) => void;
|
|
41
50
|
disconnectWallet: () => void;
|
|
42
51
|
accounts: readonly WalletAccount[];
|
|
43
52
|
account?: WalletAccount;
|
|
@@ -60,7 +60,7 @@ import { createContext, useCallback, useContext, useEffect, useMemo, useRef, use
|
|
|
60
60
|
import { WalletProvider as MystenWalletProvider, SuiClientProvider, createNetworkConfig, } from "@mysten/dapp-kit";
|
|
61
61
|
import { useAccounts, useConnectWallet, useCurrentAccount, useCurrentWallet, useDisconnectWallet, useSignTransaction, useSwitchAccount, useWallets, } from "@mysten/dapp-kit";
|
|
62
62
|
import { Transaction } from "@mysten/sui/transactions";
|
|
63
|
-
import { SUI_DECIMALS } from "@mysten/sui/utils";
|
|
63
|
+
import { SUI_DECIMALS, toBase64 } from "@mysten/sui/utils";
|
|
64
64
|
import * as Sentry from "@sentry/nextjs";
|
|
65
65
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
66
66
|
import BigNumber from "bignumber.js";
|
|
@@ -70,6 +70,7 @@ import { useLocalStorage } from "usehooks-ts";
|
|
|
70
70
|
import { API_URL, formatAddress, isInMsafeApp } from "@suilend/sui-fe";
|
|
71
71
|
import { showErrorToast, showInfoToast } from "../lib";
|
|
72
72
|
import { useSettingsContext } from "./SettingsContext";
|
|
73
|
+
import { getUniversalConnector } from "../lib/connector";
|
|
73
74
|
export var WalletType;
|
|
74
75
|
(function (WalletType) {
|
|
75
76
|
WalletType["EXTENSION"] = "extension";
|
|
@@ -200,13 +201,32 @@ export var useWalletContext = function () { return useContext(WalletContext); };
|
|
|
200
201
|
function Inner(_a) {
|
|
201
202
|
var _b;
|
|
202
203
|
var _this = this;
|
|
203
|
-
var _c;
|
|
204
|
+
var _c, _d, _e, _f;
|
|
204
205
|
var appName = _a.appName, children = _a.children;
|
|
205
206
|
var router = useRouter();
|
|
206
207
|
var queryParams = (_b = {},
|
|
207
208
|
_b[WalletContextQueryParams.WALLET] = router.query[WalletContextQueryParams.WALLET],
|
|
208
209
|
_b);
|
|
209
|
-
var
|
|
210
|
+
var _g = useSettingsContext(), suiClient = _g.suiClient, rpc = _g.rpc;
|
|
211
|
+
// Only used for wallet connect
|
|
212
|
+
var _h = useState(), universalConnector = _h[0], setUniversalConnector = _h[1];
|
|
213
|
+
var _j = useState(), session = _j[0], setSession = _j[1];
|
|
214
|
+
var sessionAddressWithout0x = (_e = (_d = (_c = session === null || session === void 0 ? void 0 : session.namespaces) === null || _c === void 0 ? void 0 : _c.sui) === null || _d === void 0 ? void 0 : _d.accounts) === null || _e === void 0 ? void 0 : _e[0];
|
|
215
|
+
var sessionAddress = sessionAddressWithout0x ? sessionAddressWithout0x.split(":").pop() : undefined;
|
|
216
|
+
useEffect(function () {
|
|
217
|
+
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
218
|
+
var connector;
|
|
219
|
+
return __generator(this, function (_a) {
|
|
220
|
+
switch (_a.label) {
|
|
221
|
+
case 0: return [4 /*yield*/, getUniversalConnector(rpc.url)];
|
|
222
|
+
case 1:
|
|
223
|
+
connector = _a.sent();
|
|
224
|
+
setUniversalConnector(connector);
|
|
225
|
+
return [2 /*return*/];
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}); })();
|
|
229
|
+
}, [rpc.url]);
|
|
210
230
|
// Impersonated address
|
|
211
231
|
var impersonatedAddress = queryParams[WalletContextQueryParams.WALLET];
|
|
212
232
|
// Wallets
|
|
@@ -318,18 +338,28 @@ function Inner(_a) {
|
|
|
318
338
|
wallets__web,
|
|
319
339
|
]);
|
|
320
340
|
// Wallet
|
|
321
|
-
var
|
|
341
|
+
var _k = useState(false), isConnectWalletDropdownOpen = _k[0], setIsConnectWalletDropdownOpen = _k[1];
|
|
322
342
|
var rawWallet = useCurrentWallet().currentWallet;
|
|
323
343
|
var wallet = useMemo(function () {
|
|
324
344
|
return rawWallet ? wallets.find(function (w) { return w.name === rawWallet.name; }) : undefined;
|
|
325
345
|
}, [rawWallet, wallets]);
|
|
326
346
|
var connectWallet = useConnectWallet().mutate;
|
|
347
|
+
var disconnectWallet = useDisconnectWallet().mutate;
|
|
327
348
|
var connectWalletWrapper = useCallback(function (_wallet) {
|
|
328
349
|
try {
|
|
329
350
|
if (!_wallet.raw)
|
|
330
351
|
throw new Error("Missing wallet");
|
|
352
|
+
if (_wallet === null || _wallet === void 0 ? void 0 : _wallet.walletConnect) {
|
|
353
|
+
universalConnector.connect().then(function (res) {
|
|
354
|
+
disconnectWallet();
|
|
355
|
+
setSession(res.session);
|
|
356
|
+
});
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
331
359
|
connectWallet({ wallet: _wallet.raw }, {
|
|
332
360
|
onSuccess: function () {
|
|
361
|
+
universalConnector.disconnect();
|
|
362
|
+
setSession(null);
|
|
333
363
|
showInfoToast("Connected ".concat(_wallet.name));
|
|
334
364
|
setIsConnectWalletDropdownOpen(false);
|
|
335
365
|
},
|
|
@@ -343,8 +373,7 @@ function Inner(_a) {
|
|
|
343
373
|
showErrorToast("Failed to connect ".concat(_wallet.name), err);
|
|
344
374
|
console.error(err);
|
|
345
375
|
}
|
|
346
|
-
}, [connectWallet]);
|
|
347
|
-
var disconnectWallet = useDisconnectWallet().mutate;
|
|
376
|
+
}, [connectWallet, disconnectWallet]);
|
|
348
377
|
var disconnectWalletWrapper = useCallback(function () {
|
|
349
378
|
try {
|
|
350
379
|
disconnectWallet(undefined, {
|
|
@@ -363,14 +392,18 @@ function Inner(_a) {
|
|
|
363
392
|
}
|
|
364
393
|
}, [disconnectWallet]);
|
|
365
394
|
// Accounts
|
|
366
|
-
var
|
|
367
|
-
var
|
|
395
|
+
var accountsRes = useAccounts();
|
|
396
|
+
var accountRes = (_f = useCurrentAccount()) !== null && _f !== void 0 ? _f : undefined;
|
|
368
397
|
var switchAccount = useSwitchAccount().mutate;
|
|
398
|
+
var account = sessionAddress ? { address: sessionAddress, publicKey: new Uint8Array(), chains: ['sui:mainnet'], features: [] } : accountRes;
|
|
399
|
+
var accounts = sessionAddress ? [{ address: sessionAddress, publicKey: new Uint8Array(), chains: ['sui:mainnet'], features: [] }] : accountsRes;
|
|
369
400
|
var switchAccountWrapper = useCallback(function (_account, addressNameServiceName) {
|
|
370
|
-
var _a, _b;
|
|
401
|
+
var _a, _b, _c;
|
|
371
402
|
var accountLabel = (_b = (_a = _account === null || _account === void 0 ? void 0 : _account.label) !== null && _a !== void 0 ? _a : addressNameServiceName) !== null && _b !== void 0 ? _b : formatAddress(_account.address);
|
|
372
403
|
try {
|
|
373
|
-
switchAccount(
|
|
404
|
+
switchAccount(
|
|
405
|
+
// only address needed here. rest for type compatibility
|
|
406
|
+
{ account: __assign(__assign({}, _account), { publicKey: (_c = _account.publicKey) !== null && _c !== void 0 ? _c : new Uint8Array() }) }, {
|
|
374
407
|
onSuccess: function () {
|
|
375
408
|
showInfoToast("Switched to ".concat(accountLabel), {
|
|
376
409
|
description: (_account === null || _account === void 0 ? void 0 : _account.label)
|
|
@@ -506,7 +539,7 @@ function Inner(_a) {
|
|
|
506
539
|
});
|
|
507
540
|
}, [impersonatedAddress, account === null || account === void 0 ? void 0 : account.address, gasBudget, suiClient]);
|
|
508
541
|
var signExecuteAndWaitForTransaction = useCallback(function (transaction, options, onSetGasBudget, onSign, onExecute) { return __awaiter(_this, void 0, void 0, function () {
|
|
509
|
-
var _address, signedTransaction, err_3, res1, res2, err_4;
|
|
542
|
+
var _address, signedTransaction, txBytes, res, err_3, res1, res2, err_4;
|
|
510
543
|
var _a, _b;
|
|
511
544
|
return __generator(this, function (_c) {
|
|
512
545
|
switch (_c.label) {
|
|
@@ -520,7 +553,7 @@ function Inner(_a) {
|
|
|
520
553
|
}
|
|
521
554
|
_c.label = 1;
|
|
522
555
|
case 1:
|
|
523
|
-
_c.trys.push([1,
|
|
556
|
+
_c.trys.push([1, 13, , 14]);
|
|
524
557
|
// Gas budget
|
|
525
558
|
if (gasBudget !== "")
|
|
526
559
|
transaction.setGasBudget(+new BigNumber(gasBudget)
|
|
@@ -529,29 +562,52 @@ function Inner(_a) {
|
|
|
529
562
|
onSetGasBudget === null || onSetGasBudget === void 0 ? void 0 : onSetGasBudget(transaction);
|
|
530
563
|
// Log
|
|
531
564
|
console.log("[WalletContext] signExecuteAndWaitForTransaction - transaction.getData():", transaction.getData());
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
565
|
+
signedTransaction = void 0;
|
|
566
|
+
if (!(sessionAddress && universalConnector)) return [3 /*break*/, 4];
|
|
567
|
+
transaction.setSender(sessionAddress);
|
|
568
|
+
return [4 /*yield*/, transaction.build({ client: suiClient })];
|
|
536
569
|
case 2:
|
|
570
|
+
txBytes = _c.sent();
|
|
571
|
+
return [4 /*yield*/, universalConnector.request({
|
|
572
|
+
method: "sui_signTransaction",
|
|
573
|
+
params: {
|
|
574
|
+
transaction: toBase64(txBytes),
|
|
575
|
+
address: sessionAddress,
|
|
576
|
+
},
|
|
577
|
+
}, "sui:mainnet")];
|
|
578
|
+
case 3:
|
|
579
|
+
res = _c.sent();
|
|
580
|
+
signedTransaction = {
|
|
581
|
+
bytes: res.transactionBytes,
|
|
582
|
+
signature: res.signature,
|
|
583
|
+
};
|
|
584
|
+
return [3 /*break*/, 6];
|
|
585
|
+
case 4: return [4 /*yield*/, signTransaction({
|
|
586
|
+
transaction: transaction,
|
|
587
|
+
chain: "sui:mainnet",
|
|
588
|
+
})];
|
|
589
|
+
case 5:
|
|
590
|
+
// Sign
|
|
537
591
|
signedTransaction = _c.sent();
|
|
592
|
+
_c.label = 6;
|
|
593
|
+
case 6:
|
|
538
594
|
onSign === null || onSign === void 0 ? void 0 : onSign(signedTransaction);
|
|
539
|
-
if (!(options === null || options === void 0 ? void 0 : options.auction)) return [3 /*break*/,
|
|
540
|
-
_c.label =
|
|
541
|
-
case
|
|
542
|
-
_c.trys.push([
|
|
595
|
+
if (!(options === null || options === void 0 ? void 0 : options.auction)) return [3 /*break*/, 10];
|
|
596
|
+
_c.label = 7;
|
|
597
|
+
case 7:
|
|
598
|
+
_c.trys.push([7, 9, , 10]);
|
|
543
599
|
return [4 /*yield*/, executeAuction(signedTransaction.bytes, signedTransaction.signature)];
|
|
544
|
-
case
|
|
600
|
+
case 8:
|
|
545
601
|
_c.sent();
|
|
546
|
-
return [3 /*break*/,
|
|
547
|
-
case
|
|
602
|
+
return [3 /*break*/, 10];
|
|
603
|
+
case 9:
|
|
548
604
|
err_3 = _c.sent();
|
|
549
|
-
return [3 /*break*/,
|
|
550
|
-
case
|
|
605
|
+
return [3 /*break*/, 10];
|
|
606
|
+
case 10: return [4 /*yield*/, suiClient.executeTransactionBlock({
|
|
551
607
|
transactionBlock: signedTransaction.bytes,
|
|
552
608
|
signature: signedTransaction.signature,
|
|
553
609
|
})];
|
|
554
|
-
case
|
|
610
|
+
case 11:
|
|
555
611
|
res1 = _c.sent();
|
|
556
612
|
onExecute === null || onExecute === void 0 ? void 0 : onExecute(res1);
|
|
557
613
|
return [4 /*yield*/, suiClient.waitForTransaction({
|
|
@@ -563,21 +619,23 @@ function Inner(_a) {
|
|
|
563
619
|
showObjectChanges: true,
|
|
564
620
|
},
|
|
565
621
|
})];
|
|
566
|
-
case
|
|
622
|
+
case 12:
|
|
567
623
|
res2 = _c.sent();
|
|
568
624
|
if (((_a = res2.effects) === null || _a === void 0 ? void 0 : _a.status) !== undefined &&
|
|
569
625
|
res2.effects.status.status === "failure")
|
|
570
626
|
throw new Error((_b = res2.effects.status.error) !== null && _b !== void 0 ? _b : "Transaction failed");
|
|
571
627
|
return [2 /*return*/, res2];
|
|
572
|
-
case
|
|
628
|
+
case 13:
|
|
573
629
|
err_4 = _c.sent();
|
|
574
630
|
Sentry.captureException(err_4);
|
|
575
631
|
console.error(err_4);
|
|
576
632
|
throw err_4;
|
|
577
|
-
case
|
|
633
|
+
case 14: return [2 /*return*/];
|
|
578
634
|
}
|
|
579
635
|
});
|
|
580
636
|
}); }, [
|
|
637
|
+
universalConnector,
|
|
638
|
+
sessionAddress,
|
|
581
639
|
gasBudget,
|
|
582
640
|
impersonatedAddress,
|
|
583
641
|
account === null || account === void 0 ? void 0 : account.address,
|
|
@@ -586,25 +644,28 @@ function Inner(_a) {
|
|
|
586
644
|
signTransaction,
|
|
587
645
|
]);
|
|
588
646
|
// Using Ledger
|
|
589
|
-
var
|
|
647
|
+
var _l = useLocalStorage("isUsingLedger-".concat(impersonatedAddress !== null && impersonatedAddress !== void 0 ? impersonatedAddress : account === null || account === void 0 ? void 0 : account.address), false), isUsingLedger = _l[0], setIsUsingLedger = _l[1];
|
|
590
648
|
// Context
|
|
591
|
-
var contextValue = useMemo(function () {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
649
|
+
var contextValue = useMemo(function () {
|
|
650
|
+
return ({
|
|
651
|
+
isImpersonating: !!impersonatedAddress,
|
|
652
|
+
isConnectWalletDropdownOpen: isConnectWalletDropdownOpen,
|
|
653
|
+
setIsConnectWalletDropdownOpen: setIsConnectWalletDropdownOpen,
|
|
654
|
+
wallets: wallets,
|
|
655
|
+
wallet: wallet,
|
|
656
|
+
connectWallet: connectWalletWrapper,
|
|
657
|
+
disconnectWallet: disconnectWalletWrapper,
|
|
658
|
+
accounts: accounts,
|
|
659
|
+
account: account,
|
|
660
|
+
switchAccount: switchAccountWrapper,
|
|
661
|
+
address: impersonatedAddress !== null && impersonatedAddress !== void 0 ? impersonatedAddress : account === null || account === void 0 ? void 0 : account.address,
|
|
662
|
+
dryRunTransaction: dryRunTransaction,
|
|
663
|
+
signExecuteAndWaitForTransaction: signExecuteAndWaitForTransaction,
|
|
664
|
+
isUsingLedger: isUsingLedger,
|
|
665
|
+
setIsUsingLedger: setIsUsingLedger,
|
|
666
|
+
});
|
|
667
|
+
}, [
|
|
668
|
+
session,
|
|
608
669
|
impersonatedAddress,
|
|
609
670
|
isConnectWalletDropdownOpen,
|
|
610
671
|
wallets,
|
package/lib/connector.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { UniversalConnector } from '@reown/appkit-universal-connector';
|
|
38
|
+
// Get projectId from https://dashboard.reown.com
|
|
39
|
+
export var projectId = "8bd21cb34c6a79f37b99768f8f607a99";
|
|
40
|
+
if (!projectId) {
|
|
41
|
+
throw new Error('Project ID is not defined');
|
|
42
|
+
}
|
|
43
|
+
export function getUniversalConnector(rpcUrl) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
45
|
+
var universalConnector;
|
|
46
|
+
return __generator(this, function (_a) {
|
|
47
|
+
switch (_a.label) {
|
|
48
|
+
case 0: return [4 /*yield*/, UniversalConnector.init({
|
|
49
|
+
projectId: projectId,
|
|
50
|
+
metadata: {
|
|
51
|
+
name: 'Universal Connector',
|
|
52
|
+
description: 'Universal Connector',
|
|
53
|
+
url: 'http://localhost:3000',
|
|
54
|
+
icons: ['https://appkit.reown.com/icon.png']
|
|
55
|
+
},
|
|
56
|
+
networks: [
|
|
57
|
+
{
|
|
58
|
+
methods: ['sui_signPersonalMessage', 'sui_signTransaction', 'sui_signAndExecuteTransaction'],
|
|
59
|
+
chains: [{
|
|
60
|
+
id: 784,
|
|
61
|
+
chainNamespace: 'sui',
|
|
62
|
+
caipNetworkId: 'sui:mainnet',
|
|
63
|
+
name: 'Sui',
|
|
64
|
+
nativeCurrency: { name: 'SUI', symbol: 'SUI', decimals: 9 },
|
|
65
|
+
rpcUrls: { default: { http: [rpcUrl] } }
|
|
66
|
+
}],
|
|
67
|
+
events: [],
|
|
68
|
+
namespace: 'sui'
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
})];
|
|
72
|
+
case 1:
|
|
73
|
+
universalConnector = _a.sent();
|
|
74
|
+
return [2 /*return*/, universalConnector];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/sui-fe-next","version":"0.1.
|
|
1
|
+
{"name":"@suilend/sui-fe-next","version":"0.1.64","private":false,"description":"A collection of TypeScript frontend components and hooks","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./contexts/SettingsContext":"./contexts/SettingsContext.jsx","./contexts/WalletContext":"./contexts/WalletContext.jsx","./contexts":"./contexts/index.js","./fetchers":"./fetchers/index.js","./fetchers/useFetchBalances":"./fetchers/useFetchBalances.js","./hooks":"./hooks/index.js","./hooks/keypair":"./hooks/keypair.js","./hooks/useCoinMetadataMap":"./hooks/useCoinMetadataMap.js","./hooks/useIsAndroid":"./hooks/useIsAndroid.jsx","./hooks/useIsTouchscreen":"./hooks/useIsTouchscreen.jsx","./hooks/useIsiOS":"./hooks/useIsiOS.jsx","./hooks/useLedgerHashDialog":"./hooks/useLedgerHashDialog.js","./hooks/useRefreshOnBalancesChange":"./hooks/useRefreshOnBalancesChange.js","./lib/connector":"./lib/connector.js","./lib":"./lib/index.js","./lib/router":"./lib/router.js","./lib/toasts":"./lib/toasts.jsx"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix \"./src/**/*.ts\"","prettier":"prettier --write \"./src/**/*\"","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ts-node ./release.ts && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/suilend/sui-fe.git"},"bugs":{"url":"https://github.com/suilend/sui-fe/issues"},"dependencies":{"@sentry/nextjs":"^8.38.0","@tanstack/react-query":"^5.60.2","bignumber.js":"^9.1.2","launchdarkly-react-client-sdk":"^3.6.0","lodash":"^4.17.21","next":"^15.0.3","react":"18.3.1","react-dom":"18.3.1","react-responsive":"^10.0.0","shio-sdk":"^1.0.8","sonner":"1.4.41","swr":"^2.2.5","tailwind-merge":"^2.5.4","usehooks-ts":"^3.1.1"},"devDependencies":{"@tsconfig/next":"^2.0.3","@types/lodash":"^4.17.13","@types/node":"^22.9.0","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","@typescript-eslint/eslint-plugin":"^8.14.0","@typescript-eslint/parser":"^8.14.0","eslint":"^9.14.0","eslint-config-next":"^15.0.3","eslint-config-prettier":"^9.1.0","eslint-plugin-import":"^2.31.0","eslint-plugin-prettier":"^5.2.1","prettier":"^3.3.3","ts-node":"^10.9.2","typescript":"^5.6.3"},"peerDependencies":{"@mysten/dapp-kit":"0.16.0","@mysten/sui":"1.28.2","@mysten/wallet-standard":"0.14.7","@suilend/sui-fe":"^0.3.31"}}
|