-
Notifications
You must be signed in to change notification settings - Fork 43
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
[epic] front-end clients #95
Comments
|
Msg for mutations/** Msg defines the bank Msg service. */
export interface Msg {
/** Send defines a method for sending coins from one account to another account. */
Send(request: MsgSend): Promise<MsgSendResponse>;
/** MultiSend defines a method for sending coins from some accounts to other accounts. */
MultiSend(request: MsgMultiSend): Promise<MsgMultiSendResponse>;
}
export class MsgClientImpl implements Msg {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
this.Send = this.Send.bind(this);
this.MultiSend = this.MultiSend.bind(this);
}
Send(request: MsgSend): Promise<MsgSendResponse> {
const data = MsgSend.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "Send", data);
return promise.then((data) => MsgSendResponse.decode(new _m0.Reader(data)));
}
MultiSend(request: MsgMultiSend): Promise<MsgMultiSendResponse> {
const data = MsgMultiSend.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data);
return promise.then((data) => MsgMultiSendResponse.decode(new _m0.Reader(data)));
}
}
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
} |
Query for queries/** Query defines the gRPC querier service. */
export interface Query {
/**
* Accounts returns all the existing accounts
*
* Since: cosmos-sdk 0.43
*/
Accounts(request: QueryAccountsRequest): Promise<QueryAccountsResponse>;
/** Account returns account details based on address. */
Account(request: QueryAccountRequest): Promise<QueryAccountResponse>;
/** Params queries all parameters. */
Params(request: QueryParamsRequest): Promise<QueryParamsResponse>;
}
export class QueryClientImpl implements Query {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
this.Accounts = this.Accounts.bind(this);
this.Account = this.Account.bind(this);
this.Params = this.Params.bind(this);
}
Accounts(request: QueryAccountsRequest): Promise<QueryAccountsResponse> {
const data = QueryAccountsRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Accounts", data);
return promise.then((data) => QueryAccountsResponse.decode(new _m0.Reader(data)));
}
Account(request: QueryAccountRequest): Promise<QueryAccountResponse> {
const data = QueryAccountRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data);
return promise.then((data) => QueryAccountResponse.decode(new _m0.Reader(data)));
}
Params(request: QueryParamsRequest): Promise<QueryParamsResponse> {
const data = QueryParamsRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data);
return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data)));
}
}
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: