Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation #12

Merged
merged 66 commits into from
Jan 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
12d425d
Update agent.ts
madschristensen99 Jan 7, 2025
b21e28d
Update agent.ts
madschristensen99 Jan 7, 2025
043230a
Update agent.ts
madschristensen99 Jan 7, 2025
b0313c8
Update get-tool-for-intent.ts
madschristensen99 Jan 7, 2025
e24db7c
Update get-tool-matching-prompt.ts
madschristensen99 Jan 7, 2025
a434c0e
Update parse-tool-parameters.ts
madschristensen99 Jan 7, 2025
d2161ad
Update add-delegatee.ts
madschristensen99 Jan 7, 2025
9e9201f
Update batch-add-delegatee.ts
madschristensen99 Jan 7, 2025
54d6148
Update batch-remove-delegatee.ts
madschristensen99 Jan 7, 2025
badc55f
Update get-delegatees.ts
madschristensen99 Jan 7, 2025
798b136
Update get-tool-policy.ts
madschristensen99 Jan 7, 2025
4415756
Update get-tools.ts
madschristensen99 Jan 7, 2025
69dc32c
Update is-delegatee.ts
madschristensen99 Jan 7, 2025
cd761e9
Update permit-tool.ts
madschristensen99 Jan 7, 2025
57aaaae
Update remove-delegatee.ts
madschristensen99 Jan 7, 2025
9865801
Update remove-tool-policy.ts
madschristensen99 Jan 7, 2025
c9f578f
Update remove-tool.ts
madschristensen99 Jan 7, 2025
0b208cd
Update set-tool-policy.ts
madschristensen99 Jan 7, 2025
4f1bbe9
Update execute-tool.ts
madschristensen99 Jan 7, 2025
67e9e49
Update get-delegated-pkps.ts
madschristensen99 Jan 7, 2025
344b7a6
Update get-registered-tools.ts
madschristensen99 Jan 7, 2025
d896ca4
Update get-tool-policy.ts
madschristensen99 Jan 7, 2025
070e618
Update batch-add-delegatee.ts
madschristensen99 Jan 7, 2025
b5d53b2
Update batch-remove-delegatee.ts
madschristensen99 Jan 7, 2025
d1b0a8f
Update delegatee-address.ts
madschristensen99 Jan 7, 2025
88cd1fa
Update init.ts
madschristensen99 Jan 7, 2025
18c20a8
Update insufficient-balance.ts
madschristensen99 Jan 7, 2025
7ad13a4
Update menu.ts
madschristensen99 Jan 7, 2025
8060b91
Update permit-tool.ts
madschristensen99 Jan 7, 2025
2e2820d
Update policy-details.ts
madschristensen99 Jan 7, 2025
e13b8c8
Update remove-delegatee.ts
madschristensen99 Jan 7, 2025
7b2ef78
Update remove-tool.ts
madschristensen99 Jan 7, 2025
2a1e132
Update init.ts
madschristensen99 Jan 7, 2025
17ac17b
Update insufficient-balance.ts
madschristensen99 Jan 7, 2025
80eadd8
Update menu.ts
madschristensen99 Jan 7, 2025
6cfbb70
Update select-pkp.ts
madschristensen99 Jan 7, 2025
d7364a0
Update select-tool.ts
madschristensen99 Jan 7, 2025
f7dcc19
Update tool-params.ts
madschristensen99 Jan 7, 2025
223abb0
Update select-lit-network.ts
madschristensen99 Jan 7, 2025
331f573
Update select-role.ts
madschristensen99 Jan 7, 2025
fe1beae
Update admin.ts
madschristensen99 Jan 7, 2025
6d5afc0
Update delegatee.ts
madschristensen99 Jan 7, 2025
d059a0b
Update admin.ts
madschristensen99 Jan 7, 2025
ff4fade
Update delegatee.ts
madschristensen99 Jan 7, 2025
970b80a
Update errors.ts
madschristensen99 Jan 7, 2025
9739e00
Update types.ts
madschristensen99 Jan 7, 2025
c8fa555
Update ipfs.ts
madschristensen99 Jan 7, 2025
b739e04
Update lit-action.ts
madschristensen99 Jan 7, 2025
6d931eb
Update policy.ts
madschristensen99 Jan 7, 2025
f5da59d
Update tool.ts
madschristensen99 Jan 7, 2025
d9cf03e
Update errors.ts
madschristensen99 Jan 7, 2025
cba86f5
Update registry.ts
madschristensen99 Jan 7, 2025
755a8dc
Update ipfs.ts
madschristensen99 Jan 7, 2025
282dafa
Update lit-action.ts
madschristensen99 Jan 7, 2025
8705114
Update policy.ts
madschristensen99 Jan 7, 2025
91aad5a
Update tool.ts
madschristensen99 Jan 7, 2025
ce6a5c5
Update ipfs.ts
madschristensen99 Jan 7, 2025
32ecf25
Update lit-action.ts
madschristensen99 Jan 7, 2025
b8a34af
Update networks.ts
madschristensen99 Jan 7, 2025
8c45ef5
Update policy.ts
madschristensen99 Jan 7, 2025
635d780
Update tool.ts
madschristensen99 Jan 7, 2025
b181cc8
Update tool.ts
madschristensen99 Jan 7, 2025
824908b
Update errors.ts
madschristensen99 Jan 7, 2025
0a40b96
Add files via upload
madschristensen99 Jan 7, 2025
8b7a126
Add files via upload
madschristensen99 Jan 7, 2025
95fe753
Merge branch 'main' into main
madschristensen99 Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update ipfs.ts
madschristensen99 authored Jan 7, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 755a8dca93c7af886519e8ddec4fb120e49b9730
22 changes: 18 additions & 4 deletions packages/fss-tool-sign-ecdsa/src/lib/ipfs.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,50 @@
import { existsSync } from 'fs';
import { join } from 'path';

// Default development CIDs
/**
* Default development IPFS CIDs (Content Identifiers) for each Lit network.
* These are placeholders used when the actual deployed CIDs are not available.
*/
const DEFAULT_CIDS = {
'datil-dev': 'DEV_IPFS_CID',
'datil-test': 'TEST_IPFS_CID',
datil: 'PROD_IPFS_CID',
} as const;

// Try to read the IPFS CIDs from the build output
/**
* Attempts to read the deployed IPFS CIDs from the build output file (`ipfs.json`).
* If the file is not found or cannot be read, falls back to the default development CIDs.
*/
let deployedCids: Record<keyof typeof DEFAULT_CIDS, string> = DEFAULT_CIDS;

try {
// Path to the `ipfs.json` file in the build output directory
const ipfsPath = join(__dirname, '../../../dist/ipfs.json');

// Check if the `ipfs.json` file exists
if (existsSync(ipfsPath)) {
// We know this import will work because we checked the file exists
// Dynamically import the `ipfs.json` file
// eslint-disable-next-line @typescript-eslint/no-var-requires
const ipfsJson = require(ipfsPath);

// Use the CIDs from the `ipfs.json` file
deployedCids = ipfsJson;
} else {
// Log a warning if the `ipfs.json` file is not found
console.warn(
'ipfs.json not found. Using development CIDs. Please run deploy script to update.'
);
}
} catch (error) {
// Log a warning if there is an error reading the `ipfs.json` file
console.warn(
'Failed to read ipfs.json. Using development CIDs:',
error instanceof Error ? error.message : String(error)
);
}

/**
* IPFS CIDs for each network's Lit Action
* Exported IPFS CIDs for each Lit network's Lit Action.
* These are either the deployed CIDs (if available) or the default development CIDs.
*/
export const IPFS_CIDS = deployedCids;