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

@cowprotocol/contracts

Package Overview
Dependencies
Maintainers
8
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cowprotocol/contracts - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3-RC.0

5

lib/commonjs/signers.d.ts

@@ -11,7 +11,8 @@ import type { JsonRpcProvider } from "@ethersproject/providers";

*/
export declare class TypedDataV3Signer implements TypedDataSigner {
export declare class TypedDataVersionedSigner implements TypedDataSigner {
signer: Signer;
provider: JsonRpcProvider;
_isSigner: boolean;
constructor(signer: Signer);
_signMethod: string;
constructor(signer: Signer, version?: "v1" | "v2" | "v3" | "v4");
_signTypedData(domain: TypedDataDomain, types: TypedDataTypes, data: Record<string, unknown>): Promise<string>;

@@ -18,0 +19,0 @@ getAddress(): Promise<string>;

48

lib/commonjs/signers.js

@@ -39,3 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.IntChainIdTypedDataV4Signer = exports.TypedDataV3Signer = void 0;
exports.IntChainIdTypedDataV4Signer = exports.TypedDataVersionedSigner = void 0;
var hash_1 = require("@ethersproject/hash");

@@ -50,6 +50,8 @@ var ethers_1 = require("./types/ethers");

*/
var TypedDataV3Signer = /** @class */ (function () {
function TypedDataV3Signer(signer) {
var TypedDataVersionedSigner = /** @class */ (function () {
function TypedDataVersionedSigner(signer, version) {
this._isSigner = true;
this.signer = signer;
var versionSufix = version ? "_" + version : "";
this._signMethod = "eth_signTypedData" + versionSufix;
if (!signer.provider) {

@@ -63,3 +65,3 @@ throw new Error("Signer does not have a provider set");

}
TypedDataV3Signer.prototype._signTypedData = function (domain, types, data) {
TypedDataVersionedSigner.prototype._signTypedData = function (domain, types, data) {
return __awaiter(this, void 0, void 0, function () {

@@ -78,3 +80,3 @@ var populated, payload, msg, address;

address = _a.sent();
return [4 /*yield*/, this.provider.send("eth_signTypedData_v3", [
return [4 /*yield*/, this.provider.send(this._signMethod, [
address.toLowerCase(),

@@ -91,53 +93,53 @@ msg,

// --- start boilerplate proxy methods ---
TypedDataV3Signer.prototype.getAddress = function () {
TypedDataVersionedSigner.prototype.getAddress = function () {
return this.signer.getAddress();
};
TypedDataV3Signer.prototype.signMessage = function (message) {
TypedDataVersionedSigner.prototype.signMessage = function (message) {
return this.signer.signMessage(message);
};
TypedDataV3Signer.prototype.signTransaction = function (transaction) {
TypedDataVersionedSigner.prototype.signTransaction = function (transaction) {
return this.signer.signTransaction(transaction);
};
TypedDataV3Signer.prototype.connect = function (provider) {
TypedDataVersionedSigner.prototype.connect = function (provider) {
return this.signer.connect(provider);
};
TypedDataV3Signer.prototype.getBalance = function (blockTag) {
TypedDataVersionedSigner.prototype.getBalance = function (blockTag) {
return this.signer.getBalance(blockTag);
};
TypedDataV3Signer.prototype.getTransactionCount = function (blockTag) {
TypedDataVersionedSigner.prototype.getTransactionCount = function (blockTag) {
return this.signer.getTransactionCount(blockTag);
};
TypedDataV3Signer.prototype.estimateGas = function (transaction) {
TypedDataVersionedSigner.prototype.estimateGas = function (transaction) {
return this.signer.estimateGas(transaction);
};
TypedDataV3Signer.prototype.call = function (transaction, blockTag) {
TypedDataVersionedSigner.prototype.call = function (transaction, blockTag) {
return this.signer.call(transaction, blockTag);
};
TypedDataV3Signer.prototype.sendTransaction = function (transaction) {
TypedDataVersionedSigner.prototype.sendTransaction = function (transaction) {
return this.signer.sendTransaction(transaction);
};
TypedDataV3Signer.prototype.getChainId = function () {
TypedDataVersionedSigner.prototype.getChainId = function () {
return this.signer.getChainId();
};
TypedDataV3Signer.prototype.getGasPrice = function () {
TypedDataVersionedSigner.prototype.getGasPrice = function () {
return this.signer.getGasPrice();
};
TypedDataV3Signer.prototype.getFeeData = function () {
TypedDataVersionedSigner.prototype.getFeeData = function () {
return this.signer.getFeeData();
};
TypedDataV3Signer.prototype.resolveName = function (name) {
TypedDataVersionedSigner.prototype.resolveName = function (name) {
return this.signer.resolveName(name);
};
TypedDataV3Signer.prototype.checkTransaction = function (transaction) {
TypedDataVersionedSigner.prototype.checkTransaction = function (transaction) {
return this.signer.checkTransaction(transaction);
};
TypedDataV3Signer.prototype.populateTransaction = function (transaction) {
TypedDataVersionedSigner.prototype.populateTransaction = function (transaction) {
return this.signer.populateTransaction(transaction);
};
TypedDataV3Signer.prototype._checkProvider = function (operation) {
TypedDataVersionedSigner.prototype._checkProvider = function (operation) {
return this.signer._checkProvider(operation);
};
return TypedDataV3Signer;
return TypedDataVersionedSigner;
}());
exports.TypedDataV3Signer = TypedDataV3Signer;
exports.TypedDataVersionedSigner = TypedDataVersionedSigner;
/**

@@ -144,0 +146,0 @@ * Wrapper around a TypedDataSigner Signer object that implements `_signTypedData` using

@@ -11,7 +11,8 @@ import type { JsonRpcProvider } from "@ethersproject/providers";

*/
export declare class TypedDataV3Signer implements TypedDataSigner {
export declare class TypedDataVersionedSigner implements TypedDataSigner {
signer: Signer;
provider: JsonRpcProvider;
_isSigner: boolean;
constructor(signer: Signer);
_signMethod: string;
constructor(signer: Signer, version?: "v1" | "v2" | "v3" | "v4");
_signTypedData(domain: TypedDataDomain, types: TypedDataTypes, data: Record<string, unknown>): Promise<string>;

@@ -18,0 +19,0 @@ getAddress(): Promise<string>;

@@ -19,6 +19,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

*/
export class TypedDataV3Signer {
constructor(signer) {
export class TypedDataVersionedSigner {
constructor(signer, version) {
this._isSigner = true;
this.signer = signer;
const versionSufix = version ? "_" + version : "";
this._signMethod = "eth_signTypedData" + versionSufix;
if (!signer.provider) {

@@ -39,3 +41,3 @@ throw new Error("Signer does not have a provider set");

// Actual signing
return (yield this.provider.send("eth_signTypedData_v3", [
return (yield this.provider.send(this._signMethod, [
address.toLowerCase(),

@@ -42,0 +44,0 @@ msg,

{
"name": "@cowprotocol/contracts",
"version": "1.1.2",
"version": "1.1.3-RC.0",
"license": "LGPL-3.0-or-later",

@@ -85,2 +85,2 @@ "scripts": {

]
}
}

@@ -1,4 +0,5 @@

# Gnosis Protocol V2
# CoW Protocol
This repository contains the Solidity smart contract code for the Gnosis Protocol version 2.
This repository contains the Solidity smart contract code for the **CoW Protocol** (formerly know as **Gnosis Protocol**).
For more documentation on how the protocol works on a smart contract level, see the [documentation pages](docs/index.md).

@@ -60,3 +61,3 @@

Contracts deployment (including contract verification) is run automatically with GitHub Actions. The deployment process is triggered manually.
Maintainers of this repository can deploy a new version of the contract in the "Actions" tab, "Deploy GPv2 contracts", "Run workflow". The target branch can be selected before running.
Maintainers of this repository can deploy a new version of the contract in the "Actions" tab, "Deploy CoW Protocol contracts", "Run workflow". The target branch can be selected before running.
A successful workflow results in a new PR asking to merge the deployment artifacts into the main branch.

@@ -63,0 +64,0 @@

@@ -19,9 +19,12 @@ import { _TypedDataEncoder } from "@ethersproject/hash";

*/
export class TypedDataV3Signer implements TypedDataSigner {
export class TypedDataVersionedSigner implements TypedDataSigner {
signer: Signer;
provider: JsonRpcProvider;
_isSigner = true;
_signMethod: string;
constructor(signer: Signer) {
constructor(signer: Signer, version?: "v1" | "v2" | "v3" | "v4") {
this.signer = signer;
const versionSufix = version ? "_" + version : "";
this._signMethod = "eth_signTypedData" + versionSufix;

@@ -60,3 +63,3 @@ if (!signer.provider) {

// Actual signing
return (await this.provider.send("eth_signTypedData_v3", [
return (await this.provider.send(this._signMethod, [
address.toLowerCase(),

@@ -63,0 +66,0 @@ msg,

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