Skip to content

Commit

Permalink
Dev (#79)
Browse files Browse the repository at this point in the history
* lower polling

* update

* remove signal test

* test

* temp test

* remove signal

* test

* push

* remove signal

* re-introduce-signal

* fix endpoint

* add url

* add prod signal
  • Loading branch information
andy-t-wang authored Oct 12, 2024
1 parent edcf100 commit 8a849c8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 28 deletions.
4 changes: 2 additions & 2 deletions demo/with-next/components/ClientContent/ExternalLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export const ExternalLinks = () => {
Valid Subdomain (Button)
</button>
<Link
href="https://worldcoin-developer-portal.eu.auth0.com/u/login/identifier?state=hKFo2SBHakd3VGFGMllRb0E4QVJMY3pDeS04VG5lWGNwTFVkdKFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIEpFNTd0NjdIOTZLVzdVMG5FVXdrQ0dHUV92dHVwaE1ho2NpZNkgbU1vVGJqbFI4RmZYVEJrU05nVzk3d1BxR2tmUmNWUk8"
href="https://worldcoin-developer-portal.eu.auth0.com/u/login/identifier"
className="bg-green-500 text-white text-center rounded-lg p-3"
>
Valid double Subdomain (Link)
</Link>
<button
onClick={() =>
window.open(
"https://worldcoin-developer-portal.eu.auth0.com/u/login/identifier?state=hKFo2SBHakd3VGFGMllRb0E4QVJMY3pDeS04VG5lWGNwTFVkdKFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIEpFNTd0NjdIOTZLVzdVMG5FVXdrQ0dHUV92dHVwaE1ho2NpZNkgbU1vVGJqbFI4RmZYVEJrU05nVzk3d1BxR2tmUmNWUk8"
"https://worldcoin-developer-portal.eu.auth0.com/u/login/identifier"
)
}
className="text-white bg-green-500 transition p-4 leading-[1] rounded-lg"
Expand Down
1 change: 1 addition & 0 deletions demo/with-next/components/ClientContent/Transaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const SendTransaction = () => {
app_id: process.env.NEXT_PUBLIC_STAGING_VERIFY_APP_ID || "",
},
transactionId: transactionId,
pollingInterval: 2000,
});

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export const VerifyAction = () => {
app_id: process.env.NEXT_PUBLIC_PROD_VERIFY_APP_ID as `app_${string}`,
action: process.env.NEXT_PUBLIC_PROD_VERIFY_ACTION as string,
verification_level,
signal: "test",
});
},
[verifyAction]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,26 @@ import {
export const verifyProof = async (params: {
app_id: `app_${string}`;
action: string;
signal: string;
signal?: string;
payload: ISuccessResult;
}) => {
const { app_id, action, payload, signal } = params;
let verifyResponse: IVerifyResponse | null = null;
const stagingEndpoint = `${process.env.NEXT_SERVER_STAGING_DEV_PORTAL_URL}/api/v1/verify/${app_id}`;
const productionEndpoint = `${process.env.NEXT_SERVER_PROD_DEV_PORTAL_URL}/api/v1/verify/${app_id}`;
const stagingEndpoint = `${process.env.NEXT_SERVER_STAGING_DEV_PORTAL_URL}/api/v2/verify/${app_id}`;

try {
// verifyResponse = await verifyCloudProof(
// payload,
// app_id,
// action,
// signal,
verifyResponse = await verifyCloudProof(
payload,
app_id,
action,
signal,

// process.env.NEXT_DEPLOYMENT_ENVIRONMENT === "staging"
// ? stagingEndpoint
// : undefined
// );
console.log(payload, app_id, action, signal);
const response = await fetch(productionEndpoint, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
payload,
app_id,
action,
signal,
}),
});
console.log("verifyResponse", response);
process.env.NEXT_DEPLOYMENT_ENVIRONMENT === "staging"
? stagingEndpoint
: undefined
);

console.log("verifyResponse", verifyResponse);
} catch (error) {
console.log("Error in verifyCloudProof", error);
}
Expand Down
1 change: 1 addition & 0 deletions packages/core/minikit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export class MiniKit {
verification_level: payload.verification_level || VerificationLevel.Orb,
timestamp,
};

sendMiniKitEvent({
command: Command.Verify,
version: this.commandVersion[Command.Verify],
Expand Down

0 comments on commit 8a849c8

Please sign in to comment.