@polymeshassociation/polymesh-sdk 23.0.0-alpha.4 → 23.0.0-alpha.6

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 (391) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/api/client/Assets.d.ts +15 -7
  3. package/api/client/Assets.d.ts.map +1 -1
  4. package/api/client/Assets.js +32 -7
  5. package/api/client/Assets.js.map +1 -1
  6. package/api/entities/Account/helpers.d.ts +3 -2
  7. package/api/entities/Account/helpers.d.ts.map +1 -1
  8. package/api/entities/Account/helpers.js.map +1 -1
  9. package/api/entities/Asset/Base/BaseAsset.d.ts +83 -0
  10. package/api/entities/Asset/Base/BaseAsset.d.ts.map +1 -0
  11. package/api/entities/Asset/Base/BaseAsset.js +175 -0
  12. package/api/entities/Asset/Base/BaseAsset.js.map +1 -0
  13. package/api/entities/Asset/{Compliance → Base/Compliance}/Requirements.d.ts +10 -10
  14. package/api/entities/Asset/Base/Compliance/Requirements.d.ts.map +1 -0
  15. package/api/entities/Asset/{Compliance → Base/Compliance}/Requirements.js +3 -3
  16. package/api/entities/Asset/Base/Compliance/Requirements.js.map +1 -0
  17. package/api/entities/Asset/{Compliance → Base/Compliance}/TrustedClaimIssuers.d.ts +7 -7
  18. package/api/entities/Asset/Base/Compliance/TrustedClaimIssuers.d.ts.map +1 -0
  19. package/api/entities/Asset/{Compliance → Base/Compliance}/TrustedClaimIssuers.js +4 -4
  20. package/api/entities/Asset/Base/Compliance/TrustedClaimIssuers.js.map +1 -0
  21. package/api/entities/Asset/{Compliance → Base/Compliance}/index.d.ts +3 -3
  22. package/api/entities/Asset/Base/Compliance/index.d.ts.map +1 -0
  23. package/api/entities/Asset/{Compliance → Base/Compliance}/index.js +1 -1
  24. package/api/entities/Asset/Base/Compliance/index.js.map +1 -0
  25. package/api/entities/Asset/{Documents.d.ts → Base/Documents/index.d.ts} +7 -8
  26. package/api/entities/Asset/Base/Documents/index.d.ts.map +1 -0
  27. package/api/entities/Asset/{Documents.js → Base/Documents/index.js} +4 -4
  28. package/api/entities/Asset/Base/Documents/index.js.map +1 -0
  29. package/api/entities/Asset/{Metadata.d.ts → Base/Metadata/index.d.ts} +5 -5
  30. package/api/entities/Asset/Base/Metadata/index.d.ts.map +1 -0
  31. package/api/entities/Asset/{Metadata.js → Base/Metadata/index.js} +5 -5
  32. package/api/entities/Asset/Base/Metadata/index.js.map +1 -0
  33. package/api/entities/Asset/{Permissions.d.ts → Base/Permissions/index.d.ts} +5 -5
  34. package/api/entities/Asset/Base/Permissions/index.d.ts.map +1 -0
  35. package/api/entities/Asset/{Permissions.js → Base/Permissions/index.js} +5 -5
  36. package/api/entities/Asset/Base/Permissions/index.js.map +1 -0
  37. package/api/entities/Asset/Base/index.d.ts +2 -0
  38. package/api/entities/Asset/Base/index.d.ts.map +1 -0
  39. package/api/entities/Asset/Base/index.js +18 -0
  40. package/api/entities/Asset/Base/index.js.map +1 -0
  41. package/api/entities/Asset/{AssetHolders.d.ts → Fungible/AssetHolders/index.d.ts} +4 -4
  42. package/api/entities/Asset/Fungible/AssetHolders/index.d.ts.map +1 -0
  43. package/api/entities/Asset/{AssetHolders.js → Fungible/AssetHolders/index.js} +4 -4
  44. package/api/entities/Asset/Fungible/AssetHolders/index.js.map +1 -0
  45. package/api/entities/Asset/{Checkpoints → Fungible/Checkpoints}/Schedules.d.ts +4 -4
  46. package/api/entities/Asset/Fungible/Checkpoints/Schedules.d.ts.map +1 -0
  47. package/api/entities/Asset/{Checkpoints → Fungible/Checkpoints}/Schedules.js +4 -4
  48. package/api/entities/Asset/Fungible/Checkpoints/Schedules.js.map +1 -0
  49. package/api/entities/Asset/{Checkpoints → Fungible/Checkpoints}/index.d.ts +4 -4
  50. package/api/entities/Asset/Fungible/Checkpoints/index.d.ts.map +1 -0
  51. package/api/entities/Asset/{Checkpoints → Fungible/Checkpoints}/index.js +5 -5
  52. package/api/entities/Asset/Fungible/Checkpoints/index.js.map +1 -0
  53. package/api/entities/Asset/{Checkpoints → Fungible/Checkpoints}/types.d.ts +1 -1
  54. package/api/entities/Asset/Fungible/Checkpoints/types.d.ts.map +1 -0
  55. package/api/entities/Asset/Fungible/Checkpoints/types.js.map +1 -0
  56. package/api/entities/Asset/{CorporateActions → Fungible/CorporateActions}/Distributions.d.ts +4 -4
  57. package/api/entities/Asset/Fungible/CorporateActions/Distributions.d.ts.map +1 -0
  58. package/api/entities/Asset/{CorporateActions → Fungible/CorporateActions}/Distributions.js +4 -4
  59. package/api/entities/Asset/Fungible/CorporateActions/Distributions.js.map +1 -0
  60. package/api/entities/Asset/{CorporateActions → Fungible/CorporateActions}/index.d.ts +4 -4
  61. package/api/entities/Asset/Fungible/CorporateActions/index.d.ts.map +1 -0
  62. package/api/entities/Asset/{CorporateActions → Fungible/CorporateActions}/index.js +3 -3
  63. package/api/entities/Asset/Fungible/CorporateActions/index.js.map +1 -0
  64. package/api/entities/Asset/{CorporateActions → Fungible/CorporateActions}/types.d.ts +1 -1
  65. package/api/entities/Asset/Fungible/CorporateActions/types.d.ts.map +1 -0
  66. package/api/entities/Asset/Fungible/CorporateActions/types.js.map +1 -0
  67. package/api/entities/Asset/{Issuance.d.ts → Fungible/Issuance/index.d.ts} +6 -6
  68. package/api/entities/Asset/Fungible/Issuance/index.d.ts.map +1 -0
  69. package/api/entities/Asset/{Issuance.js → Fungible/Issuance/index.js} +3 -3
  70. package/api/entities/Asset/Fungible/Issuance/index.js.map +1 -0
  71. package/api/entities/Asset/{Offerings.d.ts → Fungible/Offerings/index.d.ts} +5 -5
  72. package/api/entities/Asset/Fungible/Offerings/index.d.ts.map +1 -0
  73. package/api/entities/Asset/{Offerings.js → Fungible/Offerings/index.js} +5 -5
  74. package/api/entities/Asset/Fungible/Offerings/index.js.map +1 -0
  75. package/api/entities/Asset/{Settlements.d.ts → Fungible/Settlements/index.d.ts} +4 -4
  76. package/api/entities/Asset/Fungible/Settlements/index.d.ts.map +1 -0
  77. package/api/entities/Asset/{Settlements.js → Fungible/Settlements/index.js} +5 -5
  78. package/api/entities/Asset/Fungible/Settlements/index.js.map +1 -0
  79. package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/ClaimCount.d.ts +2 -2
  80. package/api/entities/Asset/Fungible/TransferRestrictions/ClaimCount.d.ts.map +1 -0
  81. package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/ClaimCount.js +2 -2
  82. package/api/entities/Asset/Fungible/TransferRestrictions/ClaimCount.js.map +1 -0
  83. package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/ClaimPercentage.d.ts +2 -2
  84. package/api/entities/Asset/Fungible/TransferRestrictions/ClaimPercentage.d.ts.map +1 -0
  85. package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/ClaimPercentage.js +2 -2
  86. package/api/entities/Asset/Fungible/TransferRestrictions/ClaimPercentage.js.map +1 -0
  87. package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/Count.d.ts +3 -3
  88. package/api/entities/Asset/Fungible/TransferRestrictions/Count.d.ts.map +1 -0
  89. package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/Count.js +2 -2
  90. package/api/entities/Asset/Fungible/TransferRestrictions/Count.js.map +1 -0
  91. package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/Percentage.d.ts +2 -2
  92. package/api/entities/Asset/Fungible/TransferRestrictions/Percentage.d.ts.map +1 -0
  93. package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/Percentage.js +2 -2
  94. package/api/entities/Asset/Fungible/TransferRestrictions/Percentage.js.map +1 -0
  95. package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/TransferRestrictionBase.d.ts +4 -4
  96. package/api/entities/Asset/Fungible/TransferRestrictions/TransferRestrictionBase.d.ts.map +1 -0
  97. package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/TransferRestrictionBase.js +4 -4
  98. package/api/entities/Asset/Fungible/TransferRestrictions/TransferRestrictionBase.js.map +1 -0
  99. package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/index.d.ts +3 -3
  100. package/api/entities/Asset/Fungible/TransferRestrictions/index.d.ts.map +1 -0
  101. package/api/entities/Asset/{TransferRestrictions → Fungible/TransferRestrictions}/index.js +1 -1
  102. package/api/entities/Asset/Fungible/TransferRestrictions/index.js.map +1 -0
  103. package/api/entities/Asset/Fungible/index.d.ts +88 -0
  104. package/api/entities/Asset/Fungible/index.d.ts.map +1 -0
  105. package/api/entities/Asset/Fungible/index.js +159 -0
  106. package/api/entities/Asset/Fungible/index.js.map +1 -0
  107. package/api/entities/Asset/NonFungible/NftCollection.d.ts +9 -24
  108. package/api/entities/Asset/NonFungible/NftCollection.d.ts.map +1 -1
  109. package/api/entities/Asset/NonFungible/NftCollection.js +40 -20
  110. package/api/entities/Asset/NonFungible/NftCollection.js.map +1 -1
  111. package/api/entities/Asset/index.d.ts +4 -132
  112. package/api/entities/Asset/index.d.ts.map +1 -1
  113. package/api/entities/Asset/index.js +17 -234
  114. package/api/entities/Asset/index.js.map +1 -1
  115. package/api/entities/Asset/types.d.ts +13 -4
  116. package/api/entities/Asset/types.d.ts.map +1 -1
  117. package/api/entities/Asset/types.js +2 -2
  118. package/api/entities/Asset/types.js.map +1 -1
  119. package/api/entities/Checkpoint.d.ts +2 -2
  120. package/api/entities/Checkpoint.d.ts.map +1 -1
  121. package/api/entities/Checkpoint.js +1 -1
  122. package/api/entities/Checkpoint.js.map +1 -1
  123. package/api/entities/CheckpointSchedule/index.d.ts +2 -2
  124. package/api/entities/CheckpointSchedule/index.d.ts.map +1 -1
  125. package/api/entities/CheckpointSchedule/index.js +1 -1
  126. package/api/entities/CheckpointSchedule/index.js.map +1 -1
  127. package/api/entities/CorporateActionBase/index.d.ts +2 -2
  128. package/api/entities/CorporateActionBase/index.d.ts.map +1 -1
  129. package/api/entities/CorporateActionBase/index.js +1 -1
  130. package/api/entities/CorporateActionBase/index.js.map +1 -1
  131. package/api/entities/DefaultTrustedClaimIssuer.d.ts +2 -2
  132. package/api/entities/DefaultTrustedClaimIssuer.d.ts.map +1 -1
  133. package/api/entities/DefaultTrustedClaimIssuer.js +1 -1
  134. package/api/entities/DefaultTrustedClaimIssuer.js.map +1 -1
  135. package/api/entities/Identity/AssetPermissions.d.ts +6 -6
  136. package/api/entities/Identity/AssetPermissions.d.ts.map +1 -1
  137. package/api/entities/Identity/AssetPermissions.js +2 -2
  138. package/api/entities/Identity/AssetPermissions.js.map +1 -1
  139. package/api/entities/Identity/index.d.ts +3 -3
  140. package/api/entities/Identity/index.d.ts.map +1 -1
  141. package/api/entities/Identity/index.js +2 -2
  142. package/api/entities/Identity/index.js.map +1 -1
  143. package/api/entities/Instruction/index.d.ts.map +1 -1
  144. package/api/entities/Instruction/index.js +1 -1
  145. package/api/entities/Instruction/index.js.map +1 -1
  146. package/api/entities/Instruction/types.d.ts +2 -2
  147. package/api/entities/Instruction/types.d.ts.map +1 -1
  148. package/api/entities/MetadataEntry/index.d.ts +2 -2
  149. package/api/entities/MetadataEntry/index.d.ts.map +1 -1
  150. package/api/entities/MetadataEntry/index.js +1 -1
  151. package/api/entities/MetadataEntry/index.js.map +1 -1
  152. package/api/entities/Offering/index.d.ts +2 -2
  153. package/api/entities/Offering/index.d.ts.map +1 -1
  154. package/api/entities/Offering/index.js +1 -1
  155. package/api/entities/Offering/index.js.map +1 -1
  156. package/api/entities/PermissionGroup.d.ts +2 -2
  157. package/api/entities/PermissionGroup.d.ts.map +1 -1
  158. package/api/entities/PermissionGroup.js +1 -1
  159. package/api/entities/PermissionGroup.js.map +1 -1
  160. package/api/entities/Portfolio/index.d.ts +2 -2
  161. package/api/entities/Portfolio/index.d.ts.map +1 -1
  162. package/api/entities/Portfolio/index.js +4 -4
  163. package/api/entities/Portfolio/index.js.map +1 -1
  164. package/api/entities/Portfolio/types.d.ts +2 -2
  165. package/api/entities/Portfolio/types.d.ts.map +1 -1
  166. package/api/entities/TickerReservation/index.d.ts +2 -2
  167. package/api/entities/TickerReservation/index.d.ts.map +1 -1
  168. package/api/entities/types.d.ts +3 -2
  169. package/api/entities/types.d.ts.map +1 -1
  170. package/api/entities/types.js.map +1 -1
  171. package/api/procedures/addAssetRequirement.d.ts +4 -4
  172. package/api/procedures/addAssetRequirement.d.ts.map +1 -1
  173. package/api/procedures/addAssetRequirement.js +3 -3
  174. package/api/procedures/addAssetRequirement.js.map +1 -1
  175. package/api/procedures/addAssetStat.d.ts.map +1 -1
  176. package/api/procedures/addAssetStat.js +1 -1
  177. package/api/procedures/addAssetStat.js.map +1 -1
  178. package/api/procedures/addTransferRestriction.d.ts.map +1 -1
  179. package/api/procedures/addTransferRestriction.js +1 -1
  180. package/api/procedures/addTransferRestriction.js.map +1 -1
  181. package/api/procedures/closeOffering.d.ts.map +1 -1
  182. package/api/procedures/closeOffering.js +1 -1
  183. package/api/procedures/closeOffering.js.map +1 -1
  184. package/api/procedures/configureDividendDistribution.d.ts.map +1 -1
  185. package/api/procedures/configureDividendDistribution.js +1 -1
  186. package/api/procedures/configureDividendDistribution.js.map +1 -1
  187. package/api/procedures/controllerTransfer.d.ts.map +1 -1
  188. package/api/procedures/controllerTransfer.js +2 -2
  189. package/api/procedures/controllerTransfer.js.map +1 -1
  190. package/api/procedures/createAsset.d.ts +5 -5
  191. package/api/procedures/createAsset.d.ts.map +1 -1
  192. package/api/procedures/createAsset.js +1 -1
  193. package/api/procedures/createAsset.js.map +1 -1
  194. package/api/procedures/createCheckpoint.d.ts.map +1 -1
  195. package/api/procedures/createCheckpoint.js +1 -1
  196. package/api/procedures/createCheckpoint.js.map +1 -1
  197. package/api/procedures/createCheckpointSchedule.d.ts.map +1 -1
  198. package/api/procedures/createCheckpointSchedule.js +1 -1
  199. package/api/procedures/createCheckpointSchedule.js.map +1 -1
  200. package/api/procedures/createGroup.d.ts +2 -2
  201. package/api/procedures/createGroup.d.ts.map +1 -1
  202. package/api/procedures/createGroup.js +1 -1
  203. package/api/procedures/createGroup.js.map +1 -1
  204. package/api/procedures/createNftCollection.d.ts.map +1 -1
  205. package/api/procedures/createNftCollection.js +6 -2
  206. package/api/procedures/createNftCollection.js.map +1 -1
  207. package/api/procedures/createTransactionBatch.d.ts.map +1 -1
  208. package/api/procedures/createTransactionBatch.js +1 -1
  209. package/api/procedures/createTransactionBatch.js.map +1 -1
  210. package/api/procedures/inviteExternalAgent.d.ts +2 -2
  211. package/api/procedures/inviteExternalAgent.d.ts.map +1 -1
  212. package/api/procedures/inviteExternalAgent.js +1 -1
  213. package/api/procedures/inviteExternalAgent.js.map +1 -1
  214. package/api/procedures/issueTokens.d.ts +6 -6
  215. package/api/procedures/issueTokens.d.ts.map +1 -1
  216. package/api/procedures/issueTokens.js +1 -1
  217. package/api/procedures/issueTokens.js.map +1 -1
  218. package/api/procedures/launchOffering.d.ts.map +1 -1
  219. package/api/procedures/launchOffering.js +1 -1
  220. package/api/procedures/launchOffering.js.map +1 -1
  221. package/api/procedures/linkCaDocs.d.ts.map +1 -1
  222. package/api/procedures/linkCaDocs.js +1 -1
  223. package/api/procedures/linkCaDocs.js.map +1 -1
  224. package/api/procedures/modifyAsset.d.ts +4 -4
  225. package/api/procedures/modifyAsset.d.ts.map +1 -1
  226. package/api/procedures/modifyAsset.js +2 -2
  227. package/api/procedures/modifyAsset.js.map +1 -1
  228. package/api/procedures/modifyAssetTrustedClaimIssuers.d.ts +4 -4
  229. package/api/procedures/modifyAssetTrustedClaimIssuers.d.ts.map +1 -1
  230. package/api/procedures/modifyAssetTrustedClaimIssuers.js +2 -2
  231. package/api/procedures/modifyAssetTrustedClaimIssuers.js.map +1 -1
  232. package/api/procedures/modifyCaCheckpoint.d.ts.map +1 -1
  233. package/api/procedures/modifyCaCheckpoint.js +1 -1
  234. package/api/procedures/modifyCaCheckpoint.js.map +1 -1
  235. package/api/procedures/modifyCaDefaultConfig.d.ts.map +1 -1
  236. package/api/procedures/modifyCaDefaultConfig.js +2 -2
  237. package/api/procedures/modifyCaDefaultConfig.js.map +1 -1
  238. package/api/procedures/modifyComplianceRequirement.d.ts.map +1 -1
  239. package/api/procedures/modifyComplianceRequirement.js +2 -2
  240. package/api/procedures/modifyComplianceRequirement.js.map +1 -1
  241. package/api/procedures/modifyCorporateActionsAgent.d.ts.map +1 -1
  242. package/api/procedures/modifyCorporateActionsAgent.js +2 -2
  243. package/api/procedures/modifyCorporateActionsAgent.js.map +1 -1
  244. package/api/procedures/modifyOfferingTimes.d.ts.map +1 -1
  245. package/api/procedures/modifyOfferingTimes.js +1 -1
  246. package/api/procedures/modifyOfferingTimes.js.map +1 -1
  247. package/api/procedures/reclaimDividendDistributionFunds.d.ts.map +1 -1
  248. package/api/procedures/reclaimDividendDistributionFunds.js +1 -1
  249. package/api/procedures/reclaimDividendDistributionFunds.js.map +1 -1
  250. package/api/procedures/redeemTokens.d.ts.map +1 -1
  251. package/api/procedures/redeemTokens.js +2 -2
  252. package/api/procedures/redeemTokens.js.map +1 -1
  253. package/api/procedures/registerMetadata.d.ts.map +1 -1
  254. package/api/procedures/registerMetadata.js +1 -1
  255. package/api/procedures/registerMetadata.js.map +1 -1
  256. package/api/procedures/removeAssetRequirement.d.ts +4 -4
  257. package/api/procedures/removeAssetRequirement.d.ts.map +1 -1
  258. package/api/procedures/removeAssetRequirement.js +2 -2
  259. package/api/procedures/removeAssetRequirement.js.map +1 -1
  260. package/api/procedures/removeAssetStat.d.ts.map +1 -1
  261. package/api/procedures/removeAssetStat.js +1 -1
  262. package/api/procedures/removeAssetStat.js.map +1 -1
  263. package/api/procedures/removeCheckpointSchedule.d.ts.map +1 -1
  264. package/api/procedures/removeCheckpointSchedule.js +1 -1
  265. package/api/procedures/removeCheckpointSchedule.js.map +1 -1
  266. package/api/procedures/removeCorporateAction.js +1 -1
  267. package/api/procedures/removeCorporateAction.js.map +1 -1
  268. package/api/procedures/removeExternalAgent.d.ts +2 -2
  269. package/api/procedures/removeExternalAgent.d.ts.map +1 -1
  270. package/api/procedures/removeExternalAgent.js +1 -1
  271. package/api/procedures/removeExternalAgent.js.map +1 -1
  272. package/api/procedures/setAssetDocuments.d.ts +5 -5
  273. package/api/procedures/setAssetDocuments.d.ts.map +1 -1
  274. package/api/procedures/setAssetDocuments.js +2 -2
  275. package/api/procedures/setAssetDocuments.js.map +1 -1
  276. package/api/procedures/setAssetRequirements.d.ts +4 -4
  277. package/api/procedures/setAssetRequirements.d.ts.map +1 -1
  278. package/api/procedures/setAssetRequirements.js +4 -4
  279. package/api/procedures/setAssetRequirements.js.map +1 -1
  280. package/api/procedures/setMetadata.d.ts.map +1 -1
  281. package/api/procedures/setMetadata.js +1 -1
  282. package/api/procedures/setMetadata.js.map +1 -1
  283. package/api/procedures/setPermissionGroup.d.ts +2 -2
  284. package/api/procedures/setPermissionGroup.d.ts.map +1 -1
  285. package/api/procedures/setTransferRestrictions.d.ts +1 -1
  286. package/api/procedures/setTransferRestrictions.d.ts.map +1 -1
  287. package/api/procedures/setTransferRestrictions.js +2 -2
  288. package/api/procedures/setTransferRestrictions.js.map +1 -1
  289. package/api/procedures/setVenueFiltering.d.ts.map +1 -1
  290. package/api/procedures/setVenueFiltering.js +1 -1
  291. package/api/procedures/setVenueFiltering.js.map +1 -1
  292. package/api/procedures/toggleFreezeOffering.d.ts.map +1 -1
  293. package/api/procedures/toggleFreezeOffering.js +1 -1
  294. package/api/procedures/toggleFreezeOffering.js.map +1 -1
  295. package/api/procedures/toggleFreezeTransfers.d.ts +4 -4
  296. package/api/procedures/toggleFreezeTransfers.d.ts.map +1 -1
  297. package/api/procedures/toggleFreezeTransfers.js +4 -4
  298. package/api/procedures/toggleFreezeTransfers.js.map +1 -1
  299. package/api/procedures/togglePauseRequirements.d.ts +4 -4
  300. package/api/procedures/togglePauseRequirements.d.ts.map +1 -1
  301. package/api/procedures/togglePauseRequirements.js +2 -2
  302. package/api/procedures/togglePauseRequirements.js.map +1 -1
  303. package/api/procedures/transferAssetOwnership.d.ts.map +1 -1
  304. package/api/procedures/transferAssetOwnership.js +1 -1
  305. package/api/procedures/transferAssetOwnership.js.map +1 -1
  306. package/api/procedures/types.d.ts +6 -6
  307. package/api/procedures/types.d.ts.map +1 -1
  308. package/api/procedures/types.js.map +1 -1
  309. package/api/procedures/utils.d.ts +3 -3
  310. package/api/procedures/utils.d.ts.map +1 -1
  311. package/api/procedures/utils.js +1 -1
  312. package/api/procedures/utils.js.map +1 -1
  313. package/api/procedures/waivePermissions.d.ts +2 -2
  314. package/api/procedures/waivePermissions.d.ts.map +1 -1
  315. package/api/procedures/waivePermissions.js.map +1 -1
  316. package/base/Context.d.ts +2 -2
  317. package/base/Context.d.ts.map +1 -1
  318. package/base/PolymeshTransactionBatch.js +2 -2
  319. package/base/PolymeshTransactionBatch.js.map +1 -1
  320. package/base/Procedure.js.map +1 -1
  321. package/internal.d.ts +2 -3
  322. package/internal.d.ts.map +1 -1
  323. package/internal.js +6 -6
  324. package/internal.js.map +1 -1
  325. package/npm-package/polymeshassociation-polymesh-sdk-23.0.0-alpha.6.tgz +0 -0
  326. package/package.json +1 -1
  327. package/types/index.d.ts +6 -6
  328. package/types/index.d.ts.map +1 -1
  329. package/types/index.js.map +1 -1
  330. package/utils/conversion.d.ts.map +1 -1
  331. package/utils/conversion.js +4 -4
  332. package/utils/conversion.js.map +1 -1
  333. package/utils/internal.d.ts +42 -6
  334. package/utils/internal.d.ts.map +1 -1
  335. package/utils/internal.js +84 -24
  336. package/utils/internal.js.map +1 -1
  337. package/utils/typeguards.d.ts +10 -6
  338. package/utils/typeguards.d.ts.map +1 -1
  339. package/utils/typeguards.js +15 -8
  340. package/utils/typeguards.js.map +1 -1
  341. package/api/entities/Asset/AssetHolders.d.ts.map +0 -1
  342. package/api/entities/Asset/AssetHolders.js.map +0 -1
  343. package/api/entities/Asset/BaseAsset/index.d.ts +0 -48
  344. package/api/entities/Asset/BaseAsset/index.d.ts.map +0 -1
  345. package/api/entities/Asset/BaseAsset/index.js +0 -69
  346. package/api/entities/Asset/BaseAsset/index.js.map +0 -1
  347. package/api/entities/Asset/Checkpoints/Schedules.d.ts.map +0 -1
  348. package/api/entities/Asset/Checkpoints/Schedules.js.map +0 -1
  349. package/api/entities/Asset/Checkpoints/index.d.ts.map +0 -1
  350. package/api/entities/Asset/Checkpoints/index.js.map +0 -1
  351. package/api/entities/Asset/Checkpoints/types.d.ts.map +0 -1
  352. package/api/entities/Asset/Checkpoints/types.js.map +0 -1
  353. package/api/entities/Asset/Compliance/Requirements.d.ts.map +0 -1
  354. package/api/entities/Asset/Compliance/Requirements.js.map +0 -1
  355. package/api/entities/Asset/Compliance/TrustedClaimIssuers.d.ts.map +0 -1
  356. package/api/entities/Asset/Compliance/TrustedClaimIssuers.js.map +0 -1
  357. package/api/entities/Asset/Compliance/index.d.ts.map +0 -1
  358. package/api/entities/Asset/Compliance/index.js.map +0 -1
  359. package/api/entities/Asset/CorporateActions/Distributions.d.ts.map +0 -1
  360. package/api/entities/Asset/CorporateActions/Distributions.js.map +0 -1
  361. package/api/entities/Asset/CorporateActions/index.d.ts.map +0 -1
  362. package/api/entities/Asset/CorporateActions/index.js.map +0 -1
  363. package/api/entities/Asset/CorporateActions/types.d.ts.map +0 -1
  364. package/api/entities/Asset/CorporateActions/types.js.map +0 -1
  365. package/api/entities/Asset/Documents.d.ts.map +0 -1
  366. package/api/entities/Asset/Documents.js.map +0 -1
  367. package/api/entities/Asset/Issuance.d.ts.map +0 -1
  368. package/api/entities/Asset/Issuance.js.map +0 -1
  369. package/api/entities/Asset/Metadata.d.ts.map +0 -1
  370. package/api/entities/Asset/Metadata.js.map +0 -1
  371. package/api/entities/Asset/Offerings.d.ts.map +0 -1
  372. package/api/entities/Asset/Offerings.js.map +0 -1
  373. package/api/entities/Asset/Permissions.d.ts.map +0 -1
  374. package/api/entities/Asset/Permissions.js.map +0 -1
  375. package/api/entities/Asset/Settlements.d.ts.map +0 -1
  376. package/api/entities/Asset/Settlements.js.map +0 -1
  377. package/api/entities/Asset/TransferRestrictions/ClaimCount.d.ts.map +0 -1
  378. package/api/entities/Asset/TransferRestrictions/ClaimCount.js.map +0 -1
  379. package/api/entities/Asset/TransferRestrictions/ClaimPercentage.d.ts.map +0 -1
  380. package/api/entities/Asset/TransferRestrictions/ClaimPercentage.js.map +0 -1
  381. package/api/entities/Asset/TransferRestrictions/Count.d.ts.map +0 -1
  382. package/api/entities/Asset/TransferRestrictions/Count.js.map +0 -1
  383. package/api/entities/Asset/TransferRestrictions/Percentage.d.ts.map +0 -1
  384. package/api/entities/Asset/TransferRestrictions/Percentage.js.map +0 -1
  385. package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.d.ts.map +0 -1
  386. package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.js.map +0 -1
  387. package/api/entities/Asset/TransferRestrictions/index.d.ts.map +0 -1
  388. package/api/entities/Asset/TransferRestrictions/index.js.map +0 -1
  389. package/npm-package/polymeshassociation-polymesh-sdk-23.0.0-alpha.4.tgz +0 -0
  390. /package/api/entities/Asset/{Checkpoints → Fungible/Checkpoints}/types.js +0 -0
  391. /package/api/entities/Asset/{CorporateActions → Fungible/CorporateActions}/types.js +0 -0
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.FungibleAsset = void 0;
16
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
+ const lodash_1 = require("lodash");
18
+ const Base_1 = require("../Base");
19
+ const internal_1 = require("../../../../internal");
20
+ const queries_1 = require("../../../../middleware/queries");
21
+ const conversion_1 = require("../../../../utils/conversion");
22
+ const internal_2 = require("../../../../utils/internal");
23
+ const AssetHolders_1 = require("./AssetHolders");
24
+ const Checkpoints_1 = require("./Checkpoints");
25
+ const CorporateActions_1 = require("./CorporateActions");
26
+ const Issuance_1 = require("./Issuance");
27
+ const Offerings_1 = require("./Offerings");
28
+ const Settlements_1 = require("./Settlements");
29
+ const TransferRestrictions_1 = require("./TransferRestrictions");
30
+ /**
31
+ * Class used to manage all Fungible Asset functionality
32
+ */
33
+ class FungibleAsset extends Base_1.BaseAsset {
34
+ /**
35
+ * @hidden
36
+ */
37
+ constructor(identifiers, context) {
38
+ super(identifiers, context);
39
+ const { ticker } = identifiers;
40
+ this.ticker = ticker;
41
+ this.did = (0, conversion_1.tickerToDid)(ticker);
42
+ this.settlements = new Settlements_1.Settlements(this, context);
43
+ this.assetHolders = new AssetHolders_1.AssetHolders(this, context);
44
+ this.issuance = new Issuance_1.Issuance(this, context);
45
+ this.transferRestrictions = new TransferRestrictions_1.TransferRestrictions(this, context);
46
+ this.offerings = new Offerings_1.Offerings(this, context);
47
+ this.checkpoints = new Checkpoints_1.Checkpoints(this, context);
48
+ this.corporateActions = new CorporateActions_1.CorporateActions(this, context);
49
+ this.modify = (0, internal_2.createProcedureMethod)({ getProcedureAndArgs: args => [internal_1.modifyAsset, Object.assign({ ticker }, args)] }, context);
50
+ this.redeem = (0, internal_2.createProcedureMethod)({ getProcedureAndArgs: args => [internal_1.redeemTokens, Object.assign({ ticker }, args)] }, context);
51
+ this.controllerTransfer = (0, internal_2.createProcedureMethod)({ getProcedureAndArgs: args => [internal_1.controllerTransfer, Object.assign({ ticker }, args)] }, context);
52
+ this.setVenueFiltering = (0, internal_2.createProcedureMethod)({ getProcedureAndArgs: args => [internal_1.setVenueFiltering, Object.assign({ ticker }, args)] }, context);
53
+ }
54
+ // eslint-disable-next-line require-jsdoc
55
+ currentFundingRound(callback) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const { context: { polymeshApi: { query: { asset }, }, }, ticker, context, } = this;
58
+ const rawTicker = (0, conversion_1.stringToTicker)(ticker, context);
59
+ const assembleResult = (roundName) => (0, conversion_1.bytesToString)(roundName) || null;
60
+ if (callback) {
61
+ return asset.fundingRound(rawTicker, round => {
62
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises -- callback errors should be handled by the caller
63
+ callback(assembleResult(round));
64
+ });
65
+ }
66
+ const fundingRound = yield asset.fundingRound(rawTicker);
67
+ return assembleResult(fundingRound);
68
+ });
69
+ }
70
+ /**
71
+ * Retrieve the identifier data (block number, date and event index) of the event that was emitted when the token was created
72
+ *
73
+ * @note uses the middlewareV2
74
+ * @note there is a possibility that the data is not ready by the time it is requested. In that case, `null` is returned
75
+ */
76
+ createdAt() {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ const { ticker, context } = this;
79
+ const { data: { assets: { nodes: [asset], }, }, } = yield context.queryMiddleware((0, queries_1.assetQuery)({
80
+ ticker,
81
+ }));
82
+ return (0, internal_2.optionize)(conversion_1.middlewareEventDetailsToEventIdentifier)(asset === null || asset === void 0 ? void 0 : asset.createdBlock, asset === null || asset === void 0 ? void 0 : asset.eventIdx);
83
+ });
84
+ }
85
+ /**
86
+ * Retrieve the amount of unique investors that hold this Asset
87
+ */
88
+ investorCount() {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ const { context: { polymeshApi: { query: { asset: { balanceOf }, }, }, }, context, ticker, } = this;
91
+ const rawTicker = (0, conversion_1.stringToTicker)(ticker, context);
92
+ const balanceEntries = yield balanceOf.entries(rawTicker);
93
+ const assetBalances = balanceEntries.filter(([, balance]) => !(0, conversion_1.balanceToBigNumber)(balance).isZero());
94
+ return new bignumber_js_1.default(assetBalances.length);
95
+ });
96
+ }
97
+ /**
98
+ * Retrieve this Asset's Operation History
99
+ *
100
+ * @note Operations are grouped by the agent Identity who performed them
101
+ *
102
+ * @note uses the middlewareV2
103
+ */
104
+ getOperationHistory() {
105
+ return __awaiter(this, void 0, void 0, function* () {
106
+ const { context, ticker: assetId } = this;
107
+ const { data: { tickerExternalAgentHistories: { nodes }, }, } = yield context.queryMiddleware((0, queries_1.tickerExternalAgentHistoryQuery)({
108
+ assetId,
109
+ }));
110
+ const groupedData = (0, lodash_1.groupBy)(nodes, 'identityId');
111
+ return (0, lodash_1.map)(groupedData, (history, did) => ({
112
+ identity: new internal_1.Identity({ did }, context),
113
+ history: history.map(({ createdBlock, eventIdx }) =>
114
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
115
+ (0, conversion_1.middlewareEventDetailsToEventIdentifier)(createdBlock, eventIdx)),
116
+ }));
117
+ });
118
+ }
119
+ /**
120
+ * Retrieve this Asset's transaction History
121
+ *
122
+ * @note uses the middlewareV2
123
+ */
124
+ getTransactionHistory(opts) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ const { context, ticker } = this;
127
+ const { size, start } = opts;
128
+ const { data: { assetTransactions: { nodes, totalCount }, }, } = yield context.queryMiddleware((0, queries_1.assetTransactionQuery)({
129
+ assetId: ticker,
130
+ }, size, start));
131
+ const data = nodes.map(({ assetId, amount, fromPortfolio, toPortfolio, createdBlock, eventId, eventIdx, extrinsicIdx, }) => (Object.assign({ asset: new FungibleAsset({ ticker: assetId }, context), amount: new bignumber_js_1.default(amount).shiftedBy(-6), event: eventId, from: (0, internal_2.optionize)(conversion_1.middlewarePortfolioToPortfolio)(fromPortfolio, context), to: (0, internal_2.optionize)(conversion_1.middlewarePortfolioToPortfolio)(toPortfolio, context),
132
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
133
+ extrinsicIndex: new bignumber_js_1.default(extrinsicIdx) }, (0, conversion_1.middlewareEventDetailsToEventIdentifier)(createdBlock, eventIdx))));
134
+ const count = new bignumber_js_1.default(totalCount);
135
+ const next = (0, internal_2.calculateNextKey)(count, data.length, start);
136
+ return {
137
+ data,
138
+ next,
139
+ count,
140
+ };
141
+ });
142
+ }
143
+ /**
144
+ * Determine whether this FungibleAsset exists on chain
145
+ */
146
+ exists() {
147
+ return __awaiter(this, void 0, void 0, function* () {
148
+ const { ticker, context, context: { polymeshApi: { query }, }, } = this;
149
+ const rawTicker = (0, conversion_1.stringToTicker)(ticker, context);
150
+ const [tokenSize, nftId] = yield Promise.all([
151
+ query.asset.tokens.size(rawTicker),
152
+ query.nft.collectionTicker(rawTicker),
153
+ ]);
154
+ return !tokenSize.isZero() && nftId.isZero();
155
+ });
156
+ }
157
+ }
158
+ exports.FungibleAsset = FungibleAsset;
159
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/Fungible/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,gEAAqC;AACrC,mCAAsC;AAEtC,kCAAsD;AACtD,mDAOoB;AACpB,4DAI8B;AAgB9B,6DAO4B;AAC5B,yDAAsF;AAGtF,iDAA8C;AAC9C,+CAA4C;AAC5C,yDAAsD;AACtD,yCAAsC;AACtC,2CAAwC;AACxC,+CAA4C;AAC5C,iEAA8D;AAE9D;;GAEG;AACH,MAAa,aAAc,SAAQ,gBAAS;IAS1C;;OAEG;IACH,YAAY,WAA8B,EAAE,OAAgB;QAC1D,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAE5B,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;QAE/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,IAAA,wBAAW,EAAC,MAAM,CAAC,CAAC;QAE/B,IAAI,CAAC,WAAW,GAAG,IAAI,yBAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY,GAAG,IAAI,2BAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpD,IAA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K,EAAE,GACvB,GACF,GAAG,IAAI,CAAC;YACT,MAAM,SAAS,GAAG,IAAA,2BAAc,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAElD,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBAC3C,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;gBAClC,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,SAAS,CAAC;aACtC,CAAC,CAAC;YAEH,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QAC/C,CAAC;KAAA;CAMF;AA7QD,sCA6QC"}
@@ -1,24 +1,10 @@
1
1
  import BigNumber from 'bignumber.js';
2
- import { BaseAsset, UniqueIdentifiers } from "../BaseAsset";
3
- import { AuthorizationRequest, Context } from "../../../../internal";
4
- import { ControllerTransferParams, EventIdentifier, ProcedureMethod, TransferAssetOwnershipParams } from "../../../../types";
2
+ import { BaseAsset } from "../Base";
3
+ import { AssetDetails, EventIdentifier, SubCallback, UnsubCallback } from "../../../../types";
5
4
  /**
6
5
  * Class used to manage Nft functionality
7
6
  */
8
7
  export declare class NftCollection extends BaseAsset {
9
- /**
10
- * @hidden
11
- */
12
- constructor(identifiers: UniqueIdentifiers, context: Context);
13
- /**
14
- * Transfer ownership of the NftCollection to another Identity. This generates an authorization request that must be accepted
15
- * by the recipient
16
- *
17
- * @note this will create {@link api/entities/AuthorizationRequest!AuthorizationRequest | Authorization Request} which has to be accepted by the `target` Identity.
18
- * An {@link api/entities/Account!Account} or {@link api/entities/Identity!Identity} can fetch its pending Authorization Requests by calling {@link api/entities/common/namespaces/Authorizations!Authorizations.getReceived | authorizations.getReceived}.
19
- * Also, an Account or Identity can directly fetch the details of an Authorization Request by calling {@link api/entities/common/namespaces/Authorizations!Authorizations.getOne | authorizations.getOne}
20
- */
21
- transferOwnership: ProcedureMethod<TransferAssetOwnershipParams, AuthorizationRequest>;
22
8
  /**
23
9
  * Retrieve the identifier data (block number, date and event index) of the event that was emitted when the token was created
24
10
  *
@@ -27,20 +13,19 @@ export declare class NftCollection extends BaseAsset {
27
13
  */
28
14
  createdAt(): Promise<EventIdentifier | null>;
29
15
  /**
30
- * Retrieve the amount of unique investors that hold this Nft
16
+ * Retrieve the NftCollection's data
17
+ *
18
+ * @note can be subscribed to
31
19
  */
32
- investorCount(): Promise<BigNumber>;
20
+ details(): Promise<AssetDetails>;
21
+ details(callback: SubCallback<AssetDetails>): Promise<UnsubCallback>;
33
22
  /**
34
- * Force a transfer from a given Portfolio to the caller’s default Portfolio
23
+ * Retrieve the amount of unique investors that hold this Nft
35
24
  */
36
- controllerTransfer: ProcedureMethod<ControllerTransferParams, void>;
25
+ investorCount(): Promise<BigNumber>;
37
26
  /**
38
27
  * Determine whether this NftCollection exists on chain
39
28
  */
40
29
  exists(): Promise<boolean>;
41
- /**
42
- * Return the NftCollection's ticker
43
- */
44
- toHuman(): string;
45
30
  }
46
31
  //# sourceMappingURL=NftCollection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NftCollection.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/NonFungible/NftCollection.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,qBAAuC;AAC9E,OAAO,EACL,oBAAoB,EACpB,OAAO,EAGR,6BAAmB;AAGpB,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,4BAA4B,EAC7B,0BAAgB;AAKjB;;GAEG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAC1C;;OAEG;gBACS,WAAW,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO;IAe5D;;;;;;;OAOG;IACI,iBAAiB,EAAE,eAAe,CAAC,4BAA4B,EAAE,oBAAoB,CAAC,CAAC;IAE9F;;;;;OAKG;IACU,SAAS,IAAI,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAkBzD;;OAEG;IACU,aAAa,IAAI,OAAO,CAAC,SAAS,CAAC;IAkBhD;;OAEG;IACI,kBAAkB,EAAE,eAAe,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC;IAE3E;;OAEG;IACU,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAUvC;;OAEG;IACI,OAAO,IAAI,MAAM;CAGzB"}
1
+ {"version":3,"file":"NftCollection.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/NonFungible/NftCollection.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,gBAAkC;AAGtD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,0BAAgB;AAqBpF;;GAEG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAC1C;;;;;OAKG;IACU,SAAS,IAAI,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAkBzD;;;;OAIG;IACa,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC;IAChC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IA0CpF;;OAEG;IACU,aAAa,IAAI,OAAO,CAAC,SAAS,CAAC;IAkBhD;;OAEG;IACmB,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;CASjD"}
@@ -14,24 +14,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.NftCollection = void 0;
16
16
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
- const BaseAsset_1 = require("../BaseAsset");
18
- const internal_1 = require("../../../../internal");
17
+ const Base_1 = require("../Base");
19
18
  const queries_1 = require("../../../../middleware/queries");
20
19
  const conversion_1 = require("../../../../utils/conversion");
21
- const internal_2 = require("../../../../utils/internal");
20
+ const internal_1 = require("../../../../utils/internal");
21
+ const sumNftIssuance = (numberOfNfts) => {
22
+ let numberIssued = new bignumber_js_1.default(0);
23
+ numberOfNfts.forEach(([, holderEntry]) => {
24
+ const holderAmount = (0, conversion_1.u64ToBigNumber)(holderEntry);
25
+ numberIssued = numberIssued.plus(holderAmount);
26
+ });
27
+ return numberIssued;
28
+ };
22
29
  /**
23
30
  * Class used to manage Nft functionality
24
31
  */
25
- class NftCollection extends BaseAsset_1.BaseAsset {
26
- /**
27
- * @hidden
28
- */
29
- constructor(identifiers, context) {
30
- super(identifiers, context);
31
- const { ticker } = identifiers;
32
- this.transferOwnership = (0, internal_2.createProcedureMethod)({ getProcedureAndArgs: args => [internal_1.transferAssetOwnership, Object.assign({ ticker }, args)] }, context);
33
- this.controllerTransfer = (0, internal_2.createProcedureMethod)({ getProcedureAndArgs: args => [internal_1.controllerTransfer, Object.assign({ ticker }, args)] }, context);
34
- }
32
+ class NftCollection extends Base_1.BaseAsset {
35
33
  /**
36
34
  * Retrieve the identifier data (block number, date and event index) of the event that was emitted when the token was created
37
35
  *
@@ -44,7 +42,35 @@ class NftCollection extends BaseAsset_1.BaseAsset {
44
42
  const { data: { assets: { nodes: [asset], }, }, } = yield context.queryMiddleware((0, queries_1.assetQuery)({
45
43
  ticker,
46
44
  }));
47
- return (0, internal_2.optionize)(conversion_1.middlewareEventDetailsToEventIdentifier)(asset === null || asset === void 0 ? void 0 : asset.createdBlock, asset === null || asset === void 0 ? void 0 : asset.eventIdx);
45
+ return (0, internal_1.optionize)(conversion_1.middlewareEventDetailsToEventIdentifier)(asset === null || asset === void 0 ? void 0 : asset.createdBlock, asset === null || asset === void 0 ? void 0 : asset.eventIdx);
46
+ });
47
+ }
48
+ // eslint-disable-next-line require-jsdoc
49
+ details(callback) {
50
+ const _super = Object.create(null, {
51
+ details: { get: () => super.details }
52
+ });
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ const { context: { polymeshApi: { query }, }, ticker, context, } = this;
55
+ const rawTicker = (0, conversion_1.stringToTicker)(ticker, context);
56
+ const rawNumberNftsPromise = query.nft.numberOfNFTs.entries(rawTicker);
57
+ if (callback) {
58
+ const rawNumberNfts = yield rawNumberNftsPromise;
59
+ const numberIssued = sumNftIssuance(rawNumberNfts);
60
+ // currently `asset.tokens` does not track Nft `totalSupply', we wrap the callback to provide it
61
+ const wrappedCallback = (commonDetails) => __awaiter(this, void 0, void 0, function* () {
62
+ const nftDetails = Object.assign(Object.assign({}, commonDetails), { totalSupply: numberIssued });
63
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
64
+ callback(nftDetails);
65
+ });
66
+ return _super.details.call(this, wrappedCallback);
67
+ }
68
+ const [rawNumberNfts, commonDetails] = yield Promise.all([
69
+ rawNumberNftsPromise,
70
+ _super.details.call(this),
71
+ ]);
72
+ const numberIssued = sumNftIssuance(rawNumberNfts);
73
+ return Object.assign(Object.assign({}, commonDetails), { totalSupply: numberIssued });
48
74
  });
49
75
  }
50
76
  /**
@@ -69,12 +95,6 @@ class NftCollection extends BaseAsset_1.BaseAsset {
69
95
  return !rawTokenId.isZero();
70
96
  });
71
97
  }
72
- /**
73
- * Return the NftCollection's ticker
74
- */
75
- toHuman() {
76
- return this.ticker;
77
- }
78
98
  }
79
99
  exports.NftCollection = NftCollection;
80
100
  //# sourceMappingURL=NftCollection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NftCollection.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/NonFungible/NftCollection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AAErC,4CAA8E;AAC9E,mDAKoB;AACpB,4DAAkD;AASlD,6DAA6F;AAC7F,yDAAoE;AAEpE;;GAEG;AACH,MAAa,aAAc,SAAQ,qBAAS;IAC1C;;OAEG;IACH,YAAY,WAA8B,EAAE,OAAgB;QAC1D,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAE5B,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,C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AAO,CAAC,MAAM,EAAE,CAAC,CAAC;YAE/E,OAAO,IAAI,sBAAS,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC;KAAA;IAOD;;OAEG;IACU,MAAM;;YACjB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;YAEjC,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,gBAAgB,CACrE,IAAA,2BAAc,EAAC,MAAM,EAAE,OAAO,CAAC,CAChC,CAAC;YAEF,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QAC9B,CAAC;KAAA;IAED;;OAEG;IACI,OAAO;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAlGD,sCAkGC"}
1
+ {"version":3,"file":"NftCollection.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/NonFungible/NftCollection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,gEAAqC;AAErC,kCAAsD;AACtD,4DAAkD;AAIlD,6DAI4B;AAC5B,yDAA6C;AAE7C,MAAM,cAAc,GAAG,CACrB,YAA2F,EAChF,EAAE;IACb,IAAI,YAAY,GAAG,IAAI,sBAAS,CAAC,CAAC,CAAC,CAAC;IACpC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,EAAE;QACvC,MAAM,YAAY,GAAG,IAAA,2BAAc,EAAC,WAAW,CAAC,CAAC;QACjD,YAAY,GAAG,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAa,aAAc,SAAQ,gBAAS;IAC1C;;;;;OAKG;IACU,SAAS;;YACpB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;YAEjC,MAAM,EACJ,IAAI,EAA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AC,CAAC;YAEnD,uCAAY,aAAa,KAAE,WAAW,EAAE,YAAY,IAAG;QACzD,CAAC;KAAA;IAED;;OAEG;IACU,aAAa;;YACxB,MAAM,EACJ,OAAO,EAAE,EACP,WAAW,EAAE,EAAE,KAAK,EAAE,GACvB,EACD,OAAO,EACP,MAAM,GACP,GAAG,IAAI,CAAC;YAET,MAAM,SAAS,GAAG,IAAA,2BAAc,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAElD,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAEtE,MAAM,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;YAE/E,OAAO,IAAI,sBAAS,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC;KAAA;IAED;;OAEG;IACmB,MAAM;;YAC1B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;YAEjC,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,gBAAgB,CACrE,IAAA,2BAAc,EAAC,MAAM,EAAE,OAAO,CAAC,CAChC,CAAC;YAEF,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QAC9B,CAAC;KAAA;CACF;AA1GD,sCA0GC"}
@@ -1,133 +1,5 @@
1
- import BigNumber from 'bignumber.js';
2
- import { BaseAsset } from "./BaseAsset";
3
- import { Metadata } from "./Metadata";
4
- import { AuthorizationRequest, Context } from "../../../internal";
5
- import { ControllerTransferParams, EventIdentifier, HistoricAgentOperation, HistoricAssetTransaction, ModifyAssetParams, NoArgsProcedureMethod, ProcedureMethod, RedeemTokensParams, ResultSet, SetVenueFilteringParams, SubCallback, TransferAssetOwnershipParams, UnsubCallback } from "../../../types";
6
- import { AssetHolders } from './AssetHolders';
7
- import { Checkpoints } from './Checkpoints';
8
- import { Compliance } from './Compliance';
9
- import { CorporateActions } from './CorporateActions';
10
- import { Documents } from './Documents';
11
- import { Issuance } from './Issuance';
12
- import { Offerings } from './Offerings';
13
- import { Permissions } from './Permissions';
14
- import { Settlements } from './Settlements';
15
- import { TransferRestrictions } from './TransferRestrictions';
16
- import { AssetDetails } from './types';
17
- /**
18
- * Properties that uniquely identify an Asset
19
- */
20
- export interface UniqueIdentifiers {
21
- /**
22
- * ticker of the Asset
23
- */
24
- ticker: string;
25
- }
26
- /**
27
- * Class used to manage all Asset functionality
28
- */
29
- export declare class Asset extends BaseAsset {
30
- documents: Documents;
31
- settlements: Settlements;
32
- assetHolders: AssetHolders;
33
- issuance: Issuance;
34
- compliance: Compliance;
35
- transferRestrictions: TransferRestrictions;
36
- offerings: Offerings;
37
- checkpoints: Checkpoints;
38
- corporateActions: CorporateActions;
39
- permissions: Permissions;
40
- metadata: Metadata;
41
- /**
42
- * @hidden
43
- */
44
- constructor(identifiers: UniqueIdentifiers, context: Context);
45
- /**
46
- * Transfer ownership of the Asset to another Identity. This generates an authorization request that must be accepted
47
- * by the recipient
48
- *
49
- * @note this will create {@link api/entities/AuthorizationRequest!AuthorizationRequest | Authorization Request} which has to be accepted by the `target` Identity.
50
- * An {@link api/entities/Account!Account} or {@link api/entities/Identity!Identity} can fetch its pending Authorization Requests by calling {@link api/entities/common/namespaces/Authorizations!Authorizations.getReceived | authorizations.getReceived}.
51
- * Also, an Account or Identity can directly fetch the details of an Authorization Request by calling {@link api/entities/common/namespaces/Authorizations!Authorizations.getOne | authorizations.getOne}
52
- */
53
- transferOwnership: ProcedureMethod<TransferAssetOwnershipParams, AuthorizationRequest>;
54
- /**
55
- * Modify some properties of the Asset
56
- *
57
- * @throws if the passed values result in no changes being made to the Asset
58
- */
59
- modify: ProcedureMethod<ModifyAssetParams, Asset>;
60
- /**
61
- * Retrieve the Asset's data
62
- *
63
- * @note can be subscribed to
64
- */
65
- details(): Promise<AssetDetails>;
66
- details(callback: SubCallback<AssetDetails>): Promise<UnsubCallback>;
67
- /**
68
- * Retrieve the Asset's funding round
69
- *
70
- * @note can be subscribed to
71
- */
72
- currentFundingRound(): Promise<string | null>;
73
- currentFundingRound(callback: SubCallback<string | null>): Promise<UnsubCallback>;
74
- /**
75
- * Retrieve the identifier data (block number, date and event index) of the event that was emitted when the token was created
76
- *
77
- * @note uses the middlewareV2
78
- * @note there is a possibility that the data is not ready by the time it is requested. In that case, `null` is returned
79
- */
80
- createdAt(): Promise<EventIdentifier | null>;
81
- /**
82
- * Freeze transfers of the Asset
83
- */
84
- freeze: NoArgsProcedureMethod<Asset>;
85
- /**
86
- * Unfreeze transfers of the Asset
87
- */
88
- unfreeze: NoArgsProcedureMethod<Asset>;
89
- /**
90
- * Redeem (burn) an amount of this Asset's tokens
91
- *
92
- * @note tokens are removed from the caller's Default Portfolio
93
- */
94
- redeem: ProcedureMethod<RedeemTokensParams, void>;
95
- /**
96
- * Retrieve the amount of unique investors that hold this Asset
97
- */
98
- investorCount(): Promise<BigNumber>;
99
- /**
100
- * Force a transfer from a given Portfolio to the caller’s default Portfolio
101
- */
102
- controllerTransfer: ProcedureMethod<ControllerTransferParams, void>;
103
- /**
104
- * Retrieve this Asset's Operation History
105
- *
106
- * @note Operations are grouped by the agent Identity who performed them
107
- *
108
- * @note uses the middlewareV2
109
- */
110
- getOperationHistory(): Promise<HistoricAgentOperation[]>;
111
- /**
112
- * Retrieve this Asset's transaction History
113
- *
114
- * @note uses the middlewareV2
115
- */
116
- getTransactionHistory(opts: {
117
- size?: BigNumber;
118
- start?: BigNumber;
119
- }): Promise<ResultSet<HistoricAssetTransaction>>;
120
- /**
121
- * Determine whether this Asset exists on chain
122
- */
123
- exists(): Promise<boolean>;
124
- /**
125
- * Return the Asset's ticker
126
- */
127
- toHuman(): string;
128
- /**
129
- * Enable/disable venue filtering for this Asset and/or set allowed/disallowed venues
130
- */
131
- setVenueFiltering: ProcedureMethod<SetVenueFilteringParams, void>;
132
- }
1
+ export * from './Fungible';
2
+ export * from './NonFungible';
3
+ export * from './Base';
4
+ export * from './types';
133
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/entities/Asset/index.ts"],"names":[],"mappings":"AAOA,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,EAAE,SAAS,EAAE,oBAAuC;AAC3D,OAAO,EAAE,QAAQ,EAAE,mBAAsC;AACzD,OAAO,EACL,oBAAoB,EACpB,OAAO,EASR,0BAAmB;AAOpB,OAAO,EACL,wBAAwB,EAExB,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,uBAAuB,EACvB,WAAW,EACX,4BAA4B,EAC5B,aAAa,EACd,uBAAgB;AAgBjB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED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