bitbadgesjs-sdk 0.0.7 → 0.1.1

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