Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@bosonprotocol/common

Package Overview
Dependencies
45
Maintainers
3
Versions
465
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bosonprotocol/common

Common configs, types, interfaces and utilities shared by the core components of the Boson Protocol.


Version published
Weekly downloads
725
decreased by-41.86%
Maintainers
3
Created
Weekly downloads
 

Readme

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 environments that can be used for easier interaction.

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

const defaultConfigOnRopsten = getDefaultConfig("staging");
// {
//   ...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

Last updated on 11 Jun 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc