Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wallet01/cosmos

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wallet01/cosmos - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

dist/chunk-3TMGHRIN.js

8

CHANGELOG.md
# @wallet01/cosmos
## 0.5.5
### Patch Changes
- bundle packages using tsup
- Updated dependencies
- @wallet01/core@0.5.5
## 0.5.4

@@ -4,0 +12,0 @@

97

dist/connectors/keplr.js

@@ -1,90 +0,7 @@

import { BaseConnector, setLastUsedConnector } from "@wallet01/core";
import emitter from "../utils/emiter";
export class KeplrConnector extends BaseConnector {
provider;
constructor(chain = "secret-4") {
super(chain, "keplr");
}
async getProvider() {
if (typeof window !== "undefined" && window.keplr) {
this.provider = window.keplr;
return this.provider;
}
else {
throw new Error("Wallet Not Installed!");
}
}
async getAccount() {
if (!this.provider)
throw new Error("Provider undefined");
try {
await this.provider.enable(this.chain);
const { bech32Address } = await this.provider.getKey(this.chain);
return [bech32Address];
}
catch (error) {
console.error(error);
throw new Error("Error in getting accounts");
}
}
async getChainId() {
return this.chain;
}
async switchChain(chainId) {
if (!this.provider)
throw new Error("Provider undefined");
try {
await this.provider.enable(chainId);
this.chain = chainId;
}
catch (err) {
console.error(err);
throw err;
}
}
async connect({ chainId = "secret-4" }) {
try {
const provider = await this.getProvider();
if (!provider)
throw new Error("Keplr not installed");
await this.provider.enable(chainId);
setLastUsedConnector(this.name);
}
catch (error) {
console.error(error);
throw error;
}
}
async disconnect() {
this.chain = "";
emitter.emit("disconnected");
}
async resolveDid(_address) {
console.error("Cosmos Ecosystem doesn't support DIDs as of now");
return null;
}
async signMessage(message) {
if (!this.provider)
throw new Error("Provider Undefined");
try {
const address = (await this.getAccount())[0];
if (!address)
throw new Error("No address found");
const { signature } = await this.provider.signArbitrary(this.chain, address, message);
return signature;
}
catch (error) {
console.warn(error);
throw error;
}
}
onAccountsChanged() {
console.log("Account Changed");
}
onChainChanged(_chain) {
console.log("Chain Changed");
}
onDisconnect() {
console.log("Wallet disconnected");
}
}
import {
KeplrConnector
} from "../chunk-6U2GXV7V.js";
import "../chunk-3TMGHRIN.js";
export {
KeplrConnector
};

@@ -1,2 +0,7 @@

import { KeplrConnector } from "./connectors/keplr";
export { KeplrConnector };
import {
KeplrConnector
} from "./chunk-6U2GXV7V.js";
import "./chunk-3TMGHRIN.js";
export {
KeplrConnector
};

@@ -1,1 +0,2 @@

export {};
// src/providers/keplrProvider.ts
import {} from "@keplr-wallet/types";

@@ -1,10 +0,6 @@

import EventEmitter from 'eventemitter3';
const eventEmitter = new EventEmitter();
const emitter = {
on: (event, fn) => eventEmitter.on(event, fn),
once: (event, fn) => eventEmitter.once(event, fn),
off: (event, fn) => eventEmitter.off(event, fn),
emit: (event, payload) => eventEmitter.emit(event, payload),
import {
emiter_default
} from "../chunk-3TMGHRIN.js";
export {
emiter_default as default
};
Object.freeze(emitter);
export default emitter;
{
"name": "@wallet01/cosmos",
"version": "0.5.4",
"main": "dist/index.js",
"version": "0.5.5",
"main": "dist/index.cjs",
"types": "dist/index.d.ts",

@@ -12,6 +12,7 @@ "import": "dist/index.js",

"eventemitter3": "^4.0.7",
"@wallet01/core": "0.5.4"
"@wallet01/core": "0.5.5"
},
"devDependencies": {
"rimraf": "^3.0.2",
"tsup": "^6.5.0",
"typescript": "^4.9.4",

@@ -25,5 +26,5 @@ "tsconfig": "0.0.0"

"clean": "rimraf dist/",
"build": "pnpm clean && tsc",
"build": "tsup && tsc --emitDeclarationOnly --declaration",
"dev": "pnpm build --watch"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc