npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

connect-cosmos-wallet

v0.0.9

Published

Help connect cosmos blockchain.

Downloads

14

Readme

Connect Cosmos network by Metamask

  1. Create folder patches at root of project
  2. Add file @cosmjs+cosmwasm-stargate+0.32.2.patch
diff --git a/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.d.ts b/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.d.ts
index 1e8a930..8f781c8 100644
--- a/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.d.ts
+++ b/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.d.ts
@@ -88,10 +88,21 @@ export interface ExecuteResult {
   /** Block height in which the transaction is included */
   readonly height: number;
   /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */
+    /** The position of the transaction within the block. This is a 0-based index. */
+    readonly txIndex: number;
   readonly transactionHash: string;
   readonly events: readonly Event[];
   readonly gasWanted: bigint;
   readonly gasUsed: bigint;
+    /**
+    * The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140)
+    * as `Any`s.
+    * This field is an empty list for chains running Cosmos SDK < 0.46.
+    */
+    readonly msgResponses: Array<{
+        readonly typeUrl: string;
+        readonly value: Uint8Array;
+    }>;
}
export interface SigningCosmWasmClientOptions {
   readonly registry?: Registry;
diff --git a/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js b/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js
index 80e6bd5..ebc234f 100644
--- a/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js
+++ b/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js
@@ -262,6 +262,7 @@ class SigningCosmWasmClient extends cosmwasmclient_1.CosmWasmClient {
           throw new Error(createDeliverTxResponseErrorMessage(result));
       }
       return {
+            ...result,
           logs: stargate_1.logs.parseRawLog(result.rawLog),
           height: result.height,
           transactionHash: result.transactionHash,
@@ -383,7 +384,10 @@ class SigningCosmWasmClient extends cosmwasmclient_1.CosmWasmClient {
           throw new Error("Failed to retrieve account from signer");
       }
       const pubkey = (0, proto_signing_1.encodePubkey)((0, amino_1.encodeSecp256k1Pubkey)(accountFromSigner.pubkey));
-        const signMode = signing_1.SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
+        let signMode = signing_1.SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
+        if (this.signer.signEip191) {
+            signMode = signing_1.SignMode.SIGN_MODE_EIP_191;
+        }
       const msgs = messages.map((msg) => this.aminoTypes.toAmino(msg));
       const signDoc = (0, amino_1.makeSignDoc)(msgs, fee, chainId, memo, accountNumber, sequence, timeoutHeight);
       const { signature, signed } = await this.signer.signAmino(signerAddress, signDoc);
  1. Add file @cosmjs+proto-signing+0.31.3.patch
diff --git a/node_modules/@cosmjs/proto-signing/build/signer.d.ts b/node_modules/@cosmjs/proto-signing/build/signer.d.ts
index 71d6f72..74540ad 100644
--- a/node_modules/@cosmjs/proto-signing/build/signer.d.ts
+++ b/node_modules/@cosmjs/proto-signing/build/signer.d.ts
@@ -19,5 +19,24 @@ export interface OfflineDirectSigner {
     readonly getAccounts: () => Promise<readonly AccountData[]>;
     readonly signDirect: (signerAddress: string, signDoc: SignDoc) => Promise<DirectSignResponse>;
 }
-export type OfflineSigner = OfflineAminoSigner | OfflineDirectSigner;
+
+export interface OfflineEip191Signer {
+/**
+ +     * Get AccountData array from wallet. Rejects if not enabled.
+ +     */
+    readonly getAccounts: () => Promise<readonly AccountData[]>;
+/**
+ +     * Request signature from whichever key corresponds to provided bech32-encoded address. Rejects if not enabled.
+ +     *
+ +     * The signer implementation may offer the user the ability to override parts of the signDoc. It must
+ +     * return the doc that was signed in the response.
+ +     *
+ +     * @param signerAddress The address of the account that should sign the transaction
+ +     * @param signDoc The content that should be signed
+ +     */
+    readonly signEip191: (signerAddress: string, signDoc: StdSignDoc) => Promise<AminoSignResponse>;
+}
+
+export type OfflineSigner = OfflineAminoSigner | OfflineDirectSigner | OfflineEip191Signer;
+
 export declare function isOfflineDirectSigner(signer: OfflineSigner): signer is OfflineDirectSigner;
diff --git a/node_modules/@cosmjs/proto-signing/build/signer.js b/node_modules/@cosmjs/proto-signing/build/signer.js
index 5f3b8ee..a43572e 100644
--- a/node_modules/@cosmjs/proto-signing/build/signer.js
+++ b/node_modules/@cosmjs/proto-signing/build/signer.js
@@ -1,8 +1,13 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
 exports.isOfflineDirectSigner = void 0;
+exports.isOfflineEip191Signer = void 0;
 function isOfflineDirectSigner(signer) {
     return signer.signDirect !== undefined;
 }
+function isOfflineEip191Signer(signer) {
+    return signer.signEip191 !== undefined;
+}
 exports.isOfflineDirectSigner = isOfflineDirectSigner;
+exports.isOfflineEip191Signer = isOfflineEip191Signer;
 //# sourceMappingURL=signer.js.map
\ No newline at end of file
  1. Add command in scripts of package.json: "postinstall": "npx patch-package"
  "scripts": {
    ...
    "postinstall": "npx patch-package"
  },