Skip to content

Commit

Permalink
secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin-Ray committed Nov 19, 2024
1 parent 701d65b commit cf344e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 3 additions & 6 deletions chainlink-functions/example/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,26 +198,23 @@ const makeRequestSepolia = async () => {

if (fulfillmentCode === FulfillmentCode.FULFILLED) {
console.log(
`\n✅ Request ${
response.requestId
`\n✅ Request ${response.requestId
} successfully fulfilled. Cost is ${ethers.utils.formatEther(
response.totalCostInJuels
)} LINK.Complete reponse: `,
response
);
} else if (fulfillmentCode === FulfillmentCode.USER_CALLBACK_ERROR) {
console.log(
`\n⚠️ Request ${
response.requestId
`\n⚠️ Request ${response.requestId
} fulfilled. However, the consumer contract callback failed. Cost is ${ethers.utils.formatEther(
response.totalCostInJuels
)} LINK.Complete reponse: `,
response
);
} else {
console.log(
`\n❌ Request ${
response.requestId
`\n❌ Request ${response.requestId
} not fulfilled. Code: ${fulfillmentCode}. Cost is ${ethers.utils.formatEther(
response.totalCostInJuels
)} LINK.Complete reponse: `,
Expand Down
7 changes: 5 additions & 2 deletions chainlink-functions/example/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ const SxTProof = SxTProofModule.default;
const queryString = 'SELECT SUM(BLOCK_NUMBER), COUNT(*) FROM ETHEREUM.BLOCKS';
const commitmentKey =
'0xca407206ec1ab726b2636c4b145ac28749505e273536fae35330b966dac69e86a4832a125c0464e066dd20add960efb518424c4f434b5320455448455245554d4a9e6f9b8d43f6ad008f8c291929dee201';
const apiKey = 'your_api_key_here';

if (!secrets.apiKey) {
throw Error("Missing secret: apiKey");
}

// Step 1: Initialize the SxTProof instance
const proof = new SxTProof(queryString, commitmentKey, apiKey);
const proof = new SxTProof(queryString, commitmentKey, secrets.apiKey);

try {
// Step 2: Initialize the wasm module
Expand Down

0 comments on commit cf344e2

Please sign in to comment.