1.1.1 • Published 3 years ago

@nimiq/oasis-api v1.1.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

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
1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago