starknet 5.19.6 → 5.20.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 CHANGED
@@ -1,3 +1,25 @@
1
+ # [5.20.0](https://github.com/0xs34n/starknet.js/compare/v5.19.6...v5.20.0) (2023-09-21)
2
+
3
+ ### Bug Fixes
4
+
5
+ - cairo 1 variable with \_len in name ([551adfa](https://github.com/0xs34n/starknet.js/commit/551adfa1d41192a5e725941537f25a15c8ee3380))
6
+ - goerli sequencer fixture ([0c6d153](https://github.com/0xs34n/starknet.js/commit/0c6d1532104327b06cae46e38f51b601d7fa0901))
7
+
8
+ ### Features
9
+
10
+ - remove testnet2(SN_GOERLI2) ([02e17de](https://github.com/0xs34n/starknet.js/commit/02e17ded113ced1c4dc01146159c4f8c6c67a243))
11
+
12
+ # [5.20.0](https://github.com/0xs34n/starknet.js/compare/v5.19.6...v5.20.0) (2023-09-21)
13
+
14
+ ### Bug Fixes
15
+
16
+ - cairo 1 variable with \_len in name ([551adfa](https://github.com/0xs34n/starknet.js/commit/551adfa1d41192a5e725941537f25a15c8ee3380))
17
+ - goerli sequencer fixture ([0c6d153](https://github.com/0xs34n/starknet.js/commit/0c6d1532104327b06cae46e38f51b601d7fa0901))
18
+
19
+ ### Features
20
+
21
+ - remove testnet2(SN_GOERLI2) ([02e17de](https://github.com/0xs34n/starknet.js/commit/02e17ded113ced1c4dc01146159c4f8c6c67a243))
22
+
1
23
  ## [5.19.6](https://github.com/0xs34n/starknet.js/compare/v5.19.5...v5.19.6) (2023-09-11)
2
24
 
3
25
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -133,18 +133,15 @@ declare const MASK_251: bigint;
133
133
  declare const API_VERSION = 0n;
134
134
  declare enum BaseUrl {
135
135
  SN_MAIN = "https://alpha-mainnet.starknet.io",
136
- SN_GOERLI = "https://alpha4.starknet.io",
137
- SN_GOERLI2 = "https://alpha4-2.starknet.io"
136
+ SN_GOERLI = "https://alpha4.starknet.io"
138
137
  }
139
138
  declare enum NetworkName {
140
139
  SN_MAIN = "SN_MAIN",
141
- SN_GOERLI = "SN_GOERLI",
142
- SN_GOERLI2 = "SN_GOERLI2"
140
+ SN_GOERLI = "SN_GOERLI"
143
141
  }
144
142
  declare enum StarknetChainId {
145
143
  SN_MAIN = "0x534e5f4d41494e",
146
- SN_GOERLI = "0x534e5f474f45524c49",
147
- SN_GOERLI2 = "0x534e5f474f45524c4932"
144
+ SN_GOERLI = "0x534e5f474f45524c49"
148
145
  }
149
146
  declare enum TransactionHashPrefix {
150
147
  DECLARE = "0x6465636c617265",
@@ -793,19 +793,16 @@ var starknet = (() => {
793
793
  var BaseUrl = /* @__PURE__ */ ((BaseUrl2) => {
794
794
  BaseUrl2["SN_MAIN"] = "https://alpha-mainnet.starknet.io";
795
795
  BaseUrl2["SN_GOERLI"] = "https://alpha4.starknet.io";
796
- BaseUrl2["SN_GOERLI2"] = "https://alpha4-2.starknet.io";
797
796
  return BaseUrl2;
798
797
  })(BaseUrl || {});
799
798
  var NetworkName = /* @__PURE__ */ ((NetworkName2) => {
800
799
  NetworkName2["SN_MAIN"] = "SN_MAIN";
801
800
  NetworkName2["SN_GOERLI"] = "SN_GOERLI";
802
- NetworkName2["SN_GOERLI2"] = "SN_GOERLI2";
803
801
  return NetworkName2;
804
802
  })(NetworkName || {});
805
803
  var StarknetChainId = /* @__PURE__ */ ((StarknetChainId4) => {
806
804
  StarknetChainId4["SN_MAIN"] = "0x534e5f4d41494e";
807
805
  StarknetChainId4["SN_GOERLI"] = "0x534e5f474f45524c49";
808
- StarknetChainId4["SN_GOERLI2"] = "0x534e5f474f45524c4932";
809
806
  return StarknetChainId4;
810
807
  })(StarknetChainId || {});
811
808
  var TransactionHashPrefix = /* @__PURE__ */ ((TransactionHashPrefix2) => {
@@ -3730,7 +3727,7 @@ var starknet = (() => {
3730
3727
  var isTypeBool = (type) => type === "core::bool";
3731
3728
  var isTypeContractAddress = (type) => type === "core::starknet::contract_address::ContractAddress";
3732
3729
  var isTypeEthAddress = (type) => type === "core::starknet::eth_address::EthAddress";
3733
- var isCairo1Type = (type) => type.includes("core::");
3730
+ var isCairo1Type = (type) => type.includes("::");
3734
3731
  var getArrayType = (type) => {
3735
3732
  if (isCairo1Type(type)) {
3736
3733
  return type.substring(type.indexOf("<") + 1, type.lastIndexOf(">"));
@@ -4273,7 +4270,7 @@ var starknet = (() => {
4273
4270
  enumerable: true,
4274
4271
  value
4275
4272
  });
4276
- if (isLen(abiParam.name)) {
4273
+ if (isLen(abiParam.name) && !isCairo1Type(abiParam.type)) {
4277
4274
  return orderedObject;
4278
4275
  }
4279
4276
  setProperty(orderInput(unorderedObject[abiParam.name], abiParam.type));
@@ -4888,7 +4885,7 @@ var starknet = (() => {
4888
4885
  }
4889
4886
  const argsIterator = args[Symbol.iterator]();
4890
4887
  const callArray = abiMethod.inputs.reduce(
4891
- (acc, input) => isLen(input.name) ? acc : acc.concat(parseCalldataField(argsIterator, input, this.structs, this.enums)),
4888
+ (acc, input) => isLen(input.name) && !isCairo1Type(input.type) ? acc : acc.concat(parseCalldataField(argsIterator, input, this.structs, this.enums)),
4892
4889
  []
4893
4890
  );
4894
4891
  Object.defineProperty(callArray, "__compiled__", {
@@ -11157,7 +11154,7 @@ var starknet = (() => {
11157
11154
  return obj === void 0 || Object.keys(obj).length === 0 || Object.keys(obj).length === 1 && Object.entries(obj).every(([k, v]) => k === "blockIdentifier" && v === null);
11158
11155
  }
11159
11156
  var defaultOptions2 = {
11160
- network: "SN_GOERLI2" /* SN_GOERLI2 */,
11157
+ network: "SN_GOERLI" /* SN_GOERLI */,
11161
11158
  blockIdentifier: "pending" /* pending */
11162
11159
  };
11163
11160
  var SequencerProvider = class {
@@ -11188,9 +11185,6 @@ var starknet = (() => {
11188
11185
  case "SN_GOERLI" /* SN_GOERLI */:
11189
11186
  case "0x534e5f474f45524c49" /* SN_GOERLI */:
11190
11187
  return "https://alpha4.starknet.io" /* SN_GOERLI */;
11191
- case "SN_GOERLI2" /* SN_GOERLI2 */:
11192
- case "0x534e5f474f45524c4932" /* SN_GOERLI2 */:
11193
- return "https://alpha4-2.starknet.io" /* SN_GOERLI2 */;
11194
11188
  default:
11195
11189
  throw new Error("Could not detect base url from NetworkName");
11196
11190
  }
@@ -11201,9 +11195,6 @@ var starknet = (() => {
11201
11195
  if (url.host.includes("mainnet.starknet.io")) {
11202
11196
  return "0x534e5f4d41494e" /* SN_MAIN */;
11203
11197
  }
11204
- if (url.host.includes("alpha4-2.starknet.io")) {
11205
- return "0x534e5f474f45524c4932" /* SN_GOERLI2 */;
11206
- }
11207
11198
  return "0x534e5f474f45524c49" /* SN_GOERLI */;
11208
11199
  } catch {
11209
11200
  console.error(`Could not parse baseUrl: ${baseUrl}`);