Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@broxus/js-core
Advanced tools
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.)
Collection of the services to manage states of the wallets connections - TVM-compatible Wallets (e.g. EVER Wallet), EVM-compatible Wallets (e.g. MetaMask), Solana-compatible Wallets (e.g. Phantom). Services to manage tokens list, DEX Account service, etc.
Service to connect to a TVM Wallet. It has connect
and disconnect
methods for manually connect
and disconnect to the wallet.
import { TvmWalletService } from '@broxus/js-core'
const tvmWalletService = new TvmWalletService({
defaultNetworkId: 42,
minWalletVersion: '2.31.0',
networks: [
{
chainId: '42',
currency: {
decimals: 9,
icon: '...',
name: 'Native currency',
symbol: 'EVER',
wrappedCurrencyAddress: new AddressLiteral( '0:a49cd4e158a9a15555e624759e2e4e766d22600b7800d891e46f9291f044a93d'), // WEVER
},
explorer: {
accountsSubPath: 'accounts',
baseUrl: 'https://everscan.io',
title: 'Everscan',
transactionsSubPath: 'transactions',
},
id: 'tvm-42',
name: 'Everscale',
provider: 'everscale',
rpcUrl: '',
shortName: 'Everscale',
type: 'tvm',
},
],
providerId: 'everscale'
})
await tvmWalletService.connect()
For add a custom token asset to the wallet extension tokens assets use method addAsset
.
await tvmWalletService.addAsset('0:a49cd4e158a9a15555e624759e2e4e766d22600b7800d891e46f9291f044a93d', 'tip3_token')
Service to connect to DEX account or create new one. Sync all related token wallets and their balances.
import { DexAccountService } from '@broxus/js-core'
const service = new DexAccountService(everWalletService, {
dexRoot: new AddressLiteral('0:5eb5713ea9b4a0f3a13bc91b282cde809636eb1e68d2fcb6427b9ad78a5a9008'),
})
First (required) argument is TvmWalletService
.
Second one (required) - options, where dexRoot
is DEX root address.
Service to connect EVM-compatible wallet.
import { EvmWalletService } from '@broxus/js-core'
const evmWalletService = new EvmWalletService({
decimals: 18,
symbol: 'ETH',
}, {
networks: [
{
chainId: '1',
currencySymbol: 'ETH',
explorerBaseUrl: 'https://etherscan.io/',
id: 'evm-1',
label: 'Ethereum',
name: 'Ethereum Mainnet',
rpcUrl: 'https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161',
transactionType: '0x2',
type: 'evm',
},
{
chainId: '56',
currencySymbol: 'BNB',
explorerBaseUrl: 'https://bscscan.com/',
id: 'evm-56',
label: 'BNB Chain (Binance Smart Chain)',
name: 'BNB Chain',
rpcUrl: 'https://bsc-dataseed.binance.org/',
transactionType: '0x0',
type: 'evm',
},
],
})
await evmWalletService.connect()
First argument is same as in TvmWalletService - blockchain native currency.
In the second argument you can pass provider options of Web3Modal in modalOptions
.
Also, you can pass list of available networks
.
Through service, you can add or change network in the connected wallet. Use methods addNetwork
and changeNetwork
evmWalletService.addNetwork('56') // add BNB network to the wallet networks list
evmWalletService.changeNetwork('1') // change network to Ethereum Mainnet
When you add network with some
chainId
- this network config should be described in thenetworks
option
Service for load and manage list of the Everscale tokens.
import { TokensListService } from '@broxus/js-core'
const tokensListService = new TokensListService('https://raw.githubusercontent.com/broxus/flatqube-assets/master/manifest.json')
await tokensListService.init()
Model for the TVM-based token
import { TvmToken } from '@broxus/js-core'
const token = new TvmToken({
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,
vendor: 'broxus'
})
const userWallet = await token.wallet(ownerAddress: Address | string)
FAQs
MobX-based JavaScript Core library
The npm package @broxus/js-core receives a total of 762 weekly downloads. As such, @broxus/js-core popularity was classified as not popular.
We found that @broxus/js-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.