-
Notifications
You must be signed in to change notification settings - Fork 3
/
flags.go
41 lines (32 loc) · 1021 Bytes
/
flags.go
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
package xlm
import (
build "github.com/stellar/go/txnbuild"
)
// SetAuthImmutable sets the auth_immutable flag on an account
func SetAuthImmutable(seed string) (int32, string, error) {
// Create with Auth immutable since we don't want the asset to be revocable
sourceAccount, mykp, err := ReturnSourceAccount(seed)
if err != nil {
return -1, "", err
}
op := build.SetOptions{
SetFlags: []build.AccountFlag{build.AuthImmutable},
}
memo := "set immutable"
return SendTx(mykp, &sourceAccount, memo, build.Operation(&op))
}
// FreezeAccount freezes an account
func FreezeAccount(seed string) (int32, string, error) {
sourceAccount, mykp, err := ReturnSourceAccount(seed)
if err != nil {
return -1, "", err
}
op := build.SetOptions{
MasterWeight: build.NewThreshold(0),
LowThreshold: build.NewThreshold(0),
MediumThreshold: build.NewThreshold(0),
HighThreshold: build.NewThreshold(0),
}
memo := "freeze account"
return SendTx(mykp, &sourceAccount, memo, build.Operation(&op))
}