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

@colony/colony-js-contract-client

Package Overview
Dependencies
Maintainers
6
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@colony/colony-js-contract-client - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

34

lib/classes/ContractMethodMultisigSender.js

@@ -92,3 +92,3 @@ 'use strict';

value: function () {
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(payload, signers) {
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(args) {
var op;

@@ -99,4 +99,4 @@ return _regenerator2.default.wrap(function _callee$(_context) {

case 0:
// This will throw an error if the payload or signers are deemed invalid.
op = new _MultisigOperation2.default(this, payload, signers);
// Will throw an error if the payload, signers or nonce are deemed invalid.
op = new _MultisigOperation2.default(this, args);
_context.next = 3;

@@ -116,3 +116,3 @@ return op.refresh();

function _startOperation(_x, _x2) {
function _startOperation(_x) {
return _ref2.apply(this, arguments);

@@ -149,3 +149,3 @@ }

function getRequiredSignees(_x3) {
function getRequiredSignees(_x2) {
return _ref3.apply(this, arguments);

@@ -214,3 +214,3 @@ }

function send(_x4, _x5) {
function send(_x3, _x4) {
return _ref5.apply(this, arguments);

@@ -244,3 +244,3 @@ }

function sendMultisig(_x6, _x7) {
function sendMultisig(_x5, _x6) {
return _ref6.apply(this, arguments);

@@ -269,7 +269,9 @@ }

return _context6.abrupt('return', this._startOperation({
data: data,
inputValues: inputValues,
destinationAddress: this.client.contract.address,
sourceAddress: this.client.contract.address,
value: 0
payload: {
data: data,
inputValues: inputValues,
destinationAddress: this.client.contract.address,
sourceAddress: this.client.contract.address,
value: 0
}
}));

@@ -285,3 +287,3 @@

function startOperation(_x8) {
function startOperation(_x7) {
return _ref7.apply(this, arguments);

@@ -319,3 +321,3 @@ }

case 8:
return _context7.abrupt('return', this._startOperation(parsed.payload, parsed.signers));
return _context7.abrupt('return', this._startOperation(parsed));

@@ -330,3 +332,3 @@ case 9:

function restoreOperation(_x9) {
function restoreOperation(_x8) {
return _ref8.apply(this, arguments);

@@ -360,3 +362,3 @@ }

function _sendTransaction(_x10, _x11) {
function _sendTransaction(_x9, _x10) {
return _ref9.apply(this, arguments);

@@ -363,0 +365,0 @@ }

@@ -122,9 +122,13 @@ 'use strict';

function MultisigOperation(sender, payload) {
var signers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var onReset = arguments[3];
function MultisigOperation(sender, args) {
(0, _classCallCheck3.default)(this, MultisigOperation);
var payload = args.payload,
_args$signers = args.signers,
signers = _args$signers === undefined ? {} : _args$signers,
nonce = args.nonce,
onReset = args.onReset;
this.constructor._validatePayload(payload);
this.constructor._validateSigners(signers);
(0, _browserAssert2.default)(nonce == null || Number.isInteger(nonce), 'The optional `nonce` parameter should be an integer');

@@ -135,2 +139,3 @@ this.sender = sender;

if (onReset) this._onReset = onReset;
if (nonce !== undefined && Number(nonce) === nonce) this._nonce = nonce;
}

@@ -141,6 +146,7 @@

value: function toJSON() {
var payload = this.payload,
var nonce = this._nonce,
payload = this.payload,
signers = this._signers;
return JSON.stringify({ payload: payload, signers: signers });
return JSON.stringify({ nonce: nonce, payload: payload, signers: signers });
}

@@ -261,31 +267,7 @@

key: '_validateRequiredSignees',
value: function () {
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return this._refreshRequiredSignees();
value: function _validateRequiredSignees() {
(0, _browserAssert2.default)(this.missingSignees.length === 0, 'Missing signatures (from addresses ' + this.missingSignees.join(', ') + ')');
return true;
}
case 2:
(0, _browserAssert2.default)(this.missingSignees.length === 0, 'Missing signatures (from addresses ' + this.missingSignees.join(', ') + ')');
return _context.abrupt('return', true);
case 4:
case 'end':
return _context.stop();
}
}
}, _callee, this);
}));
function _validateRequiredSignees() {
return _ref4.apply(this, arguments);
}
return _validateRequiredSignees;
}()
/**

@@ -299,27 +281,24 @@ * Given send options, ensure that the necessary signees have signed the

value: function () {
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(options) {
return _regenerator2.default.wrap(function _callee2$(_context2) {
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(options) {
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context2.prev = _context2.next) {
switch (_context.prev = _context.next) {
case 0:
_context2.next = 2;
_context.next = 2;
return this.refresh();
case 2:
_context2.next = 4;
return this._validateRequiredSignees();
this._validateRequiredSignees();
return _context.abrupt('return', this.sender.sendMultisig(this._getArgs(), options));
case 4:
return _context2.abrupt('return', this.sender.sendMultisig(this._getArgs(), options));
case 5:
case 'end':
return _context2.stop();
return _context.stop();
}
}
}, _callee2, this);
}, _callee, this);
}));
function send(_x3) {
return _ref5.apply(this, arguments);
function send(_x2) {
return _ref4.apply(this, arguments);
}

@@ -353,9 +332,9 @@

value: function () {
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() {
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {
var adapter, signature;
return _regenerator2.default.wrap(function _callee3$(_context3) {
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
switch (_context3.prev = _context3.next) {
switch (_context2.prev = _context2.next) {
case 0:
_context3.next = 2;
_context2.next = 2;
return this.refresh();

@@ -365,21 +344,21 @@

adapter = this.sender.client.adapter;
_context3.next = 5;
_context2.next = 5;
return adapter.signMessage(this._messageHash);
case 5:
signature = _context3.sent;
signature = _context2.sent;
this._addSignature(signature, adapter.wallet.address);
return _context3.abrupt('return', this);
return _context2.abrupt('return', this);
case 8:
case 'end':
return _context3.stop();
return _context2.stop();
}
}
}, _callee3, this);
}, _callee2, this);
}));
function sign() {
return _ref6.apply(this, arguments);
return _ref5.apply(this, arguments);
}

@@ -398,28 +377,28 @@

value: function () {
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
return _regenerator2.default.wrap(function _callee4$(_context4) {
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() {
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
switch (_context4.prev = _context4.next) {
switch (_context3.prev = _context3.next) {
case 0:
_context4.next = 2;
return this._refreshRequiredSignees();
_context3.next = 2;
return this._refreshNonce();
case 2:
_context4.next = 4;
return this._refreshNonce();
_context3.next = 4;
return this._refreshRequiredSignees();
case 4:
this._refreshMessageHash();
return _context4.abrupt('return', this);
return _context3.abrupt('return', this);
case 6:
case 'end':
return _context4.stop();
return _context3.stop();
}
}
}, _callee4, this);
}, _callee3, this);
}));
function refresh() {
return _ref7.apply(this, arguments);
return _ref6.apply(this, arguments);
}

@@ -432,15 +411,28 @@

value: function () {
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5() {
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
var oldNonce, newNonce;
return _regenerator2.default.wrap(function _callee5$(_context5) {
return _regenerator2.default.wrap(function _callee4$(_context4) {
while (1) {
switch (_context5.prev = _context5.next) {
switch (_context4.prev = _context4.next) {
case 0:
oldNonce = Number(this._nonce);
_context5.next = 3;
if (Object.hasOwnProperty.call(this, '_nonce')) {
_context4.next = 5;
break;
}
_context4.next = 3;
return this.sender.getNonce();
case 3:
newNonce = _context5.sent;
this._nonce = _context4.sent;
return _context4.abrupt('return');
case 5:
oldNonce = Number(this._nonce);
_context4.next = 8;
return this.sender.getNonce();
case 8:
newNonce = _context4.sent;
if (oldNonce !== newNonce) {

@@ -454,12 +446,12 @@ this._nonce = newNonce;

case 5:
case 10:
case 'end':
return _context5.stop();
return _context4.stop();
}
}
}, _callee5, this);
}, _callee4, this);
}));
function _refreshNonce() {
return _ref8.apply(this, arguments);
return _ref7.apply(this, arguments);
}

@@ -472,23 +464,23 @@

value: function () {
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6() {
return _regenerator2.default.wrap(function _callee6$(_context6) {
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5() {
return _regenerator2.default.wrap(function _callee5$(_context5) {
while (1) {
switch (_context6.prev = _context6.next) {
switch (_context5.prev = _context5.next) {
case 0:
_context6.next = 2;
_context5.next = 2;
return this.sender.getRequiredSignees(this.payload.inputValues);
case 2:
this._requiredSignees = _context6.sent;
this._requiredSignees = _context5.sent;
case 3:
case 'end':
return _context6.stop();
return _context5.stop();
}
}
}, _callee6, this);
}, _callee5, this);
}));
function _refreshRequiredSignees() {
return _ref9.apply(this, arguments);
return _ref8.apply(this, arguments);
}

@@ -495,0 +487,0 @@

{
"name": "@colony/colony-js-contract-client",
"version": "1.1.2",
"version": "1.1.3",
"description": "Method-like interface for Smart Contracts",

@@ -48,5 +48,5 @@ "main": "lib/index.js",

"dependencies": {
"@colony/colony-js-adapter": "^1.1.2",
"@colony/colony-js-adapter": "^1.1.3",
"@colony/colony-js-contract-loader": "^1.1.2",
"@colony/colony-js-utils": "^1.1.2",
"@colony/colony-js-utils": "^1.1.3",
"babel-runtime": "^6.26.0",

@@ -53,0 +53,0 @@ "bn.js": "^4.11.6",

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

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