starknet 6.4.0 → 6.4.2
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 +12 -0
- package/dist/index.d.ts +10 -15
- package/dist/index.global.js +19 -47
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +19 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -47
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [6.4.2](https://github.com/starknet-io/starknet.js/compare/v6.4.1...v6.4.2) (2024-03-14)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- update starknetid sepolia contract addresses ([#1016](https://github.com/starknet-io/starknet.js/issues/1016)) ([b50a3bd](https://github.com/starknet-io/starknet.js/commit/b50a3bdada4345a9d601734762bc7a600766ec25))
|
|
6
|
+
|
|
7
|
+
## [6.4.1](https://github.com/starknet-io/starknet.js/compare/v6.4.0...v6.4.1) (2024-03-14)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- byteArray encoding for less than 31 chars ([#1011](https://github.com/starknet-io/starknet.js/issues/1011)) ([653acc4](https://github.com/starknet-io/starknet.js/commit/653acc44c841540214dd6f6b8956b354d7c27644))
|
|
12
|
+
|
|
1
13
|
# [6.4.0](https://github.com/starknet-io/starknet.js/compare/v6.3.0...v6.4.0) (2024-03-12)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
package/dist/index.d.ts
CHANGED
|
@@ -7107,11 +7107,6 @@ interface Context {
|
|
|
7107
7107
|
parent?: string;
|
|
7108
7108
|
key?: string;
|
|
7109
7109
|
}
|
|
7110
|
-
declare function byteArrayFromString$1(targetString: string): {
|
|
7111
|
-
data: BigNumberish[];
|
|
7112
|
-
pending_word: BigNumberish;
|
|
7113
|
-
pending_word_len: number;
|
|
7114
|
-
};
|
|
7115
7110
|
declare function prepareSelector(selector: string): string;
|
|
7116
7111
|
declare function isMerkleTreeType(type: StarkNetType): type is StarkNetMerkleType;
|
|
7117
7112
|
/**
|
|
@@ -7164,7 +7159,7 @@ declare const typedData_getTypeHash: typeof getTypeHash;
|
|
|
7164
7159
|
declare const typedData_isMerkleTreeType: typeof isMerkleTreeType;
|
|
7165
7160
|
declare const typedData_prepareSelector: typeof prepareSelector;
|
|
7166
7161
|
declare namespace typedData {
|
|
7167
|
-
export { type typedData_StarkNetDomain as StarkNetDomain, type typedData_StarkNetEnumType as StarkNetEnumType, type typedData_StarkNetMerkleType as StarkNetMerkleType, type typedData_StarkNetType as StarkNetType, type typedData_TypedData as TypedData, typedData_TypedDataRevision as TypedDataRevision,
|
|
7162
|
+
export { type typedData_StarkNetDomain as StarkNetDomain, type typedData_StarkNetEnumType as StarkNetEnumType, type typedData_StarkNetMerkleType as StarkNetMerkleType, type typedData_StarkNetType as StarkNetType, type typedData_TypedData as TypedData, typedData_TypedDataRevision as TypedDataRevision, typedData_encodeData as encodeData, typedData_encodeType as encodeType, typedData_encodeValue as encodeValue, typedData_getDependencies as getDependencies, typedData_getMessageHash as getMessageHash, typedData_getStructHash as getStructHash, typedData_getTypeHash as getTypeHash, typedData_isMerkleTreeType as isMerkleTreeType, typedData_prepareSelector as prepareSelector };
|
|
7168
7163
|
}
|
|
7169
7164
|
|
|
7170
7165
|
declare function useDecoded(encoded: bigint[]): string;
|
|
@@ -7172,13 +7167,13 @@ declare function useEncoded(decoded: string): bigint;
|
|
|
7172
7167
|
declare const enum StarknetIdContract {
|
|
7173
7168
|
MAINNET = "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678",
|
|
7174
7169
|
TESTNET = "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce",
|
|
7175
|
-
TESTNET_SEPOLIA = "
|
|
7170
|
+
TESTNET_SEPOLIA = "0x0707f09bc576bd7cfee59694846291047e965f4184fe13dac62c56759b3b6fa7"
|
|
7176
7171
|
}
|
|
7177
7172
|
declare function getStarknetIdContract(chainId: StarknetChainId): string;
|
|
7178
7173
|
declare const enum StarknetIdIdentityContract {
|
|
7179
7174
|
MAINNET = "0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af",
|
|
7180
7175
|
TESTNET = "0x783a9097b26eae0586373b2ce0ed3529ddc44069d1e0fbc4f66d42b69d6850d",
|
|
7181
|
-
TESTNET_SEPOLIA = "
|
|
7176
|
+
TESTNET_SEPOLIA = "0x070DF8B4F5cb2879f8592849fA8f3134da39d25326B8558cc9C8FE8D47EA3A90"
|
|
7182
7177
|
}
|
|
7183
7178
|
declare function getStarknetIdIdentityContract(chainId: StarknetChainId): string;
|
|
7184
7179
|
declare const StarknetIdMulticallContract = "0x034ffb8f4452df7a613a0210824d6414dbadcddce6c6e19bf4ddc9e22ce5f970";
|
|
@@ -7186,19 +7181,19 @@ declare function getStarknetIdMulticallContract(chainId: StarknetChainId): strin
|
|
|
7186
7181
|
declare const enum StarknetIdVerifierContract {
|
|
7187
7182
|
MAINNET = "0x07d14dfd8ee95b41fce179170d88ba1f0d5a512e13aeb232f19cfeec0a88f8bf",
|
|
7188
7183
|
TESTNET = "0x057c942544063c3aea6ea6c37009cc9d1beacd750cb6801549a129c7265f0f11",
|
|
7189
|
-
TESTNET_SEPOLIA = "
|
|
7184
|
+
TESTNET_SEPOLIA = "0x0182EcE8173C216A395f4828e1523541b7e3600bf190CB252E1a1A0cE219d184"
|
|
7190
7185
|
}
|
|
7191
7186
|
declare function getStarknetIdVerifierContract(chainId: StarknetChainId): string;
|
|
7192
7187
|
declare const enum StarknetIdPfpContract {
|
|
7193
7188
|
MAINNET = "0x070aaa20ec4a46da57c932d9fd89ca5e6bb9ca3188d3df361a32306aff7d59c7",
|
|
7194
7189
|
TESTNET = "0x03cac3228b434259734ee0e4ff445f642206ea11adace7e4f45edd2596748698",
|
|
7195
|
-
TESTNET_SEPOLIA = "
|
|
7190
|
+
TESTNET_SEPOLIA = "0x058061bb6bdc501eE215172c9f87d557C1E0f466dC498cA81b18f998Bf1362b2"
|
|
7196
7191
|
}
|
|
7197
7192
|
declare function getStarknetIdPfpContract(chainId: StarknetChainId): string;
|
|
7198
7193
|
declare const enum StarknetIdPopContract {
|
|
7199
7194
|
MAINNET = "0x0293eb2ba9862f762bd3036586d5755a782bd22e6f5028320f1d0405fd47bff4",
|
|
7200
7195
|
TESTNET = "0x03528caf090179e337931ee669a5b0214041e1bae30d460ff07d2cea2c7a9106",
|
|
7201
|
-
TESTNET_SEPOLIA = "
|
|
7196
|
+
TESTNET_SEPOLIA = "0x0023FE3b845ed5665a9eb3792bbB17347B490EE4090f855C1298d03BB5F49B49"
|
|
7202
7197
|
}
|
|
7203
7198
|
declare function getStarknetIdPopContract(chainId: StarknetChainId): string;
|
|
7204
7199
|
declare function execution(staticEx: {} | undefined, ifEqual?: number[] | undefined, ifNotEqual?: number[] | undefined): CairoCustomEnum;
|
|
@@ -7454,7 +7449,7 @@ declare namespace cairo {
|
|
|
7454
7449
|
* @example
|
|
7455
7450
|
* ```typescript
|
|
7456
7451
|
* const myByteArray = {
|
|
7457
|
-
* data: [
|
|
7452
|
+
* data: [],
|
|
7458
7453
|
* pending_word: '0x414243444546474849',
|
|
7459
7454
|
* pending_word_len: 9
|
|
7460
7455
|
* }
|
|
@@ -7468,16 +7463,16 @@ declare function stringFromByteArray(myByteArray: ByteArray): string;
|
|
|
7468
7463
|
* @returns Cairo representation of a LongString
|
|
7469
7464
|
* @example
|
|
7470
7465
|
* ```typescript
|
|
7471
|
-
* const myByteArray: ByteArray =
|
|
7466
|
+
* const myByteArray: ByteArray = byteArrayFromString("ABCDEFGHI");
|
|
7472
7467
|
* ```
|
|
7473
7468
|
* Result is :
|
|
7474
7469
|
* {
|
|
7475
|
-
* data: [
|
|
7470
|
+
* data: [],
|
|
7476
7471
|
* pending_word: '0x414243444546474849',
|
|
7477
7472
|
* pending_word_len: 9
|
|
7478
7473
|
* }
|
|
7479
7474
|
*/
|
|
7480
|
-
declare function byteArrayFromString(
|
|
7475
|
+
declare function byteArrayFromString(targetString: string): ByteArray;
|
|
7481
7476
|
|
|
7482
7477
|
declare const byteArray_byteArrayFromString: typeof byteArrayFromString;
|
|
7483
7478
|
declare const byteArray_stringFromByteArray: typeof stringFromByteArray;
|
package/dist/index.global.js
CHANGED
|
@@ -16179,31 +16179,15 @@ var starknet = (() => {
|
|
|
16179
16179
|
return cumuledString + add;
|
|
16180
16180
|
}, "") + pending_word;
|
|
16181
16181
|
}
|
|
16182
|
-
function byteArrayFromString(
|
|
16183
|
-
|
|
16184
|
-
|
|
16185
|
-
|
|
16186
|
-
|
|
16187
|
-
pending_word_len: 0
|
|
16188
|
-
};
|
|
16189
|
-
}
|
|
16190
|
-
const myShortStrings = splitLongString(myString);
|
|
16191
|
-
const remains = myShortStrings[myShortStrings.length - 1];
|
|
16192
|
-
const myShortStringsEncoded = myShortStrings.map(
|
|
16193
|
-
(shortStr) => encodeShortString(shortStr)
|
|
16194
|
-
);
|
|
16195
|
-
if (remains.length === 31) {
|
|
16196
|
-
return {
|
|
16197
|
-
data: myShortStringsEncoded,
|
|
16198
|
-
pending_word: "0x00",
|
|
16199
|
-
pending_word_len: 0
|
|
16200
|
-
};
|
|
16201
|
-
}
|
|
16202
|
-
const pendingEncodedWord = myShortStringsEncoded.pop();
|
|
16182
|
+
function byteArrayFromString(targetString) {
|
|
16183
|
+
const shortStrings = splitLongString(targetString);
|
|
16184
|
+
const remainder = shortStrings[shortStrings.length - 1];
|
|
16185
|
+
const shortStringsEncoded = shortStrings.map(encodeShortString);
|
|
16186
|
+
const [pendingWord, pendingWordLength] = remainder === void 0 || remainder.length === 31 ? ["0x00", 0] : [shortStringsEncoded.pop(), remainder.length];
|
|
16203
16187
|
return {
|
|
16204
|
-
data:
|
|
16205
|
-
pending_word:
|
|
16206
|
-
pending_word_len:
|
|
16188
|
+
data: shortStringsEncoded.length === 0 ? [] : shortStringsEncoded,
|
|
16189
|
+
pending_word: pendingWord,
|
|
16190
|
+
pending_word_len: pendingWordLength
|
|
16207
16191
|
};
|
|
16208
16192
|
}
|
|
16209
16193
|
|
|
@@ -25146,7 +25130,7 @@ var starknet = (() => {
|
|
|
25146
25130
|
var StarknetIdContract = /* @__PURE__ */ ((StarknetIdContract2) => {
|
|
25147
25131
|
StarknetIdContract2["MAINNET"] = "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678";
|
|
25148
25132
|
StarknetIdContract2["TESTNET"] = "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce";
|
|
25149
|
-
StarknetIdContract2["TESTNET_SEPOLIA"] = "
|
|
25133
|
+
StarknetIdContract2["TESTNET_SEPOLIA"] = "0x0707f09bc576bd7cfee59694846291047e965f4184fe13dac62c56759b3b6fa7";
|
|
25150
25134
|
return StarknetIdContract2;
|
|
25151
25135
|
})(StarknetIdContract || {});
|
|
25152
25136
|
function getStarknetIdContract(chainId) {
|
|
@@ -25156,7 +25140,7 @@ var starknet = (() => {
|
|
|
25156
25140
|
case "0x534e5f474f45524c49" /* SN_GOERLI */:
|
|
25157
25141
|
return "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce" /* TESTNET */;
|
|
25158
25142
|
case "0x534e5f5345504f4c4941" /* SN_SEPOLIA */:
|
|
25159
|
-
return "
|
|
25143
|
+
return "0x0707f09bc576bd7cfee59694846291047e965f4184fe13dac62c56759b3b6fa7" /* TESTNET_SEPOLIA */;
|
|
25160
25144
|
default:
|
|
25161
25145
|
throw new Error("Starknet.id is not yet deployed on this network");
|
|
25162
25146
|
}
|
|
@@ -25164,7 +25148,7 @@ var starknet = (() => {
|
|
|
25164
25148
|
var StarknetIdIdentityContract = /* @__PURE__ */ ((StarknetIdIdentityContract2) => {
|
|
25165
25149
|
StarknetIdIdentityContract2["MAINNET"] = "0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af";
|
|
25166
25150
|
StarknetIdIdentityContract2["TESTNET"] = "0x783a9097b26eae0586373b2ce0ed3529ddc44069d1e0fbc4f66d42b69d6850d";
|
|
25167
|
-
StarknetIdIdentityContract2["TESTNET_SEPOLIA"] = "
|
|
25151
|
+
StarknetIdIdentityContract2["TESTNET_SEPOLIA"] = "0x070DF8B4F5cb2879f8592849fA8f3134da39d25326B8558cc9C8FE8D47EA3A90";
|
|
25168
25152
|
return StarknetIdIdentityContract2;
|
|
25169
25153
|
})(StarknetIdIdentityContract || {});
|
|
25170
25154
|
function getStarknetIdIdentityContract(chainId) {
|
|
@@ -25174,7 +25158,7 @@ var starknet = (() => {
|
|
|
25174
25158
|
case "0x534e5f474f45524c49" /* SN_GOERLI */:
|
|
25175
25159
|
return "0x783a9097b26eae0586373b2ce0ed3529ddc44069d1e0fbc4f66d42b69d6850d" /* TESTNET */;
|
|
25176
25160
|
case "0x534e5f5345504f4c4941" /* SN_SEPOLIA */:
|
|
25177
|
-
return "
|
|
25161
|
+
return "0x070DF8B4F5cb2879f8592849fA8f3134da39d25326B8558cc9C8FE8D47EA3A90" /* TESTNET_SEPOLIA */;
|
|
25178
25162
|
default:
|
|
25179
25163
|
throw new Error("Starknet.id verifier contract is not yet deployed on this network");
|
|
25180
25164
|
}
|
|
@@ -25195,7 +25179,7 @@ var starknet = (() => {
|
|
|
25195
25179
|
var StarknetIdVerifierContract = /* @__PURE__ */ ((StarknetIdVerifierContract2) => {
|
|
25196
25180
|
StarknetIdVerifierContract2["MAINNET"] = "0x07d14dfd8ee95b41fce179170d88ba1f0d5a512e13aeb232f19cfeec0a88f8bf";
|
|
25197
25181
|
StarknetIdVerifierContract2["TESTNET"] = "0x057c942544063c3aea6ea6c37009cc9d1beacd750cb6801549a129c7265f0f11";
|
|
25198
|
-
StarknetIdVerifierContract2["TESTNET_SEPOLIA"] = "
|
|
25182
|
+
StarknetIdVerifierContract2["TESTNET_SEPOLIA"] = "0x0182EcE8173C216A395f4828e1523541b7e3600bf190CB252E1a1A0cE219d184";
|
|
25199
25183
|
return StarknetIdVerifierContract2;
|
|
25200
25184
|
})(StarknetIdVerifierContract || {});
|
|
25201
25185
|
function getStarknetIdVerifierContract(chainId) {
|
|
@@ -25205,7 +25189,7 @@ var starknet = (() => {
|
|
|
25205
25189
|
case "0x534e5f474f45524c49" /* SN_GOERLI */:
|
|
25206
25190
|
return "0x057c942544063c3aea6ea6c37009cc9d1beacd750cb6801549a129c7265f0f11" /* TESTNET */;
|
|
25207
25191
|
case "0x534e5f5345504f4c4941" /* SN_SEPOLIA */:
|
|
25208
|
-
return "
|
|
25192
|
+
return "0x0182EcE8173C216A395f4828e1523541b7e3600bf190CB252E1a1A0cE219d184" /* TESTNET_SEPOLIA */;
|
|
25209
25193
|
default:
|
|
25210
25194
|
throw new Error("Starknet.id verifier contract is not yet deployed on this network");
|
|
25211
25195
|
}
|
|
@@ -25213,7 +25197,7 @@ var starknet = (() => {
|
|
|
25213
25197
|
var StarknetIdPfpContract = /* @__PURE__ */ ((StarknetIdPfpContract2) => {
|
|
25214
25198
|
StarknetIdPfpContract2["MAINNET"] = "0x070aaa20ec4a46da57c932d9fd89ca5e6bb9ca3188d3df361a32306aff7d59c7";
|
|
25215
25199
|
StarknetIdPfpContract2["TESTNET"] = "0x03cac3228b434259734ee0e4ff445f642206ea11adace7e4f45edd2596748698";
|
|
25216
|
-
StarknetIdPfpContract2["TESTNET_SEPOLIA"] = "
|
|
25200
|
+
StarknetIdPfpContract2["TESTNET_SEPOLIA"] = "0x058061bb6bdc501eE215172c9f87d557C1E0f466dC498cA81b18f998Bf1362b2";
|
|
25217
25201
|
return StarknetIdPfpContract2;
|
|
25218
25202
|
})(StarknetIdPfpContract || {});
|
|
25219
25203
|
function getStarknetIdPfpContract(chainId) {
|
|
@@ -25223,7 +25207,7 @@ var starknet = (() => {
|
|
|
25223
25207
|
case "0x534e5f474f45524c49" /* SN_GOERLI */:
|
|
25224
25208
|
return "0x03cac3228b434259734ee0e4ff445f642206ea11adace7e4f45edd2596748698" /* TESTNET */;
|
|
25225
25209
|
case "0x534e5f5345504f4c4941" /* SN_SEPOLIA */:
|
|
25226
|
-
return "
|
|
25210
|
+
return "0x058061bb6bdc501eE215172c9f87d557C1E0f466dC498cA81b18f998Bf1362b2" /* TESTNET_SEPOLIA */;
|
|
25227
25211
|
default:
|
|
25228
25212
|
throw new Error(
|
|
25229
25213
|
"Starknet.id profile picture verifier contract is not yet deployed on this network"
|
|
@@ -25233,7 +25217,7 @@ var starknet = (() => {
|
|
|
25233
25217
|
var StarknetIdPopContract = /* @__PURE__ */ ((StarknetIdPopContract2) => {
|
|
25234
25218
|
StarknetIdPopContract2["MAINNET"] = "0x0293eb2ba9862f762bd3036586d5755a782bd22e6f5028320f1d0405fd47bff4";
|
|
25235
25219
|
StarknetIdPopContract2["TESTNET"] = "0x03528caf090179e337931ee669a5b0214041e1bae30d460ff07d2cea2c7a9106";
|
|
25236
|
-
StarknetIdPopContract2["TESTNET_SEPOLIA"] = "
|
|
25220
|
+
StarknetIdPopContract2["TESTNET_SEPOLIA"] = "0x0023FE3b845ed5665a9eb3792bbB17347B490EE4090f855C1298d03BB5F49B49";
|
|
25237
25221
|
return StarknetIdPopContract2;
|
|
25238
25222
|
})(StarknetIdPopContract || {});
|
|
25239
25223
|
function getStarknetIdPopContract(chainId) {
|
|
@@ -25243,7 +25227,7 @@ var starknet = (() => {
|
|
|
25243
25227
|
case "0x534e5f474f45524c49" /* SN_GOERLI */:
|
|
25244
25228
|
return "0x03528caf090179e337931ee669a5b0214041e1bae30d460ff07d2cea2c7a9106" /* TESTNET */;
|
|
25245
25229
|
case "0x534e5f5345504f4c4941" /* SN_SEPOLIA */:
|
|
25246
|
-
return "
|
|
25230
|
+
return "0x0023FE3b845ed5665a9eb3792bbB17347B490EE4090f855C1298d03BB5F49B49" /* TESTNET_SEPOLIA */;
|
|
25247
25231
|
default:
|
|
25248
25232
|
throw new Error(
|
|
25249
25233
|
"Starknet.id proof of personhood verifier contract is not yet deployed on this network"
|
|
@@ -25504,7 +25488,6 @@ var starknet = (() => {
|
|
|
25504
25488
|
var typedData_exports = {};
|
|
25505
25489
|
__export(typedData_exports, {
|
|
25506
25490
|
TypedDataRevision: () => TypedDataRevision,
|
|
25507
|
-
byteArrayFromString: () => byteArrayFromString2,
|
|
25508
25491
|
encodeData: () => encodeData,
|
|
25509
25492
|
encodeType: () => encodeType,
|
|
25510
25493
|
encodeValue: () => encodeValue,
|
|
@@ -25623,17 +25606,6 @@ var starknet = (() => {
|
|
|
25623
25606
|
presetTypes: {}
|
|
25624
25607
|
}
|
|
25625
25608
|
};
|
|
25626
|
-
function byteArrayFromString2(targetString) {
|
|
25627
|
-
const shortStrings = splitLongString(targetString);
|
|
25628
|
-
const remainder = shortStrings[shortStrings.length - 1];
|
|
25629
|
-
const shortStringsEncoded = shortStrings.map(encodeShortString);
|
|
25630
|
-
const [pendingWord, pendingWordLength] = remainder === void 0 || remainder.length === 31 ? ["0x00", 0] : [shortStringsEncoded.pop(), remainder.length];
|
|
25631
|
-
return {
|
|
25632
|
-
data: shortStringsEncoded.length === 0 ? ["0x00"] : shortStringsEncoded,
|
|
25633
|
-
pending_word: pendingWord,
|
|
25634
|
-
pending_word_len: pendingWordLength
|
|
25635
|
-
};
|
|
25636
|
-
}
|
|
25637
25609
|
function identifyRevision({ types, domain }) {
|
|
25638
25610
|
if (revisionConfiguration["1" /* Active */].domain in types && domain.revision === "1" /* Active */)
|
|
25639
25611
|
return "1" /* Active */;
|
|
@@ -25785,7 +25757,7 @@ var starknet = (() => {
|
|
|
25785
25757
|
}
|
|
25786
25758
|
case "string": {
|
|
25787
25759
|
if (revision === "1" /* Active */) {
|
|
25788
|
-
const byteArray =
|
|
25760
|
+
const byteArray = byteArrayFromString(data);
|
|
25789
25761
|
const elements = [
|
|
25790
25762
|
byteArray.data.length,
|
|
25791
25763
|
...byteArray.data,
|