@xandeum/web3.js 0.4.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/LICENSE +51 -0
- package/README.md +167 -0
- package/archbee.yaml +55 -0
- package/dist/armageddon.d.ts +10 -0
- package/dist/armageddon.js +77 -0
- package/dist/assignCoowner.d.ts +12 -0
- package/dist/assignCoowner.js +81 -0
- package/dist/bigbang.d.ts +9 -0
- package/dist/bigbang.js +76 -0
- package/dist/const.d.ts +1 -0
- package/dist/const.js +4 -0
- package/dist/copyPath.d.ts +13 -0
- package/dist/copyPath.js +86 -0
- package/dist/createDirectory.d.ts +12 -0
- package/dist/createDirectory.js +84 -0
- package/dist/createFile.d.ts +13 -0
- package/dist/createFile.js +85 -0
- package/dist/exists.d.ts +20 -0
- package/dist/exists.js +86 -0
- package/dist/find.d.ts +22 -0
- package/dist/find.js +88 -0
- package/dist/getInfo.d.ts +12 -0
- package/dist/getInfo.js +77 -0
- package/dist/getMetadata.d.ts +23 -0
- package/dist/getMetadata.js +89 -0
- package/dist/getXandeumResult.d.ts +15 -0
- package/dist/getXandeumResult.js +95 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +37 -0
- package/dist/listDirectoryEntery.d.ts +21 -0
- package/dist/listDirectoryEntery.js +87 -0
- package/dist/move.d.ts +14 -0
- package/dist/move.js +88 -0
- package/dist/peek.d.ts +15 -0
- package/dist/peek.js +88 -0
- package/dist/poke.d.ts +14 -0
- package/dist/poke.js +93 -0
- package/dist/removeDirectory.d.ts +12 -0
- package/dist/removeDirectory.js +82 -0
- package/dist/removeFile.d.ts +12 -0
- package/dist/removeFile.js +82 -0
- package/dist/renamePath.d.ts +13 -0
- package/dist/renamePath.js +85 -0
- package/dist/sanitizePath.d.ts +14 -0
- package/dist/sanitizePath.js +60 -0
- package/dist/webSocket.d.ts +47 -0
- package/dist/webSocket.js +103 -0
- package/docs/html/.nojekyll +1 -0
- package/docs/html/assets/hierarchy.js +1 -0
- package/docs/html/assets/highlight.css +92 -0
- package/docs/html/assets/icons.js +18 -0
- package/docs/html/assets/icons.svg +1 -0
- package/docs/html/assets/main.js +60 -0
- package/docs/html/assets/navigation.js +1 -0
- package/docs/html/assets/search.js +1 -0
- package/docs/html/assets/style.css +1640 -0
- package/docs/html/functions/armageddon.html +6 -0
- package/docs/html/functions/bigbang.html +5 -0
- package/docs/html/functions/copyPath.html +8 -0
- package/docs/html/functions/createDirectory.html +8 -0
- package/docs/html/functions/createFile.html +9 -0
- package/docs/html/functions/exists.html +8 -0
- package/docs/html/functions/getMetadata.html +10 -0
- package/docs/html/functions/getXandeumResult.html +9 -0
- package/docs/html/functions/listDirectoryEntry.html +9 -0
- package/docs/html/functions/move.html +9 -0
- package/docs/html/functions/peek.html +10 -0
- package/docs/html/functions/poke.html +10 -0
- package/docs/html/functions/removeDirectory.html +8 -0
- package/docs/html/functions/removeFile.html +8 -0
- package/docs/html/functions/renamePath.html +9 -0
- package/docs/html/functions/subscribeResult.html +17 -0
- package/docs/html/functions/unsubscribeResult.html +6 -0
- package/docs/html/hierarchy.html +1 -0
- package/docs/html/index.html +62 -0
- package/docs/html/modules.html +1 -0
- package/docs/markdown/.nojekyll +0 -0
- package/docs/markdown/README.md +169 -0
- package/docs/markdown/functions/armageddon.md +34 -0
- package/docs/markdown/functions/bigbang.md +27 -0
- package/docs/markdown/functions/copyPath.md +49 -0
- package/docs/markdown/functions/createDirectory.md +49 -0
- package/docs/markdown/functions/createFile.md +50 -0
- package/docs/markdown/functions/exists.md +37 -0
- package/docs/markdown/functions/getMetadata.md +39 -0
- package/docs/markdown/functions/getXandeumResult.md +38 -0
- package/docs/markdown/functions/listDirectoryEntry.md +38 -0
- package/docs/markdown/functions/move.md +55 -0
- package/docs/markdown/functions/peek.md +57 -0
- package/docs/markdown/functions/poke.md +56 -0
- package/docs/markdown/functions/removeDirectory.md +44 -0
- package/docs/markdown/functions/removeFile.md +44 -0
- package/docs/markdown/functions/renamePath.md +50 -0
- package/docs/markdown/functions/subscribeResult.md +60 -0
- package/docs/markdown/functions/unsubscribeResult.md +34 -0
- package/docs/markdown/globals.md +25 -0
- package/docs/markdown/summary.md +44 -0
- package/package.json +26 -0
- package/src/armageddon.ts +36 -0
- package/src/bigbang.ts +32 -0
- package/src/const.ts +1 -0
- package/src/copyPath.ts +51 -0
- package/src/createDirectory.ts +47 -0
- package/src/createFile.ts +47 -0
- package/src/exists.ts +47 -0
- package/src/getMetadata.ts +50 -0
- package/src/getXandeumResult.ts +48 -0
- package/src/index.ts +16 -0
- package/src/listDirectoryEntery.ts +51 -0
- package/src/move.ts +55 -0
- package/src/peek.ts +52 -0
- package/src/poke.ts +59 -0
- package/src/removeDirectory.ts +43 -0
- package/src/removeFile.ts +44 -0
- package/src/renamePath.ts +50 -0
- package/src/sanitizePath.ts +69 -0
- package/src/webSocket.ts +131 -0
- package/tsconfig.json +14 -0
- package/typedoc.json +26 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / createFile
|
|
6
|
+
|
|
7
|
+
# Function: createFile()
|
|
8
|
+
|
|
9
|
+
> **createFile**(`fsid`, `path`, `name`, `wallet`): `Promise`\<`Transaction`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [createFile.ts:17](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/createFile.ts#L17)
|
|
12
|
+
|
|
13
|
+
Constructs a Solana transaction to create a new file
|
|
14
|
+
within a file system, identified by a file system ID (`fsid`).
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### fsid
|
|
19
|
+
|
|
20
|
+
`string`
|
|
21
|
+
|
|
22
|
+
A stringified integer representing the file system ID where the file is to be created.
|
|
23
|
+
|
|
24
|
+
### path
|
|
25
|
+
|
|
26
|
+
`string`
|
|
27
|
+
|
|
28
|
+
The absolute or relative path within the file system where the file should be created.
|
|
29
|
+
|
|
30
|
+
### name
|
|
31
|
+
|
|
32
|
+
`string`
|
|
33
|
+
|
|
34
|
+
The name of the new file or directory to be created.
|
|
35
|
+
|
|
36
|
+
### wallet
|
|
37
|
+
|
|
38
|
+
`PublicKey`
|
|
39
|
+
|
|
40
|
+
The public key of the wallet that will sign and authorize the transaction.
|
|
41
|
+
|
|
42
|
+
## Returns
|
|
43
|
+
|
|
44
|
+
`Promise`\<`Transaction`\>
|
|
45
|
+
|
|
46
|
+
A Promise that resolves to a Solana `Transaction` object containing the createFile instruction.
|
|
47
|
+
|
|
48
|
+
## Throws
|
|
49
|
+
|
|
50
|
+
Will throw an error if `path` or `name` contains invalid characters.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / exists
|
|
6
|
+
|
|
7
|
+
# Function: exists()
|
|
8
|
+
|
|
9
|
+
> **exists**(`connection`, `path`): `Promise`\<`any`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [exists.ts:23](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/exists.ts#L23)
|
|
12
|
+
|
|
13
|
+
Sends a JSON-RPC request to the Xandeum RPC endpoint to check if a file or directory exists.
|
|
14
|
+
|
|
15
|
+
This function calls the custom RPC method `isExist`, which should be implemented
|
|
16
|
+
by the backend to validate the existence of metadata (files/directories) at a given path.
|
|
17
|
+
|
|
18
|
+
## Parameters
|
|
19
|
+
|
|
20
|
+
### connection
|
|
21
|
+
|
|
22
|
+
`Connection`
|
|
23
|
+
|
|
24
|
+
The solana web3 connection with Xandeum-compatible JSON-RPC endpoint (e.g., `'https://api.devnet.solana.com'`).
|
|
25
|
+
|
|
26
|
+
### path
|
|
27
|
+
|
|
28
|
+
`string`
|
|
29
|
+
|
|
30
|
+
The filesystem path to check (e.g., `/documents/myfile.txt`).
|
|
31
|
+
|
|
32
|
+
## Returns
|
|
33
|
+
|
|
34
|
+
`Promise`\<`any`\>
|
|
35
|
+
|
|
36
|
+
A `Promise<any>` resolving to the RPC response JSON, typically including a `result` field
|
|
37
|
+
indicating existence (e.g., `true` or `false`), or `null` if not found.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / getMetadata
|
|
6
|
+
|
|
7
|
+
# Function: getMetadata()
|
|
8
|
+
|
|
9
|
+
> **getMetadata**(`connection`, `path`): `Promise`\<`any`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [getMetadata.ts:26](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/getMetadata.ts#L26)
|
|
12
|
+
|
|
13
|
+
Sends a JSON-RPC request to the Xandeum RPC endpoint to retrieve metadata
|
|
14
|
+
about a file or directory at the given path.
|
|
15
|
+
|
|
16
|
+
This function calls the custom RPC method `getMetadata`, which is implemented
|
|
17
|
+
by the backend to return metadata such as type (file or directory), size,
|
|
18
|
+
timestamps etc.
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
### connection
|
|
23
|
+
|
|
24
|
+
`Connection`
|
|
25
|
+
|
|
26
|
+
The solana web3 connection with Xandeum-compatible JSON-RPC endpoint (e.g., `'https://api.devnet.solana.com'`).
|
|
27
|
+
|
|
28
|
+
### path
|
|
29
|
+
|
|
30
|
+
`string`
|
|
31
|
+
|
|
32
|
+
The filesystem path to query metadata for (e.g., `/documents/myfile.txt`).
|
|
33
|
+
|
|
34
|
+
## Returns
|
|
35
|
+
|
|
36
|
+
`Promise`\<`any`\>
|
|
37
|
+
|
|
38
|
+
A `Promise<any>` resolving to the parsed JSON response from the RPC server,
|
|
39
|
+
typically containing a `result` object with metadata fields.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / getXandeumResult
|
|
6
|
+
|
|
7
|
+
# Function: getXandeumResult()
|
|
8
|
+
|
|
9
|
+
> **getXandeumResult**(`connection`, `signature`): `Promise`\<`any`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [getXandeumResult.ts:21](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/getXandeumResult.ts#L21)
|
|
12
|
+
|
|
13
|
+
Sends a JSON-RPC request to the Xandeum-compatible endpoint to retrieve
|
|
14
|
+
the result of a transaction previously submitted with a specific signature.
|
|
15
|
+
|
|
16
|
+
This function calls the custom RPC method `getXandeumResult`, which returns
|
|
17
|
+
the result associated with the given transaction signature.
|
|
18
|
+
|
|
19
|
+
## Parameters
|
|
20
|
+
|
|
21
|
+
### connection
|
|
22
|
+
|
|
23
|
+
`Connection`
|
|
24
|
+
|
|
25
|
+
The Solana web3 connection object pointing to a Xandeum-compatible RPC endpoint.
|
|
26
|
+
|
|
27
|
+
### signature
|
|
28
|
+
|
|
29
|
+
`string`
|
|
30
|
+
|
|
31
|
+
The transaction signature string whose result should be queried.
|
|
32
|
+
|
|
33
|
+
## Returns
|
|
34
|
+
|
|
35
|
+
`Promise`\<`any`\>
|
|
36
|
+
|
|
37
|
+
A `Promise<any>` resolving to the parsed JSON response from the RPC server,
|
|
38
|
+
which includes the result of the transaction if available.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / listDirectoryEntry
|
|
6
|
+
|
|
7
|
+
# Function: listDirectoryEntry()
|
|
8
|
+
|
|
9
|
+
> **listDirectoryEntry**(`connection`, `path`): `Promise`\<`any`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [listDirectoryEntery.ts:24](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/listDirectoryEntery.ts#L24)
|
|
12
|
+
|
|
13
|
+
Sends a JSON-RPC request to the Xandeum RPC endpoint to list all entries (files and subdirectories)
|
|
14
|
+
within a specified path.
|
|
15
|
+
|
|
16
|
+
This function calls the custom RPC method `listDirs`, which is return an array of
|
|
17
|
+
directory entry metadata — names, types etc.
|
|
18
|
+
|
|
19
|
+
## Parameters
|
|
20
|
+
|
|
21
|
+
### connection
|
|
22
|
+
|
|
23
|
+
`Connection`
|
|
24
|
+
|
|
25
|
+
The solana web3 connection with Xandeum-compatible JSON-RPC endpoint (e.g., `'https://api.devnet.solana.com'`).
|
|
26
|
+
|
|
27
|
+
### path
|
|
28
|
+
|
|
29
|
+
`string`
|
|
30
|
+
|
|
31
|
+
The filesystem path representing the directory to list (e.g., `/documents`).
|
|
32
|
+
|
|
33
|
+
## Returns
|
|
34
|
+
|
|
35
|
+
`Promise`\<`any`\>
|
|
36
|
+
|
|
37
|
+
A `Promise<any>` resolving to the parsed JSON response from the RPC server,
|
|
38
|
+
typically including a `result` array containing directory entry objects.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / move
|
|
6
|
+
|
|
7
|
+
# Function: move()
|
|
8
|
+
|
|
9
|
+
> **move**(`fsid`, `srcPath`, `destPath`, `name`, `wallet`): `Promise`\<`Transaction`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [move.ts:19](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/move.ts#L19)
|
|
12
|
+
|
|
13
|
+
Constructs a Solana transaction to copy a file or directory from one path to another.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### fsid
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The unique numeric identifier representing the target file system.
|
|
22
|
+
|
|
23
|
+
### srcPath
|
|
24
|
+
|
|
25
|
+
`string`
|
|
26
|
+
|
|
27
|
+
The source path to copy from (e.g., `/documents`).
|
|
28
|
+
|
|
29
|
+
### destPath
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The destination path to copy to (e.g., `/archive`).
|
|
34
|
+
|
|
35
|
+
### name
|
|
36
|
+
|
|
37
|
+
`string`
|
|
38
|
+
|
|
39
|
+
The name of the new file or directory at the destination (e.g., `report.txt`).
|
|
40
|
+
|
|
41
|
+
### wallet
|
|
42
|
+
|
|
43
|
+
`PublicKey`
|
|
44
|
+
|
|
45
|
+
The wallet public key used to sign and authorize the transaction.
|
|
46
|
+
|
|
47
|
+
## Returns
|
|
48
|
+
|
|
49
|
+
`Promise`\<`Transaction`\>
|
|
50
|
+
|
|
51
|
+
A Promise that resolves to a Solana `Transaction` object containing the copyPath instruction.
|
|
52
|
+
|
|
53
|
+
## Throws
|
|
54
|
+
|
|
55
|
+
Will throw an error if `srcPath` or `destPath` contains invalid characters.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / peek
|
|
6
|
+
|
|
7
|
+
# Function: peek()
|
|
8
|
+
|
|
9
|
+
> **peek**(`fsid`, `path`, `startPosition`, `endPosition`, `wallet`): `Promise`\<`Transaction`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [peek.ts:20](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/peek.ts#L20)
|
|
12
|
+
|
|
13
|
+
Constructs a Solana transaction to perform a "peek" operation on a file within a file system.
|
|
14
|
+
|
|
15
|
+
The peek operation reads data between two byte offsets within a specified file path.
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
### fsid
|
|
20
|
+
|
|
21
|
+
`string`
|
|
22
|
+
|
|
23
|
+
A stringified integer representing the file system ID in which the file resides.
|
|
24
|
+
|
|
25
|
+
### path
|
|
26
|
+
|
|
27
|
+
`string`
|
|
28
|
+
|
|
29
|
+
The path to the file to be peeked.
|
|
30
|
+
|
|
31
|
+
### startPosition
|
|
32
|
+
|
|
33
|
+
`number`
|
|
34
|
+
|
|
35
|
+
The starting byte offset (inclusive) to begin reading from.
|
|
36
|
+
|
|
37
|
+
### endPosition
|
|
38
|
+
|
|
39
|
+
`number`
|
|
40
|
+
|
|
41
|
+
The ending byte offset (exclusive) to stop reading at.
|
|
42
|
+
|
|
43
|
+
### wallet
|
|
44
|
+
|
|
45
|
+
`PublicKey`
|
|
46
|
+
|
|
47
|
+
The public key of the wallet that will sign and authorize the transaction.
|
|
48
|
+
|
|
49
|
+
## Returns
|
|
50
|
+
|
|
51
|
+
`Promise`\<`Transaction`\>
|
|
52
|
+
|
|
53
|
+
A Promise that resolves to a Solana `Transaction` object containing the peek instruction.
|
|
54
|
+
|
|
55
|
+
## Throws
|
|
56
|
+
|
|
57
|
+
Will throw an error if the `path` contains invalid characters.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / poke
|
|
6
|
+
|
|
7
|
+
# Function: poke()
|
|
8
|
+
|
|
9
|
+
> **poke**(`fsid`, `path`, `position`, `wallet`, `dataKey`): `Promise`\<`Transaction`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [poke.ts:19](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/poke.ts#L19)
|
|
12
|
+
|
|
13
|
+
Constructs a Solana transaction to perform a poke\operation, which writes data
|
|
14
|
+
to a file at the specified path and byte position.
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### fsid
|
|
19
|
+
|
|
20
|
+
`string`
|
|
21
|
+
|
|
22
|
+
A stringified integer representing the file system ID where the file resides.
|
|
23
|
+
|
|
24
|
+
### path
|
|
25
|
+
|
|
26
|
+
`string`
|
|
27
|
+
|
|
28
|
+
The path to the file to be written to.
|
|
29
|
+
|
|
30
|
+
### position
|
|
31
|
+
|
|
32
|
+
`number`
|
|
33
|
+
|
|
34
|
+
The byte offset in the file where data should be written.
|
|
35
|
+
|
|
36
|
+
### wallet
|
|
37
|
+
|
|
38
|
+
`PublicKey`
|
|
39
|
+
|
|
40
|
+
The public key of the wallet that signs and authorizes the transaction.
|
|
41
|
+
|
|
42
|
+
### dataKey
|
|
43
|
+
|
|
44
|
+
`PublicKey`
|
|
45
|
+
|
|
46
|
+
A public key of a data account that holds the content to be written to the file.
|
|
47
|
+
|
|
48
|
+
## Returns
|
|
49
|
+
|
|
50
|
+
`Promise`\<`Transaction`\>
|
|
51
|
+
|
|
52
|
+
A Promise that resolves to a Solana `Transaction` object containing the poke instruction.
|
|
53
|
+
|
|
54
|
+
## Throws
|
|
55
|
+
|
|
56
|
+
Will throw an error if the `path` contains invalid characters.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / removeDirectory
|
|
6
|
+
|
|
7
|
+
# Function: removeDirectory()
|
|
8
|
+
|
|
9
|
+
> **removeDirectory**(`fsid`, `path`, `wallet`): `Promise`\<`Transaction`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [removeDirectory.ts:17](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/removeDirectory.ts#L17)
|
|
12
|
+
|
|
13
|
+
Constructs a Solana transaction to perform a "remove directory" operation
|
|
14
|
+
in a file system, identified by a file system ID (`fsid`).
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### fsid
|
|
19
|
+
|
|
20
|
+
`string`
|
|
21
|
+
|
|
22
|
+
A stringified integer representing the file system ID containing the directory.
|
|
23
|
+
|
|
24
|
+
### path
|
|
25
|
+
|
|
26
|
+
`string`
|
|
27
|
+
|
|
28
|
+
The full path to the directory that should be removed.
|
|
29
|
+
|
|
30
|
+
### wallet
|
|
31
|
+
|
|
32
|
+
`PublicKey`
|
|
33
|
+
|
|
34
|
+
The public key of the wallet that will sign and authorize the transaction.
|
|
35
|
+
|
|
36
|
+
## Returns
|
|
37
|
+
|
|
38
|
+
`Promise`\<`Transaction`\>
|
|
39
|
+
|
|
40
|
+
A Promise that resolves to a Solana `Transaction` object containing the remove directory instruction.
|
|
41
|
+
|
|
42
|
+
## Throws
|
|
43
|
+
|
|
44
|
+
May throw an error if the `path` fails validation in `sanitizePath`.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / removeFile
|
|
6
|
+
|
|
7
|
+
# Function: removeFile()
|
|
8
|
+
|
|
9
|
+
> **removeFile**(`fsid`, `path`, `wallet`): `Promise`\<`Transaction`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [removeFile.ts:17](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/removeFile.ts#L17)
|
|
12
|
+
|
|
13
|
+
Constructs a Solana transaction to remove a file from a file system,
|
|
14
|
+
identified by a file system ID (`fsid`) and a UTF-8 encoded file path.
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### fsid
|
|
19
|
+
|
|
20
|
+
`string`
|
|
21
|
+
|
|
22
|
+
A stringified integer representing the file system ID in which the file resides.
|
|
23
|
+
|
|
24
|
+
### path
|
|
25
|
+
|
|
26
|
+
`string`
|
|
27
|
+
|
|
28
|
+
The full path to the file to be deleted.
|
|
29
|
+
|
|
30
|
+
### wallet
|
|
31
|
+
|
|
32
|
+
`PublicKey`
|
|
33
|
+
|
|
34
|
+
The public key of the wallet that signs and authorizes the transaction.
|
|
35
|
+
|
|
36
|
+
## Returns
|
|
37
|
+
|
|
38
|
+
`Promise`\<`Transaction`\>
|
|
39
|
+
|
|
40
|
+
A Promise that resolves to a Solana `Transaction` object containing the remove file instruction.
|
|
41
|
+
|
|
42
|
+
## Throws
|
|
43
|
+
|
|
44
|
+
May throw an error if `path` is invalid per `sanitizePath`.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / renamePath
|
|
6
|
+
|
|
7
|
+
# Function: renamePath()
|
|
8
|
+
|
|
9
|
+
> **renamePath**(`fsid`, `oldPath`, `name`, `wallet`): `Promise`\<`Transaction`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [renamePath.ts:18](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/renamePath.ts#L18)
|
|
12
|
+
|
|
13
|
+
Constructs a Solana transaction to rename (or move) a file or directory
|
|
14
|
+
within a file system, based on a provided file system ID (`fsid`).
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### fsid
|
|
19
|
+
|
|
20
|
+
`string`
|
|
21
|
+
|
|
22
|
+
A stringified integer representing the file system ID where the path exists.
|
|
23
|
+
|
|
24
|
+
### oldPath
|
|
25
|
+
|
|
26
|
+
`string`
|
|
27
|
+
|
|
28
|
+
The current path of the file or directory to be renamed or moved.
|
|
29
|
+
|
|
30
|
+
### name
|
|
31
|
+
|
|
32
|
+
`string`
|
|
33
|
+
|
|
34
|
+
The new name to assign to the file or directory.
|
|
35
|
+
|
|
36
|
+
### wallet
|
|
37
|
+
|
|
38
|
+
`PublicKey`
|
|
39
|
+
|
|
40
|
+
The public key of the wallet that signs and authorizes the transaction.
|
|
41
|
+
|
|
42
|
+
## Returns
|
|
43
|
+
|
|
44
|
+
`Promise`\<`Transaction`\>
|
|
45
|
+
|
|
46
|
+
A Promise that resolves to a Solana `Transaction` object containing the rename path instruction.
|
|
47
|
+
|
|
48
|
+
## Throws
|
|
49
|
+
|
|
50
|
+
May throw an error if either `oldPath` or `newPath` is invalid per `sanitizePath`.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / subscribeResult
|
|
6
|
+
|
|
7
|
+
# Function: subscribeResult()
|
|
8
|
+
|
|
9
|
+
> **subscribeResult**(`connection`, `tx`, `onResult`, `onError?`, `onClose?`): `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [webSocket.ts:40](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/webSocket.ts#L40)
|
|
12
|
+
|
|
13
|
+
Opens a WebSocket connection and subscribes to the result of a transaction
|
|
14
|
+
via the custom `xandeumResultSubscribe` method.
|
|
15
|
+
|
|
16
|
+
This is useful for receiving asynchronous results tied to an on-chain operation,
|
|
17
|
+
such as file creation, modification, or deletion.
|
|
18
|
+
|
|
19
|
+
The subscription sends a JSON-RPC request with:
|
|
20
|
+
- `method`: "xandeumResultSubscribe"
|
|
21
|
+
- `params`: [txId, { commitment: "finalized" }]
|
|
22
|
+
|
|
23
|
+
The WebSocket listens for result messages and invokes the `onResult` callback
|
|
24
|
+
if a valid result with `fsid`, `status`, or `data` is received.
|
|
25
|
+
|
|
26
|
+
## Parameters
|
|
27
|
+
|
|
28
|
+
### connection
|
|
29
|
+
|
|
30
|
+
`Connection`
|
|
31
|
+
|
|
32
|
+
The solana web3 connection with Xandeum-compatible JSON-RPC endpoint (e.g., `'https://api.devnet.solana.com'`).
|
|
33
|
+
|
|
34
|
+
### tx
|
|
35
|
+
|
|
36
|
+
`string`
|
|
37
|
+
|
|
38
|
+
The transaction ID you want to listen for results from.
|
|
39
|
+
|
|
40
|
+
### onResult
|
|
41
|
+
|
|
42
|
+
(`value`) => `void`
|
|
43
|
+
|
|
44
|
+
Callback to handle incoming result messages. Triggered when a valid response is received.
|
|
45
|
+
|
|
46
|
+
### onError?
|
|
47
|
+
|
|
48
|
+
(`err`) => `void`
|
|
49
|
+
|
|
50
|
+
(Optional) Callback triggered if a WebSocket error occurs.
|
|
51
|
+
|
|
52
|
+
### onClose?
|
|
53
|
+
|
|
54
|
+
() => `void`
|
|
55
|
+
|
|
56
|
+
(Optional) Callback triggered when the WebSocket connection closes.
|
|
57
|
+
|
|
58
|
+
## Returns
|
|
59
|
+
|
|
60
|
+
`void`
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Xandeum Web3 Library](../globals.md) / unsubscribeResult
|
|
6
|
+
|
|
7
|
+
# Function: unsubscribeResult()
|
|
8
|
+
|
|
9
|
+
> **unsubscribeResult**(`connection`, `subscriptionId`): `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [webSocket.ts:103](https://github.com/Xandeum/xandeum-web3.js/blob/master/src/webSocket.ts#L103)
|
|
12
|
+
|
|
13
|
+
Sends a WebSocket JSON-RPC message to unsubscribe from a previously subscribed transaction result
|
|
14
|
+
using the `xandeumResultUnsubscribed` method (note: custom method, ensure server-side implementation matches).
|
|
15
|
+
|
|
16
|
+
This function automatically closes the WebSocket connection after sending the unsubscribe request.
|
|
17
|
+
|
|
18
|
+
## Parameters
|
|
19
|
+
|
|
20
|
+
### connection
|
|
21
|
+
|
|
22
|
+
`Connection`
|
|
23
|
+
|
|
24
|
+
The solana web3 connection with Xandeum-compatible JSON-RPC endpoint (e.g., `'https://api.devnet.solana.com'`).
|
|
25
|
+
|
|
26
|
+
### subscriptionId
|
|
27
|
+
|
|
28
|
+
`string`
|
|
29
|
+
|
|
30
|
+
The ID of the active subscription you want to cancel.
|
|
31
|
+
|
|
32
|
+
## Returns
|
|
33
|
+
|
|
34
|
+
`void`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**Xandeum Web3 Library v1.12.0**](README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
# Xandeum Web3 Library v1.12.0
|
|
6
|
+
|
|
7
|
+
## Functions
|
|
8
|
+
|
|
9
|
+
- [armageddon](functions/armageddon.md)
|
|
10
|
+
- [bigbang](functions/bigbang.md)
|
|
11
|
+
- [copyPath](functions/copyPath.md)
|
|
12
|
+
- [createDirectory](functions/createDirectory.md)
|
|
13
|
+
- [createFile](functions/createFile.md)
|
|
14
|
+
- [exists](functions/exists.md)
|
|
15
|
+
- [getMetadata](functions/getMetadata.md)
|
|
16
|
+
- [getXandeumResult](functions/getXandeumResult.md)
|
|
17
|
+
- [listDirectoryEntry](functions/listDirectoryEntry.md)
|
|
18
|
+
- [move](functions/move.md)
|
|
19
|
+
- [peek](functions/peek.md)
|
|
20
|
+
- [poke](functions/poke.md)
|
|
21
|
+
- [removeDirectory](functions/removeDirectory.md)
|
|
22
|
+
- [removeFile](functions/removeFile.md)
|
|
23
|
+
- [renamePath](functions/renamePath.md)
|
|
24
|
+
- [subscribeResult](functions/subscribeResult.md)
|
|
25
|
+
- [unsubscribeResult](functions/unsubscribeResult.md)
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
### Metadata & Utilities
|
|
35
|
+
|
|
36
|
+
* [exists](functions/exists.md)
|
|
37
|
+
* [getMetadata](functions/getMetadata.md)
|
|
38
|
+
* [getXandeumResult](functions/getXandeumResult.md)
|
|
39
|
+
|
|
40
|
+
### WebSocket Functions
|
|
41
|
+
|
|
42
|
+
* [subscribeResult](functions/subscribeResult.md)
|
|
43
|
+
* [unsubscribeResult](functions/unsubscribeResult.md)
|
|
44
|
+
|