Skip to content

Commit aadf8cb

Browse files
committed
fix: the the quote upload no work
1 parent f5034be commit aadf8cb

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

packages/plugin-tee/src/actions/remoteAttestation.ts

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { IAgentRuntime, Memory, State, HandlerCallback } from "@elizaos/core";
22
import { RemoteAttestationProvider } from "../providers/remoteAttestationProvider";
3-
import { File } from "formdata-node";
3+
import { fetch, type BodyInit } from 'undici'
44

55
function hexToUint8Array(hex: string) {
66
hex = hex.trim();
@@ -27,18 +27,12 @@ function hexToUint8Array(hex: string) {
2727

2828
async function uploadUint8Array(data: Uint8Array) {
2929
const blob = new Blob([data], { type: "application/octet-stream" });
30-
const file = new File([blob], "quote.bin", {
31-
type: "application/octet-stream",
32-
});
3330
const formData = new FormData();
34-
formData.append("file", file);
31+
formData.append("file", blob, 'quote.bin');
3532

3633
return await fetch("https://proof.t16z.com/api/upload", {
3734
method: "POST",
38-
headers: {
39-
"Content-type": "multipart/form-data",
40-
},
41-
body: formData,
35+
body: formData as BodyInit,
4236
});
4337
}
4438

@@ -97,4 +91,4 @@ export const remoteAttestationAction = {
9791
}
9892
],
9993
],
100-
};
94+
};

0 commit comments

Comments
 (0)