2.0.7 • Published 5 months ago

@signumjs/core v2.0.7

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

@signumjs/core

Core module to build cool apps for the Signum blockchain platform

Installation

SignumJS is an isomorphic SDK and can be used with NodeJS, Web Browser, and even React Native. For non-pure Javascript Apps, e.g. PHP, .Net, it is possible to use a bundled/minified version.

Using with NodeJS and/or modern web frameworks

Install using npm:

npm install @signumjs/core

or using yarn:

yarn add @signumjs/core

Example

import {LedgerClientFactory} from '@signumjs/core'
import {Amount} from '@signumjs/util'

const ledger = LedgerClientFactory.createClient({
    nodeHost: "https://europe3.testnet.network"
});

// this self-executing file makes turns this file into a starting point of your app

(async () => {
    try {
        const {balanceNQT} = await ledger.account.getAccountBalance('13036514135565182944')
        console.log(`Account Balance: ${Amount.fromPlanck(balanceNQT).toString()}`)
    } catch (e) { // e is of type HttpError (as part of @signumjs/http)
        console.error(`Whooops, something went wrong: ${e.message}`)
    }
})()

Using in classic <script>

This is useful for plain html, js, css and also for PHP, .Net etc

Each package is available as bundled standalone library using IIFE. This way SignumJS can be used also within <script>-Tags. This might be useful for Wordpress and/or other PHP applications.

Just import the package using the HTML <script> tag.

<script src='https://cdn.jsdelivr.net/npm/@signumjs/core/dist/signumjs.min.js'></script>

Example

(() => {
    const ledger = sig$.LedgerClientFactory.createClient( {nodeHost: "https://europe3.testnet.network"});
    ledger.network.getBlockchainStatus().then(console.log).catch(console.error);
})()

Initialize Crypto Module

The above examples don't need any specific cryptographic features. But when it comes up to signing/creating transactions, deciphering P2P messages you may encounter the following error:

No Crypto Adapter provided - Use [Crypto.init()] first

You have to initialize the Crypto Module according to your platform somewhere in your apps entry point

NodeJS

import {Crypto} from "@signumjs/crypto"
import {NodeJSCryptoAdapter} from "@signumjs/crypto/adapters"

Crypto.init(new NodeJSCryptoAdapter());

Web/Browser

import {Crypto} from "@signumjs/crypto"
import {WebCryptoAdapter} from "@signumjs/crypto/adapters"

Crypto.init(new WebCryptoAdapter());

For React Native/Expo see here

See more here: @signumjs/core Online Documentation

2.0.2

6 months ago

2.0.5

6 months ago

2.0.4

6 months ago

2.0.7

5 months ago

2.0.6

5 months ago

2.0.1

6 months ago

2.0.0

6 months ago

1.0.0-rc.71

2 years ago

1.0.0-rc.75

2 years ago

1.0.0-rc.74

2 years ago

1.0.0-rc.73

2 years ago

1.0.0-rc.72

2 years ago

1.0.0-rc.70

2 years ago

1.0.0-rc.60

2 years ago

1.0.0-rc.57

2 years ago

1.0.0-rc.56

2 years ago

1.0.0-rc.59

2 years ago

1.0.0-rc.58

2 years ago

1.0.0-rc.64

2 years ago

1.0.0-rc.63

2 years ago

1.0.0-rc.62

2 years ago

1.0.0-rc.61

2 years ago

1.0.0-rc.68

2 years ago

1.0.0-rc.67

2 years ago

1.0.0-rc.66

2 years ago

1.0.0-rc.65

2 years ago

1.0.0-rc.69

2 years ago

1.0.0-rc.53

3 years ago

1.0.0-rc.55

3 years ago

1.0.0-rc.54

3 years ago

1.0.0-rc.42

3 years ago

1.0.0-rc.41

3 years ago

1.0.0-rc.40

3 years ago

1.0.0-rc.46

3 years ago

1.0.0-rc.45

3 years ago

1.0.0-rc.44

3 years ago

1.0.0-rc.43

3 years ago

1.0.0-rc.49

3 years ago

1.0.0-rc.48

3 years ago

1.0.0-rc.47

3 years ago

1.0.0-rc.52

3 years ago

1.0.0-rc.51

3 years ago

1.0.0-rc.50

3 years ago

1.0.0-rc.39

3 years ago

1.0.0-rc.38

3 years ago

1.0.0-rc.37

3 years ago

1.0.0-rc.36

3 years ago

1.0.0-rc.31

3 years ago

1.0.0-rc.34

3 years ago

1.0.0-rc.33

3 years ago

1.0.0-rc.32

3 years ago

1.0.0-rc.28

3 years ago

1.0.0-rc.29

3 years ago

1.0.0-rc.30

3 years ago

1.0.0-rc.20

3 years ago

1.0.0-rc.24

3 years ago

1.0.0-rc.23

3 years ago

1.0.0-rc.22

3 years ago

1.0.0-rc.21

3 years ago

1.0.0-rc.27

3 years ago

1.0.0-rc.26

3 years ago

1.0.0-rc.25

3 years ago

1.0.0-rc.19

3 years ago

1.0.0-rc.18

3 years ago

1.0.0-rc.17

3 years ago

1.0.0-rc.16

3 years ago

1.0.0-rc.15

3 years ago

1.0.0-rc.14

3 years ago

1.0.0-rc.9

3 years ago

1.0.0-rc.13

3 years ago

1.0.0-rc.12

3 years ago

1.0.0-rc.11

3 years ago

1.0.0-rc.10

3 years ago

1.0.0-rc.8

4 years ago

1.0.0-rc.7

4 years ago

1.0.0-rc.5

4 years ago

1.0.0-rc.6

4 years ago

1.0.0-rc.4

4 years ago

1.0.0-rc.3

4 years ago

1.0.0-rc.2

4 years ago

1.0.0-rc.1

4 years ago

1.0.0-rc.0

4 years ago