-
Notifications
You must be signed in to change notification settings - Fork 50
/
v1.rs
2165 lines (2165 loc) · 71.9 KB
/
v1.rs
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
use osmosis_std_derive::CosmwasmExt;
/// ContractExecutionAuthorization defines authorization for wasm execute.
/// Since: wasmd 0.30
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractExecutionAuthorization")]
pub struct ContractExecutionAuthorization {
/// Grants for contract executions
#[prost(message, repeated, tag = "1")]
pub grants: ::prost::alloc::vec::Vec<ContractGrant>,
}
/// ContractMigrationAuthorization defines authorization for wasm contract
/// migration. Since: wasmd 0.30
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractMigrationAuthorization")]
pub struct ContractMigrationAuthorization {
/// Grants for contract migrations
#[prost(message, repeated, tag = "1")]
pub grants: ::prost::alloc::vec::Vec<ContractGrant>,
}
/// ContractGrant a granted permission for a single contract
/// Since: wasmd 0.30
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractGrant")]
pub struct ContractGrant {
/// Contract is the bech32 address of the smart contract
#[prost(string, tag = "1")]
pub contract: ::prost::alloc::string::String,
/// Limit defines execution limits that are enforced and updated when the grant
/// is applied. When the limit lapsed the grant is removed.
#[prost(message, optional, tag = "2")]
pub limit: ::core::option::Option<crate::shim::Any>,
/// Filter define more fine-grained control on the message payload passed
/// to the contract in the operation. When no filter applies on execution, the
/// operation is prohibited.
#[prost(message, optional, tag = "3")]
pub filter: ::core::option::Option<crate::shim::Any>,
}
/// MaxCallsLimit limited number of calls to the contract. No funds transferable.
/// Since: wasmd 0.30
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.MaxCallsLimit")]
pub struct MaxCallsLimit {
/// Remaining number that is decremented on each execution
#[prost(uint64, tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub remaining: u64,
}
/// MaxFundsLimit defines the maximal amounts that can be sent to the contract.
/// Since: wasmd 0.30
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.MaxFundsLimit")]
pub struct MaxFundsLimit {
/// Amounts is the maximal amount of tokens transferable to the contract.
#[prost(message, repeated, tag = "1")]
pub amounts: ::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
}
/// CombinedLimit defines the maximal amounts that can be sent to a contract and
/// the maximal number of calls executable. Both need to remain >0 to be valid.
/// Since: wasmd 0.30
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.CombinedLimit")]
pub struct CombinedLimit {
/// Remaining number that is decremented on each execution
#[prost(uint64, tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub calls_remaining: u64,
/// Amounts is the maximal amount of tokens transferable to the contract.
#[prost(message, repeated, tag = "2")]
pub amounts: ::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
}
/// AllowAllMessagesFilter is a wildcard to allow any type of contract payload
/// message.
/// Since: wasmd 0.30
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.AllowAllMessagesFilter")]
pub struct AllowAllMessagesFilter {}
/// AcceptedMessageKeysFilter accept only the specific contract message keys in
/// the json object to be executed.
/// Since: wasmd 0.30
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter")]
pub struct AcceptedMessageKeysFilter {
/// Messages is the list of unique keys
#[prost(string, repeated, tag = "1")]
pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// AcceptedMessagesFilter accept only the specific raw contract messages to be
/// executed.
/// Since: wasmd 0.30
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.AcceptedMessagesFilter")]
pub struct AcceptedMessagesFilter {
/// Messages is the list of raw contract messages
#[prost(bytes = "vec", repeated, tag = "1")]
pub messages: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
/// AccessTypeParam
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.AccessTypeParam")]
pub struct AccessTypeParam {
#[prost(enumeration = "AccessType", tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub value: i32,
}
/// AccessConfig access control type.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.AccessConfig")]
pub struct AccessConfig {
#[prost(enumeration = "AccessType", tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub permission: i32,
/// Address
/// Deprecated: replaced by addresses
#[prost(string, tag = "2")]
pub address: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Params defines the set of wasm parameters.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.Params")]
pub struct Params {
#[prost(message, optional, tag = "1")]
pub code_upload_access: ::core::option::Option<AccessConfig>,
#[prost(enumeration = "AccessType", tag = "2")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub instantiate_default_permission: i32,
}
/// CodeInfo is data for the uploaded contract WASM code
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.CodeInfo")]
pub struct CodeInfo {
/// CodeHash is the unique identifier created by wasmvm
#[prost(bytes = "vec", tag = "1")]
pub code_hash: ::prost::alloc::vec::Vec<u8>,
/// Creator address who initially stored the code
#[prost(string, tag = "2")]
pub creator: ::prost::alloc::string::String,
/// InstantiateConfig access control to apply on contract creation, optional
#[prost(message, optional, tag = "5")]
pub instantiate_config: ::core::option::Option<AccessConfig>,
}
/// ContractInfo stores a WASM contract instance
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractInfo")]
pub struct ContractInfo {
/// CodeID is the reference to the stored Wasm code
#[prost(uint64, tag = "1")]
#[serde(alias = "codeID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code_id: u64,
/// Creator address who initially instantiated the contract
#[prost(string, tag = "2")]
pub creator: ::prost::alloc::string::String,
/// Admin is an optional address that can execute migrations
#[prost(string, tag = "3")]
pub admin: ::prost::alloc::string::String,
/// Label is optional metadata to be stored with a contract instance.
#[prost(string, tag = "4")]
pub label: ::prost::alloc::string::String,
/// Created Tx position when the contract was instantiated.
#[prost(message, optional, tag = "5")]
pub created: ::core::option::Option<AbsoluteTxPosition>,
#[prost(string, tag = "6")]
#[serde(alias = "ibc_portID")]
pub ibc_port_id: ::prost::alloc::string::String,
/// Extension is an extension point to store custom metadata within the
/// persistence model.
#[prost(message, optional, tag = "7")]
pub extension: ::core::option::Option<crate::shim::Any>,
}
/// ContractCodeHistoryEntry metadata to a contract.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractCodeHistoryEntry")]
pub struct ContractCodeHistoryEntry {
#[prost(enumeration = "ContractCodeHistoryOperationType", tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub operation: i32,
/// CodeID is the reference to the stored WASM code
#[prost(uint64, tag = "2")]
#[serde(alias = "codeID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code_id: u64,
/// Updated Tx position when the operation was executed.
#[prost(message, optional, tag = "3")]
pub updated: ::core::option::Option<AbsoluteTxPosition>,
#[prost(bytes = "vec", tag = "4")]
pub msg: ::prost::alloc::vec::Vec<u8>,
}
/// AbsoluteTxPosition is a unique transaction position that allows for global
/// ordering of transactions.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.AbsoluteTxPosition")]
pub struct AbsoluteTxPosition {
/// BlockHeight is the block the contract was created at
#[prost(uint64, tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub block_height: u64,
/// TxIndex is a monotonic counter within the block (actual transaction index,
/// or gas consumed)
#[prost(uint64, tag = "2")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub tx_index: u64,
}
/// Model is a struct that holds a KV pair
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.Model")]
pub struct Model {
/// hex-encode key to read it better (this is often ascii)
#[prost(bytes = "vec", tag = "1")]
pub key: ::prost::alloc::vec::Vec<u8>,
/// base64-encode raw value
#[prost(bytes = "vec", tag = "2")]
pub value: ::prost::alloc::vec::Vec<u8>,
}
/// AccessType permission types
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)]
pub enum AccessType {
/// AccessTypeUnspecified placeholder for empty value
Unspecified = 0,
/// AccessTypeNobody forbidden
Nobody = 1,
/// AccessTypeOnlyAddress restricted to a single address
/// Deprecated: use AccessTypeAnyOfAddresses instead
OnlyAddress = 2,
/// AccessTypeEverybody unrestricted
Everybody = 3,
/// AccessTypeAnyOfAddresses allow any of the addresses
AnyOfAddresses = 4,
}
impl AccessType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
AccessType::Unspecified => "ACCESS_TYPE_UNSPECIFIED",
AccessType::Nobody => "ACCESS_TYPE_NOBODY",
AccessType::OnlyAddress => "ACCESS_TYPE_ONLY_ADDRESS",
AccessType::Everybody => "ACCESS_TYPE_EVERYBODY",
AccessType::AnyOfAddresses => "ACCESS_TYPE_ANY_OF_ADDRESSES",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ACCESS_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"ACCESS_TYPE_NOBODY" => Some(Self::Nobody),
"ACCESS_TYPE_ONLY_ADDRESS" => Some(Self::OnlyAddress),
"ACCESS_TYPE_EVERYBODY" => Some(Self::Everybody),
"ACCESS_TYPE_ANY_OF_ADDRESSES" => Some(Self::AnyOfAddresses),
_ => None,
}
}
}
/// ContractCodeHistoryOperationType actions that caused a code change
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)]
pub enum ContractCodeHistoryOperationType {
/// ContractCodeHistoryOperationTypeUnspecified placeholder for empty value
Unspecified = 0,
/// ContractCodeHistoryOperationTypeInit on chain contract instantiation
Init = 1,
/// ContractCodeHistoryOperationTypeMigrate code migration
Migrate = 2,
/// ContractCodeHistoryOperationTypeGenesis based on genesis data
Genesis = 3,
}
impl ContractCodeHistoryOperationType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ContractCodeHistoryOperationType::Unspecified => {
"CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED"
}
ContractCodeHistoryOperationType::Init => "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT",
ContractCodeHistoryOperationType::Migrate => {
"CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE"
}
ContractCodeHistoryOperationType::Genesis => {
"CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS"
}
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT" => Some(Self::Init),
"CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE" => Some(Self::Migrate),
"CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS" => Some(Self::Genesis),
_ => None,
}
}
}
/// GenesisState - genesis state of x/wasm
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.GenesisState")]
pub struct GenesisState {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
#[prost(message, repeated, tag = "2")]
pub codes: ::prost::alloc::vec::Vec<Code>,
#[prost(message, repeated, tag = "3")]
pub contracts: ::prost::alloc::vec::Vec<Contract>,
#[prost(message, repeated, tag = "4")]
pub sequences: ::prost::alloc::vec::Vec<Sequence>,
}
/// Code struct encompasses CodeInfo and CodeBytes
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.Code")]
pub struct Code {
#[prost(uint64, tag = "1")]
#[serde(alias = "codeID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code_id: u64,
#[prost(message, optional, tag = "2")]
pub code_info: ::core::option::Option<CodeInfo>,
#[prost(bytes = "vec", tag = "3")]
pub code_bytes: ::prost::alloc::vec::Vec<u8>,
/// Pinned to wasmvm cache
#[prost(bool, tag = "4")]
pub pinned: bool,
}
/// Contract struct encompasses ContractAddress, ContractInfo, and ContractState
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.Contract")]
pub struct Contract {
#[prost(string, tag = "1")]
pub contract_address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub contract_info: ::core::option::Option<ContractInfo>,
#[prost(message, repeated, tag = "3")]
pub contract_state: ::prost::alloc::vec::Vec<Model>,
#[prost(message, repeated, tag = "4")]
pub contract_code_history: ::prost::alloc::vec::Vec<ContractCodeHistoryEntry>,
}
/// Sequence key and value of an id generation counter
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.Sequence")]
pub struct Sequence {
#[prost(bytes = "vec", tag = "1")]
pub id_key: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "2")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub value: u64,
}
/// MsgIBCSend
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgIBCSend")]
pub struct MsgIbcSend {
/// the channel by which the packet will be sent
#[prost(string, tag = "2")]
pub channel: ::prost::alloc::string::String,
/// Timeout height relative to the current block height.
/// The timeout is disabled when set to 0.
#[prost(uint64, tag = "4")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub timeout_height: u64,
/// Timeout timestamp (in nanoseconds) relative to the current block timestamp.
/// The timeout is disabled when set to 0.
#[prost(uint64, tag = "5")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub timeout_timestamp: u64,
/// Data is the payload to transfer. We must not make assumption what format or
/// content is in here.
#[prost(bytes = "vec", tag = "6")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
/// MsgIBCSendResponse
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgIBCSendResponse")]
pub struct MsgIbcSendResponse {
/// Sequence number of the IBC packet sent
#[prost(uint64, tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub sequence: u64,
}
/// MsgIBCCloseChannel port and channel need to be owned by the contract
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgIBCCloseChannel")]
pub struct MsgIbcCloseChannel {
#[prost(string, tag = "2")]
pub channel: ::prost::alloc::string::String,
}
/// StoreCodeProposal gov proposal content type to submit WASM code to the system
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.StoreCodeProposal")]
pub struct StoreCodeProposal {
/// Title is a short summary
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
/// Description is a human readable text
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// RunAs is the address that is passed to the contract's environment as sender
#[prost(string, tag = "3")]
pub run_as: ::prost::alloc::string::String,
/// WASMByteCode can be raw or gzip compressed
#[prost(bytes = "vec", tag = "4")]
pub wasm_byte_code: ::prost::alloc::vec::Vec<u8>,
/// InstantiatePermission to apply on contract creation, optional
#[prost(message, optional, tag = "7")]
pub instantiate_permission: ::core::option::Option<AccessConfig>,
/// UnpinCode code on upload, optional
#[prost(bool, tag = "8")]
pub unpin_code: bool,
/// Source is the URL where the code is hosted
#[prost(string, tag = "9")]
pub source: ::prost::alloc::string::String,
/// Builder is the docker image used to build the code deterministically, used
/// for smart contract verification
#[prost(string, tag = "10")]
pub builder: ::prost::alloc::string::String,
/// CodeHash is the SHA256 sum of the code outputted by builder, used for smart
/// contract verification
#[prost(bytes = "vec", tag = "11")]
pub code_hash: ::prost::alloc::vec::Vec<u8>,
}
/// InstantiateContractProposal gov proposal content type to instantiate a
/// contract.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.InstantiateContractProposal")]
pub struct InstantiateContractProposal {
/// Title is a short summary
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
/// Description is a human readable text
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// RunAs is the address that is passed to the contract's environment as sender
#[prost(string, tag = "3")]
pub run_as: ::prost::alloc::string::String,
/// Admin is an optional address that can execute migrations
#[prost(string, tag = "4")]
pub admin: ::prost::alloc::string::String,
/// CodeID is the reference to the stored WASM code
#[prost(uint64, tag = "5")]
#[serde(alias = "codeID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code_id: u64,
/// Label is optional metadata to be stored with a constract instance.
#[prost(string, tag = "6")]
pub label: ::prost::alloc::string::String,
/// Msg json encoded message to be passed to the contract on instantiation
#[prost(bytes = "vec", tag = "7")]
pub msg: ::prost::alloc::vec::Vec<u8>,
/// Funds coins that are transferred to the contract on instantiation
#[prost(message, repeated, tag = "8")]
pub funds: ::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
}
/// InstantiateContract2Proposal gov proposal content type to instantiate
/// contract 2
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.InstantiateContract2Proposal")]
pub struct InstantiateContract2Proposal {
/// Title is a short summary
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
/// Description is a human readable text
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// RunAs is the address that is passed to the contract's enviroment as sender
#[prost(string, tag = "3")]
pub run_as: ::prost::alloc::string::String,
/// Admin is an optional address that can execute migrations
#[prost(string, tag = "4")]
pub admin: ::prost::alloc::string::String,
/// CodeID is the reference to the stored WASM code
#[prost(uint64, tag = "5")]
#[serde(alias = "codeID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code_id: u64,
/// Label is optional metadata to be stored with a constract instance.
#[prost(string, tag = "6")]
pub label: ::prost::alloc::string::String,
/// Msg json encode message to be passed to the contract on instantiation
#[prost(bytes = "vec", tag = "7")]
pub msg: ::prost::alloc::vec::Vec<u8>,
/// Funds coins that are transferred to the contract on instantiation
#[prost(message, repeated, tag = "8")]
pub funds: ::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
/// Salt is an arbitrary value provided by the sender. Size can be 1 to 64.
#[prost(bytes = "vec", tag = "9")]
pub salt: ::prost::alloc::vec::Vec<u8>,
/// FixMsg include the msg value into the hash for the predictable address.
/// Default is false
#[prost(bool, tag = "10")]
pub fix_msg: bool,
}
/// MigrateContractProposal gov proposal content type to migrate a contract.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.MigrateContractProposal")]
pub struct MigrateContractProposal {
/// Title is a short summary
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
/// Description is a human readable text
///
/// Note: skipping 3 as this was previously used for unneeded run_as
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// Contract is the address of the smart contract
#[prost(string, tag = "4")]
pub contract: ::prost::alloc::string::String,
/// CodeID references the new WASM code
#[prost(uint64, tag = "5")]
#[serde(alias = "codeID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code_id: u64,
/// Msg json encoded message to be passed to the contract on migration
#[prost(bytes = "vec", tag = "6")]
pub msg: ::prost::alloc::vec::Vec<u8>,
}
/// SudoContractProposal gov proposal content type to call sudo on a contract.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.SudoContractProposal")]
pub struct SudoContractProposal {
/// Title is a short summary
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
/// Description is a human readable text
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// Contract is the address of the smart contract
#[prost(string, tag = "3")]
pub contract: ::prost::alloc::string::String,
/// Msg json encoded message to be passed to the contract as sudo
#[prost(bytes = "vec", tag = "4")]
pub msg: ::prost::alloc::vec::Vec<u8>,
}
/// ExecuteContractProposal gov proposal content type to call execute on a
/// contract.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.ExecuteContractProposal")]
pub struct ExecuteContractProposal {
/// Title is a short summary
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
/// Description is a human readable text
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// RunAs is the address that is passed to the contract's environment as sender
#[prost(string, tag = "3")]
pub run_as: ::prost::alloc::string::String,
/// Contract is the address of the smart contract
#[prost(string, tag = "4")]
pub contract: ::prost::alloc::string::String,
/// Msg json encoded message to be passed to the contract as execute
#[prost(bytes = "vec", tag = "5")]
pub msg: ::prost::alloc::vec::Vec<u8>,
/// Funds coins that are transferred to the contract on instantiation
#[prost(message, repeated, tag = "6")]
pub funds: ::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
}
/// UpdateAdminProposal gov proposal content type to set an admin for a contract.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.UpdateAdminProposal")]
pub struct UpdateAdminProposal {
/// Title is a short summary
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
/// Description is a human readable text
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// NewAdmin address to be set
#[prost(string, tag = "3")]
pub new_admin: ::prost::alloc::string::String,
/// Contract is the address of the smart contract
#[prost(string, tag = "4")]
pub contract: ::prost::alloc::string::String,
}
/// ClearAdminProposal gov proposal content type to clear the admin of a
/// contract.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.ClearAdminProposal")]
pub struct ClearAdminProposal {
/// Title is a short summary
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
/// Description is a human readable text
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// Contract is the address of the smart contract
#[prost(string, tag = "3")]
pub contract: ::prost::alloc::string::String,
}
/// PinCodesProposal gov proposal content type to pin a set of code ids in the
/// wasmvm cache.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/cosmwasm.wasm.v1.PinCodesProposal")]
pub struct PinCodesProposal {
/// Title is a short summary
#[prost(string, tag = "1")]
pub title: ::prost::alloc::string::String,
/// Description is a human readable text
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// CodeIDs references the new WASM codes
#[prost(uint64, repeated, packed = "false", tag = "3")]
#[serde(alias = "codeIDs")]
pub code_ids: ::prost::alloc::vec::Vec<u64>,
}
/// UnpinCodesProposal gov proposal content type to unpin a set of code ids in
/// the wasmvm cache.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,