Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bosonprotocol/common

Package Overview
Dependencies
Maintainers
10
Versions
508
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bosonprotocol/common

Common package

  • 1.8.0-alpha.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5K
increased by34.56%
Maintainers
10
Weekly downloads
 
Created
Source

@bosonprotocol/common

JS lib with common types, interfaces and utilities shared by the core components of the Boson Protocol.

Install

npm install @bosonprotocol/common

# OR

yarn add @bosonprotocol/common

Usage

ABIs

Useful ABIs can be imported.

import { abis } from "@bosonprotocol/common";

const { ProtocolDiamondABI } = abis;

Default configs

We provide default configurations for multiple chains that can be used for easier interaction on different environments.

import { getDefaultConfig } from "@bosonprotocol/common";

const defaultConfigOnRopsten = getDefaultConfig({
  chainId: 3
});
// {
//   ...otherConfigParameters,
//   subgraphUrl: "https://api.thegraph.com/subgraphs/name/bosonprotocol/ccropsten",
//   contracts: {
//     protocolDiamond: "0x5E3f5127e320aD0C38a21970E327eefEf12561E5"
//   }
// }

Interfaces and types

Interfaces and types can also be imported. This might be useful for implementing custom a Web3LibAdapter or MetadataStorage.

import { Web3LibAdapter, MetadataStorage } from "@bosonprotocol/common";

class CustomWeb3LibAdapter implements Web3LibAdapter {
  // implementation
}

class CustomMetadataStorage implements MetadataStorage {
  // implementation
}
Web3LibAdapter

The core-sdk has the following features:

  • web3 lib agnostic
  • lightweight
  • consists of composable building blocks
  • leverages existing tools, such as TypeChain

To achieve these, we use an adapter pattern with Web3LibAdapter being the interface.

An example implementation is the EthersAdapter targeting the ethers library.

FAQs

Package last updated on 30 Jun 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc