Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added interchainjs deps #683

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers";
import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing";
import { Pubkey } from "@cosmjs/amino";
import { Pubkey } from "@interchainjs/Pubkey";
/** BondStatus is the status of a validator. */
export enum BondStatus {
/** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Timestamp } from "../../../google/protobuf/timestamp";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers";
import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing";
import { Pubkey } from "@cosmjs/amino";
import { Pubkey } from "@interchainjs/Pubkey";
/** MsgCreateValidator defines a SDK message for creating a new validator. */
export interface MsgCreateValidator {
description: Description;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/* eslint-disable */
import { Attribute, AttributeSDKType } from "../../base/v1beta1/attribute.js";
import { ReadOnlyAminoMsg as AminoMsg } from "@interchainjs/ReadOnlyAminoMsg";
import { MsgSignProviderAttributes, MsgSignProviderAttributesSDKType, MsgDeleteProviderAttributes, MsgDeleteProviderAttributesSDKType } from "./audit.js";
export interface MsgSignProviderAttributesAminoType extends AminoMsg {
type: "akash/audit/testonly-sign-provider-attributes";
value: {
owner: string;
auditor: string;
attributes: {
key: string;
value: string;
}[];
};
}
export interface MsgDeleteProviderAttributesAminoType extends AminoMsg {
type: "akash/audit/testonly-delete-provider-attributes";
value: {
owner: string;
auditor: string;
keys: string[];
};
}
export const AminoConverter = {
"/akash.audit.v1beta1.MsgSignProviderAttributes": {
aminoType: "akash/audit/testonly-sign-provider-attributes",
toAmino: ({
owner,
auditor,
attributes
}: MsgSignProviderAttributes): MsgSignProviderAttributesAminoType["value"] => {
return {
owner,
auditor,
attributes: attributes.map(el0 => ({
key: el0.key,
value: el0.value
}))
};
},
fromAmino: ({
owner,
auditor,
attributes
}: MsgSignProviderAttributesAminoType["value"]): MsgSignProviderAttributes => {
return {
owner,
auditor,
attributes: attributes.map(el0 => ({
key: el0.key,
value: el0.value
}))
};
}
},
"/akash.audit.v1beta1.MsgDeleteProviderAttributes": {
aminoType: "akash/audit/testonly-delete-provider-attributes",
toAmino: ({
owner,
auditor,
keys
}: MsgDeleteProviderAttributes): MsgDeleteProviderAttributesAminoType["value"] => {
return {
owner,
auditor,
keys
};
},
fromAmino: ({
owner,
auditor,
keys
}: MsgDeleteProviderAttributesAminoType["value"]): MsgDeleteProviderAttributes => {
return {
owner,
auditor,
keys
};
}
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { Attribute, AttributeSDKType } from "../../base/v1beta1/attribute.js";
import { GeneratedType, Registry } from "@cosmjs/proto-signing";
import { MsgSignProviderAttributes, MsgSignProviderAttributesSDKType, MsgDeleteProviderAttributes, MsgDeleteProviderAttributesSDKType } from "./audit.js";
export const registry: ReadonlyArray<[string, GeneratedType]> = [["/akash.audit.v1beta1.MsgSignProviderAttributes", MsgSignProviderAttributes], ["/akash.audit.v1beta1.MsgDeleteProviderAttributes", MsgDeleteProviderAttributes]];
export const load = (protoRegistry: Registry) => {
registry.forEach(([typeUrl, mod]) => {
protoRegistry.register(typeUrl, mod);
});
};
export const MessageComposer = {
encoded: {
signProviderAttributes(value: MsgSignProviderAttributes) {
return {
typeUrl: "/akash.audit.v1beta1.MsgSignProviderAttributes",
value: MsgSignProviderAttributes.encode(value).finish()
};
},
deleteProviderAttributes(value: MsgDeleteProviderAttributes) {
return {
typeUrl: "/akash.audit.v1beta1.MsgDeleteProviderAttributes",
value: MsgDeleteProviderAttributes.encode(value).finish()
};
}
},
withTypeUrl: {
signProviderAttributes(value: MsgSignProviderAttributes) {
return {
typeUrl: "/akash.audit.v1beta1.MsgSignProviderAttributes",
value
};
},
deleteProviderAttributes(value: MsgDeleteProviderAttributes) {
return {
typeUrl: "/akash.audit.v1beta1.MsgDeleteProviderAttributes",
value
};
}
},
toJSON: {
signProviderAttributes(value: MsgSignProviderAttributes) {
return {
typeUrl: "/akash.audit.v1beta1.MsgSignProviderAttributes",
value: MsgSignProviderAttributes.toJSON(value)
};
},
deleteProviderAttributes(value: MsgDeleteProviderAttributes) {
return {
typeUrl: "/akash.audit.v1beta1.MsgDeleteProviderAttributes",
value: MsgDeleteProviderAttributes.toJSON(value)
};
}
},
fromJSON: {
signProviderAttributes(value: any) {
return {
typeUrl: "/akash.audit.v1beta1.MsgSignProviderAttributes",
value: MsgSignProviderAttributes.fromJSON(value)
};
},
deleteProviderAttributes(value: any) {
return {
typeUrl: "/akash.audit.v1beta1.MsgDeleteProviderAttributes",
value: MsgDeleteProviderAttributes.fromJSON(value)
};
}
},
fromPartial: {
signProviderAttributes(value: MsgSignProviderAttributes) {
return {
typeUrl: "/akash.audit.v1beta1.MsgSignProviderAttributes",
value: MsgSignProviderAttributes.fromPartial(value)
};
},
deleteProviderAttributes(value: MsgDeleteProviderAttributes) {
return {
typeUrl: "/akash.audit.v1beta1.MsgDeleteProviderAttributes",
value: MsgDeleteProviderAttributes.fromPartial(value)
};
}
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { buildTx, SigningClientResolver } from "../../../helper-func-types";
import { buildUseMutation } from "../../../react-query";
import { toEncoders, toConverters } from "@interchainjs/cosmos/utils";
import { MsgSignProviderAttributes, MsgDeleteProviderAttributes } from "./audit";
export const createSignProviderAttributes = (getSigningClient: SigningClientResolver) => buildTx<MsgSignProviderAttributes>({
getSigningClient: getSigningClient,
typeUrl: MsgSignProviderAttributes.typeUrl,
encoders: toEncoders(MsgSignProviderAttributes),
converters: toConverters(MsgSignProviderAttributes)
});
export const useSignProviderAttributes = buildUseMutation<MsgSignProviderAttributes, Error>({
builderMutationFn: createSignProviderAttributes
});
export const createDeleteProviderAttributes = (getSigningClient: SigningClientResolver) => buildTx<MsgDeleteProviderAttributes>({
getSigningClient: getSigningClient,
typeUrl: MsgDeleteProviderAttributes.typeUrl,
encoders: toEncoders(MsgDeleteProviderAttributes),
converters: toConverters(MsgDeleteProviderAttributes)
});
export const useDeleteProviderAttributes = buildUseMutation<MsgDeleteProviderAttributes, Error>({
builderMutationFn: createDeleteProviderAttributes
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Attribute, AttributeSDKType } from "../../base/v1beta1/attribute.js";
import { Rpc } from "../../../helpers.js";
import { BinaryReader } from "../../../binary.js";
import { MsgSignProviderAttributes, MsgSignProviderAttributesSDKType, MsgSignProviderAttributesResponse, MsgSignProviderAttributesResponseSDKType, MsgDeleteProviderAttributes, MsgDeleteProviderAttributesSDKType, MsgDeleteProviderAttributesResponse, MsgDeleteProviderAttributesResponseSDKType } from "./audit.js";
/** Msg defines the provider Msg service */
export interface Msg {
/** SignProviderAttributes defines a method that signs provider attributes */
signProviderAttributes(request: MsgSignProviderAttributes): Promise<MsgSignProviderAttributesResponse>;
/** DeleteProviderAttributes defines a method that deletes provider attributes */
deleteProviderAttributes(request: MsgDeleteProviderAttributes): Promise<MsgDeleteProviderAttributesResponse>;
}
export class MsgClientImpl implements Msg {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
}
/* SignProviderAttributes defines a method that signs provider attributes */
signProviderAttributes = async (request: MsgSignProviderAttributes): Promise<MsgSignProviderAttributesResponse> => {
const data = MsgSignProviderAttributes.encode(request).finish();
const promise = this.rpc.request("akash.audit.v1beta1.Msg", "SignProviderAttributes", data);
return promise.then(data => MsgSignProviderAttributesResponse.decode(new BinaryReader(data)));
};
/* DeleteProviderAttributes defines a method that deletes provider attributes */
deleteProviderAttributes = async (request: MsgDeleteProviderAttributes): Promise<MsgDeleteProviderAttributesResponse> => {
const data = MsgDeleteProviderAttributes.encode(request).finish();
const promise = this.rpc.request("akash.audit.v1beta1.Msg", "DeleteProviderAttributes", data);
return promise.then(data => MsgDeleteProviderAttributesResponse.decode(new BinaryReader(data)));
};
}
export const createClientImpl = (rpc: Rpc) => {
return new MsgClientImpl(rpc);
};
Loading
Loading