@stoar/sdk
Version:
JavaScript/TypeScript SDK for STOAR - Decentralized file storage on Arweave
65 lines • 1.43 kB
TypeScript
/**
* GraphQL utilities for querying Arweave
*/
export interface GraphQLEdge {
cursor: string;
node: {
id: string;
owner: {
address: string;
};
fee: {
winston: string;
};
quantity: {
winston: string;
};
tags: Array<{
name: string;
value: string;
}>;
block?: {
height: number;
timestamp: number;
};
};
}
export interface GraphQLResponse {
data: {
transactions: {
edges: GraphQLEdge[];
pageInfo: {
hasNextPage: boolean;
};
};
};
}
export interface GraphQLQueryOptions {
owners?: string[];
tags?: Array<{
name: string;
values: string[];
}>;
first?: number;
after?: string;
block?: {
min?: number;
max?: number;
};
}
/**
* Build a GraphQL query for transactions
*/
export declare function buildTransactionQuery(options?: GraphQLQueryOptions): string;
/**
* Execute a GraphQL query
*/
export declare function executeGraphQLQuery(query: string, gateway?: string): Promise<GraphQLResponse>;
/**
* Convert tags from array format to object format
*/
export declare function tagsArrayToObject(tags: Array<{
name: string;
value: string;
}>): Record<string, string>;
//# sourceMappingURL=graphql.d.ts.map