-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
} | ||
} |