starknet 7.5.1 → 7.6.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 +10 -0
- package/dist/index.d.ts +15 -2
- package/dist/index.global.js +16 -5
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -147,6 +147,7 @@ __export(index_exports, {
|
|
|
147
147
|
stark: () => stark_exports,
|
|
148
148
|
starknetId: () => starknetId_exports,
|
|
149
149
|
toAnyPatchVersion: () => toAnyPatchVersion,
|
|
150
|
+
toApiVersion: () => toApiVersion,
|
|
150
151
|
transaction: () => transaction_exports,
|
|
151
152
|
typedData: () => typedData_exports,
|
|
152
153
|
types: () => types_exports,
|
|
@@ -3700,6 +3701,10 @@ function toAnyPatchVersion(version) {
|
|
|
3700
3701
|
}
|
|
3701
3702
|
return `${parts[0]}.${parts[1]}.*`;
|
|
3702
3703
|
}
|
|
3704
|
+
function toApiVersion(version) {
|
|
3705
|
+
const [major, minor] = version.replace(/^v/, "").split(".");
|
|
3706
|
+
return `v${major}_${minor}`;
|
|
3707
|
+
}
|
|
3703
3708
|
function isPendingBlock(response) {
|
|
3704
3709
|
return response.status === "PENDING";
|
|
3705
3710
|
}
|
|
@@ -4028,6 +4033,7 @@ __export(provider_exports, {
|
|
|
4028
4033
|
createSierraContractClass: () => createSierraContractClass,
|
|
4029
4034
|
getDefaultNodeUrl: () => getDefaultNodeUrl,
|
|
4030
4035
|
getDefaultNodes: () => getDefaultNodes,
|
|
4036
|
+
getSupportedRpcVersions: () => getSupportedRpcVersions,
|
|
4031
4037
|
parseContract: () => parseContract,
|
|
4032
4038
|
validBlockTags: () => validBlockTags,
|
|
4033
4039
|
wait: () => wait
|
|
@@ -4065,15 +4071,17 @@ var getDefaultNodeUrl = (networkName, mute = false, rpcVersion) => {
|
|
|
4065
4071
|
return nodes[randIdx];
|
|
4066
4072
|
};
|
|
4067
4073
|
function getDefaultNodes(rpcVersion) {
|
|
4068
|
-
const vToUrl = (versionString) => `v${versionString.replace(/^v/, "").replace(/\./g, "_")}`;
|
|
4069
4074
|
const nodes = { ...RPC_DEFAULT_NODES };
|
|
4070
4075
|
Object.keys(nodes).forEach(function(key, _) {
|
|
4071
4076
|
nodes[key] = nodes[key].map((it) => {
|
|
4072
|
-
return `${it}${
|
|
4077
|
+
return `${it}${toApiVersion(rpcVersion)}`;
|
|
4073
4078
|
});
|
|
4074
4079
|
});
|
|
4075
4080
|
return nodes;
|
|
4076
4081
|
}
|
|
4082
|
+
function getSupportedRpcVersions() {
|
|
4083
|
+
return [...new Set(Object.values(_SupportedRpcVersion))];
|
|
4084
|
+
}
|
|
4077
4085
|
var validBlockTags = Object.values(BlockTag);
|
|
4078
4086
|
var Block = class {
|
|
4079
4087
|
/**
|
|
@@ -5446,7 +5454,8 @@ var RpcChannel2 = class {
|
|
|
5446
5454
|
type: RPCSPEC08.ETransactionType.INVOKE,
|
|
5447
5455
|
sender_address: invocation.contractAddress,
|
|
5448
5456
|
calldata: CallData.toHex(invocation.calldata),
|
|
5449
|
-
version: toHex(defaultVersions.v3),
|
|
5457
|
+
version: toHex(invocation.version || defaultVersions.v3),
|
|
5458
|
+
// invocation.version as simulate can use fee and normal version
|
|
5450
5459
|
...details
|
|
5451
5460
|
};
|
|
5452
5461
|
}
|
|
@@ -5464,7 +5473,8 @@ var RpcChannel2 = class {
|
|
|
5464
5473
|
},
|
|
5465
5474
|
compiled_class_hash: invocation.compiledClassHash || "",
|
|
5466
5475
|
sender_address: invocation.senderAddress,
|
|
5467
|
-
version: toHex(defaultVersions.v3),
|
|
5476
|
+
version: toHex(invocation.version || defaultVersions.v3),
|
|
5477
|
+
// invocation.version as simulate can use fee and normal version
|
|
5468
5478
|
...details
|
|
5469
5479
|
};
|
|
5470
5480
|
}
|
|
@@ -5475,7 +5485,8 @@ var RpcChannel2 = class {
|
|
|
5475
5485
|
constructor_calldata: CallData.toHex(invocation.constructorCalldata || []),
|
|
5476
5486
|
class_hash: toHex(invocation.classHash),
|
|
5477
5487
|
contract_address_salt: toHex(invocation.addressSalt || 0),
|
|
5478
|
-
version: toHex(defaultVersions.v3),
|
|
5488
|
+
version: toHex(invocation.version || defaultVersions.v3),
|
|
5489
|
+
// invocation.version as simulate can use fee and normal version
|
|
5479
5490
|
...restDetails
|
|
5480
5491
|
};
|
|
5481
5492
|
}
|
|
@@ -11025,6 +11036,7 @@ function units(amount, simbol = "fri") {
|
|
|
11025
11036
|
stark,
|
|
11026
11037
|
starknetId,
|
|
11027
11038
|
toAnyPatchVersion,
|
|
11039
|
+
toApiVersion,
|
|
11028
11040
|
transaction,
|
|
11029
11041
|
typedData,
|
|
11030
11042
|
types,
|