starknet 4.17.0 → 4.17.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 +8 -0
- package/dist/index.d.ts +9 -5
- package/dist/index.global.js +13 -11
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +13 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -11
- package/dist/index.mjs.map +1 -1
- package/index.d.ts +9 -5
- package/index.global.js +13 -11
- package/index.global.js.map +1 -1
- package/index.js +13 -11
- package/index.js.map +1 -1
- package/index.mjs +13 -11
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/account/default.ts +3 -3
- package/src/account/interface.ts +5 -3
- package/src/provider/rpc.ts +10 -8
- package/src/types/api/openrpc.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [4.17.1](https://github.com/0xs34n/starknet.js/compare/v4.17.0...v4.17.1) (2022-12-14)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- estimateAccountDeployFee set nonce to constant 0 ([2110ef0](https://github.com/0xs34n/starknet.js/commit/2110ef09da63765609d60e01259c360a0e8a9ddf))
|
|
6
|
+
- nonce should be fixed for deploy account to 0 ([c8a38e5](https://github.com/0xs34n/starknet.js/commit/c8a38e5349e5c5ebe3bb0665a4fb18cd02811626))
|
|
7
|
+
- rpc deployAccountContract request, rpc nonce hotfix ([9576335](https://github.com/0xs34n/starknet.js/commit/9576335893561603cfd6a8ff4454b69cb49f7484))
|
|
8
|
+
|
|
1
9
|
# [4.17.0](https://github.com/0xs34n/starknet.js/compare/v4.16.0...v4.17.0) (2022-12-13)
|
|
2
10
|
|
|
3
11
|
### Bug Fixes
|
package/dist/index.d.ts
CHANGED
|
@@ -544,7 +544,9 @@ declare namespace OPENRPC {
|
|
|
544
544
|
errors: Errors.INVALID_CONTRACT_CLASS;
|
|
545
545
|
};
|
|
546
546
|
starknet_addDeployAccountTransaction: {
|
|
547
|
-
params:
|
|
547
|
+
params: {
|
|
548
|
+
deploy_account_transaction: BROADCASTED_DEPLOY_ACCOUNT_TXN;
|
|
549
|
+
};
|
|
548
550
|
result: {
|
|
549
551
|
transaction_hash: TXN_HASH;
|
|
550
552
|
contract_address: FELT;
|
|
@@ -2008,10 +2010,12 @@ declare abstract class AccountInterface extends ProviderInterface {
|
|
|
2008
2010
|
/**
|
|
2009
2011
|
* Estimate Fee for executing a DEPLOY_ACCOUNT transaction on starknet
|
|
2010
2012
|
*
|
|
2011
|
-
* @param contractPayload
|
|
2013
|
+
* @param contractPayload -
|
|
2012
2014
|
* - contract - the compiled contract to be deployed
|
|
2013
2015
|
* - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli.
|
|
2014
|
-
*
|
|
2016
|
+
* @param estimateFeeDetails -
|
|
2017
|
+
* - optional blockIdentifier
|
|
2018
|
+
* - constant nonce = 0
|
|
2015
2019
|
* @returns response from estimate_fee
|
|
2016
2020
|
*/
|
|
2017
2021
|
abstract estimateAccountDeployFee(contractPayload: DeployAccountContractPayload, estimateFeeDetails?: EstimateFeeDetails): Promise<EstimateFeeResponse>;
|
|
@@ -2138,7 +2142,7 @@ declare abstract class AccountInterface extends ProviderInterface {
|
|
|
2138
2142
|
- optional address salt
|
|
2139
2143
|
- optional contractAddress
|
|
2140
2144
|
* @param transactionsDetail Invocation Details containing:
|
|
2141
|
-
-
|
|
2145
|
+
- constant nonce = 0
|
|
2142
2146
|
- optional version
|
|
2143
2147
|
- optional maxFee
|
|
2144
2148
|
* @returns a confirmation of sending a transaction on the starknet contract
|
|
@@ -2208,7 +2212,7 @@ declare class Account extends Provider implements AccountInterface {
|
|
|
2208
2212
|
estimateFee(calls: AllowArray<Call>, estimateFeeDetails?: EstimateFeeDetails | undefined): Promise<EstimateFee>;
|
|
2209
2213
|
estimateInvokeFee(calls: AllowArray<Call>, { nonce: providedNonce, blockIdentifier }?: EstimateFeeDetails): Promise<EstimateFee>;
|
|
2210
2214
|
estimateDeclareFee({ classHash, contract }: DeclareContractPayload, { blockIdentifier, nonce: providedNonce }?: EstimateFeeDetails): Promise<EstimateFee>;
|
|
2211
|
-
estimateAccountDeployFee({ classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress, }: DeployAccountContractPayload, { blockIdentifier
|
|
2215
|
+
estimateAccountDeployFee({ classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress, }: DeployAccountContractPayload, { blockIdentifier }?: EstimateFeeDetails): Promise<EstimateFee>;
|
|
2212
2216
|
estimateDeployFee(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], transactionsDetail?: InvocationsDetails | undefined): Promise<EstimateFee>;
|
|
2213
2217
|
execute(calls: AllowArray<Call>, abis?: Abi[] | undefined, transactionsDetail?: InvocationsDetails): Promise<InvokeFunctionResponse>;
|
|
2214
2218
|
declare({ classHash, contract }: DeclareContractPayload, transactionsDetail?: InvocationsDetails): Promise<DeclareContractResponse>;
|
package/dist/index.global.js
CHANGED
|
@@ -20773,14 +20773,16 @@ var starknet = (() => {
|
|
|
20773
20773
|
}
|
|
20774
20774
|
async deployAccountContract({ classHash, constructorCalldata, addressSalt, signature }, details) {
|
|
20775
20775
|
return this.fetchEndpoint("starknet_addDeployAccountTransaction", {
|
|
20776
|
-
|
|
20777
|
-
|
|
20778
|
-
|
|
20779
|
-
|
|
20780
|
-
|
|
20781
|
-
|
|
20782
|
-
|
|
20783
|
-
|
|
20776
|
+
deploy_account_transaction: {
|
|
20777
|
+
constructor_calldata: bigNumberishArrayToHexadecimalStringArray(constructorCalldata || []),
|
|
20778
|
+
class_hash: toHex(toBN(classHash)),
|
|
20779
|
+
contract_address_salt: toHex(toBN(addressSalt || 0)),
|
|
20780
|
+
type: "DEPLOY_ACCOUNT",
|
|
20781
|
+
max_fee: toHex(toBN(details.maxFee || 0)),
|
|
20782
|
+
version: toHex(toBN(details.version || 0)),
|
|
20783
|
+
signature: bigNumberishArrayToHexadecimalStringArray(signature || []),
|
|
20784
|
+
nonce: toHex(toBN(details.nonce))
|
|
20785
|
+
}
|
|
20784
20786
|
});
|
|
20785
20787
|
}
|
|
20786
20788
|
async invokeFunction(functionInvocation, details) {
|
|
@@ -22502,8 +22504,8 @@ ${res.tx_failure_reason.error_message}` : res.tx_status;
|
|
|
22502
22504
|
addressSalt = 0,
|
|
22503
22505
|
constructorCalldata = [],
|
|
22504
22506
|
contractAddress: providedContractAddress
|
|
22505
|
-
}, { blockIdentifier
|
|
22506
|
-
const nonce =
|
|
22507
|
+
}, { blockIdentifier } = {}) {
|
|
22508
|
+
const nonce = "0x0";
|
|
22507
22509
|
const version3 = toBN(feeTransactionVersion);
|
|
22508
22510
|
const chainId = await this.getChainId();
|
|
22509
22511
|
const contractAddress = providedContractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, constructorCalldata, 0);
|
|
@@ -22662,7 +22664,7 @@ ${res.tx_failure_reason.error_message}` : res.tx_status;
|
|
|
22662
22664
|
addressSalt = 0,
|
|
22663
22665
|
contractAddress: providedContractAddress
|
|
22664
22666
|
}, transactionsDetail = {}) {
|
|
22665
|
-
const nonce =
|
|
22667
|
+
const nonce = "0x0";
|
|
22666
22668
|
const version3 = toBN(transactionVersion);
|
|
22667
22669
|
const chainId = await this.getChainId();
|
|
22668
22670
|
const contractAddress = providedContractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, constructorCalldata, 0);
|