- Add Network to Keplr
- Aura Devnet:
Use this jsfiddle to add the
aura-testnet
chain to your Keplr browser extension.
- Detech Keplr
if (!window.keplr) {
alert("Please install keplr extension");
} else {
const chainId = "aura-testnet";
// Enabling before using the Keplr is recommended.
// This method will ask the user whether to allow access if they haven't visited this website.
// Also, it will request that the user unlock the wallet if the wallet is locked.
await window.keplr.enable(chainId);
const offlineSigner = window.keplr.getOfflineSigner(chainId);
// You can get the address/public keys by `getAccounts` method.
// It can return the array of address/public key.
// But, currently, Keplr extension manages only one address/public key pair.
// XXX: This line is needed to set the sender address for SigningCosmosClient.
const accounts = await offlineSigner.getAccounts();
console.log(accounts)
}
- Unlock Keplr
window.keplr.enable(chainId);
- Get current address / Public key
await offlineSigner.getAccounts();
//or
await offlineSigner.getAccounts(chainid);
- Sign transaction
- Require: @cosmjs/stargate
npm install @cosmjs/stargate
- Use SigningStargateClient
const chainId = "aura-testnet";
await window.keplr.enable(chainId);
const offlineSigner = window.getOfflineSigner(chainId);
const client = await SigningStargateClient.connectWithSigner(tendermintUrl, offlineSigner);
const tx = {
chainId: "aura-testnet",
// accountNumber: "0",
// sequence: "0",
// fee: {
// amount: [{
// amount: "0",
// denom: "uatom",
// }],
// gas: "200000",
// },
msgs: [
{
type: "cosmos-sdk/MsgSend",
value: {
from_address: sender.address,
to_address: "auraxxxxxxxxxxxxxxxxxxx",
amount: [{
amount: "1",
denom: "uaura",
}],
},
},
],
memo: "",
};
// sign transaction
const signedTx = await client.sign(tx);
console.log(signedTx);
// broadcast transaction
const res = await client.broadcast(signedTx);
console.log(res);
Reference: https://docs.keplr.app/api/
- Vega Testnet (ATOM)
Deprecated since March 2022 in favor of v7-Theta Testnet
Use this jsfiddle to add the vega-testnet
chain to your Keplr browser extension.
-
Theta Testnet (ATOM)
Use this jsfiddle to add thetheta-testnet-001
chain to your Keplr browser extension. -
Juno Testnet (JUNO)
Access JunoTools website: https://test.juno.tools/ Click on Connect Wallet and approve request add chain.
Approve request connect network.
-
Osmosis Testnet (OSMO)
Use this jsfiddle to add theosmo-test-4
chain to your Keplr browser extension.