import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
import { Registry } from "@cosmjs/proto-signing";
import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate";
import * as marsIncentivesV1beta1TxRegistry from "./incentives/v1beta1/tx.registry";
import * as marsSafetyV1beta1TxRegistry from "./safety/v1beta1/tx.registry";
import * as marsIncentivesV1beta1TxAmino from "./incentives/v1beta1/tx.amino";
import * as marsSafetyV1beta1TxAmino from "./safety/v1beta1/tx.amino";
export const marsAminoConverters = _objectSpread(_objectSpread({}, marsIncentivesV1beta1TxAmino.AminoConverter), marsSafetyV1beta1TxAmino.AminoConverter);
export const marsProtoRegistry = [...marsIncentivesV1beta1TxRegistry.registry, ...marsSafetyV1beta1TxRegistry.registry];
export const getSigningMarsClientOptions = ({
  defaultTypes = defaultRegistryTypes
} = {}) => {
  const registry = new Registry([...defaultTypes, ...marsProtoRegistry]);
  const aminoTypes = new AminoTypes(_objectSpread({}, marsAminoConverters));
  return {
    registry,
    aminoTypes
  };
};
export const getSigningMarsClient = async ({
  rpcEndpoint,
  signer,
  defaultTypes = defaultRegistryTypes
}) => {
  const {
    registry,
    aminoTypes
  } = getSigningMarsClientOptions({
    defaultTypes
  });
  const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, {
    registry,
    aminoTypes
  });
  return client;
};