@types/arconnect
@types/arconnect
npm i @types/arconnect
@types/arconnect

@types/arconnect

The repository for high quality TypeScript type definitions.

by DefinitelyTyped

1.0.1 (see all)License:MITTypeScript:Built-In
npm i @types/arconnect
Readme

Installation

npm install --save @types/arconnect

Summary

This package contains type definitions for arconnect (https://github.com/th8ta/ArConnect).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/arconnect.

index.d.ts

// Type definitions for arconnect 1.0
// Project: https://github.com/th8ta/ArConnect
// Definitions by: Marton Lederer <https://github.com/martonlederer>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import { SignatureOptions } from "arweave/node/lib/crypto/crypto-interface";
import Transaction from "arweave/node/lib/transaction";

/**
 * Arweave wallet declarations
 */
declare global {
  interface Window {
    arweaveWallet: {
      connect(permissions: PermissionType[]): Promise<void>;
      disconnect(): Promise<void>;
      getActiveAddress(): Promise<string>;
      getAllAddresses(): Promise<string[]>;
      getWalletNames(): Promise<{ [addr: string]: string }>;
      sign(
        transaction: Transaction,
        options?: SignatureOptions
      ): Promise<Transaction>;
      getPermissions(): Promise<PermissionType[]>;
      encrypt(
        data: string,
        options: {
          algorithm: string;
          hash: string;
          salt?: string | undefined;
        }
      ): Promise<Uint8Array>;
      decrypt(
        data: Uint8Array,
        options: {
          algorithm: string;
          hash: string;
          salt?: string | undefined;
        }
      ): Promise<string>;
    };
  }
  interface WindowEventMap {
    walletSwitch: CustomEvent<{ address: string }>;
    arweaveWalletLoaded: CustomEvent<{}>;
  }
}

/**
 * Arweave wallet permission types
 */
 export type PermissionType =
  | "ACCESS_ADDRESS"
  | "ACCESS_ALL_ADDRESSES"
  | "SIGN_TRANSACTION"
  | "ENCRYPT"
  | "DECRYPT";

export {};

Additional Details

  • Last updated: Wed, 07 Jul 2021 21:44:30 GMT
  • Dependencies: @types/arweave
  • Global values: none

Credits

These definitions were written by Marton Lederer.

Downloads/wk

21

GitHub Stars

41K

LAST COMMIT

7mos ago

MAINTAINERS

1

CONTRIBUTORS

17,572

OPEN ISSUES

637

OPEN PRs

201
VersionTagPublished
1.0.1
latest
1yr ago
1.0.1
ts4.7
1yr ago
1.0.1
ts4.6
1yr ago
1.0.1
ts4.8
1yr ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate