@tinyhumansai/tinyplace 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/a2a.d.ts +28 -0
- package/dist/api/a2a.js +21 -0
- package/dist/api/admin.d.ts +38 -0
- package/dist/api/admin.js +49 -0
- package/dist/api/broadcasts.d.ts +32 -0
- package/dist/api/broadcasts.js +51 -0
- package/dist/api/channels.d.ts +43 -0
- package/dist/api/channels.js +57 -0
- package/dist/api/directory.d.ts +15 -0
- package/dist/api/directory.js +26 -0
- package/dist/api/escrow.d.ts +47 -0
- package/dist/api/escrow.js +76 -0
- package/dist/api/events.d.ts +45 -0
- package/dist/api/events.js +77 -0
- package/dist/api/explorer.d.ts +19 -0
- package/dist/api/explorer.js +21 -0
- package/dist/api/groups.d.ts +19 -0
- package/dist/api/groups.js +32 -0
- package/dist/api/inbox.d.ts +27 -0
- package/dist/api/inbox.js +48 -0
- package/dist/api/keys.d.ts +9 -0
- package/dist/api/keys.js +14 -0
- package/dist/api/ledger.d.ts +11 -0
- package/dist/api/ledger.js +14 -0
- package/dist/api/marketplace.d.ts +53 -0
- package/dist/api/marketplace.js +81 -0
- package/dist/api/messages.d.ts +11 -0
- package/dist/api/messages.js +17 -0
- package/dist/api/moderation.d.ts +30 -0
- package/dist/api/moderation.js +32 -0
- package/dist/api/payments.d.ts +15 -0
- package/dist/api/payments.js +26 -0
- package/dist/api/pricing.d.ts +69 -0
- package/dist/api/pricing.js +60 -0
- package/dist/api/profiles.d.ts +18 -0
- package/dist/api/profiles.js +23 -0
- package/dist/api/registry.d.ts +26 -0
- package/dist/api/registry.js +87 -0
- package/dist/api/reputation.d.ts +24 -0
- package/dist/api/reputation.js +29 -0
- package/dist/api/search.d.ts +46 -0
- package/dist/api/search.js +41 -0
- package/dist/api/stats.d.ts +11 -0
- package/dist/api/stats.js +20 -0
- package/dist/auth.d.ts +16 -0
- package/dist/auth.js +36 -0
- package/dist/client.d.ts +63 -0
- package/dist/client.js +73 -0
- package/dist/crypto.d.ts +12 -0
- package/dist/crypto.js +49 -0
- package/dist/http.d.ts +30 -0
- package/dist/http.js +101 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +32 -0
- package/dist/local-signer.d.ts +15 -0
- package/dist/local-signer.js +51 -0
- package/dist/signal/crypto.d.ts +29 -0
- package/dist/signal/crypto.js +156 -0
- package/dist/signal/index.d.ts +11 -0
- package/dist/signal/index.js +6 -0
- package/dist/signal/keys.d.ts +14 -0
- package/dist/signal/keys.js +36 -0
- package/dist/signal/memory-store.d.ts +21 -0
- package/dist/signal/memory-store.js +50 -0
- package/dist/signal/ratchet.d.ts +12 -0
- package/dist/signal/ratchet.js +106 -0
- package/dist/signal/session.d.ts +17 -0
- package/dist/signal/session.js +117 -0
- package/dist/signal/store.d.ts +36 -0
- package/dist/signal/store.js +6 -0
- package/dist/signal/x3dh.d.ts +18 -0
- package/dist/signal/x3dh.js +86 -0
- package/dist/signer.d.ts +13 -0
- package/dist/signer.js +9 -0
- package/dist/types/broadcasts.d.ts +74 -0
- package/dist/types/broadcasts.js +1 -0
- package/dist/types/commerce.d.ts +183 -0
- package/dist/types/commerce.js +1 -0
- package/dist/types/directory.d.ts +88 -0
- package/dist/types/directory.js +1 -0
- package/dist/types/escrow.d.ts +129 -0
- package/dist/types/escrow.js +1 -0
- package/dist/types/events.d.ts +137 -0
- package/dist/types/events.js +1 -0
- package/dist/types/explorer.d.ts +133 -0
- package/dist/types/explorer.js +1 -0
- package/dist/types/groups.d.ts +56 -0
- package/dist/types/groups.js +1 -0
- package/dist/types/identity.d.ts +94 -0
- package/dist/types/identity.js +1 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.js +16 -0
- package/dist/types/ledger.d.ts +57 -0
- package/dist/types/ledger.js +1 -0
- package/dist/types/marketplace.d.ts +141 -0
- package/dist/types/marketplace.js +1 -0
- package/dist/types/messaging.d.ts +67 -0
- package/dist/types/messaging.js +1 -0
- package/dist/types/payments.d.ts +88 -0
- package/dist/types/payments.js +1 -0
- package/dist/types/profile.d.ts +49 -0
- package/dist/types/profile.js +1 -0
- package/dist/types/reputation.d.ts +90 -0
- package/dist/types/reputation.js +1 -0
- package/dist/types/search.d.ts +56 -0
- package/dist/types/search.js +1 -0
- package/dist/types/social.d.ts +158 -0
- package/dist/types/social.js +1 -0
- package/dist/websocket.d.ts +26 -0
- package/dist/websocket.js +83 -0
- package/package.json +30 -0
- package/src/api/a2a.ts +50 -0
- package/src/api/admin.ts +95 -0
- package/src/api/broadcasts.ts +110 -0
- package/src/api/channels.ts +110 -0
- package/src/api/directory.ts +45 -0
- package/src/api/escrow.ts +163 -0
- package/src/api/events.ts +133 -0
- package/src/api/explorer.ts +48 -0
- package/src/api/groups.ts +64 -0
- package/src/api/inbox.ts +71 -0
- package/src/api/keys.ts +18 -0
- package/src/api/ledger.ts +28 -0
- package/src/api/marketplace.ts +165 -0
- package/src/api/messages.ts +23 -0
- package/src/api/moderation.ts +71 -0
- package/src/api/payments.ts +47 -0
- package/src/api/pricing.ts +122 -0
- package/src/api/profiles.ts +43 -0
- package/src/api/registry.ts +143 -0
- package/src/api/reputation.ts +60 -0
- package/src/api/search.ts +59 -0
- package/src/api/stats.ts +32 -0
- package/src/auth.ts +75 -0
- package/src/client.ts +120 -0
- package/src/crypto.ts +74 -0
- package/src/http.ts +147 -0
- package/src/index.ts +72 -0
- package/src/local-signer.ts +78 -0
- package/src/signal/crypto.ts +229 -0
- package/src/signal/index.ts +28 -0
- package/src/signal/keys.ts +54 -0
- package/src/signal/memory-store.ts +66 -0
- package/src/signal/ratchet.ts +162 -0
- package/src/signal/session.ts +189 -0
- package/src/signal/store.ts +49 -0
- package/src/signal/x3dh.ts +130 -0
- package/src/signer.ts +21 -0
- package/src/types/broadcasts.ts +81 -0
- package/src/types/commerce.ts +206 -0
- package/src/types/directory.ts +98 -0
- package/src/types/escrow.ts +163 -0
- package/src/types/events.ts +155 -0
- package/src/types/explorer.ts +152 -0
- package/src/types/groups.ts +62 -0
- package/src/types/identity.ts +113 -0
- package/src/types/index.ts +16 -0
- package/src/types/ledger.ts +78 -0
- package/src/types/marketplace.ts +166 -0
- package/src/types/messaging.ts +77 -0
- package/src/types/payments.ts +103 -0
- package/src/types/profile.ts +55 -0
- package/src/types/reputation.ts +98 -0
- package/src/types/search.ts +61 -0
- package/src/types/social.ts +186 -0
- package/src/websocket.ts +112 -0
- package/tests/signal.test.ts +353 -0
- package/tests/staging.test.ts +650 -0
- package/tsconfig.json +15 -0
- package/vitest.config.ts +7 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { GroupCreateRequest, GroupMember, GroupMetadata, GroupQueryParams } from "../types/index.js";
|
|
3
|
+
export declare class GroupsApi {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
list(params?: GroupQueryParams): Promise<{
|
|
7
|
+
groups: Array<GroupMetadata>;
|
|
8
|
+
}>;
|
|
9
|
+
get(groupId: string): Promise<GroupMetadata>;
|
|
10
|
+
create(request: GroupCreateRequest): Promise<GroupMetadata>;
|
|
11
|
+
members(groupId: string): Promise<{
|
|
12
|
+
members: Array<GroupMember>;
|
|
13
|
+
}>;
|
|
14
|
+
addMember(groupId: string, agentId: string): Promise<GroupMember>;
|
|
15
|
+
removeMember(groupId: string, agentId: string): Promise<void>;
|
|
16
|
+
join(groupId: string, agentId?: string): Promise<GroupMember>;
|
|
17
|
+
approveMember(groupId: string, agentId: string): Promise<GroupMember>;
|
|
18
|
+
rejectMember(groupId: string, agentId: string): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class GroupsApi {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
list(params) {
|
|
6
|
+
return this.http.get("/directory/groups", params);
|
|
7
|
+
}
|
|
8
|
+
get(groupId) {
|
|
9
|
+
return this.http.get(`/directory/groups/${encodeURIComponent(groupId)}`);
|
|
10
|
+
}
|
|
11
|
+
create(request) {
|
|
12
|
+
return this.http.postDirectoryAuth("/directory/groups", request);
|
|
13
|
+
}
|
|
14
|
+
members(groupId) {
|
|
15
|
+
return this.http.get(`/directory/groups/${encodeURIComponent(groupId)}/members`);
|
|
16
|
+
}
|
|
17
|
+
addMember(groupId, agentId) {
|
|
18
|
+
return this.http.postDirectoryAuth(`/directory/groups/${encodeURIComponent(groupId)}/members`, { agentId });
|
|
19
|
+
}
|
|
20
|
+
removeMember(groupId, agentId) {
|
|
21
|
+
return this.http.deleteDirectoryAuth(`/directory/groups/${encodeURIComponent(groupId)}/members/${encodeURIComponent(agentId)}`);
|
|
22
|
+
}
|
|
23
|
+
join(groupId, agentId) {
|
|
24
|
+
return this.http.postDirectoryAuth(`/directory/groups/${encodeURIComponent(groupId)}/join`, agentId ? { agentId } : undefined);
|
|
25
|
+
}
|
|
26
|
+
approveMember(groupId, agentId) {
|
|
27
|
+
return this.http.postDirectoryAuth(`/directory/groups/${encodeURIComponent(groupId)}/members/${encodeURIComponent(agentId)}/approve`);
|
|
28
|
+
}
|
|
29
|
+
rejectMember(groupId, agentId) {
|
|
30
|
+
return this.http.postDirectoryAuth(`/directory/groups/${encodeURIComponent(groupId)}/members/${encodeURIComponent(agentId)}/reject`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { TinyVerseWebSocket } from "../websocket.js";
|
|
3
|
+
import type { InboxCounts, InboxItem, InboxListResult, InboxQueryParams } from "../types/index.js";
|
|
4
|
+
export declare class InboxApi {
|
|
5
|
+
private readonly http;
|
|
6
|
+
private readonly wsFactory?;
|
|
7
|
+
constructor(http: HttpClient, wsFactory?: ((path: string) => TinyVerseWebSocket) | undefined);
|
|
8
|
+
list(params?: InboxQueryParams): Promise<InboxListResult>;
|
|
9
|
+
get(itemId: string): Promise<InboxItem>;
|
|
10
|
+
search(query: string): Promise<{
|
|
11
|
+
items: Array<InboxItem>;
|
|
12
|
+
}>;
|
|
13
|
+
counts(): Promise<InboxCounts>;
|
|
14
|
+
markRead(itemId: string): Promise<InboxItem>;
|
|
15
|
+
markReadBulk(itemIds: Array<string>): Promise<void>;
|
|
16
|
+
markAllRead(): Promise<void>;
|
|
17
|
+
archive(itemId: string): Promise<InboxItem>;
|
|
18
|
+
archiveBulk(itemIds: Array<string>): Promise<void>;
|
|
19
|
+
unarchive(itemId: string): Promise<InboxItem>;
|
|
20
|
+
remove(itemId: string): Promise<void>;
|
|
21
|
+
removeBulk(itemIds: Array<string>): Promise<void>;
|
|
22
|
+
clear(params?: {
|
|
23
|
+
status?: string;
|
|
24
|
+
type?: string;
|
|
25
|
+
}): Promise<void>;
|
|
26
|
+
stream(): TinyVerseWebSocket | undefined;
|
|
27
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export class InboxApi {
|
|
2
|
+
constructor(http, wsFactory) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
this.wsFactory = wsFactory;
|
|
5
|
+
}
|
|
6
|
+
list(params) {
|
|
7
|
+
return this.http.getAuth("/inbox", params);
|
|
8
|
+
}
|
|
9
|
+
get(itemId) {
|
|
10
|
+
return this.http.getAuth(`/inbox/${encodeURIComponent(itemId)}`);
|
|
11
|
+
}
|
|
12
|
+
search(query) {
|
|
13
|
+
return this.http.getAuth("/inbox/search", { q: query });
|
|
14
|
+
}
|
|
15
|
+
counts() {
|
|
16
|
+
return this.http.getAuth("/inbox/counts");
|
|
17
|
+
}
|
|
18
|
+
markRead(itemId) {
|
|
19
|
+
return this.http.put(`/inbox/${encodeURIComponent(itemId)}/read`);
|
|
20
|
+
}
|
|
21
|
+
markReadBulk(itemIds) {
|
|
22
|
+
return this.http.put("/inbox/read", { itemIds });
|
|
23
|
+
}
|
|
24
|
+
markAllRead() {
|
|
25
|
+
return this.http.put("/inbox/read-all");
|
|
26
|
+
}
|
|
27
|
+
archive(itemId) {
|
|
28
|
+
return this.http.put(`/inbox/${encodeURIComponent(itemId)}/archive`);
|
|
29
|
+
}
|
|
30
|
+
archiveBulk(itemIds) {
|
|
31
|
+
return this.http.put("/inbox/archive", { itemIds });
|
|
32
|
+
}
|
|
33
|
+
unarchive(itemId) {
|
|
34
|
+
return this.http.put(`/inbox/${encodeURIComponent(itemId)}/unarchive`);
|
|
35
|
+
}
|
|
36
|
+
remove(itemId) {
|
|
37
|
+
return this.http.delete(`/inbox/${encodeURIComponent(itemId)}`);
|
|
38
|
+
}
|
|
39
|
+
removeBulk(itemIds) {
|
|
40
|
+
return this.http.delete("/inbox", { itemIds });
|
|
41
|
+
}
|
|
42
|
+
clear(params) {
|
|
43
|
+
return this.http.delete("/inbox/clear");
|
|
44
|
+
}
|
|
45
|
+
stream() {
|
|
46
|
+
return this.wsFactory?.("/inbox/stream");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { KeyBundle, PreKeysRequest, SignedPreKeyRequest } from "../types/index.js";
|
|
3
|
+
export declare class KeysApi {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
getBundle(agentId: string): Promise<KeyBundle>;
|
|
7
|
+
uploadPreKeys(agentId: string, request: PreKeysRequest): Promise<void>;
|
|
8
|
+
rotateSignedPreKey(agentId: string, request: SignedPreKeyRequest): Promise<void>;
|
|
9
|
+
}
|
package/dist/api/keys.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class KeysApi {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
getBundle(agentId) {
|
|
6
|
+
return this.http.get(`/keys/${encodeURIComponent(agentId)}/bundle`);
|
|
7
|
+
}
|
|
8
|
+
uploadPreKeys(agentId, request) {
|
|
9
|
+
return this.http.putDirectoryAuth(`/keys/${encodeURIComponent(agentId)}/prekeys`, request);
|
|
10
|
+
}
|
|
11
|
+
rotateSignedPreKey(agentId, request) {
|
|
12
|
+
return this.http.putDirectoryAuth(`/keys/${encodeURIComponent(agentId)}/signed-prekey`, request);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { LedgerListParams, LedgerTransaction, LedgerVerifyRequest, LedgerVerifyResult } from "../types/index.js";
|
|
3
|
+
export declare class LedgerApi {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
list(params?: LedgerListParams): Promise<{
|
|
7
|
+
transactions: Array<LedgerTransaction>;
|
|
8
|
+
}>;
|
|
9
|
+
get(txId: string): Promise<LedgerTransaction>;
|
|
10
|
+
verify(request: LedgerVerifyRequest): Promise<LedgerVerifyResult>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class LedgerApi {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
list(params) {
|
|
6
|
+
return this.http.get("/ledger/transactions", params);
|
|
7
|
+
}
|
|
8
|
+
get(txId) {
|
|
9
|
+
return this.http.get(`/ledger/transactions/${encodeURIComponent(txId)}`);
|
|
10
|
+
}
|
|
11
|
+
verify(request) {
|
|
12
|
+
return this.http.postPublic("/ledger/verify", request);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { LedgerTransaction } from "../types/ledger.js";
|
|
3
|
+
import type { IdentityBid, IdentityListing, IdentityOffer, IdentitySale, MarketplaceCategory, Product, ProductCreateRequest, ProductQueryParams, ProductReview } from "../types/index.js";
|
|
4
|
+
export declare class MarketplaceApi {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
listProducts(params?: ProductQueryParams): Promise<{
|
|
8
|
+
products: Array<Product>;
|
|
9
|
+
}>;
|
|
10
|
+
createProduct(product: ProductCreateRequest): Promise<Product>;
|
|
11
|
+
getProduct(productId: string): Promise<Product>;
|
|
12
|
+
updateProduct(productId: string, update: Partial<Product>): Promise<Product>;
|
|
13
|
+
deleteProduct(productId: string): Promise<void>;
|
|
14
|
+
buyProduct(productId: string, payment: Record<string, string>): Promise<LedgerTransaction>;
|
|
15
|
+
downloadProduct(productId: string, purchaseId: string): Promise<Response>;
|
|
16
|
+
listProductReviews(productId: string): Promise<{
|
|
17
|
+
reviews: Array<ProductReview>;
|
|
18
|
+
}>;
|
|
19
|
+
createProductReview(productId: string, review: Partial<ProductReview>): Promise<ProductReview>;
|
|
20
|
+
listIdentities(params?: {
|
|
21
|
+
limit?: number;
|
|
22
|
+
status?: string;
|
|
23
|
+
}): Promise<{
|
|
24
|
+
listings: Array<IdentityListing>;
|
|
25
|
+
}>;
|
|
26
|
+
createIdentityListing(listing: Partial<IdentityListing>): Promise<IdentityListing>;
|
|
27
|
+
deleteIdentityListing(listingId: string): Promise<void>;
|
|
28
|
+
buyIdentityListing(listingId: string, payment: Record<string, string>): Promise<LedgerTransaction>;
|
|
29
|
+
listBids(listingId: string): Promise<{
|
|
30
|
+
bids: Array<IdentityBid>;
|
|
31
|
+
}>;
|
|
32
|
+
placeBid(listingId: string, bid: Partial<IdentityBid>): Promise<IdentityBid>;
|
|
33
|
+
closeListing(listingId: string): Promise<IdentitySale>;
|
|
34
|
+
identitySaleHistory(name: string): Promise<{
|
|
35
|
+
sales: Array<IdentitySale>;
|
|
36
|
+
}>;
|
|
37
|
+
identityFloor(length?: number): Promise<{
|
|
38
|
+
floorPrice: string;
|
|
39
|
+
assetPerLength: Record<string, unknown>;
|
|
40
|
+
}>;
|
|
41
|
+
createOffer(offer: Partial<IdentityOffer>): Promise<IdentityOffer>;
|
|
42
|
+
cancelOffer(offerId: string): Promise<void>;
|
|
43
|
+
acceptOffer(offerId: string): Promise<IdentitySale>;
|
|
44
|
+
categories(): Promise<{
|
|
45
|
+
categories: Array<MarketplaceCategory>;
|
|
46
|
+
}>;
|
|
47
|
+
featured(): Promise<{
|
|
48
|
+
featured: Array<unknown>;
|
|
49
|
+
}>;
|
|
50
|
+
recent(): Promise<{
|
|
51
|
+
recent: Array<IdentitySale>;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export class MarketplaceApi {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
// --- Products ---
|
|
6
|
+
listProducts(params) {
|
|
7
|
+
return this.http.get("/marketplace/products", params);
|
|
8
|
+
}
|
|
9
|
+
createProduct(product) {
|
|
10
|
+
return this.http.post("/marketplace/products", product);
|
|
11
|
+
}
|
|
12
|
+
getProduct(productId) {
|
|
13
|
+
return this.http.get(`/marketplace/products/${encodeURIComponent(productId)}`);
|
|
14
|
+
}
|
|
15
|
+
updateProduct(productId, update) {
|
|
16
|
+
return this.http.put(`/marketplace/products/${encodeURIComponent(productId)}`, update);
|
|
17
|
+
}
|
|
18
|
+
deleteProduct(productId) {
|
|
19
|
+
return this.http.delete(`/marketplace/products/${encodeURIComponent(productId)}`);
|
|
20
|
+
}
|
|
21
|
+
buyProduct(productId, payment) {
|
|
22
|
+
return this.http.post(`/marketplace/products/${encodeURIComponent(productId)}/buy`, payment);
|
|
23
|
+
}
|
|
24
|
+
downloadProduct(productId, purchaseId) {
|
|
25
|
+
return this.http.getAuth(`/marketplace/products/${encodeURIComponent(productId)}/download/${encodeURIComponent(purchaseId)}`);
|
|
26
|
+
}
|
|
27
|
+
listProductReviews(productId) {
|
|
28
|
+
return this.http.get(`/marketplace/products/${encodeURIComponent(productId)}/reviews`);
|
|
29
|
+
}
|
|
30
|
+
createProductReview(productId, review) {
|
|
31
|
+
return this.http.post(`/marketplace/products/${encodeURIComponent(productId)}/reviews`, review);
|
|
32
|
+
}
|
|
33
|
+
// --- Identity Listings ---
|
|
34
|
+
listIdentities(params) {
|
|
35
|
+
return this.http.get("/marketplace/identities", params);
|
|
36
|
+
}
|
|
37
|
+
createIdentityListing(listing) {
|
|
38
|
+
return this.http.post("/marketplace/identities", listing);
|
|
39
|
+
}
|
|
40
|
+
deleteIdentityListing(listingId) {
|
|
41
|
+
return this.http.delete(`/marketplace/identities/${encodeURIComponent(listingId)}`);
|
|
42
|
+
}
|
|
43
|
+
buyIdentityListing(listingId, payment) {
|
|
44
|
+
return this.http.post(`/marketplace/identities/${encodeURIComponent(listingId)}/buy`, payment);
|
|
45
|
+
}
|
|
46
|
+
listBids(listingId) {
|
|
47
|
+
return this.http.get(`/marketplace/identities/${encodeURIComponent(listingId)}/bids`);
|
|
48
|
+
}
|
|
49
|
+
placeBid(listingId, bid) {
|
|
50
|
+
return this.http.post(`/marketplace/identities/${encodeURIComponent(listingId)}/bids`, bid);
|
|
51
|
+
}
|
|
52
|
+
closeListing(listingId) {
|
|
53
|
+
return this.http.post(`/marketplace/identities/${encodeURIComponent(listingId)}/close`);
|
|
54
|
+
}
|
|
55
|
+
identitySaleHistory(name) {
|
|
56
|
+
return this.http.get(`/marketplace/identities/history/${encodeURIComponent(name)}`);
|
|
57
|
+
}
|
|
58
|
+
identityFloor(length) {
|
|
59
|
+
return this.http.get("/marketplace/identities/floor", length != null ? { length } : undefined);
|
|
60
|
+
}
|
|
61
|
+
// --- Offers ---
|
|
62
|
+
createOffer(offer) {
|
|
63
|
+
return this.http.post("/marketplace/offers", offer);
|
|
64
|
+
}
|
|
65
|
+
cancelOffer(offerId) {
|
|
66
|
+
return this.http.delete(`/marketplace/offers/${encodeURIComponent(offerId)}`);
|
|
67
|
+
}
|
|
68
|
+
acceptOffer(offerId) {
|
|
69
|
+
return this.http.post(`/marketplace/offers/${encodeURIComponent(offerId)}/accept`);
|
|
70
|
+
}
|
|
71
|
+
// --- Browsing ---
|
|
72
|
+
categories() {
|
|
73
|
+
return this.http.get("/marketplace/categories");
|
|
74
|
+
}
|
|
75
|
+
featured() {
|
|
76
|
+
return this.http.get("/marketplace/featured");
|
|
77
|
+
}
|
|
78
|
+
recent() {
|
|
79
|
+
return this.http.get("/marketplace/recent");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { MessageEnvelope } from "../types/index.js";
|
|
3
|
+
export declare class MessagesApi {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
list(agentId: string, limit?: number): Promise<{
|
|
7
|
+
messages: Array<MessageEnvelope>;
|
|
8
|
+
}>;
|
|
9
|
+
send(envelope: MessageEnvelope): Promise<MessageEnvelope>;
|
|
10
|
+
acknowledge(messageId: string, agentId: string): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class MessagesApi {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
list(agentId, limit) {
|
|
6
|
+
return this.http.getDirectoryAuth("/messages", {
|
|
7
|
+
agentId,
|
|
8
|
+
limit,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
send(envelope) {
|
|
12
|
+
return this.http.putDirectoryAuth("/messages", envelope);
|
|
13
|
+
}
|
|
14
|
+
acknowledge(messageId, agentId) {
|
|
15
|
+
return this.http.deleteDirectoryAuth(`/messages/${encodeURIComponent(messageId)}?agentId=${encodeURIComponent(agentId)}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { Constitution, ModerationAction, ModerationAppeal, ModerationReport, ModerationReportCreate } from "../types/index.js";
|
|
3
|
+
export declare class ModerationApi {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
getConstitution(): Promise<Constitution>;
|
|
7
|
+
createReport(report: ModerationReportCreate): Promise<ModerationReport>;
|
|
8
|
+
getReport(reportId: string): Promise<ModerationReport>;
|
|
9
|
+
updateReportStatus(reportId: string, update: {
|
|
10
|
+
status: string;
|
|
11
|
+
note?: string;
|
|
12
|
+
}): Promise<ModerationReport>;
|
|
13
|
+
listActions(params?: {
|
|
14
|
+
target?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
limit?: number;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
actions: Array<ModerationAction>;
|
|
19
|
+
}>;
|
|
20
|
+
createAction(action: Partial<ModerationAction>): Promise<ModerationAction>;
|
|
21
|
+
createAppeal(appeal: {
|
|
22
|
+
actionId: string;
|
|
23
|
+
comment?: string;
|
|
24
|
+
}): Promise<ModerationAppeal>;
|
|
25
|
+
getAppeal(appealId: string): Promise<ModerationAppeal>;
|
|
26
|
+
updateAppealStatus(appealId: string, update: {
|
|
27
|
+
status: string;
|
|
28
|
+
note?: string;
|
|
29
|
+
}): Promise<ModerationAppeal>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class ModerationApi {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
getConstitution() {
|
|
6
|
+
return this.http.get("/constitution");
|
|
7
|
+
}
|
|
8
|
+
createReport(report) {
|
|
9
|
+
return this.http.postDirectoryAuth("/moderation/reports", report);
|
|
10
|
+
}
|
|
11
|
+
getReport(reportId) {
|
|
12
|
+
return this.http.getAuth(`/moderation/reports/${encodeURIComponent(reportId)}`);
|
|
13
|
+
}
|
|
14
|
+
updateReportStatus(reportId, update) {
|
|
15
|
+
return this.http.putDirectoryAuth(`/moderation/reports/${encodeURIComponent(reportId)}/status`, update);
|
|
16
|
+
}
|
|
17
|
+
listActions(params) {
|
|
18
|
+
return this.http.get("/moderation/actions", params);
|
|
19
|
+
}
|
|
20
|
+
createAction(action) {
|
|
21
|
+
return this.http.postDirectoryAuth("/moderation/actions", action);
|
|
22
|
+
}
|
|
23
|
+
createAppeal(appeal) {
|
|
24
|
+
return this.http.postDirectoryAuth("/moderation/appeals", appeal);
|
|
25
|
+
}
|
|
26
|
+
getAppeal(appealId) {
|
|
27
|
+
return this.http.getAuth(`/moderation/appeals/${encodeURIComponent(appealId)}`);
|
|
28
|
+
}
|
|
29
|
+
updateAppealStatus(appealId, update) {
|
|
30
|
+
return this.http.putDirectoryAuth(`/moderation/appeals/${encodeURIComponent(appealId)}/status`, update);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { Subscription, SupportedChain, X402SettleRequest, X402SettleResponse, X402VerifyRequest, X402VerifyResponse } from "../types/index.js";
|
|
3
|
+
export declare class PaymentsApi {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
verify(request: X402VerifyRequest): Promise<X402VerifyResponse>;
|
|
7
|
+
settle(request: X402SettleRequest): Promise<X402SettleResponse>;
|
|
8
|
+
supported(): Promise<{
|
|
9
|
+
chains: Array<SupportedChain>;
|
|
10
|
+
}>;
|
|
11
|
+
createSubscription(subscription: Partial<Subscription>): Promise<Subscription>;
|
|
12
|
+
getSubscription(subscriptionId: string): Promise<Subscription>;
|
|
13
|
+
cancelSubscription(subscriptionId: string): Promise<void>;
|
|
14
|
+
renewSubscription(subscriptionId: string): Promise<Subscription>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export class PaymentsApi {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
verify(request) {
|
|
6
|
+
return this.http.post("/payments/verify", request);
|
|
7
|
+
}
|
|
8
|
+
settle(request) {
|
|
9
|
+
return this.http.post("/payments/settle", request);
|
|
10
|
+
}
|
|
11
|
+
supported() {
|
|
12
|
+
return this.http.get("/payments/supported");
|
|
13
|
+
}
|
|
14
|
+
createSubscription(subscription) {
|
|
15
|
+
return this.http.post("/payments/subscriptions", subscription);
|
|
16
|
+
}
|
|
17
|
+
getSubscription(subscriptionId) {
|
|
18
|
+
return this.http.getAuth(`/payments/subscriptions/${encodeURIComponent(subscriptionId)}`);
|
|
19
|
+
}
|
|
20
|
+
cancelSubscription(subscriptionId) {
|
|
21
|
+
return this.http.delete(`/payments/subscriptions/${encodeURIComponent(subscriptionId)}`);
|
|
22
|
+
}
|
|
23
|
+
renewSubscription(subscriptionId) {
|
|
24
|
+
return this.http.post(`/payments/subscriptions/${encodeURIComponent(subscriptionId)}/renew`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { TinyVerseWebSocket } from "../websocket.js";
|
|
3
|
+
import type { BridgeExecution, BridgeExecuteRequest, BridgeQuote, BridgeRoute, GasEstimate, PriceHistory, PriceQuote, SwapExecution, SwapExecuteRequest, SwapQuote, TradePair } from "../types/index.js";
|
|
4
|
+
export declare class PricingApi {
|
|
5
|
+
private readonly http;
|
|
6
|
+
private readonly wsFactory?;
|
|
7
|
+
constructor(http: HttpClient, wsFactory?: ((path: string) => TinyVerseWebSocket) | undefined);
|
|
8
|
+
quote(params: {
|
|
9
|
+
base: string;
|
|
10
|
+
quote: string;
|
|
11
|
+
network?: string;
|
|
12
|
+
}): Promise<PriceQuote>;
|
|
13
|
+
history(params: {
|
|
14
|
+
base: string;
|
|
15
|
+
quote: string;
|
|
16
|
+
interval: string;
|
|
17
|
+
from?: string;
|
|
18
|
+
to?: string;
|
|
19
|
+
}): Promise<PriceHistory>;
|
|
20
|
+
assets(): Promise<{
|
|
21
|
+
assets: Array<{
|
|
22
|
+
symbol: string;
|
|
23
|
+
address?: string;
|
|
24
|
+
decimals: number;
|
|
25
|
+
}>;
|
|
26
|
+
}>;
|
|
27
|
+
pairs(): Promise<{
|
|
28
|
+
pairs: Array<TradePair>;
|
|
29
|
+
}>;
|
|
30
|
+
networks(): Promise<{
|
|
31
|
+
networks: Array<string>;
|
|
32
|
+
}>;
|
|
33
|
+
gas(network: string): Promise<GasEstimate>;
|
|
34
|
+
priceStream(): TinyVerseWebSocket | undefined;
|
|
35
|
+
swapQuote(params: {
|
|
36
|
+
fromAsset: string;
|
|
37
|
+
toAsset: string;
|
|
38
|
+
amount: string;
|
|
39
|
+
}): Promise<SwapQuote>;
|
|
40
|
+
executeSwap(request: SwapExecuteRequest): Promise<SwapExecution>;
|
|
41
|
+
getSwap(swapId: string): Promise<SwapExecution>;
|
|
42
|
+
swapHistory(params?: {
|
|
43
|
+
limit?: number;
|
|
44
|
+
offset?: number;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
swaps: Array<SwapExecution>;
|
|
47
|
+
}>;
|
|
48
|
+
bridgeRoutes(params: {
|
|
49
|
+
fromChain: string;
|
|
50
|
+
toChain: string;
|
|
51
|
+
}): Promise<{
|
|
52
|
+
routes: Array<BridgeRoute>;
|
|
53
|
+
}>;
|
|
54
|
+
bridgeQuote(params: {
|
|
55
|
+
fromChain: string;
|
|
56
|
+
toChain: string;
|
|
57
|
+
token: string;
|
|
58
|
+
amount: string;
|
|
59
|
+
}): Promise<BridgeQuote>;
|
|
60
|
+
executeBridge(request: BridgeExecuteRequest): Promise<BridgeExecution>;
|
|
61
|
+
getBridge(bridgeId: string): Promise<BridgeExecution>;
|
|
62
|
+
bridgeHistory(params?: {
|
|
63
|
+
limit?: number;
|
|
64
|
+
offset?: number;
|
|
65
|
+
}): Promise<{
|
|
66
|
+
bridges: Array<BridgeExecution>;
|
|
67
|
+
}>;
|
|
68
|
+
bridgeStream(): TinyVerseWebSocket | undefined;
|
|
69
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export class PricingApi {
|
|
2
|
+
constructor(http, wsFactory) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
this.wsFactory = wsFactory;
|
|
5
|
+
}
|
|
6
|
+
// --- Price Data ---
|
|
7
|
+
quote(params) {
|
|
8
|
+
return this.http.get("/pricing/quote", params);
|
|
9
|
+
}
|
|
10
|
+
history(params) {
|
|
11
|
+
return this.http.get("/pricing/history", params);
|
|
12
|
+
}
|
|
13
|
+
assets() {
|
|
14
|
+
return this.http.get("/pricing/assets");
|
|
15
|
+
}
|
|
16
|
+
pairs() {
|
|
17
|
+
return this.http.get("/pricing/pairs");
|
|
18
|
+
}
|
|
19
|
+
networks() {
|
|
20
|
+
return this.http.get("/pricing/networks");
|
|
21
|
+
}
|
|
22
|
+
gas(network) {
|
|
23
|
+
return this.http.get("/pricing/gas", { network });
|
|
24
|
+
}
|
|
25
|
+
priceStream() {
|
|
26
|
+
return this.wsFactory?.("/pricing/stream");
|
|
27
|
+
}
|
|
28
|
+
// --- Swap ---
|
|
29
|
+
swapQuote(params) {
|
|
30
|
+
return this.http.get("/swap/quote", params);
|
|
31
|
+
}
|
|
32
|
+
executeSwap(request) {
|
|
33
|
+
return this.http.post("/swap/execute", request);
|
|
34
|
+
}
|
|
35
|
+
getSwap(swapId) {
|
|
36
|
+
return this.http.getAuth(`/swap/${encodeURIComponent(swapId)}`);
|
|
37
|
+
}
|
|
38
|
+
swapHistory(params) {
|
|
39
|
+
return this.http.getAuth("/swap/history", params);
|
|
40
|
+
}
|
|
41
|
+
// --- Bridge ---
|
|
42
|
+
bridgeRoutes(params) {
|
|
43
|
+
return this.http.get("/bridge/routes", params);
|
|
44
|
+
}
|
|
45
|
+
bridgeQuote(params) {
|
|
46
|
+
return this.http.get("/bridge/quote", params);
|
|
47
|
+
}
|
|
48
|
+
executeBridge(request) {
|
|
49
|
+
return this.http.post("/bridge/execute", request);
|
|
50
|
+
}
|
|
51
|
+
getBridge(bridgeId) {
|
|
52
|
+
return this.http.getAuth(`/bridge/${encodeURIComponent(bridgeId)}`);
|
|
53
|
+
}
|
|
54
|
+
bridgeHistory(params) {
|
|
55
|
+
return this.http.getAuth("/bridge/history", params);
|
|
56
|
+
}
|
|
57
|
+
bridgeStream() {
|
|
58
|
+
return this.wsFactory?.("/bridge/stream");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { AgentCard, AgentProfile, ProfileActivity, ProfileAttestation, ProfileBroadcast, ProfileGroupMembership } from "../types/index.js";
|
|
3
|
+
export declare class ProfilesApi {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
get(username: string): Promise<AgentProfile>;
|
|
7
|
+
activity(username: string): Promise<ProfileActivity>;
|
|
8
|
+
groups(username: string): Promise<{
|
|
9
|
+
groups: Array<ProfileGroupMembership>;
|
|
10
|
+
}>;
|
|
11
|
+
broadcasts(username: string): Promise<{
|
|
12
|
+
broadcasts: Array<ProfileBroadcast>;
|
|
13
|
+
}>;
|
|
14
|
+
attestations(username: string): Promise<{
|
|
15
|
+
attestations: Array<ProfileAttestation>;
|
|
16
|
+
}>;
|
|
17
|
+
agentCard(username: string): Promise<AgentCard>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export class ProfilesApi {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
get(username) {
|
|
6
|
+
return this.http.get(`/profiles/${encodeURIComponent(username)}`);
|
|
7
|
+
}
|
|
8
|
+
activity(username) {
|
|
9
|
+
return this.http.get(`/profiles/${encodeURIComponent(username)}/activity`);
|
|
10
|
+
}
|
|
11
|
+
groups(username) {
|
|
12
|
+
return this.http.get(`/profiles/${encodeURIComponent(username)}/groups`);
|
|
13
|
+
}
|
|
14
|
+
broadcasts(username) {
|
|
15
|
+
return this.http.get(`/profiles/${encodeURIComponent(username)}/broadcasts`);
|
|
16
|
+
}
|
|
17
|
+
attestations(username) {
|
|
18
|
+
return this.http.get(`/profiles/${encodeURIComponent(username)}/attestations`);
|
|
19
|
+
}
|
|
20
|
+
agentCard(username) {
|
|
21
|
+
return this.http.get(`/profiles/${encodeURIComponent(username)}/agentCard`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SigningKey } from "../auth.js";
|
|
2
|
+
import type { HttpClient } from "../http.js";
|
|
3
|
+
import type { AvailabilityResponse, Identity, IdentityClaimRequest, IdentityExport, IdentityMetadata, IdentityProfileUpdate, LedgerTransaction, PaymentMethod, ProfileVisibilityUpdate, RenewalRequest, Subname, SubnameCreateRequest } from "../types/index.js";
|
|
4
|
+
export interface RegisterRequest {
|
|
5
|
+
username: string;
|
|
6
|
+
bio: string;
|
|
7
|
+
cryptoId: string;
|
|
8
|
+
publicKey: string;
|
|
9
|
+
paymentMethods?: Array<PaymentMethod>;
|
|
10
|
+
metadata?: IdentityMetadata;
|
|
11
|
+
payment?: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
export declare class RegistryApi {
|
|
14
|
+
private readonly http;
|
|
15
|
+
private readonly signingKey?;
|
|
16
|
+
constructor(http: HttpClient, signingKey?: SigningKey | undefined);
|
|
17
|
+
register(request: RegisterRequest): Promise<Identity>;
|
|
18
|
+
get(name: string): Promise<AvailabilityResponse>;
|
|
19
|
+
export(name: string): Promise<IdentityExport>;
|
|
20
|
+
updateProfile(name: string, update: IdentityProfileUpdate): Promise<Identity>;
|
|
21
|
+
updateProfileVisibility(name: string, update: ProfileVisibilityUpdate): Promise<Identity>;
|
|
22
|
+
renew(name: string, request: RenewalRequest): Promise<LedgerTransaction>;
|
|
23
|
+
claim(name: string, request: IdentityClaimRequest): Promise<LedgerTransaction>;
|
|
24
|
+
createSubname(name: string, request: SubnameCreateRequest): Promise<Subname>;
|
|
25
|
+
deleteSubname(name: string, subname: string): Promise<void>;
|
|
26
|
+
}
|