@nimiq/oasis-api
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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

function init(url: string)
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>>
async function getHtlc(id: string): Promise<Htlc>
async function settleHtlc(
    id: string,
    secret: string,
    settlementJWS: string,
    authorizationToken?: string,
): Promise<Htlc<HtlcStatus.SETTLED>>
async function sandboxMockClearHtlc(id: string): Promise<boolean>
async function exchangeAuthorizationToken(token: string): Promise<string>

Helper methods

function base64ToHex(base64: string): string
function hexToBase64(hex: string): string

Readme

Keywords

Package Sidebar

Install

npm i @nimiq/oasis-api

Weekly Downloads

12

Version

1.1.1

License

Apache-2.0

Unpacked Size

15.2 kB

Total Files

4

Last publish

Collaborators

  • mraveux
  • nimiq-network
  • sisou
  • styppo
  • mnimiq
  • cb5890
  • jeffesquivels
  • danimoh