Skip to content

Commit

Permalink
feat: [SC-25948] ✨ Add new endpoint to NameGraph: sampleCollectionMem…
Browse files Browse the repository at this point in the history
…bers (#480)
  • Loading branch information
FrancoAguzzi authored Dec 5, 2024
1 parent 3f80c06 commit f10f837
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nervous-roses-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@namehash/namegraph-sdk": minor
---

Add new endpoint to NameGraph: sampleCollectionMembers
17 changes: 17 additions & 0 deletions packages/namegraph-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,23 @@ export class NameGraph {
return this.rawRequest(`grouped-by-category`, "POST", payload);
}

public sampleCollectionMembers(
collection_id: string,
): Promise<NameGraphSuggestion[]> {
const metadata = true;
const max_sample_size = 5;
const seed = 5;

const payload = {
collection_id,
metadata,
max_sample_size,
seed,
};

return this.rawRequest("sample_collection_members", "POST", payload);
}

public findCollectionsByString(
query: string,
): Promise<FindCollectionsResponse> {
Expand Down

0 comments on commit f10f837

Please sign in to comment.