@azguardwallet/types 0.2.0 → 0.2.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.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @azguardwallet/types
2
2
 
3
+ [![GitHub License](https://img.shields.io/github/license/AzguardWallet/azguard-wallet-types)](https://github.com/AzguardWallet/azguard-wallet-types/blob/main/LICENSE)
4
+ [![NPM Version](https://img.shields.io/npm/v/@azguardwallet/types)](https://www.npmjs.com/package/@azguardwallet/types)
5
+ [![NPM Downloads](https://img.shields.io/npm/dt/@azguardwallet/types)](https://www.npmjs.com/package/@azguardwallet/types)
6
+
3
7
  This library contains type declarations with annotations for Azguard Wallet inpage RPC client, that can be helpful for browser based apps written in TypeScript.
4
8
 
5
9
  ### How to use
@@ -28,6 +32,10 @@ import type {
28
32
  OkResult,
29
33
  } from "@azguardwallet/types";
30
34
 
35
+ if (!window.azguard) {
36
+ throw "Azguard Wallet is not installed";
37
+ }
38
+
31
39
  const azguard = window.azguard.createClient();
32
40
 
33
41
  const account: CaipAccount = "aztec:31337:0xffff...";
package/dist/index.d.ts CHANGED
@@ -2,9 +2,9 @@ import { AzguardRpcClient } from "./client";
2
2
  declare global {
3
3
  interface Window {
4
4
  /**
5
- * Azguard Wallet accessor
5
+ * Azguard Wallet accessor or undefined if Azguard Wallet is not installed
6
6
  */
7
- azguard: {
7
+ azguard?: {
8
8
  /**
9
9
  * Version
10
10
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azguardwallet/types",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Typings for Azguard Wallet inpage RPC client",
5
5
  "author": "Azguard Wallet",
6
6
  "homepage": "https://github.com/AzguardWallet/azguard-wallet-types",