tohex.ts 984 B

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