@paper-clip/pc 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/client.js +4 -1
  2. package/package.json +1 -1
package/dist/client.js CHANGED
@@ -40,7 +40,10 @@ export async function getProvider() {
40
40
  export async function getProgram() {
41
41
  const provider = await getProvider();
42
42
  anchor.setProvider(provider);
43
- const idlPath = path.resolve(__dirname, "..", "..", "target", "idl", "paperclip_protocol.json");
43
+ // Try npm package location first, fall back to local dev path
44
+ const npmIdlPath = path.resolve(__dirname, "..", "idl", "paperclip_protocol.json");
45
+ const devIdlPath = path.resolve(__dirname, "..", "..", "target", "idl", "paperclip_protocol.json");
46
+ const idlPath = fs.existsSync(npmIdlPath) ? npmIdlPath : devIdlPath;
44
47
  const idl = JSON.parse(fs.readFileSync(idlPath, "utf8"));
45
48
  // Override address with env-configurable PROGRAM_ID
46
49
  idl.address = PROGRAM_ID.toBase58();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paper-clip/pc",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {