Skip to content

Commit

Permalink
chore: fleek namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ozwaldorf committed May 29, 2024
1 parent facce86 commit 3e2f88e
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions dts/lib.fleek.d.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
/** Handle to blockstore content.
* Utility for traversing the proof and reading blocks from the blockstore.
* @property {Uint8Array} proof - Raw blake3 proof of the content
* @property {number} length - Number of blocks in the content
* @category Fleek APIs
*/
declare class ContentHandle {
constructor(proof: Uint8Array);
proof: Uint8Array;
length: number;
/**
* Read a given block index from the blockstore
* @param {number} idx - Index of block to read
* @returns {Promise<Uint8Array>}
*/
read(idx: number): Promise<Uint8Array>;
}

/** @category Fleek APIs */
declare interface Fleek {
/**
* Fleek namespace for interacting with the core node.
* @category Fleek Node API
*/
declare namespace Fleek {
/** Fetch some blake3 content
* @param {Uint8Array} hash - Blake3 hash of content to fetch
* @returns {Promise<bool>} True if the fetch was successful
*/
fetch_blake3(hash: Uint8Array): Promise<boolean>;
function fetch_blake3(hash: Uint8Array): Promise<boolean>;
/** Load a blockstore handle to some blake3 content
* @param {Uint8Array} hash - Blake3 hash of the content
* @returns {Promise<ContentHandle>}
*/
load_content(hash: Uint8Array): Promise<ContentHandle>;
function load_content(hash: Uint8Array): Promise<ContentHandle>;
/** Fetch a clients FLK balance.
* @param {Uint8Array} account - The balance to check
* @returns {Promise<BigInt>} BigInt of the balance
*/
query_client_flk_balance(account: Uint8Array): Promise<BigInt>;
function query_client_flk_balance(account: Uint8Array): Promise<BigInt>;
/** Fetch a clients bandwidth balance.
* @param {Uint8Array} account - The balance to check
* @returns {Promise<BigInt>} BigInt of the balance
*/
query_client_bandwidth_balance(
function query_client_bandwidth_balance(
account: Uint8Array,
): Promise<BigInt>;
}

/** @category Fleek APIs */
declare var Fleek: Fleek;
/** Handle to blockstore content.
* Utility for traversing the proof and reading blocks from the blockstore.
* @property {Uint8Array} proof - Raw blake3 proof of the content
* @property {number} length - Number of blocks in the content
* @category Fleek Node API
*/
class ContentHandle {
constructor(proof: Uint8Array);
proof: Uint8Array;
length: number;
/**
* Read a given block index from the blockstore
* @param {number} idx - Index of block to read
* @returns {Promise<Uint8Array>}
*/
read(idx: number): Promise<Uint8Array>;
}
}

0 comments on commit 3e2f88e

Please sign in to comment.