@uprtcl/connections
TypeScript icon, indicating that this package has built-in type declarations

0.0.2-alpha3 • Public • Published

@uprtcl/connections

_Prtcl resources: Overview, Spec, Dev guide, API reference

This node package includes basic connections services to help connect to different backend platforms. These services include standard funcionality like a retry mechanism, or a ready() function to wait for them to be ready.

List of supported connections:

  • Ethereum: small wrapper around Web3
  • Ipfs: small wrapper around ipfs-http-client
  • Holochain: small wrapper around @holochain/hc-web-client
  • Web server (via http or websockets)

Dependencies

This package depends on @uprtcl/micro-orchestrator and @uprtcl/cortex to import basic types, but doesn't import funcionality from them.

Install

npm install @uprtcl/connections

Usage

Import the appropriate connection you would like to use, and make a new instance of it by passing its configuration:

import { EthereumConnection } from '@uprtcl/connections';

const ethConnection = new EthereumConnection({
  provider: provider,
  contractAbi: myContractAbi
});

await ethConnection.ready();

Package Sidebar

Install

npm i @uprtcl/connections

Homepage

uprtcl.io

Weekly Downloads

1

Version

0.0.2-alpha3

License

MIT

Unpacked Size

186 kB

Total Files

46

Last publish

Collaborators

  • sotous
  • guillem.cordoba
  • pepoospina