starknet 6.9.0 → 6.10.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 +12 -0
- package/LICENSE +1 -1
- package/README.md +5 -9
- package/dist/account/default.cjs +655 -0
- package/dist/account/default.d.ts +67 -0
- package/dist/account/default.mjs +652 -0
- package/dist/account/index.cjs +27 -0
- package/dist/account/index.d.ts +2 -0
- package/dist/account/index.mjs +2 -0
- package/dist/account/interface.cjs +9 -0
- package/dist/account/interface.d.ts +301 -0
- package/dist/account/interface.mjs +3 -0
- package/dist/channel/index.cjs +27 -0
- package/dist/channel/index.d.ts +3 -0
- package/dist/channel/index.mjs +3 -0
- package/dist/channel/rpc_0_6.cjs +607 -0
- package/dist/channel/rpc_0_6.d.ts +78 -0
- package/dist/channel/rpc_0_6.mjs +543 -0
- package/dist/channel/rpc_0_7.cjs +619 -0
- package/dist/channel/rpc_0_7.d.ts +81 -0
- package/dist/channel/rpc_0_7.mjs +561 -0
- package/dist/constants.cjs +76 -0
- package/dist/constants.d.ts +70 -0
- package/dist/constants.mjs +60 -0
- package/dist/contract/contractFactory.cjs +93 -0
- package/dist/contract/contractFactory.d.ts +46 -0
- package/dist/contract/contractFactory.mjs +83 -0
- package/dist/contract/default.cjs +269 -0
- package/dist/contract/default.d.ts +58 -0
- package/dist/contract/default.mjs +254 -0
- package/dist/contract/index.cjs +38 -0
- package/dist/contract/index.d.ts +3 -0
- package/dist/contract/index.mjs +3 -0
- package/dist/contract/interface.cjs +13 -0
- package/dist/contract/interface.d.ts +128 -0
- package/dist/contract/interface.mjs +6 -0
- package/dist/index.cjs +267 -0
- package/dist/index.d.ts +45 -5991
- package/dist/index.global.js +728 -609
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +39 -7320
- package/dist/provider/errors.cjs +50 -0
- package/dist/provider/errors.d.ts +16 -0
- package/dist/provider/errors.mjs +35 -0
- package/dist/provider/extensions/default.cjs +11 -0
- package/dist/provider/extensions/default.d.ts +6 -0
- package/dist/provider/extensions/default.mjs +5 -0
- package/dist/provider/extensions/starknetId.cjs +174 -0
- package/dist/provider/extensions/starknetId.d.ts +10 -0
- package/dist/provider/extensions/starknetId.mjs +230 -0
- package/dist/provider/index.cjs +56 -0
- package/dist/provider/index.d.ts +6 -0
- package/dist/provider/index.mjs +6 -0
- package/dist/provider/interface.cjs +8 -0
- package/dist/provider/interface.d.ts +261 -0
- package/dist/provider/interface.mjs +2 -0
- package/dist/provider/rpc.cjs +301 -0
- package/dist/provider/rpc.d.ts +115 -0
- package/dist/provider/rpc.mjs +302 -0
- package/dist/service/types.cjs +1 -0
- package/dist/service/types.d.ts +5 -0
- package/dist/service/types.mjs +0 -0
- package/dist/signer/default.cjs +105 -0
- package/dist/signer/default.d.ts +12 -0
- package/dist/signer/default.mjs +102 -0
- package/dist/signer/ethSigner.cjs +123 -0
- package/dist/signer/ethSigner.d.ts +25 -0
- package/dist/signer/ethSigner.mjs +140 -0
- package/dist/signer/index.cjs +38 -0
- package/dist/signer/index.d.ts +3 -0
- package/dist/signer/index.mjs +3 -0
- package/dist/signer/interface.cjs +8 -0
- package/dist/signer/interface.d.ts +115 -0
- package/dist/signer/interface.mjs +2 -0
- package/dist/types/account.cjs +1 -0
- package/dist/types/account.d.ts +79 -0
- package/dist/types/account.mjs +0 -0
- package/dist/types/api/index.cjs +30 -0
- package/dist/types/api/index.d.ts +4 -0
- package/dist/types/api/index.mjs +4 -0
- package/dist/types/api/jsonrpc/index.cjs +1 -0
- package/dist/types/api/jsonrpc/index.d.ts +21 -0
- package/dist/types/api/jsonrpc/index.mjs +0 -0
- package/dist/types/api/rpcspec_0_6/components.cjs +1 -0
- package/dist/types/api/rpcspec_0_6/components.d.ts +541 -0
- package/dist/types/api/rpcspec_0_6/components.mjs +0 -0
- package/dist/types/api/rpcspec_0_6/contract.cjs +1 -0
- package/dist/types/api/rpcspec_0_6/contract.d.ts +85 -0
- package/dist/types/api/rpcspec_0_6/contract.mjs +0 -0
- package/dist/types/api/rpcspec_0_6/errors.cjs +1 -0
- package/dist/types/api/rpcspec_0_6/errors.d.ts +128 -0
- package/dist/types/api/rpcspec_0_6/errors.mjs +0 -0
- package/dist/types/api/rpcspec_0_6/index.cjs +45 -0
- package/dist/types/api/rpcspec_0_6/index.d.ts +8 -0
- package/dist/types/api/rpcspec_0_6/index.mjs +5 -0
- package/dist/types/api/rpcspec_0_6/methods.cjs +1 -0
- package/dist/types/api/rpcspec_0_6/methods.d.ts +207 -0
- package/dist/types/api/rpcspec_0_6/methods.mjs +0 -0
- package/dist/types/api/rpcspec_0_6/nonspec.cjs +65 -0
- package/dist/types/api/rpcspec_0_6/nonspec.d.ts +147 -0
- package/dist/types/api/rpcspec_0_6/nonspec.mjs +59 -0
- package/dist/types/cairoEnum.cjs +1 -0
- package/dist/types/cairoEnum.d.ts +2 -0
- package/dist/types/cairoEnum.mjs +0 -0
- package/dist/types/calldata.cjs +27 -0
- package/dist/types/calldata.d.ts +23 -0
- package/dist/types/calldata.mjs +21 -0
- package/dist/types/contract.cjs +1 -0
- package/dist/types/contract.d.ts +27 -0
- package/dist/types/contract.mjs +0 -0
- package/dist/types/helpers/valuesType.cjs +1 -0
- package/dist/types/helpers/valuesType.d.ts +1 -0
- package/dist/types/helpers/valuesType.mjs +0 -0
- package/dist/types/index.cjs +121 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.mjs +10 -0
- package/dist/types/lib/contract/abi.cjs +1 -0
- package/dist/types/lib/contract/abi.d.ts +71 -0
- package/dist/types/lib/contract/abi.mjs +0 -0
- package/dist/types/lib/contract/index.cjs +50 -0
- package/dist/types/lib/contract/index.d.ts +26 -0
- package/dist/types/lib/contract/index.mjs +8 -0
- package/dist/types/lib/contract/legacy.cjs +1 -0
- package/dist/types/lib/contract/legacy.d.ts +33 -0
- package/dist/types/lib/contract/legacy.mjs +0 -0
- package/dist/types/lib/contract/sierra.cjs +1 -0
- package/dist/types/lib/contract/sierra.d.ts +52 -0
- package/dist/types/lib/contract/sierra.mjs +0 -0
- package/dist/types/lib/index.cjs +61 -0
- package/dist/types/lib/index.d.ts +259 -0
- package/dist/types/lib/index.mjs +36 -0
- package/dist/types/provider/configuration.cjs +1 -0
- package/dist/types/provider/configuration.d.ts +20 -0
- package/dist/types/provider/configuration.mjs +0 -0
- package/dist/types/provider/index.cjs +27 -0
- package/dist/types/provider/index.d.ts +2 -0
- package/dist/types/provider/index.mjs +2 -0
- package/dist/types/provider/response.cjs +30 -0
- package/dist/types/provider/response.d.ts +98 -0
- package/dist/types/provider/response.mjs +1 -0
- package/dist/types/provider/spec.cjs +1 -0
- package/dist/types/provider/spec.d.ts +49 -0
- package/dist/types/provider/spec.mjs +0 -0
- package/dist/types/signer.cjs +1 -0
- package/dist/types/signer.d.ts +49 -0
- package/dist/types/signer.mjs +0 -0
- package/dist/types/transactionReceipt.cjs +1 -0
- package/dist/types/transactionReceipt.d.ts +23 -0
- package/dist/types/transactionReceipt.mjs +0 -0
- package/dist/types/typedData.cjs +12 -0
- package/dist/types/typedData.d.ts +1 -0
- package/dist/types/typedData.mjs +3 -0
- package/dist/utils/address.cjs +44 -0
- package/dist/utils/address.d.ts +55 -0
- package/dist/utils/address.mjs +35 -0
- package/dist/utils/assert.cjs +11 -0
- package/dist/utils/assert.d.ts +12 -0
- package/dist/utils/assert.mjs +5 -0
- package/dist/utils/cairoDataTypes/felt.cjs +31 -0
- package/dist/utils/cairoDataTypes/felt.d.ts +6 -0
- package/dist/utils/cairoDataTypes/felt.mjs +27 -0
- package/dist/utils/cairoDataTypes/uint256.cjs +113 -0
- package/dist/utils/cairoDataTypes/uint256.d.ts +72 -0
- package/dist/utils/cairoDataTypes/uint256.mjs +103 -0
- package/dist/utils/cairoDataTypes/uint512.cjs +125 -0
- package/dist/utils/cairoDataTypes/uint512.d.ts +76 -0
- package/dist/utils/cairoDataTypes/uint512.mjs +123 -0
- package/dist/utils/calldata/byteArray.cjs +27 -0
- package/dist/utils/calldata/byteArray.d.ts +32 -0
- package/dist/utils/calldata/byteArray.mjs +20 -0
- package/dist/utils/calldata/cairo.cjs +114 -0
- package/dist/utils/calldata/cairo.d.ts +196 -0
- package/dist/utils/calldata/cairo.mjs +68 -0
- package/dist/utils/calldata/enum/CairoCustomEnum.cjs +55 -0
- package/dist/utils/calldata/enum/CairoCustomEnum.d.ts +38 -0
- package/dist/utils/calldata/enum/CairoCustomEnum.mjs +50 -0
- package/dist/utils/calldata/enum/CairoOption.cjs +55 -0
- package/dist/utils/calldata/enum/CairoOption.d.ts +37 -0
- package/dist/utils/calldata/enum/CairoOption.mjs +50 -0
- package/dist/utils/calldata/enum/CairoResult.cjs +54 -0
- package/dist/utils/calldata/enum/CairoResult.d.ts +36 -0
- package/dist/utils/calldata/enum/CairoResult.mjs +47 -0
- package/dist/utils/calldata/enum/index.cjs +38 -0
- package/dist/utils/calldata/enum/index.d.ts +3 -0
- package/dist/utils/calldata/enum/index.mjs +3 -0
- package/dist/utils/calldata/formatter.cjs +55 -0
- package/dist/utils/calldata/formatter.d.ts +9 -0
- package/dist/utils/calldata/formatter.mjs +58 -0
- package/dist/utils/calldata/index.cjs +272 -0
- package/dist/utils/calldata/index.d.ts +90 -0
- package/dist/utils/calldata/index.mjs +276 -0
- package/dist/utils/calldata/parser/index.cjs +29 -0
- package/dist/utils/calldata/parser/index.d.ts +5 -0
- package/dist/utils/calldata/parser/index.mjs +21 -0
- package/dist/utils/calldata/parser/interface.cjs +8 -0
- package/dist/utils/calldata/parser/interface.d.ts +20 -0
- package/dist/utils/calldata/parser/interface.mjs +2 -0
- package/dist/utils/calldata/parser/parser-0-1.1.0.cjs +38 -0
- package/dist/utils/calldata/parser/parser-0-1.1.0.d.ts +24 -0
- package/dist/utils/calldata/parser/parser-0-1.1.0.mjs +31 -0
- package/dist/utils/calldata/parser/parser-2.0.0.cjs +42 -0
- package/dist/utils/calldata/parser/parser-2.0.0.d.ts +23 -0
- package/dist/utils/calldata/parser/parser-2.0.0.mjs +37 -0
- package/dist/utils/calldata/propertyOrder.cjs +159 -0
- package/dist/utils/calldata/propertyOrder.d.ts +2 -0
- package/dist/utils/calldata/propertyOrder.mjs +189 -0
- package/dist/utils/calldata/requestParser.cjs +204 -0
- package/dist/utils/calldata/requestParser.d.ts +11 -0
- package/dist/utils/calldata/requestParser.mjs +231 -0
- package/dist/utils/calldata/responseParser.cjs +200 -0
- package/dist/utils/calldata/responseParser.d.ts +11 -0
- package/dist/utils/calldata/responseParser.mjs +201 -0
- package/dist/utils/calldata/tuple.cjs +106 -0
- package/dist/utils/calldata/tuple.d.ts +6 -0
- package/dist/utils/calldata/tuple.mjs +88 -0
- package/dist/utils/calldata/validate.cjs +241 -0
- package/dist/utils/calldata/validate.d.ts +6 -0
- package/dist/utils/calldata/validate.mjs +315 -0
- package/dist/utils/contract.cjs +40 -0
- package/dist/utils/contract.d.ts +37 -0
- package/dist/utils/contract.mjs +31 -0
- package/dist/utils/ec.cjs +12 -0
- package/dist/utils/ec.d.ts +2 -0
- package/dist/utils/ec.mjs +2 -0
- package/dist/utils/encode.cjs +78 -0
- package/dist/utils/encode.d.ts +207 -0
- package/dist/utils/encode.mjs +56 -0
- package/dist/utils/eth.cjs +22 -0
- package/dist/utils/eth.d.ts +22 -0
- package/dist/utils/eth.mjs +14 -0
- package/dist/utils/events/index.cjs +144 -0
- package/dist/utils/events/index.d.ts +84 -0
- package/dist/utils/events/index.mjs +136 -0
- package/dist/utils/fetchPonyfill.cjs +14 -0
- package/dist/utils/fetchPonyfill.d.ts +2 -0
- package/dist/utils/fetchPonyfill.mjs +5 -0
- package/dist/utils/hash/classHash.cjs +151 -0
- package/dist/utils/hash/classHash.d.ts +120 -0
- package/dist/utils/hash/classHash.mjs +168 -0
- package/dist/utils/hash/index.cjs +49 -0
- package/dist/utils/hash/index.d.ts +7 -0
- package/dist/utils/hash/index.mjs +4 -0
- package/dist/utils/hash/selector.cjs +37 -0
- package/dist/utils/hash/selector.d.ts +57 -0
- package/dist/utils/hash/selector.mjs +28 -0
- package/dist/utils/hash/transactionHash/index.cjs +38 -0
- package/dist/utils/hash/transactionHash/index.d.ts +81 -0
- package/dist/utils/hash/transactionHash/index.mjs +102 -0
- package/dist/utils/hash/transactionHash/v2.cjs +31 -0
- package/dist/utils/hash/transactionHash/v2.d.ts +34 -0
- package/dist/utils/hash/transactionHash/v2.mjs +57 -0
- package/dist/utils/hash/transactionHash/v3.cjs +45 -0
- package/dist/utils/hash/transactionHash/v3.d.ts +24 -0
- package/dist/utils/hash/transactionHash/v3.mjs +80 -0
- package/dist/utils/json.cjs +21 -0
- package/dist/utils/json.d.ts +50 -0
- package/dist/utils/json.mjs +10 -0
- package/dist/utils/merkle.cjs +118 -0
- package/dist/utils/merkle.d.ts +87 -0
- package/dist/utils/merkle.mjs +114 -0
- package/dist/utils/num.cjs +109 -0
- package/dist/utils/num.d.ts +283 -0
- package/dist/utils/num.mjs +86 -0
- package/dist/utils/provider.cjs +182 -0
- package/dist/utils/provider.d.ts +217 -0
- package/dist/utils/provider.mjs +158 -0
- package/dist/utils/responseParser/index.cjs +27 -0
- package/dist/utils/responseParser/index.d.ts +2 -0
- package/dist/utils/responseParser/index.mjs +2 -0
- package/dist/utils/responseParser/interface.cjs +8 -0
- package/dist/utils/responseParser/interface.d.ts +13 -0
- package/dist/utils/responseParser/interface.mjs +2 -0
- package/dist/utils/responseParser/rpc.cjs +83 -0
- package/dist/utils/responseParser/rpc.d.ts +19 -0
- package/dist/utils/responseParser/rpc.mjs +77 -0
- package/dist/utils/shortString.cjs +56 -0
- package/dist/utils/shortString.d.ts +116 -0
- package/dist/utils/shortString.mjs +39 -0
- package/dist/utils/stark.cjs +137 -0
- package/dist/utils/stark.d.ts +224 -0
- package/dist/utils/stark.mjs +109 -0
- package/dist/utils/starknetId.cjs +196 -0
- package/dist/utils/starknetId.d.ts +182 -0
- package/dist/utils/starknetId.mjs +185 -0
- package/dist/utils/transaction.cjs +115 -0
- package/dist/utils/transaction.d.ts +185 -0
- package/dist/utils/transaction.mjs +98 -0
- package/dist/utils/transactionReceipt.cjs +54 -0
- package/dist/utils/transactionReceipt.d.ts +33 -0
- package/dist/utils/transactionReceipt.mjs +49 -0
- package/dist/utils/typedData.cjs +285 -0
- package/dist/utils/typedData.d.ts +54 -0
- package/dist/utils/typedData.mjs +286 -0
- package/dist/utils/uint256.cjs +30 -0
- package/dist/utils/uint256.d.ts +45 -0
- package/dist/utils/uint256.mjs +11 -0
- package/dist/utils/url.cjs +35 -0
- package/dist/utils/url.d.ts +29 -0
- package/dist/utils/url.mjs +27 -0
- package/dist/wallet/account.cjs +115 -0
- package/dist/wallet/account.d.ts +31 -0
- package/dist/wallet/account.mjs +112 -0
- package/dist/wallet/connect.cjs +90 -0
- package/dist/wallet/connect.d.ts +82 -0
- package/dist/wallet/connect.mjs +64 -0
- package/dist/wallet/index.cjs +16 -0
- package/dist/wallet/index.d.ts +1 -0
- package/dist/wallet/index.mjs +1 -0
- package/dist/wallet/types.cjs +1 -0
- package/dist/wallet/types.d.ts +4 -0
- package/dist/wallet/types.mjs +0 -0
- package/package.json +13 -13
- package/dist/index.js +0 -7426
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { ProviderInterface } from '../provider';
|
|
2
|
+
import { SignerInterface } from '../signer';
|
|
3
|
+
import { Abi, AllowArray, BigNumberish, BlockIdentifier, CairoVersion, Call, DeclareAndDeployContractPayload, DeclareContractPayload, DeclareContractResponse, DeclareDeployUDCResponse, DeployAccountContractPayload, DeployContractResponse, DeployContractUDCResponse, EstimateFee, EstimateFeeAction, EstimateFeeDetails, EstimateFeeResponse, EstimateFeeResponseBulk, Invocations, InvocationsDetails, InvokeFunctionResponse, MultiDeployContractResponse, Nonce, Signature, SimulateTransactionDetails, SimulateTransactionResponse, TypedData, UniversalDeployerContractPayload } from '../types';
|
|
4
|
+
export declare abstract class AccountInterface extends ProviderInterface {
|
|
5
|
+
abstract address: string;
|
|
6
|
+
abstract signer: SignerInterface;
|
|
7
|
+
abstract cairoVersion: CairoVersion;
|
|
8
|
+
/**
|
|
9
|
+
* Estimate Fee for executing an INVOKE transaction on starknet
|
|
10
|
+
*
|
|
11
|
+
* @param calls the invocation object containing:
|
|
12
|
+
* - contractAddress - the address of the contract
|
|
13
|
+
* - entrypoint - the entrypoint of the contract
|
|
14
|
+
* - calldata? - (defaults to []) the calldata
|
|
15
|
+
*
|
|
16
|
+
* @param estimateFeeDetails -
|
|
17
|
+
* - blockIdentifier?
|
|
18
|
+
* - nonce? = 0
|
|
19
|
+
* - skipValidate? - default true
|
|
20
|
+
* - tip? - prioritize order of transactions in the mempool.
|
|
21
|
+
* - accountDeploymentData? - deploy an account contract (substitution for deploy account transaction)
|
|
22
|
+
* - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337)
|
|
23
|
+
* - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
|
|
24
|
+
* - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
|
|
25
|
+
* - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei
|
|
26
|
+
*
|
|
27
|
+
* @returns response from estimate_fee
|
|
28
|
+
*/
|
|
29
|
+
abstract estimateInvokeFee(calls: AllowArray<Call>, estimateFeeDetails?: EstimateFeeDetails): Promise<EstimateFeeResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Estimate Fee for executing a DECLARE transaction on starknet
|
|
32
|
+
*
|
|
33
|
+
* @param contractPayload the payload object containing:
|
|
34
|
+
* - contract - the compiled contract to be declared
|
|
35
|
+
* - casm? - compiled cairo assembly. Cairo1(casm or compiledClassHash are required)
|
|
36
|
+
* - classHash? - the class hash of the compiled contract. Precalculate for faster execution.
|
|
37
|
+
* - compiledClassHash?: class hash of the cairo assembly. Cairo1(casm or compiledClassHash are required)
|
|
38
|
+
*
|
|
39
|
+
* @param estimateFeeDetails -
|
|
40
|
+
* - blockIdentifier?
|
|
41
|
+
* - nonce? = 0
|
|
42
|
+
* - skipValidate? - default true
|
|
43
|
+
* - tip? - prioritize order of transactions in the mempool.
|
|
44
|
+
* - accountDeploymentData? - deploy an account contract (substitution for deploy account transaction)
|
|
45
|
+
* - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337)
|
|
46
|
+
* - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
|
|
47
|
+
* - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
|
|
48
|
+
* - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei
|
|
49
|
+
*
|
|
50
|
+
* @returns response from estimate_fee
|
|
51
|
+
*/
|
|
52
|
+
abstract estimateDeclareFee(contractPayload: DeclareContractPayload, estimateFeeDetails?: EstimateFeeDetails): Promise<EstimateFeeResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Estimate Fee for executing a DEPLOY_ACCOUNT transaction on starknet
|
|
55
|
+
*
|
|
56
|
+
* @param contractPayload -
|
|
57
|
+
* - classHash - the class hash of the compiled contract.
|
|
58
|
+
* - constructorCalldata? - constructor data;
|
|
59
|
+
* - contractAddress? - future account contract address. Precalculate for faster execution.
|
|
60
|
+
* - addressSalt? - salt used for calculation of the contractAddress. Required if contractAddress is provided.
|
|
61
|
+
*
|
|
62
|
+
* @param estimateFeeDetails -
|
|
63
|
+
* - blockIdentifier?
|
|
64
|
+
* - nonce? = 0
|
|
65
|
+
* - skipValidate? - default true
|
|
66
|
+
* - tip? - prioritize order of transactions in the mempool.
|
|
67
|
+
* - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337)
|
|
68
|
+
* - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
|
|
69
|
+
* - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
|
|
70
|
+
* - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei
|
|
71
|
+
*
|
|
72
|
+
* @returns response from estimate_fee
|
|
73
|
+
*/
|
|
74
|
+
abstract estimateAccountDeployFee(contractPayload: DeployAccountContractPayload, estimateFeeDetails?: EstimateFeeDetails): Promise<EstimateFeeResponse>;
|
|
75
|
+
/**
|
|
76
|
+
* Estimate Fee for executing a UDC DEPLOY transaction on starknet
|
|
77
|
+
* This is different from the normal DEPLOY transaction as it goes through the Universal Deployer Contract (UDC)
|
|
78
|
+
|
|
79
|
+
* @param deployContractPayload array or singular
|
|
80
|
+
* - classHash: computed class hash of compiled contract
|
|
81
|
+
* - salt: address salt
|
|
82
|
+
* - unique: bool if true ensure unique salt
|
|
83
|
+
* - constructorCalldata: constructor calldata
|
|
84
|
+
*
|
|
85
|
+
* @param estimateFeeDetails -
|
|
86
|
+
* - blockIdentifier?
|
|
87
|
+
* - nonce?
|
|
88
|
+
* - skipValidate? - default true
|
|
89
|
+
* - tip? - prioritize order of transactions in the mempool.
|
|
90
|
+
* - accountDeploymentData? - deploy an account contract (substitution for deploy account transaction)
|
|
91
|
+
* - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337)
|
|
92
|
+
* - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
|
|
93
|
+
* - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
|
|
94
|
+
* - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei
|
|
95
|
+
*/
|
|
96
|
+
abstract estimateDeployFee(deployContractPayload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], estimateFeeDetails?: EstimateFeeDetails): Promise<EstimateFeeResponse>;
|
|
97
|
+
/**
|
|
98
|
+
* Estimate Fee for executing a list of transactions on starknet
|
|
99
|
+
* Contract must be deployed for fee estimation to be possible
|
|
100
|
+
*
|
|
101
|
+
* @param invocations array of transaction object containing :
|
|
102
|
+
* - type - the type of transaction : 'DECLARE' | (multi)'DEPLOY' | (multi)'INVOKE_FUNCTION' | 'DEPLOY_ACCOUNT'
|
|
103
|
+
* - payload - the payload of the transaction
|
|
104
|
+
*
|
|
105
|
+
* @param details -
|
|
106
|
+
* - blockIdentifier?
|
|
107
|
+
* - nonce?
|
|
108
|
+
* - skipValidate? - default true
|
|
109
|
+
* - tip? - prioritize order of transactions in the mempool.
|
|
110
|
+
* - accountDeploymentData? - deploy an account contract (substitution for deploy account transaction)
|
|
111
|
+
* - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337)
|
|
112
|
+
* - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
|
|
113
|
+
* - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
|
|
114
|
+
* - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei
|
|
115
|
+
*
|
|
116
|
+
* @returns response from estimate_fee
|
|
117
|
+
*/
|
|
118
|
+
abstract estimateFeeBulk(invocations: Invocations, details?: EstimateFeeDetails): Promise<EstimateFeeResponseBulk>;
|
|
119
|
+
/**
|
|
120
|
+
* Gets Suggested Max Fee based on the transaction type
|
|
121
|
+
*
|
|
122
|
+
* @param {EstimateFeeAction} estimateFeeAction
|
|
123
|
+
* @param {EstimateFeeDetails} details
|
|
124
|
+
* @returns EstimateFee (...response, resourceBounds, suggestedMaxFee)
|
|
125
|
+
*/
|
|
126
|
+
abstract getSuggestedFee(estimateFeeAction: EstimateFeeAction, details: EstimateFeeDetails): Promise<EstimateFee>;
|
|
127
|
+
/**
|
|
128
|
+
* Simulates an array of transaction and returns an array of transaction trace and estimated fee.
|
|
129
|
+
*
|
|
130
|
+
* @param invocations Invocations containing:
|
|
131
|
+
* - type - transaction type: DECLARE, (multi)DEPLOY, DEPLOY_ACCOUNT, (multi)INVOKE_FUNCTION
|
|
132
|
+
* @param details SimulateTransactionDetails
|
|
133
|
+
*
|
|
134
|
+
* @returns response from simulate_transaction
|
|
135
|
+
*/
|
|
136
|
+
abstract simulateTransaction(invocations: Invocations, details?: SimulateTransactionDetails): Promise<SimulateTransactionResponse>;
|
|
137
|
+
/**
|
|
138
|
+
* Invoke execute function in account contract
|
|
139
|
+
*
|
|
140
|
+
* @param transactions the invocation object or an array of them, containing:
|
|
141
|
+
* - contractAddress - the address of the contract
|
|
142
|
+
* - entrypoint - the entrypoint of the contract
|
|
143
|
+
* - calldata - (defaults to []) the calldata
|
|
144
|
+
* - signature - (defaults to []) the signature
|
|
145
|
+
* @param {InvocationsDetails} transactionsDetail Additional optional parameters for the transaction
|
|
146
|
+
*
|
|
147
|
+
* @returns response from addTransaction
|
|
148
|
+
*/
|
|
149
|
+
abstract execute(transactions: AllowArray<Call>, transactionsDetail?: InvocationsDetails): Promise<InvokeFunctionResponse>;
|
|
150
|
+
/**
|
|
151
|
+
* @deprecated
|
|
152
|
+
* @param transactions the invocation object or an array of them, containing:
|
|
153
|
+
* - contractAddress - the address of the contract
|
|
154
|
+
* - entrypoint - the entrypoint of the contract
|
|
155
|
+
* - calldata - (defaults to []) the calldata
|
|
156
|
+
* - signature - (defaults to []) the signature
|
|
157
|
+
* @param abis (optional) the abi of the contract for better displaying
|
|
158
|
+
* @param {InvocationsDetails} transactionsDetail Additional optional parameters for the transaction
|
|
159
|
+
* * @returns response from addTransaction
|
|
160
|
+
*/
|
|
161
|
+
abstract execute(transactions: AllowArray<Call>, abis?: Abi[], transactionsDetail?: InvocationsDetails): Promise<InvokeFunctionResponse>;
|
|
162
|
+
/**
|
|
163
|
+
* Declares a given compiled contract (json) to starknet
|
|
164
|
+
*
|
|
165
|
+
* @param contractPayload transaction payload to be deployed containing:
|
|
166
|
+
* - contract: compiled contract code
|
|
167
|
+
* - (optional) classHash: computed class hash of compiled contract. Pre-compute it for faster execution.
|
|
168
|
+
* - (required for Cairo1 without compiledClassHash) casm: CompiledContract | string;
|
|
169
|
+
* - (optional for Cairo1 with casm) compiledClassHash: compiled class hash from casm. Pre-compute it for faster execution.
|
|
170
|
+
* @param transactionsDetail - InvocationsDetails
|
|
171
|
+
*
|
|
172
|
+
* @returns a confirmation of sending a transaction on the starknet contract
|
|
173
|
+
*/
|
|
174
|
+
abstract declare(contractPayload: DeclareContractPayload, transactionsDetail?: InvocationsDetails): Promise<DeclareContractResponse>;
|
|
175
|
+
/**
|
|
176
|
+
* Deploys a declared contract to starknet - using Universal Deployer Contract (UDC)
|
|
177
|
+
* support multicall
|
|
178
|
+
*
|
|
179
|
+
* @param payload -
|
|
180
|
+
* - classHash: computed class hash of compiled contract
|
|
181
|
+
* - [constructorCalldata] contract constructor calldata
|
|
182
|
+
* - [salt=pseudorandom] deploy address salt
|
|
183
|
+
* - [unique=true] ensure unique salt
|
|
184
|
+
* @param details - InvocationsDetails
|
|
185
|
+
*
|
|
186
|
+
* @returns
|
|
187
|
+
* - contract_address[]
|
|
188
|
+
* - transaction_hash
|
|
189
|
+
*/
|
|
190
|
+
abstract deploy(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], details?: InvocationsDetails): Promise<MultiDeployContractResponse>;
|
|
191
|
+
/**
|
|
192
|
+
* Simplify deploy simulating old DeployContract with same response + UDC specific response
|
|
193
|
+
* Internal wait for L2 transaction, support multicall
|
|
194
|
+
*
|
|
195
|
+
* @param payload -
|
|
196
|
+
* - classHash: computed class hash of compiled contract
|
|
197
|
+
* - [constructorCalldata] contract constructor calldata
|
|
198
|
+
* - [salt=pseudorandom] deploy address salt
|
|
199
|
+
* - [unique=true] ensure unique salt
|
|
200
|
+
* @param details - InvocationsDetails
|
|
201
|
+
*
|
|
202
|
+
* @returns
|
|
203
|
+
* - contract_address
|
|
204
|
+
* - transaction_hash
|
|
205
|
+
* - address
|
|
206
|
+
* - deployer
|
|
207
|
+
* - unique
|
|
208
|
+
* - classHash
|
|
209
|
+
* - calldata_len
|
|
210
|
+
* - calldata
|
|
211
|
+
* - salt
|
|
212
|
+
*/
|
|
213
|
+
abstract deployContract(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], details?: InvocationsDetails): Promise<DeployContractUDCResponse>;
|
|
214
|
+
/**
|
|
215
|
+
* Declares and Deploy a given compiled contract (json) to starknet using UDC
|
|
216
|
+
* Internal wait for L2 transaction, do not support multicall
|
|
217
|
+
* Method will pass even if contract is already declared (internal using DeclareIfNot)
|
|
218
|
+
*
|
|
219
|
+
* @param payload
|
|
220
|
+
* - contract: compiled contract code
|
|
221
|
+
* - [casm=cairo1]: CairoAssembly | undefined;
|
|
222
|
+
* - [compiledClassHash]: string | undefined;
|
|
223
|
+
* - [classHash]: computed class hash of compiled contract
|
|
224
|
+
* - [constructorCalldata] contract constructor calldata
|
|
225
|
+
* - [salt=pseudorandom] deploy address salt
|
|
226
|
+
* - [unique=true] ensure unique salt
|
|
227
|
+
* @param details - InvocationsDetails
|
|
228
|
+
*
|
|
229
|
+
* @returns
|
|
230
|
+
* - declare
|
|
231
|
+
* - transaction_hash
|
|
232
|
+
* - deploy
|
|
233
|
+
* - contract_address
|
|
234
|
+
* - transaction_hash
|
|
235
|
+
* - address
|
|
236
|
+
* - deployer
|
|
237
|
+
* - unique
|
|
238
|
+
* - classHash
|
|
239
|
+
* - calldata_len
|
|
240
|
+
* - calldata
|
|
241
|
+
* - salt
|
|
242
|
+
*/
|
|
243
|
+
abstract declareAndDeploy(payload: DeclareAndDeployContractPayload, details?: InvocationsDetails): Promise<DeclareDeployUDCResponse>;
|
|
244
|
+
/**
|
|
245
|
+
* Deploy the account on Starknet
|
|
246
|
+
*
|
|
247
|
+
* @param contractPayload transaction payload to be deployed containing:
|
|
248
|
+
* - classHash: computed class hash of compiled contract
|
|
249
|
+
* - optional constructor calldata
|
|
250
|
+
* - optional address salt
|
|
251
|
+
* - optional contractAddress
|
|
252
|
+
* @param transactionsDetail - InvocationsDetails
|
|
253
|
+
*
|
|
254
|
+
* @returns a confirmation of sending a transaction on the starknet contract
|
|
255
|
+
*/
|
|
256
|
+
abstract deployAccount(contractPayload: DeployAccountContractPayload, transactionsDetail?: InvocationsDetails): Promise<DeployContractResponse>;
|
|
257
|
+
/**
|
|
258
|
+
* Signs a TypedData object for off-chain usage with the Starknet private key and returns the signature
|
|
259
|
+
* This adds a message prefix so it can't be interchanged with transactions
|
|
260
|
+
*
|
|
261
|
+
* @param typedData - TypedData object to be signed
|
|
262
|
+
* @returns the signature of the TypedData object
|
|
263
|
+
* @throws {Error} if typedData is not a valid TypedData
|
|
264
|
+
*/
|
|
265
|
+
abstract signMessage(typedData: TypedData): Promise<Signature>;
|
|
266
|
+
/**
|
|
267
|
+
* Hash a TypedData object with Pedersen hash and return the hash
|
|
268
|
+
* This adds a message prefix so it can't be interchanged with transactions
|
|
269
|
+
*
|
|
270
|
+
* @param typedData - TypedData object to be hashed
|
|
271
|
+
* @returns the hash of the TypedData object
|
|
272
|
+
* @throws {Error} if typedData is not a valid TypedData
|
|
273
|
+
*/
|
|
274
|
+
abstract hashMessage(typedData: TypedData): Promise<string>;
|
|
275
|
+
/**
|
|
276
|
+
* Verify a signature of a TypedData object
|
|
277
|
+
*
|
|
278
|
+
* @param typedData - TypedData object to be verified
|
|
279
|
+
* @param signature - signature of the TypedData object
|
|
280
|
+
* @returns true if the signature is valid, false otherwise
|
|
281
|
+
* @throws {Error} if typedData is not a valid TypedData or the signature is not a valid signature
|
|
282
|
+
*/
|
|
283
|
+
abstract verifyMessage(typedData: TypedData, signature: Signature): Promise<boolean>;
|
|
284
|
+
/**
|
|
285
|
+
* Verify a signature of a given hash
|
|
286
|
+
* @warning This method is not recommended, use verifyMessage instead
|
|
287
|
+
*
|
|
288
|
+
* @param hash - hash to be verified
|
|
289
|
+
* @param signature - signature of the hash
|
|
290
|
+
* @returns true if the signature is valid, false otherwise
|
|
291
|
+
* @throws {Error} if the signature is not a valid signature
|
|
292
|
+
*/
|
|
293
|
+
abstract verifyMessageHash(hash: BigNumberish, signature: Signature): Promise<boolean>;
|
|
294
|
+
/**
|
|
295
|
+
* Gets the nonce of the account with respect to a specific block
|
|
296
|
+
*
|
|
297
|
+
* @param {BlockIdentifier} blockIdentifier - optional blockIdentifier. Defaults to 'pending'
|
|
298
|
+
* @returns nonce of the account
|
|
299
|
+
*/
|
|
300
|
+
abstract getNonce(blockIdentifier?: BlockIdentifier): Promise<Nonce>;
|
|
301
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
RPC06: true,
|
|
8
|
+
RPC07: true
|
|
9
|
+
};
|
|
10
|
+
exports.RPC07 = exports.RPC06 = void 0;
|
|
11
|
+
var _RPC = _interopRequireWildcard(require("./rpc_0_6.cjs"));
|
|
12
|
+
exports.RPC06 = _RPC;
|
|
13
|
+
var _RPC2 = _interopRequireWildcard(require("./rpc_0_7.cjs"));
|
|
14
|
+
exports.RPC07 = _RPC2;
|
|
15
|
+
Object.keys(_RPC2).forEach(function (key) {
|
|
16
|
+
if (key === "default" || key === "__esModule") return;
|
|
17
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
18
|
+
if (key in exports && exports[key] === _RPC2[key]) return;
|
|
19
|
+
Object.defineProperty(exports, key, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _RPC2[key];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
27
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|