cowprotocol / cow-sdk

CoW protocol SDK
https://docs.cow.fi/cow-protocol/reference/sdks/cow-sdk
Other
31 stars 9 forks source link

Composable CoW #129

Closed mfw78 closed 1 year ago

mfw78 commented 1 year ago

NOTE: This PR is currently in draft status and is for discussing APIs etc prior to being considered for merge.

This PR:

  1. Provides typedoc for all existing functions.
  2. Updates the generated classes from the openapi to the latest version from https://github.com/cowprotocol/services
  3. Adds support for ComposableCoW primitives including: a. BaseConditionalOrder classes for order types to inherit from. b. Multiplexer methods allowing for generating Merkle Trees of orders.

Outstanding items:

socket-security[bot] commented 1 year ago

New and updated dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@types/node 20.4.1 None +0 3.81 MB types
typescript 5.1.6 None +0 40.1 MB typescript-bot
@safe-global/protocol-kit 1.0.1 shell +163 27.4 MB dasanra
@openzeppelin/merkle-tree 1.0.5 None +6 1.24 MB frangio
typechain 8.2.0 filesystem +19 1.48 MB ethereum-ts-bot
@typechain/ethers-v5 11.0.0 filesystem, shell +23 2.39 MB ethereum-ts-bot
graphql 16.7.1 None +0 1.34 MB i1g
@cowprotocol/cow-sdk 2.0.0-alpha.4...2.1.0, 2.0.0-alpha.6...2.1.0 shell, environment +11/-0 5.58 MB cowprotocol_dev
socket-security[bot] commented 1 year ago

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Issue Package Version Note Source
Native code bufferutil 4.0.7
Native code keccak 3.0.3
Native code secp256k1 4.0.3
Native code utf-8-validate 5.0.10
Install scripts web3 1.10.0
  • Install script: postinstall
  • Source: echo "Web3.js 4.x alpha has been released for early testing and feedback. Checkout doc at https://docs.web3js.org/ "
Install scripts web3-bzz 1.10.0
  • Install script: postinstall
  • Source: echo "WARNING: the web3-bzz api will be deprecated in the next version"
Install scripts web3-shh 1.10.0
  • Install script: postinstall
  • Source: echo "WARNING: the web3-shh api will be deprecated in the next version"
Install scripts es5-ext 0.10.62
  • Install script: postinstall
  • Source: node -e "try{require('./_postinstall')}catch(e){}" || exit 0
Protestware/Troll package es5-ext 0.10.62
  • Note: This package prints a protestware console message on install regarding Ukraine for users with Russian language locale

Next steps

What's wrong with native code?

Contains native code which could be a vector to obscure malicious code, and generally decrease the likelihood of reproducible or reliable installs.

Ensure that native code bindings are expected. Consumers may consider pure JS and functionally similar alternatives to avoid the challenges and risks associated with native code bindings.

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

What is protestware and troll packages?

This package is a joke, parody, or includes undocumented or hidden behavior unrelated to its primary function.

Consider that consuming this package my come along with functionality unrelated to its primary purpose.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore web3@1.10.0
  • @SocketSecurity ignore web3-bzz@1.10.0
  • @SocketSecurity ignore web3-shh@1.10.0
  • @SocketSecurity ignore es5-ext@0.10.62
  • @SocketSecurity ignore bufferutil@4.0.7
  • @SocketSecurity ignore keccak@3.0.3
  • @SocketSecurity ignore secp256k1@4.0.3
  • @SocketSecurity ignore utf-8-validate@5.0.10