starknet 6.16.0 → 6.17.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,9 @@
1
+ # [6.17.0](https://github.com/starknet-io/starknet.js/compare/v6.16.0...v6.17.0) (2024-10-24)
2
+
3
+ ### Features
4
+
5
+ - Cairo u96 implementation ([#1247](https://github.com/starknet-io/starknet.js/issues/1247)) ([06f0a80](https://github.com/starknet-io/starknet.js/commit/06f0a8013405ded4685d0a21c4f245a25e7d4827))
6
+
1
7
  # [6.16.0](https://github.com/starknet-io/starknet.js/compare/v6.15.0...v6.16.0) (2024-10-24)
2
8
 
3
9
  ### Features
package/dist/index.d.ts CHANGED
@@ -2498,6 +2498,7 @@ declare const Literal: {
2498
2498
  readonly ClassHash: "core::starknet::class_hash::ClassHash";
2499
2499
  readonly ContractAddress: "core::starknet::contract_address::ContractAddress";
2500
2500
  readonly Secp256k1Point: "core::starknet::secp256k1::Secp256k1Point";
2501
+ readonly U96: "core::internal::bounded_int::BoundedInt::<0, 79228162514264337593543950335>";
2501
2502
  };
2502
2503
  type Literal = ValuesType<typeof Literal>;
2503
2504
  declare const ETH_ADDRESS = "core::starknet::eth_address::EthAddress";
@@ -7184,6 +7185,13 @@ declare const isTypeBytes31: (type: string) => type is "core::bytes_31::bytes31"
7184
7185
  * @returns - True if the given type is equal to 'core::byte_array::ByteArray', false otherwise.
7185
7186
  */
7186
7187
  declare const isTypeByteArray: (type: string) => type is "core::byte_array::ByteArray";
7188
+ /**
7189
+ * Checks if the given type is equal to the u96 type
7190
+ *
7191
+ * @param {string} type - The type to check.
7192
+ * @returns - True if the given type is equal to u96, false otherwise.
7193
+ */
7194
+ declare const isTypeU96: (type: string) => type is "core::internal::bounded_int::BoundedInt::<0, 79228162514264337593543950335>";
7187
7195
  declare const isTypeSecp256k1Point: (type: string) => type is "core::starknet::secp256k1::Secp256k1Point";
7188
7196
  declare const isCairo1Type: (type: string) => boolean;
7189
7197
  /**
@@ -7282,13 +7290,14 @@ declare const cairo_isTypeResult: typeof isTypeResult;
7282
7290
  declare const cairo_isTypeSecp256k1Point: typeof isTypeSecp256k1Point;
7283
7291
  declare const cairo_isTypeStruct: typeof isTypeStruct;
7284
7292
  declare const cairo_isTypeTuple: typeof isTypeTuple;
7293
+ declare const cairo_isTypeU96: typeof isTypeU96;
7285
7294
  declare const cairo_isTypeUint: typeof isTypeUint;
7286
7295
  declare const cairo_isTypeUint256: typeof isTypeUint256;
7287
7296
  declare const cairo_tuple: typeof tuple;
7288
7297
  declare const cairo_uint256: typeof uint256;
7289
7298
  declare const cairo_uint512: typeof uint512;
7290
7299
  declare namespace cairo {
7291
- export { cairo_felt as felt, cairo_getAbiContractVersion as getAbiContractVersion, cairo_getArrayType as getArrayType, cairo_isCairo1Abi as isCairo1Abi, cairo_isCairo1Type as isCairo1Type, cairo_isLen as isLen, cairo_isTypeArray as isTypeArray, cairo_isTypeBool as isTypeBool, cairo_isTypeByteArray as isTypeByteArray, cairo_isTypeBytes31 as isTypeBytes31, cairo_isTypeContractAddress as isTypeContractAddress, cairo_isTypeEnum as isTypeEnum, cairo_isTypeEthAddress as isTypeEthAddress, cairo_isTypeFelt as isTypeFelt, cairo_isTypeLiteral as isTypeLiteral, cairo_isTypeNamedTuple as isTypeNamedTuple, cairo_isTypeNonZero as isTypeNonZero, cairo_isTypeOption as isTypeOption, cairo_isTypeResult as isTypeResult, cairo_isTypeSecp256k1Point as isTypeSecp256k1Point, cairo_isTypeStruct as isTypeStruct, cairo_isTypeTuple as isTypeTuple, cairo_isTypeUint as isTypeUint, cairo_isTypeUint256 as isTypeUint256, cairo_tuple as tuple, cairo_uint256 as uint256, cairo_uint512 as uint512 };
7300
+ export { cairo_felt as felt, cairo_getAbiContractVersion as getAbiContractVersion, cairo_getArrayType as getArrayType, cairo_isCairo1Abi as isCairo1Abi, cairo_isCairo1Type as isCairo1Type, cairo_isLen as isLen, cairo_isTypeArray as isTypeArray, cairo_isTypeBool as isTypeBool, cairo_isTypeByteArray as isTypeByteArray, cairo_isTypeBytes31 as isTypeBytes31, cairo_isTypeContractAddress as isTypeContractAddress, cairo_isTypeEnum as isTypeEnum, cairo_isTypeEthAddress as isTypeEthAddress, cairo_isTypeFelt as isTypeFelt, cairo_isTypeLiteral as isTypeLiteral, cairo_isTypeNamedTuple as isTypeNamedTuple, cairo_isTypeNonZero as isTypeNonZero, cairo_isTypeOption as isTypeOption, cairo_isTypeResult as isTypeResult, cairo_isTypeSecp256k1Point as isTypeSecp256k1Point, cairo_isTypeStruct as isTypeStruct, cairo_isTypeTuple as isTypeTuple, cairo_isTypeU96 as isTypeU96, cairo_isTypeUint as isTypeUint, cairo_isTypeUint256 as isTypeUint256, cairo_tuple as tuple, cairo_uint256 as uint256, cairo_uint512 as uint512 };
7292
7301
  }
7293
7302
 
7294
7303
  /**
@@ -13982,7 +13982,8 @@ var starknet = (() => {
13982
13982
  var Literal = {
13983
13983
  ClassHash: "core::starknet::class_hash::ClassHash",
13984
13984
  ContractAddress: "core::starknet::contract_address::ContractAddress",
13985
- Secp256k1Point: "core::starknet::secp256k1::Secp256k1Point"
13985
+ Secp256k1Point: "core::starknet::secp256k1::Secp256k1Point",
13986
+ U96: "core::internal::bounded_int::BoundedInt::<0, 79228162514264337593543950335>"
13986
13987
  };
13987
13988
  var ETH_ADDRESS = "core::starknet::eth_address::EthAddress";
13988
13989
  var NON_ZERO_PREFIX = "core::zeroable::NonZero::";
@@ -16965,6 +16966,7 @@ var starknet = (() => {
16965
16966
  isTypeSecp256k1Point: () => isTypeSecp256k1Point,
16966
16967
  isTypeStruct: () => isTypeStruct,
16967
16968
  isTypeTuple: () => isTypeTuple,
16969
+ isTypeU96: () => isTypeU96,
16968
16970
  isTypeUint: () => isTypeUint,
16969
16971
  isTypeUint256: () => isTypeUint256,
16970
16972
  tuple: () => tuple,
@@ -17242,6 +17244,7 @@ var starknet = (() => {
17242
17244
  var isTypeEthAddress = (type) => type === ETH_ADDRESS;
17243
17245
  var isTypeBytes31 = (type) => type === "core::bytes_31::bytes31";
17244
17246
  var isTypeByteArray = (type) => type === "core::byte_array::ByteArray";
17247
+ var isTypeU96 = (type) => type === "core::internal::bounded_int::BoundedInt::<0, 79228162514264337593543950335>";
17245
17248
  var isTypeSecp256k1Point = (type) => type === Literal.Secp256k1Point;
17246
17249
  var isCairo1Type = (type) => type.includes("::");
17247
17250
  var getArrayType = (type) => {
@@ -17706,6 +17709,9 @@ var starknet = (() => {
17706
17709
  if (isTypeByteArray(abiType)) {
17707
17710
  return unorderedItem;
17708
17711
  }
17712
+ if (isTypeU96(abiType)) {
17713
+ return unorderedItem;
17714
+ }
17709
17715
  if (isTypeSecp256k1Point(abiType)) {
17710
17716
  return unorderedItem;
17711
17717
  }
@@ -18337,6 +18343,13 @@ var starknet = (() => {
18337
18343
  );
18338
18344
  break;
18339
18345
  }
18346
+ case Literal.U96: {
18347
+ assert(
18348
+ param >= 0n && param <= 2n ** 96n - 1n,
18349
+ `Validate: arg ${input.name} must be ${input.type} : a 96 bits number.`
18350
+ );
18351
+ break;
18352
+ }
18340
18353
  default:
18341
18354
  break;
18342
18355
  }