starknet 4.17.0 → 4.18.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 +20 -0
- package/README.md +2 -10
- package/dist/index.d.ts +27 -9
- package/dist/index.global.js +30 -13
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +30 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -1
- package/.babelrc +0 -6
- package/.commitlintrc +0 -22
- package/.eslintignore +0 -2
- package/.eslintrc +0 -28
- package/.prettierrc +0 -6
- package/.releaserc +0 -28
- package/CODE_OF_CONDUCT.md +0 -128
- package/CONTRIBUTING.md +0 -52
- package/__mocks__/Account.json +0 -25486
- package/__mocks__/ERC20.json +0 -40027
- package/__mocks__/TestDapp.json +0 -12962
- package/__mocks__/contract.json +0 -33191
- package/__mocks__/l1l2_compiled.json +0 -10107
- package/__mocks__/multicall.json +0 -8139
- package/__mocks__/naming_compiled.json +0 -53283
- package/__mocks__/starknetId_compiled.json +0 -44703
- package/__mocks__/typedDataExample.json +0 -35
- package/__mocks__/typedDataSessionExample.json +0 -42
- package/__mocks__/typedDataStructArrayExample.json +0 -44
- package/__tests__/account.test.ts +0 -345
- package/__tests__/contract.test.ts +0 -249
- package/__tests__/defaultProvider.test.ts +0 -177
- package/__tests__/fixtures.ts +0 -84
- package/__tests__/jest.setup.ts +0 -30
- package/__tests__/rpcProvider.test.ts +0 -132
- package/__tests__/sequencerProvider.test.ts +0 -123
- package/__tests__/utils/__snapshots__/ellipticalCurve.test.ts.snap +0 -5
- package/__tests__/utils/__snapshots__/utils.browser.test.ts.snap +0 -5
- package/__tests__/utils/__snapshots__/utils.test.ts.snap +0 -5
- package/__tests__/utils/address.test.ts +0 -45
- package/__tests__/utils/ellipticalCurve.test.ts +0 -91
- package/__tests__/utils/merkle.test.ts +0 -256
- package/__tests__/utils/shortString.test.ts +0 -22
- package/__tests__/utils/starknetId.test.ts +0 -53
- package/__tests__/utils/transactionHash.test.ts +0 -17
- package/__tests__/utils/typedData.test.ts +0 -223
- package/__tests__/utils/uint256.test.ts +0 -32
- package/__tests__/utils/utils.browser.test.ts +0 -29
- package/__tests__/utils/utils.test.ts +0 -141
- package/img/logo.svg +0 -17
- package/index.d.ts +0 -2683
- package/index.global.js +0 -23192
- package/index.global.js.map +0 -1
- package/index.js +0 -4910
- package/index.js.map +0 -1
- package/index.mjs +0 -4852
- package/index.mjs.map +0 -1
- package/src/account/default.ts +0 -501
- package/src/account/index.ts +0 -2
- package/src/account/interface.ts +0 -309
- package/src/constants.ts +0 -2065
- package/src/contract/contractFactory.ts +0 -88
- package/src/contract/default.ts +0 -425
- package/src/contract/index.ts +0 -3
- package/src/contract/interface.ts +0 -106
- package/src/index.ts +0 -26
- package/src/provider/default.ts +0 -187
- package/src/provider/errors.ts +0 -14
- package/src/provider/index.ts +0 -9
- package/src/provider/interface.ts +0 -281
- package/src/provider/rpc.ts +0 -482
- package/src/provider/sequencer.ts +0 -523
- package/src/provider/utils.ts +0 -100
- package/src/signer/default.ts +0 -99
- package/src/signer/index.ts +0 -2
- package/src/signer/interface.ts +0 -77
- package/src/types/account.ts +0 -43
- package/src/types/api/index.ts +0 -10
- package/src/types/api/openrpc.ts +0 -607
- package/src/types/api/rpc.ts +0 -45
- package/src/types/api/sequencer.ts +0 -369
- package/src/types/contract.ts +0 -5
- package/src/types/index.ts +0 -8
- package/src/types/lib.ts +0 -143
- package/src/types/provider.ts +0 -134
- package/src/types/signer.ts +0 -24
- package/src/utils/address.ts +0 -44
- package/src/utils/calldata.ts +0 -250
- package/src/utils/ellipticCurve.ts +0 -120
- package/src/utils/encode.ts +0 -66
- package/src/utils/events.ts +0 -32
- package/src/utils/fetchPonyfill.ts +0 -5
- package/src/utils/hash.ts +0 -235
- package/src/utils/json.ts +0 -15
- package/src/utils/merkle.ts +0 -69
- package/src/utils/number.ts +0 -98
- package/src/utils/provider.ts +0 -28
- package/src/utils/responseParser/index.ts +0 -28
- package/src/utils/responseParser/rpc.ts +0 -70
- package/src/utils/responseParser/sequencer.ts +0 -135
- package/src/utils/shortString.ts +0 -21
- package/src/utils/stark.ts +0 -57
- package/src/utils/starknetId.ts +0 -116
- package/src/utils/transaction.ts +0 -56
- package/src/utils/typedData/index.ts +0 -247
- package/src/utils/typedData/types.ts +0 -37
- package/src/utils/typedData/utils.ts +0 -16
- package/src/utils/uint256.ts +0 -32
- package/src/utils/url.ts +0 -53
- package/tsconfig.eslint.json +0 -4
- package/tsup.config.ts +0 -9
- package/www/README.md +0 -41
- package/www/babel.config.js +0 -3
- package/www/code-examples/account.js +0 -65
- package/www/code-examples/amm.js +0 -44
- package/www/code-examples/erc20.js +0 -13
- package/www/code-examples/package-lock.json +0 -336
- package/www/code-examples/package.json +0 -15
- package/www/docs/API/_category_.json +0 -5
- package/www/docs/API/account.md +0 -463
- package/www/docs/API/changelog.md +0 -15
- package/www/docs/API/contract.md +0 -135
- package/www/docs/API/contractFactory.md +0 -45
- package/www/docs/API/index.md +0 -3
- package/www/docs/API/provider.md +0 -725
- package/www/docs/API/signer.md +0 -105
- package/www/docs/API/utils.md +0 -374
- package/www/docusaurus.config.js +0 -130
- package/www/guides/account.md +0 -140
- package/www/guides/cra.md +0 -3
- package/www/guides/erc20.md +0 -163
- package/www/guides/intro.md +0 -63
- package/www/package-lock.json +0 -20405
- package/www/package.json +0 -43
- package/www/sidebars.js +0 -31
- package/www/src/components/HomepageFeatures/index.tsx +0 -67
- package/www/src/components/HomepageFeatures/styles.module.css +0 -10
- package/www/src/css/custom.css +0 -39
- package/www/src/pages/index.module.css +0 -23
- package/www/src/pages/index.tsx +0 -40
- package/www/src/pages/markdown-page.md +0 -7
- package/www/static/.nojekyll +0 -0
- package/www/static/img/docusaurus.png +0 -0
- package/www/static/img/favicon.ico +0 -0
- package/www/static/img/logo.svg +0 -17
- package/www/static/img/starknet-1.png +0 -0
- package/www/static/img/starknet-2.png +0 -0
- package/www/static/img/starknet-3.png +0 -0
- package/www/static/img/tutorial/docsVersionDropdown.png +0 -0
- package/www/static/img/tutorial/localeDropdown.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# [4.18.0](https://github.com/0xs34n/starknet.js/compare/v4.17.1...v4.18.0) (2022-12-23)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- merge develop into branch ([21efcb1](https://github.com/0xs34n/starknet.js/commit/21efcb1cefd6ea70a9d49e060ff620e88002e3b6))
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- simulate_transaction support on sequencer ([304c3cc](https://github.com/0xs34n/starknet.js/commit/304c3cc1af81bc8810581546f043caca01db173b))
|
|
10
|
+
- update simulate tx ([8f3ea55](https://github.com/0xs34n/starknet.js/commit/8f3ea55eb1e23cefc0419902a2ebbe10ee373ccb))
|
|
11
|
+
- update simulate tx in sequencer ([d79a9fa](https://github.com/0xs34n/starknet.js/commit/d79a9faa307936561504c120f67f3fb2f18423b6))
|
|
12
|
+
|
|
13
|
+
## [4.17.1](https://github.com/0xs34n/starknet.js/compare/v4.17.0...v4.17.1) (2022-12-14)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
- estimateAccountDeployFee set nonce to constant 0 ([2110ef0](https://github.com/0xs34n/starknet.js/commit/2110ef09da63765609d60e01259c360a0e8a9ddf))
|
|
18
|
+
- nonce should be fixed for deploy account to 0 ([c8a38e5](https://github.com/0xs34n/starknet.js/commit/c8a38e5349e5c5ebe3bb0665a4fb18cd02811626))
|
|
19
|
+
- rpc deployAccountContract request, rpc nonce hotfix ([9576335](https://github.com/0xs34n/starknet.js/commit/9576335893561603cfd6a8ff4454b69cb49f7484))
|
|
20
|
+
|
|
1
21
|
# [4.17.0](https://github.com/0xs34n/starknet.js/compare/v4.16.0...v4.17.0) (2022-12-13)
|
|
2
22
|
|
|
3
23
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -56,14 +56,6 @@ Guides can be found [here](https://www.starknetjs.com/guides/intro)
|
|
|
56
56
|
|
|
57
57
|
[Click Here](https://www.starknetjs.com/docs/API/)
|
|
58
58
|
|
|
59
|
-
## 🚀 Powered by Starknet.js
|
|
60
|
-
|
|
61
|
-
- [Argent X - the first StarkNet wallet](https://github.com/argentlabs/argent-x)
|
|
62
|
-
- [Braavos - your new wallet on top of StarkNet](https://chrome.google.com/webstore/detail/braavos-wallet/jnlgamecbpmbajjfhmmmlhejkemejdma)
|
|
63
|
-
- [React + Starknet.js boilerplate](https://github.com/fracek/starknet-react-example)
|
|
64
|
-
- [AMM Demo](https://www.starknetswap.com/)
|
|
65
|
-
- [mySwap - the first DeFi app to launch on StarkNet](https://myswap.xyz)
|
|
66
|
-
|
|
67
59
|
## ✏️ Contributing
|
|
68
60
|
|
|
69
61
|
If you consider to contribute to this project please read [CONTRIBUTING.md](https://github.com/0xs34n/starknet.js/blob/main/CONTRIBUTING.md) first.
|
|
@@ -72,9 +64,9 @@ If you consider to contribute to this project please read [CONTRIBUTING.md](http
|
|
|
72
64
|
|
|
73
65
|
Special thanks to all the [contributors](https://github.com/0xs34n/starknet.js/graphs/contributors), especially to:
|
|
74
66
|
|
|
75
|
-
Janek ([@janek26](https://github.com/janek26))
|
|
67
|
+
Janek ([@janek26](https://github.com/janek26)) and Dhruv ([@dhruvkelawala](https://github.com/dhruvkelawala)) from [Argent](https://github.com/argentlabs)
|
|
76
68
|
|
|
77
|
-
|
|
69
|
+
Toni ([@tabaktoni](https://github.com/tabaktoni)) and Ivan ([@ivpavici](https://github.com/ivpavici)) from [Shard Labs](https://shardlabs.io/)
|
|
78
70
|
|
|
79
71
|
and of course the [StarkWare](https://starkware.co/) team for their dedicated support!
|
|
80
72
|
|
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;
|
|
@@ -1112,7 +1114,7 @@ declare type ExecutionResources = {
|
|
|
1112
1114
|
};
|
|
1113
1115
|
n_memory_holes: number;
|
|
1114
1116
|
};
|
|
1115
|
-
declare type
|
|
1117
|
+
declare type TransactionTraceResponse = {
|
|
1116
1118
|
validate_invocation?: FunctionInvocation;
|
|
1117
1119
|
function_invocation?: FunctionInvocation;
|
|
1118
1120
|
fee_transfer_invocation?: FunctionInvocation;
|
|
@@ -1254,10 +1256,16 @@ declare namespace Sequencer {
|
|
|
1254
1256
|
type DeployAccountEstimateFee = Omit<DeployAccountTransaction, 'max_fee'>;
|
|
1255
1257
|
type DeployEstimateFee = DeployTransaction;
|
|
1256
1258
|
type EstimateFeeRequest = InvokeEstimateFee | DeclareEstimateFee | DeployEstimateFee | DeployAccountEstimateFee;
|
|
1259
|
+
type TransactionSimulationResponse = {
|
|
1260
|
+
trace: TransactionTraceResponse;
|
|
1261
|
+
fee_estimation: Sequencer.EstimateFeeResponse;
|
|
1262
|
+
};
|
|
1263
|
+
type SimulateTransaction = Omit<InvokeFunctionTransaction, 'max_fee' | 'entry_point_type'>;
|
|
1257
1264
|
type EstimateFeeResponse = {
|
|
1258
1265
|
overall_fee: number;
|
|
1259
1266
|
gas_price: number;
|
|
1260
1267
|
gas_usage: number;
|
|
1268
|
+
uint: string;
|
|
1261
1269
|
} | {
|
|
1262
1270
|
amount: BN__default;
|
|
1263
1271
|
unit: string;
|
|
@@ -1292,7 +1300,7 @@ declare namespace Sequencer {
|
|
|
1292
1300
|
transactionHash: string;
|
|
1293
1301
|
};
|
|
1294
1302
|
REQUEST: never;
|
|
1295
|
-
RESPONSE:
|
|
1303
|
+
RESPONSE: TransactionTraceResponse;
|
|
1296
1304
|
};
|
|
1297
1305
|
get_transaction_receipt: {
|
|
1298
1306
|
QUERY: {
|
|
@@ -1382,6 +1390,13 @@ declare namespace Sequencer {
|
|
|
1382
1390
|
REQUEST: any;
|
|
1383
1391
|
RESPONSE: EstimateFeeResponse;
|
|
1384
1392
|
};
|
|
1393
|
+
simulate_transaction: {
|
|
1394
|
+
QUERY: {
|
|
1395
|
+
blockIdentifier: BlockIdentifier;
|
|
1396
|
+
};
|
|
1397
|
+
REQUEST: SimulateTransaction;
|
|
1398
|
+
RESPONSE: TransactionSimulationResponse;
|
|
1399
|
+
};
|
|
1385
1400
|
};
|
|
1386
1401
|
}
|
|
1387
1402
|
|
|
@@ -1723,8 +1738,9 @@ declare class SequencerProvider implements ProviderInterface {
|
|
|
1723
1738
|
* @param txHash
|
|
1724
1739
|
* @returns the transaction trace
|
|
1725
1740
|
*/
|
|
1726
|
-
getTransactionTrace(txHash: BigNumberish): Promise<
|
|
1741
|
+
getTransactionTrace(txHash: BigNumberish): Promise<TransactionTraceResponse>;
|
|
1727
1742
|
estimateMessageFee({ from_address, to_address, entry_point_selector, payload }: CallL1Handler, blockIdentifier?: BlockIdentifier): Promise<Sequencer.EstimateFeeResponse>;
|
|
1743
|
+
simulateTransaction(invocation: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier): Promise<Sequencer.TransactionSimulationResponse>;
|
|
1728
1744
|
}
|
|
1729
1745
|
|
|
1730
1746
|
interface ProviderOptions {
|
|
@@ -2008,10 +2024,12 @@ declare abstract class AccountInterface extends ProviderInterface {
|
|
|
2008
2024
|
/**
|
|
2009
2025
|
* Estimate Fee for executing a DEPLOY_ACCOUNT transaction on starknet
|
|
2010
2026
|
*
|
|
2011
|
-
* @param contractPayload
|
|
2027
|
+
* @param contractPayload -
|
|
2012
2028
|
* - contract - the compiled contract to be deployed
|
|
2013
2029
|
* - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli.
|
|
2014
|
-
*
|
|
2030
|
+
* @param estimateFeeDetails -
|
|
2031
|
+
* - optional blockIdentifier
|
|
2032
|
+
* - constant nonce = 0
|
|
2015
2033
|
* @returns response from estimate_fee
|
|
2016
2034
|
*/
|
|
2017
2035
|
abstract estimateAccountDeployFee(contractPayload: DeployAccountContractPayload, estimateFeeDetails?: EstimateFeeDetails): Promise<EstimateFeeResponse>;
|
|
@@ -2138,7 +2156,7 @@ declare abstract class AccountInterface extends ProviderInterface {
|
|
|
2138
2156
|
- optional address salt
|
|
2139
2157
|
- optional contractAddress
|
|
2140
2158
|
* @param transactionsDetail Invocation Details containing:
|
|
2141
|
-
-
|
|
2159
|
+
- constant nonce = 0
|
|
2142
2160
|
- optional version
|
|
2143
2161
|
- optional maxFee
|
|
2144
2162
|
* @returns a confirmation of sending a transaction on the starknet contract
|
|
@@ -2208,7 +2226,7 @@ declare class Account extends Provider implements AccountInterface {
|
|
|
2208
2226
|
estimateFee(calls: AllowArray<Call>, estimateFeeDetails?: EstimateFeeDetails | undefined): Promise<EstimateFee>;
|
|
2209
2227
|
estimateInvokeFee(calls: AllowArray<Call>, { nonce: providedNonce, blockIdentifier }?: EstimateFeeDetails): Promise<EstimateFee>;
|
|
2210
2228
|
estimateDeclareFee({ classHash, contract }: DeclareContractPayload, { blockIdentifier, nonce: providedNonce }?: EstimateFeeDetails): Promise<EstimateFee>;
|
|
2211
|
-
estimateAccountDeployFee({ classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress, }: DeployAccountContractPayload, { blockIdentifier
|
|
2229
|
+
estimateAccountDeployFee({ classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress, }: DeployAccountContractPayload, { blockIdentifier }?: EstimateFeeDetails): Promise<EstimateFee>;
|
|
2212
2230
|
estimateDeployFee(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], transactionsDetail?: InvocationsDetails | undefined): Promise<EstimateFee>;
|
|
2213
2231
|
execute(calls: AllowArray<Call>, abis?: Abi[] | undefined, transactionsDetail?: InvocationsDetails): Promise<InvokeFunctionResponse>;
|
|
2214
2232
|
declare({ classHash, contract }: DeclareContractPayload, transactionsDetail?: InvocationsDetails): Promise<DeclareContractResponse>;
|
|
@@ -2680,4 +2698,4 @@ declare function validateChecksumAddress(address: string): boolean;
|
|
|
2680
2698
|
declare function isUrl(s?: string): boolean;
|
|
2681
2699
|
declare function buildUrl(baseUrl: string, defaultPath: string, urlOrPath?: string): string;
|
|
2682
2700
|
|
|
2683
|
-
export { Abi, AbiEntry, Account, AccountInterface, AllowArray, Args, AsyncContractFunction, BlockNumber, BlockTag, Call, CallContractResponse, CallDetails, CallL1Handler, CallOptions, Calldata, CommonTransactionReceiptResponse, CommonTransactionResponse, CompiledContract, CompressedCompiledContract, CompressedProgram, Contract, ContractClass, ContractEntryPoint, ContractFactory, ContractFunction, ContractInterface, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployContractPayload, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeclareTransactionResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployContractPayload, DeployContractResponse, DeployContractUDCResponse, EntryPointType, EntryPointsByType, EstimateFee, EstimateFeeAction, EstimateFeeDetails, EstimateFeeResponse, Event, ExecutionResources, FunctionAbi, FunctionInvocation, GatewayError, GetBlockResponse, GetCodeResponse, GetContractAddressesResponse, GetTransactionReceiptResponse, GetTransactionResponse, GetTransactionStatusResponse,
|
|
2701
|
+
export { Abi, AbiEntry, Account, AccountInterface, AllowArray, Args, AsyncContractFunction, BlockNumber, BlockTag, Call, CallContractResponse, CallDetails, CallL1Handler, CallOptions, Calldata, CommonTransactionReceiptResponse, CommonTransactionResponse, CompiledContract, CompressedCompiledContract, CompressedProgram, Contract, ContractClass, ContractEntryPoint, ContractFactory, ContractFunction, ContractInterface, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployContractPayload, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeclareTransactionResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployContractPayload, DeployContractResponse, DeployContractUDCResponse, EntryPointType, EntryPointsByType, EstimateFee, EstimateFeeAction, EstimateFeeDetails, EstimateFeeResponse, Event, ExecutionResources, FunctionAbi, FunctionInvocation, GatewayError, GetBlockResponse, GetCodeResponse, GetContractAddressesResponse, GetTransactionReceiptResponse, GetTransactionResponse, GetTransactionStatusResponse, HttpError, Invocation, InvocationsDetails, InvocationsDetailsWithNonce, InvocationsSignerDetails, InvokeFunctionResponse, InvokeTransactionReceiptResponse, InvokeTransactionResponse, KeyPair, MessageToL1, MessageToL2, MultiDeployContractResponse, Overrides, ParsedStruct, Program, Provider, ProviderInterface, ProviderOptions, RPC, RawArgs, RawCalldata, Result, RpcProvider, RpcProviderOptions, Sequencer, SequencerProvider, SequencerProviderOptions, Signature, Signer, SignerInterface, Status, Struct, StructAbi, TransactionStatus, TransactionTraceResponse, TransactionType, UniversalDeployerContractPayload, addAddressPadding, buildUrl, constants, defaultProvider, ellipticCurve as ec, encode, getChecksumAddress, hash, isUrl, json, merkle, number, shortString, stark, transaction, index as typedData, uint256, validateAndParseAddress, validateChecksumAddress };
|
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) {
|
|
@@ -20790,7 +20792,7 @@ var starknet = (() => {
|
|
|
20790
20792
|
calldata: parseCalldata(functionInvocation.calldata),
|
|
20791
20793
|
type: "INVOKE",
|
|
20792
20794
|
max_fee: toHex(toBN(details.maxFee || 0)),
|
|
20793
|
-
version: toHex(toBN(details.version ||
|
|
20795
|
+
version: toHex(toBN(details.version || 1)),
|
|
20794
20796
|
signature: bigNumberishArrayToHexadecimalStringArray(functionInvocation.signature || []),
|
|
20795
20797
|
nonce: toHex(toBN(details.nonce))
|
|
20796
20798
|
}
|
|
@@ -21116,7 +21118,8 @@ var starknet = (() => {
|
|
|
21116
21118
|
"add_transaction",
|
|
21117
21119
|
"call_contract",
|
|
21118
21120
|
"estimate_fee",
|
|
21119
|
-
"estimate_message_fee"
|
|
21121
|
+
"estimate_message_fee",
|
|
21122
|
+
"simulate_transaction"
|
|
21120
21123
|
];
|
|
21121
21124
|
return postMethodEndpoints.includes(endpoint) ? "POST" : "GET";
|
|
21122
21125
|
}
|
|
@@ -21361,6 +21364,20 @@ ${res.tx_failure_reason.error_message}` : res.tx_status;
|
|
|
21361
21364
|
};
|
|
21362
21365
|
return this.fetchEndpoint("estimate_message_fee", { blockIdentifier }, validCallL1Handler);
|
|
21363
21366
|
}
|
|
21367
|
+
async simulateTransaction(invocation, invocationDetails, blockIdentifier = this.blockIdentifier) {
|
|
21368
|
+
return this.fetchEndpoint(
|
|
21369
|
+
"simulate_transaction",
|
|
21370
|
+
{ blockIdentifier },
|
|
21371
|
+
{
|
|
21372
|
+
type: "INVOKE_FUNCTION",
|
|
21373
|
+
contract_address: invocation.contractAddress,
|
|
21374
|
+
calldata: invocation.calldata ?? [],
|
|
21375
|
+
signature: bigNumberishArrayToDecimalStringArray(invocation.signature || []),
|
|
21376
|
+
version: toHex(toBN((invocationDetails == null ? void 0 : invocationDetails.version) || 1)),
|
|
21377
|
+
nonce: toHex(toBN(invocationDetails.nonce))
|
|
21378
|
+
}
|
|
21379
|
+
);
|
|
21380
|
+
}
|
|
21364
21381
|
};
|
|
21365
21382
|
|
|
21366
21383
|
// src/provider/default.ts
|
|
@@ -22502,8 +22519,8 @@ ${res.tx_failure_reason.error_message}` : res.tx_status;
|
|
|
22502
22519
|
addressSalt = 0,
|
|
22503
22520
|
constructorCalldata = [],
|
|
22504
22521
|
contractAddress: providedContractAddress
|
|
22505
|
-
}, { blockIdentifier
|
|
22506
|
-
const nonce =
|
|
22522
|
+
}, { blockIdentifier } = {}) {
|
|
22523
|
+
const nonce = "0x0";
|
|
22507
22524
|
const version3 = toBN(feeTransactionVersion);
|
|
22508
22525
|
const chainId = await this.getChainId();
|
|
22509
22526
|
const contractAddress = providedContractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, constructorCalldata, 0);
|
|
@@ -22662,7 +22679,7 @@ ${res.tx_failure_reason.error_message}` : res.tx_status;
|
|
|
22662
22679
|
addressSalt = 0,
|
|
22663
22680
|
contractAddress: providedContractAddress
|
|
22664
22681
|
}, transactionsDetail = {}) {
|
|
22665
|
-
const nonce =
|
|
22682
|
+
const nonce = "0x0";
|
|
22666
22683
|
const version3 = toBN(transactionVersion);
|
|
22667
22684
|
const chainId = await this.getChainId();
|
|
22668
22685
|
const contractAddress = providedContractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, constructorCalldata, 0);
|