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

@arcblock/did-util

Package Overview
Dependencies
Maintainers
1
Versions
580
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcblock/did-util - npm Package Compare versions

Comparing version 0.28.4 to 0.29.0

14

lib/index.d.ts

@@ -27,5 +27,7 @@ // Generate by [js2dts@0.3.3](https://github.com/whxaxes/js2dts#readme)

* @param {object} itx - an object of forge supported itx
* @param {string} type - itx type string
* @param {enum} [role=types.RoleType.ROLE_TX] - role type
* @returns {string} itx address without `did:abt:` prefix
*/
declare function toItxAddress(itx: any, type: any): string;
declare function toItxAddress(itx: any, type: string, role?: any): string;
/**

@@ -60,2 +62,11 @@ * Create an itx did

declare function toStakeDid(sender: string, receiver: string): string;
/**
* Generate a tether address from the deposit tether tx hash
*
* @public
* @static
* @param {string} hash - DepositTetherTx hash
* @returns {string} stake address without `did:abt:` prefix
*/
declare function toTetherAddress(hash: string): string;
declare const _Lib: _Lib.T100;

@@ -70,4 +81,5 @@ declare namespace _Lib {

toStakeDid: typeof toStakeDid;
toTetherAddress: typeof toTetherAddress;
}
}
export = _Lib;

@@ -87,5 +87,3 @@ /**

const receiverBuffer = Buffer.from(receiver);
const buffer = Buffer.concat(
sender < receiver ? [senderBuffer, receiverBuffer] : [receiverBuffer, senderBuffer]
);
const buffer = Buffer.concat([senderBuffer, receiverBuffer]);
const hash = Hasher.SHA3.hash256(buffer);

@@ -96,2 +94,14 @@ return fromHash(hash, types.RoleType.ROLE_STAKE);

/**
* Generate a tether address from the deposit tether tx hash
*
* @public
* @static
* @param {string} hash - DepositTetherTx hash
* @returns {string} stake address without `did:abt:` prefix
*/
function toTetherAddress(hash) {
return fromHash(hash, types.RoleType.ROLE_TETHER);
}
/**
* Generate an stake address, eg: the did of the stake

@@ -116,2 +126,3 @@ *

toStakeDid,
toTetherAddress,
};

16

package.json
{
"name": "@arcblock/did-util",
"description": "Helper function to calculate did",
"version": "0.28.4",
"version": "0.29.0",
"author": {

@@ -21,8 +21,8 @@ "name": "wangshijun",

"dependencies": {
"@arcblock/did": "^0.28.1",
"@arcblock/forge-message": "^0.28.4",
"@arcblock/forge-proto": "^0.28.3",
"@arcblock/forge-util": "^0.28.0",
"@arcblock/forge-wallet": "^0.28.4",
"@arcblock/mcrypto": "^0.28.0"
"@arcblock/did": "^0.29.0",
"@arcblock/forge-message": "^0.29.0",
"@arcblock/forge-proto": "^0.29.0",
"@arcblock/forge-util": "^0.29.0",
"@arcblock/forge-wallet": "^0.29.0",
"@arcblock/mcrypto": "^0.29.0"
},

@@ -73,3 +73,3 @@ "devDependencies": {

},
"gitHead": "fd0ce7603b7b16f7fd2a6b550e35518909f10a6e"
"gitHead": "6e922db0d834db071d8208d56cbf46175192e301"
}

@@ -7,10 +7,10 @@ # [**@arcblock/did-util**](https://github.com/arcblock/forge-js)

## Table of Contents
- [**@arcblock/did-util**](#arcblockdid-util)
- [Table of Contents](#table-of-contents)
- [Install](#install)
- [Usage](#usage)
- [Documentation](#documentation)
* [Install](#install)
* [Usage](#usage)
* [Documentation](#documentation)
## Install

@@ -24,2 +24,3 @@

## Usage

@@ -59,4 +60,12 @@

## Documentation
For full documentation, checkout [README.md](./docs/README.md).
## Contributors
| Name | Website |
| -------------- | -------------------------- |
| **wangshijun** | <https://ocap.arcblock.io> |
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