bitbadgesjs-sdk 0.0.6 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/dist/amino/objectConverter.d.ts +1 -1
  2. package/dist/amino/objectConverter.d.ts.map +1 -1
  3. package/dist/amino/registry.js +3 -3
  4. package/dist/amino/registry.js.map +1 -1
  5. package/dist/eip712/payload/createTypedData.d.ts +1 -1
  6. package/dist/eip712/payload/createTypedData.d.ts.map +1 -1
  7. package/dist/eip712/payload/createTypes/parseMessage.d.ts +1 -1
  8. package/dist/eip712/payload/createTypes/parseMessage.d.ts.map +1 -1
  9. package/dist/eip712/payload/createTypes/parseMessage.js.map +1 -1
  10. package/dist/eip712/payload/createTypes/parsePayload.d.ts +1 -1
  11. package/dist/eip712/payload/createTypes/parsePayload.d.ts.map +1 -1
  12. package/dist/eip712/payload/createTypes/parsePayload.js.map +1 -1
  13. package/dist/eip712/payload/flattenPayload.d.ts +1 -1
  14. package/dist/eip712/payload/flattenPayload.d.ts.map +1 -1
  15. package/dist/eip712/payload/samples/getSampleMsg.js +1 -1
  16. package/dist/eip712/payload/samples/getSampleMsg.js.map +1 -1
  17. package/dist/index.d.ts +9 -9
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +9 -9
  20. package/dist/index.js.map +1 -1
  21. package/dist/transactions/messages/base.d.ts +3 -3
  22. package/dist/transactions/messages/base.d.ts.map +1 -1
  23. package/dist/transactions/messages/base.js +6 -9
  24. package/dist/transactions/messages/base.js.map +1 -1
  25. package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.d.ts +12 -5
  26. package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.d.ts.map +1 -1
  27. package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.js +26 -14
  28. package/dist/transactions/messages/bitbadges/badges/msgCreateAddressLists.js.map +1 -1
  29. package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.d.ts +24 -6
  30. package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.d.ts.map +1 -1
  31. package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.js +75 -43
  32. package/dist/transactions/messages/bitbadges/badges/msgCreateCollection.js.map +1 -1
  33. package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.d.ts +14 -6
  34. package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.d.ts.map +1 -1
  35. package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.js +32 -21
  36. package/dist/transactions/messages/bitbadges/badges/msgDeleteCollection.js.map +1 -1
  37. package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.d.ts +14 -6
  38. package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.d.ts.map +1 -1
  39. package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.js +35 -23
  40. package/dist/transactions/messages/bitbadges/badges/msgTransferBadges.js.map +1 -1
  41. package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.d.ts +22 -6
  42. package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.d.ts.map +1 -1
  43. package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.js +118 -55
  44. package/dist/transactions/messages/bitbadges/badges/msgUniversalUpdateCollection.js.map +1 -1
  45. package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.d.ts +11 -6
  46. package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.d.ts.map +1 -1
  47. package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.js +108 -52
  48. package/dist/transactions/messages/bitbadges/badges/msgUpdateCollection.js.map +1 -1
  49. package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.d.ts +23 -6
  50. package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.d.ts.map +1 -1
  51. package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.js +71 -31
  52. package/dist/transactions/messages/bitbadges/badges/msgUpdateUserApprovals.js.map +1 -1
  53. package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.d.ts +15 -3
  54. package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.d.ts.map +1 -1
  55. package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.js +35 -6
  56. package/dist/transactions/messages/bitbadges/protocols/msgCreateProtocol.js.map +1 -1
  57. package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.d.ts +12 -5
  58. package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.d.ts.map +1 -1
  59. package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.js +26 -6
  60. package/dist/transactions/messages/bitbadges/protocols/msgDeleteProtocol.js.map +1 -1
  61. package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.d.ts +14 -4
  62. package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.d.ts.map +1 -1
  63. package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.js +36 -6
  64. package/dist/transactions/messages/bitbadges/protocols/msgSetCollectionForProtocol.js.map +1 -1
  65. package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.d.ts +12 -3
  66. package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.d.ts.map +1 -1
  67. package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.js +26 -6
  68. package/dist/transactions/messages/bitbadges/protocols/msgUnsetCollectionForProtocol.js.map +1 -1
  69. package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.d.ts +15 -3
  70. package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.d.ts.map +1 -1
  71. package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.js +35 -6
  72. package/dist/transactions/messages/bitbadges/protocols/msgUpdateProtocol.js.map +1 -1
  73. package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.d.ts +14 -3
  74. package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.d.ts.map +1 -1
  75. package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.js +32 -6
  76. package/dist/transactions/messages/bitbadges/wasmx/msgExecuteContractCompat.js.map +1 -1
  77. package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.d.ts +14 -3
  78. package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.d.ts.map +1 -1
  79. package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.js +32 -11
  80. package/dist/transactions/messages/bitbadges/wasmx/msgInstantiateContractCompat.js.map +1 -1
  81. package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.d.ts +15 -2
  82. package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.d.ts.map +1 -1
  83. package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.js +26 -9
  84. package/dist/transactions/messages/bitbadges/wasmx/msgStoreCodeCompat.js.map +1 -1
  85. package/dist/transactions/messages/common.d.ts +1 -1
  86. package/dist/transactions/messages/common.d.ts.map +1 -1
  87. package/dist/transactions/messages/msgSend.d.ts +2 -2
  88. package/dist/transactions/messages/msgSend.d.ts.map +1 -1
  89. package/dist/transactions/messages/transaction.d.ts +2 -2
  90. package/dist/transactions/messages/transaction.d.ts.map +1 -1
  91. package/dist/transactions/messages/transaction.js +1 -1
  92. package/dist/transactions/messages/transaction.js.map +1 -1
  93. package/dist/transactions/messages/txRaw.d.ts +2 -2
  94. package/dist/transactions/messages/txRaw.d.ts.map +1 -1
  95. package/dist/transactions/messages/txRaw.js.map +1 -1
  96. package/dist/transactions/messages/web3Extension.d.ts +2 -2
  97. package/dist/transactions/messages/web3Extension.d.ts.map +1 -1
  98. package/dist/transactions/messages/web3Extension.js +4 -4
  99. package/dist/transactions/messages/web3Extension.js.map +1 -1
  100. package/dist/tsconfig.build.tsbuildinfo +1 -1
  101. package/dist/types/badges/aminoRegistry.d.ts +3 -0
  102. package/dist/types/badges/aminoRegistry.d.ts.map +1 -0
  103. package/dist/types/badges/aminoRegistry.js.map +1 -0
  104. package/dist/{proto-types → types}/badges/string-numbers.d.ts +2 -2
  105. package/dist/types/badges/string-numbers.d.ts.map +1 -0
  106. package/dist/types/badges/string-numbers.js.map +1 -0
  107. package/dist/types/badges/typeutils/approvals.d.ts +320 -0
  108. package/dist/types/badges/typeutils/approvals.d.ts.map +1 -0
  109. package/dist/types/badges/typeutils/approvals.js +690 -0
  110. package/dist/types/badges/typeutils/approvals.js.map +1 -0
  111. package/dist/types/badges/typeutils/permissions.d.ts +230 -0
  112. package/dist/types/badges/typeutils/permissions.d.ts.map +1 -0
  113. package/dist/types/badges/typeutils/permissions.js +675 -0
  114. package/dist/types/badges/typeutils/permissions.js.map +1 -0
  115. package/dist/types/badges/typeutils/typeUtils.d.ts +411 -0
  116. package/dist/types/badges/typeutils/typeUtils.d.ts.map +1 -0
  117. package/dist/types/badges/typeutils/typeUtils.js +1086 -0
  118. package/dist/types/badges/typeutils/typeUtils.js.map +1 -0
  119. package/dist/{proto-types → types}/base.d.ts +1 -1
  120. package/dist/types/base.d.ts.map +1 -0
  121. package/dist/types/base.js.map +1 -0
  122. package/dist/types/protocols/aminoRegistry.d.ts +3 -0
  123. package/dist/types/protocols/aminoRegistry.d.ts.map +1 -0
  124. package/dist/types/protocols/aminoRegistry.js.map +1 -0
  125. package/dist/types/protocols/types.d.ts +24 -0
  126. package/dist/types/protocols/types.d.ts.map +1 -0
  127. package/dist/types/protocols/types.js +50 -0
  128. package/dist/types/protocols/types.js.map +1 -0
  129. package/dist/types/txRaw.d.ts.map +1 -0
  130. package/dist/types/txRaw.js.map +1 -0
  131. package/dist/{proto-types → types}/utils.d.ts +2 -1
  132. package/dist/types/utils.d.ts.map +1 -0
  133. package/dist/types/utils.js.map +1 -0
  134. package/dist/types/wasmx/aminoRegistry.d.ts +3 -0
  135. package/dist/types/wasmx/aminoRegistry.d.ts.map +1 -0
  136. package/dist/types/wasmx/aminoRegistry.js.map +1 -0
  137. package/dist/{proto-types → types}/web3Extension.d.ts +1 -1
  138. package/dist/types/web3Extension.d.ts.map +1 -0
  139. package/dist/{proto-types → types}/web3Extension.js +3 -3
  140. package/dist/types/web3Extension.js.map +1 -0
  141. package/dist/utils/addressLists.d.ts +1 -4
  142. package/dist/utils/addressLists.d.ts.map +1 -1
  143. package/dist/utils/addressLists.js +28 -44
  144. package/dist/utils/addressLists.js.map +1 -1
  145. package/dist/utils/aliases.d.ts +1 -1
  146. package/dist/utils/aliases.d.ts.map +1 -1
  147. package/dist/utils/api-sdk.d.ts +40 -45
  148. package/dist/utils/api-sdk.d.ts.map +1 -1
  149. package/dist/utils/api-sdk.js +84 -137
  150. package/dist/utils/api-sdk.js.map +1 -1
  151. package/dist/utils/api-utils.d.ts +3 -2
  152. package/dist/utils/api-utils.d.ts.map +1 -1
  153. package/dist/utils/api-utils.js +19 -37
  154. package/dist/utils/api-utils.js.map +1 -1
  155. package/dist/utils/approved_transfers_casts.d.ts.map +1 -1
  156. package/dist/utils/approved_transfers_casts.js +27 -24
  157. package/dist/utils/approved_transfers_casts.js.map +1 -1
  158. package/dist/utils/badgeMetadata.d.ts +4 -4
  159. package/dist/utils/badgeMetadata.d.ts.map +1 -1
  160. package/dist/utils/badgeMetadata.js +19 -17
  161. package/dist/utils/badgeMetadata.js.map +1 -1
  162. package/dist/utils/balances.d.ts +12 -16
  163. package/dist/utils/balances.d.ts.map +1 -1
  164. package/dist/utils/balances.js +119 -141
  165. package/dist/utils/balances.js.map +1 -1
  166. package/dist/utils/batch-utils.d.ts +11 -4
  167. package/dist/utils/batch-utils.d.ts.map +1 -1
  168. package/dist/utils/batch-utils.js +41 -20
  169. package/dist/utils/batch-utils.js.map +1 -1
  170. package/dist/utils/chains.d.ts +0 -2
  171. package/dist/utils/chains.d.ts.map +1 -1
  172. package/dist/utils/chains.js +12 -15
  173. package/dist/utils/chains.js.map +1 -1
  174. package/dist/utils/constants.d.ts.map +1 -1
  175. package/dist/utils/constants.js +5 -4
  176. package/dist/utils/constants.js.map +1 -1
  177. package/dist/utils/display.d.ts +1 -1
  178. package/dist/utils/display.d.ts.map +1 -1
  179. package/dist/utils/display.js +7 -5
  180. package/dist/utils/display.js.map +1 -1
  181. package/dist/utils/distribution.d.ts +4 -4
  182. package/dist/utils/distribution.d.ts.map +1 -1
  183. package/dist/utils/distribution.js +32 -31
  184. package/dist/utils/distribution.js.map +1 -1
  185. package/dist/utils/firstMatches.d.ts +2 -2
  186. package/dist/utils/firstMatches.d.ts.map +1 -1
  187. package/dist/utils/firstMatches.js +20 -19
  188. package/dist/utils/firstMatches.js.map +1 -1
  189. package/dist/utils/index.d.ts +1 -2
  190. package/dist/utils/index.d.ts.map +1 -1
  191. package/dist/utils/index.js +1 -2
  192. package/dist/utils/index.js.map +1 -1
  193. package/dist/utils/math.d.ts +8 -2
  194. package/dist/utils/math.d.ts.map +1 -1
  195. package/dist/utils/math.js +63 -15
  196. package/dist/utils/math.js.map +1 -1
  197. package/dist/utils/metadataIds.d.ts +2 -2
  198. package/dist/utils/metadataIds.d.ts.map +1 -1
  199. package/dist/utils/metadataIds.js +8 -8
  200. package/dist/utils/metadataIds.js.map +1 -1
  201. package/dist/utils/node-rest-api/balances.d.ts +1 -1
  202. package/dist/utils/node-rest-api/balances.d.ts.map +1 -1
  203. package/dist/utils/node-rest-api/gov.d.ts +1 -1
  204. package/dist/utils/node-rest-api/gov.d.ts.map +1 -1
  205. package/dist/utils/node-rest-api/staking.d.ts +1 -1
  206. package/dist/utils/node-rest-api/staking.d.ts.map +1 -1
  207. package/dist/utils/overlaps.d.ts.map +1 -1
  208. package/dist/utils/overlaps.js +67 -67
  209. package/dist/utils/overlaps.js.map +1 -1
  210. package/dist/utils/permission_checks.d.ts +10 -10
  211. package/dist/utils/permission_checks.d.ts.map +1 -1
  212. package/dist/utils/permission_checks.js +58 -57
  213. package/dist/utils/permission_checks.js.map +1 -1
  214. package/dist/utils/permissions.d.ts +2 -2
  215. package/dist/utils/permissions.d.ts.map +1 -1
  216. package/dist/utils/permissions.js +20 -18
  217. package/dist/utils/permissions.js.map +1 -1
  218. package/dist/utils/types/activity.d.ts +51 -74
  219. package/dist/utils/types/activity.d.ts.map +1 -1
  220. package/dist/utils/types/activity.js +118 -105
  221. package/dist/utils/types/activity.js.map +1 -1
  222. package/dist/utils/types/api.d.ts +349 -134
  223. package/dist/utils/types/api.d.ts.map +1 -1
  224. package/dist/utils/types/api.js +512 -248
  225. package/dist/utils/types/api.js.map +1 -1
  226. package/dist/utils/types/coin.d.ts +9 -3
  227. package/dist/utils/types/coin.d.ts.map +1 -1
  228. package/dist/utils/types/coin.js +17 -9
  229. package/dist/utils/types/coin.js.map +1 -1
  230. package/dist/utils/types/collections.d.ts +263 -26
  231. package/dist/utils/types/collections.d.ts.map +1 -1
  232. package/dist/utils/types/collections.js +717 -99
  233. package/dist/utils/types/collections.js.map +1 -1
  234. package/dist/utils/types/db.d.ts +434 -187
  235. package/dist/utils/types/db.d.ts.map +1 -1
  236. package/dist/utils/types/db.js +859 -502
  237. package/dist/utils/types/db.js.map +1 -1
  238. package/dist/utils/types/indexer.d.ts +2 -2
  239. package/dist/utils/types/indexer.d.ts.map +1 -1
  240. package/dist/utils/types/metadata.d.ts +77 -9
  241. package/dist/utils/types/metadata.d.ts.map +1 -1
  242. package/dist/utils/types/metadata.js +133 -18
  243. package/dist/utils/types/metadata.js.map +1 -1
  244. package/dist/utils/types/routes.d.ts +49 -47
  245. package/dist/utils/types/routes.d.ts.map +1 -1
  246. package/dist/utils/types/routes.js +50 -93
  247. package/dist/utils/types/routes.js.map +1 -1
  248. package/dist/utils/types/schemas.d.ts +120 -0
  249. package/dist/utils/types/schemas.d.ts.map +1 -0
  250. package/dist/utils/types/schemas.js +261 -0
  251. package/dist/utils/types/schemas.js.map +1 -0
  252. package/dist/utils/types/transfers.d.ts +11 -5
  253. package/dist/utils/types/transfers.d.ts.map +1 -1
  254. package/dist/utils/types/transfers.js +22 -13
  255. package/dist/utils/types/transfers.js.map +1 -1
  256. package/dist/utils/types/types.d.ts +6 -6
  257. package/dist/utils/types/types.d.ts.map +1 -1
  258. package/dist/utils/types/types.js +3 -6
  259. package/dist/utils/types/types.js.map +1 -1
  260. package/dist/utils/types/users.d.ts +125 -15
  261. package/dist/utils/types/users.d.ts.map +1 -1
  262. package/dist/utils/types/users.js +275 -57
  263. package/dist/utils/types/users.js.map +1 -1
  264. package/dist/utils/uintRanges.d.ts +10 -14
  265. package/dist/utils/uintRanges.d.ts.map +1 -1
  266. package/dist/utils/uintRanges.js +53 -65
  267. package/dist/utils/uintRanges.js.map +1 -1
  268. package/dist/utils/update_checks.d.ts +2 -2
  269. package/dist/utils/update_checks.d.ts.map +1 -1
  270. package/dist/utils/update_checks.js +247 -185
  271. package/dist/utils/update_checks.js.map +1 -1
  272. package/dist/utils/userApprovals.d.ts.map +1 -1
  273. package/dist/utils/userApprovals.js +19 -34
  274. package/dist/utils/userApprovals.js.map +1 -1
  275. package/dist/utils/validate_permissions_updates.d.ts +2 -2
  276. package/dist/utils/validate_permissions_updates.d.ts.map +1 -1
  277. package/dist/utils/validate_permissions_updates.js.map +1 -1
  278. package/package.json +8 -16
  279. package/dist/proto-types/badges/aminoRegistry.d.ts +0 -3
  280. package/dist/proto-types/badges/aminoRegistry.d.ts.map +0 -1
  281. package/dist/proto-types/badges/aminoRegistry.js.map +0 -1
  282. package/dist/proto-types/badges/string-numbers.d.ts.map +0 -1
  283. package/dist/proto-types/badges/string-numbers.js.map +0 -1
  284. package/dist/proto-types/badges/typeutils/approvals.d.ts +0 -127
  285. package/dist/proto-types/badges/typeutils/approvals.d.ts.map +0 -1
  286. package/dist/proto-types/badges/typeutils/approvals.js +0 -209
  287. package/dist/proto-types/badges/typeutils/approvals.js.map +0 -1
  288. package/dist/proto-types/badges/typeutils/permissions.d.ts +0 -88
  289. package/dist/proto-types/badges/typeutils/permissions.d.ts.map +0 -1
  290. package/dist/proto-types/badges/typeutils/permissions.js +0 -124
  291. package/dist/proto-types/badges/typeutils/permissions.js.map +0 -1
  292. package/dist/proto-types/badges/typeutils/typeUtils.d.ts +0 -119
  293. package/dist/proto-types/badges/typeutils/typeUtils.d.ts.map +0 -1
  294. package/dist/proto-types/badges/typeutils/typeUtils.js +0 -146
  295. package/dist/proto-types/badges/typeutils/typeUtils.js.map +0 -1
  296. package/dist/proto-types/base.d.ts.map +0 -1
  297. package/dist/proto-types/base.js.map +0 -1
  298. package/dist/proto-types/protocols/aminoRegistry.d.ts +0 -3
  299. package/dist/proto-types/protocols/aminoRegistry.d.ts.map +0 -1
  300. package/dist/proto-types/protocols/aminoRegistry.js.map +0 -1
  301. package/dist/proto-types/protocols/types.d.ts +0 -8
  302. package/dist/proto-types/protocols/types.d.ts.map +0 -1
  303. package/dist/proto-types/protocols/types.js +0 -3
  304. package/dist/proto-types/protocols/types.js.map +0 -1
  305. package/dist/proto-types/txRaw.d.ts.map +0 -1
  306. package/dist/proto-types/txRaw.js.map +0 -1
  307. package/dist/proto-types/utils.d.ts.map +0 -1
  308. package/dist/proto-types/utils.js.map +0 -1
  309. package/dist/proto-types/wasmx/aminoRegistry.d.ts +0 -3
  310. package/dist/proto-types/wasmx/aminoRegistry.d.ts.map +0 -1
  311. package/dist/proto-types/wasmx/aminoRegistry.js.map +0 -1
  312. package/dist/proto-types/web3Extension.d.ts.map +0 -1
  313. package/dist/proto-types/web3Extension.js.map +0 -1
  314. package/dist/utils/collections.d.ts +0 -7
  315. package/dist/utils/collections.d.ts.map +0 -1
  316. package/dist/utils/collections.js +0 -99
  317. package/dist/utils/collections.js.map +0 -1
  318. package/dist/utils/timeline_helpers.d.ts +0 -30
  319. package/dist/utils/timeline_helpers.d.ts.map +0 -1
  320. package/dist/utils/timeline_helpers.js +0 -74
  321. package/dist/utils/timeline_helpers.js.map +0 -1
  322. package/dist/utils/timelines.d.ts +0 -32
  323. package/dist/utils/timelines.d.ts.map +0 -1
  324. package/dist/utils/timelines.js +0 -106
  325. package/dist/utils/timelines.js.map +0 -1
  326. package/dist/utils/types/utils.d.ts +0 -2
  327. package/dist/utils/types/utils.d.ts.map +0 -1
  328. package/dist/utils/types/utils.js +0 -26
  329. package/dist/utils/types/utils.js.map +0 -1
  330. package/dist/utils/utils/compare.d.ts +0 -2
  331. package/dist/utils/utils/compare.d.ts.map +0 -1
  332. package/dist/utils/utils/compare.js +0 -42
  333. package/dist/utils/utils/compare.js.map +0 -1
  334. /package/dist/{proto-types → types}/badges/aminoRegistry.js +0 -0
  335. /package/dist/{proto-types → types}/badges/string-numbers.js +0 -0
  336. /package/dist/{proto-types → types}/base.js +0 -0
  337. /package/dist/{proto-types → types}/protocols/aminoRegistry.js +0 -0
  338. /package/dist/{proto-types → types}/txRaw.d.ts +0 -0
  339. /package/dist/{proto-types → types}/txRaw.js +0 -0
  340. /package/dist/{proto-types → types}/utils.js +0 -0
  341. /package/dist/{proto-types → types}/wasmx/aminoRegistry.js +0 -0
@@ -1,539 +1,896 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FollowDetailsSchema = exports.BlockinAuthSignatureSchema = exports.ComplianceSchema = exports.IPFSTotalsSchema = exports.AirdropSchema = exports.RefreshSchema = exports.FetchSchema = exports.ApprovalTrackerSchema = exports.ChallengeSchema = exports.PasswordSchema = exports.BalanceSchema = exports.AddressListSchema = exports.StatusSchema = exports.QueueSchema = exports.ProfileSchema = exports.AccountSchema = exports.CollectionSchema = exports.UserProtocolCollectionsSchema = exports.ProtocolSchema = exports.convertUserProtocolCollectionsDoc = exports.convertProtocolDoc = exports.convertFollowDetailsDoc = exports.convertBlockinAuthSignatureDoc = exports.convertComplianceDoc = exports.convertIPFSTotalsDoc = exports.convertAirdropDoc = exports.convertRefreshDoc = exports.convertFetchDoc = exports.convertApprovalInfoDetails = exports.convertMerkleChallengeWithDetails = exports.convertMerkleChallengeIdDetails = exports.convertMerkleChallengeDoc = exports.convertChallengeTrackerIdDetails = exports.convertApprovalTrackerDoc = exports.convertChallengeDetails = exports.convertPasswordDoc = exports.convertBalanceDocWithDetails = exports.convertBalanceDoc = exports.convertAddressListDoc = exports.convertAddressListInfoBase = exports.convertAddressListEditKey = exports.convertStatusDoc = exports.convertLatestBlockStatus = exports.convertQueueDoc = exports.convertProfileDoc = exports.convertAccountDoc = exports.convertCollectionDoc = void 0;
7
- const __1 = require("../..");
3
+ exports.UserProtocolCollectionsDoc = exports.ProtocolDoc = exports.FollowDetailsDoc = exports.BlockinAuthSignatureDoc = exports.ComplianceDoc = exports.IPFSTotalsDoc = exports.AirdropDoc = exports.RefreshDoc = exports.FetchDoc = exports.ApprovalInfoDetails = exports.MerkleChallengeWithDetails = exports.MerkleChallengeIdDetails = exports.MerkleChallengeDoc = exports.ChallengeTrackerIdDetails = exports.ApprovalTrackerDoc = exports.ChallengeDetails = exports.PasswordDoc = exports.BalanceDocWithDetails = exports.BalanceDoc = exports.convertClassPropertiesToJson = exports.AddressListDoc = exports.AddressListEditKey = exports.StatusDoc = exports.LatestBlockStatus = exports.QueueDoc = exports.ProfileDoc = exports.AccountDoc = exports.CollectionDoc = void 0;
8
4
  const blockin_1 = require("blockin");
9
- const mongoose_1 = __importDefault(require("mongoose"));
5
+ const __1 = require("../..");
6
+ const batch_utils_1 = require("../batch-utils");
10
7
  const coin_1 = require("./coin");
11
- const collections_1 = require("./collections");
12
- const metadata_1 = require("./metadata");
13
- ;
14
8
  const transfers_1 = require("./transfers");
15
- const users_1 = require("./users");
16
- const utils_1 = require("./utils");
17
- function convertCollectionDoc(item, convertFunction) {
18
- return (0, utils_1.deepCopy)({
19
- ...item,
20
- collectionId: convertFunction(item.collectionId),
21
- collectionMetadataTimeline: item.collectionMetadataTimeline.map((collectionMetadataTimeline) => (0, __1.convertCollectionMetadataTimeline)(collectionMetadataTimeline, convertFunction)),
22
- badgeMetadataTimeline: item.badgeMetadataTimeline.map((badgeMetadataTimeline) => (0, __1.convertBadgeMetadataTimeline)(badgeMetadataTimeline, convertFunction)),
23
- offChainBalancesMetadataTimeline: item.offChainBalancesMetadataTimeline.map((offChainBalancesMetadataTimeline) => (0, __1.convertOffChainBalancesMetadataTimeline)(offChainBalancesMetadataTimeline, convertFunction)),
24
- customDataTimeline: item.customDataTimeline.map((customDataTimeline) => (0, __1.convertCustomDataTimeline)(customDataTimeline, convertFunction)),
25
- managerTimeline: item.managerTimeline.map((managerTimeline) => (0, __1.convertManagerTimeline)(managerTimeline, convertFunction)),
26
- collectionPermissions: (0, __1.convertCollectionPermissions)(item.collectionPermissions, convertFunction),
27
- collectionApprovals: item.collectionApprovals.map((collectionApprovals) => (0, __1.convertCollectionApproval)(collectionApprovals, convertFunction)),
28
- standardsTimeline: item.standardsTimeline.map((standardsTimeline) => (0, __1.convertStandardsTimeline)(standardsTimeline, convertFunction)),
29
- isArchivedTimeline: item.isArchivedTimeline.map((isArchivedTimeline) => (0, __1.convertIsArchivedTimeline)(isArchivedTimeline, convertFunction)),
30
- defaultBalances: (0, __1.convertUserBalanceStore)(item.defaultBalances, convertFunction),
31
- createdBlock: convertFunction(item.createdBlock),
32
- createdTimestamp: convertFunction(item.createdTimestamp),
33
- updateHistory: item.updateHistory.map((updateHistory) => ({
34
- txHash: updateHistory.txHash,
35
- block: convertFunction(updateHistory.block),
36
- blockTimestamp: convertFunction(updateHistory.blockTimestamp),
37
- })),
38
- });
9
+ class CollectionDoc extends __1.BaseNumberTypeClass {
10
+ _docId;
11
+ _id;
12
+ collectionId;
13
+ collectionMetadataTimeline;
14
+ badgeMetadataTimeline;
15
+ balancesType;
16
+ offChainBalancesMetadataTimeline;
17
+ customDataTimeline;
18
+ managerTimeline;
19
+ collectionPermissions;
20
+ collectionApprovals;
21
+ standardsTimeline;
22
+ isArchivedTimeline;
23
+ defaultBalances;
24
+ createdBy;
25
+ createdBlock;
26
+ createdTimestamp;
27
+ updateHistory;
28
+ aliasAddress;
29
+ constructor(data) {
30
+ super();
31
+ this._docId = data._docId;
32
+ this._id = data._id;
33
+ this.collectionId = data.collectionId;
34
+ this.collectionMetadataTimeline = data.collectionMetadataTimeline.map((collectionMetadataTimeline) => new __1.CollectionMetadataTimeline(collectionMetadataTimeline));
35
+ this.badgeMetadataTimeline = data.badgeMetadataTimeline.map((badgeMetadataTimeline) => new __1.BadgeMetadataTimeline(badgeMetadataTimeline));
36
+ this.balancesType = data.balancesType;
37
+ this.offChainBalancesMetadataTimeline = data.offChainBalancesMetadataTimeline.map((offChainBalancesMetadataTimeline) => new __1.OffChainBalancesMetadataTimeline(offChainBalancesMetadataTimeline));
38
+ this.customDataTimeline = data.customDataTimeline.map((customDataTimeline) => new __1.CustomDataTimeline(customDataTimeline));
39
+ this.managerTimeline = data.managerTimeline.map((managerTimeline) => new __1.ManagerTimeline(managerTimeline));
40
+ this.collectionPermissions = new __1.CollectionPermissions(data.collectionPermissions);
41
+ this.collectionApprovals = data.collectionApprovals.map((collectionApproval) => new __1.CollectionApproval(collectionApproval));
42
+ this.standardsTimeline = data.standardsTimeline.map((standardsTimeline) => new __1.StandardsTimeline(standardsTimeline));
43
+ this.isArchivedTimeline = data.isArchivedTimeline.map((isArchivedTimeline) => new __1.IsArchivedTimeline(isArchivedTimeline));
44
+ this.defaultBalances = new __1.UserBalanceStore(data.defaultBalances);
45
+ this.createdBy = data.createdBy;
46
+ this.createdBlock = data.createdBlock;
47
+ this.createdTimestamp = data.createdTimestamp;
48
+ this.updateHistory = data.updateHistory;
49
+ this.aliasAddress = data.aliasAddress;
50
+ }
51
+ convert(convertFunction) {
52
+ return new CollectionDoc((0, __1.deepCopy)({
53
+ ...this,
54
+ collectionId: convertFunction(this.collectionId),
55
+ collectionMetadataTimeline: this.collectionMetadataTimeline.map((collectionMetadataTimeline) => collectionMetadataTimeline.convert(convertFunction)),
56
+ badgeMetadataTimeline: this.badgeMetadataTimeline.map((badgeMetadataTimeline) => badgeMetadataTimeline.convert(convertFunction)),
57
+ offChainBalancesMetadataTimeline: this.offChainBalancesMetadataTimeline.map((offChainBalancesMetadataTimeline) => offChainBalancesMetadataTimeline.convert(convertFunction)),
58
+ customDataTimeline: this.customDataTimeline.map((customDataTimeline) => customDataTimeline.convert(convertFunction)),
59
+ managerTimeline: this.managerTimeline.map((managerTimeline) => managerTimeline.convert(convertFunction)),
60
+ collectionPermissions: this.collectionPermissions.convert(convertFunction),
61
+ collectionApprovals: this.collectionApprovals.map((collectionApproval) => collectionApproval.convert(convertFunction)),
62
+ standardsTimeline: this.standardsTimeline.map((standardsTimeline) => standardsTimeline.convert(convertFunction)),
63
+ isArchivedTimeline: this.isArchivedTimeline.map((isArchivedTimeline) => isArchivedTimeline.convert(convertFunction)),
64
+ defaultBalances: this.defaultBalances.convert(convertFunction),
65
+ createdBlock: convertFunction(this.createdBlock),
66
+ createdTimestamp: convertFunction(this.createdTimestamp),
67
+ updateHistory: this.updateHistory.map((updateHistory) => ({
68
+ ...updateHistory,
69
+ block: convertFunction(updateHistory.block),
70
+ blockTimestamp: convertFunction(updateHistory.blockTimestamp),
71
+ })),
72
+ }));
73
+ }
39
74
  }
40
- exports.convertCollectionDoc = convertCollectionDoc;
41
- function convertAccountDoc(item, convertFunction) {
42
- return (0, utils_1.deepCopy)({
43
- ...item,
44
- accountNumber: convertFunction(item.accountNumber),
45
- sequence: item.sequence ? convertFunction(item.sequence) : undefined,
46
- balance: item.balance ? (0, coin_1.convertCosmosCoin)(item.balance, convertFunction) : undefined
47
- });
75
+ exports.CollectionDoc = CollectionDoc;
76
+ class AccountDoc extends __1.BaseNumberTypeClass {
77
+ _docId;
78
+ _id;
79
+ publicKey;
80
+ accountNumber;
81
+ pubKeyType;
82
+ cosmosAddress;
83
+ ethAddress;
84
+ solAddress;
85
+ btcAddress;
86
+ sequence;
87
+ balance;
88
+ constructor(data) {
89
+ super();
90
+ this._docId = data._docId;
91
+ this._id = data._id;
92
+ this.publicKey = data.publicKey;
93
+ this.accountNumber = data.accountNumber;
94
+ this.pubKeyType = data.pubKeyType;
95
+ this.cosmosAddress = data.cosmosAddress;
96
+ this.ethAddress = data.ethAddress;
97
+ this.solAddress = data.solAddress;
98
+ this.btcAddress = data.btcAddress;
99
+ this.sequence = data.sequence;
100
+ this.balance = data.balance ? new coin_1.CosmosCoin(data.balance) : undefined;
101
+ }
102
+ convert(convertFunction) {
103
+ return new AccountDoc((0, __1.deepCopy)({
104
+ ...this,
105
+ accountNumber: convertFunction(this.accountNumber),
106
+ sequence: convertFunction(this.sequence),
107
+ balance: this.balance?.convert(convertFunction),
108
+ }));
109
+ }
48
110
  }
49
- exports.convertAccountDoc = convertAccountDoc;
50
- function convertProfileDoc(item, convertFunction) {
51
- return (0, utils_1.deepCopy)({
52
- ...item,
53
- seenActivity: item.seenActivity ? convertFunction(item.seenActivity) : undefined,
54
- createdAt: item.createdAt ? convertFunction(item.createdAt) : undefined,
55
- hiddenBadges: item.hiddenBadges ? item.hiddenBadges.map((hiddenBadge) => ({
56
- collectionId: convertFunction(hiddenBadge.collectionId),
57
- badgeIds: hiddenBadge.badgeIds.map((badgeId) => (0, __1.convertUintRange)(badgeId, convertFunction)),
58
- })) : undefined,
59
- customPages: item.customPages ? {
60
- badges: item.customPages.badges.map((customPage) => ({
61
- title: customPage.title,
62
- description: customPage.description,
63
- items: customPage.items.map((badge) => ({
64
- collectionId: convertFunction(badge.collectionId),
65
- badgeIds: badge.badgeIds.map((badgeId) => (0, __1.convertUintRange)(badgeId, convertFunction)),
111
+ exports.AccountDoc = AccountDoc;
112
+ class ProfileDoc extends __1.BaseNumberTypeClass {
113
+ _docId;
114
+ _id;
115
+ fetchedProfile;
116
+ seenActivity;
117
+ createdAt;
118
+ discord;
119
+ twitter;
120
+ github;
121
+ telegram;
122
+ readme;
123
+ customLinks;
124
+ hiddenBadges;
125
+ hiddenLists;
126
+ customPages;
127
+ watchlists;
128
+ profilePicUrl;
129
+ username;
130
+ latestSignedInChain;
131
+ solAddress;
132
+ notifications;
133
+ constructor(data) {
134
+ super();
135
+ this._docId = data._docId;
136
+ this._id = data._id;
137
+ this.fetchedProfile = data.fetchedProfile;
138
+ this.seenActivity = data.seenActivity;
139
+ this.createdAt = data.createdAt;
140
+ this.discord = data.discord;
141
+ this.twitter = data.twitter;
142
+ this.github = data.github;
143
+ this.telegram = data.telegram;
144
+ this.readme = data.readme;
145
+ this.customLinks = data.customLinks;
146
+ this.hiddenBadges = data.hiddenBadges?.map((hiddenBadge) => new batch_utils_1.BatchBadgeDetails(hiddenBadge));
147
+ this.hiddenLists = data.hiddenLists;
148
+ this.customPages = data.customPages;
149
+ this.watchlists = data.watchlists;
150
+ this.profilePicUrl = data.profilePicUrl;
151
+ this.username = data.username;
152
+ this.latestSignedInChain = data.latestSignedInChain;
153
+ this.solAddress = data.solAddress;
154
+ this.notifications = data.notifications;
155
+ }
156
+ convert(convertFunction) {
157
+ return new ProfileDoc((0, __1.deepCopy)({
158
+ ...this,
159
+ hiddenBadges: this.hiddenBadges?.map((hiddenBadge) => hiddenBadge.convert(convertFunction)),
160
+ customPages: this.customPages ? {
161
+ badges: this.customPages?.badges.map((customPage) => ({
162
+ title: customPage.title,
163
+ description: customPage.description,
164
+ items: customPage.items.map((badge) => badge.convert(convertFunction)),
66
165
  })),
67
- })),
68
- lists: item.customPages.lists.map((customPage) => ({
69
- title: customPage.title,
70
- description: customPage.description,
71
- items: customPage.items,
72
- })),
73
- } : undefined,
74
- watchlists: item.watchlists ? {
75
- badges: item.watchlists.badges.map((customPage) => ({
76
- title: customPage.title,
77
- description: customPage.description,
78
- items: customPage.items.map((badge) => ({
79
- collectionId: convertFunction(badge.collectionId),
80
- badgeIds: badge.badgeIds.map((badgeId) => (0, __1.convertUintRange)(badgeId, convertFunction)),
166
+ lists: this.customPages?.lists.map((customPage) => ({
167
+ title: customPage.title,
168
+ description: customPage.description,
169
+ items: customPage.items,
81
170
  })),
82
- })),
83
- lists: item.watchlists.lists.map((customPage) => ({
84
- title: customPage.title,
85
- description: customPage.description,
86
- items: customPage.items,
87
- })),
88
- } : undefined,
89
- notifications: item.notifications ? {
90
- email: item.notifications.email,
91
- emailVerification: item.notifications.emailVerification ? {
92
- verified: item.notifications.emailVerification.verified,
93
- token: item.notifications.emailVerification.token,
94
- expiry: item.notifications.emailVerification.expiry ? convertFunction(item.notifications.emailVerification.expiry) : undefined,
95
- antiPhishingCode: item.notifications.emailVerification.antiPhishingCode,
96
171
  } : undefined,
97
- preferences: item.notifications.preferences,
98
- } : undefined,
99
- });
172
+ watchlists: this.watchlists ? {
173
+ badges: this.watchlists.badges.map((customPage) => ({
174
+ title: customPage.title,
175
+ description: customPage.description,
176
+ items: customPage.items.map((badge) => badge.convert(convertFunction)),
177
+ })),
178
+ lists: this.watchlists.lists.map((customPage) => ({
179
+ title: customPage.title,
180
+ description: customPage.description,
181
+ items: customPage.items,
182
+ })),
183
+ } : undefined,
184
+ seenActivity: this.seenActivity ? convertFunction(this.seenActivity) : undefined,
185
+ createdAt: this.createdAt ? convertFunction(this.createdAt) : undefined,
186
+ notifications: this.notifications ? {
187
+ email: this.notifications.email,
188
+ emailVerification: this.notifications.emailVerification ? {
189
+ verified: this.notifications.emailVerification.verified,
190
+ token: this.notifications.emailVerification.token,
191
+ expiry: this.notifications.emailVerification.expiry ? convertFunction(this.notifications.emailVerification.expiry) : undefined,
192
+ antiPhishingCode: this.notifications.emailVerification.antiPhishingCode,
193
+ } : undefined,
194
+ preferences: this.notifications.preferences,
195
+ } : undefined,
196
+ }));
197
+ }
100
198
  }
101
- exports.convertProfileDoc = convertProfileDoc;
102
- ;
103
- function convertQueueDoc(item, convertFunction) {
104
- return (0, utils_1.deepCopy)({
105
- ...item,
106
- collectionId: convertFunction(item.collectionId),
107
- loadBalanceId: convertFunction(item.loadBalanceId),
108
- refreshRequestTime: convertFunction(item.refreshRequestTime),
109
- numRetries: convertFunction(item.numRetries),
110
- lastFetchedAt: item.lastFetchedAt ? convertFunction(item.lastFetchedAt) : undefined,
111
- deletedAt: item.deletedAt ? convertFunction(item.deletedAt) : undefined,
112
- nextFetchTime: item.nextFetchTime ? convertFunction(item.nextFetchTime) : undefined,
113
- });
199
+ exports.ProfileDoc = ProfileDoc;
200
+ class QueueDoc extends __1.BaseNumberTypeClass {
201
+ _docId;
202
+ _id;
203
+ uri;
204
+ collectionId;
205
+ loadBalanceId;
206
+ refreshRequestTime;
207
+ numRetries;
208
+ lastFetchedAt;
209
+ error;
210
+ deletedAt;
211
+ nextFetchTime;
212
+ emailMessage;
213
+ recipientAddress;
214
+ activityDocId;
215
+ notificationType;
216
+ constructor(data) {
217
+ super();
218
+ this._docId = data._docId;
219
+ this._id = data._id;
220
+ this.uri = data.uri;
221
+ this.collectionId = data.collectionId;
222
+ this.loadBalanceId = data.loadBalanceId;
223
+ this.refreshRequestTime = data.refreshRequestTime;
224
+ this.numRetries = data.numRetries;
225
+ this.lastFetchedAt = data.lastFetchedAt;
226
+ this.error = data.error;
227
+ this.deletedAt = data.deletedAt;
228
+ this.nextFetchTime = data.nextFetchTime;
229
+ this.emailMessage = data.emailMessage;
230
+ this.recipientAddress = data.recipientAddress;
231
+ this.activityDocId = data.activityDocId;
232
+ this.notificationType = data.notificationType;
233
+ }
234
+ convert(convertFunction) {
235
+ return new QueueDoc((0, __1.deepCopy)({
236
+ ...this,
237
+ collectionId: convertFunction(this.collectionId),
238
+ loadBalanceId: convertFunction(this.loadBalanceId),
239
+ refreshRequestTime: convertFunction(this.refreshRequestTime),
240
+ numRetries: convertFunction(this.numRetries),
241
+ lastFetchedAt: this.lastFetchedAt ? convertFunction(this.lastFetchedAt) : undefined,
242
+ deletedAt: this.deletedAt ? convertFunction(this.deletedAt) : undefined,
243
+ nextFetchTime: this.nextFetchTime ? convertFunction(this.nextFetchTime) : undefined,
244
+ }));
245
+ }
114
246
  }
115
- exports.convertQueueDoc = convertQueueDoc;
116
- function convertLatestBlockStatus(item, convertFunction) {
117
- return (0, utils_1.deepCopy)({
118
- ...item,
119
- height: convertFunction(item.height),
120
- txIndex: convertFunction(item.txIndex),
121
- timestamp: convertFunction(item.timestamp),
122
- });
247
+ exports.QueueDoc = QueueDoc;
248
+ class LatestBlockStatus extends __1.BaseNumberTypeClass {
249
+ height;
250
+ txIndex;
251
+ timestamp;
252
+ constructor(data) {
253
+ super();
254
+ this.height = data.height;
255
+ this.txIndex = data.txIndex;
256
+ this.timestamp = data.timestamp;
257
+ }
258
+ convert(convertFunction) {
259
+ return new LatestBlockStatus((0, __1.deepCopy)({
260
+ height: convertFunction(this.height),
261
+ txIndex: convertFunction(this.txIndex),
262
+ timestamp: convertFunction(this.timestamp),
263
+ }));
264
+ }
123
265
  }
124
- exports.convertLatestBlockStatus = convertLatestBlockStatus;
125
- function convertStatusDoc(item, convertFunction) {
126
- return (0, utils_1.deepCopy)({
127
- ...item,
128
- block: convertLatestBlockStatus(item.block, convertFunction),
129
- nextCollectionId: convertFunction(item.nextCollectionId),
130
- lastXGasLimits: item.lastXGasLimits.map((gasLimit) => convertFunction(gasLimit)),
131
- lastXGasAmounts: item.lastXGasAmounts.map((gasAmount) => convertFunction(gasAmount)),
132
- });
266
+ exports.LatestBlockStatus = LatestBlockStatus;
267
+ class StatusDoc extends __1.BaseNumberTypeClass {
268
+ _docId;
269
+ _id;
270
+ block;
271
+ nextCollectionId;
272
+ gasPrice;
273
+ lastXGasAmounts;
274
+ lastXGasLimits;
275
+ constructor(data) {
276
+ super();
277
+ this._docId = data._docId;
278
+ this._id = data._id;
279
+ this.block = new LatestBlockStatus(data.block);
280
+ this.nextCollectionId = data.nextCollectionId;
281
+ this.gasPrice = data.gasPrice;
282
+ this.lastXGasAmounts = data.lastXGasAmounts;
283
+ this.lastXGasLimits = data.lastXGasLimits;
284
+ }
285
+ convert(convertFunction) {
286
+ return new StatusDoc((0, __1.deepCopy)({
287
+ ...this,
288
+ block: this.block.convert(convertFunction),
289
+ nextCollectionId: convertFunction(this.nextCollectionId),
290
+ lastXGasLimits: this.lastXGasLimits.map((gasLimit) => convertFunction(gasLimit)),
291
+ lastXGasAmounts: this.lastXGasAmounts.map((gasAmount) => convertFunction(gasAmount)),
292
+ }));
293
+ }
133
294
  }
134
- exports.convertStatusDoc = convertStatusDoc;
135
- function convertAddressListEditKey(item, convertFunction) {
136
- return (0, utils_1.deepCopy)({
137
- ...item,
138
- expirationDate: convertFunction(item.expirationDate),
139
- });
295
+ exports.StatusDoc = StatusDoc;
296
+ class AddressListEditKey extends __1.BaseNumberTypeClass {
297
+ key;
298
+ expirationDate;
299
+ mustSignIn;
300
+ constructor(data) {
301
+ super();
302
+ this.key = data.key;
303
+ this.expirationDate = data.expirationDate;
304
+ this.mustSignIn = data.mustSignIn;
305
+ }
306
+ convert(convertFunction) {
307
+ return new AddressListEditKey((0, __1.deepCopy)({
308
+ ...this,
309
+ expirationDate: convertFunction(this.expirationDate),
310
+ }));
311
+ }
140
312
  }
141
- exports.convertAddressListEditKey = convertAddressListEditKey;
142
- function convertAddressListInfoBase(item, convertFunction) {
143
- return (0, utils_1.deepCopy)({
144
- ...item,
145
- updateHistory: item.updateHistory.map((updateHistory) => ({
146
- txHash: updateHistory.txHash,
147
- block: convertFunction(updateHistory.block),
148
- blockTimestamp: convertFunction(updateHistory.blockTimestamp),
149
- })),
150
- createdBlock: convertFunction(item.createdBlock),
151
- lastUpdated: convertFunction(item.lastUpdated),
152
- editKeys: item.editKeys ? item.editKeys.map((editKey) => convertAddressListEditKey(editKey, convertFunction)) : undefined,
153
- });
313
+ exports.AddressListEditKey = AddressListEditKey;
314
+ class AddressListDoc extends __1.AddressList {
315
+ _docId;
316
+ _id;
317
+ updateHistory;
318
+ createdBlock;
319
+ lastUpdated;
320
+ nsfw;
321
+ reported;
322
+ private;
323
+ viewableWithLink;
324
+ editKeys;
325
+ constructor(data) {
326
+ super(data);
327
+ this._docId = data._docId;
328
+ this._id = data._id;
329
+ this.createdBy = data.createdBy;
330
+ this.updateHistory = data.updateHistory;
331
+ this.createdBlock = data.createdBlock;
332
+ this.lastUpdated = data.lastUpdated;
333
+ this.nsfw = data.nsfw;
334
+ this.reported = data.reported;
335
+ this.private = data.private;
336
+ this.viewableWithLink = data.viewableWithLink;
337
+ this.editKeys = data.editKeys ? data.editKeys.map((editKey) => new AddressListEditKey(editKey)) : undefined;
338
+ }
339
+ convert(convertFunction) {
340
+ return new AddressListDoc((0, __1.deepCopy)({
341
+ ...this,
342
+ createdBlock: convertFunction(this.createdBlock),
343
+ lastUpdated: convertFunction(this.lastUpdated),
344
+ updateHistory: this.updateHistory.map((updateHistory) => ({
345
+ txHash: updateHistory.txHash,
346
+ block: convertFunction(updateHistory.block),
347
+ blockTimestamp: convertFunction(updateHistory.blockTimestamp),
348
+ })),
349
+ editKeys: this.editKeys ? this.editKeys.map((editKey) => editKey.convert(convertFunction)) : undefined,
350
+ }));
351
+ }
154
352
  }
155
- exports.convertAddressListInfoBase = convertAddressListInfoBase;
156
- function convertAddressListDoc(item, convertFunction) {
157
- return (0, utils_1.deepCopy)({
158
- ...item,
159
- updateHistory: item.updateHistory.map((updateHistory) => ({
160
- ...updateHistory,
161
- block: convertFunction(updateHistory.block),
162
- blockTimestamp: convertFunction(updateHistory.blockTimestamp),
163
- })),
164
- createdBlock: convertFunction(item.createdBlock),
165
- lastUpdated: convertFunction(item.lastUpdated),
166
- editKeys: item.editKeys ? item.editKeys.map((editKey) => convertAddressListEditKey(editKey, convertFunction)) : undefined,
167
- });
353
+ exports.AddressListDoc = AddressListDoc;
354
+ function convertClassPropertiesToJson(obj) {
355
+ const json = {};
356
+ for (const prop in obj) {
357
+ if (Object.prototype.hasOwnProperty.call(obj, prop)) {
358
+ const value = obj[prop];
359
+ if (typeof value !== 'undefined' && typeof value !== 'function') {
360
+ if (Array.isArray(value)) {
361
+ json[prop] = value.map((item) => (typeof item === 'object' && item !== null && typeof item.toJson === 'function') ? item.toJson() : item);
362
+ }
363
+ else if (typeof value === 'object' && value !== null && typeof value.toJson === 'function') {
364
+ json[prop] = value.toJson();
365
+ }
366
+ else {
367
+ json[prop] = value;
368
+ }
369
+ }
370
+ }
371
+ }
372
+ return json;
168
373
  }
169
- exports.convertAddressListDoc = convertAddressListDoc;
170
- function convertBalanceDoc(item, convertFunction) {
171
- return (0, utils_1.deepCopy)({
172
- ...item,
173
- ...(0, __1.convertUserBalanceStore)(item, convertFunction),
174
- incomingApprovals: item.incomingApprovals.map(x => (0, __1.convertUserIncomingApproval)(x, convertFunction)),
175
- outgoingApprovals: item.outgoingApprovals.map(x => (0, __1.convertUserOutgoingApproval)(x, convertFunction)),
176
- collectionId: convertFunction(item.collectionId),
177
- fetchedAt: item.fetchedAt ? convertFunction(item.fetchedAt) : undefined,
178
- fetchedAtBlock: item.fetchedAtBlock ? convertFunction(item.fetchedAtBlock) : undefined,
179
- updateHistory: item.updateHistory.map((updateHistory) => ({
180
- txHash: updateHistory.txHash,
181
- block: convertFunction(updateHistory.block),
182
- blockTimestamp: convertFunction(updateHistory.blockTimestamp),
183
- })),
184
- });
374
+ exports.convertClassPropertiesToJson = convertClassPropertiesToJson;
375
+ class BalanceDoc extends __1.BaseNumberTypeClass {
376
+ _docId;
377
+ _id;
378
+ collectionId;
379
+ cosmosAddress;
380
+ onChain;
381
+ uri;
382
+ fetchedAt;
383
+ fetchedAtBlock;
384
+ isPermanent;
385
+ contentHash;
386
+ updateHistory;
387
+ balances;
388
+ incomingApprovals;
389
+ outgoingApprovals;
390
+ userPermissions;
391
+ autoApproveSelfInitiatedIncomingTransfers;
392
+ autoApproveSelfInitiatedOutgoingTransfers;
393
+ constructor(data) {
394
+ super();
395
+ this._docId = data._docId;
396
+ this._id = data._id;
397
+ this.collectionId = data.collectionId;
398
+ this.cosmosAddress = data.cosmosAddress;
399
+ this.onChain = data.onChain;
400
+ this.uri = data.uri;
401
+ this.fetchedAt = data.fetchedAt;
402
+ this.fetchedAtBlock = data.fetchedAtBlock;
403
+ this.isPermanent = data.isPermanent;
404
+ this.contentHash = data.contentHash;
405
+ this.updateHistory = data.updateHistory;
406
+ this.balances = data.balances.map((balance) => new __1.Balance(balance));
407
+ this.incomingApprovals = data.incomingApprovals.map((incomingApproval) => new __1.UserIncomingApproval(incomingApproval));
408
+ this.outgoingApprovals = data.outgoingApprovals.map((outgoingApproval) => new __1.UserOutgoingApproval(outgoingApproval));
409
+ this.userPermissions = new __1.UserPermissions(data.userPermissions);
410
+ this.autoApproveSelfInitiatedIncomingTransfers = data.autoApproveSelfInitiatedIncomingTransfers;
411
+ this.autoApproveSelfInitiatedOutgoingTransfers = data.autoApproveSelfInitiatedOutgoingTransfers;
412
+ }
413
+ convert(convertFunction) {
414
+ return new BalanceDoc((0, __1.deepCopy)({
415
+ ...this,
416
+ ...new __1.UserBalanceStore(this).convert(convertFunction),
417
+ collectionId: convertFunction(this.collectionId),
418
+ fetchedAt: this.fetchedAt ? convertFunction(this.fetchedAt) : undefined,
419
+ fetchedAtBlock: this.fetchedAtBlock ? convertFunction(this.fetchedAtBlock) : undefined,
420
+ updateHistory: this.updateHistory.map((updateHistory) => ({
421
+ txHash: updateHistory.txHash,
422
+ block: convertFunction(updateHistory.block),
423
+ blockTimestamp: convertFunction(updateHistory.blockTimestamp),
424
+ })),
425
+ }));
426
+ }
185
427
  }
186
- exports.convertBalanceDoc = convertBalanceDoc;
187
- function convertBalanceDocWithDetails(item, convertFunction) {
188
- return (0, utils_1.deepCopy)({
189
- ...convertBalanceDoc(item, convertFunction),
190
- incomingApprovals: item.incomingApprovals.map(x => (0, users_1.convertUserIncomingApprovalWithDetails)(x, convertFunction)),
191
- outgoingApprovals: item.outgoingApprovals.map(x => (0, users_1.convertUserOutgoingApprovalWithDetails)(x, convertFunction)),
192
- userPermissions: (0, collections_1.convertUserPermissionsWithDetails)(item.userPermissions, convertFunction),
193
- });
428
+ exports.BalanceDoc = BalanceDoc;
429
+ class BalanceDocWithDetails extends __1.BaseNumberTypeClass {
430
+ outgoingApprovals;
431
+ incomingApprovals;
432
+ userPermissions;
433
+ _docId;
434
+ _id;
435
+ collectionId;
436
+ cosmosAddress;
437
+ onChain;
438
+ uri;
439
+ fetchedAt;
440
+ fetchedAtBlock;
441
+ isPermanent;
442
+ contentHash;
443
+ updateHistory;
444
+ balances;
445
+ autoApproveSelfInitiatedIncomingTransfers;
446
+ autoApproveSelfInitiatedOutgoingTransfers;
447
+ constructor(data) {
448
+ super();
449
+ this._docId = data._docId;
450
+ this._id = data._id;
451
+ this.outgoingApprovals = data.outgoingApprovals;
452
+ this.incomingApprovals = data.incomingApprovals;
453
+ this.userPermissions = data.userPermissions;
454
+ this.collectionId = data.collectionId;
455
+ this.cosmosAddress = data.cosmosAddress;
456
+ this.onChain = data.onChain;
457
+ this.uri = data.uri;
458
+ this.fetchedAt = data.fetchedAt;
459
+ this.fetchedAtBlock = data.fetchedAtBlock;
460
+ this.isPermanent = data.isPermanent;
461
+ this.contentHash = data.contentHash;
462
+ this.updateHistory = data.updateHistory;
463
+ this.balances = data.balances.map((balance) => new __1.Balance(balance));
464
+ this.autoApproveSelfInitiatedIncomingTransfers = data.autoApproveSelfInitiatedIncomingTransfers;
465
+ this.autoApproveSelfInitiatedOutgoingTransfers = data.autoApproveSelfInitiatedOutgoingTransfers;
466
+ }
467
+ convert(convertFunction) {
468
+ return new BalanceDocWithDetails((0, __1.deepCopy)({
469
+ ...this,
470
+ collectionId: convertFunction(this.collectionId),
471
+ fetchedAt: this.fetchedAt ? convertFunction(this.fetchedAt) : undefined,
472
+ fetchedAtBlock: this.fetchedAtBlock ? convertFunction(this.fetchedAtBlock) : undefined,
473
+ updateHistory: this.updateHistory.map((updateHistory) => ({
474
+ txHash: updateHistory.txHash,
475
+ block: convertFunction(updateHistory.block),
476
+ blockTimestamp: convertFunction(updateHistory.blockTimestamp),
477
+ })),
478
+ outgoingApprovals: this.outgoingApprovals.map((outgoingApproval) => outgoingApproval.convert(convertFunction)),
479
+ incomingApprovals: this.incomingApprovals.map((incomingApproval) => incomingApproval.convert(convertFunction)),
480
+ userPermissions: this.userPermissions.convert(convertFunction),
481
+ balances: this.balances.map((balance) => balance.convert(convertFunction)),
482
+ }));
483
+ }
194
484
  }
195
- exports.convertBalanceDocWithDetails = convertBalanceDocWithDetails;
196
- function convertPasswordDoc(item, convertFunction) {
197
- return (0, utils_1.deepCopy)({
198
- ...item,
199
- collectionId: convertFunction(item.collectionId),
200
- challengeDetails: item.challengeDetails ? convertChallengeDetails(item.challengeDetails, convertFunction) : undefined,
201
- claimedUsers: Object.fromEntries(Object.entries(item.claimedUsers).map(([key, value]) => [key, convertFunction(value)])),
202
- });
485
+ exports.BalanceDocWithDetails = BalanceDocWithDetails;
486
+ class PasswordDoc extends __1.BaseNumberTypeClass {
487
+ _docId;
488
+ _id;
489
+ cid;
490
+ createdBy;
491
+ docClaimedByCollection;
492
+ collectionId;
493
+ claimedUsers;
494
+ challengeDetails;
495
+ constructor(data) {
496
+ super();
497
+ this._docId = data._docId;
498
+ this._id = data._id;
499
+ this.cid = data.cid;
500
+ this.createdBy = data.createdBy;
501
+ this.docClaimedByCollection = data.docClaimedByCollection;
502
+ this.collectionId = data.collectionId;
503
+ this.claimedUsers = data.claimedUsers;
504
+ this.challengeDetails = data.challengeDetails ? new ChallengeDetails(data.challengeDetails) : undefined;
505
+ }
506
+ convert(convertFunction) {
507
+ return new PasswordDoc((0, __1.deepCopy)({
508
+ ...this,
509
+ collectionId: convertFunction(this.collectionId),
510
+ challengeDetails: this.challengeDetails ? this.challengeDetails.convert(convertFunction) : undefined,
511
+ claimedUsers: Object.fromEntries(Object.entries(this.claimedUsers).map(([key, value]) => [key, convertFunction(value)])),
512
+ }));
513
+ }
203
514
  }
204
- exports.convertPasswordDoc = convertPasswordDoc;
205
- function convertChallengeDetails(item, convertFunction) {
206
- return (0, utils_1.deepCopy)({
207
- ...item,
208
- numLeaves: item.numLeaves ? convertFunction(item.numLeaves) : undefined,
209
- currCode: item.currCode !== undefined && BigInt(item.currCode ?? -1n) >= 0 ? convertFunction(item.currCode) : undefined,
210
- });
515
+ exports.PasswordDoc = PasswordDoc;
516
+ class ChallengeDetails extends __1.BaseNumberTypeClass {
517
+ leavesDetails;
518
+ tree;
519
+ treeOptions;
520
+ numLeaves;
521
+ currCode;
522
+ hasPassword;
523
+ password;
524
+ constructor(data) {
525
+ super();
526
+ this.leavesDetails = data.leavesDetails;
527
+ this.tree = data.tree;
528
+ this.treeOptions = data.treeOptions;
529
+ this.numLeaves = data.numLeaves;
530
+ this.currCode = data.currCode;
531
+ this.hasPassword = data.hasPassword;
532
+ this.password = data.password;
533
+ }
534
+ convert(convertFunction) {
535
+ return new ChallengeDetails((0, __1.deepCopy)({
536
+ ...this,
537
+ numLeaves: this.numLeaves ? convertFunction(this.numLeaves) : undefined,
538
+ currCode: this.currCode !== undefined && BigInt(this.currCode ?? -1n) >= 0 ? convertFunction(this.currCode) : undefined,
539
+ }));
540
+ }
211
541
  }
212
- exports.convertChallengeDetails = convertChallengeDetails;
213
- function convertApprovalTrackerDoc(item, convertFunction) {
214
- return (0, utils_1.deepCopy)({
215
- ...item,
216
- collectionId: convertFunction(item.collectionId),
217
- numTransfers: convertFunction(item.numTransfers),
218
- amounts: item.amounts.map((amount) => (0, __1.convertBalance)(amount, convertFunction)),
219
- });
542
+ exports.ChallengeDetails = ChallengeDetails;
543
+ class ApprovalTrackerDoc extends __1.AmountTrackerIdDetails {
544
+ _docId;
545
+ _id;
546
+ numTransfers;
547
+ amounts;
548
+ constructor(data) {
549
+ super(data);
550
+ this.numTransfers = data.numTransfers;
551
+ this.amounts = data.amounts.map((amount) => new __1.Balance(amount));
552
+ this._docId = data._docId;
553
+ this._id = data._id;
554
+ }
555
+ convert(convertFunction) {
556
+ return new ApprovalTrackerDoc((0, __1.deepCopy)({
557
+ ...this,
558
+ ...super.convert(convertFunction),
559
+ numTransfers: convertFunction(this.numTransfers),
560
+ amounts: this.amounts.map((amount) => amount.convert(convertFunction)),
561
+ }));
562
+ }
220
563
  }
221
- exports.convertApprovalTrackerDoc = convertApprovalTrackerDoc;
222
- function convertChallengeTrackerIdDetails(item, convertFunction) {
223
- return (0, utils_1.deepCopy)({
224
- ...item,
225
- collectionId: convertFunction(item.collectionId),
226
- });
564
+ exports.ApprovalTrackerDoc = ApprovalTrackerDoc;
565
+ class ChallengeTrackerIdDetails extends __1.BaseNumberTypeClass {
566
+ collectionId;
567
+ challengeId;
568
+ challengeLevel;
569
+ approverAddress;
570
+ constructor(data) {
571
+ super();
572
+ this.collectionId = data.collectionId;
573
+ this.challengeId = data.challengeId;
574
+ this.challengeLevel = data.challengeLevel;
575
+ this.approverAddress = data.approverAddress;
576
+ }
577
+ convert(convertFunction) {
578
+ return new ChallengeTrackerIdDetails((0, __1.deepCopy)({
579
+ ...this,
580
+ collectionId: convertFunction(this.collectionId),
581
+ }));
582
+ }
227
583
  }
228
- exports.convertChallengeTrackerIdDetails = convertChallengeTrackerIdDetails;
229
- function convertMerkleChallengeDoc(item, convertFunction) {
230
- return (0, utils_1.deepCopy)({
231
- ...item,
232
- collectionId: convertFunction(item.collectionId),
233
- usedLeafIndices: item.usedLeafIndices.map(convertFunction),
234
- });
584
+ exports.ChallengeTrackerIdDetails = ChallengeTrackerIdDetails;
585
+ class MerkleChallengeDoc extends __1.BaseNumberTypeClass {
586
+ _docId;
587
+ _id;
588
+ collectionId;
589
+ challengeId;
590
+ challengeLevel;
591
+ approverAddress;
592
+ usedLeafIndices;
593
+ constructor(data) {
594
+ super();
595
+ this._docId = data._docId;
596
+ this._id = data._id;
597
+ this.collectionId = data.collectionId;
598
+ this.challengeId = data.challengeId;
599
+ this.challengeLevel = data.challengeLevel;
600
+ this.approverAddress = data.approverAddress;
601
+ this.usedLeafIndices = data.usedLeafIndices;
602
+ }
603
+ convert(convertFunction) {
604
+ return new MerkleChallengeDoc((0, __1.deepCopy)({
605
+ ...this,
606
+ collectionId: convertFunction(this.collectionId),
607
+ usedLeafIndices: this.usedLeafIndices.map(convertFunction),
608
+ }));
609
+ }
235
610
  }
236
- exports.convertMerkleChallengeDoc = convertMerkleChallengeDoc;
237
- function convertMerkleChallengeIdDetails(item, convertFunction) {
238
- return (0, utils_1.deepCopy)({
239
- ...item,
240
- collectionId: convertFunction(item.collectionId),
241
- });
611
+ exports.MerkleChallengeDoc = MerkleChallengeDoc;
612
+ class MerkleChallengeIdDetails extends __1.BaseNumberTypeClass {
613
+ collectionId;
614
+ challengeId;
615
+ challengeLevel;
616
+ approverAddress;
617
+ usedLeafIndices;
618
+ constructor(data) {
619
+ super();
620
+ this.collectionId = data.collectionId;
621
+ this.challengeId = data.challengeId;
622
+ this.challengeLevel = data.challengeLevel;
623
+ this.approverAddress = data.approverAddress;
624
+ this.usedLeafIndices = data.usedLeafIndices;
625
+ }
626
+ convert(convertFunction) {
627
+ return new MerkleChallengeIdDetails((0, __1.deepCopy)({
628
+ ...this,
629
+ collectionId: convertFunction(this.collectionId),
630
+ usedLeafIndices: this.usedLeafIndices.map(convertFunction),
631
+ }));
632
+ }
242
633
  }
243
- exports.convertMerkleChallengeIdDetails = convertMerkleChallengeIdDetails;
244
- function convertMerkleChallengeWithDetails(item, convertFunction) {
245
- return (0, utils_1.deepCopy)({
246
- ...item,
247
- ...(0, __1.convertMerkleChallenge)(item, convertFunction),
248
- details: item.details ? convertApprovalInfoDetails(item.details, convertFunction) : undefined,
249
- _rev: undefined,
250
- });
634
+ exports.MerkleChallengeIdDetails = MerkleChallengeIdDetails;
635
+ class MerkleChallengeWithDetails extends __1.MerkleChallenge {
636
+ details;
637
+ constructor(data) {
638
+ super(data);
639
+ this.details = data.details;
640
+ }
641
+ convert(convertFunction) {
642
+ const converted = new MerkleChallengeWithDetails((0, __1.deepCopy)({
643
+ ...this,
644
+ ...super.convert(convertFunction),
645
+ details: this.details ? this.details.convert(convertFunction) : undefined,
646
+ }));
647
+ return converted;
648
+ }
251
649
  }
252
- exports.convertMerkleChallengeWithDetails = convertMerkleChallengeWithDetails;
253
- function convertApprovalInfoDetails(item, convertFunction) {
254
- return (0, utils_1.deepCopy)({
255
- ...item,
256
- challengeDetails: convertChallengeDetails(item.challengeDetails, convertFunction),
257
- });
650
+ exports.MerkleChallengeWithDetails = MerkleChallengeWithDetails;
651
+ class ApprovalInfoDetails extends __1.BaseNumberTypeClass {
652
+ name;
653
+ description;
654
+ hasPassword;
655
+ password;
656
+ challengeDetails;
657
+ constructor(data) {
658
+ super();
659
+ this.name = data.name;
660
+ this.description = data.description;
661
+ this.hasPassword = data.hasPassword;
662
+ this.password = data.password;
663
+ this.challengeDetails = data.challengeDetails ? new ChallengeDetails(data.challengeDetails) : undefined;
664
+ }
665
+ convert(convertFunction) {
666
+ return new ApprovalInfoDetails((0, __1.deepCopy)({
667
+ ...this,
668
+ challengeDetails: this.challengeDetails ? this.challengeDetails.convert(convertFunction) : undefined,
669
+ }));
670
+ }
258
671
  }
259
- exports.convertApprovalInfoDetails = convertApprovalInfoDetails;
260
- function convertFetchDoc(item, convertFunction) {
261
- return (0, utils_1.deepCopy)({
262
- ...item,
263
- content: item.content ? item.db === 'Metadata' ? (0, metadata_1.convertMetadata)(item.content, convertFunction) : item.db === 'ApprovalInfo' ? convertApprovalInfoDetails(item.content, convertFunction) : (0, transfers_1.convertOffChainBalancesMap)(item.content, convertFunction) : undefined,
264
- fetchedAt: convertFunction(item.fetchedAt),
265
- fetchedAtBlock: convertFunction(item.fetchedAtBlock),
266
- });
672
+ exports.ApprovalInfoDetails = ApprovalInfoDetails;
673
+ class FetchDoc extends __1.BaseNumberTypeClass {
674
+ _docId;
675
+ _id;
676
+ content;
677
+ fetchedAt;
678
+ fetchedAtBlock;
679
+ db;
680
+ isPermanent;
681
+ constructor(data) {
682
+ super();
683
+ this.content = data.content;
684
+ this.fetchedAt = data.fetchedAt;
685
+ this.fetchedAtBlock = data.fetchedAtBlock;
686
+ this.db = data.db;
687
+ this.isPermanent = data.isPermanent;
688
+ this._docId = data._docId;
689
+ this._id = data._id;
690
+ }
691
+ convert(convertFunction) {
692
+ return new FetchDoc((0, __1.deepCopy)({
693
+ ...this,
694
+ content: this.content ? this.db === 'Metadata' ?
695
+ this.content.convert(convertFunction) : this.db === 'ApprovalInfo' ?
696
+ this.content.convert(convertFunction) : (0, transfers_1.convertOffChainBalancesMap)(this.content, convertFunction) : undefined,
697
+ fetchedAt: convertFunction(this.fetchedAt),
698
+ fetchedAtBlock: convertFunction(this.fetchedAtBlock),
699
+ }));
700
+ }
267
701
  }
268
- exports.convertFetchDoc = convertFetchDoc;
269
- function convertRefreshDoc(item, convertFunction) {
270
- return (0, utils_1.deepCopy)({
271
- ...item,
272
- collectionId: convertFunction(item.collectionId),
273
- refreshRequestTime: convertFunction(item.refreshRequestTime),
274
- });
702
+ exports.FetchDoc = FetchDoc;
703
+ class RefreshDoc extends __1.BaseNumberTypeClass {
704
+ _docId;
705
+ _id;
706
+ collectionId;
707
+ refreshRequestTime;
708
+ constructor(data) {
709
+ super();
710
+ this._docId = data._docId;
711
+ this._id = data._id;
712
+ this.collectionId = data.collectionId;
713
+ this.refreshRequestTime = data.refreshRequestTime;
714
+ }
715
+ convert(convertFunction) {
716
+ return new RefreshDoc((0, __1.deepCopy)({
717
+ ...this,
718
+ collectionId: convertFunction(this.collectionId),
719
+ refreshRequestTime: convertFunction(this.refreshRequestTime),
720
+ }));
721
+ }
275
722
  }
276
- exports.convertRefreshDoc = convertRefreshDoc;
277
- function convertAirdropDoc(item, convertFunction) {
278
- return (0, utils_1.deepCopy)({
279
- ...item,
280
- timestamp: convertFunction(item.timestamp),
281
- });
723
+ exports.RefreshDoc = RefreshDoc;
724
+ class AirdropDoc extends __1.BaseNumberTypeClass {
725
+ _docId;
726
+ _id;
727
+ airdropped;
728
+ timestamp;
729
+ hash;
730
+ constructor(data) {
731
+ super();
732
+ this._docId = data._docId;
733
+ this._id = data._id;
734
+ this.airdropped = data.airdropped;
735
+ this.timestamp = data.timestamp;
736
+ this.hash = data.hash;
737
+ }
738
+ convert(convertFunction) {
739
+ return new AirdropDoc((0, __1.deepCopy)({
740
+ ...this,
741
+ timestamp: convertFunction(this.timestamp),
742
+ }));
743
+ }
282
744
  }
283
- exports.convertAirdropDoc = convertAirdropDoc;
284
- function convertIPFSTotalsDoc(item, convertFunction) {
285
- return (0, utils_1.deepCopy)({
286
- ...item,
287
- bytesUploaded: convertFunction(item.bytesUploaded),
288
- });
745
+ exports.AirdropDoc = AirdropDoc;
746
+ class IPFSTotalsDoc extends __1.BaseNumberTypeClass {
747
+ _docId;
748
+ _id;
749
+ bytesUploaded;
750
+ constructor(data) {
751
+ super();
752
+ this.bytesUploaded = data.bytesUploaded;
753
+ this._docId = data._docId;
754
+ this._id = data._id;
755
+ }
756
+ convert(convertFunction) {
757
+ return new IPFSTotalsDoc((0, __1.deepCopy)({
758
+ ...this,
759
+ bytesUploaded: convertFunction(this.bytesUploaded),
760
+ }));
761
+ }
289
762
  }
290
- exports.convertIPFSTotalsDoc = convertIPFSTotalsDoc;
291
- function convertComplianceDoc(item, convertFunction) {
292
- return (0, utils_1.deepCopy)({
293
- ...item,
294
- badges: {
295
- nsfw: item.badges.nsfw.map(x => { return { ...x, collectionId: convertFunction(x.collectionId), badgeIds: x.badgeIds.map(y => (0, __1.convertUintRange)(y, convertFunction)) }; }),
296
- reported: item.badges.reported.map(x => { return { ...x, collectionId: convertFunction(x.collectionId), badgeIds: x.badgeIds.map(y => (0, __1.convertUintRange)(y, convertFunction)) }; }),
297
- },
298
- });
763
+ exports.IPFSTotalsDoc = IPFSTotalsDoc;
764
+ class ComplianceDoc extends __1.BaseNumberTypeClass {
765
+ _docId;
766
+ _id;
767
+ badges;
768
+ addressLists;
769
+ accounts;
770
+ constructor(data) {
771
+ super();
772
+ this.badges = data.badges;
773
+ this.addressLists = data.addressLists;
774
+ this.accounts = data.accounts;
775
+ this._docId = data._docId;
776
+ this._id = data._id;
777
+ }
778
+ convert(convertFunction) {
779
+ return new ComplianceDoc((0, __1.deepCopy)({
780
+ ...this,
781
+ badges: {
782
+ nsfw: this.badges.nsfw.map(x => { return { ...x, collectionId: convertFunction(x.collectionId), badgeIds: x.badgeIds.map(y => y.convert(convertFunction)) }; }),
783
+ reported: this.badges.reported.map(x => { return { ...x, collectionId: convertFunction(x.collectionId), badgeIds: x.badgeIds.map(y => y.convert(convertFunction)) }; }),
784
+ },
785
+ }));
786
+ }
299
787
  }
300
- exports.convertComplianceDoc = convertComplianceDoc;
301
- function convertBlockinAuthSignatureDoc(item, convertFunction) {
302
- return (0, utils_1.deepCopy)({
303
- ...item,
304
- createdAt: convertFunction(item.createdAt),
305
- params: (0, blockin_1.convertChallengeParams)(item.params, convertFunction),
306
- deletedAt: item.deletedAt ? convertFunction(item.deletedAt) : undefined,
307
- });
788
+ exports.ComplianceDoc = ComplianceDoc;
789
+ class BlockinAuthSignatureDoc extends __1.BaseNumberTypeClass {
790
+ _docId;
791
+ _id;
792
+ signature;
793
+ name;
794
+ description;
795
+ image;
796
+ cosmosAddress;
797
+ params;
798
+ createdAt;
799
+ deletedAt;
800
+ constructor(data) {
801
+ super();
802
+ this.signature = data.signature;
803
+ this.name = data.name;
804
+ this.description = data.description;
805
+ this.image = data.image;
806
+ this.cosmosAddress = data.cosmosAddress;
807
+ this.params = data.params;
808
+ this.createdAt = data.createdAt;
809
+ this.deletedAt = data.deletedAt;
810
+ this._docId = data._docId;
811
+ this._id = data._id;
812
+ }
813
+ convert(convertFunction) {
814
+ return new BlockinAuthSignatureDoc((0, __1.deepCopy)({
815
+ ...this,
816
+ createdAt: convertFunction(this.createdAt),
817
+ params: (0, blockin_1.convertChallengeParams)(this.params, convertFunction),
818
+ deletedAt: this.deletedAt ? convertFunction(this.deletedAt) : undefined,
819
+ }));
820
+ }
308
821
  }
309
- exports.convertBlockinAuthSignatureDoc = convertBlockinAuthSignatureDoc;
310
- function convertFollowDetailsDoc(item, convertFunction) {
311
- return (0, utils_1.deepCopy)({
312
- ...item,
313
- followingCount: convertFunction(item.followingCount),
314
- followersCount: convertFunction(item.followersCount),
315
- followingCollectionId: convertFunction(item.followingCollectionId),
316
- });
822
+ exports.BlockinAuthSignatureDoc = BlockinAuthSignatureDoc;
823
+ class FollowDetailsDoc extends __1.BaseNumberTypeClass {
824
+ _docId;
825
+ _id;
826
+ cosmosAddress;
827
+ followingCount;
828
+ followersCount;
829
+ followers;
830
+ following;
831
+ followingCollectionId;
832
+ constructor(data) {
833
+ super();
834
+ this.cosmosAddress = data.cosmosAddress;
835
+ this.followingCount = data.followingCount;
836
+ this.followersCount = data.followersCount;
837
+ this.followers = data.followers;
838
+ this.following = data.following;
839
+ this.followingCollectionId = data.followingCollectionId;
840
+ this._docId = data._docId;
841
+ this._id = data._id;
842
+ }
843
+ convert(convertFunction) {
844
+ return new FollowDetailsDoc((0, __1.deepCopy)({
845
+ ...this,
846
+ followingCount: convertFunction(this.followingCount),
847
+ followersCount: convertFunction(this.followersCount),
848
+ followingCollectionId: convertFunction(this.followingCollectionId),
849
+ }));
850
+ }
317
851
  }
318
- exports.convertFollowDetailsDoc = convertFollowDetailsDoc;
319
- function convertProtocolDoc(item, convertFunction) {
320
- return (0, utils_1.deepCopy)({
321
- ...item,
322
- });
852
+ exports.FollowDetailsDoc = FollowDetailsDoc;
853
+ class ProtocolDoc extends __1.BaseNumberTypeClass {
854
+ _docId;
855
+ _id;
856
+ name;
857
+ uri;
858
+ customData;
859
+ createdBy;
860
+ isFrozen;
861
+ constructor(data) {
862
+ super();
863
+ this._docId = data._docId;
864
+ this._id = data._id;
865
+ this.name = data.name;
866
+ this.uri = data.uri;
867
+ this.customData = data.customData;
868
+ this.createdBy = data.createdBy;
869
+ this.isFrozen = data.isFrozen;
870
+ }
871
+ convert(convertFunction) {
872
+ return new ProtocolDoc((0, __1.deepCopy)({
873
+ ...this,
874
+ }));
875
+ }
323
876
  }
324
- exports.convertProtocolDoc = convertProtocolDoc;
325
- function convertUserProtocolCollectionsDoc(item, convertFunction) {
326
- return (0, utils_1.deepCopy)({
327
- ...item,
328
- protocols: Object.fromEntries(Object.entries(item.protocols).map(([key, value]) => [key, convertFunction(value)])),
329
- });
877
+ exports.ProtocolDoc = ProtocolDoc;
878
+ class UserProtocolCollectionsDoc extends __1.BaseNumberTypeClass {
879
+ _docId;
880
+ _id;
881
+ protocols;
882
+ constructor(data) {
883
+ super();
884
+ this._docId = data._docId;
885
+ this._id = data._id;
886
+ this.protocols = data.protocols;
887
+ }
888
+ convert(convertFunction) {
889
+ return new UserProtocolCollectionsDoc((0, __1.deepCopy)({
890
+ ...this,
891
+ protocols: Object.fromEntries(Object.entries(this.protocols).map(([key, value]) => [key, convertFunction(value)])),
892
+ }));
893
+ }
330
894
  }
331
- exports.convertUserProtocolCollectionsDoc = convertUserProtocolCollectionsDoc;
332
- const { Schema } = mongoose_1.default;
333
- exports.ProtocolSchema = new Schema({
334
- _docId: String,
335
- name: String,
336
- uri: String,
337
- customData: String,
338
- createdBy: String,
339
- isFrozen: Boolean
340
- });
341
- exports.UserProtocolCollectionsSchema = new Schema({
342
- _docId: String,
343
- protocols: Schema.Types.Mixed,
344
- });
345
- exports.CollectionSchema = new Schema({
346
- _docId: String,
347
- collectionId: Schema.Types.Mixed,
348
- collectionMetadataTimeline: [Schema.Types.Mixed],
349
- badgeMetadataTimeline: [Schema.Types.Mixed],
350
- balancesType: String,
351
- offChainBalancesMetadataTimeline: [Schema.Types.Mixed],
352
- customDataTimeline: [Schema.Types.Mixed],
353
- managerTimeline: [Schema.Types.Mixed],
354
- collectionPermissions: Schema.Types.Mixed,
355
- collectionApprovals: [Schema.Types.Mixed],
356
- standardsTimeline: [Schema.Types.Mixed],
357
- isArchivedTimeline: [Schema.Types.Mixed],
358
- defaultBalances: Schema.Types.Mixed,
359
- createdBy: String,
360
- createdBlock: Schema.Types.Mixed,
361
- createdTimestamp: Schema.Types.Mixed,
362
- updateHistory: [Schema.Types.Mixed],
363
- aliasAddress: String,
364
- });
365
- exports.AccountSchema = new Schema({
366
- _docId: String,
367
- publicKey: String,
368
- pubKeyType: String,
369
- cosmosAddress: String,
370
- ethAddress: String,
371
- solAddress: String,
372
- btcAddress: String,
373
- accountNumber: Schema.Types.Mixed,
374
- sequence: Schema.Types.Mixed,
375
- balance: Schema.Types.Mixed,
376
- });
377
- exports.ProfileSchema = new Schema({
378
- _docId: String,
379
- fetchedProfile: Boolean,
380
- seenActivity: Schema.Types.Mixed,
381
- createdAt: Schema.Types.Mixed,
382
- discord: String,
383
- twitter: String,
384
- github: String,
385
- telegram: String,
386
- readme: String,
387
- customLinks: [Schema.Types.Mixed],
388
- hiddenBadges: [
389
- {
390
- collectionId: Schema.Types.Mixed,
391
- badgeIds: [{}],
392
- },
393
- ],
394
- hiddenLists: [String],
395
- customPages: Schema.Types.Mixed,
396
- watchlists: Schema.Types.Mixed,
397
- profilePicUrl: String,
398
- username: String,
399
- latestSignedInChain: String,
400
- solAddress: String,
401
- notifications: Schema.Types.Mixed,
402
- });
403
- exports.QueueSchema = new Schema({
404
- _docId: String,
405
- uri: String,
406
- collectionId: Schema.Types.Mixed,
407
- loadBalanceId: Schema.Types.Mixed,
408
- refreshRequestTime: Schema.Types.Mixed,
409
- numRetries: Schema.Types.Mixed,
410
- lastFetchedAt: Schema.Types.Mixed,
411
- error: String,
412
- deletedAt: Schema.Types.Mixed,
413
- nextFetchTime: Schema.Types.Mixed,
414
- emailMessage: String,
415
- recipientAddress: String,
416
- activityDocId: String,
417
- notificationType: String,
418
- });
419
- exports.StatusSchema = new Schema({
420
- _docId: String,
421
- block: Schema.Types.Mixed,
422
- nextCollectionId: Schema.Types.Mixed,
423
- gasPrice: Number,
424
- lastXGasLimits: [Schema.Types.Mixed],
425
- lastXGasAmounts: [Schema.Types.Mixed],
426
- });
427
- exports.AddressListSchema = new Schema({
428
- _docId: String,
429
- listId: String,
430
- addresses: [String],
431
- whitelist: Boolean,
432
- uri: String,
433
- customData: String,
434
- createdBy: String,
435
- aliasAddress: String,
436
- updateHistory: [Schema.Types.Mixed],
437
- createdBlock: Schema.Types.Mixed,
438
- lastUpdated: Schema.Types.Mixed,
439
- private: Boolean,
440
- editKeys: [Schema.Types.Mixed],
441
- nsfw: { reason: String },
442
- reported: { reason: String },
443
- });
444
- exports.BalanceSchema = new Schema({
445
- _docId: String,
446
- collectionId: Schema.Types.Mixed,
447
- cosmosAddress: String,
448
- balances: [Schema.Types.Mixed],
449
- incomingApprovals: [Schema.Types.Mixed],
450
- outgoingApprovals: [Schema.Types.Mixed],
451
- autoApproveSelfInitiatedIncomingTransfers: Boolean,
452
- autoApproveSelfInitiatedOutgoingTransfers: Boolean,
453
- userPermissions: Schema.Types.Mixed,
454
- onChain: Boolean,
455
- uri: String,
456
- fetchedAt: Schema.Types.Mixed,
457
- fetchedAtBlock: Schema.Types.Mixed,
458
- contentHash: String,
459
- isPermanent: Boolean,
460
- updateHistory: [Schema.Types.Mixed],
461
- });
462
- exports.PasswordSchema = new Schema({
463
- _docId: String,
464
- cid: String,
465
- createdBy: String,
466
- docClaimedByCollection: Boolean,
467
- collectionId: Schema.Types.Mixed,
468
- claimedUsers: Schema.Types.Mixed,
469
- challengeDetails: Schema.Types.Mixed,
470
- });
471
- exports.ChallengeSchema = new Schema({
472
- _docId: String,
473
- collectionId: Schema.Types.Mixed,
474
- challengeId: String,
475
- challengeLevel: String,
476
- approverAddress: String,
477
- usedLeafIndices: [Schema.Types.Mixed],
478
- });
479
- exports.ApprovalTrackerSchema = new Schema({
480
- _docId: String,
481
- collectionId: Schema.Types.Mixed,
482
- numTransfers: Schema.Types.Mixed,
483
- amounts: [Schema.Types.Mixed],
484
- approvalLevel: String,
485
- approverAddress: String,
486
- amountTrackerId: String,
487
- trackerType: String,
488
- approvedAddress: String,
489
- });
490
- exports.FetchSchema = new Schema({
491
- _docId: String,
492
- content: Schema.Types.Mixed,
493
- fetchedAt: Schema.Types.Mixed,
494
- fetchedAtBlock: Schema.Types.Mixed,
495
- db: String,
496
- isPermanent: Boolean,
497
- });
498
- exports.RefreshSchema = new Schema({
499
- _docId: String,
500
- collectionId: Schema.Types.Mixed,
501
- refreshRequestTime: Schema.Types.Mixed,
502
- });
503
- exports.AirdropSchema = new Schema({
504
- _docId: String,
505
- airdropped: Boolean,
506
- timestamp: Schema.Types.Mixed,
507
- hash: String,
508
- });
509
- exports.IPFSTotalsSchema = new Schema({
510
- _docId: String,
511
- bytesUploaded: Schema.Types.Mixed,
512
- });
513
- exports.ComplianceSchema = new Schema({
514
- _docId: String,
515
- badges: Schema.Types.Mixed,
516
- addressLists: Schema.Types.Mixed,
517
- accounts: Schema.Types.Mixed,
518
- });
519
- exports.BlockinAuthSignatureSchema = new Schema({
520
- _docId: String,
521
- signature: String,
522
- name: String,
523
- description: String,
524
- image: String,
525
- cosmosAddress: String,
526
- params: Schema.Types.Mixed,
527
- createdAt: Schema.Types.Mixed,
528
- deletedAt: Schema.Types.Mixed,
529
- });
530
- exports.FollowDetailsSchema = new Schema({
531
- _docId: String,
532
- cosmosAddress: String,
533
- followingCount: Schema.Types.Mixed,
534
- followersCount: Schema.Types.Mixed,
535
- followingCollectionId: Schema.Types.Mixed,
536
- followers: Schema.Types.Mixed,
537
- following: Schema.Types.Mixed,
538
- });
895
+ exports.UserProtocolCollectionsDoc = UserProtocolCollectionsDoc;
539
896
  //# sourceMappingURL=db.js.map