-
Notifications
You must be signed in to change notification settings - Fork 31
/
tx.proto
162 lines (148 loc) · 6.56 KB
/
tx.proto
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
syntax = "proto3";
package cosmwasm.wasm.v1;
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmwasm/wasm/v1/types.proto";
option go_package = "github.com/line/lbm-sdk/x/wasm/types";
option (gogoproto.goproto_getters_all) = false;
// Msg defines the wasm Msg service.
service Msg {
// StoreCode to submit Wasm code to the system
rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse);
// Instantiate creates a new smart contract instance for the given code id.
rpc InstantiateContract(MsgInstantiateContract) returns (MsgInstantiateContractResponse);
// StoreCodeAndInstantiatecontract upload code and instantiate a contract using it.
rpc StoreCodeAndInstantiateContract(MsgStoreCodeAndInstantiateContract)
returns (MsgStoreCodeAndInstantiateContractResponse);
// Execute submits the given message data to a smart contract
rpc ExecuteContract(MsgExecuteContract) returns (MsgExecuteContractResponse);
// Migrate runs a code upgrade/ downgrade for a smart contract
rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse);
// UpdateAdmin sets a new admin for a smart contract
rpc UpdateAdmin(MsgUpdateAdmin) returns (MsgUpdateAdminResponse);
// ClearAdmin removes any admin stored for a smart contract
rpc ClearAdmin(MsgClearAdmin) returns (MsgClearAdminResponse);
}
// MsgStoreCode submit Wasm code to the system
message MsgStoreCode {
// Sender is the that actor that signed the messages
string sender = 1;
// WASMByteCode can be raw or gzip compressed
bytes wasm_byte_code = 2 [(gogoproto.customname) = "WASMByteCode"];
// Used in v1beta1
reserved 3, 4;
// InstantiatePermission access control to apply on contract creation,
// optional
AccessConfig instantiate_permission = 5;
}
// MsgStoreCodeResponse returns store result data.
message MsgStoreCodeResponse {
// CodeID is the reference to the stored WASM code
uint64 code_id = 1 [(gogoproto.customname) = "CodeID"];
}
// MsgInstantiateContract create a new smart contract instance for the given
// code id.
message MsgInstantiateContract {
// Sender is the that actor that signed the messages
string sender = 1;
// Admin is an optional address that can execute migrations
string admin = 2;
// CodeID is the reference to the stored WASM code
uint64 code_id = 3 [(gogoproto.customname) = "CodeID"];
// Label is optional metadata to be stored with a contract instance.
string label = 4;
// Msg json encoded message to be passed to the contract on instantiation
bytes msg = 5 [(gogoproto.casttype) = "RawContractMessage"];
// Funds coins that are transferred to the contract on instantiation
repeated cosmos.base.v1beta1.Coin funds = 6
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lbm-sdk/types.Coins"];
}
// MsgInstantiateContractResponse return instantiation result data
message MsgInstantiateContractResponse {
// Address is the bech32 address of the new contract instance.
string address = 1;
// Data contains base64-encoded bytes to returned from the contract
bytes data = 2;
}
// MsgStoreCodeAndInstantiateContract submit Wasm code to the system and instantiate a contract using it.
message MsgStoreCodeAndInstantiateContract {
// Sender is the that actor that signed the messages
string sender = 1;
// WASMByteCode can be raw or gzip compressed
bytes wasm_byte_code = 2 [(gogoproto.customname) = "WASMByteCode"];
// Used in v1beta1
reserved 3, 4;
AccessConfig instantiate_permission = 5;
// Admin is an optional address that can execute migrations
string admin = 6;
// Label is optional metadata to be stored with a contract instance.
string label = 7;
// Msg json encoded message to be passed to the contract on instantiation
bytes msg = 8 [(gogoproto.casttype) = "RawContractMessage"];
// Funds coins that are transferred to the contract on instantiation
repeated cosmos.base.v1beta1.Coin funds = 9
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lbm-sdk/types.Coins"];
}
// MsgStoreCodeAndInstantiateContractResponse returns store and instantiate result data.
message MsgStoreCodeAndInstantiateContractResponse {
// CodeID is the reference to the stored WASM code
uint64 code_id = 1 [(gogoproto.customname) = "CodeID"];
// Address is the bech32 address of the new contract instance.
string address = 2;
// Data contains base64-encoded bytes to returned from the contract
bytes data = 3;
}
// MsgExecuteContract submits the given message data to a smart contract
message MsgExecuteContract {
// Sender is the that actor that signed the messages
string sender = 1;
// Contract is the address of the smart contract
string contract = 2;
// Msg json encoded message to be passed to the contract
bytes msg = 3 [(gogoproto.casttype) = "RawContractMessage"];
// Funds coins that are transferred to the contract on execution
repeated cosmos.base.v1beta1.Coin funds = 4
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lbm-sdk/types.Coins"];
}
// MsgExecuteContractResponse returns execution result data.
message MsgExecuteContractResponse {
// Data contains base64-encoded bytes to returned from the contract
bytes data = 1;
}
// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract
message MsgMigrateContract {
// Sender is the that actor that signed the messages
string sender = 1;
// Contract is the address of the smart contract
string contract = 2;
// CodeID references the new WASM code
uint64 code_id = 3 [(gogoproto.customname) = "CodeID"];
// Msg json encoded message to be passed to the contract on migration
bytes msg = 4 [(gogoproto.casttype) = "RawContractMessage"];
}
// MsgMigrateContractResponse returns contract migration result data.
message MsgMigrateContractResponse {
// Data contains same raw bytes returned as data from the wasm contract.
// (May be empty)
bytes data = 1;
}
// MsgUpdateAdmin sets a new admin for a smart contract
message MsgUpdateAdmin {
// Sender is the that actor that signed the messages
string sender = 1;
// NewAdmin address to be set
string new_admin = 2;
// Contract is the address of the smart contract
string contract = 3;
}
// MsgUpdateAdminResponse returns empty data
message MsgUpdateAdminResponse {}
// MsgClearAdmin removes any admin stored for a smart contract
message MsgClearAdmin {
// Sender is the that actor that signed the messages
string sender = 1;
// Contract is the address of the smart contract
string contract = 3;
}
// MsgClearAdminResponse returns empty data
message MsgClearAdminResponse {}