open-index/open-npm huggingface dataset:
npm package: @nimiq/nano-api
Description: Nano Network API
Author: Nimiq
Latest version: 0.7.6

# [To be Deprecated Soon]
While this library is still in use in our applications, we don't recommend to use it, as it is going to be deprecated soon. Instead, please refer to https://nimiq.com/developers/#tutorials.

# Nano Api
A high-level API to the Nimiq nano client. This is intended to be the basis for nimiq wallet applications. 

## Setup
```
npm install @nimiq/nano-api
```
or
```
yarn add @nimiq/nano-api
```

Create an Instance:
```javascript
const config = {
	cdn: 'https://cdn.nimiq.com/nimiq.js',
	network: 'test' // or 'main'
}
const nimiq = new NanoApi(config)

```
npm package: @nimiq/oasis-api
Description: Typed Javascript library to access OASIS APIs from the browser.
Author: Nimiq Network Ltd.
Latest version: 1.1.1

# OASIS API for Javascript, typed

A simple ES5 library to interact with the OASIS API.

## Package

This package can be installed from NPM as

```
@nimiq/oasis-api
```

https://www.npmjs.com/package/@nimiq/oasis-api

## API

```ts
function init(url: string)
```

```ts
async function createHtlc(
    contract: {
        asset: Asset,
        amount: number,
        beneficiary: OctetKeyPair | EllipticCurveKey,
        hash: {
            algorithm: 'sha256' | 'blake2b',
            value: string,
        },
        preimage: {
            size: 32,
        },
        expires: number,
        includeFee: boolean,
    },
    authorizationToken?: string,
): Promise<Htlc<HtlcStatus.PENDING>>
```

```ts
async function getHtlc(id: string): Promise<Htlc>
```

```ts
async function settleHtlc(
    id: string,
    secret: string,
    settlementJWS: string,
    authorizationToken?: string,
): Promise<Htlc<HtlcStatus.SETTLED>>
```

```ts
async function sandboxMockClearHtlc(id: string): Promise<boolean>
```

```ts
async function exchangeAuthorizationToken(token: string): Promise<string>
```

## Helper methods

```ts
function base64ToHex(base64: string): string
```

```ts
function hexToBase64(hex: string): string
```