@xandeum/web3.js 1.3.0 → 1.3.2
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/README.md +9 -6
- package/archbee.yaml +55 -0
- package/dist/armageddon.js +9 -1
- package/dist/assignCoowner.d.ts +12 -0
- package/dist/assignCoowner.js +89 -0
- package/dist/bigbang.d.ts +2 -1
- package/dist/bigbang.js +17 -3
- package/dist/const.d.ts +1 -1
- package/dist/const.js +1 -1
- package/dist/copyPath.js +9 -1
- package/dist/createDirectory.js +9 -1
- package/dist/createFile.js +9 -1
- package/dist/exists.js +7 -5
- package/dist/find.d.ts +22 -0
- package/dist/find.js +88 -0
- package/dist/getMetadata.js +7 -5
- package/dist/getXandeumResult.d.ts +15 -0
- package/dist/getXandeumResult.js +115 -0
- package/dist/helpers.d.ts +56 -0
- package/dist/helpers.js +80 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +7 -1
- package/dist/listDirectoryEntery.js +7 -5
- package/dist/move.d.ts +14 -0
- package/dist/move.js +96 -0
- package/dist/pdaHelpers.d.ts +57 -0
- package/dist/pdaHelpers.js +83 -0
- package/dist/peek.js +9 -1
- package/dist/poke.js +9 -1
- package/dist/removeDirectory.js +9 -1
- package/dist/removeFile.js +9 -1
- package/dist/renamePath.js +9 -1
- package/dist/webSocket.d.ts +1 -1
- package/dist/webSocket.js +16 -3
- package/docs/html/assets/highlight.css +92 -0
- package/docs/html/assets/navigation.js +1 -0
- package/docs/html/assets/search.js +1 -0
- package/docs/{functions → html/functions}/armageddon.html +3 -3
- package/docs/html/functions/assignCoowner.html +8 -0
- package/docs/html/functions/bigbang.html +5 -0
- package/docs/{functions → html/functions}/copyPath.html +2 -8
- package/docs/{functions → html/functions}/createDirectory.html +2 -8
- package/docs/{functions → html/functions}/createFile.html +2 -9
- package/docs/{functions → html/functions}/exists.html +4 -4
- package/docs/html/functions/find.html +10 -0
- package/docs/html/functions/getMetadata.html +10 -0
- package/docs/html/functions/getXandeumResult.html +9 -0
- package/docs/{functions → html/functions}/listDirectoryEntry.html +4 -4
- package/docs/html/functions/move.html +9 -0
- package/docs/{functions → html/functions}/peek.html +2 -10
- package/docs/{functions → html/functions}/poke.html +2 -10
- package/docs/{functions → html/functions}/removeDirectory.html +2 -8
- package/docs/{functions → html/functions}/removeFile.html +2 -8
- package/docs/{functions → html/functions}/renamePath.html +3 -9
- package/docs/{functions → html/functions}/subscribeResult.html +4 -4
- package/docs/html/functions/unsubscribeResult.html +6 -0
- package/docs/{hierarchy.html → html/hierarchy.html} +1 -1
- package/docs/html/index.html +62 -0
- package/docs/html/modules.html +1 -0
- package/docs/markdown/README.md +10 -7
- package/docs/markdown/functions/armageddon.md +2 -2
- package/docs/markdown/functions/assignCoowner.md +46 -0
- package/docs/markdown/functions/bigbang.md +9 -3
- package/docs/markdown/functions/copyPath.md +2 -2
- package/docs/markdown/functions/createDirectory.md +2 -2
- package/docs/markdown/functions/createFile.md +2 -2
- package/docs/markdown/functions/exists.md +2 -2
- package/docs/markdown/functions/find.md +44 -0
- package/docs/markdown/functions/getMetadata.md +2 -2
- package/docs/markdown/functions/getXandeumResult.md +38 -0
- package/docs/markdown/functions/listDirectoryEntry.md +2 -2
- package/docs/markdown/functions/move.md +55 -0
- package/docs/markdown/functions/peek.md +2 -2
- package/docs/markdown/functions/poke.md +2 -2
- package/docs/markdown/functions/removeDirectory.md +2 -2
- package/docs/markdown/functions/removeFile.md +2 -2
- package/docs/markdown/functions/renamePath.md +2 -2
- package/docs/markdown/functions/subscribeResult.md +2 -2
- package/docs/markdown/functions/unsubscribeResult.md +2 -2
- package/docs/markdown/globals.md +6 -2
- package/package.json +3 -3
- package/src/armageddon.ts +8 -0
- package/src/assignCoowner.ts +49 -0
- package/src/bigbang.ts +13 -2
- package/src/const.ts +1 -1
- package/src/copyPath.ts +8 -1
- package/src/createDirectory.ts +8 -1
- package/src/createFile.ts +8 -2
- package/src/exists.ts +2 -1
- package/src/find.ts +53 -0
- package/src/getMetadata.ts +2 -1
- package/src/getXandeumResult.ts +67 -0
- package/src/helpers.ts +85 -0
- package/src/index.ts +5 -1
- package/src/listDirectoryEntery.ts +2 -1
- package/src/move.ts +62 -0
- package/src/peek.ts +8 -1
- package/src/poke.ts +8 -1
- package/src/removeDirectory.ts +8 -2
- package/src/removeFile.ts +8 -2
- package/src/renamePath.ts +8 -2
- package/src/webSocket.ts +18 -5
- package/typedoc.json +3 -4
- package/docs/assets/highlight.css +0 -22
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/functions/bigbang.html +0 -4
- package/docs/functions/getMetadata.html +0 -10
- package/docs/functions/unsubscribeResult.html +0 -6
- package/docs/index.html +0 -2
- package/docs/modules.html +0 -1
- /package/docs/{.nojekyll → html/.nojekyll} +0 -0
- /package/docs/{assets → html/assets}/hierarchy.js +0 -0
- /package/docs/{assets → html/assets}/icons.js +0 -0
- /package/docs/{assets → html/assets}/icons.svg +0 -0
- /package/docs/{assets → html/assets}/main.js +0 -0
- /package/docs/{assets → html/assets}/style.css +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
import { Connection } from "@solana/web3.js"
|
|
3
|
+
|
|
4
|
+
function sleep(ms: number) {
|
|
5
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Sends a JSON-RPC request to the Xandeum-compatible endpoint to retrieve
|
|
10
|
+
* the result of a transaction previously submitted with a specific signature.
|
|
11
|
+
*
|
|
12
|
+
* This function calls the custom RPC method `getXandeumResult`, which returns
|
|
13
|
+
* the result associated with the given transaction signature.
|
|
14
|
+
*
|
|
15
|
+
* @param connection - The Solana web3 connection object pointing to a Xandeum-compatible RPC endpoint.
|
|
16
|
+
* @param signature - The transaction signature string whose result should be queried.
|
|
17
|
+
*
|
|
18
|
+
* @returns A `Promise<any>` resolving to the parsed JSON response from the RPC server,
|
|
19
|
+
* which includes the result of the transaction if available.
|
|
20
|
+
*/
|
|
21
|
+
export async function getXandeumResult(
|
|
22
|
+
connection: Connection,
|
|
23
|
+
signature: string
|
|
24
|
+
): Promise<any> {
|
|
25
|
+
const url = connection.rpcEndpoint;
|
|
26
|
+
const maxAttempts = 3;
|
|
27
|
+
const delayMs = 5000;
|
|
28
|
+
|
|
29
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
30
|
+
// Wait before every attempt (including the first one)
|
|
31
|
+
await sleep(delayMs);
|
|
32
|
+
|
|
33
|
+
const response = await fetch(url, {
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: { "Content-Type": "application/json" },
|
|
36
|
+
body: JSON.stringify({
|
|
37
|
+
jsonrpc: "2.0",
|
|
38
|
+
id: 1,
|
|
39
|
+
method: "getXandeumResult",
|
|
40
|
+
params: [signature],
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (!response.ok) {
|
|
45
|
+
const text = await response.text();
|
|
46
|
+
console.error(`Attempt ${attempt}/${maxAttempts} failed: ${response.status} ${text}`);
|
|
47
|
+
if (attempt === maxAttempts) {
|
|
48
|
+
return { result: null, error: `HTTP ${response.status}` };
|
|
49
|
+
}
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const data = await response.json();
|
|
54
|
+
|
|
55
|
+
// Change this condition if Xandeum uses a different "not ready" value
|
|
56
|
+
if (data?.result != null && data.result !== "pending") {
|
|
57
|
+
console.log(`Got result on attempt ${attempt}`);
|
|
58
|
+
return data; // Success — return immediately
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
console.log(`Attempt ${attempt}/${maxAttempts}: still pending...`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// All 3 attempts done, still no result
|
|
65
|
+
console.log("Max attempts reached — result still not available");
|
|
66
|
+
return { result: null, error: "Result not ready after 3 attempts" };
|
|
67
|
+
}
|
package/src/helpers.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { PublicKey } from '@solana/web3.js'
|
|
2
|
+
import { programId } from './const'
|
|
3
|
+
import BN from 'bn.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Seed used for deriving the fee distributor PDA
|
|
7
|
+
*/
|
|
8
|
+
export const FEE_DISTRIBUTOR_SEED = 'fee_distributor'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Duration of one pulse in seconds
|
|
12
|
+
*/
|
|
13
|
+
export const PULSE_DURATION_SECONDS = 15
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Number of pulses in one yuga
|
|
17
|
+
*/
|
|
18
|
+
export const PULSES_PER_YUGA = 16384
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Duration of one yuga in seconds (16384 * 15 = 245,760 seconds ≈ 2.84 days)
|
|
22
|
+
*/
|
|
23
|
+
export const YUGA_DURATION_SECONDS = PULSES_PER_YUGA * PULSE_DURATION_SECONDS
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Unix timestamp (in seconds) when the first yuga started
|
|
27
|
+
*/
|
|
28
|
+
export const YUGA_START_TIMESTAMP = 1768898445
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Calculates the yuga number from a given unix timestamp.
|
|
32
|
+
*
|
|
33
|
+
* @param unixTimestamp - Unix timestamp in seconds
|
|
34
|
+
* @returns The yuga number for the given timestamp
|
|
35
|
+
*/
|
|
36
|
+
export function getYugaFromTimestamp(unixTimestamp: number): number {
|
|
37
|
+
if (unixTimestamp < YUGA_START_TIMESTAMP) {
|
|
38
|
+
return 0
|
|
39
|
+
}
|
|
40
|
+
return Math.floor((unixTimestamp - YUGA_START_TIMESTAMP) / YUGA_DURATION_SECONDS)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets the current yuga value.
|
|
45
|
+
* Yuga represents an epoch or era in the Xandeum system.
|
|
46
|
+
* Each yuga lasts 245,760 seconds (approximately 2.84 days).
|
|
47
|
+
*
|
|
48
|
+
* @returns The current yuga number
|
|
49
|
+
*/
|
|
50
|
+
export function getCurrentYuga(): number {
|
|
51
|
+
const currentTime = Math.floor(Date.now() / 1000)
|
|
52
|
+
return getYugaFromTimestamp(currentTime)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Derives the Program Derived Address (PDA) for the fee distributor account.
|
|
57
|
+
*
|
|
58
|
+
* The PDA is derived using:
|
|
59
|
+
* - The fee distributor seed
|
|
60
|
+
* - The current yuga (epoch) as little-endian bytes
|
|
61
|
+
*
|
|
62
|
+
* @returns An object containing the PDA public key and bump seed
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const { pda, bump } = getFeeDistributorPda()
|
|
67
|
+
* console.log('Fee Distributor PDA:', pda.toBase58())
|
|
68
|
+
* console.log('Bump seed:', bump)
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export function getFeeDistributorPda(): { pda: PublicKey; bump: number } {
|
|
72
|
+
const yuga = getCurrentYuga()
|
|
73
|
+
|
|
74
|
+
const yugaBuffer = Buffer.from(new BN(yuga).toArray('le', 8))
|
|
75
|
+
|
|
76
|
+
const [pda, bump] = PublicKey.findProgramAddressSync(
|
|
77
|
+
[
|
|
78
|
+
Buffer.from(FEE_DISTRIBUTOR_SEED, 'utf-8'),
|
|
79
|
+
yugaBuffer
|
|
80
|
+
],
|
|
81
|
+
new PublicKey(programId)
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
return { pda, bump }
|
|
85
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -9,7 +9,11 @@ export * from "./peek";
|
|
|
9
9
|
export * from "./poke";
|
|
10
10
|
export * from "./removeDirectory";
|
|
11
11
|
export * from "./copyPath";
|
|
12
|
-
|
|
12
|
+
export * from "./move";
|
|
13
|
+
export * from "./getXandeumResult";
|
|
14
|
+
export * from "./assignCoowner";
|
|
13
15
|
export {exists } from "./exists";
|
|
14
16
|
export {listDirectoryEntry} from "./listDirectoryEntery";
|
|
15
17
|
export {getMetadata} from "./getMetadata";
|
|
18
|
+
export {find} from "./find";
|
|
19
|
+
export * from "./helpers";
|
|
@@ -42,7 +42,8 @@ export async function listDirectoryEntry (
|
|
|
42
42
|
})
|
|
43
43
|
|
|
44
44
|
if (!response.ok) {
|
|
45
|
-
|
|
45
|
+
const errorText = await response.text();
|
|
46
|
+
return Error(`error! status: ${response.status}, message: ${errorText}`);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
const data = await response.json()
|
package/src/move.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Transaction, TransactionInstruction, PublicKey } from '@solana/web3.js'
|
|
2
|
+
import BN from 'bn.js'
|
|
3
|
+
import { programId } from './const'
|
|
4
|
+
import { sanitizePath } from './sanitizePath'
|
|
5
|
+
import { getFeeDistributorPda } from './helpers'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Constructs a Solana transaction to copy a file or directory from one path to another.
|
|
9
|
+
*
|
|
10
|
+
* @param fsid - The unique numeric identifier representing the target file system.
|
|
11
|
+
* @param srcPath - The source path to copy from (e.g., `/documents`).
|
|
12
|
+
* @param destPath - The destination path to copy to (e.g., `/archive`).
|
|
13
|
+
* @param name - The name of the new file or directory at the destination (e.g., `report.txt`).
|
|
14
|
+
* @param wallet - The wallet public key used to sign and authorize the transaction.
|
|
15
|
+
* @returns A Promise that resolves to a Solana `Transaction` object containing the copyPath instruction.
|
|
16
|
+
* @throws Will throw an error if `srcPath` or `destPath` contains invalid characters.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export async function move (
|
|
21
|
+
fsid: string,
|
|
22
|
+
srcPath: string,
|
|
23
|
+
destPath: string,
|
|
24
|
+
name: string,
|
|
25
|
+
wallet: PublicKey
|
|
26
|
+
): Promise<Transaction> {
|
|
27
|
+
// Validate path: only letters, numbers, and /
|
|
28
|
+
sanitizePath(srcPath)
|
|
29
|
+
|
|
30
|
+
sanitizePath(destPath)
|
|
31
|
+
sanitizePath(name)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
const rest = Buffer.from(`${srcPath}\0${destPath}\0${name}`, 'utf-8')
|
|
35
|
+
|
|
36
|
+
const instructionData = Buffer.concat([
|
|
37
|
+
Buffer.from(Int8Array.from([0]).buffer),
|
|
38
|
+
Buffer.from(Int8Array.from([13]).buffer),
|
|
39
|
+
Buffer.from(Uint8Array.of(...new BN(fsid).toArray('le', 8))),
|
|
40
|
+
rest
|
|
41
|
+
])
|
|
42
|
+
let feeDistributorPda = getFeeDistributorPda()
|
|
43
|
+
const instruction = new TransactionInstruction({
|
|
44
|
+
keys: [
|
|
45
|
+
{
|
|
46
|
+
pubkey: wallet,
|
|
47
|
+
isSigner: true,
|
|
48
|
+
isWritable: true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
pubkey: feeDistributorPda.pda,
|
|
52
|
+
isSigner: false,
|
|
53
|
+
isWritable: true
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
programId: new PublicKey(programId),
|
|
57
|
+
data: instructionData
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const tx = new Transaction().add(instruction)
|
|
61
|
+
return tx
|
|
62
|
+
}
|
package/src/peek.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Transaction, TransactionInstruction, PublicKey } from '@solana/web3.js'
|
|
|
2
2
|
import BN from 'bn.js'
|
|
3
3
|
import { programId } from './const'
|
|
4
4
|
import { sanitizePath } from './sanitizePath'
|
|
5
|
+
import { getFeeDistributorPda } from './helpers'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Constructs a Solana transaction to perform a "peek" operation on a file within a file system.
|
|
@@ -28,19 +29,25 @@ export async function peek (
|
|
|
28
29
|
|
|
29
30
|
const rest = Buffer.from(`${path}`, 'utf-8')
|
|
30
31
|
const instructionData = Buffer.concat([
|
|
32
|
+
Buffer.from(Int8Array.from([0]).buffer),
|
|
31
33
|
Buffer.from(Int8Array.from([3]).buffer),
|
|
32
34
|
Buffer.from(Uint8Array.of(...new BN(fsid).toArray('le', 8))),
|
|
33
35
|
Buffer.from(Uint8Array.of(...new BN(startPosition).toArray('le', 8))),
|
|
34
36
|
Buffer.from(Uint8Array.of(...new BN(endPosition).toArray('le', 8))),
|
|
35
37
|
rest
|
|
36
38
|
])
|
|
37
|
-
|
|
39
|
+
let feeDistributorPda = getFeeDistributorPda()
|
|
38
40
|
const instruction = new TransactionInstruction({
|
|
39
41
|
keys: [
|
|
40
42
|
{
|
|
41
43
|
pubkey: wallet,
|
|
42
44
|
isSigner: true,
|
|
43
45
|
isWritable: true
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
pubkey: feeDistributorPda.pda,
|
|
49
|
+
isSigner: false,
|
|
50
|
+
isWritable: true
|
|
44
51
|
}
|
|
45
52
|
],
|
|
46
53
|
programId: new PublicKey(programId),
|
package/src/poke.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Transaction, TransactionInstruction, PublicKey } from '@solana/web3.js'
|
|
|
2
2
|
import BN from 'bn.js'
|
|
3
3
|
import { programId } from './const'
|
|
4
4
|
import { sanitizePath } from './sanitizePath'
|
|
5
|
+
import { getFeeDistributorPda } from './helpers'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Constructs a Solana transaction to perform a poke\operation, which writes data
|
|
@@ -30,13 +31,14 @@ export async function poke (
|
|
|
30
31
|
// Encode the path length as an 8-byte little-endian unsigned integer
|
|
31
32
|
const pathLengthBuffer = Buffer.from(Uint8Array.of(...new BN(pathBuffer.length).toArray('le', 8)))
|
|
32
33
|
const instructionData = Buffer.concat([
|
|
34
|
+
Buffer.from(Int8Array.from([0]).buffer),
|
|
33
35
|
Buffer.from(Int8Array.from([4]).buffer),
|
|
34
36
|
Buffer.from(Uint8Array.of(...new BN(fsid).toArray('le', 8))),
|
|
35
37
|
Buffer.from(Uint8Array.of(...new BN(position).toArray('le', 8))),
|
|
36
38
|
pathLengthBuffer,
|
|
37
39
|
pathBuffer
|
|
38
40
|
])
|
|
39
|
-
|
|
41
|
+
let feeDistributorPda = getFeeDistributorPda()
|
|
40
42
|
const instruction = new TransactionInstruction({
|
|
41
43
|
keys: [
|
|
42
44
|
{
|
|
@@ -48,6 +50,11 @@ export async function poke (
|
|
|
48
50
|
pubkey: dataKey,
|
|
49
51
|
isSigner: false,
|
|
50
52
|
isWritable: false
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
pubkey: feeDistributorPda.pda,
|
|
56
|
+
isSigner: false,
|
|
57
|
+
isWritable: true
|
|
51
58
|
}
|
|
52
59
|
],
|
|
53
60
|
programId: new PublicKey(programId),
|
package/src/removeDirectory.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Transaction, TransactionInstruction, PublicKey } from '@solana/web3.js'
|
|
|
2
2
|
import BN from 'bn.js'
|
|
3
3
|
import { programId } from './const'
|
|
4
4
|
import { sanitizePath } from './sanitizePath'
|
|
5
|
-
|
|
5
|
+
import { getFeeDistributorPda } from './helpers'
|
|
6
6
|
/**
|
|
7
7
|
* Constructs a Solana transaction to perform a "remove directory" operation
|
|
8
8
|
* in a file system, identified by a file system ID (`fsid`).
|
|
@@ -21,17 +21,23 @@ export async function removeDirectory (
|
|
|
21
21
|
): Promise<Transaction> {
|
|
22
22
|
sanitizePath(path)
|
|
23
23
|
const instructionData = Buffer.concat([
|
|
24
|
+
Buffer.from(Int8Array.from([0]).buffer),
|
|
24
25
|
Buffer.from(Int8Array.from([7]).buffer),
|
|
25
26
|
Buffer.from(Uint8Array.of(...new BN(fsid).toArray('le', 8))),
|
|
26
27
|
Buffer.from(`${path}`, 'utf-8')
|
|
27
28
|
])
|
|
28
|
-
|
|
29
|
+
let feeDistributorPda = getFeeDistributorPda()
|
|
29
30
|
const instruction = new TransactionInstruction({
|
|
30
31
|
keys: [
|
|
31
32
|
{
|
|
32
33
|
pubkey: wallet,
|
|
33
34
|
isSigner: true,
|
|
34
35
|
isWritable: true
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
pubkey: feeDistributorPda.pda,
|
|
39
|
+
isSigner: false,
|
|
40
|
+
isWritable: true
|
|
35
41
|
}
|
|
36
42
|
],
|
|
37
43
|
programId: new PublicKey(programId),
|
package/src/removeFile.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Transaction, TransactionInstruction, PublicKey } from '@solana/web3.js'
|
|
|
2
2
|
import BN from 'bn.js'
|
|
3
3
|
import { programId } from './const'
|
|
4
4
|
import { sanitizePath } from './sanitizePath'
|
|
5
|
-
|
|
5
|
+
import { getFeeDistributorPda } from './helpers'
|
|
6
6
|
/**
|
|
7
7
|
* Constructs a Solana transaction to remove a file from a file system,
|
|
8
8
|
* identified by a file system ID (`fsid`) and a UTF-8 encoded file path.
|
|
@@ -22,17 +22,23 @@ export async function removeFile (
|
|
|
22
22
|
sanitizePath(path)
|
|
23
23
|
|
|
24
24
|
const instructionData = Buffer.concat([
|
|
25
|
+
Buffer.from(Int8Array.from([0]).buffer),
|
|
25
26
|
Buffer.from(Int8Array.from([5]).buffer),
|
|
26
27
|
Buffer.from(Uint8Array.of(...new BN(fsid).toArray('le', 8))),
|
|
27
28
|
Buffer.from(`${path}`, 'utf-8')
|
|
28
29
|
])
|
|
29
|
-
|
|
30
|
+
let feeDistributorPda = getFeeDistributorPda()
|
|
30
31
|
const instruction = new TransactionInstruction({
|
|
31
32
|
keys: [
|
|
32
33
|
{
|
|
33
34
|
pubkey: wallet,
|
|
34
35
|
isSigner: true,
|
|
35
36
|
isWritable: true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
pubkey: feeDistributorPda.pda,
|
|
40
|
+
isSigner: false,
|
|
41
|
+
isWritable: true
|
|
36
42
|
}
|
|
37
43
|
],
|
|
38
44
|
programId: new PublicKey(programId),
|
package/src/renamePath.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Transaction, TransactionInstruction, PublicKey } from '@solana/web3.js'
|
|
|
2
2
|
import BN from 'bn.js'
|
|
3
3
|
import { programId } from './const'
|
|
4
4
|
import { sanitizePath } from './sanitizePath'
|
|
5
|
-
|
|
5
|
+
import { getFeeDistributorPda } from './helpers'
|
|
6
6
|
/**
|
|
7
7
|
* Constructs a Solana transaction to rename (or move) a file or directory
|
|
8
8
|
* within a file system, based on a provided file system ID (`fsid`).
|
|
@@ -28,17 +28,23 @@ export async function renamePath (
|
|
|
28
28
|
const rest = Buffer.from(`${oldPath}\0${name}`, 'utf-8')
|
|
29
29
|
|
|
30
30
|
const instructionData = Buffer.concat([
|
|
31
|
+
Buffer.from(Int8Array.from([0]).buffer),
|
|
31
32
|
Buffer.from(Int8Array.from([8]).buffer),
|
|
32
33
|
Buffer.from(Uint8Array.of(...new BN(fsid).toArray('le', 8))),
|
|
33
34
|
rest
|
|
34
35
|
])
|
|
35
|
-
|
|
36
|
+
let feeDistributorPda = getFeeDistributorPda()
|
|
36
37
|
const instruction = new TransactionInstruction({
|
|
37
38
|
keys: [
|
|
38
39
|
{
|
|
39
40
|
pubkey: wallet,
|
|
40
41
|
isSigner: true,
|
|
41
42
|
isWritable: true
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
pubkey: feeDistributorPda.pda,
|
|
46
|
+
isSigner: false,
|
|
47
|
+
isWritable: true
|
|
42
48
|
}
|
|
43
49
|
],
|
|
44
50
|
programId: new PublicKey(programId),
|
package/src/webSocket.ts
CHANGED
|
@@ -45,7 +45,14 @@ export function subscribeResult (
|
|
|
45
45
|
onClose?: () => void
|
|
46
46
|
): void {
|
|
47
47
|
let rpcEndpoint = connection.rpcEndpoint;
|
|
48
|
-
const
|
|
48
|
+
const url = new URL(rpcEndpoint);
|
|
49
|
+
// url.port = '8900'; // Set the port to 8900
|
|
50
|
+
if (url.port) {
|
|
51
|
+
url.port = '8900';
|
|
52
|
+
}
|
|
53
|
+
url.protocol = url.protocol.replace('http', 'ws');
|
|
54
|
+
const wsEndpoint = url.toString();
|
|
55
|
+
const ws = new WebSocket(wsEndpoint);
|
|
49
56
|
|
|
50
57
|
ws.addEventListener('open', () => {
|
|
51
58
|
const subscriptionMessage = {
|
|
@@ -88,14 +95,20 @@ export function subscribeResult (
|
|
|
88
95
|
* using the `xandeumResultUnsubscribed` method (note: custom method, ensure server-side implementation matches).
|
|
89
96
|
*
|
|
90
97
|
* This function automatically closes the WebSocket connection after sending the unsubscribe request.
|
|
91
|
-
*
|
|
92
|
-
* @param subscriptionId - The ID of the active subscription you want to cancel.
|
|
98
|
+
*
|
|
93
99
|
* @param connection - The solana web3 connection with Xandeum-compatible JSON-RPC endpoint (e.g., `'https://api.devnet.solana.com'`).
|
|
100
|
+
* @param subscriptionId - The ID of the active subscription you want to cancel.
|
|
94
101
|
*/
|
|
95
102
|
|
|
96
103
|
export function unsubscribeResult(connection: Connection,subscriptionId: string): void {
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
let rpcEndpoint = connection.rpcEndpoint;
|
|
105
|
+
const url = new URL(rpcEndpoint);
|
|
106
|
+
if (url.port) {
|
|
107
|
+
url.port = '8900';
|
|
108
|
+
}
|
|
109
|
+
url.protocol = url.protocol.replace('http', 'ws');
|
|
110
|
+
const wsEndpoint = url.toString();
|
|
111
|
+
const ws = new WebSocket(wsEndpoint);
|
|
99
112
|
|
|
100
113
|
ws.addEventListener('open', () => {
|
|
101
114
|
const unsubscribeMessage = {
|
package/typedoc.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://typedoc.org/schema.json",
|
|
3
3
|
"entryPoints": ["src/index.ts"],
|
|
4
|
-
"
|
|
5
|
-
"out": "docs/markdown",
|
|
4
|
+
"out": "docs/html",
|
|
6
5
|
"tsconfig": "tsconfig.json",
|
|
7
6
|
"name": "Xandeum Web3 Library",
|
|
8
7
|
"readme": "README.md",
|
|
@@ -16,8 +15,8 @@
|
|
|
16
15
|
"excludeInternal": true,
|
|
17
16
|
"excludeNotDocumented": false,
|
|
18
17
|
"gitRemote": "origin",
|
|
19
|
-
"gitRevision": "
|
|
20
|
-
"sourceLinkTemplate": "https://github.com/Xandeum/
|
|
18
|
+
"gitRevision": "reinheim",
|
|
19
|
+
"sourceLinkTemplate": "https://github.com/Xandeum/xandeum-web3.js/blob/{gitRevision}/{path}#L{line}",
|
|
21
20
|
"visibilityFilters": {
|
|
22
21
|
"protected": false,
|
|
23
22
|
"private": false,
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--light-code-background: #FFFFFF;
|
|
3
|
-
--dark-code-background: #1E1E1E;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
@media (prefers-color-scheme: light) { :root {
|
|
7
|
-
--code-background: var(--light-code-background);
|
|
8
|
-
} }
|
|
9
|
-
|
|
10
|
-
@media (prefers-color-scheme: dark) { :root {
|
|
11
|
-
--code-background: var(--dark-code-background);
|
|
12
|
-
} }
|
|
13
|
-
|
|
14
|
-
:root[data-theme='light'] {
|
|
15
|
-
--code-background: var(--light-code-background);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
:root[data-theme='dark'] {
|
|
19
|
-
--code-background: var(--dark-code-background);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
pre, code { background: var(--code-background); }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
window.navigationData = "eJyNkj0PgjAQhv9LZ6OLcXBWNxPjahyucGIDtKQ9DMb434X4gcJxuN77Pk/Taw83RViRWirwOSQYx86qiSqAzvXsVNqIjLNh1qbTM+VZXUmNjdVyMb9PPgptEg024fhXJMCRK667BmPodybhHoFwZTxG5PyVtfxWRmUbk+Gwp0kFBVYmUODwZyKgCdIWCWIg4PivWJBk9SGfq64t8SvptwRlgZhykmYuYS5l19jMBcxj7i7yg3Yqo7KhB21TUWEhx6Ef2qaCIpQ6RN5o3GMoM+I8nYogK+0ful6pJzw+AFipZAk="
|
package/docs/assets/search.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
window.searchData = "eJyVlk2P2jAQhv+LzxHL5Duc20o9VKp66AWhKiSGjcgHysd2V4j/3nECOMbDdrggxjPvYyl+x56TaJu/nVitT+JQ1LlYhb4j6rSSYiXStkr3Ms+bWjhiaEtc2g111hdN3b3o5OK1r0qsyMq06ySyhDg7BG5b7LdpvSdYlwwXlDXHj59p/0qQrik2qpVpL78Urcz6pv2giGbFc+BvRSkfMlWSi5PvRdd3BGpKcDF72f+QfZqnfUqwZlkusMTdb9/ma92Tn9Au4uKPUh4IoFpmI5oDdQRqmYtoZdW8fWqSu4rnwA9MopN8nPrzoDN0kovrhm2XtcVW/pLdUPYE866CCx7q/6OtGgq+cQSy5btYncSbbDtU4rq78BYJVu4KWebqapv2RWlTVbJWu+VNNox/N5ey3+PBqeKp+mUpnPXScb1FGMFm46yv4jExLlwZemUUAkZACcESgiF0MXIpoWsJXUPoYeRRQs8SeobQx8inhL4l9A1hgFFACQNLGBjCEKOQEoaWMDSEEUYRJYwsYWQIY4xiShhbwtgQooPWCSVMLGFiGkD5AUjvgG0euHPPaB/aP4SBTAeB8gWQHgLbRGC6CJQ3gPQR2EYC00mg/AGkl8A202Vp7F5s217m36cuxuabzxwn8efS3svr3XESS/w5n3UzYzTrZ5VTe91mDc0AzQAWQ80Sx/Ey1RBXQ1weZHzqc/12aJanWd4TrN34XGiMrzE+C3OdJTQi0IiAhcBJobrNEZoTak7I4qjJ4PZt5DQ+aFykcRELN40LGhBrQMwDjMOCBiQakLAA06NNHjfMTAw8F0+0+wOHuZN5Vp4e/3szw8zNwLPz7VFuLw/3jDbzM/AMPXvkCd7M2MBwNl4nx+Ioy6JGyXpzPv8DcZ0xZw==";
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>bigbang | Xandeum Web3 Library - v9.0.0</title><meta name="description" content="Documentation for Xandeum Web3 Library"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Xandeum Web3 Library - v9.0.0</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">bigbang</a></li></ul><h1>Function bigbang</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="bigbang"><span class="tsd-kind-call-signature">bigbang</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">wallet</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PublicKey</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Transaction</span><span class="tsd-signature-symbol">></span><a href="#bigbang" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Constructs a Solana transaction that triggers the "bigbang" instruction and create new file system.</p>
|
|
2
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">wallet</span>: <span class="tsd-signature-type">PublicKey</span></span><div class="tsd-comment tsd-typography"><p>The public key of the wallet that will sign and authorize the transaction.</p>
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Transaction</span><span class="tsd-signature-symbol">></span></h4><p>A Promise that resolves to a Solana <code>Transaction</code> object containing the bigbang instruction.</p>
|
|
4
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/Xandeum/test_web3/blob/main/src/bigbang.ts#L10">bigbang.ts:10</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">Xandeum Web3 Library - v9.0.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>getMetadata | Xandeum Web3 Library - v9.0.0</title><meta name="description" content="Documentation for Xandeum Web3 Library"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Xandeum Web3 Library - v9.0.0</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">getMetadata</a></li></ul><h1>Function getMetadata</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getmetadata"><span class="tsd-kind-call-signature">getMetadata</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">path</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">url</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><a href="#getmetadata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sends a JSON-RPC request to the Xandeum RPC endpoint to retrieve metadata
|
|
2
|
-
about a file or directory at the given path.</p>
|
|
3
|
-
<p>This function calls the custom RPC method <code>getMetadata</code>, which is implemented
|
|
4
|
-
by the backend to return metadata such as type (file or directory), size,
|
|
5
|
-
timestamps etc.</p>
|
|
6
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">path</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The filesystem path to query metadata for (e.g., <code>/documents/myfile.txt</code>).</p>
|
|
7
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">url</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The full URL of the Xandeum-compatible JSON-RPC endpoint (e.g., <code>'https://api.devnet.solana.com'</code>).</p>
|
|
8
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h4><p>A <code>Promise<any></code> resolving to the parsed JSON response from the RPC server,
|
|
9
|
-
typically containing a <code>result</code> object with metadata fields.</p>
|
|
10
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/Xandeum/test_web3/blob/main/src/getMetadata.ts#L24">getMetadata.ts:24</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">Xandeum Web3 Library - v9.0.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>unsubscribeResult | Xandeum Web3 Library - v9.0.0</title><meta name="description" content="Documentation for Xandeum Web3 Library"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Xandeum Web3 Library - v9.0.0</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">unsubscribeResult</a></li></ul><h1>Function unsubscribeResult</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="unsubscriberesult"><span class="tsd-kind-call-signature">unsubscribeResult</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">subscriptionId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">wsUrl</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#unsubscriberesult" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sends a WebSocket JSON-RPC message to unsubscribe from a previously subscribed transaction result
|
|
2
|
-
using the <code>xandeumResultUnsubscribed</code> method (note: custom method, ensure server-side implementation matches).</p>
|
|
3
|
-
<p>This function automatically closes the WebSocket connection after sending the unsubscribe request.</p>
|
|
4
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">subscriptionId</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The ID of the active subscription you want to cancel.</p>
|
|
5
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">wsUrl</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The WebSocket endpoint (e.g., <code>wss://...</code>) to connect to for unsubscribing.</p>
|
|
6
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/Xandeum/test_web3/blob/main/src/webSocket.ts#L86">webSocket.ts:86</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">Xandeum Web3 Library - v9.0.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
package/docs/index.html
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="./"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Xandeum Web3 Library - v9.0.0</title><meta name="description" content="Documentation for Xandeum Web3 Library"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="index.html" class="title">Xandeum Web3 Library - v9.0.0</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h1>Xandeum Web3 Library - v9.0.0</h1></div><div class="tsd-panel tsd-typography"><p>#Xandeum Web3.js</p>
|
|
2
|
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">Xandeum Web3 Library - v9.0.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|