tohex.ts 853 B

123456789101112131415161718192021222324252627282930
  1. import { CuratorApplicationId } from '@joystream/types/content-working-group'
  2. import { BTreeSet, createType, TypeRegistry } from '@polkadot/types'
  3. import { types } from '@joystream/types'
  4. async function main() {
  5. const wgId = [1, 2]
  6. const registry = new TypeRegistry()
  7. registry.register(types)
  8. const set = new BTreeSet<CuratorApplicationId>(registry, CuratorApplicationId, [])
  9. wgId.forEach((id) => {
  10. set.add(createType(registry, 'CuratorApplicationId', id))
  11. })
  12. /*
  13. Replace the integers inside the bracket in:
  14. let wgId:number[] = [1, 2];
  15. With the "WG ID"s of the curators you wish to hire, in ascending order.
  16. To hire "WG ID" 18 21 and 16:
  17. let wgId:number[] = [16, 18, 21];
  18. */
  19. console.log('copy/paste the output below to hire curator applicant(s) with WG IDs:', wgId)
  20. console.log(set.toHex())
  21. }
  22. main()