Socket
Socket
Sign inDemoInstall

@keplr-wallet/common

Package Overview
Dependencies
Maintainers
1
Versions
547
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keplr-wallet/common - npm Package Compare versions

Comparing version 0.9.0-alpha.4 to 0.9.0-alpha.6

build/denom/denom.spec.d.ts

4

build/denom/index.d.ts
export declare class DenomHelper {
protected readonly _denom: string;
static ibcDenom(paths: {
portId: string;
channelId: string;
}[], coinMinimalDenom: string): string;
protected readonly _type: string;

@@ -4,0 +8,0 @@ protected readonly _contractAddress: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DenomHelper = void 0;
const buffer_1 = require("buffer/");
const crypto_1 = require("@keplr-wallet/crypto");
class DenomHelper {

@@ -15,2 +17,14 @@ constructor(_denom) {

}
static ibcDenom(paths, coinMinimalDenom) {
const prefixes = [];
for (const path of paths) {
prefixes.push(`${path.portId}/${path.channelId}`);
}
const prefix = prefixes.join("/");
const denom = `${prefix}/${coinMinimalDenom}`;
return ("ibc/" +
buffer_1.Buffer.from(crypto_1.Hash.sha256(buffer_1.Buffer.from(denom)))
.toString("hex")
.toUpperCase());
}
get denom() {

@@ -17,0 +31,0 @@ return this._denom;

6

package.json
{
"name": "@keplr-wallet/common",
"version": "0.9.0-alpha.4",
"version": "0.9.0-alpha.6",
"main": "build/index.js",

@@ -20,5 +20,7 @@ "author": "chainapsis",

"dependencies": {
"@keplr-wallet/crypto": "^0.9.0-alpha.6",
"buffer": "^6.0.3",
"delay": "^4.4.0"
},
"gitHead": "6c196a5f457949b646657eb5d62555c3ff066300"
"gitHead": "f11fdd3d5c968bf408431eeb50e9f3c251b18bcb"
}

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

import { Buffer } from "buffer/";
import { Hash } from "@keplr-wallet/crypto";
export class DenomHelper {
static ibcDenom(
paths: {
portId: string;
channelId: string;
}[],
coinMinimalDenom: string
): string {
const prefixes: string[] = [];
for (const path of paths) {
prefixes.push(`${path.portId}/${path.channelId}`);
}
const prefix = prefixes.join("/");
const denom = `${prefix}/${coinMinimalDenom}`;
return (
"ibc/" +
Buffer.from(Hash.sha256(Buffer.from(denom)))
.toString("hex")
.toUpperCase()
);
}
protected readonly _type: string;

@@ -3,0 +29,0 @@ protected readonly _contractAddress: string;

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