@bsv/wallet-toolbox-mobile 1.5.0 → 1.5.8

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 (55) hide show
  1. package/out/src/CWIStyleWalletManager.d.ts.map +1 -1
  2. package/out/src/CWIStyleWalletManager.js +40 -5
  3. package/out/src/CWIStyleWalletManager.js.map +1 -1
  4. package/out/src/WalletPermissionsManager.d.ts.map +1 -1
  5. package/out/src/WalletPermissionsManager.js +10 -29
  6. package/out/src/WalletPermissionsManager.js.map +1 -1
  7. package/out/src/monitor/tasks/TaskReviewStatus.d.ts +1 -1
  8. package/out/src/monitor/tasks/TaskReviewStatus.js +1 -1
  9. package/out/src/services/chaintracker/{BhsChainTracker.d.ts → BHServiceClient.d.ts} +12 -16
  10. package/out/src/services/chaintracker/BHServiceClient.d.ts.map +1 -0
  11. package/out/src/services/chaintracker/BHServiceClient.js +163 -0
  12. package/out/src/services/chaintracker/BHServiceClient.js.map +1 -0
  13. package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts +140 -0
  14. package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts.map +1 -0
  15. package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js +467 -0
  16. package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js.map +1 -0
  17. package/out/src/services/chaintracker/chaintracks/util/dirtyHashes.d.ts +20 -0
  18. package/out/src/services/chaintracker/chaintracks/util/dirtyHashes.d.ts.map +1 -0
  19. package/out/src/services/chaintracker/chaintracks/util/dirtyHashes.js +31 -0
  20. package/out/src/services/chaintracker/chaintracks/util/dirtyHashes.js.map +1 -0
  21. package/out/src/services/chaintracker/index.d.ts +1 -1
  22. package/out/src/services/chaintracker/index.js +1 -1
  23. package/out/src/services/createDefaultWalletServicesOptions.d.ts +1 -1
  24. package/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -1
  25. package/out/src/services/createDefaultWalletServicesOptions.js +10 -7
  26. package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -1
  27. package/out/src/storage/WalletStorageManager.d.ts +19 -25
  28. package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
  29. package/out/src/storage/WalletStorageManager.js +64 -69
  30. package/out/src/storage/WalletStorageManager.js.map +1 -1
  31. package/out/src/storage/methods/createAction.d.ts.map +1 -1
  32. package/out/src/storage/methods/createAction.js +9 -4
  33. package/out/src/storage/methods/createAction.js.map +1 -1
  34. package/out/src/storage/methods/processAction.js +1 -1
  35. package/out/src/storage/methods/processAction.js.map +1 -1
  36. package/out/src/utility/utilityHelpers.buffer.d.ts +18 -0
  37. package/out/src/utility/utilityHelpers.buffer.d.ts.map +1 -0
  38. package/out/src/utility/utilityHelpers.buffer.js +45 -0
  39. package/out/src/utility/utilityHelpers.buffer.js.map +1 -0
  40. package/package.json +5 -5
  41. package/out/src/SetupClient.mobile.d.ts +0 -90
  42. package/out/src/SetupClient.mobile.d.ts.map +0 -1
  43. package/out/src/SetupClient.mobile.js +0 -183
  44. package/out/src/SetupClient.mobile.js.map +0 -1
  45. package/out/src/SetupWallet.mobile.d.ts +0 -93
  46. package/out/src/SetupWallet.mobile.d.ts.map +0 -1
  47. package/out/src/SetupWallet.mobile.js +0 -3
  48. package/out/src/SetupWallet.mobile.js.map +0 -1
  49. package/out/src/services/chaintracker/BhsChainTracker.d.ts.map +0 -1
  50. package/out/src/services/chaintracker/BhsChainTracker.js +0 -84
  51. package/out/src/services/chaintracker/BhsChainTracker.js.map +0 -1
  52. package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts +0 -98
  53. package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts.map +0 -1
  54. package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js +0 -38
  55. package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js.map +0 -1
@@ -1,93 +0,0 @@
1
- import { PrivateKey, KeyDeriver, PublicKey } from '@bsv/sdk';
2
- import { WalletStorageManager, Monitor, sdk } from './index.mobile';
3
- import { Services } from './services';
4
- import { Wallet } from './Wallet';
5
- /**
6
- * When creating a BRC-100 compatible `Wallet`, many components come into play.
7
- *
8
- * All of the `createWallet` functions in the `Setup` and `SetupClient` classes return
9
- * an object with direct access to each component to facilitate experimentation, testing
10
- * and customization.
11
- */
12
- export interface SetupWallet {
13
- /**
14
- * The rootKey of the `KeyDeriver`. The private key from which other keys are derived.
15
- */
16
- rootKey: PrivateKey;
17
- /**
18
- * The pubilc key associated with the `rootKey` which also serves as the wallet's identity.
19
- */
20
- identityKey: string;
21
- /**
22
- * The `KeyDeriver` component used by the wallet for key derivation and cryptographic functions.
23
- */
24
- keyDeriver: KeyDeriver;
25
- /**
26
- * The chain ('main' or 'test') which the wallet accesses.
27
- */
28
- chain: sdk.Chain;
29
- /**
30
- * The `WalletStorageManager` that manages all the configured storage providers (active and backups)
31
- * accessed by the wallet.
32
- */
33
- storage: WalletStorageManager;
34
- /**
35
- * The network `Services` component which provides the wallet with access to external services hosted
36
- * on the public network.
37
- */
38
- services: Services;
39
- /**
40
- * The background task `Monitor` component available to the wallet to offload tasks
41
- * that speed up wallet operations and maintain data integrity.
42
- */
43
- monitor: Monitor;
44
- /**
45
- * The actual BRC-100 `Wallet` to which all the other properties and components contribute.
46
- *
47
- * Note that internally, the wallet is itself linked to all these properties and components.
48
- * They are included in this interface to facilitate access after wallet construction for
49
- * experimentation, testing and customization. Any changes made to the configuration of these
50
- * properties and components may thus directly impact your wallet.
51
- */
52
- wallet: Wallet;
53
- }
54
- /**
55
- * A private key and associated public key and address.
56
- */
57
- export interface KeyPairAddress {
58
- privateKey: PrivateKey;
59
- publicKey: PublicKey;
60
- address: string;
61
- }
62
- /**
63
- * Arguments used by `createWallet` to construct a `SetupWallet`.
64
- *
65
- * Extension `SetupWalletClientArgs` used by `createWalletClient` to construct a `SetupWalletClient`.
66
- *
67
- * @publicbody
68
- */
69
- export interface SetupClientWalletArgs {
70
- chain: sdk.Chain;
71
- rootKeyHex: string;
72
- /**
73
- * When requesting privileged operations (e.g., sign), this method will be called
74
- * to allow signing. This method will automatically be linked to a key derivation
75
- * path known to be privileged, if available.
76
- */
77
- privilegedKeyGetter?: () => Promise<PrivateKey>;
78
- active?: sdk.WalletStorageProvider;
79
- backups?: sdk.WalletStorageProvider[];
80
- taalApiKey?: string;
81
- }
82
- /**
83
- * Extension `SetupWalletClient` of `SetupWallet` is returned by `createWalletClient`
84
- */
85
- export interface SetupWalletClient extends SetupWallet {
86
- /**
87
- * The endpoint URL of a service hosting the `StorageServer` JSON-RPC service to
88
- * which the wallet's `StorageClient` is connected to function as
89
- * the active storage provider of the wallet.
90
- */
91
- endpointUrl: string;
92
- }
93
- //# sourceMappingURL=SetupWallet.mobile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SetupWallet.mobile.d.ts","sourceRoot":"","sources":["../../../src/SetupWallet.mobile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC;;;;;;GAMG;AAEH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,OAAO,EAAE,UAAU,CAAA;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,UAAU,EAAE,UAAU,CAAA;IACtB;;OAEG;IACH,KAAK,EAAE,GAAG,CAAC,KAAK,CAAA;IAChB;;;OAGG;IACH,OAAO,EAAE,oBAAoB,CAAA;IAC7B;;;OAGG;IACH,QAAQ,EAAE,QAAQ,CAAA;IAClB;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,SAAS,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAA;IAC/C,MAAM,CAAC,EAAE,GAAG,CAAC,qBAAqB,CAAA;IAClC,OAAO,CAAC,EAAE,GAAG,CAAC,qBAAqB,EAAE,CAAA;IACrC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAA;CACpB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=SetupWallet.mobile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SetupWallet.mobile.js","sourceRoot":"","sources":["../../../src/SetupWallet.mobile.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BhsChainTracker.d.ts","sourceRoot":"","sources":["../../../../../src/services/chaintracker/BhsChainTracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAA;AAClH,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;CACf;AAED,qBAAa,eAAgB,YAAW,w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kB,IAAI,OAAO,CAAC,WAAW,CAAC;IAI1C,kBAAkB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAI3D,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAIpC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvD,SAAS,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAI5C"}
@@ -1,84 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BHServiceClient = void 0;
4
- const sdk_1 = require("@bsv/sdk");
5
- const ChaintracksServiceClient_1 = require("./chaintracks/ChaintracksServiceClient");
6
- class BHServiceClient {
7
- constructor(chain, options) {
8
- this.bhs = new sdk_1.BlockHeadersService(options.url, { apiKey: options.apiKey });
9
- this.cache = {};
10
- this.chain = chain;
11
- this.serviceUrl = options.url;
12
- this.opts = options;
13
- this.options = ChaintracksServiceClient_1.ChaintracksServiceClient.createChaintracksServiceClientOptions();
14
- this.options.useAuthrite = true;
15
- }
16
- async currentHeight() {
17
- return await this.bhs.currentHeight();
18
- }
19
- async isValidRootForHeight(root, height) {
20
- const cachedRoot = this.cache[height];
21
- if (cachedRoot) {
22
- return cachedRoot === root;
23
- }
24
- const isValid = await this.bhs.isValidRootForHeight(root, height);
25
- this.cache[height] = root;
26
- return isValid;
27
- }
28
- async getPresentHeight() {
29
- return await this.bhs.currentHeight();
30
- }
31
- async findHeaderForHeight(height) {
32
- return undefined;
33
- }
34
- async findHeaderForBlockHash(hash) {
35
- return undefined;
36
- }
37
- async findHeaderForMerkleRoot(merkleRoot, height) {
38
- return undefined;
39
- }
40
- async getHeaders(height, count) {
41
- return '';
42
- }
43
- async startListening() {
44
- return;
45
- }
46
- async listening() {
47
- return;
48
- }
49
- async isSynchronized() {
50
- return true;
51
- }
52
- async getChain() {
53
- return this.chain;
54
- }
55
- async isListening() {
56
- return true;
57
- }
58
- async getChainTipHeader() {
59
- return undefined;
60
- }
61
- async findChainTipHashHex() {
62
- return '';
63
- }
64
- async findChainWorkForBlockHash(hash) {
65
- return undefined;
66
- }
67
- async findChainTipHeader() {
68
- return undefined;
69
- }
70
- async getJsonOrUndefined(path) {
71
- return undefined;
72
- }
73
- async getJson(path) {
74
- return {};
75
- }
76
- async postJsonVoid(path, params) {
77
- return;
78
- }
79
- async addHeader(header) {
80
- return;
81
- }
82
- }
83
- exports.BHServiceClient = BHServiceClient;
84
- //# sourceMappingURL=BhsChainTracker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BhsChainTracker.js","sourceRoot":"","sources":["../../../../../src/services/chaintracker/BhsChainTracker.ts"],"names":[],"mappings":";;;AAAA,kCAA8C;AAC9C,qFAAkH;AASlH,MAAa,eAAe;IAQ1B,YAAY,KAAgB,EAAE,OAA+B;QAC3D,IAAI,CAAC,GAAG,GAAG,IAAI,yBAAmB,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;QAC3E,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,GAAG,CAAA;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAA;QACnB,IAAI,CAAC,OAAO,GAAG,mDAAwB,CAAC,qCAAqC,EAAE,CAAA;QAC/E,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAA;IACjC,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAA;IACvC,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,IAAY,EAAE,MAAc;QACrD,MAAM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C,kBAAkB;QACtB,OAAO,SAAmC,CAAA;IAC5C,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAI,IAAY;QACtC,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,OAAO,CAAI,IAAY;QAC3B,OAAO,EAAO,CAAA;IAChB,CAAC;IAED,KAAK,CAAC,YAAY,CAAI,IAAY,EAAE,MAAS;QAC3C,OAAM;IACR,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,MAAW;QACzB,OAAM;IACR,CAAC;CAEF;AAxGD,0CAwGC"}
@@ -1,98 +0,0 @@
1
- /**
2
- * These are fields of 80 byte serialized header in order whose double sha256 hash is a block's hash value
3
- * and the next block's previousHash value.
4
- *
5
- * All block hash values and merkleRoot values are 32 byte hex string values with the byte order reversed from the serialized byte order.
6
- */
7
- export interface BaseBlockHeader {
8
- /**
9
- * Block header version value. Serialized length is 4 bytes.
10
- */
11
- version: number;
12
- /**
13
- * Hash of previous block's block header. Serialized length is 32 bytes.
14
- */
15
- previousHash: string;
16
- /**
17
- * Root hash of the merkle tree of all transactions in this block. Serialized length is 32 bytes.
18
- */
19
- merkleRoot: string;
20
- /**
21
- * Block header time value. Serialized length is 4 bytes.
22
- */
23
- time: number;
24
- /**
25
- * Block header bits value. Serialized length is 4 bytes.
26
- */
27
- bits: number;
28
- /**
29
- * Block header nonce value. Serialized length is 4 bytes.
30
- */
31
- nonce: number;
32
- }
33
- /**
34
- * A `BaseBlockHeader` extended with its computed hash and height in its chain.
35
- */
36
- export interface BlockHeader extends BaseBlockHeader {
37
- /**
38
- * Height of the header, starting from zero.
39
- */
40
- height: number;
41
- /**
42
- * The double sha256 hash of the serialized `BaseBlockHeader` fields.
43
- */
44
- hash: string;
45
- }
46
- /**
47
- * The "live" portion of the block chain is recent history that can conceivably be subject to reorganizations.
48
- * The additional fields support tracking orphan blocks, chain forks, and chain reorgs.
49
- */
50
- export interface LiveBlockHeader extends BlockHeader {
51
- /**
52
- * The cummulative chainwork achieved by the addition of this block to the chain.
53
- * Chainwork only matters in selecting the active chain.
54
- */
55
- chainWork: string;
56
- /**
57
- * True only if this header is currently a chain tip. e.g. There is no header that follows it by previousHash or previousHeaderId.
58
- */
59
- isChainTip: boolean;
60
- /**
61
- * True only if this header is currently on the active chain.
62
- */
63
- isActive: boolean;
64
- /**
65
- * As there may be more than one header with identical height values due to orphan tracking,
66
- * headers are assigned a unique headerId while part of the "live" portion of the block chain.
67
- */
68
- headerId: number;
69
- /**
70
- * Every header in the "live" portion of the block chain is linked to an ancestor header through
71
- * both its previousHash and previousHeaderId properties.
72
- *
73
- * Due to forks, there may be multiple headers with identical `previousHash` and `previousHeaderId` values.
74
- * Of these, only one (the header on the active chain) will have `isActive` === true.
75
- */
76
- previousHeaderId: number | null;
77
- }
78
- /**
79
- * Type guard function.
80
- * @publicbody
81
- */
82
- export declare function isLive(header: BlockHeader | LiveBlockHeader): header is LiveBlockHeader;
83
- /**
84
- * Type guard function.
85
- * @publicbody
86
- */
87
- export declare function isBaseBlockHeader(header: BaseBlockHeader | BlockHeader | LiveBlockHeader): header is BaseBlockHeader;
88
- /**
89
- * Type guard function.
90
- * @publicbody
91
- */
92
- export declare function isBlockHeader(header: BaseBlockHeader | BlockHeader | LiveBlockHeader): header is LiveBlockHeader;
93
- /**
94
- * Type guard function.
95
- * @publicbody
96
- */
97
- export declare function isLiveBlockHeader(header: BaseBlockHeader | BlockHeader | LiveBlockHeader): header is LiveBlockHeader;
98
- //# sourceMappingURL=BlockHeaderApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockHeaderApi.d.ts","sourceRoot":"","sources":["../../../../../../src/services/chaintracker/chaintracks/BlockHeaderApi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;;OAMG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;CAChC;AAMD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,eAAe,GAAG,MAAM,IAAI,eAAe,CAEvF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,GAAG,eAAe,GAAG,MAAM,IAAI,eAAe,CAEpH;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,GAAG,eAAe,GAAG,MAAM,IAAI,eAAe,CAEhH;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,GAAG,eAAe,GAAG,MAAM,IAAI,eAAe,CAEpH"}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isLive = isLive;
4
- exports.isBaseBlockHeader = isBaseBlockHeader;
5
- exports.isBlockHeader = isBlockHeader;
6
- exports.isLiveBlockHeader = isLiveBlockHeader;
7
- //
8
- // TYPE GUARDS
9
- //
10
- /**
11
- * Type guard function.
12
- * @publicbody
13
- */
14
- function isLive(header) {
15
- return header.headerId !== undefined;
16
- }
17
- /**
18
- * Type guard function.
19
- * @publicbody
20
- */
21
- function isBaseBlockHeader(header) {
22
- return typeof header.previousHash === 'string';
23
- }
24
- /**
25
- * Type guard function.
26
- * @publicbody
27
- */
28
- function isBlockHeader(header) {
29
- return 'height' in header && typeof header.previousHash === 'string';
30
- }
31
- /**
32
- * Type guard function.
33
- * @publicbody
34
- */
35
- function isLiveBlockHeader(header) {
36
- return 'chainwork' in header && typeof header.previousHash === 'string';
37
- }
38
- //# sourceMappingURL=BlockHeaderApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockHeaderApi.js","sourceRoot":"","sources":["../../../../../../src/services/chaintracker/chaintracks/BlockHeaderApi.ts"],"names":[],"mappings":";;AAwFA,wBAEC;AAMD,8CAEC;AAMD,sCAEC;AAMD,8CAEC;AAlCD,EAAE;AACF,cAAc;AACd,EAAE;AAEF;;;GAGG;AACH,SAAgB,MAAM,CAAC,MAAqC;IAC1D,OAAQ,MAA0B,CAAC,QAAQ,KAAK,SAAS,CAAA;AAC3D,CAAC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,MAAuD;IACvF,OAAO,OAAO,MAAM,CAAC,YAAY,KAAK,QAAQ,CAAA;AAChD,CAAC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,MAAuD;IACnF,OAAO,QAAQ,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,YAAY,KAAK,QAAQ,CAAA;AACtE,CAAC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,MAAuD;IACvF,OAAO,WAAW,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,YAAY,KAAK,QAAQ,CAAA;AACzE,CAAC"}