@xyo-network/xl1-rpc 1.15.1 → 1.15.3

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 (234) hide show
  1. package/README.md +11897 -1213
  2. package/dist/neutral/engine/index-node.d.ts +2 -2
  3. package/dist/neutral/engine/index-node.d.ts.map +1 -1
  4. package/dist/neutral/engine/index.d.ts +2 -1
  5. package/dist/neutral/engine/index.d.ts.map +1 -1
  6. package/dist/neutral/engine/rpcEngineFromConnection.d.ts +4 -0
  7. package/dist/neutral/engine/rpcEngineFromConnection.d.ts.map +1 -0
  8. package/dist/neutral/engine/rpcMethodHandlersFromConnection.d.ts +4 -0
  9. package/dist/neutral/engine/rpcMethodHandlersFromConnection.d.ts.map +1 -0
  10. package/dist/neutral/engine/rpcMethodHandlersFromPermissions.d.ts +4 -0
  11. package/dist/neutral/engine/rpcMethodHandlersFromPermissions.d.ts.map +1 -0
  12. package/dist/neutral/engine/rpcMethodHandlersFromViewer.d.ts.map +1 -1
  13. package/dist/neutral/index.mjs +894 -437
  14. package/dist/neutral/index.mjs.map +1 -1
  15. package/dist/neutral/provider/client/MemoryXyoClient.d.ts +2 -2
  16. package/dist/neutral/provider/client/MemoryXyoClient.d.ts.map +1 -1
  17. package/dist/neutral/provider/client/index.d.ts +0 -1
  18. package/dist/neutral/provider/client/index.d.ts.map +1 -1
  19. package/dist/neutral/provider/index.d.ts +1 -0
  20. package/dist/neutral/provider/index.d.ts.map +1 -1
  21. package/dist/neutral/provider/permissions/MemoryXyoPermissions.d.ts +17 -0
  22. package/dist/neutral/provider/permissions/MemoryXyoPermissions.d.ts.map +1 -0
  23. package/dist/neutral/provider/permissions/RpcXyoPermissions.d.ts +11 -0
  24. package/dist/neutral/provider/permissions/RpcXyoPermissions.d.ts.map +1 -0
  25. package/dist/neutral/provider/permissions/index.d.ts +4 -0
  26. package/dist/neutral/provider/permissions/index.d.ts.map +1 -0
  27. package/dist/neutral/provider/permissions/spec/MemoryXyoPermissions.spec.d.ts +2 -0
  28. package/dist/neutral/provider/permissions/spec/MemoryXyoPermissions.spec.d.ts.map +1 -0
  29. package/dist/neutral/provider/permissions/store/MemoryPermissions.d.ts +16 -0
  30. package/dist/neutral/provider/permissions/store/MemoryPermissions.d.ts.map +1 -0
  31. package/dist/neutral/provider/permissions/store/PermissionsStore.d.ts +12 -0
  32. package/dist/neutral/provider/permissions/store/PermissionsStore.d.ts.map +1 -0
  33. package/dist/neutral/provider/permissions/store/index.d.ts +3 -0
  34. package/dist/neutral/provider/permissions/store/index.d.ts.map +1 -0
  35. package/dist/neutral/provider/signer/JsonRpcXyoSigner.d.ts +3 -2
  36. package/dist/neutral/provider/signer/JsonRpcXyoSigner.d.ts.map +1 -1
  37. package/dist/neutral/provider/signer/MemoryXyoSigner.d.ts +2 -2
  38. package/dist/neutral/provider/signer/MemoryXyoSigner.d.ts.map +1 -1
  39. package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts +26 -9
  40. package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
  41. package/dist/neutral/transport/post-message/index.d.ts +0 -1
  42. package/dist/neutral/transport/post-message/index.d.ts.map +1 -1
  43. package/dist/neutral/types/ErrorCodes.d.ts.map +1 -1
  44. package/dist/neutral/types/XyoPermissions.d.ts +7 -0
  45. package/dist/neutral/types/XyoPermissions.d.ts.map +1 -0
  46. package/dist/neutral/types/index.d.ts +1 -2
  47. package/dist/neutral/types/index.d.ts.map +1 -1
  48. package/dist/neutral/types/schema/AllRpcSchemas.d.ts +914 -80
  49. package/dist/neutral/types/schema/AllRpcSchemas.d.ts.map +1 -1
  50. package/dist/neutral/types/schema/XyoPermissionsRpcSchemas.d.ts +74 -0
  51. package/dist/neutral/types/schema/XyoPermissionsRpcSchemas.d.ts.map +1 -0
  52. package/dist/neutral/types/schema/XyoProviderRpcSchemas.d.ts +4 -4
  53. package/dist/neutral/types/schema/XyoRunnerRpcSchemas.d.ts +4 -4
  54. package/dist/neutral/types/schema/XyoSignerRpcSchemas.d.ts +19 -19
  55. package/dist/neutral/types/schema/XyoSignerRpcSchemas.d.ts.map +1 -1
  56. package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts +828 -64
  57. package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts.map +1 -1
  58. package/dist/neutral/types/schema/common/BlockBoundWitness.d.ts +4 -4
  59. package/dist/neutral/types/schema/common/Chain.d.ts +2 -2
  60. package/dist/neutral/types/schema/common/Chain.d.ts.map +1 -1
  61. package/dist/neutral/types/schema/common/HydratedBlock.d.ts +5 -5
  62. package/dist/neutral/types/schema/common/HydratedTransaction.d.ts +14 -14
  63. package/dist/neutral/types/schema/common/Permission.d.ts +53 -0
  64. package/dist/neutral/types/schema/common/Permission.d.ts.map +1 -0
  65. package/dist/neutral/types/schema/common/Stake.d.ts +11 -5
  66. package/dist/neutral/types/schema/common/Stake.d.ts.map +1 -1
  67. package/dist/neutral/types/schema/common/StepContext.d.ts +6 -0
  68. package/dist/neutral/types/schema/common/StepContext.d.ts.map +1 -0
  69. package/dist/neutral/types/schema/common/TransactionBoundWitness.d.ts +4 -4
  70. package/dist/neutral/types/schema/common/Transfer.d.ts +33 -0
  71. package/dist/neutral/types/schema/common/Transfer.d.ts.map +1 -0
  72. package/dist/neutral/types/schema/common/index.d.ts +3 -0
  73. package/dist/neutral/types/schema/common/index.d.ts.map +1 -1
  74. package/dist/neutral/types/schema/index.d.ts +1 -1
  75. package/dist/neutral/types/schema/index.d.ts.map +1 -1
  76. package/dist/node/engine/index-node.d.ts +2 -2
  77. package/dist/node/engine/index-node.d.ts.map +1 -1
  78. package/dist/node/engine/index.d.ts +2 -1
  79. package/dist/node/engine/index.d.ts.map +1 -1
  80. package/dist/node/engine/rpcEngineFromConnection.d.ts +4 -0
  81. package/dist/node/engine/rpcEngineFromConnection.d.ts.map +1 -0
  82. package/dist/node/engine/rpcMethodHandlersFromConnection.d.ts +4 -0
  83. package/dist/node/engine/rpcMethodHandlersFromConnection.d.ts.map +1 -0
  84. package/dist/node/engine/rpcMethodHandlersFromPermissions.d.ts +4 -0
  85. package/dist/node/engine/rpcMethodHandlersFromPermissions.d.ts.map +1 -0
  86. package/dist/node/engine/rpcMethodHandlersFromViewer.d.ts.map +1 -1
  87. package/dist/node/index-node.mjs +900 -443
  88. package/dist/node/index-node.mjs.map +1 -1
  89. package/dist/node/provider/client/MemoryXyoClient.d.ts +2 -2
  90. package/dist/node/provider/client/MemoryXyoClient.d.ts.map +1 -1
  91. package/dist/node/provider/client/index.d.ts +0 -1
  92. package/dist/node/provider/client/index.d.ts.map +1 -1
  93. package/dist/node/provider/index.d.ts +1 -0
  94. package/dist/node/provider/index.d.ts.map +1 -1
  95. package/dist/node/provider/permissions/MemoryXyoPermissions.d.ts +17 -0
  96. package/dist/node/provider/permissions/MemoryXyoPermissions.d.ts.map +1 -0
  97. package/dist/node/provider/permissions/RpcXyoPermissions.d.ts +11 -0
  98. package/dist/node/provider/permissions/RpcXyoPermissions.d.ts.map +1 -0
  99. package/dist/node/provider/permissions/index.d.ts +4 -0
  100. package/dist/node/provider/permissions/index.d.ts.map +1 -0
  101. package/dist/node/provider/permissions/spec/MemoryXyoPermissions.spec.d.ts +2 -0
  102. package/dist/node/provider/permissions/spec/MemoryXyoPermissions.spec.d.ts.map +1 -0
  103. package/dist/node/provider/permissions/store/MemoryPermissions.d.ts +16 -0
  104. package/dist/node/provider/permissions/store/MemoryPermissions.d.ts.map +1 -0
  105. package/dist/node/provider/permissions/store/PermissionsStore.d.ts +12 -0
  106. package/dist/node/provider/permissions/store/PermissionsStore.d.ts.map +1 -0
  107. package/dist/node/provider/permissions/store/index.d.ts +3 -0
  108. package/dist/node/provider/permissions/store/index.d.ts.map +1 -0
  109. package/dist/node/provider/signer/JsonRpcXyoSigner.d.ts +3 -2
  110. package/dist/node/provider/signer/JsonRpcXyoSigner.d.ts.map +1 -1
  111. package/dist/node/provider/signer/MemoryXyoSigner.d.ts +2 -2
  112. package/dist/node/provider/signer/MemoryXyoSigner.d.ts.map +1 -1
  113. package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts +26 -9
  114. package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
  115. package/dist/node/transport/post-message/index.d.ts +0 -1
  116. package/dist/node/transport/post-message/index.d.ts.map +1 -1
  117. package/dist/node/types/ErrorCodes.d.ts.map +1 -1
  118. package/dist/node/types/XyoPermissions.d.ts +7 -0
  119. package/dist/node/types/XyoPermissions.d.ts.map +1 -0
  120. package/dist/node/types/index.d.ts +1 -2
  121. package/dist/node/types/index.d.ts.map +1 -1
  122. package/dist/node/types/schema/AllRpcSchemas.d.ts +914 -80
  123. package/dist/node/types/schema/AllRpcSchemas.d.ts.map +1 -1
  124. package/dist/node/types/schema/XyoPermissionsRpcSchemas.d.ts +74 -0
  125. package/dist/node/types/schema/XyoPermissionsRpcSchemas.d.ts.map +1 -0
  126. package/dist/node/types/schema/XyoProviderRpcSchemas.d.ts +4 -4
  127. package/dist/node/types/schema/XyoRunnerRpcSchemas.d.ts +4 -4
  128. package/dist/node/types/schema/XyoSignerRpcSchemas.d.ts +19 -19
  129. package/dist/node/types/schema/XyoSignerRpcSchemas.d.ts.map +1 -1
  130. package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts +828 -64
  131. package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts.map +1 -1
  132. package/dist/node/types/schema/common/BlockBoundWitness.d.ts +4 -4
  133. package/dist/node/types/schema/common/Chain.d.ts +2 -2
  134. package/dist/node/types/schema/common/Chain.d.ts.map +1 -1
  135. package/dist/node/types/schema/common/HydratedBlock.d.ts +5 -5
  136. package/dist/node/types/schema/common/HydratedTransaction.d.ts +14 -14
  137. package/dist/node/types/schema/common/Permission.d.ts +53 -0
  138. package/dist/node/types/schema/common/Permission.d.ts.map +1 -0
  139. package/dist/node/types/schema/common/Stake.d.ts +11 -5
  140. package/dist/node/types/schema/common/Stake.d.ts.map +1 -1
  141. package/dist/node/types/schema/common/StepContext.d.ts +6 -0
  142. package/dist/node/types/schema/common/StepContext.d.ts.map +1 -0
  143. package/dist/node/types/schema/common/TransactionBoundWitness.d.ts +4 -4
  144. package/dist/node/types/schema/common/Transfer.d.ts +33 -0
  145. package/dist/node/types/schema/common/Transfer.d.ts.map +1 -0
  146. package/dist/node/types/schema/common/index.d.ts +3 -0
  147. package/dist/node/types/schema/common/index.d.ts.map +1 -1
  148. package/dist/node/types/schema/index.d.ts +1 -1
  149. package/dist/node/types/schema/index.d.ts.map +1 -1
  150. package/package.json +36 -36
  151. package/src/engine/index-node.ts +2 -2
  152. package/src/engine/index.ts +2 -1
  153. package/src/engine/{rpcEngineFromProvider.ts → rpcEngineFromConnection.ts} +3 -3
  154. package/src/engine/{rpcMethodHandlersFromProvider.ts → rpcMethodHandlersFromConnection.ts} +3 -3
  155. package/src/engine/rpcMethodHandlersFromPermissions.ts +11 -0
  156. package/src/engine/rpcMethodHandlersFromViewer.ts +19 -1
  157. package/src/provider/client/MemoryXyoClient.ts +2 -1
  158. package/src/provider/client/index.ts +0 -1
  159. package/src/provider/client/spec/MemoryXyoClient.spec.ts +17 -31
  160. package/src/provider/index.ts +1 -0
  161. package/src/provider/permissions/MemoryXyoPermissions.ts +82 -0
  162. package/src/provider/permissions/RpcXyoPermissions.ts +30 -0
  163. package/src/provider/permissions/index.ts +3 -0
  164. package/src/provider/permissions/spec/MemoryXyoPermissions.spec.ts +93 -0
  165. package/src/provider/permissions/store/MemoryPermissions.ts +32 -0
  166. package/src/provider/permissions/store/PermissionsStore.ts +15 -0
  167. package/src/provider/permissions/store/index.ts +2 -0
  168. package/src/provider/signer/JsonRpcXyoSigner.ts +3 -2
  169. package/src/provider/signer/MemoryXyoSigner.ts +2 -2
  170. package/src/provider/signer/spec/RpcEngineXyoSigner.spec.ts +5 -5
  171. package/src/provider/viewer/JsonRpcXyoViewer.ts +105 -30
  172. package/src/transport/post-message/index.ts +0 -1
  173. package/src/types/ErrorCodes.ts +1 -0
  174. package/src/types/XyoPermissions.ts +13 -0
  175. package/src/types/index.ts +1 -2
  176. package/src/types/schema/AllRpcSchemas.ts +2 -0
  177. package/src/types/schema/XyoPermissionsRpcSchemas.ts +40 -0
  178. package/src/types/schema/XyoSignerRpcSchemas.ts +1 -1
  179. package/src/types/schema/XyoViewerRpcSchemas.ts +261 -15
  180. package/src/types/schema/common/Chain.ts +2 -2
  181. package/src/types/schema/common/Permission.ts +23 -0
  182. package/src/types/schema/common/Stake.ts +3 -3
  183. package/src/types/schema/common/StepContext.ts +6 -0
  184. package/src/types/schema/common/Transfer.ts +14 -0
  185. package/src/types/schema/common/index.ts +3 -0
  186. package/src/types/schema/index.ts +1 -1
  187. package/dist/neutral/engine/rpcEngineFromProvider.d.ts +0 -4
  188. package/dist/neutral/engine/rpcEngineFromProvider.d.ts.map +0 -1
  189. package/dist/neutral/engine/rpcMethodHandlersFromProvider.d.ts +0 -4
  190. package/dist/neutral/engine/rpcMethodHandlersFromProvider.d.ts.map +0 -1
  191. package/dist/neutral/provider/client/PermissionsStore/MemoryPermissionsStore.d.ts +0 -11
  192. package/dist/neutral/provider/client/PermissionsStore/MemoryPermissionsStore.d.ts.map +0 -1
  193. package/dist/neutral/provider/client/PermissionsStore/PermissionsStore.d.ts +0 -8
  194. package/dist/neutral/provider/client/PermissionsStore/PermissionsStore.d.ts.map +0 -1
  195. package/dist/neutral/provider/client/PermissionsStore/getPermissionsStoreFromTransport.d.ts +0 -5
  196. package/dist/neutral/provider/client/PermissionsStore/getPermissionsStoreFromTransport.d.ts.map +0 -1
  197. package/dist/neutral/provider/client/PermissionsStore/index.d.ts +0 -4
  198. package/dist/neutral/provider/client/PermissionsStore/index.d.ts.map +0 -1
  199. package/dist/neutral/provider/client/PermissionsStore/spec/MemoryPermissionsStore.spec.d.ts +0 -2
  200. package/dist/neutral/provider/client/PermissionsStore/spec/MemoryPermissionsStore.spec.d.ts.map +0 -1
  201. package/dist/neutral/transport/post-message/LegacyPostMessageRpcTransport.d.ts +0 -15
  202. package/dist/neutral/transport/post-message/LegacyPostMessageRpcTransport.d.ts.map +0 -1
  203. package/dist/neutral/types/XyoGatewayRpc.d.ts +0 -8
  204. package/dist/neutral/types/XyoGatewayRpc.d.ts.map +0 -1
  205. package/dist/neutral/types/schema/XyoGatewayRpcSchemas.d.ts +0 -437
  206. package/dist/neutral/types/schema/XyoGatewayRpcSchemas.d.ts.map +0 -1
  207. package/dist/node/engine/rpcEngineFromProvider.d.ts +0 -4
  208. package/dist/node/engine/rpcEngineFromProvider.d.ts.map +0 -1
  209. package/dist/node/engine/rpcMethodHandlersFromProvider.d.ts +0 -4
  210. package/dist/node/engine/rpcMethodHandlersFromProvider.d.ts.map +0 -1
  211. package/dist/node/provider/client/PermissionsStore/MemoryPermissionsStore.d.ts +0 -11
  212. package/dist/node/provider/client/PermissionsStore/MemoryPermissionsStore.d.ts.map +0 -1
  213. package/dist/node/provider/client/PermissionsStore/PermissionsStore.d.ts +0 -8
  214. package/dist/node/provider/client/PermissionsStore/PermissionsStore.d.ts.map +0 -1
  215. package/dist/node/provider/client/PermissionsStore/getPermissionsStoreFromTransport.d.ts +0 -5
  216. package/dist/node/provider/client/PermissionsStore/getPermissionsStoreFromTransport.d.ts.map +0 -1
  217. package/dist/node/provider/client/PermissionsStore/index.d.ts +0 -4
  218. package/dist/node/provider/client/PermissionsStore/index.d.ts.map +0 -1
  219. package/dist/node/provider/client/PermissionsStore/spec/MemoryPermissionsStore.spec.d.ts +0 -2
  220. package/dist/node/provider/client/PermissionsStore/spec/MemoryPermissionsStore.spec.d.ts.map +0 -1
  221. package/dist/node/transport/post-message/LegacyPostMessageRpcTransport.d.ts +0 -15
  222. package/dist/node/transport/post-message/LegacyPostMessageRpcTransport.d.ts.map +0 -1
  223. package/dist/node/types/XyoGatewayRpc.d.ts +0 -8
  224. package/dist/node/types/XyoGatewayRpc.d.ts.map +0 -1
  225. package/dist/node/types/schema/XyoGatewayRpcSchemas.d.ts +0 -437
  226. package/dist/node/types/schema/XyoGatewayRpcSchemas.d.ts.map +0 -1
  227. package/src/provider/client/PermissionsStore/MemoryPermissionsStore.ts +0 -33
  228. package/src/provider/client/PermissionsStore/PermissionsStore.ts +0 -8
  229. package/src/provider/client/PermissionsStore/getPermissionsStoreFromTransport.ts +0 -12
  230. package/src/provider/client/PermissionsStore/index.ts +0 -3
  231. package/src/provider/client/PermissionsStore/spec/MemoryPermissionsStore.spec.ts +0 -78
  232. package/src/transport/post-message/LegacyPostMessageRpcTransport.ts +0 -120
  233. package/src/types/XyoGatewayRpc.ts +0 -15
  234. package/src/types/schema/XyoGatewayRpcSchemas.ts +0 -108
@@ -1,437 +0,0 @@
1
- import type { Chain } from '@xyo-network/xl1-protocol';
2
- import * as z from 'zod';
3
- export declare const ChainConnectionZod: z.ZodObject<{
4
- chainId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<Chain, Chain>]>>;
5
- name: z.ZodString;
6
- url: z.ZodString;
7
- }, z.core.$strip>;
8
- export declare const CaveatTypesZod: z.ZodEnum<{
9
- chain: "chain";
10
- expiration: "expiration";
11
- filteredResponse: "filteredResponse";
12
- rateLimit: "rateLimit";
13
- }>;
14
- export declare const CaveatsZod: z.ZodObject<{
15
- type: z.ZodEnum<{
16
- chain: "chain";
17
- expiration: "expiration";
18
- filteredResponse: "filteredResponse";
19
- rateLimit: "rateLimit";
20
- }>;
21
- value: z.ZodUnknown;
22
- }, z.core.$strip>;
23
- export declare const PermissionZod: z.ZodObject<{
24
- capability: z.ZodString;
25
- caveats: z.ZodOptional<z.ZodArray<z.ZodObject<{
26
- type: z.ZodEnum<{
27
- chain: "chain";
28
- expiration: "expiration";
29
- filteredResponse: "filteredResponse";
30
- rateLimit: "rateLimit";
31
- }>;
32
- value: z.ZodUnknown;
33
- }, z.core.$strip>>>;
34
- invoker: z.ZodString;
35
- }, z.core.$strip>;
36
- export declare const InvokerPermissionZod: z.ZodObject<{
37
- capability: z.ZodString;
38
- caveats: z.ZodOptional<z.ZodArray<z.ZodObject<{
39
- type: z.ZodEnum<{
40
- chain: "chain";
41
- expiration: "expiration";
42
- filteredResponse: "filteredResponse";
43
- rateLimit: "rateLimit";
44
- }>;
45
- value: z.ZodUnknown;
46
- }, z.core.$strip>>>;
47
- invoker: z.ZodString;
48
- date: z.ZodOptional<z.ZodNumber>;
49
- }, z.core.$strip>;
50
- export type ChainConnection = z.infer<typeof ChainConnectionZod>;
51
- export declare const XyoGatewayRpcSchemas: {
52
- xyoGateway_submitTransaction: {
53
- params: {
54
- from: z.ZodArray<z.ZodTuple<[z.ZodObject<{
55
- schema: z.ZodLiteral<"network.xyo.boundwitness">;
56
- addresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
57
- readonly __hex: true;
58
- }>, {
59
- readonly __address: true;
60
- }>, string>>>;
61
- payload_hashes: z.ZodArray<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
62
- readonly __hex: true;
63
- }>, {
64
- readonly __hash: true;
65
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
66
- readonly __hex: true;
67
- }>, {
68
- readonly __hash: true;
69
- }>, unknown>>>;
70
- payload_schemas: z.ZodArray<z.ZodString>;
71
- previous_hashes: z.ZodArray<z.ZodNullable<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
72
- readonly __hex: true;
73
- }>, {
74
- readonly __hash: true;
75
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
76
- readonly __hex: true;
77
- }>, {
78
- readonly __hash: true;
79
- }>, unknown>>>>;
80
- $destination: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
81
- readonly __hex: true;
82
- }>, {
83
- readonly __address: true;
84
- }>, string>>>;
85
- $sourceQuery: z.ZodOptional<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
86
- readonly __hex: true;
87
- }>, {
88
- readonly __hash: true;
89
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
90
- readonly __hex: true;
91
- }>, {
92
- readonly __hash: true;
93
- }>, unknown>>>;
94
- $signatures: z.ZodArray<z.ZodUnion<readonly [z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
95
- readonly __hex: true;
96
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
97
- readonly __hex: true;
98
- }>, unknown>>, z.ZodNull]>>;
99
- _hash: z.ZodOptional<z.ZodPipe<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
100
- readonly __hex: true;
101
- }>, {
102
- readonly __hash: true;
103
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
104
- readonly __hex: true;
105
- }>, {
106
- readonly __hash: true;
107
- }>, unknown>>, z.ZodTransform<string, import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
108
- readonly __hex: true;
109
- }>, {
110
- readonly __hash: true;
111
- }>>>>;
112
- _dataHash: z.ZodOptional<z.ZodPipe<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
113
- readonly __hex: true;
114
- }>, {
115
- readonly __hash: true;
116
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
117
- readonly __hex: true;
118
- }>, {
119
- readonly __hash: true;
120
- }>, unknown>>, z.ZodTransform<string, import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
121
- readonly __hex: true;
122
- }>, {
123
- readonly __hash: true;
124
- }>>>>;
125
- _sequence: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
126
- nbf: z.ZodNumber;
127
- exp: z.ZodNumber;
128
- fees: z.ZodObject<{
129
- base: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
130
- readonly __hex: true;
131
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
132
- readonly __hex: true;
133
- }>, unknown>>;
134
- gasLimit: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
135
- readonly __hex: true;
136
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
137
- readonly __hex: true;
138
- }>, unknown>>;
139
- gasPrice: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
140
- readonly __hex: true;
141
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
142
- readonly __hex: true;
143
- }>, unknown>>;
144
- priority: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
145
- readonly __hex: true;
146
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
147
- readonly __hex: true;
148
- }>, unknown>>;
149
- }, z.core.$strip>;
150
- chain: z.ZodPipe<z.ZodString, z.ZodTransform<Chain, string>>;
151
- from: z.ZodPipe<z.ZodString, z.ZodTransform<Chain, string>>;
152
- script: z.ZodOptional<z.ZodArray<z.ZodString>>;
153
- }, z.core.$strip>, z.ZodArray<z.ZodObject<{
154
- schema: z.ZodString;
155
- }, z.core.$catchall<z.ZodAny>>>], null>>;
156
- to: z.ZodArray<z.ZodTuple<[z.ZodObject<{
157
- schema: z.ZodLiteral<"network.xyo.boundwitness">;
158
- addresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
159
- readonly __hex: true;
160
- }>, {
161
- readonly __address: true;
162
- }>, string>>>;
163
- payload_hashes: z.ZodArray<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
164
- readonly __hex: true;
165
- }>, {
166
- readonly __hash: true;
167
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
168
- readonly __hex: true;
169
- }>, {
170
- readonly __hash: true;
171
- }>, unknown>>>;
172
- payload_schemas: z.ZodArray<z.ZodString>;
173
- previous_hashes: z.ZodArray<z.ZodNullable<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
174
- readonly __hex: true;
175
- }>, {
176
- readonly __hash: true;
177
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
178
- readonly __hex: true;
179
- }>, {
180
- readonly __hash: true;
181
- }>, unknown>>>>;
182
- $destination: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
183
- readonly __hex: true;
184
- }>, {
185
- readonly __address: true;
186
- }>, string>>>;
187
- $sourceQuery: z.ZodOptional<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
188
- readonly __hex: true;
189
- }>, {
190
- readonly __hash: true;
191
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
192
- readonly __hex: true;
193
- }>, {
194
- readonly __hash: true;
195
- }>, unknown>>>;
196
- $signatures: z.ZodArray<z.ZodUnion<readonly [z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
197
- readonly __hex: true;
198
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
199
- readonly __hex: true;
200
- }>, unknown>>, z.ZodNull]>>;
201
- _hash: z.ZodOptional<z.ZodPipe<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
202
- readonly __hex: true;
203
- }>, {
204
- readonly __hash: true;
205
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
206
- readonly __hex: true;
207
- }>, {
208
- readonly __hash: true;
209
- }>, unknown>>, z.ZodTransform<string, import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
210
- readonly __hex: true;
211
- }>, {
212
- readonly __hash: true;
213
- }>>>>;
214
- _dataHash: z.ZodOptional<z.ZodPipe<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
215
- readonly __hex: true;
216
- }>, {
217
- readonly __hash: true;
218
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
219
- readonly __hex: true;
220
- }>, {
221
- readonly __hash: true;
222
- }>, unknown>>, z.ZodTransform<string, import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
223
- readonly __hex: true;
224
- }>, {
225
- readonly __hash: true;
226
- }>>>>;
227
- _sequence: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
228
- nbf: z.ZodNumber;
229
- exp: z.ZodNumber;
230
- fees: z.ZodObject<{
231
- base: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
232
- readonly __hex: true;
233
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
234
- readonly __hex: true;
235
- }>, unknown>>;
236
- gasLimit: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
237
- readonly __hex: true;
238
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
239
- readonly __hex: true;
240
- }>, unknown>>;
241
- gasPrice: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
242
- readonly __hex: true;
243
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
244
- readonly __hex: true;
245
- }>, unknown>>;
246
- priority: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
247
- readonly __hex: true;
248
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
249
- readonly __hex: true;
250
- }>, unknown>>;
251
- }, z.core.$strip>;
252
- chain: z.ZodPipe<z.ZodString, z.ZodTransform<Chain, string>>;
253
- from: z.ZodPipe<z.ZodString, z.ZodTransform<Chain, string>>;
254
- script: z.ZodOptional<z.ZodArray<z.ZodString>>;
255
- }, z.core.$strip>, z.ZodArray<z.ZodObject<{
256
- schema: z.ZodString;
257
- }, z.core.$catchall<z.ZodAny>>>], null>>;
258
- };
259
- result: {
260
- from: z.ZodObject<{
261
- schema: z.ZodLiteral<"network.xyo.boundwitness">;
262
- addresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
263
- readonly __hex: true;
264
- }>, {
265
- readonly __address: true;
266
- }>, string>>>;
267
- payload_hashes: z.ZodArray<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
268
- readonly __hex: true;
269
- }>, {
270
- readonly __hash: true;
271
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
272
- readonly __hex: true;
273
- }>, {
274
- readonly __hash: true;
275
- }>, unknown>>>;
276
- payload_schemas: z.ZodArray<z.ZodString>;
277
- previous_hashes: z.ZodArray<z.ZodNullable<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
278
- readonly __hex: true;
279
- }>, {
280
- readonly __hash: true;
281
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
282
- readonly __hex: true;
283
- }>, {
284
- readonly __hash: true;
285
- }>, unknown>>>>;
286
- $destination: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
287
- readonly __hex: true;
288
- }>, {
289
- readonly __address: true;
290
- }>, string>>>;
291
- $sourceQuery: z.ZodOptional<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
292
- readonly __hex: true;
293
- }>, {
294
- readonly __hash: true;
295
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
296
- readonly __hex: true;
297
- }>, {
298
- readonly __hash: true;
299
- }>, unknown>>>;
300
- $signatures: z.ZodArray<z.ZodUnion<readonly [z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
301
- readonly __hex: true;
302
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
303
- readonly __hex: true;
304
- }>, unknown>>, z.ZodNull]>>;
305
- _hash: z.ZodOptional<z.ZodPipe<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
306
- readonly __hex: true;
307
- }>, {
308
- readonly __hash: true;
309
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
310
- readonly __hex: true;
311
- }>, {
312
- readonly __hash: true;
313
- }>, unknown>>, z.ZodTransform<string, import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
314
- readonly __hex: true;
315
- }>, {
316
- readonly __hash: true;
317
- }>>>>;
318
- _dataHash: z.ZodOptional<z.ZodPipe<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
319
- readonly __hex: true;
320
- }>, {
321
- readonly __hash: true;
322
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
323
- readonly __hex: true;
324
- }>, {
325
- readonly __hash: true;
326
- }>, unknown>>, z.ZodTransform<string, import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
327
- readonly __hex: true;
328
- }>, {
329
- readonly __hash: true;
330
- }>>>>;
331
- _sequence: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
332
- block: z.ZodNumber;
333
- chain: z.ZodPipe<z.ZodString, z.ZodTransform<Chain, string>>;
334
- previous: z.ZodNullable<z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
335
- readonly __hex: true;
336
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
337
- readonly __hex: true;
338
- }>, unknown>>>;
339
- protocol: z.ZodOptional<z.ZodNumber>;
340
- step_hashes: z.ZodOptional<z.ZodArray<z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
341
- readonly __hex: true;
342
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
343
- readonly __hex: true;
344
- }>, unknown>>>>;
345
- $epoch: z.ZodNumber;
346
- }, z.core.$strip>;
347
- to: z.ZodObject<{
348
- schema: z.ZodLiteral<"network.xyo.boundwitness">;
349
- addresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
350
- readonly __hex: true;
351
- }>, {
352
- readonly __address: true;
353
- }>, string>>>;
354
- payload_hashes: z.ZodArray<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
355
- readonly __hex: true;
356
- }>, {
357
- readonly __hash: true;
358
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
359
- readonly __hex: true;
360
- }>, {
361
- readonly __hash: true;
362
- }>, unknown>>>;
363
- payload_schemas: z.ZodArray<z.ZodString>;
364
- previous_hashes: z.ZodArray<z.ZodNullable<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
365
- readonly __hex: true;
366
- }>, {
367
- readonly __hash: true;
368
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
369
- readonly __hex: true;
370
- }>, {
371
- readonly __hash: true;
372
- }>, unknown>>>>;
373
- $destination: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
374
- readonly __hex: true;
375
- }>, {
376
- readonly __address: true;
377
- }>, string>>>;
378
- $sourceQuery: z.ZodOptional<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
379
- readonly __hex: true;
380
- }>, {
381
- readonly __hash: true;
382
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
383
- readonly __hex: true;
384
- }>, {
385
- readonly __hash: true;
386
- }>, unknown>>>;
387
- $signatures: z.ZodArray<z.ZodUnion<readonly [z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
388
- readonly __hex: true;
389
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
390
- readonly __hex: true;
391
- }>, unknown>>, z.ZodNull]>>;
392
- _hash: z.ZodOptional<z.ZodPipe<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
393
- readonly __hex: true;
394
- }>, {
395
- readonly __hash: true;
396
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
397
- readonly __hex: true;
398
- }>, {
399
- readonly __hash: true;
400
- }>, unknown>>, z.ZodTransform<string, import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
401
- readonly __hex: true;
402
- }>, {
403
- readonly __hash: true;
404
- }>>>>;
405
- _dataHash: z.ZodOptional<z.ZodPipe<z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
406
- readonly __hex: true;
407
- }>, {
408
- readonly __hash: true;
409
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
410
- readonly __hex: true;
411
- }>, {
412
- readonly __hash: true;
413
- }>, unknown>>, z.ZodTransform<string, import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
414
- readonly __hex: true;
415
- }>, {
416
- readonly __hash: true;
417
- }>>>>;
418
- _sequence: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
419
- block: z.ZodNumber;
420
- chain: z.ZodPipe<z.ZodString, z.ZodTransform<Chain, string>>;
421
- previous: z.ZodNullable<z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
422
- readonly __hex: true;
423
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
424
- readonly __hex: true;
425
- }>, unknown>>>;
426
- protocol: z.ZodOptional<z.ZodNumber>;
427
- step_hashes: z.ZodOptional<z.ZodArray<z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
428
- readonly __hex: true;
429
- }>, unknown, z.core.$ZodTypeInternals<import("@xylabs/typeof").Brand<Lowercase<string>, {
430
- readonly __hex: true;
431
- }>, unknown>>>>;
432
- $epoch: z.ZodNumber;
433
- }, z.core.$strip>;
434
- };
435
- };
436
- };
437
- //# sourceMappingURL=XyoGatewayRpcSchemas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"XyoGatewayRpcSchemas.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/XyoGatewayRpcSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAMxB,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;EAAmE,CAAA;AAE9F,eAAO,MAAM,UAAU;;;;;;;;iBAGrB,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;iBAIxB,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;iBAAwD,CAAA;AAEzF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEhE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EgB,CAAA"}
@@ -1,33 +0,0 @@
1
- import type { Promisable } from '@xylabs/promise'
2
- import type { InvokerPermission, Permission } from '@xyo-network/xl1-protocol'
3
-
4
- import type { PermissionsStore } from './PermissionsStore.ts'
5
-
6
- export class MemoryPermissionsStore implements PermissionsStore {
7
- private readonly _store: Map<string, InvokerPermission> = new Map()
8
-
9
- getPermissions(): Promisable<InvokerPermission[]> {
10
- return [...this._store.values()]
11
- }
12
-
13
- requestPermissions(permissions: Permission[]): Promisable<boolean> {
14
- const now = Date.now()
15
- for (const perm of permissions) {
16
- const key = this.getKey(perm)
17
- this._store.set(key, { ...perm, date: now })
18
- }
19
- return true
20
- }
21
-
22
- revokePermissions(permissions: Permission[]): Promisable<boolean> {
23
- for (const perm of permissions) {
24
- const key = this.getKey(perm)
25
- this._store.delete(key)
26
- }
27
- return true
28
- }
29
-
30
- private getKey(permission: Permission): string {
31
- return `${permission.invoker}::${permission.capability}`
32
- }
33
- }
@@ -1,8 +0,0 @@
1
- import type { Promisable } from '@xylabs/promise'
2
- import type { InvokerPermission, Permission } from '@xyo-network/xl1-protocol'
3
-
4
- export interface PermissionsStore {
5
- getPermissions(): Promisable<InvokerPermission[]>
6
- requestPermissions(permissions: Permission[]): Promisable<boolean>
7
- revokePermissions(permissions: Permission[]): Promisable<boolean>
8
- }
@@ -1,12 +0,0 @@
1
- import { type RpcTransport } from '../../../transport/index.ts'
2
- import type { XyoGatewayRpcSchemas } from '../../../types/index.ts'
3
- import type { PermissionsStore } from './PermissionsStore.ts'
4
-
5
- export const getPermissionsStoreFromTransport = (_transport: RpcTransport<typeof XyoGatewayRpcSchemas>): PermissionsStore => {
6
- throw new Error('Not implemented')
7
- // return {
8
- // getPermissions: () => transport.sendRequest('xyoGateway_getPermissions'),
9
- // requestPermissions: (permissions: Permission[]) => transport.sendRequest('xyoGateway_requestPermissions', permissions),
10
- // revokePermissions: (permissions: Permission[]) => transport.sendRequest('xyoGateway_revokePermissions', permissions),
11
- // }
12
- }
@@ -1,3 +0,0 @@
1
- export * from './getPermissionsStoreFromTransport.ts'
2
- export * from './MemoryPermissionsStore.ts'
3
- export * from './PermissionsStore.ts'
@@ -1,78 +0,0 @@
1
- import type { Permission } from '@xyo-network/xl1-protocol'
2
- import {
3
- beforeEach, describe, expect, it,
4
- } from 'vitest'
5
-
6
- import { MemoryPermissionsStore } from '../MemoryPermissionsStore.ts'
7
-
8
- describe('MemoryPermissionsStore', () => {
9
- const invoker = 'https://example.com'
10
- const capability = 'xyoViewer_chainId'
11
- let store: MemoryPermissionsStore
12
- const basePermission: Permission = { capability, invoker }
13
-
14
- beforeEach(() => {
15
- store = new MemoryPermissionsStore()
16
- })
17
-
18
- it('returns an empty list initially', async () => {
19
- const permissions = await store.getPermissions()
20
- expect(permissions).toEqual([])
21
- })
22
-
23
- it('adds and retrieves a permission', async () => {
24
- const result = await store.requestPermissions([basePermission])
25
- expect(result).toBe(true)
26
-
27
- const permissions = await store.getPermissions()
28
- expect(permissions.length).toBe(1)
29
- expect(permissions[0].capability).toBe(basePermission.capability)
30
- expect(permissions[0].invoker).toBe(basePermission.invoker)
31
- expect(typeof permissions[0].date).toBe('number')
32
- })
33
-
34
- it('replaces an existing permission with the same key', async () => {
35
- const original = { ...basePermission }
36
- const updated = { ...basePermission }
37
-
38
- await store.requestPermissions([original])
39
- const originalDate = (await store.getPermissions())[0].date
40
-
41
- await new Promise(r => setTimeout(r, 5)) // ensure timestamp difference
42
- await store.requestPermissions([updated])
43
- const updatedDate = (await store.getPermissions())[0].date
44
-
45
- expect(updatedDate).toBeGreaterThan(originalDate!)
46
- })
47
-
48
- it('revokes a previously granted permission', async () => {
49
- await store.requestPermissions([basePermission])
50
- expect((await store.getPermissions()).length).toBe(1)
51
-
52
- const result = await store.revokePermissions([basePermission])
53
- expect(result).toBe(true)
54
-
55
- const permissions = await store.getPermissions()
56
- expect(permissions).toEqual([])
57
- })
58
-
59
- it('revoking a non-existent permission does nothing and returns true', async () => {
60
- const result = await store.revokePermissions([basePermission])
61
- expect(result).toBe(true)
62
- expect(await store.getPermissions()).toEqual([])
63
- })
64
-
65
- it('can handle multiple permissions from different invokers', async () => {
66
- const perms: Permission[] = [
67
- { invoker: 'https://a.com', capability: 'xyo_1' },
68
- { invoker: 'https://b.com', capability: 'xyo_2' },
69
- { invoker: 'https://a.com', capability: 'xyo_3' },
70
- ]
71
-
72
- await store.requestPermissions(perms)
73
- const results = await store.getPermissions()
74
-
75
- expect(results.length).toBe(3)
76
- expect(results.map(p => p.capability).toSorted((a, b) => a.localeCompare(b))).toEqual(['xyo_1', 'xyo_2', 'xyo_3'])
77
- })
78
- })