-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path3_lockIssuingAccount.js
45 lines (37 loc) · 1017 Bytes
/
3_lockIssuingAccount.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
const {
accounts: { issuer },
serverUrl
} = require("./config.json");
const {
Server,
Networks,
TransactionBuilder,
Operation,
Keypair
} = require("stellar-sdk");
const server = new Server(serverUrl);
const main = async () => {
const issuingAccount = await server.loadAccount(issuer.publicKey);
const txOptions = {
fee: await server.fetchBaseFee(),
networkPassphrase: Networks.TESTNET
};
const thresholds = {
masterWeight: 0, // issuing account private key signature counts for 0, no rights :)
lowThreshold: 0,
medThreshold: 0,
highThreshold: 0 // no more transaction on this account anymore !
};
const transaction = new TransactionBuilder(issuingAccount, txOptions)
.addOperation(Operation.setOptions(thresholds))
.setTimeout(0)
.build();
transaction.sign(Keypair.fromSecret(issuer.secret));
await server.submitTransaction(transaction);
};
main()
.then(() => console.log("ok"))
.catch(e => {
console.log("Meh", e);
throw e;
});