bitbadgesjs-sdk 0.1.2 → 0.1.4

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 (976) hide show
  1. package/dist/{utils → address-converter}/converter.d.ts +1 -1
  2. package/dist/address-converter/converter.d.ts.map +1 -0
  3. package/dist/{utils → address-converter}/converter.js +1 -1
  4. package/dist/address-converter/converter.js.map +1 -0
  5. package/dist/address-converter/index.d.ts +2 -0
  6. package/dist/address-converter/index.d.ts.map +1 -0
  7. package/dist/address-converter/index.js +18 -0
  8. package/dist/address-converter/index.js.map +1 -0
  9. package/dist/{utils/api → api-indexer}/BitBadgesAddressList.d.ts +36 -15
  10. package/dist/api-indexer/BitBadgesAddressList.d.ts.map +1 -0
  11. package/dist/{utils/api → api-indexer}/BitBadgesAddressList.js +54 -28
  12. package/dist/api-indexer/BitBadgesAddressList.js.map +1 -0
  13. package/dist/{utils/api → api-indexer}/BitBadgesApi.d.ts +21 -18
  14. package/dist/api-indexer/BitBadgesApi.d.ts.map +1 -0
  15. package/dist/{utils/api → api-indexer}/BitBadgesApi.js +40 -38
  16. package/dist/api-indexer/BitBadgesApi.js.map +1 -0
  17. package/dist/api-indexer/BitBadgesCollection.d.ts +193 -0
  18. package/dist/api-indexer/BitBadgesCollection.d.ts.map +1 -0
  19. package/dist/{utils/api → api-indexer}/BitBadgesCollection.js +188 -274
  20. package/dist/api-indexer/BitBadgesCollection.js.map +1 -0
  21. package/dist/{utils/api → api-indexer}/BitBadgesUserInfo.d.ts +20 -29
  22. package/dist/api-indexer/BitBadgesUserInfo.d.ts.map +1 -0
  23. package/dist/{utils/api → api-indexer}/BitBadgesUserInfo.js +90 -57
  24. package/dist/api-indexer/BitBadgesUserInfo.js.map +1 -0
  25. package/dist/api-indexer/base.d.ts +33 -0
  26. package/dist/api-indexer/base.d.ts.map +1 -0
  27. package/dist/api-indexer/base.js +61 -0
  28. package/dist/api-indexer/base.js.map +1 -0
  29. package/dist/api-indexer/docs/activity.d.ts +58 -0
  30. package/dist/api-indexer/docs/activity.d.ts.map +1 -0
  31. package/dist/{utils/types → api-indexer/docs}/activity.js +20 -36
  32. package/dist/api-indexer/docs/activity.js.map +1 -0
  33. package/dist/api-indexer/docs/docs.d.ts +433 -0
  34. package/dist/api-indexer/docs/docs.d.ts.map +1 -0
  35. package/dist/{utils/types/db.js → api-indexer/docs/docs.js} +198 -260
  36. package/dist/api-indexer/docs/docs.js.map +1 -0
  37. package/dist/api-indexer/docs/index.d.ts +7 -0
  38. package/dist/api-indexer/docs/index.d.ts.map +1 -0
  39. package/dist/api-indexer/docs/index.js +23 -0
  40. package/dist/api-indexer/docs/index.js.map +1 -0
  41. package/dist/api-indexer/docs/interfaces.d.ts +326 -0
  42. package/dist/api-indexer/docs/interfaces.d.ts.map +1 -0
  43. package/dist/api-indexer/docs/interfaces.js +3 -0
  44. package/dist/api-indexer/docs/interfaces.js.map +1 -0
  45. package/dist/api-indexer/index.d.ts +10 -0
  46. package/dist/api-indexer/index.d.ts.map +1 -0
  47. package/dist/api-indexer/index.js +26 -0
  48. package/dist/api-indexer/index.js.map +1 -0
  49. package/dist/api-indexer/indexer/index.d.ts +3 -0
  50. package/dist/api-indexer/indexer/index.d.ts.map +1 -0
  51. package/dist/api-indexer/indexer/index.js +19 -0
  52. package/dist/api-indexer/indexer/index.js.map +1 -0
  53. package/dist/{utils/types → api-indexer/indexer}/indexer.d.ts +2 -2
  54. package/dist/api-indexer/indexer/indexer.d.ts.map +1 -0
  55. package/dist/api-indexer/indexer/indexer.js.map +1 -0
  56. package/dist/{utils/types → api-indexer/indexer}/schemas.d.ts +27 -3
  57. package/dist/api-indexer/indexer/schemas.d.ts.map +1 -0
  58. package/dist/api-indexer/indexer/schemas.js.map +1 -0
  59. package/dist/{utils → api-indexer/metadata}/badgeMetadata.d.ts +24 -3
  60. package/dist/api-indexer/metadata/badgeMetadata.d.ts.map +1 -0
  61. package/dist/{utils → api-indexer/metadata}/badgeMetadata.js +41 -19
  62. package/dist/api-indexer/metadata/badgeMetadata.js.map +1 -0
  63. package/dist/api-indexer/metadata/index.d.ts +4 -0
  64. package/dist/api-indexer/metadata/index.d.ts.map +1 -0
  65. package/dist/api-indexer/metadata/index.js +20 -0
  66. package/dist/api-indexer/metadata/index.js.map +1 -0
  67. package/dist/{utils/types → api-indexer/metadata}/metadata.d.ts +6 -22
  68. package/dist/api-indexer/metadata/metadata.d.ts.map +1 -0
  69. package/dist/{utils/constants.js → api-indexer/metadata/metadata.js} +43 -18
  70. package/dist/api-indexer/metadata/metadata.js.map +1 -0
  71. package/dist/{utils → api-indexer/metadata}/metadataIds.d.ts +2 -1
  72. package/dist/api-indexer/metadata/metadataIds.d.ts.map +1 -0
  73. package/dist/{utils → api-indexer/metadata}/metadataIds.js +4 -5
  74. package/dist/api-indexer/metadata/metadataIds.js.map +1 -0
  75. package/dist/api-indexer/requests/blockin.d.ts +54 -0
  76. package/dist/api-indexer/requests/blockin.d.ts.map +1 -0
  77. package/dist/api-indexer/requests/blockin.js +149 -0
  78. package/dist/api-indexer/requests/blockin.js.map +1 -0
  79. package/dist/api-indexer/requests/collections.d.ts +125 -0
  80. package/dist/api-indexer/requests/collections.d.ts.map +1 -0
  81. package/dist/api-indexer/requests/collections.js +109 -0
  82. package/dist/api-indexer/requests/collections.js.map +1 -0
  83. package/dist/api-indexer/requests/index.d.ts +5 -0
  84. package/dist/api-indexer/requests/index.d.ts.map +1 -0
  85. package/dist/api-indexer/requests/index.js +21 -0
  86. package/dist/api-indexer/requests/index.js.map +1 -0
  87. package/dist/api-indexer/requests/protocols.d.ts +40 -0
  88. package/dist/api-indexer/requests/protocols.d.ts.map +1 -0
  89. package/dist/{types/protocols/types.js → api-indexer/requests/protocols.js} +7 -32
  90. package/dist/api-indexer/requests/protocols.js.map +1 -0
  91. package/dist/{utils/types/api.d.ts → api-indexer/requests/requests.d.ts} +66 -117
  92. package/dist/api-indexer/requests/requests.d.ts.map +1 -0
  93. package/dist/{utils/types/api.js → api-indexer/requests/requests.js} +40 -139
  94. package/dist/api-indexer/requests/requests.js.map +1 -0
  95. package/dist/{utils/types → api-indexer/requests}/routes.d.ts +1 -1
  96. package/dist/api-indexer/requests/routes.d.ts.map +1 -0
  97. package/dist/api-indexer/requests/routes.js.map +1 -0
  98. package/dist/common/base.d.ts +34 -0
  99. package/dist/common/base.d.ts.map +1 -0
  100. package/dist/{types → common}/base.js +90 -93
  101. package/dist/common/base.js.map +1 -0
  102. package/dist/{utils/chains.d.ts → common/constants.d.ts} +13 -4
  103. package/dist/common/constants.d.ts.map +1 -0
  104. package/dist/{utils/chains.js → common/constants.js} +14 -54
  105. package/dist/common/constants.js.map +1 -0
  106. package/dist/common/index.d.ts +6 -0
  107. package/dist/common/index.d.ts.map +1 -0
  108. package/dist/common/index.js +22 -0
  109. package/dist/common/index.js.map +1 -0
  110. package/dist/{types → common}/math.d.ts +3 -3
  111. package/dist/common/math.d.ts.map +1 -0
  112. package/dist/{types → common}/math.js +14 -14
  113. package/dist/common/math.js.map +1 -0
  114. package/dist/{types → common}/string-numbers.d.ts +0 -6
  115. package/dist/common/string-numbers.d.ts.map +1 -0
  116. package/dist/{types → common}/string-numbers.js +2 -2
  117. package/dist/common/string-numbers.js.map +1 -0
  118. package/dist/common/typed-arrays.d.ts +21 -0
  119. package/dist/common/typed-arrays.d.ts.map +1 -0
  120. package/dist/common/typed-arrays.js +61 -0
  121. package/dist/common/typed-arrays.js.map +1 -0
  122. package/dist/common/types.d.ts.map +1 -0
  123. package/dist/{types → common}/types.js +4 -4
  124. package/dist/common/types.js.map +1 -0
  125. package/dist/core/addressLists.d.ts +31 -0
  126. package/dist/core/addressLists.d.ts.map +1 -0
  127. package/dist/{types/badges → core}/addressLists.js +7 -7
  128. package/dist/core/addressLists.js.map +1 -0
  129. package/dist/{utils → core}/aliases.d.ts +1 -1
  130. package/dist/core/aliases.d.ts.map +1 -0
  131. package/dist/{utils → core}/aliases.js +7 -7
  132. package/dist/core/aliases.js.map +1 -0
  133. package/dist/{utils/firstMatches.d.ts → core/approval-utils.d.ts} +4 -5
  134. package/dist/core/approval-utils.d.ts.map +1 -0
  135. package/dist/{utils/firstMatches.js → core/approval-utils.js} +57 -30
  136. package/dist/core/approval-utils.js.map +1 -0
  137. package/dist/{types/badges → core}/approvals.d.ts +172 -151
  138. package/dist/core/approvals.d.ts.map +1 -0
  139. package/dist/core/approvals.js +1149 -0
  140. package/dist/core/approvals.js.map +1 -0
  141. package/dist/core/balances.d.ts +76 -0
  142. package/dist/core/balances.d.ts.map +1 -0
  143. package/dist/core/balances.js +496 -0
  144. package/dist/core/balances.js.map +1 -0
  145. package/dist/core/batch-utils.d.ts +29 -0
  146. package/dist/core/batch-utils.d.ts.map +1 -0
  147. package/dist/core/batch-utils.js +145 -0
  148. package/dist/core/batch-utils.js.map +1 -0
  149. package/dist/{utils/types → core}/coin.d.ts +4 -3
  150. package/dist/core/coin.d.ts.map +1 -0
  151. package/dist/{utils/types → core}/coin.js +4 -6
  152. package/dist/core/coin.js.map +1 -0
  153. package/dist/core/index.d.ts +20 -0
  154. package/dist/core/index.d.ts.map +1 -0
  155. package/dist/core/index.js +36 -0
  156. package/dist/core/index.js.map +1 -0
  157. package/dist/core/misc.d.ts +229 -0
  158. package/dist/core/misc.d.ts.map +1 -0
  159. package/dist/core/misc.js +1038 -0
  160. package/dist/core/misc.js.map +1 -0
  161. package/dist/{utils → core}/overlaps.d.ts +17 -16
  162. package/dist/core/overlaps.d.ts.map +1 -0
  163. package/dist/{utils → core}/overlaps.js +74 -62
  164. package/dist/core/overlaps.js.map +1 -0
  165. package/dist/core/permission-utils.d.ts +9 -0
  166. package/dist/core/permission-utils.d.ts.map +1 -0
  167. package/dist/core/permission-utils.js +103 -0
  168. package/dist/core/permission-utils.js.map +1 -0
  169. package/dist/core/permissions.d.ts +245 -0
  170. package/dist/core/permissions.d.ts.map +1 -0
  171. package/dist/core/permissions.js +987 -0
  172. package/dist/core/permissions.js.map +1 -0
  173. package/dist/core/timelines.d.ts +14 -0
  174. package/dist/core/timelines.d.ts.map +1 -0
  175. package/dist/core/timelines.js +84 -0
  176. package/dist/core/timelines.js.map +1 -0
  177. package/dist/core/transfers.d.ts +59 -0
  178. package/dist/core/transfers.d.ts.map +1 -0
  179. package/dist/core/transfers.js +300 -0
  180. package/dist/core/transfers.js.map +1 -0
  181. package/dist/core/uintRanges.d.ts +48 -0
  182. package/dist/core/uintRanges.d.ts.map +1 -0
  183. package/dist/core/uintRanges.js +311 -0
  184. package/dist/core/uintRanges.js.map +1 -0
  185. package/dist/core/userBalances.d.ts +32 -0
  186. package/dist/core/userBalances.d.ts.map +1 -0
  187. package/dist/core/userBalances.js +95 -0
  188. package/dist/core/userBalances.js.map +1 -0
  189. package/dist/core/validate-utils.d.ts +10 -0
  190. package/dist/core/validate-utils.d.ts.map +1 -0
  191. package/dist/core/validate-utils.js +134 -0
  192. package/dist/core/validate-utils.js.map +1 -0
  193. package/dist/index.d.ts +6 -34
  194. package/dist/index.d.ts.map +1 -1
  195. package/dist/index.js +6 -34
  196. package/dist/index.js.map +1 -1
  197. package/dist/interfaces/badges/approvals.d.ts +110 -0
  198. package/dist/interfaces/badges/approvals.d.ts.map +1 -0
  199. package/dist/interfaces/badges/approvals.js +3 -0
  200. package/dist/interfaces/badges/approvals.js.map +1 -0
  201. package/dist/interfaces/badges/core.d.ts +104 -0
  202. package/dist/interfaces/badges/core.d.ts.map +1 -0
  203. package/dist/{utils/node-rest-api/coin.js → interfaces/badges/core.js} +1 -1
  204. package/dist/interfaces/badges/core.js.map +1 -0
  205. package/dist/interfaces/badges/index.d.ts +5 -0
  206. package/dist/interfaces/badges/index.d.ts.map +1 -0
  207. package/dist/interfaces/badges/index.js +21 -0
  208. package/dist/interfaces/badges/index.js.map +1 -0
  209. package/dist/interfaces/badges/permissions.d.ts +99 -0
  210. package/dist/interfaces/badges/permissions.d.ts.map +1 -0
  211. package/dist/interfaces/badges/permissions.js +3 -0
  212. package/dist/interfaces/badges/permissions.js.map +1 -0
  213. package/dist/interfaces/badges/userBalances.d.ts +22 -0
  214. package/dist/interfaces/badges/userBalances.d.ts.map +1 -0
  215. package/dist/interfaces/badges/userBalances.js +3 -0
  216. package/dist/interfaces/badges/userBalances.js.map +1 -0
  217. package/dist/interfaces/index.d.ts +3 -0
  218. package/dist/interfaces/index.d.ts.map +1 -0
  219. package/dist/interfaces/index.js +19 -0
  220. package/dist/interfaces/index.js.map +1 -0
  221. package/dist/node-rest-api/account.d.ts.map +1 -0
  222. package/dist/node-rest-api/account.js.map +1 -0
  223. package/dist/{utils/node-rest-api → node-rest-api}/balances.d.ts +2 -2
  224. package/dist/node-rest-api/balances.d.ts.map +1 -0
  225. package/dist/node-rest-api/balances.js.map +1 -0
  226. package/dist/node-rest-api/broadcast.d.ts.map +1 -0
  227. package/dist/{utils/node-rest-api → node-rest-api}/broadcast.js +1 -1
  228. package/dist/node-rest-api/broadcast.js.map +1 -0
  229. package/dist/{utils/node-rest-api → node-rest-api}/gov.d.ts +2 -2
  230. package/dist/node-rest-api/gov.d.ts.map +1 -0
  231. package/dist/{utils/node-rest-api → node-rest-api}/gov.js +1 -1
  232. package/dist/node-rest-api/gov.js.map +1 -0
  233. package/dist/node-rest-api/ibc.d.ts.map +1 -0
  234. package/dist/node-rest-api/ibc.js.map +1 -0
  235. package/dist/node-rest-api/index.d.ts +7 -0
  236. package/dist/node-rest-api/index.d.ts.map +1 -0
  237. package/dist/node-rest-api/index.js +23 -0
  238. package/dist/node-rest-api/index.js.map +1 -0
  239. package/dist/{utils/node-rest-api → node-rest-api}/staking.d.ts +4 -4
  240. package/dist/node-rest-api/staking.d.ts.map +1 -0
  241. package/dist/node-rest-api/staking.js.map +1 -0
  242. package/dist/proto/badges/index.d.ts.map +1 -1
  243. package/dist/proto/badges/index.js.map +1 -1
  244. package/dist/proto/bitcoin/index.d.ts.map +1 -1
  245. package/dist/proto/bitcoin/index.js.map +1 -1
  246. package/dist/proto/cosmos/app/index.d.ts.map +1 -1
  247. package/dist/proto/cosmos/app/index.js.map +1 -1
  248. package/dist/proto/cosmos/app/runtime/index.d.ts.map +1 -1
  249. package/dist/proto/cosmos/app/runtime/index.js.map +1 -1
  250. package/dist/proto/cosmos/app/runtime/v1alpha1/index.d.ts.map +1 -1
  251. package/dist/proto/cosmos/app/runtime/v1alpha1/index.js.map +1 -1
  252. package/dist/proto/cosmos/app/v1alpha1/index.d.ts.map +1 -1
  253. package/dist/proto/cosmos/app/v1alpha1/index.js.map +1 -1
  254. package/dist/proto/cosmos/auth/index.d.ts.map +1 -1
  255. package/dist/proto/cosmos/auth/index.js.map +1 -1
  256. package/dist/proto/cosmos/auth/module/index.d.ts.map +1 -1
  257. package/dist/proto/cosmos/auth/module/index.js.map +1 -1
  258. package/dist/proto/cosmos/auth/module/v1/index.d.ts.map +1 -1
  259. package/dist/proto/cosmos/auth/module/v1/index.js.map +1 -1
  260. package/dist/proto/cosmos/auth/v1beta1/index.d.ts.map +1 -1
  261. package/dist/proto/cosmos/auth/v1beta1/index.js.map +1 -1
  262. package/dist/proto/cosmos/authz/index.d.ts.map +1 -1
  263. package/dist/proto/cosmos/authz/index.js.map +1 -1
  264. package/dist/proto/cosmos/authz/module/index.d.ts.map +1 -1
  265. package/dist/proto/cosmos/authz/module/index.js.map +1 -1
  266. package/dist/proto/cosmos/authz/module/v1/index.d.ts.map +1 -1
  267. package/dist/proto/cosmos/authz/module/v1/index.js.map +1 -1
  268. package/dist/proto/cosmos/authz/v1beta1/index.d.ts.map +1 -1
  269. package/dist/proto/cosmos/authz/v1beta1/index.js.map +1 -1
  270. package/dist/proto/cosmos/autocli/index.d.ts.map +1 -1
  271. package/dist/proto/cosmos/autocli/index.js.map +1 -1
  272. package/dist/proto/cosmos/autocli/v1/index.d.ts.map +1 -1
  273. package/dist/proto/cosmos/autocli/v1/index.js.map +1 -1
  274. package/dist/proto/cosmos/bank/index.d.ts.map +1 -1
  275. package/dist/proto/cosmos/bank/index.js.map +1 -1
  276. package/dist/proto/cosmos/bank/module/index.d.ts.map +1 -1
  277. package/dist/proto/cosmos/bank/module/index.js.map +1 -1
  278. package/dist/proto/cosmos/bank/module/v1/index.d.ts.map +1 -1
  279. package/dist/proto/cosmos/bank/module/v1/index.js.map +1 -1
  280. package/dist/proto/cosmos/bank/v1beta1/index.d.ts.map +1 -1
  281. package/dist/proto/cosmos/bank/v1beta1/index.js.map +1 -1
  282. package/dist/proto/cosmos/base/abci/index.d.ts.map +1 -1
  283. package/dist/proto/cosmos/base/abci/index.js.map +1 -1
  284. package/dist/proto/cosmos/base/index.d.ts.map +1 -1
  285. package/dist/proto/cosmos/base/index.js.map +1 -1
  286. package/dist/proto/cosmos/base/kv/index.d.ts.map +1 -1
  287. package/dist/proto/cosmos/base/kv/index.js.map +1 -1
  288. package/dist/proto/cosmos/base/kv/v1beta1/index.d.ts.map +1 -1
  289. package/dist/proto/cosmos/base/kv/v1beta1/index.js.map +1 -1
  290. package/dist/proto/cosmos/base/node/index.d.ts.map +1 -1
  291. package/dist/proto/cosmos/base/node/index.js.map +1 -1
  292. package/dist/proto/cosmos/base/node/v1beta1/index.d.ts.map +1 -1
  293. package/dist/proto/cosmos/base/node/v1beta1/index.js.map +1 -1
  294. package/dist/proto/cosmos/base/query/index.d.ts.map +1 -1
  295. package/dist/proto/cosmos/base/query/index.js.map +1 -1
  296. package/dist/proto/cosmos/base/query/v1beta1/index.d.ts.map +1 -1
  297. package/dist/proto/cosmos/base/query/v1beta1/index.js.map +1 -1
  298. package/dist/proto/cosmos/base/reflection/index.d.ts.map +1 -1
  299. package/dist/proto/cosmos/base/reflection/index.js.map +1 -1
  300. package/dist/proto/cosmos/base/reflection/v1beta1/index.d.ts.map +1 -1
  301. package/dist/proto/cosmos/base/reflection/v1beta1/index.js.map +1 -1
  302. package/dist/proto/cosmos/base/reflection/v2alpha1/index.d.ts.map +1 -1
  303. package/dist/proto/cosmos/base/reflection/v2alpha1/index.js.map +1 -1
  304. package/dist/proto/cosmos/base/snapshots/index.d.ts.map +1 -1
  305. package/dist/proto/cosmos/base/snapshots/index.js.map +1 -1
  306. package/dist/proto/cosmos/base/snapshots/v1beta1/index.d.ts.map +1 -1
  307. package/dist/proto/cosmos/base/snapshots/v1beta1/index.js.map +1 -1
  308. package/dist/proto/cosmos/base/store/index.d.ts.map +1 -1
  309. package/dist/proto/cosmos/base/store/index.js.map +1 -1
  310. package/dist/proto/cosmos/base/store/v1beta1/index.d.ts.map +1 -1
  311. package/dist/proto/cosmos/base/store/v1beta1/index.js.map +1 -1
  312. package/dist/proto/cosmos/base/tendermint/index.d.ts.map +1 -1
  313. package/dist/proto/cosmos/base/tendermint/index.js.map +1 -1
  314. package/dist/proto/cosmos/base/tendermint/v1beta1/index.d.ts.map +1 -1
  315. package/dist/proto/cosmos/base/tendermint/v1beta1/index.js.map +1 -1
  316. package/dist/proto/cosmos/capability/index.d.ts.map +1 -1
  317. package/dist/proto/cosmos/capability/index.js.map +1 -1
  318. package/dist/proto/cosmos/capability/module/index.d.ts.map +1 -1
  319. package/dist/proto/cosmos/capability/module/index.js.map +1 -1
  320. package/dist/proto/cosmos/capability/module/v1/index.d.ts.map +1 -1
  321. package/dist/proto/cosmos/capability/module/v1/index.js.map +1 -1
  322. package/dist/proto/cosmos/consensus/index.d.ts.map +1 -1
  323. package/dist/proto/cosmos/consensus/index.js.map +1 -1
  324. package/dist/proto/cosmos/consensus/module/index.d.ts.map +1 -1
  325. package/dist/proto/cosmos/consensus/module/index.js.map +1 -1
  326. package/dist/proto/cosmos/consensus/module/v1/index.d.ts.map +1 -1
  327. package/dist/proto/cosmos/consensus/module/v1/index.js.map +1 -1
  328. package/dist/proto/cosmos/consensus/v1/index.d.ts.map +1 -1
  329. package/dist/proto/cosmos/consensus/v1/index.js.map +1 -1
  330. package/dist/proto/cosmos/crisis/index.d.ts.map +1 -1
  331. package/dist/proto/cosmos/crisis/index.js.map +1 -1
  332. package/dist/proto/cosmos/crisis/module/index.d.ts.map +1 -1
  333. package/dist/proto/cosmos/crisis/module/index.js.map +1 -1
  334. package/dist/proto/cosmos/crisis/module/v1/index.d.ts.map +1 -1
  335. package/dist/proto/cosmos/crisis/module/v1/index.js.map +1 -1
  336. package/dist/proto/cosmos/crisis/v1beta1/index.d.ts.map +1 -1
  337. package/dist/proto/cosmos/crisis/v1beta1/index.js.map +1 -1
  338. package/dist/proto/cosmos/crypto/ed25519/index.d.ts.map +1 -1
  339. package/dist/proto/cosmos/crypto/ed25519/index.js.map +1 -1
  340. package/dist/proto/cosmos/crypto/hd/index.d.ts.map +1 -1
  341. package/dist/proto/cosmos/crypto/hd/index.js.map +1 -1
  342. package/dist/proto/cosmos/crypto/index.d.ts.map +1 -1
  343. package/dist/proto/cosmos/crypto/index.js.map +1 -1
  344. package/dist/proto/cosmos/crypto/keyring/index.d.ts.map +1 -1
  345. package/dist/proto/cosmos/crypto/keyring/index.js.map +1 -1
  346. package/dist/proto/cosmos/crypto/keyring/v1/index.d.ts.map +1 -1
  347. package/dist/proto/cosmos/crypto/keyring/v1/index.js.map +1 -1
  348. package/dist/proto/cosmos/crypto/multisig/index.d.ts.map +1 -1
  349. package/dist/proto/cosmos/crypto/multisig/index.js.map +1 -1
  350. package/dist/proto/cosmos/crypto/multisig/v1beta1/index.d.ts.map +1 -1
  351. package/dist/proto/cosmos/crypto/multisig/v1beta1/index.js.map +1 -1
  352. package/dist/proto/cosmos/crypto/secp256k1/index.d.ts.map +1 -1
  353. package/dist/proto/cosmos/crypto/secp256k1/index.js.map +1 -1
  354. package/dist/proto/cosmos/crypto/secp256r1/index.d.ts.map +1 -1
  355. package/dist/proto/cosmos/crypto/secp256r1/index.js.map +1 -1
  356. package/dist/proto/cosmos/distribution/index.d.ts.map +1 -1
  357. package/dist/proto/cosmos/distribution/index.js.map +1 -1
  358. package/dist/proto/cosmos/distribution/module/index.d.ts.map +1 -1
  359. package/dist/proto/cosmos/distribution/module/index.js.map +1 -1
  360. package/dist/proto/cosmos/distribution/module/v1/index.d.ts.map +1 -1
  361. package/dist/proto/cosmos/distribution/module/v1/index.js.map +1 -1
  362. package/dist/proto/cosmos/distribution/v1beta1/index.d.ts.map +1 -1
  363. package/dist/proto/cosmos/distribution/v1beta1/index.js.map +1 -1
  364. package/dist/proto/cosmos/evidence/index.d.ts.map +1 -1
  365. package/dist/proto/cosmos/evidence/index.js.map +1 -1
  366. package/dist/proto/cosmos/evidence/module/index.d.ts.map +1 -1
  367. package/dist/proto/cosmos/evidence/module/index.js.map +1 -1
  368. package/dist/proto/cosmos/evidence/module/v1/index.d.ts.map +1 -1
  369. package/dist/proto/cosmos/evidence/module/v1/index.js.map +1 -1
  370. package/dist/proto/cosmos/evidence/v1beta1/index.d.ts.map +1 -1
  371. package/dist/proto/cosmos/evidence/v1beta1/index.js.map +1 -1
  372. package/dist/proto/cosmos/feegrant/index.d.ts.map +1 -1
  373. package/dist/proto/cosmos/feegrant/index.js.map +1 -1
  374. package/dist/proto/cosmos/feegrant/module/index.d.ts.map +1 -1
  375. package/dist/proto/cosmos/feegrant/module/index.js.map +1 -1
  376. package/dist/proto/cosmos/feegrant/module/v1/index.d.ts.map +1 -1
  377. package/dist/proto/cosmos/feegrant/module/v1/index.js.map +1 -1
  378. package/dist/proto/cosmos/feegrant/v1beta1/index.d.ts.map +1 -1
  379. package/dist/proto/cosmos/feegrant/v1beta1/index.js.map +1 -1
  380. package/dist/proto/cosmos/genutil/index.d.ts.map +1 -1
  381. package/dist/proto/cosmos/genutil/index.js.map +1 -1
  382. package/dist/proto/cosmos/genutil/module/index.d.ts.map +1 -1
  383. package/dist/proto/cosmos/genutil/module/index.js.map +1 -1
  384. package/dist/proto/cosmos/genutil/module/v1/index.d.ts.map +1 -1
  385. package/dist/proto/cosmos/genutil/module/v1/index.js.map +1 -1
  386. package/dist/proto/cosmos/gov/index.d.ts.map +1 -1
  387. package/dist/proto/cosmos/gov/index.js.map +1 -1
  388. package/dist/proto/cosmos/gov/module/index.d.ts.map +1 -1
  389. package/dist/proto/cosmos/gov/module/index.js.map +1 -1
  390. package/dist/proto/cosmos/gov/module/v1/index.d.ts.map +1 -1
  391. package/dist/proto/cosmos/gov/module/v1/index.js.map +1 -1
  392. package/dist/proto/cosmos/gov/v1/gov_pb.js +2 -2
  393. package/dist/proto/cosmos/gov/v1/gov_pb.js.map +1 -1
  394. package/dist/proto/cosmos/gov/v1/index.d.ts.map +1 -1
  395. package/dist/proto/cosmos/gov/v1/index.js.map +1 -1
  396. package/dist/proto/cosmos/gov/v1beta1/gov_pb.js +2 -2
  397. package/dist/proto/cosmos/gov/v1beta1/gov_pb.js.map +1 -1
  398. package/dist/proto/cosmos/gov/v1beta1/index.d.ts.map +1 -1
  399. package/dist/proto/cosmos/gov/v1beta1/index.js.map +1 -1
  400. package/dist/proto/cosmos/group/index.d.ts.map +1 -1
  401. package/dist/proto/cosmos/group/index.js.map +1 -1
  402. package/dist/proto/cosmos/group/module/index.d.ts.map +1 -1
  403. package/dist/proto/cosmos/group/module/index.js.map +1 -1
  404. package/dist/proto/cosmos/group/module/v1/index.d.ts.map +1 -1
  405. package/dist/proto/cosmos/group/module/v1/index.js.map +1 -1
  406. package/dist/proto/cosmos/group/v1/index.d.ts.map +1 -1
  407. package/dist/proto/cosmos/group/v1/index.js.map +1 -1
  408. package/dist/proto/cosmos/group/v1/tx_pb.js +1 -1
  409. package/dist/proto/cosmos/group/v1/tx_pb.js.map +1 -1
  410. package/dist/proto/cosmos/group/v1/types_pb.js +3 -3
  411. package/dist/proto/cosmos/group/v1/types_pb.js.map +1 -1
  412. package/dist/proto/cosmos/index.d.ts.map +1 -1
  413. package/dist/proto/cosmos/index.js.map +1 -1
  414. package/dist/proto/cosmos/mint/index.d.ts.map +1 -1
  415. package/dist/proto/cosmos/mint/index.js.map +1 -1
  416. package/dist/proto/cosmos/mint/module/index.d.ts.map +1 -1
  417. package/dist/proto/cosmos/mint/module/index.js.map +1 -1
  418. package/dist/proto/cosmos/mint/module/v1/index.d.ts.map +1 -1
  419. package/dist/proto/cosmos/mint/module/v1/index.js.map +1 -1
  420. package/dist/proto/cosmos/mint/v1beta1/index.d.ts.map +1 -1
  421. package/dist/proto/cosmos/mint/v1beta1/index.js.map +1 -1
  422. package/dist/proto/cosmos/nft/index.d.ts.map +1 -1
  423. package/dist/proto/cosmos/nft/index.js.map +1 -1
  424. package/dist/proto/cosmos/nft/module/index.d.ts.map +1 -1
  425. package/dist/proto/cosmos/nft/module/index.js.map +1 -1
  426. package/dist/proto/cosmos/nft/module/v1/index.d.ts.map +1 -1
  427. package/dist/proto/cosmos/nft/module/v1/index.js.map +1 -1
  428. package/dist/proto/cosmos/nft/v1beta1/index.d.ts.map +1 -1
  429. package/dist/proto/cosmos/nft/v1beta1/index.js.map +1 -1
  430. package/dist/proto/cosmos/orm/index.d.ts.map +1 -1
  431. package/dist/proto/cosmos/orm/index.js.map +1 -1
  432. package/dist/proto/cosmos/orm/module/index.d.ts.map +1 -1
  433. package/dist/proto/cosmos/orm/module/index.js.map +1 -1
  434. package/dist/proto/cosmos/orm/module/v1alpha1/index.d.ts.map +1 -1
  435. package/dist/proto/cosmos/orm/module/v1alpha1/index.js.map +1 -1
  436. package/dist/proto/cosmos/orm/query/index.d.ts.map +1 -1
  437. package/dist/proto/cosmos/orm/query/index.js.map +1 -1
  438. package/dist/proto/cosmos/orm/query/v1alpha1/index.d.ts.map +1 -1
  439. package/dist/proto/cosmos/orm/query/v1alpha1/index.js.map +1 -1
  440. package/dist/proto/cosmos/orm/v1/index.d.ts.map +1 -1
  441. package/dist/proto/cosmos/orm/v1/index.js.map +1 -1
  442. package/dist/proto/cosmos/orm/v1alpha1/index.d.ts.map +1 -1
  443. package/dist/proto/cosmos/orm/v1alpha1/index.js.map +1 -1
  444. package/dist/proto/cosmos/orm/v1alpha1/schema_pb.js +1 -1
  445. package/dist/proto/cosmos/orm/v1alpha1/schema_pb.js.map +1 -1
  446. package/dist/proto/cosmos/params/index.d.ts.map +1 -1
  447. package/dist/proto/cosmos/params/index.js.map +1 -1
  448. package/dist/proto/cosmos/params/module/index.d.ts.map +1 -1
  449. package/dist/proto/cosmos/params/module/index.js.map +1 -1
  450. package/dist/proto/cosmos/params/module/v1/index.d.ts.map +1 -1
  451. package/dist/proto/cosmos/params/module/v1/index.js.map +1 -1
  452. package/dist/proto/cosmos/params/v1beta1/index.d.ts.map +1 -1
  453. package/dist/proto/cosmos/params/v1beta1/index.js.map +1 -1
  454. package/dist/proto/cosmos/reflection/index.d.ts.map +1 -1
  455. package/dist/proto/cosmos/reflection/index.js.map +1 -1
  456. package/dist/proto/cosmos/reflection/v1/index.d.ts.map +1 -1
  457. package/dist/proto/cosmos/reflection/v1/index.js.map +1 -1
  458. package/dist/proto/cosmos/slashing/index.d.ts.map +1 -1
  459. package/dist/proto/cosmos/slashing/index.js.map +1 -1
  460. package/dist/proto/cosmos/slashing/module/index.d.ts.map +1 -1
  461. package/dist/proto/cosmos/slashing/module/index.js.map +1 -1
  462. package/dist/proto/cosmos/slashing/module/v1/index.d.ts.map +1 -1
  463. package/dist/proto/cosmos/slashing/module/v1/index.js.map +1 -1
  464. package/dist/proto/cosmos/slashing/v1beta1/index.d.ts.map +1 -1
  465. package/dist/proto/cosmos/slashing/v1beta1/index.js.map +1 -1
  466. package/dist/proto/cosmos/staking/index.d.ts.map +1 -1
  467. package/dist/proto/cosmos/staking/index.js.map +1 -1
  468. package/dist/proto/cosmos/staking/module/index.d.ts.map +1 -1
  469. package/dist/proto/cosmos/staking/module/index.js.map +1 -1
  470. package/dist/proto/cosmos/staking/module/v1/index.d.ts.map +1 -1
  471. package/dist/proto/cosmos/staking/module/v1/index.js.map +1 -1
  472. package/dist/proto/cosmos/staking/v1beta1/authz_pb.js +1 -1
  473. package/dist/proto/cosmos/staking/v1beta1/authz_pb.js.map +1 -1
  474. package/dist/proto/cosmos/staking/v1beta1/index.d.ts.map +1 -1
  475. package/dist/proto/cosmos/staking/v1beta1/index.js.map +1 -1
  476. package/dist/proto/cosmos/staking/v1beta1/staking_pb.js +2 -2
  477. package/dist/proto/cosmos/staking/v1beta1/staking_pb.js.map +1 -1
  478. package/dist/proto/cosmos/tx/config/index.d.ts.map +1 -1
  479. package/dist/proto/cosmos/tx/config/index.js.map +1 -1
  480. package/dist/proto/cosmos/tx/index.d.ts.map +1 -1
  481. package/dist/proto/cosmos/tx/index.js.map +1 -1
  482. package/dist/proto/cosmos/tx/signing/index.d.ts.map +1 -1
  483. package/dist/proto/cosmos/tx/signing/index.js.map +1 -1
  484. package/dist/proto/cosmos/tx/signing/v1beta1/index.d.ts.map +1 -1
  485. package/dist/proto/cosmos/tx/signing/v1beta1/index.js.map +1 -1
  486. package/dist/proto/cosmos/tx/signing/v1beta1/signing_pb.js +1 -1
  487. package/dist/proto/cosmos/tx/signing/v1beta1/signing_pb.js.map +1 -1
  488. package/dist/proto/cosmos/tx/v1beta1/index.d.ts.map +1 -1
  489. package/dist/proto/cosmos/tx/v1beta1/index.js.map +1 -1
  490. package/dist/proto/cosmos/tx/v1beta1/service_pb.js +2 -2
  491. package/dist/proto/cosmos/tx/v1beta1/service_pb.js.map +1 -1
  492. package/dist/proto/cosmos/upgrade/index.d.ts.map +1 -1
  493. package/dist/proto/cosmos/upgrade/index.js.map +1 -1
  494. package/dist/proto/cosmos/upgrade/module/index.d.ts.map +1 -1
  495. package/dist/proto/cosmos/upgrade/module/index.js.map +1 -1
  496. package/dist/proto/cosmos/upgrade/module/v1/index.d.ts.map +1 -1
  497. package/dist/proto/cosmos/upgrade/module/v1/index.js.map +1 -1
  498. package/dist/proto/cosmos/upgrade/v1beta1/index.d.ts.map +1 -1
  499. package/dist/proto/cosmos/upgrade/v1beta1/index.js.map +1 -1
  500. package/dist/proto/cosmos/vesting/index.d.ts.map +1 -1
  501. package/dist/proto/cosmos/vesting/index.js.map +1 -1
  502. package/dist/proto/cosmos/vesting/module/index.d.ts.map +1 -1
  503. package/dist/proto/cosmos/vesting/module/index.js.map +1 -1
  504. package/dist/proto/cosmos/vesting/module/v1/index.d.ts.map +1 -1
  505. package/dist/proto/cosmos/vesting/module/v1/index.js.map +1 -1
  506. package/dist/proto/cosmos/vesting/v1beta1/index.d.ts.map +1 -1
  507. package/dist/proto/cosmos/vesting/v1beta1/index.js.map +1 -1
  508. package/dist/proto/cosmos_proto/cosmos_pb.js +1 -1
  509. package/dist/proto/cosmos_proto/cosmos_pb.js.map +1 -1
  510. package/dist/proto/cosmwasm/index.d.ts.map +1 -1
  511. package/dist/proto/cosmwasm/index.js.map +1 -1
  512. package/dist/proto/cosmwasm/wasm/index.d.ts.map +1 -1
  513. package/dist/proto/cosmwasm/wasm/index.js.map +1 -1
  514. package/dist/proto/cosmwasm/wasm/v1/index.d.ts.map +1 -1
  515. package/dist/proto/cosmwasm/wasm/v1/index.js.map +1 -1
  516. package/dist/proto/cosmwasm/wasm/v1/types_pb.js +2 -2
  517. package/dist/proto/cosmwasm/wasm/v1/types_pb.js.map +1 -1
  518. package/dist/proto/ethereum/ethsecp256k1/index.d.ts.map +1 -1
  519. package/dist/proto/ethereum/ethsecp256k1/index.js.map +1 -1
  520. package/dist/proto/ethereum/index.d.ts.map +1 -1
  521. package/dist/proto/ethereum/index.js.map +1 -1
  522. package/dist/proto/google/index.d.ts.map +1 -1
  523. package/dist/proto/google/index.js.map +1 -1
  524. package/dist/proto/google/protobuf/any_pb.js.map +1 -1
  525. package/dist/proto/google/protobuf/descriptor_pb.js +6 -6
  526. package/dist/proto/google/protobuf/descriptor_pb.js.map +1 -1
  527. package/dist/proto/ibc/applications/index.d.ts.map +1 -1
  528. package/dist/proto/ibc/applications/index.js.map +1 -1
  529. package/dist/proto/ibc/applications/interchain_accounts/controller/index.d.ts.map +1 -1
  530. package/dist/proto/ibc/applications/interchain_accounts/controller/index.js.map +1 -1
  531. package/dist/proto/ibc/applications/interchain_accounts/controller/v1/index.d.ts.map +1 -1
  532. package/dist/proto/ibc/applications/interchain_accounts/controller/v1/index.js.map +1 -1
  533. package/dist/proto/ibc/applications/interchain_accounts/host/index.d.ts.map +1 -1
  534. package/dist/proto/ibc/applications/interchain_accounts/host/index.js.map +1 -1
  535. package/dist/proto/ibc/applications/interchain_accounts/host/v1/index.d.ts.map +1 -1
  536. package/dist/proto/ibc/applications/interchain_accounts/host/v1/index.js.map +1 -1
  537. package/dist/proto/ibc/applications/interchain_accounts/index.d.ts.map +1 -1
  538. package/dist/proto/ibc/applications/interchain_accounts/index.js.map +1 -1
  539. package/dist/proto/ibc/applications/interchain_accounts/v1/index.d.ts.map +1 -1
  540. package/dist/proto/ibc/applications/interchain_accounts/v1/index.js.map +1 -1
  541. package/dist/proto/ibc/applications/interchain_accounts/v1/packet_pb.js +1 -1
  542. package/dist/proto/ibc/applications/interchain_accounts/v1/packet_pb.js.map +1 -1
  543. package/dist/proto/ibc/applications/transfer/index.d.ts.map +1 -1
  544. package/dist/proto/ibc/applications/transfer/index.js.map +1 -1
  545. package/dist/proto/ibc/applications/transfer/v1/index.d.ts.map +1 -1
  546. package/dist/proto/ibc/applications/transfer/v1/index.js.map +1 -1
  547. package/dist/proto/ibc/applications/transfer/v2/index.d.ts.map +1 -1
  548. package/dist/proto/ibc/applications/transfer/v2/index.js.map +1 -1
  549. package/dist/proto/ibc/core/channel/index.d.ts.map +1 -1
  550. package/dist/proto/ibc/core/channel/index.js.map +1 -1
  551. package/dist/proto/ibc/core/channel/v1/channel_pb.js +2 -2
  552. package/dist/proto/ibc/core/channel/v1/channel_pb.js.map +1 -1
  553. package/dist/proto/ibc/core/channel/v1/index.d.ts.map +1 -1
  554. package/dist/proto/ibc/core/channel/v1/index.js.map +1 -1
  555. package/dist/proto/ibc/core/client/index.d.ts.map +1 -1
  556. package/dist/proto/ibc/core/client/index.js.map +1 -1
  557. package/dist/proto/ibc/core/client/v1/index.d.ts.map +1 -1
  558. package/dist/proto/ibc/core/client/v1/index.js.map +1 -1
  559. package/dist/proto/ibc/core/commitment/index.d.ts.map +1 -1
  560. package/dist/proto/ibc/core/commitment/index.js.map +1 -1
  561. package/dist/proto/ibc/core/connection/index.d.ts.map +1 -1
  562. package/dist/proto/ibc/core/connection/index.js.map +1 -1
  563. package/dist/proto/ibc/core/connection/v1/connection_pb.js +1 -1
  564. package/dist/proto/ibc/core/connection/v1/connection_pb.js.map +1 -1
  565. package/dist/proto/ibc/core/connection/v1/index.d.ts.map +1 -1
  566. package/dist/proto/ibc/core/connection/v1/index.js.map +1 -1
  567. package/dist/proto/ibc/core/index.d.ts.map +1 -1
  568. package/dist/proto/ibc/core/index.js.map +1 -1
  569. package/dist/proto/ibc/core/types/index.d.ts.map +1 -1
  570. package/dist/proto/ibc/core/types/index.js.map +1 -1
  571. package/dist/proto/ibc/index.d.ts.map +1 -1
  572. package/dist/proto/ibc/index.js.map +1 -1
  573. package/dist/proto/ibc/lightclients/index.d.ts.map +1 -1
  574. package/dist/proto/ibc/lightclients/index.js.map +1 -1
  575. package/dist/proto/ibc/lightclients/localhost/index.d.ts.map +1 -1
  576. package/dist/proto/ibc/lightclients/localhost/index.js.map +1 -1
  577. package/dist/proto/ibc/lightclients/localhost/v1/index.d.ts.map +1 -1
  578. package/dist/proto/ibc/lightclients/localhost/v1/index.js.map +1 -1
  579. package/dist/proto/ibc/lightclients/solomachine/index.d.ts.map +1 -1
  580. package/dist/proto/ibc/lightclients/solomachine/index.js.map +1 -1
  581. package/dist/proto/ibc/lightclients/solomachine/v1/index.d.ts.map +1 -1
  582. package/dist/proto/ibc/lightclients/solomachine/v1/index.js.map +1 -1
  583. package/dist/proto/ibc/lightclients/solomachine/v1/solomachine_pb.js +1 -1
  584. package/dist/proto/ibc/lightclients/solomachine/v1/solomachine_pb.js.map +1 -1
  585. package/dist/proto/ibc/lightclients/solomachine/v2/index.d.ts.map +1 -1
  586. package/dist/proto/ibc/lightclients/solomachine/v2/index.js.map +1 -1
  587. package/dist/proto/ibc/lightclients/solomachine/v2/solomachine_pb.js +1 -1
  588. package/dist/proto/ibc/lightclients/solomachine/v2/solomachine_pb.js.map +1 -1
  589. package/dist/proto/ibc/lightclients/tendermint/index.d.ts.map +1 -1
  590. package/dist/proto/ibc/lightclients/tendermint/index.js.map +1 -1
  591. package/dist/proto/ibc/lightclients/tendermint/v1/index.d.ts.map +1 -1
  592. package/dist/proto/ibc/lightclients/tendermint/v1/index.js.map +1 -1
  593. package/dist/proto/proofs_pb.js +2 -2
  594. package/dist/proto/proofs_pb.js.map +1 -1
  595. package/dist/proto/protocols/index.d.ts.map +1 -1
  596. package/dist/proto/protocols/index.js.map +1 -1
  597. package/dist/proto/solana/index.d.ts.map +1 -1
  598. package/dist/proto/solana/index.js.map +1 -1
  599. package/dist/proto/tendermint/abci/index.d.ts.map +1 -1
  600. package/dist/proto/tendermint/abci/index.js.map +1 -1
  601. package/dist/proto/tendermint/abci/types_pb.js +5 -5
  602. package/dist/proto/tendermint/abci/types_pb.js.map +1 -1
  603. package/dist/proto/tendermint/crypto/index.d.ts.map +1 -1
  604. package/dist/proto/tendermint/crypto/index.js.map +1 -1
  605. package/dist/proto/tendermint/index.d.ts.map +1 -1
  606. package/dist/proto/tendermint/index.js.map +1 -1
  607. package/dist/proto/tendermint/libs/bits/index.d.ts.map +1 -1
  608. package/dist/proto/tendermint/libs/bits/index.js.map +1 -1
  609. package/dist/proto/tendermint/p2p/index.d.ts.map +1 -1
  610. package/dist/proto/tendermint/p2p/index.js.map +1 -1
  611. package/dist/proto/tendermint/types/index.d.ts.map +1 -1
  612. package/dist/proto/tendermint/types/index.js.map +1 -1
  613. package/dist/proto/tendermint/types/types_pb.js +2 -2
  614. package/dist/proto/tendermint/types/types_pb.js.map +1 -1
  615. package/dist/proto/tendermint/version/index.d.ts.map +1 -1
  616. package/dist/proto/tendermint/version/index.js.map +1 -1
  617. package/dist/proto/wasmx/index.d.ts.map +1 -1
  618. package/dist/proto/wasmx/index.js.map +1 -1
  619. package/dist/transactions/amino/objectConverter.d.ts.map +1 -0
  620. package/dist/transactions/amino/objectConverter.js.map +1 -0
  621. package/dist/transactions/amino/registry.d.ts +10 -0
  622. package/dist/transactions/amino/registry.d.ts.map +1 -0
  623. package/dist/transactions/amino/registry.js +53 -0
  624. package/dist/transactions/amino/registry.js.map +1 -0
  625. package/dist/transactions/eip712/payload/createDomain.d.ts.map +1 -0
  626. package/dist/transactions/eip712/payload/createDomain.js.map +1 -0
  627. package/dist/{eip712 → transactions/eip712}/payload/createTypedData.d.ts +2 -3
  628. package/dist/transactions/eip712/payload/createTypedData.d.ts.map +1 -0
  629. package/dist/transactions/eip712/payload/createTypedData.js +24 -0
  630. package/dist/transactions/eip712/payload/createTypedData.js.map +1 -0
  631. package/dist/transactions/eip712/payload/createTypes/index.d.ts +2 -0
  632. package/dist/transactions/eip712/payload/createTypes/index.d.ts.map +1 -0
  633. package/dist/{eip712 → transactions/eip712}/payload/createTypes/index.js +2 -2
  634. package/dist/transactions/eip712/payload/createTypes/index.js.map +1 -0
  635. package/dist/{eip712 → transactions/eip712}/payload/createTypes/parseMessage.d.ts +1 -1
  636. package/dist/transactions/eip712/payload/createTypes/parseMessage.d.ts.map +1 -0
  637. package/dist/transactions/eip712/payload/createTypes/parseMessage.js.map +1 -0
  638. package/dist/{eip712 → transactions/eip712}/payload/createTypes/parsePayload.d.ts +1 -1
  639. package/dist/transactions/eip712/payload/createTypes/parsePayload.d.ts.map +1 -0
  640. package/dist/transactions/eip712/payload/createTypes/parsePayload.js.map +1 -0
  641. package/dist/transactions/eip712/payload/eip712Types.d.ts.map +1 -0
  642. package/dist/transactions/eip712/payload/eip712Types.js.map +1 -0
  643. package/dist/transactions/eip712/payload/flattenPayload.d.ts.map +1 -0
  644. package/dist/transactions/eip712/payload/flattenPayload.js.map +1 -0
  645. package/dist/{eip712 → transactions/eip712}/payload/samples/getSampleMsg.d.ts +1 -1
  646. package/dist/transactions/eip712/payload/samples/getSampleMsg.d.ts.map +1 -0
  647. package/dist/transactions/eip712/payload/samples/getSampleMsg.js +478 -0
  648. package/dist/transactions/eip712/payload/samples/getSampleMsg.js.map +1 -0
  649. package/dist/transactions/eip712/payload/types.d.ts.map +1 -0
  650. package/dist/transactions/eip712/payload/types.js.map +1 -0
  651. package/dist/transactions/index.d.ts +2 -0
  652. package/dist/transactions/index.d.ts.map +1 -0
  653. package/dist/transactions/index.js +18 -0
  654. package/dist/transactions/index.js.map +1 -0
  655. package/dist/transactions/messages/base.d.ts +3 -26
  656. package/dist/transactions/messages/base.d.ts.map +1 -1
  657. package/dist/transactions/messages/base.js +36 -27
  658. package/dist/transactions/messages/base.js.map +1 -1
  659. package/dist/transactions/messages/bitbadges/badges/index.d.ts +9 -0
  660. package/dist/transactions/messages/bitbadges/badges/index.d.ts.map +1 -0
  661. package/dist/transactions/messages/bitbadges/badges/index.js +25 -0
  662. package/dist/transactions/messages/bitbadges/badges/index.js.map +1 -0
  663. package/dist/transactions/messages/bitbadges/badges/interfaces.d.ts +62 -0
  664. package/dist/transactions/messages/bitbadges/badges/interfaces.d.ts.map +1 -0
  665. package/dist/transactions/messages/bitbadges/badges/interfaces.js +3 -0
  666. package/dist/transactions/messages/bitbadges/badges/interfaces.js.map +1 -0
  667. package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.d.ts +5 -8
  668. package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.d.ts.map +1 -1
  669. package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.js +7 -7
  670. package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.js.map +1 -1
  671. package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.d.ts +11 -24
  672. package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.d.ts.map +1 -1
  673. package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.js +30 -45
  674. package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.js.map +1 -1
  675. package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.d.ts +6 -8
  676. package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.d.ts.map +1 -1
  677. package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.js +7 -11
  678. package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.js.map +1 -1
  679. package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.d.ts +7 -10
  680. package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.d.ts.map +1 -1
  681. package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.js +10 -15
  682. package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.js.map +1 -1
  683. package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.d.ts +12 -22
  684. package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.d.ts.map +1 -1
  685. package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.js +31 -55
  686. package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.js.map +1 -1
  687. package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.d.ts +11 -11
  688. package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.d.ts.map +1 -1
  689. package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.js +29 -51
  690. package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.js.map +1 -1
  691. package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.d.ts +8 -20
  692. package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.d.ts.map +1 -1
  693. package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.js +17 -24
  694. package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.js.map +1 -1
  695. package/dist/transactions/messages/bitbadges/index.d.ts +4 -0
  696. package/dist/transactions/messages/bitbadges/index.d.ts.map +1 -0
  697. package/dist/transactions/messages/bitbadges/index.js +20 -0
  698. package/dist/transactions/messages/bitbadges/index.js.map +1 -0
  699. package/dist/transactions/messages/bitbadges/protocols/index.d.ts +7 -0
  700. package/dist/transactions/messages/bitbadges/protocols/index.d.ts.map +1 -0
  701. package/dist/transactions/messages/bitbadges/protocols/index.js +23 -0
  702. package/dist/transactions/messages/bitbadges/protocols/index.js.map +1 -0
  703. package/dist/transactions/messages/bitbadges/protocols/interfaces.d.ts +36 -0
  704. package/dist/transactions/messages/bitbadges/protocols/interfaces.d.ts.map +1 -0
  705. package/dist/transactions/messages/bitbadges/protocols/interfaces.js +3 -0
  706. package/dist/transactions/messages/bitbadges/protocols/interfaces.js.map +1 -0
  707. package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.d.ts +5 -10
  708. package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.d.ts.map +1 -1
  709. package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.js +4 -4
  710. package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.js.map +1 -1
  711. package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.d.ts +5 -7
  712. package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.d.ts.map +1 -1
  713. package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.js +4 -4
  714. package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.js.map +1 -1
  715. package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.d.ts +7 -9
  716. package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.d.ts.map +1 -1
  717. package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.js +7 -12
  718. package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.js.map +1 -1
  719. package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.d.ts +5 -7
  720. package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.d.ts.map +1 -1
  721. package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.js +4 -4
  722. package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.js.map +1 -1
  723. package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.d.ts +5 -10
  724. package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.d.ts.map +1 -1
  725. package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.js +4 -4
  726. package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.js.map +1 -1
  727. package/dist/transactions/messages/bitbadges/wasmx/index.d.ts +5 -0
  728. package/dist/transactions/messages/bitbadges/wasmx/index.d.ts.map +1 -0
  729. package/dist/transactions/messages/bitbadges/wasmx/index.js +21 -0
  730. package/dist/transactions/messages/bitbadges/wasmx/index.js.map +1 -0
  731. package/dist/transactions/messages/bitbadges/wasmx/interfaces.d.ts +17 -0
  732. package/dist/transactions/messages/bitbadges/wasmx/interfaces.d.ts.map +1 -0
  733. package/dist/transactions/messages/bitbadges/wasmx/interfaces.js +3 -0
  734. package/dist/transactions/messages/bitbadges/wasmx/interfaces.js.map +1 -0
  735. package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.d.ts +5 -9
  736. package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.d.ts.map +1 -1
  737. package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.js +4 -4
  738. package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.js.map +1 -1
  739. package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.d.ts +5 -9
  740. package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.d.ts.map +1 -1
  741. package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.js +4 -4
  742. package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.js.map +1 -1
  743. package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.d.ts +5 -11
  744. package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.d.ts.map +1 -1
  745. package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.js +4 -4
  746. package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.js.map +1 -1
  747. package/dist/transactions/messages/common.d.ts +1 -1
  748. package/dist/transactions/messages/common.d.ts.map +1 -1
  749. package/dist/transactions/messages/index.d.ts +4 -0
  750. package/dist/transactions/messages/index.d.ts.map +1 -0
  751. package/dist/transactions/messages/index.js +20 -0
  752. package/dist/transactions/messages/index.js.map +1 -0
  753. package/dist/transactions/messages/transaction.d.ts +1 -1
  754. package/dist/transactions/messages/transaction.d.ts.map +1 -1
  755. package/dist/transactions/messages/transaction.js +5 -5
  756. package/dist/transactions/messages/transaction.js.map +1 -1
  757. package/dist/transactions/messages/txRaw.d.ts +11 -3
  758. package/dist/transactions/messages/txRaw.d.ts.map +1 -1
  759. package/dist/transactions/messages/txRaw.js +30 -4
  760. package/dist/transactions/messages/txRaw.js.map +1 -1
  761. package/dist/transactions/messages/utils.d.ts.map +1 -0
  762. package/dist/transactions/messages/utils.js.map +1 -0
  763. package/dist/transactions/messages/web3Extension.d.ts +18 -3
  764. package/dist/transactions/messages/web3Extension.d.ts.map +1 -1
  765. package/dist/transactions/messages/web3Extension.js +69 -5
  766. package/dist/transactions/messages/web3Extension.js.map +1 -1
  767. package/dist/tsconfig.build.tsbuildinfo +1 -1
  768. package/package.json +3 -4
  769. package/dist/amino/objectConverter.d.ts.map +0 -1
  770. package/dist/amino/objectConverter.js.map +0 -1
  771. package/dist/amino/registry.d.ts +0 -6
  772. package/dist/amino/registry.d.ts.map +0 -1
  773. package/dist/amino/registry.js +0 -18
  774. package/dist/amino/registry.js.map +0 -1
  775. package/dist/eip712/payload/createDomain.d.ts.map +0 -1
  776. package/dist/eip712/payload/createDomain.js.map +0 -1
  777. package/dist/eip712/payload/createTypedData.d.ts.map +0 -1
  778. package/dist/eip712/payload/createTypedData.js +0 -24
  779. package/dist/eip712/payload/createTypedData.js.map +0 -1
  780. package/dist/eip712/payload/createTypes/index.d.ts +0 -2
  781. package/dist/eip712/payload/createTypes/index.d.ts.map +0 -1
  782. package/dist/eip712/payload/createTypes/index.js.map +0 -1
  783. package/dist/eip712/payload/createTypes/parseMessage.d.ts.map +0 -1
  784. package/dist/eip712/payload/createTypes/parseMessage.js.map +0 -1
  785. package/dist/eip712/payload/createTypes/parsePayload.d.ts.map +0 -1
  786. package/dist/eip712/payload/createTypes/parsePayload.js.map +0 -1
  787. package/dist/eip712/payload/eip712Types.d.ts.map +0 -1
  788. package/dist/eip712/payload/eip712Types.js.map +0 -1
  789. package/dist/eip712/payload/flattenPayload.d.ts.map +0 -1
  790. package/dist/eip712/payload/flattenPayload.js.map +0 -1
  791. package/dist/eip712/payload/index.d.ts +0 -2
  792. package/dist/eip712/payload/index.d.ts.map +0 -1
  793. package/dist/eip712/payload/index.js +0 -9
  794. package/dist/eip712/payload/index.js.map +0 -1
  795. package/dist/eip712/payload/samples/getSampleMsg.d.ts.map +0 -1
  796. package/dist/eip712/payload/samples/getSampleMsg.js +0 -484
  797. package/dist/eip712/payload/samples/getSampleMsg.js.map +0 -1
  798. package/dist/eip712/payload/types.d.ts.map +0 -1
  799. package/dist/eip712/payload/types.js.map +0 -1
  800. package/dist/transactions/messages/msgSend.d.ts +0 -9
  801. package/dist/transactions/messages/msgSend.d.ts.map +0 -1
  802. package/dist/transactions/messages/msgSend.js +0 -20
  803. package/dist/transactions/messages/msgSend.js.map +0 -1
  804. package/dist/types/badges/addressLists.d.ts +0 -39
  805. package/dist/types/badges/addressLists.d.ts.map +0 -1
  806. package/dist/types/badges/addressLists.js.map +0 -1
  807. package/dist/types/badges/aminoRegistry.d.ts +0 -3
  808. package/dist/types/badges/aminoRegistry.d.ts.map +0 -1
  809. package/dist/types/badges/aminoRegistry.js +0 -18
  810. package/dist/types/badges/aminoRegistry.js.map +0 -1
  811. package/dist/types/badges/approvals.d.ts.map +0 -1
  812. package/dist/types/badges/approvals.js +0 -725
  813. package/dist/types/badges/approvals.js.map +0 -1
  814. package/dist/types/badges/permissions.d.ts +0 -365
  815. package/dist/types/badges/permissions.d.ts.map +0 -1
  816. package/dist/types/badges/permissions.js +0 -2030
  817. package/dist/types/badges/permissions.js.map +0 -1
  818. package/dist/types/badges/typeUtils.d.ts +0 -412
  819. package/dist/types/badges/typeUtils.d.ts.map +0 -1
  820. package/dist/types/badges/typeUtils.js +0 -1330
  821. package/dist/types/badges/typeUtils.js.map +0 -1
  822. package/dist/types/badges/userBalances.d.ts +0 -79
  823. package/dist/types/badges/userBalances.d.ts.map +0 -1
  824. package/dist/types/badges/userBalances.js +0 -154
  825. package/dist/types/badges/userBalances.js.map +0 -1
  826. package/dist/types/base.d.ts +0 -61
  827. package/dist/types/base.d.ts.map +0 -1
  828. package/dist/types/base.js.map +0 -1
  829. package/dist/types/math.d.ts.map +0 -1
  830. package/dist/types/math.js.map +0 -1
  831. package/dist/types/protocols/aminoRegistry.d.ts +0 -3
  832. package/dist/types/protocols/aminoRegistry.d.ts.map +0 -1
  833. package/dist/types/protocols/aminoRegistry.js +0 -16
  834. package/dist/types/protocols/aminoRegistry.js.map +0 -1
  835. package/dist/types/protocols/types.d.ts +0 -50
  836. package/dist/types/protocols/types.d.ts.map +0 -1
  837. package/dist/types/protocols/types.js.map +0 -1
  838. package/dist/types/string-numbers.d.ts.map +0 -1
  839. package/dist/types/string-numbers.js.map +0 -1
  840. package/dist/types/txRaw.d.ts +0 -9
  841. package/dist/types/txRaw.d.ts.map +0 -1
  842. package/dist/types/txRaw.js +0 -29
  843. package/dist/types/txRaw.js.map +0 -1
  844. package/dist/types/types.d.ts.map +0 -1
  845. package/dist/types/types.js.map +0 -1
  846. package/dist/types/utils.d.ts.map +0 -1
  847. package/dist/types/utils.js.map +0 -1
  848. package/dist/types/wasmx/aminoRegistry.d.ts +0 -3
  849. package/dist/types/wasmx/aminoRegistry.d.ts.map +0 -1
  850. package/dist/types/wasmx/aminoRegistry.js +0 -18
  851. package/dist/types/wasmx/aminoRegistry.js.map +0 -1
  852. package/dist/types/web3Extension.d.ts +0 -16
  853. package/dist/types/web3Extension.d.ts.map +0 -1
  854. package/dist/types/web3Extension.js +0 -69
  855. package/dist/types/web3Extension.js.map +0 -1
  856. package/dist/utils/aliases.d.ts.map +0 -1
  857. package/dist/utils/aliases.js.map +0 -1
  858. package/dist/utils/api/BitBadgesAddressList.d.ts.map +0 -1
  859. package/dist/utils/api/BitBadgesAddressList.js.map +0 -1
  860. package/dist/utils/api/BitBadgesApi.d.ts.map +0 -1
  861. package/dist/utils/api/BitBadgesApi.js.map +0 -1
  862. package/dist/utils/api/BitBadgesCollection.d.ts +0 -314
  863. package/dist/utils/api/BitBadgesCollection.d.ts.map +0 -1
  864. package/dist/utils/api/BitBadgesCollection.js.map +0 -1
  865. package/dist/utils/api/BitBadgesUserInfo.d.ts.map +0 -1
  866. package/dist/utils/api/BitBadgesUserInfo.js.map +0 -1
  867. package/dist/utils/approved_transfers_casts.d.ts +0 -9
  868. package/dist/utils/approved_transfers_casts.d.ts.map +0 -1
  869. package/dist/utils/approved_transfers_casts.js +0 -134
  870. package/dist/utils/approved_transfers_casts.js.map +0 -1
  871. package/dist/utils/badgeMetadata.d.ts.map +0 -1
  872. package/dist/utils/badgeMetadata.js.map +0 -1
  873. package/dist/utils/balances.d.ts +0 -22
  874. package/dist/utils/balances.d.ts.map +0 -1
  875. package/dist/utils/balances.js +0 -362
  876. package/dist/utils/balances.js.map +0 -1
  877. package/dist/utils/batch-utils.d.ts +0 -19
  878. package/dist/utils/batch-utils.d.ts.map +0 -1
  879. package/dist/utils/batch-utils.js +0 -73
  880. package/dist/utils/batch-utils.js.map +0 -1
  881. package/dist/utils/chains.d.ts.map +0 -1
  882. package/dist/utils/chains.js.map +0 -1
  883. package/dist/utils/constants.d.ts +0 -17
  884. package/dist/utils/constants.d.ts.map +0 -1
  885. package/dist/utils/constants.js.map +0 -1
  886. package/dist/utils/converter.d.ts.map +0 -1
  887. package/dist/utils/converter.js.map +0 -1
  888. package/dist/utils/display.d.ts +0 -6
  889. package/dist/utils/display.d.ts.map +0 -1
  890. package/dist/utils/display.js +0 -76
  891. package/dist/utils/display.js.map +0 -1
  892. package/dist/utils/distribution.d.ts +0 -10
  893. package/dist/utils/distribution.d.ts.map +0 -1
  894. package/dist/utils/distribution.js +0 -179
  895. package/dist/utils/distribution.js.map +0 -1
  896. package/dist/utils/firstMatches.d.ts.map +0 -1
  897. package/dist/utils/firstMatches.js.map +0 -1
  898. package/dist/utils/index.d.ts +0 -45
  899. package/dist/utils/index.d.ts.map +0 -1
  900. package/dist/utils/index.js +0 -59
  901. package/dist/utils/index.js.map +0 -1
  902. package/dist/utils/metadataIds.d.ts.map +0 -1
  903. package/dist/utils/metadataIds.js.map +0 -1
  904. package/dist/utils/node-rest-api/account.d.ts.map +0 -1
  905. package/dist/utils/node-rest-api/account.js.map +0 -1
  906. package/dist/utils/node-rest-api/balances.d.ts.map +0 -1
  907. package/dist/utils/node-rest-api/balances.js.map +0 -1
  908. package/dist/utils/node-rest-api/broadcast.d.ts.map +0 -1
  909. package/dist/utils/node-rest-api/broadcast.js.map +0 -1
  910. package/dist/utils/node-rest-api/coin.d.ts +0 -5
  911. package/dist/utils/node-rest-api/coin.d.ts.map +0 -1
  912. package/dist/utils/node-rest-api/coin.js.map +0 -1
  913. package/dist/utils/node-rest-api/gov.d.ts.map +0 -1
  914. package/dist/utils/node-rest-api/gov.js.map +0 -1
  915. package/dist/utils/node-rest-api/ibc.d.ts.map +0 -1
  916. package/dist/utils/node-rest-api/ibc.js.map +0 -1
  917. package/dist/utils/node-rest-api/staking.d.ts.map +0 -1
  918. package/dist/utils/node-rest-api/staking.js.map +0 -1
  919. package/dist/utils/overlaps.d.ts.map +0 -1
  920. package/dist/utils/overlaps.js.map +0 -1
  921. package/dist/utils/types/activity.d.ts +0 -88
  922. package/dist/utils/types/activity.d.ts.map +0 -1
  923. package/dist/utils/types/activity.js.map +0 -1
  924. package/dist/utils/types/api.d.ts.map +0 -1
  925. package/dist/utils/types/api.js.map +0 -1
  926. package/dist/utils/types/coin.d.ts.map +0 -1
  927. package/dist/utils/types/coin.js.map +0 -1
  928. package/dist/utils/types/collections.d.ts +0 -115
  929. package/dist/utils/types/collections.d.ts.map +0 -1
  930. package/dist/utils/types/collections.js +0 -279
  931. package/dist/utils/types/collections.js.map +0 -1
  932. package/dist/utils/types/db.d.ts +0 -680
  933. package/dist/utils/types/db.d.ts.map +0 -1
  934. package/dist/utils/types/db.js.map +0 -1
  935. package/dist/utils/types/indexer.d.ts.map +0 -1
  936. package/dist/utils/types/indexer.js.map +0 -1
  937. package/dist/utils/types/metadata.d.ts.map +0 -1
  938. package/dist/utils/types/metadata.js +0 -73
  939. package/dist/utils/types/metadata.js.map +0 -1
  940. package/dist/utils/types/routes.d.ts.map +0 -1
  941. package/dist/utils/types/routes.js.map +0 -1
  942. package/dist/utils/types/schemas.d.ts.map +0 -1
  943. package/dist/utils/types/schemas.js.map +0 -1
  944. package/dist/utils/types/transfers.d.ts +0 -23
  945. package/dist/utils/types/transfers.d.ts.map +0 -1
  946. package/dist/utils/types/transfers.js +0 -35
  947. package/dist/utils/types/transfers.js.map +0 -1
  948. package/dist/utils/userApprovals.d.ts +0 -6
  949. package/dist/utils/userApprovals.d.ts.map +0 -1
  950. package/dist/utils/userApprovals.js +0 -81
  951. package/dist/utils/userApprovals.js.map +0 -1
  952. /package/dist/{utils/types → api-indexer/indexer}/indexer.js +0 -0
  953. /package/dist/{utils/types → api-indexer/indexer}/schemas.js +0 -0
  954. /package/dist/{utils/types → api-indexer/requests}/routes.js +0 -0
  955. /package/dist/{types → common}/types.d.ts +0 -0
  956. /package/dist/{utils/node-rest-api → node-rest-api}/account.d.ts +0 -0
  957. /package/dist/{utils/node-rest-api → node-rest-api}/account.js +0 -0
  958. /package/dist/{utils/node-rest-api → node-rest-api}/balances.js +0 -0
  959. /package/dist/{utils/node-rest-api → node-rest-api}/broadcast.d.ts +0 -0
  960. /package/dist/{utils/node-rest-api → node-rest-api}/ibc.d.ts +0 -0
  961. /package/dist/{utils/node-rest-api → node-rest-api}/ibc.js +0 -0
  962. /package/dist/{utils/node-rest-api → node-rest-api}/staking.js +0 -0
  963. /package/dist/{amino → transactions/amino}/objectConverter.d.ts +0 -0
  964. /package/dist/{amino → transactions/amino}/objectConverter.js +0 -0
  965. /package/dist/{eip712 → transactions/eip712}/payload/createDomain.d.ts +0 -0
  966. /package/dist/{eip712 → transactions/eip712}/payload/createDomain.js +0 -0
  967. /package/dist/{eip712 → transactions/eip712}/payload/createTypes/parseMessage.js +0 -0
  968. /package/dist/{eip712 → transactions/eip712}/payload/createTypes/parsePayload.js +0 -0
  969. /package/dist/{eip712 → transactions/eip712}/payload/eip712Types.d.ts +0 -0
  970. /package/dist/{eip712 → transactions/eip712}/payload/eip712Types.js +0 -0
  971. /package/dist/{eip712 → transactions/eip712}/payload/flattenPayload.d.ts +0 -0
  972. /package/dist/{eip712 → transactions/eip712}/payload/flattenPayload.js +0 -0
  973. /package/dist/{eip712 → transactions/eip712}/payload/types.d.ts +0 -0
  974. /package/dist/{eip712 → transactions/eip712}/payload/types.js +0 -0
  975. /package/dist/{types → transactions/messages}/utils.d.ts +0 -0
  976. /package/dist/{types → transactions/messages}/utils.js +0 -0
@@ -1,2030 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validatePermissionsUpdate = exports.validateActionPermissionUpdate = exports.validateCollectionApprovalPermissionsUpdate = exports.validateTimedUpdateWithBadgeIdsPermissionUpdate = exports.validateTimedUpdatePermissionUpdate = exports.validateBalancesActionPermissionUpdate = exports.checkNotForbiddenForAllOverlaps = exports.checkIfUserIncomingApprovalPermissionPermits = exports.checkIfUserOutgoingApprovalPermissionPermits = exports.checkIfCollectionApprovalPermissionPermits = exports.checkIfTimedUpdateWithBadgeIdsPermissionPermits = exports.checkIfBalancesActionPermissionPermits = exports.checkIfTimedUpdatePermissionPermits = exports.checkIfActionPermissionPermits = exports.getUpdateCombinationsToCheck = exports.validateIsArchivedUpdate = exports.validateStandardsUpdate = exports.validateCustomDataUpdate = exports.validateManagerUpdate = exports.getUpdatedBoolCombinations = exports.getUpdatedStringCombinations = exports.validateOffChainBalancesMetadataUpdate = exports.validateCollectionMetadataUpdate = exports.validateBadgeMetadataUpdate = exports.validateCollectionApprovalsUpdate = exports.getPotentialUpdatesForTimelineValues = exports.castUserOutgoingApprovalPermissionToCollectionApprovalPermission = exports.castUserIncomingApprovalPermissionToCollectionApprovalPermission = exports.UserPermissionsWithDetails = exports.CollectionPermissionsWithDetails = exports.UserOutgoingApprovalPermissionWithDetails = exports.UserIncomingApprovalPermissionWithDetails = exports.CollectionApprovalPermissionWithDetails = exports.castBadgeMetadataToUniversalPermission = exports.castBalancesActionPermissionToUniversalPermission = exports.castTimedUpdatePermissionToUniversalPermission = exports.castTimedUpdateWithBadgeIdsPermissionToUniversalPermission = exports.castCollectionApprovalPermissionToUniversalPermission = exports.castActionPermissionToUniversalPermission = exports.isCurrentTimeForbidden = exports.CollectionApprovalPermission = exports.TimedUpdateWithBadgeIdsPermission = exports.BalancesActionPermission = exports.TimedUpdatePermission = exports.ActionPermission = exports.CollectionPermissions = exports.getPermissionVariablesFromName = exports.UserIncomingApprovalPermission = exports.UserOutgoingApprovalPermission = exports.UserPermissions = void 0;
4
- exports.validateUniversalPermissionUpdate = void 0;
5
- const proto_1 = require("../../proto");
6
- const utils_1 = require("../../utils");
7
- const overlaps_1 = require("../../utils/overlaps");
8
- const collections_1 = require("../../utils/types/collections");
9
- const base_1 = require("../base");
10
- const string_numbers_1 = require("../string-numbers");
11
- const typeUtils_1 = require("./typeUtils");
12
- const { removeUintRangesFromUintRanges } = typeUtils_1.UintRange;
13
- class UserPermissions extends base_1.BaseNumberTypeClass {
14
- canUpdateOutgoingApprovals;
15
- canUpdateIncomingApprovals;
16
- canUpdateAutoApproveSelfInitiatedOutgoingTransfers;
17
- canUpdateAutoApproveSelfInitiatedIncomingTransfers;
18
- constructor(msg) {
19
- super();
20
- this.canUpdateOutgoingApprovals = msg.canUpdateOutgoingApprovals.map(x => new UserOutgoingApprovalPermission(x));
21
- this.canUpdateIncomingApprovals = msg.canUpdateIncomingApprovals.map(x => new UserIncomingApprovalPermission(x));
22
- this.canUpdateAutoApproveSelfInitiatedOutgoingTransfers = msg.canUpdateAutoApproveSelfInitiatedOutgoingTransfers.map(x => new ActionPermission(x));
23
- this.canUpdateAutoApproveSelfInitiatedIncomingTransfers = msg.canUpdateAutoApproveSelfInitiatedIncomingTransfers.map(x => new ActionPermission(x));
24
- }
25
- static required() {
26
- return new UserPermissions({
27
- canUpdateOutgoingApprovals: [],
28
- canUpdateIncomingApprovals: [],
29
- canUpdateAutoApproveSelfInitiatedOutgoingTransfers: [],
30
- canUpdateAutoApproveSelfInitiatedIncomingTransfers: []
31
- });
32
- }
33
- convert(convertFunction) {
34
- return new UserPermissions((0, base_1.deepCopy)({
35
- canUpdateOutgoingApprovals: this.canUpdateOutgoingApprovals.map((x) => x.convert(convertFunction)),
36
- canUpdateIncomingApprovals: this.canUpdateIncomingApprovals.map((x) => x.convert(convertFunction)),
37
- canUpdateAutoApproveSelfInitiatedOutgoingTransfers: this.canUpdateAutoApproveSelfInitiatedOutgoingTransfers.map((x) => x.convert(convertFunction)),
38
- canUpdateAutoApproveSelfInitiatedIncomingTransfers: this.canUpdateAutoApproveSelfInitiatedIncomingTransfers.map((x) => x.convert(convertFunction))
39
- }));
40
- }
41
- toProto() {
42
- return new proto_1.badges.UserPermissions(this.convert(string_numbers_1.Stringify));
43
- }
44
- static fromJson(jsonValue, convertFunction, options) {
45
- return UserPermissions.convertFromProto(proto_1.badges.UserPermissions.fromJson(jsonValue, options), convertFunction);
46
- }
47
- static fromJsonString(jsonString, convertFunction, options) {
48
- return UserPermissions.convertFromProto(proto_1.badges.UserPermissions.fromJsonString(jsonString, options), convertFunction);
49
- }
50
- static convertFromProto(protoMsg, convertFunction) {
51
- return new UserPermissions({
52
- canUpdateOutgoingApprovals: protoMsg.canUpdateOutgoingApprovals.map(x => UserOutgoingApprovalPermission.convertFromProto(x, convertFunction)),
53
- canUpdateIncomingApprovals: protoMsg.canUpdateIncomingApprovals.map(x => UserIncomingApprovalPermission.convertFromProto(x, convertFunction)),
54
- canUpdateAutoApproveSelfInitiatedOutgoingTransfers: protoMsg.canUpdateAutoApproveSelfInitiatedOutgoingTransfers.map(x => ActionPermission.convertFromProto(x, convertFunction)),
55
- canUpdateAutoApproveSelfInitiatedIncomingTransfers: protoMsg.canUpdateAutoApproveSelfInitiatedIncomingTransfers.map(x => ActionPermission.convertFromProto(x, convertFunction))
56
- });
57
- }
58
- }
59
- exports.UserPermissions = UserPermissions;
60
- class UserOutgoingApprovalPermission extends base_1.BaseNumberTypeClass {
61
- toListId;
62
- initiatedByListId;
63
- transferTimes;
64
- badgeIds;
65
- ownershipTimes;
66
- approvalId;
67
- amountTrackerId;
68
- challengeTrackerId;
69
- permanentlyPermittedTimes;
70
- permanentlyForbiddenTimes;
71
- constructor(msg) {
72
- super();
73
- this.toListId = msg.toListId;
74
- this.initiatedByListId = msg.initiatedByListId;
75
- this.transferTimes = msg.transferTimes.map(x => new typeUtils_1.UintRange(x));
76
- this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
77
- this.ownershipTimes = msg.ownershipTimes.map(x => new typeUtils_1.UintRange(x));
78
- this.approvalId = msg.approvalId;
79
- this.amountTrackerId = msg.amountTrackerId;
80
- this.challengeTrackerId = msg.challengeTrackerId;
81
- this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
82
- this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
83
- }
84
- static required() {
85
- return new UserOutgoingApprovalPermission({
86
- toListId: '',
87
- initiatedByListId: '',
88
- transferTimes: [],
89
- badgeIds: [],
90
- ownershipTimes: [],
91
- approvalId: '',
92
- amountTrackerId: '',
93
- challengeTrackerId: '',
94
- permanentlyPermittedTimes: [],
95
- permanentlyForbiddenTimes: []
96
- });
97
- }
98
- convert(convertFunction) {
99
- return new UserOutgoingApprovalPermission((0, base_1.deepCopy)({
100
- toListId: this.toListId,
101
- initiatedByListId: this.initiatedByListId,
102
- transferTimes: this.transferTimes.map((x) => x.convert(convertFunction)),
103
- badgeIds: this.badgeIds.map((x) => x.convert(convertFunction)),
104
- ownershipTimes: this.ownershipTimes.map((x) => x.convert(convertFunction)),
105
- approvalId: this.approvalId,
106
- amountTrackerId: this.amountTrackerId,
107
- challengeTrackerId: this.challengeTrackerId,
108
- permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
109
- permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
110
- }));
111
- }
112
- toProto() {
113
- return new proto_1.badges.UserOutgoingApprovalPermission(this.convert(string_numbers_1.Stringify));
114
- }
115
- static fromJson(jsonValue, convertFunction, options) {
116
- return UserOutgoingApprovalPermission.convertFromProto(proto_1.badges.UserOutgoingApprovalPermission.fromJson(jsonValue, options), convertFunction);
117
- }
118
- static fromJsonString(jsonString, convertFunction, options) {
119
- return UserOutgoingApprovalPermission.convertFromProto(proto_1.badges.UserOutgoingApprovalPermission.fromJsonString(jsonString, options), convertFunction);
120
- }
121
- static convertFromProto(protoMsg, convertFunction) {
122
- return new UserOutgoingApprovalPermission({
123
- toListId: protoMsg.toListId,
124
- initiatedByListId: protoMsg.initiatedByListId,
125
- transferTimes: protoMsg.transferTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
126
- badgeIds: protoMsg.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
127
- ownershipTimes: protoMsg.ownershipTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
128
- approvalId: protoMsg.approvalId,
129
- amountTrackerId: protoMsg.amountTrackerId,
130
- challengeTrackerId: protoMsg.challengeTrackerId,
131
- permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
132
- permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
133
- });
134
- }
135
- }
136
- exports.UserOutgoingApprovalPermission = UserOutgoingApprovalPermission;
137
- class UserIncomingApprovalPermission extends base_1.BaseNumberTypeClass {
138
- fromListId;
139
- initiatedByListId;
140
- transferTimes;
141
- badgeIds;
142
- ownershipTimes;
143
- approvalId;
144
- amountTrackerId;
145
- challengeTrackerId;
146
- permanentlyPermittedTimes;
147
- permanentlyForbiddenTimes;
148
- constructor(msg) {
149
- super();
150
- this.fromListId = msg.fromListId;
151
- this.initiatedByListId = msg.initiatedByListId;
152
- this.approvalId = msg.approvalId;
153
- this.amountTrackerId = msg.amountTrackerId;
154
- this.challengeTrackerId = msg.challengeTrackerId;
155
- this.transferTimes = msg.transferTimes.map(x => new typeUtils_1.UintRange(x));
156
- this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
157
- this.ownershipTimes = msg.ownershipTimes.map(x => new typeUtils_1.UintRange(x));
158
- this.approvalId = msg.approvalId;
159
- this.amountTrackerId = msg.amountTrackerId;
160
- this.challengeTrackerId = msg.challengeTrackerId;
161
- this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
162
- this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
163
- }
164
- static required() {
165
- return new UserIncomingApprovalPermission({
166
- fromListId: '',
167
- initiatedByListId: '',
168
- transferTimes: [],
169
- badgeIds: [],
170
- ownershipTimes: [],
171
- approvalId: '',
172
- amountTrackerId: '',
173
- challengeTrackerId: '',
174
- permanentlyPermittedTimes: [],
175
- permanentlyForbiddenTimes: []
176
- });
177
- }
178
- convert(convertFunction) {
179
- return new UserIncomingApprovalPermission((0, base_1.deepCopy)({
180
- fromListId: this.fromListId,
181
- initiatedByListId: this.initiatedByListId,
182
- transferTimes: this.transferTimes.map((x) => x.convert(convertFunction)),
183
- badgeIds: this.badgeIds.map((x) => x.convert(convertFunction)),
184
- ownershipTimes: this.ownershipTimes.map((x) => x.convert(convertFunction)),
185
- approvalId: this.approvalId,
186
- amountTrackerId: this.amountTrackerId,
187
- challengeTrackerId: this.challengeTrackerId,
188
- permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
189
- permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
190
- }));
191
- }
192
- toProto() {
193
- return new proto_1.badges.UserIncomingApprovalPermission(this.convert(string_numbers_1.Stringify));
194
- }
195
- static fromJson(jsonValue, convertFunction, options) {
196
- return UserIncomingApprovalPermission.convertFromProto(proto_1.badges.UserIncomingApprovalPermission.fromJson(jsonValue, options), convertFunction);
197
- }
198
- static fromJsonString(jsonString, convertFunction, options) {
199
- return UserIncomingApprovalPermission.convertFromProto(proto_1.badges.UserIncomingApprovalPermission.fromJsonString(jsonString, options), convertFunction);
200
- }
201
- static convertFromProto(protoMsg, convertFunction) {
202
- return new UserIncomingApprovalPermission({
203
- fromListId: protoMsg.fromListId,
204
- initiatedByListId: protoMsg.initiatedByListId,
205
- transferTimes: protoMsg.transferTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
206
- badgeIds: protoMsg.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
207
- ownershipTimes: protoMsg.ownershipTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
208
- approvalId: protoMsg.approvalId,
209
- amountTrackerId: protoMsg.amountTrackerId,
210
- challengeTrackerId: protoMsg.challengeTrackerId,
211
- permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
212
- permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
213
- });
214
- }
215
- }
216
- exports.UserIncomingApprovalPermission = UserIncomingApprovalPermission;
217
- const getPermissionVariablesFromName = (permissionName) => {
218
- let castFunction = () => { return []; };
219
- let flags = overlaps_1.ApprovalPermissionUsedFlags;
220
- let validateFunction = undefined;
221
- let validatePermissionUpdateFunction = undefined;
222
- switch (permissionName) {
223
- case 'canArchiveCollection':
224
- validateFunction = validateIsArchivedUpdate;
225
- break;
226
- case 'canUpdateOffChainBalancesMetadata':
227
- validateFunction = validateOffChainBalancesMetadataUpdate;
228
- break;
229
- case 'canUpdateManager':
230
- validateFunction = validateManagerUpdate;
231
- break;
232
- case 'canUpdateCollectionMetadata':
233
- validateFunction = validateCollectionMetadataUpdate;
234
- break;
235
- case 'canUpdateBadgeMetadata':
236
- validateFunction = validateBadgeMetadataUpdate;
237
- break;
238
- case 'canUpdateCollectionApprovals':
239
- validateFunction = validateCollectionApprovalsUpdate;
240
- break;
241
- }
242
- switch (permissionName) {
243
- case 'canDeleteCollection':
244
- case 'canUpdateAutoApproveSelfInitiatedOutgoingTransfers':
245
- case 'canUpdateAutoApproveSelfInitiatedIncomingTransfers':
246
- validatePermissionUpdateFunction = validateActionPermissionUpdate;
247
- break;
248
- case 'canArchiveCollection':
249
- case 'canUpdateOffChainBalancesMetadata':
250
- case 'canUpdateStandards':
251
- case 'canUpdateCustomData':
252
- case 'canUpdateManager':
253
- case 'canUpdateCollectionMetadata':
254
- validatePermissionUpdateFunction = validateTimedUpdatePermissionUpdate;
255
- break;
256
- case 'canCreateMoreBadges':
257
- validatePermissionUpdateFunction = validateBalancesActionPermissionUpdate;
258
- break;
259
- case 'canUpdateBadgeMetadata':
260
- validatePermissionUpdateFunction = validateTimedUpdateWithBadgeIdsPermissionUpdate;
261
- break;
262
- case 'canUpdateCollectionApprovals':
263
- validatePermissionUpdateFunction = validateCollectionApprovalPermissionsUpdate;
264
- break;
265
- }
266
- let question = "";
267
- switch (permissionName) {
268
- case 'canDeleteCollection':
269
- question = "Can delete the collection?";
270
- break;
271
- case 'canArchiveCollection':
272
- question = "Can archive the collection?";
273
- break;
274
- case 'canUpdateOffChainBalancesMetadata':
275
- question = "Can update the off-chain balances metadata?";
276
- break;
277
- case 'canUpdateStandards':
278
- question = "Can update the standards?";
279
- break;
280
- case 'canUpdateCustomData':
281
- question = "Can update the custom data?";
282
- break;
283
- case 'canUpdateManager':
284
- question = "Can update the manager?";
285
- break;
286
- case 'canUpdateCollectionMetadata':
287
- question = "Can update the collection metadata?";
288
- break;
289
- case 'canCreateMoreBadges':
290
- question = "Can create more badges?";
291
- break;
292
- case 'canUpdateBadgeMetadata':
293
- question = "Can update the badge metadata?";
294
- break;
295
- case 'canUpdateCollectionApprovals':
296
- question = "Can update collection approvals?";
297
- break;
298
- case 'canUpdateAutoApproveSelfInitiatedOutgoingTransfers':
299
- question = "Can update auto approve self initiated outgoing transfers?";
300
- break;
301
- case 'canUpdateAutoApproveSelfInitiatedIncomingTransfers':
302
- question = "Can update auto approve self initiated incoming transfers?";
303
- break;
304
- }
305
- switch (permissionName) {
306
- case 'canDeleteCollection':
307
- case 'canUpdateAutoApproveSelfInitiatedOutgoingTransfers':
308
- case 'canUpdateAutoApproveSelfInitiatedIncomingTransfers':
309
- castFunction = exports.castActionPermissionToUniversalPermission;
310
- flags = overlaps_1.ActionPermissionUsedFlags;
311
- break;
312
- case 'canArchiveCollection':
313
- case 'canUpdateOffChainBalancesMetadata':
314
- case 'canUpdateStandards':
315
- case 'canUpdateCustomData':
316
- case 'canUpdateManager':
317
- case 'canUpdateCollectionMetadata':
318
- castFunction = exports.castTimedUpdatePermissionToUniversalPermission;
319
- flags = overlaps_1.TimedUpdatePermissionUsedFlags;
320
- break;
321
- case 'canCreateMoreBadges':
322
- castFunction = exports.castBalancesActionPermissionToUniversalPermission;
323
- flags = overlaps_1.BalancesActionPermissionUsedFlags;
324
- break;
325
- case 'canUpdateBadgeMetadata':
326
- castFunction = exports.castTimedUpdateWithBadgeIdsPermissionToUniversalPermission;
327
- flags = overlaps_1.TimedUpdateWithBadgeIdsPermissionUsedFlags;
328
- break;
329
- case 'canUpdateCollectionApprovals':
330
- castFunction = exports.castCollectionApprovalPermissionToUniversalPermission;
331
- flags = overlaps_1.ApprovalPermissionUsedFlags;
332
- break;
333
- }
334
- if (!castFunction)
335
- throw new Error('');
336
- return {
337
- castFunction,
338
- flags,
339
- question,
340
- validateFunction,
341
- validatePermissionUpdateFunction
342
- };
343
- };
344
- exports.getPermissionVariablesFromName = getPermissionVariablesFromName;
345
- class CollectionPermissions extends base_1.BaseNumberTypeClass {
346
- canDeleteCollection;
347
- canArchiveCollection;
348
- canUpdateOffChainBalancesMetadata;
349
- canUpdateStandards;
350
- canUpdateCustomData;
351
- canUpdateManager;
352
- canUpdateCollectionMetadata;
353
- canCreateMoreBadges;
354
- canUpdateBadgeMetadata;
355
- canUpdateCollectionApprovals;
356
- constructor(msg) {
357
- super();
358
- this.canDeleteCollection = msg.canDeleteCollection.map(x => new ActionPermission(x));
359
- this.canArchiveCollection = msg.canArchiveCollection.map(x => new TimedUpdatePermission(x));
360
- this.canUpdateOffChainBalancesMetadata = msg.canUpdateOffChainBalancesMetadata.map(x => new TimedUpdatePermission(x));
361
- this.canUpdateStandards = msg.canUpdateStandards.map(x => new TimedUpdatePermission(x));
362
- this.canUpdateCustomData = msg.canUpdateCustomData.map(x => new TimedUpdatePermission(x));
363
- this.canUpdateManager = msg.canUpdateManager.map(x => new TimedUpdatePermission(x));
364
- this.canUpdateCollectionMetadata = msg.canUpdateCollectionMetadata.map(x => new TimedUpdatePermission(x));
365
- this.canCreateMoreBadges = msg.canCreateMoreBadges.map(x => new BalancesActionPermission(x));
366
- this.canUpdateBadgeMetadata = msg.canUpdateBadgeMetadata.map(x => new TimedUpdateWithBadgeIdsPermission(x));
367
- this.canUpdateCollectionApprovals = msg.canUpdateCollectionApprovals.map(x => new CollectionApprovalPermission(x));
368
- }
369
- static required() {
370
- return new CollectionPermissions({
371
- canDeleteCollection: [],
372
- canArchiveCollection: [],
373
- canUpdateOffChainBalancesMetadata: [],
374
- canUpdateStandards: [],
375
- canUpdateCustomData: [],
376
- canUpdateManager: [],
377
- canUpdateCollectionMetadata: [],
378
- canCreateMoreBadges: [],
379
- canUpdateBadgeMetadata: [],
380
- canUpdateCollectionApprovals: []
381
- });
382
- }
383
- convert(convertFunction) {
384
- return new CollectionPermissions((0, base_1.deepCopy)({
385
- canDeleteCollection: this.canDeleteCollection.map((x) => x.convert(convertFunction)),
386
- canArchiveCollection: this.canArchiveCollection.map((x) => x.convert(convertFunction)),
387
- canUpdateOffChainBalancesMetadata: this.canUpdateOffChainBalancesMetadata.map((x) => x.convert(convertFunction)),
388
- canUpdateStandards: this.canUpdateStandards.map((x) => x.convert(convertFunction)),
389
- canUpdateCustomData: this.canUpdateCustomData.map((x) => x.convert(convertFunction)),
390
- canUpdateManager: this.canUpdateManager.map((x) => x.convert(convertFunction)),
391
- canUpdateCollectionMetadata: this.canUpdateCollectionMetadata.map((x) => x.convert(convertFunction)),
392
- canCreateMoreBadges: this.canCreateMoreBadges.map((x) => x.convert(convertFunction)),
393
- canUpdateBadgeMetadata: this.canUpdateBadgeMetadata.map((x) => x.convert(convertFunction)),
394
- canUpdateCollectionApprovals: this.canUpdateCollectionApprovals.map((x) => x.convert(convertFunction))
395
- }));
396
- }
397
- toProto() {
398
- return new proto_1.badges.CollectionPermissions(this.convert(string_numbers_1.Stringify));
399
- }
400
- static fromJson(jsonValue, convertFunction, options) {
401
- return CollectionPermissions.convertFromProto(proto_1.badges.CollectionPermissions.fromJson(jsonValue, options), convertFunction);
402
- }
403
- static fromJsonString(jsonString, convertFunction, options) {
404
- return CollectionPermissions.convertFromProto(proto_1.badges.CollectionPermissions.fromJsonString(jsonString, options), convertFunction);
405
- }
406
- static convertFromProto(protoMsg, convertFunction) {
407
- return new CollectionPermissions({
408
- canDeleteCollection: protoMsg.canDeleteCollection.map(x => ActionPermission.convertFromProto(x, convertFunction)),
409
- canArchiveCollection: protoMsg.canArchiveCollection.map(x => TimedUpdatePermission.convertFromProto(x, convertFunction)),
410
- canUpdateOffChainBalancesMetadata: protoMsg.canUpdateOffChainBalancesMetadata.map(x => TimedUpdatePermission.convertFromProto(x, convertFunction)),
411
- canUpdateStandards: protoMsg.canUpdateStandards.map(x => TimedUpdatePermission.convertFromProto(x, convertFunction)),
412
- canUpdateCustomData: protoMsg.canUpdateCustomData.map(x => TimedUpdatePermission.convertFromProto(x, convertFunction)),
413
- canUpdateManager: protoMsg.canUpdateManager.map(x => TimedUpdatePermission.convertFromProto(x, convertFunction)),
414
- canUpdateCollectionMetadata: protoMsg.canUpdateCollectionMetadata.map(x => TimedUpdatePermission.convertFromProto(x, convertFunction)),
415
- canCreateMoreBadges: protoMsg.canCreateMoreBadges.map(x => BalancesActionPermission.convertFromProto(x, convertFunction)),
416
- canUpdateBadgeMetadata: protoMsg.canUpdateBadgeMetadata.map(x => TimedUpdateWithBadgeIdsPermission.convertFromProto(x, convertFunction)),
417
- canUpdateCollectionApprovals: protoMsg.canUpdateCollectionApprovals.map(x => CollectionApprovalPermission.convertFromProto(x, convertFunction))
418
- });
419
- }
420
- }
421
- exports.CollectionPermissions = CollectionPermissions;
422
- class ActionPermission extends base_1.BaseNumberTypeClass {
423
- permanentlyPermittedTimes;
424
- permanentlyForbiddenTimes;
425
- constructor(msg) {
426
- super();
427
- this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
428
- this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
429
- }
430
- static required() {
431
- return new ActionPermission({
432
- permanentlyPermittedTimes: [],
433
- permanentlyForbiddenTimes: []
434
- });
435
- }
436
- convert(convertFunction) {
437
- return new ActionPermission((0, base_1.deepCopy)({
438
- permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
439
- permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
440
- }));
441
- }
442
- toProto() {
443
- return new proto_1.badges.ActionPermission(this.convert(string_numbers_1.Stringify));
444
- }
445
- static fromJson(jsonValue, convertFunction, options) {
446
- return ActionPermission.convertFromProto(proto_1.badges.ActionPermission.fromJson(jsonValue, options), convertFunction);
447
- }
448
- static fromJsonString(jsonString, convertFunction, options) {
449
- return ActionPermission.convertFromProto(proto_1.badges.ActionPermission.fromJsonString(jsonString, options), convertFunction);
450
- }
451
- static convertFromProto(protoMsg, convertFunction) {
452
- return new ActionPermission({
453
- permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
454
- permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
455
- });
456
- }
457
- }
458
- exports.ActionPermission = ActionPermission;
459
- class TimedUpdatePermission extends base_1.BaseNumberTypeClass {
460
- timelineTimes;
461
- permanentlyPermittedTimes;
462
- permanentlyForbiddenTimes;
463
- constructor(msg) {
464
- super();
465
- this.timelineTimes = msg.timelineTimes.map(x => new typeUtils_1.UintRange(x));
466
- this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
467
- this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
468
- }
469
- convert(convertFunction) {
470
- return new TimedUpdatePermission((0, base_1.deepCopy)({
471
- timelineTimes: this.timelineTimes.map((x) => x.convert(convertFunction)),
472
- permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
473
- permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
474
- }));
475
- }
476
- toProto() {
477
- return new proto_1.badges.TimedUpdatePermission(this.convert(string_numbers_1.Stringify));
478
- }
479
- static fromJson(jsonValue, convertFunction, options) {
480
- return TimedUpdatePermission.convertFromProto(proto_1.badges.TimedUpdatePermission.fromJson(jsonValue, options), convertFunction);
481
- }
482
- static fromJsonString(jsonString, convertFunction, options) {
483
- return TimedUpdatePermission.convertFromProto(proto_1.badges.TimedUpdatePermission.fromJsonString(jsonString, options), convertFunction);
484
- }
485
- static convertFromProto(protoMsg, convertFunction) {
486
- return new TimedUpdatePermission({
487
- timelineTimes: protoMsg.timelineTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
488
- permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
489
- permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
490
- });
491
- }
492
- }
493
- exports.TimedUpdatePermission = TimedUpdatePermission;
494
- class BalancesActionPermission extends base_1.BaseNumberTypeClass {
495
- badgeIds;
496
- ownershipTimes;
497
- permanentlyPermittedTimes;
498
- permanentlyForbiddenTimes;
499
- constructor(msg) {
500
- super();
501
- this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
502
- this.ownershipTimes = msg.ownershipTimes.map(x => new typeUtils_1.UintRange(x));
503
- this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
504
- this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
505
- }
506
- static required() {
507
- return new BalancesActionPermission({
508
- badgeIds: [],
509
- ownershipTimes: [],
510
- permanentlyPermittedTimes: [],
511
- permanentlyForbiddenTimes: []
512
- });
513
- }
514
- convert(convertFunction) {
515
- return new BalancesActionPermission((0, base_1.deepCopy)({
516
- badgeIds: this.badgeIds.map((x) => x.convert(convertFunction)),
517
- ownershipTimes: this.ownershipTimes.map((x) => x.convert(convertFunction)),
518
- permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
519
- permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
520
- }));
521
- }
522
- toProto() {
523
- return new proto_1.badges.BalancesActionPermission(this.convert(string_numbers_1.Stringify));
524
- }
525
- static fromJson(jsonValue, convertFunction, options) {
526
- return BalancesActionPermission.convertFromProto(proto_1.badges.BalancesActionPermission.fromJson(jsonValue, options), convertFunction);
527
- }
528
- static fromJsonString(jsonString, convertFunction, options) {
529
- return BalancesActionPermission.convertFromProto(proto_1.badges.BalancesActionPermission.fromJsonString(jsonString, options), convertFunction);
530
- }
531
- static convertFromProto(protoMsg, convertFunction) {
532
- return new BalancesActionPermission({
533
- badgeIds: protoMsg.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
534
- ownershipTimes: protoMsg.ownershipTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
535
- permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
536
- permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
537
- });
538
- }
539
- }
540
- exports.BalancesActionPermission = BalancesActionPermission;
541
- class TimedUpdateWithBadgeIdsPermission extends base_1.BaseNumberTypeClass {
542
- timelineTimes;
543
- badgeIds;
544
- permanentlyPermittedTimes;
545
- permanentlyForbiddenTimes;
546
- constructor(msg) {
547
- super();
548
- this.timelineTimes = msg.timelineTimes.map(x => new typeUtils_1.UintRange(x));
549
- this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
550
- this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
551
- this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
552
- }
553
- static required() {
554
- return new TimedUpdateWithBadgeIdsPermission({
555
- timelineTimes: [],
556
- badgeIds: [],
557
- permanentlyPermittedTimes: [],
558
- permanentlyForbiddenTimes: []
559
- });
560
- }
561
- convert(convertFunction) {
562
- return new TimedUpdateWithBadgeIdsPermission((0, base_1.deepCopy)({
563
- timelineTimes: this.timelineTimes.map((x) => x.convert(convertFunction)),
564
- badgeIds: this.badgeIds.map((x) => x.convert(convertFunction)),
565
- permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
566
- permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
567
- }));
568
- }
569
- toProto() {
570
- return new proto_1.badges.TimedUpdateWithBadgeIdsPermission(this.convert(string_numbers_1.Stringify));
571
- }
572
- static fromJson(jsonValue, convertFunction, options) {
573
- return TimedUpdateWithBadgeIdsPermission.convertFromProto(proto_1.badges.TimedUpdateWithBadgeIdsPermission.fromJson(jsonValue, options), convertFunction);
574
- }
575
- static fromJsonString(jsonString, convertFunction, options) {
576
- return TimedUpdateWithBadgeIdsPermission.convertFromProto(proto_1.badges.TimedUpdateWithBadgeIdsPermission.fromJsonString(jsonString, options), convertFunction);
577
- }
578
- static convertFromProto(protoMsg, convertFunction) {
579
- return new TimedUpdateWithBadgeIdsPermission({
580
- timelineTimes: protoMsg.timelineTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
581
- badgeIds: protoMsg.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
582
- permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
583
- permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
584
- });
585
- }
586
- }
587
- exports.TimedUpdateWithBadgeIdsPermission = TimedUpdateWithBadgeIdsPermission;
588
- class CollectionApprovalPermission extends base_1.BaseNumberTypeClass {
589
- fromListId;
590
- toListId;
591
- initiatedByListId;
592
- transferTimes;
593
- badgeIds;
594
- ownershipTimes;
595
- approvalId;
596
- amountTrackerId;
597
- challengeTrackerId;
598
- permanentlyPermittedTimes;
599
- permanentlyForbiddenTimes;
600
- constructor(msg) {
601
- super();
602
- this.fromListId = msg.fromListId;
603
- this.toListId = msg.toListId;
604
- this.initiatedByListId = msg.initiatedByListId;
605
- this.transferTimes = msg.transferTimes.map(x => new typeUtils_1.UintRange(x));
606
- this.badgeIds = msg.badgeIds.map(x => new typeUtils_1.UintRange(x));
607
- this.ownershipTimes = msg.ownershipTimes.map(x => new typeUtils_1.UintRange(x));
608
- this.approvalId = msg.approvalId;
609
- this.amountTrackerId = msg.amountTrackerId;
610
- this.challengeTrackerId = msg.challengeTrackerId;
611
- this.permanentlyPermittedTimes = msg.permanentlyPermittedTimes.map(x => new typeUtils_1.UintRange(x));
612
- this.permanentlyForbiddenTimes = msg.permanentlyForbiddenTimes.map(x => new typeUtils_1.UintRange(x));
613
- }
614
- static required() {
615
- return new CollectionApprovalPermission({
616
- fromListId: '',
617
- toListId: '',
618
- initiatedByListId: '',
619
- transferTimes: [],
620
- badgeIds: [],
621
- ownershipTimes: [],
622
- approvalId: '',
623
- amountTrackerId: '',
624
- challengeTrackerId: '',
625
- permanentlyPermittedTimes: [],
626
- permanentlyForbiddenTimes: []
627
- });
628
- }
629
- convert(convertFunction) {
630
- return new CollectionApprovalPermission((0, base_1.deepCopy)({
631
- fromListId: this.fromListId,
632
- toListId: this.toListId,
633
- initiatedByListId: this.initiatedByListId,
634
- transferTimes: this.transferTimes.map((x) => x.convert(convertFunction)),
635
- badgeIds: this.badgeIds.map((x) => x.convert(convertFunction)),
636
- ownershipTimes: this.ownershipTimes.map((x) => x.convert(convertFunction)),
637
- approvalId: this.approvalId,
638
- amountTrackerId: this.amountTrackerId,
639
- challengeTrackerId: this.challengeTrackerId,
640
- permanentlyPermittedTimes: this.permanentlyPermittedTimes.map((x) => x.convert(convertFunction)),
641
- permanentlyForbiddenTimes: this.permanentlyForbiddenTimes.map((x) => x.convert(convertFunction))
642
- }));
643
- }
644
- toProto() {
645
- return new proto_1.badges.CollectionApprovalPermission(this.convert(string_numbers_1.Stringify));
646
- }
647
- static fromJson(jsonValue, convertFunction, options) {
648
- return CollectionApprovalPermission.convertFromProto(proto_1.badges.CollectionApprovalPermission.fromJson(jsonValue, options), convertFunction);
649
- }
650
- static fromJsonString(jsonString, convertFunction, options) {
651
- return CollectionApprovalPermission.convertFromProto(proto_1.badges.CollectionApprovalPermission.fromJsonString(jsonString, options), convertFunction);
652
- }
653
- static convertFromProto(protoMsg, convertFunction) {
654
- return new CollectionApprovalPermission({
655
- fromListId: protoMsg.fromListId,
656
- toListId: protoMsg.toListId,
657
- initiatedByListId: protoMsg.initiatedByListId,
658
- transferTimes: protoMsg.transferTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
659
- badgeIds: protoMsg.badgeIds.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
660
- ownershipTimes: protoMsg.ownershipTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
661
- approvalId: protoMsg.approvalId,
662
- amountTrackerId: protoMsg.amountTrackerId,
663
- challengeTrackerId: protoMsg.challengeTrackerId,
664
- permanentlyPermittedTimes: protoMsg.permanentlyPermittedTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction)),
665
- permanentlyForbiddenTimes: protoMsg.permanentlyForbiddenTimes.map(x => typeUtils_1.UintRange.convertFromProto(x, convertFunction))
666
- });
667
- }
668
- }
669
- exports.CollectionApprovalPermission = CollectionApprovalPermission;
670
- const { getReservedAddressList, getReservedTrackerList } = typeUtils_1.AddressList;
671
- const { searchForId } = typeUtils_1.UintRange;
672
- function isCurrentTimeForbidden(permanentlyForbiddenTimes) {
673
- const currentTime = BigInt(Date.now());
674
- const [_, found] = searchForId(currentTime, permanentlyForbiddenTimes);
675
- return found;
676
- }
677
- exports.isCurrentTimeForbidden = isCurrentTimeForbidden;
678
- const castActionPermissionToUniversalPermission = (actionPermission) => {
679
- const castedPermissions = [];
680
- for (const permission of actionPermission) {
681
- castedPermissions.push({
682
- permanentlyPermittedTimes: permission.permanentlyPermittedTimes,
683
- permanentlyForbiddenTimes: permission.permanentlyForbiddenTimes,
684
- badgeIds: [],
685
- timelineTimes: [],
686
- transferTimes: [],
687
- ownershipTimes: [],
688
- fromList: typeUtils_1.AddressList.AllAddresses(),
689
- toList: typeUtils_1.AddressList.AllAddresses(),
690
- initiatedByList: typeUtils_1.AddressList.AllAddresses(),
691
- approvalIdList: typeUtils_1.AddressList.AllAddresses(),
692
- amountTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
693
- challengeTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
694
- usesAmountTrackerIdList: false,
695
- usesChallengeTrackerIdList: false,
696
- usesApprovalIdList: false,
697
- usesBadgeIds: false,
698
- usesTimelineTimes: false,
699
- usesTransferTimes: false,
700
- usesToList: false,
701
- usesFromList: false,
702
- usesInitiatedByList: false,
703
- usesOwnershipTimes: false,
704
- arbitraryValue: undefined,
705
- });
706
- }
707
- return castedPermissions;
708
- };
709
- exports.castActionPermissionToUniversalPermission = castActionPermissionToUniversalPermission;
710
- const castCollectionApprovalPermissionToUniversalPermission = (collectionUpdatePermission) => {
711
- const castedPermissions = [];
712
- for (const collectionPermission of collectionUpdatePermission) {
713
- castedPermissions.push({
714
- ...typeUtils_1.AllDefaultValues,
715
- transferTimes: collectionPermission.transferTimes,
716
- ownershipTimes: collectionPermission.ownershipTimes,
717
- fromList: collectionPermission.fromList,
718
- toList: collectionPermission.toList,
719
- initiatedByList: collectionPermission.initiatedByList,
720
- badgeIds: collectionPermission.badgeIds,
721
- approvalIdList: getReservedTrackerList(collectionPermission.approvalId),
722
- amountTrackerIdList: getReservedTrackerList(collectionPermission.amountTrackerId),
723
- challengeTrackerIdList: getReservedTrackerList(collectionPermission.challengeTrackerId),
724
- usesAmountTrackerIdList: true,
725
- usesChallengeTrackerIdList: true,
726
- usesApprovalIdList: true,
727
- usesBadgeIds: true,
728
- usesTransferTimes: true,
729
- usesOwnershipTimes: true,
730
- usesToList: true,
731
- usesFromList: true,
732
- usesInitiatedByList: true,
733
- permanentlyPermittedTimes: collectionPermission.permanentlyPermittedTimes,
734
- permanentlyForbiddenTimes: collectionPermission.permanentlyForbiddenTimes,
735
- arbitraryValue: undefined,
736
- });
737
- }
738
- return castedPermissions;
739
- };
740
- exports.castCollectionApprovalPermissionToUniversalPermission = castCollectionApprovalPermissionToUniversalPermission;
741
- const castTimedUpdateWithBadgeIdsPermissionToUniversalPermission = (timedUpdateWithBadgeIdsPermission) => {
742
- const castedPermissions = [];
743
- for (const timedPermission of timedUpdateWithBadgeIdsPermission) {
744
- castedPermissions.push({
745
- ...typeUtils_1.AllDefaultValues,
746
- timelineTimes: timedPermission.timelineTimes,
747
- badgeIds: timedPermission.badgeIds,
748
- usesTimelineTimes: true,
749
- usesBadgeIds: true,
750
- permanentlyPermittedTimes: timedPermission.permanentlyPermittedTimes,
751
- permanentlyForbiddenTimes: timedPermission.permanentlyForbiddenTimes,
752
- });
753
- }
754
- return castedPermissions;
755
- };
756
- exports.castTimedUpdateWithBadgeIdsPermissionToUniversalPermission = castTimedUpdateWithBadgeIdsPermissionToUniversalPermission;
757
- const castTimedUpdatePermissionToUniversalPermission = (timedUpdatePermission) => {
758
- const castedPermissions = [];
759
- for (const timedPermission of timedUpdatePermission) {
760
- castedPermissions.push({
761
- ...typeUtils_1.AllDefaultValues,
762
- timelineTimes: timedPermission.timelineTimes,
763
- usesTimelineTimes: true,
764
- permanentlyPermittedTimes: timedPermission.permanentlyPermittedTimes,
765
- permanentlyForbiddenTimes: timedPermission.permanentlyForbiddenTimes,
766
- });
767
- }
768
- return castedPermissions;
769
- };
770
- exports.castTimedUpdatePermissionToUniversalPermission = castTimedUpdatePermissionToUniversalPermission;
771
- const castBalancesActionPermissionToUniversalPermission = (balancesActionPermission) => {
772
- const castedPermissions = [];
773
- for (const permission of balancesActionPermission) {
774
- castedPermissions.push({
775
- ...typeUtils_1.AllDefaultValues,
776
- badgeIds: permission.badgeIds,
777
- ownershipTimes: permission.ownershipTimes,
778
- usesBadgeIds: true,
779
- usesOwnershipTimes: true,
780
- permanentlyPermittedTimes: permission.permanentlyPermittedTimes,
781
- permanentlyForbiddenTimes: permission.permanentlyForbiddenTimes,
782
- });
783
- }
784
- return castedPermissions;
785
- };
786
- exports.castBalancesActionPermissionToUniversalPermission = castBalancesActionPermissionToUniversalPermission;
787
- const castBadgeMetadataToUniversalPermission = (badgeMetadata) => {
788
- const castedPermissions = [];
789
- for (const metadata of badgeMetadata) {
790
- castedPermissions.push({
791
- ...typeUtils_1.AllDefaultValues,
792
- badgeIds: metadata.badgeIds,
793
- usesBadgeIds: true,
794
- arbitraryValue: metadata.uri + "<><><>" + metadata.customData,
795
- });
796
- }
797
- return castedPermissions;
798
- };
799
- exports.castBadgeMetadataToUniversalPermission = castBadgeMetadataToUniversalPermission;
800
- class CollectionApprovalPermissionWithDetails extends CollectionApprovalPermission {
801
- toList;
802
- fromList;
803
- initiatedByList;
804
- constructor(data) {
805
- super(data);
806
- this.toList = new typeUtils_1.AddressList(data.toList);
807
- this.fromList = new typeUtils_1.AddressList(data.fromList);
808
- this.initiatedByList = new typeUtils_1.AddressList(data.initiatedByList);
809
- }
810
- convert(convertFunction) {
811
- return new CollectionApprovalPermissionWithDetails((0, base_1.deepCopy)({
812
- ...this,
813
- ...super.convert(convertFunction),
814
- }));
815
- }
816
- }
817
- exports.CollectionApprovalPermissionWithDetails = CollectionApprovalPermissionWithDetails;
818
- class UserIncomingApprovalPermissionWithDetails extends UserIncomingApprovalPermission {
819
- fromList;
820
- initiatedByList;
821
- constructor(data) {
822
- super(data);
823
- this.fromList = new typeUtils_1.AddressList(data.fromList);
824
- this.initiatedByList = new typeUtils_1.AddressList(data.initiatedByList);
825
- }
826
- convert(convertFunction) {
827
- return new UserIncomingApprovalPermissionWithDetails((0, base_1.deepCopy)({
828
- ...this,
829
- ...super.convert(convertFunction),
830
- }));
831
- }
832
- }
833
- exports.UserIncomingApprovalPermissionWithDetails = UserIncomingApprovalPermissionWithDetails;
834
- class UserOutgoingApprovalPermissionWithDetails extends UserOutgoingApprovalPermission {
835
- toList;
836
- initiatedByList;
837
- constructor(data) {
838
- super(data);
839
- this.toList = new typeUtils_1.AddressList(data.toList);
840
- this.initiatedByList = new typeUtils_1.AddressList(data.initiatedByList);
841
- }
842
- convert(convertFunction) {
843
- return new UserOutgoingApprovalPermissionWithDetails((0, base_1.deepCopy)({
844
- ...this,
845
- ...super.convert(convertFunction),
846
- }));
847
- }
848
- }
849
- exports.UserOutgoingApprovalPermissionWithDetails = UserOutgoingApprovalPermissionWithDetails;
850
- class CollectionPermissionsWithDetails extends base_1.BaseNumberTypeClass {
851
- canUpdateCollectionApprovals;
852
- canDeleteCollection;
853
- canArchiveCollection;
854
- canUpdateOffChainBalancesMetadata;
855
- canUpdateStandards;
856
- canUpdateCustomData;
857
- canUpdateManager;
858
- canUpdateCollectionMetadata;
859
- canCreateMoreBadges;
860
- canUpdateBadgeMetadata;
861
- constructor(data) {
862
- super();
863
- this.canUpdateCollectionApprovals = data.canUpdateCollectionApprovals.map((canUpdateCollectionApproval) => new CollectionApprovalPermissionWithDetails(canUpdateCollectionApproval));
864
- this.canDeleteCollection = data.canDeleteCollection.map((actionPermission) => new ActionPermission(actionPermission));
865
- this.canArchiveCollection = data.canArchiveCollection.map((timedUpdatePermission) => new TimedUpdatePermission(timedUpdatePermission));
866
- this.canUpdateOffChainBalancesMetadata = data.canUpdateOffChainBalancesMetadata.map((timedUpdatePermission) => new TimedUpdatePermission(timedUpdatePermission));
867
- this.canUpdateStandards = data.canUpdateStandards.map((timedUpdatePermission) => new TimedUpdatePermission(timedUpdatePermission));
868
- this.canUpdateCustomData = data.canUpdateCustomData.map((timedUpdatePermission) => new TimedUpdatePermission(timedUpdatePermission));
869
- this.canUpdateManager = data.canUpdateManager.map((timedUpdatePermission) => new TimedUpdatePermission(timedUpdatePermission));
870
- this.canUpdateCollectionMetadata = data.canUpdateCollectionMetadata.map((timedUpdatePermission) => new TimedUpdatePermission(timedUpdatePermission));
871
- this.canCreateMoreBadges = data.canCreateMoreBadges.map((balancesActionPermission) => new BalancesActionPermission(balancesActionPermission));
872
- this.canUpdateBadgeMetadata = data.canUpdateBadgeMetadata.map((timedUpdateWithBadgeIdsPermission) => new TimedUpdateWithBadgeIdsPermission(timedUpdateWithBadgeIdsPermission));
873
- }
874
- convert(convertFunction) {
875
- return new CollectionPermissionsWithDetails((0, base_1.deepCopy)({
876
- ...this,
877
- canUpdateCollectionApprovals: this.canUpdateCollectionApprovals.map((canUpdateCollectionApproval) => canUpdateCollectionApproval.convert(convertFunction)),
878
- canDeleteCollection: this.canDeleteCollection.map((actionPermission) => actionPermission.convert(convertFunction)),
879
- canArchiveCollection: this.canArchiveCollection.map((timedUpdatePermission) => timedUpdatePermission.convert(convertFunction)),
880
- canUpdateOffChainBalancesMetadata: this.canUpdateOffChainBalancesMetadata.map((timedUpdatePermission) => timedUpdatePermission.convert(convertFunction)),
881
- canUpdateStandards: this.canUpdateStandards.map((timedUpdatePermission) => timedUpdatePermission.convert(convertFunction)),
882
- canUpdateCustomData: this.canUpdateCustomData.map((timedUpdatePermission) => timedUpdatePermission.convert(convertFunction)),
883
- canUpdateManager: this.canUpdateManager.map((timedUpdatePermission) => timedUpdatePermission.convert(convertFunction)),
884
- canUpdateCollectionMetadata: this.canUpdateCollectionMetadata.map((timedUpdatePermission) => timedUpdatePermission.convert(convertFunction)),
885
- canCreateMoreBadges: this.canCreateMoreBadges.map((balancesActionPermission) => balancesActionPermission.convert(convertFunction)),
886
- canUpdateBadgeMetadata: this.canUpdateBadgeMetadata.map((timedUpdateWithBadgeIdsPermission) => timedUpdateWithBadgeIdsPermission.convert(convertFunction)),
887
- }));
888
- }
889
- }
890
- exports.CollectionPermissionsWithDetails = CollectionPermissionsWithDetails;
891
- class UserPermissionsWithDetails extends base_1.BaseNumberTypeClass {
892
- canUpdateIncomingApprovals;
893
- canUpdateOutgoingApprovals;
894
- canUpdateAutoApproveSelfInitiatedOutgoingTransfers;
895
- canUpdateAutoApproveSelfInitiatedIncomingTransfers;
896
- constructor(data) {
897
- super();
898
- this.canUpdateIncomingApprovals = data.canUpdateIncomingApprovals.map((canUpdateUserIncomingApproval) => new UserIncomingApprovalPermissionWithDetails(canUpdateUserIncomingApproval));
899
- this.canUpdateOutgoingApprovals = data.canUpdateOutgoingApprovals.map((canUpdateUserOutgoingApproval) => new UserOutgoingApprovalPermissionWithDetails(canUpdateUserOutgoingApproval));
900
- this.canUpdateAutoApproveSelfInitiatedOutgoingTransfers = data.canUpdateAutoApproveSelfInitiatedOutgoingTransfers.map((actionPermission) => new ActionPermission(actionPermission));
901
- this.canUpdateAutoApproveSelfInitiatedIncomingTransfers = data.canUpdateAutoApproveSelfInitiatedIncomingTransfers.map((actionPermission) => new ActionPermission(actionPermission));
902
- }
903
- convert(convertFunction) {
904
- return new UserPermissionsWithDetails((0, base_1.deepCopy)({
905
- ...this,
906
- canUpdateIncomingApprovals: this.canUpdateIncomingApprovals.map((canUpdateUserIncomingApproval) => canUpdateUserIncomingApproval.convert(convertFunction)),
907
- canUpdateOutgoingApprovals: this.canUpdateOutgoingApprovals.map((canUpdateUserOutgoingApproval) => canUpdateUserOutgoingApproval.convert(convertFunction)),
908
- canUpdateAutoApproveSelfInitiatedOutgoingTransfers: this.canUpdateAutoApproveSelfInitiatedOutgoingTransfers.map((actionPermission) => actionPermission.convert(convertFunction)),
909
- canUpdateAutoApproveSelfInitiatedIncomingTransfers: this.canUpdateAutoApproveSelfInitiatedIncomingTransfers.map((actionPermission) => actionPermission.convert(convertFunction)),
910
- }));
911
- }
912
- }
913
- exports.UserPermissionsWithDetails = UserPermissionsWithDetails;
914
- const castUserIncomingApprovalPermissionToCollectionApprovalPermission = (userIncomingApprovals, toAddress) => {
915
- return userIncomingApprovals.map((approval) => {
916
- return new CollectionApprovalPermissionWithDetails({
917
- ...approval,
918
- toList: getReservedAddressList(toAddress),
919
- toListId: toAddress,
920
- });
921
- });
922
- };
923
- exports.castUserIncomingApprovalPermissionToCollectionApprovalPermission = castUserIncomingApprovalPermissionToCollectionApprovalPermission;
924
- const castUserOutgoingApprovalPermissionToCollectionApprovalPermission = (userOutgoingApprovals, fromAddress) => {
925
- return userOutgoingApprovals.map((approval) => {
926
- return new CollectionApprovalPermissionWithDetails({
927
- ...approval,
928
- fromList: getReservedAddressList(fromAddress),
929
- fromListId: fromAddress,
930
- });
931
- });
932
- };
933
- exports.castUserOutgoingApprovalPermissionToCollectionApprovalPermission = castUserOutgoingApprovalPermissionToCollectionApprovalPermission;
934
- function getPotentialUpdatesForTimelineValues(times, values) {
935
- const castedPermissions = [];
936
- for (let idx = 0; idx < times.length; idx++) {
937
- castedPermissions.push({
938
- timelineTimes: times[idx],
939
- arbitraryValue: values[idx],
940
- usesTimelineTimes: true,
941
- usesBadgeIds: false,
942
- usesOwnershipTimes: false,
943
- usesTransferTimes: false,
944
- usesToList: false,
945
- usesFromList: false,
946
- usesInitiatedByList: false,
947
- usesApprovalIdList: false,
948
- permanentlyPermittedTimes: [],
949
- permanentlyForbiddenTimes: [],
950
- badgeIds: [],
951
- ownershipTimes: [],
952
- transferTimes: [],
953
- toList: typeUtils_1.AddressList.AllAddresses(),
954
- fromList: typeUtils_1.AddressList.AllAddresses(),
955
- initiatedByList: typeUtils_1.AddressList.AllAddresses(),
956
- approvalIdList: typeUtils_1.AddressList.AllAddresses(),
957
- amountTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
958
- challengeTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
959
- usesAmountTrackerIdList: false,
960
- usesChallengeTrackerIdList: false,
961
- });
962
- }
963
- const firstMatches = (0, overlaps_1.GetFirstMatchOnly)(castedPermissions);
964
- return firstMatches;
965
- }
966
- exports.getPotentialUpdatesForTimelineValues = getPotentialUpdatesForTimelineValues;
967
- function getFirstMatchOnlyWithApprovalCriteria(permissions) {
968
- const handled = [];
969
- for (const permission of permissions) {
970
- const badgeIds = (0, overlaps_1.GetUintRangesWithOptions)(permission.badgeIds, permission.usesBadgeIds);
971
- const timelineTimes = (0, overlaps_1.GetUintRangesWithOptions)(permission.timelineTimes, permission.usesTimelineTimes);
972
- const transferTimes = (0, overlaps_1.GetUintRangesWithOptions)(permission.transferTimes, permission.usesTransferTimes);
973
- const ownershipTimes = (0, overlaps_1.GetUintRangesWithOptions)(permission.ownershipTimes, permission.usesOwnershipTimes);
974
- const permanentlyPermittedTimes = (0, overlaps_1.GetUintRangesWithOptions)(permission.permanentlyPermittedTimes, true);
975
- const permanentlyForbiddenTimes = (0, overlaps_1.GetUintRangesWithOptions)(permission.permanentlyForbiddenTimes, true);
976
- for (const badgeId of badgeIds) {
977
- for (const timelineTime of timelineTimes) {
978
- for (const transferTime of transferTimes) {
979
- for (const ownershipTime of ownershipTimes) {
980
- const approvalCriteria = [
981
- permission.arbitraryValue.approvalCriteria ?? null,
982
- ];
983
- const isApproved = permission.arbitraryValue.isApproved;
984
- const arbValue = {
985
- isApproved: isApproved,
986
- approvalCriteria: approvalCriteria,
987
- };
988
- const brokenDown = [
989
- {
990
- badgeId: badgeId,
991
- timelineTime: timelineTime,
992
- transferTime: transferTime,
993
- ownershipTime: ownershipTime,
994
- toList: permission.toList,
995
- fromList: permission.fromList,
996
- initiatedByList: permission.initiatedByList,
997
- approvalIdList: permission.approvalIdList,
998
- amountTrackerIdList: permission.amountTrackerIdList,
999
- challengeTrackerIdList: permission.challengeTrackerIdList,
1000
- permanentlyPermittedTimes: permanentlyPermittedTimes,
1001
- permanentlyForbiddenTimes: permanentlyForbiddenTimes,
1002
- arbitraryValue: arbValue,
1003
- },
1004
- ];
1005
- const [overlaps, inBrokenDownButNotHandled, inHandledButNotBrokenDown] = (0, overlaps_1.getOverlapsAndNonOverlaps)(brokenDown, handled);
1006
- handled.length = 0;
1007
- handled.push(...inHandledButNotBrokenDown);
1008
- handled.push(...inBrokenDownButNotHandled);
1009
- for (const overlap of overlaps) {
1010
- const mergedApprovalCriteria = overlap.secondDetails.arbitraryValue.approvalCriteria.concat(overlap.firstDetails.arbitraryValue.approvalCriteria);
1011
- const isApprovedFirst = overlap.firstDetails.arbitraryValue.isApproved;
1012
- const isApprovedSecond = overlap.secondDetails.arbitraryValue.isApproved;
1013
- const isApproved = isApprovedFirst && isApprovedSecond;
1014
- const newArbValue = {
1015
- isApproved: isApproved,
1016
- approvalCriteria: mergedApprovalCriteria,
1017
- };
1018
- handled.push({
1019
- timelineTime: overlap.overlap.timelineTime,
1020
- badgeId: overlap.overlap.badgeId,
1021
- transferTime: overlap.overlap.transferTime,
1022
- ownershipTime: overlap.overlap.ownershipTime,
1023
- toList: overlap.overlap.toList,
1024
- fromList: overlap.overlap.fromList,
1025
- initiatedByList: overlap.overlap.initiatedByList,
1026
- approvalIdList: overlap.overlap.approvalIdList,
1027
- amountTrackerIdList: overlap.overlap.amountTrackerIdList,
1028
- challengeTrackerIdList: overlap.overlap.challengeTrackerIdList,
1029
- permanentlyPermittedTimes: permanentlyPermittedTimes,
1030
- permanentlyForbiddenTimes: permanentlyForbiddenTimes,
1031
- arbitraryValue: newArbValue,
1032
- });
1033
- }
1034
- }
1035
- }
1036
- }
1037
- }
1038
- }
1039
- const returnArr = [];
1040
- for (const handledItem of handled) {
1041
- let idxToInsert = 0;
1042
- while (idxToInsert < returnArr.length && handledItem.badgeId.start > returnArr[idxToInsert].badgeId.start) {
1043
- idxToInsert++;
1044
- }
1045
- returnArr.push(null);
1046
- returnArr.copyWithin(idxToInsert + 1, idxToInsert);
1047
- returnArr[idxToInsert] = handledItem;
1048
- }
1049
- return returnArr;
1050
- }
1051
- function validateCollectionApprovalsUpdate(oldApprovals, newApprovals, canUpdateCollectionApprovals) {
1052
- const dummyRanges = [[new typeUtils_1.UintRange(new typeUtils_1.UintRange({ start: 1n, end: 1n }))]];
1053
- const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues((0, base_1.deepCopy)(dummyRanges), [(0, base_1.deepCopy)(oldApprovals)]);
1054
- const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues((0, base_1.deepCopy)(dummyRanges), [(0, base_1.deepCopy)(newApprovals)]);
1055
- const detailsToCheck = getUpdateCombinationsToCheck(oldTimelineFirstMatches, newTimelineFirstMatches, [], function (oldValue, newValue) {
1056
- const expandedOldApprovals = (0, utils_1.expandCollectionApprovals)(oldValue);
1057
- const expandedNewApprovals = (0, utils_1.expandCollectionApprovals)(newValue);
1058
- const oldApprovals = (0, collections_1.castCollectionApprovalToUniversalPermission)(expandedOldApprovals);
1059
- if (!oldApprovals) {
1060
- throw new Error("InvalidOldValue");
1061
- }
1062
- const newApprovals = (0, collections_1.castCollectionApprovalToUniversalPermission)(expandedNewApprovals);
1063
- if (!newApprovals) {
1064
- throw new Error("InvalidNewValue");
1065
- }
1066
- const firstMatchesForOld = getFirstMatchOnlyWithApprovalCriteria(oldApprovals);
1067
- const firstMatchesForNew = getFirstMatchOnlyWithApprovalCriteria(newApprovals);
1068
- const detailsToReturn = [];
1069
- const [overlapObjects, inOldButNotNew, inNewButNotOld] = (0, overlaps_1.getOverlapsAndNonOverlaps)(firstMatchesForOld, firstMatchesForNew);
1070
- for (const overlapObject of overlapObjects) {
1071
- const overlap = overlapObject.overlap;
1072
- const oldDetails = overlapObject.firstDetails;
1073
- const newDetails = overlapObject.secondDetails;
1074
- let different = false;
1075
- if ((oldDetails.arbitraryValue === null && newDetails.arbitraryValue !== null) || (oldDetails.arbitraryValue !== null && newDetails.arbitraryValue === null)) {
1076
- different = true;
1077
- }
1078
- else {
1079
- const oldArbVal = oldDetails.arbitraryValue;
1080
- const newArbVal = newDetails.arbitraryValue;
1081
- const oldVal = oldArbVal.approvalCriteria;
1082
- const newVal = newArbVal.approvalCriteria;
1083
- if (oldArbVal.isApproved !== newArbVal.isApproved) {
1084
- different = true;
1085
- }
1086
- if (oldVal.length !== newVal.length) {
1087
- different = true;
1088
- }
1089
- else {
1090
- for (let i = 0; i < oldVal.length; i++) {
1091
- if (JSON.stringify(oldVal[i]) !== JSON.stringify(newVal[i])) {
1092
- different = true;
1093
- }
1094
- }
1095
- }
1096
- }
1097
- if (different) {
1098
- detailsToReturn.push(overlap);
1099
- }
1100
- }
1101
- detailsToReturn.push(...inOldButNotNew);
1102
- detailsToReturn.push(...inNewButNotOld);
1103
- return detailsToReturn;
1104
- });
1105
- const details = detailsToCheck.map(x => {
1106
- const result = {
1107
- timelineTimes: [x.timelineTime],
1108
- badgeIds: [x.badgeId],
1109
- ownershipTimes: [x.ownershipTime],
1110
- transferTimes: [x.transferTime],
1111
- toList: x.toList,
1112
- fromList: x.fromList,
1113
- initiatedByList: x.initiatedByList,
1114
- approvalIdList: x.approvalIdList,
1115
- amountTrackerIdList: x.amountTrackerIdList,
1116
- challengeTrackerIdList: x.challengeTrackerIdList,
1117
- };
1118
- return result;
1119
- });
1120
- const err = checkIfCollectionApprovalPermissionPermits(details, canUpdateCollectionApprovals);
1121
- if (err) {
1122
- return err;
1123
- }
1124
- return null;
1125
- }
1126
- exports.validateCollectionApprovalsUpdate = validateCollectionApprovalsUpdate;
1127
- function validateBadgeMetadataUpdate(oldBadgeMetadata, newBadgeMetadata, canUpdateBadgeMetadata) {
1128
- const { times: oldTimes, values: oldValues } = getBadgeMetadataTimesAndValues(oldBadgeMetadata);
1129
- const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
1130
- const { times: newTimes, values: newValues } = getBadgeMetadataTimesAndValues(newBadgeMetadata);
1131
- const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
1132
- const detailsToCheck = getUpdateCombinationsToCheck(oldTimelineFirstMatches, newTimelineFirstMatches, [], function (oldValue, newValue) {
1133
- const oldBadgeMetadata = oldValue;
1134
- const firstMatchesForOld = (0, overlaps_1.GetFirstMatchOnly)((0, exports.castBadgeMetadataToUniversalPermission)(oldBadgeMetadata));
1135
- const newBadgeMetadata = newValue;
1136
- const firstMatchesForNew = (0, overlaps_1.GetFirstMatchOnly)((0, exports.castBadgeMetadataToUniversalPermission)(newBadgeMetadata));
1137
- const detailsToReturn = [];
1138
- const [overlapObjects, inOldButNotNew, inNewButNotOld] = (0, overlaps_1.getOverlapsAndNonOverlaps)(firstMatchesForOld, firstMatchesForNew);
1139
- for (const overlapObject of overlapObjects) {
1140
- const overlap = overlapObject.overlap;
1141
- const oldDetails = overlapObject.firstDetails;
1142
- const newDetails = overlapObject.secondDetails;
1143
- if ((oldDetails.arbitraryValue === null && newDetails.arbitraryValue !== null) || (oldDetails.arbitraryValue !== null && newDetails.arbitraryValue === null)) {
1144
- detailsToReturn.push(overlap);
1145
- }
1146
- else {
1147
- const oldVal = oldDetails.arbitraryValue;
1148
- const newVal = newDetails.arbitraryValue;
1149
- if (newVal !== oldVal) {
1150
- detailsToReturn.push(overlap);
1151
- }
1152
- }
1153
- }
1154
- detailsToReturn.push(...inOldButNotNew);
1155
- detailsToReturn.push(...inNewButNotOld);
1156
- return detailsToReturn;
1157
- });
1158
- const details = detailsToCheck.map(x => {
1159
- const result = {
1160
- timelineTimes: [x.timelineTime],
1161
- badgeIds: [x.badgeId],
1162
- ownershipTimes: [x.ownershipTime],
1163
- transferTimes: [x.transferTime],
1164
- toList: x.toList,
1165
- fromList: x.fromList,
1166
- initiatedByList: x.initiatedByList,
1167
- };
1168
- return result;
1169
- });
1170
- const err = checkIfTimedUpdateWithBadgeIdsPermissionPermits(details, canUpdateBadgeMetadata);
1171
- if (err) {
1172
- return err;
1173
- }
1174
- return null;
1175
- }
1176
- exports.validateBadgeMetadataUpdate = validateBadgeMetadataUpdate;
1177
- function validateCollectionMetadataUpdate(oldCollectionMetadata, newCollectionMetadata, canUpdateCollectionMetadata) {
1178
- const { times: oldTimes, values: oldValues } = getCollectionMetadataTimesAndValues(oldCollectionMetadata);
1179
- const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
1180
- const { times: newTimes, values: newValues } = getCollectionMetadataTimesAndValues(newCollectionMetadata);
1181
- const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
1182
- const detailsToCheck = getUpdateCombinationsToCheck(oldTimelineFirstMatches, newTimelineFirstMatches, {}, function (oldValue, newValue) {
1183
- const detailsToCheck = [];
1184
- if (oldValue === null && newValue !== null) {
1185
- detailsToCheck.push({
1186
- timelineTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1187
- badgeId: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1188
- ownershipTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1189
- transferTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1190
- toList: typeUtils_1.AddressList.AllAddresses(),
1191
- fromList: typeUtils_1.AddressList.AllAddresses(),
1192
- initiatedByList: typeUtils_1.AddressList.AllAddresses(),
1193
- approvalIdList: typeUtils_1.AddressList.AllAddresses(),
1194
- amountTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1195
- challengeTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1196
- permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
1197
- });
1198
- }
1199
- else {
1200
- const oldVal = oldValue;
1201
- const newVal = newValue;
1202
- if (oldVal.uri !== newVal.uri || oldVal.customData !== newVal.customData) {
1203
- detailsToCheck.push({
1204
- timelineTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1205
- badgeId: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1206
- ownershipTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1207
- transferTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1208
- toList: typeUtils_1.AddressList.AllAddresses(),
1209
- fromList: typeUtils_1.AddressList.AllAddresses(),
1210
- initiatedByList: typeUtils_1.AddressList.AllAddresses(),
1211
- approvalIdList: typeUtils_1.AddressList.AllAddresses(),
1212
- amountTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1213
- challengeTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1214
- permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
1215
- });
1216
- }
1217
- }
1218
- return detailsToCheck;
1219
- });
1220
- const details = detailsToCheck.map(x => {
1221
- return [x.timelineTime];
1222
- }).flat();
1223
- const err = checkIfTimedUpdatePermissionPermits(details, canUpdateCollectionMetadata);
1224
- if (err) {
1225
- return err;
1226
- }
1227
- return null;
1228
- }
1229
- exports.validateCollectionMetadataUpdate = validateCollectionMetadataUpdate;
1230
- function validateOffChainBalancesMetadataUpdate(oldOffChainBalancesMetadata, newOffChainBalancesMetadata, canUpdateOffChainBalancesMetadata) {
1231
- const { times: oldTimes, values: oldValues } = getOffChainBalancesMetadataTimesAndValues(oldOffChainBalancesMetadata);
1232
- const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
1233
- const { times: newTimes, values: newValues } = getOffChainBalancesMetadataTimesAndValues(newOffChainBalancesMetadata);
1234
- const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
1235
- const detailsToCheck = getUpdateCombinationsToCheck(oldTimelineFirstMatches, newTimelineFirstMatches, {}, function (oldValue, newValue) {
1236
- const detailsToCheck = [];
1237
- if (oldValue === null && newValue !== null) {
1238
- detailsToCheck.push({
1239
- timelineTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1240
- badgeId: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1241
- ownershipTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1242
- transferTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1243
- toList: typeUtils_1.AddressList.AllAddresses(),
1244
- fromList: typeUtils_1.AddressList.AllAddresses(),
1245
- initiatedByList: typeUtils_1.AddressList.AllAddresses(),
1246
- approvalIdList: typeUtils_1.AddressList.AllAddresses(),
1247
- amountTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1248
- challengeTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1249
- permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
1250
- });
1251
- }
1252
- else {
1253
- const oldVal = oldValue;
1254
- const newVal = newValue;
1255
- if (oldVal.uri !== newVal.uri || oldVal.customData !== newVal.customData) {
1256
- detailsToCheck.push({
1257
- timelineTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1258
- badgeId: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1259
- ownershipTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1260
- transferTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1261
- toList: typeUtils_1.AddressList.AllAddresses(),
1262
- fromList: typeUtils_1.AddressList.AllAddresses(),
1263
- initiatedByList: typeUtils_1.AddressList.AllAddresses(),
1264
- approvalIdList: typeUtils_1.AddressList.AllAddresses(),
1265
- amountTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1266
- challengeTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1267
- permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
1268
- });
1269
- }
1270
- }
1271
- return detailsToCheck;
1272
- });
1273
- const details = detailsToCheck.map(x => x.timelineTime);
1274
- const err = checkIfTimedUpdatePermissionPermits(details, canUpdateOffChainBalancesMetadata);
1275
- if (err) {
1276
- return err;
1277
- }
1278
- return null;
1279
- }
1280
- exports.validateOffChainBalancesMetadataUpdate = validateOffChainBalancesMetadataUpdate;
1281
- function getUpdatedStringCombinations(oldValue, newValue) {
1282
- const x = [];
1283
- if ((oldValue === null && newValue !== null) || (oldValue !== null && newValue === null) || oldValue !== newValue) {
1284
- x.push({
1285
- timelineTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1286
- badgeId: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1287
- ownershipTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1288
- transferTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1289
- toList: typeUtils_1.AddressList.AllAddresses(),
1290
- fromList: typeUtils_1.AddressList.AllAddresses(),
1291
- initiatedByList: typeUtils_1.AddressList.AllAddresses(),
1292
- approvalIdList: typeUtils_1.AddressList.AllAddresses(),
1293
- amountTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1294
- challengeTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1295
- permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
1296
- });
1297
- }
1298
- return x;
1299
- }
1300
- exports.getUpdatedStringCombinations = getUpdatedStringCombinations;
1301
- function getUpdatedBoolCombinations(oldValue, newValue) {
1302
- if ((oldValue === null && newValue !== null) || (oldValue !== null && newValue === null) || oldValue !== newValue) {
1303
- return [{
1304
- timelineTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1305
- badgeId: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1306
- ownershipTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1307
- transferTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1308
- toList: typeUtils_1.AddressList.AllAddresses(),
1309
- fromList: typeUtils_1.AddressList.AllAddresses(),
1310
- initiatedByList: typeUtils_1.AddressList.AllAddresses(),
1311
- approvalIdList: typeUtils_1.AddressList.AllAddresses(),
1312
- amountTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1313
- challengeTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1314
- permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
1315
- }];
1316
- }
1317
- return [];
1318
- }
1319
- exports.getUpdatedBoolCombinations = getUpdatedBoolCombinations;
1320
- function validateManagerUpdate(oldManager, newManager, canUpdateManager) {
1321
- const { times: oldTimes, values: oldValues } = getManagerTimesAndValues(oldManager);
1322
- const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
1323
- const { times: newTimes, values: newValues } = getManagerTimesAndValues(newManager);
1324
- const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
1325
- const updatedTimelineTimes = getUpdateCombinationsToCheck(oldTimelineFirstMatches, newTimelineFirstMatches, "", getUpdatedStringCombinations);
1326
- const details = updatedTimelineTimes.map(x => x.timelineTime);
1327
- const err = checkIfTimedUpdatePermissionPermits(details, canUpdateManager);
1328
- if (err) {
1329
- return err;
1330
- }
1331
- return null;
1332
- }
1333
- exports.validateManagerUpdate = validateManagerUpdate;
1334
- function validateCustomDataUpdate(oldCustomData, newCustomData, canUpdateCustomData) {
1335
- const { times: oldTimes, values: oldValues } = getCustomDataTimesAndValues(oldCustomData);
1336
- const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
1337
- const { times: newTimes, values: newValues } = getCustomDataTimesAndValues(newCustomData);
1338
- const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
1339
- const updatedTimelineTimes = getUpdateCombinationsToCheck(oldTimelineFirstMatches, newTimelineFirstMatches, "", getUpdatedStringCombinations);
1340
- const details = updatedTimelineTimes.map(x => x.timelineTime);
1341
- const err = checkIfTimedUpdatePermissionPermits(details, canUpdateCustomData);
1342
- if (err) {
1343
- return err;
1344
- }
1345
- return null;
1346
- }
1347
- exports.validateCustomDataUpdate = validateCustomDataUpdate;
1348
- function validateStandardsUpdate(oldStandards, newStandards, canUpdateStandards) {
1349
- const { times: oldTimes, values: oldValues } = getStandardsTimesAndValues(oldStandards);
1350
- const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
1351
- const { times: newTimes, values: newValues } = getStandardsTimesAndValues(newStandards);
1352
- const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
1353
- const updatedTimelineTimes = getUpdateCombinationsToCheck(oldTimelineFirstMatches, newTimelineFirstMatches, [], function (oldValue, newValue) {
1354
- if ((oldValue == null && newValue != null) || (oldValue != null && newValue == null)) {
1355
- return [{
1356
- timelineTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1357
- badgeId: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1358
- ownershipTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1359
- transferTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1360
- toList: typeUtils_1.AddressList.AllAddresses(),
1361
- fromList: typeUtils_1.AddressList.AllAddresses(),
1362
- initiatedByList: typeUtils_1.AddressList.AllAddresses(),
1363
- approvalIdList: typeUtils_1.AddressList.AllAddresses(),
1364
- amountTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1365
- challengeTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1366
- permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
1367
- }];
1368
- }
1369
- else if (oldValue.length != newValue.length) {
1370
- return [{
1371
- timelineTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1372
- badgeId: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1373
- ownershipTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1374
- transferTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1375
- toList: typeUtils_1.AddressList.AllAddresses(),
1376
- fromList: typeUtils_1.AddressList.AllAddresses(),
1377
- initiatedByList: typeUtils_1.AddressList.AllAddresses(),
1378
- approvalIdList: typeUtils_1.AddressList.AllAddresses(),
1379
- amountTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1380
- challengeTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1381
- permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
1382
- }];
1383
- }
1384
- else {
1385
- for (let i = 0; i < oldValue.length; i++) {
1386
- if (oldValue[i] != newValue[i]) {
1387
- return [{
1388
- timelineTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1389
- badgeId: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1390
- ownershipTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1391
- transferTime: new typeUtils_1.UintRange({ start: 1n, end: 1n }),
1392
- toList: typeUtils_1.AddressList.AllAddresses(),
1393
- fromList: typeUtils_1.AddressList.AllAddresses(),
1394
- initiatedByList: typeUtils_1.AddressList.AllAddresses(),
1395
- approvalIdList: typeUtils_1.AddressList.AllAddresses(),
1396
- amountTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1397
- challengeTrackerIdList: typeUtils_1.AddressList.AllAddresses(),
1398
- permanentlyPermittedTimes: [], permanentlyForbiddenTimes: [], arbitraryValue: undefined
1399
- }];
1400
- }
1401
- }
1402
- }
1403
- return [];
1404
- });
1405
- const details = updatedTimelineTimes.map(x => x.timelineTime);
1406
- const err = checkIfTimedUpdatePermissionPermits(details, canUpdateStandards);
1407
- if (err) {
1408
- return err;
1409
- }
1410
- return null;
1411
- }
1412
- exports.validateStandardsUpdate = validateStandardsUpdate;
1413
- function validateIsArchivedUpdate(oldIsArchived, newIsArchived, canUpdateIsArchived) {
1414
- const { times: oldTimes, values: oldValues } = getIsArchivedTimesAndValues(oldIsArchived);
1415
- const oldTimelineFirstMatches = getPotentialUpdatesForTimelineValues(oldTimes, oldValues);
1416
- const { times: newTimes, values: newValues } = getIsArchivedTimesAndValues(newIsArchived);
1417
- const newTimelineFirstMatches = getPotentialUpdatesForTimelineValues(newTimes, newValues);
1418
- const updatedTimelineTimes = getUpdateCombinationsToCheck(oldTimelineFirstMatches, newTimelineFirstMatches, false, getUpdatedBoolCombinations);
1419
- const details = updatedTimelineTimes.map(x => x.timelineTime);
1420
- const err = checkIfTimedUpdatePermissionPermits(details, canUpdateIsArchived);
1421
- if (err) {
1422
- return err;
1423
- }
1424
- return null;
1425
- }
1426
- exports.validateIsArchivedUpdate = validateIsArchivedUpdate;
1427
- function getIsArchivedTimesAndValues(isArchivedTimeline) {
1428
- const times = [];
1429
- const values = [];
1430
- for (const timelineVal of isArchivedTimeline) {
1431
- times.push(timelineVal.timelineTimes);
1432
- values.push(timelineVal.isArchived);
1433
- }
1434
- return { times, values };
1435
- }
1436
- function getOffChainBalancesMetadataTimesAndValues(inheritedBalancesMetadata) {
1437
- const times = [];
1438
- const values = [];
1439
- for (const timelineVal of inheritedBalancesMetadata) {
1440
- times.push(timelineVal.timelineTimes);
1441
- values.push(timelineVal.offChainBalancesMetadata);
1442
- }
1443
- return { times, values };
1444
- }
1445
- function getCollectionMetadataTimesAndValues(timeline) {
1446
- const times = [];
1447
- const values = [];
1448
- for (const timelineVal of timeline) {
1449
- times.push(timelineVal.timelineTimes);
1450
- values.push(timelineVal.collectionMetadata);
1451
- }
1452
- return { times, values };
1453
- }
1454
- function getBadgeMetadataTimesAndValues(timeline) {
1455
- const times = [];
1456
- const values = [];
1457
- for (const timelineVal of timeline) {
1458
- times.push(timelineVal.timelineTimes);
1459
- values.push(timelineVal.badgeMetadata);
1460
- }
1461
- return { times, values };
1462
- }
1463
- function getManagerTimesAndValues(managerTimeline) {
1464
- const times = [];
1465
- const values = [];
1466
- for (const timelineVal of managerTimeline) {
1467
- times.push(timelineVal.timelineTimes);
1468
- values.push(timelineVal.manager);
1469
- }
1470
- return { times, values };
1471
- }
1472
- function getCustomDataTimesAndValues(customDataTimeline) {
1473
- const times = [];
1474
- const values = [];
1475
- for (const timelineVal of customDataTimeline) {
1476
- times.push(timelineVal.timelineTimes);
1477
- values.push(timelineVal.customData);
1478
- }
1479
- return { times, values };
1480
- }
1481
- function getStandardsTimesAndValues(standardsTimeline) {
1482
- const times = [];
1483
- const values = [];
1484
- for (const timelineVal of standardsTimeline) {
1485
- times.push(timelineVal.timelineTimes);
1486
- values.push(timelineVal.standards);
1487
- }
1488
- return { times, values };
1489
- }
1490
- function getUpdateCombinationsToCheck(firstMatchesForOld, firstMatchesForNew, emptyValue, compareAndGetUpdateCombosToCheck) {
1491
- const detailsToCheck = [];
1492
- const [overlapObjects, inOldButNotNew, inNewButNotOld,] = (0, overlaps_1.getOverlapsAndNonOverlaps)(firstMatchesForOld, firstMatchesForNew);
1493
- for (const detail of inOldButNotNew) {
1494
- const detailsToAdd = compareAndGetUpdateCombosToCheck(detail.arbitraryValue, emptyValue);
1495
- for (const detailToAdd of detailsToAdd) {
1496
- detailsToCheck.push({
1497
- timelineTime: detail.timelineTime,
1498
- badgeId: detailToAdd.badgeId,
1499
- transferTime: detailToAdd.transferTime,
1500
- toList: detailToAdd.toList,
1501
- fromList: detailToAdd.fromList,
1502
- initiatedByList: detailToAdd.initiatedByList,
1503
- ownershipTime: detailToAdd.ownershipTime,
1504
- approvalIdList: detailToAdd.approvalIdList,
1505
- amountTrackerIdList: detailToAdd.amountTrackerIdList,
1506
- challengeTrackerIdList: detailToAdd.challengeTrackerIdList,
1507
- permanentlyPermittedTimes: [],
1508
- permanentlyForbiddenTimes: [],
1509
- arbitraryValue: undefined
1510
- });
1511
- }
1512
- }
1513
- for (const detail of inNewButNotOld) {
1514
- const detailsToAdd = compareAndGetUpdateCombosToCheck(detail.arbitraryValue, emptyValue);
1515
- for (const detailToAdd of detailsToAdd) {
1516
- detailsToCheck.push({
1517
- timelineTime: detail.timelineTime,
1518
- badgeId: detailToAdd.badgeId,
1519
- transferTime: detailToAdd.transferTime,
1520
- toList: detailToAdd.toList,
1521
- fromList: detailToAdd.fromList,
1522
- initiatedByList: detailToAdd.initiatedByList,
1523
- approvalIdList: detailToAdd.approvalIdList,
1524
- amountTrackerIdList: detailToAdd.amountTrackerIdList,
1525
- challengeTrackerIdList: detailToAdd.challengeTrackerIdList,
1526
- ownershipTime: detailToAdd.ownershipTime,
1527
- permanentlyPermittedTimes: [],
1528
- permanentlyForbiddenTimes: [],
1529
- arbitraryValue: undefined
1530
- });
1531
- }
1532
- }
1533
- for (const overlapObj of overlapObjects) {
1534
- const overlap = overlapObj.overlap;
1535
- const oldDetails = overlapObj.firstDetails;
1536
- const newDetails = overlapObj.secondDetails;
1537
- const detailsToAdd = compareAndGetUpdateCombosToCheck(oldDetails.arbitraryValue, newDetails.arbitraryValue);
1538
- for (const detailToAdd of detailsToAdd) {
1539
- detailsToCheck.push({
1540
- timelineTime: overlap.timelineTime,
1541
- badgeId: detailToAdd.badgeId,
1542
- transferTime: detailToAdd.transferTime,
1543
- toList: detailToAdd.toList,
1544
- fromList: detailToAdd.fromList,
1545
- initiatedByList: detailToAdd.initiatedByList,
1546
- approvalIdList: detailToAdd.approvalIdList,
1547
- amountTrackerIdList: detailToAdd.amountTrackerIdList,
1548
- challengeTrackerIdList: detailToAdd.challengeTrackerIdList,
1549
- ownershipTime: detailToAdd.ownershipTime,
1550
- permanentlyPermittedTimes: [],
1551
- permanentlyForbiddenTimes: [],
1552
- arbitraryValue: undefined
1553
- });
1554
- }
1555
- }
1556
- return detailsToCheck;
1557
- }
1558
- exports.getUpdateCombinationsToCheck = getUpdateCombinationsToCheck;
1559
- function checkNotForbidden(permission, time) {
1560
- const blockTime = time ?? BigInt(Date.now());
1561
- const [, found] = searchForId(blockTime, permission.permanentlyForbiddenTimes);
1562
- if (found) {
1563
- return new Error(`permission is forbidden from being executed at current time ${new Date(Number(blockTime)).toLocaleDateString() + ' ' + new Date(Number(blockTime)).toLocaleTimeString()}`);
1564
- }
1565
- return null;
1566
- }
1567
- function checkIfActionPermissionPermits(permissions, time) {
1568
- const castedPermissions = (0, exports.castActionPermissionToUniversalPermission)(permissions);
1569
- const permissionDetails = (0, overlaps_1.GetFirstMatchOnly)(castedPermissions);
1570
- for (const permissionDetail of permissionDetails) {
1571
- const err = checkNotForbidden(permissionDetail, time);
1572
- if (err) {
1573
- return err;
1574
- }
1575
- }
1576
- return null;
1577
- }
1578
- exports.checkIfActionPermissionPermits = checkIfActionPermissionPermits;
1579
- function checkIfTimedUpdatePermissionPermits(timelineTimes, permissions, time) {
1580
- const detailsToCheck = [];
1581
- for (const timelineTime of timelineTimes) {
1582
- detailsToCheck.push({
1583
- timelineTime,
1584
- badgeId: new typeUtils_1.UintRange({ start: -1n, end: -1n }),
1585
- ownershipTime: new typeUtils_1.UintRange({ start: -1n, end: -1n }),
1586
- transferTime: new typeUtils_1.UintRange({ start: -1n, end: -1n }),
1587
- toList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1588
- fromList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1589
- initiatedByList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1590
- approvalIdList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1591
- amountTrackerIdList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1592
- challengeTrackerIdList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1593
- permanentlyPermittedTimes: [],
1594
- permanentlyForbiddenTimes: [],
1595
- arbitraryValue: undefined
1596
- });
1597
- }
1598
- const castedPermissions = (0, exports.castTimedUpdatePermissionToUniversalPermission)(permissions);
1599
- const permissionDetails = (0, overlaps_1.GetFirstMatchOnly)(castedPermissions);
1600
- return checkNotForbiddenForAllOverlaps(permissionDetails, detailsToCheck, time);
1601
- }
1602
- exports.checkIfTimedUpdatePermissionPermits = checkIfTimedUpdatePermissionPermits;
1603
- function checkIfBalancesActionPermissionPermits(balances, permissions, time) {
1604
- const detailsToCheck = [];
1605
- for (const badgeToCreate of balances) {
1606
- for (const badgeIdRange of badgeToCreate.badgeIds) {
1607
- for (const ownershipTime of badgeToCreate.ownershipTimes) {
1608
- detailsToCheck.push({
1609
- badgeId: badgeIdRange,
1610
- ownershipTime: ownershipTime,
1611
- timelineTime: new typeUtils_1.UintRange({ start: -1n, end: -1n }),
1612
- transferTime: new typeUtils_1.UintRange({ start: -1n, end: -1n }),
1613
- toList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1614
- fromList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1615
- initiatedByList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1616
- approvalIdList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1617
- amountTrackerIdList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1618
- challengeTrackerIdList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1619
- permanentlyPermittedTimes: [],
1620
- permanentlyForbiddenTimes: [],
1621
- arbitraryValue: undefined
1622
- });
1623
- }
1624
- }
1625
- }
1626
- const castedPermissions = (0, exports.castBalancesActionPermissionToUniversalPermission)(permissions);
1627
- const permissionDetails = (0, overlaps_1.GetFirstMatchOnly)(castedPermissions);
1628
- return checkNotForbiddenForAllOverlaps(permissionDetails, detailsToCheck, time);
1629
- }
1630
- exports.checkIfBalancesActionPermissionPermits = checkIfBalancesActionPermissionPermits;
1631
- function checkIfTimedUpdateWithBadgeIdsPermissionPermits(details, permissions, time) {
1632
- const detailsToCheck = [];
1633
- for (const detail of details) {
1634
- for (const timelineTime of detail.timelineTimes) {
1635
- for (const badgeId of detail.badgeIds) {
1636
- detailsToCheck.push({
1637
- timelineTime,
1638
- badgeId,
1639
- ownershipTime: new typeUtils_1.UintRange({ start: -1n, end: -1n }),
1640
- transferTime: new typeUtils_1.UintRange({ start: -1n, end: -1n }),
1641
- toList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1642
- fromList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1643
- initiatedByList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1644
- approvalIdList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1645
- amountTrackerIdList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1646
- challengeTrackerIdList: new typeUtils_1.AddressList({ listId: 'All', addresses: [], whitelist: false, uri: "", customData: "", createdBy: "" }),
1647
- permanentlyPermittedTimes: [],
1648
- permanentlyForbiddenTimes: [],
1649
- arbitraryValue: undefined
1650
- });
1651
- }
1652
- }
1653
- }
1654
- const castedPermissions = (0, exports.castTimedUpdateWithBadgeIdsPermissionToUniversalPermission)(permissions);
1655
- const permissionDetails = (0, overlaps_1.GetFirstMatchOnly)(castedPermissions);
1656
- return checkNotForbiddenForAllOverlaps(permissionDetails, detailsToCheck, time);
1657
- }
1658
- exports.checkIfTimedUpdateWithBadgeIdsPermissionPermits = checkIfTimedUpdateWithBadgeIdsPermissionPermits;
1659
- function checkIfCollectionApprovalPermissionPermits(details, permissions, time) {
1660
- const castedPermissions = (0, exports.castCollectionApprovalPermissionToUniversalPermission)(permissions);
1661
- const permissionDetails = (0, overlaps_1.GetFirstMatchOnly)(castedPermissions);
1662
- const detailsToCheck = [];
1663
- for (const detail of details) {
1664
- for (const timelineTime of detail.timelineTimes) {
1665
- for (const badgeId of detail.badgeIds) {
1666
- for (const ownershipTime of detail.ownershipTimes) {
1667
- for (const transferTime of detail.transferTimes) {
1668
- detailsToCheck.push({
1669
- timelineTime,
1670
- badgeId,
1671
- ownershipTime: ownershipTime,
1672
- transferTime,
1673
- toList: detail.toList,
1674
- fromList: detail.fromList,
1675
- initiatedByList: detail.initiatedByList,
1676
- approvalIdList: detail.approvalIdList,
1677
- amountTrackerIdList: detail.amountTrackerIdList,
1678
- challengeTrackerIdList: detail.challengeTrackerIdList,
1679
- permanentlyPermittedTimes: [],
1680
- permanentlyForbiddenTimes: [],
1681
- arbitraryValue: undefined
1682
- });
1683
- }
1684
- }
1685
- }
1686
- }
1687
- }
1688
- return checkNotForbiddenForAllOverlaps(permissionDetails, detailsToCheck, time, true);
1689
- }
1690
- exports.checkIfCollectionApprovalPermissionPermits = checkIfCollectionApprovalPermissionPermits;
1691
- function checkIfUserOutgoingApprovalPermissionPermits(detailsToCheck, permissions, userAddress, time) {
1692
- const newDetails = detailsToCheck.map(x => {
1693
- return {
1694
- ...x,
1695
- fromList: getReservedAddressList(userAddress),
1696
- };
1697
- });
1698
- const castedPermissions = (0, exports.castUserOutgoingApprovalPermissionToCollectionApprovalPermission)(permissions, userAddress);
1699
- return checkIfCollectionApprovalPermissionPermits(newDetails, castedPermissions, time);
1700
- }
1701
- exports.checkIfUserOutgoingApprovalPermissionPermits = checkIfUserOutgoingApprovalPermissionPermits;
1702
- function checkIfUserIncomingApprovalPermissionPermits(detailsToCheck, permissions, userAddress, time) {
1703
- const newDetails = detailsToCheck.map(x => {
1704
- return {
1705
- ...x,
1706
- toList: getReservedAddressList(userAddress),
1707
- };
1708
- });
1709
- const castedPermissions = (0, exports.castUserIncomingApprovalPermissionToCollectionApprovalPermission)(permissions, userAddress);
1710
- return checkIfCollectionApprovalPermissionPermits(newDetails, castedPermissions, time);
1711
- }
1712
- exports.checkIfUserIncomingApprovalPermissionPermits = checkIfUserIncomingApprovalPermissionPermits;
1713
- function checkNotForbiddenForAllOverlaps(permissionDetails, detailsToCheck, time = undefined, usesLists) {
1714
- let usesBadgeIds = true;
1715
- let usesTimelineTimes = true;
1716
- let usesTransferTimes = true;
1717
- let usesOwnershipTimes = true;
1718
- let usesToLists = true;
1719
- let usesFromLists = true;
1720
- let usesInitiatedByLists = true;
1721
- let usesApprovalIdLists = true;
1722
- let usesAmountTrackerIdList = true;
1723
- let usesChallengeTrackerIdList = true;
1724
- for (const detailToCheck of detailsToCheck) {
1725
- if (detailToCheck.badgeId.start === -1n) {
1726
- usesBadgeIds = false;
1727
- detailToCheck.badgeId = new typeUtils_1.UintRange({ start: BigInt(1n), end: BigInt(1n) });
1728
- }
1729
- if (detailToCheck.timelineTime.start === -1n) {
1730
- usesTimelineTimes = false;
1731
- detailToCheck.timelineTime = new typeUtils_1.UintRange({ start: BigInt(1n), end: BigInt(1n) });
1732
- }
1733
- if (detailToCheck.transferTime.start === -1n) {
1734
- usesTransferTimes = false;
1735
- detailToCheck.transferTime = new typeUtils_1.UintRange({ start: BigInt(1n), end: BigInt(1n) });
1736
- }
1737
- if (detailToCheck.ownershipTime.start === -1n) {
1738
- usesOwnershipTimes = false;
1739
- detailToCheck.ownershipTime = new typeUtils_1.UintRange({ start: BigInt(1n), end: BigInt(1n) });
1740
- }
1741
- if (!usesLists) {
1742
- usesToLists = false;
1743
- detailToCheck.toList = typeUtils_1.AddressList.AllAddresses();
1744
- }
1745
- if (!usesLists) {
1746
- usesFromLists = false;
1747
- detailToCheck.fromList = typeUtils_1.AddressList.AllAddresses();
1748
- }
1749
- if (!usesLists) {
1750
- usesInitiatedByLists = false;
1751
- detailToCheck.initiatedByList = typeUtils_1.AddressList.AllAddresses();
1752
- }
1753
- if (!usesLists) {
1754
- usesApprovalIdLists = false;
1755
- detailToCheck.approvalIdList = typeUtils_1.AddressList.AllAddresses();
1756
- }
1757
- if (!usesLists) {
1758
- usesAmountTrackerIdList = false;
1759
- detailToCheck.amountTrackerIdList = typeUtils_1.AddressList.AllAddresses();
1760
- }
1761
- if (!usesLists) {
1762
- usesChallengeTrackerIdList = false;
1763
- detailToCheck.challengeTrackerIdList = typeUtils_1.AddressList.AllAddresses();
1764
- }
1765
- }
1766
- for (const permissionDetail of permissionDetails) {
1767
- for (const detailToCheck of detailsToCheck) {
1768
- const [, overlap] = (0, overlaps_1.universalRemoveOverlaps)(permissionDetail, detailToCheck);
1769
- if (overlap.length > 0) {
1770
- const err = checkNotForbidden(permissionDetail, time);
1771
- if (err) {
1772
- let errStr = err.message;
1773
- if (usesTimelineTimes) {
1774
- errStr += ` for the timeline times ${new Date(Number(permissionDetail.timelineTime.start)).toLocaleDateString() + ' ' + new Date(Number(permissionDetail.timelineTime.start)).toLocaleTimeString()} to ${new Date(Number(permissionDetail.timelineTime.end)).toLocaleDateString() + ' ' + new Date(Number(permissionDetail.timelineTime.end)).toLocaleTimeString()}`;
1775
- }
1776
- if (usesTransferTimes) {
1777
- errStr += ` for the transfer times ${new Date(Number(permissionDetail.transferTime.start)).toLocaleDateString() + ' ' + new Date(Number(permissionDetail.transferTime.start)).toLocaleTimeString()} to ${new Date(Number(permissionDetail.transferTime.end)).toLocaleDateString() + ' ' + new Date(Number(permissionDetail.transferTime.end)).toLocaleTimeString()}`;
1778
- }
1779
- if (usesBadgeIds) {
1780
- errStr += ` for the badge ids ${permissionDetail.badgeId.start} to ${permissionDetail.badgeId.end}`;
1781
- }
1782
- if (usesOwnershipTimes) {
1783
- errStr += ` for the ownership times ${new Date(Number(permissionDetail.ownershipTime.start)).toLocaleDateString() + ' ' + new Date(Number(permissionDetail.ownershipTime.start)).toLocaleTimeString()} to ${new Date(Number(permissionDetail.ownershipTime.end)).toLocaleDateString() + ' ' + new Date(Number(permissionDetail.ownershipTime.end)).toLocaleTimeString()}`;
1784
- }
1785
- if (usesToLists) {
1786
- errStr += ` for the to lists ${permissionDetail.toList.listId}`;
1787
- }
1788
- if (usesFromLists) {
1789
- errStr += ` for the from lists ${permissionDetail.fromList.listId}`;
1790
- }
1791
- if (usesInitiatedByLists) {
1792
- errStr += ` for the initiated by lists ${permissionDetail.initiatedByList.listId}`;
1793
- }
1794
- if (usesApprovalIdLists) {
1795
- errStr += ` for the approval id ${permissionDetail.approvalIdList.listId}`;
1796
- }
1797
- if (usesAmountTrackerIdList) {
1798
- errStr += ` for the amount tracker id ${permissionDetail.amountTrackerIdList.listId}`;
1799
- }
1800
- if (usesChallengeTrackerIdList) {
1801
- errStr += ` for the challenge tracker id ${permissionDetail.challengeTrackerIdList.listId}`;
1802
- }
1803
- return new Error(errStr);
1804
- }
1805
- }
1806
- }
1807
- }
1808
- return null;
1809
- }
1810
- exports.checkNotForbiddenForAllOverlaps = checkNotForbiddenForAllOverlaps;
1811
- function validateBalancesActionPermissionUpdate(oldPermissions, newPermissions) {
1812
- const castedOldPermissions = (0, exports.castBalancesActionPermissionToUniversalPermission)(oldPermissions);
1813
- const castedNewPermissions = (0, exports.castBalancesActionPermissionToUniversalPermission)(newPermissions);
1814
- const err = validateUniversalPermissionUpdate((0, overlaps_1.GetFirstMatchOnly)(castedOldPermissions), (0, overlaps_1.GetFirstMatchOnly)(castedNewPermissions));
1815
- if (err) {
1816
- return new Error(`Error validating update in permissions: ${err}`);
1817
- }
1818
- return null;
1819
- }
1820
- exports.validateBalancesActionPermissionUpdate = validateBalancesActionPermissionUpdate;
1821
- function validateTimedUpdatePermissionUpdate(oldPermissions, newPermissions) {
1822
- const castedOldPermissions = (0, exports.castTimedUpdatePermissionToUniversalPermission)(oldPermissions);
1823
- const castedNewPermissions = (0, exports.castTimedUpdatePermissionToUniversalPermission)(newPermissions);
1824
- const err = validateUniversalPermissionUpdate((0, overlaps_1.GetFirstMatchOnly)(castedOldPermissions), (0, overlaps_1.GetFirstMatchOnly)(castedNewPermissions));
1825
- if (err) {
1826
- return new Error(`Error validating update in permissions: ${err}`);
1827
- }
1828
- return null;
1829
- }
1830
- exports.validateTimedUpdatePermissionUpdate = validateTimedUpdatePermissionUpdate;
1831
- function validateTimedUpdateWithBadgeIdsPermissionUpdate(oldPermissions, newPermissions) {
1832
- const castedOldPermissions = (0, base_1.deepCopy)((0, exports.castTimedUpdateWithBadgeIdsPermissionToUniversalPermission)(oldPermissions));
1833
- const castedNewPermissions = (0, base_1.deepCopy)((0, exports.castTimedUpdateWithBadgeIdsPermissionToUniversalPermission)(newPermissions));
1834
- const err = validateUniversalPermissionUpdate((0, overlaps_1.GetFirstMatchOnly)(castedOldPermissions), (0, overlaps_1.GetFirstMatchOnly)(castedNewPermissions));
1835
- if (err) {
1836
- return new Error(`Error validating update in permissions: ${err}`);
1837
- }
1838
- return null;
1839
- }
1840
- exports.validateTimedUpdateWithBadgeIdsPermissionUpdate = validateTimedUpdateWithBadgeIdsPermissionUpdate;
1841
- function validateCollectionApprovalPermissionsUpdate(oldPermissions, newPermissions) {
1842
- const castedOldPermissions = (0, exports.castCollectionApprovalPermissionToUniversalPermission)(oldPermissions);
1843
- const castedNewPermissions = (0, exports.castCollectionApprovalPermissionToUniversalPermission)(newPermissions);
1844
- const err = validateUniversalPermissionUpdate((0, overlaps_1.GetFirstMatchOnly)(castedOldPermissions), (0, overlaps_1.GetFirstMatchOnly)(castedNewPermissions));
1845
- if (err) {
1846
- return new Error(`Error validating update in permissions: ${err}`);
1847
- }
1848
- return null;
1849
- }
1850
- exports.validateCollectionApprovalPermissionsUpdate = validateCollectionApprovalPermissionsUpdate;
1851
- function validateActionPermissionUpdate(oldPermissions, newPermissions) {
1852
- const castedOldPermissions = (0, exports.castActionPermissionToUniversalPermission)(oldPermissions);
1853
- const castedNewPermissions = (0, exports.castActionPermissionToUniversalPermission)(newPermissions);
1854
- const err = validateUniversalPermissionUpdate((0, overlaps_1.GetFirstMatchOnly)(castedOldPermissions), (0, overlaps_1.GetFirstMatchOnly)(castedNewPermissions));
1855
- if (err) {
1856
- return new Error(`Error validating update in permissions: ${err}`);
1857
- }
1858
- return null;
1859
- }
1860
- exports.validateActionPermissionUpdate = validateActionPermissionUpdate;
1861
- function validatePermissionsUpdate(oldPermissions, newPermissions) {
1862
- if (newPermissions.canDeleteCollection !== null) {
1863
- const error = validateActionPermissionUpdate(oldPermissions.canDeleteCollection, newPermissions.canDeleteCollection);
1864
- if (error) {
1865
- return new Error(`Error validating update in canDeleteCollection permissions: ${error}`);
1866
- }
1867
- }
1868
- if (newPermissions.canUpdateManager !== null) {
1869
- const error = validateTimedUpdatePermissionUpdate(oldPermissions.canUpdateManager, newPermissions.canUpdateManager);
1870
- if (error) {
1871
- return new Error(`Error validating update in canUpdateManager permissions: ${error}`);
1872
- }
1873
- }
1874
- if (newPermissions.canUpdateCustomData !== null) {
1875
- const error = validateTimedUpdatePermissionUpdate(oldPermissions.canUpdateCustomData, newPermissions.canUpdateCustomData);
1876
- if (error) {
1877
- return new Error(`Error validating update in canUpdateCustomData permissions: ${error}`);
1878
- }
1879
- }
1880
- if (newPermissions.canUpdateStandards !== null) {
1881
- const error = validateTimedUpdatePermissionUpdate(oldPermissions.canUpdateStandards, newPermissions.canUpdateStandards);
1882
- if (error) {
1883
- return new Error(`Error validating update in canUpdateStandards permissions: ${error}`);
1884
- }
1885
- }
1886
- if (newPermissions.canArchiveCollection !== null) {
1887
- const error = validateTimedUpdatePermissionUpdate(oldPermissions.canArchiveCollection, newPermissions.canArchiveCollection);
1888
- if (error) {
1889
- return new Error(`Error validating update in canArchiveCollection permissions: ${error}`);
1890
- }
1891
- }
1892
- if (newPermissions.canUpdateOffChainBalancesMetadata !== null) {
1893
- const error = validateTimedUpdatePermissionUpdate(oldPermissions.canUpdateOffChainBalancesMetadata, newPermissions.canUpdateOffChainBalancesMetadata);
1894
- if (error) {
1895
- return new Error(`Error validating update in canUpdateOffChainBalancesMetadata permissions: ${error}`);
1896
- }
1897
- }
1898
- if (newPermissions.canUpdateCollectionMetadata !== null) {
1899
- const error = validateTimedUpdatePermissionUpdate(oldPermissions.canUpdateCollectionMetadata, newPermissions.canUpdateCollectionMetadata);
1900
- if (error) {
1901
- return new Error(`Error validating update in canUpdateCollectionMetadata permissions: ${error}`);
1902
- }
1903
- }
1904
- if (newPermissions.canCreateMoreBadges !== null) {
1905
- const error = validateBalancesActionPermissionUpdate(oldPermissions.canCreateMoreBadges, newPermissions.canCreateMoreBadges);
1906
- if (error) {
1907
- return new Error(`Error validating update in canCreateMoreBadges permissions: ${error}`);
1908
- }
1909
- }
1910
- if (newPermissions.canUpdateBadgeMetadata !== null) {
1911
- const error = validateTimedUpdateWithBadgeIdsPermissionUpdate(oldPermissions.canUpdateBadgeMetadata, newPermissions.canUpdateBadgeMetadata);
1912
- if (error) {
1913
- return new Error(`Error validating update in canUpdateBadgeMetadata permissions: ${error}`);
1914
- }
1915
- }
1916
- if (newPermissions.canUpdateCollectionApprovals !== null) {
1917
- const error = validateCollectionApprovalPermissionsUpdate(oldPermissions.canUpdateCollectionApprovals, newPermissions.canUpdateCollectionApprovals);
1918
- if (error) {
1919
- return new Error(`Error validating update in canUpdateCollectionApprovals permissions: ${error}`);
1920
- }
1921
- }
1922
- return null;
1923
- }
1924
- exports.validatePermissionsUpdate = validatePermissionsUpdate;
1925
- function validateUniversalPermissionUpdate(oldPermissions, newPermissions) {
1926
- const [allOverlaps, inOldButNotNew] = (0, overlaps_1.getOverlapsAndNonOverlaps)(oldPermissions, newPermissions);
1927
- if (inOldButNotNew.length > 0) {
1928
- let errMsg = `Permission ${getPermissionString(inOldButNotNew[0])} found in old permissions but not in new permissions`;
1929
- if (inOldButNotNew.length > 1) {
1930
- errMsg += ` (along with ${inOldButNotNew.length - 1} more)`;
1931
- }
1932
- return new Error(errMsg);
1933
- }
1934
- for (const overlapObj of allOverlaps) {
1935
- const oldPermission = overlapObj.firstDetails;
1936
- const newPermission = overlapObj.secondDetails;
1937
- const [leftoverPermittedTimes] = removeUintRangesFromUintRanges(newPermission.permanentlyPermittedTimes, oldPermission.permanentlyPermittedTimes);
1938
- const [leftoverForbiddenTimes] = removeUintRangesFromUintRanges(newPermission.permanentlyForbiddenTimes, oldPermission.permanentlyForbiddenTimes);
1939
- if (leftoverPermittedTimes.length > 0 || leftoverForbiddenTimes.length > 0) {
1940
- let errMsg = `Permission ${getPermissionString(oldPermission)} found in both new and old permissions but `;
1941
- if (leftoverPermittedTimes.length > 0) {
1942
- errMsg += 'previously explicitly allowed the times ( ';
1943
- for (const oldPermittedTime of leftoverPermittedTimes) {
1944
- errMsg += `${oldPermittedTime.start}-${oldPermittedTime.end} `;
1945
- }
1946
- errMsg += ') which are now set to disApproved';
1947
- }
1948
- if (leftoverForbiddenTimes.length > 0 && leftoverPermittedTimes.length > 0) {
1949
- errMsg += ' and';
1950
- }
1951
- if (leftoverForbiddenTimes.length > 0) {
1952
- errMsg += ' previously explicitly disApproved the times ( ';
1953
- for (const oldForbiddenTime of leftoverForbiddenTimes) {
1954
- errMsg += `${oldForbiddenTime.start}-${oldForbiddenTime.end} `;
1955
- }
1956
- errMsg += ') which are now set to allowed.';
1957
- }
1958
- return new Error(errMsg);
1959
- }
1960
- }
1961
- return null;
1962
- }
1963
- exports.validateUniversalPermissionUpdate = validateUniversalPermissionUpdate;
1964
- function getPermissionString(permission) {
1965
- let str = "(";
1966
- const maxUint64 = 18446744073709551615n;
1967
- if (permission.badgeId.start === maxUint64 || permission.badgeId.end === maxUint64) {
1968
- str += `badgeId: ${permission.badgeId.start} `;
1969
- }
1970
- if (permission.timelineTime.start === maxUint64 || permission.timelineTime.end === maxUint64) {
1971
- str += `timelineTime: ${permission.timelineTime.start} `;
1972
- }
1973
- if (permission.transferTime.start === maxUint64 || permission.transferTime.end === maxUint64) {
1974
- str += `transferTime: ${permission.transferTime.start} `;
1975
- }
1976
- if (permission.ownershipTime.start === maxUint64 || permission.ownershipTime.end === maxUint64) {
1977
- str += `ownershipTime: ${permission.ownershipTime.start} `;
1978
- }
1979
- if (permission.toList) {
1980
- str += "toList: ";
1981
- if (!permission.toList.whitelist) {
1982
- str += `${permission.toList.addresses.length} addresses `;
1983
- }
1984
- else {
1985
- str += `all except ${permission.toList.addresses.length} addresses `;
1986
- }
1987
- if (permission.toList.addresses.length > 0 && permission.toList.addresses.length <= 5) {
1988
- str += "(";
1989
- for (const address of permission.toList.addresses) {
1990
- str += address + " ";
1991
- }
1992
- str += ")";
1993
- }
1994
- }
1995
- if (permission.fromList) {
1996
- str += "fromList: ";
1997
- if (!permission.fromList.whitelist) {
1998
- str += `${permission.fromList.addresses.length} addresses `;
1999
- }
2000
- else {
2001
- str += `all except ${permission.fromList.addresses.length} addresses `;
2002
- }
2003
- if (permission.fromList.addresses.length > 0 && permission.fromList.addresses.length <= 5) {
2004
- str += "(";
2005
- for (const address of permission.fromList.addresses) {
2006
- str += address + " ";
2007
- }
2008
- str += ")";
2009
- }
2010
- }
2011
- if (permission.initiatedByList) {
2012
- str += "initiatedByList: ";
2013
- if (!permission.initiatedByList.whitelist) {
2014
- str += `${permission.initiatedByList.addresses.length} addresses `;
2015
- }
2016
- else {
2017
- str += `all except ${permission.initiatedByList.addresses.length} addresses `;
2018
- }
2019
- if (permission.initiatedByList.addresses.length > 0 && permission.initiatedByList.addresses.length <= 5) {
2020
- str += "(";
2021
- for (const address of permission.initiatedByList.addresses) {
2022
- str += address + " ";
2023
- }
2024
- str += ")";
2025
- }
2026
- }
2027
- str += ") ";
2028
- return str;
2029
- }
2030
- //# sourceMappingURL=permissions.js.map