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

cosmos-wallet

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cosmos-wallet - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

11

dist/cjs/helpers/utils.d.ts

@@ -0,1 +1,3 @@

import { Coin } from '@cosmjs/amino';
import { AccountData } from '@cosmjs/proto-signing';
export declare function getCosmosAddressPrefix(chainId?: string): string;

@@ -5,2 +7,11 @@ export declare function getCosmosAddress(publicKey: Uint8Array, chainId?: string): string;

export declare function getPublicKey(privkey: Uint8Array): Promise<Uint8Array>;
export declare function stringifySignDocValues(signDoc: any): any;
export declare function parseSignDocValues(signDoc: any): any;
export declare function formatDirectSignDoc(fee: Coin[], pubkey: string, gasLimit: number, accountNumber: number, sequence: number, bodyBytes: string, chainId: string): import("@cosmjs/proto-signing/build/codec/cosmos/tx/v1beta1/tx").SignDoc;
export declare function stringifyAccountDataValues(account: AccountData): {
pubkey: string;
address: string;
algo: import("@cosmjs/proto-signing").Algo;
};
export declare function parseAccountDataValues(account: any): any;
//# sourceMappingURL=utils.d.ts.map

34

dist/cjs/helpers/utils.js

@@ -11,6 +11,11 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const long_1 = __importDefault(require("long"));
const crypto_1 = require("@cosmjs/crypto");
const amino_1 = require("@cosmjs/amino");
const encoding_1 = require("@cosmjs/encoding");
const amino_1 = require("@cosmjs/amino");
const proto_signing_1 = require("@cosmjs/proto-signing");
const constants_1 = require("../constants");

@@ -41,6 +46,3 @@ function getCosmosAddressPrefix(chainId) {

function getAddressFromPublicKey(publicKey, prefix = 'cosmos') {
const pubKey = {
type: amino_1.pubkeyType.secp256k1,
value: encoding_1.toBase64(publicKey),
};
const pubKey = { type: amino_1.pubkeyType.secp256k1, value: encoding_1.toBase64(publicKey) };
return amino_1.pubkeyToAddress(pubKey, prefix);

@@ -56,2 +58,24 @@ }

exports.getPublicKey = getPublicKey;
function stringifySignDocValues(signDoc) {
return Object.assign(Object.assign({}, signDoc), { bodyBytes: encoding_1.toHex(signDoc.bodyBytes), authInfoBytes: encoding_1.toHex(signDoc.authInfoBytes), accountNumber: signDoc.accountNumber.toString(16) });
}
exports.stringifySignDocValues = stringifySignDocValues;
function parseSignDocValues(signDoc) {
return Object.assign(Object.assign({}, signDoc), { bodyBytes: encoding_1.fromHex(signDoc.bodyBytes), authInfoBytes: encoding_1.fromHex(signDoc.authInfoBytes), accountNumber: new long_1.default(signDoc.accountNumber) });
}
exports.parseSignDocValues = parseSignDocValues;
function formatDirectSignDoc(fee, pubkey, gasLimit, accountNumber, sequence, bodyBytes, chainId) {
const authInfoBytes = proto_signing_1.makeAuthInfoBytes([pubkey], fee, gasLimit, sequence);
const signDoc = proto_signing_1.makeSignDoc(encoding_1.fromHex(bodyBytes), authInfoBytes, chainId, accountNumber);
return signDoc;
}
exports.formatDirectSignDoc = formatDirectSignDoc;
function stringifyAccountDataValues(account) {
return Object.assign(Object.assign({}, account), { pubkey: encoding_1.toHex(account.pubkey) });
}
exports.stringifyAccountDataValues = stringifyAccountDataValues;
function parseAccountDataValues(account) {
return Object.assign(Object.assign({}, account), { pubkey: encoding_1.fromHex(account.pubkey) });
}
exports.parseAccountDataValues = parseAccountDataValues;
//# sourceMappingURL=utils.js.map

2

package.json
{
"name": "cosmos-wallet",
"description": "Cosmos Wallet with Direct and Amino signing",
"version": "1.0.0",
"version": "1.1.0",
"author": "Pedro Gomes <github.com/pedrouid>",

@@ -6,0 +6,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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