You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To reproduce run any script using reclaim sdk using bun
import{ReclaimClient}from"@reclaimprotocol/zk-fetch";import{verifyProof,transformForOnchain}from"@reclaimprotocol/js-sdk";constapiUrl="https://api.openai.com/v1/chat/completions";constapiKey=process.env.OPENAI_API_KEY;constreclaimPublicKey=process.env.RECLAIM_PUBLIC_KEY;constreclaimPrivateKey=process.env.RECLAIM_PRIVATE_KEY;constreclaimClient=newReclaimClient(reclaimPublicKey,reclaimPrivateKey);constgetProof=async()=>{constdata={model: "gpt-4o",messages: [{role: "system",content: "You are a helpful assistant.",},{role: "user",content: "Hello!",},],};constpublicOptions={method: "POST",body: JSON.stringify(data),headers: {accept: "*/*","accept-language": "en-GB,en-US;q=0.9,en;q=0.8","content-type": "application/json",},};constprivateOptions={headers: {authorization: `Bearer ${apiKey}`,},responseMatches: [{type: "regex",value:
'"choices":\\s*\\[\\s*{\\s*"index":\\s*0,\\s*"message":\\s*{\\s*"role":\\s*"assistant",\\s*"content":\\s*"(?<content>.*?)"',},],};try{constproof=awaitreclaimClient.zkFetch(apiUrl,publicOptions,privateOptions);constisValidProof=awaitverifyProof(proof);return{ proof, isValidProof };}catch(error){console.error("Error during zkFetch:",error);if(error.response){console.error("Response data:",error.response.data);}}};constmain=async()=>{constproof=awaitgetProof();if(proof){consttransformedProof=transformForOnchain(proof.proof);console.log(transformedProof);consturlFromProof=JSON.parse(transformedProof.claimInfo.parameters).url;console.log(urlFromProof);}else{console.error("Failed to generate proof.");}};main()
You will get the following error
➜ daio git:(main) ✗ source .env && bun run zktls/reclaim.ts
warning: Node-API function "napi_type_tag_object" is not implemented yet.
Track the status of Node-API in Bun: https://github.com/oven-sh/bun/issues/158
Gnark is only supported on linux x64 & ARM64. Error: Failed to load shared library: dlopen(/Users/williamcory/daio/node_modules/.p
npm/@reclaimprotocol+circom-symmetric-crypto@git+https+++git@github.com+reclaimprotocol+circom-sy_xxf3fxsuts3gw5j75fssr426le/node_
modules/@reclaimprotocol/circom-symmetric-crypto/resources/gnark/arm64/libverify.so, 0x0006): tried: '/Users/williamcory/daio/node
_modules/.pnpm/@reclaimprotocol+circom-symmetric-crypto@git+https+++git@github.com+reclaimprotocol+circom-sy_xxf3fxsuts3gw5j75fssr
426le/node_modules/@reclaimprotocol/circom-symmetric-crypto/resources/gnark/arm64/libverify.so' (not a mach-o file), '/System/Volu
mes/Preboot/Cryptexes/OS/Users/williamcory/daio/node_modules/.pnpm/@reclaimprotocol+circom-symmetric-crypto@git+https+++git@github
.com+reclaimprotocol+circom-sy_xxf3fxsuts3gw5j75fssr426le/node_modules/@reclaimprotocol/circom-symmetric-crypto/resources/gnark/ar
m64/libverify.so' (no such file), '/Users/williamcory/daio/node_modules/.pnpm/@reclaimprotocol+circom-symmetric-crypto@git+https++
+git@github.com+reclaimprotocol+circ
dyld[35193]: missing symbol called
[1] 35193 abort bun run zktls/reclaim.ts
The text was updated successfully, but these errors were encountered:
Getting another bug using node that is platform specific
Gnark is only supported on linux x64 & ARM64. Error: Failed to load shared library: dlopen(/Users/williamcory/daio/node_modules/.p
npm/@reclaimprotocol+circom-symmetric-crypto@git+https+++git@github.com+reclaimprotocol+circom-sy_xxf3fxsuts3gw5j75fssr426le/node_
modules/@reclaimprotocol/circom-symmetric-crypto/resources/gnark/arm64/libverify.so, 0x0006): tried: '/Users/williamcory/daio/node
_modules/.pnpm/@reclaimprotocol+circom-symmetric-crypto@git+https+++git@github.com+reclaimprotocol+circom-sy_xxf3fxsuts3gw5j75fssr
426le/node_modules/@reclaimprotocol/circom-symmetric-crypto/resources/gnark/arm64/libverify.so' (not a mach-o file), '/System/Volu
mes/Preboot/Cryptexes/OS/Users/williamcory/daio/node_modules/.pnpm/@reclaimprotocol+circom-symmetric-crypto@git+https+++git@github
.com+reclaimprotocol+circom-sy_xxf3fxsuts3gw5j75fssr426le/node_modules/@reclaimprotocol/circom-symmetric-crypto/resources/gnark/ar
m64/libverify.so' (no such file), '/Users/williamcory/daio/node_modules/.pnpm/@reclaimprotocol+circom-symmetric-crypto@git+https++
+git@github.com+reclaimprotocol+circ
/Users/williamcory/daio/node_modules/.pnpm/@reclaimprotocol+zk-fetch@0.2.0_js-base64@3.7.7/node_modules/@reclaimprotocol/zk-fetch/
src/utils.ts:28
throw new InvalidParamError(`${paramName} passed to ${functionName} must not be null or undefined.`);
roninjin10
changed the title
Reclaim sdk does not support bun
Reclaim sdk does not support bun or macos
Oct 28, 2024
To reproduce run any script using reclaim sdk using bun
You will get the following error
The text was updated successfully, but these errors were encountered: