@broxus/js-core
TypeScript icon, indicating that this package has built-in type declarations

0.33.1 • Public • Published

Broxus JavaScript Core

Introduction

This library provides MobX-based services, models and helpers to build JavaScript Applications with any popular frameworks or libraries (e.g. React, Angular, Vue, etc.)

Core

AbstractStore

Abstract class AbstractStore is a primary way to create any services or stores that provides API to manage state and data:

abstract class AbstractStore {
    setData(keyOrData: string | object | ((prevData) => nextData)): this
    setState(keyOrState: string | object | ((prevState) => nextState)): this
    toJSON(): object
}

TvmContractWrapper

Abstract class TvmContractWrapper is a primary way to create models (wrapper for contract)

abstract class TvmContractWrapper {
    address: Address
    contractState?: FullContractState
    isDeployed?: boolean
    isSyncing?: boolean
    syncedAt?: number
    async syncContractState(): Promise<FullContractState | undefined>
    abstract watch?(): Promise<Subscriber>
    abstract unwatch?(): Promise<void>
}

Models

TvmToken

Model of the TVM-based token

import { TvmToken } from '@broxus/js-core'

const token = new TvmToken(tvmWalletService.connection, {
    name: 'Wrapped EVER',
    symbol: 'WEVER',
    decimals: 9,
    address: '0:a49cd4e158a9a15555e624759e2e4e766d22600b7800d891e46f9291f044a93d',
    logoURI: 'https://raw.githubusercontent.com/broxus/flatqube-assets/master/icons/WEVER/logo.svg',
    version: 5,
    verified: true,
}, [tvmWalletService.provider])

await token.sync({ force: true, silent: true })

const userWallet = await token.wallet(ownerAddress: Address | string)

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.33.185latest

Version History

VersionDownloads (Last 7 Days)Published
0.33.185
0.33.013
0.32.16
0.32.02
0.31.28
0.31.12
0.31.00
0.30.60
0.30.53
0.30.40
0.30.30
0.30.21
0.30.11
0.30.00
0.29.00
0.28.00
0.27.20
0.27.10
0.27.01
0.26.01
0.25.01
0.24.01
0.23.10
0.23.020
0.22.10
0.22.00
0.21.00
0.20.11
0.20.01
0.19.30
0.19.21
0.19.10
0.19.00
0.18.11
0.18.01
0.17.100
0.17.90
0.17.80
0.17.70
0.17.61
0.17.50
0.17.40
0.17.31
0.17.20
0.17.10
0.17.01
0.16.30
0.16.21
0.16.10
0.16.00
0.15.01
0.14.20
0.14.10
0.14.00
0.13.70
0.13.60
0.13.50
0.13.40
0.13.30
0.13.21
0.13.10
0.13.00
0.12.10
0.12.00
0.11.23
0.11.12
0.11.00
0.10.70
0.10.60
0.10.50
0.10.40
0.10.31
0.10.20
0.10.11
0.10.01
0.9.10
0.9.01
0.8.01
0.7.00
0.6.11
0.6.00
0.5.20
0.5.10
0.5.00
0.4.60
0.4.51
0.4.40
0.4.30
0.4.20
0.4.10
0.4.00
0.3.00
0.2.10
0.2.00
0.1.10
0.1.00

Package Sidebar

Install

npm i @broxus/js-core

Weekly Downloads

154

Version

0.33.1

License

MIT

Unpacked Size

2.39 MB

Total Files

468

Last publish

Collaborators

  • rexagon
  • pavlovdog_
  • geronimo
  • 30mb1
  • odrin
  • pavel337
  • maxpretorian