@mysten/sui
Advanced tools
Comparing version 1.16.2 to 1.17.0
# @mysten/sui.js | ||
## 1.17.0 | ||
### Minor Changes | ||
- 20af12d: add passkey sdk | ||
## 1.16.2 | ||
@@ -4,0 +10,0 @@ |
@@ -37,2 +37,3 @@ "use strict"; | ||
ObjectDigest: () => ObjectDigest, | ||
PasskeyAuthenticator: () => PasskeyAuthenticator, | ||
ProgrammableMoveCall: () => ProgrammableMoveCall, | ||
@@ -308,2 +309,7 @@ ProgrammableTransaction: () => ProgrammableTransaction, | ||
}); | ||
const PasskeyAuthenticator = import_bcs.bcs.struct("PasskeyAuthenticator", { | ||
authenticatorData: import_bcs.bcs.vector(import_bcs.bcs.u8()), | ||
clientDataJson: import_bcs.bcs.string(), | ||
userSignature: import_bcs.bcs.vector(import_bcs.bcs.u8()) | ||
}); | ||
//# sourceMappingURL=bcs.js.map |
@@ -71,4 +71,5 @@ "use strict"; | ||
TypeTag: import_bcs2.TypeTag, | ||
TransactionEffects: import_effects.TransactionEffects | ||
TransactionEffects: import_effects.TransactionEffects, | ||
PasskeyAuthenticator: import_bcs2.PasskeyAuthenticator | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -7,2 +7,3 @@ export declare const SIGNATURE_SCHEME_TO_FLAG: { | ||
readonly ZkLogin: 5; | ||
readonly Passkey: 6; | ||
}; | ||
@@ -20,4 +21,5 @@ export declare const SIGNATURE_SCHEME_TO_SIZE: { | ||
readonly 5: "ZkLogin"; | ||
readonly 6: "Passkey"; | ||
}; | ||
export type SignatureScheme = 'ED25519' | 'Secp256k1' | 'Secp256r1' | 'MultiSig' | 'ZkLogin'; | ||
export type SignatureScheme = 'ED25519' | 'Secp256k1' | 'Secp256r1' | 'MultiSig' | 'ZkLogin' | 'Passkey'; | ||
export type SignatureFlag = keyof typeof SIGNATURE_FLAG_TO_SCHEME; |
@@ -31,3 +31,4 @@ "use strict"; | ||
MultiSig: 3, | ||
ZkLogin: 5 | ||
ZkLogin: 5, | ||
Passkey: 6 | ||
}; | ||
@@ -44,4 +45,5 @@ const SIGNATURE_SCHEME_TO_SIZE = { | ||
3: "MultiSig", | ||
5: "ZkLogin" | ||
5: "ZkLogin", | ||
6: "Passkey" | ||
}; | ||
//# sourceMappingURL=signature-scheme.js.map |
@@ -22,3 +22,11 @@ import type { MultiSigStruct } from '../multisig/publickey.js'; | ||
export declare function parseSerializedSignature(serializedSignature: string): { | ||
signatureScheme: "Passkey"; | ||
serializedSignature: string; | ||
signature: Uint8Array; | ||
authenticatorData: number[]; | ||
clientDataJson: string; | ||
userSignature: Uint8Array; | ||
publicKey: Uint8Array; | ||
} | { | ||
serializedSignature: string; | ||
signatureScheme: "ZkLogin"; | ||
@@ -25,0 +33,0 @@ zkLogin: { |
@@ -27,3 +27,4 @@ "use strict"; | ||
var import_bcs2 = require("../bcs/index.js"); | ||
var import_publickey = require("../zklogin/publickey.js"); | ||
var import_publickey = require("../keypairs/passkey/publickey.js"); | ||
var import_publickey2 = require("../zklogin/publickey.js"); | ||
var import_signature_scheme = require("./signature-scheme.js"); | ||
@@ -49,2 +50,4 @@ function toSerializedSignature({ | ||
switch (signatureScheme) { | ||
case "Passkey": | ||
return (0, import_publickey.parseSerializedPasskeySignature)(serializedSignature); | ||
case "MultiSig": | ||
@@ -59,3 +62,3 @@ const multisig = import_bcs2.bcs.MultiSig.parse(bytes.slice(1)); | ||
case "ZkLogin": | ||
return (0, import_publickey.parseSerializedZkLoginSignature)(serializedSignature); | ||
return (0, import_publickey2.parseSerializedZkLoginSignature)(serializedSignature); | ||
case "ED25519": | ||
@@ -62,0 +65,0 @@ case "Secp256k1": |
@@ -31,6 +31,7 @@ "use strict"; | ||
var import_publickey = require("../keypairs/ed25519/publickey.js"); | ||
var import_publickey2 = require("../keypairs/secp256k1/publickey.js"); | ||
var import_publickey3 = require("../keypairs/secp256r1/publickey.js"); | ||
var import_publickey4 = require("../multisig/publickey.js"); | ||
var import_publickey5 = require("../zklogin/publickey.js"); | ||
var import_publickey2 = require("../keypairs/passkey/publickey.js"); | ||
var import_publickey3 = require("../keypairs/secp256k1/publickey.js"); | ||
var import_publickey4 = require("../keypairs/secp256r1/publickey.js"); | ||
var import_publickey5 = require("../multisig/publickey.js"); | ||
var import_publickey6 = require("../zklogin/publickey.js"); | ||
async function verifySignature(bytes, signature) { | ||
@@ -68,3 +69,3 @@ const parsedSignature = parseSignature(signature); | ||
...parsedSignature, | ||
publicKey: new import_publickey4.MultiSigPublicKey(parsedSignature.multisig.multisig_pk) | ||
publicKey: new import_publickey5.MultiSigPublicKey(parsedSignature.multisig.multisig_pk) | ||
}; | ||
@@ -87,9 +88,11 @@ } | ||
case "Secp256k1": | ||
return new import_publickey2.Secp256k1PublicKey(bytes); | ||
return new import_publickey3.Secp256k1PublicKey(bytes); | ||
case "Secp256r1": | ||
return new import_publickey3.Secp256r1PublicKey(bytes); | ||
return new import_publickey4.Secp256r1PublicKey(bytes); | ||
case "MultiSig": | ||
return new import_publickey4.MultiSigPublicKey(bytes); | ||
return new import_publickey5.MultiSigPublicKey(bytes); | ||
case "ZkLogin": | ||
return new import_publickey5.ZkLoginPublicIdentifier(bytes, options); | ||
return new import_publickey6.ZkLoginPublicIdentifier(bytes, options); | ||
case "Passkey": | ||
return new import_publickey2.PasskeyPublicKey(bytes); | ||
default: | ||
@@ -96,0 +99,0 @@ throw new Error(`Unsupported signature scheme ${signatureScheme}`); |
@@ -1,2 +0,2 @@ | ||
export declare const PACKAGE_VERSION = "1.16.2"; | ||
export declare const PACKAGE_VERSION = "1.17.0"; | ||
export declare const TARGETED_RPC_VERSION = "1.40.0"; |
@@ -25,4 +25,4 @@ "use strict"; | ||
module.exports = __toCommonJS(version_exports); | ||
const PACKAGE_VERSION = "1.16.2"; | ||
const PACKAGE_VERSION = "1.17.0"; | ||
const TARGETED_RPC_VERSION = "1.40.0"; | ||
//# sourceMappingURL=version.js.map |
@@ -255,2 +255,7 @@ import { bcs, fromBase58, fromBase64, fromHex, toBase58, toBase64, toHex } from "@mysten/bcs"; | ||
}); | ||
const PasskeyAuthenticator = bcs.struct("PasskeyAuthenticator", { | ||
authenticatorData: bcs.vector(bcs.u8()), | ||
clientDataJson: bcs.string(), | ||
userSignature: bcs.vector(bcs.u8()) | ||
}); | ||
export { | ||
@@ -273,2 +278,3 @@ Address, | ||
ObjectDigest, | ||
PasskeyAuthenticator, | ||
ProgrammableMoveCall, | ||
@@ -275,0 +281,0 @@ ProgrammableTransaction, |
@@ -19,2 +19,3 @@ import { bcs } from "@mysten/bcs"; | ||
ObjectDigest, | ||
PasskeyAuthenticator, | ||
ProgrammableMoveCall, | ||
@@ -77,3 +78,4 @@ ProgrammableTransaction, | ||
TypeTag, | ||
TransactionEffects | ||
TransactionEffects, | ||
PasskeyAuthenticator | ||
}; | ||
@@ -80,0 +82,0 @@ export { |
@@ -7,2 +7,3 @@ export declare const SIGNATURE_SCHEME_TO_FLAG: { | ||
readonly ZkLogin: 5; | ||
readonly Passkey: 6; | ||
}; | ||
@@ -20,4 +21,5 @@ export declare const SIGNATURE_SCHEME_TO_SIZE: { | ||
readonly 5: "ZkLogin"; | ||
readonly 6: "Passkey"; | ||
}; | ||
export type SignatureScheme = 'ED25519' | 'Secp256k1' | 'Secp256r1' | 'MultiSig' | 'ZkLogin'; | ||
export type SignatureScheme = 'ED25519' | 'Secp256k1' | 'Secp256r1' | 'MultiSig' | 'ZkLogin' | 'Passkey'; | ||
export type SignatureFlag = keyof typeof SIGNATURE_FLAG_TO_SCHEME; |
@@ -6,3 +6,4 @@ const SIGNATURE_SCHEME_TO_FLAG = { | ||
MultiSig: 3, | ||
ZkLogin: 5 | ||
ZkLogin: 5, | ||
Passkey: 6 | ||
}; | ||
@@ -19,3 +20,4 @@ const SIGNATURE_SCHEME_TO_SIZE = { | ||
3: "MultiSig", | ||
5: "ZkLogin" | ||
5: "ZkLogin", | ||
6: "Passkey" | ||
}; | ||
@@ -22,0 +24,0 @@ export { |
@@ -22,3 +22,11 @@ import type { MultiSigStruct } from '../multisig/publickey.js'; | ||
export declare function parseSerializedSignature(serializedSignature: string): { | ||
signatureScheme: "Passkey"; | ||
serializedSignature: string; | ||
signature: Uint8Array; | ||
authenticatorData: number[]; | ||
clientDataJson: string; | ||
userSignature: Uint8Array; | ||
publicKey: Uint8Array; | ||
} | { | ||
serializedSignature: string; | ||
signatureScheme: "ZkLogin"; | ||
@@ -25,0 +33,0 @@ zkLogin: { |
import { fromBase64, toBase64 } from "@mysten/bcs"; | ||
import { bcs } from "../bcs/index.js"; | ||
import { parseSerializedPasskeySignature } from "../keypairs/passkey/publickey.js"; | ||
import { parseSerializedZkLoginSignature } from "../zklogin/publickey.js"; | ||
@@ -28,2 +29,4 @@ import { | ||
switch (signatureScheme) { | ||
case "Passkey": | ||
return parseSerializedPasskeySignature(serializedSignature); | ||
case "MultiSig": | ||
@@ -30,0 +33,0 @@ const multisig = bcs.MultiSig.parse(bytes.slice(1)); |
import { fromBase64 } from "@mysten/bcs"; | ||
import { parseSerializedSignature, SIGNATURE_FLAG_TO_SCHEME } from "../cryptography/index.js"; | ||
import { Ed25519PublicKey } from "../keypairs/ed25519/publickey.js"; | ||
import { PasskeyPublicKey } from "../keypairs/passkey/publickey.js"; | ||
import { Secp256k1PublicKey } from "../keypairs/secp256k1/publickey.js"; | ||
@@ -65,2 +66,4 @@ import { Secp256r1PublicKey } from "../keypairs/secp256r1/publickey.js"; | ||
return new ZkLoginPublicIdentifier(bytes, options); | ||
case "Passkey": | ||
return new PasskeyPublicKey(bytes); | ||
default: | ||
@@ -67,0 +70,0 @@ throw new Error(`Unsupported signature scheme ${signatureScheme}`); |
@@ -1,2 +0,2 @@ | ||
export declare const PACKAGE_VERSION = "1.16.2"; | ||
export declare const PACKAGE_VERSION = "1.17.0"; | ||
export declare const TARGETED_RPC_VERSION = "1.40.0"; |
@@ -1,2 +0,2 @@ | ||
const PACKAGE_VERSION = "1.16.2"; | ||
const PACKAGE_VERSION = "1.17.0"; | ||
const TARGETED_RPC_VERSION = "1.40.0"; | ||
@@ -3,0 +3,0 @@ export { |
@@ -6,3 +6,3 @@ { | ||
"homepage": "https://sdk.mystenlabs.com", | ||
"version": "1.16.2", | ||
"version": "1.17.0", | ||
"license": "Apache-2.0", | ||
@@ -66,2 +66,6 @@ "sideEffects": false, | ||
}, | ||
"./keypairs/passkey": { | ||
"import": "./dist/esm/keypairs/passkey/index.js", | ||
"require": "./dist/cjs/keypairs/passkey/index.js" | ||
}, | ||
"./multisig": { | ||
@@ -131,2 +135,3 @@ "import": "./dist/esm/multisig/index.js", | ||
"@scure/bip39": "^1.3.0", | ||
"@simplewebauthn/typescript-types": "^7.4.0", | ||
"@suchipi/femver": "^1.0.0", | ||
@@ -133,0 +138,0 @@ "bech32": "^2.0.0", |
@@ -301,1 +301,7 @@ // Copyright (c) Mysten Labs, Inc. | ||
}); | ||
export const PasskeyAuthenticator = bcs.struct('PasskeyAuthenticator', { | ||
authenticatorData: bcs.vector(bcs.u8()), | ||
clientDataJson: bcs.string(), | ||
userSignature: bcs.vector(bcs.u8()), | ||
}); |
@@ -23,2 +23,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
ObjectDigest, | ||
PasskeyAuthenticator, | ||
ProgrammableMoveCall, | ||
@@ -86,4 +87,5 @@ ProgrammableTransaction, | ||
TransactionEffects, | ||
PasskeyAuthenticator, | ||
}; | ||
export { suiBcs as bcs }; |
@@ -10,2 +10,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
ZkLogin: 0x05, | ||
Passkey: 0x06, | ||
} as const; | ||
@@ -25,6 +26,13 @@ | ||
0x05: 'ZkLogin', | ||
0x06: 'Passkey', | ||
} as const; | ||
export type SignatureScheme = 'ED25519' | 'Secp256k1' | 'Secp256r1' | 'MultiSig' | 'ZkLogin'; | ||
export type SignatureScheme = | ||
| 'ED25519' | ||
| 'Secp256k1' | ||
| 'Secp256r1' | ||
| 'MultiSig' | ||
| 'ZkLogin' | ||
| 'Passkey'; | ||
export type SignatureFlag = keyof typeof SIGNATURE_FLAG_TO_SCHEME; |
@@ -7,2 +7,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
import { bcs } from '../bcs/index.js'; | ||
import { parseSerializedPasskeySignature } from '../keypairs/passkey/publickey.js'; | ||
import type { MultiSigStruct } from '../multisig/publickey.js'; | ||
@@ -59,2 +60,4 @@ import { parseSerializedZkLoginSignature } from '../zklogin/publickey.js'; | ||
switch (signatureScheme) { | ||
case 'Passkey': | ||
return parseSerializedPasskeySignature(serializedSignature); | ||
case 'MultiSig': | ||
@@ -61,0 +64,0 @@ const multisig: MultiSigStruct = bcs.MultiSig.parse(bytes.slice(1)); |
@@ -10,2 +10,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
import { Ed25519PublicKey } from '../keypairs/ed25519/publickey.js'; | ||
import { PasskeyPublicKey } from '../keypairs/passkey/publickey.js'; | ||
import { Secp256k1PublicKey } from '../keypairs/secp256k1/publickey.js'; | ||
@@ -102,2 +103,4 @@ import { Secp256r1PublicKey } from '../keypairs/secp256r1/publickey.js'; | ||
return new ZkLoginPublicIdentifier(bytes, options); | ||
case 'Passkey': | ||
return new PasskeyPublicKey(bytes); | ||
default: | ||
@@ -104,0 +107,0 @@ throw new Error(`Unsupported signature scheme ${signatureScheme}`); |
@@ -6,3 +6,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
export const PACKAGE_VERSION = '1.16.2'; | ||
export const PACKAGE_VERSION = '1.17.0'; | ||
export const TARGETED_RPC_VERSION = '1.40.0'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
5470516
682
95035
15
+ Added@simplewebauthn/typescript-types@7.4.0(transitive)