xpi-ts 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +516 -0
  3. package/dist/index.d.ts +9 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +8 -0
  6. package/dist/lib/bitcore/address.d.ts +66 -0
  7. package/dist/lib/bitcore/address.d.ts.map +1 -0
  8. package/dist/lib/bitcore/address.js +407 -0
  9. package/dist/lib/bitcore/block/block.d.ts +57 -0
  10. package/dist/lib/bitcore/block/block.d.ts.map +1 -0
  11. package/dist/lib/bitcore/block/block.js +233 -0
  12. package/dist/lib/bitcore/block/blockheader.d.ts +82 -0
  13. package/dist/lib/bitcore/block/blockheader.d.ts.map +1 -0
  14. package/dist/lib/bitcore/block/blockheader.js +323 -0
  15. package/dist/lib/bitcore/block/index.d.ts +5 -0
  16. package/dist/lib/bitcore/block/index.d.ts.map +1 -0
  17. package/dist/lib/bitcore/block/index.js +2 -0
  18. package/dist/lib/bitcore/chunk.d.ts +22 -0
  19. package/dist/lib/bitcore/chunk.d.ts.map +1 -0
  20. package/dist/lib/bitcore/chunk.js +46 -0
  21. package/dist/lib/bitcore/crypto/bn.d.ts +53 -0
  22. package/dist/lib/bitcore/crypto/bn.d.ts.map +1 -0
  23. package/dist/lib/bitcore/crypto/bn.js +238 -0
  24. package/dist/lib/bitcore/crypto/ecdsa.d.ts +46 -0
  25. package/dist/lib/bitcore/crypto/ecdsa.d.ts.map +1 -0
  26. package/dist/lib/bitcore/crypto/ecdsa.js +247 -0
  27. package/dist/lib/bitcore/crypto/hash.d.ts +16 -0
  28. package/dist/lib/bitcore/crypto/hash.d.ts.map +1 -0
  29. package/dist/lib/bitcore/crypto/hash.js +87 -0
  30. package/dist/lib/bitcore/crypto/index.d.ts +9 -0
  31. package/dist/lib/bitcore/crypto/index.d.ts.map +1 -0
  32. package/dist/lib/bitcore/crypto/index.js +8 -0
  33. package/dist/lib/bitcore/crypto/musig2.d.ts +40 -0
  34. package/dist/lib/bitcore/crypto/musig2.d.ts.map +1 -0
  35. package/dist/lib/bitcore/crypto/musig2.js +236 -0
  36. package/dist/lib/bitcore/crypto/point.d.ts +20 -0
  37. package/dist/lib/bitcore/crypto/point.d.ts.map +1 -0
  38. package/dist/lib/bitcore/crypto/point.js +133 -0
  39. package/dist/lib/bitcore/crypto/random.d.ts +7 -0
  40. package/dist/lib/bitcore/crypto/random.d.ts.map +1 -0
  41. package/dist/lib/bitcore/crypto/random.js +30 -0
  42. package/dist/lib/bitcore/crypto/schnorr.d.ts +40 -0
  43. package/dist/lib/bitcore/crypto/schnorr.d.ts.map +1 -0
  44. package/dist/lib/bitcore/crypto/schnorr.js +185 -0
  45. package/dist/lib/bitcore/crypto/signature.d.ts +53 -0
  46. package/dist/lib/bitcore/crypto/signature.d.ts.map +1 -0
  47. package/dist/lib/bitcore/crypto/signature.js +300 -0
  48. package/dist/lib/bitcore/crypto/sigtype.d.ts +5 -0
  49. package/dist/lib/bitcore/crypto/sigtype.d.ts.map +1 -0
  50. package/dist/lib/bitcore/crypto/sigtype.js +18 -0
  51. package/dist/lib/bitcore/encoding/base58.d.ts +16 -0
  52. package/dist/lib/bitcore/encoding/base58.d.ts.map +1 -0
  53. package/dist/lib/bitcore/encoding/base58.js +55 -0
  54. package/dist/lib/bitcore/encoding/base58check.d.ts +9 -0
  55. package/dist/lib/bitcore/encoding/base58check.d.ts.map +1 -0
  56. package/dist/lib/bitcore/encoding/base58check.js +82 -0
  57. package/dist/lib/bitcore/encoding/bufferreader.d.ts +34 -0
  58. package/dist/lib/bitcore/encoding/bufferreader.d.ts.map +1 -0
  59. package/dist/lib/bitcore/encoding/bufferreader.js +198 -0
  60. package/dist/lib/bitcore/encoding/bufferwriter.d.ts +36 -0
  61. package/dist/lib/bitcore/encoding/bufferwriter.d.ts.map +1 -0
  62. package/dist/lib/bitcore/encoding/bufferwriter.js +189 -0
  63. package/dist/lib/bitcore/encoding/varint.d.ts +20 -0
  64. package/dist/lib/bitcore/encoding/varint.d.ts.map +1 -0
  65. package/dist/lib/bitcore/encoding/varint.js +61 -0
  66. package/dist/lib/bitcore/errors.d.ts +28 -0
  67. package/dist/lib/bitcore/errors.d.ts.map +1 -0
  68. package/dist/lib/bitcore/errors.js +325 -0
  69. package/dist/lib/bitcore/hdprivatekey.d.ts +78 -0
  70. package/dist/lib/bitcore/hdprivatekey.d.ts.map +1 -0
  71. package/dist/lib/bitcore/hdprivatekey.js +381 -0
  72. package/dist/lib/bitcore/hdpublickey.d.ts +98 -0
  73. package/dist/lib/bitcore/hdpublickey.d.ts.map +1 -0
  74. package/dist/lib/bitcore/hdpublickey.js +416 -0
  75. package/dist/lib/bitcore/index.d.ts +60 -0
  76. package/dist/lib/bitcore/index.d.ts.map +1 -0
  77. package/dist/lib/bitcore/index.js +44 -0
  78. package/dist/lib/bitcore/message.d.ts +23 -0
  79. package/dist/lib/bitcore/message.d.ts.map +1 -0
  80. package/dist/lib/bitcore/message.js +112 -0
  81. package/dist/lib/bitcore/mnemonic/errors.d.ts +7 -0
  82. package/dist/lib/bitcore/mnemonic/errors.d.ts.map +1 -0
  83. package/dist/lib/bitcore/mnemonic/errors.js +20 -0
  84. package/dist/lib/bitcore/mnemonic/index.d.ts +5 -0
  85. package/dist/lib/bitcore/mnemonic/index.d.ts.map +1 -0
  86. package/dist/lib/bitcore/mnemonic/index.js +4 -0
  87. package/dist/lib/bitcore/mnemonic/mnemonic.d.ts +23 -0
  88. package/dist/lib/bitcore/mnemonic/mnemonic.d.ts.map +1 -0
  89. package/dist/lib/bitcore/mnemonic/mnemonic.js +164 -0
  90. package/dist/lib/bitcore/mnemonic/pbkdf2.d.ts +2 -0
  91. package/dist/lib/bitcore/mnemonic/pbkdf2.d.ts.map +1 -0
  92. package/dist/lib/bitcore/mnemonic/pbkdf2.js +25 -0
  93. package/dist/lib/bitcore/mnemonic/words/english.d.ts +2 -0
  94. package/dist/lib/bitcore/mnemonic/words/english.d.ts.map +1 -0
  95. package/dist/lib/bitcore/mnemonic/words/english.js +2050 -0
  96. package/dist/lib/bitcore/mnemonic/words/index.d.ts +4 -0
  97. package/dist/lib/bitcore/mnemonic/words/index.d.ts.map +1 -0
  98. package/dist/lib/bitcore/mnemonic/words/index.js +4 -0
  99. package/dist/lib/bitcore/musig2/index.d.ts +3 -0
  100. package/dist/lib/bitcore/musig2/index.d.ts.map +1 -0
  101. package/dist/lib/bitcore/musig2/index.js +2 -0
  102. package/dist/lib/bitcore/musig2/session.d.ts +79 -0
  103. package/dist/lib/bitcore/musig2/session.d.ts.map +1 -0
  104. package/dist/lib/bitcore/musig2/session.js +346 -0
  105. package/dist/lib/bitcore/musig2/signer.d.ts +61 -0
  106. package/dist/lib/bitcore/musig2/signer.d.ts.map +1 -0
  107. package/dist/lib/bitcore/musig2/signer.js +146 -0
  108. package/dist/lib/bitcore/networks.d.ts +53 -0
  109. package/dist/lib/bitcore/networks.d.ts.map +1 -0
  110. package/dist/lib/bitcore/networks.js +150 -0
  111. package/dist/lib/bitcore/opcode.d.ts +250 -0
  112. package/dist/lib/bitcore/opcode.d.ts.map +1 -0
  113. package/dist/lib/bitcore/opcode.js +270 -0
  114. package/dist/lib/bitcore/privatekey.d.ts +56 -0
  115. package/dist/lib/bitcore/privatekey.d.ts.map +1 -0
  116. package/dist/lib/bitcore/privatekey.js +237 -0
  117. package/dist/lib/bitcore/publickey.d.ts +59 -0
  118. package/dist/lib/bitcore/publickey.d.ts.map +1 -0
  119. package/dist/lib/bitcore/publickey.js +263 -0
  120. package/dist/lib/bitcore/script/interpreter.d.ts +98 -0
  121. package/dist/lib/bitcore/script/interpreter.d.ts.map +1 -0
  122. package/dist/lib/bitcore/script/interpreter.js +1704 -0
  123. package/dist/lib/bitcore/script.d.ts +111 -0
  124. package/dist/lib/bitcore/script.d.ts.map +1 -0
  125. package/dist/lib/bitcore/script.js +1112 -0
  126. package/dist/lib/bitcore/taproot/musig2.d.ts +29 -0
  127. package/dist/lib/bitcore/taproot/musig2.d.ts.map +1 -0
  128. package/dist/lib/bitcore/taproot/musig2.js +104 -0
  129. package/dist/lib/bitcore/taproot/nft.d.ts +164 -0
  130. package/dist/lib/bitcore/taproot/nft.d.ts.map +1 -0
  131. package/dist/lib/bitcore/taproot/nft.js +407 -0
  132. package/dist/lib/bitcore/taproot.d.ts +65 -0
  133. package/dist/lib/bitcore/taproot.d.ts.map +1 -0
  134. package/dist/lib/bitcore/taproot.js +288 -0
  135. package/dist/lib/bitcore/transaction/index.d.ts +12 -0
  136. package/dist/lib/bitcore/transaction/index.d.ts.map +1 -0
  137. package/dist/lib/bitcore/transaction/index.js +6 -0
  138. package/dist/lib/bitcore/transaction/input.d.ts +202 -0
  139. package/dist/lib/bitcore/transaction/input.d.ts.map +1 -0
  140. package/dist/lib/bitcore/transaction/input.js +911 -0
  141. package/dist/lib/bitcore/transaction/output.d.ts +48 -0
  142. package/dist/lib/bitcore/transaction/output.d.ts.map +1 -0
  143. package/dist/lib/bitcore/transaction/output.js +231 -0
  144. package/dist/lib/bitcore/transaction/sighash.d.ts +32 -0
  145. package/dist/lib/bitcore/transaction/sighash.d.ts.map +1 -0
  146. package/dist/lib/bitcore/transaction/sighash.js +335 -0
  147. package/dist/lib/bitcore/transaction/signature.d.ts +36 -0
  148. package/dist/lib/bitcore/transaction/signature.d.ts.map +1 -0
  149. package/dist/lib/bitcore/transaction/signature.js +130 -0
  150. package/dist/lib/bitcore/transaction/transaction.d.ts +164 -0
  151. package/dist/lib/bitcore/transaction/transaction.d.ts.map +1 -0
  152. package/dist/lib/bitcore/transaction/transaction.js +1016 -0
  153. package/dist/lib/bitcore/transaction/unspentoutput.d.ts +58 -0
  154. package/dist/lib/bitcore/transaction/unspentoutput.d.ts.map +1 -0
  155. package/dist/lib/bitcore/transaction/unspentoutput.js +167 -0
  156. package/dist/lib/bitcore/unit.d.ts +44 -0
  157. package/dist/lib/bitcore/unit.d.ts.map +1 -0
  158. package/dist/lib/bitcore/unit.js +106 -0
  159. package/dist/lib/bitcore/uri.d.ts +29 -0
  160. package/dist/lib/bitcore/uri.d.ts.map +1 -0
  161. package/dist/lib/bitcore/uri.js +163 -0
  162. package/dist/lib/bitcore/util/base32.d.ts +5 -0
  163. package/dist/lib/bitcore/util/base32.d.ts.map +1 -0
  164. package/dist/lib/bitcore/util/base32.js +58 -0
  165. package/dist/lib/bitcore/util/buffer.d.ts +18 -0
  166. package/dist/lib/bitcore/util/buffer.d.ts.map +1 -0
  167. package/dist/lib/bitcore/util/buffer.js +76 -0
  168. package/dist/lib/bitcore/util/convertBits.d.ts +2 -0
  169. package/dist/lib/bitcore/util/convertBits.d.ts.map +1 -0
  170. package/dist/lib/bitcore/util/convertBits.js +26 -0
  171. package/dist/lib/bitcore/util/js.d.ts +9 -0
  172. package/dist/lib/bitcore/util/js.d.ts.map +1 -0
  173. package/dist/lib/bitcore/util/js.js +45 -0
  174. package/dist/lib/bitcore/util/preconditions.d.ts +6 -0
  175. package/dist/lib/bitcore/util/preconditions.d.ts.map +1 -0
  176. package/dist/lib/bitcore/util/preconditions.js +31 -0
  177. package/dist/lib/bitcore/util.d.ts +14 -0
  178. package/dist/lib/bitcore/util.d.ts.map +1 -0
  179. package/dist/lib/bitcore/util.js +13 -0
  180. package/dist/lib/bitcore/xaddress.d.ts +45 -0
  181. package/dist/lib/bitcore/xaddress.d.ts.map +1 -0
  182. package/dist/lib/bitcore/xaddress.js +279 -0
  183. package/dist/lib/rank/api.d.ts +75 -0
  184. package/dist/lib/rank/api.d.ts.map +1 -0
  185. package/dist/lib/rank/api.js +4 -0
  186. package/dist/lib/rank/index.d.ts +127 -0
  187. package/dist/lib/rank/index.d.ts.map +1 -0
  188. package/dist/lib/rank/index.js +421 -0
  189. package/dist/lib/rank/opcode.d.ts +23 -0
  190. package/dist/lib/rank/opcode.d.ts.map +1 -0
  191. package/dist/lib/rank/opcode.js +23 -0
  192. package/dist/lib/rank/script.d.ts +2 -0
  193. package/dist/lib/rank/script.d.ts.map +1 -0
  194. package/dist/lib/rank/script.js +7 -0
  195. package/dist/lib/rank/transaction.d.ts +3 -0
  196. package/dist/lib/rank/transaction.d.ts.map +1 -0
  197. package/dist/lib/rank/transaction.js +12 -0
  198. package/dist/lib/rpc.d.ts +136 -0
  199. package/dist/lib/rpc.d.ts.map +1 -0
  200. package/dist/lib/rpc.js +62 -0
  201. package/dist/utils/constants.d.ts +18 -0
  202. package/dist/utils/constants.d.ts.map +1 -0
  203. package/dist/utils/constants.js +20 -0
  204. package/dist/utils/env.d.ts +3 -0
  205. package/dist/utils/env.d.ts.map +1 -0
  206. package/dist/utils/env.js +8 -0
  207. package/dist/utils/string.d.ts +11 -0
  208. package/dist/utils/string.d.ts.map +1 -0
  209. package/dist/utils/string.js +47 -0
  210. package/dist/utils/types.d.ts +2 -0
  211. package/dist/utils/types.d.ts.map +1 -0
  212. package/dist/utils/types.js +1 -0
  213. package/dist/utils/wallet.d.ts +12 -0
  214. package/dist/utils/wallet.d.ts.map +1 -0
  215. package/dist/utils/wallet.js +28 -0
  216. package/package.json +91 -0
@@ -0,0 +1,76 @@
1
+ import { Preconditions } from './preconditions.js';
2
+ export class BufferUtil {
3
+ static fill(buffer, value) {
4
+ Preconditions.checkArgumentType(buffer, 'Buffer', 'buffer');
5
+ Preconditions.checkArgumentType(value, 'number', 'value');
6
+ const length = buffer.length;
7
+ for (let i = 0; i < length; i++) {
8
+ buffer[i] = value;
9
+ }
10
+ return buffer;
11
+ }
12
+ static copy(original) {
13
+ const buffer = Buffer.alloc(original.length);
14
+ original.copy(buffer);
15
+ return buffer;
16
+ }
17
+ static isBuffer(arg) {
18
+ return Buffer.isBuffer(arg) || arg instanceof Uint8Array;
19
+ }
20
+ static emptyBuffer(bytes) {
21
+ Preconditions.checkArgumentType(bytes, 'number', 'bytes');
22
+ const result = Buffer.alloc(bytes);
23
+ for (let i = 0; i < bytes; i++) {
24
+ result.write('\0', i);
25
+ }
26
+ return result;
27
+ }
28
+ static concat(list, totalLength) {
29
+ return Buffer.concat(list, totalLength);
30
+ }
31
+ static equals(a, b) {
32
+ if (a.length !== b.length) {
33
+ return false;
34
+ }
35
+ const length = a.length;
36
+ for (let i = 0; i < length; i++) {
37
+ if (a[i] !== b[i]) {
38
+ return false;
39
+ }
40
+ }
41
+ return true;
42
+ }
43
+ static equal(a, b) {
44
+ return BufferUtil.equals(a, b);
45
+ }
46
+ static integerAsSingleByteBuffer(integer) {
47
+ Preconditions.checkArgumentType(integer, 'number', 'integer');
48
+ return Buffer.from([integer & 0xff]);
49
+ }
50
+ static integerAsBuffer(integer) {
51
+ Preconditions.checkArgumentType(integer, 'number', 'integer');
52
+ const bytes = [];
53
+ bytes.push((integer >> 24) & 0xff);
54
+ bytes.push((integer >> 16) & 0xff);
55
+ bytes.push((integer >> 8) & 0xff);
56
+ bytes.push(integer & 0xff);
57
+ return Buffer.from(bytes);
58
+ }
59
+ static integerFromBuffer(buffer) {
60
+ Preconditions.checkArgumentType(buffer, 'Buffer', 'buffer');
61
+ return (buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | buffer[3];
62
+ }
63
+ static integerFromSingleByteBuffer(buffer) {
64
+ Preconditions.checkArgumentType(buffer, 'Buffer', 'buffer');
65
+ return buffer[0];
66
+ }
67
+ static bufferToHex(buffer) {
68
+ Preconditions.checkArgumentType(buffer, 'Buffer', 'buffer');
69
+ return buffer.toString('hex');
70
+ }
71
+ static reverse(param) {
72
+ return Buffer.from(param).reverse();
73
+ }
74
+ }
75
+ export const NULL_HASH = BufferUtil.fill(Buffer.alloc(32), 0);
76
+ export const EMPTY_BUFFER = Buffer.alloc(0);
@@ -0,0 +1,2 @@
1
+ export declare function convertBits(data: number[], from: number, to: number, strict?: boolean): number[];
2
+ //# sourceMappingURL=convertBits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertBits.d.ts","sourceRoot":"","sources":["../../../../lib/bitcore/util/convertBits.ts"],"names":[],"mappings":"AAkBA,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,MAAM,GAAE,OAAe,GACtB,MAAM,EAAE,CAkCV"}
@@ -0,0 +1,26 @@
1
+ import { Preconditions } from './preconditions.js';
2
+ export function convertBits(data, from, to, strict = false) {
3
+ let accumulator = 0;
4
+ let bits = 0;
5
+ const result = [];
6
+ const mask = (1 << to) - 1;
7
+ for (let i = 0; i < data.length; i++) {
8
+ const value = data[i];
9
+ Preconditions.checkArgument(!(value < 0 || value >> from !== 0), 'value', `value ${value}`);
10
+ accumulator = (accumulator << from) | value;
11
+ bits += from;
12
+ while (bits >= to) {
13
+ bits -= to;
14
+ result.push((accumulator >> bits) & mask);
15
+ }
16
+ }
17
+ if (!strict) {
18
+ if (bits > 0) {
19
+ result.push((accumulator << (to - bits)) & mask);
20
+ }
21
+ }
22
+ else {
23
+ Preconditions.checkState(!(bits >= from || (accumulator << (to - bits)) & mask), 'Conversion requires padding but strict mode was used');
24
+ }
25
+ return result;
26
+ }
@@ -0,0 +1,9 @@
1
+ export declare class JSUtil {
2
+ static isHexa(value: string): boolean;
3
+ static isHexaString(str: string): boolean;
4
+ static isValidJSON(arg: string): boolean;
5
+ static cloneArray<T>(arr: T[]): T[];
6
+ static isNaturalNumber(value: unknown): boolean;
7
+ static defineImmutable(obj: object, properties: Record<string, unknown>): object;
8
+ }
9
+ //# sourceMappingURL=js.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../../../lib/bitcore/util/js.ts"],"names":[],"mappings":"AAKA,qBAAa,MAAM;IAIjB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAOrC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAOzC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAexC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE;IAOnC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAc/C,MAAM,CAAC,eAAe,CACpB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,MAAM;CAWV"}
@@ -0,0 +1,45 @@
1
+ export class JSUtil {
2
+ static isHexa(value) {
3
+ if (typeof value !== 'string') {
4
+ return false;
5
+ }
6
+ return /^[0-9a-fA-F]+$/.test(value);
7
+ }
8
+ static isHexaString(str) {
9
+ return typeof str === 'string' && /^[0-9a-fA-F]+$/.test(str);
10
+ }
11
+ static isValidJSON(arg) {
12
+ if (typeof arg !== 'string') {
13
+ return false;
14
+ }
15
+ try {
16
+ const parsed = JSON.parse(arg);
17
+ return typeof parsed === 'object';
18
+ }
19
+ catch (e) {
20
+ return false;
21
+ }
22
+ }
23
+ static cloneArray(arr) {
24
+ return [...arr];
25
+ }
26
+ static isNaturalNumber(value) {
27
+ return ((typeof value === 'number' &&
28
+ isFinite(value) &&
29
+ Math.floor(value) === value &&
30
+ value >= 0) ||
31
+ (typeof value === 'string' && /^[0-9]+$/.test(value)) ||
32
+ (typeof value === 'bigint' && value >= 0n));
33
+ }
34
+ static defineImmutable(obj, properties) {
35
+ Object.keys(properties).forEach(key => {
36
+ Object.defineProperty(obj, key, {
37
+ value: properties[key],
38
+ writable: false,
39
+ enumerable: true,
40
+ configurable: false,
41
+ });
42
+ });
43
+ return obj;
44
+ }
45
+ }
@@ -0,0 +1,6 @@
1
+ export declare class Preconditions {
2
+ static checkState(condition: boolean, message: string): void;
3
+ static checkArgument(condition: boolean, argumentName: string, message?: string, docsPath?: string): void;
4
+ static checkArgumentType(argument: unknown, type: string | ((...args: unknown[]) => unknown), argumentName?: string): void;
5
+ }
6
+ //# sourceMappingURL=preconditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preconditions.d.ts","sourceRoot":"","sources":["../../../../lib/bitcore/util/preconditions.ts"],"names":[],"mappings":"AAOA,qBAAa,aAAa;IACxB,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAM5D,MAAM,CAAC,aAAa,CAClB,SAAS,EAAE,OAAO,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI;IAUP,MAAM,CAAC,iBAAiB,CACtB,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,EAChD,YAAY,CAAC,EAAE,MAAM,GACpB,IAAI;CA6BR"}
@@ -0,0 +1,31 @@
1
+ import { BitcoreError } from '../errors.js';
2
+ export class Preconditions {
3
+ static checkState(condition, message) {
4
+ if (!condition) {
5
+ throw new BitcoreError.Precondition.InvalidState(message);
6
+ }
7
+ }
8
+ static checkArgument(condition, argumentName, message, docsPath) {
9
+ if (!condition) {
10
+ throw new BitcoreError.Precondition.InvalidArgument(argumentName, message, docsPath);
11
+ }
12
+ }
13
+ static checkArgumentType(argument, type, argumentName) {
14
+ argumentName = argumentName || '(unknown name)';
15
+ if (typeof type === 'string') {
16
+ if (type === 'Buffer') {
17
+ if (!Buffer.isBuffer(argument)) {
18
+ throw new BitcoreError.Precondition.InvalidArgumentType(argument, type, argumentName);
19
+ }
20
+ }
21
+ else if (typeof argument !== type) {
22
+ throw new BitcoreError.Precondition.InvalidArgumentType(argument, type, argumentName);
23
+ }
24
+ }
25
+ else {
26
+ if (!(argument instanceof type)) {
27
+ throw new BitcoreError.Precondition.InvalidArgumentType(argument, type.name, argumentName);
28
+ }
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,14 @@
1
+ import { BufferUtil } from './util/buffer.js';
2
+ import { JSUtil } from './util/js.js';
3
+ import { Preconditions } from './util/preconditions.js';
4
+ import { Base32 } from './util/base32.js';
5
+ import { convertBits } from './util/convertBits.js';
6
+ export declare const util: {
7
+ buffer: typeof BufferUtil;
8
+ js: typeof JSUtil;
9
+ $: typeof Preconditions;
10
+ base32: typeof Base32;
11
+ convertBits: typeof convertBits;
12
+ };
13
+ export { BufferUtil, JSUtil, Preconditions, Base32, convertBits };
14
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../lib/bitcore/util.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,eAAO,MAAM,IAAI;;;;;;CAMhB,CAAA;AAGD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { BufferUtil } from './util/buffer.js';
2
+ import { JSUtil } from './util/js.js';
3
+ import { Preconditions } from './util/preconditions.js';
4
+ import { Base32 } from './util/base32.js';
5
+ import { convertBits } from './util/convertBits.js';
6
+ export const util = {
7
+ buffer: BufferUtil,
8
+ js: JSUtil,
9
+ $: Preconditions,
10
+ base32: Base32,
11
+ convertBits: convertBits,
12
+ };
13
+ export { BufferUtil, JSUtil, Preconditions, Base32, convertBits };
@@ -0,0 +1,45 @@
1
+ import { Network } from './networks.js';
2
+ import { PublicKey } from './publickey.js';
3
+ export interface XAddressData {
4
+ hashBuffer?: Buffer;
5
+ network?: Network;
6
+ type?: string;
7
+ prefix?: string;
8
+ }
9
+ export interface XAddressObject {
10
+ hash: string;
11
+ type: string;
12
+ network: string;
13
+ prefix?: string;
14
+ }
15
+ export type XAddressInput = string | Buffer | XAddressData | PublicKey;
16
+ export declare class XAddress {
17
+ static readonly PayToPublicKeyHash = "pubkeyhash";
18
+ static readonly PayToScriptHash = "scripthash";
19
+ static readonly PayToTaproot = "taproot";
20
+ readonly prefix: string;
21
+ readonly hashBuffer: Buffer;
22
+ readonly network: Network;
23
+ readonly type: string;
24
+ constructor(data?: XAddressInput, network?: Network | string, type?: string, prefix?: string);
25
+ private _classifyArguments;
26
+ private static _transformObject;
27
+ private static _classifyFromVersion;
28
+ private static _transformString;
29
+ private static _transformBuffer;
30
+ static fromString(str: string, network?: Network | string, type?: string): XAddress;
31
+ static fromObject(obj: XAddressObject): XAddress;
32
+ static getValidationError(data: XAddressInput, network?: Network | string, type?: string): Error | null;
33
+ static isValid(data: XAddressInput, network?: Network | string, type?: string): boolean;
34
+ static _decode(address: string): XAddressData;
35
+ toBuffer(): Buffer;
36
+ toObject(): XAddressObject;
37
+ toJSON(): XAddressObject;
38
+ toXAddress(): string;
39
+ toString(): string;
40
+ isPayToPublicKeyHash(): boolean;
41
+ isPayToScriptHash(): boolean;
42
+ isPayToTaproot(): boolean;
43
+ inspect(): string;
44
+ }
45
+ //# sourceMappingURL=xaddress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xaddress.d.ts","sourceRoot":"","sources":["../../../lib/bitcore/xaddress.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAY,MAAM,eAAe,CAAA;AAIjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAmB1C,MAAM,WAAW,YAAY;IAI3B,UAAU,CAAC,EAAE,MAAM,CAAA;IAKnB,OAAO,CAAC,EAAE,OAAO,CAAA;IAOjB,IAAI,CAAC,EAAE,MAAM,CAAA;IAKb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAMD,MAAM,WAAW,cAAc;IAK7B,IAAI,EAAE,MAAM,CAAA;IAMZ,IAAI,E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AC,EAAE,OAAO,GAAG,MAAM,EAC1B,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO;IAOV,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY;IAO7C,QAAQ,IAAI,MAAM;IAWlB,QAAQ,IAAI,cAAc;IAS1B,MAAM,IAAI,cAAc;IAUxB,UAAU,IAAI,MAAM;IAepB,QAAQ,IAAI,MAAM;IAOlB,oBAAoB,IAAI,OAAO;IAO/B,iBAAiB,IAAI,OAAO;IAO5B,cAAc,IAAI,OAAO;IAOzB,OAAO,IAAI,MAAM;CAGlB"}
@@ -0,0 +1,279 @@
1
+ import { Preconditions } from './util/preconditions.js';
2
+ import { Base58 } from './encoding/base58.js';
3
+ import { BufferWriter } from './encoding/bufferwriter.js';
4
+ import { Networks } from './networks.js';
5
+ import { Hash } from './crypto/hash.js';
6
+ import { JSUtil } from './util/js.js';
7
+ import { BufferUtil } from './util/buffer.js';
8
+ const TOKEN_NAME = 'lotus';
9
+ const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
10
+ export class XAddress {
11
+ static PayToPublicKeyHash = 'pubkeyhash';
12
+ static PayToScriptHash = 'scripthash';
13
+ static PayToTaproot = 'taproot';
14
+ prefix;
15
+ hashBuffer;
16
+ network;
17
+ type;
18
+ constructor(data, network, type, prefix = TOKEN_NAME) {
19
+ if (data instanceof XAddress) {
20
+ return data;
21
+ }
22
+ Preconditions.checkArgument(data !== undefined, 'data', 'First argument is required, please include address data.', 'guide/address.html');
23
+ const networkExplicitlyProvided = network !== undefined;
24
+ network ||= Networks.defaultNetwork.name;
25
+ if (network && !Networks.get(network)) {
26
+ throw new TypeError('Second argument must be "livenet", "testnet", or "regtest".');
27
+ }
28
+ if (type &&
29
+ type !== XAddress.PayToPublicKeyHash &&
30
+ type !== XAddress.PayToScriptHash &&
31
+ type !== XAddress.PayToTaproot) {
32
+ throw new TypeError('Third argument must be "pubkeyhash", "scripthash", or "taproot".');
33
+ }
34
+ const info = this._classifyArguments(data, network, type, prefix, networkExplicitlyProvided);
35
+ info.network =
36
+ info.network || Networks.get(network) || Networks.defaultNetwork;
37
+ info.type = info.type || type || XAddress.PayToPublicKeyHash;
38
+ JSUtil.defineImmutable(this, {
39
+ prefix: info.prefix,
40
+ hashBuffer: info.hashBuffer,
41
+ network: info.network,
42
+ type: info.type,
43
+ });
44
+ }
45
+ _classifyArguments(data, network, type, prefix, networkExplicitlyProvided = true) {
46
+ if (typeof data === 'string') {
47
+ return XAddress._transformString(data, networkExplicitlyProvided ? network : undefined, type);
48
+ }
49
+ else if (Buffer.isBuffer(data) || data instanceof Uint8Array) {
50
+ return XAddress._transformBuffer(data, network, type, prefix);
51
+ }
52
+ else if (typeof data === 'object' && data !== null) {
53
+ return XAddress._transformObject(data);
54
+ }
55
+ else {
56
+ throw new TypeError('First argument is an unrecognized data format.');
57
+ }
58
+ }
59
+ static _transformObject(data) {
60
+ Preconditions.checkArgument(data.hashBuffer !== undefined, 'data', 'Must provide a `hash` or `hashBuffer` property');
61
+ Preconditions.checkArgument(data.type !== undefined, 'data', 'Must provide a `type` property');
62
+ return {
63
+ hashBuffer: data.hashBuffer || Buffer.from(data.hashBuffer.toString(), 'hex'),
64
+ network: Networks.get(data.network) || Networks.defaultNetwork,
65
+ type: data.type,
66
+ prefix: data.prefix,
67
+ };
68
+ }
69
+ static _classifyFromVersion(buffer) {
70
+ const version = {};
71
+ const pubkeyhashNetwork = Networks.get(buffer[0], 'pubkeyhash');
72
+ const scripthashNetwork = Networks.get(buffer[0], 'scripthash');
73
+ if (pubkeyhashNetwork) {
74
+ version.network = pubkeyhashNetwork;
75
+ version.type = XAddress.PayToPublicKeyHash;
76
+ }
77
+ else if (scripthashNetwork) {
78
+ version.network = scripthashNetwork;
79
+ version.type = XAddress.PayToScriptHash;
80
+ }
81
+ return version;
82
+ }
83
+ static _transformString(data, network, type) {
84
+ if (typeof data !== 'string') {
85
+ throw new TypeError('data parameter supplied is not a string.');
86
+ }
87
+ data = data.trim();
88
+ const networkObj = Networks.get(network);
89
+ if (network && !networkObj) {
90
+ throw new TypeError('Unknown network');
91
+ }
92
+ const info = XAddress._decode(data);
93
+ if (!info.network ||
94
+ (networkObj && networkObj.name !== info.network.name)) {
95
+ throw new TypeError('Address has mismatched network type.');
96
+ }
97
+ return info;
98
+ }
99
+ static _transformBuffer(buffer, network, type, prefix = TOKEN_NAME) {
100
+ const info = {};
101
+ if (!Buffer.isBuffer(buffer) && !(buffer instanceof Uint8Array)) {
102
+ throw new TypeError('XAddress supplied is not a buffer.');
103
+ }
104
+ const networkObj = Networks.get(network);
105
+ if (network && !networkObj) {
106
+ throw new TypeError('Unknown network');
107
+ }
108
+ if (type === undefined) {
109
+ throw new TypeError('Unknown type.');
110
+ }
111
+ info.prefix = prefix;
112
+ info.hashBuffer = Buffer.from(buffer);
113
+ info.network = networkObj || Networks.defaultNetwork;
114
+ info.type = type;
115
+ return info;
116
+ }
117
+ static fromString(str, network, type) {
118
+ const info = XAddress._transformString(str, network, type);
119
+ return new XAddress(info.hashBuffer, info.network, info.type);
120
+ }
121
+ static fromObject(obj) {
122
+ Preconditions.checkState(JSUtil.isHexa(obj.hash), 'Unexpected hash property, "' + obj.hash + '", expected to be hex.');
123
+ const hashBuffer = Buffer.from(obj.hash, 'hex');
124
+ return new XAddress(hashBuffer, obj.network, obj.type, obj.prefix);
125
+ }
126
+ static getValidationError(data, network, type) {
127
+ try {
128
+ new XAddress(data, network, type);
129
+ return null;
130
+ }
131
+ catch (e) {
132
+ return e;
133
+ }
134
+ }
135
+ static isValid(data, network, type) {
136
+ return !XAddress.getValidationError(data, network, type);
137
+ }
138
+ static _decode(address) {
139
+ return decode(address);
140
+ }
141
+ toBuffer() {
142
+ const version = Buffer.from([
143
+ this.network[this.type],
144
+ ]);
145
+ const buf = Buffer.concat([version, this.hashBuffer]);
146
+ return buf;
147
+ }
148
+ toObject() {
149
+ return {
150
+ prefix: this.prefix,
151
+ hash: this.hashBuffer.toString('hex'),
152
+ type: this.type,
153
+ network: this.network.toString(),
154
+ };
155
+ }
156
+ toJSON() {
157
+ return this.toObject();
158
+ }
159
+ toXAddress() {
160
+ const prefix = this.prefix;
161
+ const networkChar = getNetworkChar(this.network);
162
+ const networkByte = Buffer.from(networkChar);
163
+ const typeByte = Buffer.from([getTypeByte(this.type)]);
164
+ const payload = this.hashBuffer;
165
+ const checksum = createChecksum(prefix, networkByte, typeByte, payload);
166
+ const encodedPayload = encodePayload(typeByte, payload, checksum);
167
+ return prefix + networkChar + encodedPayload;
168
+ }
169
+ toString() {
170
+ return this.toXAddress();
171
+ }
172
+ isPayToPublicKeyHash() {
173
+ return this.type === XAddress.PayToPublicKeyHash;
174
+ }
175
+ isPayToScriptHash() {
176
+ return this.type === XAddress.PayToScriptHash;
177
+ }
178
+ isPayToTaproot() {
179
+ return this.type === XAddress.PayToTaproot;
180
+ }
181
+ inspect() {
182
+ return '<XAddress: ' + this.toString() + ', type: ' + this.type + '>';
183
+ }
184
+ }
185
+ function createChecksum(prefix, networkByte, typeByte, payload) {
186
+ const data = BufferUtil.concat([
187
+ Buffer.from(prefix),
188
+ networkByte,
189
+ typeByte,
190
+ payload,
191
+ ]);
192
+ return Hash.sha256(data).subarray(0, 4);
193
+ }
194
+ function createChecksumLegacy(prefix, networkByte, typeByte, payload) {
195
+ const bw = new BufferWriter();
196
+ bw.writeVarintNum(prefix.length);
197
+ bw.write(Buffer.from(prefix));
198
+ bw.writeUInt8(networkByte[0]);
199
+ bw.writeUInt8(typeByte[0]);
200
+ bw.writeVarintNum(payload.length);
201
+ bw.write(payload);
202
+ const buf = bw.concat();
203
+ return Hash.sha256(buf).subarray(0, 4);
204
+ }
205
+ function getType(typeByte) {
206
+ switch (typeByte) {
207
+ case 0:
208
+ return 'pubkeyhash';
209
+ case 1:
210
+ return 'scripthash';
211
+ case 2:
212
+ return 'taproot';
213
+ }
214
+ return 'pubkeyhash';
215
+ }
216
+ function getTypeByte(type) {
217
+ switch (type) {
218
+ case 'pubkeyhash':
219
+ case 'scripthash':
220
+ return 0;
221
+ case 'taproot':
222
+ return 2;
223
+ }
224
+ return 0;
225
+ }
226
+ function getNetworkFromChar(networkChar) {
227
+ switch (networkChar) {
228
+ case '_':
229
+ return Networks.get('livenet');
230
+ case 'T':
231
+ return Networks.get('testnet');
232
+ case 'R':
233
+ return Networks.get('regtest');
234
+ default:
235
+ throw new TypeError('Unknown network type: ' + networkChar);
236
+ }
237
+ }
238
+ function getNetworkChar(network) {
239
+ if (network.name === 'livenet') {
240
+ return '_';
241
+ }
242
+ else if (network.name === 'testnet') {
243
+ return 'T';
244
+ }
245
+ else if (network.name === 'regtest') {
246
+ return 'R';
247
+ }
248
+ else {
249
+ throw new TypeError('Unknown network: ' + network.name);
250
+ }
251
+ }
252
+ function encodePayload(typeByte, payload, checksum) {
253
+ const bw = new BufferWriter();
254
+ bw.writeUInt8(typeByte[0]);
255
+ bw.write(payload);
256
+ bw.write(checksum);
257
+ const buf = bw.concat();
258
+ return Base58.encode(buf);
259
+ }
260
+ function decode(address) {
261
+ const match = /[A-Z]|_/.exec(address);
262
+ const splitLocation = match ? match.index : 0;
263
+ const prefix = address.substring(0, splitLocation);
264
+ const networkChar = address.substring(splitLocation, splitLocation + 1);
265
+ const networkByte = Buffer.from(networkChar);
266
+ const encodedPayload = address.substring(splitLocation + 1);
267
+ const decodedBytes = Base58.decode(encodedPayload);
268
+ const typeByte = decodedBytes.subarray(0, 1);
269
+ const payload = decodedBytes.subarray(1, decodedBytes.length - 4);
270
+ const decodedChecksum = decodedBytes.subarray(decodedBytes.length - 4);
271
+ const checksum = createChecksum(prefix, networkByte, typeByte, payload);
272
+ Preconditions.checkArgument(checksum.toString('hex') === decodedChecksum.toString('hex'), 'checksum', 'Invalid checksum: ' + address);
273
+ const info = {};
274
+ info.hashBuffer = payload;
275
+ info.network = getNetworkFromChar(networkChar);
276
+ info.type = getType(typeByte[0]);
277
+ info.prefix = prefix;
278
+ return info;
279
+ }
@@ -0,0 +1,75 @@
1
+ export type InstanceData = {
2
+ instanceId: string;
3
+ runtimeId: string;
4
+ startTime: string;
5
+ nonce: number;
6
+ };
7
+ export type AuthorizationData = {
8
+ instanceId: string;
9
+ scriptPayload: string;
10
+ blockhash: string;
11
+ blockheight: string;
12
+ };
13
+ export type PostMeta = {
14
+ hasWalletUpvoted: boolean;
15
+ hasWalletDownvoted: boolean;
16
+ txidsUpvoted: string[];
17
+ txidsDownvoted: string[];
18
+ };
19
+ export type TransactionAPI = {
20
+ txid: string;
21
+ outIdx: number;
22
+ sats: string;
23
+ firstSeen: string;
24
+ scriptPayload: string;
25
+ instanceId?: string;
26
+ height?: number;
27
+ timestamp?: string;
28
+ };
29
+ export type TransactionRANKAPI = TransactionAPI & {
30
+ sentiment: string;
31
+ platform: string;
32
+ profileId: string;
33
+ postId?: string;
34
+ };
35
+ export type TransactionRNKCAPI = TransactionAPI & {
36
+ data: string;
37
+ feeRate: number;
38
+ platform: string;
39
+ inReplyToProfileId?: string;
40
+ inReplyToPostId?: string;
41
+ repliedProfile?: ProfileAPI;
42
+ repliedPost?: PostAPI;
43
+ };
44
+ export type ParametersAPI = {
45
+ platform: string;
46
+ profileId: string;
47
+ };
48
+ export type ProfileAPI = ParametersAPI & {
49
+ ranking: string;
50
+ satsPositive: string;
51
+ satsNegative: string;
52
+ votesPositive: number;
53
+ votesNegative: number;
54
+ ranks?: TransactionRANKAPI[];
55
+ comments?: TransactionRNKCAPI[];
56
+ posts?: PostAPI[];
57
+ };
58
+ export type PostAPI = ParametersAPI & {
59
+ ranking: string;
60
+ satsPositive: string;
61
+ satsNegative: string;
62
+ votesPositive: number;
63
+ votesNegative: number;
64
+ profile: ProfileAPI;
65
+ postId: string;
66
+ ranks?: TransactionRANKAPI[];
67
+ comments?: TransactionRNKCAPI[];
68
+ data?: string;
69
+ postMeta?: PostMeta;
70
+ };
71
+ export declare const AuthenticateHeader: {
72
+ scheme: string;
73
+ param: string[];
74
+ };
75
+ //# sour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