@dynamic-labs/wagmi-connector 0.14.28 → 0.14.30
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/index.cjs +6 -5
- package/index.js +6 -5
- package/package.json +3 -2
package/index.cjs
CHANGED
|
@@ -7,6 +7,7 @@ var wagmi = require('wagmi');
|
|
|
7
7
|
var _public = require('wagmi/providers/public');
|
|
8
8
|
var sdkReact = require('@dynamic-labs/sdk-react');
|
|
9
9
|
var utils = require('ethers/lib/utils.js');
|
|
10
|
+
var multiWallet = require('@dynamic-labs/multi-wallet');
|
|
10
11
|
var allChains = require('wagmi/chains');
|
|
11
12
|
var ethers = require('ethers');
|
|
12
13
|
|
|
@@ -1186,7 +1187,7 @@ class Connector extends wagmi.Connector {
|
|
|
1186
1187
|
connect(config) {
|
|
1187
1188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1188
1189
|
if (!this.walletConnector) {
|
|
1189
|
-
throw new
|
|
1190
|
+
throw new multiWallet.DynamicError('WalletConnector is not defined');
|
|
1190
1191
|
}
|
|
1191
1192
|
const account = yield this.getAccount();
|
|
1192
1193
|
this.setupEventListeners();
|
|
@@ -1226,7 +1227,7 @@ class Connector extends wagmi.Connector {
|
|
|
1226
1227
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1227
1228
|
const address = yield (_a = this.walletConnector) === null || _a === void 0 ? void 0 : _a.fetchPublicAddress();
|
|
1228
1229
|
if (!address) {
|
|
1229
|
-
throw new
|
|
1230
|
+
throw new multiWallet.DynamicError('Not connected');
|
|
1230
1231
|
}
|
|
1231
1232
|
return utils.getAddress(address);
|
|
1232
1233
|
});
|
|
@@ -1234,11 +1235,11 @@ class Connector extends wagmi.Connector {
|
|
|
1234
1235
|
getChainId() {
|
|
1235
1236
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1236
1237
|
if (!this.walletConnector) {
|
|
1237
|
-
throw new
|
|
1238
|
+
throw new multiWallet.DynamicError('WalletConnector is not defined');
|
|
1238
1239
|
}
|
|
1239
1240
|
const network = yield this.walletConnector.getNetwork();
|
|
1240
1241
|
if (!network) {
|
|
1241
|
-
throw new
|
|
1242
|
+
throw new multiWallet.DynamicError('Network is not defined');
|
|
1242
1243
|
}
|
|
1243
1244
|
return network;
|
|
1244
1245
|
});
|
|
@@ -1287,7 +1288,7 @@ class Connector extends wagmi.Connector {
|
|
|
1287
1288
|
});
|
|
1288
1289
|
}
|
|
1289
1290
|
watchAsset(asset) {
|
|
1290
|
-
throw new
|
|
1291
|
+
throw new multiWallet.DynamicError('Method not implemented.');
|
|
1291
1292
|
}
|
|
1292
1293
|
}
|
|
1293
1294
|
|
package/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Connector as Connector$1, useClient, useConnect, useDisconnect, mainnet
|
|
|
3
3
|
import { publicProvider } from 'wagmi/providers/public';
|
|
4
4
|
import { useDynamicContext } from '@dynamic-labs/sdk-react';
|
|
5
5
|
import { getAddress, hexValue } from 'ethers/lib/utils.js';
|
|
6
|
+
import { DynamicError } from '@dynamic-labs/multi-wallet';
|
|
6
7
|
import * as allChains from 'wagmi/chains';
|
|
7
8
|
import { providers } from 'ethers';
|
|
8
9
|
|
|
@@ -1159,7 +1160,7 @@ class Connector extends Connector$1 {
|
|
|
1159
1160
|
connect(config) {
|
|
1160
1161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1161
1162
|
if (!this.walletConnector) {
|
|
1162
|
-
throw new
|
|
1163
|
+
throw new DynamicError('WalletConnector is not defined');
|
|
1163
1164
|
}
|
|
1164
1165
|
const account = yield this.getAccount();
|
|
1165
1166
|
this.setupEventListeners();
|
|
@@ -1199,7 +1200,7 @@ class Connector extends Connector$1 {
|
|
|
1199
1200
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1200
1201
|
const address = yield (_a = this.walletConnector) === null || _a === void 0 ? void 0 : _a.fetchPublicAddress();
|
|
1201
1202
|
if (!address) {
|
|
1202
|
-
throw new
|
|
1203
|
+
throw new DynamicError('Not connected');
|
|
1203
1204
|
}
|
|
1204
1205
|
return getAddress(address);
|
|
1205
1206
|
});
|
|
@@ -1207,11 +1208,11 @@ class Connector extends Connector$1 {
|
|
|
1207
1208
|
getChainId() {
|
|
1208
1209
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1209
1210
|
if (!this.walletConnector) {
|
|
1210
|
-
throw new
|
|
1211
|
+
throw new DynamicError('WalletConnector is not defined');
|
|
1211
1212
|
}
|
|
1212
1213
|
const network = yield this.walletConnector.getNetwork();
|
|
1213
1214
|
if (!network) {
|
|
1214
|
-
throw new
|
|
1215
|
+
throw new DynamicError('Network is not defined');
|
|
1215
1216
|
}
|
|
1216
1217
|
return network;
|
|
1217
1218
|
});
|
|
@@ -1260,7 +1261,7 @@ class Connector extends Connector$1 {
|
|
|
1260
1261
|
});
|
|
1261
1262
|
}
|
|
1262
1263
|
watchAsset(asset) {
|
|
1263
|
-
throw new
|
|
1264
|
+
throw new DynamicError('Method not implemented.');
|
|
1264
1265
|
}
|
|
1265
1266
|
}
|
|
1266
1267
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wagmi-connector",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"react": "^17.0.2 || ^18.0.0",
|
|
13
13
|
"ethers": "^5.7.2",
|
|
14
14
|
"wagmi": "~0.10.3",
|
|
15
|
-
"@dynamic-labs/sdk-react": "0.14.
|
|
15
|
+
"@dynamic-labs/sdk-react": "0.14.30",
|
|
16
|
+
"@dynamic-labs/multi-wallet": "0.14.30"
|
|
16
17
|
},
|
|
17
18
|
"license": "Apache-2.0",
|
|
18
19
|
"module": "./index.js",
|