UNPKG

@keplr-ewallet/ewallet-sdk-cosmos

Version:
18 lines (15 loc) 633 B
import type { KeplrSignOptions } from "@keplr-wallet/types"; import type { OfflineDirectSigner } from "@cosmjs/proto-signing"; import type { OfflineAminoSigner } from "@cosmjs/amino"; import { type CosmosEWallet } from "@keplr-ewallet-sdk-cosmos/cosmos_ewallet"; export async function getOfflineSignerAuto( this: CosmosEWallet, chainId: string, signOptions?: KeplrSignOptions, ): Promise<OfflineDirectSigner | OfflineAminoSigner> { const key = await this.getKey(chainId); if (key.isNanoLedger) { return this.getOfflineSignerOnlyAmino(chainId, signOptions); } return this.getOfflineSigner(chainId, signOptions); }