@mysten/sui
Advanced tools
Comparing version 0.0.0-experimental-20240813182818 to 0.0.0-experimental-20240819182036
# @mysten/sui.js | ||
## 0.0.0-experimental-20240813182818 | ||
## 0.0.0-experimental-20240819182036 | ||
### Patch Changes | ||
- 4357ac6: Add options argument to verifyTransactionSignature | ||
## 1.6.0 | ||
### Minor Changes | ||
@@ -6,0 +12,0 @@ |
@@ -7,6 +7,10 @@ import type { PublicKey, SignatureScheme } from '../cryptography/index.js'; | ||
}): Promise<PublicKey>; | ||
export declare function verifyTransactionSignature(transaction: Uint8Array, signature: string): Promise<PublicKey>; | ||
export declare function verifyTransactionSignature(transaction: Uint8Array, signature: string, options?: { | ||
client?: SuiGraphQLClient; | ||
}): Promise<PublicKey>; | ||
export declare function publicKeyFromRawBytes(signatureScheme: SignatureScheme, bytes: Uint8Array, options?: { | ||
client?: SuiGraphQLClient; | ||
}): PublicKey; | ||
export declare function publicKeyFromSuiBytes(publicKey: string | Uint8Array): PublicKey; | ||
export declare function publicKeyFromSuiBytes(publicKey: string | Uint8Array, options?: { | ||
client?: SuiGraphQLClient; | ||
}): PublicKey; |
@@ -52,4 +52,4 @@ "use strict"; | ||
} | ||
async function verifyTransactionSignature(transaction, signature) { | ||
const parsedSignature = parseSignature(signature); | ||
async function verifyTransactionSignature(transaction, signature, options = {}) { | ||
const parsedSignature = parseSignature(signature, options); | ||
if (!await parsedSignature.publicKey.verifyTransaction( | ||
@@ -97,7 +97,7 @@ transaction, | ||
} | ||
function publicKeyFromSuiBytes(publicKey) { | ||
function publicKeyFromSuiBytes(publicKey, options = {}) { | ||
const bytes = typeof publicKey === "string" ? (0, import_bcs.fromB64)(publicKey) : publicKey; | ||
const signatureScheme = import_cryptography.SIGNATURE_FLAG_TO_SCHEME[bytes[0]]; | ||
return publicKeyFromRawBytes(signatureScheme, bytes.slice(1)); | ||
return publicKeyFromRawBytes(signatureScheme, bytes.slice(1), options); | ||
} | ||
//# sourceMappingURL=verify.js.map |
@@ -1,2 +0,2 @@ | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240813182818"; | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240819182036"; | ||
export declare const TARGETED_RPC_VERSION = "1.32.0"; |
@@ -25,4 +25,4 @@ "use strict"; | ||
module.exports = __toCommonJS(version_exports); | ||
const PACKAGE_VERSION = "0.0.0-experimental-20240813182818"; | ||
const PACKAGE_VERSION = "0.0.0-experimental-20240819182036"; | ||
const TARGETED_RPC_VERSION = "1.32.0"; | ||
//# sourceMappingURL=version.js.map |
@@ -7,6 +7,10 @@ import type { PublicKey, SignatureScheme } from '../cryptography/index.js'; | ||
}): Promise<PublicKey>; | ||
export declare function verifyTransactionSignature(transaction: Uint8Array, signature: string): Promise<PublicKey>; | ||
export declare function verifyTransactionSignature(transaction: Uint8Array, signature: string, options?: { | ||
client?: SuiGraphQLClient; | ||
}): Promise<PublicKey>; | ||
export declare function publicKeyFromRawBytes(signatureScheme: SignatureScheme, bytes: Uint8Array, options?: { | ||
client?: SuiGraphQLClient; | ||
}): PublicKey; | ||
export declare function publicKeyFromSuiBytes(publicKey: string | Uint8Array): PublicKey; | ||
export declare function publicKeyFromSuiBytes(publicKey: string | Uint8Array, options?: { | ||
client?: SuiGraphQLClient; | ||
}): PublicKey; |
@@ -25,4 +25,4 @@ import { fromB64 } from "@mysten/bcs"; | ||
} | ||
async function verifyTransactionSignature(transaction, signature) { | ||
const parsedSignature = parseSignature(signature); | ||
async function verifyTransactionSignature(transaction, signature, options = {}) { | ||
const parsedSignature = parseSignature(signature, options); | ||
if (!await parsedSignature.publicKey.verifyTransaction( | ||
@@ -70,6 +70,6 @@ transaction, | ||
} | ||
function publicKeyFromSuiBytes(publicKey) { | ||
function publicKeyFromSuiBytes(publicKey, options = {}) { | ||
const bytes = typeof publicKey === "string" ? fromB64(publicKey) : publicKey; | ||
const signatureScheme = SIGNATURE_FLAG_TO_SCHEME[bytes[0]]; | ||
return publicKeyFromRawBytes(signatureScheme, bytes.slice(1)); | ||
return publicKeyFromRawBytes(signatureScheme, bytes.slice(1), options); | ||
} | ||
@@ -76,0 +76,0 @@ export { |
@@ -1,2 +0,2 @@ | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240813182818"; | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240819182036"; | ||
export declare const TARGETED_RPC_VERSION = "1.32.0"; |
@@ -1,2 +0,2 @@ | ||
const PACKAGE_VERSION = "0.0.0-experimental-20240813182818"; | ||
const PACKAGE_VERSION = "0.0.0-experimental-20240819182036"; | ||
const TARGETED_RPC_VERSION = "1.32.0"; | ||
@@ -3,0 +3,0 @@ export { |
@@ -6,3 +6,3 @@ { | ||
"homepage": "https://sdk.mystenlabs.com", | ||
"version": "0.0.0-experimental-20240813182818", | ||
"version": "0.0.0-experimental-20240819182036", | ||
"license": "Apache-2.0", | ||
@@ -9,0 +9,0 @@ "sideEffects": false, |
@@ -48,4 +48,5 @@ // Copyright (c) Mysten Labs, Inc. | ||
signature: string, | ||
options: { client?: SuiGraphQLClient } = {}, | ||
): Promise<PublicKey> { | ||
const parsedSignature = parseSignature(signature); | ||
const parsedSignature = parseSignature(signature, options); | ||
@@ -106,3 +107,6 @@ if ( | ||
export function publicKeyFromSuiBytes(publicKey: string | Uint8Array) { | ||
export function publicKeyFromSuiBytes( | ||
publicKey: string | Uint8Array, | ||
options: { client?: SuiGraphQLClient } = {}, | ||
) { | ||
const bytes = typeof publicKey === 'string' ? fromB64(publicKey) : publicKey; | ||
@@ -112,3 +116,3 @@ | ||
return publicKeyFromRawBytes(signatureScheme, bytes.slice(1)); | ||
return publicKeyFromRawBytes(signatureScheme, bytes.slice(1), options); | ||
} |
@@ -6,3 +6,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
export const PACKAGE_VERSION = '0.0.0-experimental-20240813182818'; | ||
export const PACKAGE_VERSION = '0.0.0-experimental-20240819182036'; | ||
export const TARGETED_RPC_VERSION = '1.32.0'; |
@@ -74,2 +74,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
const address = new ZkLoginPublicIdentifier(parsedSignature.publicKey).toSuiAddress(); | ||
return graphqlVerifyZkLoginSignature({ | ||
@@ -76,0 +77,0 @@ address: address, |
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5389641
91356