import { AccessConfig, AccessConfigSDKType } from "./types"; import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial, Long } from "../../../helpers"; /** StoreCodeProposal gov proposal content type to submit WASM code to the system */ export interface StoreCodeProposal { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** RunAs is the address that is passed to the contract's environment as sender */ runAs: string; /** WASMByteCode can be raw or gzip compressed */ wasmByteCode: Uint8Array; /** InstantiatePermission to apply on contract creation, optional */ instantiatePermission?: AccessConfig; } /** StoreCodeProposal gov proposal content type to submit WASM code to the system */ export interface StoreCodeProposalSDKType { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** RunAs is the address that is passed to the contract's environment as sender */ run_as: string; /** WASMByteCode can be raw or gzip compressed */ wasm_byte_code: Uint8Array; /** InstantiatePermission to apply on contract creation, optional */ instantiate_permission?: AccessConfigSDKType; } /** * InstantiateContractProposal gov proposal content type to instantiate a * contract. */ export interface InstantiateContractProposal { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** RunAs is the address that is passed to the contract's environment as sender */ runAs: string; /** Admin is an optional address that can execute migrations */ admin: string; /** CodeID is the reference to the stored WASM code */ codeId: Long; /** Label is optional metadata to be stored with a constract instance. */ label: string; /** Msg json encoded message to be passed to the contract on instantiation */ msg: Uint8Array; /** Funds coins that are transferred to the contract on instantiation */ funds: Coin[]; } /** * InstantiateContractProposal gov proposal content type to instantiate a * contract. */ export interface InstantiateContractProposalSDKType { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** RunAs is the address that is passed to the contract's environment as sender */ run_as: string; /** Admin is an optional address that can execute migrations */ admin: string; /** CodeID is the reference to the stored WASM code */ code_id: Long; /** Label is optional metadata to be stored with a constract instance. */ label: string; /** Msg json encoded message to be passed to the contract on instantiation */ msg: Uint8Array; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinSDKType[]; } /** MigrateContractProposal gov proposal content type to migrate a contract. */ export interface MigrateContractProposal { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** Contract is the address of the smart contract */ contract: string; /** CodeID references the new WASM codesudo */ codeId: Long; /** Msg json encoded message to be passed to the contract on migration */ msg: Uint8Array; } /** MigrateContractProposal gov proposal content type to migrate a contract. */ export interface MigrateContractProposalSDKType { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** Contract is the address of the smart contract */ contract: string; /** CodeID references the new WASM codesudo */ code_id: Long; /** Msg json encoded message to be passed to the contract on migration */ msg: Uint8Array; } /** SudoContractProposal gov proposal content type to call sudo on a contract. */ export interface SudoContractProposal { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** Contract is the address of the smart contract */ contract: string; /** Msg json encoded message to be passed to the contract as sudo */ msg: Uint8Array; } /** SudoContractProposal gov proposal content type to call sudo on a contract. */ export interface SudoContractProposalSDKType { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** Contract is the address of the smart contract */ contract: string; /** Msg json encoded message to be passed to the contract as sudo */ msg: Uint8Array; } /** * ExecuteContractProposal gov proposal content type to call execute on a * contract. */ export interface ExecuteContractProposal { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** RunAs is the address that is passed to the contract's environment as sender */ runAs: string; /** Contract is the address of the smart contract */ contract: string; /** Msg json encoded message to be passed to the contract as execute */ msg: Uint8Array; /** Funds coins that are transferred to the contract on instantiation */ funds: Coin[]; } /** * ExecuteContractProposal gov proposal content type to call execute on a * contract. */ export interface ExecuteContractProposalSDKType { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** RunAs is the address that is passed to the contract's environment as sender */ run_as: string; /** Contract is the address of the smart contract */ contract: string; /** Msg json encoded message to be passed to the contract as execute */ msg: Uint8Array; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinSDKType[]; } /** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ export interface UpdateAdminProposal { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** NewAdmin address to be set */ newAdmin: string; /** Contract is the address of the smart contract */ contract: string; } /** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ export interface UpdateAdminProposalSDKType { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** NewAdmin address to be set */ new_admin: string; /** Contract is the address of the smart contract */ contract: string; } /** * ClearAdminProposal gov proposal content type to clear the admin of a * contract. */ export interface ClearAdminProposal { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** Contract is the address of the smart contract */ contract: string; } /** * ClearAdminProposal gov proposal content type to clear the admin of a * contract. */ export interface ClearAdminProposalSDKType { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** Contract is the address of the smart contract */ contract: string; } /** * PinCodesProposal gov proposal content type to pin a set of code ids in the * wasmvm cache. */ export interface PinCodesProposal { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** CodeIDs references the new WASM codes */ codeIds: Long[]; } /** * PinCodesProposal gov proposal content type to pin a set of code ids in the * wasmvm cache. */ export interface PinCodesProposalSDKType { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** CodeIDs references the new WASM codes */ code_ids: Long[]; } /** * UnpinCodesProposal gov proposal content type to unpin a set of code ids in * the wasmvm cache. */ export interface UnpinCodesProposal { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** CodeIDs references the WASM codes */ codeIds: Long[]; } /** * UnpinCodesProposal gov proposal content type to unpin a set of code ids in * the wasmvm cache. */ export interface UnpinCodesProposalSDKType { /** Title is a short summary */ title: string; /** Description is a human readable text */ description: string; /** CodeIDs references the WASM codes */ code_ids: Long[]; } function createBaseStoreCodeProposal(): StoreCodeProposal { return { title: "", description: "", runAs: "", wasmByteCode: new Uint8Array(), instantiatePermission: undefined }; } export const StoreCodeProposal = { encode(message: StoreCodeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } if (message.description !== "") { writer.uint32(18).string(message.description); } if (message.runAs !== "") { writer.uint32(26).string(message.runAs); } if (message.wasmByteCode.length !== 0) { writer.uint32(34).bytes(message.wasmByteCode); } if (message.instantiatePermission !== undefined) { AccessConfig.encode(message.instantiatePermission, writer.uint32(58).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): StoreCodeProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStoreCodeProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.title = reader.string(); break; case 2: message.description = reader.string(); break; case 3: message.runAs = reader.string(); break; case 4: message.wasmByteCode = reader.bytes(); break; case 7: message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): StoreCodeProposal { const message = createBaseStoreCodeProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; message.runAs = object.runAs ?? ""; message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; return message; } }; function createBaseInstantiateContractProposal(): InstantiateContractProposal { return { title: "", description: "", runAs: "", admin: "", codeId: Long.UZERO, label: "", msg: new Uint8Array(), funds: [] }; } export const InstantiateContractProposal = { encode(message: InstantiateContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } if (message.description !== "") { writer.uint32(18).string(message.description); } if (message.runAs !== "") { writer.uint32(26).string(message.runAs); } if (message.admin !== "") { writer.uint32(34).string(message.admin); } if (!message.codeId.isZero()) { writer.uint32(40).uint64(message.codeId); } if (message.label !== "") { writer.uint32(50).string(message.label); } if (message.msg.length !== 0) { writer.uint32(58).bytes(message.msg); } for (const v of message.funds) { Coin.encode(v!, writer.uint32(66).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): InstantiateContractProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInstantiateContractProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.title = reader.string(); break; case 2: message.description = reader.string(); break; case 3: message.runAs = reader.string(); break; case 4: message.admin = reader.string(); break; case 5: message.codeId = (reader.uint64() as Long); break; case 6: message.label = reader.string(); break; case 7: message.msg = reader.bytes(); break; case 8: message.funds.push(Coin.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): InstantiateContractProposal { const message = createBaseInstantiateContractProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; message.runAs = object.runAs ?? ""; message.admin = object.admin ?? ""; message.codeId = object.codeId !== undefined && object.codeId !== null ? Long.fromValue(object.codeId) : Long.UZERO; message.label = object.label ?? ""; message.msg = object.msg ?? new Uint8Array(); message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; return message; } }; function createBaseMigrateContractProposal(): MigrateContractProposal { return { title: "", description: "", contract: "", codeId: Long.UZERO, msg: new Uint8Array() }; } export const MigrateContractProposal = { encode(message: MigrateContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } if (message.description !== "") { writer.uint32(18).string(message.description); } if (message.contract !== "") { writer.uint32(34).string(message.contract); } if (!message.codeId.isZero()) { writer.uint32(40).uint64(message.codeId); } if (message.msg.length !== 0) { writer.uint32(50).bytes(message.msg); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): MigrateContractProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMigrateContractProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.title = reader.string(); break; case 2: message.description = reader.string(); break; case 4: message.contract = reader.string(); break; case 5: message.codeId = (reader.uint64() as Long); break; case 6: message.msg = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): MigrateContractProposal { const message = createBaseMigrateContractProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; message.contract = object.contract ?? ""; message.codeId = object.codeId !== undefined && object.codeId !== null ? Long.fromValue(object.codeId) : Long.UZERO; message.msg = object.msg ?? new Uint8Array(); return message; } }; function createBaseSudoContractProposal(): SudoContractProposal { return { title: "", description: "", contract: "", msg: new Uint8Array() }; } export const SudoContractProposal = { encode(message: SudoContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } if (message.description !== "") { writer.uint32(18).string(message.description); } if (message.contract !== "") { writer.uint32(26).string(message.contract); } if (message.msg.length !== 0) { writer.uint32(34).bytes(message.msg); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): SudoContractProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSudoContractProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.title = reader.string(); break; case 2: message.description = reader.string(); break; case 3: message.contract = reader.string(); break; case 4: message.msg = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): SudoContractProposal { const message = createBaseSudoContractProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; message.contract = object.contract ?? ""; message.msg = object.msg ?? new Uint8Array(); return message; } }; function createBaseExecuteContractProposal(): ExecuteContractProposal { return { title: "", description: "", runAs: "", contract: "", msg: new Uint8Array(), funds: [] }; } export const ExecuteContractProposal = { encode(message: ExecuteContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } if (message.description !== "") { writer.uint32(18).string(message.description); } if (message.runAs !== "") { writer.uint32(26).string(message.runAs); } if (message.contract !== "") { writer.uint32(34).string(message.contract); } if (message.msg.length !== 0) { writer.uint32(42).bytes(message.msg); } for (const v of message.funds) { Coin.encode(v!, writer.uint32(50).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ExecuteContractProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExecuteContractProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.title = reader.string(); break; case 2: message.description = reader.string(); break; case 3: message.runAs = reader.string(); break; case 4: message.contract = reader.string(); break; case 5: message.msg = reader.bytes(); break; case 6: message.funds.push(Coin.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ExecuteContractProposal { const message = createBaseExecuteContractProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; message.runAs = object.runAs ?? ""; message.contract = object.contract ?? ""; message.msg = object.msg ?? new Uint8Array(); message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; return message; } }; function createBaseUpdateAdminProposal(): UpdateAdminProposal { return { title: "", description: "", newAdmin: "", contract: "" }; } export const UpdateAdminProposal = { encode(message: UpdateAdminProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } if (message.description !== "") { writer.uint32(18).string(message.description); } if (message.newAdmin !== "") { writer.uint32(26).string(message.newAdmin); } if (message.contract !== "") { writer.uint32(34).string(message.contract); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): UpdateAdminProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUpdateAdminProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.title = reader.string(); break; case 2: message.description = reader.string(); break; case 3: message.newAdmin = reader.string(); break; case 4: message.contract = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): UpdateAdminProposal { const message = createBaseUpdateAdminProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; message.newAdmin = object.newAdmin ?? ""; message.contract = object.contract ?? ""; return message; } }; function createBaseClearAdminProposal(): ClearAdminProposal { return { title: "", description: "", contract: "" }; } export const ClearAdminProposal = { encode(message: ClearAdminProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } if (message.description !== "") { writer.uint32(18).string(message.description); } if (message.contract !== "") { writer.uint32(26).string(message.contract); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ClearAdminProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClearAdminProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.title = reader.string(); break; case 2: message.description = reader.string(); break; case 3: message.contract = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): ClearAdminProposal { const message = createBaseClearAdminProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; message.contract = object.contract ?? ""; return message; } }; function createBasePinCodesProposal(): PinCodesProposal { return { title: "", description: "", codeIds: [] }; } export const PinCodesProposal = { encode(message: PinCodesProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } if (message.description !== "") { writer.uint32(18).string(message.description); } writer.uint32(26).fork(); for (const v of message.codeIds) { writer.uint64(v); } writer.ldelim(); return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): PinCodesProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePinCodesProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.title = reader.string(); break; case 2: message.description = reader.string(); break; case 3: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { message.codeIds.push((reader.uint64() as Long)); } } else { message.codeIds.push((reader.uint64() as Long)); } break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): PinCodesProposal { const message = createBasePinCodesProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; message.codeIds = object.codeIds?.map(e => Long.fromValue(e)) || []; return message; } }; function createBaseUnpinCodesProposal(): UnpinCodesProposal { return { title: "", description: "", codeIds: [] }; } export const UnpinCodesProposal = { encode(message: UnpinCodesProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.title !== "") { writer.uint32(10).string(message.title); } if (message.description !== "") { writer.uint32(18).string(message.description); } writer.uint32(26).fork(); for (const v of message.codeIds) { writer.uint64(v); } writer.ldelim(); return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): UnpinCodesProposal { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUnpinCodesProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.title = reader.string(); break; case 2: message.description = reader.string(); break; case 3: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { message.codeIds.push((reader.uint64() as Long)); } } else { message.codeIds.push((reader.uint64() as Long)); } break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): UnpinCodesProposal { const message = createBaseUnpinCodesProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; message.codeIds = object.codeIds?.map(e => Long.fromValue(e)) || []; return message; } };