@openocean.finance/wallet 1.7.9 → 1.8.1
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.
|
@@ -152,7 +152,9 @@ function link(reqConnectWalletVo, chain) {
|
|
|
152
152
|
// https://solana-api.projectserum.com
|
|
153
153
|
// https://mercuria-fronten-1cd8.mainnet.rpcpool.com/
|
|
154
154
|
// "https://rpc.ankr.com/solana/ad9d7bb3250b29d691330e63e3b46778099aca307af8f5e49b2ebc0a470dd848"
|
|
155
|
-
wallet.connection = new web3_js_1.Connection(
|
|
155
|
+
wallet.connection = new web3_js_1.Connection(
|
|
156
|
+
// "https://solana-mainnet.g.alchemy.com/v2/aTdPTJc3R936_mNf4ABtPvl1NFgejm8w"
|
|
157
|
+
"https://few-silent-choice.solana-mainnet.quiknode.pro/b37eb00eb03a5a5e0ae9d9b7cf535b0b9c0dd6a9/");
|
|
156
158
|
if (res) {
|
|
157
159
|
// connect(wallet);
|
|
158
160
|
}
|
|
@@ -62,6 +62,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
62
62
|
*/
|
|
63
63
|
// @ts-ignore
|
|
64
64
|
var rabby_svg_1 = __importDefault(require("../assets/rabby.svg"));
|
|
65
|
+
var helper_1 = require("../helper");
|
|
65
66
|
var types_1 = require("../types");
|
|
66
67
|
var BaseWallet_1 = __importDefault(require("./BaseWallet"));
|
|
67
68
|
var web3_1 = __importDefault(require("web3"));
|
|
@@ -94,19 +95,23 @@ var RabbyWallet = /** @class */ (function (_super) {
|
|
|
94
95
|
*/
|
|
95
96
|
RabbyWallet.prototype.requestConnect = function (chainId) {
|
|
96
97
|
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
-
var address, currentChainId;
|
|
98
|
+
var result, address, currentChainId;
|
|
98
99
|
return __generator(this, function (_a) {
|
|
99
100
|
switch (_a.label) {
|
|
100
|
-
case 0:
|
|
101
|
-
|
|
101
|
+
case 0: return [4 /*yield*/, (0, helper_1.autoWalletCheck)(function () {
|
|
102
|
+
return window.rabby;
|
|
103
|
+
}, 3000)];
|
|
104
|
+
case 1:
|
|
105
|
+
result = _a.sent();
|
|
106
|
+
if (!result) {
|
|
102
107
|
throw new Error(types_1.EnumErrors.NoRabbyWallet);
|
|
103
108
|
}
|
|
104
|
-
this.sdk = new web3_1.default(
|
|
109
|
+
this.sdk = new web3_1.default(window.rabby);
|
|
105
110
|
return [4 /*yield*/, this.sdk.eth.requestAccounts()];
|
|
106
|
-
case
|
|
111
|
+
case 2:
|
|
107
112
|
address = (_a.sent())[0];
|
|
108
113
|
return [4 /*yield*/, this.sdk.eth.getChainId()];
|
|
109
|
-
case
|
|
114
|
+
case 3:
|
|
110
115
|
currentChainId = _a.sent();
|
|
111
116
|
if (chainId && currentChainId !== chainId) {
|
|
112
117
|
throw new Error(types_1.EnumErrors.ChainIdNotMath);
|