-
Notifications
You must be signed in to change notification settings - Fork 102
/
autocli.go
89 lines (86 loc) · 3.66 KB
/
autocli.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package tokenfactory
import (
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
"cosmossdk.io/client/v2/autocli"
)
var _ autocli.HasAutoCLIConfig = AppModule{}
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
return &autocliv1.ModuleOptions{
Query: &autocliv1.ServiceCommandDescriptor{
Service: "osmosis.tokenfactory.v1beta1.Query",
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Params",
Use: "params",
Short: "Query module params",
},
{
RpcMethod: "DenomAuthorityMetadata",
Use: "denom-authority-metadata [creator] [subdenom] [flags]",
Short: "Get the authority metadata for a specific denom",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "creator"}, {ProtoField: "subdenom"}},
},
{
RpcMethod: "DenomsFromCreator",
Use: "denoms-from-creator [creator-address] [flags]",
Short: "Returns a list of all tokens created by a specific creator address",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "creator"}},
},
{
RpcMethod: "BeforeSendHookAddress",
Use: "before-send-hook [creator] [subdenom] [flags]",
Short: "Get the before send hook for a specific denom",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "creator"}, {ProtoField: "subdenom"}},
},
},
EnhanceCustomCommand: true,
},
Tx: &autocliv1.ServiceCommandDescriptor{
Service: "osmosis.tokenfactory.v1beta1.Msg",
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "UpdateParams",
Use: "update-params [--params JSON]",
Short: "Updates params. Must be a adminmodule admin to do so.",
},
{
RpcMethod: "CreateDenom",
Use: "create-denom [subdenom] [flags]",
Short: "Create a new denom from an account",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "subdenom"}},
},
{
RpcMethod: "Mint",
Use: "mint [amount] [flags]",
Short: "Mint a denom to an address. Must have admin authority to do so.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "amount"}},
},
{
RpcMethod: "Burn",
Use: "burn [amount] [flags]",
Short: "Burn tokens from an address. Must have admin authority to do so.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "amount"}},
},
{
RpcMethod: "ChangeAdmin",
Use: "change-admin [denom] [new-admin-address] [flags]",
Short: "Changes the admin address for a factory-created denom. Must have admin authority to do so.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denom"}, {ProtoField: "new_admin"}},
},
{
RpcMethod: "SetBeforeSendHook",
Use: "set-before-send-hook [denom] [contract-addr] [flags]",
Short: "Sets the before send hook for a factory-created denom. Must have admin authority to do so.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denom"}, {ProtoField: "contract_addr"}},
},
{
RpcMethod: "ForceTransfer",
Use: "force-transfer [amount] [transfer-from-address] [transfer-to-address] [flags]",
Short: "Force transfer tokens from one address to another address. Must have admin authority to do so.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "amount"}, {ProtoField: "transferFromAddress"}, {ProtoField: "transferToAddress"}},
},
},
EnhanceCustomCommand: true,
},
}
}