@mysten/signers 0.3.8 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/aws/aws-kms-signer.d.ts +1 -1
- package/dist/cjs/aws/aws-kms-signer.js.map +2 -2
- package/dist/cjs/gcp/gcp-kms-client.d.ts +1 -1
- package/dist/cjs/gcp/gcp-kms-client.js.map +2 -2
- package/dist/cjs/ledger/index.js.map +2 -2
- package/dist/cjs/utils/utils.d.ts +1 -1
- package/dist/cjs/utils/utils.js.map +2 -2
- package/dist/cjs/webcrypto/index.d.ts +2 -2
- package/dist/cjs/webcrypto/index.js.map +2 -2
- package/dist/esm/aws/aws-kms-signer.d.ts +1 -1
- package/dist/esm/aws/aws-kms-signer.js.map +2 -2
- package/dist/esm/gcp/gcp-kms-client.d.ts +1 -1
- package/dist/esm/gcp/gcp-kms-client.js.map +2 -2
- package/dist/esm/ledger/index.js.map +2 -2
- package/dist/esm/utils/utils.d.ts +1 -1
- package/dist/esm/utils/utils.js.map +2 -2
- package/dist/esm/webcrypto/index.d.ts +2 -2
- package/dist/esm/webcrypto/index.js.map +2 -2
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/aws/aws-kms-signer.ts +1 -1
- package/src/gcp/gcp-kms-client.ts +1 -1
- package/src/ledger/index.ts +1 -1
- package/src/utils/utils.ts +6 -2
- package/src/webcrypto/index.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mysten/signers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A collection of signers for various providers",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Mysten Labs <build@mystenlabs.com>",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"homepage": "https://github.com/MystenLabs/ts-sdks/tree/main/packages/signers#readme",
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^22.15.29",
|
|
49
|
-
"dotenv": "^
|
|
50
|
-
"typescript": "^5.
|
|
49
|
+
"dotenv": "^17.2.2",
|
|
50
|
+
"typescript": "^5.9.2",
|
|
51
51
|
"vitest": "^3.2.4",
|
|
52
52
|
"@mysten/build-scripts": "0.0.0"
|
|
53
53
|
},
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"@noble/curves": "^1.9.4",
|
|
57
57
|
"@noble/hashes": "^1.8.0",
|
|
58
58
|
"asn1-ts": "^8.0.2",
|
|
59
|
-
"@mysten/ledgerjs-hw-app-sui": "0.
|
|
60
|
-
"@mysten/sui": "1.
|
|
59
|
+
"@mysten/ledgerjs-hw-app-sui": "0.6.0",
|
|
60
|
+
"@mysten/sui": "1.38.0"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=20"
|
|
@@ -71,7 +71,7 @@ export class AwsKmsSigner extends Signer {
|
|
|
71
71
|
* @returns A promise that resolves to the signature as a Uint8Array.
|
|
72
72
|
* @throws Will throw an error if the public key is not initialized or if signing fails.
|
|
73
73
|
*/
|
|
74
|
-
async sign(bytes: Uint8Array): Promise<Uint8Array
|
|
74
|
+
async sign(bytes: Uint8Array): Promise<Uint8Array<ArrayBuffer>> {
|
|
75
75
|
const signResponse = await this.#client.runCommand('Sign', {
|
|
76
76
|
KeyId: this.#kmsKeyId,
|
|
77
77
|
Message: toBase64(bytes),
|
|
@@ -73,7 +73,7 @@ export class GcpKmsSigner extends Signer {
|
|
|
73
73
|
* @returns A promise that resolves to the signature as a Uint8Array.
|
|
74
74
|
* @throws Will throw an error if the public key is not initialized or if signing fails.
|
|
75
75
|
*/
|
|
76
|
-
async sign(bytes: Uint8Array): Promise<Uint8Array
|
|
76
|
+
async sign(bytes: Uint8Array): Promise<Uint8Array<ArrayBuffer>> {
|
|
77
77
|
const [signResponse] = await this.#client.asymmetricSign({
|
|
78
78
|
name: this.#versionName,
|
|
79
79
|
data: bytes,
|
package/src/ledger/index.ts
CHANGED
|
@@ -181,7 +181,7 @@ export class LedgerSigner extends Signer {
|
|
|
181
181
|
storageRebate: object.data.storageRebate!,
|
|
182
182
|
}).toBytes();
|
|
183
183
|
})
|
|
184
|
-
.filter((bcsBytes): bcsBytes is Uint8Array => !!bcsBytes);
|
|
184
|
+
.filter((bcsBytes): bcsBytes is Uint8Array<ArrayBuffer> => !!bcsBytes);
|
|
185
185
|
|
|
186
186
|
return { bcsObjects };
|
|
187
187
|
}
|
package/src/utils/utils.ts
CHANGED
|
@@ -71,9 +71,13 @@ export function getConcatenatedSignature(signature: Uint8Array, keyScheme: strin
|
|
|
71
71
|
|
|
72
72
|
switch (keyScheme) {
|
|
73
73
|
case 'Secp256k1':
|
|
74
|
-
return new secp256k1.Signature(BigInt(r), BigInt(s))
|
|
74
|
+
return new secp256k1.Signature(BigInt(r), BigInt(s))
|
|
75
|
+
.normalizeS()
|
|
76
|
+
.toCompactRawBytes() as Uint8Array<ArrayBuffer>;
|
|
75
77
|
case 'Secp256r1':
|
|
76
|
-
return new secp256r1.Signature(BigInt(r), BigInt(s))
|
|
78
|
+
return new secp256r1.Signature(BigInt(r), BigInt(s))
|
|
79
|
+
.normalizeS()
|
|
80
|
+
.toCompactRawBytes() as Uint8Array<ArrayBuffer>;
|
|
77
81
|
default:
|
|
78
82
|
throw new Error('Unsupported key scheme');
|
|
79
83
|
}
|
package/src/webcrypto/index.ts
CHANGED
|
@@ -23,7 +23,7 @@ function getCompressedPublicKey(publicKey: Uint8Array) {
|
|
|
23
23
|
|
|
24
24
|
export interface ExportedWebCryptoKeypair {
|
|
25
25
|
privateKey: CryptoKey;
|
|
26
|
-
publicKey: Uint8Array
|
|
26
|
+
publicKey: Uint8Array<ArrayBuffer>;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export class WebCryptoSigner extends Signer {
|
|
@@ -91,18 +91,18 @@ export class WebCryptoSigner extends Signer {
|
|
|
91
91
|
return this.#publicKey;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
async sign(bytes: Uint8Array): Promise<Uint8Array
|
|
94
|
+
async sign(bytes: Uint8Array): Promise<Uint8Array<ArrayBuffer>> {
|
|
95
95
|
const rawSignature = await globalThis.crypto.subtle.sign(
|
|
96
96
|
{
|
|
97
97
|
name: 'ECDSA',
|
|
98
98
|
hash: 'SHA-256',
|
|
99
99
|
},
|
|
100
100
|
this.privateKey,
|
|
101
|
-
bytes,
|
|
101
|
+
bytes as BufferSource,
|
|
102
102
|
);
|
|
103
103
|
|
|
104
104
|
const signature = secp256r1.Signature.fromCompact(new Uint8Array(rawSignature));
|
|
105
105
|
|
|
106
|
-
return signature.normalizeS().toCompactRawBytes()
|
|
106
|
+
return signature.normalizeS().toCompactRawBytes() as Uint8Array<ArrayBuffer>;
|
|
107
107
|
}
|
|
108
108
|
}
|