Skip to content

Commit

Permalink
Merge pull request #63 from DelphinusLab/ZKWAS-242-download-image-fun…
Browse files Browse the repository at this point in the history
…ctionality

ZKWAS-242: Download WASM image functionality
  • Loading branch information
yymone authored Apr 13, 2024
2 parents e164ef1 + 9cdea64 commit 135bcda
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions dist/cjs/helper/task.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export declare class ZkWasmServiceHelper {
endpoint: ZkWasmServiceEndpoint;
constructor(endpoint: string, username: string, useraddress: string);
queryImage(md5: string): Promise<Image>;
queryImageBinary(md5: string): Promise<number[]>;
queryUser(user_query: UserQueryParams): Promise<User>;
queryUserSubscription(user_query: UserQueryParams): Promise<Subscription | null>;
queryTxHistory(history_query: TxHistoryQueryParams): Promise<PaginationResult<TransactionInfo[]>>;
Expand Down
9 changes: 9 additions & 0 deletions dist/cjs/helper/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ class ZkWasmServiceHelper {
return images[0];
});
}
queryImageBinary(md5) {
return __awaiter(this, void 0, void 0, function* () {
let req = JSON.parse("{}");
req["md5"] = md5;
const image = yield this.endpoint.invokeRequest("GET", "/imagebinary", req);
console.log("get queryImageBinary response.");
return image;
});
}
queryUser(user_query) {
return __awaiter(this, void 0, void 0, function* () {
let req = JSON.parse("{}");
Expand Down
1 change: 1 addition & 0 deletions dist/mjs/helper/task.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export declare class ZkWasmServiceHelper {
endpoint: ZkWasmServiceEndpoint;
constructor(endpoint: string, username: string, useraddress: string);
queryImage(md5: string): Promise<Image>;
queryImageBinary(md5: string): Promise<number[]>;
queryUser(user_query: UserQueryParams): Promise<User>;
queryUserSubscription(user_query: UserQueryParams): Promise<Subscription | null>;
queryTxHistory(history_query: TxHistoryQueryParams): Promise<PaginationResult<TransactionInfo[]>>;
Expand Down
7 changes: 7 additions & 0 deletions dist/mjs/helper/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ export class ZkWasmServiceHelper {
console.log("get queryImage response.");
return images[0];
}
async queryImageBinary(md5) {
let req = JSON.parse("{}");
req["md5"] = md5;
const image = await this.endpoint.invokeRequest("GET", "/imagebinary", req);
console.log("get queryImageBinary response.");
return image;
}
async queryUser(user_query) {
let req = JSON.parse("{}");
req["user_address"] = user_query.user_address;
Expand Down
9 changes: 9 additions & 0 deletions src/helper/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ export class ZkWasmServiceHelper {
return images[0]!;
}

async queryImageBinary(md5: string): Promise<number[]> {
let req = JSON.parse("{}");
req["md5"] = md5;

const image = await this.endpoint.invokeRequest("GET", "/imagebinary", req);
console.log("get queryImageBinary response.");
return image!;
}

async queryUser(user_query: UserQueryParams): Promise<User> {
let req = JSON.parse("{}");
req["user_address"] = user_query.user_address;
Expand Down

0 comments on commit 135bcda

Please sign in to comment.