starknet 6.12.0 → 6.12.1
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 +7 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.global.js +7 -4
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [6.12.1](https://github.com/starknet-io/starknet.js/compare/v6.12.0...v6.12.1) (2024-07-30)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- deprecate url utility methods ([bbbf3d8](https://github.com/starknet-io/starknet.js/commit/bbbf3d8add56021b9609395ffff3d93ac084acb1))
|
|
6
|
+
- remove ledger transport dependency ([91493bb](https://github.com/starknet-io/starknet.js/commit/91493bb73762f0eb2c4605352c73d35645194593))
|
|
7
|
+
|
|
1
8
|
# [6.12.0](https://github.com/starknet-io/starknet.js/compare/v6.11.1...v6.12.0) (2024-07-26)
|
|
2
9
|
|
|
3
10
|
### Bug Fixes
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import * as weierstrass from '@noble/curves/abstract/weierstrass';
|
|
|
5
5
|
import { RecoveredSignatureType } from '@noble/curves/abstract/weierstrass';
|
|
6
6
|
import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
|
|
7
7
|
import { Abi as Abi$1, TypedContract } from 'abi-wan-kanabi';
|
|
8
|
-
import Transport from '@ledgerhq/hw-transport';
|
|
9
8
|
import * as poseidon from '@noble/curves/abstract/poseidon';
|
|
10
9
|
import * as json$1 from 'lossless-json';
|
|
11
10
|
import * as starknet from '@scure/starknet';
|
|
@@ -3539,8 +3538,9 @@ declare class EthSigner implements SignerInterface {
|
|
|
3539
3538
|
/**
|
|
3540
3539
|
* Signer for accounts using a Ledger Nano S+/X signature
|
|
3541
3540
|
*/
|
|
3542
|
-
declare class LedgerSigner implements SignerInterface {
|
|
3541
|
+
declare class LedgerSigner<Transport extends Record<any, any>> implements SignerInterface {
|
|
3543
3542
|
readonly transporter: Transport;
|
|
3543
|
+
private _transporter;
|
|
3544
3544
|
readonly accountID: number;
|
|
3545
3545
|
readonly eip2645applicationName: string;
|
|
3546
3546
|
readonly pathBuffer: Uint8Array;
|
|
@@ -6723,6 +6723,8 @@ declare function getChecksumAddress(address: BigNumberish): string;
|
|
|
6723
6723
|
declare function validateChecksumAddress(address: string): boolean;
|
|
6724
6724
|
|
|
6725
6725
|
/**
|
|
6726
|
+
* @deprecated
|
|
6727
|
+
*
|
|
6726
6728
|
* Loosely validate a URL `string`.
|
|
6727
6729
|
*
|
|
6728
6730
|
* @param {string} s - The URL to check for
|
|
@@ -6735,6 +6737,8 @@ declare function validateChecksumAddress(address: string): boolean;
|
|
|
6735
6737
|
*/
|
|
6736
6738
|
declare function isUrl(s?: string): boolean;
|
|
6737
6739
|
/**
|
|
6740
|
+
* @deprecated
|
|
6741
|
+
*
|
|
6738
6742
|
* Builds a URL using the provided base URL, default path, and optional URL or path.
|
|
6739
6743
|
*
|
|
6740
6744
|
* @param {string} baseUrl - The base URL of the URL being built.
|
package/dist/index.global.js
CHANGED
|
@@ -28981,6 +28981,8 @@ var starknet = (() => {
|
|
|
28981
28981
|
// src/signer/ledgerSigner.ts
|
|
28982
28982
|
var LedgerSigner = class {
|
|
28983
28983
|
transporter;
|
|
28984
|
+
// this is a hack to allow the '@ledgerhq/hw-transport' type to be used as a dev dependency but not exposed in the production build
|
|
28985
|
+
_transporter;
|
|
28984
28986
|
accountID;
|
|
28985
28987
|
eip2645applicationName;
|
|
28986
28988
|
pathBuffer;
|
|
@@ -29006,6 +29008,7 @@ var starknet = (() => {
|
|
|
29006
29008
|
assert(accountID <= MASK_31, "Ledger account ID shall be < 2**31.");
|
|
29007
29009
|
assert(!!eip2645application, "Ledger application name shall not be empty.");
|
|
29008
29010
|
this.transporter = transport;
|
|
29011
|
+
this._transporter = this.transporter;
|
|
29009
29012
|
this.accountID = accountID;
|
|
29010
29013
|
this.pubKey = "";
|
|
29011
29014
|
this.fullPubKey = "";
|
|
@@ -29040,7 +29043,7 @@ var starknet = (() => {
|
|
|
29040
29043
|
*/
|
|
29041
29044
|
async getAppVersion() {
|
|
29042
29045
|
if (!this.appVersion) {
|
|
29043
|
-
const resp = await this.
|
|
29046
|
+
const resp = await this._transporter.send(Number("0x5a"), 0, 0, 0);
|
|
29044
29047
|
this.appVersion = `${resp[0]}.${resp[1]}.${resp[2]}`;
|
|
29045
29048
|
}
|
|
29046
29049
|
return this.appVersion;
|
|
@@ -29124,12 +29127,12 @@ var starknet = (() => {
|
|
|
29124
29127
|
}
|
|
29125
29128
|
async signRaw(msgHash) {
|
|
29126
29129
|
addHexPrefix(
|
|
29127
|
-
buf2hex(await this.
|
|
29130
|
+
buf2hex(await this._transporter.send(Number("0x5a"), 2, 0, 0, Buffer.from(this.pathBuffer)))
|
|
29128
29131
|
);
|
|
29129
29132
|
const shiftedHash = toHex(BigInt(msgHash) << 4n);
|
|
29130
29133
|
const buff2 = hexToBytes2(shiftedHash);
|
|
29131
29134
|
const respSign2 = Uint8Array.from(
|
|
29132
|
-
await this.
|
|
29135
|
+
await this._transporter.send(Number("0x5a"), 2, 1, 0, Buffer.from(buff2))
|
|
29133
29136
|
);
|
|
29134
29137
|
const r = BigInt(addHexPrefix(buf2hex(respSign2.subarray(1, 33))));
|
|
29135
29138
|
const s = BigInt(addHexPrefix(buf2hex(respSign2.subarray(33, 65))));
|
|
@@ -29141,7 +29144,7 @@ var starknet = (() => {
|
|
|
29141
29144
|
async getPublicKeys() {
|
|
29142
29145
|
const pathBuff = this.pathBuffer;
|
|
29143
29146
|
const respGetPublic = Uint8Array.from(
|
|
29144
|
-
await this.
|
|
29147
|
+
await this._transporter.send(Number("0x5a"), 1, 0, 0, Buffer.from(pathBuff))
|
|
29145
29148
|
);
|
|
29146
29149
|
this.pubKey = addHexPrefix(buf2hex(respGetPublic.subarray(1, 33)));
|
|
29147
29150
|
this.fullPubKey = addHexPrefix(buf2hex(respGetPublic.subarray(0, 65)));
|