0.6.0-beta.6 • Published 3 years ago

@burstjs/core v0.6.0-beta.6

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

@burstjs/core

Burst-related functions and models for building Burstcoin applications.

Installation

burstJS can be used with NodeJS or Web. Two formats are available

Using with NodeJS and/or modern web frameworks

Install using npm:

npm install @burstjs/core

or using yarn:

yarn add @burstjs/core

Example

import {composeApi, ApiSettings} from '@burstjs/core'
import {BurstValue} from '@burstjs/util'

const apiSettings = new ApiSettings('https://testnet.burstcoin.network:6876');
const api = composeApi(apiSettings);

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

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

Using in classic <script>

Each package is available as bundled standalone library using IIFE. This way burstJS 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/@burstjs/core/dist/burstjs.min.js'></script>

Example

(function(){
const api = b$.composeApi({nodeHost: "https://testnet.burstcoin.network:6876"});

api.network.getBlockchainStatus().then(console.log).catch(console.error);
})()

See more here:

@burstjs/core Online Documentation


API Reference

Modules

Classes

api

const api = apiComposer .create(burstService) .withMessageApi({ sendTextMessage }) .withAccountApi({ getAccountTransactions, getUnconfirmedAccountTransactions, getAccountBalance, generateSendTransactionQRCode, generateSendTransactionQRCodeAddress, }) .compose();

api~ApiSettings

Kind: inner class of api

new ApiSettings(nodeHost, apiVersion, httpClientOptions)

ParamTypeDescription
nodeHoststringThe url of the Burst peer
apiVersionApiVersionFor future usage.
httpClientOptionsany | AxiosRequestSettingsOptional http options, like additional header. The default implementation uses axios. In case of a custom client pass your own options. see Axios Configuration

api

api~ApiSettings

Kind: inner class of api

new ApiSettings(nodeHost, apiVersion, httpClientOptions)

ParamTypeDescription
nodeHoststringThe url of the Burst peer
apiVersionApiVersionFor future usage.
httpClientOptionsany | AxiosRequestSettingsOptional http options, like additional header. The default implementation uses axios. In case of a custom client pass your own options. see Axios Configuration

api ⇒

Returns: The complete API

ParamDescription
settingsnecessary execution context

api~ApiSettings

Kind: inner class of api

new ApiSettings(nodeHost, apiVersion, httpClientOptions)

ParamTypeDescription
nodeHoststringThe url of the Burst peer
apiVersionApiVersionFor future usage.
httpClientOptionsany | AxiosRequestSettingsOptional http options, like additional header. The default implementation uses axios. In case of a custom client pass your own options. see Axios Configuration

core ⇒

Returns: return Identifier, if exists, otherwise undefined

ParamDescription
transactionThe transaction to be checked

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core ⇒

Returns: true, if version string matches

ParamDescription
transactionThe transaction to be checked
versionIdentifierThe version string, i.e. MultiOutCreation

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

Kind: instance method of BurstService
Returns: string - The mounted url (without host)
See: https://burstwiki.org/wiki/The_Burst_API

ParamTypeDescription
methodstringThe method name for requestType
dataanyA JSON object which will be mapped to url params

burstService.query(method, args, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API
argsanyA JSON object which will be mapped to url params
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

burstService.send(method, args, body, options) ⇒ Promise.<T>

Kind: instance method of BurstService
Returns: Promise.<T> - The response data of success
Throws:

ParamTypeDescription
methodstringThe BRS method according https://burstwiki.org/wiki/The_Burst_API. Note that there are only a few POST methods
argsanyA JSON object which will be mapped to url params
bodyanyAn object with key value pairs to submit as post body
optionsany | AxiosRequestConfigThe optional request configuration for the passed Http client

core ⇒

Deprecated

Returns: HttpParams
Internal:

ParamDescription
transactionThe transaction with the attachment
paramsSome HttpParams

core~BurstService

Kind: inner class of core

new BurstService(settings)

ParamDescription
settingsThe settings for the service

burstService.toBRSEndpoint(method, data) ⇒ string

0.6.0-beta.6

3 years ago

0.6.0-beta.5

3 years ago

0.6.0-beta.4

3 years ago

0.6.0-beta.3

3 years ago

0.6.0-beta.2

3 years ago

0.6.0-beta.1

3 years ago

0.6.0-alpha.9

3 years ago

0.6.0-alpha.8

3 years ago

0.6.0-alpha.7

3 years ago

0.6.0-alpha.6

3 years ago

0.6.0-alpha.5

3 years ago

0.6.0-alpha.4

3 years ago

0.6.0-alpha.3

3 years ago

0.6.0-alpha.2

3 years ago

0.6.0-alpha.1

3 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.5.0-beta.12

4 years ago

0.5.0-beta.11

4 years ago

0.5.0-beta.10

4 years ago

0.5.0-beta.9

4 years ago

0.5.0-beta.8

4 years ago

0.5.0-beta.7

4 years ago

0.5.0-beta.6

4 years ago

0.5.0-beta.5

4 years ago

0.5.0-beta.4

4 years ago

0.5.0-beta.3

4 years ago

0.5.0-beta.2

4 years ago

0.5.0-beta.1

4 years ago

0.5.0-alpha.3

4 years ago

0.5.0-alpha.2

4 years ago

0.5.0-alpha.1

4 years ago

0.5.0-alpha.0

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.1.0-rc.3.2

5 years ago

0.1.0-rc.3.1

5 years ago

0.1.0-rc.3

5 years ago

0.1.0-rc.2

5 years ago

0.1.0-rc1

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago