open-index/open-npm huggingface dataset:
npm package: @obsidiansystems/hw-app-xtz
Description: Ledger Hardware Wallet Tezos Application API
Latest version: 4.72.3

<img src="https://user-images.githubusercontent.com/211411/34776833-6f1ef4da-f618-11e7-8b13-f0697901d6a8.png" height="100" />

## @ledgerhq/hw-app-xtz

Library for Ledger Hardware Wallets.

[Github](https://github.com/LedgerHQ/ledgerjs/),
[API Doc](http://ledgerhq.github.io/ledgerjs/),
[Ledger Devs Slack](https://ledger-dev.slack.com/)

## Using LedgerJS for XTZ

Here is a sample app for Node:

```
let Transport = require("@ledgerhq/hw-transport-node-hid").default;
let App = require("@ledgerhq/hw-app-xtz").default;

const getAddress = async () => {
  const transport = await Transport.create();
  const xtz = new App(transport);
  const result = await xtz.getAddress("44'/1729'/0'/0'", true);
  return result.publicKey;
};

const signOperation = async () => {
  const transport = await Transport.create();
  const xtz = new App(transport);
  const result = await xtz.signOperation("44'/1729'/0'/0'", "0342397c7a82e1f7509513642e573020aeb0aea36ac087139085e42d480cd08520070000d2e495a7ab40156d0a7c35b73d2530a3470fc8700002000000cda3081bd81219ec494b29068dcfd19e427fed9a66abcdc9e9e99ca6478f60e9080000d2e495a7ab40156d0a7c35b73d2530a3470fc870d0860303c80100c0ba99060000e7670f32038107a59a2b9cfefae36ea21f5aa63c00");
  return result.signature;
};

const getVersion = async () => {
  const transport = await Transport.create();
  const xtz = new App(transport);
  const versionInfo = await xtz.getVersion();
  return versionInfo;
};

const doAll = async () => {
    version = await getVersion();
    console.log(version);
    address = await getAddress();
    console.log(address);
    signature = await signOperation();
    console.log(signature);
};

doAll().catch(err => console.log(err));
```

To get this to work with a dev checkout of the LedgerJS repo, make sure that
you have appropriate dependencies in your `package.json`, either by using
`yarn add file:.../path` or `yarn link`. Make sure that you `yarn install`
*and* `yarn build` the LedgerJS packages, as `yarn build` will be necessary
to translate the Javascript into a form acceptable by Node.

If you want to use web instead, replace `hw-transport-node-hid` with `hw-transport-u2f`
and run `npx webpack`.
npm package: @obsidion/bridge
Description: Obsidion Bridge: A reliable end-to-end encrypted websocket bridge
Latest version: 0.11.2

# Obsidion Bridge

Obsidion Bridge provides a secure websocket connection between two parties using end-to-end encryption.

## Installation

```bash
bun install @obsidion/bridge
```

## Usage

The bridge creates a secure encrypted communication channel via ECDH between two parties:

1. **Creator** - The party that creates the bridge connection and shares the connection string. This will typically be a frontend web app.
2. **Joiner** - The party that joins the bridge using the connection string. This will typically be a mobile app.

### Bridge Creator

```typescript
import { Bridge } from "@obsidion/bridge"

// Create a bridge
const bridge = await Bridge.create()

// The connection string URI to share with the joiner (can be encoded as a QR code)
console.log("Bridge connection string:", bridge.connectionString)

// Set up event handlers
bridge.onConnect((reconnection: boolean) => {
  console.log(`${reconnection ? "Reconnected" : "Connected"} to bridge`)
})

bridge.onFailedToConnect((event: FailedToConnectEvent) => {
  console.error("Failed to connect", event)
})

bridge.onSecureChannelEstablished(() => {
  console.log("Secure channel established with joiner")
  // Now we can send secure messages
  bridge.sendMessage("greeting", { message: "Hello from creator!" })
})

bridge.onSecureMessage((message) => {
  console.log("Received message:", message)
})

bridge.onRawMessage((raw: string) => {
  logMessage(`Raw message received: ${raw}`)
})

bridge.onDisconnect((event: BridgeDisconnectedEvent) => {
  console.log("Disconnected from bridge", event)
})

bridge.onError((error) => {
  console.error("Error:", error)
})

// Cleanup the bridge when done
bridge.cleanup()
```

### Bridge Joiner

```typescript
import { Bridge } from "@obsidion/bridge"

// Join using the connection string shared by the creator
// This is typically obtained from scanning a QR code
const cs = "obsidion:02d3ff5e5db7c48c34880bc11e8b457a4b9a6bf2a2f545cf575eb941b08f04adc4?d=localhost"
const bridge = await Bridge.join(cs)

// Set up event handlers
bridge.onConnect((reconnection: boolean) => {
  console.log(`${reconnection ? "Reconnected" : "Connected"} to bridge`)
})

bridge.onFailedToConnect((event: FailedToConnectEvent) => {
  console.error("Failed to connect", event)
})

bridge.onSecureChannelEstablished(() => {
  console.log("Secure channel established with creator")
  // Now we can send secure messages
  bridge.sendMessage("greeting", { message: "Hello from joiner!" })
})

bridge.onSecureMessage((message) => {
  console.log("Received message:", message)
})

bridge.onRawMessage((raw: string) => {
  logMessage(`Raw message received: ${raw}`)
})

bridge.onDisconnect((event: BridgeDisconnectedEvent) => {
  console.log("Disconnected from bridge", event)
})

bridge.onError((error) => {
  console.error("Error:", error)
})

// Cleanup the bridge when done
bridge.cleanup()
```