xpi-ts 0.2.22 → 0.2.24
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/dist/cjs/lib/bitcore/crypto/point.js +2 -2
- package/dist/cjs/lib/bitcore/index.js +162 -162
- package/dist/esm/lib/bitcore/crypto/point.js +2 -2
- package/dist/esm/lib/bitcore/index.js +42 -42
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/address.d.ts +116 -0
- package/dist/types/lib/bitcore/address.d.ts.map +1 -1
- package/dist/types/lib/bitcore/block/block.d.ts +214 -0
- package/dist/types/lib/bitcore/block/block.d.ts.map +1 -1
- package/dist/types/lib/bitcore/block/blockheader.d.ts +220 -0
- package/dist/types/lib/bitcore/block/blockheader.d.ts.map +1 -1
- package/dist/types/lib/bitcore/block/merkleblock.d.ts +206 -0
- package/dist/types/lib/bitcore/block/merkleblock.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/bn.d.ts +224 -0
- package/dist/types/lib/bitcore/crypto/bn.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/ecdsa.d.ts +122 -0
- package/dist/types/lib/bitcore/crypto/ecdsa.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/hash.d.ts +56 -0
- package/dist/types/lib/bitcore/crypto/hash.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/index.d.ts +4 -0
- package/dist/types/lib/bitcore/crypto/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/musig2.d.ts +282 -0
- package/dist/types/lib/bitcore/crypto/musig2.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/point.d.ts +87 -0
- package/dist/types/lib/bitcore/crypto/point.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/random.d.ts +48 -0
- package/dist/types/lib/bitcore/crypto/random.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/schnorr.d.ts +203 -0
- package/dist/types/lib/bitcore/crypto/schnorr.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/signature.d.ts +452 -0
- package/dist/types/lib/bitcore/crypto/signature.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/sigtype.d.ts +46 -0
- package/dist/types/lib/bitcore/crypto/sigtype.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/base58.d.ts +68 -0
- package/dist/types/lib/bitcore/encoding/base58.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/base58check.d.ts +58 -0
- package/dist/types/lib/bitcore/encoding/base58check.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/bufferreader.d.ts +112 -0
- package/dist/types/lib/bitcore/encoding/bufferreader.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/bufferwriter.d.ts +144 -0
- package/dist/types/lib/bitcore/encoding/bufferwriter.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/varint.d.ts +86 -0
- package/dist/types/lib/bitcore/encoding/varint.d.ts.map +1 -1
- package/dist/types/lib/bitcore/errors.d.ts +4 -0
- package/dist/types/lib/bitcore/errors.d.ts.map +1 -1
- package/dist/types/lib/bitcore/hdprivatekey.d.ts +59 -0
- package/dist/types/lib/bitcore/hdprivatekey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/hdpublickey.d.ts +145 -0
- package/dist/types/lib/bitcore/hdpublickey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/index.d.ts +58 -54
- package/dist/types/lib/bitcore/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/message.d.ts +63 -0
- package/dist/types/lib/bitcore/message.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/errors.d.ts +4 -0
- package/dist/types/lib/bitcore/mnemonic/errors.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/index.d.ts +4 -0
- package/dist/types/lib/bitcore/mnemonic/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/mnemonic.d.ts +106 -0
- package/dist/types/lib/bitcore/mnemonic/mnemonic.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/pbkdf2.d.ts +13 -0
- package/dist/types/lib/bitcore/mnemonic/pbkdf2.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/words/english.d.ts +4 -0
- package/dist/types/lib/bitcore/mnemonic/words/english.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/words/french.d.ts +5 -0
- package/dist/types/lib/bitcore/mnemonic/words/french.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/words/index.d.ts +4 -0
- package/dist/types/lib/bitcore/mnemonic/words/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/musig2/index.d.ts +14 -0
- package/dist/types/lib/bitcore/musig2/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/musig2/session.d.ts +254 -0
- package/dist/types/lib/bitcore/musig2/session.d.ts.map +1 -1
- package/dist/types/lib/bitcore/musig2/signer.d.ts +212 -0
- package/dist/types/lib/bitcore/musig2/signer.d.ts.map +1 -1
- package/dist/types/lib/bitcore/networks.d.ts +17 -0
- package/dist/types/lib/bitcore/networks.d.ts.map +1 -1
- package/dist/types/lib/bitcore/opcode.d.ts +151 -0
- package/dist/types/lib/bitcore/opcode.d.ts.map +1 -1
- package/dist/types/lib/bitcore/privatekey.d.ts +80 -0
- package/dist/types/lib/bitcore/privatekey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/publickey.d.ts +195 -0
- package/dist/types/lib/bitcore/publickey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/chunk.d.ts +51 -0
- package/dist/types/lib/bitcore/script/chunk.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/condition-stack.d.ts +60 -0
- package/dist/types/lib/bitcore/script/interpreter/condition-stack.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/index.d.ts +23 -0
- package/dist/types/lib/bitcore/script/interpreter/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/interpreter.d.ts +86 -0
- package/dist/types/lib/bitcore/script/interpreter/interpreter.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/script-num.d.ts +115 -0
- package/dist/types/lib/bitcore/script/interpreter/script-num.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/types.d.ts +119 -0
- package/dist/types/lib/bitcore/script/interpreter/types.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/taproot.d.ts +297 -0
- package/dist/types/lib/bitcore/script/taproot.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script.d.ts +510 -0
- package/dist/types/lib/bitcore/script.d.ts.map +1 -1
- package/dist/types/lib/bitcore/taproot/musig2.d.ts +153 -0
- package/dist/types/lib/bitcore/taproot/musig2.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/multisig.d.ts +8 -0
- package/dist/types/lib/bitcore/transaction/input/multisig.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/multisigscripthash.d.ts +8 -0
- package/dist/types/lib/bitcore/transaction/input/multisigscripthash.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/publickey.d.ts +8 -0
- package/dist/types/lib/bitcore/transaction/input/publickey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/publickeyhash.d.ts +14 -0
- package/dist/types/lib/bitcore/transaction/input/publickeyhash.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/taproot.d.ts +22 -0
- package/dist/types/lib/bitcore/transaction/input/taproot.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input.d.ts +418 -0
- package/dist/types/lib/bitcore/transaction/input.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/outpoint.d.ts +110 -0
- package/dist/types/lib/bitcore/transaction/outpoint.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/output.d.ts +83 -0
- package/dist/types/lib/bitcore/transaction/output.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/sighash.d.ts +69 -0
- package/dist/types/lib/bitcore/transaction/sighash.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/signature.d.ts +98 -0
- package/dist/types/lib/bitcore/transaction/signature.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/transaction.d.ts +379 -0
- package/dist/types/lib/bitcore/transaction/transaction.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/unspentoutput.d.ts +61 -0
- package/dist/types/lib/bitcore/transaction/unspentoutput.d.ts.map +1 -1
- package/dist/types/lib/bitcore/unit.d.ts +140 -0
- package/dist/types/lib/bitcore/unit.d.ts.map +1 -1
- package/dist/types/lib/bitcore/uri.d.ts +34 -0
- package/dist/types/lib/bitcore/uri.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/base32.d.ts +55 -0
- package/dist/types/lib/bitcore/util/base32.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/bits.d.ts +76 -0
- package/dist/types/lib/bitcore/util/bits.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/buffer.d.ts +135 -0
- package/dist/types/lib/bitcore/util/buffer.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/convertBits.d.ts +15 -0
- package/dist/types/lib/bitcore/util/convertBits.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/js.d.ts +19 -0
- package/dist/types/lib/bitcore/util/js.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/merkle.d.ts +85 -0
- package/dist/types/lib/bitcore/util/merkle.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/preconditions.d.ts +29 -0
- package/dist/types/lib/bitcore/util/preconditions.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util.d.ts +7 -0
- package/dist/types/lib/bitcore/util.d.ts.map +1 -1
- package/dist/types/lib/bitcore/xaddress.d.ts +117 -0
- package/dist/types/lib/bitcore/xaddress.d.ts.map +1 -1
- package/dist/types/lib/lokad.d.ts +292 -0
- package/dist/types/lib/lokad.d.ts.map +1 -1
- package/dist/types/lib/nft.d.ts +434 -0
- package/dist/types/lib/nft.d.ts.map +1 -1
- package/dist/types/lib/rank/api.d.ts +13 -0
- package/dist/types/lib/rank/api.d.ts.map +1 -1
- package/dist/types/lib/rank/index.d.ts +153 -0
- package/dist/types/lib/rank/index.d.ts.map +1 -1
- package/dist/types/lib/rank/opcode.d.ts +6 -2
- package/dist/types/lib/rank/opcode.d.ts.map +1 -1
- package/dist/types/lib/rank/script.d.ts +10 -0
- package/dist/types/lib/rank/script.d.ts.map +1 -1
- package/dist/types/lib/rank/transaction.d.ts +11 -0
- package/dist/types/lib/rank/transaction.d.ts.map +1 -1
- package/dist/types/lib/rpc.d.ts +176 -0
- package/dist/types/lib/rpc.d.ts.map +1 -1
- package/dist/types/utils/constants.d.ts +27 -0
- package/dist/types/utils/constants.d.ts.map +1 -1
- package/dist/types/utils/env.d.ts +15 -0
- package/dist/types/utils/env.d.ts.map +1 -1
- package/dist/types/utils/string.d.ts +57 -0
- package/dist/types/utils/string.d.ts.map +1 -1
- package/dist/types/utils/wallet.d.ts +43 -1
- package/dist/types/utils/wallet.d.ts.map +1 -1
- package/package.json +1 -1
- package/tsconfig.types.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../lib/rank/api.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AACD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../lib/rank/api.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAA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ewardship
|
|
4
|
+
* License: MIT
|
|
5
|
+
*/
|
|
1
6
|
import { Buffer } from 'buffer/';
|
|
2
7
|
import OpCode from './opcode.js';
|
|
3
8
|
export type ScriptChunkLokadUTF8 = 'RANK' | 'RNKC';
|
|
@@ -8,32 +13,50 @@ export type ScriptChunkPlatformMap = Map<number, ScriptChunkPlatformUTF8>;
|
|
|
8
13
|
export type ScriptChunkSentimentMap = Map<number, ScriptChunkSentimentUTF8>;
|
|
9
14
|
export type ScriptChunkField = 'sentiment' | 'platform' | 'profileId' | 'postId' | 'comment' | 'postHash' | 'instanceId';
|
|
10
15
|
export type ScriptChunk = {
|
|
16
|
+
/** Byte offset of the chunk in the output script */
|
|
11
17
|
offset: number | null;
|
|
18
|
+
/** Byte length of the chunk in the output script */
|
|
12
19
|
len: number | null;
|
|
20
|
+
/** Map of supported RANK script chunks */
|
|
13
21
|
map?: ScriptChunkLokadMap | ScriptChunkPlatformMap | ScriptChunkSentimentMap;
|
|
14
22
|
};
|
|
23
|
+
/** Required RNKC script chunks */
|
|
15
24
|
export type ScriptChunksRNKC = {
|
|
16
25
|
[name in Exclude<ScriptChunkField, 'sentiment' | 'postHash' | 'instanceId'>]: ScriptChunk;
|
|
17
26
|
};
|
|
27
|
+
/** Required RANK script chunks */
|
|
18
28
|
export type ScriptChunksRANK = {
|
|
19
29
|
[name in Exclude<ScriptChunkField, 'comment' | 'postId' | 'postHash' | 'instanceId'>]: ScriptChunk;
|
|
20
30
|
};
|
|
31
|
+
/** Optional RANK script chunks */
|
|
21
32
|
export type ScriptChunksOptionalRANK = {
|
|
22
33
|
[name in Extract<ScriptChunkField, 'postId' | 'postHash' | 'instanceId'>]: ScriptChunk;
|
|
23
34
|
};
|
|
35
|
+
/** OP_RETURN \<RANK\> \<sentiment\> \<profileId\> [\<postId\> \<postHash\> [\<instanceId\>]] */
|
|
24
36
|
export type TransactionOutputRANK = {
|
|
37
|
+
/** positive or negative sentiment (can support more) */
|
|
25
38
|
sentiment: ScriptChunkSentimentUTF8;
|
|
39
|
+
/** e.g. Twitter/X.com, etc. */
|
|
26
40
|
platform: ScriptChunkPlatformUTF8;
|
|
41
|
+
/** who the ranking is for */
|
|
27
42
|
profileId: string;
|
|
43
|
+
/** optional post ID if ranking specific content */
|
|
28
44
|
postId?: string;
|
|
29
45
|
};
|
|
46
|
+
/** OP_RETURN \<RNKC\> \<platform\> \<profileId\> \<postId\> */
|
|
30
47
|
export type TransactionOutputRNKC = {
|
|
48
|
+
/** outIdx 1 and 2 concatenated as comment data in UTF-8 encoding */
|
|
31
49
|
data: Uint8Array;
|
|
50
|
+
/** Minimum fee rate for accepting RNKC transaction, in satoshis per byte */
|
|
32
51
|
feeRate: number;
|
|
52
|
+
/** e.g. Twitter/X.com, etc. */
|
|
33
53
|
inReplyToPlatform: ScriptChunkPlatformUTF8;
|
|
54
|
+
/** who the comment is replying to */
|
|
34
55
|
inReplyToProfileId?: string;
|
|
56
|
+
/** ID of the post being replied to */
|
|
35
57
|
inReplyToPostId?: string;
|
|
36
58
|
};
|
|
59
|
+
/** Transaction data for the backend indexer */
|
|
37
60
|
export type Transaction = {
|
|
38
61
|
txid: string;
|
|
39
62
|
outIdx: number;
|
|
@@ -44,8 +67,11 @@ export type Transaction = {
|
|
|
44
67
|
height?: number;
|
|
45
68
|
timestamp?: bigint;
|
|
46
69
|
};
|
|
70
|
+
/** RANK transaction data for the backend indexer */
|
|
47
71
|
export type TransactionRANK = TransactionOutputRANK & Transaction;
|
|
72
|
+
/** RNKC transaction data for the backend indexer */
|
|
48
73
|
export type TransactionRNKC = TransactionOutputRNKC & Transaction;
|
|
74
|
+
/** Target entity being ranked by a RANK transaction, commented on by an RNKC transaction, etc. (e.g. Profile, Post, etc.) */
|
|
49
75
|
export type TargetEntity = {
|
|
50
76
|
id: string;
|
|
51
77
|
platform: string;
|
|
@@ -57,15 +83,24 @@ export type TargetEntity = {
|
|
|
57
83
|
votesPositive: number;
|
|
58
84
|
votesNegative: number;
|
|
59
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* `IndexedTransactionRANK` objects are converted to a `ProfileMap` for database ops
|
|
88
|
+
*
|
|
89
|
+
* `string` is `profileId`
|
|
90
|
+
*/
|
|
60
91
|
export type ProfileMap = Map<string, Profile>;
|
|
61
92
|
export type PostMap = Map<string, Post>;
|
|
93
|
+
/** */
|
|
62
94
|
export type Profile = TargetEntity & {
|
|
63
95
|
posts?: PostMap;
|
|
64
96
|
};
|
|
97
|
+
/** */
|
|
65
98
|
export type Post = TargetEntity & {
|
|
66
99
|
profileId: string;
|
|
100
|
+
/** If this post is a RNKC transaction, this is set for establishing relation to `RankComment` */
|
|
67
101
|
data?: Uint8Array;
|
|
68
102
|
};
|
|
103
|
+
/** Platform parameters */
|
|
69
104
|
export type PlatformParameters = {
|
|
70
105
|
profileId: {
|
|
71
106
|
len: number;
|
|
@@ -77,49 +112,167 @@ export type PlatformParameters = {
|
|
|
77
112
|
type: 'BigInt' | 'Number' | 'String';
|
|
78
113
|
};
|
|
79
114
|
};
|
|
115
|
+
/** LOKAD chunk map */
|
|
80
116
|
export declare const LOKAD_PREFIX_RANK = 1380011595;
|
|
81
117
|
export declare const LOKAD_PREFIX_RNKC = 1380862787;
|
|
82
118
|
export declare const SCRIPT_CHUNK_LOKAD: ScriptChunkLokadMap;
|
|
83
119
|
export declare const RANK_SENTIMENT_NEUTRAL = OpCode.OP_16;
|
|
84
120
|
export declare const RANK_SENTIMENT_POSITIVE = OpCode.OP_1;
|
|
85
121
|
export declare const RANK_SENTIMENT_NEGATIVE = OpCode.OP_0;
|
|
122
|
+
/** Sentiment chunk map */
|
|
86
123
|
export declare const SCRIPT_CHUNK_SENTIMENT: ScriptChunkSentimentMap;
|
|
124
|
+
/** Sentiment OP code map */
|
|
87
125
|
export declare const RANK_SENTIMENT_OP_CODES: Map<ScriptChunkSentimentUTF8, string>;
|
|
126
|
+
/** Platform chunk map */
|
|
88
127
|
export declare const SCRIPT_CHUNK_PLATFORM: ScriptChunkPlatformMap;
|
|
128
|
+
/** Required RANK Comment script chunks */
|
|
89
129
|
export declare const ScriptChunksRNKCMap: Map<keyof ScriptChunksRNKC, ScriptChunk>;
|
|
130
|
+
/** Length of the required RANK script chunks in bytes */
|
|
90
131
|
export declare const RANK_SCRIPT_REQUIRED_LENGTH = 10;
|
|
132
|
+
/** Required RANK script chunks */
|
|
91
133
|
export declare const ScriptChunksRANKMap: Map<keyof ScriptChunksRANK, ScriptChunk>;
|
|
92
134
|
export declare const ScriptChunksOptionalRANKMap: Map<keyof ScriptChunksOptionalRANK, ScriptChunk>;
|
|
135
|
+
/** Platform configuration */
|
|
93
136
|
export declare const PlatformConfiguration: Map<ScriptChunkPlatformUTF8, PlatformParameters>;
|
|
137
|
+
/**
|
|
138
|
+
* RANK script utilities
|
|
139
|
+
*/
|
|
140
|
+
/**
|
|
141
|
+
* Convert the profile ID to a buffer
|
|
142
|
+
* @param platform - The platform to convert the profile ID for
|
|
143
|
+
* @param profileId - The profile ID to convert
|
|
144
|
+
* @returns The profile ID buffer
|
|
145
|
+
*/
|
|
94
146
|
export declare function toProfileIdBuf(platform: ScriptChunkPlatformUTF8, profileId: string): Buffer | null;
|
|
147
|
+
/**
|
|
148
|
+
* Convert the `OP_RETURN` profile name back to UTF-8 with null bytes removed
|
|
149
|
+
* @param profileIdBuf - The profile ID buffer to convert, padded with null bytes
|
|
150
|
+
* @returns The UTF-8 profile ID
|
|
151
|
+
*/
|
|
95
152
|
export declare function toProfileIdUTF8(profileIdBuf: Buffer): string;
|
|
153
|
+
/**
|
|
154
|
+
* Convert the post ID to a buffer
|
|
155
|
+
* @param platform - The platform to convert the post ID for
|
|
156
|
+
* @param postId - The post ID to convert
|
|
157
|
+
* @returns The post ID buffer
|
|
158
|
+
*/
|
|
96
159
|
export declare function toPostIdBuf(platform: ScriptChunkPlatformUTF8, postId: string): Buffer | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* Convert the UTF-8 platform name to the defined 1-byte platform hex code
|
|
162
|
+
* @param platform
|
|
163
|
+
* @returns
|
|
164
|
+
*/
|
|
97
165
|
export declare function toPlatformBuf(platform: ScriptChunkPlatformUTF8): Buffer | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Convert the defined 1-byte platform hex code to the UTF-8 platform name
|
|
168
|
+
* @param platformBuf
|
|
169
|
+
*/
|
|
98
170
|
export declare function toPlatformUTF8(platformBuf: Buffer): ScriptChunkPlatformUTF8 | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* Convert the UTF-8 sentiment name to the defined 1-byte OP code
|
|
173
|
+
* @param sentiment
|
|
174
|
+
* @returns
|
|
175
|
+
*/
|
|
99
176
|
export declare function toSentimentOpCode(sentiment: ScriptChunkSentimentUTF8): string | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* Convert the defined 1-byte sentiment OP code to the UTF-8 sentiment name
|
|
179
|
+
* @param sentimentBuf
|
|
180
|
+
*/
|
|
100
181
|
export declare function toSentimentUTF8(sentimentBuf: Buffer): ScriptChunkSentimentUTF8 | undefined;
|
|
182
|
+
/**
|
|
183
|
+
* Convert the comment buffer to a UTF-8 string
|
|
184
|
+
* @param commentBuf - The comment buffer to convert
|
|
185
|
+
* @returns The UTF-8 string
|
|
186
|
+
*/
|
|
101
187
|
export declare function toCommentUTF8(commentBuf: Buffer | Uint8Array): string | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* Create a hex-encoded RANK script from the given parameters
|
|
190
|
+
* @param sentiment - The sentiment to use
|
|
191
|
+
* @param platform - The platform to use
|
|
192
|
+
* @param profileId - The profile ID to use
|
|
193
|
+
* @param postId - The post ID to use
|
|
194
|
+
* @returns The hex-encoded RANK script, as `Buffer`
|
|
195
|
+
*/
|
|
102
196
|
export declare function toScriptRANK(sentiment: ScriptChunkSentimentUTF8, platform: ScriptChunkPlatformUTF8, profileId: string, postId?: string): Buffer;
|
|
197
|
+
/**
|
|
198
|
+
* Create a hex-encoded RANK Comment script from the given parameters
|
|
199
|
+
*
|
|
200
|
+
* RNKC requires 2 output scripts at minimum, so we return output scripts in an
|
|
201
|
+
* array of `Buffer` objects according to outIdx.
|
|
202
|
+
* @param platform - The platform to use
|
|
203
|
+
* @param profileId - The profile ID to use
|
|
204
|
+
* @param postId - The post ID to use
|
|
205
|
+
* @param comment - The comment to use
|
|
206
|
+
* @returns The hex-encoded RANK Comment script
|
|
207
|
+
*/
|
|
103
208
|
export declare function toScriptRNKC({ platform, profileId, postId, comment, }: {
|
|
104
209
|
platform: ScriptChunkPlatformUTF8;
|
|
105
210
|
profileId: string;
|
|
106
211
|
postId?: string;
|
|
107
212
|
comment: string;
|
|
108
213
|
}): Buffer[];
|
|
214
|
+
/**
|
|
215
|
+
* Processor for defined LOKAD protocols (RANK, RNKC, etc.)
|
|
216
|
+
* @param script - The script to process, as a `Buffer`
|
|
217
|
+
*/
|
|
109
218
|
export declare class ScriptProcessor {
|
|
110
219
|
private chunks;
|
|
220
|
+
/** The script to process, as a `Buffer` */
|
|
111
221
|
private script;
|
|
222
|
+
/** Supplemental scripts, e.g. outIdx 1 and/or 2 for RNKC */
|
|
112
223
|
private supplementalScripts;
|
|
113
224
|
constructor(script: Buffer);
|
|
225
|
+
/**
|
|
226
|
+
* Add a supplemental OP_RETURN script to the processor
|
|
227
|
+
* @param script - The script to add, as a `Buffer`
|
|
228
|
+
* @returns true if the script was added, false otherwise
|
|
229
|
+
*/
|
|
114
230
|
addScript(script: string | Buffer): boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Get the LOKAD type from the script
|
|
233
|
+
* @returns The LOKAD type or undefined if invalid
|
|
234
|
+
*/
|
|
115
235
|
get lokadType(): ScriptChunkLokadUTF8 | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* Process the LOKAD chunk
|
|
238
|
+
* @returns The LOKAD value or undefined if invalid
|
|
239
|
+
*/
|
|
116
240
|
private processLokad;
|
|
241
|
+
/**
|
|
242
|
+
* Process the sentiment chunk (RANK)
|
|
243
|
+
* @returns The sentiment value or undefined if invalid
|
|
244
|
+
*/
|
|
117
245
|
private processSentiment;
|
|
246
|
+
/**
|
|
247
|
+
* Process the platform chunk
|
|
248
|
+
* @returns The platform value or undefined if invalid
|
|
249
|
+
*/
|
|
118
250
|
private processPlatform;
|
|
251
|
+
/**
|
|
252
|
+
* Process the profileId chunk
|
|
253
|
+
* @returns The profileId value or undefined if invalid
|
|
254
|
+
*/
|
|
119
255
|
private processProfileId;
|
|
256
|
+
/**
|
|
257
|
+
* Process the postId chunk
|
|
258
|
+
* @returns The postId value or undefined if invalid
|
|
259
|
+
*/
|
|
120
260
|
private processPostId;
|
|
261
|
+
/**
|
|
262
|
+
* Process the RNKC comment chunks (outIdx 1 and 2)
|
|
263
|
+
* @param scripts - outIdx 1 and 2 scripts, if outIdx 0 is RNKC
|
|
264
|
+
* @returns The comment value or null if invalid
|
|
265
|
+
*/
|
|
121
266
|
private processComment;
|
|
267
|
+
/**
|
|
268
|
+
* Validate the required RANK chunks and store the processed output
|
|
269
|
+
* @returns true if all required chunks are valid, false otherwise
|
|
270
|
+
*/
|
|
122
271
|
processScriptRANK(): TransactionOutputRANK | null;
|
|
272
|
+
/**
|
|
273
|
+
* Validate the required RNKC chunks and store the processed output
|
|
274
|
+
* @returns true if all required chunks are valid, false otherwise
|
|
275
|
+
*/
|
|
123
276
|
processScriptRNKC(burnedSats: number | bigint, options?: {
|
|
124
277
|
minDataLength: number;
|
|
125
278
|
minFeeRate: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/rank/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/rank/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAOhC,OAAO,MAAM,MAAM,aAAa,CAAA;AAGhC,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAA;AAClD,MAAM,MAAM,uBAAuB,GA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qBAAqB,GAAG,IAAI;CA4DhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opcode.d.ts","sourceRoot":"","sources":["../../../../lib/rank/opcode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"opcode.d.ts","sourceRoot":"","sources":["../../../../lib/rank/opcode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,aAAK,MAAM;IACT,SAAS,MAAO;IAChB,YAAY,KAAO;IAEnB,IAAI,IAAO,CAAE,WAAW;IACxB,IAAI,KAAO,CAAE,WAAW;IACxB,IAAI,KAAO;IACX,IAAI,KAAO;IACX,IAAI,KAAO;IACX,IAAI,KAAO;IACX,IAAI,KAAO;IACX,IAAI,KAAO;IACX,IAAI,KAAO;IACX,IAAI,KAAO;IACX,KAAK,KAAO;IACZ,KAAK,KAAO;IACZ,KAAK,KAAO;IACZ,KAAK,KAAO;IACZ,KAAK,KAAO;IACZ,KAAK,KAAO;IACZ,KAAK,KAAO;CACb;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 The Lotusia Stewardship
|
|
3
|
+
* Github: https://github.com/LotusiaStewardship
|
|
4
|
+
* License: MIT
|
|
5
|
+
*/
|
|
1
6
|
import { Buffer } from 'buffer/';
|
|
7
|
+
/**
|
|
8
|
+
* Check provided script for OP_RETURN op code
|
|
9
|
+
* @param script - The script to check, as a `Buffer` or hex `string`
|
|
10
|
+
* @returns true if the output is an OP_RETURN, false otherwise
|
|
11
|
+
*/
|
|
2
12
|
export declare function isOpReturn(script: Buffer | string): boolean;
|
|
3
13
|
//# sourceMappingURL=script.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../../lib/rank/script.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../../lib/rank/script.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIhC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAK3D"}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 The Lotusia Stewardship
|
|
3
|
+
* Github: https://github.com/LotusiaStewardship
|
|
4
|
+
* License: MIT
|
|
5
|
+
*/
|
|
1
6
|
import { Buffer } from 'buffer/';
|
|
2
7
|
import { Transaction } from '../bitcore/transaction/index.js';
|
|
3
8
|
export declare function processTransaction(tx: Transaction | Buffer | string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Convert a bitcore transaction to an RNKC transaction
|
|
11
|
+
* @param tx - The bitcore transaction to convert
|
|
12
|
+
* @param scriptProcessor - Optional instantiated `ScriptProcessor` for the transaction
|
|
13
|
+
* @returns The RNKC transaction, ready to be indexed
|
|
14
|
+
*/
|
|
4
15
|
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../../lib/rank/transaction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../../lib/rank/transaction.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAG7D,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,QAUnE;AACD;;;;;GAKG"}
|
package/dist/types/lib/rpc.d.ts
CHANGED
|
@@ -1,136 +1,312 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RPC daemon configuration
|
|
3
|
+
*/
|
|
1
4
|
export interface RPCConfig {
|
|
5
|
+
/** Username for RPC authentication */
|
|
2
6
|
user: string;
|
|
7
|
+
/** Password for RPC authentication */
|
|
3
8
|
password: string;
|
|
9
|
+
/** RPC daemon address (hostname or IP) */
|
|
4
10
|
address: string;
|
|
11
|
+
/** RPC daemon port number */
|
|
5
12
|
port: number;
|
|
6
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Network information returned by the RPC daemon
|
|
16
|
+
*/
|
|
7
17
|
export interface NetworkInfo {
|
|
18
|
+
/** Subversion string */
|
|
8
19
|
subversion: string;
|
|
20
|
+
/** Whether local relay is enabled */
|
|
9
21
|
localrelay: boolean;
|
|
22
|
+
/** Number of connections */
|
|
10
23
|
connections: number;
|
|
24
|
+
/** Number of inbound connections */
|
|
11
25
|
connections_in: number;
|
|
26
|
+
/** Network warnings if any */
|
|
12
27
|
warnings: string;
|
|
13
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Mining information returned by the RPC daemon
|
|
31
|
+
*/
|
|
14
32
|
export interface MiningInfo {
|
|
33
|
+
/** Current block height */
|
|
15
34
|
blocks: number;
|
|
35
|
+
/** Current network difficulty */
|
|
16
36
|
difficulty: number;
|
|
37
|
+
/** Network hash rate in hashes per second */
|
|
17
38
|
networkhashps: number;
|
|
39
|
+
/** Number of transactions in the mempool */
|
|
18
40
|
pooledtx: number;
|
|
41
|
+
/** Blockchain name (e.g., "main", "test", "regtest") */
|
|
19
42
|
chain: string;
|
|
43
|
+
/** Network warnings if any */
|
|
20
44
|
warnings: string;
|
|
21
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Mempool information returned by the RPC daemon
|
|
48
|
+
*/
|
|
22
49
|
export interface MempoolInfo {
|
|
50
|
+
/** Whether the mempool is loaded */
|
|
23
51
|
loaded: boolean;
|
|
52
|
+
/** Number of transactions in mempool */
|
|
24
53
|
size: number;
|
|
54
|
+
/** Total size of mempool in bytes */
|
|
25
55
|
bytes: number;
|
|
56
|
+
/** Memory usage in bytes */
|
|
26
57
|
usage: number;
|
|
58
|
+
/** Maximum mempool size in bytes */
|
|
27
59
|
maxmempool: number;
|
|
60
|
+
/** Minimum fee rate for mempool transactions */
|
|
28
61
|
mempoolminfee: number;
|
|
62
|
+
/** Minimum relay fee rate */
|
|
29
63
|
minrelaytxfee: number;
|
|
64
|
+
/** Number of unbroadcast transactions */
|
|
30
65
|
unbroadcastcount: number;
|
|
31
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Peer connection information returned by the RPC daemon
|
|
69
|
+
*/
|
|
32
70
|
export interface PeerInfo {
|
|
71
|
+
/** Peer address and port */
|
|
33
72
|
addr: string;
|
|
73
|
+
/** Peer services as hex string */
|
|
34
74
|
services: string;
|
|
75
|
+
/** Array of service names */
|
|
35
76
|
servicesnames: Array<string>;
|
|
77
|
+
/** Whether peer relays transactions */
|
|
36
78
|
relaytxes: boolean;
|
|
79
|
+
/** Timestamp of last sent message */
|
|
37
80
|
lastsend: number;
|
|
81
|
+
/** Timestamp of last received message */
|
|
38
82
|
lastrecv: number;
|
|
83
|
+
/** Timestamp of last transaction */
|
|
39
84
|
last_transaction: number;
|
|
85
|
+
/** Timestamp of last proof */
|
|
40
86
|
last_proof: number;
|
|
87
|
+
/** Timestamp of last block */
|
|
41
88
|
last_block: number;
|
|
89
|
+
/** Total bytes sent to peer */
|
|
42
90
|
bytessent: number;
|
|
91
|
+
/** Total bytes received from peer */
|
|
43
92
|
bytesrecv: number;
|
|
93
|
+
/** Connection time timestamp */
|
|
44
94
|
conntime: number;
|
|
95
|
+
/** Time offset in seconds */
|
|
45
96
|
timeoffset: number;
|
|
97
|
+
/** Current ping time in seconds */
|
|
46
98
|
pingtime: number;
|
|
99
|
+
/** Minimum ping time in seconds */
|
|
47
100
|
minping: number;
|
|
101
|
+
/** Protocol version */
|
|
48
102
|
version: number;
|
|
103
|
+
/** User agent string */
|
|
49
104
|
subver: string;
|
|
105
|
+
/** Whether connection is inbound */
|
|
50
106
|
inbound: boolean;
|
|
107
|
+
/** Starting block height */
|
|
51
108
|
startingheight: number;
|
|
109
|
+
/** Number of synced headers */
|
|
52
110
|
synced_headers: number;
|
|
111
|
+
/** Number of synced blocks */
|
|
53
112
|
synced_blocks: number;
|
|
113
|
+
/** GeoIP data */
|
|
54
114
|
geoip?: {
|
|
55
115
|
country: string;
|
|
56
116
|
city: string;
|
|
57
117
|
};
|
|
58
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Block statistics returned by the RPC daemon
|
|
121
|
+
*/
|
|
59
122
|
export interface BlockStats {
|
|
123
|
+
/** Average fee in the block */
|
|
60
124
|
avgfee: number;
|
|
125
|
+
/** Average fee rate in the block */
|
|
61
126
|
avgfeerate: number;
|
|
127
|
+
/** Average transaction size in the block */
|
|
62
128
|
avgtxsize: number;
|
|
129
|
+
/** Block hash */
|
|
63
130
|
blockhash: string;
|
|
131
|
+
/** Fee rate percentiles */
|
|
64
132
|
feerate_percentiles: Array<number>;
|
|
133
|
+
/** Block height */
|
|
65
134
|
height: number;
|
|
135
|
+
/** Number of inputs */
|
|
66
136
|
ins: number;
|
|
137
|
+
/** Maximum fee in the block */
|
|
67
138
|
maxfee: number;
|
|
139
|
+
/** Maximum fee rate in the block */
|
|
68
140
|
maxfeerate: number;
|
|
141
|
+
/** Maximum transaction size in the block */
|
|
69
142
|
maxtxsize: number;
|
|
143
|
+
/** Median fee in the block */
|
|
70
144
|
medianfee: number;
|
|
145
|
+
/** Median fee rate in the block */
|
|
71
146
|
medianfeerate: number;
|
|
147
|
+
/** Median transaction size in the block */
|
|
72
148
|
mediantxsize: number;
|
|
149
|
+
/** Minimum fee rate in the block */
|
|
73
150
|
minfeerate: number;
|
|
151
|
+
/** Minimum transaction size in the block */
|
|
74
152
|
mintxsize: number;
|
|
153
|
+
/** Number of outputs */
|
|
75
154
|
notx: number;
|
|
155
|
+
/** Number of outputs */
|
|
76
156
|
outs: number;
|
|
157
|
+
/** Block subsidy */
|
|
77
158
|
subsidy: number;
|
|
159
|
+
/** Block timestamp */
|
|
78
160
|
time: number;
|
|
161
|
+
/** Total output value */
|
|
79
162
|
total_out: number;
|
|
163
|
+
/** Total block size */
|
|
80
164
|
total_size: number;
|
|
165
|
+
/** Total fees in the block */
|
|
81
166
|
totalfee: number;
|
|
167
|
+
/** Number of transactions */
|
|
82
168
|
txs: number;
|
|
169
|
+
/** UTXO increase count */
|
|
83
170
|
utxo_increase: number;
|
|
171
|
+
/** UTXO size increase */
|
|
84
172
|
utxo_size_inc: number;
|
|
85
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Block information returned by the RPC daemon
|
|
176
|
+
*/
|
|
86
177
|
export interface BlockInfo {
|
|
178
|
+
/** Block hash */
|
|
87
179
|
hash: string;
|
|
180
|
+
/** Number of confirmations */
|
|
88
181
|
confirmations: number;
|
|
182
|
+
/** Block size in bytes */
|
|
89
183
|
size: number;
|
|
184
|
+
/** Block height */
|
|
90
185
|
height: number;
|
|
186
|
+
/** Array of transaction IDs */
|
|
91
187
|
tx: Array<string>;
|
|
188
|
+
/** Block timestamp */
|
|
92
189
|
time: number;
|
|
190
|
+
/** Block difficulty */
|
|
93
191
|
difficulty: number;
|
|
192
|
+
/** Number of transactions */
|
|
94
193
|
nTx: number;
|
|
194
|
+
/** Previous block hash */
|
|
95
195
|
previousblockhash: string;
|
|
196
|
+
/** Next block hash */
|
|
96
197
|
nextblockhash: string;
|
|
97
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Transaction input information
|
|
201
|
+
*/
|
|
98
202
|
export interface TransactionInput {
|
|
203
|
+
/** Transaction ID */
|
|
99
204
|
txid: string;
|
|
205
|
+
/** Output index */
|
|
100
206
|
vout: number;
|
|
207
|
+
/** Coinbase transaction data (for coinbase inputs) */
|
|
101
208
|
coinbase?: string;
|
|
102
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Transaction output information
|
|
212
|
+
*/
|
|
103
213
|
export interface TransactionOutput {
|
|
214
|
+
/** Output value in coins */
|
|
104
215
|
value: number;
|
|
216
|
+
/** Script public key information */
|
|
105
217
|
scriptPubKey: {
|
|
218
|
+
/** Array of addresses */
|
|
106
219
|
addresses: Array<string>;
|
|
220
|
+
/** Script type */
|
|
107
221
|
type: string;
|
|
222
|
+
/** Assembly representation */
|
|
108
223
|
asm: string;
|
|
109
224
|
};
|
|
110
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* Raw transaction information returned by the RPC daemon
|
|
228
|
+
*/
|
|
111
229
|
export interface RawTransaction {
|
|
230
|
+
/** Transaction ID */
|
|
112
231
|
txid: string;
|
|
232
|
+
/** Transaction size in bytes */
|
|
113
233
|
size: number;
|
|
234
|
+
/** Array of transaction inputs */
|
|
114
235
|
vin: TransactionInput[];
|
|
236
|
+
/** Array of transaction outputs */
|
|
115
237
|
vout: TransactionOutput[];
|
|
238
|
+
/** Transaction timestamp */
|
|
116
239
|
time?: number;
|
|
240
|
+
/** Block timestamp */
|
|
117
241
|
blocktime?: number;
|
|
242
|
+
/** Block hash containing this transaction */
|
|
118
243
|
blockhash?: string;
|
|
244
|
+
/** Number of confirmations */
|
|
119
245
|
confirmations?: number;
|
|
120
246
|
}
|
|
121
247
|
export declare class RPCClient {
|
|
122
248
|
config: RPCConfig;
|
|
123
249
|
constructor(config: RPCConfig);
|
|
250
|
+
/**
|
|
251
|
+
* Sends an RPC request to the Lotus daemon
|
|
252
|
+
* @param method - The RPC method to call
|
|
253
|
+
* @param params - Array of parameters to pass to the RPC method
|
|
254
|
+
* @returns Promise that resolves to the JSON response from the RPC daemon
|
|
255
|
+
*/
|
|
124
256
|
private sendRPCRequest;
|
|
257
|
+
/**
|
|
258
|
+
* RPC command - `getmininginfo`
|
|
259
|
+
* @returns {Promise<MiningInfo>} Raw mining information
|
|
260
|
+
*/
|
|
125
261
|
getMiningInfo(): Promise<MiningInfo>;
|
|
262
|
+
/**
|
|
263
|
+
* RPC command - `getnetworkinfo`
|
|
264
|
+
* @returns {Promise<NetworkInfo>} Network information
|
|
265
|
+
*/
|
|
126
266
|
getNetworkInfo(): Promise<NetworkInfo>;
|
|
267
|
+
/**
|
|
268
|
+
* RPC command - `getpeerinfo`
|
|
269
|
+
* @returns {Promise<PeerInfo[]>} Array of peer connection information
|
|
270
|
+
*/
|
|
127
271
|
getPeerInfo(): Promise<PeerInfo[]>;
|
|
272
|
+
/**
|
|
273
|
+
* RPC command - `getblockcount`
|
|
274
|
+
* @returns {Promise<number>} Current block count
|
|
275
|
+
*/
|
|
128
276
|
getBlockCount(): Promise<number>;
|
|
277
|
+
/**
|
|
278
|
+
* RPC command - `getblockhash`
|
|
279
|
+
* @param {number} height - Block height
|
|
280
|
+
* @returns {Promise<string>} Block hash for the given height
|
|
281
|
+
*/
|
|
129
282
|
getBlockHash(height: number): Promise<string>;
|
|
283
|
+
/**
|
|
284
|
+
* RPC command - `getblockstats`
|
|
285
|
+
* @param {string} hash - Block hash
|
|
286
|
+
* @returns {Promise<BlockStats>} Block statistics
|
|
287
|
+
*/
|
|
130
288
|
getBlockStats(hash: string): Promise<BlockStats>;
|
|
289
|
+
/**
|
|
290
|
+
* RPC command - `getblock`
|
|
291
|
+
* @param {string} hash - Block hash
|
|
292
|
+
* @returns {Promise<BlockInfo>} Block information
|
|
293
|
+
*/
|
|
131
294
|
getBlock(hash: string): Promise<BlockInfo>;
|
|
295
|
+
/**
|
|
296
|
+
* RPC command - `getrawtransaction`
|
|
297
|
+
* @param {string} txid - Transaction ID
|
|
298
|
+
* @returns {Promise<RawTransaction>} Raw transaction information
|
|
299
|
+
*/
|
|
132
300
|
getRawTransaction(txid: string): Promise<RawTransaction>;
|
|
301
|
+
/**
|
|
302
|
+
* RPC command - `getrawmempool`
|
|
303
|
+
* @returns {Promise<string[]>} Array of transaction IDs in mempool
|
|
304
|
+
*/
|
|
133
305
|
getRawMemPool(): Promise<string[]>;
|
|
306
|
+
/**
|
|
307
|
+
* RPC command - `getmempoolinfo`
|
|
308
|
+
* @returns {Promise<MempoolInfo>} Mempool information
|
|
309
|
+
*/
|
|
134
310
|
getMempoolInfo(): Promise<MempoolInfo>;
|
|
135
311
|
}
|
|
136
312
|
//# sourceMappingURL=rpc.d.ts.map
|