Skip to content

Commit

Permalink
chore: added offline signer client (#118)
Browse files Browse the repository at this point in the history
* chore: added offline signer client
* chore: removed unused import
  • Loading branch information
troykessler committed Jan 26, 2024
1 parent 2d346e1 commit 62da504
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions common/sdk/src/sdk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
OfflineAminoSigner,
pubkeyToAddress,
Secp256k1HdWallet,
Secp256k1Wallet,
Expand All @@ -7,6 +8,7 @@ import { fromBase64, fromHex } from "@cosmjs/encoding";
import {
DirectSecp256k1HdWallet,
DirectSecp256k1Wallet,
OfflineDirectSigner,
} from "@cosmjs/proto-signing";
import { RequestAccountResponse } from "@cosmostation/extension-client/types/message";
import { verifyADR36Amino } from "@keplr-wallet/cosmos";
Expand Down Expand Up @@ -120,6 +122,26 @@ export class KyveSDK {
return getSigningKyveClient(this.config, signedClient, aminoSigner);
}

/**
* create a client from offline signers
* @param offlineSigner - offline signer
* @param offlineAminoSigner - offline amino signer
* @param walletName - optinal wallet name
* @return Promise<KyveClient>
*/
async fromOfflineSigner(
offlineSigner: OfflineDirectSigner | OfflineAminoSigner,
offlineAminoSigner: OfflineAminoSigner,
walletName?: string
): Promise<KyveClient> {
return getSigningKyveClient(
this.config,
offlineSigner,
offlineAminoSigner,
walletName
);
}

/**
* Create a client from Keplr wallet if installed
* @return Promise<KyveWebClient>
Expand Down

0 comments on commit 62da504

Please sign in to comment.