@xyo-network/xl1-protocol-sdk 1.16.24 → 1.16.25
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/block/hydrate/blockPayloadsFromHydratedBlock.d.ts +3 -3
- package/dist/neutral/block/hydrate/blockPayloadsFromHydratedBlock.d.ts.map +1 -1
- package/dist/neutral/block/hydrate/flattenHydratedBlock.d.ts +3 -3
- package/dist/neutral/block/hydrate/flattenHydratedBlock.d.ts.map +1 -1
- package/dist/neutral/block/hydrate/flattenHydratedBlocks.d.ts +3 -3
- package/dist/neutral/block/hydrate/flattenHydratedBlocks.d.ts.map +1 -1
- package/dist/neutral/block/hydrate/hydrateBlock.d.ts +2 -2
- package/dist/neutral/block/hydrate/hydrateBlock.d.ts.map +1 -1
- package/dist/neutral/block/hydrate/transactionsFromHydratedBlock.d.ts +2 -3
- package/dist/neutral/block/hydrate/transactionsFromHydratedBlock.d.ts.map +1 -1
- package/dist/neutral/block/primitives/blockFromBlockNumber.d.ts +3 -2
- package/dist/neutral/block/primitives/blockFromBlockNumber.d.ts.map +1 -1
- package/dist/neutral/config/Config.d.ts +1 -0
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/Services.d.ts +1 -0
- package/dist/neutral/config/Services.d.ts.map +1 -1
- package/dist/neutral/index.d.ts +0 -1
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +534 -851
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/instances/transaction/HydratedTransaction.d.ts +2 -3
- package/dist/neutral/instances/transaction/HydratedTransaction.d.ts.map +1 -1
- package/dist/neutral/instances/transaction/TransactionFields.d.ts +3 -2
- package/dist/neutral/instances/transaction/TransactionFields.d.ts.map +1 -1
- package/dist/neutral/model/PayloadBundle/bundledPayloadToHydratedTransaction.d.ts +4 -0
- package/dist/neutral/model/PayloadBundle/bundledPayloadToHydratedTransaction.d.ts.map +1 -0
- package/dist/neutral/model/PayloadBundle/hydratedTransactionToPayloadBundle.d.ts +4 -0
- package/dist/neutral/model/PayloadBundle/hydratedTransactionToPayloadBundle.d.ts.map +1 -0
- package/dist/neutral/model/PayloadBundle/index.d.ts +3 -0
- package/dist/neutral/model/PayloadBundle/index.d.ts.map +1 -0
- package/dist/neutral/model/index.d.ts +1 -0
- package/dist/neutral/model/index.d.ts.map +1 -1
- package/dist/neutral/primitives/summary/schemas/schemasStepSummaryFromRange.d.ts +2 -2
- package/dist/neutral/primitives/summary/schemas/schemasStepSummaryFromRange.d.ts.map +1 -1
- package/dist/neutral/primitives/transaction/elevatedPayloads.d.ts +3 -3
- package/dist/neutral/primitives/transaction/elevatedPayloads.d.ts.map +1 -1
- package/dist/neutral/provider/TransactionSubmitter.d.ts +3 -3
- package/dist/neutral/provider/TransactionSubmitter.d.ts.map +1 -1
- package/dist/neutral/provider/XyoGatewayRunner.d.ts +3 -3
- package/dist/neutral/provider/XyoGatewayRunner.d.ts.map +1 -1
- package/dist/neutral/provider/signer/XyoSigner.d.ts +2 -2
- package/dist/neutral/provider/signer/XyoSigner.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/XyoViewer.d.ts +3 -0
- package/dist/neutral/provider/viewer/XyoViewer.d.ts.map +1 -1
- package/dist/neutral/services/BlockProducerService.d.ts +2 -2
- package/dist/neutral/services/BlockProducerService.d.ts.map +1 -1
- package/dist/neutral/simple/accountBalance/SimpleAccountBalanceViewer.d.ts +18 -6
- package/dist/neutral/simple/accountBalance/SimpleAccountBalanceViewer.d.ts.map +1 -1
- package/dist/neutral/simple/gateway/SimpleXyoGatewayRunner.d.ts +2 -2
- package/dist/neutral/simple/gateway/SimpleXyoGatewayRunner.d.ts.map +1 -1
- package/dist/neutral/simple/mempool/SimpleMempoolViewer.d.ts +9 -0
- package/dist/neutral/simple/mempool/SimpleMempoolViewer.d.ts.map +1 -0
- package/dist/neutral/simple/mempool/index.d.ts +2 -0
- package/dist/neutral/simple/mempool/index.d.ts.map +1 -0
- package/dist/neutral/simple/signer/SimpleXyoSigner.d.ts +3 -4
- package/dist/neutral/simple/signer/SimpleXyoSigner.d.ts.map +1 -1
- package/dist/neutral/transaction/buildTransaction.d.ts +2 -2
- package/dist/neutral/transaction/buildTransaction.d.ts.map +1 -1
- package/dist/neutral/transaction/buildUnsignedTransaction.d.ts +2 -2
- package/dist/neutral/transaction/buildUnsignedTransaction.d.ts.map +1 -1
- package/dist/neutral/transaction/hydrateTransaction.d.ts.map +1 -1
- package/dist/neutral/transaction/primitives/transactionBlockByteCount.d.ts +2 -2
- package/dist/neutral/transaction/primitives/transactionBlockByteCount.d.ts.map +1 -1
- package/dist/neutral/transaction/primitives/transactionElevatedPayloads.d.ts +2 -2
- package/dist/neutral/transaction/primitives/transactionElevatedPayloads.d.ts.map +1 -1
- package/dist/neutral/transaction/primitives/transactionRequiredGas.d.ts +3 -3
- package/dist/neutral/transaction/primitives/transactionRequiredGas.d.ts.map +1 -1
- package/dist/neutral/transaction/script.d.ts +3 -3
- package/dist/neutral/transaction/script.d.ts.map +1 -1
- package/dist/neutral/transaction/signTransaction.d.ts +23 -3
- package/dist/neutral/transaction/signTransaction.d.ts.map +1 -1
- package/dist/neutral/validation/block/HydratedBlockStateValidationFunction.d.ts +2 -2
- package/dist/neutral/validation/block/HydratedBlockStateValidationFunction.d.ts.map +1 -1
- package/dist/neutral/validation/block/HydratedBlockValidationFunction.d.ts +2 -2
- package/dist/neutral/validation/block/HydratedBlockValidationFunction.d.ts.map +1 -1
- package/dist/neutral/viewers/AccountBalance.d.ts +20 -26
- package/dist/neutral/viewers/AccountBalance.d.ts.map +1 -1
- package/dist/neutral/viewers/Block.d.ts +5 -5
- package/dist/neutral/viewers/Block.d.ts.map +1 -1
- package/dist/neutral/viewers/Mempool.d.ts +14 -0
- package/dist/neutral/viewers/Mempool.d.ts.map +1 -0
- package/dist/neutral/viewers/index.d.ts +1 -0
- package/dist/neutral/viewers/index.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/block/hydrate/blockPayloadsFromHydratedBlock.ts +5 -5
- package/src/block/hydrate/flattenHydratedBlock.ts +3 -3
- package/src/block/hydrate/flattenHydratedBlocks.ts +3 -3
- package/src/block/hydrate/hydrateBlock.ts +2 -2
- package/src/block/hydrate/transactionsFromHydratedBlock.ts +4 -6
- package/src/block/primitives/blockFromBlockNumber.ts +27 -7
- package/src/config/Services.ts +5 -0
- package/src/index.ts +1 -1
- package/src/instances/transaction/HydratedTransaction.ts +3 -5
- package/src/instances/transaction/TransactionFields.ts +4 -4
- package/src/model/PayloadBundle/bundledPayloadToHydratedTransaction.ts +14 -0
- package/src/model/PayloadBundle/hydratedTransactionToPayloadBundle.ts +18 -0
- package/src/model/PayloadBundle/index.ts +2 -0
- package/src/model/index.ts +1 -0
- package/src/primitives/summary/balances/balancesSummary.ts +1 -1
- package/src/primitives/summary/schemas/schemasStepSummaryFromRange.ts +8 -8
- package/src/primitives/summary/schemas/schemasSummary.ts +1 -1
- package/src/primitives/summary/transfers/transfersSummary.ts +1 -1
- package/src/primitives/transaction/elevatedPayloads.ts +4 -4
- package/src/provider/TransactionSubmitter.ts +3 -2
- package/src/provider/XyoGatewayRunner.ts +3 -2
- package/src/provider/signer/XyoSigner.ts +4 -3
- package/src/provider/viewer/XyoViewer.ts +3 -0
- package/src/services/BlockProducerService.ts +2 -2
- package/src/simple/accountBalance/SimpleAccountBalanceViewer.ts +31 -13
- package/src/simple/gateway/SimpleXyoGatewayRunner.ts +11 -8
- package/src/simple/mempool/SimpleMempoolViewer.ts +37 -0
- package/src/simple/mempool/index.ts +1 -0
- package/src/simple/signer/SimpleXyoSigner.ts +10 -7
- package/src/transaction/buildTransaction.ts +8 -6
- package/src/transaction/buildUnsignedTransaction.ts +5 -4
- package/src/transaction/hydrateTransaction.ts +2 -2
- package/src/transaction/primitives/transactionBlockByteCount.ts +2 -2
- package/src/transaction/primitives/transactionElevatedPayloads.ts +2 -2
- package/src/transaction/primitives/transactionRequiredGas.ts +3 -3
- package/src/transaction/script.ts +3 -3
- package/src/transaction/signTransaction.ts +12 -9
- package/src/validation/block/HydratedBlockStateValidationFunction.ts +2 -2
- package/src/validation/block/HydratedBlockValidationFunction.ts +2 -2
- package/src/viewers/AccountBalance.ts +1 -2
- package/src/viewers/Block.ts +5 -5
- package/src/viewers/Mempool.ts +18 -0
- package/src/viewers/index.ts +1 -0
- package/dist/neutral/zod/ArrayBuffer.d.ts +0 -4
- package/dist/neutral/zod/ArrayBuffer.d.ts.map +0 -1
- package/dist/neutral/zod/BlockBoundWitness.d.ts +0 -44
- package/dist/neutral/zod/BlockBoundWitness.d.ts.map +0 -1
- package/dist/neutral/zod/BoundWitness.d.ts +0 -123
- package/dist/neutral/zod/BoundWitness.d.ts.map +0 -1
- package/dist/neutral/zod/Chain.d.ts +0 -4
- package/dist/neutral/zod/Chain.d.ts.map +0 -1
- package/dist/neutral/zod/HydratedBlock.d.ts +0 -133
- package/dist/neutral/zod/HydratedBlock.d.ts.map +0 -1
- package/dist/neutral/zod/HydratedTransaction.d.ts +0 -210
- package/dist/neutral/zod/HydratedTransaction.d.ts.map +0 -1
- package/dist/neutral/zod/Permission.d.ts +0 -53
- package/dist/neutral/zod/Permission.d.ts.map +0 -1
- package/dist/neutral/zod/RewardsRangeOptions.d.ts +0 -11
- package/dist/neutral/zod/RewardsRangeOptions.d.ts.map +0 -1
- package/dist/neutral/zod/Sequence.d.ts +0 -9
- package/dist/neutral/zod/Sequence.d.ts.map +0 -1
- package/dist/neutral/zod/Stake.d.ts +0 -62
- package/dist/neutral/zod/Stake.d.ts.map +0 -1
- package/dist/neutral/zod/TimeDomain.d.ts +0 -3
- package/dist/neutral/zod/TimeDomain.d.ts.map +0 -1
- package/dist/neutral/zod/TransactionBoundWitness.d.ts +0 -75
- package/dist/neutral/zod/TransactionBoundWitness.d.ts.map +0 -1
- package/dist/neutral/zod/TransactionFees.d.ts +0 -53
- package/dist/neutral/zod/TransactionFees.d.ts.map +0 -1
- package/dist/neutral/zod/TransferPair.d.ts +0 -3
- package/dist/neutral/zod/TransferPair.d.ts.map +0 -1
- package/dist/neutral/zod/index.d.ts +0 -15
- package/dist/neutral/zod/index.d.ts.map +0 -1
- package/src/zod/ArrayBuffer.ts +0 -42
- package/src/zod/BlockBoundWitness.ts +0 -36
- package/src/zod/BoundWitness.ts +0 -56
- package/src/zod/Chain.ts +0 -5
- package/src/zod/HydratedBlock.ts +0 -32
- package/src/zod/HydratedTransaction.ts +0 -37
- package/src/zod/Permission.ts +0 -23
- package/src/zod/RewardsRangeOptions.ts +0 -10
- package/src/zod/Sequence.ts +0 -15
- package/src/zod/Stake.ts +0 -43
- package/src/zod/TimeDomain.ts +0 -7
- package/src/zod/TransactionBoundWitness.ts +0 -42
- package/src/zod/TransactionFees.ts +0 -45
- package/src/zod/TransferPair.ts +0 -6
- package/src/zod/index.ts +0 -14
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { PositionId } from '@xyo-network/xl1-protocol';
|
|
2
|
-
import * as z from 'zod';
|
|
3
|
-
export declare const StakeZod: z.ZodObject<{
|
|
4
|
-
amount: z.ZodBigInt;
|
|
5
|
-
addBlock: z.ZodNumber;
|
|
6
|
-
id: z.ZodNumber;
|
|
7
|
-
removeBlock: z.ZodNumber;
|
|
8
|
-
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Address, string>>;
|
|
9
|
-
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Address, string>>;
|
|
10
|
-
withdrawBlock: z.ZodNumber;
|
|
11
|
-
}, z.core.$strip>;
|
|
12
|
-
export declare const StakeToJsonZod: z.ZodPipe<z.ZodObject<{
|
|
13
|
-
amount: z.ZodBigInt;
|
|
14
|
-
addBlock: z.ZodNumber;
|
|
15
|
-
id: z.ZodNumber;
|
|
16
|
-
removeBlock: z.ZodNumber;
|
|
17
|
-
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Address, string>>;
|
|
18
|
-
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Address, string>>;
|
|
19
|
-
withdrawBlock: z.ZodNumber;
|
|
20
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
21
|
-
addBlock: number;
|
|
22
|
-
amount: import("@xylabs/sdk-js").Hex;
|
|
23
|
-
id: number;
|
|
24
|
-
removeBlock: number;
|
|
25
|
-
staked: import("@xylabs/sdk-js").Address;
|
|
26
|
-
staker: import("@xylabs/sdk-js").Address;
|
|
27
|
-
withdrawBlock: number;
|
|
28
|
-
}, {
|
|
29
|
-
amount: bigint;
|
|
30
|
-
addBlock: number;
|
|
31
|
-
id: number;
|
|
32
|
-
removeBlock: number;
|
|
33
|
-
staked: import("@xylabs/sdk-js").Address;
|
|
34
|
-
staker: import("@xylabs/sdk-js").Address;
|
|
35
|
-
withdrawBlock: number;
|
|
36
|
-
}>>;
|
|
37
|
-
export declare const JsonToStakeZod: z.ZodPipe<z.ZodObject<{
|
|
38
|
-
addBlock: z.ZodNumber;
|
|
39
|
-
id: z.ZodNumber;
|
|
40
|
-
removeBlock: z.ZodNumber;
|
|
41
|
-
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Address, string>>;
|
|
42
|
-
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Address, string>>;
|
|
43
|
-
withdrawBlock: z.ZodNumber;
|
|
44
|
-
amount: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Hex, string>>;
|
|
45
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
46
|
-
addBlock: number;
|
|
47
|
-
amount: import("@xyo-network/xl1-protocol").AttoXL1;
|
|
48
|
-
id: PositionId;
|
|
49
|
-
removeBlock: number;
|
|
50
|
-
staked: import("@xylabs/sdk-js").Address;
|
|
51
|
-
staker: import("@xylabs/sdk-js").Address;
|
|
52
|
-
withdrawBlock: number;
|
|
53
|
-
}, {
|
|
54
|
-
addBlock: number;
|
|
55
|
-
id: number;
|
|
56
|
-
removeBlock: number;
|
|
57
|
-
staked: import("@xylabs/sdk-js").Address;
|
|
58
|
-
staker: import("@xylabs/sdk-js").Address;
|
|
59
|
-
withdrawBlock: number;
|
|
60
|
-
amount: import("@xylabs/sdk-js").Hex;
|
|
61
|
-
}>>;
|
|
62
|
-
//# sourceMappingURL=Stake.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Stake.d.ts","sourceRoot":"","sources":["../../../src/zod/Stake.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAMxB,eAAO,MAAM,QAAQ;;;;;;;;iBAcnB,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;GAQxB,CAAA;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;QAGX,UAAU;;;;;;;;;;;;;GAKvB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimeDomain.d.ts","sourceRoot":"","sources":["../../../src/zod/TimeDomain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,aAAa,6FAIxB,CAAA"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
export declare const BlockStartZod: z.ZodObject<{
|
|
3
|
-
nbf: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("@xyo-network/xl1-protocol").BlockNumber, number>>;
|
|
4
|
-
}, z.core.$strip>;
|
|
5
|
-
export declare const BlockEndZod: z.ZodObject<{
|
|
6
|
-
exp: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("@xyo-network/xl1-protocol").BlockNumber, number>>;
|
|
7
|
-
}, z.core.$strip>;
|
|
8
|
-
export declare const BlockDurationZod: z.ZodObject<{
|
|
9
|
-
nbf: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("@xyo-network/xl1-protocol").BlockNumber, number>>;
|
|
10
|
-
exp: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("@xyo-network/xl1-protocol").BlockNumber, number>>;
|
|
11
|
-
}, z.core.$strip>;
|
|
12
|
-
export declare const BlockScriptsZod: z.ZodObject<{
|
|
13
|
-
script: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
-
}, z.core.$strip>;
|
|
15
|
-
export declare const WithTransactionFeesZod: z.ZodObject<{
|
|
16
|
-
fees: z.ZodObject<{
|
|
17
|
-
base: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
18
|
-
gasLimit: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
19
|
-
gasPrice: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
20
|
-
priority: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
export declare const TransactionBoundWitnessZod: z.ZodObject<{
|
|
24
|
-
schema: z.ZodLiteral<"network.xyo.boundwitness">;
|
|
25
|
-
addresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>>;
|
|
26
|
-
payload_hashes: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
27
|
-
payload_schemas: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<string & {
|
|
28
|
-
__schema: true;
|
|
29
|
-
}, string>>]>>;
|
|
30
|
-
previous_hashes: z.ZodArray<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>>;
|
|
31
|
-
$destination: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>>;
|
|
32
|
-
$sourceQuery: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
33
|
-
$signatures: z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>, z.ZodNull]>>;
|
|
34
|
-
_hash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
35
|
-
_dataHash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
36
|
-
_sequence: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<import("@xyo-network/payload-model").LocalSequence, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<import("@xyo-network/payload-model").QualifiedSequence, string>>]>>;
|
|
37
|
-
nbf: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("@xyo-network/xl1-protocol").BlockNumber, number>>;
|
|
38
|
-
exp: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("@xyo-network/xl1-protocol").BlockNumber, number>>;
|
|
39
|
-
fees: z.ZodObject<{
|
|
40
|
-
base: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
41
|
-
gasLimit: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
42
|
-
gasPrice: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
43
|
-
priority: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
44
|
-
}, z.core.$strip>;
|
|
45
|
-
chain: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xyo-network/xl1-protocol").ChainId, string>>;
|
|
46
|
-
from: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xyo-network/xl1-protocol").ChainId, string>>;
|
|
47
|
-
script: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
-
}, z.core.$strip>;
|
|
49
|
-
export declare const SignedTransactionBoundWitnessZod: z.ZodObject<{
|
|
50
|
-
schema: z.ZodLiteral<"network.xyo.boundwitness">;
|
|
51
|
-
addresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>>;
|
|
52
|
-
payload_hashes: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
53
|
-
payload_schemas: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<string & {
|
|
54
|
-
__schema: true;
|
|
55
|
-
}, string>>]>>;
|
|
56
|
-
previous_hashes: z.ZodArray<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>>;
|
|
57
|
-
$destination: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Address, string>>>;
|
|
58
|
-
$sourceQuery: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
59
|
-
$signatures: z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>, z.ZodNull]>>;
|
|
60
|
-
_hash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
61
|
-
_dataHash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hash, string>>>;
|
|
62
|
-
_sequence: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<import("@xyo-network/payload-model").LocalSequence, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<import("@xyo-network/payload-model").QualifiedSequence, string>>]>>;
|
|
63
|
-
nbf: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("@xyo-network/xl1-protocol").BlockNumber, number>>;
|
|
64
|
-
exp: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("@xyo-network/xl1-protocol").BlockNumber, number>>;
|
|
65
|
-
fees: z.ZodObject<{
|
|
66
|
-
base: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
67
|
-
gasLimit: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
68
|
-
gasPrice: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
69
|
-
priority: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").Hex, string>>;
|
|
70
|
-
}, z.core.$strip>;
|
|
71
|
-
chain: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xyo-network/xl1-protocol").ChainId, string>>;
|
|
72
|
-
from: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xyo-network/xl1-protocol").ChainId, string>>;
|
|
73
|
-
script: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
74
|
-
}, z.core.$strip>;
|
|
75
|
-
//# sourceMappingURL=TransactionBoundWitness.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionBoundWitness.d.ts","sourceRoot":"","sources":["../../../src/zod/TransactionBoundWitness.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAMxB,eAAO,MAAM,aAAa;;iBAAoC,CAAA;AAC9D,eAAO,MAAM,WAAW;;iBAAoC,CAAA;AAC5D,eAAO,MAAM,gBAAgB;;;iBAAyD,CAAA;AACtF,eAAO,MAAM,eAAe;;iBAAuD,CAAA;AAEnF,eAAO,MAAM,sBAAsB;;;;;;;iBAA4C,CAAA;AAM/E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;iBAUd,CAAA;AAEzB,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;iBAUV,CAAA"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
export declare const AttoZod: z.ZodBigInt;
|
|
3
|
-
export declare const JsonToAttoZod: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Hex, string>>, z.ZodTransform<bigint, import("@xylabs/sdk-js").Hex>>, z.ZodTransform<import("@xyo-network/xl1-protocol").AttoXL1, bigint>>;
|
|
4
|
-
export declare const AttoToJsonZod: z.ZodPipe<z.ZodBigInt, z.ZodTransform<import("@xylabs/sdk-js").Hex, bigint>>;
|
|
5
|
-
export declare const TransactionFeesHexZod: z.ZodObject<{
|
|
6
|
-
base: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Hex, string>>;
|
|
7
|
-
gasLimit: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Hex, string>>;
|
|
8
|
-
gasPrice: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Hex, string>>;
|
|
9
|
-
priority: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Hex, string>>;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
export type TransactionFeesHexZodType = z.infer<typeof TransactionFeesHexZod>;
|
|
12
|
-
export declare const TransactionFeesBigIntZod: z.ZodObject<{
|
|
13
|
-
base: z.ZodBigInt;
|
|
14
|
-
gasLimit: z.ZodBigInt;
|
|
15
|
-
gasPrice: z.ZodBigInt;
|
|
16
|
-
priority: z.ZodBigInt;
|
|
17
|
-
}, z.core.$strip>;
|
|
18
|
-
export type TransactionFeesBigIntZodType = z.infer<typeof TransactionFeesBigIntZod>;
|
|
19
|
-
export declare const TransactionFeesJsonToBigIntZod: z.ZodPipe<z.ZodObject<{
|
|
20
|
-
base: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Hex, string>>;
|
|
21
|
-
gasLimit: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Hex, string>>;
|
|
22
|
-
gasPrice: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Hex, string>>;
|
|
23
|
-
priority: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Hex, string>>;
|
|
24
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
25
|
-
base: bigint;
|
|
26
|
-
gasLimit: bigint;
|
|
27
|
-
gasPrice: bigint;
|
|
28
|
-
priority: bigint;
|
|
29
|
-
}, {
|
|
30
|
-
base: import("@xylabs/sdk-js").Hex;
|
|
31
|
-
gasLimit: import("@xylabs/sdk-js").Hex;
|
|
32
|
-
gasPrice: import("@xylabs/sdk-js").Hex;
|
|
33
|
-
priority: import("@xylabs/sdk-js").Hex;
|
|
34
|
-
}>>;
|
|
35
|
-
export declare const TransactionFeesBigIntToJsonZod: z.ZodPipe<z.ZodObject<{
|
|
36
|
-
base: z.ZodBigInt;
|
|
37
|
-
gasLimit: z.ZodBigInt;
|
|
38
|
-
gasPrice: z.ZodBigInt;
|
|
39
|
-
priority: z.ZodBigInt;
|
|
40
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
41
|
-
base: import("@xylabs/sdk-js").Hex;
|
|
42
|
-
gasLimit: import("@xylabs/sdk-js").Hex;
|
|
43
|
-
gasPrice: import("@xylabs/sdk-js").Hex;
|
|
44
|
-
priority: import("@xylabs/sdk-js").Hex;
|
|
45
|
-
}, {
|
|
46
|
-
base: bigint;
|
|
47
|
-
gasLimit: bigint;
|
|
48
|
-
gasPrice: bigint;
|
|
49
|
-
priority: bigint;
|
|
50
|
-
}>>;
|
|
51
|
-
export type TransactionFeesJsonToBigIntZodType = z.infer<typeof TransactionFeesJsonToBigIntZod>;
|
|
52
|
-
export type TransactionFeesBigIntToJsonZodType = z.infer<typeof TransactionFeesBigIntToJsonZod>;
|
|
53
|
-
//# sourceMappingURL=TransactionFees.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionFees.d.ts","sourceRoot":"","sources":["../../../src/zod/TransactionFees.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,OAAO,aAAa,CAAA;AACjC,eAAO,MAAM,aAAa,+NAA+C,CAAA;AAEzE,eAAO,MAAM,aAAa,8EAAkB,CAAA;AAE5C,eAAO,MAAM,qBAAqB;;;;;iBAKhC,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAE7E,eAAO,MAAM,wBAAwB;;;;;iBAKnC,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEnF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;GAKxC,CAAA;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;GAKxC,CAAA;AAEH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AAC/F,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import z from 'zod';
|
|
2
|
-
export declare const TransferPairZod: z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Address, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").Address, string>>], null>;
|
|
3
|
-
//# sourceMappingURL=TransferPair.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransferPair.d.ts","sourceRoot":"","sources":["../../../src/zod/TransferPair.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,eAAO,MAAM,eAAe,wLAE1B,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from './ArrayBuffer.ts';
|
|
2
|
-
export * from './BlockBoundWitness.ts';
|
|
3
|
-
export * from './BoundWitness.ts';
|
|
4
|
-
export * from './Chain.ts';
|
|
5
|
-
export * from './HydratedBlock.ts';
|
|
6
|
-
export * from './HydratedTransaction.ts';
|
|
7
|
-
export * from './Permission.ts';
|
|
8
|
-
export * from './RewardsRangeOptions.ts';
|
|
9
|
-
export * from './Sequence.ts';
|
|
10
|
-
export * from './Stake.ts';
|
|
11
|
-
export * from './TimeDomain.ts';
|
|
12
|
-
export * from './TransactionBoundWitness.ts';
|
|
13
|
-
export * from './TransactionFees.ts';
|
|
14
|
-
export * from './TransferPair.ts';
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zod/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA"}
|
package/src/zod/ArrayBuffer.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod'
|
|
2
|
-
|
|
3
|
-
function base64Encode(u8: Uint8Array): string {
|
|
4
|
-
// Node
|
|
5
|
-
if (typeof Buffer !== 'undefined' && typeof Buffer.from === 'function') {
|
|
6
|
-
return Buffer.from(u8).toString('base64')
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// Browser
|
|
10
|
-
let binary = ''
|
|
11
|
-
const chunk = 0x80_00
|
|
12
|
-
for (let i = 0; i < u8.length; i += chunk) {
|
|
13
|
-
// eslint-disable-next-line unicorn/prefer-code-point
|
|
14
|
-
binary += String.fromCharCode(...u8.subarray(i, i + chunk))
|
|
15
|
-
}
|
|
16
|
-
return btoa(binary)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** Base64 decode that works in Node and browsers -> Uint8Array */
|
|
20
|
-
function base64Decode(b64: string): Uint8Array {
|
|
21
|
-
// Node
|
|
22
|
-
if (typeof Buffer !== 'undefined' && typeof Buffer.from === 'function') {
|
|
23
|
-
return new Uint8Array(Buffer.from(b64, 'base64'))
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Browser
|
|
27
|
-
const binary = atob(b64)
|
|
28
|
-
const u8 = new Uint8Array(binary.length)
|
|
29
|
-
// eslint-disable-next-line unicorn/prefer-code-point
|
|
30
|
-
for (let i = 0; i < binary.length; i++) u8[i] = binary.charCodeAt(i)
|
|
31
|
-
return u8
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const ArrayBufferToJsonZod = z.instanceof(ArrayBuffer).transform((x) => {
|
|
35
|
-
const u8 = new Uint8Array(x)
|
|
36
|
-
return base64Encode(u8)
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
export const JsonToArrayBufferZod = z.string().transform((x) => {
|
|
40
|
-
const u8 = base64Decode(x)
|
|
41
|
-
return u8.buffer
|
|
42
|
-
})
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { HashZod } from '@xylabs/sdk-js'
|
|
2
|
-
import { StorageMetaZod } from '@xyo-network/payload-model'
|
|
3
|
-
import { XL1BlockNumberZod } from '@xyo-network/xl1-protocol'
|
|
4
|
-
import * as z from 'zod'
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
SignedBoundWitnessZod,
|
|
8
|
-
UnsignedBoundWitnessZod,
|
|
9
|
-
} from './BoundWitness.ts'
|
|
10
|
-
import { ChainZod } from './Chain.ts'
|
|
11
|
-
|
|
12
|
-
const BlockBoundWitnessFieldsZod = z.object({
|
|
13
|
-
block: XL1BlockNumberZod,
|
|
14
|
-
chain: ChainZod,
|
|
15
|
-
previous: HashZod.nullable(),
|
|
16
|
-
protocol: z.number(),
|
|
17
|
-
step_hashes: z.array(HashZod).optional(),
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
const BlockBoundWitnessMetaZod = z.object({ $epoch: z.number() })
|
|
21
|
-
|
|
22
|
-
export const BlockBoundWitnessZod = UnsignedBoundWitnessZod
|
|
23
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
24
|
-
.merge(StorageMetaZod.partial())
|
|
25
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
26
|
-
.merge(BlockBoundWitnessFieldsZod)
|
|
27
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
28
|
-
.merge(BlockBoundWitnessMetaZod)
|
|
29
|
-
|
|
30
|
-
export const SignedBlockBoundWitnessZod = SignedBoundWitnessZod
|
|
31
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
32
|
-
.merge(StorageMetaZod.partial())
|
|
33
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
34
|
-
.merge(BlockBoundWitnessFieldsZod)
|
|
35
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
36
|
-
.merge(BlockBoundWitnessMetaZod)
|
package/src/zod/BoundWitness.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AddressZod, HashZod, HexZod,
|
|
3
|
-
} from '@xylabs/sdk-js'
|
|
4
|
-
import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'
|
|
5
|
-
import {
|
|
6
|
-
PayloadZod, SchemaZod, StorageMetaZod,
|
|
7
|
-
} from '@xyo-network/payload-model'
|
|
8
|
-
import * as z from 'zod'
|
|
9
|
-
|
|
10
|
-
const BoundWitnessRequiredFieldsZod = z.object({
|
|
11
|
-
addresses: z.array(AddressZod),
|
|
12
|
-
payload_hashes: z.array(HashZod),
|
|
13
|
-
payload_schemas: z.array(SchemaZod),
|
|
14
|
-
previous_hashes: z.array(HashZod.nullable()),
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
const BoundWitnessMetaZod = z.object({
|
|
18
|
-
$destination: AddressZod.optional(),
|
|
19
|
-
$sourceQuery: HashZod.optional(),
|
|
20
|
-
$signatures: z.array(z.union([HexZod, z.null()])),
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
export const BoundWitnessZod = PayloadZod
|
|
24
|
-
.extend({ schema: z.literal(BoundWitnessSchema) })
|
|
25
|
-
.extend(BoundWitnessRequiredFieldsZod.shape)
|
|
26
|
-
.extend(BoundWitnessMetaZod.shape)
|
|
27
|
-
.refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })
|
|
28
|
-
|
|
29
|
-
export type BoundWitness = z.infer<typeof BoundWitnessZod>
|
|
30
|
-
|
|
31
|
-
export const AnyBoundWitnessZod = BoundWitnessZod
|
|
32
|
-
.catchall(z.any())
|
|
33
|
-
|
|
34
|
-
export type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>
|
|
35
|
-
|
|
36
|
-
export const UnsignedBoundWitnessZod = BoundWitnessZod.refine(data => data.$signatures.includes(null), { message: 'all $signatures must be null' })
|
|
37
|
-
|
|
38
|
-
export type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>
|
|
39
|
-
|
|
40
|
-
export const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod
|
|
41
|
-
.catchall(z.any())
|
|
42
|
-
|
|
43
|
-
export type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>
|
|
44
|
-
|
|
45
|
-
export const UnsignedBoundWitnessWithStorageMetaZod = UnsignedBoundWitnessZod
|
|
46
|
-
.safeExtend(BoundWitnessRequiredFieldsZod.shape)
|
|
47
|
-
.safeExtend(BoundWitnessMetaZod.shape)
|
|
48
|
-
.safeExtend(StorageMetaZod.shape)
|
|
49
|
-
|
|
50
|
-
export const SignedBoundWitnessZod = BoundWitnessZod.refine(data => !data.$signatures.includes(null), { message: 'all $signatures must not be null' })
|
|
51
|
-
|
|
52
|
-
export const SignedBoundWitnessWithStorageMetaZod = UnsignedBoundWitnessWithStorageMetaZod
|
|
53
|
-
|
|
54
|
-
export const AnySignedBoundWitnessZod = UnsignedBoundWitnessZod.catchall(z.any())
|
|
55
|
-
|
|
56
|
-
export const AnySignedBoundWitnessWithStorageMetaZod = UnsignedBoundWitnessWithStorageMetaZod.catchall(z.any())
|
package/src/zod/Chain.ts
DELETED
package/src/zod/HydratedBlock.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { PayloadZodLoose, WithStorageMetaZod } from '@xyo-network/payload-model'
|
|
2
|
-
import * as z from 'zod'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
BlockBoundWitnessZod,
|
|
6
|
-
SignedBlockBoundWitnessZod,
|
|
7
|
-
} from './BlockBoundWitness.ts'
|
|
8
|
-
|
|
9
|
-
export const HydratedBlockZod = z.tuple([
|
|
10
|
-
BlockBoundWitnessZod,
|
|
11
|
-
z.array(PayloadZodLoose),
|
|
12
|
-
])
|
|
13
|
-
|
|
14
|
-
export const HydratedBlockWithStorageMetaZod = z.tuple([
|
|
15
|
-
WithStorageMetaZod(BlockBoundWitnessZod),
|
|
16
|
-
z.array(WithStorageMetaZod(PayloadZodLoose)),
|
|
17
|
-
])
|
|
18
|
-
|
|
19
|
-
export const SignedHydratedBlockZod = z.tuple([
|
|
20
|
-
SignedBlockBoundWitnessZod,
|
|
21
|
-
z.array(PayloadZodLoose),
|
|
22
|
-
])
|
|
23
|
-
|
|
24
|
-
export const SignedHydratedBlockToJsonZod = z.tuple([
|
|
25
|
-
SignedBlockBoundWitnessZod,
|
|
26
|
-
z.array(PayloadZodLoose),
|
|
27
|
-
])
|
|
28
|
-
|
|
29
|
-
export const SignedHydratedBlockWithStorageMetaZod = z.tuple([
|
|
30
|
-
WithStorageMetaZod(SignedBlockBoundWitnessZod),
|
|
31
|
-
z.array(WithStorageMetaZod(PayloadZodLoose)),
|
|
32
|
-
])
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { JsonObject } from '@xylabs/sdk-js'
|
|
2
|
-
import { asAnyPayload, PayloadZodLoose } from '@xyo-network/payload-model'
|
|
3
|
-
import { asSignedHydratedTransaction } from '@xyo-network/xl1-protocol'
|
|
4
|
-
import * as z from 'zod'
|
|
5
|
-
|
|
6
|
-
import { SignedTransactionBoundWitnessZod, TransactionBoundWitnessZod } from './TransactionBoundWitness.ts'
|
|
7
|
-
|
|
8
|
-
export const HydratedTransactionZod = z.tuple([
|
|
9
|
-
TransactionBoundWitnessZod,
|
|
10
|
-
z.array(PayloadZodLoose),
|
|
11
|
-
])
|
|
12
|
-
|
|
13
|
-
export const UnsignedHydratedTransactionZod = z.tuple([
|
|
14
|
-
TransactionBoundWitnessZod,
|
|
15
|
-
z.array(PayloadZodLoose),
|
|
16
|
-
])
|
|
17
|
-
|
|
18
|
-
export const SignedHydratedTransactionZod = z.tuple([
|
|
19
|
-
SignedTransactionBoundWitnessZod,
|
|
20
|
-
z.array(PayloadZodLoose),
|
|
21
|
-
])
|
|
22
|
-
|
|
23
|
-
export const SignedHydratedTransactionToJsonZod = SignedHydratedTransactionZod.transform(([
|
|
24
|
-
tx,
|
|
25
|
-
payloads,
|
|
26
|
-
]) => asSignedHydratedTransaction([
|
|
27
|
-
tx as JsonObject,
|
|
28
|
-
payloads.map(payload => payload as JsonObject),
|
|
29
|
-
]))
|
|
30
|
-
|
|
31
|
-
export const JsonToSignedHydratedTransactionZod = SignedHydratedTransactionZod.transform(([
|
|
32
|
-
tx,
|
|
33
|
-
payloads,
|
|
34
|
-
]) => ([
|
|
35
|
-
asSignedHydratedTransaction(tx),
|
|
36
|
-
payloads.map(p => asAnyPayload(p)),
|
|
37
|
-
]))
|
package/src/zod/Permission.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
export const CaveatTypesZod = z.enum(['chain', 'expiration', 'filteredResponse', 'rateLimit', 'restrictReturnedAccounts'])
|
|
4
|
-
|
|
5
|
-
export const CaveatsZod = z.object({
|
|
6
|
-
type: CaveatTypesZod,
|
|
7
|
-
value: z.json(),
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
export const PermissionZod = z.object({
|
|
11
|
-
parentCapability: z.string(),
|
|
12
|
-
caveats: CaveatsZod.array().optional(),
|
|
13
|
-
invoker: z.string(),
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
export const InvokerPermissionZod = PermissionZod.extend({ date: z.number().optional() })
|
|
17
|
-
|
|
18
|
-
export const PermissionRequestZod = z.record(z.string(), z.record(z.string(), z.any()))
|
|
19
|
-
|
|
20
|
-
export const RequestedPermissionZod = z.object({
|
|
21
|
-
parentCapability: z.string(),
|
|
22
|
-
date: z.number().optional(),
|
|
23
|
-
})
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AddressZod } from '@xylabs/sdk-js'
|
|
2
|
-
import { BlockRangeZod, StepIdentityZod } from '@xyo-network/xl1-protocol'
|
|
3
|
-
import { z } from 'zod'
|
|
4
|
-
|
|
5
|
-
export const RewardsRangeOptionsZod = z.object({
|
|
6
|
-
positions: z.array(z.number()).optional(),
|
|
7
|
-
range: BlockRangeZod.optional(),
|
|
8
|
-
steps: z.array(StepIdentityZod).optional(),
|
|
9
|
-
stakers: z.array(AddressZod).optional(),
|
|
10
|
-
})
|
package/src/zod/Sequence.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { HexRegExMinMax, toHex } from '@xylabs/sdk-js'
|
|
2
|
-
import type { LocalSequence, QualifiedSequence } from '@xyo-network/payload-model'
|
|
3
|
-
import { SequenceConstants } from '@xyo-network/payload-model'
|
|
4
|
-
import * as z from 'zod'
|
|
5
|
-
|
|
6
|
-
const LocalSequenceRegex = new RegExp(HexRegExMinMax(SequenceConstants.localSequenceBytes, SequenceConstants.localSequenceBytes))
|
|
7
|
-
export const LocalSequenceToStringZod = z.string().regex(LocalSequenceRegex)
|
|
8
|
-
export const LocalSequenceFromStringZod = z.string().regex(LocalSequenceRegex).transform<LocalSequence>(v => toHex(v) as LocalSequence)
|
|
9
|
-
|
|
10
|
-
const QualifiedSequenceRegex = new RegExp(HexRegExMinMax(SequenceConstants.qualifiedSequenceBytes, SequenceConstants.qualifiedSequenceBytes))
|
|
11
|
-
export const QualifiedSequenceToStringZod = z.string().regex(QualifiedSequenceRegex)
|
|
12
|
-
export const QualifiedSequenceFromStringZod = z.string().regex(QualifiedSequenceRegex).transform<QualifiedSequence>(v => toHex(v) as QualifiedSequence)
|
|
13
|
-
|
|
14
|
-
export const SequenceToStringZod = z.union([LocalSequenceToStringZod, QualifiedSequenceToStringZod])
|
|
15
|
-
export const SequenceFromStringZod = z.union([LocalSequenceFromStringZod, QualifiedSequenceFromStringZod])
|
package/src/zod/Stake.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { AddressZod, HexZod } from '@xylabs/sdk-js'
|
|
2
|
-
import type { PositionId } from '@xyo-network/xl1-protocol'
|
|
3
|
-
import * as z from 'zod'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
AttoToJsonZod, AttoZod, JsonToAttoZod,
|
|
7
|
-
} from './TransactionFees.ts'
|
|
8
|
-
|
|
9
|
-
export const StakeZod = z.object({
|
|
10
|
-
amount: AttoZod,
|
|
11
|
-
// the block number when the stake was added
|
|
12
|
-
addBlock: z.number(),
|
|
13
|
-
// the unique id for the stake item
|
|
14
|
-
id: z.number(),
|
|
15
|
-
// the block number when the stake was removed (set to 0 if not removed)
|
|
16
|
-
removeBlock: z.number(),
|
|
17
|
-
// the address that is being staked
|
|
18
|
-
staked: AddressZod,
|
|
19
|
-
// the address that owns the stake
|
|
20
|
-
staker: AddressZod,
|
|
21
|
-
// the block number when the stake was withdrawn (set to 0 if not withdrawn)
|
|
22
|
-
withdrawBlock: z.number(),
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
export const StakeToJsonZod = StakeZod.transform(val => ({
|
|
26
|
-
addBlock: val.addBlock,
|
|
27
|
-
amount: AttoToJsonZod.parse(val.amount),
|
|
28
|
-
id: val.id,
|
|
29
|
-
removeBlock: val.removeBlock,
|
|
30
|
-
staked: AddressZod.parse(val.staked),
|
|
31
|
-
staker: AddressZod.parse(val.staker),
|
|
32
|
-
withdrawBlock: val.withdrawBlock,
|
|
33
|
-
}))
|
|
34
|
-
|
|
35
|
-
export const JsonToStakeZod = StakeZod.extend({ amount: HexZod }).transform(val => ({
|
|
36
|
-
addBlock: val.addBlock,
|
|
37
|
-
amount: JsonToAttoZod.parse(val.amount),
|
|
38
|
-
id: val.id as PositionId,
|
|
39
|
-
removeBlock: val.removeBlock,
|
|
40
|
-
staked: val.staked,
|
|
41
|
-
staker: val.staker,
|
|
42
|
-
withdrawBlock: val.withdrawBlock,
|
|
43
|
-
}))
|
package/src/zod/TimeDomain.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { StorageMetaZod } from '@xyo-network/payload-model'
|
|
2
|
-
import { BlockNumberZod } from '@xyo-network/xl1-protocol'
|
|
3
|
-
import * as z from 'zod'
|
|
4
|
-
|
|
5
|
-
import { SignedBoundWitnessZod, UnsignedBoundWitnessZod } from './BoundWitness.ts'
|
|
6
|
-
import { ChainZod } from './Chain.ts'
|
|
7
|
-
import { TransactionFeesHexZod } from './TransactionFees.ts'
|
|
8
|
-
|
|
9
|
-
export const BlockStartZod = z.object({ nbf: BlockNumberZod })
|
|
10
|
-
export const BlockEndZod = z.object({ exp: BlockNumberZod })
|
|
11
|
-
export const BlockDurationZod = z.object({ nbf: BlockNumberZod, exp: BlockNumberZod })
|
|
12
|
-
export const BlockScriptsZod = z.object({ script: z.array(z.string()).optional() })
|
|
13
|
-
|
|
14
|
-
export const WithTransactionFeesZod = z.object({ fees: TransactionFeesHexZod })
|
|
15
|
-
|
|
16
|
-
const TransactionBoundWitnessFields = z.object({ chain: ChainZod, from: ChainZod })
|
|
17
|
-
|
|
18
|
-
// It seems like zod marked all of merge as deprecated even though just multiple merges should have been deprecated
|
|
19
|
-
|
|
20
|
-
export const TransactionBoundWitnessZod = UnsignedBoundWitnessZod
|
|
21
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
22
|
-
.merge(StorageMetaZod.partial())
|
|
23
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
24
|
-
.merge(BlockDurationZod)
|
|
25
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
26
|
-
.merge(WithTransactionFeesZod)
|
|
27
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
28
|
-
.merge(TransactionBoundWitnessFields)
|
|
29
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
30
|
-
.merge(BlockScriptsZod)
|
|
31
|
-
|
|
32
|
-
export const SignedTransactionBoundWitnessZod = SignedBoundWitnessZod
|
|
33
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
34
|
-
.merge(StorageMetaZod.partial())
|
|
35
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
36
|
-
.merge(BlockDurationZod)
|
|
37
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
38
|
-
.merge(WithTransactionFeesZod)
|
|
39
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
40
|
-
.merge(TransactionBoundWitnessFields)
|
|
41
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
42
|
-
.merge(BlockScriptsZod.partial())
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BigIntToJsonZod, HexZod, JsonToBigIntZod,
|
|
3
|
-
} from '@xylabs/sdk-js'
|
|
4
|
-
import { asAttoXL1 } from '@xyo-network/xl1-protocol'
|
|
5
|
-
import * as z from 'zod'
|
|
6
|
-
|
|
7
|
-
export const AttoZod = z.bigint()
|
|
8
|
-
export const JsonToAttoZod = JsonToBigIntZod.transform(v => asAttoXL1(v))
|
|
9
|
-
// eslint-disable-next-line unicorn/prefer-export-from
|
|
10
|
-
export const AttoToJsonZod = BigIntToJsonZod
|
|
11
|
-
|
|
12
|
-
export const TransactionFeesHexZod = z.object({
|
|
13
|
-
base: HexZod,
|
|
14
|
-
gasLimit: HexZod,
|
|
15
|
-
gasPrice: HexZod,
|
|
16
|
-
priority: HexZod,
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
export type TransactionFeesHexZodType = z.infer<typeof TransactionFeesHexZod>
|
|
20
|
-
|
|
21
|
-
export const TransactionFeesBigIntZod = z.object({
|
|
22
|
-
base: AttoZod,
|
|
23
|
-
gasLimit: AttoZod,
|
|
24
|
-
gasPrice: AttoZod,
|
|
25
|
-
priority: AttoZod,
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
export type TransactionFeesBigIntZodType = z.infer<typeof TransactionFeesBigIntZod>
|
|
29
|
-
|
|
30
|
-
export const TransactionFeesJsonToBigIntZod = TransactionFeesHexZod.transform(val => ({
|
|
31
|
-
base: JsonToBigIntZod.parse(val.base),
|
|
32
|
-
gasLimit: JsonToBigIntZod.parse(val.gasLimit),
|
|
33
|
-
gasPrice: JsonToBigIntZod.parse(val.gasPrice),
|
|
34
|
-
priority: JsonToBigIntZod.parse(val.priority),
|
|
35
|
-
}))
|
|
36
|
-
|
|
37
|
-
export const TransactionFeesBigIntToJsonZod = TransactionFeesBigIntZod.transform(val => ({
|
|
38
|
-
base: BigIntToJsonZod.parse(val.base),
|
|
39
|
-
gasLimit: BigIntToJsonZod.parse(val.gasLimit),
|
|
40
|
-
gasPrice: BigIntToJsonZod.parse(val.gasPrice),
|
|
41
|
-
priority: BigIntToJsonZod.parse(val.priority),
|
|
42
|
-
}))
|
|
43
|
-
|
|
44
|
-
export type TransactionFeesJsonToBigIntZodType = z.infer<typeof TransactionFeesJsonToBigIntZod>
|
|
45
|
-
export type TransactionFeesBigIntToJsonZodType = z.infer<typeof TransactionFeesBigIntToJsonZod>
|