@mocanetwork/airkit-connector 1.2.0-beta.2 → 1.2.0-beta.4

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  var airkit = require('@mocanetwork/airkit');
4
4
 
5
- const version$1 = '2.23.5';
5
+ const version$1 = '2.26.5';
6
6
 
7
7
  let errorConfig = {
8
8
  getDocsUrl: ({
@@ -1418,13 +1418,13 @@ function airConnector(parameters) {
1418
1418
  async connect({ chainId } = {}) {
1419
1419
  try {
1420
1420
  config.emitter.emit("message", { type: "connecting" });
1421
- loginResult = await service.login({
1422
- authToken: parameters.loginOptions?.authToken,
1423
- });
1424
1421
  const provider = await this.getProvider();
1425
1422
  provider.on("accountsChanged", (payload) => this.onAccountsChanged(payload));
1426
1423
  provider.on("chainChanged", this.onChainChanged);
1427
1424
  provider.on("disconnect", this.onDisconnect.bind(this));
1425
+ loginResult = await service.login({
1426
+ authToken: parameters.loginOptions?.authToken,
1427
+ });
1428
1428
  let currentChainId = await this.getChainId();
1429
1429
  if (chainId && currentChainId !== chainId) {
1430
1430
  const chain = await this.switchChain({ chainId }).catch((error) => {
@@ -1438,7 +1438,7 @@ function airConnector(parameters) {
1438
1438
  return { accounts, chainId: currentChainId };
1439
1439
  }
1440
1440
  catch (error) {
1441
- log.error("error while connecting", error);
1441
+ log.error("Error while connecting", error);
1442
1442
  this.onDisconnect();
1443
1443
  throw new UserRejectedRequestError("Something went wrong");
1444
1444
  }
@@ -1,6 +1,6 @@
1
1
  import { AirService } from '@mocanetwork/airkit';
2
2
 
3
- const version$1 = '2.23.5';
3
+ const version$1 = '2.26.5';
4
4
 
5
5
  let errorConfig = {
6
6
  getDocsUrl: ({
@@ -1416,13 +1416,13 @@ function airConnector(parameters) {
1416
1416
  async connect({ chainId } = {}) {
1417
1417
  try {
1418
1418
  config.emitter.emit("message", { type: "connecting" });
1419
- loginResult = await service.login({
1420
- authToken: parameters.loginOptions?.authToken,
1421
- });
1422
1419
  const provider = await this.getProvider();
1423
1420
  provider.on("accountsChanged", (payload) => this.onAccountsChanged(payload));
1424
1421
  provider.on("chainChanged", this.onChainChanged);
1425
1422
  provider.on("disconnect", this.onDisconnect.bind(this));
1423
+ loginResult = await service.login({
1424
+ authToken: parameters.loginOptions?.authToken,
1425
+ });
1426
1426
  let currentChainId = await this.getChainId();
1427
1427
  if (chainId && currentChainId !== chainId) {
1428
1428
  const chain = await this.switchChain({ chainId }).catch((error) => {
@@ -1436,7 +1436,7 @@ function airConnector(parameters) {
1436
1436
  return { accounts, chainId: currentChainId };
1437
1437
  }
1438
1438
  catch (error) {
1439
- log.error("error while connecting", error);
1439
+ log.error("Error while connecting", error);
1440
1440
  this.onDisconnect();
1441
1441
  throw new UserRejectedRequestError("Something went wrong");
1442
1442
  }
@@ -4,7 +4,7 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.AirkitConnector = {}, global.airkit));
5
5
  })(this, (function (exports, airkit) { 'use strict';
6
6
 
7
- const version$1 = '2.23.5';
7
+ const version$1 = '2.26.5';
8
8
 
9
9
  let errorConfig = {
10
10
  getDocsUrl: ({
@@ -1420,13 +1420,13 @@
1420
1420
  async connect({ chainId } = {}) {
1421
1421
  try {
1422
1422
  config.emitter.emit("message", { type: "connecting" });
1423
- loginResult = await service.login({
1424
- authToken: parameters.loginOptions?.authToken,
1425
- });
1426
1423
  const provider = await this.getProvider();
1427
1424
  provider.on("accountsChanged", (payload) => this.onAccountsChanged(payload));
1428
1425
  provider.on("chainChanged", this.onChainChanged);
1429
1426
  provider.on("disconnect", this.onDisconnect.bind(this));
1427
+ loginResult = await service.login({
1428
+ authToken: parameters.loginOptions?.authToken,
1429
+ });
1430
1430
  let currentChainId = await this.getChainId();
1431
1431
  if (chainId && currentChainId !== chainId) {
1432
1432
  const chain = await this.switchChain({ chainId }).catch((error) => {
@@ -1440,7 +1440,7 @@
1440
1440
  return { accounts, chainId: currentChainId };
1441
1441
  }
1442
1442
  catch (error) {
1443
- log.error("error while connecting", error);
1443
+ log.error("Error while connecting", error);
1444
1444
  this.onDisconnect();
1445
1445
  throw new UserRejectedRequestError("Something went wrong");
1446
1446
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mocanetwork/airkit-connector",
3
- "version": "1.2.0-beta.2",
3
+ "version": "1.2.0-beta.4",
4
4
  "description": "AirKit wagmi connector to connect with the AirService",
5
5
  "main": "dist/airkitConnector.cjs.js",
6
6
  "unpkg": "dist/airkitConnector.umd.min.js",
@@ -23,7 +23,7 @@
23
23
  "pre-commit": "lint-staged --cwd ."
24
24
  },
25
25
  "dependencies": {
26
- "@mocanetwork/airkit": "^1.2.0-beta.2",
26
+ "@mocanetwork/airkit": "^1.2.0-beta.4",
27
27
  "@wagmi/core": "^2.x",
28
28
  "loglevel": "^1.8.1",
29
29
  "viem": "^2.x"
@@ -38,14 +38,16 @@ export function airConnector(
38
38
  async connect({ chainId } = {}) {
39
39
  try {
40
40
  config.emitter.emit("message", { type: "connecting" });
41
- loginResult = await service.login({
42
- authToken: parameters.loginOptions?.authToken,
43
- });
44
41
 
45
42
  const provider = await this.getProvider();
46
43
  provider.on("accountsChanged", (payload) => this.onAccountsChanged(payload));
47
44
  provider.on("chainChanged", this.onChainChanged);
48
45
  provider.on("disconnect", this.onDisconnect.bind(this));
46
+
47
+ loginResult = await service.login({
48
+ authToken: parameters.loginOptions?.authToken,
49
+ });
50
+
49
51
  let currentChainId = await this.getChainId();
50
52
  if (chainId && currentChainId !== chainId) {
51
53
  const chain = await this.switchChain!({ chainId }).catch((error) => {
@@ -58,7 +60,7 @@ export function airConnector(
58
60
  const accounts = await this.getAccounts();
59
61
  return { accounts, chainId: currentChainId };
60
62
  } catch (error) {
61
- log.error("error while connecting", error);
63
+ log.error("Error while connecting", error);
62
64
  this.onDisconnect();
63
65
  throw new UserRejectedRequestError("Something went wrong" as unknown as Error);
64
66
  }