Skip to content

Commit 52a529f

Browse files
committed
chore: update .gitignore and add AGENTS.md for ABI method guidelines
1 parent 113eaf7 commit 52a529f

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,6 @@ lit-auth-storage
8585
.ctx
8686
packages/auth-services/lit-auth-*
8787
pkp-tokens
88+
pkp-tokens-bob
8889
lit-cache
8990
lit-auth-local

AGENTS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Here are the files that need to be updated when adding new ABI methods:
2+
3+
`packages/networks/src/networks/vNaga/LitChainClient/contract-manager/createContractsManager.ts` is the file that creates the contracts manager. This is where use define the ABI signatures we want to use. We use the `@lit-protocol/contracts` package's constants `nagaDevSignatures` to get the ABI signatures. eg `nagaDevSignatures.PaymentDelegation`
4+
5+
Networks are defined in the `packages/networks/src/networks` directory. For each network, it will be prefixed with `v` and the name of the network. Right now, there's only one network, `vNaga`. Then, within the network, we have different environments. For example, `vNaga/envs/naga-dev`.
6+
7+
Then, for each environment, we have `createChainManager` which is essentially an object that binds the methods we want to expose to the user to the actual methods that are available on the chain.
8+
9+
These methods are defined in the `packages/networks/src/networks/vNaga/LitChainClient/apis` directory. There are two types of methods:
10+
11+
1. High-level methods: These are the methods that are exposed to the user. They are defined in the `packages/networks/src/networks/vNaga/envs/naga-dev/chain-manager/createChainManager.ts` file.
12+
2. Raw contract methods: These are the raw contract methods that are defined in the `packages/networks/src/networks/vNaga/LitChainClient/apis/rawContractApis` directory.
13+
14+
For example, for payment manager, we are using the Ledger contract ABIs in the `packages/networks/src/networks/vNaga/LitChainClient/apis/rawContractApis/ledger` directory. Then, we will create a higher level methods in `packages/networks/src/networks/vNaga/LitChainClient/apis/highLevelApis/PaymentManager/PaymentManager.ts`
15+
16+
Then, we need to update the `packages/lit-client/src/lib/LitClient/createLitClient.ts` file to add the new methods to the LitClient. (See getPaymentManager for an example). LitClient is the main entry point for the user to interact the Lit Protocol.
17+
18+
Finally, we need to update the test in `e2e/src/e2e.spec.ts` to add the new methods to the test. See `e2e/src/helper/tests/pkp-permissions-manager-flow.ts` as reference.
19+
20+
To ensure we have implemented correctly, we need to run this command:
21+
22+
```
23+
NETWORK=naga-dev bun run test:e2e <test-name>
24+
```
25+
26+
These are the ABI methods that need to be added:
27+
28+
...methods
29+
30+
Here's the source of the `<Your Contract>` contract:
31+
32+
Smart Contract Source:
33+
34+
```
35+
```
36+
37+
ABIs:
38+
39+
```
40+
```

0 commit comments

Comments
 (0)