Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion src/hooks/useAgentPermissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export function useAgentPermissions(agentAddress: string | null) {

const [contractAddress, contractName] = agentAddress.split(".");
const res = await fetch(
`${process.env.NEXT_PUBLIC_CACHE_URL}/contract-calls/read-only/${contractAddress}/${contractName}/get-agent-permissions`,
// `${process.env.NEXT_PUBLIC_CACHE_URL}/contract-calls/read-only/${contractAddress}/${contractName}/get-agent-permissions`,
`https://aibtcdev-cache-preview.hosting-962.workers.dev/contract-calls/read-only/${contractAddress}/${contractName}/get-agent-permissions`,
{
method: "POST",
headers: {
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useContractApproval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ async function fetchApprovals(
const results = await Promise.all(
contractIds.map(async (targetContractId) => {
const res = await fetch(
`${process.env.NEXT_PUBLIC_CACHE_URL}/contract-calls/read-only/${agentAddr}/${agentName}/is-approved-contract`,
// `${process.env.NEXT_PUBLIC_CACHE_URL}/contract-calls/read-only/${agentAddr}/${agentName}/is-approved-contract`,
`https://aibtcdev-cache-preview.hosting-962.workers.dev/contract-calls/read-only/${agentAddr}/${agentName}/get-agent-permissions`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
Expand Down
12 changes: 6 additions & 6 deletions src/lib/vote-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export function formatVotes(votes: number): string {
return (votes / 1e8).toString();
}

const url =
process.env.NEXT_PUBLIC_STACKS_NETWORK === "testnet"
? process.env.NEXT_PUBLIC_CACHE_URL_TESTNET
: process.env.NEXT_PUBLIC_CACHE_URL;
// const url =
// process.env.NEXT_PUBLIC_STACKS_NETWORK === "testnet"
// ? process.env.NEXT_PUBLIC_CACHE_URL_TESTNET
// : process.env.NEXT_PUBLIC_CACHE_URL;

export async function getProposalVotes(
contractPrincipal: string,
Expand All @@ -25,9 +25,9 @@ export async function getProposalVotes(
}

try {
// Call the endpoint with POST method and the correct request body format
// `${url}/contract-calls/read-only/${contractAddress}/${contractName}/get-proposal`,
const response = await fetch(
`${url}/contract-calls/read-only/${contractAddress}/${contractName}/get-proposal`,
`https://aibtcdev-cache-preview.hosting-962.workers.dev/contract-calls/read-only/${contractAddress}/${contractName}/get-proposal`,
{
method: "POST",
headers: {
Expand Down
5 changes: 3 additions & 2 deletions src/services/vote.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,14 @@ export async function getProposalVotes(
const proposalIdString = proposalId.toString();

try {
const apiUrl = `${url}/contract-calls/read-only/${contractAddress}/${contractName}/get-proposal`;
// const apiUrl = `${url}/contract-calls/read-only/${contractAddress}/${contractName}/get-proposal`;
const apiUrl = `https://aibtcdev-cache-preview.hosting-962.workers.dev/read-only/${contractAddress}/${contractName}/get-agent-permissions`;
const response = await fetch(apiUrl, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
functionArgs: [{ type: "uint", value: proposalIdString }],
// Optional: Add cache control if the endpoint supports it
network: process.env.NEXT_PUBLIC_STACKS_NETWORK,
cacheControl: bustCache ? { bustCache: true, ttl: 3600 } : undefined,
}),
});
Expand Down