@xyo-network/xl1-protocol 5.8.3 → 5.8.5
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/neutral/modules/protocol-lib/providers/XyoClient.d.ts +5 -1
- package/dist/neutral/modules/protocol-lib/providers/XyoClient.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-lib/transaction/elevatedPayloads.d.ts +6 -1
- package/dist/neutral/modules/protocol-lib/transaction/elevatedPayloads.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-lib/transaction/script.d.ts +21 -9
- package/dist/neutral/modules/protocol-lib/transaction/script.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-lib/viewers/Block.d.ts +1 -1
- package/dist/neutral/modules/protocol-lib/viewers/Block.d.ts.map +1 -1
- package/dist/neutral/modules/protocol-lib/viewers/Transaction.d.ts +1 -1
- package/dist/neutral/modules/protocol-lib/viewers/Transaction.d.ts.map +1 -1
- package/dist/neutral/modules/validation/block/validators/BlockCumulativeBalanceValidator.d.ts.map +1 -1
- package/dist/neutral/modules/validation/block/validators/BlockTransactionUniquenessValidator.d.ts +4 -0
- package/dist/neutral/modules/validation/block/validators/BlockTransactionUniquenessValidator.d.ts.map +1 -1
- package/dist/neutral/modules/validation/block/validators/transactionsReferencedByBlock.d.ts +4 -0
- package/dist/neutral/modules/validation/block/validators/transactionsReferencedByBlock.d.ts.map +1 -0
- package/dist/neutral/protocol-lib.mjs +57 -44
- package/dist/neutral/protocol-lib.mjs.map +3 -3
- package/dist/neutral/validation.mjs +12 -5
- package/dist/neutral/validation.mjs.map +4 -4
- package/package.json +6 -6
|
@@ -11,7 +11,11 @@ export interface XyoGatewayConfig {
|
|
|
11
11
|
}
|
|
12
12
|
/** @deprecated */
|
|
13
13
|
export interface XyoRpcGatewayConfig extends XyoGatewayConfig {
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Build the lake with `createRestDataLakeViewer(url)` and
|
|
16
|
+
* `createRestDataLakeRunner(url)`. Bind `DataLakeViewer` and `DataLakeRunner`
|
|
17
|
+
* through the locator. This field/method/option is removed in 6.0.
|
|
18
|
+
*/
|
|
15
19
|
dataLakeEndpoint: string;
|
|
16
20
|
/** `networkEndpoint` value exposed by this contract. */
|
|
17
21
|
networkEndpoint: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoClient.d.ts","sourceRoot":"","sources":["../../../../../src/modules/protocol-lib/providers/XyoClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,kBAAkB;AAClB,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,kBAAkB;AAClB,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D
|
|
1
|
+
{"version":3,"file":"XyoClient.d.ts","sourceRoot":"","sources":["../../../../../src/modules/protocol-lib/providers/XyoClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,kBAAkB;AAClB,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,kBAAkB;AAClB,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAA;IACxB,wDAAwD;IACxD,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,sCAAsC;AACtC,MAAM,WAAW,SAAS;IACxB,mDAAmD;IACnD,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,iDAAiD;IACjD,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;IAClE,iDAAiD;IACjD,WAAW,EAAE,cAAc,CAAA;IAC3B,0FAA0F;IAC1F,aAAa,CAAC,EAAE,mBAAmB,CAAA;IAEnC,kBAAkB;IAClB,UAAU,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,mBAAmB,GAAG,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACvG,kBAAkB;IAClB,aAAa,CAAC,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACjD"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { WithHashMeta } from '@xyo-network/sdk';
|
|
2
2
|
import type { AllowedBlockPayload, HydratedTransactionWithHashMeta } from '../../protocol-model/index.js';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Returns payloads named by canonical elevate operations.
|
|
5
|
+
*
|
|
6
|
+
* Non-canonical `elevate|` operations are skipped. Returns undefined when a
|
|
7
|
+
* canonical hash does not resolve to an allowed payload.
|
|
8
|
+
*/
|
|
4
9
|
export declare function tryElevatedPayloads([tx, payloads]: HydratedTransactionWithHashMeta): WithHashMeta<AllowedBlockPayload>[] | undefined;
|
|
5
10
|
/** Returns all elevated payloads referenced by a transaction script. */
|
|
6
11
|
export declare function elevatedPayloads(tx: HydratedTransactionWithHashMeta): WithHashMeta<AllowedBlockPayload>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elevatedPayloads.d.ts","sourceRoot":"","sources":["../../../../../src/modules/protocol-lib/transaction/elevatedPayloads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"elevatedPayloads.d.ts","sourceRoot":"","sources":["../../../../../src/modules/protocol-lib/transaction/elevatedPayloads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAA;AAK3F;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,+BAA+B,GAAG,YAAY,CAAC,mBAAmB,CAAC,EAAE,GAAG,SAAS,CAUpI;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,+BAA+B,GAAG,YAAY,CAAC,mBAAmB,CAAC,EAAE,CAMzG"}
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import { type Hash } from '@ariestools/sdk';
|
|
2
2
|
import type { WithHashMeta } from '@xyo-network/sdk';
|
|
3
3
|
import type { AllowedBlockPayload, HydratedTransactionWithHashMeta } from '../../protocol-model/index.js';
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Parses one script operation.
|
|
6
|
+
*
|
|
7
|
+
* Accepts only `elevate|` followed by 64 lowercase hex characters. Every other
|
|
8
|
+
* string, including non-canonical `elevate|` forms, returns undefined. Never throws.
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseElevateOperation(op: string): Hash | undefined;
|
|
11
|
+
/** Returns hashes from canonical `elevate|` operations. Skips every other operation and never throws. */
|
|
12
|
+
export declare function tryExtractElevatedHashesFromScript(strings: string[]): Hash[];
|
|
13
|
+
/** Returns elevate hashes and throws when any `elevate|` operation is not canonical. */
|
|
14
|
+
export declare function extractElevatedHashesFromScript(strings: string[]): Hash[];
|
|
15
|
+
/** Resolves payloads named by canonical elevate operations. Skips every other operation and never throws. */
|
|
16
|
+
export declare function tryExtractElevatedHashes(tx: HydratedTransactionWithHashMeta): WithHashMeta<AllowedBlockPayload>[];
|
|
10
17
|
/**
|
|
11
18
|
* Returns a copy of the transaction that excludes non-elevated payloads — i.e. only what ends up on chain.
|
|
12
19
|
* The payloads must carry hash meta so the elevated script hashes can be resolved.
|
|
20
|
+
* Non-canonical elevate operations are omitted rather than throwing.
|
|
21
|
+
*/
|
|
22
|
+
export declare function elevatedTransaction<T extends HydratedTransactionWithHashMeta>(tx: T): T;
|
|
23
|
+
/**
|
|
24
|
+
* Resolves elevated payloads and throws when any `elevate|` operation is not
|
|
25
|
+
* canonical or does not resolve to an allowed payload. The count is the raw
|
|
26
|
+
* number of `elevate|` operations.
|
|
13
27
|
*/
|
|
14
|
-
export declare
|
|
15
|
-
/** Resolves elevated payloads from a transaction and throws if script references are invalid. */
|
|
16
|
-
export declare const extractElevatedHashes: (tx: HydratedTransactionWithHashMeta) => WithHashMeta<AllowedBlockPayload>[];
|
|
28
|
+
export declare function extractElevatedHashes(tx: HydratedTransactionWithHashMeta): WithHashMeta<AllowedBlockPayload>[];
|
|
17
29
|
//# sourceMappingURL=script.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../../../src/modules/protocol-lib/transaction/script.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../../../src/modules/protocol-lib/transaction/script.ts"],"names":[],"mappings":"AAAA,OAAO,EACK,KAAK,IAAI,EACpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAGpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAA;AAK3F;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAIlE;AAYD,yGAAyG;AACzG,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAO5E;AAED,wFAAwF;AACxF,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAEzE;AAED,6GAA6G;AAC7G,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,+BAA+B,GAAG,YAAY,CAAC,mBAAmB,CAAC,EAAE,CAOjH;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,+BAA+B,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAGvF;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,+BAA+B,GAAG,YAAY,CAAC,mBAAmB,CAAC,EAAE,CAS9G"}
|
|
@@ -41,7 +41,7 @@ export interface BlockViewerMethods {
|
|
|
41
41
|
blocksByStep(stepLevel: number, stepIndex: number): Promisable<SignedHydratedBlockWithHashMeta[]>;
|
|
42
42
|
/** Returns the current signed and hydrated chain head. */
|
|
43
43
|
currentBlock(): Promisable<SignedHydratedBlockWithHashMeta>;
|
|
44
|
-
/** Returns
|
|
44
|
+
/** Returns payloads from the gateway store for the supplied hashes, omitting hashes the store cannot resolve. Does not consult a datalake. */
|
|
45
45
|
payloadsByHash(hashes: Hash[]): Promisable<WithHashMeta<Payload>[]>;
|
|
46
46
|
}
|
|
47
47
|
/** Moniker identifier for the BlockViewer provider. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Block.d.ts","sourceRoot":"","sources":["../../../../../src/modules/protocol-lib/viewers/Block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAC1C,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE7D,OAAO,KAAK,EACV,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,eAAe,EAAE,+BAA+B,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAC3H,MAAM,iBAAiB,CAAA;AAExB,uDAAuD;AACvD,MAAM,WAAW,2BAA2B;IAC1C,0CAA0C;IAC1C,KAAK,EAAE,+BAA+B,CAAA;CACvC;AAED,2CAA2C;AAC3C,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD;;;;OAIG;IACH,WAAW,EAAE,2BAA2B,CAAA;CACzC;AAED,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,iGAAiG;IACjG,sBAAsB,CAAC,eAAe,EAAE,IAAI,GAAG,UAAU,CAAC,+BAA+B,GAAG,IAAI,CAAC,CAAA;IACjG;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,+BAA+B,EAAE,CAAC,CAAA;IACvF;;;;;;;;;;OAUG;IACH,cAAc,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,+BAA+B,EAAE,CAAC,CAAA;IACpG,0EAA0E;IAC1E,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,CAAC,+BAA+B,EAAE,CAAC,CAAA;IACjG,0DAA0D;IAC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a,GAAG,UAAU,CAAC,SAAS,CAAC,CAAA;IACjF,8EAA8E;IAC9E,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAA;IAC7H,sEAAsE;IACtE,gBAAgB,CACd,UAAU,EAAE,gBAAgB,EAC5B,gBAAgB,CAAC,EAAE,cAAc,EACjC,QAAQ,CAAC,EAAE,MAAM,aAAa,EAC9B,WAAW,CAAC,EAAE,MAAM,EACpB,WAAW,CAAC,EAAE,MAAM,GACnB,UAAU,CAAC,SAAS,CAAC,CAAA;CACzB"}
|
|
@@ -2,7 +2,7 @@ import type { Hash, Promisable } from '@ariestools/sdk';
|
|
|
2
2
|
import type { Provider, ProviderMoniker, SignedHydratedTransaction, SignedHydratedTransactionWithHashMeta } from '../../protocol-model/index.js';
|
|
3
3
|
/** Operations exposed by the Transaction Viewer contract. */
|
|
4
4
|
export interface TransactionViewerMethods {
|
|
5
|
-
/** Returns the
|
|
5
|
+
/** Returns the transaction from the gateway store. Off-chain bodies are not read from a datalake. */
|
|
6
6
|
byHash(transactionHash: Hash): Promisable<SignedHydratedTransactionWithHashMeta | null>;
|
|
7
7
|
/** @deprecated use .byBlockHashAndIndex instead */
|
|
8
8
|
transactionByBlockHashAndIndex(blockHash: Hash, transactionIndex: number): Promisable<SignedHydratedTransaction | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../../../../src/modules/protocol-lib/viewers/Transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEvD,OAAO,KAAK,EACV,QAAQ,EAAE,eAAe,EAAE,yBAAyB,EAAE,qCAAqC,EAC5F,MAAM,iBAAiB,CAAA;AAExB,6DAA6D;AAC7D,M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AqB,CAAC,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,UAAU,CAAC,qCAAqC,GAAG,IAAI,CAAC,CAAA;CAC/H"}
|
package/dist/neutral/modules/validation/block/validators/BlockCumulativeBalanceValidator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockCumulativeBalanceValidator.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/validation/block/validators/BlockCumulativeBalanceValidator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EACV,oCAAoC,EACpC,yBAAyB,EACzB,mCAAmC,EACpC,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"BlockCumulativeBalanceValidator.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/validation/block/validators/BlockCumulativeBalanceValidator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EACV,oCAAoC,EACpC,yBAAyB,EACzB,mCAAmC,EACpC,MAAM,eAAe,CAAA;AAqCtB,yFAAyF;AACzF,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,mCAAmC,EAAE,EACnD,QAAQ,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACrC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAiB5B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,mCAAmC,EAAE,EACnD,QAAQ,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACrC,yBAAyB,CAAC,CAAC,CAAC,CAM9B;AAED,oHAAoH;AACpH,wBAAgB,sCAAsC,IAAI,oCAAoC,CA8D7F"}
|
package/dist/neutral/modules/validation/block/validators/BlockTransactionUniquenessValidator.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ import type { HydratedBlockStateValidationFunction } from '../../../protocol-lib
|
|
|
18
18
|
*
|
|
19
19
|
* Chain engines must inject this alongside `BlockCumulativeBalanceValidatorFactory` — see the
|
|
20
20
|
* note on `validateTransaction` about `additionalValidators`.
|
|
21
|
+
*
|
|
22
|
+
* Payloads the block bound witness does not reference are ignored, matching `_hash` or
|
|
23
|
+
* `_dataHash`. A caller that attaches extra transactions cannot force a duplicate or
|
|
24
|
+
* high-S finding for a transaction the block did not include.
|
|
21
25
|
*/
|
|
22
26
|
export declare function BlockTransactionUniquenessValidatorFactory(): HydratedBlockStateValidationFunction;
|
|
23
27
|
//# sourceMappingURL=BlockTransactionUniquenessValidator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockTransactionUniquenessValidator.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/validation/block/validators/BlockTransactionUniquenessValidator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"BlockTransactionUniquenessValidator.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/validation/block/validators/BlockTransactionUniquenessValidator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAA;AAQzE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,0CAA0C,IAAI,oCAAoC,CA2CjG"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HydratedBlockWithHashMeta, TransactionBoundWitnessWithHashMeta } from '../../../protocol-lib/index.js';
|
|
2
|
+
/** Transactions the block bound witness references, matching `_hash` or `_dataHash`. */
|
|
3
|
+
export declare function transactionsReferencedByBlock(block: HydratedBlockWithHashMeta[0], payloads: HydratedBlockWithHashMeta[1]): TransactionBoundWitnessWithHashMeta[];
|
|
4
|
+
//# sourceMappingURL=transactionsReferencedByBlock.d.ts.map
|
package/dist/neutral/modules/validation/block/validators/transactionsReferencedByBlock.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactionsReferencedByBlock.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/validation/block/validators/transactionsReferencedByBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,mCAAmC,EAAE,MAAM,eAAe,CAAA;AAGnG,wFAAwF;AACxF,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC,EACnC,QAAQ,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACrC,mCAAmC,EAAE,CAKvC"}
|
|
@@ -164,18 +164,67 @@ import {
|
|
|
164
164
|
var StepSummarySchema = asSchema3("network.xyo.step.summary", true);
|
|
165
165
|
|
|
166
166
|
// src/modules/protocol-lib/transaction/elevatedPayloads.ts
|
|
167
|
+
import { isAllowedBlockPayload as isAllowedBlockPayload2 } from "#protocol-model";
|
|
168
|
+
|
|
169
|
+
// src/modules/protocol-lib/transaction/script.ts
|
|
170
|
+
import {
|
|
171
|
+
assertEx,
|
|
172
|
+
isHash
|
|
173
|
+
} from "@ariestools/sdk";
|
|
174
|
+
import { isHashMeta } from "@xyo-network/sdk";
|
|
167
175
|
import { ELEVATE_OPCODE, isAllowedBlockPayload } from "#protocol-model";
|
|
176
|
+
var elevatePrefix = `${ELEVATE_OPCODE}|`;
|
|
177
|
+
function parseElevateOperation(op) {
|
|
178
|
+
if (!op.startsWith(elevatePrefix)) return void 0;
|
|
179
|
+
const hash = op.slice(elevatePrefix.length);
|
|
180
|
+
return isHash(hash) ? hash : void 0;
|
|
181
|
+
}
|
|
182
|
+
function strictElevateHashes(strings) {
|
|
183
|
+
const hashes = [];
|
|
184
|
+
for (const op of strings) {
|
|
185
|
+
if (!op.startsWith(elevatePrefix)) continue;
|
|
186
|
+
hashes.push(assertEx(parseElevateOperation(op), () => "Invalid elevated hashes"));
|
|
187
|
+
}
|
|
188
|
+
return hashes;
|
|
189
|
+
}
|
|
190
|
+
function tryExtractElevatedHashesFromScript(strings) {
|
|
191
|
+
const hashes = [];
|
|
192
|
+
for (const op of strings) {
|
|
193
|
+
const hash = parseElevateOperation(op);
|
|
194
|
+
if (hash !== void 0) hashes.push(hash);
|
|
195
|
+
}
|
|
196
|
+
return hashes;
|
|
197
|
+
}
|
|
198
|
+
function extractElevatedHashesFromScript(strings) {
|
|
199
|
+
return strictElevateHashes(strings);
|
|
200
|
+
}
|
|
201
|
+
function tryExtractElevatedHashes(tx) {
|
|
202
|
+
const [bw, payloads] = tx;
|
|
203
|
+
const hashes = bw.script ? tryExtractElevatedHashesFromScript(bw.script) : [];
|
|
204
|
+
return payloads.filter((payload) => hashes.includes(payload._hash)).filter(isAllowedBlockPayload).filter(isHashMeta);
|
|
205
|
+
}
|
|
206
|
+
function elevatedTransaction(tx) {
|
|
207
|
+
return [tx[0], tryExtractElevatedHashes(tx)];
|
|
208
|
+
}
|
|
209
|
+
function extractElevatedHashes(tx) {
|
|
210
|
+
const [bw, payloads] = tx;
|
|
211
|
+
const hashes = bw.script ? strictElevateHashes(bw.script) : [];
|
|
212
|
+
const filtered = payloads.filter((payload) => hashes.includes(payload._hash)).filter(isAllowedBlockPayload).filter(isHashMeta);
|
|
213
|
+
assertEx(filtered.length === hashes.length, () => "Invalid elevated hashes");
|
|
214
|
+
return filtered;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// src/modules/protocol-lib/transaction/elevatedPayloads.ts
|
|
168
218
|
function tryElevatedPayloads([tx, payloads]) {
|
|
169
|
-
const opCodes = (tx.script ?? []).filter((operation) => operation.startsWith(`${ELEVATE_OPCODE}|`));
|
|
170
219
|
const elevatedPayloads2 = [];
|
|
171
|
-
for (const
|
|
172
|
-
const
|
|
220
|
+
for (const operation of tx.script ?? []) {
|
|
221
|
+
const hash = parseElevateOperation(operation);
|
|
222
|
+
if (hash === void 0) continue;
|
|
173
223
|
const elevatedPayload = payloads.find((payload) => payload._hash === hash);
|
|
174
|
-
if (
|
|
175
|
-
|
|
176
|
-
}
|
|
224
|
+
if (!isAllowedBlockPayload2(elevatedPayload)) return void 0;
|
|
225
|
+
elevatedPayloads2.push(elevatedPayload);
|
|
177
226
|
}
|
|
178
|
-
return
|
|
227
|
+
return elevatedPayloads2;
|
|
179
228
|
}
|
|
180
229
|
function elevatedPayloads(tx) {
|
|
181
230
|
const result = tryElevatedPayloads(tx);
|
|
@@ -185,43 +234,6 @@ function elevatedPayloads(tx) {
|
|
|
185
234
|
throw new Error("Not all elevated payloads could be found in the transaction payloads");
|
|
186
235
|
}
|
|
187
236
|
|
|
188
|
-
// src/modules/protocol-lib/transaction/script.ts
|
|
189
|
-
import {
|
|
190
|
-
asHash,
|
|
191
|
-
assertEx,
|
|
192
|
-
filterAs
|
|
193
|
-
} from "@ariestools/sdk";
|
|
194
|
-
import { isHashMeta } from "@xyo-network/sdk";
|
|
195
|
-
import { isAllowedBlockPayload as isAllowedBlockPayload2 } from "#protocol-model";
|
|
196
|
-
var tryExtractElevatedHashesFromScript = (strings) => {
|
|
197
|
-
const hashes = strings.filter((str) => str.startsWith("elevate|")).map((str) => str.split("|", 2)[1]);
|
|
198
|
-
return filterAs(hashes, (h) => asHash(h));
|
|
199
|
-
};
|
|
200
|
-
var extractElevatedHashesFromScript = (strings) => {
|
|
201
|
-
const hashes = strings.filter((str) => str.startsWith("elevate|")).map((str) => str.split("|", 2)[1]);
|
|
202
|
-
const filtered = filterAs(hashes, (h) => asHash(h));
|
|
203
|
-
assertEx(filtered.length === hashes.length, () => "Invalid elevated hashes");
|
|
204
|
-
return filtered;
|
|
205
|
-
};
|
|
206
|
-
var tryExtractElevatedHashes = (tx) => {
|
|
207
|
-
const [bw, payloads] = tx;
|
|
208
|
-
const { script } = bw;
|
|
209
|
-
const hashes = script ? tryExtractElevatedHashesFromScript(script) : [];
|
|
210
|
-
return payloads.filter((p) => hashes.includes(p._hash)).filter(isAllowedBlockPayload2).filter(isHashMeta);
|
|
211
|
-
};
|
|
212
|
-
var elevatedTransaction = (tx) => (
|
|
213
|
-
// The cast bridges the loose-object payload typing; the elevated payloads are a subset of the originals.
|
|
214
|
-
[tx[0], tryExtractElevatedHashes(tx)]
|
|
215
|
-
);
|
|
216
|
-
var extractElevatedHashes = (tx) => {
|
|
217
|
-
const [bw, payloads] = tx;
|
|
218
|
-
const { script } = bw;
|
|
219
|
-
const hashes = script ? tryExtractElevatedHashesFromScript(script) : [];
|
|
220
|
-
const filtered = payloads.filter((p) => hashes.includes(p._hash)).filter(isAllowedBlockPayload2).filter(isHashMeta);
|
|
221
|
-
assertEx(filtered.length === hashes.length, () => "Invalid elevated hashes");
|
|
222
|
-
return filtered;
|
|
223
|
-
};
|
|
224
|
-
|
|
225
237
|
// src/modules/protocol-lib/validation/block/error.ts
|
|
226
238
|
import {
|
|
227
239
|
HashZod as HashZod2,
|
|
@@ -714,6 +726,7 @@ export {
|
|
|
714
726
|
isTransactionValidationConfig,
|
|
715
727
|
isValidationError,
|
|
716
728
|
isXyoJwtSignerMethods,
|
|
729
|
+
parseElevateOperation,
|
|
717
730
|
requireRuleActive,
|
|
718
731
|
resolveChainIdAtBlockNumber,
|
|
719
732
|
resolveRuleParams,
|