Skip to content

Commit

Permalink
update storage and format
Browse files Browse the repository at this point in the history
  • Loading branch information
phn210 committed Jan 24, 2024
1 parent ace0361 commit 97b4d44
Show file tree
Hide file tree
Showing 30 changed files with 4,599 additions and 4,088 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"tabWidth": 4,
"trailingComma": "es5"
}
137 changes: 69 additions & 68 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,71 +1,72 @@
{
"name": "@auxo-dev/platform",
"version": "0.1.3",
"description": "Auxo's On-chain Funding platform on Mina blockchain",
"author": "",
"license": "Apache-2.0",
"keywords": [
"mina-zkapp",
"mina-zk-app",
"mina-dapp",
"zkapp"
],
"main": "./build/esm/src/index.js",
"types": "./build/esm/src/index.d.ts",
"scripts": {
"build": "tsc --build tsconfig.json tsconfig.cjs.json tsconfig.types.json && ./fix-export.sh",
"scripts": "tsc --build tsconfig.json tsconfig.cjs.json tsconfig.types.json && ./fix-export.sh && node",
"buildw": "tsc --watch",
"coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
"format": "prettier --write --ignore-unknown **/*",
"prepare": "husky install",
"test": "tsc && node --experimental-vm-modules node_modules/jest/bin/jest.js",
"testw": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch",
"lint": "npx eslint src/* --fix"
},
"exports": {
".": {
"types": "./build/types/src/index.d.ts",
"require": "./build/cjs/src/index.js",
"import": "./build/esm/src/index.js",
"default": "./build/esm/src/index.js"
"name": "@auxo-dev/platform",
"version": "0.1.3",
"description": "Auxo's On-chain Funding platform on Mina blockchain",
"author": "",
"license": "Apache-2.0",
"keywords": [
"mina-zkapp",
"mina-zk-app",
"mina-dapp",
"zkapp"
],
"main": "./build/esm/src/index.js",
"types": "./build/esm/src/index.d.ts",
"scripts": {
"build": "tsc --build tsconfig.json tsconfig.cjs.json tsconfig.types.json && ./fix-export.sh",
"build:no-scripts": "tsc --build tsconfig.noscripts.json",
"scripts": "tsc --build tsconfig.json tsconfig.cjs.json tsconfig.types.json && ./fix-export.sh && node",
"buildw": "tsc --watch",
"coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
"format": "prettier --write --ignore-unknown **/*",
"prepare": "husky install",
"test": "tsc && node --experimental-vm-modules node_modules/jest/bin/jest.js",
"testw": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch",
"lint": "npx eslint src/* --fix"
},
"./*": {
"types": "./*.d.ts",
"require": "./*.js",
"import": "./*.js",
"default": "./*.js"
"exports": {
".": {
"types": "./build/types/src/index.d.ts",
"require": "./build/cjs/src/index.js",
"import": "./build/esm/src/index.js",
"default": "./build/esm/src/index.js"
},
"./*": {
"types": "./*.d.ts",
"require": "./*.js",
"import": "./*.js",
"default": "./*.js"
}
},
"files": [
"build/*",
"build/**/*.map"
],
"lint-staged": {
"**/*": [
"eslint src/* --fix --ignore-pattern *.sh",
"prettier --write --ignore-unknown"
]
},
"devDependencies": {
"@babel/preset-env": "^7.16.4",
"@babel/preset-typescript": "^7.16.0",
"@types/jest": "^27.0.3",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.5.0",
"eslint": "^8.7.0",
"eslint-plugin-o1js": "^0.4.0",
"husky": "^7.0.1",
"jest": "^27.3.1",
"lint-staged": "^11.0.1",
"prettier": "^2.3.2",
"ts-jest": "^27.0.7",
"typescript": "^4.7.2",
"zkapp-cli": "^0.15.0"
},
"dependencies": {
"@auxo-dev/dkg": "0.2.9",
"@auxo-dev/auxo-libs": "0.3.5",
"o1js": "0.15.1"
}
},
"files": [
"build/*",
"build/**/*.map"
],
"lint-staged": {
"**/*": [
"eslint src/* --fix --ignore-pattern *.sh",
"prettier --write --ignore-unknown"
]
},
"devDependencies": {
"@babel/preset-env": "^7.16.4",
"@babel/preset-typescript": "^7.16.0",
"@types/jest": "^27.0.3",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.5.0",
"eslint": "^8.7.0",
"eslint-plugin-o1js": "^0.4.0",
"husky": "^7.0.1",
"jest": "^27.3.1",
"lint-staged": "^11.0.1",
"prettier": "^2.3.2",
"ts-jest": "^27.0.7",
"typescript": "^4.7.2",
"zkapp-cli": "^0.15.0"
},
"dependencies": {
"@auxo-dev/dkg": "0.2.9",
"@auxo-dev/auxo-libs": "0.3.5",
"o1js": "0.15.1"
}
}
}
44 changes: 22 additions & 22 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@ import { Constants } from '@auxo-dev/dkg';
export const PROJECT_MEMBER_MAX_SIZE = 2 ** 3;
export const ADDRESS_MAX_SIZE = 16;
export const INSTANCE_LIMITS = {
PROJECT: 2 ** 5,
CAMPAIGN: 2 ** 5,
PARTICIPATION: Constants.REQUEST_MAX_SIZE,
PROJECT: 2 ** 5,
CAMPAIGN: 2 ** 5,
PARTICIPATION: Constants.REQUEST_MAX_SIZE,
};
export enum Contract {
COMMITTEE = 'committee',
DKG = 'dkg',
ROUND1 = 'round1',
ROUND2 = 'round2',
RESPONSE = 'response',
REQUEST = 'request',
PROJECT = 'project',
CAMPAIGN = 'campaign',
PARTICIPATION = 'participation',
FUNDING = 'funding',
TREASURY = 'treasury',
COMMITTEE = 'committee',
DKG = 'dkg',
ROUND1 = 'round1',
ROUND2 = 'round2',
RESPONSE = 'response',
REQUEST = 'request',
PROJECT = 'project',
CAMPAIGN = 'campaign',
PARTICIPATION = 'participation',
FUNDING = 'funding',
TREASURY = 'treasury',
}

function createEnumIndexMap(enumObj: any): { [key: string]: number } {
const map: { [key: string]: number } = {};
let index = 0;
for (const key in enumObj) {
if (enumObj.hasOwnProperty(key)) {
map[enumObj[key].toUpperCase()] = index++;
const map: { [key: string]: number } = {};
let index = 0;
for (const key in enumObj) {
if (enumObj.hasOwnProperty(key)) {
map[enumObj[key].toUpperCase()] = index++;
}
}
}
// console.log(map);
return map;
// console.log(map);
return map;
}

export const ZkAppEnum = createEnumIndexMap(Contract);
Loading

0 comments on commit 97b4d44

Please sign in to comment.