Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit 37800b2

Browse files
authored
Merge pull request #88 from LIT-Protocol/release/0.1.0-23
Release/0.1.0-23
2 parents 76b81ae + 60ae5d9 commit 37800b2

File tree

24 files changed

+258
-155
lines changed

24 files changed

+258
-155
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.1.0-23 (2025-02-18)
2+
3+
This was a version bump only, there were no code changes.
4+
15
## 0.1.0-22 (2025-02-15)
26

37
This was a version bump only, there were no code changes.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,8 @@
6161
}
6262
}
6363
}
64+
},
65+
"dependencies": {
66+
"@lit-protocol/misc": "^7.0.6"
6467
}
6568
}

packages/agent-wallet/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lit-protocol/agent-wallet",
3-
"version": "0.1.0-22",
3+
"version": "0.1.0-23",
44
"publishConfig": {
55
"access": "public"
66
},

packages/aw-contracts-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lit-protocol/aw-contracts-sdk",
3-
"version": "0.1.0-22",
3+
"version": "0.1.0-23",
44
"publishConfig": {
55
"access": "public"
66
},

packages/aw-contracts-sdk/src/lib/get-registered-tools-and-delegatees.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { type LitContracts } from '@lit-protocol/contracts-sdk';
22
import { getToolByIpfsCid } from '@lit-protocol/aw-tool-registry';
33
import { ethers } from 'ethers';
44

5-
const bs58 = require('bs58');
6-
75
import type {
86
ToolInfo,
97
RegisteredToolsResult,
@@ -155,11 +153,14 @@ export const getRegisteredToolsAndDelegatees = async (
155153
pkpTokenId
156154
);
157155

156+
// Import bs58 dynamically
157+
const bs58 = await import('bs58');
158+
158159
// Convert hex CIDs to base58
159160
const base58PermittedTools = permittedTools.map((hexCid) => {
160161
// Remove '0x' prefix and convert to Buffer
161162
const bytes = Buffer.from(hexCid.slice(2), 'hex');
162-
return bs58.encode(bytes);
163+
return bs58.default.encode(bytes);
163164
});
164165

165166
// Get tools and their policies from registry contract

packages/aw-signer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lit-protocol/aw-signer",
3-
"version": "0.1.0-22",
3+
"version": "0.1.0-23",
44
"publishConfig": {
55
"access": "public"
66
},

packages/aw-subagent-gaia/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lit-protocol/aw-subagent-gaia",
3-
"version": "0.1.0-22",
3+
"version": "0.1.0-23",
44
"publishConfig": {
55
"access": "public"
66
},

packages/aw-subagent-openai/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lit-protocol/aw-subagent-openai",
3-
"version": "0.1.0-22",
3+
"version": "0.1.0-23",
44
"publishConfig": {
55
"access": "public"
66
},

packages/aw-tool-enso/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lit-protocol/aw-tool-enso",
3-
"version": "0.1.0-22",
3+
"version": "0.1.0-23",
44
"publishConfig": {
55
"access": "public"
66
},
Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
import { isBrowser } from '@lit-protocol/misc';
12
import { existsSync } from 'fs';
23
import { join } from 'path';
34

5+
type NetworkCids = {
6+
tool: string;
7+
defaultPolicy: string;
8+
};
9+
410
/**
511
* Default development CIDs for different environments.
612
* @type {Object.<string, NetworkCids>}
@@ -24,26 +30,25 @@ const DEFAULT_CIDS = {
2430
} as const;
2531

2632
/**
27-
* Tries to read the IPFS CIDs from the build output.
33+
* Tries to read the IPFS CIDs from the build output for node.js environments or simply return the default CIDs.
2834
* Falls back to default development CIDs if the file is not found or cannot be read.
2935
* @type {Record<keyof typeof DEFAULT_CIDS, NetworkCids>}
3036
*/
31-
let deployedCids = DEFAULT_CIDS;
32-
33-
const ipfsPath = join(__dirname, '../../../dist/ipfs.json');
34-
if (existsSync(ipfsPath)) {
35-
// We know this import will work because we checked the file exists
36-
// eslint-disable-next-line @typescript-eslint/no-var-requires
37-
const ipfsJson = require(ipfsPath);
38-
deployedCids = ipfsJson;
39-
} else {
40-
throw new Error(
41-
'Failed to read ipfs.json. You should only see this error if you are running the monorepo locally. You should run pnpm deploy:tools to update the ipfs.json files.'
42-
);
43-
}
44-
45-
/**
46-
* IPFS CIDs for each network's Lit Action.
47-
* @type {Record<keyof typeof DEFAULT_CIDS, NetworkCids>}
48-
*/
49-
export const IPFS_CIDS = deployedCids;
37+
export const IPFS_CIDS: Record<keyof typeof DEFAULT_CIDS, NetworkCids> =
38+
(() => {
39+
if (isBrowser()) {
40+
return DEFAULT_CIDS as Record<keyof typeof DEFAULT_CIDS, NetworkCids>;
41+
} else {
42+
let deployedCids = DEFAULT_CIDS;
43+
const ipfsPath = join(__dirname, '../../../dist/ipfs.json');
44+
if (existsSync(ipfsPath)) {
45+
const ipfsJson = require(ipfsPath);
46+
deployedCids = ipfsJson;
47+
} else {
48+
throw new Error(
49+
'Failed to read ipfs.json. You should only see this error if you are running the monorepo locally. You should run pnpm deploy:tools to update the ipfs.json files.'
50+
);
51+
}
52+
return deployedCids;
53+
}
54+
})();

0 commit comments

Comments
 (0)