@xyo-network/xl1-protocol-sdk 1.26.18 → 1.26.19
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HydratedBlock,
|
|
1
|
+
import type { HydratedBlock, TransactionBoundWitnessWithHashMeta } from '@xyo-network/xl1-protocol-lib';
|
|
2
2
|
/** transactionsFromHydratedBlock constant. */
|
|
3
|
-
export declare const transactionsFromHydratedBlock: (block: HydratedBlock) =>
|
|
3
|
+
export declare const transactionsFromHydratedBlock: (block: HydratedBlock) => TransactionBoundWitnessWithHashMeta[];
|
|
4
4
|
//# sourceMappingURL=transactionsFromHydratedBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactionsFromHydratedBlock.d.ts","sourceRoot":"","sources":["../../../../src/block/hydrate/transactionsFromHydratedBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"transactionsFromHydratedBlock.d.ts","sourceRoot":"","sources":["../../../../src/block/hydrate/transactionsFromHydratedBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,mCAAmC,EAAE,MAAM,+BAA+B,CAAA;AAGvG,8CAA8C;AAC9C,eAAO,MAAM,6BAA6B,GAAI,OAAO,aAAa,KAAG,mCAAmC,EAEvG,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -379,14 +379,14 @@ var hydrateBlock = async (context, hash, maxDepth = 1, minDepth = maxDepth) => {
|
|
|
379
379
|
};
|
|
380
380
|
|
|
381
381
|
// src/block/hydrate/transactionsFromHydratedBlock.ts
|
|
382
|
-
import {
|
|
382
|
+
import { isTransactionBoundWitnessWithHashMeta } from "@xyo-network/xl1-protocol-lib";
|
|
383
383
|
var transactionsFromHydratedBlock = (block) => {
|
|
384
|
-
return block[1].filter(
|
|
384
|
+
return block[1].filter(isTransactionBoundWitnessWithHashMeta);
|
|
385
385
|
};
|
|
386
386
|
|
|
387
387
|
// src/block/hydrate/tryHydrateBlock.ts
|
|
388
388
|
import { assertEx as assertEx5 } from "@xylabs/sdk-js";
|
|
389
|
-
import { isBlockBoundWitnessWithStorageMeta, isTransactionBoundWitnessWithStorageMeta as
|
|
389
|
+
import { isBlockBoundWitnessWithStorageMeta, isTransactionBoundWitnessWithStorageMeta as isTransactionBoundWitnessWithStorageMeta2 } from "@xyo-network/xl1-protocol-lib";
|
|
390
390
|
var tryHydrateBlock = async (archivist, hash, maxDepth = 1) => {
|
|
391
391
|
assertEx5(maxDepth >= 0, () => "maxDepth must be greater than or equal to 0");
|
|
392
392
|
const bw = (await archivist.get([hash])).find(isBlockBoundWitnessWithStorageMeta);
|
|
@@ -394,7 +394,7 @@ var tryHydrateBlock = async (archivist, hash, maxDepth = 1) => {
|
|
|
394
394
|
if (maxDepth === 0) return [bw, []];
|
|
395
395
|
const blkPayloads = await archivist.get(bw.payload_hashes);
|
|
396
396
|
if (maxDepth === 1) return [bw, blkPayloads];
|
|
397
|
-
const transactions = blkPayloads.filter(
|
|
397
|
+
const transactions = blkPayloads.filter(isTransactionBoundWitnessWithStorageMeta2);
|
|
398
398
|
const transactionsPayloadHashes = transactions.flatMap((tx) => tx.payload_hashes);
|
|
399
399
|
const transactionsPayloads = await archivist.get(transactionsPayloadHashes);
|
|
400
400
|
const allPayloadsHashes = new Set([...blkPayloads, ...transactionsPayloads].flatMap((p) => p._hash));
|
|
@@ -1628,7 +1628,7 @@ var hydratedTransactionToPayloadBundle = (transaction) => {
|
|
|
1628
1628
|
return bundle2(root, transaction);
|
|
1629
1629
|
};
|
|
1630
1630
|
var bundle2 = (root, transaction) => {
|
|
1631
|
-
const payloads = flattenHydratedTransaction(transaction)
|
|
1631
|
+
const payloads = flattenHydratedTransaction(transaction);
|
|
1632
1632
|
return new PayloadBuilder11({ schema: PayloadBundleSchema2 }).fields({ payloads, root }).build();
|
|
1633
1633
|
};
|
|
1634
1634
|
|
|
@@ -4829,7 +4829,7 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
|
|
|
4829
4829
|
if (!validationPassed) {
|
|
4830
4830
|
this.logger?.info(`Pruning block bundle ${bundle3._hash} during simpleValidationCheck`);
|
|
4831
4831
|
this.logger?.info(` - chainId match: ${chainIdPassed}`);
|
|
4832
|
-
this.logger?.info(` - blockNumber check: ${blockNumberPassed}`);
|
|
4832
|
+
this.logger?.info(` - blockNumber check: ${blockNumberPassed} [${headNumber}|${block?.[0].block}]`);
|
|
4833
4833
|
this.logger?.info(` - typeCheck: ${typeCheckPassed}`);
|
|
4834
4834
|
this.logger?.info(` - bundle hash: ${bundle3._hash}`);
|
|
4835
4835
|
}
|
|
@@ -5842,7 +5842,7 @@ import {
|
|
|
5842
5842
|
asSignedHydratedTransactionWithHashMeta,
|
|
5843
5843
|
asSignedTransactionBoundWitness,
|
|
5844
5844
|
BlockViewerMoniker as BlockViewerMoniker6,
|
|
5845
|
-
isTransactionBoundWitnessWithHashMeta,
|
|
5845
|
+
isTransactionBoundWitnessWithHashMeta as isTransactionBoundWitnessWithHashMeta2,
|
|
5846
5846
|
TransactionViewerMoniker
|
|
5847
5847
|
} from "@xyo-network/xl1-protocol-lib";
|
|
5848
5848
|
var SimpleTransactionViewer = class extends AbstractCreatableProvider {
|
|
@@ -5860,7 +5860,7 @@ var SimpleTransactionViewer = class extends AbstractCreatableProvider {
|
|
|
5860
5860
|
const blockBoundWitnessIndexes = block[0].payload_schemas.map((schema, index) => schema === BoundWitnessSchema ? index : void 0).filter(exists10);
|
|
5861
5861
|
const blockBoundWitnessHashes = new Set(blockBoundWitnessIndexes.map((index) => block[0].payload_hashes[index]));
|
|
5862
5862
|
const blockBoundWitnesses = block[1].filter((payload) => blockBoundWitnessHashes.has(payload._hash) || blockBoundWitnessHashes.has(payload._dataHash));
|
|
5863
|
-
const blockTransactionBoundWitnesses = blockBoundWitnesses.filter(
|
|
5863
|
+
const blockTransactionBoundWitnesses = blockBoundWitnesses.filter(isTransactionBoundWitnessWithHashMeta2);
|
|
5864
5864
|
const transaction = blockTransactionBoundWitnesses.at(transactionIndex);
|
|
5865
5865
|
if (!transaction) return null;
|
|
5866
5866
|
return await this.byHash(transaction._hash);
|