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

@terminal-packages/sdk

Package Overview
Dependencies
Maintainers
3
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@terminal-packages/sdk

Terminals sdk

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
59
increased by247.06%
Maintainers
3
Weekly downloads
 
Created
Source

hex-sdk

TerminalHttpProvider

Basic provider options:
export enum SoureTypes {
  Terminal = 'Terminal',
  Truffle = 'Truffle',
  Alchemy = 'Alchemy'
}
import Web3 from 'web3';
import { TerminalHttpProvider, SoureTypes } from '@terminal-packages/sdk';

const web3 = new Web3(
  new TerminalHttpProvider({
    host: 'https://yourethnodeurl.io',
    apiKey: 'yourApiKey',
    source: SoureTypes.Terminal // source can be a dynamic string as well
  })
);
With provider options
  • timeout - optional
  • headers - optional
  • withCredentials - optional
import Web3 from 'web3';
import { TerminalHttpProvider } from '@terminal-packages/sdk';

const web3 = new Web3(
  new TerminalHttpProvider({
    host: 'https://yourethnodeurl.io',
    apiKey: 'yourApiKey',
    source: SoureTypes.Terminal // source can be a dynamic string as well
    timeout: 10000,
    headers: [{ name: 'x-custom-header' value: 'example' }],
    withCredentials: true
  })
);
With your own http custom provider
import Web3 from 'web3';
import { TerminalHttpProvider } from '@terminal-packages/sdk';

const web3 = new Web3(
  new TerminalHttpProvider({
    apiKey: 'yourApiKey',
    source: SoureTypes.Terminal // source can be a dynamic string as well
    customHttpProvider: new YourCustomHttpProvider()
  })
);
Running against a different environment then live, example below is with basic provider options but environment can be passed in within any of the examples above:

Environment type enum:

export enum EnvironmentTypes {
  dev = 'dev',
  staging = 'staging',
  live = 'live'
}
import Web3 from 'web3';
import { TerminalHttpProvider, EnvironmentTypes } from '@terminal-packages/sdk';

const web3 = new Web3(
  new TerminalHttpProvider({
    host: 'https://yourethnodeurl.io',
    apiKey: 'yourApiKey',
    source: 'node source',
    environment: EnvironmentTypes.dev
  })
);

FAQs

Package last updated on 17 Sep 2019

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