New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 - npm Package Compare versions

Comparing version 1.0.15 to 1.0.16

20

CHANGELOG.md

@@ -1,11 +0,25 @@

## Unreleased [Version 1.0.15]
## Unreleased [Version 1.0.17]
### New features
### Bug fixes
---
## [Version 1.0.16](2019-10-09)
### New features
- docs: update readme
## [Version 1.0.15](2019-10-09)
### New features
- feat: pass in projectId
- feat: pass in custom provider headers
### Bug fixes
### Other
---
- refactor: MetaMask provider pass in a object now so we can easily extend

@@ -12,0 +26,0 @@ ## [Version 1.0.14](2019-10-08)

2

package.json
{
"name": "@terminal-packages/sdk",
"version": "1.0.15",
"version": "1.0.16",
"description": "Ethereum developer tool kit for the Terminal platform",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -5,7 +5,7 @@ [![npm version](https://badge.fury.io/js/%40terminal-packages%2Fsdk.svg)](https://badge.fury.io/js/%40terminal-packages%2Fsdk)

[![Discord Channel](https://img.shields.io/discord/572498612450492419.svg?style=flat&label=Discord&color=blue)](https://t.co/cJZ2MdBPkL?amp=1)
# ![Terminal-logo](https://storage.googleapis.com/terminal-assets/images/text-black-robot-light-face-black-horizontal.png)
| [Setup Guide](#setup-guide) | [Basic Wallet Providers](#terminalhttpprovider) | [MetaMask Provider](#metamask) | [Custom Http Providers](#with-your-own-http-provider) | [Websockets](#terminalwebsocketprovider) |
| [Setup Guide](#setup-guide) | [Basic Wallet Providers](#terminalhttpprovider) | [MetaMask Provider](#metamask) | [Custom Http Providers](#with-your-own-http-provider) | [Websockets](#terminalwebsocketprovider) |
# TerminalSDK - Logging for Blockchain Infrastructure

@@ -89,7 +89,7 @@

export enum SourceType {
Terminal = "Terminal",
Truffle = "Truffle",
Alchemy = "Alchemy",
MetaMask = "MetaMask",
Infura = "Infura"
Terminal = 'Terminal',
Truffle = 'Truffle',
Alchemy = 'Alchemy',
MetaMask = 'MetaMask',
Infura = 'Infura'
}

@@ -101,12 +101,12 @@ ```

```js
import { TerminalHttpProvider, SourceType } from "@terminal-packages/sdk";
import Web3 from "web3";
import { TerminalHttpProvider, SourceType } from '@terminal-packages/sdk';
import Web3 from 'web3';
const web3 = new Web3(
new TerminalHttpProvider({
host: "https://yourethnodeurl.io",
apiKey: "yourApiKey",
host: 'https://yourethnodeurl.io',
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -121,12 +121,12 @@ source: SourceType.Terminal

```js
const sdk = require("@terminal-packages/sdk");
const Web3 = require("web3");
const sdk = require('@terminal-packages/sdk');
const Web3 = require('web3');
const web3 = new Web3(
new sdk.TerminalHttpProvider({
host: "https://yourethnodeurl.io",
apiKey: "yourApiKey",
host: 'https://yourethnodeurl.io',
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -205,11 +205,11 @@ source: SourceType.Terminal

```js
import { TerminalHttpProvider, SourceType } from "@terminal-packages/sdk";
import Web3 from "web3";
import { TerminalHttpProvider, SourceType } from '@terminal-packages/sdk';
import Web3 from 'web3';
const web3 = new Web3(
new TerminalHttpProvider({
apiKey: "yourApiKey",
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -225,11 +225,11 @@ source: SourceType.Terminal,

```js
const sdk = require("@terminal-packages/sdk");
const Web3 = require("web3");
const sdk = require('@terminal-packages/sdk');
const Web3 = require('web3');
const web3 = new Web3(
new sdk.TerminalHttpProvider({
apiKey: "yourApiKey",
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -250,5 +250,5 @@ source: SourceType.Terminal,

export enum EnvironmentTypes {
dev = "dev",
staging = "staging",
live = "live"
dev = 'dev',
staging = 'staging',
live = 'live'
}

@@ -264,12 +264,12 @@ ```

SourceType
} from "@terminal-packages/sdk";
import Web3 from "web3";
} from '@terminal-packages/sdk';
import Web3 from 'web3';
const web3 = new Web3(
new TerminalHttpProvider({
host: "https://yourethnodeurl.io",
apiKey: "yourApiKey",
host: 'https://yourethnodeurl.io',
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -285,12 +285,12 @@ source: SourceType.Terminal,

```js
const sdk = require("@terminal-packages/sdk");
const Web3 = require("web3");
const sdk = require('@terminal-packages/sdk');
const Web3 = require('web3');
const web3 = new Web3(
new sdk.TerminalHttpProvider({
host: "https://yourethnodeurl.io",
apiKey: "yourApiKey",
host: 'https://yourethnodeurl.io',
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -311,7 +311,7 @@ source: SourceType.Terminal,

export enum SourceType {
Terminal = "Terminal",
Truffle = "Truffle",
Alchemy = "Alchemy",
MetaMask = "MetaMask",
Infura = "Infura"
Terminal = 'Terminal',
Truffle = 'Truffle',
Alchemy = 'Alchemy',
MetaMask = 'MetaMask',
Infura = 'Infura'
}

@@ -323,12 +323,12 @@ ```

```js
import { TerminalHttpProvider, SourceType } from "@terminal-packages/sdk";
import { ethers } from "ethers";
import { TerminalHttpProvider, SourceType } from '@terminal-packages/sdk';
import { ethers } from 'ethers';
const provider = new ethers.providers.Web3Provider(
new TerminalHttpProvider({
host: "https://yourethnodeurl.io",
apiKey: "yourApiKey",
host: 'https://yourethnodeurl.io',
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -343,12 +343,12 @@ source: SourceType.Terminal

```js
const sdk = require("@terminal-packages/sdk");
const ethers = require("ethers");
const sdk = require('@terminal-packages/sdk');
const ethers = require('ethers');
const provider = new ethers.providers.Web3Provider(
new sdk.TerminalHttpProvider({
host: "https://yourethnodeurl.io",
apiKey: "yourApiKey",
host: 'https://yourethnodeurl.io',
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -427,11 +427,11 @@ source: SourceType.Terminal

```js
import { TerminalHttpProvider } from "@terminal-packages/sdk";
import { ethers } from "ethers";
import { TerminalHttpProvider } from '@terminal-packages/sdk';
import { ethers } from 'ethers';
const provider = new ethers.providers.Web3Provider(
new TerminalHttpProvider({
apiKey: "yourApiKey",
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -447,11 +447,11 @@ source: SourceType.Terminal,

```js
const sdk = require("@terminal-packages/sdk");
const ethers = require("ethers");
const sdk = require('@terminal-packages/sdk');
const ethers = require('ethers');
const provider = new ethers.providers.Web3Provider(
new sdk.TerminalHttpProvider({
apiKey: "yourApiKey",
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -472,5 +472,5 @@ source: SourceType.Terminal,

export enum EnvironmentTypes {
dev = "dev",
staging = "staging",
live = "live"
dev = 'dev',
staging = 'staging',
live = 'live'
}

@@ -486,12 +486,12 @@ ```

SourceType
} from "@terminal-packages/sdk";
import { ethers } from "ethers";
} from '@terminal-packages/sdk';
import { ethers } from 'ethers';
const provider = new ethers.providers.Web3Provider(
new TerminalHttpProvider({
host: "https://yourethnodeurl.io",
apiKey: "yourApiKey",
host: 'https://yourethnodeurl.io',
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -507,12 +507,12 @@ source: SourceType.Terminal,

```js
const sdk = require("@terminal-packages/sdk");
const ethers = require("ethers");
const sdk = require('@terminal-packages/sdk');
const ethers = require('ethers');
const provider = new ethers.providers.Web3Provider(
new sdk.TerminalHttpProvider({
host: "https://yourethnodeurl.io",
apiKey: "yourApiKey",
host: 'https://yourethnodeurl.io',
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -534,11 +534,11 @@ source: SourceType.Terminal,

```js
import { TerminalHttpProvider, SourceType } from "@terminal-packages/sdk";
import Web3 from "web3";
import { TerminalHttpProvider, SourceType } from '@terminal-packages/sdk';
import Web3 from 'web3';
const web3 = new Web3(
new TerminalHttpProvider({
apiKey: "yourApiKey",
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -554,11 +554,11 @@ source: SourceType.Terminal,

```js
import { TerminalHttpProvider, SourceType } from "@terminal-packages/sdk";
import { ethers } from "ethers";
import { TerminalHttpProvider, SourceType } from '@terminal-packages/sdk';
import { ethers } from 'ethers';
const provider = new ethers.providers.Web3Provider(
new TerminalHttpProvider({
apiKey: "yourApiKey",
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -581,7 +581,7 @@ source: SourceType.Terminal,

export enum SourceType {
Terminal = "Terminal",
Truffle = "Truffle",
Alchemy = "Alchemy",
MetaMask = "MetaMask",
Infura = "Infura"
Terminal = 'Terminal',
Truffle = 'Truffle',
Alchemy = 'Alchemy',
MetaMask = 'MetaMask',
Infura = 'Infura'
}

@@ -594,4 +594,4 @@ ```

export enum Web3Versions {
one = "1",
two = "2"
one = '1',
two = '2'
}

@@ -609,12 +609,12 @@ ```

Web3Versions
} from "@terminal-packages/sdk";
import Web3 from "web3";
} from '@terminal-packages/sdk';
import Web3 from 'web3';
const web3 = new Web3(
new TerminalWebsocketProvider({
host: "wss://yourethnodeurl.io",
apiKey: "yourApiKey",
host: 'wss://yourethnodeurl.io',
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -631,12 +631,12 @@ source: SourceType.Terminal,

```js
const sdk = require("@terminal-packages/sdk");
const Web3 = require("web3");
const sdk = require('@terminal-packages/sdk');
const Web3 = require('web3');
const web3 = new Web3(
new sdk.TerminalWebsocketProvider({
host: "wss://yourethnodeurl.io",
apiKey: "yourApiKey",
host: 'wss://yourethnodeurl.io',
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -736,11 +736,11 @@ source: SourceType.Terminal,

Web3Versions
} from "@terminal-packages/sdk";
import Web3 from "web3";
} from '@terminal-packages/sdk';
import Web3 from 'web3';
const web3 = new Web3(
new TerminalWebsocketProvider({
apiKey: "yourApiKey",
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -758,11 +758,11 @@ source: SourceType.Terminal,

```js
const sdk = require("@terminal-packages/sdk");
const Web3 = require("web3");
const sdk = require('@terminal-packages/sdk');
const Web3 = require('web3');
const web3 = new Web3(
new sdk.TerminalWebsocketProvider({
apiKey: "yourApiKey",
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -785,7 +785,7 @@ source: SourceType.Terminal,

export enum SourceType {
Terminal = "Terminal",
Truffle = "Truffle",
Alchemy = "Alchemy",
MetaMask = "MetaMask",
Infura = "Infura"
Terminal = 'Terminal',
Truffle = 'Truffle',
Alchemy = 'Alchemy',
MetaMask = 'MetaMask',
Infura = 'Infura'
}

@@ -798,4 +798,4 @@ ```

export enum Web3Versions {
one = "1",
two = "2"
one = '1',
two = '2'
}

@@ -811,12 +811,12 @@ ```

Web3Versions
} from "@terminal-packages/sdk";
import { ethers } from "ethers";
} from '@terminal-packages/sdk';
import { ethers } from 'ethers';
const provider = new ethers.providers.Web3Provider(
new TerminalWebsocketProvider({
host: "wss://yourethnodeurl.io",
apiKey: "yourApiKey",
host: 'wss://yourethnodeurl.io',
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -833,12 +833,12 @@ source: SourceType.Terminal,

```js
const sdk = require("@terminal-packages/sdk");
const ethers = require("ethers");
const sdk = require('@terminal-packages/sdk');
const ethers = require('ethers');
const provider = new ethers.providers.Web3Provider(
new sdk.TerminalWebsocketProvider({
host: "wss://yourethnodeurl.io",
apiKey: "yourApiKey",
host: 'wss://yourethnodeurl.io',
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -937,11 +937,11 @@ source: SourceType.Terminal,

Web3Versions
} from "@terminal-packages/sdk";
import { ethers } from "ethers";
} from '@terminal-packages/sdk';
import { ethers } from 'ethers';
const web3 = new ethers.providers.Web3Provider(
new TerminalWebsocketProvider({
apiKey: "yourApiKey",
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -959,11 +959,11 @@ source: SourceType.Terminal,

```js
const sdk = require("@terminal-packages/sdk");
const ethers = require("ethers");
const sdk = require('@terminal-packages/sdk');
const ethers = require('ethers');
const web3 = new ethers.providers.Web3Provider(
new sdk.TerminalWebsocketProvider({
apiKey: "yourApiKey",
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -991,11 +991,11 @@ source: SourceType.Terminal,

Web3Versions
} from "@terminal-packages/sdk";
import Web3 from "web3";
} from '@terminal-packages/sdk';
import Web3 from 'web3';
const web3 = new Web3(
new TerminalWebsocketProvider({
apiKey: "yourApiKey",
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -1017,11 +1017,11 @@ source: SourceType.Terminal,

Web3Versions
} from "@terminal-packages/sdk";
import { ethers } from "ethers";
} from '@terminal-packages/sdk';
import { ethers } from 'ethers';
const provider = new ethers.providers.Web3Provider(
new TerminalWebsocketProvider({
apiKey: "yourApiKey",
apiKey: 'yourApiKey',
// projectId is not required to log but we suggest
// using it for the best experience
projectId: "YOUR_TERMINAL_PROJECT_ID",
projectId: 'YOUR_TERMINAL_PROJECT_ID',
// source can be a dynamic string as well

@@ -1042,2 +1042,12 @@ source: SourceType.Terminal,

### MetaMask options:
```ts
export interface IMetaMaskOptions {
apiKey: string;
projectId?: string | undefined;
environmentType?: EnvironmentTypes | undefined;
}
```
If your dapp is using `MetaMask` as the wallet signer, you will not be able to use the custom provider code explained above in the `TerminalHttpProvider` section. `MetaMask` injects it's own `web3` instance onto the global window of the browser (`window.web3`) and our script wraps that `web3` instance with our `TerminalHttpProvider` so we can start logging `jsonrpc` calls for you. Don't worry, `MetaMask` will do all the calls still, we just proxy the request and the response so we can log it.

@@ -1053,3 +1063,3 @@

<script type="text/JavaScript">
window.terminal.sdk.metamask.startLogging('YOUR_API_KEY');
window.terminal.sdk.metamask.startLogging({apiKey: 'YOUR_API_KEY', projectId: 'YOUR_PROJECT_ID'});
</script>

@@ -1059,3 +1069,3 @@ <!-- END TERMINAL SCRIPTS -->

By default it will use the `live` environment but if you want to use `dev` or `staging` you can use the 2nd parameter in the `startLogging` method:
By default it will use the `live` environment but if you want to use `dev` or `staging` you can set the `environmentType`

@@ -1065,3 +1075,7 @@ dev:

```js
window.terminal.sdk.metamask.startLogging("YOUR_API_KEY", "dev");
window.terminal.sdk.metamask.startLogging({
apiKey: 'YOUR_API_KEY',
projectId: 'YOUR_PROJECT_ID',
environmentType: 'dev'
});
```

@@ -1072,3 +1086,7 @@

```js
window.terminal.sdk.metamask.startLogging("YOUR_API_KEY", "staging");
window.terminal.sdk.metamask.startLogging({
apiKey: 'YOUR_API_KEY',
projectId: 'YOUR_PROJECT_ID',
environmentType: 'staging'
});
```

@@ -1075,0 +1093,0 @@

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