New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@connext/apps

Package Overview
Dependencies
Maintainers
4
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@connext/apps - npm Package Compare versions

Comparing version

to
6.0.0-alpha.6

48

dist/index-iife.js
this.window = this.window || {};
this.window.apps = (function (exports, types, cfCore, constants, utils, contracts) {
this.window.apps = (function (exports, types, cfCore, constants, utils, crypto, contracts) {
'use strict';

@@ -217,3 +217,3 @@

}
let recovered = await types.recoverAddressWithEthers(initialState.data, initialState.signatures[0]);
let recovered = await crypto.recoverAddress(initialState.data, initialState.signatures[0]);
if (recovered !== initialState.signers[0]) {

@@ -225,34 +225,23 @@ throw new Error(`Cannot install withdraw app - incorrect signer recovered from initiator sig on data.

class WithdrawETHCommitment extends cfCore.MultisigCommitment {
constructor(multisigAddress, multisigOwners, to, value) {
const iface = new utils.Interface(contracts.ConditionalTransactionDelegateTarget.abi);
class WithdrawCommitment extends cfCore.MultisigCommitment {
constructor(networkContext, multisigAddress, multisigOwners, recipient, assetId, amount) {
super(multisigAddress, multisigOwners);
this.networkContext = networkContext;
this.multisigAddress = multisigAddress;
this.multisigOwners = multisigOwners;
this.to = to;
this.value = value;
this.recipient = recipient;
this.assetId = assetId;
this.amount = amount;
}
getTransactionDetails() {
return {
to: this.to,
value: utils.bigNumberify(this.value),
data: "0x",
operation: types.MultisigOperation.Call,
};
}
}
class WithdrawERC20Commitment extends cfCore.MultisigCommitment {
constructor(multisigAddress, multisigOwners, to, value, tokenAddress) {
super(multisigAddress, multisigOwners);
this.multisigAddress = multisigAddress;
this.multisigOwners = multisigOwners;
this.to = to;
this.value = value;
this.tokenAddress = tokenAddress;
}
getTransactionDetails() {
return {
data: new utils.Interface(contracts.ERC20.abi).functions.transfer.encode([this.to, this.value]),
operation: types.MultisigOperation.Call,
to: this.tokenAddress,
to: this.networkContext.ConditionalTransactionDelegateTarget,
value: 0,
data: iface.functions.withdrawWrapper.encode([
this.recipient,
this.assetId,
this.amount,
]),
operation: types.MultisigOperation.DelegateCall,
};

@@ -281,4 +270,3 @@ }

exports.WithdrawAppRegistryInfo = WithdrawAppRegistryInfo;
exports.WithdrawERC20Commitment = WithdrawERC20Commitment;
exports.WithdrawETHCommitment = WithdrawETHCommitment;
exports.WithdrawCommitment = WithdrawCommitment;
exports.baseCoinTransferValidation = baseCoinTransferValidation;

@@ -296,2 +284,2 @@ exports.commonAppProposalValidation = commonAppProposalValidation;

}({}, types, cfCore, constants, utils, contracts));
}({}, types, cfCore, constants, utils, crypto, contracts));

@@ -1,6 +0,7 @@

import { CoinBalanceRefundAppName, OutcomeType, CoinBalanceRefundAppStateEncoding, FastSignedTransferAppName, FastSignedTransferAppStateEncoding, FastSignedTransferAppActionEncoding, enumify, SimpleLinkedTransferAppName, SimpleSignedTransferAppName, SimpleTwoPartySwapAppName, WithdrawAppName, HashLockTransferAppName, stringify, HashLockTransferAppActionEncoding, HashLockTransferAppStateEncoding, SimpleLinkedTransferAppActionEncoding, SimpleLinkedTransferAppStateEncoding, SimpleSignedTransferAppStateEncoding, SimpleSignedTransferAppActionEncoding, SimpleSwapAppStateEncoding, calculateExchange, WithdrawAppStateEncoding, WithdrawAppActionEncoding, bigNumberifyJson, recoverAddressWithEthers, MultisigOperation } from '@connext/types';
import { CoinBalanceRefundAppName, OutcomeType, CoinBalanceRefundAppStateEncoding, FastSignedTransferAppName, FastSignedTransferAppStateEncoding, FastSignedTransferAppActionEncoding, enumify, SimpleLinkedTransferAppName, SimpleSignedTransferAppName, SimpleTwoPartySwapAppName, WithdrawAppName, HashLockTransferAppName, stringify, HashLockTransferAppActionEncoding, HashLockTransferAppStateEncoding, SimpleLinkedTransferAppActionEncoding, SimpleLinkedTransferAppStateEncoding, SimpleSignedTransferAppStateEncoding, SimpleSignedTransferAppActionEncoding, SimpleSwapAppStateEncoding, calculateExchange, WithdrawAppStateEncoding, WithdrawAppActionEncoding, bigNumberifyJson, MultisigOperation } from '@connext/types';
import { xkeyKthAddress, MultisigCommitment } from '@connext/cf-core';
import { Zero, HashZero } from 'ethers/constants';
import { bigNumberify, Interface } from 'ethers/utils';
import { ERC20 } from '@connext/contracts';
import { recoverAddress } from '@connext/crypto';
import { ConditionalTransactionDelegateTarget } from '@connext/contracts';

@@ -219,3 +220,3 @@ const CoinBalanceRefundAppRegistryInfo = {

}
let recovered = await recoverAddressWithEthers(initialState.data, initialState.signatures[0]);
let recovered = await recoverAddress(initialState.data, initialState.signatures[0]);
if (recovered !== initialState.signers[0]) {

@@ -227,34 +228,23 @@ throw new Error(`Cannot install withdraw app - incorrect signer recovered from initiator sig on data.

class WithdrawETHCommitment extends MultisigCommitment {
constructor(multisigAddress, multisigOwners, to, value) {
const iface = new Interface(ConditionalTransactionDelegateTarget.abi);
class WithdrawCommitment extends MultisigCommitment {
constructor(networkContext, multisigAddress, multisigOwners, recipient, assetId, amount) {
super(multisigAddress, multisigOwners);
this.networkContext = networkContext;
this.multisigAddress = multisigAddress;
this.multisigOwners = multisigOwners;
this.to = to;
this.value = value;
this.recipient = recipient;
this.assetId = assetId;
this.amount = amount;
}
getTransactionDetails() {
return {
to: this.to,
value: bigNumberify(this.value),
data: "0x",
operation: MultisigOperation.Call,
};
}
}
class WithdrawERC20Commitment extends MultisigCommitment {
constructor(multisigAddress, multisigOwners, to, value, tokenAddress) {
super(multisigAddress, multisigOwners);
this.multisigAddress = multisigAddress;
this.multisigOwners = multisigOwners;
this.to = to;
this.value = value;
this.tokenAddress = tokenAddress;
}
getTransactionDetails() {
return {
data: new Interface(ERC20.abi).functions.transfer.encode([this.to, this.value]),
operation: MultisigOperation.Call,
to: this.tokenAddress,
to: this.networkContext.ConditionalTransactionDelegateTarget,
value: 0,
data: iface.functions.withdrawWrapper.encode([
this.recipient,
this.assetId,
this.amount,
]),
operation: MultisigOperation.DelegateCall,
};

@@ -274,2 +264,2 @@ }

export { AppRegistry, CoinBalanceRefundAppRegistryInfo, FastSignedTransferAppRegistryInfo, HashLockTransferAppRegistryInfo, SimpleLinkedTransferAppRegistryInfo, SimpleSignedTransferAppRegistryInfo, SimpleTwoPartySwapAppRegistryInfo, SupportedApplications, WithdrawAppRegistryInfo, WithdrawERC20Commitment, WithdrawETHCommitment, baseCoinTransferValidation, commonAppProposalValidation, unidirectionalCoinTransferValidation, validateFastSignedTransferApp, validateHashLockTransferApp, validateSignedTransferApp, validateSimpleLinkedTransferApp, validateSimpleSwapApp, validateWithdrawApp };
export { AppRegistry, CoinBalanceRefundAppRegistryInfo, FastSignedTransferAppRegistryInfo, HashLockTransferAppRegistryInfo, SimpleLinkedTransferAppRegistryInfo, SimpleSignedTransferAppRegistryInfo, SimpleTwoPartySwapAppRegistryInfo, SupportedApplications, WithdrawAppRegistryInfo, WithdrawCommitment, baseCoinTransferValidation, commonAppProposalValidation, unidirectionalCoinTransferValidation, validateFastSignedTransferApp, validateHashLockTransferApp, validateSignedTransferApp, validateSimpleLinkedTransferApp, validateSimpleSwapApp, validateWithdrawApp };

@@ -9,2 +9,3 @@ 'use strict';

var utils = require('ethers/utils');
var crypto = require('@connext/crypto');
var contracts = require('@connext/contracts');

@@ -224,3 +225,3 @@

}
let recovered = await types.recoverAddressWithEthers(initialState.data, initialState.signatures[0]);
let recovered = await crypto.recoverAddress(initialState.data, initialState.signatures[0]);
if (recovered !== initialState.signers[0]) {

@@ -232,34 +233,23 @@ throw new Error(`Cannot install withdraw app - incorrect signer recovered from initiator sig on data.

class WithdrawETHCommitment extends cfCore.MultisigCommitment {
constructor(multisigAddress, multisigOwners, to, value) {
const iface = new utils.Interface(contracts.ConditionalTransactionDelegateTarget.abi);
class WithdrawCommitment extends cfCore.MultisigCommitment {
constructor(networkContext, multisigAddress, multisigOwners, recipient, assetId, amount) {
super(multisigAddress, multisigOwners);
this.networkContext = networkContext;
this.multisigAddress = multisigAddress;
this.multisigOwners = multisigOwners;
this.to = to;
this.value = value;
this.recipient = recipient;
this.assetId = assetId;
this.amount = amount;
}
getTransactionDetails() {
return {
to: this.to,
value: utils.bigNumberify(this.value),
data: "0x",
operation: types.MultisigOperation.Call,
};
}
}
class WithdrawERC20Commitment extends cfCore.MultisigCommitment {
constructor(multisigAddress, multisigOwners, to, value, tokenAddress) {
super(multisigAddress, multisigOwners);
this.multisigAddress = multisigAddress;
this.multisigOwners = multisigOwners;
this.to = to;
this.value = value;
this.tokenAddress = tokenAddress;
}
getTransactionDetails() {
return {
data: new utils.Interface(contracts.ERC20.abi).functions.transfer.encode([this.to, this.value]),
operation: types.MultisigOperation.Call,
to: this.tokenAddress,
to: this.networkContext.ConditionalTransactionDelegateTarget,
value: 0,
data: iface.functions.withdrawWrapper.encode([
this.recipient,
this.assetId,
this.amount,
]),
operation: types.MultisigOperation.DelegateCall,
};

@@ -288,4 +278,3 @@ }

exports.WithdrawAppRegistryInfo = WithdrawAppRegistryInfo;
exports.WithdrawERC20Commitment = WithdrawERC20Commitment;
exports.WithdrawETHCommitment = WithdrawETHCommitment;
exports.WithdrawCommitment = WithdrawCommitment;
exports.baseCoinTransferValidation = baseCoinTransferValidation;

@@ -292,0 +281,0 @@ exports.commonAppProposalValidation = commonAppProposalValidation;

import { xkeyKthAddress } from "@connext/cf-core";
import { bigNumberifyJson, recoverAddressWithEthers, } from "@connext/types";
import { recoverAddress } from "@connext/crypto";
import { bigNumberifyJson } from "@connext/types";
import { HashZero, Zero } from "ethers/constants";

@@ -26,3 +27,3 @@ import { unidirectionalCoinTransferValidation } from "../shared";

}
let recovered = await recoverAddressWithEthers(initialState.data, initialState.signatures[0]);
let recovered = await recoverAddress(initialState.data, initialState.signatures[0]);
if (recovered !== initialState.signers[0]) {

@@ -29,0 +30,0 @@ throw new Error(`Cannot install withdraw app - incorrect signer recovered from initiator sig on data.

@@ -1,21 +0,14 @@

import { MultisigTransaction } from "@connext/types";
import { MultisigTransaction, NetworkContext, ContractAddresses } from "@connext/types";
import { MultisigCommitment } from "@connext/cf-core";
import { BigNumberish } from "ethers/utils";
export declare class WithdrawETHCommitment extends MultisigCommitment {
export declare class WithdrawCommitment extends MultisigCommitment {
readonly networkContext: NetworkContext | ContractAddresses;
readonly multisigAddress: string;
readonly multisigOwners: string[];
readonly to: string;
readonly value: BigNumberish;
constructor(multisigAddress: string, multisigOwners: string[], to: string, value: BigNumberish);
readonly recipient: string;
readonly assetId: string;
readonly amount: BigNumberish;
constructor(networkContext: NetworkContext | ContractAddresses, multisigAddress: string, multisigOwners: string[], recipient: string, assetId: string, amount: BigNumberish);
getTransactionDetails(): MultisigTransaction;
}
export declare class WithdrawERC20Commitment extends MultisigCommitment {
readonly multisigAddress: string;
readonly multisigOwners: string[];
readonly to: string;
readonly value: BigNumberish;
readonly tokenAddress: string;
constructor(multisigAddress: string, multisigOwners: string[], to: string, value: BigNumberish, tokenAddress: string);
getTransactionDetails(): MultisigTransaction;
}
//# sourceMappingURL=withdrawCommitment.d.ts.map
import { MultisigOperation } from "@connext/types";
import { MultisigCommitment } from "@connext/cf-core";
import { ERC20 } from "@connext/contracts";
import { bigNumberify, Interface } from "ethers/utils";
export class WithdrawETHCommitment extends MultisigCommitment {
constructor(multisigAddress, multisigOwners, to, value) {
import { ConditionalTransactionDelegateTarget } from "@connext/contracts";
import { Interface } from "ethers/utils";
const iface = new Interface(ConditionalTransactionDelegateTarget.abi);
export class WithdrawCommitment extends MultisigCommitment {
constructor(networkContext, multisigAddress, multisigOwners, recipient, assetId, amount) {
super(multisigAddress, multisigOwners);
this.networkContext = networkContext;
this.multisigAddress = multisigAddress;
this.multisigOwners = multisigOwners;
this.to = to;
this.value = value;
this.recipient = recipient;
this.assetId = assetId;
this.amount = amount;
}
getTransactionDetails() {
return {
to: this.to,
value: bigNumberify(this.value),
data: "0x",
operation: MultisigOperation.Call,
};
}
}
export class WithdrawERC20Commitment extends MultisigCommitment {
constructor(multisigAddress, multisigOwners, to, value, tokenAddress) {
super(multisigAddress, multisigOwners);
this.multisigAddress = multisigAddress;
this.multisigOwners = multisigOwners;
this.to = to;
this.value = value;
this.tokenAddress = tokenAddress;
}
getTransactionDetails() {
return {
data: new Interface(ERC20.abi).functions.transfer.encode([this.to, this.value]),
operation: MultisigOperation.Call,
to: this.tokenAddress,
to: this.networkContext.ConditionalTransactionDelegateTarget,
value: 0,
data: iface.functions.withdrawWrapper.encode([
this.recipient,
this.assetId,
this.amount,
]),
operation: MultisigOperation.DelegateCall,
};

@@ -38,0 +27,0 @@ }

{
"name": "@connext/apps",
"version": "6.0.0-alpha.5",
"version": "6.0.0-alpha.6",
"description": "Connext Counterfactual Apps",

@@ -21,6 +21,6 @@ "main": "dist/index.js",

"devDependencies": {
"@connext/cf-core": "6.0.0-alpha.4",
"@connext/cf-core": "6.0.0-alpha.5",
"@connext/contracts": "1.0.5",
"@connext/crypto": "6.0.0-alpha.4",
"@connext/types": "6.0.0-alpha.5",
"@connext/crypto": "6.0.0-alpha.5",
"@connext/types": "6.0.0-alpha.6",
"ethers": "4.0.46",

@@ -27,0 +27,0 @@ "rollup": "1.31.1",

import { xkeyKthAddress } from "@connext/cf-core";
import {
bigNumberifyJson,
MethodParams,
recoverAddressWithEthers,
WithdrawAppState,
} from "@connext/types";
import { recoverAddress } from "@connext/crypto";
import { bigNumberifyJson, MethodParams, WithdrawAppState } from "@connext/types";
import { HashZero, Zero } from "ethers/constants";

@@ -58,3 +54,3 @@

let recovered = await recoverAddressWithEthers(initialState.data, initialState.signatures[0]);
let recovered = await recoverAddress(initialState.data, initialState.signatures[0]);

@@ -61,0 +57,0 @@ if (recovered !== initialState.signers[0]) {

@@ -1,12 +0,15 @@

import { MultisigTransaction, MultisigOperation } from "@connext/types";
import { MultisigTransaction, MultisigOperation, NetworkContext, ContractAddresses } from "@connext/types";
import { MultisigCommitment } from "@connext/cf-core";
import { ERC20 } from "@connext/contracts";
import { BigNumberish, bigNumberify, Interface } from "ethers/utils";
import { ConditionalTransactionDelegateTarget } from "@connext/contracts";
import { BigNumberish, Interface } from "ethers/utils";
export class WithdrawETHCommitment extends MultisigCommitment {
const iface = new Interface(ConditionalTransactionDelegateTarget.abi);
export class WithdrawCommitment extends MultisigCommitment {
public constructor(
public readonly networkContext: NetworkContext | ContractAddresses,
public readonly multisigAddress: string,
public readonly multisigOwners: string[],
public readonly to: string,
public readonly value: BigNumberish,
public readonly recipient: string,
public readonly assetId: string,
public readonly amount: BigNumberish,
) {

@@ -18,29 +21,12 @@ super(multisigAddress, multisigOwners);

return {
to: this.to,
value: bigNumberify(this.value),
data: "0x",
operation: MultisigOperation.Call,
};
}
}
export class WithdrawERC20Commitment extends MultisigCommitment {
public constructor(
public readonly multisigAddress: string,
public readonly multisigOwners: string[],
public readonly to: string,
public readonly value: BigNumberish,
public readonly tokenAddress: string,
) {
super(multisigAddress, multisigOwners);
}
public getTransactionDetails(): MultisigTransaction {
return {
data: new Interface(ERC20.abi).functions.transfer.encode([this.to, this.value]),
operation: MultisigOperation.Call,
to: this.tokenAddress,
to: this.networkContext.ConditionalTransactionDelegateTarget,
value: 0,
data: iface.functions.withdrawWrapper.encode([
this.recipient,
this.assetId,
this.amount,
]),
operation: MultisigOperation.DelegateCall,
};
}
}

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet