Basic API
Note: Please create cosmos wallet before using this function
How to detect Coin98
window.onload = async () => {
if (!window.keplr) {
alert("Please install keplr extension");
} else {
const chainId = "osmosis-1";
// Enabling before using the Coin98 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, Coin98 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();
// Initialize the gaia api with the offline signer that is injected by Coin98 extension.
const cosmJS = new SigningCosmosClient(
"https://lcd-cosmoshub.keplr.app",
accounts[0].address,
offlineSigner,
);
}
}
Coin98-specific features
Using with Typescript
Enable Connection
Get Address / Public Key
Sign Amino
Sign Direct / Protobuf
Request Transaction Broadcasting
Request Signature for Arbitrary Message
Interaction Options
Custom event
Change Key Store Event
Last updated