open-index/open-npm huggingface dataset:
npm package: @ryki/datemath
Description: A collection date, duration, and interval functions
Author: Ryan King
Latest version: 1.3.4

# Datemath

Essentially `date-fns` and `duration-fns` with more flexibile duration functions. I expect `date-fns` to eventually catch up on duration functionality but I need something now.

    npm install @ryki/datemath

## Functions

    import { Function } from "@ryki/datemath"

| Function | Description |
| ----------- | ----------- |
| **addDurationToDate**(`Date`, `Duration`) -> `Date` | Adds duration to a date |
| **subDurationFromDate**(`Date`, `Duration`) -> `Date` | Subtracts duration from date |
| **addUnitToDate**(`Date`, `Unit`, `Number`) -> `Date` | Adds Number of Units to Date |
| **subUnitFromDate**(`Date`, `Unit`, `Number`) -> `Date`| Subtracts Number of Units from Date |
| **durationBetween**(`Date`, `Date`) -> `Duration` | Get duration between 2 dates. The earliest date being the first argument. |
| **addDurations**(`Duration`, `Duration`) -> `Duration` | Adds 2 durations |
| **subsDurations**(`Duration`, `Duration`) -> `Duration` | Subtracts the 2nd duration from the first (1st - 2nd) |
| **multiplyDurationBy**(`Duration`, `Number`) -> `Duration` | Multiplies duration by number |
| **divideDurationBy**(`Duration`, `Number`) -> `Duration` | Divides duration by number |
| **durationToUnit**(`Duration`, `Unit`, `Number`, `Date`) -> `Number` | Converts duration into a number of units or multiples of units. Date is a reference for calculating duration units. |
| **largestWholeUnitBetween**(`Date`, `Date`) -> `Duration` | Returns a single unit duration with the largest non-decimal unit. ie. 14 days -> 2 weeks, 15 days -> 15 days, 0.5 days -> 12 hours |
| **normalizeDuration**(`Duration`,`Date`) -> `Duration` | Converts duration into simplest possible whole unit form expressed using multiple units |
| **simplifyDuration**(`Duration`,`Date`) -> `Duration` | Converts duration into simplest possible who unit form |
| **unitsBetween**(`Date`, `Date`, `Unit`, `Number`) -> `Number` | Get number of units or multiples of units between 2 dates. |
| **wholeUnitsBetween**(`Date`, `Date`, `Unit`, `Number`) -> `Number` | Get number of whole units or multiples of units between 2 dates. |
| **timeFromDate**(`Date`) -> `Duration` | Returns time of day as a duration |
| **smallestTimeUnitFromDate**(`Date`) -> `Unit` | Returns smallest unit of time in the time of day  |
npm package: @ryki/wana-global
Description: Global store backed by wana
Author: Ryan King
Latest version: 0.3.1

# wana-global

wana-global is global store backed by wana-obervables with built-in persistence and undo / redo functionality.

    npm install @ryki/wana-global

## How to use

For an example, let's build a basic sticky notes app.

```js
import { oStore, oClass, oHistory, state, derivative } from "@ryki/wana-global";
```

We will create the following class for our sticky notes. We must use the `@oStore` decorator and extend the `oClass`

All properties using the `@state` decorator will be stored in the global state, and all other state should derive from this.

```js
@oStore("Sticky")
class Sticky extends oClass {
	@state note = "This is a sticky note";
	@state firstName = "Mary"
	@state lastName = "Jane"
}
```

We can use a `@derivative` decorator to create additional values derived from the state. Whenever the state updates the derivative will know to update.

```js
@oStore("Sticky")
class Sticky extends oClass {
	@state note = "This is a sticky note";
	@state firstName = "Mary"
	@state lastName = "Jane"
	// use @derivative derived values
	@derivative
	get name {
		return `${this.firstName} ${this.lastName}`
	}
```

Adding undo / redo functionality in eve is super easy. In this case we're using the history helper to provide localised undo / redo functionality to each individual sticky note.

```js
@oStore("Sticky")
class Sticky extends oClass {
	@state note = "This is a sticky note";
	@state firstName = "Mary"
	@state lastName = "Jane"
	@derivative
	get name {
		return `${this.firstName} ${this.lastName}`
	}
	constructor() {
		super();
		// localised history
		this.history = new oHistory(() => this)
	}
```

Now you can just create some sticky notes and the collection will automically update.

### Persistance

You can serialize and replay any session.

```js
import { oState } from "@ryki/wana-global";
const snap = oState.snapshot();
// The 2nd argument is a playback speed multiplier
oState.apply(snap, 2);
```

### Undo / Redo

A history object can listen to any classes, instances, or properties with state to create undo / redo functionality.

```js
import { oHistory } from "@ryki/wana-global";
const history = new oHistory(() => Sticky);
// this will only undo Sticky class instances but no other instances
history.undo()
history.redo()
```

### React

wana-global is framework independant but a `useChangeObserver` component is available to react users.

```js
import { useChangeObserver } from "@ryki/wana-global";

function Sticky({ sticky }) {
	const [note] = useChangeObserver(() => [sticky.note]);
	const updateNote = useCallback((e) => {
		sticky.note = e.target.value
	})
	// this will automatically update whenever note changes
	return (
		<div className="sticky">
			<textarea
				value={note}
				onChange={updateNote}
			/>
		</div>
	);
}
```
npm package: @rykie/legion-sdk-testnet-new
Description: 🛠 An SDK for building applications on top of Legionswap.
Author: ryukie
Latest version: 0.2.3

# Legionswap SDK Testnet

Forked from the [Uniswap SDK](https://github.com/Uniswap/uniswap-v2-sdk/commit/a88048e9c4198a5bdaea00883ca00c8c8e582605).

You can refer to the Uniswap SDK documentation [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/ashalfarhan/legionswap-sdk-testnet.git
```

Move into the legionswap-sdk-testnet working directory

```sh
cd legionswap-sdk-testnet/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @rykie/legionswap-sdk-testnet
Description: 🛠 An SDK for building applications on top of Legionswap.
Author: ryukie
Latest version: 0.2.4

# Legionswap SDK Testnet

Forked from the [Uniswap SDK](https://github.com/Uniswap/uniswap-v2-sdk/commit/a88048e9c4198a5bdaea00883ca00c8c8e582605).

You can refer to the Uniswap SDK documentation [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/ashalfarhan/legionswap-sdk-testnet.git
```

Move into the legionswap-sdk-testnet working directory

```sh
cd legionswap-sdk-testnet/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
# legionswap-sdk-testnet