@tideorg/js 0.0.1

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/LICENSE +333 -0
  2. package/README.md +12 -0
  3. package/dist/Clients/ClientBase.d.ts +24 -0
  4. package/dist/Clients/ClientBase.d.ts.map +1 -0
  5. package/dist/Clients/ClientBase.js +160 -0
  6. package/dist/Clients/NetworkClient.d.ts +11 -0
  7. package/dist/Clients/NetworkClient.d.ts.map +1 -0
  8. package/dist/Clients/NetworkClient.js +68 -0
  9. package/dist/Clients/NodeClient.d.ts +34 -0
  10. package/dist/Clients/NodeClient.d.ts.map +1 -0
  11. package/dist/Clients/NodeClient.js +191 -0
  12. package/dist/Clients/VoucherClient.d.ts +8 -0
  13. package/dist/Clients/VoucherClient.d.ts.map +1 -0
  14. package/dist/Clients/VoucherClient.js +36 -0
  15. package/dist/Clients/index.d.ts +5 -0
  16. package/dist/Clients/index.d.ts.map +1 -0
  17. package/dist/Clients/index.js +20 -0
  18. package/dist/Contracts/BaseContract.d.ts +47 -0
  19. package/dist/Contracts/BaseContract.d.ts.map +1 -0
  20. package/dist/Contracts/BaseContract.js +153 -0
  21. package/dist/Contracts/GenericRealmAccessThresholdRoleContract.d.ts +8 -0
  22. package/dist/Contracts/GenericRealmAccessThresholdRoleContract.d.ts.map +1 -0
  23. package/dist/Contracts/GenericRealmAccessThresholdRoleContract.js +21 -0
  24. package/dist/Contracts/GenericResourceAccessThresholdRoleContract.d.ts +8 -0
  25. package/dist/Contracts/GenericResourceAccessThresholdRoleContract.d.ts.map +1 -0
  26. package/dist/Contracts/GenericResourceAccessThresholdRoleContract.js +21 -0
  27. package/dist/Contracts/index.d.ts +4 -0
  28. package/dist/Contracts/index.d.ts.map +1 -0
  29. package/dist/Contracts/index.js +19 -0
  30. package/dist/Cryptide/Components/BaseComponent.d.ts +56 -0
  31. package/dist/Cryptide/Components/BaseComponent.d.ts.map +1 -0
  32. package/dist/Cryptide/Components/BaseComponent.js +176 -0
  33. package/dist/Cryptide/Components/ComponentRegistry.d.ts +18 -0
  34. package/dist/Cryptide/Components/ComponentRegistry.d.ts.map +1 -0
  35. package/dist/Cryptide/Components/ComponentRegistry.js +39 -0
  36. package/dist/Cryptide/Components/Schemes/AES/AESScheme.d.ts +5 -0
  37. package/dist/Cryptide/Components/Schemes/AES/AESScheme.d.ts.map +1 -0
  38. package/dist/Cryptide/Components/Schemes/AES/AESScheme.js +20 -0
  39. package/dist/Cryptide/Components/Schemes/AES/index.d.ts +2 -0
  40. package/dist/Cryptide/Components/Schemes/AES/index.d.ts.map +1 -0
  41. package/dist/Cryptide/Components/Schemes/AES/index.js +17 -0
  42. package/dist/Cryptide/Components/Schemes/BaseScheme.d.ts +7 -0
  43. package/dist/Cryptide/Components/Schemes/BaseScheme.d.ts.map +1 -0
  44. package/dist/Cryptide/Components/Schemes/BaseScheme.js +23 -0
  45. package/dist/Cryptide/Components/Schemes/Ed25519/Ed25519Components.d.ts +52 -0
  46. package/dist/Cryptide/Components/Schemes/Ed25519/Ed25519Components.d.ts.map +1 -0
  47. package/dist/Cryptide/Components/Schemes/Ed25519/Ed25519Components.js +171 -0
  48. package/dist/Cryptide/Components/Schemes/Ed25519/Ed25519Scheme.d.ts +13 -0
  49. package/dist/Cryptide/Components/Schemes/Ed25519/Ed25519Scheme.d.ts.map +1 -0
  50. package/dist/Cryptide/Components/Schemes/Ed25519/Ed25519Scheme.js +71 -0
  51. package/dist/Cryptide/Components/Schemes/Ed25519/index.d.ts +3 -0
  52. package/dist/Cryptide/Components/Schemes/Ed25519/index.d.ts.map +1 -0
  53. package/dist/Cryptide/Components/Schemes/Ed25519/index.js +18 -0
  54. package/dist/Cryptide/Components/Schemes/SchemeRegistry.d.ts +3 -0
  55. package/dist/Cryptide/Components/Schemes/SchemeRegistry.d.ts.map +1 -0
  56. package/dist/Cryptide/Components/Schemes/SchemeRegistry.js +22 -0
  57. package/dist/Cryptide/Components/Schemes/index.d.ts +5 -0
  58. package/dist/Cryptide/Components/Schemes/index.d.ts.map +1 -0
  59. package/dist/Cryptide/Components/Schemes/index.js +20 -0
  60. package/dist/Cryptide/Components/index.d.ts +4 -0
  61. package/dist/Cryptide/Components/index.d.ts.map +1 -0
  62. package/dist/Cryptide/Components/index.js +19 -0
  63. package/dist/Cryptide/Ed25519.d.ts +106 -0
  64. package/dist/Cryptide/Ed25519.d.ts.map +1 -0
  65. package/dist/Cryptide/Ed25519.js +522 -0
  66. package/dist/Cryptide/Encryption/AES.d.ts +6 -0
  67. package/dist/Cryptide/Encryption/AES.d.ts.map +1 -0
  68. package/dist/Cryptide/Encryption/AES.js +76 -0
  69. package/dist/Cryptide/Encryption/DH.d.ts +4 -0
  70. package/dist/Cryptide/Encryption/DH.d.ts.map +1 -0
  71. package/dist/Cryptide/Encryption/DH.js +38 -0
  72. package/dist/Cryptide/Encryption/ElGamal.d.ts +12 -0
  73. package/dist/Cryptide/Encryption/ElGamal.d.ts.map +1 -0
  74. package/dist/Cryptide/Encryption/ElGamal.js +61 -0
  75. package/dist/Cryptide/Encryption/index.d.ts +4 -0
  76. package/dist/Cryptide/Encryption/index.d.ts.map +1 -0
  77. package/dist/Cryptide/Encryption/index.js +19 -0
  78. package/dist/Cryptide/Hashing/H2P.d.ts +6 -0
  79. package/dist/Cryptide/Hashing/H2P.d.ts.map +1 -0
  80. package/dist/Cryptide/Hashing/H2P.js +235 -0
  81. package/dist/Cryptide/Hashing/Hash.d.ts +8 -0
  82. package/dist/Cryptide/Hashing/Hash.d.ts.map +1 -0
  83. package/dist/Cryptide/Hashing/Hash.js +43 -0
  84. package/dist/Cryptide/Hashing/index.d.ts +3 -0
  85. package/dist/Cryptide/Hashing/index.d.ts.map +1 -0
  86. package/dist/Cryptide/Hashing/index.js +18 -0
  87. package/dist/Cryptide/Interpolation.d.ts +20 -0
  88. package/dist/Cryptide/Interpolation.d.ts.map +1 -0
  89. package/dist/Cryptide/Interpolation.js +68 -0
  90. package/dist/Cryptide/Math.d.ts +11 -0
  91. package/dist/Cryptide/Math.d.ts.map +1 -0
  92. package/dist/Cryptide/Math.js +81 -0
  93. package/dist/Cryptide/Serialization.d.ts +66 -0
  94. package/dist/Cryptide/Serialization.d.ts.map +1 -0
  95. package/dist/Cryptide/Serialization.js +517 -0
  96. package/dist/Cryptide/Signing/BlindSig.d.ts +10 -0
  97. package/dist/Cryptide/Signing/BlindSig.d.ts.map +1 -0
  98. package/dist/Cryptide/Signing/BlindSig.js +41 -0
  99. package/dist/Cryptide/Signing/EdDSA.d.ts +14 -0
  100. package/dist/Cryptide/Signing/EdDSA.d.ts.map +1 -0
  101. package/dist/Cryptide/Signing/EdDSA.js +67 -0
  102. package/dist/Cryptide/Signing/TideSignature.d.ts +59 -0
  103. package/dist/Cryptide/Signing/TideSignature.d.ts.map +1 -0
  104. package/dist/Cryptide/Signing/TideSignature.js +118 -0
  105. package/dist/Cryptide/Signing/index.d.ts +4 -0
  106. package/dist/Cryptide/Signing/index.d.ts.map +1 -0
  107. package/dist/Cryptide/Signing/index.js +19 -0
  108. package/dist/Cryptide/TideKey.d.ts +17 -0
  109. package/dist/Cryptide/TideKey.d.ts.map +1 -0
  110. package/dist/Cryptide/TideKey.js +84 -0
  111. package/dist/Cryptide/TideMemoryObjects.d.ts +4 -0
  112. package/dist/Cryptide/TideMemoryObjects.d.ts.map +1 -0
  113. package/dist/Cryptide/TideMemoryObjects.js +32 -0
  114. package/dist/Cryptide/index.d.ts +11 -0
  115. package/dist/Cryptide/index.d.ts.map +1 -0
  116. package/dist/Cryptide/index.js +28 -0
  117. package/dist/Flow/DecryptionFlows/dVVKDecryptionFlow.d.ts +16 -0
  118. package/dist/Flow/DecryptionFlows/dVVKDecryptionFlow.d.ts.map +1 -0
  119. package/dist/Flow/DecryptionFlows/dVVKDecryptionFlow.js +47 -0
  120. package/dist/Flow/DecryptionFlows/index.d.ts +2 -0
  121. package/dist/Flow/DecryptionFlows/index.d.ts.map +1 -0
  122. package/dist/Flow/DecryptionFlows/index.js +17 -0
  123. package/dist/Flow/EncryptionFlows/AuthorizedEncryptionFlow.d.ts +13 -0
  124. package/dist/Flow/EncryptionFlows/AuthorizedEncryptionFlow.d.ts.map +1 -0
  125. package/dist/Flow/EncryptionFlows/AuthorizedEncryptionFlow.js +183 -0
  126. package/dist/Flow/EncryptionFlows/PolicyAuthorizedEncryptionFlow.d.ts +57 -0
  127. package/dist/Flow/EncryptionFlows/PolicyAuthorizedEncryptionFlow.d.ts.map +1 -0
  128. package/dist/Flow/EncryptionFlows/PolicyAuthorizedEncryptionFlow.js +220 -0
  129. package/dist/Flow/EncryptionFlows/index.d.ts +3 -0
  130. package/dist/Flow/EncryptionFlows/index.d.ts.map +1 -0
  131. package/dist/Flow/EncryptionFlows/index.js +18 -0
  132. package/dist/Flow/SigningFlows/AuthorizedSigningFlow.d.ts +12 -0
  133. package/dist/Flow/SigningFlows/AuthorizedSigningFlow.d.ts.map +1 -0
  134. package/dist/Flow/SigningFlows/AuthorizedSigningFlow.js +50 -0
  135. package/dist/Flow/SigningFlows/dTestVVkSigningFlow.d.ts +15 -0
  136. package/dist/Flow/SigningFlows/dTestVVkSigningFlow.d.ts.map +1 -0
  137. package/dist/Flow/SigningFlows/dTestVVkSigningFlow.js +67 -0
  138. package/dist/Flow/SigningFlows/dVVKSigningFlow.d.ts +17 -0
  139. package/dist/Flow/SigningFlows/dVVKSigningFlow.d.ts.map +1 -0
  140. package/dist/Flow/SigningFlows/dVVKSigningFlow.js +61 -0
  141. package/dist/Flow/SigningFlows/dVVKSigningFlow2Step.d.ts +28 -0
  142. package/dist/Flow/SigningFlows/dVVKSigningFlow2Step.d.ts.map +1 -0
  143. package/dist/Flow/SigningFlows/dVVKSigningFlow2Step.js +118 -0
  144. package/dist/Flow/SigningFlows/index.d.ts +5 -0
  145. package/dist/Flow/SigningFlows/index.d.ts.map +1 -0
  146. package/dist/Flow/SigningFlows/index.js +20 -0
  147. package/dist/Flow/VoucherFlows/VoucherFlow.d.ts +16 -0
  148. package/dist/Flow/VoucherFlows/VoucherFlow.d.ts.map +1 -0
  149. package/dist/Flow/VoucherFlows/VoucherFlow.js +34 -0
  150. package/dist/Flow/VoucherFlows/index.d.ts +2 -0
  151. package/dist/Flow/VoucherFlows/index.d.ts.map +1 -0
  152. package/dist/Flow/VoucherFlows/index.js +17 -0
  153. package/dist/Flow/index.d.ts +5 -0
  154. package/dist/Flow/index.d.ts.map +1 -0
  155. package/dist/Flow/index.js +20 -0
  156. package/dist/Math/KeyDecryption.d.ts +3 -0
  157. package/dist/Math/KeyDecryption.d.ts.map +1 -0
  158. package/dist/Math/KeyDecryption.js +24 -0
  159. package/dist/Math/KeySigning.d.ts +4 -0
  160. package/dist/Math/KeySigning.d.ts.map +1 -0
  161. package/dist/Math/KeySigning.js +28 -0
  162. package/dist/Math/index.d.ts +3 -0
  163. package/dist/Math/index.d.ts.map +1 -0
  164. package/dist/Math/index.js +18 -0
  165. package/dist/Models/AuthRequest.d.ts +14 -0
  166. package/dist/Models/AuthRequest.d.ts.map +1 -0
  167. package/dist/Models/AuthRequest.js +48 -0
  168. package/dist/Models/BaseTideRequest.d.ts +55 -0
  169. package/dist/Models/BaseTideRequest.d.ts.map +1 -0
  170. package/dist/Models/BaseTideRequest.js +299 -0
  171. package/dist/Models/CustomTideRequest.d.ts +19 -0
  172. package/dist/Models/CustomTideRequest.d.ts.map +1 -0
  173. package/dist/Models/CustomTideRequest.js +30 -0
  174. package/dist/Models/Datum.d.ts +11 -0
  175. package/dist/Models/Datum.d.ts.map +1 -0
  176. package/dist/Models/Datum.js +33 -0
  177. package/dist/Models/Doken.d.ts +33 -0
  178. package/dist/Models/Doken.d.ts.map +1 -0
  179. package/dist/Models/Doken.js +133 -0
  180. package/dist/Models/EnclaveEntry.d.ts +14 -0
  181. package/dist/Models/EnclaveEntry.d.ts.map +1 -0
  182. package/dist/Models/EnclaveEntry.js +49 -0
  183. package/dist/Models/Infos/KeyInfo.d.ts +24 -0
  184. package/dist/Models/Infos/KeyInfo.d.ts.map +1 -0
  185. package/dist/Models/Infos/KeyInfo.js +51 -0
  186. package/dist/Models/Infos/OrkInfo.d.ts +18 -0
  187. package/dist/Models/Infos/OrkInfo.d.ts.map +1 -0
  188. package/dist/Models/Infos/OrkInfo.js +58 -0
  189. package/dist/Models/Infos/index.d.ts +3 -0
  190. package/dist/Models/Infos/index.d.ts.map +1 -0
  191. package/dist/Models/Infos/index.js +18 -0
  192. package/dist/Models/ModelRegistry.d.ts +29 -0
  193. package/dist/Models/ModelRegistry.d.ts.map +1 -0
  194. package/dist/Models/ModelRegistry.js +321 -0
  195. package/dist/Models/Policy.d.ts +41 -0
  196. package/dist/Models/Policy.d.ts.map +1 -0
  197. package/dist/Models/Policy.js +317 -0
  198. package/dist/Models/PolicyProtectedSerializedField.d.ts +12 -0
  199. package/dist/Models/PolicyProtectedSerializedField.d.ts.map +1 -0
  200. package/dist/Models/PolicyProtectedSerializedField.js +50 -0
  201. package/dist/Models/Responses/Vendor/VoucherResponse.d.ts +12 -0
  202. package/dist/Models/Responses/Vendor/VoucherResponse.d.ts.map +1 -0
  203. package/dist/Models/Responses/Vendor/VoucherResponse.js +39 -0
  204. package/dist/Models/Responses/Vendor/index.d.ts +2 -0
  205. package/dist/Models/Responses/Vendor/index.d.ts.map +1 -0
  206. package/dist/Models/Responses/Vendor/index.js +17 -0
  207. package/dist/Models/Responses/index.d.ts +2 -0
  208. package/dist/Models/Responses/index.d.ts.map +1 -0
  209. package/dist/Models/Responses/index.js +17 -0
  210. package/dist/Models/SerializedField.d.ts +12 -0
  211. package/dist/Models/SerializedField.d.ts.map +1 -0
  212. package/dist/Models/SerializedField.js +50 -0
  213. package/dist/Models/VendorData.d.ts +12 -0
  214. package/dist/Models/VendorData.d.ts.map +1 -0
  215. package/dist/Models/VendorData.js +38 -0
  216. package/dist/Models/VendorSettings.d.ts +9 -0
  217. package/dist/Models/VendorSettings.d.ts.map +1 -0
  218. package/dist/Models/VendorSettings.js +32 -0
  219. package/dist/Models/index.d.ts +13 -0
  220. package/dist/Models/index.d.ts.map +1 -0
  221. package/dist/Models/index.js +30 -0
  222. package/dist/Tools/TideMemory.d.ts +10 -0
  223. package/dist/Tools/TideMemory.d.ts.map +1 -0
  224. package/dist/Tools/TideMemory.js +105 -0
  225. package/dist/Tools/Utils.d.ts +13 -0
  226. package/dist/Tools/Utils.d.ts.map +1 -0
  227. package/dist/Tools/Utils.js +244 -0
  228. package/dist/Tools/index.d.ts +3 -0
  229. package/dist/Tools/index.d.ts.map +1 -0
  230. package/dist/Tools/index.js +18 -0
  231. package/dist/index.d.ts +10 -0
  232. package/dist/index.d.ts.map +1 -0
  233. package/dist/index.js +26 -0
  234. package/package.json +27 -0
package/LICENSE ADDED
@@ -0,0 +1,333 @@
1
+ Tide Community Open Code License
2
+
3
+ Preamble:
4
+ The Tide Community Open Code License is a copyright License for
5
+ software and other kinds of works designed to encourage the adoption
6
+ of the Tide Protocol. The aim of the Tide Protocol is to be the technological
7
+ infrastructure of a true zero-trust paradigm, addressing the data-breach
8
+ protection needs of platform vendors, the self-sovereign authority needs of
9
+ online users, and everyone's reliance on proofs rather blind trust..
10
+
11
+ To that end, the Tide Community Open Code License gives you the
12
+ freedom to modify and distribute copies of software and other works
13
+ for free, or for a fee, as long as you do so in accordance with these
14
+ terms and the software adopts the Tide Protocol in full.
15
+
16
+ License Terms
17
+ Version: 2
18
+ Date of last revision: 1 December 2022
19
+
20
+ 1 Acceptance of these terms
21
+ (a) These terms are between the copyright holder (“we”, “us” and
22
+ “our”) identified in the notice embedded in or provided with
23
+ the source code, technical documentation or other material
24
+ relating to the Tide Foundation Limited’s (ACN 630 011 371)
25
+ (“Tide”) data decryption and key management platform
26
+ known as the “Tide Protocol” (“Tide Protocol”) and with which
27
+ these terms are packaged (“Materials”) and the person or
28
+ entity (“you” and “your”) accessing and/or using the Materials.
29
+ (b) By using, modifying or publishing the Materials or any Modified
30
+ Materials (as defined in clause 2(c) below), you agree to be
31
+ bound by these terms. If you are doing any of the foregoing in
32
+ the context of your employment with your employer or on behalf
33
+ of another entity, you are agreeing to be bound by these terms
34
+ on behalf of that employer or other entity and you represent
35
+ and warrant that you have the authority of that employer or
36
+ other entity to enter into these terms on their behalf. In such
37
+ circumstances, each reference in these terms “you” or “your”
38
+ includes that employer or other entity.
39
+ (c) These terms will remain in effect until terminated under
40
+ clause 9.
41
+
42
+ 2 Intellectual property rights
43
+ (a) In these terms, “Intellectual Property Rights” means all
44
+ intellectual property rights of whatever nature throughout the
45
+ world, including all rights conferred under statute, common
46
+ law or equity, whether existing now or at any time in the
47
+ future, including all rights in and to any patents, patent
48
+ applications, business names, trade names, domain names, trade
49
+ marks, copyright, trade secrets, circuit layout rights,
50
+ designs, confidential information, know-how, technical
51
+ information, data or developments. All of our Intellectual
52
+ Property Rights are protected by the laws in force in
53
+ Australia from time to time.
54
+ (b) You acknowledge and agree that we (or our licensors) retain all
55
+ right, title, and interest (including all Intellectual Property
56
+ Rights) in and to the Materials, and nothing you do with or in
57
+ relation to the Materials will transfer any right, title or
58
+ interest (including Intellectual Property Rights) to you or
59
+ License or otherwise permit you to exercise any Intellectual
60
+ Property Rights except as expressly granted under these terms.
61
+ (c) In these terms, “Modified Materials” means any work based on
62
+ one or more of the Materials, including a revision,
63
+ modification, adaptation, subset, addition, enhancement,
64
+ improvement, combination, translation, abridgment,
65
+ condensation, expansion, collection, compilation or any other
66
+ form in which such Materials may be recast, transformed or
67
+ adapted or any other new material derived from the Materials.
68
+
69
+ 3 Your License to the Materials
70
+ (a) Subject to paragraph (c) below and your compliance with these
71
+ terms, we grant you a limited, non-exclusive,
72
+ non-sub-licensable, revocable, worldwide, royalty free License
73
+ for the term of these terms to access, use, copy, modify,
74
+ adapt, distribute, publish and exploit the Materials, provided
75
+ that such License is exercised:
76
+ (i) solely in connection with the adoption and use of the
77
+ Tide Protocol;
78
+ (ii) solely in a manner which requires any payment or
79
+ exchange of value to be made via Tide Tokens (as
80
+ defined in paragraph (c) below); and
81
+ (iii) in accordance with clause 6 and on these terms in
82
+ respect of the right to distribute and publish the
83
+ Materials and Modified Materials.
84
+ The foregoing rights to distribute, publish and exploit the
85
+ Materials include the right to do so for a fee and applies
86
+ in respect of the Materials and the Modified Materials.
87
+ (b) Any access, use, copy, modification, adaptation, distribution,
88
+ publication or exploitation of any of the Materials for use
89
+ with applications that do not fully use, adopt and implement
90
+ the Tide Protocol is prohibited. This prohibition includes any
91
+ use or adaptation of the Materials for the purposes of any
92
+ protocol, system or platform competing with the Tide Protocol
93
+ or which facilitates any form of payment or exchange of value
94
+ other than through use of Tide Tokens (as defined in paragraph
95
+ (c) below).
96
+ (c) Without limiting paragraph (b), the License granted under
97
+ paragraph (a) does not permit you to, and in exercising the
98
+ rights granted to you under paragraph (a) you must not, under
99
+ any circumstances:
100
+ (i) remove, omit or in any way modify any component of the
101
+ Materials, including source code components, which
102
+ requires payment or exchange of value to be made via
103
+ Tide cryptographic tokens designed for settling
104
+ transactions entered into via the Tide Protocol (“Tide
105
+ Tokens”);
106
+ (ii) use the Materials which are source code or object code:
107
+ (A) in combination with any other code, script or
108
+ software (whether in source or object code form),
109
+ or otherwise in any manner, which would in any way
110
+ circumvent the requirement for any payment or
111
+ exchange of value to be made via Tide Tokens; or
112
+ (B) in any other way which does not properly use, adopt
113
+ and implement the Tide Protocol in its entirety,
114
+ including for the purposes of both data decryption
115
+ and key management;
116
+ (iii) violate any applicable laws or any rights of any person,
117
+ or use or permit or facilitate the use of the Materials
118
+ in any manner or for any purpose that is unlawful or is
119
+ in breach of any laws of jurisdiction anywhere in the
120
+ world;
121
+ (iv) distribute viruses, spyware, corrupted files, or any
122
+ other similar software or programs that may damage the
123
+ operation of any computer hardware or software, or the
124
+ Tide Protocol; or
125
+ (v) engage in any other conduct that is improper or brings
126
+ or is likely to bring us, the Materials, the Tide
127
+ Protocol or Tide Tokens into disrepute,
128
+ and you must ensure that where any third party is being engaged
129
+ to make modifications to the Materials on your behalf, their
130
+ rights to do so are subject to terms which incorporate the
131
+ restrictions in this clause 3.
132
+ (d) You must take your own precautions to ensure that the processes
133
+ which you employ for accessing and using the Materials do not
134
+ expose you to the risk of viruses, malicious computer code or
135
+ other forms of interference which may damage your computer
136
+ systems. We recommend that you install and use up-to-date
137
+ anti-virus, anti-spyware and firewall software on your computer
138
+ systems.
139
+
140
+ 4 Data security and privacy
141
+ You are fully responsible for ensuring:
142
+ (a) any use, adoption or implementation of the Materials, any
143
+ Modified Materials and/or the Tide Protocol appropriately
144
+ protects, encrypts and stores data; and
145
+ (b) all aspects of compliance with privacy and data protection laws.
146
+ We disclaim all warranties and liability regarding the same.
147
+
148
+ 5 Modification of Tide Protocol and Materials
149
+ You acknowledge that Tide may at any time without notice to you change
150
+ or update the whole or any part of the Tide Protocol and/or any of the
151
+ Materials, including in a manner which may result in applications or
152
+ processes you may have developed or implemented no longer being
153
+ compatible or otherwise working in the same manner with the Tide
154
+ Protocol or any Material, including any software development kit. We
155
+ may also withdraw or remove any part of the Materials or the Tide
156
+ Protocol at any stage without notice to you.
157
+
158
+ 6 Distribution
159
+ (a) Without limiting clause 3, in exercising the rights granted to
160
+ you under clause 3(a) to distribute or publish one or more
161
+ copies of any Materials verbatim as you receive the Materials,
162
+ you may do so in any medium, provided that:
163
+ (i) you provide all recipients of the Materials with a copy of
164
+ these terms along with the Materials:
165
+ (ii) you keep intact and do not remove, omit, or in any way
166
+ modify any of the following:
167
+ (A) any notices stating that these License terms apply;
168
+ (B) any hyperlink to these License terms; and
169
+ (C) any notices of the absence of any warranty;
170
+ (b) You may charge any price or no price for each copy of the
171
+ Materials or Modified Materials that you distribute or publish,
172
+ and you may offer support or warranty protection for a fee.
173
+ (c) Without limiting clause 3, in exercising the rights granted to
174
+ you under clause 3(a) to distribute or publish one or more
175
+ copies of any Modified Materials you create or cause to be
176
+ created, you may do so in any medium, provided that:
177
+ (i) you provide all recipients of the Modified Materials with
178
+ a copy of these terms along with the Modified Materials;
179
+ (ii) you keep intact and do not remove, omit, or in any way
180
+ modify any of the following:
181
+ (A) any notices stating that these License terms apply to
182
+ the unmodified Materials;
183
+ (B) any hyperlink to these License terms; and
184
+ (C) any notices of the absence of any warranty in respect
185
+ of the unmodified Materials; and
186
+ (iii) the whole of any Modified Materials must be licensed under
187
+ these terms (although this does not limit the operation of
188
+ paragraph (d)), but you may impose further restrictions
189
+ that do not conflict with or override these terms.
190
+ (d) Where you compile any source code Materials or Modified
191
+ Materials in an aggregate with any proprietary program, the
192
+ Materials remain governed by these License terms. For the
193
+ purposes of the foregoing, a compilation of any Materials with
194
+ other separate and independent works, which are not by their
195
+ nature extensions of the Materials, and which are not combined
196
+ with the Materials such as to form a larger program, in or on
197
+ a volume of a storage or distribution medium, is an “aggregate”
198
+ if the compilation and its resulting copyright are not used to
199
+ limit the access or legal rights of the compilation's users
200
+ beyond what the individual Materials permit. Inclusion of any
201
+ Materials in an aggregate does not cause these terms to apply
202
+ to the other parts of the aggregate.
203
+ (e) You may not initiate any proceedings or claims in respect of
204
+ infringement of any patent rights in respect of the access,
205
+ use, copy, modification, adaptation, distribution, publication
206
+ or exploitation of any of the Materials or Modified Materials
207
+ in accordance with these terms.
208
+
209
+ 7 Liability
210
+ (a) All express or implied guarantees, warranties, representations,
211
+ statements, terms or conditions relating to these terms or the
212
+ Materials that are not contained in these terms, are excluded
213
+ to the maximum extent permitted by law. Without limiting the
214
+ foregoing:
215
+ (i) the Materials are provided ‘as-is’ and neither we nor Tide
216
+ warrant or represent that they will work in any way, that
217
+ they are fit for any particular purpose, that your
218
+ requirements will be met, that your use of the Materials
219
+ will be uninterrupted or error free or that the Materials
220
+ are free of viruses or other harmful components; and
221
+ (ii) we and Tide are not responsible for any loss, corruption or
222
+ interception of data which occurs in connection with your
223
+ use or misuse of the Materials.
224
+ (b) Nothing in these terms excludes, restricts or modifies any
225
+ guarantee, term, condition, warranty, or any right or remedy,
226
+ implied or imposed by any law which cannot lawfully be excluded
227
+ or limited. (a “Non-Excludable Provision”). If any guarantee,
228
+ term, condition or warranty is implied into these terms under a
229
+ Non-Excludable Provision and we or Tide can limit your remedy
230
+ for a breach of the Non-Excludable Provision, then our and
231
+ Tide’s liability for breach of the Non-Excludable Provision is
232
+ limited to one or more of the following at our option:
233
+ (i) in the case of goods, the replacement of the goods or the
234
+ supply of equivalent goods, the repair of the goods, the
235
+ payment of the cost of replacing the goods or of acquiring
236
+ equivalent goods, or the payment of the cost of having the
237
+ goods repaired; or
238
+ (ii) in the case of services, the supplying of the services
239
+ again, or the payment of the cost of having the services
240
+ supplied again.
241
+ (c) To the maximum extent permitted by law but despite any other
242
+ clause in these terms, your use of the Materials is at your own
243
+ risk and neither we nor Tide are liable to you for any loss or
244
+ damage you (or any of your representatives or sub-licensees)
245
+ suffer, sustain or incur in connection with these terms,
246
+ exercise of any rights granted under these terms or otherwise
247
+ in connection with any access or use of the Materials, including
248
+ in respect of any loss, corruption or interception of data or
249
+ breach of privacy or security.
250
+ (d) Without limiting paragraph (c), to the maximum extent permitted
251
+ by law, neither we nor Tide are not liable to you for and no
252
+ measure of damages will under any circumstances include:
253
+ (i) special, indirect, consequential, incidental or punitive
254
+ damages; or
255
+ (ii) damages for loss of profits, revenue, goodwill,
256
+ opportunity, anticipated savings or loss or corruption of
257
+ data.
258
+ (e) The exclusions and limitations of liability in this clause 8
259
+ apply regardless of the basis on which such liability arises,
260
+ whether in contract, breach of warranty, tort (including
261
+ negligence), in equity, under statute, under an indemnity or
262
+ on any other basis.
263
+ (f) You will indemnify us and hold us, Tide and each of our
264
+ directors, officers, employees and contractors harmless from
265
+ and against any loss suffered or incurred by us or any of
266
+ those indemnified, arising out of or in connection with:
267
+ (i) your or any of your sub-licensee’s access or use of any of
268
+ the Materials or any other exercise of any of the rights
269
+ granted to you under these terms in connection with any of
270
+ the Materials;
271
+ (ii) your negligence or breach of these terms;
272
+ (iii) your violation of any applicable law or infringement of any
273
+ rights (including Intellectual Property Rights) of a third
274
+ party; or
275
+ (iv) any claim made by any third party arising out of or in
276
+ connection with any Modified Materials, including any
277
+ application developed using any of the Materials, and
278
+ including in respect of infringement of any person’s
279
+ Intellectual Property Rights.
280
+ 8 Termination
281
+ (a) Your License to use the Materials under clause 3(a) immediately
282
+ and automatically terminates without the need for us to give
283
+ notice to you if you breach these terms.
284
+ (b) You may terminate these terms at any time by ceasing all use
285
+ and removing all implementations of the Materials and the Tide
286
+ Protocol.
287
+ (c) Upon termination of these terms, all rights and Licenses
288
+ granted to you under these terms will also terminate and you
289
+ must immediately cease using the Materials and remove all
290
+ implementations of the Materials.
291
+ 9 General
292
+ (a) You remain fully responsible and liable for the acts and
293
+ omissions of any third party to whom you subcontract the
294
+ exercise or performance any of your rights or obligations under
295
+ these terms, as if such acts and omissions were your acts and
296
+ omissions.
297
+ (b) If any part of these terms is held to be unenforceable, the
298
+ unenforceable part is to be given effect to the greatest extent
299
+ possible and the remainder will remain in full force and effect.
300
+ (c) No waiver, delay or failure by us to take any action shall
301
+ constitute or be construed as a waiver of that or any other term,
302
+ condition, option, privilege or right we may have.
303
+ (d) The word “including” when used in these terms is not a term of
304
+ limitation.
305
+
306
+ ====================
307
+ End of License terms
308
+ ====================
309
+
310
+ If you develop a Modified Material and want to assert your copyright,
311
+ attach the following notices to the Modified Material. It is best to
312
+ attach them to the start of each source file to most effectively state
313
+ the exclusion of warranty and each file should have at least the
314
+ “copyright” line and a pointer to where the full notice is found.
315
+
316
+ <INSERT PROGRAM NAME and PURPOSE.>
317
+
318
+ Copyright (c) <year> <name of author>
319
+
320
+ This program is free software and is subject to the terms of the Tide
321
+ Community Open Code License as published by the Tide Foundation
322
+ Limited. You may modify it and redistribute it in accordance with
323
+ and subject to the terms of that License.
324
+
325
+ This program is distributed WITHOUT WARRANTY of any kind, including
326
+ without any implied warranty of MERCHANTABILITY or FITNESS FOR A
327
+ PARTICULAR PURPOSE. See the Tide Community Open Code License for
328
+ more details.
329
+
330
+ You should have received a copy of the Tide Community Open Code
331
+ License along with this program.
332
+
333
+ If not, see https://tide.org/licenses_tcoc2-0-0-en
package/README.md ADDED
@@ -0,0 +1,12 @@
1
+ # Tide JS
2
+ Browser side modules required to interact with the Tide's Cybersecurity Fabric.
3
+
4
+ ## Repository Index
5
+ * [Clients.](https://github.com/tide-foundation/tide-js/tree/main/Clients) HTTP clients required to interact with Tide Network and Authentication functions, as well as the Vendor's voucher endpoint.
6
+ * [Cryptide.](https://github.com/tide-foundation/tide-js/tree/main/Cryptide) Very similar to [Cryptide .NET](https://github.com/tide-foundation/ork/tree/main/Cryptide), except written in Javascript.
7
+ * [Flow.](https://github.com/tide-foundation/tide-js/tree/main/Flow) Contains all types of Tide Flows such as key generation, authentication, recovery, encryption, decryption and signing.
8
+ * [Math.](https://github.com/tide-foundation/tide-js/tree/main/Math) Basic Math used in flows.
9
+ * [Models.](https://github.com/tide-foundation/tide-js/tree/main/Models) Models used around the Tide Network for: serialized data, web responses and network object data structures (OrkInfo + KeyInfo).
10
+ * [Tests.](https://github.com/tide-foundation/tide-js/tree/main/Tests) Tests hosted at /tests.html
11
+
12
+ ## ***This is a standalone SDK with 0 dependancies, it's meant to be copied to a modules directory of a Javascript project that wants to use it***
@@ -0,0 +1,24 @@
1
+ export default class ClientBase {
2
+ url: string;
3
+ token: string;
4
+ sessionKeyPrivateRaw: any;
5
+ sessionKeyPublicEncoded: any;
6
+ constructor(url: string);
7
+ _createFormData(form: Object): FormData;
8
+ _get(endpoint: string, timeout?: number, signal?: AbortSignal): Promise<Response>;
9
+ /**
10
+ * Silent get, makes a returns a response without handling response errors.
11
+ */
12
+ _getSilent(endpoint: string, timeout?: number, signal?: AbortSignal): Promise<Response>;
13
+ _post(endpoint: string, data: FormData, timeout?: number): Promise<Response>;
14
+ _put(endpoint: string, data: FormData): Promise<Response>;
15
+ _postJSON(endpoint: string, data: Object): Promise<Response>;
16
+ /**
17
+ * Post silent returns the response without handling response errors.
18
+ */
19
+ _postSilent(endpoint: string, data: FormData, timeout?: number): Promise<Response>;
20
+ _handleError(response: Response, functionName?: string, throwError?: boolean): Promise<string>;
21
+ _handleErrorSimulator(response: Response): Promise<string>;
22
+ AddBearerAuthorization(sessionKeyPrivate: Uint8Array, sessionKeyPublicEncoded: string, token: string): this;
23
+ }
24
+ //# sourceMappingURL=ClientBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientBase.d.ts","sourceRoot":"","sources":["../../Clients/ClientBase.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB,EAAE,GAAG,CAAC;IAC1B,uBAAuB,EAAE,GAAG,CAAC;gBAEjB,GAAG,EAAE,MAAM;IAIvB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;IAgBjC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,MAAc,EAAE,MAAM,GAAE,WAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAkBpG;;MAEE;IACI,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,MAAc,EAAE,MAAM,GAAE,WAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAkBpG,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAE,MAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAqBnF,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAOzD,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAWlE;;OAEG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAE,MAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAkBzF,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,GAAE,MAAW,EAAE,UAAU,GAAE,OAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAiBzG,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAUhE,sBAAsB,CAAC,iBAAiB,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAMvG"}
@@ -0,0 +1,160 @@
1
+ //
2
+ // Tide Protocol - Infrastructure for a TRUE Zero-Trust paradigm
3
+ // Copyright (C) 2022 Tide Foundation Ltd
4
+ //
5
+ // This program is free software and is subject to the terms of
6
+ // the Tide Community Open Code License as published by the
7
+ // Tide Foundation Limited. You may modify it and redistribute
8
+ // it in accordance with and subject to the terms of that License.
9
+ // This program is distributed WITHOUT WARRANTY of any kind,
10
+ // including without any implied warranty of MERCHANTABILITY or
11
+ // FITNESS FOR A PARTICULAR PURPOSE.
12
+ // See the Tide Community Open Code License for more details.
13
+ // You should have received a copy of the Tide Community Open
14
+ // Code License along with this program.
15
+ // If not, see https://tide.org/licenses_tcoc2-0-0-en
16
+ //
17
+ export default class ClientBase {
18
+ constructor(url) {
19
+ this.url = url;
20
+ }
21
+ _createFormData(form) {
22
+ const formData = new FormData();
23
+ Object.entries(form).forEach(([key, value]) => {
24
+ if (Array.isArray(value)) {
25
+ for (let i = 0; i < value.length; i++) {
26
+ formData.append(key + "[" + i + "]", value[i]);
27
+ }
28
+ }
29
+ else
30
+ formData.append(key, value);
31
+ });
32
+ return formData;
33
+ }
34
+ async _get(endpoint, timeout = 20000, signal = null) {
35
+ const controller = new AbortController();
36
+ const id = setTimeout(() => controller.abort(), timeout);
37
+ let response;
38
+ try {
39
+ response = await fetch(this.url + endpoint, {
40
+ method: 'GET',
41
+ signal: signal ?? controller.signal
42
+ });
43
+ clearTimeout(id);
44
+ }
45
+ catch {
46
+ throw Error("enclave.networkFailure");
47
+ }
48
+ if (!response.ok)
49
+ throw Error("Ork.Exceptions.Network.StatusException");
50
+ return response;
51
+ }
52
+ /**
53
+ * Silent get, makes a returns a response without handling response errors.
54
+ */
55
+ async _getSilent(endpoint, timeout = 20000, signal = null) {
56
+ const controller = new AbortController();
57
+ const id = setTimeout(() => controller.abort(), timeout);
58
+ let response;
59
+ try {
60
+ response = await fetch(this.url + endpoint, {
61
+ method: 'GET',
62
+ signal: signal ?? controller.signal
63
+ });
64
+ clearTimeout(id);
65
+ }
66
+ catch {
67
+ throw Error("enclave.networkFailure");
68
+ }
69
+ if (!response.ok)
70
+ throw Error("Ork.Exceptions.Network.StatusException");
71
+ return response;
72
+ }
73
+ async _post(endpoint, data, timeout = 20000) {
74
+ const controller = new AbortController();
75
+ const id = setTimeout(() => controller.abort(), timeout);
76
+ if (this.token)
77
+ data.append("token", this.token);
78
+ let response;
79
+ try {
80
+ response = await fetch(this.url + endpoint, {
81
+ method: 'POST',
82
+ body: data,
83
+ signal: controller.signal
84
+ });
85
+ clearTimeout(id);
86
+ }
87
+ catch {
88
+ throw Error("enclave.networkFailure");
89
+ }
90
+ if (!response.ok)
91
+ throw Error("Ork.Exceptions.Network.StatusException");
92
+ return response;
93
+ }
94
+ async _put(endpoint, data) {
95
+ return fetch(this.url + endpoint, {
96
+ method: 'PUT',
97
+ body: data
98
+ });
99
+ }
100
+ async _postJSON(endpoint, data) {
101
+ return fetch(this.url + endpoint, {
102
+ method: 'POST',
103
+ headers: {
104
+ 'Accept': 'application/json',
105
+ 'Content-Type': 'application/json'
106
+ },
107
+ body: JSON.stringify(data)
108
+ });
109
+ }
110
+ /**
111
+ * Post silent returns the response without handling response errors.
112
+ */
113
+ async _postSilent(endpoint, data, timeout = 20000) {
114
+ const controller = new AbortController();
115
+ const id = setTimeout(() => controller.abort(), timeout);
116
+ let response;
117
+ try {
118
+ response = await fetch(this.url + endpoint, {
119
+ method: 'POST',
120
+ body: data,
121
+ signal: controller.signal
122
+ });
123
+ clearTimeout(id);
124
+ }
125
+ catch {
126
+ throw Error("enclave.networkFailure");
127
+ }
128
+ return response;
129
+ }
130
+ async _handleError(response, functionName = "", throwError = false) {
131
+ var error = "";
132
+ const responseData = await response.text();
133
+ if (responseData.split(":")[0] === "--FAILED--") {
134
+ console.error(responseData);
135
+ error = responseData.split(":")[1];
136
+ }
137
+ if (error !== "") {
138
+ if (throwError)
139
+ throw Error(functionName + " " + error);
140
+ else
141
+ return Promise.reject(error);
142
+ }
143
+ return responseData;
144
+ }
145
+ async _handleErrorSimulator(response) {
146
+ var error = "";
147
+ const responseData = await response.text();
148
+ if (!response.ok)
149
+ error = responseData;
150
+ if (error !== "")
151
+ return Promise.reject(error);
152
+ return responseData;
153
+ }
154
+ AddBearerAuthorization(sessionKeyPrivate, sessionKeyPublicEncoded, token) {
155
+ this.sessionKeyPrivateRaw = sessionKeyPrivate;
156
+ this.sessionKeyPublicEncoded = sessionKeyPublicEncoded;
157
+ this.token = token;
158
+ return this;
159
+ }
160
+ }
@@ -0,0 +1,11 @@
1
+ import KeyInfo from "../Models/Infos/KeyInfo";
2
+ import OrkInfo from "../Models/Infos/OrkInfo";
3
+ import ClientBase from "./ClientBase";
4
+ export default class NetworkClient extends ClientBase {
5
+ constructor(url?: string);
6
+ FindReservers(uid: string): Promise<OrkInfo[]>;
7
+ GetSomeORKs(): Promise<any>;
8
+ GetPayerUrl(payerPublic: any): Promise<any>;
9
+ GetKeyInfo(uid: string): Promise<KeyInfo>;
10
+ }
11
+ //# sourceMappingURL=NetworkClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NetworkClient.d.ts","sourceRoot":"","sources":["../../Clients/NetworkClient.ts"],"names":[],"mappings":"AAiBA,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;gBACrC,GAAG,GAAE,MAAa;IAMxB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAa9C,WAAW;IAUX,WAAW,CAAC,WAAW,KAAA;IAQvB,UAAU,CAAC,GAAG,EAAE,MAAM;CAU/B"}
@@ -0,0 +1,68 @@
1
+ //
2
+ // Tide Protocol - Infrastructure for a TRUE Zero-Trust paradigm
3
+ // Copyright (C) 2022 Tide Foundation Ltd
4
+ //
5
+ // This program is free software and is subject to the terms of
6
+ // the Tide Community Open Code License as published by the
7
+ // Tide Foundation Limited. You may modify it and redistribute
8
+ // it in accordance with and subject to the terms of that License.
9
+ // This program is distributed WITHOUT WARRANTY of any kind,
10
+ // including without any implied warranty of MERCHANTABILITY or
11
+ // FITNESS FOR A PARTICULAR PURPOSE.
12
+ // See the Tide Community Open Code License for more details.
13
+ // You should have received a copy of the Tide Community Open
14
+ // Code License along with this program.
15
+ // If not, see https://tide.org/licenses_tcoc2-0-0-en
16
+ //
17
+ import KeyInfo from "../Models/Infos/KeyInfo";
18
+ import OrkInfo from "../Models/Infos/OrkInfo";
19
+ import ClientBase from "./ClientBase";
20
+ export default class NetworkClient extends ClientBase {
21
+ constructor(url = null) {
22
+ if (url == null)
23
+ super(window.location.origin);
24
+ else
25
+ super(url); // no gaurantee that the home ork will be part of selected orks, we need a selected ork url here for uncommitted entries
26
+ }
27
+ async FindReservers(uid) {
28
+ const response = await this._get(`/Network/Authentication/Users/GetReservers/${uid}`);
29
+ try {
30
+ const responseData = await this._handleError(response, "Find Reservers");
31
+ const formattedResponse = JSON.parse(responseData);
32
+ if (formattedResponse.length == 0)
33
+ throw Error("Username forbidden");
34
+ const returnedResponse = formattedResponse.map(orkEntry => OrkInfo.from(orkEntry));
35
+ return returnedResponse;
36
+ }
37
+ catch (err) {
38
+ throw Error(err);
39
+ }
40
+ }
41
+ async GetSomeORKs() {
42
+ const response = await this._get('/Network/Authentication/Node/Some');
43
+ const responseData = await this._handleError(response, "Get Some Orks");
44
+ const formattedResponse = JSON.parse(responseData);
45
+ const returnedResponse = formattedResponse.map(orkEntry => {
46
+ return OrkInfo.from(orkEntry);
47
+ });
48
+ return returnedResponse;
49
+ }
50
+ async GetPayerUrl(payerPublic) {
51
+ const response = await this._get(`/Network/Payment/Node/Urls/${payerPublic}`);
52
+ const responseData = await this._handleError(response, "Get Payer URL");
53
+ const urlArray = JSON.parse(responseData);
54
+ const randomUrl = urlArray[Math.floor(Math.random() * urlArray.length)];
55
+ return randomUrl;
56
+ }
57
+ async GetKeyInfo(uid) {
58
+ const response = await this._get(`/Network/Authentication/Users/UserInfo/${uid}`);
59
+ let responseData;
60
+ try {
61
+ responseData = await this._handleError(response, "Get Key Info");
62
+ }
63
+ catch {
64
+ throw Error("simulator.invalidAccount");
65
+ }
66
+ return KeyInfo.from(responseData);
67
+ }
68
+ }
@@ -0,0 +1,34 @@
1
+ import ClientBase from "./ClientBase";
2
+ import BaseTideRequest from "../Models/BaseTideRequest";
3
+ import { Point } from "../Cryptide/Ed25519";
4
+ export default class NodeClient extends ClientBase {
5
+ enabledTideDH: boolean;
6
+ DHKey: any;
7
+ orkCacheId: any;
8
+ constructor(url: string);
9
+ isActive(): Promise<string>;
10
+ EnableTideDH(orkPublic: Point, gSessKey?: any, sessKey?: any): Promise<this>;
11
+ PreSign(index: number, vuid: string, request: BaseTideRequest, voucher: string): Promise<{
12
+ index: number;
13
+ data: {
14
+ GRis: any[];
15
+ AdditionalData: Uint8Array<ArrayBufferLike>;
16
+ };
17
+ }>;
18
+ Sign(vuid: string, request: BaseTideRequest, GRs: Point[], bitwise: Uint8Array, sessId?: Uint8Array): Promise<{
19
+ Sij: any[];
20
+ AdditionalData: Uint8Array<ArrayBufferLike>;
21
+ }>;
22
+ Decrypt(index: number, vuid: string, request: BaseTideRequest, voucher: string): Promise<{
23
+ index: number;
24
+ appliedC1s: any[];
25
+ }>;
26
+ CreateCheckoutSession(vendorData: any, redirectUrl: any, licensingTier: any): Promise<Response>;
27
+ IsLicenseActive(vendorId: any): Promise<boolean>;
28
+ GetLicenseDetails(vendorId: any, timestamp: any, timestampSig: any): Promise<string>;
29
+ GetSubscriptionStatus(vendorId: any, initialSessionId: any, timestamp: any, timestampSig: any): Promise<string>;
30
+ CreateCustomerPortalSession(vendorId: any, redirectUrl: any, timestamp: any, timestampSig: any): Promise<Response>;
31
+ UpdateSubscription(updateRequest: any, licenseId: any, timestamp: any, timestampSig: any): Promise<Response>;
32
+ CancelSubscription(licenseId: any, initialSessionId: any, timestamp: any, timestampSig: any): Promise<Response>;
33
+ }
34
+ //# sourceMappingURL=NodeClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeClient.d.ts","sourceRoot":"","sources":["../../Clients/NodeClient.ts"],"names":[],"mappings":"AAkBA,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,UAAU;IAC9C,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,GAAG,CAAC;gBAEJ,GAAG,EAAE,MAAM;IAKjB,QAAQ;IAMR,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAA,EAAE,OAAO,CAAC,KAAA;IAMlD,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM;;;;;;;IAgC9E,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,UAAU;;;;IAiCnG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM;;;;IA2B9E,qBAAqB,CAAC,UAAU,KAAA,EAAE,WAAW,KAAA,EAAE,aAAa,KAAA;IAS5D,eAAe,CAAC,QAAQ,KAAA;IAOxB,iBAAiB,CAAC,QAAQ,KAAA,EAAE,SAAS,KAAA,EAAE,YAAY,KAAA;IAcnD,qBAAqB,CAAC,QAAQ,KAAA,EAAE,gBAAgB,KAAA,EAAE,SAAS,KAAA,EAAE,YAAY,KAAA;IAiBzE,2BAA2B,CAAC,QAAQ,KAAA,EAAE,WAAW,KAAA,EAAE,SAAS,KAAA,EAAE,YAAY,KAAA;IAW1E,kBAAkB,CAAC,aAAa,KAAA,EAAE,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,YAAY,KAAA;IAWpE,kBAAkB,CAAC,SAAS,KAAA,EAAE,gBAAgB,KAAA,EAAE,SAAS,KAAA,EAAE,YAAY,KAAA;CAYhF"}