@xyo-network/xl1-rpc 1.16.22 → 1.16.24

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 (173) hide show
  1. package/dist/neutral/engine/rpcMethodHandlersFromViewer.d.ts.map +1 -1
  2. package/dist/neutral/index.mjs +708 -882
  3. package/dist/neutral/index.mjs.map +1 -1
  4. package/dist/neutral/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewer.d.ts +12 -0
  5. package/dist/neutral/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewer.d.ts.map +1 -0
  6. package/dist/neutral/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewerMethods.d.ts +12 -0
  7. package/dist/neutral/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewerMethods.d.ts.map +1 -0
  8. package/dist/neutral/provider/viewer/JsonRpcAccountBalanceViewer/index.d.ts +3 -0
  9. package/dist/neutral/provider/viewer/JsonRpcAccountBalanceViewer/index.d.ts.map +1 -0
  10. package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts +9 -1
  11. package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
  12. package/dist/neutral/provider/viewer/index.d.ts +1 -0
  13. package/dist/neutral/provider/viewer/index.d.ts.map +1 -1
  14. package/dist/neutral/types/AccountBalanceViewerRpc.d.ts +10 -0
  15. package/dist/neutral/types/AccountBalanceViewerRpc.d.ts.map +1 -0
  16. package/dist/neutral/types/index.d.ts +1 -0
  17. package/dist/neutral/types/index.d.ts.map +1 -1
  18. package/dist/neutral/types/schema/AccountBalanceViewerRpcSchemas.d.ts +132 -0
  19. package/dist/neutral/types/schema/AccountBalanceViewerRpcSchemas.d.ts.map +1 -0
  20. package/dist/neutral/types/schema/AllRpcSchemas.d.ts +264 -8
  21. package/dist/neutral/types/schema/AllRpcSchemas.d.ts.map +1 -1
  22. package/dist/neutral/types/schema/DataLakeViewerRpcSchema.d.ts.map +1 -1
  23. package/dist/neutral/types/schema/RewardsByPositionViewerRpcSchemas.d.ts.map +1 -1
  24. package/dist/neutral/types/schema/RewardsByStakerViewerRpcSchemas.d.ts.map +1 -1
  25. package/dist/neutral/types/schema/RewardsByStepViewerRpcSchemas.d.ts.map +1 -1
  26. package/dist/neutral/types/schema/RewardsTotalViewerRpcSchemas.d.ts.map +1 -1
  27. package/dist/neutral/types/schema/StepViewerRpcSchemas.d.ts.map +1 -1
  28. package/dist/neutral/types/schema/TimeSyncViewerRpcSchema.d.ts.map +1 -1
  29. package/dist/neutral/types/schema/XyoPermissionsRpcSchemas.d.ts.map +1 -1
  30. package/dist/neutral/types/schema/XyoRunnerRpcSchemas.d.ts.map +1 -1
  31. package/dist/neutral/types/schema/XyoSignerRpcSchemas.d.ts.map +1 -1
  32. package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts +136 -8
  33. package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts.map +1 -1
  34. package/dist/neutral/types/schema/index.d.ts +1 -1
  35. package/dist/neutral/types/schema/index.d.ts.map +1 -1
  36. package/dist/node/engine/rpcMethodHandlersFromViewer.d.ts.map +1 -1
  37. package/dist/node/index-node.mjs +708 -882
  38. package/dist/node/index-node.mjs.map +1 -1
  39. package/dist/node/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewer.d.ts +12 -0
  40. package/dist/node/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewer.d.ts.map +1 -0
  41. package/dist/node/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewerMethods.d.ts +12 -0
  42. package/dist/node/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewerMethods.d.ts.map +1 -0
  43. package/dist/node/provider/viewer/JsonRpcAccountBalanceViewer/index.d.ts +3 -0
  44. package/dist/node/provider/viewer/JsonRpcAccountBalanceViewer/index.d.ts.map +1 -0
  45. package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts +9 -1
  46. package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
  47. package/dist/node/provider/viewer/index.d.ts +1 -0
  48. package/dist/node/provider/viewer/index.d.ts.map +1 -1
  49. package/dist/node/types/AccountBalanceViewerRpc.d.ts +10 -0
  50. package/dist/node/types/AccountBalanceViewerRpc.d.ts.map +1 -0
  51. package/dist/node/types/index.d.ts +1 -0
  52. package/dist/node/types/index.d.ts.map +1 -1
  53. package/dist/node/types/schema/AccountBalanceViewerRpcSchemas.d.ts +132 -0
  54. package/dist/node/types/schema/AccountBalanceViewerRpcSchemas.d.ts.map +1 -0
  55. package/dist/node/types/schema/AllRpcSchemas.d.ts +264 -8
  56. package/dist/node/types/schema/AllRpcSchemas.d.ts.map +1 -1
  57. package/dist/node/types/schema/DataLakeViewerRpcSchema.d.ts.map +1 -1
  58. package/dist/node/types/schema/RewardsByPositionViewerRpcSchemas.d.ts.map +1 -1
  59. package/dist/node/types/schema/RewardsByStakerViewerRpcSchemas.d.ts.map +1 -1
  60. package/dist/node/types/schema/RewardsByStepViewerRpcSchemas.d.ts.map +1 -1
  61. package/dist/node/types/schema/RewardsTotalViewerRpcSchemas.d.ts.map +1 -1
  62. package/dist/node/types/schema/StepViewerRpcSchemas.d.ts.map +1 -1
  63. package/dist/node/types/schema/TimeSyncViewerRpcSchema.d.ts.map +1 -1
  64. package/dist/node/types/schema/XyoPermissionsRpcSchemas.d.ts.map +1 -1
  65. package/dist/node/types/schema/XyoRunnerRpcSchemas.d.ts.map +1 -1
  66. package/dist/node/types/schema/XyoSignerRpcSchemas.d.ts.map +1 -1
  67. package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts +136 -8
  68. package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts.map +1 -1
  69. package/dist/node/types/schema/index.d.ts +1 -1
  70. package/dist/node/types/schema/index.d.ts.map +1 -1
  71. package/package.json +8 -9
  72. package/src/engine/rpcMethodHandlersFromViewer.ts +2 -0
  73. package/src/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewer.ts +23 -0
  74. package/src/provider/viewer/JsonRpcAccountBalanceViewer/JsonRpcAccountBalanceViewerMethods.ts +31 -0
  75. package/src/provider/viewer/JsonRpcAccountBalanceViewer/index.ts +2 -0
  76. package/src/provider/viewer/JsonRpcXyoViewer.ts +27 -6
  77. package/src/provider/viewer/index.ts +1 -0
  78. package/src/types/AccountBalanceViewerRpc.ts +16 -0
  79. package/src/types/index.ts +1 -0
  80. package/src/types/schema/AccountBalanceViewerRpcSchemas.ts +33 -0
  81. package/src/types/schema/AllRpcSchemas.ts +2 -0
  82. package/src/types/schema/DataLakeViewerRpcSchema.ts +1 -1
  83. package/src/types/schema/RewardsByPositionViewerRpcSchemas.ts +1 -1
  84. package/src/types/schema/RewardsByStakerViewerRpcSchemas.ts +1 -1
  85. package/src/types/schema/RewardsByStepViewerRpcSchemas.ts +1 -1
  86. package/src/types/schema/RewardsTotalViewerRpcSchemas.ts +1 -1
  87. package/src/types/schema/StepViewerRpcSchemas.ts +1 -1
  88. package/src/types/schema/TimeSyncViewerRpcSchema.ts +1 -1
  89. package/src/types/schema/XyoPermissionsRpcSchemas.ts +3 -3
  90. package/src/types/schema/XyoRunnerRpcSchemas.ts +1 -1
  91. package/src/types/schema/XyoSignerRpcSchemas.ts +1 -4
  92. package/src/types/schema/XyoViewerRpcSchemas.ts +32 -19
  93. package/src/types/schema/index.ts +1 -1
  94. package/dist/neutral/types/schema/common/ArrayBuffer.d.ts +0 -4
  95. package/dist/neutral/types/schema/common/ArrayBuffer.d.ts.map +0 -1
  96. package/dist/neutral/types/schema/common/BlockBoundWitness.d.ts +0 -44
  97. package/dist/neutral/types/schema/common/BlockBoundWitness.d.ts.map +0 -1
  98. package/dist/neutral/types/schema/common/BoundWitness.d.ts +0 -123
  99. package/dist/neutral/types/schema/common/BoundWitness.d.ts.map +0 -1
  100. package/dist/neutral/types/schema/common/Chain.d.ts +0 -4
  101. package/dist/neutral/types/schema/common/Chain.d.ts.map +0 -1
  102. package/dist/neutral/types/schema/common/HydratedBlock.d.ts +0 -133
  103. package/dist/neutral/types/schema/common/HydratedBlock.d.ts.map +0 -1
  104. package/dist/neutral/types/schema/common/HydratedTransaction.d.ts +0 -210
  105. package/dist/neutral/types/schema/common/HydratedTransaction.d.ts.map +0 -1
  106. package/dist/neutral/types/schema/common/Json.d.ts +0 -7
  107. package/dist/neutral/types/schema/common/Json.d.ts.map +0 -1
  108. package/dist/neutral/types/schema/common/Permission.d.ts +0 -53
  109. package/dist/neutral/types/schema/common/Permission.d.ts.map +0 -1
  110. package/dist/neutral/types/schema/common/RewardsRangeOptions.d.ts +0 -11
  111. package/dist/neutral/types/schema/common/RewardsRangeOptions.d.ts.map +0 -1
  112. package/dist/neutral/types/schema/common/Sequence.d.ts +0 -9
  113. package/dist/neutral/types/schema/common/Sequence.d.ts.map +0 -1
  114. package/dist/neutral/types/schema/common/Stake.d.ts +0 -62
  115. package/dist/neutral/types/schema/common/Stake.d.ts.map +0 -1
  116. package/dist/neutral/types/schema/common/TimeDomain.d.ts +0 -3
  117. package/dist/neutral/types/schema/common/TimeDomain.d.ts.map +0 -1
  118. package/dist/neutral/types/schema/common/TransactionBoundWitness.d.ts +0 -75
  119. package/dist/neutral/types/schema/common/TransactionBoundWitness.d.ts.map +0 -1
  120. package/dist/neutral/types/schema/common/TransactionFees.d.ts +0 -53
  121. package/dist/neutral/types/schema/common/TransactionFees.d.ts.map +0 -1
  122. package/dist/neutral/types/schema/common/TransferPair.d.ts +0 -3
  123. package/dist/neutral/types/schema/common/TransferPair.d.ts.map +0 -1
  124. package/dist/neutral/types/schema/common/index.d.ts +0 -16
  125. package/dist/neutral/types/schema/common/index.d.ts.map +0 -1
  126. package/dist/node/types/schema/common/ArrayBuffer.d.ts +0 -4
  127. package/dist/node/types/schema/common/ArrayBuffer.d.ts.map +0 -1
  128. package/dist/node/types/schema/common/BlockBoundWitness.d.ts +0 -44
  129. package/dist/node/types/schema/common/BlockBoundWitness.d.ts.map +0 -1
  130. package/dist/node/types/schema/common/BoundWitness.d.ts +0 -123
  131. package/dist/node/types/schema/common/BoundWitness.d.ts.map +0 -1
  132. package/dist/node/types/schema/common/Chain.d.ts +0 -4
  133. package/dist/node/types/schema/common/Chain.d.ts.map +0 -1
  134. package/dist/node/types/schema/common/HydratedBlock.d.ts +0 -133
  135. package/dist/node/types/schema/common/HydratedBlock.d.ts.map +0 -1
  136. package/dist/node/types/schema/common/HydratedTransaction.d.ts +0 -210
  137. package/dist/node/types/schema/common/HydratedTransaction.d.ts.map +0 -1
  138. package/dist/node/types/schema/common/Json.d.ts +0 -7
  139. package/dist/node/types/schema/common/Json.d.ts.map +0 -1
  140. package/dist/node/types/schema/common/Permission.d.ts +0 -53
  141. package/dist/node/types/schema/common/Permission.d.ts.map +0 -1
  142. package/dist/node/types/schema/common/RewardsRangeOptions.d.ts +0 -11
  143. package/dist/node/types/schema/common/RewardsRangeOptions.d.ts.map +0 -1
  144. package/dist/node/types/schema/common/Sequence.d.ts +0 -9
  145. package/dist/node/types/schema/common/Sequence.d.ts.map +0 -1
  146. package/dist/node/types/schema/common/Stake.d.ts +0 -62
  147. package/dist/node/types/schema/common/Stake.d.ts.map +0 -1
  148. package/dist/node/types/schema/common/TimeDomain.d.ts +0 -3
  149. package/dist/node/types/schema/common/TimeDomain.d.ts.map +0 -1
  150. package/dist/node/types/schema/common/TransactionBoundWitness.d.ts +0 -75
  151. package/dist/node/types/schema/common/TransactionBoundWitness.d.ts.map +0 -1
  152. package/dist/node/types/schema/common/TransactionFees.d.ts +0 -53
  153. package/dist/node/types/schema/common/TransactionFees.d.ts.map +0 -1
  154. package/dist/node/types/schema/common/TransferPair.d.ts +0 -3
  155. package/dist/node/types/schema/common/TransferPair.d.ts.map +0 -1
  156. package/dist/node/types/schema/common/index.d.ts +0 -16
  157. package/dist/node/types/schema/common/index.d.ts.map +0 -1
  158. package/src/types/schema/common/ArrayBuffer.ts +0 -42
  159. package/src/types/schema/common/BlockBoundWitness.ts +0 -36
  160. package/src/types/schema/common/BoundWitness.ts +0 -56
  161. package/src/types/schema/common/Chain.ts +0 -5
  162. package/src/types/schema/common/HydratedBlock.ts +0 -32
  163. package/src/types/schema/common/HydratedTransaction.ts +0 -37
  164. package/src/types/schema/common/Json.ts +0 -19
  165. package/src/types/schema/common/Permission.ts +0 -23
  166. package/src/types/schema/common/RewardsRangeOptions.ts +0 -10
  167. package/src/types/schema/common/Sequence.ts +0 -15
  168. package/src/types/schema/common/Stake.ts +0 -43
  169. package/src/types/schema/common/TimeDomain.ts +0 -7
  170. package/src/types/schema/common/TransactionBoundWitness.ts +0 -42
  171. package/src/types/schema/common/TransactionFees.ts +0 -45
  172. package/src/types/schema/common/TransferPair.ts +0 -6
  173. package/src/types/schema/common/index.ts +0 -15
@@ -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
- }))
@@ -1,7 +0,0 @@
1
- import * as z from 'zod'
2
-
3
- export const TimeDomainZod = z.union([
4
- z.literal('xl1'),
5
- z.literal('epoch'),
6
- z.literal('ethereum'),
7
- ])
@@ -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>
@@ -1,6 +0,0 @@
1
- import { AddressZod } from '@xylabs/sdk-js'
2
- import z from 'zod'
3
-
4
- export const TransferPairZod = z.tuple([
5
- AddressZod, AddressZod,
6
- ])
@@ -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 './Json.ts'
8
- export * from './Permission.ts'
9
- export * from './RewardsRangeOptions.ts'
10
- export * from './Sequence.ts'
11
- export * from './Stake.ts'
12
- export * from './TimeDomain.ts'
13
- export * from './TransactionBoundWitness.ts'
14
- export * from './TransactionFees.ts'
15
- export * from './TransferPair.ts'