Skip to main content

CosmJS

CosmJS

Similarly, @turnkey/cosmjs exports a TurnkeyDirectWallet that serves as a drop-in replacement for a CosmJS direct wallet. It includes support for signDirect. See full implementation here for more details and examples.

// Initialize a Turnkey Signer
const turnkeySigner = await TurnkeyDirectWallet.init({
config: {
...
},
prefix: "celestia", // can be replaced with other Cosmos chains
});

const account = refineNonNull((await turnkeySigner.getAccounts())[0]);
const compressedPublicKey = toHex(account.pubkey);
const selfAddress = account.address;
Ask AI