@xandeum/web3.js 0.6.0 → 0.8.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.
Files changed (55) hide show
  1. package/dist/find.d.ts +1 -1
  2. package/dist/find.js +2 -2
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +3 -1
  5. package/docs/html/assets/navigation.js +1 -1
  6. package/docs/html/assets/search.js +1 -1
  7. package/docs/html/functions/armageddon.html +2 -2
  8. package/docs/html/functions/assignCoowner.html +2 -2
  9. package/docs/html/functions/bigbang.html +2 -2
  10. package/docs/html/functions/copyPath.html +2 -2
  11. package/docs/html/functions/createDirectory.html +2 -2
  12. package/docs/html/functions/createFile.html +2 -2
  13. package/docs/html/functions/exists.html +2 -2
  14. package/docs/html/functions/find.html +10 -0
  15. package/docs/html/functions/getMetadata.html +2 -2
  16. package/docs/html/functions/getXandeumResult.html +2 -2
  17. package/docs/html/functions/listDirectoryEntry.html +2 -2
  18. package/docs/html/functions/move.html +2 -2
  19. package/docs/html/functions/peek.html +2 -2
  20. package/docs/html/functions/poke.html +2 -2
  21. package/docs/html/functions/removeDirectory.html +2 -2
  22. package/docs/html/functions/removeFile.html +2 -2
  23. package/docs/html/functions/renamePath.html +2 -2
  24. package/docs/html/functions/subscribeResult.html +2 -2
  25. package/docs/html/functions/unsubscribeResult.html +2 -2
  26. package/docs/html/hierarchy.html +1 -1
  27. package/docs/html/index.html +2 -2
  28. package/docs/html/modules.html +1 -1
  29. package/docs/markdown/README.md +1 -1
  30. package/docs/markdown/functions/armageddon.md +2 -2
  31. package/docs/markdown/functions/assignCoowner.md +2 -2
  32. package/docs/markdown/functions/bigbang.md +2 -2
  33. package/docs/markdown/functions/copyPath.md +2 -2
  34. package/docs/markdown/functions/createDirectory.md +2 -2
  35. package/docs/markdown/functions/createFile.md +2 -2
  36. package/docs/markdown/functions/exists.md +2 -2
  37. package/docs/markdown/functions/find.md +44 -0
  38. package/docs/markdown/functions/getMetadata.md +2 -2
  39. package/docs/markdown/functions/getXandeumResult.md +2 -2
  40. package/docs/markdown/functions/listDirectoryEntry.md +2 -2
  41. package/docs/markdown/functions/move.md +2 -2
  42. package/docs/markdown/functions/peek.md +2 -2
  43. package/docs/markdown/functions/poke.md +2 -2
  44. package/docs/markdown/functions/removeDirectory.md +2 -2
  45. package/docs/markdown/functions/removeFile.md +2 -2
  46. package/docs/markdown/functions/renamePath.md +2 -2
  47. package/docs/markdown/functions/subscribeResult.md +2 -2
  48. package/docs/markdown/functions/unsubscribeResult.md +2 -2
  49. package/docs/markdown/globals.md +3 -2
  50. package/docs/markdown/summary.md +49 -0
  51. package/package.json +1 -1
  52. package/src/bigbang.ts +1 -1
  53. package/src/find.ts +53 -0
  54. package/src/index.ts +1 -0
  55. package/typedoc.json +1 -1
@@ -1,8 +1,8 @@
1
- [**Xandeum Web3 Library v0.6.0**](README.md)
1
+ [**Xandeum Web3 Library v0.8.0**](README.md)
2
2
 
3
3
  ***
4
4
 
5
- # Xandeum Web3 Library v0.6.0
5
+ # Xandeum Web3 Library v0.8.0
6
6
 
7
7
  ## Functions
8
8
 
@@ -13,6 +13,7 @@
13
13
  - [createDirectory](functions/createDirectory.md)
14
14
  - [createFile](functions/createFile.md)
15
15
  - [exists](functions/exists.md)
16
+ - [find](functions/find.md)
16
17
  - [getMetadata](functions/getMetadata.md)
17
18
  - [getXandeumResult](functions/getXandeumResult.md)
18
19
  - [listDirectoryEntry](functions/listDirectoryEntry.md)
@@ -0,0 +1,49 @@
1
+ # Summary
2
+
3
+ ## Getting Started
4
+
5
+ * [Introduction](README.md)
6
+ * [Globals](globals.md)
7
+
8
+ ## Core Functions
9
+
10
+ ### File System Management
11
+
12
+ * [bigbang](functions/bigbang.md)
13
+ * [armageddon](functions/armageddon.md)
14
+
15
+ ### File Operations
16
+
17
+ * [createFile](functions/createFile.md)
18
+ * [removeFile](functions/removeFile.md)
19
+ * [copyPath](functions/copyPath.md)
20
+ * [renamePath](functions/renamePath.md)
21
+ * [move](functions/move.md)
22
+
23
+ ### Directory Operations
24
+
25
+ * [createDirectory](functions/createDirectory.md)
26
+ * [removeDirectory](functions/removeDirectory.md)
27
+ * [listDirectoryEntry](functions/listDirectoryEntry.md)
28
+
29
+ ### File Content Operations
30
+
31
+ * [peek](functions/peek.md)
32
+ * [poke](functions/poke.md)
33
+
34
+ ### Search & Query
35
+
36
+ * [find](functions/find.md)
37
+
38
+ ### Metadata & Utilities
39
+
40
+ * [exists](functions/exists.md)
41
+ * [getMetadata](functions/getMetadata.md)
42
+ * [getXandeumResult](functions/getXandeumResult.md)
43
+ * [assignCoowner](functions/assignCoowner.md)
44
+
45
+ ### WebSocket Functions
46
+
47
+ * [subscribeResult](functions/subscribeResult.md)
48
+ * [unsubscribeResult](functions/unsubscribeResult.md)
49
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xandeum/web3.js",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "Xandeum javascript api",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/bigbang.ts CHANGED
@@ -9,7 +9,7 @@ import { programId } from './const'
9
9
  * @param replica_count - A stringified integer representing the number of replicas for the new file system.
10
10
  * @returns A Promise that resolves to a Solana `Transaction` object containing the bigbang instruction.
11
11
  */
12
- export async function bigbang (replica_count:string,wallet: PublicKey): Promise<Transaction> {
12
+ export async function bigbang(replica_count:string,wallet: PublicKey): Promise<Transaction> {
13
13
  const instructionData = Buffer.concat([
14
14
  Buffer.from(Int8Array.from([0]).buffer),
15
15
  Buffer.from(Uint8Array.of(...new BN(replica_count).toArray('le', 8)))
package/src/find.ts ADDED
@@ -0,0 +1,53 @@
1
+ import { Connection } from "@solana/web3.js"
2
+
3
+ export interface RpcRequest {
4
+ jsonrpc: string
5
+ id: number
6
+ method: string
7
+ params: any[]
8
+ }
9
+
10
+ /**
11
+ * Sends a JSON-RPC request to the Xandeum RPC endpoint to search for a file or directory
12
+ * within a specified path.
13
+ *
14
+ * This function calls the custom RPC method `find`, which is return an array of
15
+ * directory entry metadata — names, types etc.
16
+ *
17
+ * @param connection - The solana web3 connection with Xandeum-compatible JSON-RPC endpoint (e.g., `'https://api.devnet.solana.com'`).
18
+ * @param path - The filesystem path where the search will be performed (e.g., `/documents`).
19
+ * @param query - The query to search for (e.g., `'myfile.txt'`).
20
+ *
21
+ * @returns A `Promise<any>` resolving to the parsed JSON response from the RPC server,
22
+ * typically including a `result` array containing directory entry objects.
23
+ */
24
+
25
+ export async function find (
26
+ connection: Connection,
27
+ path: string,
28
+ query: string,
29
+ ): Promise<any> {
30
+ const url = connection.rpcEndpoint;
31
+ const requestBody: RpcRequest = {
32
+ jsonrpc: '2.0',
33
+ id: 1,
34
+ method: 'find',
35
+ params: [path,query]
36
+ }
37
+
38
+ const response = await fetch(url, {
39
+ method: 'POST',
40
+ headers: {
41
+ 'Content-Type': 'application/json'
42
+ },
43
+ body: JSON.stringify(requestBody)
44
+ })
45
+
46
+ if (!response.ok) {
47
+ const errorText = await response.text();
48
+ return Error(`error! status: ${response.status}, message: ${errorText}`);
49
+ }
50
+
51
+ const data = await response.json()
52
+ return data
53
+ }
package/src/index.ts CHANGED
@@ -15,3 +15,4 @@ export * from "./assignCoowner";
15
15
  export {exists } from "./exists";
16
16
  export {listDirectoryEntry} from "./listDirectoryEntery";
17
17
  export {getMetadata} from "./getMetadata";
18
+ export {find} from "./find";
package/typedoc.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "excludeInternal": true,
16
16
  "excludeNotDocumented": false,
17
17
  "gitRemote": "origin",
18
- "gitRevision": "stuttgart",
18
+ "gitRevision": "master",
19
19
  "sourceLinkTemplate": "https://github.com/Xandeum/xandeum-web3.js/blob/{gitRevision}/{path}#L{line}",
20
20
  "visibilityFilters": {
21
21
  "protected": false,