Socket
Socket
Sign inDemoInstall

@terra-money/terra.js

Package Overview
Dependencies
Maintainers
5
Versions
230
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@terra-money/terra.js - npm Package Compare versions

Comparing version 0.4.14-rc.0 to 0.4.14-rc.1

13

dist/extension/index.d.ts

@@ -0,7 +1,18 @@

import { Msg } from '../core/Msg';
declare type SendDataType = 'connect' | 'post';
interface SendData {
id: number | string;
type: SendDataType;
[key: string]: any;
}
export declare class Extension {
static instance: Extension;
private inpageStream;
private sequence;
constructor();
send(data: object): void;
send(data: SendData): void;
on(name: string, callback: (payload: any) => void): void;
connect(): number;
post(msgs: Msg[]): number;
}
export {};

@@ -8,2 +8,3 @@ "use strict";

function Extension() {
this.sequence = 1;
if (Extension.instance) {

@@ -18,2 +19,4 @@ return Extension.instance;

}
// low level function for sending message to extension.
// Do not use this function unless you know what you are doing.
Extension.prototype.send = function (data) {

@@ -27,2 +30,19 @@ this.inpageStream.write(data);

};
Extension.prototype.connect = function () {
var id = this.sequence++;
this.send({
id: id,
type: 'connect',
});
return id;
};
Extension.prototype.post = function (msgs) {
var id = this.sequence++;
this.send({
id: id,
type: 'post',
msgs: msgs.map(function (msg) { return msg.toJSON(); }),
});
return id;
};
return Extension;

@@ -29,0 +49,0 @@ }());

2

package.json
{
"version": "0.4.14-rc.0",
"version": "0.4.14-rc.1",
"license": "MIT",

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

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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