@mocanetwork/airkit 1.4.0 → 1.4.2

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/README.md CHANGED
@@ -5,19 +5,19 @@ This SDK is part of the [Moca Network](https://moca.network/) offering and provi
5
5
  ## ⚡ Quick Start
6
6
 
7
7
  ```shell
8
- npm install path/to/mocanetwork-airkit-0.5.0.tgz
8
+ npm install @mocanetwork/airkit
9
9
  ```
10
10
 
11
11
  ### Initialize & Login
12
12
 
13
13
  ```ts
14
- import AirService, { EMBED_BUILD_ENV } from "@mocanetwork/airkit";
14
+ import AirService, { BUILD_ENV } from "@mocanetwork/airkit";
15
15
 
16
16
  const service = new AirService({
17
17
  partnerId: YOUR_PARTNER_ID,
18
18
  });
19
19
  await service.init({
20
- buildEnv: EMBED_BUILD_ENV.STAGING,
20
+ buildEnv: BUILD_ENV.SANDBOX,
21
21
  enableLogging: true,
22
22
  });
23
23
  await embed.login();
@@ -127,6 +127,11 @@ export default defineConfig({
127
127
  ## Usage
128
128
  Once the SDK is installed and the `AirService` successfully initialized, it can be used to authenticate users. Further, the native provider given by the embed instance can be used to let users interact with the blockchain.
129
129
 
130
+ ### Live Examples
131
+
132
+ - **[Deployed Example App](https://developers.sandbox.air3.com/example)** - See Air Kit in action with wagmi integration
133
+ - **[Source Code](https://github.com/MocaNetwork/airkit-example)** - Complete React + TypeScript example
134
+
130
135
  ### Signing Example
131
136
 
132
137
  <details open>
@@ -97,7 +97,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
97
97
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
98
98
  };
99
99
 
100
- var version = "1.4.0";
100
+ var version = "1.4.2";
101
101
  var airkitPackage = {
102
102
  version: version};
103
103
 
@@ -2506,7 +2506,7 @@ class AirService {
2506
2506
  };
2507
2507
  }
2508
2508
  shouldEnableAutomation() {
2509
- return localStorage.getItem("automation") === "true" && __classPrivateFieldGet(this, _AirService_buildEnv, "f") !== "production";
2509
+ return localStorage.getItem("automation") === "true" && __classPrivateFieldGet(this, _AirService_buildEnv, "f") !== BUILD_ENV.PRODUCTION;
2510
2510
  }
2511
2511
  async init({ buildEnv = BUILD_ENV.PRODUCTION, enableLogging = false, skipRehydration = false, }) {
2512
2512
  if (!__classPrivateFieldGet(this, _AirService_partnerId, "f"))
@@ -95,7 +95,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
95
95
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
96
96
  };
97
97
 
98
- var version = "1.4.0";
98
+ var version = "1.4.2";
99
99
  var airkitPackage = {
100
100
  version: version};
101
101
 
@@ -2504,7 +2504,7 @@ class AirService {
2504
2504
  };
2505
2505
  }
2506
2506
  shouldEnableAutomation() {
2507
- return localStorage.getItem("automation") === "true" && __classPrivateFieldGet(this, _AirService_buildEnv, "f") !== "production";
2507
+ return localStorage.getItem("automation") === "true" && __classPrivateFieldGet(this, _AirService_buildEnv, "f") !== BUILD_ENV.PRODUCTION;
2508
2508
  }
2509
2509
  async init({ buildEnv = BUILD_ENV.PRODUCTION, enableLogging = false, skipRehydration = false, }) {
2510
2510
  if (!__classPrivateFieldGet(this, _AirService_partnerId, "f"))
@@ -101,7 +101,7 @@
101
101
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
102
102
  };
103
103
 
104
- var version = "1.4.0";
104
+ var version = "1.4.2";
105
105
  var airkitPackage = {
106
106
  version: version};
107
107
 
@@ -2510,7 +2510,7 @@
2510
2510
  };
2511
2511
  }
2512
2512
  shouldEnableAutomation() {
2513
- return localStorage.getItem("automation") === "true" && __classPrivateFieldGet(this, _AirService_buildEnv, "f") !== "production";
2513
+ return localStorage.getItem("automation") === "true" && __classPrivateFieldGet(this, _AirService_buildEnv, "f") !== BUILD_ENV.PRODUCTION;
2514
2514
  }
2515
2515
  async init({ buildEnv = BUILD_ENV.PRODUCTION, enableLogging = false, skipRehydration = false, }) {
2516
2516
  if (!__classPrivateFieldGet(this, _AirService_partnerId, "f"))
@@ -1,24 +1,24 @@
1
1
  export declare const mocaTestnet: {
2
- id: number;
3
- name: string;
4
- nativeCurrency: {
5
- decimals: number;
6
- name: string;
7
- symbol: string;
2
+ readonly id: 5151;
3
+ readonly name: "Moca Testnet";
4
+ readonly nativeCurrency: {
5
+ readonly decimals: 18;
6
+ readonly name: "Moca Network";
7
+ readonly symbol: "MOCA";
8
8
  };
9
- rpcUrls: {
10
- default: {
11
- http: string[];
12
- webSocket: string[];
9
+ readonly rpcUrls: {
10
+ readonly default: {
11
+ readonly http: readonly ["https://testnet-rpc.mechain.tech"];
12
+ readonly webSocket: readonly ["wss://testnet-rpc.mechain.tech"];
13
13
  };
14
14
  };
15
- blockExplorers: {
16
- default: {
17
- name: string;
18
- url: string;
15
+ readonly blockExplorers: {
16
+ readonly default: {
17
+ readonly name: "Blockscout";
18
+ readonly url: "https://testnet-scan.mechain.tech";
19
19
  };
20
20
  };
21
- contracts: {
21
+ readonly contracts: {
22
22
  readonly multicall3: {
23
23
  readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
24
24
  readonly blockCreated: 3837540;
@@ -1,4 +1,4 @@
1
- export type Environment = "development" | "staging" | "uat" | "production";
1
+ export type Environment = "development" | "staging" | "uat" | "sandbox" | "production";
2
2
  export type Hex = `0x${string}`;
3
3
  export type Jsonable = string | number | boolean | null | undefined | readonly Jsonable[] | {
4
4
  readonly [key: string]: Jsonable;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mocanetwork/airkit",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Air kit to interact with the Moca Network",
5
5
  "main": "dist/airkit.cjs.js",
6
6
  "module": "dist/airkit.esm.js",