/
addresses.js
49 lines (35 loc) · 1.33 KB
/
addresses.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { ApiPromise, WsProvider, Keyring } from "@polkadot/api";
import fs from "fs";
import dotenv from "dotenv";
dotenv.config();
async function main() {
const wsProvider = new WsProvider("ws://127.0.0.1:9944");
const api = await ApiPromise.create({ provider: wsProvider });
const account1_phrase = process.env.ACCOUNT1_MNEMONIC;
const account1 = new Keyring({ type: "sr25519" }).addFromUri(account1_phrase);
const account2_phrase = process.env.ACCOUNT2_MNEMONIC;
const account2 = new Keyring({ type: "sr25519" }).addFromUri(account2_phrase);
const account3_phrase = process.env.ACCOUNT3_MNEMONIC;
const account3 = new Keyring({ type: "sr25519" }).addFromUri(account3_phrase);
const account4_phrase = process.env.ACCOUNT4_MNEMONIC;
const account4 = new Keyring({ type: "sr25519" }).addFromUri(account4_phrase);
const account5_phrase = process.env.ACCOUNT5_MNEMONIC;
const account5 = new Keyring({ type: "sr25519" }).addFromUri(account5_phrase);
const signatories = [
account1.address,
account2.address,
account3.address,
account4.address,
];
console.log(signatories.sort());
const orders = [
account3.address,
account4.address,
account1.address,
account2.address,
];
console.log(orders);
}
main()
.catch((error) => console.error(error))
.finally(() => process.exit());