Skip to main content
Glama
genesis.js9.04 kB
//@ts-nocheck import { AccountAuthenticator } from "./models"; import { Params } from "./params"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { GlobalDecoderRegistry } from "../../../registry"; function createBaseAuthenticatorData() { return { address: "", authenticators: [] }; } export const AuthenticatorData = { typeUrl: "/osmosis.smartaccount.v1beta1.AuthenticatorData", aminoType: "osmosis/smartaccount/authenticator-data", is(o) { return o && (o.$typeUrl === AuthenticatorData.typeUrl || typeof o.address === "string" && Array.isArray(o.authenticators) && (!o.authenticators.length || AccountAuthenticator.is(o.authenticators[0]))); }, isSDK(o) { return o && (o.$typeUrl === AuthenticatorData.typeUrl || typeof o.address === "string" && Array.isArray(o.authenticators) && (!o.authenticators.length || AccountAuthenticator.isSDK(o.authenticators[0]))); }, isAmino(o) { return o && (o.$typeUrl === AuthenticatorData.typeUrl || typeof o.address === "string" && Array.isArray(o.authenticators) && (!o.authenticators.length || AccountAuthenticator.isAmino(o.authenticators[0]))); }, encode(message, writer = BinaryWriter.create()) { if (message.address !== "") { writer.uint32(10).string(message.address); } for (const v of message.authenticators) { AccountAuthenticator.encode(v, writer.uint32(18).fork()).ldelim(); } 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 = createBaseAuthenticatorData(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.address = reader.string(); break; case 2: message.authenticators.push(AccountAuthenticator.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseAuthenticatorData(); message.address = object.address ?? ""; message.authenticators = object.authenticators?.map(e => AccountAuthenticator.fromPartial(e)) || []; return message; }, fromAmino(object) { const message = createBaseAuthenticatorData(); if (object.address !== undefined && object.address !== null) { message.address = object.address; } message.authenticators = object.authenticators?.map(e => AccountAuthenticator.fromAmino(e)) || []; return message; }, toAmino(message) { const obj = {}; obj.address = message.address === "" ? undefined : message.address; if (message.authenticators) { obj.authenticators = message.authenticators.map(e => e ? AccountAuthenticator.toAmino(e) : undefined); } else { obj.authenticators = message.authenticators; } return obj; }, fromAminoMsg(object) { return AuthenticatorData.fromAmino(object.value); }, toAminoMsg(message) { return { type: "osmosis/smartaccount/authenticator-data", value: AuthenticatorData.toAmino(message) }; }, fromProtoMsg(message) { return AuthenticatorData.decode(message.value); }, toProto(message) { return AuthenticatorData.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/osmosis.smartaccount.v1beta1.AuthenticatorData", value: AuthenticatorData.encode(message).finish() }; } }; GlobalDecoderRegistry.register(AuthenticatorData.typeUrl, AuthenticatorData); GlobalDecoderRegistry.registerAminoProtoMapping(AuthenticatorData.aminoType, AuthenticatorData.typeUrl); function createBaseGenesisState() { return { params: Params.fromPartial({}), nextAuthenticatorId: BigInt(0), authenticatorData: [] }; } export const GenesisState = { typeUrl: "/osmosis.smartaccount.v1beta1.GenesisState", aminoType: "osmosis/smartaccount/genesis-state", is(o) { return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && typeof o.nextAuthenticatorId === "bigint" && Array.isArray(o.authenticatorData) && (!o.authenticatorData.length || AuthenticatorData.is(o.authenticatorData[0]))); }, isSDK(o) { return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && typeof o.next_authenticator_id === "bigint" && Array.isArray(o.authenticator_data) && (!o.authenticator_data.length || AuthenticatorData.isSDK(o.authenticator_data[0]))); }, isAmino(o) { return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && typeof o.next_authenticator_id === "bigint" && Array.isArray(o.authenticator_data) && (!o.authenticator_data.length || AuthenticatorData.isAmino(o.authenticator_data[0]))); }, encode(message, writer = BinaryWriter.create()) { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } if (message.nextAuthenticatorId !== BigInt(0)) { writer.uint32(16).uint64(message.nextAuthenticatorId); } for (const v of message.authenticatorData) { AuthenticatorData.encode(v, writer.uint32(26).fork()).ldelim(); } 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 = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.params = Params.decode(reader, reader.uint32()); break; case 2: message.nextAuthenticatorId = reader.uint64(); break; case 3: message.authenticatorData.push(AuthenticatorData.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; message.nextAuthenticatorId = object.nextAuthenticatorId !== undefined && object.nextAuthenticatorId !== null ? BigInt(object.nextAuthenticatorId.toString()) : BigInt(0); message.authenticatorData = object.authenticatorData?.map(e => AuthenticatorData.fromPartial(e)) || []; return message; }, fromAmino(object) { const message = createBaseGenesisState(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromAmino(object.params); } if (object.next_authenticator_id !== undefined && object.next_authenticator_id !== null) { message.nextAuthenticatorId = BigInt(object.next_authenticator_id); } message.authenticatorData = object.authenticator_data?.map(e => AuthenticatorData.fromAmino(e)) || []; return message; }, toAmino(message) { const obj = {}; obj.params = message.params ? Params.toAmino(message.params) : undefined; obj.next_authenticator_id = message.nextAuthenticatorId !== BigInt(0) ? message.nextAuthenticatorId.toString() : undefined; if (message.authenticatorData) { obj.authenticator_data = message.authenticatorData.map(e => e ? AuthenticatorData.toAmino(e) : undefined); } else { obj.authenticator_data = message.authenticatorData; } return obj; }, fromAminoMsg(object) { return GenesisState.fromAmino(object.value); }, toAminoMsg(message) { return { type: "osmosis/smartaccount/genesis-state", value: GenesisState.toAmino(message) }; }, fromProtoMsg(message) { return GenesisState.decode(message.value); }, toProto(message) { return GenesisState.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/osmosis.smartaccount.v1beta1.GenesisState", value: GenesisState.encode(message).finish() }; } }; GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MyronKoch-dev/osmosis-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server