diff --git a/common/sdk/src/sdk.ts b/common/sdk/src/sdk.ts index 586f33d3..6cfb2aeb 100644 --- a/common/sdk/src/sdk.ts +++ b/common/sdk/src/sdk.ts @@ -1,4 +1,5 @@ import { + OfflineAminoSigner, pubkeyToAddress, Secp256k1HdWallet, Secp256k1Wallet, @@ -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"; @@ -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 + */ + async fromOfflineSigner( + offlineSigner: OfflineDirectSigner | OfflineAminoSigner, + offlineAminoSigner: OfflineAminoSigner, + walletName?: string + ): Promise { + return getSigningKyveClient( + this.config, + offlineSigner, + offlineAminoSigner, + walletName + ); + } + /** * Create a client from Keplr wallet if installed * @return Promise