@cheqd/ts-proto
Version:
A TypeScript package for all transpiled cheqd ProtoBuf definitions.
1,393 lines • 50.8 kB
JavaScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc unknown
// source: cheqd/did/v2/tx.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Coin } from "../../../cosmos/base/v1beta1/coin.js";
import { DidDocWithMetadata, Service, VerificationMethod } from "./diddoc.js";
import { FeeParams } from "./fee.js";
function createBaseMsgCreateDidDoc() {
return { payload: undefined, signatures: [] };
}
export const MsgCreateDidDoc = {
encode(message, writer = new BinaryWriter()) {
if (message.payload !== undefined) {
MsgCreateDidDocPayload.encode(message.payload, writer.uint32(10).fork()).join();
}
for (const v of message.signatures) {
SignInfo.encode(v, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgCreateDidDoc();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.payload = MsgCreateDidDocPayload.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.signatures.push(SignInfo.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
payload: isSet(object.payload) ? MsgCreateDidDocPayload.fromJSON(object.payload) : undefined,
signatures: globalThis.Array.isArray(object?.signatures)
? object.signatures.map((e) => SignInfo.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.payload !== undefined) {
obj.payload = MsgCreateDidDocPayload.toJSON(message.payload);
}
if (message.signatures?.length) {
obj.signatures = message.signatures.map((e) => SignInfo.toJSON(e));
}
return obj;
},
create(base) {
return MsgCreateDidDoc.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgCreateDidDoc();
message.payload = (object.payload !== undefined && object.payload !== null)
? MsgCreateDidDocPayload.fromPartial(object.payload)
: undefined;
message.signatures = object.signatures?.map((e) => SignInfo.fromPartial(e)) || [];
return message;
},
};
function createBaseMsgUpdateDidDoc() {
return { payload: undefined, signatures: [] };
}
export const MsgUpdateDidDoc = {
encode(message, writer = new BinaryWriter()) {
if (message.payload !== undefined) {
MsgUpdateDidDocPayload.encode(message.payload, writer.uint32(10).fork()).join();
}
for (const v of message.signatures) {
SignInfo.encode(v, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgUpdateDidDoc();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.payload = MsgUpdateDidDocPayload.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.signatures.push(SignInfo.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
payload: isSet(object.payload) ? MsgUpdateDidDocPayload.fromJSON(object.payload) : undefined,
signatures: globalThis.Array.isArray(object?.signatures)
? object.signatures.map((e) => SignInfo.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.payload !== undefined) {
obj.payload = MsgUpdateDidDocPayload.toJSON(message.payload);
}
if (message.signatures?.length) {
obj.signatures = message.signatures.map((e) => SignInfo.toJSON(e));
}
return obj;
},
create(base) {
return MsgUpdateDidDoc.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgUpdateDidDoc();
message.payload = (object.payload !== undefined && object.payload !== null)
? MsgUpdateDidDocPayload.fromPartial(object.payload)
: undefined;
message.signatures = object.signatures?.map((e) => SignInfo.fromPartial(e)) || [];
return message;
},
};
function createBaseMsgDeactivateDidDoc() {
return { payload: undefined, signatures: [] };
}
export const MsgDeactivateDidDoc = {
encode(message, writer = new BinaryWriter()) {
if (message.payload !== undefined) {
MsgDeactivateDidDocPayload.encode(message.payload, writer.uint32(10).fork()).join();
}
for (const v of message.signatures) {
SignInfo.encode(v, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgDeactivateDidDoc();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.payload = MsgDeactivateDidDocPayload.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.signatures.push(SignInfo.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
payload: isSet(object.payload) ? MsgDeactivateDidDocPayload.fromJSON(object.payload) : undefined,
signatures: globalThis.Array.isArray(object?.signatures)
? object.signatures.map((e) => SignInfo.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.payload !== undefined) {
obj.payload = MsgDeactivateDidDocPayload.toJSON(message.payload);
}
if (message.signatures?.length) {
obj.signatures = message.signatures.map((e) => SignInfo.toJSON(e));
}
return obj;
},
create(base) {
return MsgDeactivateDidDoc.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgDeactivateDidDoc();
message.payload = (object.payload !== undefined && object.payload !== null)
? MsgDeactivateDidDocPayload.fromPartial(object.payload)
: undefined;
message.signatures = object.signatures?.map((e) => SignInfo.fromPartial(e)) || [];
return message;
},
};
function createBaseSignInfo() {
return { verificationMethodId: "", signature: new Uint8Array(0) };
}
export const SignInfo = {
encode(message, writer = new BinaryWriter()) {
if (message.verificationMethodId !== "") {
writer.uint32(10).string(message.verificationMethodId);
}
if (message.signature.length !== 0) {
writer.uint32(18).bytes(message.signature);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseSignInfo();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.verificationMethodId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.signature = reader.bytes();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
verificationMethodId: isSet(object.verificationMethodId) ? globalThis.String(object.verificationMethodId) : "",
signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(0),
};
},
toJSON(message) {
const obj = {};
if (message.verificationMethodId !== "") {
obj.verificationMethodId = message.verificationMethodId;
}
if (message.signature.length !== 0) {
obj.signature = base64FromBytes(message.signature);
}
return obj;
},
create(base) {
return SignInfo.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseSignInfo();
message.verificationMethodId = object.verificationMethodId ?? "";
message.signature = object.signature ?? new Uint8Array(0);
return message;
},
};
function createBaseMsgCreateDidDocPayload() {
return {
context: [],
id: "",
controller: [],
verificationMethod: [],
authentication: [],
assertionMethod: [],
capabilityInvocation: [],
capabilityDelegation: [],
keyAgreement: [],
service: [],
alsoKnownAs: [],
versionId: "",
};
}
export const MsgCreateDidDocPayload = {
encode(message, writer = new BinaryWriter()) {
for (const v of message.context) {
writer.uint32(10).string(v);
}
if (message.id !== "") {
writer.uint32(18).string(message.id);
}
for (const v of message.controller) {
writer.uint32(26).string(v);
}
for (const v of message.verificationMethod) {
VerificationMethod.encode(v, writer.uint32(34).fork()).join();
}
for (const v of message.authentication) {
writer.uint32(42).string(v);
}
for (const v of message.assertionMethod) {
writer.uint32(50).string(v);
}
for (const v of message.capabilityInvocation) {
writer.uint32(58).string(v);
}
for (const v of message.capabilityDelegation) {
writer.uint32(66).string(v);
}
for (const v of message.keyAgreement) {
writer.uint32(74).string(v);
}
for (const v of message.service) {
Service.encode(v, writer.uint32(82).fork()).join();
}
for (const v of message.alsoKnownAs) {
writer.uint32(90).string(v);
}
if (message.versionId !== "") {
writer.uint32(98).string(message.versionId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgCreateDidDocPayload();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.context.push(reader.string());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.id = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.controller.push(reader.string());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.verificationMethod.push(VerificationMethod.decode(reader, reader.uint32()));
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.authentication.push(reader.string());
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.assertionMethod.push(reader.string());
continue;
}
case 7: {
if (tag !== 58) {
break;
}
message.capabilityInvocation.push(reader.string());
continue;
}
case 8: {
if (tag !== 66) {
break;
}
message.capabilityDelegation.push(reader.string());
continue;
}
case 9: {
if (tag !== 74) {
break;
}
message.keyAgreement.push(reader.string());
continue;
}
case 10: {
if (tag !== 82) {
break;
}
message.service.push(Service.decode(reader, reader.uint32()));
continue;
}
case 11: {
if (tag !== 90) {
break;
}
message.alsoKnownAs.push(reader.string());
continue;
}
case 12: {
if (tag !== 98) {
break;
}
message.versionId = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
context: globalThis.Array.isArray(object?.context) ? object.context.map((e) => globalThis.String(e)) : [],
id: isSet(object.id) ? globalThis.String(object.id) : "",
controller: globalThis.Array.isArray(object?.controller)
? object.controller.map((e) => globalThis.String(e))
: [],
verificationMethod: globalThis.Array.isArray(object?.verificationMethod)
? object.verificationMethod.map((e) => VerificationMethod.fromJSON(e))
: [],
authentication: globalThis.Array.isArray(object?.authentication)
? object.authentication.map((e) => globalThis.String(e))
: [],
assertionMethod: globalThis.Array.isArray(object?.assertionMethod)
? object.assertionMethod.map((e) => globalThis.String(e))
: [],
capabilityInvocation: globalThis.Array.isArray(object?.capabilityInvocation)
? object.capabilityInvocation.map((e) => globalThis.String(e))
: [],
capabilityDelegation: globalThis.Array.isArray(object?.capabilityDelegation)
? object.capabilityDelegation.map((e) => globalThis.String(e))
: [],
keyAgreement: globalThis.Array.isArray(object?.keyAgreement)
? object.keyAgreement.map((e) => globalThis.String(e))
: [],
service: globalThis.Array.isArray(object?.service) ? object.service.map((e) => Service.fromJSON(e)) : [],
alsoKnownAs: globalThis.Array.isArray(object?.alsoKnownAs)
? object.alsoKnownAs.map((e) => globalThis.String(e))
: [],
versionId: isSet(object.versionId) ? globalThis.String(object.versionId) : "",
};
},
toJSON(message) {
const obj = {};
if (message.context?.length) {
obj.context = message.context;
}
if (message.id !== "") {
obj.id = message.id;
}
if (message.controller?.length) {
obj.controller = message.controller;
}
if (message.verificationMethod?.length) {
obj.verificationMethod = message.verificationMethod.map((e) => VerificationMethod.toJSON(e));
}
if (message.authentication?.length) {
obj.authentication = message.authentication;
}
if (message.assertionMethod?.length) {
obj.assertionMethod = message.assertionMethod;
}
if (message.capabilityInvocation?.length) {
obj.capabilityInvocation = message.capabilityInvocation;
}
if (message.capabilityDelegation?.length) {
obj.capabilityDelegation = message.capabilityDelegation;
}
if (message.keyAgreement?.length) {
obj.keyAgreement = message.keyAgreement;
}
if (message.service?.length) {
obj.service = message.service.map((e) => Service.toJSON(e));
}
if (message.alsoKnownAs?.length) {
obj.alsoKnownAs = message.alsoKnownAs;
}
if (message.versionId !== "") {
obj.versionId = message.versionId;
}
return obj;
},
create(base) {
return MsgCreateDidDocPayload.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgCreateDidDocPayload();
message.context = object.context?.map((e) => e) || [];
message.id = object.id ?? "";
message.controller = object.controller?.map((e) => e) || [];
message.verificationMethod = object.verificationMethod?.map((e) => VerificationMethod.fromPartial(e)) || [];
message.authentication = object.authentication?.map((e) => e) || [];
message.assertionMethod = object.assertionMethod?.map((e) => e) || [];
message.capabilityInvocation = object.capabilityInvocation?.map((e) => e) || [];
message.capabilityDelegation = object.capabilityDelegation?.map((e) => e) || [];
message.keyAgreement = object.keyAgreement?.map((e) => e) || [];
message.service = object.service?.map((e) => Service.fromPartial(e)) || [];
message.alsoKnownAs = object.alsoKnownAs?.map((e) => e) || [];
message.versionId = object.versionId ?? "";
return message;
},
};
function createBaseMsgCreateDidDocResponse() {
return { value: undefined };
}
export const MsgCreateDidDocResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.value !== undefined) {
DidDocWithMetadata.encode(message.value, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgCreateDidDocResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.value = DidDocWithMetadata.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { value: isSet(object.value) ? DidDocWithMetadata.fromJSON(object.value) : undefined };
},
toJSON(message) {
const obj = {};
if (message.value !== undefined) {
obj.value = DidDocWithMetadata.toJSON(message.value);
}
return obj;
},
create(base) {
return MsgCreateDidDocResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgCreateDidDocResponse();
message.value = (object.value !== undefined && object.value !== null)
? DidDocWithMetadata.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseMsgUpdateDidDocPayload() {
return {
context: [],
id: "",
controller: [],
verificationMethod: [],
authentication: [],
assertionMethod: [],
capabilityInvocation: [],
capabilityDelegation: [],
keyAgreement: [],
service: [],
alsoKnownAs: [],
versionId: "",
};
}
export const MsgUpdateDidDocPayload = {
encode(message, writer = new BinaryWriter()) {
for (const v of message.context) {
writer.uint32(10).string(v);
}
if (message.id !== "") {
writer.uint32(18).string(message.id);
}
for (const v of message.controller) {
writer.uint32(26).string(v);
}
for (const v of message.verificationMethod) {
VerificationMethod.encode(v, writer.uint32(34).fork()).join();
}
for (const v of message.authentication) {
writer.uint32(42).string(v);
}
for (const v of message.assertionMethod) {
writer.uint32(50).string(v);
}
for (const v of message.capabilityInvocation) {
writer.uint32(58).string(v);
}
for (const v of message.capabilityDelegation) {
writer.uint32(66).string(v);
}
for (const v of message.keyAgreement) {
writer.uint32(74).string(v);
}
for (const v of message.service) {
Service.encode(v, writer.uint32(82).fork()).join();
}
for (const v of message.alsoKnownAs) {
writer.uint32(90).string(v);
}
if (message.versionId !== "") {
writer.uint32(98).string(message.versionId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgUpdateDidDocPayload();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.context.push(reader.string());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.id = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.controller.push(reader.string());
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.verificationMethod.push(VerificationMethod.decode(reader, reader.uint32()));
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.authentication.push(reader.string());
continue;
}
case 6: {
if (tag !== 50) {
break;
}
message.assertionMethod.push(reader.string());
continue;
}
case 7: {
if (tag !== 58) {
break;
}
message.capabilityInvocation.push(reader.string());
continue;
}
case 8: {
if (tag !== 66) {
break;
}
message.capabilityDelegation.push(reader.string());
continue;
}
case 9: {
if (tag !== 74) {
break;
}
message.keyAgreement.push(reader.string());
continue;
}
case 10: {
if (tag !== 82) {
break;
}
message.service.push(Service.decode(reader, reader.uint32()));
continue;
}
case 11: {
if (tag !== 90) {
break;
}
message.alsoKnownAs.push(reader.string());
continue;
}
case 12: {
if (tag !== 98) {
break;
}
message.versionId = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
context: globalThis.Array.isArray(object?.context) ? object.context.map((e) => globalThis.String(e)) : [],
id: isSet(object.id) ? globalThis.String(object.id) : "",
controller: globalThis.Array.isArray(object?.controller)
? object.controller.map((e) => globalThis.String(e))
: [],
verificationMethod: globalThis.Array.isArray(object?.verificationMethod)
? object.verificationMethod.map((e) => VerificationMethod.fromJSON(e))
: [],
authentication: globalThis.Array.isArray(object?.authentication)
? object.authentication.map((e) => globalThis.String(e))
: [],
assertionMethod: globalThis.Array.isArray(object?.assertionMethod)
? object.assertionMethod.map((e) => globalThis.String(e))
: [],
capabilityInvocation: globalThis.Array.isArray(object?.capabilityInvocation)
? object.capabilityInvocation.map((e) => globalThis.String(e))
: [],
capabilityDelegation: globalThis.Array.isArray(object?.capabilityDelegation)
? object.capabilityDelegation.map((e) => globalThis.String(e))
: [],
keyAgreement: globalThis.Array.isArray(object?.keyAgreement)
? object.keyAgreement.map((e) => globalThis.String(e))
: [],
service: globalThis.Array.isArray(object?.service) ? object.service.map((e) => Service.fromJSON(e)) : [],
alsoKnownAs: globalThis.Array.isArray(object?.alsoKnownAs)
? object.alsoKnownAs.map((e) => globalThis.String(e))
: [],
versionId: isSet(object.versionId) ? globalThis.String(object.versionId) : "",
};
},
toJSON(message) {
const obj = {};
if (message.context?.length) {
obj.context = message.context;
}
if (message.id !== "") {
obj.id = message.id;
}
if (message.controller?.length) {
obj.controller = message.controller;
}
if (message.verificationMethod?.length) {
obj.verificationMethod = message.verificationMethod.map((e) => VerificationMethod.toJSON(e));
}
if (message.authentication?.length) {
obj.authentication = message.authentication;
}
if (message.assertionMethod?.length) {
obj.assertionMethod = message.assertionMethod;
}
if (message.capabilityInvocation?.length) {
obj.capabilityInvocation = message.capabilityInvocation;
}
if (message.capabilityDelegation?.length) {
obj.capabilityDelegation = message.capabilityDelegation;
}
if (message.keyAgreement?.length) {
obj.keyAgreement = message.keyAgreement;
}
if (message.service?.length) {
obj.service = message.service.map((e) => Service.toJSON(e));
}
if (message.alsoKnownAs?.length) {
obj.alsoKnownAs = message.alsoKnownAs;
}
if (message.versionId !== "") {
obj.versionId = message.versionId;
}
return obj;
},
create(base) {
return MsgUpdateDidDocPayload.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgUpdateDidDocPayload();
message.context = object.context?.map((e) => e) || [];
message.id = object.id ?? "";
message.controller = object.controller?.map((e) => e) || [];
message.verificationMethod = object.verificationMethod?.map((e) => VerificationMethod.fromPartial(e)) || [];
message.authentication = object.authentication?.map((e) => e) || [];
message.assertionMethod = object.assertionMethod?.map((e) => e) || [];
message.capabilityInvocation = object.capabilityInvocation?.map((e) => e) || [];
message.capabilityDelegation = object.capabilityDelegation?.map((e) => e) || [];
message.keyAgreement = object.keyAgreement?.map((e) => e) || [];
message.service = object.service?.map((e) => Service.fromPartial(e)) || [];
message.alsoKnownAs = object.alsoKnownAs?.map((e) => e) || [];
message.versionId = object.versionId ?? "";
return message;
},
};
function createBaseMsgUpdateDidDocResponse() {
return { value: undefined };
}
export const MsgUpdateDidDocResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.value !== undefined) {
DidDocWithMetadata.encode(message.value, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgUpdateDidDocResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.value = DidDocWithMetadata.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { value: isSet(object.value) ? DidDocWithMetadata.fromJSON(object.value) : undefined };
},
toJSON(message) {
const obj = {};
if (message.value !== undefined) {
obj.value = DidDocWithMetadata.toJSON(message.value);
}
return obj;
},
create(base) {
return MsgUpdateDidDocResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgUpdateDidDocResponse();
message.value = (object.value !== undefined && object.value !== null)
? DidDocWithMetadata.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseMsgDeactivateDidDocPayload() {
return { id: "", versionId: "" };
}
export const MsgDeactivateDidDocPayload = {
encode(message, writer = new BinaryWriter()) {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
if (message.versionId !== "") {
writer.uint32(18).string(message.versionId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgDeactivateDidDocPayload();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.id = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.versionId = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
id: isSet(object.id) ? globalThis.String(object.id) : "",
versionId: isSet(object.versionId) ? globalThis.String(object.versionId) : "",
};
},
toJSON(message) {
const obj = {};
if (message.id !== "") {
obj.id = message.id;
}
if (message.versionId !== "") {
obj.versionId = message.versionId;
}
return obj;
},
create(base) {
return MsgDeactivateDidDocPayload.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgDeactivateDidDocPayload();
message.id = object.id ?? "";
message.versionId = object.versionId ?? "";
return message;
},
};
function createBaseMsgDeactivateDidDocResponse() {
return { value: undefined };
}
export const MsgDeactivateDidDocResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.value !== undefined) {
DidDocWithMetadata.encode(message.value, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgDeactivateDidDocResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.value = DidDocWithMetadata.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { value: isSet(object.value) ? DidDocWithMetadata.fromJSON(object.value) : undefined };
},
toJSON(message) {
const obj = {};
if (message.value !== undefined) {
obj.value = DidDocWithMetadata.toJSON(message.value);
}
return obj;
},
create(base) {
return MsgDeactivateDidDocResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgDeactivateDidDocResponse();
message.value = (object.value !== undefined && object.value !== null)
? DidDocWithMetadata.fromPartial(object.value)
: undefined;
return message;
},
};
function createBaseMsgBurn() {
return { fromAddress: "", amount: [] };
}
export const MsgBurn = {
encode(message, writer = new BinaryWriter()) {
if (message.fromAddress !== "") {
writer.uint32(10).string(message.fromAddress);
}
for (const v of message.amount) {
Coin.encode(v, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgBurn();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.fromAddress = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.amount.push(Coin.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
fromAddress: isSet(object.fromAddress) ? globalThis.String(object.fromAddress) : "",
amount: globalThis.Array.isArray(object?.amount) ? object.amount.map((e) => Coin.fromJSON(e)) : [],
};
},
toJSON(message) {
const obj = {};
if (message.fromAddress !== "") {
obj.fromAddress = message.fromAddress;
}
if (message.amount?.length) {
obj.amount = message.amount.map((e) => Coin.toJSON(e));
}
return obj;
},
create(base) {
return MsgBurn.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgBurn();
message.fromAddress = object.fromAddress ?? "";
message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [];
return message;
},
};
function createBaseMsgBurnResponse() {
return {};
}
export const MsgBurnResponse = {
encode(_, writer = new BinaryWriter()) {
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgBurnResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return {};
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return MsgBurnResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseMsgBurnResponse();
return message;
},
};
function createBaseMsgMint() {
return { authority: "", toAddress: "", amount: [] };
}
export const MsgMint = {
encode(message, writer = new BinaryWriter()) {
if (message.authority !== "") {
writer.uint32(10).string(message.authority);
}
if (message.toAddress !== "") {
writer.uint32(18).string(message.toAddress);
}
for (const v of message.amount) {
Coin.encode(v, writer.uint32(26).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgMint();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.authority = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.toAddress = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.amount.push(Coin.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
authority: isSet(object.authority) ? globalThis.String(object.authority) : "",
toAddress: isSet(object.toAddress) ? globalThis.String(object.toAddress) : "",
amount: globalThis.Array.isArray(object?.amount) ? object.amount.map((e) => Coin.fromJSON(e)) : [],
};
},
toJSON(message) {
const obj = {};
if (message.authority !== "") {
obj.authority = message.authority;
}
if (message.toAddress !== "") {
obj.toAddress = message.toAddress;
}
if (message.amount?.length) {
obj.amount = message.amount.map((e) => Coin.toJSON(e));
}
return obj;
},
create(base) {
return MsgMint.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgMint();
message.authority = object.authority ?? "";
message.toAddress = object.toAddress ?? "";
message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [];
return message;
},
};
function createBaseMsgMintResponse() {
return {};
}
export const MsgMintResponse = {
encode(_, writer = new BinaryWriter()) {
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgMintResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return {};
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return MsgMintResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseMsgMintResponse();
return message;
},
};
function createBaseMsgUpdateParams() {
return { authority: "", params: undefined };
}
export const MsgUpdateParams = {
encode(message, writer = new BinaryWriter()) {
if (message.authority !== "") {
writer.uint32(10).string(message.authority);
}
if (message.params !== undefined) {
FeeParams.encode(message.params, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgUpdateParams();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.authority = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.params = FeeParams.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
authority: isSet(object.authority) ? globalThis.String(object.authority) : "",
params: isSet(object.params) ? FeeParams.fromJSON(object.params) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.authority !== "") {
obj.authority = message.authority;
}
if (message.params !== undefined) {
obj.params = FeeParams.toJSON(message.params);
}
return obj;
},
create(base) {
return MsgUpdateParams.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgUpdateParams();
message.authority = object.authority ?? "";
message.params = (object.params !== undefined && object.params !== null)
? FeeParams.fromPartial(object.params)
: undefined;
return message;
},
};
function createBaseMsgUpdateParamsResponse() {
return {};
}
export const MsgUpdateParamsResponse = {
encode(_, writer = new BinaryWriter()) {
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgUpdateParamsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return {};
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return MsgUpdateParamsResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseMsgUpdateParamsResponse();
return message;
},
};
export const MsgServiceName = "cheqd.did.v2.Msg";
export class MsgClientImpl {
rpc;
service;
constructor(rpc, opts) {
this.service = opts?.service || MsgServiceName;
this.rpc = rpc;
this.CreateDidDoc = this.CreateDidDoc.bind(this);
this.UpdateDidDoc = this.UpdateDidDoc.bind(this);
this.DeactivateDidDoc = this.DeactivateDidDoc.bind(this);
this.Burn = this.Burn.bind(this);
this.Mint = this.Mint.bind(this);
this.UpdateParams = this.UpdateParams.bind(this);
}
CreateDidDoc(request) {
const data = MsgCreateDidDoc.encode(request).finish();
const promise = this.rpc.request(this.service, "CreateDidDoc", data);
return promise.then((data) => MsgCreateDidDocResponse.decode(new BinaryReader(data)));
}
UpdateDidDoc(request) {
const data = MsgUpdateDidDoc.encode(request).finish();
const promise = this.rpc.request(this.service, "UpdateDidDoc", data);
return promise.then((data) => MsgUpdateDidDocResponse.decode(new BinaryReader(data)));
}
DeactivateDidDoc(request) {
const data = MsgDeactivateDidDoc.encode(request).finish();
const promise = this.rpc.request(this.service, "DeactivateDidDoc", data);
return promise.then((data) => MsgDeactivateDidDocResponse.decode(new BinaryReader(data)));
}
Burn(request) {
const data = MsgBurn.encode(request).finish();
const promise = this.rpc.request(this.service, "Burn", data);
return promise.then((data) => MsgBurnResponse.decode(new BinaryReader(data)));
}
Mint(request) {
const data = MsgMint.encode(request).finish();
const promise = this.rpc.request(this.service, "Mint", data);
return promise.then((data) => MsgMintResponse.decode(new BinaryReader(data)));
}
UpdateParams(request) {
const data = MsgUpdateParams.encode(request).finish();
const promise = this.rpc.request(this.service, "UpdateParams", data);
return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data)));
}
}
fu