chore: update SDK package to public one

This commit is contained in:
moebius
2025-02-19 14:09:35 +01:00
committed by GitHub
22 changed files with 59 additions and 115 deletions

View File

@@ -43,11 +43,6 @@ jobs:
- name: Print Circom version
run: circom --version
- name: Setup .npmrc file
run: |
echo "@defi-wonderland:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PKG_REGISTRY_TOKEN }}" >> .npmrc
- name: Install dependencies
run: yarn

View File

@@ -38,11 +38,6 @@ jobs:
node-version: 20.x
cache: "yarn"
- name: Setup .npmrc file
run: |
echo "@defi-wonderland:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PKG_REGISTRY_TOKEN }}" >> .npmrc
- name: Install dependencies
run: yarn --frozen-lockfile --network-concurrency 1
@@ -70,28 +65,8 @@ jobs:
node-version: 20.x
cache: "yarn"
- name: Setup .npmrc file
run: |
echo "@defi-wonderland:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PKG_REGISTRY_TOKEN }}" >> .npmrc
working-directory: .
- name: Install root dependencies
- name: Install dependencies
run: yarn --frozen-lockfile --network-concurrency 1
working-directory: .
- name: Build SDK
run: |
yarn build
chmod +x ./scripts/copy_circuits.sh
bash ./scripts/copy_circuits.sh
working-directory: packages/sdk
- name: Link SDK
run: |
cd ../sdk && yarn link
cd ../contracts && yarn link "@defi-wonderland/privacy-pool-core-sdk"
shell: bash
- name: Precompile
run: yarn build
@@ -121,11 +96,6 @@ jobs:
node-version: 20.x
cache: "yarn"
- name: Setup .npmrc file
run: |
echo "@defi-wonderland:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PKG_REGISTRY_TOKEN }}" >> .npmrc
- name: Install dependencies
run: yarn --frozen-lockfile --network-concurrency 1
@@ -142,18 +112,18 @@ jobs:
with:
submodules: recursive
- name: Setup .npmrc file
run: |
echo "@defi-wonderland:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PKG_REGISTRY_TOKEN }}" >> .npmrc
working-directory: .
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "yarn"
- name: Install dependencies
run: yarn --frozen-lockfile --network-concurrency 1
- name: Run Medusa
run: medusa fuzz --test-limit 200000
upload-coverage:
name: Upload Coverage
runs-on: ubuntu-latest
@@ -170,15 +140,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20.x
# cache: "yarn"
- name: Install Yarn
run: npm install -g yarn
- name: Setup .npmrc file
run: |
echo "@defi-wonderland:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PKG_REGISTRY_TOKEN }}" >> .npmrc
cache: "yarn"
- name: Install dependencies
run: yarn --frozen-lockfile --network-concurrency 1

View File

@@ -27,15 +27,14 @@ jobs:
with:
fetch-depth: 1
- name: Setup .npmrc file
run: |
echo "@defi-wonderland:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PKG_REGISTRY_TOKEN }}" >> .npmrc
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "yarn"
- name: Install dependencies
run: yarn --frozen-lockfile --network-concurrency 1
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Build
run: yarn build
@@ -55,15 +54,14 @@ jobs:
with:
fetch-depth: 1
- name: Setup .npmrc file
run: |
echo "@defi-wonderland:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PKG_REGISTRY_TOKEN }}" >> .npmrc
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests with coverage
run: yarn test:cov

View File

@@ -27,10 +27,11 @@ jobs:
with:
fetch-depth: 1
- name: Setup .npmrc file
run: |
echo "@defi-wonderland:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PKG_REGISTRY_TOKEN }}" >> .npmrc
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "yarn"
- name: Install dependencies
run: yarn --frozen-lockfile --network-concurrency 1
@@ -50,10 +51,11 @@ jobs:
with:
fetch-depth: 1
- name: Setup .npmrc file
run: |
echo "@defi-wonderland:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PKG_REGISTRY_TOKEN }}" >> .npmrc
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile

View File

@@ -11,7 +11,7 @@ template CommitmentHasher() {
//////////////////////// SIGNALS ////////////////////////
signal input value; // Value of commitment
signal input label; // keccak256(pool_scope, nonce)
signal input label; // keccak256(pool_scope, nonce) % SNARK_SCALAR_FIELD
signal input nullifier; // Nullifier of commitment
signal input secret; // Secret of commitment

View File

@@ -21,7 +21,7 @@ template Withdraw(maxTreeDepth) {
signal input stateTreeDepth; // Current state tree depth
signal input ASPRoot; // Latest ASP root
signal input ASPTreeDepth; // Current ASP tree depth
signal input context; // keccak256(IPrivacyPool.Withdrawal, scope)
signal input context; // keccak256(IPrivacyPool.Withdrawal, scope) % SNARK_SCALAR_FIELD
//////////////////// END OF PUBLIC SIGNALS ////////////////////
@@ -29,7 +29,7 @@ template Withdraw(maxTreeDepth) {
/////////////////////// PRIVATE SIGNALS ///////////////////////
// Signals to compute commitments
signal input label; // keccak256(scope, nonce)
signal input label; // keccak256(scope, nonce) % SNARK_SCALAR_FIELD
signal input existingValue; // Value of the existing commitment
signal input existingNullifier; // Nullifier of the existing commitment
signal input existingSecret; // Secret of the existing commitment

View File

@@ -31,7 +31,7 @@
"package.json": "sort-package-json"
},
"dependencies": {
"@defi-wonderland/privacy-pool-core-sdk": "^0.0.0-bc6bbf37",
"@0xbow/privacy-pools-core-sdk": "^0.1.5",
"@openzeppelin/contracts": "5.1.0",
"@openzeppelin/contracts-upgradeable": "5.0.2",
"@openzeppelin/foundry-upgrades": "0.3.6",

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { encodeAbiParameters } from "viem";
import { generateMerkleProof } from "@defi-wonderland/privacy-pool-core-sdk";
import { generateMerkleProof } from "@0xbow/privacy-pools-core-sdk";
// Function to temporarily redirect stdout
function withSilentStdout(fn) {

View File

@@ -2,7 +2,7 @@
import {
PrivacyPoolSDK,
Circuits,
} from "@defi-wonderland/privacy-pool-core-sdk";
} from "@0xbow/privacy-pools-core-sdk";
import { encodeAbiParameters } from "viem";
// Function to temporarily redirect stdout

View File

@@ -3,7 +3,7 @@ import {
PrivacyPoolSDK,
Circuits,
getCommitment,
} from "@defi-wonderland/privacy-pool-core-sdk";
} from "@0xbow/privacy-pools-core-sdk";
import { encodeAbiParameters, decodeAbiParameters } from "viem";
function padSiblings(siblings, treeDepth) {

View File

@@ -4,7 +4,7 @@ WORKDIR /build
RUN yarn global add typescript
# Copy package files
COPY package.json .npmrc tsconfig.build.json config.json ./
COPY package.json tsconfig.build.json config.json ./
RUN yarn install
COPY src/ ./src/

View File

@@ -8,6 +8,6 @@ services:
volumes:
- /tmp/pp_relayer.sqlite:/pp_relayer.sqlite
- ./config.example.json:/build/config.json
- ../circuits/artifacts:/build/node_modules/@defi-wonderland/privacy-pool-core-sdk/dist/node/artifacts
- ../circuits/artifacts:/build/node_modules/@0xbow/privacy-pools-core-sdk/dist/node/artifacts
ports:
- "3000:3000" # HOST:CONTAINER

View File

@@ -33,7 +33,7 @@
"docker:run": "docker-compose up"
},
"dependencies": {
"@defi-wonderland/privacy-pool-core-sdk": "0.0.0-bc6bbf37",
"@0xbow/privacy-pools-core-sdk": "0.1.5",
"ajv": "8.17.1",
"body-parser": "1.20.3",
"express": "4.21.2",

View File

@@ -1,7 +1,7 @@
import {
Withdrawal,
WithdrawalProof,
} from "@defi-wonderland/privacy-pool-core-sdk";
} from "@0xbow/privacy-pools-core-sdk";
/**
* Represents the proof payload for a relayer request.

View File

@@ -11,7 +11,7 @@ import {
WithdrawalProof,
SDKError,
type Hash,
} from "@defi-wonderland/privacy-pool-core-sdk";
} from "@0xbow/privacy-pools-core-sdk";
import { Address } from "viem";
import {
CHAIN,

View File

@@ -2,7 +2,7 @@ import {
Address,
Withdrawal,
WithdrawalProof,
} from "@defi-wonderland/privacy-pool-core-sdk";
} from "@0xbow/privacy-pools-core-sdk";
import { WithdrawalPayload } from "../interfaces/relayer/request.js";
export interface SdkProviderInterface {

View File

@@ -12,7 +12,7 @@
"main": "node dist/main.js"
},
"devDependencies": {
"@defi-wonderland/privacy-pool-core-sdk": "0.1.0",
"@0xbow/privacy-pools-core-sdk": "0.1.5",
"@types/node": "^22.13.0",
"typescript": "5.5.4"
}

View File

@@ -10,7 +10,7 @@ import {
Withdrawal,
WithdrawalProof,
WithdrawalProofInput,
} from "@defi-wonderland/privacy-pool-core-sdk";
} from "@0xbow/privacy-pools-core-sdk";
import { Address, defineChain, Hex } from "viem";
import { localhost } from "viem/chains";

View File

@@ -1,7 +1,7 @@
import { encodeAbiParameters, getAddress, Hex } from "viem";
import { request } from "./api-test.js";
import { deposit, proveWithdrawal } from "./create-withdrawal.js";
import { Hash, Withdrawal } from "@defi-wonderland/privacy-pool-core-sdk";
import { Hash, Withdrawal } from "@0xbow/privacy-pools-core-sdk";
const FeeDataAbi = [
{

View File

@@ -14,7 +14,7 @@ import {
dataMismatchFeeRecipient,
} from "../inputs/validateWithdrawal.input.ts";
import { WithdrawalProof } from "@defi-wonderland/privacy-pool-core-sdk";
import { WithdrawalProof } from "@0xbow/privacy-pools-core-sdk";
import * as Config from "../../src/config.ts";
import { PrivacyPoolRelayer } from "../../src/services/privacyPoolRelayer.service.ts";
import { RelayerDatabase } from "../../src/types/db.types.ts";

View File

@@ -1,6 +1,6 @@
{
"name": "@0xbow/privacy-pools-core-sdk",
"version": "0.1.0",
"version": "0.1.1",
"description": "Typescript SDK for the Privacy Pool protocol",
"repository": "https://github.com/0xbow-io/privacy-pools-core",
"license": "Apache-2.0",
@@ -9,9 +9,7 @@
"main": "./dist/node/index.mjs",
"module": "./dist/esm/index.mjs",
"browser": "./dist/esm/index.mjs",
"types": {
"import": "./dist/index.d.mts"
},
"types": "./dist/index.d.mts",
"exports": {
"node": {
"types": "./dist/index.d.mts",

View File

@@ -2,6 +2,18 @@
# yarn lockfile v1
"@0xbow/privacy-pools-core-sdk@0.1.5", "@0xbow/privacy-pools-core-sdk@^0.1.5":
version "0.1.5"
resolved "https://registry.yarnpkg.com/@0xbow/privacy-pools-core-sdk/-/privacy-pools-core-sdk-0.1.5.tgz#a574a1ade5f886c7e2c1e5d4907959cdf68e9de5"
integrity sha512-iWLyhvfV5z6MPB5EBXyVRtpytbn8GsMSFlKVgnJ2goPb089KNHfMzwvmcgqPh2P8+i6bgB+9bBCrxvgOnLncmA==
dependencies:
"@types/snarkjs" "0.7.9"
"@zk-kit/lean-imt" "2.2.2"
maci-crypto "2.5.0"
snarkjs "0.7.5"
typescript "^5.7.3"
viem "2.22.14"
"@adraffy/ens-normalize@1.10.1":
version "1.10.1"
resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz#63430d04bd8c5e74f8d7d049338f1cd9d4f02069"
@@ -351,29 +363,6 @@
solc-typed-ast "18.1.6"
yargs "17.7.2"
"@defi-wonderland/privacy-pool-core-sdk@0.0.0-bc6bbf37":
version "0.0.0-bc6bbf37"
resolved "https://npm.pkg.github.com/download/@defi-wonderland/privacy-pool-core-sdk/0.0.0-bc6bbf37/fab308c2ea6c43803561140f7774bfdad89a0fdd#fab308c2ea6c43803561140f7774bfdad89a0fdd"
integrity sha512-hjdlt7ZpR8pPsgyuhBihOLp+HBovxVOkIzn0jr00paPwbFGYr0iQBnHDW7Z3Gb4i/x5V/exPvlMyhC+KlChqWQ==
dependencies:
"@types/snarkjs" "0.7.9"
"@zk-kit/lean-imt" "2.2.2"
maci-crypto "2.5.0"
snarkjs "0.7.5"
typescript "^5.7.3"
viem "2.22.14"
"@defi-wonderland/privacy-pool-core-sdk@^0.0.0-bc6bbf37":
version "0.0.0-febd6b85"
resolved "https://npm.pkg.github.com/download/@defi-wonderland/privacy-pool-core-sdk/0.0.0-febd6b85/a93a34744093ead2257dd8f078faccd25d050234#a93a34744093ead2257dd8f078faccd25d050234"
integrity sha512-aIdlOm/vrt87/TxZ/GywI1obFKLBaPc/cTmuV9lFSd1tGQb3BafgNYrryCCcmrLAlNxZ8p88xHDJVywxW0mJhA==
dependencies:
"@types/snarkjs" "0.7.9"
"@zk-kit/lean-imt" "2.2.2"
maci-crypto "2.5.0"
snarkjs "0.7.5"
viem "2.22.14"
"@esbuild/aix-ppc64@0.24.2":
version "0.24.2"
resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.24.2.tgz#38848d3e25afe842a7943643cbcd387cc6e13461"