import { BinaryReader } from "../../../binary";
import { MsgAddAuthenticator, MsgAddAuthenticatorResponse, MsgRemoveAuthenticator, MsgRemoveAuthenticatorResponse, MsgSetActiveState, MsgSetActiveStateResponse } from "./tx";
export class MsgClientImpl {
rpc;
constructor(rpc) {
this.rpc = rpc;
this.addAuthenticator = this.addAuthenticator.bind(this);
this.removeAuthenticator = this.removeAuthenticator.bind(this);
this.setActiveState = this.setActiveState.bind(this);
}
addAuthenticator(request) {
const data = MsgAddAuthenticator.encode(request).finish();
const promise = this.rpc.request("osmosis.smartaccount.v1beta1.Msg", "AddAuthenticator", data);
return promise.then(data => MsgAddAuthenticatorResponse.decode(new BinaryReader(data)));
}
removeAuthenticator(request) {
const data = MsgRemoveAuthenticator.encode(request).finish();
const promise = this.rpc.request("osmosis.smartaccount.v1beta1.Msg", "RemoveAuthenticator", data);
return promise.then(data => MsgRemoveAuthenticatorResponse.decode(new BinaryReader(data)));
}
setActiveState(request) {
const data = MsgSetActiveState.encode(request).finish();
const promise = this.rpc.request("osmosis.smartaccount.v1beta1.Msg", "SetActiveState", data);
return promise.then(data => MsgSetActiveStateResponse.decode(new BinaryReader(data)));
}
}
export const createClientImpl = (rpc) => {
return new MsgClientImpl(rpc);
};