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
package/dist/types/lib/nft.d.ts
CHANGED
|
@@ -8,104 +8,237 @@ import { UnspentOutput, UnspentOutputData } from './bitcore/transaction/unspento
|
|
|
8
8
|
import { Address } from './bitcore/address.js';
|
|
9
9
|
import { Network, type NetworkName } from './bitcore/networks.js';
|
|
10
10
|
import type { Buffer } from 'buffer/';
|
|
11
|
+
/**
|
|
12
|
+
* Standard NFT metadata structure
|
|
13
|
+
* Compatible with OpenSea and other marketplaces
|
|
14
|
+
*/
|
|
11
15
|
export interface NFTMetadata {
|
|
16
|
+
/** NFT name */
|
|
12
17
|
name: string;
|
|
18
|
+
/** NFT description */
|
|
13
19
|
description: string;
|
|
20
|
+
/** Image URI (IPFS CID, Arweave, or URL) */
|
|
14
21
|
image: string;
|
|
22
|
+
/** Optional attributes/traits */
|
|
15
23
|
attributes?: NFTAttribute[];
|
|
24
|
+
/** Optional collection identifier */
|
|
16
25
|
collection?: string;
|
|
26
|
+
/** Optional creator address */
|
|
17
27
|
creator?: string;
|
|
28
|
+
/** Optional external URL */
|
|
18
29
|
external_url?: string;
|
|
30
|
+
/** Optional animation URL */
|
|
19
31
|
animation_url?: string;
|
|
32
|
+
/** Optional background color (hex code without #) */
|
|
20
33
|
background_color?: string;
|
|
21
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* NFT attribute/trait
|
|
37
|
+
*/
|
|
22
38
|
export interface NFTAttribute {
|
|
39
|
+
/** Trait type (e.g., "Rarity", "Color") */
|
|
23
40
|
trait_type: string;
|
|
41
|
+
/** Trait value */
|
|
24
42
|
value: string | number;
|
|
43
|
+
/** Optional display type */
|
|
25
44
|
display_type?: 'number' | 'boost_percentage' | 'boost_number' | 'date';
|
|
26
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Collection metadata structure
|
|
48
|
+
*/
|
|
27
49
|
export interface NFTCollectionMetadata {
|
|
50
|
+
/** Collection name */
|
|
28
51
|
name: string;
|
|
52
|
+
/** Collection description */
|
|
29
53
|
description: string;
|
|
54
|
+
/** Total supply */
|
|
30
55
|
totalSupply: number;
|
|
56
|
+
/** Creator address */
|
|
31
57
|
creator: string;
|
|
58
|
+
/** Optional royalty percentage (0-100) */
|
|
32
59
|
royalty?: number;
|
|
60
|
+
/** Optional collection image */
|
|
33
61
|
image?: string;
|
|
62
|
+
/** Optional external URL */
|
|
34
63
|
external_url?: string;
|
|
35
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* NFT data interface (plain object representation)
|
|
67
|
+
*/
|
|
36
68
|
export interface NFTData {
|
|
69
|
+
/** Taproot script locking the NFT */
|
|
37
70
|
script: Script;
|
|
71
|
+
/** NFT address */
|
|
38
72
|
address: Address;
|
|
73
|
+
/** Metadata hash (32 bytes, stored on-chain) */
|
|
39
74
|
metadataHash: Buffer;
|
|
75
|
+
/** Full metadata (stored off-chain) */
|
|
40
76
|
metadata: NFTMetadata;
|
|
77
|
+
/** NFT value in satoshis */
|
|
41
78
|
satoshis: number;
|
|
79
|
+
/** Optional transaction ID if minted */
|
|
42
80
|
txid?: string;
|
|
81
|
+
/** Optional output index if minted */
|
|
43
82
|
outputIndex?: number;
|
|
83
|
+
/** Script tree commitment public key (required for script-path) */
|
|
44
84
|
commitment: PublicKey;
|
|
85
|
+
/** Merkle root of script tree (required for script-path) */
|
|
45
86
|
merkleRoot: Buffer;
|
|
87
|
+
/** Control block for script-path spending (required) */
|
|
46
88
|
controlBlock: Buffer;
|
|
89
|
+
/** Script leaves with merkle paths (required for script-path) */
|
|
47
90
|
leaves: TapLeaf[];
|
|
48
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* NFT transfer record for provenance tracking
|
|
94
|
+
*/
|
|
49
95
|
export interface NFTTransfer {
|
|
96
|
+
/** Transaction ID */
|
|
50
97
|
txid: string;
|
|
98
|
+
/** Sender address (null for mint) */
|
|
51
99
|
from: string | null;
|
|
100
|
+
/** Recipient address */
|
|
52
101
|
to: string;
|
|
102
|
+
/** Metadata hash (must remain constant) */
|
|
53
103
|
metadataHash: string;
|
|
104
|
+
/** Timestamp */
|
|
54
105
|
timestamp: number;
|
|
106
|
+
/** Optional block height */
|
|
55
107
|
blockHeight?: number;
|
|
56
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* NFT minting configuration
|
|
111
|
+
*/
|
|
57
112
|
export interface NFTMintConfig {
|
|
113
|
+
/** Owner's private key */
|
|
58
114
|
ownerKey: PrivateKey;
|
|
115
|
+
/** NFT metadata */
|
|
59
116
|
metadata: NFTMetadata;
|
|
117
|
+
/** NFT value in satoshis (default: 1000 = 0.001 XPI) */
|
|
60
118
|
satoshis?: number;
|
|
119
|
+
/** Optional collection hash */
|
|
61
120
|
collectionHash?: Buffer;
|
|
121
|
+
/** Network (default: livenet) */
|
|
62
122
|
network?: Network | NetworkName;
|
|
63
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* NFT UTXO information
|
|
126
|
+
*/
|
|
64
127
|
export interface NFTUtxo {
|
|
128
|
+
/** Transaction ID */
|
|
65
129
|
txid: string;
|
|
130
|
+
/** Output index */
|
|
66
131
|
outputIndex: number;
|
|
132
|
+
/** Taproot script with state */
|
|
67
133
|
script: Script;
|
|
134
|
+
/** NFT value in satoshis */
|
|
68
135
|
satoshis: number;
|
|
69
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* NFT transfer configuration
|
|
139
|
+
*/
|
|
70
140
|
export interface NFTTransferConfig {
|
|
141
|
+
/** Current owner's private key */
|
|
71
142
|
currentOwnerKey: PrivateKey;
|
|
143
|
+
/** New owner's public key */
|
|
72
144
|
newOwnerKey: PublicKey;
|
|
145
|
+
/** Current NFT UTXO */
|
|
73
146
|
nftUtxo: NFTUtxo;
|
|
147
|
+
/** Metadata hash (must match UTXO) */
|
|
74
148
|
metadataHash: Buffer;
|
|
149
|
+
/** Script-path spending data (required for all NFT transfers) */
|
|
75
150
|
scriptPathData: {
|
|
151
|
+
/** Internal public key (before tweaking) */
|
|
76
152
|
internalPubKey: PublicKey;
|
|
153
|
+
/** Merkle root of script tree */
|
|
77
154
|
merkleRoot: Buffer;
|
|
155
|
+
/** Control block for script path spending */
|
|
78
156
|
controlBlock: Buffer;
|
|
157
|
+
/** Script to execute (e.g., OP_CHECKSIG) */
|
|
79
158
|
tapScript: Script;
|
|
80
159
|
};
|
|
160
|
+
/** Optional fee in satoshis */
|
|
81
161
|
fee?: number;
|
|
82
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* NFT with script path information
|
|
165
|
+
*/
|
|
83
166
|
export interface NFTWithScriptPath extends NFTData {
|
|
167
|
+
/** Commitment public key */
|
|
84
168
|
commitment: PublicKey;
|
|
169
|
+
/** Merkle root of script tree */
|
|
85
170
|
merkleRoot: Buffer;
|
|
171
|
+
/** Array of leaf scripts with merkle paths */
|
|
86
172
|
leaves: TapLeaf[];
|
|
87
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* NFT that belongs to a collection
|
|
176
|
+
*/
|
|
88
177
|
export interface NFTWithCollection extends NFTData {
|
|
178
|
+
/** Collection hash identifier */
|
|
89
179
|
collectionHash: Buffer;
|
|
90
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* NFT information extracted from script
|
|
183
|
+
*/
|
|
91
184
|
export interface NFTInfo {
|
|
185
|
+
/** Commitment public key from script */
|
|
92
186
|
commitment: PublicKey;
|
|
187
|
+
/** Metadata hash from state parameter */
|
|
93
188
|
metadataHash: Buffer;
|
|
189
|
+
/** NFT address */
|
|
94
190
|
address: Address;
|
|
95
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* NFT JSON serialization format
|
|
194
|
+
*/
|
|
96
195
|
export interface NFTObject {
|
|
196
|
+
/** Script as hex string */
|
|
97
197
|
script: string;
|
|
198
|
+
/** Address as string */
|
|
98
199
|
address: string;
|
|
200
|
+
/** Metadata hash as hex string */
|
|
99
201
|
metadataHash: string;
|
|
202
|
+
/** Full metadata object */
|
|
100
203
|
metadata: NFTMetadata;
|
|
204
|
+
/** NFT value in satoshis */
|
|
101
205
|
satoshis: number;
|
|
206
|
+
/** Optional transaction ID */
|
|
102
207
|
txid?: string;
|
|
208
|
+
/** Optional output index */
|
|
103
209
|
outputIndex?: number;
|
|
210
|
+
/** Commitment public key (hex) - required for script-path */
|
|
104
211
|
commitment: string;
|
|
212
|
+
/** Merkle root (hex) - required for script-path */
|
|
105
213
|
merkleRoot: string;
|
|
214
|
+
/** Control block (hex) - required for script-path spending */
|
|
106
215
|
controlBlock: string;
|
|
216
|
+
/** Optional collection hash (hex) */
|
|
107
217
|
collectionHash?: string;
|
|
108
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
* NFT Class - Represents a Lotus NFT instance
|
|
221
|
+
*
|
|
222
|
+
* This class provides an object-oriented interface for working with NFTs.
|
|
223
|
+
* It wraps NFT data and provides methods for common operations like
|
|
224
|
+
* transferring, verifying, and updating NFT state.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```typescript
|
|
228
|
+
* // Create a new NFT
|
|
229
|
+
* const nft = new NFT({
|
|
230
|
+
* metadata: { name: 'My NFT', description: '...', image: 'ipfs://...' },
|
|
231
|
+
* ownerKey: privateKey.publicKey,
|
|
232
|
+
* satoshis: 1000,
|
|
233
|
+
* })
|
|
234
|
+
*
|
|
235
|
+
* // Transfer to new owner
|
|
236
|
+
* const transferTx = nft.transfer(newOwnerKey, currentOwnerPrivateKey)
|
|
237
|
+
*
|
|
238
|
+
* // Verify metadata
|
|
239
|
+
* const isValid = nft.verifyMetadata()
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
109
242
|
export declare class NFT {
|
|
110
243
|
private _script;
|
|
111
244
|
private _address;
|
|
@@ -119,17 +252,47 @@ export declare class NFT {
|
|
|
119
252
|
private _controlBlock?;
|
|
120
253
|
private _leaves?;
|
|
121
254
|
private _collectionHash?;
|
|
255
|
+
/**
|
|
256
|
+
* Create a new NFT instance
|
|
257
|
+
*
|
|
258
|
+
* @param config - NFT configuration
|
|
259
|
+
*/
|
|
122
260
|
constructor(config: {
|
|
261
|
+
/** NFT metadata */
|
|
123
262
|
metadata: NFTMetadata;
|
|
263
|
+
/** Owner's public key */
|
|
124
264
|
ownerKey: PublicKey;
|
|
265
|
+
/** NFT value in satoshis (default: 1000) */
|
|
125
266
|
satoshis?: number;
|
|
267
|
+
/** Network (default: livenet) */
|
|
126
268
|
network?: Network;
|
|
269
|
+
/** Optional script tree for advanced spending conditions */
|
|
127
270
|
scriptTree?: TapNode;
|
|
271
|
+
/** Optional collection hash for collection NFTs */
|
|
128
272
|
collectionHash?: Buffer;
|
|
273
|
+
/** Optional transaction ID if already minted */
|
|
129
274
|
txid?: string;
|
|
275
|
+
/** Optional output index if already minted */
|
|
130
276
|
outputIndex?: number;
|
|
131
277
|
});
|
|
278
|
+
/**
|
|
279
|
+
* Create NFT instance from existing script
|
|
280
|
+
*
|
|
281
|
+
* @param script - Taproot script with state
|
|
282
|
+
* @param metadata - NFT metadata
|
|
283
|
+
* @param satoshis - NFT value
|
|
284
|
+
* @param txid - Optional transaction ID
|
|
285
|
+
* @param outputIndex - Optional output index
|
|
286
|
+
* @returns NFT instance
|
|
287
|
+
*/
|
|
132
288
|
static fromScript(script: Script, metadata: NFTMetadata, satoshis: number, txid?: string, outputIndex?: number): NFT;
|
|
289
|
+
/**
|
|
290
|
+
* Create NFT instance from UTXO
|
|
291
|
+
*
|
|
292
|
+
* @param utxo - Unspent output or NFT UTXO information
|
|
293
|
+
* @param metadata - NFT metadata
|
|
294
|
+
* @returns NFT instance
|
|
295
|
+
*/
|
|
133
296
|
static fromUTXO(utxo: UnspentOutput | NFTUtxo | UnspentOutputData, metadata: NFTMetadata): NFT;
|
|
134
297
|
get script(): Script;
|
|
135
298
|
get address(): Address;
|
|
@@ -143,36 +306,307 @@ export declare class NFT {
|
|
|
143
306
|
get leaves(): TapLeaf[] | undefined;
|
|
144
307
|
get controlBlock(): Buffer | undefined;
|
|
145
308
|
get collectionHash(): Buffer | undefined;
|
|
309
|
+
/**
|
|
310
|
+
* Check if this NFT has script tree (script path spending)
|
|
311
|
+
*/
|
|
146
312
|
hasScriptTree(): boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Check if this NFT belongs to a collection
|
|
315
|
+
*/
|
|
147
316
|
isCollectionNFT(): boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Verify that the metadata matches the on-chain hash
|
|
319
|
+
*
|
|
320
|
+
* @returns true if metadata is valid
|
|
321
|
+
*/
|
|
148
322
|
verifyMetadata(): boolean;
|
|
323
|
+
/**
|
|
324
|
+
* Create a transfer transaction to a new owner
|
|
325
|
+
*
|
|
326
|
+
* @param newOwnerKey - New owner's public key
|
|
327
|
+
* @param currentOwnerKey - Current owner's private key
|
|
328
|
+
* @param fee - Optional transaction fee in satoshis
|
|
329
|
+
* @returns Signed transfer transaction
|
|
330
|
+
*
|
|
331
|
+
* @throws Error if NFT doesn't have UTXO information
|
|
332
|
+
*/
|
|
149
333
|
transfer(newOwnerKey: PublicKey, currentOwnerKey: PrivateKey, fee?: number): Transaction;
|
|
334
|
+
/**
|
|
335
|
+
* Update the UTXO information after the NFT is minted or transferred
|
|
336
|
+
*
|
|
337
|
+
* @param txid - Transaction ID
|
|
338
|
+
* @param outputIndex - Output index
|
|
339
|
+
*/
|
|
150
340
|
updateUTXO(txid: string, outputIndex: number): void;
|
|
341
|
+
/**
|
|
342
|
+
* Get comprehensive NFT information
|
|
343
|
+
*
|
|
344
|
+
* @returns NFT info object
|
|
345
|
+
*/
|
|
151
346
|
getInfo(): NFTInfo;
|
|
347
|
+
/**
|
|
348
|
+
* Create an Output object for this NFT
|
|
349
|
+
*
|
|
350
|
+
* @returns Output instance
|
|
351
|
+
*/
|
|
152
352
|
toOutput(): Output;
|
|
353
|
+
/**
|
|
354
|
+
* Create an UnspentOutput object for this NFT
|
|
355
|
+
*
|
|
356
|
+
* @returns UnspentOutput instance
|
|
357
|
+
* @throws Error if NFT doesn't have UTXO information
|
|
358
|
+
*/
|
|
153
359
|
toUnspentOutput(): UnspentOutput;
|
|
360
|
+
/**
|
|
361
|
+
* Get NFT UTXO information
|
|
362
|
+
*
|
|
363
|
+
* @returns NFT UTXO data
|
|
364
|
+
* @throws Error if NFT doesn't have UTXO information
|
|
365
|
+
*/
|
|
154
366
|
getUtxo(): NFTUtxo;
|
|
367
|
+
/**
|
|
368
|
+
* Serialize NFT to JSON
|
|
369
|
+
*
|
|
370
|
+
* @returns JSON representation
|
|
371
|
+
*/
|
|
155
372
|
toJSON(): NFTObject;
|
|
373
|
+
/**
|
|
374
|
+
* Serialize NFT to a plain object matching the NFTData interface
|
|
375
|
+
*
|
|
376
|
+
* @returns NFTData interface object
|
|
377
|
+
*/
|
|
156
378
|
toObject(): NFTData;
|
|
379
|
+
/**
|
|
380
|
+
* Get string representation of the NFT
|
|
381
|
+
*
|
|
382
|
+
* @returns String representation
|
|
383
|
+
*/
|
|
157
384
|
toString(): string;
|
|
158
385
|
}
|
|
386
|
+
/**
|
|
387
|
+
* NFT Utility Class
|
|
388
|
+
*/
|
|
159
389
|
export declare class NFTUtil {
|
|
390
|
+
/**
|
|
391
|
+
* Hash NFT metadata to 32-byte commitment
|
|
392
|
+
*
|
|
393
|
+
* Creates a SHA256 hash of the JSON-stringified metadata.
|
|
394
|
+
* This hash is stored in the Taproot state parameter on-chain.
|
|
395
|
+
*
|
|
396
|
+
* @param metadata - NFT metadata object
|
|
397
|
+
* @returns 32-byte hash
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
* ```typescript
|
|
401
|
+
* const metadata = {
|
|
402
|
+
* name: 'Lotus NFT #1',
|
|
403
|
+
* description: 'First NFT',
|
|
404
|
+
* image: 'ipfs://Qm...',
|
|
405
|
+
* }
|
|
406
|
+
* const hash = NFTUtil.hashMetadata(metadata)
|
|
407
|
+
* console.log(hash.toString('hex')) // 32-byte hex string
|
|
408
|
+
* ```
|
|
409
|
+
*/
|
|
160
410
|
static hashMetadata(metadata: NFTMetadata): Buffer;
|
|
411
|
+
/**
|
|
412
|
+
* Hash collection metadata
|
|
413
|
+
*
|
|
414
|
+
* @param collectionInfo - Collection metadata
|
|
415
|
+
* @returns 32-byte hash
|
|
416
|
+
*/
|
|
161
417
|
static hashCollection(collectionInfo: NFTCollectionMetadata): Buffer;
|
|
418
|
+
/**
|
|
419
|
+
* Create combined hash for collection NFT
|
|
420
|
+
*
|
|
421
|
+
* Combines collection hash with individual NFT metadata for
|
|
422
|
+
* NFTs that belong to a collection.
|
|
423
|
+
*
|
|
424
|
+
* @param collectionHash - Collection hash
|
|
425
|
+
* @param nftMetadata - Individual NFT metadata
|
|
426
|
+
* @returns 32-byte combined hash
|
|
427
|
+
*/
|
|
162
428
|
static hashCollectionNFT(collectionHash: Buffer, nftMetadata: NFTMetadata): Buffer;
|
|
429
|
+
/**
|
|
430
|
+
* Verify metadata matches hash
|
|
431
|
+
*
|
|
432
|
+
* @param metadata - NFT metadata
|
|
433
|
+
* @param hash - Claimed hash
|
|
434
|
+
* @returns true if metadata matches hash
|
|
435
|
+
*/
|
|
163
436
|
static verifyMetadata(metadata: NFTMetadata, hash: Buffer): boolean;
|
|
437
|
+
/**
|
|
438
|
+
* Verify collection NFT metadata
|
|
439
|
+
*
|
|
440
|
+
* @param collectionHash - Collection hash
|
|
441
|
+
* @param nftMetadata - NFT metadata
|
|
442
|
+
* @param hash - Claimed combined hash
|
|
443
|
+
* @returns true if metadata matches hash
|
|
444
|
+
*/
|
|
164
445
|
static verifyCollectionNFT(collectionHash: Buffer, nftMetadata: NFTMetadata, hash: Buffer): boolean;
|
|
446
|
+
/**
|
|
447
|
+
* Extract state from NFT script
|
|
448
|
+
*
|
|
449
|
+
* @param script - Taproot script
|
|
450
|
+
* @returns Metadata hash or null if no state
|
|
451
|
+
* @throws Error if not a valid Taproot script
|
|
452
|
+
*/
|
|
165
453
|
static extractMetadataHash(script: Script): Buffer | null;
|
|
454
|
+
/**
|
|
455
|
+
* Create an NFT with metadata validation (script-path spending)
|
|
456
|
+
*
|
|
457
|
+
* Creates an NFT that validates the metadata hash on-chain using script-path spending.
|
|
458
|
+
* The metadata hash is stored in the script state and validated during spending.
|
|
459
|
+
*
|
|
460
|
+
* @param ownerKey - Owner's public key
|
|
461
|
+
* @param metadata - NFT metadata
|
|
462
|
+
* @param satoshis - NFT value in satoshis (default: 1000)
|
|
463
|
+
* @param network - Network (default: livenet)
|
|
464
|
+
* @returns NFT instance with metadata validation
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
* ```typescript
|
|
468
|
+
* const ownerKey = new PrivateKey()
|
|
469
|
+
* const metadata = {
|
|
470
|
+
* name: 'My NFT',
|
|
471
|
+
* description: 'A unique collectible',
|
|
472
|
+
* image: 'ipfs://Qm...',
|
|
473
|
+
* }
|
|
474
|
+
* const nft = NFTUtil.createNFT(ownerKey.publicKey, metadata)
|
|
475
|
+
* console.log('NFT address:', nft.address.toString())
|
|
476
|
+
* console.log('Metadata hash:', nft.metadataHash.toString('hex'))
|
|
477
|
+
* ```
|
|
478
|
+
*/
|
|
166
479
|
static createNFT(ownerKey: PublicKey, metadata: NFTMetadata, satoshis?: number, network?: Network | NetworkName): NFTData;
|
|
167
480
|
static createScriptPathNFT(ownerKey: PublicKey, metadata: NFTMetadata, scriptTree: TapNode, satoshis?: number, network?: Network): NFTWithScriptPath;
|
|
481
|
+
/**
|
|
482
|
+
* Create a collection NFT
|
|
483
|
+
*
|
|
484
|
+
* Creates an NFT that belongs to a collection. The metadata hash includes
|
|
485
|
+
* both the collection identifier and individual NFT metadata.
|
|
486
|
+
*
|
|
487
|
+
* @param ownerKey - Owner's public key
|
|
488
|
+
* @param collectionHash - Collection hash
|
|
489
|
+
* @param nftMetadata - Individual NFT metadata
|
|
490
|
+
* @param satoshis - NFT value in satoshis (default: 1000)
|
|
491
|
+
* @param network - Network
|
|
492
|
+
* @returns NFT instance with collection info
|
|
493
|
+
*/
|
|
168
494
|
static createCollectionNFT(ownerKey: PublicKey, collectionHash: Buffer, nftMetadata: NFTMetadata, satoshis?: number, network?: Network): NFTWithCollection;
|
|
495
|
+
/**
|
|
496
|
+
* Mint a single NFT
|
|
497
|
+
*
|
|
498
|
+
* Creates a transaction that mints an NFT by creating a Taproot output
|
|
499
|
+
* with metadata commitment in the state parameter.
|
|
500
|
+
*
|
|
501
|
+
* Note: This function creates the output structure. You need to add inputs
|
|
502
|
+
* and sign the transaction.
|
|
503
|
+
*
|
|
504
|
+
* @param config - Mint configuration
|
|
505
|
+
* @returns Transaction with NFT output (needs inputs and signing)
|
|
506
|
+
*
|
|
507
|
+
* @example
|
|
508
|
+
* ```typescript
|
|
509
|
+
* const tx = NFTUtil.mintNFT({
|
|
510
|
+
* ownerKey: privateKey,
|
|
511
|
+
* metadata: {
|
|
512
|
+
* name: 'My NFT',
|
|
513
|
+
* description: 'A unique collectible',
|
|
514
|
+
* image: 'ipfs://Qm...',
|
|
515
|
+
* },
|
|
516
|
+
* satoshis: 1000,
|
|
517
|
+
* })
|
|
518
|
+
*
|
|
519
|
+
* // Add funding input and change output
|
|
520
|
+
* tx.from(utxo)
|
|
521
|
+
* tx.change(changeAddress)
|
|
522
|
+
* tx.sign(privateKey)
|
|
523
|
+
* ```
|
|
524
|
+
*/
|
|
169
525
|
static mintNFT(config: NFTMintConfig): Transaction;
|
|
526
|
+
/**
|
|
527
|
+
* Mint multiple NFTs in a single transaction (batch minting)
|
|
528
|
+
*
|
|
529
|
+
* @param ownerKey - Owner's private key
|
|
530
|
+
* @param nftMetadataList - Array of NFT metadata
|
|
531
|
+
* @param satoshisPerNFT - Value per NFT (default: 1000)
|
|
532
|
+
* @param network - Network
|
|
533
|
+
* @returns Transaction with multiple NFT outputs
|
|
534
|
+
*/
|
|
170
535
|
static mintBatch(ownerKey: PrivateKey, nftMetadataList: NFTMetadata[], satoshisPerNFT?: number, network?: Network): Transaction;
|
|
536
|
+
/**
|
|
537
|
+
* Mint a collection of NFTs
|
|
538
|
+
*
|
|
539
|
+
* @param ownerKey - Owner's private key
|
|
540
|
+
* @param collectionInfo - Collection metadata
|
|
541
|
+
* @param nftMetadataList - Array of individual NFT metadata
|
|
542
|
+
* @param satoshisPerNFT - Value per NFT (default: 1000)
|
|
543
|
+
* @param network - Network
|
|
544
|
+
* @returns Transaction with collection NFT outputs
|
|
545
|
+
*/
|
|
171
546
|
static mintCollection(ownerKey: PrivateKey, collectionInfo: NFTCollectionMetadata, nftMetadataList: NFTMetadata[], satoshisPerNFT?: number, network?: Network): Transaction;
|
|
547
|
+
/**
|
|
548
|
+
* Transfer an NFT to a new owner (key path)
|
|
549
|
+
*
|
|
550
|
+
* Creates a transaction that transfers an NFT by spending the current
|
|
551
|
+
* NFT UTXO and creating a new NFT output for the new owner with the
|
|
552
|
+
* same metadata hash.
|
|
553
|
+
*
|
|
554
|
+
* @param config - Transfer configuration
|
|
555
|
+
* @returns Signed transaction ready to broadcast
|
|
556
|
+
*
|
|
557
|
+
* @example
|
|
558
|
+
* ```typescript
|
|
559
|
+
* const transferTx = NFTUtil.transferNFT({
|
|
560
|
+
* currentOwnerKey: currentOwner,
|
|
561
|
+
* newOwnerKey: newOwner.publicKey,
|
|
562
|
+
* nftUtxo: {
|
|
563
|
+
* txid: 'abc123...',
|
|
564
|
+
* outputIndex: 0,
|
|
565
|
+
* script: nftScript,
|
|
566
|
+
* satoshis: 1000,
|
|
567
|
+
* },
|
|
568
|
+
* metadataHash: metadataHash,
|
|
569
|
+
* })
|
|
570
|
+
*
|
|
571
|
+
* console.log('Transfer TX:', transferTx.serialize())
|
|
572
|
+
* ```
|
|
573
|
+
*/
|
|
172
574
|
static transferNFT(config: NFTTransferConfig): Transaction;
|
|
575
|
+
/**
|
|
576
|
+
* Validate NFT transfer preserves metadata
|
|
577
|
+
*
|
|
578
|
+
* Verifies that an NFT transfer maintains the same metadata hash
|
|
579
|
+
* from input to output, ensuring NFT authenticity.
|
|
580
|
+
*
|
|
581
|
+
* @param inputScript - Input script
|
|
582
|
+
* @param outputScript - Output script
|
|
583
|
+
* @returns true if metadata hash is preserved
|
|
584
|
+
*/
|
|
173
585
|
static validateTransfer(inputScript: Script, outputScript: Script): boolean;
|
|
586
|
+
/**
|
|
587
|
+
* Trace NFT provenance
|
|
588
|
+
*
|
|
589
|
+
* Verifies that all transfers in the provenance chain maintain the
|
|
590
|
+
* same metadata hash, proving authenticity from mint to current owner.
|
|
591
|
+
*
|
|
592
|
+
* @param transfers - Array of transfers (chronological order)
|
|
593
|
+
* @returns true if provenance is valid
|
|
594
|
+
*/
|
|
174
595
|
static verifyProvenance(transfers: NFTTransfer[]): boolean;
|
|
596
|
+
/**
|
|
597
|
+
* Check if a script is an NFT (has state parameter)
|
|
598
|
+
*
|
|
599
|
+
* @param script - Script to check
|
|
600
|
+
* @returns true if script is an NFT
|
|
601
|
+
*/
|
|
175
602
|
static isNFT(script: Script): boolean;
|
|
603
|
+
/**
|
|
604
|
+
* Get NFT info from script
|
|
605
|
+
*
|
|
606
|
+
* @param script - NFT script
|
|
607
|
+
* @returns NFT information
|
|
608
|
+
* @throws Error if not a valid NFT
|
|
609
|
+
*/
|
|
176
610
|
static getNFTInfo(script: Script): NFTInfo;
|
|
177
611
|
}
|
|
178
612
|
//# sourceMappingURL=nft.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nft.d.ts","sourceRoot":"","sources":["../../../lib/nft.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAE5C,OAAO,EAKL,KAAK,OAAO,EACZ,KAAK,OAAO,EACb,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAExD,OAAO,EACL,aAAa,EACb,iBAAiB,EAClB,MAAM,wCAAwC,CAAA;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"nft.d.ts","sourceRoot":"","sources":["../../../lib/nft.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAE5C,OAAO,EAKL,KAAK,OAAO,EACZ,KAAK,OAAO,EACb,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAExD,OAAO,EACL,aA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M,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAQrC;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;CAkB3C"}
|
|
@@ -10,12 +10,14 @@ export type AuthorizationData = {
|
|
|
10
10
|
blockhash: string;
|
|
11
11
|
blockheight: string;
|
|
12
12
|
};
|
|
13
|
+
/** */
|
|
13
14
|
export type PostMeta = {
|
|
14
15
|
hasWalletUpvoted: boolean;
|
|
15
16
|
hasWalletDownvoted: boolean;
|
|
16
17
|
txidsUpvoted: string[];
|
|
17
18
|
txidsDownvoted: string[];
|
|
18
19
|
};
|
|
20
|
+
/** Transaction data returned from RANK backend API */
|
|
19
21
|
export type TransactionAPI = {
|
|
20
22
|
txid: string;
|
|
21
23
|
outIdx: number;
|
|
@@ -32,6 +34,7 @@ export type TransactionRANKAPI = TransactionAPI & {
|
|
|
32
34
|
profileId: string;
|
|
33
35
|
postId?: string;
|
|
34
36
|
};
|
|
37
|
+
/** Comment data returned from RANK backend API */
|
|
35
38
|
export type TransactionRNKCAPI = TransactionAPI & {
|
|
36
39
|
data: string;
|
|
37
40
|
feeRate: number;
|
|
@@ -41,20 +44,26 @@ export type TransactionRNKCAPI = TransactionAPI & {
|
|
|
41
44
|
repliedProfile?: ProfileAPI;
|
|
42
45
|
repliedPost?: PostAPI;
|
|
43
46
|
};
|
|
47
|
+
/** */
|
|
44
48
|
export type ParametersAPI = {
|
|
45
49
|
platform: string;
|
|
46
50
|
profileId: string;
|
|
47
51
|
};
|
|
52
|
+
/** Profile ranking returned from RANK backend API */
|
|
48
53
|
export type ProfileAPI = ParametersAPI & {
|
|
49
54
|
ranking: string;
|
|
50
55
|
satsPositive: string;
|
|
51
56
|
satsNegative: string;
|
|
52
57
|
votesPositive: number;
|
|
53
58
|
votesNegative: number;
|
|
59
|
+
/** RANK transactions associated with the profile */
|
|
54
60
|
ranks?: TransactionRANKAPI[];
|
|
61
|
+
/** Comments associated with the profile */
|
|
55
62
|
comments?: TransactionRNKCAPI[];
|
|
63
|
+
/** Posts associated with the profile */
|
|
56
64
|
posts?: PostAPI[];
|
|
57
65
|
};
|
|
66
|
+
/** Post ranking returned from RANK backend API */
|
|
58
67
|
export type PostAPI = ParametersAPI & {
|
|
59
68
|
ranking: string;
|
|
60
69
|
satsPositive: string;
|
|
@@ -63,11 +72,15 @@ export type PostAPI = ParametersAPI & {
|
|
|
63
72
|
votesNegative: number;
|
|
64
73
|
profile: ProfileAPI;
|
|
65
74
|
postId: string;
|
|
75
|
+
/** RANK transactions associated with the post */
|
|
66
76
|
ranks?: TransactionRANKAPI[];
|
|
77
|
+
/** Comments associated with the post */
|
|
67
78
|
comments?: TransactionRNKCAPI[];
|
|
79
|
+
/** Comment data as a UTF-8 string, if available */
|
|
68
80
|
data?: string;
|
|
69
81
|
postMeta?: PostMeta;
|
|
70
82
|
};
|
|
83
|
+
/** Authentication header parameters provided to client for authorization to API */
|
|
71
84
|
export declare const AuthenticateHeader: {
|
|
72
85
|
scheme: string;
|
|
73
86
|
param: string[];
|