ripple-binary-codec 2.7.0 → 2.8.0-smartcontract.0

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 (196) hide show
  1. package/dist/enums/definitions.json +238 -260
  2. package/dist/enums/src/enums/definitions.json +238 -260
  3. package/dist/quality.js +15 -3
  4. package/dist/quality.js.map +1 -1
  5. package/dist/serdes/binary-parser.js +8 -2
  6. package/dist/serdes/binary-parser.js.map +1 -1
  7. package/dist/serdes/binary-serializer.d.ts +1 -1
  8. package/dist/serdes/binary-serializer.js +2 -2
  9. package/dist/serdes/binary-serializer.js.map +1 -1
  10. package/dist/src/enums/definitions.json +238 -260
  11. package/dist/src/quality.js +15 -3
  12. package/dist/src/quality.js.map +1 -1
  13. package/dist/src/serdes/binary-parser.js +8 -2
  14. package/dist/src/serdes/binary-parser.js.map +1 -1
  15. package/dist/src/serdes/binary-serializer.d.ts +1 -1
  16. package/dist/src/serdes/binary-serializer.js +2 -2
  17. package/dist/src/serdes/binary-serializer.js.map +1 -1
  18. package/dist/src/types/account-id.d.ts +2 -0
  19. package/dist/src/types/account-id.js +4 -0
  20. package/dist/src/types/account-id.js.map +1 -1
  21. package/dist/src/types/amount.d.ts +2 -1
  22. package/dist/src/types/amount.js +25 -4
  23. package/dist/src/types/amount.js.map +1 -1
  24. package/dist/src/types/blob.d.ts +2 -1
  25. package/dist/src/types/blob.js +3 -0
  26. package/dist/src/types/blob.js.map +1 -1
  27. package/dist/src/types/currency.d.ts +2 -0
  28. package/dist/src/types/currency.js +4 -0
  29. package/dist/src/types/currency.js.map +1 -1
  30. package/dist/src/types/data.d.ts +86 -0
  31. package/dist/src/types/data.js +252 -0
  32. package/dist/src/types/data.js.map +1 -0
  33. package/dist/src/types/dataType.d.ts +94 -0
  34. package/dist/src/types/dataType.js +145 -0
  35. package/dist/src/types/dataType.js.map +1 -0
  36. package/dist/src/types/hash-128.d.ts +2 -0
  37. package/dist/src/types/hash-128.js +4 -0
  38. package/dist/src/types/hash-128.js.map +1 -1
  39. package/dist/src/types/hash-160.d.ts +2 -0
  40. package/dist/src/types/hash-160.js +4 -0
  41. package/dist/src/types/hash-160.js.map +1 -1
  42. package/dist/src/types/hash-192.d.ts +2 -0
  43. package/dist/src/types/hash-192.js +4 -0
  44. package/dist/src/types/hash-192.js.map +1 -1
  45. package/dist/src/types/hash-256.d.ts +2 -0
  46. package/dist/src/types/hash-256.js +4 -0
  47. package/dist/src/types/hash-256.js.map +1 -1
  48. package/dist/src/types/index.d.ts +3 -1
  49. package/dist/src/types/index.js +7 -1
  50. package/dist/src/types/index.js.map +1 -1
  51. package/dist/src/types/issue.d.ts +2 -1
  52. package/dist/src/types/issue.js +3 -0
  53. package/dist/src/types/issue.js.map +1 -1
  54. package/dist/src/types/json.d.ts +173 -0
  55. package/dist/src/types/json.js +531 -0
  56. package/dist/src/types/json.js.map +1 -0
  57. package/dist/src/types/path-set.d.ts +2 -1
  58. package/dist/src/types/path-set.js +3 -0
  59. package/dist/src/types/path-set.js.map +1 -1
  60. package/dist/src/types/serialized-type.d.ts +43 -0
  61. package/dist/src/types/serialized-type.js +63 -1
  62. package/dist/src/types/serialized-type.js.map +1 -1
  63. package/dist/src/types/st-array.d.ts +2 -1
  64. package/dist/src/types/st-array.js +3 -0
  65. package/dist/src/types/st-array.js.map +1 -1
  66. package/dist/src/types/st-number.d.ts +2 -1
  67. package/dist/src/types/st-number.js +3 -0
  68. package/dist/src/types/st-number.js.map +1 -1
  69. package/dist/src/types/st-object.d.ts +2 -1
  70. package/dist/src/types/st-object.js +9 -1
  71. package/dist/src/types/st-object.js.map +1 -1
  72. package/dist/src/types/uint-16.d.ts +2 -0
  73. package/dist/src/types/uint-16.js +4 -0
  74. package/dist/src/types/uint-16.js.map +1 -1
  75. package/dist/src/types/uint-32.d.ts +2 -0
  76. package/dist/src/types/uint-32.js +4 -0
  77. package/dist/src/types/uint-32.js.map +1 -1
  78. package/dist/src/types/uint-64.d.ts +2 -0
  79. package/dist/src/types/uint-64.js +4 -0
  80. package/dist/src/types/uint-64.js.map +1 -1
  81. package/dist/src/types/uint-8.d.ts +2 -0
  82. package/dist/src/types/uint-8.js +4 -0
  83. package/dist/src/types/uint-8.js.map +1 -1
  84. package/dist/src/types/vector-256.d.ts +2 -1
  85. package/dist/src/types/vector-256.js +3 -0
  86. package/dist/src/types/vector-256.js.map +1 -1
  87. package/dist/src/types/xchain-bridge.d.ts +2 -1
  88. package/dist/src/types/xchain-bridge.js +3 -0
  89. package/dist/src/types/xchain-bridge.js.map +1 -1
  90. package/dist/src/utils.js +1 -1
  91. package/dist/src/utils.js.map +1 -1
  92. package/dist/tsconfig.tsbuildinfo +1 -1
  93. package/dist/types/account-id.d.ts +2 -0
  94. package/dist/types/account-id.js +4 -0
  95. package/dist/types/account-id.js.map +1 -1
  96. package/dist/types/amount.d.ts +2 -1
  97. package/dist/types/amount.js +25 -4
  98. package/dist/types/amount.js.map +1 -1
  99. package/dist/types/blob.d.ts +2 -1
  100. package/dist/types/blob.js +3 -0
  101. package/dist/types/blob.js.map +1 -1
  102. package/dist/types/currency.d.ts +2 -0
  103. package/dist/types/currency.js +4 -0
  104. package/dist/types/currency.js.map +1 -1
  105. package/dist/types/data.d.ts +86 -0
  106. package/dist/types/data.js +252 -0
  107. package/dist/types/data.js.map +1 -0
  108. package/dist/types/dataType.d.ts +94 -0
  109. package/dist/types/dataType.js +145 -0
  110. package/dist/types/dataType.js.map +1 -0
  111. package/dist/types/hash-128.d.ts +2 -0
  112. package/dist/types/hash-128.js +4 -0
  113. package/dist/types/hash-128.js.map +1 -1
  114. package/dist/types/hash-160.d.ts +2 -0
  115. package/dist/types/hash-160.js +4 -0
  116. package/dist/types/hash-160.js.map +1 -1
  117. package/dist/types/hash-192.d.ts +2 -0
  118. package/dist/types/hash-192.js +4 -0
  119. package/dist/types/hash-192.js.map +1 -1
  120. package/dist/types/hash-256.d.ts +2 -0
  121. package/dist/types/hash-256.js +4 -0
  122. package/dist/types/hash-256.js.map +1 -1
  123. package/dist/types/index.d.ts +3 -1
  124. package/dist/types/index.js +7 -1
  125. package/dist/types/index.js.map +1 -1
  126. package/dist/types/issue.d.ts +2 -1
  127. package/dist/types/issue.js +3 -0
  128. package/dist/types/issue.js.map +1 -1
  129. package/dist/types/json.d.ts +173 -0
  130. package/dist/types/json.js +531 -0
  131. package/dist/types/json.js.map +1 -0
  132. package/dist/types/path-set.d.ts +2 -1
  133. package/dist/types/path-set.js +3 -0
  134. package/dist/types/path-set.js.map +1 -1
  135. package/dist/types/serialized-type.d.ts +43 -0
  136. package/dist/types/serialized-type.js +63 -1
  137. package/dist/types/serialized-type.js.map +1 -1
  138. package/dist/types/st-array.d.ts +2 -1
  139. package/dist/types/st-array.js +3 -0
  140. package/dist/types/st-array.js.map +1 -1
  141. package/dist/types/st-number.d.ts +2 -1
  142. package/dist/types/st-number.js +3 -0
  143. package/dist/types/st-number.js.map +1 -1
  144. package/dist/types/st-object.d.ts +2 -1
  145. package/dist/types/st-object.js +9 -1
  146. package/dist/types/st-object.js.map +1 -1
  147. package/dist/types/uint-16.d.ts +2 -0
  148. package/dist/types/uint-16.js +4 -0
  149. package/dist/types/uint-16.js.map +1 -1
  150. package/dist/types/uint-32.d.ts +2 -0
  151. package/dist/types/uint-32.js +4 -0
  152. package/dist/types/uint-32.js.map +1 -1
  153. package/dist/types/uint-64.d.ts +2 -0
  154. package/dist/types/uint-64.js +4 -0
  155. package/dist/types/uint-64.js.map +1 -1
  156. package/dist/types/uint-8.d.ts +2 -0
  157. package/dist/types/uint-8.js +4 -0
  158. package/dist/types/uint-8.js.map +1 -1
  159. package/dist/types/vector-256.d.ts +2 -1
  160. package/dist/types/vector-256.js +3 -0
  161. package/dist/types/vector-256.js.map +1 -1
  162. package/dist/types/xchain-bridge.d.ts +2 -1
  163. package/dist/types/xchain-bridge.js +3 -0
  164. package/dist/types/xchain-bridge.js.map +1 -1
  165. package/dist/utils.js +1 -1
  166. package/dist/utils.js.map +1 -1
  167. package/package.json +2 -2
  168. package/src/enums/definitions.json +238 -260
  169. package/src/quality.ts +13 -3
  170. package/src/serdes/binary-parser.ts +12 -2
  171. package/src/serdes/binary-serializer.ts +2 -2
  172. package/src/types/account-id.ts +5 -0
  173. package/src/types/amount.ts +25 -6
  174. package/src/types/blob.ts +5 -1
  175. package/src/types/currency.ts +5 -0
  176. package/src/types/data.ts +294 -0
  177. package/src/types/dataType.ts +178 -0
  178. package/src/types/hash-128.ts +5 -0
  179. package/src/types/hash-160.ts +5 -0
  180. package/src/types/hash-192.ts +5 -0
  181. package/src/types/hash-256.ts +5 -0
  182. package/src/types/index.ts +6 -0
  183. package/src/types/issue.ts +5 -1
  184. package/src/types/json.ts +650 -0
  185. package/src/types/path-set.ts +5 -1
  186. package/src/types/serialized-type.ts +67 -0
  187. package/src/types/st-array.ts +5 -1
  188. package/src/types/st-number.ts +5 -1
  189. package/src/types/st-object.ts +12 -2
  190. package/src/types/uint-16.ts +5 -0
  191. package/src/types/uint-32.ts +5 -0
  192. package/src/types/uint-64.ts +6 -1
  193. package/src/types/uint-8.ts +5 -0
  194. package/src/types/vector-256.ts +5 -1
  195. package/src/types/xchain-bridge.ts +5 -1
  196. package/src/utils.ts +1 -1
@@ -1,4 +1,5 @@
1
1
  import { Hash } from './hash'
2
+ import { SerializedTypeID } from './serialized-type'
2
3
 
3
4
  /**
4
5
  * Hash with a width of 160 bits
@@ -14,6 +15,10 @@ class Hash160 extends Hash {
14
15
 
15
16
  super(bytes ?? Hash160.ZERO_160.bytes)
16
17
  }
18
+
19
+ getSType(): SerializedTypeID {
20
+ return SerializedTypeID.STI_UINT160
21
+ }
17
22
  }
18
23
 
19
24
  export { Hash160 }
@@ -1,4 +1,5 @@
1
1
  import { Hash } from './hash'
2
+ import { SerializedTypeID } from './serialized-type'
2
3
 
3
4
  /**
4
5
  * Hash with a width of 192 bits
@@ -14,6 +15,10 @@ class Hash192 extends Hash {
14
15
 
15
16
  super(bytes ?? Hash192.ZERO_192.bytes)
16
17
  }
18
+
19
+ getSType(): SerializedTypeID {
20
+ return SerializedTypeID.STI_UINT192
21
+ }
17
22
  }
18
23
 
19
24
  export { Hash192 }
@@ -1,4 +1,5 @@
1
1
  import { Hash } from './hash'
2
+ import { SerializedTypeID } from './serialized-type'
2
3
 
3
4
  /**
4
5
  * Hash with a width of 256 bits
@@ -10,6 +11,10 @@ class Hash256 extends Hash {
10
11
  constructor(bytes: Uint8Array) {
11
12
  super(bytes ?? Hash256.ZERO_256.bytes)
12
13
  }
14
+
15
+ getSType(): SerializedTypeID {
16
+ return SerializedTypeID.STI_UINT256
17
+ }
13
18
  }
14
19
 
15
20
  export { Hash256 }
@@ -2,6 +2,8 @@ import { AccountID } from './account-id'
2
2
  import { Amount } from './amount'
3
3
  import { Blob } from './blob'
4
4
  import { Currency } from './currency'
5
+ import { Data } from './data'
6
+ import { DataType } from './dataType'
5
7
  import { Hash128 } from './hash-128'
6
8
  import { Hash160 } from './hash-160'
7
9
  import { Hash192 } from './hash-192'
@@ -26,6 +28,8 @@ const coreTypes: Record<string, typeof SerializedType> = {
26
28
  Amount,
27
29
  Blob,
28
30
  Currency,
31
+ Data,
32
+ DataType,
29
33
  Hash128,
30
34
  Hash160,
31
35
  Hash192,
@@ -55,6 +59,8 @@ export {
55
59
  Amount,
56
60
  Blob,
57
61
  Currency,
62
+ Data,
63
+ DataType,
58
64
  Hash128,
59
65
  Hash160,
60
66
  Hash192,
@@ -3,7 +3,7 @@ import { BinaryParser } from '../serdes/binary-parser'
3
3
 
4
4
  import { AccountID } from './account-id'
5
5
  import { Currency } from './currency'
6
- import { JsonObject, SerializedType } from './serialized-type'
6
+ import { JsonObject, SerializedType, SerializedTypeID } from './serialized-type'
7
7
  import { Hash192 } from './hash-192'
8
8
  import { readUInt32BE, writeUInt32BE } from '../utils'
9
9
 
@@ -158,6 +158,10 @@ class Issue extends SerializedType {
158
158
  issuer: issuer.toJSON(),
159
159
  }
160
160
  }
161
+
162
+ getSType(): SerializedTypeID {
163
+ return SerializedTypeID.STI_ISSUE
164
+ }
161
165
  }
162
166
 
163
167
  export { Issue, IssueObject }