forked from cerc-io/laconic-sdk
196 lines
8.0 KiB
TypeScript
196 lines
8.0 KiB
TypeScript
// @ts-nocheck
|
|
/* eslint-disable */
|
|
/**
|
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
|
* compiler version: 3.12.4
|
|
* source: vulcanize/bond/v1beta1/bond.proto
|
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
|
import * as dependency_1 from "./../../../gogoproto/gogo";
|
|
import * as dependency_2 from "./../../../cosmos/base/v1beta1/coin";
|
|
import * as pb_1 from "google-protobuf";
|
|
export namespace vulcanize.bond.v1beta1 {
|
|
export class Params extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
max_bond_amount?: dependency_2.cosmos.base.v1beta1.Coin;
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("max_bond_amount" in data && data.max_bond_amount != undefined) {
|
|
this.max_bond_amount = data.max_bond_amount;
|
|
}
|
|
}
|
|
}
|
|
get max_bond_amount() {
|
|
return pb_1.Message.getWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 1) as dependency_2.cosmos.base.v1beta1.Coin;
|
|
}
|
|
set max_bond_amount(value: dependency_2.cosmos.base.v1beta1.Coin) {
|
|
pb_1.Message.setWrapperField(this, 1, value);
|
|
}
|
|
get has_max_bond_amount() {
|
|
return pb_1.Message.getField(this, 1) != null;
|
|
}
|
|
static fromObject(data: {
|
|
max_bond_amount?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
|
}): Params {
|
|
const message = new Params({});
|
|
if (data.max_bond_amount != null) {
|
|
message.max_bond_amount = dependency_2.cosmos.base.v1beta1.Coin.fromObject(data.max_bond_amount);
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
max_bond_amount?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
|
} = {};
|
|
if (this.max_bond_amount != null) {
|
|
data.max_bond_amount = this.max_bond_amount.toObject();
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.has_max_bond_amount)
|
|
writer.writeMessage(1, this.max_bond_amount, () => this.max_bond_amount.serialize(writer));
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Params {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Params();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
reader.readMessage(message.max_bond_amount, () => message.max_bond_amount = dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader));
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): Params {
|
|
return Params.deserialize(bytes);
|
|
}
|
|
}
|
|
export class Bond extends pb_1.Message {
|
|
#one_of_decls: number[][] = [];
|
|
constructor(data?: any[] | {
|
|
id?: string;
|
|
owner?: string;
|
|
balance?: dependency_2.cosmos.base.v1beta1.Coin[];
|
|
}) {
|
|
super();
|
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
|
|
if (!Array.isArray(data) && typeof data == "object") {
|
|
if ("id" in data && data.id != undefined) {
|
|
this.id = data.id;
|
|
}
|
|
if ("owner" in data && data.owner != undefined) {
|
|
this.owner = data.owner;
|
|
}
|
|
if ("balance" in data && data.balance != undefined) {
|
|
this.balance = data.balance;
|
|
}
|
|
}
|
|
}
|
|
get id() {
|
|
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
|
}
|
|
set id(value: string) {
|
|
pb_1.Message.setField(this, 1, value);
|
|
}
|
|
get owner() {
|
|
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
|
}
|
|
set owner(value: string) {
|
|
pb_1.Message.setField(this, 2, value);
|
|
}
|
|
get balance() {
|
|
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 3) as dependency_2.cosmos.base.v1beta1.Coin[];
|
|
}
|
|
set balance(value: dependency_2.cosmos.base.v1beta1.Coin[]) {
|
|
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
|
}
|
|
static fromObject(data: {
|
|
id?: string;
|
|
owner?: string;
|
|
balance?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
|
}): Bond {
|
|
const message = new Bond({});
|
|
if (data.id != null) {
|
|
message.id = data.id;
|
|
}
|
|
if (data.owner != null) {
|
|
message.owner = data.owner;
|
|
}
|
|
if (data.balance != null) {
|
|
message.balance = data.balance.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item));
|
|
}
|
|
return message;
|
|
}
|
|
toObject() {
|
|
const data: {
|
|
id?: string;
|
|
owner?: string;
|
|
balance?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
|
} = {};
|
|
if (this.id != null) {
|
|
data.id = this.id;
|
|
}
|
|
if (this.owner != null) {
|
|
data.owner = this.owner;
|
|
}
|
|
if (this.balance != null) {
|
|
data.balance = this.balance.map((item: dependency_2.cosmos.base.v1beta1.Coin) => item.toObject());
|
|
}
|
|
return data;
|
|
}
|
|
serialize(): Uint8Array;
|
|
serialize(w: pb_1.BinaryWriter): void;
|
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
|
const writer = w || new pb_1.BinaryWriter();
|
|
if (this.id.length)
|
|
writer.writeString(1, this.id);
|
|
if (this.owner.length)
|
|
writer.writeString(2, this.owner);
|
|
if (this.balance.length)
|
|
writer.writeRepeatedMessage(3, this.balance, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer));
|
|
if (!w)
|
|
return writer.getResultBuffer();
|
|
}
|
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Bond {
|
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Bond();
|
|
while (reader.nextField()) {
|
|
if (reader.isEndGroup())
|
|
break;
|
|
switch (reader.getFieldNumber()) {
|
|
case 1:
|
|
message.id = reader.readString();
|
|
break;
|
|
case 2:
|
|
message.owner = reader.readString();
|
|
break;
|
|
case 3:
|
|
reader.readMessage(message.balance, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin));
|
|
break;
|
|
default: reader.skipField();
|
|
}
|
|
}
|
|
return message;
|
|
}
|
|
serializeBinary(): Uint8Array {
|
|
return this.serialize();
|
|
}
|
|
static deserializeBinary(bytes: Uint8Array): Bond {
|
|
return Bond.deserialize(bytes);
|
|
}
|
|
}
|
|
}
|