@joystream-types-npm-0.20.1-034fcceb67.patch 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. diff --git a/augment/augment-api-consts.js b/augment/augment-api-consts.js
  2. index c60e7efae22fec89b226cf35ae0a509eda081cbc..ff6fef04a2b798bc3a4fa8f4438e18ee1c5786c0 100644
  3. --- a/augment/augment-api-consts.js
  4. +++ b/augment/augment-api-consts.js
  5. @@ -1,4 +1,3 @@
  6. -"use strict";
  7. // Auto-generated via `yarn polkadot-types-from-chain`, do not edit
  8. /* eslint-disable */
  9. -Object.defineProperty(exports, "__esModule", { value: true });
  10. +export {};
  11. diff --git a/augment/augment-api-errors.js b/augment/augment-api-errors.js
  12. index c60e7efae22fec89b226cf35ae0a509eda081cbc..ff6fef04a2b798bc3a4fa8f4438e18ee1c5786c0 100644
  13. --- a/augment/augment-api-errors.js
  14. +++ b/augment/augment-api-errors.js
  15. @@ -1,4 +1,3 @@
  16. -"use strict";
  17. // Auto-generated via `yarn polkadot-types-from-chain`, do not edit
  18. /* eslint-disable */
  19. -Object.defineProperty(exports, "__esModule", { value: true });
  20. +export {};
  21. diff --git a/augment/augment-api-events.js b/augment/augment-api-events.js
  22. index c60e7efae22fec89b226cf35ae0a509eda081cbc..ff6fef04a2b798bc3a4fa8f4438e18ee1c5786c0 100644
  23. --- a/augment/augment-api-events.js
  24. +++ b/augment/augment-api-events.js
  25. @@ -1,4 +1,3 @@
  26. -"use strict";
  27. // Auto-generated via `yarn polkadot-types-from-chain`, do not edit
  28. /* eslint-disable */
  29. -Object.defineProperty(exports, "__esModule", { value: true });
  30. +export {};
  31. diff --git a/augment/augment-api-query.js b/augment/augment-api-query.js
  32. index c60e7efae22fec89b226cf35ae0a509eda081cbc..ff6fef04a2b798bc3a4fa8f4438e18ee1c5786c0 100644
  33. --- a/augment/augment-api-query.js
  34. +++ b/augment/augment-api-query.js
  35. @@ -1,4 +1,3 @@
  36. -"use strict";
  37. // Auto-generated via `yarn polkadot-types-from-chain`, do not edit
  38. /* eslint-disable */
  39. -Object.defineProperty(exports, "__esModule", { value: true });
  40. +export {};
  41. diff --git a/augment/augment-api-rpc.js b/augment/augment-api-rpc.js
  42. index c60e7efae22fec89b226cf35ae0a509eda081cbc..ff6fef04a2b798bc3a4fa8f4438e18ee1c5786c0 100644
  43. --- a/augment/augment-api-rpc.js
  44. +++ b/augment/augment-api-rpc.js
  45. @@ -1,4 +1,3 @@
  46. -"use strict";
  47. // Auto-generated via `yarn polkadot-types-from-chain`, do not edit
  48. /* eslint-disable */
  49. -Object.defineProperty(exports, "__esModule", { value: true });
  50. +export {};
  51. diff --git a/augment/augment-api-tx.js b/augment/augment-api-tx.js
  52. index c60e7efae22fec89b226cf35ae0a509eda081cbc..ff6fef04a2b798bc3a4fa8f4438e18ee1c5786c0 100644
  53. --- a/augment/augment-api-tx.js
  54. +++ b/augment/augment-api-tx.js
  55. @@ -1,4 +1,3 @@
  56. -"use strict";
  57. // Auto-generated via `yarn polkadot-types-from-chain`, do not edit
  58. /* eslint-disable */
  59. -Object.defineProperty(exports, "__esModule", { value: true });
  60. +export {};
  61. diff --git a/augment/augment-api.js b/augment/augment-api.js
  62. index e18ffa2c8be55d7a2694cabdd90be23bfd52d14b..1109edb05f107b9c9916599f376efb57cf81c91b 100644
  63. --- a/augment/augment-api.js
  64. +++ b/augment/augment-api.js
  65. @@ -1,10 +1,8 @@
  66. -"use strict";
  67. // Auto-generated via `yarn polkadot-types-from-chain`, do not edit
  68. /* eslint-disable */
  69. -Object.defineProperty(exports, "__esModule", { value: true });
  70. -require("./augment-api-consts");
  71. -require("./augment-api-errors");
  72. -require("./augment-api-events");
  73. -require("./augment-api-query");
  74. -require("./augment-api-tx");
  75. -require("./augment-api-rpc");
  76. +import './augment-api-consts';
  77. +import './augment-api-errors';
  78. +import './augment-api-events';
  79. +import './augment-api-query';
  80. +import './augment-api-tx';
  81. +import './augment-api-rpc';
  82. diff --git a/augment/augment-types.js b/augment/augment-types.js
  83. index c56161d96a47321e024185a89aca087b6af4585f..e27d37b2ff1bfd30fa2bbc0cbb38eed6013870cc 100644
  84. --- a/augment/augment-types.js
  85. +++ b/augment/augment-types.js
  86. @@ -1,4 +1,3 @@
  87. -"use strict";
  88. // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
  89. /* eslint-disable */
  90. -Object.defineProperty(exports, "__esModule", { value: true });
  91. +export {};
  92. diff --git a/augment/lookup.js b/augment/lookup.js
  93. index c2d61d9a563260bdaad7b2a2f72473a7255b59e8..5d75f7a9c4d7f67adb6f191f28b872ebaf470281 100644
  94. --- a/augment/lookup.js
  95. +++ b/augment/lookup.js
  96. @@ -1,9 +1,7 @@
  97. -"use strict";
  98. // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
  99. /* eslint-disable */
  100. -Object.defineProperty(exports, "__esModule", { value: true });
  101. /* eslint-disable sort-keys */
  102. -exports.default = {
  103. +export default {
  104. /**
  105. * Lookup3: frame_system::AccountInfo<Index, pallet_balances::AccountData<Balance>>
  106. **/
  107. diff --git a/augment/registry.js b/augment/registry.js
  108. index c56161d96a47321e024185a89aca087b6af4585f..e27d37b2ff1bfd30fa2bbc0cbb38eed6013870cc 100644
  109. --- a/augment/registry.js
  110. +++ b/augment/registry.js
  111. @@ -1,4 +1,3 @@
  112. -"use strict";
  113. // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
  114. /* eslint-disable */
  115. -Object.defineProperty(exports, "__esModule", { value: true });
  116. +export {};
  117. diff --git a/index.js b/index.js
  118. index 58f95495c7507fcecd4207eddeb60e9dea8c3052..15487b2f5a4c777f4f1d3530ed69449952087a01 100644
  119. --- a/index.js
  120. +++ b/index.js
  121. @@ -1,30 +1,21 @@
  122. -"use strict";
  123. -var __importDefault = (this && this.__importDefault) || function (mod) {
  124. - return (mod && mod.__esModule) ? mod : { "default": mod };
  125. -};
  126. -Object.defineProperty(exports, "__esModule", { value: true });
  127. -exports.JOYSTREAM_ADDRESS_PREFIX = exports.entriesByIds = exports.keysOf = exports.createType = exports.registry = void 0;
  128. -require("./augment/types-lookup");
  129. -require("./augment/registry");
  130. -require("./augment/augment-api");
  131. -const types_1 = require("@polkadot/types");
  132. -const lookup_1 = __importDefault(require("./augment/lookup"));
  133. -exports.registry = new types_1.TypeRegistry();
  134. -exports.registry.register(lookup_1.default);
  135. -function createType(typeName, value) {
  136. - return exports.registry.createType(typeName, value);
  137. +import './augment/types-lookup';
  138. +import './augment/registry';
  139. +import './augment/augment-api';
  140. +import { TypeRegistry, } from '@polkadot/types';
  141. +import defs from './augment/lookup';
  142. +export const registry = new TypeRegistry();
  143. +registry.register(defs);
  144. +export function createType(typeName, value) {
  145. + return registry.createType(typeName, value);
  146. }
  147. -exports.createType = createType;
  148. -function keysOf(typeName) {
  149. - return exports.registry.createType(typeName).defKeys;
  150. +export function keysOf(typeName) {
  151. + return registry.createType(typeName).defKeys;
  152. }
  153. -exports.keysOf = keysOf;
  154. -async function entriesByIds(apiMethod) {
  155. +export async function entriesByIds(apiMethod) {
  156. const entries = (await apiMethod.entries()).map(([storageKey, value]) => [
  157. storageKey.args[0],
  158. value,
  159. ]);
  160. return entries.sort((a, b) => a[0].toNumber() - b[0].toNumber());
  161. }
  162. -exports.entriesByIds = entriesByIds;
  163. -exports.JOYSTREAM_ADDRESS_PREFIX = 126;
  164. +export const JOYSTREAM_ADDRESS_PREFIX = 126;
  165. diff --git a/package.json b/package.json
  166. index 9e02f6cc5822e3bebfb96cbd682ab74842cb4c8d..d8452ddbc34ea4344e95e17f658fe790a2f183cd 100644
  167. --- a/package.json
  168. +++ b/package.json
  169. @@ -4,6 +4,8 @@
  170. "description": "Types for Joystream Substrate Runtime - Carthage release",
  171. "main": "index.js",
  172. "types": "index.d.ts",
  173. + "type": "module",
  174. + "module": "index.js",
  175. "scripts": {
  176. "prepublishOnly": "yarn clean && yarn build",
  177. "prepack": "yarn clean && yarn build",
  178. diff --git a/primitives.js b/primitives.js
  179. index c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce..cb0ff5c3b541f646105198ee23ac0fc3d805023e 100644
  180. --- a/primitives.js
  181. +++ b/primitives.js
  182. @@ -1,2 +1 @@
  183. -"use strict";
  184. -Object.defineProperty(exports, "__esModule", { value: true });
  185. +export {};
  186. diff --git a/tsconfig.json b/tsconfig.json
  187. index b0904e827b94c841584ae15e32a348c46c7bad7f..8aa0f80e79fdd67486520c29fb668ee3da3d1935 100644
  188. --- a/tsconfig.json
  189. +++ b/tsconfig.json
  190. @@ -1,7 +1,7 @@
  191. {
  192. "compilerOptions": {
  193. "target": "es2017",
  194. - "module": "commonjs",
  195. + "module": "esnext",
  196. "strict": true,
  197. "noImplicitAny": true,
  198. "noUnusedLocals": true,