@polymeshassociation/polymesh-sdk 14.0.0-beta.11

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 (791) hide show
  1. package/AccountManagement.d.ts +89 -0
  2. package/AccountManagement.d.ts.map +1 -0
  3. package/AccountManagement.js +116 -0
  4. package/AccountManagement.js.map +1 -0
  5. package/Assets.d.ts +68 -0
  6. package/Assets.d.ts.map +1 -0
  7. package/Assets.js +114 -0
  8. package/Assets.js.map +1 -0
  9. package/CHANGELOG.md +6 -0
  10. package/Claims.d.ts +123 -0
  11. package/Claims.d.ts.map +1 -0
  12. package/Claims.js +247 -0
  13. package/Claims.js.map +1 -0
  14. package/Identities.d.ts +45 -0
  15. package/Identities.d.ts.map +1 -0
  16. package/Identities.js +34 -0
  17. package/Identities.js.map +1 -0
  18. package/Network.d.ts +104 -0
  19. package/Network.d.ts.map +1 -0
  20. package/Network.js +203 -0
  21. package/Network.js.map +1 -0
  22. package/Polymesh.d.ts +111 -0
  23. package/Polymesh.d.ts.map +1 -0
  24. package/Polymesh.js +219 -0
  25. package/Polymesh.js.map +1 -0
  26. package/Settlements.d.ts +44 -0
  27. package/Settlements.d.ts.map +1 -0
  28. package/Settlements.js +93 -0
  29. package/Settlements.js.map +1 -0
  30. package/api/entities/Account.d.ts +102 -0
  31. package/api/entities/Account.d.ts.map +1 -0
  32. package/api/entities/Account.js +375 -0
  33. package/api/entities/Account.js.map +1 -0
  34. package/api/entities/Asset/AssetHolders.d.ts +14 -0
  35. package/api/entities/Asset/AssetHolders.d.ts.map +1 -0
  36. package/api/entities/Asset/AssetHolders.js +45 -0
  37. package/api/entities/Asset/AssetHolders.js.map +1 -0
  38. package/api/entities/Asset/Checkpoints/Schedules.d.ts +50 -0
  39. package/api/entities/Asset/Checkpoints/Schedules.d.ts.map +1 -0
  40. package/api/entities/Asset/Checkpoints/Schedules.js +103 -0
  41. package/api/entities/Asset/Checkpoints/Schedules.js.map +1 -0
  42. package/api/entities/Asset/Checkpoints/index.d.ts +33 -0
  43. package/api/entities/Asset/Checkpoints/index.d.ts.map +1 -0
  44. package/api/entities/Asset/Checkpoints/index.js +90 -0
  45. package/api/entities/Asset/Checkpoints/index.js.map +1 -0
  46. package/api/entities/Asset/Checkpoints/types.d.ts +20 -0
  47. package/api/entities/Asset/Checkpoints/types.d.ts.map +1 -0
  48. package/api/entities/Asset/Checkpoints/types.js +9 -0
  49. package/api/entities/Asset/Checkpoints/types.js.map +1 -0
  50. package/api/entities/Asset/Compliance/Requirements.d.ts +68 -0
  51. package/api/entities/Asset/Compliance/Requirements.d.ts.map +1 -0
  52. package/api/entities/Asset/Compliance/Requirements.js +114 -0
  53. package/api/entities/Asset/Compliance/Requirements.js.map +1 -0
  54. package/api/entities/Asset/Compliance/TrustedClaimIssuers.d.ts +33 -0
  55. package/api/entities/Asset/Compliance/TrustedClaimIssuers.d.ts.map +1 -0
  56. package/api/entities/Asset/Compliance/TrustedClaimIssuers.js +70 -0
  57. package/api/entities/Asset/Compliance/TrustedClaimIssuers.js.map +1 -0
  58. package/api/entities/Asset/Compliance/index.d.ts +15 -0
  59. package/api/entities/Asset/Compliance/index.d.ts.map +1 -0
  60. package/api/entities/Asset/Compliance/index.js +21 -0
  61. package/api/entities/Asset/Compliance/index.js.map +1 -0
  62. package/api/entities/Asset/CorporateActions/Distributions.d.ts +32 -0
  63. package/api/entities/Asset/CorporateActions/Distributions.d.ts.map +1 -0
  64. package/api/entities/Asset/CorporateActions/Distributions.js +74 -0
  65. package/api/entities/Asset/CorporateActions/Distributions.js.map +1 -0
  66. package/api/entities/Asset/CorporateActions/index.d.ts +58 -0
  67. package/api/entities/Asset/CorporateActions/index.d.ts.map +1 -0
  68. package/api/entities/Asset/CorporateActions/index.js +85 -0
  69. package/api/entities/Asset/CorporateActions/index.js.map +1 -0
  70. package/api/entities/Asset/CorporateActions/types.d.ts +8 -0
  71. package/api/entities/Asset/CorporateActions/types.d.ts.map +1 -0
  72. package/api/entities/Asset/CorporateActions/types.js +3 -0
  73. package/api/entities/Asset/CorporateActions/types.js.map +1 -0
  74. package/api/entities/Asset/Documents.d.ts +24 -0
  75. package/api/entities/Asset/Documents.d.ts.map +1 -0
  76. package/api/entities/Asset/Documents.js +49 -0
  77. package/api/entities/Asset/Documents.js.map +1 -0
  78. package/api/entities/Asset/Issuance.d.ts +21 -0
  79. package/api/entities/Asset/Issuance.d.ts.map +1 -0
  80. package/api/entities/Asset/Issuance.js +20 -0
  81. package/api/entities/Asset/Issuance.js.map +1 -0
  82. package/api/entities/Asset/Offerings.d.ts +37 -0
  83. package/api/entities/Asset/Offerings.d.ts.map +1 -0
  84. package/api/entities/Asset/Offerings.js +79 -0
  85. package/api/entities/Asset/Offerings.js.map +1 -0
  86. package/api/entities/Asset/Permissions.d.ts +50 -0
  87. package/api/entities/Asset/Permissions.d.ts.map +1 -0
  88. package/api/entities/Asset/Permissions.js +83 -0
  89. package/api/entities/Asset/Permissions.js.map +1 -0
  90. package/api/entities/Asset/Settlements.d.ts +48 -0
  91. package/api/entities/Asset/Settlements.d.ts.map +1 -0
  92. package/api/entities/Asset/Settlements.js +108 -0
  93. package/api/entities/Asset/Settlements.js.map +1 -0
  94. package/api/entities/Asset/TransferRestrictions/Count.d.ts +36 -0
  95. package/api/entities/Asset/TransferRestrictions/Count.d.ts.map +1 -0
  96. package/api/entities/Asset/TransferRestrictions/Count.js +16 -0
  97. package/api/entities/Asset/TransferRestrictions/Count.js.map +1 -0
  98. package/api/entities/Asset/TransferRestrictions/Percentage.d.ts +36 -0
  99. package/api/entities/Asset/TransferRestrictions/Percentage.d.ts.map +1 -0
  100. package/api/entities/Asset/TransferRestrictions/Percentage.js +16 -0
  101. package/api/entities/Asset/TransferRestrictions/Percentage.js.map +1 -0
  102. package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.d.ts +44 -0
  103. package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.d.ts.map +1 -0
  104. package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.js +99 -0
  105. package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.js.map +1 -0
  106. package/api/entities/Asset/TransferRestrictions/index.d.ts +15 -0
  107. package/api/entities/Asset/TransferRestrictions/index.d.ts.map +1 -0
  108. package/api/entities/Asset/TransferRestrictions/index.js +21 -0
  109. package/api/entities/Asset/TransferRestrictions/index.js.map +1 -0
  110. package/api/entities/Asset/index.d.ts +166 -0
  111. package/api/entities/Asset/index.d.ts.map +1 -0
  112. package/api/entities/Asset/index.js +306 -0
  113. package/api/entities/Asset/index.js.map +1 -0
  114. package/api/entities/Asset/types.d.ts +55 -0
  115. package/api/entities/Asset/types.d.ts.map +1 -0
  116. package/api/entities/Asset/types.js +19 -0
  117. package/api/entities/Asset/types.js.map +1 -0
  118. package/api/entities/AuthorizationRequest.d.ts +95 -0
  119. package/api/entities/AuthorizationRequest.d.ts.map +1 -0
  120. package/api/entities/AuthorizationRequest.js +128 -0
  121. package/api/entities/AuthorizationRequest.js.map +1 -0
  122. package/api/entities/Checkpoint.d.ts +71 -0
  123. package/api/entities/Checkpoint.d.ts.map +1 -0
  124. package/api/entities/Checkpoint.js +180 -0
  125. package/api/entities/Checkpoint.js.map +1 -0
  126. package/api/entities/CheckpointSchedule/index.d.ts +83 -0
  127. package/api/entities/CheckpointSchedule/index.d.ts.map +1 -0
  128. package/api/entities/CheckpointSchedule/index.js +137 -0
  129. package/api/entities/CheckpointSchedule/index.js.map +1 -0
  130. package/api/entities/CheckpointSchedule/types.d.ts +8 -0
  131. package/api/entities/CheckpointSchedule/types.d.ts.map +1 -0
  132. package/api/entities/CheckpointSchedule/types.js +3 -0
  133. package/api/entities/CheckpointSchedule/types.js.map +1 -0
  134. package/api/entities/CorporateAction.d.ts +40 -0
  135. package/api/entities/CorporateAction.d.ts.map +1 -0
  136. package/api/entities/CorporateAction.js +25 -0
  137. package/api/entities/CorporateAction.js.map +1 -0
  138. package/api/entities/CorporateActionBase/index.d.ts +106 -0
  139. package/api/entities/CorporateActionBase/index.d.ts.map +1 -0
  140. package/api/entities/CorporateActionBase/index.js +134 -0
  141. package/api/entities/CorporateActionBase/index.js.map +1 -0
  142. package/api/entities/CorporateActionBase/types.d.ts +30 -0
  143. package/api/entities/CorporateActionBase/types.d.ts.map +1 -0
  144. package/api/entities/CorporateActionBase/types.js +17 -0
  145. package/api/entities/CorporateActionBase/types.js.map +1 -0
  146. package/api/entities/CustomPermissionGroup.d.ts +43 -0
  147. package/api/entities/CustomPermissionGroup.d.ts.map +1 -0
  148. package/api/entities/CustomPermissionGroup.js +81 -0
  149. package/api/entities/CustomPermissionGroup.js.map +1 -0
  150. package/api/entities/DefaultPortfolio.d.ts +18 -0
  151. package/api/entities/DefaultPortfolio.d.ts.map +1 -0
  152. package/api/entities/DefaultPortfolio.js +35 -0
  153. package/api/entities/DefaultPortfolio.js.map +1 -0
  154. package/api/entities/DefaultTrustedClaimIssuer.d.ts +36 -0
  155. package/api/entities/DefaultTrustedClaimIssuer.d.ts.map +1 -0
  156. package/api/entities/DefaultTrustedClaimIssuer.js +88 -0
  157. package/api/entities/DefaultTrustedClaimIssuer.js.map +1 -0
  158. package/api/entities/DividendDistribution/index.d.ts +158 -0
  159. package/api/entities/DividendDistribution/index.d.ts.map +1 -0
  160. package/api/entities/DividendDistribution/index.js +346 -0
  161. package/api/entities/DividendDistribution/index.js.map +1 -0
  162. package/api/entities/DividendDistribution/types.d.ts +24 -0
  163. package/api/entities/DividendDistribution/types.d.ts.map +1 -0
  164. package/api/entities/DividendDistribution/types.js +3 -0
  165. package/api/entities/DividendDistribution/types.js.map +1 -0
  166. package/api/entities/Entity.d.ts +43 -0
  167. package/api/entities/Entity.d.ts.map +1 -0
  168. package/api/entities/Entity.js +58 -0
  169. package/api/entities/Entity.js.map +1 -0
  170. package/api/entities/Identity/AssetPermissions.d.ts +76 -0
  171. package/api/entities/Identity/AssetPermissions.d.ts.map +1 -0
  172. package/api/entities/Identity/AssetPermissions.js +284 -0
  173. package/api/entities/Identity/AssetPermissions.js.map +1 -0
  174. package/api/entities/Identity/IdentityAuthorizations.d.ts +23 -0
  175. package/api/entities/Identity/IdentityAuthorizations.d.ts.map +1 -0
  176. package/api/entities/Identity/IdentityAuthorizations.js +79 -0
  177. package/api/entities/Identity/IdentityAuthorizations.js.map +1 -0
  178. package/api/entities/Identity/Portfolios.d.ts +43 -0
  179. package/api/entities/Identity/Portfolios.d.ts.map +1 -0
  180. package/api/entities/Identity/Portfolios.js +107 -0
  181. package/api/entities/Identity/Portfolios.js.map +1 -0
  182. package/api/entities/Identity/index.d.ts +152 -0
  183. package/api/entities/Identity/index.d.ts.map +1 -0
  184. package/api/entities/Identity/index.js +430 -0
  185. package/api/entities/Identity/index.js.map +1 -0
  186. package/api/entities/Instruction/index.d.ts +91 -0
  187. package/api/entities/Instruction/index.d.ts.map +1 -0
  188. package/api/entities/Instruction/index.js +261 -0
  189. package/api/entities/Instruction/index.js.map +1 -0
  190. package/api/entities/Instruction/types.d.ts +52 -0
  191. package/api/entities/Instruction/types.d.ts.map +1 -0
  192. package/api/entities/Instruction/types.js +21 -0
  193. package/api/entities/Instruction/types.js.map +1 -0
  194. package/api/entities/KnownPermissionGroup.d.ts +38 -0
  195. package/api/entities/KnownPermissionGroup.d.ts.map +1 -0
  196. package/api/entities/KnownPermissionGroup.js +100 -0
  197. package/api/entities/KnownPermissionGroup.js.map +1 -0
  198. package/api/entities/Namespace.d.ts +15 -0
  199. package/api/entities/Namespace.d.ts.map +1 -0
  200. package/api/entities/Namespace.js +19 -0
  201. package/api/entities/Namespace.js.map +1 -0
  202. package/api/entities/NumberedPortfolio.d.ts +48 -0
  203. package/api/entities/NumberedPortfolio.d.ts.map +1 -0
  204. package/api/entities/NumberedPortfolio.js +95 -0
  205. package/api/entities/NumberedPortfolio.js.map +1 -0
  206. package/api/entities/Offering/index.d.ts +93 -0
  207. package/api/entities/Offering/index.d.ts.map +1 -0
  208. package/api/entities/Offering/index.js +135 -0
  209. package/api/entities/Offering/index.js.map +1 -0
  210. package/api/entities/Offering/types.d.ts +83 -0
  211. package/api/entities/Offering/types.d.ts.map +1 -0
  212. package/api/entities/Offering/types.js +55 -0
  213. package/api/entities/Offering/types.js.map +1 -0
  214. package/api/entities/PermissionGroup.d.ts +26 -0
  215. package/api/entities/PermissionGroup.d.ts.map +1 -0
  216. package/api/entities/PermissionGroup.js +19 -0
  217. package/api/entities/PermissionGroup.js.map +1 -0
  218. package/api/entities/Portfolio/index.d.ts +112 -0
  219. package/api/entities/Portfolio/index.d.ts.map +1 -0
  220. package/api/entities/Portfolio/index.js +246 -0
  221. package/api/entities/Portfolio/index.js.map +1 -0
  222. package/api/entities/Portfolio/types.d.ts +21 -0
  223. package/api/entities/Portfolio/types.d.ts.map +1 -0
  224. package/api/entities/Portfolio/types.js +3 -0
  225. package/api/entities/Portfolio/types.js.map +1 -0
  226. package/api/entities/Subsidy/index.d.ts +80 -0
  227. package/api/entities/Subsidy/index.d.ts.map +1 -0
  228. package/api/entities/Subsidy/index.js +97 -0
  229. package/api/entities/Subsidy/index.js.map +1 -0
  230. package/api/entities/Subsidy/types.d.ts +21 -0
  231. package/api/entities/Subsidy/types.d.ts.map +1 -0
  232. package/api/entities/Subsidy/types.js +3 -0
  233. package/api/entities/Subsidy/types.js.map +1 -0
  234. package/api/entities/TickerReservation/index.d.ts +72 -0
  235. package/api/entities/TickerReservation/index.d.ts.map +1 -0
  236. package/api/entities/TickerReservation/index.js +118 -0
  237. package/api/entities/TickerReservation/index.js.map +1 -0
  238. package/api/entities/TickerReservation/types.d.ts +27 -0
  239. package/api/entities/TickerReservation/types.d.ts.map +1 -0
  240. package/api/entities/TickerReservation/types.js +19 -0
  241. package/api/entities/TickerReservation/types.js.map +1 -0
  242. package/api/entities/Venue/index.d.ts +77 -0
  243. package/api/entities/Venue/index.d.ts.map +1 -0
  244. package/api/entities/Venue/index.js +139 -0
  245. package/api/entities/Venue/index.js.map +1 -0
  246. package/api/entities/Venue/types.d.ts +22 -0
  247. package/api/entities/Venue/types.d.ts.map +1 -0
  248. package/api/entities/Venue/types.js +20 -0
  249. package/api/entities/Venue/types.js.map +1 -0
  250. package/api/entities/common/namespaces/Authorizations.d.ts +37 -0
  251. package/api/entities/common/namespaces/Authorizations.d.ts.map +1 -0
  252. package/api/entities/common/namespaces/Authorizations.js +91 -0
  253. package/api/entities/common/namespaces/Authorizations.js.map +1 -0
  254. package/api/entities/types.d.ts +30 -0
  255. package/api/entities/types.d.ts.map +1 -0
  256. package/api/entities/types.js +27 -0
  257. package/api/entities/types.js.map +1 -0
  258. package/api/procedures/addAssetRequirement.d.ts +30 -0
  259. package/api/procedures/addAssetRequirement.d.ts.map +1 -0
  260. package/api/procedures/addAssetRequirement.js +70 -0
  261. package/api/procedures/addAssetRequirement.js.map +1 -0
  262. package/api/procedures/addInstruction.d.ts +70 -0
  263. package/api/procedures/addInstruction.d.ts.map +1 -0
  264. package/api/procedures/addInstruction.js +266 -0
  265. package/api/procedures/addInstruction.js.map +1 -0
  266. package/api/procedures/addInvestorUniquenessClaim.d.ts +23 -0
  267. package/api/procedures/addInvestorUniquenessClaim.d.ts.map +1 -0
  268. package/api/procedures/addInvestorUniquenessClaim.js +80 -0
  269. package/api/procedures/addInvestorUniquenessClaim.js.map +1 -0
  270. package/api/procedures/addTransferRestriction.d.ts +29 -0
  271. package/api/procedures/addTransferRestriction.d.ts.map +1 -0
  272. package/api/procedures/addTransferRestriction.js +102 -0
  273. package/api/procedures/addTransferRestriction.js.map +1 -0
  274. package/api/procedures/claimClassicTicker.d.ts +22 -0
  275. package/api/procedures/claimClassicTicker.d.ts.map +1 -0
  276. package/api/procedures/claimClassicTicker.js +112 -0
  277. package/api/procedures/claimClassicTicker.js.map +1 -0
  278. package/api/procedures/claimDividends.d.ts +16 -0
  279. package/api/procedures/claimDividends.d.ts.map +1 -0
  280. package/api/procedures/claimDividends.js +58 -0
  281. package/api/procedures/claimDividends.js.map +1 -0
  282. package/api/procedures/closeOffering.d.ts +23 -0
  283. package/api/procedures/closeOffering.d.ts.map +1 -0
  284. package/api/procedures/closeOffering.js +59 -0
  285. package/api/procedures/closeOffering.js.map +1 -0
  286. package/api/procedures/configureDividendDistribution.d.ts +69 -0
  287. package/api/procedures/configureDividendDistribution.d.ts.map +1 -0
  288. package/api/procedures/configureDividendDistribution.js +158 -0
  289. package/api/procedures/configureDividendDistribution.js.map +1 -0
  290. package/api/procedures/consumeAddMultiSigSignerAuthorization.d.ts +22 -0
  291. package/api/procedures/consumeAddMultiSigSignerAuthorization.d.ts.map +1 -0
  292. package/api/procedures/consumeAddMultiSigSignerAuthorization.js +102 -0
  293. package/api/procedures/consumeAddMultiSigSignerAuthorization.js.map +1 -0
  294. package/api/procedures/consumeAuthorizationRequests.d.ts +24 -0
  295. package/api/procedures/consumeAuthorizationRequests.d.ts.map +1 -0
  296. package/api/procedures/consumeAuthorizationRequests.js +124 -0
  297. package/api/procedures/consumeAuthorizationRequests.js.map +1 -0
  298. package/api/procedures/consumeJoinOrRotateAuthorization.d.ts +35 -0
  299. package/api/procedures/consumeJoinOrRotateAuthorization.d.ts.map +1 -0
  300. package/api/procedures/consumeJoinOrRotateAuthorization.js +136 -0
  301. package/api/procedures/consumeJoinOrRotateAuthorization.js.map +1 -0
  302. package/api/procedures/controllerTransfer.d.ts +40 -0
  303. package/api/procedures/controllerTransfer.d.ts.map +1 -0
  304. package/api/procedures/controllerTransfer.js +90 -0
  305. package/api/procedures/controllerTransfer.js.map +1 -0
  306. package/api/procedures/createAsset.d.ts +82 -0
  307. package/api/procedures/createAsset.d.ts.map +1 -0
  308. package/api/procedures/createAsset.js +178 -0
  309. package/api/procedures/createAsset.js.map +1 -0
  310. package/api/procedures/createCheckpoint.d.ts +26 -0
  311. package/api/procedures/createCheckpoint.d.ts.map +1 -0
  312. package/api/procedures/createCheckpoint.js +61 -0
  313. package/api/procedures/createCheckpoint.js.map +1 -0
  314. package/api/procedures/createCheckpointSchedule.d.ts +43 -0
  315. package/api/procedures/createCheckpointSchedule.d.ts.map +1 -0
  316. package/api/procedures/createCheckpointSchedule.js +70 -0
  317. package/api/procedures/createCheckpointSchedule.js.map +1 -0
  318. package/api/procedures/createGroup.d.ts +44 -0
  319. package/api/procedures/createGroup.d.ts.map +1 -0
  320. package/api/procedures/createGroup.js +90 -0
  321. package/api/procedures/createGroup.js.map +1 -0
  322. package/api/procedures/createPortfolio.d.ts +21 -0
  323. package/api/procedures/createPortfolio.d.ts.map +1 -0
  324. package/api/procedures/createPortfolio.js +64 -0
  325. package/api/procedures/createPortfolio.js.map +1 -0
  326. package/api/procedures/createVenue.d.ts +20 -0
  327. package/api/procedures/createVenue.d.ts.map +1 -0
  328. package/api/procedures/createVenue.js +56 -0
  329. package/api/procedures/createVenue.js.map +1 -0
  330. package/api/procedures/deletePortfolio.d.ts +20 -0
  331. package/api/procedures/deletePortfolio.d.ts.map +1 -0
  332. package/api/procedures/deletePortfolio.js +69 -0
  333. package/api/procedures/deletePortfolio.js.map +1 -0
  334. package/api/procedures/initiateCorporateAction.d.ts +60 -0
  335. package/api/procedures/initiateCorporateAction.d.ts.map +1 -0
  336. package/api/procedures/initiateCorporateAction.js +107 -0
  337. package/api/procedures/initiateCorporateAction.js.map +1 -0
  338. package/api/procedures/investInOffering.d.ts +66 -0
  339. package/api/procedures/investInOffering.d.ts.map +1 -0
  340. package/api/procedures/investInOffering.js +147 -0
  341. package/api/procedures/investInOffering.js.map +1 -0
  342. package/api/procedures/inviteAccount.d.ts +16 -0
  343. package/api/procedures/inviteAccount.d.ts.map +1 -0
  344. package/api/procedures/inviteAccount.js +92 -0
  345. package/api/procedures/inviteAccount.js.map +1 -0
  346. package/api/procedures/inviteExternalAgent.d.ts +46 -0
  347. package/api/procedures/inviteExternalAgent.d.ts.map +1 -0
  348. package/api/procedures/inviteExternalAgent.js +97 -0
  349. package/api/procedures/inviteExternalAgent.js.map +1 -0
  350. package/api/procedures/issueTokens.d.ts +27 -0
  351. package/api/procedures/issueTokens.d.ts.map +1 -0
  352. package/api/procedures/issueTokens.js +75 -0
  353. package/api/procedures/issueTokens.js.map +1 -0
  354. package/api/procedures/launchOffering.d.ts +81 -0
  355. package/api/procedures/launchOffering.d.ts.map +1 -0
  356. package/api/procedures/launchOffering.js +139 -0
  357. package/api/procedures/launchOffering.js.map +1 -0
  358. package/api/procedures/leaveIdentity.d.ts +10 -0
  359. package/api/procedures/leaveIdentity.d.ts.map +1 -0
  360. package/api/procedures/leaveIdentity.js +53 -0
  361. package/api/procedures/leaveIdentity.js.map +1 -0
  362. package/api/procedures/linkCaDocs.d.ts +30 -0
  363. package/api/procedures/linkCaDocs.d.ts.map +1 -0
  364. package/api/procedures/linkCaDocs.js +69 -0
  365. package/api/procedures/linkCaDocs.js.map +1 -0
  366. package/api/procedures/modifyAllowance.d.ts +42 -0
  367. package/api/procedures/modifyAllowance.d.ts.map +1 -0
  368. package/api/procedures/modifyAllowance.js +87 -0
  369. package/api/procedures/modifyAllowance.js.map +1 -0
  370. package/api/procedures/modifyAsset.d.ts +46 -0
  371. package/api/procedures/modifyAsset.d.ts.map +1 -0
  372. package/api/procedures/modifyAsset.js +130 -0
  373. package/api/procedures/modifyAsset.js.map +1 -0
  374. package/api/procedures/modifyAssetTrustedClaimIssuers.d.ts +35 -0
  375. package/api/procedures/modifyAssetTrustedClaimIssuers.d.ts.map +1 -0
  376. package/api/procedures/modifyAssetTrustedClaimIssuers.js +139 -0
  377. package/api/procedures/modifyAssetTrustedClaimIssuers.js.map +1 -0
  378. package/api/procedures/modifyCaCheckpoint.d.ts +25 -0
  379. package/api/procedures/modifyCaCheckpoint.d.ts.map +1 -0
  380. package/api/procedures/modifyCaCheckpoint.js +58 -0
  381. package/api/procedures/modifyCaCheckpoint.js.map +1 -0
  382. package/api/procedures/modifyCaDefaultConfig.d.ts +36 -0
  383. package/api/procedures/modifyCaDefaultConfig.d.ts.map +1 -0
  384. package/api/procedures/modifyCaDefaultConfig.js +119 -0
  385. package/api/procedures/modifyCaDefaultConfig.js.map +1 -0
  386. package/api/procedures/modifyClaims.d.ts +39 -0
  387. package/api/procedures/modifyClaims.d.ts.map +1 -0
  388. package/api/procedures/modifyClaims.js +205 -0
  389. package/api/procedures/modifyClaims.js.map +1 -0
  390. package/api/procedures/modifyComplianceRequirement.d.ts +35 -0
  391. package/api/procedures/modifyComplianceRequirement.d.ts.map +1 -0
  392. package/api/procedures/modifyComplianceRequirement.js +75 -0
  393. package/api/procedures/modifyComplianceRequirement.js.map +1 -0
  394. package/api/procedures/modifyCorporateActionsAgent.d.ts +31 -0
  395. package/api/procedures/modifyCorporateActionsAgent.d.ts.map +1 -0
  396. package/api/procedures/modifyCorporateActionsAgent.js +83 -0
  397. package/api/procedures/modifyCorporateActionsAgent.js.map +1 -0
  398. package/api/procedures/modifyDistributionCheckpoint.d.ts +25 -0
  399. package/api/procedures/modifyDistributionCheckpoint.d.ts.map +1 -0
  400. package/api/procedures/modifyDistributionCheckpoint.js +60 -0
  401. package/api/procedures/modifyDistributionCheckpoint.js.map +1 -0
  402. package/api/procedures/modifyInstructionAffirmation.d.ts +33 -0
  403. package/api/procedures/modifyInstructionAffirmation.d.ts.map +1 -0
  404. package/api/procedures/modifyInstructionAffirmation.js +158 -0
  405. package/api/procedures/modifyInstructionAffirmation.js.map +1 -0
  406. package/api/procedures/modifyOfferingTimes.d.ts +39 -0
  407. package/api/procedures/modifyOfferingTimes.d.ts.map +1 -0
  408. package/api/procedures/modifyOfferingTimes.js +103 -0
  409. package/api/procedures/modifyOfferingTimes.js.map +1 -0
  410. package/api/procedures/modifyPrimaryIssuanceAgent.d.ts +33 -0
  411. package/api/procedures/modifyPrimaryIssuanceAgent.d.ts.map +1 -0
  412. package/api/procedures/modifyPrimaryIssuanceAgent.js +87 -0
  413. package/api/procedures/modifyPrimaryIssuanceAgent.js.map +1 -0
  414. package/api/procedures/modifySignerPermissions.d.ts +35 -0
  415. package/api/procedures/modifySignerPermissions.d.ts.map +1 -0
  416. package/api/procedures/modifySignerPermissions.js +82 -0
  417. package/api/procedures/modifySignerPermissions.js.map +1 -0
  418. package/api/procedures/modifyVenue.d.ts +32 -0
  419. package/api/procedures/modifyVenue.d.ts.map +1 -0
  420. package/api/procedures/modifyVenue.js +81 -0
  421. package/api/procedures/modifyVenue.js.map +1 -0
  422. package/api/procedures/moveFunds.d.ts +33 -0
  423. package/api/procedures/moveFunds.d.ts.map +1 -0
  424. package/api/procedures/moveFunds.js +124 -0
  425. package/api/procedures/moveFunds.js.map +1 -0
  426. package/api/procedures/payDividends.d.ts +24 -0
  427. package/api/procedures/payDividends.d.ts.map +1 -0
  428. package/api/procedures/payDividends.js +90 -0
  429. package/api/procedures/payDividends.js.map +1 -0
  430. package/api/procedures/quitCustody.d.ts +28 -0
  431. package/api/procedures/quitCustody.d.ts.map +1 -0
  432. package/api/procedures/quitCustody.js +71 -0
  433. package/api/procedures/quitCustody.js.map +1 -0
  434. package/api/procedures/quitSubsidy.d.ts +20 -0
  435. package/api/procedures/quitSubsidy.d.ts.map +1 -0
  436. package/api/procedures/quitSubsidy.js +64 -0
  437. package/api/procedures/quitSubsidy.js.map +1 -0
  438. package/api/procedures/reclaimDividendDistributionFunds.d.ts +21 -0
  439. package/api/procedures/reclaimDividendDistributionFunds.d.ts.map +1 -0
  440. package/api/procedures/reclaimDividendDistributionFunds.js +69 -0
  441. package/api/procedures/reclaimDividendDistributionFunds.js.map +1 -0
  442. package/api/procedures/redeemTokens.d.ts +25 -0
  443. package/api/procedures/redeemTokens.d.ts.map +1 -0
  444. package/api/procedures/redeemTokens.js +70 -0
  445. package/api/procedures/redeemTokens.js.map +1 -0
  446. package/api/procedures/registerIdentity.d.ts +23 -0
  447. package/api/procedures/registerIdentity.d.ts.map +1 -0
  448. package/api/procedures/registerIdentity.js +70 -0
  449. package/api/procedures/registerIdentity.js.map +1 -0
  450. package/api/procedures/removeAssetRequirement.d.ts +26 -0
  451. package/api/procedures/removeAssetRequirement.d.ts.map +1 -0
  452. package/api/procedures/removeAssetRequirement.js +62 -0
  453. package/api/procedures/removeAssetRequirement.js.map +1 -0
  454. package/api/procedures/removeCheckpointSchedule.d.ts +28 -0
  455. package/api/procedures/removeCheckpointSchedule.d.ts.map +1 -0
  456. package/api/procedures/removeCheckpointSchedule.js +75 -0
  457. package/api/procedures/removeCheckpointSchedule.js.map +1 -0
  458. package/api/procedures/removeCorporateAction.d.ts +25 -0
  459. package/api/procedures/removeCorporateAction.d.ts.map +1 -0
  460. package/api/procedures/removeCorporateAction.js +98 -0
  461. package/api/procedures/removeCorporateAction.js.map +1 -0
  462. package/api/procedures/removeCorporateActionsAgent.d.ts +23 -0
  463. package/api/procedures/removeCorporateActionsAgent.d.ts.map +1 -0
  464. package/api/procedures/removeCorporateActionsAgent.js +60 -0
  465. package/api/procedures/removeCorporateActionsAgent.js.map +1 -0
  466. package/api/procedures/removeExternalAgent.d.ts +34 -0
  467. package/api/procedures/removeExternalAgent.d.ts.map +1 -0
  468. package/api/procedures/removeExternalAgent.js +83 -0
  469. package/api/procedures/removeExternalAgent.js.map +1 -0
  470. package/api/procedures/removePrimaryIssuanceAgent.d.ts +21 -0
  471. package/api/procedures/removePrimaryIssuanceAgent.d.ts.map +1 -0
  472. package/api/procedures/removePrimaryIssuanceAgent.js +58 -0
  473. package/api/procedures/removePrimaryIssuanceAgent.js.map +1 -0
  474. package/api/procedures/removeSecondaryAccounts.d.ts +14 -0
  475. package/api/procedures/removeSecondaryAccounts.d.ts.map +1 -0
  476. package/api/procedures/removeSecondaryAccounts.js +61 -0
  477. package/api/procedures/removeSecondaryAccounts.js.map +1 -0
  478. package/api/procedures/renamePortfolio.d.ts +26 -0
  479. package/api/procedures/renamePortfolio.d.ts.map +1 -0
  480. package/api/procedures/renamePortfolio.js +69 -0
  481. package/api/procedures/renamePortfolio.js.map +1 -0
  482. package/api/procedures/rescheduleInstruction.d.ts +17 -0
  483. package/api/procedures/rescheduleInstruction.d.ts.map +1 -0
  484. package/api/procedures/rescheduleInstruction.js +52 -0
  485. package/api/procedures/rescheduleInstruction.js.map +1 -0
  486. package/api/procedures/reserveTicker.d.ts +29 -0
  487. package/api/procedures/reserveTicker.d.ts.map +1 -0
  488. package/api/procedures/reserveTicker.js +94 -0
  489. package/api/procedures/reserveTicker.js.map +1 -0
  490. package/api/procedures/setAssetDocuments.d.ts +37 -0
  491. package/api/procedures/setAssetDocuments.d.ts.map +1 -0
  492. package/api/procedures/setAssetDocuments.js +103 -0
  493. package/api/procedures/setAssetDocuments.js.map +1 -0
  494. package/api/procedures/setAssetRequirements.d.ts +29 -0
  495. package/api/procedures/setAssetRequirements.d.ts.map +1 -0
  496. package/api/procedures/setAssetRequirements.js +81 -0
  497. package/api/procedures/setAssetRequirements.js.map +1 -0
  498. package/api/procedures/setCustodian.d.ts +27 -0
  499. package/api/procedures/setCustodian.d.ts.map +1 -0
  500. package/api/procedures/setCustodian.js +86 -0
  501. package/api/procedures/setCustodian.js.map +1 -0
  502. package/api/procedures/setGroupPermissions.d.ts +29 -0
  503. package/api/procedures/setGroupPermissions.d.ts.map +1 -0
  504. package/api/procedures/setGroupPermissions.js +61 -0
  505. package/api/procedures/setGroupPermissions.js.map +1 -0
  506. package/api/procedures/setPermissionGroup.d.ts +57 -0
  507. package/api/procedures/setPermissionGroup.d.ts.map +1 -0
  508. package/api/procedures/setPermissionGroup.js +108 -0
  509. package/api/procedures/setPermissionGroup.js.map +1 -0
  510. package/api/procedures/setTransferRestrictions.d.ts +50 -0
  511. package/api/procedures/setTransferRestrictions.d.ts.map +1 -0
  512. package/api/procedures/setTransferRestrictions.js +204 -0
  513. package/api/procedures/setTransferRestrictions.js.map +1 -0
  514. package/api/procedures/subsidizeAccount.d.ts +21 -0
  515. package/api/procedures/subsidizeAccount.d.ts.map +1 -0
  516. package/api/procedures/subsidizeAccount.js +77 -0
  517. package/api/procedures/subsidizeAccount.js.map +1 -0
  518. package/api/procedures/toggleFreezeOffering.d.ts +21 -0
  519. package/api/procedures/toggleFreezeOffering.d.ts.map +1 -0
  520. package/api/procedures/toggleFreezeOffering.js +85 -0
  521. package/api/procedures/toggleFreezeOffering.js.map +1 -0
  522. package/api/procedures/toggleFreezeSecondaryAccounts.d.ts +18 -0
  523. package/api/procedures/toggleFreezeSecondaryAccounts.d.ts.map +1 -0
  524. package/api/procedures/toggleFreezeSecondaryAccounts.js +65 -0
  525. package/api/procedures/toggleFreezeSecondaryAccounts.js.map +1 -0
  526. package/api/procedures/toggleFreezeTransfers.d.ts +24 -0
  527. package/api/procedures/toggleFreezeTransfers.d.ts.map +1 -0
  528. package/api/procedures/toggleFreezeTransfers.js +72 -0
  529. package/api/procedures/toggleFreezeTransfers.js.map +1 -0
  530. package/api/procedures/togglePauseRequirements.d.ts +24 -0
  531. package/api/procedures/togglePauseRequirements.d.ts.map +1 -0
  532. package/api/procedures/togglePauseRequirements.js +63 -0
  533. package/api/procedures/togglePauseRequirements.js.map +1 -0
  534. package/api/procedures/transferAssetOwnership.d.ts +28 -0
  535. package/api/procedures/transferAssetOwnership.d.ts.map +1 -0
  536. package/api/procedures/transferAssetOwnership.js +61 -0
  537. package/api/procedures/transferAssetOwnership.js.map +1 -0
  538. package/api/procedures/transferPolyx.d.ts +30 -0
  539. package/api/procedures/transferPolyx.d.ts.map +1 -0
  540. package/api/procedures/transferPolyx.js +101 -0
  541. package/api/procedures/transferPolyx.js.map +1 -0
  542. package/api/procedures/transferTickerOwnership.d.ts +28 -0
  543. package/api/procedures/transferTickerOwnership.d.ts.map +1 -0
  544. package/api/procedures/transferTickerOwnership.js +70 -0
  545. package/api/procedures/transferTickerOwnership.js.map +1 -0
  546. package/api/procedures/utils.d.ts +103 -0
  547. package/api/procedures/utils.d.ts.map +1 -0
  548. package/api/procedures/utils.js +537 -0
  549. package/api/procedures/utils.js.map +1 -0
  550. package/api/procedures/waivePermissions.d.ts +34 -0
  551. package/api/procedures/waivePermissions.d.ts.map +1 -0
  552. package/api/procedures/waivePermissions.js +70 -0
  553. package/api/procedures/waivePermissions.js.map +1 -0
  554. package/base/Context.d.ts +287 -0
  555. package/base/Context.d.ts.map +1 -0
  556. package/base/Context.js +838 -0
  557. package/base/Context.js.map +1 -0
  558. package/base/PolymeshError.d.ts +17 -0
  559. package/base/PolymeshError.d.ts.map +1 -0
  560. package/base/PolymeshError.js +24 -0
  561. package/base/PolymeshError.js.map +1 -0
  562. package/base/PolymeshTransaction.d.ts +54 -0
  563. package/base/PolymeshTransaction.d.ts.map +1 -0
  564. package/base/PolymeshTransaction.js +84 -0
  565. package/base/PolymeshTransaction.js.map +1 -0
  566. package/base/PolymeshTransactionBase.d.ts +163 -0
  567. package/base/PolymeshTransactionBase.d.ts.map +1 -0
  568. package/base/PolymeshTransactionBase.js +322 -0
  569. package/base/PolymeshTransactionBase.js.map +1 -0
  570. package/base/PolymeshTransactionBatch.d.ts +51 -0
  571. package/base/PolymeshTransactionBatch.d.ts.map +1 -0
  572. package/base/PolymeshTransactionBatch.js +107 -0
  573. package/base/PolymeshTransactionBatch.js.map +1 -0
  574. package/base/PostTransactionValue.d.ts +45 -0
  575. package/base/PostTransactionValue.d.ts.map +1 -0
  576. package/base/PostTransactionValue.js +108 -0
  577. package/base/PostTransactionValue.js.map +1 -0
  578. package/base/Procedure.d.ts +92 -0
  579. package/base/Procedure.d.ts.map +1 -0
  580. package/base/Procedure.js +362 -0
  581. package/base/Procedure.js.map +1 -0
  582. package/base/TransactionQueue.d.ts +142 -0
  583. package/base/TransactionQueue.d.ts.map +1 -0
  584. package/base/TransactionQueue.js +420 -0
  585. package/base/TransactionQueue.js.map +1 -0
  586. package/base/types.d.ts +9 -0
  587. package/base/types.d.ts.map +1 -0
  588. package/base/types.js +4 -0
  589. package/base/types.js.map +1 -0
  590. package/generated/types.d.ts +253 -0
  591. package/generated/types.d.ts.map +1 -0
  592. package/generated/types.js +258 -0
  593. package/generated/types.js.map +1 -0
  594. package/generated/utils.d.ts +12 -0
  595. package/generated/utils.d.ts.map +1 -0
  596. package/generated/utils.js +767 -0
  597. package/generated/utils.js.map +1 -0
  598. package/index.d.ts +5 -0
  599. package/index.d.ts.map +1 -0
  600. package/index.js +12 -0
  601. package/index.js.map +1 -0
  602. package/internal.d.ts +107 -0
  603. package/internal.d.ts.map +1 -0
  604. package/internal.js +219 -0
  605. package/internal.js.map +1 -0
  606. package/middleware/queries.d.ts +129 -0
  607. package/middleware/queries.d.ts.map +1 -0
  608. package/middleware/queries.js +701 -0
  609. package/middleware/queries.js.map +1 -0
  610. package/middleware/types.d.ts +1624 -0
  611. package/middleware/types.d.ts.map +1 -0
  612. package/middleware/types.js +866 -0
  613. package/middleware/types.js.map +1 -0
  614. package/npm-package/polymeshassociation-polymesh-sdk-14.0.0-beta.11.tgz +0 -0
  615. package/package.json +131 -0
  616. package/polkadot/asset/definitions.d.ts +25 -0
  617. package/polkadot/asset/definitions.d.ts.map +1 -0
  618. package/polkadot/asset/definitions.js +96 -0
  619. package/polkadot/asset/definitions.js.map +1 -0
  620. package/polkadot/asset/index.d.ts +2 -0
  621. package/polkadot/asset/index.d.ts.map +1 -0
  622. package/polkadot/asset/index.js +20 -0
  623. package/polkadot/asset/index.js.map +1 -0
  624. package/polkadot/asset/types.d.ts +2 -0
  625. package/polkadot/asset/types.d.ts.map +1 -0
  626. package/polkadot/asset/types.js +5 -0
  627. package/polkadot/asset/types.js.map +1 -0
  628. package/polkadot/augment-api-consts.d.ts +178 -0
  629. package/polkadot/augment-api-consts.d.ts.map +1 -0
  630. package/polkadot/augment-api-consts.js +5 -0
  631. package/polkadot/augment-api-consts.js.map +1 -0
  632. package/polkadot/augment-api-errors.d.ts +1638 -0
  633. package/polkadot/augment-api-errors.d.ts.map +1 -0
  634. package/polkadot/augment-api-errors.js +5 -0
  635. package/polkadot/augment-api-errors.js.map +1 -0
  636. package/polkadot/augment-api-events.d.ts +1671 -0
  637. package/polkadot/augment-api-events.d.ts.map +1 -0
  638. package/polkadot/augment-api-events.js +5 -0
  639. package/polkadot/augment-api-events.js.map +1 -0
  640. package/polkadot/augment-api-query.d.ts +1993 -0
  641. package/polkadot/augment-api-query.d.ts.map +1 -0
  642. package/polkadot/augment-api-query.js +5 -0
  643. package/polkadot/augment-api-query.js.map +1 -0
  644. package/polkadot/augment-api-rpc.d.ts +695 -0
  645. package/polkadot/augment-api-rpc.d.ts.map +1 -0
  646. package/polkadot/augment-api-rpc.js +5 -0
  647. package/polkadot/augment-api-rpc.js.map +1 -0
  648. package/polkadot/augment-api-tx.d.ts +5464 -0
  649. package/polkadot/augment-api-tx.d.ts.map +1 -0
  650. package/polkadot/augment-api-tx.js +5 -0
  651. package/polkadot/augment-api-tx.js.map +1 -0
  652. package/polkadot/augment-api.d.ts +8 -0
  653. package/polkadot/augment-api.d.ts.map +1 -0
  654. package/polkadot/augment-api.js +12 -0
  655. package/polkadot/augment-api.js.map +1 -0
  656. package/polkadot/augment-types.d.ts +3243 -0
  657. package/polkadot/augment-types.d.ts.map +1 -0
  658. package/polkadot/augment-types.js +5 -0
  659. package/polkadot/augment-types.js.map +1 -0
  660. package/polkadot/compliance/definitions.d.ts +16 -0
  661. package/polkadot/compliance/definitions.d.ts.map +1 -0
  662. package/polkadot/compliance/definitions.js +35 -0
  663. package/polkadot/compliance/definitions.js.map +1 -0
  664. package/polkadot/compliance/index.d.ts +2 -0
  665. package/polkadot/compliance/index.d.ts.map +1 -0
  666. package/polkadot/compliance/index.js +20 -0
  667. package/polkadot/compliance/index.js.map +1 -0
  668. package/polkadot/compliance/types.d.ts +2 -0
  669. package/polkadot/compliance/types.d.ts.map +1 -0
  670. package/polkadot/compliance/types.js +5 -0
  671. package/polkadot/compliance/types.js.map +1 -0
  672. package/polkadot/definitions.d.ts +8 -0
  673. package/polkadot/definitions.d.ts.map +1 -0
  674. package/polkadot/definitions.js +22 -0
  675. package/polkadot/definitions.js.map +1 -0
  676. package/polkadot/identity/definitions.d.ts +61 -0
  677. package/polkadot/identity/definitions.d.ts.map +1 -0
  678. package/polkadot/identity/definitions.js +120 -0
  679. package/polkadot/identity/definitions.js.map +1 -0
  680. package/polkadot/identity/index.d.ts +2 -0
  681. package/polkadot/identity/index.d.ts.map +1 -0
  682. package/polkadot/identity/index.js +20 -0
  683. package/polkadot/identity/index.js.map +1 -0
  684. package/polkadot/identity/types.d.ts +2 -0
  685. package/polkadot/identity/types.d.ts.map +1 -0
  686. package/polkadot/identity/types.js +5 -0
  687. package/polkadot/identity/types.js.map +1 -0
  688. package/polkadot/index.d.ts +2 -0
  689. package/polkadot/index.d.ts.map +1 -0
  690. package/polkadot/index.js +20 -0
  691. package/polkadot/index.js.map +1 -0
  692. package/polkadot/pips/definitions.d.ts +34 -0
  693. package/polkadot/pips/definitions.d.ts.map +1 -0
  694. package/polkadot/pips/definitions.js +57 -0
  695. package/polkadot/pips/definitions.js.map +1 -0
  696. package/polkadot/pips/index.d.ts +2 -0
  697. package/polkadot/pips/index.d.ts.map +1 -0
  698. package/polkadot/pips/index.js +20 -0
  699. package/polkadot/pips/index.js.map +1 -0
  700. package/polkadot/pips/types.d.ts +2 -0
  701. package/polkadot/pips/types.d.ts.map +1 -0
  702. package/polkadot/pips/types.js +5 -0
  703. package/polkadot/pips/types.js.map +1 -0
  704. package/polkadot/polymesh/definitions.d.ts +855 -0
  705. package/polkadot/polymesh/definitions.d.ts.map +1 -0
  706. package/polkadot/polymesh/definitions.js +1139 -0
  707. package/polkadot/polymesh/definitions.js.map +1 -0
  708. package/polkadot/polymesh/index.d.ts +2 -0
  709. package/polkadot/polymesh/index.d.ts.map +1 -0
  710. package/polkadot/polymesh/index.js +20 -0
  711. package/polkadot/polymesh/index.js.map +1 -0
  712. package/polkadot/polymesh/types.d.ts +1408 -0
  713. package/polkadot/polymesh/types.d.ts.map +1 -0
  714. package/polkadot/polymesh/types.js +5 -0
  715. package/polkadot/polymesh/types.js.map +1 -0
  716. package/polkadot/portfolio/definitions.d.ts +25 -0
  717. package/polkadot/portfolio/definitions.d.ts.map +1 -0
  718. package/polkadot/portfolio/definitions.js +31 -0
  719. package/polkadot/portfolio/definitions.js.map +1 -0
  720. package/polkadot/portfolio/index.d.ts +2 -0
  721. package/polkadot/portfolio/index.d.ts.map +1 -0
  722. package/polkadot/portfolio/index.js +20 -0
  723. package/polkadot/portfolio/index.js.map +1 -0
  724. package/polkadot/portfolio/types.d.ts +2 -0
  725. package/polkadot/portfolio/types.d.ts.map +1 -0
  726. package/polkadot/portfolio/types.js +5 -0
  727. package/polkadot/portfolio/types.js.map +1 -0
  728. package/polkadot/protocolFee/definitions.d.ts +16 -0
  729. package/polkadot/protocolFee/definitions.d.ts.map +1 -0
  730. package/polkadot/protocolFee/definitions.js +25 -0
  731. package/polkadot/protocolFee/definitions.js.map +1 -0
  732. package/polkadot/protocolFee/index.d.ts +2 -0
  733. package/polkadot/protocolFee/index.d.ts.map +1 -0
  734. package/polkadot/protocolFee/index.js +20 -0
  735. package/polkadot/protocolFee/index.js.map +1 -0
  736. package/polkadot/protocolFee/types.d.ts +2 -0
  737. package/polkadot/protocolFee/types.d.ts.map +1 -0
  738. package/polkadot/protocolFee/types.js +5 -0
  739. package/polkadot/protocolFee/types.js.map +1 -0
  740. package/polkadot/schema.d.ts +994 -0
  741. package/polkadot/schema.d.ts.map +1 -0
  742. package/polkadot/schema.js +1451 -0
  743. package/polkadot/schema.js.map +1 -0
  744. package/polkadot/staking/definitions.d.ts +16 -0
  745. package/polkadot/staking/definitions.d.ts.map +1 -0
  746. package/polkadot/staking/definitions.js +20 -0
  747. package/polkadot/staking/definitions.js.map +1 -0
  748. package/polkadot/staking/index.d.ts +2 -0
  749. package/polkadot/staking/index.d.ts.map +1 -0
  750. package/polkadot/staking/index.js +20 -0
  751. package/polkadot/staking/index.js.map +1 -0
  752. package/polkadot/staking/types.d.ts +2 -0
  753. package/polkadot/staking/types.d.ts.map +1 -0
  754. package/polkadot/staking/types.js +5 -0
  755. package/polkadot/staking/types.js.map +1 -0
  756. package/polkadot/types.d.ts +472 -0
  757. package/polkadot/types.d.ts.map +1 -0
  758. package/polkadot/types.js +531 -0
  759. package/polkadot/types.js.map +1 -0
  760. package/types/index.d.ts +1164 -0
  761. package/types/index.d.ts.map +1 -0
  762. package/types/index.js +506 -0
  763. package/types/index.js.map +1 -0
  764. package/types/internal.d.ts +304 -0
  765. package/types/internal.d.ts.map +1 -0
  766. package/types/internal.js +34 -0
  767. package/types/internal.js.map +1 -0
  768. package/types/utils/index.d.ts +47 -0
  769. package/types/utils/index.d.ts.map +1 -0
  770. package/types/utils/index.js +11 -0
  771. package/types/utils/index.js.map +1 -0
  772. package/utils/constants.d.ts +63 -0
  773. package/utils/constants.d.ts.map +1 -0
  774. package/utils/constants.js +109 -0
  775. package/utils/constants.js.map +1 -0
  776. package/utils/conversion.d.ts +584 -0
  777. package/utils/conversion.d.ts.map +1 -0
  778. package/utils/conversion.js +2649 -0
  779. package/utils/conversion.js.map +1 -0
  780. package/utils/index.d.ts +4 -0
  781. package/utils/index.d.ts.map +1 -0
  782. package/utils/index.js +28 -0
  783. package/utils/index.js.map +1 -0
  784. package/utils/internal.d.ts +296 -0
  785. package/utils/internal.d.ts.map +1 -0
  786. package/utils/internal.js +786 -0
  787. package/utils/internal.js.map +1 -0
  788. package/utils/typeguards.d.ts +175 -0
  789. package/utils/typeguards.d.ts.map +1 -0
  790. package/utils/typeguards.js +312 -0
  791. package/utils/typeguards.js.map +1 -0
@@ -0,0 +1,322 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PolymeshTransactionBase = void 0;
13
+ const events_1 = require("events");
14
+ const internal_1 = require("../internal");
15
+ const types_1 = require("../types");
16
+ const conversion_1 = require("../utils/conversion");
17
+ const internal_2 = require("../utils/internal");
18
+ /**
19
+ * @hidden
20
+ */
21
+ var Event;
22
+ (function (Event) {
23
+ Event["StatusChange"] = "StatusChange";
24
+ })(Event || (Event = {}));
25
+ /**
26
+ * Wrapper class for a Polymesh Transaction
27
+ */
28
+ class PolymeshTransactionBase {
29
+ /**
30
+ * @hidden
31
+ */
32
+ constructor(transactionSpec, context) {
33
+ /**
34
+ * current status of the transaction
35
+ */
36
+ this.status = types_1.TransactionStatus.Idle;
37
+ /**
38
+ * @hidden
39
+ *
40
+ * wrappers for values that will exist after this transaction has executed
41
+ */
42
+ this.postValues = [];
43
+ const { postTransactionValues, signingAddress, signer, isCritical, fee, paidForBy } = transactionSpec;
44
+ if (postTransactionValues) {
45
+ this.postValues = postTransactionValues;
46
+ }
47
+ this.emitter = new events_1.EventEmitter();
48
+ this.signingAddress = signingAddress;
49
+ this.signer = signer;
50
+ this.isCritical = isCritical;
51
+ this.protocolFee = fee;
52
+ this.context = context;
53
+ this.paidForBy = paidForBy;
54
+ }
55
+ /**
56
+ * Run the transaction and update its status
57
+ */
58
+ run() {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ try {
61
+ const receipt = yield this.internalRun();
62
+ this.receipt = receipt;
63
+ yield Promise.all(this.postValues.map(postValue => postValue.run(receipt)));
64
+ this.updateStatus(types_1.TransactionStatus.Succeeded);
65
+ }
66
+ catch (err) {
67
+ const error = err;
68
+ this.error = err;
69
+ switch (error.code) {
70
+ case types_1.ErrorCode.TransactionAborted: {
71
+ this.updateStatus(types_1.TransactionStatus.Aborted);
72
+ break;
73
+ }
74
+ case types_1.ErrorCode.TransactionRejectedByUser: {
75
+ this.updateStatus(types_1.TransactionStatus.Rejected);
76
+ break;
77
+ }
78
+ case types_1.ErrorCode.TransactionReverted:
79
+ case types_1.ErrorCode.FatalError:
80
+ default: {
81
+ this.updateStatus(types_1.TransactionStatus.Failed);
82
+ break;
83
+ }
84
+ }
85
+ throw error;
86
+ }
87
+ });
88
+ }
89
+ /**
90
+ * @hidden
91
+ *
92
+ * Execute the underlying transaction, updating the status where applicable and
93
+ * throwing any pertinent errors
94
+ */
95
+ internalRun() {
96
+ return __awaiter(this, void 0, void 0, function* () {
97
+ const { signingAddress, signer } = this;
98
+ this.updateStatus(types_1.TransactionStatus.Unapproved);
99
+ return new Promise((resolve, reject) => {
100
+ const txWithArgs = this.composeTx();
101
+ let settingBlockData = Promise.resolve();
102
+ // nonce: -1 takes pending transactions into consideration.
103
+ // More information can be found at: https://polkadot.js.org/docs/api/cookbook/tx/#how-do-i-take-the-pending-tx-pool-into-account-in-my-nonce
104
+ const gettingUnsub = txWithArgs.signAndSend(signingAddress, { nonce: -1, signer }, receipt => {
105
+ const { status } = receipt;
106
+ let isLastCallback = false;
107
+ let unsubscribing = Promise.resolve();
108
+ let extrinsicFailedEvent;
109
+ // isCompleted === isFinalized || isInBlock || isError
110
+ if (receipt.isCompleted) {
111
+ if (receipt.isInBlock) {
112
+ const blockHash = status.asInBlock;
113
+ /*
114
+ * this must be done to ensure that the block hash and number are set before the success event
115
+ * is emitted, and at the same time. We do not resolve or reject the containing promise until this
116
+ * one resolves
117
+ */
118
+ settingBlockData = (0, internal_2.defusePromise)(this.context.polymeshApi.rpc.chain.getBlock(blockHash).then(({ block }) => {
119
+ this.blockHash = (0, conversion_1.hashToString)(blockHash);
120
+ this.blockNumber = (0, conversion_1.u32ToBigNumber)(block.header.number.unwrap());
121
+ }));
122
+ // if the extrinsic failed due to an on-chain error, we should handle it in a special way
123
+ extrinsicFailedEvent = receipt.findRecord('system', 'ExtrinsicFailed');
124
+ // extrinsic failed so we can unsubscribe
125
+ isLastCallback = !!extrinsicFailedEvent;
126
+ }
127
+ else {
128
+ // isFinalized || isError so we know we can unsubscribe
129
+ isLastCallback = true;
130
+ }
131
+ if (isLastCallback) {
132
+ unsubscribing = gettingUnsub.then(unsub => {
133
+ unsub();
134
+ });
135
+ }
136
+ /*
137
+ * Promise chain that handles all sub-promises in this pass through the signAndSend callback.
138
+ * Primarily for consistent error handling
139
+ */
140
+ let finishing = Promise.resolve();
141
+ if (extrinsicFailedEvent) {
142
+ const { event: { data }, } = extrinsicFailedEvent;
143
+ finishing = Promise.all([settingBlockData, unsubscribing]).then(() => {
144
+ this.handleExtrinsicFailure(resolve, reject, data[0]);
145
+ });
146
+ }
147
+ else if (receipt.isFinalized) {
148
+ finishing = Promise.all([settingBlockData, unsubscribing]).then(() => {
149
+ this.handleExtrinsicSuccess(resolve, reject, receipt);
150
+ });
151
+ }
152
+ else if (receipt.isError) {
153
+ reject(new internal_1.PolymeshError({ code: types_1.ErrorCode.TransactionAborted }));
154
+ }
155
+ finishing.catch((err) => reject(err));
156
+ }
157
+ });
158
+ gettingUnsub
159
+ .then(() => {
160
+ // tx approved by signer
161
+ this.txHash = txWithArgs.hash.toString();
162
+ this.updateStatus(types_1.TransactionStatus.Running);
163
+ })
164
+ .catch((err) => {
165
+ let error;
166
+ /* istanbul ignore else */
167
+ if (err.message.indexOf('Cancelled') > -1) {
168
+ // tx rejected by signer
169
+ error = { code: types_1.ErrorCode.TransactionRejectedByUser };
170
+ }
171
+ else {
172
+ // unexpected error
173
+ error = { code: types_1.ErrorCode.UnexpectedError, message: err.message };
174
+ }
175
+ reject(new internal_1.PolymeshError(error));
176
+ });
177
+ });
178
+ });
179
+ }
180
+ /**
181
+ * Subscribe to status changes
182
+ *
183
+ * @param listener - callback function that will be called whenever the status changes
184
+ *
185
+ * @returns unsubscribe function
186
+ */
187
+ onStatusChange(listener) {
188
+ this.emitter.on(Event.StatusChange, listener);
189
+ return () => {
190
+ this.emitter.removeListener(Event.StatusChange, listener);
191
+ };
192
+ }
193
+ /**
194
+ * Retrieve the Account that would pay fees for the transaction if it was run at this moment, as well as the total amount that can be
195
+ * charged to it (allowance). A null allowance means that there is no limit to that amount
196
+ *
197
+ * A null return value signifies that the caller Account would pay the fees
198
+ *
199
+ * @note this value might change if, before running the transaction, the caller Account enters (or leaves)
200
+ * a subsidizer relationship
201
+ */
202
+ getPayingAccount() {
203
+ return __awaiter(this, void 0, void 0, function* () {
204
+ const { paidForBy, context } = this;
205
+ if (this.ignoresSubsidy()) {
206
+ return null;
207
+ }
208
+ if (paidForBy) {
209
+ const { account: primaryAccount } = yield paidForBy.getPrimaryAccount();
210
+ return {
211
+ type: types_1.PayingAccountType.Other,
212
+ account: primaryAccount,
213
+ allowance: null,
214
+ };
215
+ }
216
+ const subsidyWithAllowance = yield context.accountSubsidy();
217
+ if (!subsidyWithAllowance) {
218
+ return null;
219
+ }
220
+ const { subsidy: { subsidizer: account }, allowance, } = subsidyWithAllowance;
221
+ return {
222
+ type: types_1.PayingAccountType.Subsidy,
223
+ account,
224
+ allowance,
225
+ };
226
+ });
227
+ }
228
+ /**
229
+ * Get all (protocol and gas) fees associated with this transaction. Returns null
230
+ * if the transaction is not ready yet (this can happen if it depends on the execution of a
231
+ * previous transaction in the queue)
232
+ *
233
+ * @note this value might change if the transaction is run at a later time. This can be due to a governance vote
234
+ */
235
+ getFees() {
236
+ return __awaiter(this, void 0, void 0, function* () {
237
+ const { signingAddress } = this;
238
+ let { protocolFee: protocol } = this;
239
+ let composedTx;
240
+ try {
241
+ composedTx = this.composeTx();
242
+ }
243
+ catch (err) {
244
+ return null;
245
+ }
246
+ const paymentInfoPromise = composedTx.paymentInfo(signingAddress);
247
+ if (!protocol) {
248
+ protocol = yield this.getProtocolFees();
249
+ }
250
+ const { partialFee } = yield paymentInfoPromise;
251
+ return {
252
+ protocol,
253
+ gas: (0, conversion_1.balanceToBigNumber)(partialFee),
254
+ };
255
+ });
256
+ }
257
+ /**
258
+ * @hidden
259
+ */
260
+ updateStatus(status) {
261
+ this.status = status;
262
+ /* eslint-disable default-case */
263
+ switch (status) {
264
+ case types_1.TransactionStatus.Unapproved:
265
+ case types_1.TransactionStatus.Running:
266
+ case types_1.TransactionStatus.Succeeded: {
267
+ this.emitter.emit(Event.StatusChange, this);
268
+ return;
269
+ }
270
+ case types_1.TransactionStatus.Rejected:
271
+ case types_1.TransactionStatus.Aborted:
272
+ case types_1.TransactionStatus.Failed: {
273
+ this.emitter.emit(Event.StatusChange, this, this.error);
274
+ }
275
+ }
276
+ /* eslint-enable default-case */
277
+ }
278
+ /**
279
+ * @hidden
280
+ *
281
+ * Return whether the transaction ignores any existing subsidizer relationships
282
+ * and is always paid by the caller
283
+ */
284
+ ignoresSubsidy() {
285
+ /*
286
+ * since we don't know anything about the transaction, a safe default is
287
+ * to assume it doesn't ignore subsidies
288
+ */
289
+ return false;
290
+ }
291
+ /**
292
+ * @hidden
293
+ */
294
+ handleExtrinsicFailure(_resolve, reject, error, data) {
295
+ // get revert message from event
296
+ let message;
297
+ if (error.isModule) {
298
+ // known error
299
+ const mod = error.asModule;
300
+ const { section, name, docs } = mod.registry.findMetaError(mod);
301
+ message = `${section}.${name}: ${docs.join(' ')}`;
302
+ }
303
+ else if (error.isBadOrigin) {
304
+ message = 'Bad origin';
305
+ }
306
+ else if (error.isCannotLookup) {
307
+ message = 'Could not lookup information required to validate the transaction';
308
+ }
309
+ else {
310
+ message = 'Unknown error';
311
+ }
312
+ reject(new internal_1.PolymeshError({ code: types_1.ErrorCode.TransactionReverted, message, data }));
313
+ }
314
+ /**
315
+ * @hidden
316
+ */
317
+ handleExtrinsicSuccess(resolve, _reject, receipt) {
318
+ resolve(receipt);
319
+ }
320
+ }
321
+ exports.PolymeshTransactionBase = PolymeshTransactionBase;
322
+ //# sourceMappingURL=PolymeshTransactionBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PolymeshTransactionBase.js","sourceRoot":"","sources":["../../src/base/PolymeshTransactionBase.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,mCAAsC;AAEtC,0CAA8D;AAC9D,oCAA+F;AAE/F,oDAAsF;AACtF,gDAAiD;AAEjD;;GAEG;AACH,IAAK,KAEJ;AAFD,WAAK,KAAK;IACR,sCAA6B,CAAA;AAC/B,CAAC,EAFI,KAAK,K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,IAAI,OAAe,CAAC;QAEpB,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClB,cAAc;YACd,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC;YAE3B,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAkB,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;YAC/E,OAAO,GAAG,GAAG,OAAO,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;SACnD;aAAM,IAAI,KAAK,CAAC,WAAW,EAAE;YAC5B,OAAO,GAAG,YAAY,CAAC;SACxB;aAAM,IAAI,KAAK,CAAC,cAAc,EAAE;YAC/B,OAAO,GAAG,mEAAmE,CAAC;SAC/E;aAAM;YACL,OAAO,GAAG,eAAe,CAAC;SAC3B;QAED,MAAM,CAAC,IAAI,wBAAa,CAAC,EAAE,IAAI,EAAE,iBAAS,CAAC,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACpF,CAAC;IAED;;OAEG;IACO,sBAAsB,CAC9B,OAA8E,EAC9E,OAAmC,EACnC,OAA2B;QAE3B,OAAO,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;CACF;AAvbD,0DAubC"}
@@ -0,0 +1,51 @@
1
+ import { SubmittableExtrinsic } from '@polkadot/api/types';
2
+ import { ISubmittableResult } from '@polkadot/types/types';
3
+ import BigNumber from 'bignumber.js';
4
+ import { Context, PolymeshTransactionBase } from "../internal";
5
+ import { BatchTransactionSpec, MapTxData } from "../types/internal";
6
+ /**
7
+ * Wrapper class for a batch of Polymesh Transactions
8
+ */
9
+ export declare class PolymeshTransactionBatch<Args extends unknown[][] = unknown[][], Values extends unknown[] = unknown[]> extends PolymeshTransactionBase<Values> {
10
+ /**
11
+ * @hidden
12
+ *
13
+ * unwrapped transaction data (available right before execution)
14
+ */
15
+ private unwrappedTransactions?;
16
+ /**
17
+ * @hidden
18
+ *
19
+ * underlying transactions to be batched, together with their respective arguments
20
+ */
21
+ private inputTransactions;
22
+ /**
23
+ * @hidden
24
+ */
25
+ constructor(transactionSpec: BatchTransactionSpec<Args, Values>, context: Context);
26
+ /**
27
+ * @hidden
28
+ */
29
+ private getUnwrappedTransactions;
30
+ /**
31
+ * transactions in the batch with their respective arguments
32
+ */
33
+ get transactions(): MapTxData<Args>;
34
+ /**
35
+ * @hidden
36
+ */
37
+ protected composeTx(): SubmittableExtrinsic<'promise', ISubmittableResult>;
38
+ /**
39
+ * @hidden
40
+ */
41
+ protected getProtocolFees(): Promise<BigNumber>;
42
+ /**
43
+ * @note batches can't be subsidized
44
+ */
45
+ supportsSubsidy(): boolean;
46
+ /**
47
+ * @hidden
48
+ */
49
+ protected handleExtrinsicSuccess(resolve: (value: ISubmittableResult | PromiseLike<ISubmittableResult>) => void, reject: (reason?: unknown) => void, receipt: ISubmittableResult): void;
50
+ }
51
+ //# sourceMappingURL=PolymeshTransactionBatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PolymeshTransactionBatch.d.ts","sourceRoot":"","sources":["../../src/base/PolymeshTransactionBatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,oBAAmB;AAC9D,OAAO,EACL,oBAAoB,EACpB,SAAS,EAGV,0BAAyB;AAI1B;;GAEG;AACH,qBAAa,wBAAwB,CACnC,IAAI,SAAS,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,EACtC,MAAM,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,CACpC,SAAQ,uBAAuB,CAAC,MAAM,CAAC;IACvC;;;;OAIG;IACH,OAAO,CAAC,qBAAqB,CAAC,CAA0B;IAExD;;;;OAIG;IACH,OAAO,CAAC,iBAAiB,CAAsB;IAE/C;;OAEG;gBACS,eAAe,EAAE,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO;IAQjF;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAehC;;OAEG;IACH,IAAI,YAAY,IAAI,SAAS,CAAC,IAAI,CAAC,CAKlC;IAED;;OAEG;IACH,SAAS,CAAC,SAAS,IAAI,oBAAoB,CAAC,SAAS,EAAE,kBAAkB,CAAC;IAc1E;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,OAAO,CAAC,SAAS,CAAC;IAY/C;;OAEG;IACI,eAAe,IAAI,OAAO;IAIjC;;OAEG;cACgB,sBAAsB,CACvC,OAAO,EAAE,CAAC,KAAK,EAAE,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,CAAC,KAAK,IAAI,EAC9E,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,EAClC,OAAO,EAAE,kBAAkB,GAC1B,IAAI;CAgBR"}
@@ -0,0 +1,107 @@
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 __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.PolymeshTransactionBatch = void 0;
27
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
28
+ const bluebird_1 = __importDefault(require("bluebird"));
29
+ const internal_1 = require("../internal");
30
+ const conversion_1 = require("../utils/conversion");
31
+ const internal_2 = require("../utils/internal");
32
+ /**
33
+ * Wrapper class for a batch of Polymesh Transactions
34
+ */
35
+ class PolymeshTransactionBatch extends internal_1.PolymeshTransactionBase {
36
+ /**
37
+ * @hidden
38
+ */
39
+ constructor(transactionSpec, context) {
40
+ const { transactions } = transactionSpec, rest = __rest(transactionSpec, ["transactions"]);
41
+ super(rest, context);
42
+ this.inputTransactions = transactions;
43
+ }
44
+ /**
45
+ * @hidden
46
+ */
47
+ getUnwrappedTransactions() {
48
+ if (!this.unwrappedTransactions) {
49
+ this.unwrappedTransactions = this.inputTransactions.map(({ transaction, args, feeMultiplier }) => ({
50
+ tag: (0, conversion_1.transactionToTxTag)(transaction),
51
+ args: (0, internal_2.unwrapValues)(args),
52
+ feeMultiplier,
53
+ transaction,
54
+ }));
55
+ }
56
+ return this.unwrappedTransactions;
57
+ }
58
+ /**
59
+ * transactions in the batch with their respective arguments
60
+ */
61
+ get transactions() {
62
+ return this.getUnwrappedTransactions().map(({ tag, args }) => ({
63
+ tag,
64
+ args,
65
+ }));
66
+ }
67
+ /**
68
+ * @hidden
69
+ */
70
+ composeTx() {
71
+ const { context: { polymeshApi: { tx: { utility }, }, }, } = this;
72
+ return utility.batchAtomic(this.getUnwrappedTransactions().map(({ transaction, args }) => transaction(...args)));
73
+ }
74
+ /**
75
+ * @hidden
76
+ */
77
+ getProtocolFees() {
78
+ return bluebird_1.default.reduce(this.getUnwrappedTransactions(), (total, { tag, feeMultiplier = new bignumber_js_1.default(1) }) => __awaiter(this, void 0, void 0, function* () {
79
+ const [{ fees }] = yield this.context.getProtocolFees({ tags: [tag] });
80
+ return total.plus(fees.multipliedBy(feeMultiplier));
81
+ }), new bignumber_js_1.default(0));
82
+ }
83
+ /**
84
+ * @note batches can't be subsidized
85
+ */
86
+ supportsSubsidy() {
87
+ return false;
88
+ }
89
+ /**
90
+ * @hidden
91
+ */
92
+ handleExtrinsicSuccess(resolve, reject, receipt) {
93
+ // If one of the transactions in the batch fails, this event gets emitted
94
+ const failed = receipt.findRecord('utility', 'BatchInterrupted');
95
+ if (failed) {
96
+ const { event: { data: failedData }, } = failed;
97
+ const failedIndex = (0, conversion_1.u32ToBigNumber)(failedData[0]).toNumber();
98
+ const dispatchError = failedData[1];
99
+ this.handleExtrinsicFailure(resolve, reject, dispatchError, { failedIndex });
100
+ }
101
+ else {
102
+ resolve(receipt);
103
+ }
104
+ }
105
+ }
106
+ exports.PolymeshTransactionBatch = PolymeshTransactionBatch;
107
+ //# sourceMappingURL=PolymeshTransactionBatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PolymeshTransactionBatch.js","sourceRoot":"","sources":["../../src/base/PolymeshTransactionBatch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,gEAAqC;AACrC,wDAAyB;AAEzB,0CAA8D;AAO9D,oDAAwE;AACxE,gDAAgD;AAEhD;;GAEG;AACH,MAAa,wBAGX,SAAQ,kCAA+B;IAevC;;OAEG;IACH,YAAY,eAAmD,EAAE,OAAgB;QAC/E,MAAM,EAAE,YAAY,KAAc,eAAe,EAAxB,IAAI,UAAK,eAAe,EAA3C,gBAAyB,CAAkB,CAAC;QAElD,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAErB,IAAI,CAAC,iBAAiB,GAAG,YAAY,CAAC;IACxC,CAAC;IAED;;OAEG;IACK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AAI,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAEvE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC;QACtD,CAAC,CAAA,EACD,IAAI,sBAAS,CAAC,CAAC,CAAC,CACjB,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,eAAe;QACpB,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACgB,sBAAsB,CACvC,OAA8E,EAC9E,MAAkC,EAClC,OAA2B;QAE3B,yEAAyE;QACzE,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;QAEjE,IAAI,MAAM,EAAE;YACV,MAAM,EACJ,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,GAC5B,GAAG,MAAM,CAAC;YACX,MAAM,WAAW,GAAG,IAAA,2BAAc,EAAC,UAAU,CAAC,CAAC,CAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;YACpE,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,CAAkB,CAAC;YAErD,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;SAC9E;aAAM;YACL,OAAO,CAAC,OAAO,CAAC,CAAC;SAClB;IACH,CAAC;CACF;AAvHD,4DAuHC"}
@@ -0,0 +1,45 @@
1
+ import { ISubmittableResult } from '@polkadot/types/types';
2
+ import { MaybePostTransactionValue } from "../types/internal";
3
+ /**
4
+ * @hidden
5
+ *
6
+ * Represents a value or method that doesn't exist at the moment, but will exist once a certain transaction
7
+ * has been run
8
+ */
9
+ export declare class PostTransactionValue<Value> {
10
+ private _value?;
11
+ private resolved;
12
+ private resolver;
13
+ private runCondition;
14
+ /**
15
+ * Array of PostTransactionValues spawned by this one via `transform` or `merge`. We use this to keep track
16
+ */
17
+ private children;
18
+ constructor(resolver: (receipt: ISubmittableResult) => Promise<Value> | Value, runCondition?: () => boolean);
19
+ /**
20
+ * Run the resolver function and assign its result to this object
21
+ */
22
+ run(receipt: ISubmittableResult): Promise<void>;
23
+ /**
24
+ * Retrieve the resolved value
25
+ *
26
+ * @throws if the value is being accessed before the resolver function has run
27
+ */
28
+ get value(): Value;
29
+ /**
30
+ * Add a new PostTransactionValue to the children array to be run when this one runs
31
+ */
32
+ private addChild;
33
+ /**
34
+ * Return a new PostTransactionValue that resolves to the value of this one processed by
35
+ * the passed callback. The new PostTransactionValue is resolved when this one is resolved
36
+ */
37
+ transform<NewValue>(callback: (val: Value) => NewValue): PostTransactionValue<NewValue>;
38
+ /**
39
+ * Merge this PostTransactionValue with another PostTransactionValue (or plain value), resulting in a new
40
+ * PostTransactionValue that resolves once these two are resolved. The resolved value is the result of passing the
41
+ * resolved values of both PostTransactionValues to the callback
42
+ */
43
+ merge<PostValue, NewValue>(postValue: MaybePostTransactionValue<PostValue>, callback: (val: Value, pval: PostValue) => NewValue): PostTransactionValue<NewValue>;
44
+ }
45
+ //# sourceMappingURL=PostTransactionValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PostTransactionValue.d.ts","sourceRoot":"","sources":["../../src/base/PostTransactionValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,EAAE,yBAAyB,EAAE,0BAAyB;AAE7D;;;;;GAKG;AACH,qBAAa,oBAAoB,CAAC,KAAK;IACrC,OAAO,CAAC,MAAM,CAAC,CAAQ;IAEvB,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,QAAQ,CAA0D;IAE1E,OAAO,CAAC,YAAY,CAAgB;IAEpC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAuC;gBAIrD,QAAQ,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,EACjE,YAAY,GAAE,MAAM,OAA6B;IAMnD;;OAEG;IACU,GAAG,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAY5D;;;;OAIG;IACH,IAAW,KAAK,IAAI,KAAK,CAaxB;IAED;;OAEG;IACH,OAAO,CAAC,QAAQ;IAIhB;;;OAGG;IACI,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,QAAQ,GAAG,oBAAoB,CAAC,QAAQ,CAAC;IAW9F;;;;OAIG;IACI,KAAK,CAAC,SAAS,EAAE,QAAQ,EAC9B,SAAS,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAE/C,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,QAAQ,GAClD,oBAAoB,CAAC,QAAQ,CAAC;CAsBlC"}
@@ -0,0 +1,108 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PostTransactionValue = void 0;
13
+ const internal_1 = require("../internal");
14
+ const types_1 = require("../types");
15
+ /**
16
+ * @hidden
17
+ *
18
+ * Represents a value or method that doesn't exist at the moment, but will exist once a certain transaction
19
+ * has been run
20
+ */
21
+ class PostTransactionValue {
22
+ // eslint-disable-next-line require-jsdoc
23
+ constructor(resolver, runCondition = () => true) {
24
+ this.resolved = false;
25
+ /**
26
+ * Array of PostTransactionValues spawned by this one via `transform` or `merge`. We use this to keep track
27
+ */
28
+ this.children = [];
29
+ this.resolver = resolver;
30
+ this.runCondition = runCondition;
31
+ }
32
+ /**
33
+ * Run the resolver function and assign its result to this object
34
+ */
35
+ run(receipt) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (!this.runCondition()) {
38
+ return;
39
+ }
40
+ const result = yield this.resolver(receipt);
41
+ this.resolved = true;
42
+ this._value = result;
43
+ yield Promise.all(this.children.map(child => child.run(receipt)));
44
+ });
45
+ }
46
+ /**
47
+ * Retrieve the resolved value
48
+ *
49
+ * @throws if the value is being accessed before the resolver function has run
50
+ */
51
+ get value() {
52
+ const { _value: value, resolved } = this;
53
+ if (!resolved) {
54
+ throw new internal_1.PolymeshError({
55
+ code: types_1.ErrorCode.FatalError,
56
+ message: 'Post Transaction Value accessed before the corresponding transaction was executed',
57
+ });
58
+ }
59
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
60
+ return value;
61
+ }
62
+ /**
63
+ * Add a new PostTransactionValue to the children array to be run when this one runs
64
+ */
65
+ addChild(child) {
66
+ this.children.push(child);
67
+ }
68
+ /**
69
+ * Return a new PostTransactionValue that resolves to the value of this one processed by
70
+ * the passed callback. The new PostTransactionValue is resolved when this one is resolved
71
+ */
72
+ transform(callback) {
73
+ const newResolver = () => {
74
+ return callback(this.value);
75
+ };
76
+ const child = new PostTransactionValue(newResolver);
77
+ this.addChild(child);
78
+ return child;
79
+ }
80
+ /**
81
+ * Merge this PostTransactionValue with another PostTransactionValue (or plain value), resulting in a new
82
+ * PostTransactionValue that resolves once these two are resolved. The resolved value is the result of passing the
83
+ * resolved values of both PostTransactionValues to the callback
84
+ */
85
+ merge(postValue,
86
+ // cSpell: disable-next-line
87
+ callback) {
88
+ let newResolver;
89
+ let runCondition;
90
+ // do nothing on .run unless both underlying values have been resolved
91
+ if (postValue instanceof PostTransactionValue) {
92
+ newResolver = () => callback(this.value, postValue.value);
93
+ runCondition = () => this.resolved && postValue.resolved;
94
+ }
95
+ else {
96
+ newResolver = () => callback(this.value, postValue);
97
+ runCondition = () => this.resolved;
98
+ }
99
+ const child = new PostTransactionValue(newResolver, runCondition);
100
+ this.addChild(child);
101
+ if (postValue instanceof PostTransactionValue) {
102
+ postValue.addChild(child);
103
+ }
104
+ return child;
105
+ }
106
+ }
107
+ exports.PostTransactionValue = PostTransactionValue;
108
+ //# sourceMappingURL=PostTransactionValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PostTransactionValue.js","sourceRoot":"","sources":["../../src/base/PostTransactionValue.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,0CAA2C;AAC3C,oCAAoC;AAGpC;;;;;GAKG;AACH,MAAa,oBAAoB;IAc/B,yCAAyC;IACzC,YACE,QAAiE,EACjE,eAA8B,GAAY,EAAE,CAAC,IAAI;QAd3C,aAAQ,GAAG,KAAK,CAAC;QAMzB;;WAEG;QACK,aAAQ,GAAoC,EAAE,CAAC;QAOrD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED;;OAEG;IACU,GAAG,CAAC,OAA2B;;YAC1C,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE;gBACxB,OAAO;aACR;YAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;YAErB,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC;KAAA;IAED;;;;OAIG;IACH,IAAW,KAAK;QACd,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAEzC,IAAI,CAAC,QAAQ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