open-index/open-npm huggingface dataset:
npm package: @quartz-labs/sdk
Description: SDK for interacting with the Quartz Protocol
Author: Quartz Labs
Latest version: 0.42.3

<div align="center">
  <img width="2500" alt="Pyra" src="https://pyra.fi/open-graph.jpg" />

  <h1 style="margin-top:20px;">Pyra SDK</h1>
</div>

Typescript SDK for interacting with the Pyra Protocol. 

Install using:

```bash
yarn add @quartz-labs/sdk
# or
npm install @quartz-labs/sdk
```

There is currently an issue with dependency resolutions, so add the following to your package.json to fix:

```json
"resolutions": {
  "rpc-websockets": "9.0.4",
  "@solana/web3.js": "1.98.0"
}
```

If you want to use this SDK in a front-end, note that some Node modules don't work in the browser. Because of this, you'll normally want to import the SDK in your client side code like this:

```javascript
import * from "@quartz-labs/sdk/browser";
```

Server-side code can still be imported without the /browser path at the end, but you may need to set up your config so your web app doesn't try to bundle the problematic Node modules with the and client side code.

## Basic setup

Create a Quartz Client with:

```javascript
import { QuartzClient } from "@quartz-labs/sdk";
import { Connection } from "@solana/web3.js";

const connection = new Connection("https://api.mainnet-beta.solana.com");
const client = QuartzClient.fetchClient(connection);
```

The majority of this SDK can then be accessed through the client, eg:

```javascript
import { LAMPORTS_PER_SOL } from "@solana/web3.js";

const depositApy = client.getDepositRate(marketIndex);
const createAccountInstructions = client.makeInitQuartzUserIxs(address);

const user = client.getQuartzAccount(address);
const health = user.getHealth();
const stablecoinBalances = user.getMultipleTokenBalances(stablecoinIndices);
const depositInstructions = user.makeDepositIx(
  LAMPORTS_PER_SOL,
  marketIndexSol,
  true // true = can change position from loan <-> collateral, false = will limit amount deposited to prevent this
);
```

## Links

Website: [pyra.fi](https://pyra.fi/)

Docs: [docs.pyra.fi](https://docs.pyra.fi/)

X: [@GetPyra](https://x.com/GetPyra)

Discord: [discord.gg/GetPyra](https:discord.gg/GetPyra)

Contact: [diego@pyra.fi](mailto:diego@pyra.fi)
npm package: @quartz-vision/ionic-events
Description: Vue plugin that adds some events based on ionic's gestures
Author: Lia Va
Latest version: 1.0.2

# ionic-events
A bunch of events on top of ionic's gestures

 - [installation](#installation)
 - [usage](#usage)
 - [events](#events)

## Installation
```console
npm i @quartz-vision/ionic-events
```

## Setup
```js
import Vue from "vue"
import ionicEvents from "@quartz-vision/ionic-events"

const app = createApp(myApp)
  .use(ionicEvents);
```

## Usage
```vue
<div v-quartz:<event name>="<handler>">
```


## Events
 - [long-tap](#long-tap)


### long-tap
```vue
<div v-quartz:long-tap="onLongTap">
```
> Tap time: `500ms`
npm package: @quartz-vision/vue-events-helper
Description: Vue plugin that helps with custom events creation
Author: Lia Va
Latest version: 1.1.9

# vue-events-helper
> Requires vue3

Vue plugin that helps with custom events creation.

## Installation
```console
npm i @quartz-vision/vue-events-helper
```

## Setup
`VueEventsHelper` takes one argument - name of the directive
```js
import Vue from "vue"
import VueEventsHelper from "@quartz-vision/vue-events-helper"

const myEvents = new VueEventsHelper("my");

myEvents.registerEvent("interaction", {
    mounted(el, {handler}) {
        el.addEventListener("click", handler);
    },

    beforeUnmount(el, {handler}) {
        el.removeEventListener("click", handler);
    }
});

const app = createApp(myApp)
  .use(myEvents);
```

## Usage
```vue
<div v-my:interaction="onInteraction">
```


## Methods

### registerEvent
```js
helper.registerEvent(name, manager)
// name - event name
// manager - object with lifecycle hooks

helper.registerEvent('myEvent', {
  // called before bound element's attributes or event listeners are applied
  created(el, eventSpecification) {},
  
  // called before bound element's parent component is mounted
  beforeMount(el, eventSpecification) {},
  
  // called when bound element's parent component is mounted
  mounted(el, eventSpecification) {},
  
  // called before the containing component's VNode is updated
  beforeUpdate(el, eventSpecification) {},
  
  // called after the containing component's VNode and the VNodes of its children // have updated
  updated(el, eventSpecification) {},
  
  // called before the bound element's parent component is unmounted
  beforeUnmount(el, eventSpecification) {},
  
  // called when the bound element's parent component is unmounted
  unmounted(el, eventSpecification) {}
})
```

Event hooks are passed these arguments:
#
`el`

The element the event is bound to.
#
`eventSpecification`

An object containing the following properties.
```js
{
  modifiers: {a: true, b: true},  // for example v-my:interaction.a.b="...",
  handler: function,  // The handler passed to the event directive
  oldHandler: function  // The previous handler, only for beforeUpdate hook
}
```