@keplr-ewallet/ewallet-sdk-cosmos
Version:
17 lines (14 loc) • 529 B
text/typescript
import type { KeplrSignOptions } from "@keplr-wallet/types";
import type { OfflineDirectSigner } from "@cosmjs/proto-signing";
import type { CosmosEWalletInterface } from "@keplr-ewallet-sdk-cosmos/types";
export function getOfflineSigner(
this: CosmosEWalletInterface,
chainId: string,
signOptions?: KeplrSignOptions,
): OfflineDirectSigner {
return {
getAccounts: this.getAccounts.bind(this),
signDirect: (signerAddress, signDoc) =>
this.signDirect(chainId, signerAddress, signDoc, signOptions),
};
}