@xlabs-libs/wallet-aggregator-injective
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-alpha.17 • Public • Published

Wallet Aggregator - Injective

Implements the base abstractions for the Injective blockchain.

Usage

Under the hood the wallet relies on the WalletSelector class provided by the @injectivelabs/wallet-ts package, which acts as a façade with multiple strategies behind it, one for each method of connecting. So, while the generic class is InjectiveWallet, we inject the type of wallet we want to connect to through a constructor parameter.

For now, the only supported types are Keplr and Cosmostation.

import { ChainId as InjectiveChainId } from "@injectivelabs/ts-types";
import { getNetworkInfo, Network } from "@injectivelabs/networks";
import { InjectiveWallet } from "@xlabs-libs/wallet-aggregator-injective";

const network = InjectiveChainId.Mainnet;
const networkInfo = getNetworkInfo(Network.MainnetK8s);

const opts = {
  networkChainId: network,
  broadcasterOptions: {
    network,
    endpoints: {
      indexerApi: networkInfo.indexerApi,
      sentryGrpcApi: networkInfo.sentryGrpcApi,
      sentryHttpApi: networkInfo.sentryHttpApi,
    },
  },
};

const keplr = new InjectiveWallet({
  ...opts,
  type: InjectiveWalletType.Keplr,
});
const cosmostation = new InjectiveWallet({
  ...opts,
  type: InjectiveWalletType.Cosmostation,
});

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.1-alpha.172latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.1-alpha.172
0.0.1-alpha.161
0.0.1-alpha.1527
0.0.1-alpha.141
0.0.1-alpha.131
0.0.1-alpha.121
0.0.1-alpha.111
0.0.1-alpha.101
0.0.1-alpha.91
0.0.1-alpha.81
0.0.1-alpha.71
0.0.1-alpha.61
0.0.1-alpha.51
0.0.1-alpha.42

Package Sidebar

Install

npm i @xlabs-libs/wallet-aggregator-injective

Weekly Downloads

42

Version

0.0.1-alpha.17

License

MIT

Unpacked Size

89.5 kB

Total Files

58

Last publish

Collaborators

  • sebastianscatularo
  • yuliferna
  • mpicco
  • mpicco-randlabs