Skip to content

Commit 2fd7fd5

Browse files
committed
feat(lit-contracts): migrated away from https://github.com/Lit-Protocol/Lit-contracts into this monorepo
1 parent 422000c commit 2fd7fd5

File tree

104 files changed

+559837
-45
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+559837
-45
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,7 @@ lit-auth-local
9191
artillery-state.json
9292
artillery-pkp-tokens
9393
lit-auth-artillery
94-
alice-auth-manager-data
94+
alice-auth-manager-data
95+
96+
!/packages/contracts/dist/
97+
!/packages/contracts/dist/dev

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ git commit -m "chore: release v0.0.1"
9898
bunx changeset publish
9999
```
100100

101+
# # Keeping the contract address and ABIs in sync with the latest changes
102+
103+
This command must be run manually and is NOT part of the build process, as it requires a GitHub API key.
104+
105+
```
106+
DEV_BRANCH=develop GH_API_KEY=github_pat_xxx bun run sync:contracts
107+
```
108+
101109
---
102110

103111
# Legacy Documentation for V7 and Earlier

bun.lock

Lines changed: 275 additions & 36 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
"license": "MIT",
55
"scripts": {
66
"reset": "bun unlink-all && rimraf dist node_modules doc tmp yarn-error.log yarn.lock package-lock.json bun.lockb learn-debug.log tmp .nx lit-auth-storage pkp-tokens lit-auth-local ./e2e/dist ./e2e/node_modules",
7-
"go": "bun run build && bun link-all",
8-
"build": "bun unlink-all && nx run-many --parallel=false --target=build --all --exclude=wrapped-keys,wrapped-keys-lit-actions && bun run prettier",
9-
"build:affected": "nx affected --target=build --exclude=wrapped-keys,wrapped-keys-lit-actions",
7+
"build": "nx run-many --parallel=false --target=build --all --exclude=wrapped-keys,wrapped-keys-lit-actions,contracts && bun run prettier",
8+
"build:affected": "nx affected --target=build --exclude=wrapped-keys,wrapped-keys-lit-actions,contracts",
109
"check-deps": "npx nx run-many --target=check-deps --exclude=wrapped-keys,wrapped-keys-lit-actions",
1110
"validate": "npm run check-deps && npm run build",
1211
"test:local": "node ./local-tests/build.mjs && dotenvx run --env-file=.env -- node ./local-tests/build/test.mjs",
@@ -18,6 +17,7 @@
1817
"gen:docs": "node ./tools/scripts/gen-doc.mjs",
1918
"gen:readme": "node ./tools/scripts/gen-readme.mjs",
2019
"gen:local-network-context": "bun run packages/networks/src/networks/vNaga/envs/naga-local/scripts/00-generate-abi-signatures.ts",
20+
"sync:contracts": "nx run contracts:start",
2121
"prettier": "npx nx format:write --all",
2222
"format:check": "npx nx format:check --all",
2323
"link-all": "for dir in packages/*/; do echo \"Linking in $dir\"; (cd \"$dir\" && bun link) || { echo \"ERROR: Failed to link in $dir\"; exit 1; }; done",
@@ -35,7 +35,6 @@
3535
"private": true,
3636
"dependencies": {
3737
"@dotenvx/dotenvx": "^1.6.4",
38-
"@lit-protocol/contracts": "0.5.1",
3938
"@lit-protocol/nacl": "7.1.1",
4039
"@lit-protocol/uint8arrays": "7.1.1",
4140
"@metamask/eth-sig-util": "5.0.2",

packages/auth-services/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@elysiajs/cors": "^1.2.0",
2121
"@elysiajs/static": "^1.3.0",
2222
"@elysiajs/swagger": "^1.2.0",
23-
"@lit-protocol/contracts": "^0.5.1",
23+
"@lit-protocol/contracts": "workspace:*",
2424
"@simplewebauthn/server": "6.2.1",
2525
"@simplewebauthn/typescript-types": "^8.3.4",
2626
"@t3-oss/env-core": "^0.12.0",

packages/constants/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
"type": "commonjs",
1616
"dependencies": {
1717
"@openagenda/verror": "^3.1.4",
18-
"zod": "3.24.3"
18+
"tslib": "^2.8.1",
19+
"zod": "3.24.3",
20+
"@lit-protocol/contracts": "workspace:*"
1921
},
2022
"publishConfig": {
2123
"access": "public",

packages/contracts/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Configurations
2+
3+
All configs are in the `./src/config` directory
4+
5+
6+
```bash
7+
.
8+
├── env.ts // 👈 to modify env vars
9+
├── methods.ts // 👈 to add new ABI methods to extract
10+
└── networks.ts // 👈 to add or modify a network
11+
```
12+
13+
# Syncing Contract Addresses and ABIs
14+
15+
```shell
16+
tsx ./src/index.ts
17+
```
18+
19+
or from monorepo root
20+
21+
```shell
22+
nx run contracts:start
23+
```

packages/contracts/dist/build.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export declare const env: Readonly<{
2+
GH_API_KEY: string;
3+
DEV_BRANCH: string;
4+
}>;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export declare const METHODS_TO_EXTRACT: readonly ["PKPPermissions.getPermittedActions", "PKPPermissions.getPermittedAddresses", "PKPPermissions.isPermittedAction", "PKPPermissions.isPermittedAddress", "PKPPermissions.getPermittedAuthMethods", "PKPPermissions.getPermittedAuthMethodScopes", "PKPPermissions.addPermittedAction", "PKPPermissions.addPermittedAddress", "PKPPermissions.addPermittedAuthMethodScope", "PKPPermissions.addPermittedAuthMethod", "PKPPermissions.removePermittedAction", "PKPPermissions.removePermittedAddress", "PKPPermissions.removePermittedAuthMethod", "PKPPermissions.removePermittedAuthMethodScope", "PKPPermissions.getTokenIdsForAuthMethod", "PKPNFT.tokenOfOwnerByIndex", "PKPNFT.mintCost", "PKPNFT.safeTransferFrom", "PKPNFT.mintNext", "PKPNFT.claimAndMint", "PKPHelper.claimAndMintNextAndAddAuthMethodsWithTypes", "PKPHelper.mintNextAndAddAuthMethods", "Staking.getActiveUnkickedValidatorStructsAndCounts", "PriceFeed.getNodesForRequest", "PubkeyRouter.deriveEthAddressFromPubkey", "PubkeyRouter.ethAddressToPkpId", "PubkeyRouter.getPubkey", "PubkeyRouter.getEthAddress", "Ledger.deposit", "Ledger.depositForUser", "Ledger.balance", "Ledger.stableBalance", "Ledger.requestWithdraw", "Ledger.latestWithdrawRequest", "Ledger.userWithdrawDelay", "Ledger.withdraw", "PaymentDelegation.getPayersAndRestrictions", "PaymentDelegation.getUsers", "PaymentDelegation.getRestriction", "PaymentDelegation.getPayers", "PaymentDelegation.delegatePayments", "PaymentDelegation.undelegatePayments", "PaymentDelegation.delegatePaymentsBatch", "PaymentDelegation.undelegatePaymentsBatch", "PaymentDelegation.setRestriction"];
2+
export type ContractName = "PKPPermissions" | "PKPNFT" | "PKPHelper" | "Staking" | "PubkeyRouter";
3+
export type ExtractMethodName<T extends string> = T extends `${ContractName}.${infer Method}` ? Method : never;

0 commit comments

Comments
 (0)