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

@mysten/zklogin

Package Overview
Dependencies
Maintainers
4
Versions
260
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mysten/zklogin - npm Package Compare versions

Comparing version 0.0.0-experimental-20230817171212 to 0.0.0-experimental-20230817191944

3

CHANGELOG.md
# @mysten/zklogin
## 0.0.0-experimental-20230817171212
## 0.0.0-experimental-20230817191944
### Patch Changes
- b676fa4e9: Change function signature of genAddrSeed
- 626098033: Fix generated types

@@ -8,0 +9,0 @@ - 608e8e407: Update max key claim value length

@@ -15,2 +15,2 @@ /// <reference types="node" />

export declare function hashASCIIStrToField(str: string, maxSize: number): bigint;
export declare function genAddressSeed(pin: bigint, name: string, value: string): bigint;
export declare function genAddressSeed(pin: bigint, name: string, value: string, max_name_length?: number, max_value_length?: number): bigint;

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

}
function genAddressSeed(pin, name, value) {
function genAddressSeed(pin, name, value, max_name_length = MAX_KEY_CLAIM_NAME_LENGTH, max_value_length = MAX_KEY_CLAIM_VALUE_LENGTH) {
return (0, import_poseidon.poseidonHash)([
hashASCIIStrToField(name, MAX_KEY_CLAIM_NAME_LENGTH),
hashASCIIStrToField(value, MAX_KEY_CLAIM_VALUE_LENGTH),
hashASCIIStrToField(name, max_name_length),
hashASCIIStrToField(value, max_value_length),
(0, import_poseidon.poseidonHash)([pin])

@@ -74,0 +74,0 @@ ]);

@@ -15,2 +15,2 @@ /// <reference types="node" />

export declare function hashASCIIStrToField(str: string, maxSize: number): bigint;
export declare function genAddressSeed(pin: bigint, name: string, value: string): bigint;
export declare function genAddressSeed(pin: bigint, name: string, value: string, max_name_length?: number, max_value_length?: number): bigint;

@@ -41,6 +41,6 @@ import { poseidonHash } from "./poseidon.js";

}
function genAddressSeed(pin, name, value) {
function genAddressSeed(pin, name, value, max_name_length = MAX_KEY_CLAIM_NAME_LENGTH, max_value_length = MAX_KEY_CLAIM_VALUE_LENGTH) {
return poseidonHash([
hashASCIIStrToField(name, MAX_KEY_CLAIM_NAME_LENGTH),
hashASCIIStrToField(value, MAX_KEY_CLAIM_VALUE_LENGTH),
hashASCIIStrToField(name, max_name_length),
hashASCIIStrToField(value, max_value_length),
poseidonHash([pin])

@@ -47,0 +47,0 @@ ]);

{
"name": "@mysten/zklogin",
"version": "0.0.0-experimental-20230817171212",
"version": "0.0.0-experimental-20230817191944",
"description": "Utilities for interacting with zkLogin in Sui",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

@@ -72,8 +72,14 @@ // Copyright (c) Mysten Labs, Inc.

export function genAddressSeed(pin: bigint, name: string, value: string) {
export function genAddressSeed(
pin: bigint,
name: string,
value: string,
max_name_length = MAX_KEY_CLAIM_NAME_LENGTH,
max_value_length = MAX_KEY_CLAIM_VALUE_LENGTH,
) {
return poseidonHash([
hashASCIIStrToField(name, MAX_KEY_CLAIM_NAME_LENGTH),
hashASCIIStrToField(value, MAX_KEY_CLAIM_VALUE_LENGTH),
hashASCIIStrToField(name, max_name_length),
hashASCIIStrToField(value, max_value_length),
poseidonHash([pin]),
]);
}

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 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