Skip to content

Commit

Permalink
untested ejector deployment (#679)
Browse files Browse the repository at this point in the history
* untested ejector deployment

* remove idb

* yarn lock, fix build, make runCommand cross-platform

* remove submodule file
  • Loading branch information
Sladuca authored Apr 25, 2024
1 parent fa234de commit 428dc2b
Show file tree
Hide file tree
Showing 20 changed files with 654 additions and 7 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
"unlink:protocol": "yarn unlink -A ../protocol"
},
"resolutions": {
"@uniswap/sdk-core": "^4.0.3"
"@uniswap/sdk-core": "^4.0.3",
"protocol": "portal:../protocol",
"@nocturne-xyz/contracts": "portal:../protocol/packages/contracts"
},
"devDependencies": {
"@changesets/cli": "^2.26.2",
Expand All @@ -54,7 +56,8 @@
"node": ">=18"
},
"volta": {
"node": "18.12.1"
"node": "18.12.1",
"yarn": "3.2.0"
},
"prettier": {
"plugins": [
Expand Down
3 changes: 3 additions & 0 deletions packages/ejector/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
coverage
6 changes: 6 additions & 0 deletions packages/ejector/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["../../.eslintrc"],
"parserOptions": {
"project": ["./tsconfig.json"]
}
}
23 changes: 23 additions & 0 deletions packages/ejector/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"overrides": [
{
"files": "*.js",
"options": {
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all"
}
},
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false,
"explicitTypes": "always"
}
}
]
}
147 changes: 147 additions & 0 deletions packages/ejector/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Changelog

## 0.4.14

### Patch Changes

- Updated dependencies [8b9d9030]
- @nocturne-xyz/core@3.3.0

## 0.4.13

### Patch Changes

- 87d5bb40: dummy bump
- Updated dependencies [87d5bb40]
- @nocturne-xyz/core@3.2.1

## 0.4.12

### Patch Changes

- Updated dependencies [3ca99eaf]
- @nocturne-xyz/core@3.2.0

## 0.4.11

### Patch Changes

- empty bump
- Updated dependencies
- @nocturne-xyz/core@3.1.4

## 0.4.10

### Patch Changes

- Updated dependencies [4070b154]
- @nocturne-xyz/core@3.1.3

## 0.4.10-beta.0

### Patch Changes

- Updated dependencies [4070b154]
- @nocturne-xyz/core@3.1.3-beta.0

## 0.4.9

### Patch Changes

- Updated dependencies [1b2530d1]
- @nocturne-xyz/core@3.1.2

## 0.4.8

### Patch Changes

- Updated dependencies [45d0719a]
- @nocturne-xyz/core@3.1.1

## 0.4.7

### Patch Changes

- Updated dependencies [a94caaec]
- Updated dependencies [c717e4d9]
- @nocturne-xyz/core@3.1.0

## 0.4.6

### Patch Changes

- Updated dependencies [22abab87]
- Updated dependencies [a6275d8a]
- @nocturne-xyz/core@3.0.0

## 0.4.5

### Patch Changes

- Updated dependencies [e2801b16]
- Updated dependencies [5d90ac8e]
- Updated dependencies [8b3e1b2c]
- Updated dependencies [f80bff6a]
- Updated dependencies [fbfadb23]
- @nocturne-xyz/core@2.2.0

## 0.4.4

### Patch Changes

- Updated dependencies [7c190c2c]
- Updated dependencies [07625550]
- @nocturne-xyz/core@2.1.0

## 0.4.3

### Patch Changes

- Updated dependencies [16dfb275]
- Updated dependencies [dcea2acb]
- @nocturne-xyz/core@2.0.2

## 0.4.2

### Patch Changes

- Updated dependencies [0ed9f872]
- Updated dependencies [4d7147b6]
- @nocturne-xyz/core@2.0.1

## 0.4.1

### Patch Changes

- Updated dependencies [9fccc32f]
- Updated dependencies [543af0b0]
- Updated dependencies [543af0b0]
- @nocturne-xyz/core@2.0.0

## 0.4.0

### Minor Changes

- 9b1fd626: Initial implementation

### Patch Changes

- Updated dependencies [6abd69b9]
- Updated dependencies [81598815]
- Updated dependencies [003e7082]
- Updated dependencies [1ffcf31f]
- Updated dependencies [fc364ae8]
- Updated dependencies [0cb20e3d]
- Updated dependencies [86d484ad]
- Updated dependencies [1ffcf31f]
- Updated dependencies [77c4063c]
- Updated dependencies [35b0f76f]
- Updated dependencies [589e0230]
- Updated dependencies [3be7d366]
- Updated dependencies [9098e2c8]
- Updated dependencies [58b363a4]
- Updated dependencies [003e7082]
- Updated dependencies [77c4063c]
- Updated dependencies [58b363a4]
- Updated dependencies [f8046431]
- @nocturne-xyz/core@1.0.0
1 change: 1 addition & 0 deletions packages/ejector/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./src/index";
46 changes: 46 additions & 0 deletions packages/ejector/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "@nocturne-xyz/ejector",
"version": "0.1.0",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
"src/**/*"
],
"scripts": {
"build": "yarn clean; tsc --build",
"check": "yarn clean && tsc --noEmit",
"clean": "rm -rf .turbo dist",
"lint": "eslint --fix src --ext .ts",
"prettier:check": "prettier --check ./src",
"prettier:write": "prettier --write ./src"
},
"devDependencies": {
"@types/node": "^18.8.0",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.8.0",
"prettier": "^2.8.8",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
},
"engines": {
"node": ">=18"
},
"dependencies": {
"@nocturne-xyz/bundler": "workspace:^",
"@nocturne-xyz/client": "workspace:^",
"@nocturne-xyz/config": "workspace:^",
"@nocturne-xyz/contracts": "^3.0.0",
"@nocturne-xyz/core": "workspace:^",
"@nocturne-xyz/local-prover": "workspace:^",
"@nocturne-xyz/subgraph-sync-adapters": "workspace:^",
"async-mutex": "^0.5.0",
"dotenv": "^16.4.5",
"ethers": "^5.7.2",
"ioredis": "^5.3.1",
"redis-memory-server": "^0.6.0"
}
}
32 changes: 32 additions & 0 deletions packages/ejector/src/deployment/env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import * as dotenv from "dotenv";

export interface EnvVars {
RPC_URL: string;
SPEND_PRIVATE_KEY: string;
WITHDRAWAL_EOA_PRIVATE_KEY: string;
}

export function getEnvVars(): EnvVars {
dotenv.config();

const RPC_URL = process.env.RPC_URL;
if (!RPC_URL) {
throw new Error("RPC_URL env var is not set!");
}

const SPEND_PRIVATE_KEY = process.env.SPEND_PRIVATE_KEY;
if (!SPEND_PRIVATE_KEY) {
throw new Error("SPEND_PRIVATE_KEY env var is not set!");
}

const WITHDRAWAL_EOA_PRIVATE_KEY = process.env.WITHDRAWAL_EOA_PRIVATE_KEY;
if (!WITHDRAWAL_EOA_PRIVATE_KEY) {
throw new Error("WITHDRAWAL_EOA_PRIVATE_KEY env var is not set!");
}

return {
RPC_URL,
SPEND_PRIVATE_KEY,
WITHDRAWAL_EOA_PRIVATE_KEY,
};
}
Loading

0 comments on commit 428dc2b

Please sign in to comment.