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,259 @@
|
|
|
1
|
+
import { ValuesType } from '../helpers/valuesType';
|
|
2
|
+
import { StarknetChainId } from '../../constants';
|
|
3
|
+
import { weierstrass } from '../../utils/ec';
|
|
4
|
+
import { EDataAvailabilityMode, ResourceBounds } from '../api';
|
|
5
|
+
import { CairoEnum } from '../cairoEnum';
|
|
6
|
+
import { CompiledContract, CompiledSierraCasm, ContractClass } from './contract';
|
|
7
|
+
export type WeierstrassSignatureType = weierstrass.SignatureType;
|
|
8
|
+
export type ArraySignatureType = string[];
|
|
9
|
+
export type Signature = ArraySignatureType | WeierstrassSignatureType;
|
|
10
|
+
export type BigNumberish = string | number | bigint;
|
|
11
|
+
export type ByteArray = {
|
|
12
|
+
data: BigNumberish[];
|
|
13
|
+
pending_word: BigNumberish;
|
|
14
|
+
pending_word_len: BigNumberish;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Compiled calldata ready to be sent
|
|
18
|
+
*
|
|
19
|
+
* decimal-string array
|
|
20
|
+
*/
|
|
21
|
+
export type Calldata = string[] & {
|
|
22
|
+
readonly __compiled__?: true;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Represents an integer in the range [0, 2^256)
|
|
26
|
+
*/
|
|
27
|
+
export interface Uint256 {
|
|
28
|
+
low: BigNumberish;
|
|
29
|
+
high: BigNumberish;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Represents an integer in the range [0, 2^256)
|
|
33
|
+
*/
|
|
34
|
+
export interface Uint512 {
|
|
35
|
+
limb0: BigNumberish;
|
|
36
|
+
limb1: BigNumberish;
|
|
37
|
+
limb2: BigNumberish;
|
|
38
|
+
limb3: BigNumberish;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* BigNumberish array
|
|
42
|
+
*
|
|
43
|
+
* use CallData.compile() to convert to Calldata
|
|
44
|
+
*/
|
|
45
|
+
export type RawCalldata = BigNumberish[];
|
|
46
|
+
/**
|
|
47
|
+
* Hexadecimal-string array
|
|
48
|
+
*/
|
|
49
|
+
export type HexCalldata = string[];
|
|
50
|
+
export type AllowArray<T> = T | T[];
|
|
51
|
+
export type OptionalPayload<T> = {
|
|
52
|
+
payload: T;
|
|
53
|
+
} | T;
|
|
54
|
+
export type RawArgs = RawArgsObject | RawArgsArray;
|
|
55
|
+
export type RawArgsObject = {
|
|
56
|
+
[inputName: string]: MultiType | MultiType[] | RawArgs;
|
|
57
|
+
};
|
|
58
|
+
export type RawArgsArray = Array<MultiType | MultiType[] | RawArgs>;
|
|
59
|
+
export type MultiType = BigNumberish | Uint256 | object | boolean | CairoEnum;
|
|
60
|
+
export type UniversalDeployerContractPayload = {
|
|
61
|
+
classHash: BigNumberish;
|
|
62
|
+
salt?: string;
|
|
63
|
+
unique?: boolean;
|
|
64
|
+
constructorCalldata?: RawArgs;
|
|
65
|
+
};
|
|
66
|
+
export type DeployAccountContractPayload = {
|
|
67
|
+
classHash: string;
|
|
68
|
+
constructorCalldata?: RawArgs;
|
|
69
|
+
addressSalt?: BigNumberish;
|
|
70
|
+
contractAddress?: string;
|
|
71
|
+
};
|
|
72
|
+
export type DeployAccountContractTransaction = Omit<DeployAccountContractPayload, 'contractAddress'> & {
|
|
73
|
+
signature?: Signature;
|
|
74
|
+
};
|
|
75
|
+
export type DeclareContractPayload = {
|
|
76
|
+
contract: CompiledContract | string;
|
|
77
|
+
classHash?: string;
|
|
78
|
+
casm?: CompiledSierraCasm;
|
|
79
|
+
compiledClassHash?: string;
|
|
80
|
+
};
|
|
81
|
+
export type CompleteDeclareContractPayload = {
|
|
82
|
+
contract: CompiledContract | string;
|
|
83
|
+
classHash: string;
|
|
84
|
+
casm?: CompiledSierraCasm;
|
|
85
|
+
compiledClassHash?: string;
|
|
86
|
+
};
|
|
87
|
+
export type DeclareAndDeployContractPayload = Omit<UniversalDeployerContractPayload, 'classHash'> & DeclareContractPayload;
|
|
88
|
+
export type DeclareContractTransaction = {
|
|
89
|
+
contract: ContractClass;
|
|
90
|
+
senderAddress: string;
|
|
91
|
+
signature?: Signature;
|
|
92
|
+
compiledClassHash?: string;
|
|
93
|
+
};
|
|
94
|
+
export type CallDetails = {
|
|
95
|
+
contractAddress: string;
|
|
96
|
+
calldata?: RawArgs | Calldata;
|
|
97
|
+
entrypoint?: string;
|
|
98
|
+
};
|
|
99
|
+
export type Invocation = CallDetails & {
|
|
100
|
+
signature?: Signature;
|
|
101
|
+
};
|
|
102
|
+
export type Call = CallDetails & {
|
|
103
|
+
entrypoint: string;
|
|
104
|
+
};
|
|
105
|
+
export type CairoVersion = '0' | '1' | undefined;
|
|
106
|
+
export type CompilerVersion = '0' | '1' | '2' | undefined;
|
|
107
|
+
export type InvocationsDetails = {
|
|
108
|
+
nonce?: BigNumberish;
|
|
109
|
+
maxFee?: BigNumberish;
|
|
110
|
+
version?: BigNumberish;
|
|
111
|
+
} & Partial<V3TransactionDetails>;
|
|
112
|
+
export type V3TransactionDetails = {
|
|
113
|
+
nonce: BigNumberish;
|
|
114
|
+
version: BigNumberish;
|
|
115
|
+
resourceBounds: ResourceBounds;
|
|
116
|
+
tip: BigNumberish;
|
|
117
|
+
paymasterData: BigNumberish[];
|
|
118
|
+
accountDeploymentData: BigNumberish[];
|
|
119
|
+
nonceDataAvailabilityMode: EDataAvailabilityMode;
|
|
120
|
+
feeDataAvailabilityMode: EDataAvailabilityMode;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Contain all additional details params
|
|
124
|
+
*/
|
|
125
|
+
export type Details = {
|
|
126
|
+
nonce: BigNumberish;
|
|
127
|
+
maxFee: BigNumberish;
|
|
128
|
+
version: BigNumberish;
|
|
129
|
+
chainId: StarknetChainId;
|
|
130
|
+
};
|
|
131
|
+
export type InvocationsDetailsWithNonce = (InvocationsDetails & {
|
|
132
|
+
nonce: BigNumberish;
|
|
133
|
+
}) | V3TransactionDetails;
|
|
134
|
+
export declare const TransactionType: {
|
|
135
|
+
readonly DECLARE: "DECLARE";
|
|
136
|
+
readonly DEPLOY: "DEPLOY";
|
|
137
|
+
readonly DEPLOY_ACCOUNT: "DEPLOY_ACCOUNT";
|
|
138
|
+
readonly INVOKE: "INVOKE_FUNCTION";
|
|
139
|
+
};
|
|
140
|
+
export type TransactionType = ValuesType<typeof TransactionType>;
|
|
141
|
+
/**
|
|
142
|
+
* new statuses are defined by props: finality_status and execution_status
|
|
143
|
+
* to be #deprecated
|
|
144
|
+
*/
|
|
145
|
+
export declare const TransactionStatus: {
|
|
146
|
+
readonly NOT_RECEIVED: "NOT_RECEIVED";
|
|
147
|
+
readonly RECEIVED: "RECEIVED";
|
|
148
|
+
readonly ACCEPTED_ON_L2: "ACCEPTED_ON_L2";
|
|
149
|
+
readonly ACCEPTED_ON_L1: "ACCEPTED_ON_L1";
|
|
150
|
+
readonly REJECTED: "REJECTED";
|
|
151
|
+
readonly REVERTED: "REVERTED";
|
|
152
|
+
};
|
|
153
|
+
export type TransactionStatus = ValuesType<typeof TransactionStatus>;
|
|
154
|
+
export declare const TransactionFinalityStatus: {
|
|
155
|
+
readonly NOT_RECEIVED: "NOT_RECEIVED";
|
|
156
|
+
readonly RECEIVED: "RECEIVED";
|
|
157
|
+
readonly ACCEPTED_ON_L2: "ACCEPTED_ON_L2";
|
|
158
|
+
readonly ACCEPTED_ON_L1: "ACCEPTED_ON_L1";
|
|
159
|
+
};
|
|
160
|
+
export type TransactionFinalityStatus = ValuesType<typeof TransactionFinalityStatus>;
|
|
161
|
+
export declare const TransactionExecutionStatus: {
|
|
162
|
+
readonly REJECTED: "REJECTED";
|
|
163
|
+
readonly REVERTED: "REVERTED";
|
|
164
|
+
readonly SUCCEEDED: "SUCCEEDED";
|
|
165
|
+
};
|
|
166
|
+
export type TransactionExecutionStatus = ValuesType<typeof TransactionExecutionStatus>;
|
|
167
|
+
export declare const BlockStatus: {
|
|
168
|
+
readonly PENDING: "PENDING";
|
|
169
|
+
readonly ACCEPTED_ON_L1: "ACCEPTED_ON_L1";
|
|
170
|
+
readonly ACCEPTED_ON_L2: "ACCEPTED_ON_L2";
|
|
171
|
+
readonly REJECTED: "REJECTED";
|
|
172
|
+
};
|
|
173
|
+
export type BlockStatus = ValuesType<typeof BlockStatus>;
|
|
174
|
+
export declare const BlockTag: {
|
|
175
|
+
readonly PENDING: "pending";
|
|
176
|
+
readonly LATEST: "latest";
|
|
177
|
+
};
|
|
178
|
+
export type BlockTag = ValuesType<typeof BlockTag>;
|
|
179
|
+
export type BlockNumber = BlockTag | null | number;
|
|
180
|
+
/**
|
|
181
|
+
* hex string and BigInt are detected as block hashes
|
|
182
|
+
*
|
|
183
|
+
* decimal string and number are detected as block numbers
|
|
184
|
+
*
|
|
185
|
+
* text string are detected as block tag
|
|
186
|
+
*
|
|
187
|
+
* null return 'pending' block tag
|
|
188
|
+
*/
|
|
189
|
+
export type BlockIdentifier = BlockNumber | BigNumberish;
|
|
190
|
+
/**
|
|
191
|
+
* items used by AccountInvocations
|
|
192
|
+
*/
|
|
193
|
+
export type AccountInvocationItem = (({
|
|
194
|
+
type: typeof TransactionType.DECLARE;
|
|
195
|
+
} & DeclareContractTransaction) | ({
|
|
196
|
+
type: typeof TransactionType.DEPLOY_ACCOUNT;
|
|
197
|
+
} & DeployAccountContractTransaction) | ({
|
|
198
|
+
type: typeof TransactionType.INVOKE;
|
|
199
|
+
} & Invocation)) & InvocationsDetailsWithNonce;
|
|
200
|
+
/**
|
|
201
|
+
* Complete invocations array with account details (internal type from account -> provider)
|
|
202
|
+
*/
|
|
203
|
+
export type AccountInvocations = AccountInvocationItem[];
|
|
204
|
+
/**
|
|
205
|
+
* Invocations array user provide to bulk method (simulate)
|
|
206
|
+
*/
|
|
207
|
+
export type Invocations = Array<({
|
|
208
|
+
type: typeof TransactionType.DECLARE;
|
|
209
|
+
} & OptionalPayload<DeclareContractPayload>) | ({
|
|
210
|
+
type: typeof TransactionType.DEPLOY;
|
|
211
|
+
} & OptionalPayload<AllowArray<UniversalDeployerContractPayload>>) | ({
|
|
212
|
+
type: typeof TransactionType.DEPLOY_ACCOUNT;
|
|
213
|
+
} & OptionalPayload<DeployAccountContractPayload>) | ({
|
|
214
|
+
type: typeof TransactionType.INVOKE;
|
|
215
|
+
} & OptionalPayload<AllowArray<Call>>)>;
|
|
216
|
+
export type Tupled = {
|
|
217
|
+
element: any;
|
|
218
|
+
type: string;
|
|
219
|
+
};
|
|
220
|
+
export type Args = {
|
|
221
|
+
[inputName: string]: BigNumberish | BigNumberish[] | ParsedStruct | ParsedStruct[];
|
|
222
|
+
};
|
|
223
|
+
export type ParsedStruct = {
|
|
224
|
+
[key: string]: BigNumberish | BigNumberish[] | ParsedStruct | Uint256;
|
|
225
|
+
};
|
|
226
|
+
export type waitForTransactionOptions = {
|
|
227
|
+
retryInterval?: number;
|
|
228
|
+
successStates?: Array<TransactionFinalityStatus | TransactionExecutionStatus>;
|
|
229
|
+
errorStates?: Array<TransactionFinalityStatus | TransactionExecutionStatus>;
|
|
230
|
+
};
|
|
231
|
+
export type getSimulateTransactionOptions = {
|
|
232
|
+
blockIdentifier?: BlockIdentifier;
|
|
233
|
+
skipValidate?: boolean;
|
|
234
|
+
skipExecute?: boolean;
|
|
235
|
+
skipFeeCharge?: boolean;
|
|
236
|
+
};
|
|
237
|
+
export type getContractVersionOptions = {
|
|
238
|
+
blockIdentifier?: BlockIdentifier;
|
|
239
|
+
compiler?: boolean;
|
|
240
|
+
};
|
|
241
|
+
export type getEstimateFeeBulkOptions = {
|
|
242
|
+
blockIdentifier?: BlockIdentifier;
|
|
243
|
+
skipValidate?: boolean;
|
|
244
|
+
};
|
|
245
|
+
export interface CallStruct {
|
|
246
|
+
to: string;
|
|
247
|
+
selector: string;
|
|
248
|
+
calldata: string[];
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Represent Contract version
|
|
252
|
+
*/
|
|
253
|
+
export type ContractVersion = {
|
|
254
|
+
/** version of the cairo language */
|
|
255
|
+
cairo: CairoVersion;
|
|
256
|
+
/** version of the cairo compiler used to compile the contract */
|
|
257
|
+
compiler: CompilerVersion;
|
|
258
|
+
};
|
|
259
|
+
export * from './contract';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const TransactionType = {
|
|
2
|
+
DECLARE: "DECLARE",
|
|
3
|
+
DEPLOY: "DEPLOY",
|
|
4
|
+
DEPLOY_ACCOUNT: "DEPLOY_ACCOUNT",
|
|
5
|
+
INVOKE: "INVOKE_FUNCTION"
|
|
6
|
+
};
|
|
7
|
+
export const TransactionStatus = {
|
|
8
|
+
NOT_RECEIVED: "NOT_RECEIVED",
|
|
9
|
+
RECEIVED: "RECEIVED",
|
|
10
|
+
ACCEPTED_ON_L2: "ACCEPTED_ON_L2",
|
|
11
|
+
ACCEPTED_ON_L1: "ACCEPTED_ON_L1",
|
|
12
|
+
REJECTED: "REJECTED",
|
|
13
|
+
REVERTED: "REVERTED"
|
|
14
|
+
};
|
|
15
|
+
export const TransactionFinalityStatus = {
|
|
16
|
+
NOT_RECEIVED: "NOT_RECEIVED",
|
|
17
|
+
RECEIVED: "RECEIVED",
|
|
18
|
+
ACCEPTED_ON_L2: "ACCEPTED_ON_L2",
|
|
19
|
+
ACCEPTED_ON_L1: "ACCEPTED_ON_L1"
|
|
20
|
+
};
|
|
21
|
+
export const TransactionExecutionStatus = {
|
|
22
|
+
REJECTED: "REJECTED",
|
|
23
|
+
REVERTED: "REVERTED",
|
|
24
|
+
SUCCEEDED: "SUCCEEDED"
|
|
25
|
+
};
|
|
26
|
+
export const BlockStatus = {
|
|
27
|
+
PENDING: "PENDING",
|
|
28
|
+
ACCEPTED_ON_L1: "ACCEPTED_ON_L1",
|
|
29
|
+
ACCEPTED_ON_L2: "ACCEPTED_ON_L2",
|
|
30
|
+
REJECTED: "REJECTED"
|
|
31
|
+
};
|
|
32
|
+
export const BlockTag = {
|
|
33
|
+
PENDING: "pending",
|
|
34
|
+
LATEST: "latest"
|
|
35
|
+
};
|
|
36
|
+
export * from "./contract/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NetworkName, StarknetChainId } from '../../constants';
|
|
2
|
+
import { BlockIdentifier } from '../lib';
|
|
3
|
+
export interface ProviderOptions extends RpcProviderOptions {
|
|
4
|
+
}
|
|
5
|
+
export type RpcProviderOptions = {
|
|
6
|
+
nodeUrl?: string | NetworkName;
|
|
7
|
+
retries?: number;
|
|
8
|
+
transactionRetryIntervalFallback?: number;
|
|
9
|
+
headers?: object;
|
|
10
|
+
blockIdentifier?: BlockIdentifier;
|
|
11
|
+
chainId?: StarknetChainId;
|
|
12
|
+
specVersion?: string;
|
|
13
|
+
default?: boolean;
|
|
14
|
+
waitMode?: boolean;
|
|
15
|
+
feeMarginPercentage?: {
|
|
16
|
+
l1BoundMaxAmount: number;
|
|
17
|
+
l1BoundMaxPricePerUnit: number;
|
|
18
|
+
maxFee: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _configuration = require("./configuration.cjs");
|
|
7
|
+
Object.keys(_configuration).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _configuration[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _configuration[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _response = require("./response.cjs");
|
|
18
|
+
Object.keys(_response).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _response[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _response[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BlockWithTxHashes", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _spec.BlockWithTxHashes;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ContractClassPayload", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _spec.ContractClassPayload;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "FeeEstimate", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _spec.FeeEstimate;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "TransactionReceipt", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _spec.TransactionReceipt;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var _spec = require("./spec.cjs");
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common interface response
|
|
3
|
+
* Intersection (sequencer response ∩ (∪ rpc responses))
|
|
4
|
+
*/
|
|
5
|
+
import { CompiledSierra, LegacyContractClass, TransactionExecutionStatus, TransactionFinalityStatus, TransactionType, TransactionStatus, BlockNumber } from '../lib';
|
|
6
|
+
import { BLOCK_HASH, BLOCK_NUMBER, DECLARE_TXN_RECEIPT, DEPLOY_ACCOUNT_TXN_RECEIPT, FELT, INVOKE_TXN_RECEIPT, L1_HANDLER_TXN_RECEIPT, PENDING_DECLARE_TXN_RECEIPT, PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT, PENDING_INVOKE_TXN_RECEIPT, PENDING_L1_HANDLER_TXN_RECEIPT, PENDING_STATE_UPDATE, PRICE_UNIT, RESOURCE_PRICE, SIMULATION_FLAG, STATE_UPDATE, TXN_HASH, DeclaredTransaction, InvokedTransaction, ResourceBounds, SimulateTransaction, TransactionWithHash } from './spec';
|
|
7
|
+
export { BlockWithTxHashes, ContractClassPayload, FeeEstimate, TransactionReceipt } from './spec';
|
|
8
|
+
export type GetBlockResponse = PendingBlock | Block;
|
|
9
|
+
export type PendingBlock = {
|
|
10
|
+
status: 'PENDING';
|
|
11
|
+
parent_hash: BLOCK_HASH;
|
|
12
|
+
timestamp: number;
|
|
13
|
+
sequencer_address: FELT;
|
|
14
|
+
l1_gas_price: RESOURCE_PRICE;
|
|
15
|
+
starknet_version: string;
|
|
16
|
+
transactions: TXN_HASH[];
|
|
17
|
+
};
|
|
18
|
+
export type Block = {
|
|
19
|
+
status: 'ACCEPTED_ON_L2' | 'ACCEPTED_ON_L1' | 'REJECTED';
|
|
20
|
+
block_hash: BLOCK_HASH;
|
|
21
|
+
parent_hash: BLOCK_HASH;
|
|
22
|
+
block_number: BLOCK_NUMBER;
|
|
23
|
+
new_root: FELT;
|
|
24
|
+
timestamp: number;
|
|
25
|
+
sequencer_address: FELT;
|
|
26
|
+
l1_gas_price: RESOURCE_PRICE;
|
|
27
|
+
starknet_version: string;
|
|
28
|
+
transactions: TXN_HASH[];
|
|
29
|
+
};
|
|
30
|
+
export interface MessageToL1 {
|
|
31
|
+
to_address: string;
|
|
32
|
+
payload: Array<string>;
|
|
33
|
+
}
|
|
34
|
+
export type RevertedTransactionReceiptResponse = {
|
|
35
|
+
type?: TransactionType | any;
|
|
36
|
+
execution_status: typeof TransactionExecutionStatus.REVERTED | any;
|
|
37
|
+
finality_status: TransactionFinalityStatus | any;
|
|
38
|
+
status?: TransactionStatus;
|
|
39
|
+
actual_fee: string;
|
|
40
|
+
block_hash?: string;
|
|
41
|
+
block_number?: BlockNumber;
|
|
42
|
+
transaction_hash: string;
|
|
43
|
+
transaction_index?: number;
|
|
44
|
+
messages_sent: Array<MessageToL1>;
|
|
45
|
+
events: any[];
|
|
46
|
+
revert_reason?: string;
|
|
47
|
+
};
|
|
48
|
+
export type RejectedTransactionReceiptResponse = {
|
|
49
|
+
status: typeof TransactionStatus.REJECTED;
|
|
50
|
+
transaction_failure_reason: {
|
|
51
|
+
code: string;
|
|
52
|
+
error_message: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export type GetTxReceiptResponseWithoutHelper = SuccessfulTransactionReceiptResponse | RevertedTransactionReceiptResponse | RejectedTransactionReceiptResponse;
|
|
56
|
+
export type SuccessfulTransactionReceiptResponse = InvokeTransactionReceiptResponse | DeployTransactionReceiptResponse | DeclareTransactionReceiptResponse;
|
|
57
|
+
export type GetTransactionResponse = TransactionWithHash;
|
|
58
|
+
export type InvokeTransactionReceiptResponse = INVOKE_TXN_RECEIPT | PENDING_INVOKE_TXN_RECEIPT;
|
|
59
|
+
export type DeclareTransactionReceiptResponse = DECLARE_TXN_RECEIPT | PENDING_DECLARE_TXN_RECEIPT;
|
|
60
|
+
export type DeployTransactionReceiptResponse = InvokeTransactionReceiptResponse;
|
|
61
|
+
export type DeployAccountTransactionReceiptResponse = DEPLOY_ACCOUNT_TXN_RECEIPT | PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT;
|
|
62
|
+
export type L1HandlerTransactionReceiptResponse = L1_HANDLER_TXN_RECEIPT | PENDING_L1_HANDLER_TXN_RECEIPT;
|
|
63
|
+
export interface EstimateFeeResponse {
|
|
64
|
+
gas_consumed: bigint;
|
|
65
|
+
overall_fee: bigint;
|
|
66
|
+
gas_price: bigint;
|
|
67
|
+
unit: PRICE_UNIT;
|
|
68
|
+
suggestedMaxFee: bigint;
|
|
69
|
+
resourceBounds: ResourceBounds;
|
|
70
|
+
data_gas_consumed: bigint;
|
|
71
|
+
data_gas_price: bigint;
|
|
72
|
+
}
|
|
73
|
+
export type EstimateFeeResponseBulk = Array<EstimateFeeResponse>;
|
|
74
|
+
export type InvokeFunctionResponse = InvokedTransaction;
|
|
75
|
+
export type DeclareContractResponse = DeclaredTransaction;
|
|
76
|
+
export type CallContractResponse = string[];
|
|
77
|
+
export type Storage = FELT;
|
|
78
|
+
export type Nonce = string;
|
|
79
|
+
export type { SIMULATION_FLAG };
|
|
80
|
+
export type SimulationFlags = Array<SIMULATION_FLAG>;
|
|
81
|
+
export type SimulatedTransaction = SimulateTransaction & {
|
|
82
|
+
suggestedMaxFee: bigint;
|
|
83
|
+
resourceBounds: ResourceBounds;
|
|
84
|
+
};
|
|
85
|
+
export type SimulateTransactionResponse = SimulatedTransaction[];
|
|
86
|
+
export type StateUpdateResponse = StateUpdate | PendingStateUpdate;
|
|
87
|
+
export type StateUpdate = STATE_UPDATE;
|
|
88
|
+
export type PendingStateUpdate = PENDING_STATE_UPDATE;
|
|
89
|
+
/**
|
|
90
|
+
* Standardized type
|
|
91
|
+
*
|
|
92
|
+
* Cairo0 program compressed and Cairo1 sierra_program decompressed
|
|
93
|
+
*
|
|
94
|
+
* abi Abi
|
|
95
|
+
*
|
|
96
|
+
* CompiledSierra without '.sierra_program_debug_info'
|
|
97
|
+
*/
|
|
98
|
+
export type ContractClassResponse = LegacyContractClass | Omit<CompiledSierra, 'sierra_program_debug_info'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BlockWithTxHashes, ContractClassPayload, FeeEstimate, TransactionReceipt } from "./spec.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { RPCSPEC07 } from '../api';
|
|
2
|
+
import * as RPC06 from '../api/rpcspec_0_6';
|
|
3
|
+
import { SPEC as SPEC06 } from '../api/rpcspec_0_6';
|
|
4
|
+
type Simplify<T> = {
|
|
5
|
+
[K in keyof T]: T[K];
|
|
6
|
+
} & {};
|
|
7
|
+
export type RequiredKeysOf<T extends object> = Exclude<{
|
|
8
|
+
[K in keyof T]: T extends Record<K, T[K]> ? K : never;
|
|
9
|
+
}[keyof T], undefined>;
|
|
10
|
+
type ArrayElement<T> = T extends Array<infer U> ? U : never;
|
|
11
|
+
type MergeProperties<T1 extends Record<any, any>, T2 extends Record<any, any>> = {
|
|
12
|
+
[K in RequiredKeysOf<T1> & RequiredKeysOf<T2>]: Merge<T1[K], T2[K]>;
|
|
13
|
+
} & {
|
|
14
|
+
[K in keyof T1 & keyof T2]?: Merge<T1[K], T2[K]>;
|
|
15
|
+
} & {
|
|
16
|
+
[K in Exclude<keyof T1, keyof T2>]?: T1[K];
|
|
17
|
+
} & {
|
|
18
|
+
[K in Exclude<keyof T2, keyof T1>]?: T2[K];
|
|
19
|
+
};
|
|
20
|
+
type Merge<T1, T2> = Simplify<T1 extends Array<any> ? T2 extends Array<any> ? Array<Merge<ArrayElement<T1>, ArrayElement<T2>>> : T1 : T2 extends Array<any> ? T2 : T1 extends object ? T2 extends object ? MergeProperties<T1, T2> : T1 : T2 extends object ? T2 : T1 | T2>;
|
|
21
|
+
export type BLOCK_HASH = Merge<SPEC06.BLOCK_HASH, RPCSPEC07.SPEC.BLOCK_HASH>;
|
|
22
|
+
export type BLOCK_NUMBER = Merge<SPEC06.BLOCK_NUMBER, RPCSPEC07.SPEC.BLOCK_NUMBER>;
|
|
23
|
+
export type FELT = Merge<SPEC06.FELT, RPCSPEC07.SPEC.FELT>;
|
|
24
|
+
export type TXN_HASH = Merge<SPEC06.TXN_HASH, RPCSPEC07.SPEC.TXN_HASH>;
|
|
25
|
+
export type PRICE_UNIT = Merge<SPEC06.PRICE_UNIT, RPCSPEC07.SPEC.PRICE_UNIT>;
|
|
26
|
+
export type RESOURCE_PRICE = Merge<SPEC06.RESOURCE_PRICE, RPCSPEC07.SPEC.RESOURCE_PRICE>;
|
|
27
|
+
export type SIMULATION_FLAG = Merge<SPEC06.SIMULATION_FLAG, RPCSPEC07.SPEC.SIMULATION_FLAG>;
|
|
28
|
+
export type STATE_UPDATE = Merge<SPEC06.STATE_UPDATE, RPCSPEC07.SPEC.STATE_UPDATE>;
|
|
29
|
+
export type PENDING_STATE_UPDATE = Merge<SPEC06.PENDING_STATE_UPDATE, RPCSPEC07.SPEC.PENDING_STATE_UPDATE>;
|
|
30
|
+
export type INVOKE_TXN_RECEIPT = Merge<SPEC06.INVOKE_TXN_RECEIPT, RPCSPEC07.SPEC.INVOKE_TXN_RECEIPT & RPCSPEC07.BlockHashAndNumber>;
|
|
31
|
+
export type DECLARE_TXN_RECEIPT = Merge<SPEC06.DECLARE_TXN_RECEIPT, RPCSPEC07.SPEC.DECLARE_TXN_RECEIPT & RPCSPEC07.BlockHashAndNumber>;
|
|
32
|
+
export type DEPLOY_ACCOUNT_TXN_RECEIPT = Merge<SPEC06.DEPLOY_ACCOUNT_TXN_RECEIPT, RPCSPEC07.SPEC.DEPLOY_ACCOUNT_TXN_RECEIPT & RPCSPEC07.BlockHashAndNumber>;
|
|
33
|
+
export type L1_HANDLER_TXN_RECEIPT = Merge<SPEC06.L1_HANDLER_TXN_RECEIPT, RPCSPEC07.SPEC.L1_HANDLER_TXN_RECEIPT & RPCSPEC07.BlockHashAndNumber>;
|
|
34
|
+
export type PENDING_INVOKE_TXN_RECEIPT = Merge<SPEC06.PENDING_INVOKE_TXN_RECEIPT, RPCSPEC07.SPEC.INVOKE_TXN_RECEIPT>;
|
|
35
|
+
export type PENDING_DECLARE_TXN_RECEIPT = Merge<SPEC06.PENDING_DECLARE_TXN_RECEIPT, RPCSPEC07.SPEC.DECLARE_TXN_RECEIPT>;
|
|
36
|
+
export type PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT = Merge<SPEC06.PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT, RPCSPEC07.SPEC.DEPLOY_ACCOUNT_TXN_RECEIPT>;
|
|
37
|
+
export type PENDING_L1_HANDLER_TXN_RECEIPT = Merge<SPEC06.PENDING_L1_HANDLER_TXN_RECEIPT, RPCSPEC07.SPEC.L1_HANDLER_TXN_RECEIPT>;
|
|
38
|
+
export type BlockWithTxHashes = Merge<RPC06.BlockWithTxHashes, RPCSPEC07.BlockWithTxHashes>;
|
|
39
|
+
export type ContractClassPayload = Merge<RPC06.ContractClass, RPCSPEC07.ContractClass>;
|
|
40
|
+
export type DeclaredTransaction = Merge<RPC06.DeclaredTransaction, RPCSPEC07.DeclaredTransaction>;
|
|
41
|
+
export type FeeEstimate = Merge<SPEC06.FEE_ESTIMATE, RPCSPEC07.SPEC.FEE_ESTIMATE>;
|
|
42
|
+
export type InvokedTransaction = Merge<RPC06.InvokedTransaction, RPCSPEC07.InvokedTransaction>;
|
|
43
|
+
export type PendingReceipt = Merge<RPC06.PendingReceipt, RPCSPEC07.PendingReceipt>;
|
|
44
|
+
export type Receipt = Merge<RPC06.Receipt, RPCSPEC07.Receipt>;
|
|
45
|
+
export type ResourceBounds = Merge<RPC06.ResourceBounds, RPCSPEC07.ResourceBounds>;
|
|
46
|
+
export type SimulateTransaction = Merge<RPC06.SimulateTransaction, RPCSPEC07.SimulateTransaction>;
|
|
47
|
+
export type TransactionReceipt = Merge<RPC06.TransactionReceipt, RPCSPEC07.TransactionReceipt>;
|
|
48
|
+
export type TransactionWithHash = Merge<RPC06.TransactionWithHash, RPCSPEC07.TransactionWithHash>;
|
|
49
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { StarknetChainId } from '../constants';
|
|
2
|
+
import { ETransactionVersion, ETransactionVersion2, ETransactionVersion3 } from './api';
|
|
3
|
+
import { BigNumberish, CairoVersion, DeployAccountContractPayload, InvocationsDetails, V3TransactionDetails } from './lib';
|
|
4
|
+
export type InvocationsSignerDetails = (V2InvocationsSignerDetails | V3InvocationsSignerDetails) & {
|
|
5
|
+
version: `${ETransactionVersion}`;
|
|
6
|
+
skipValidate?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type V2InvocationsSignerDetails = {
|
|
9
|
+
walletAddress: string;
|
|
10
|
+
cairoVersion: CairoVersion;
|
|
11
|
+
chainId: StarknetChainId;
|
|
12
|
+
nonce: BigNumberish;
|
|
13
|
+
maxFee: BigNumberish;
|
|
14
|
+
version: `${ETransactionVersion2}`;
|
|
15
|
+
};
|
|
16
|
+
export type V3InvocationsSignerDetails = V3TransactionDetails & {
|
|
17
|
+
walletAddress: string;
|
|
18
|
+
cairoVersion: CairoVersion;
|
|
19
|
+
chainId: StarknetChainId;
|
|
20
|
+
version: `${ETransactionVersion3}`;
|
|
21
|
+
};
|
|
22
|
+
export type DeclareSignerDetails = (V3DeclareSignerDetails | V2DeclareSignerDetails) & {
|
|
23
|
+
version: `${ETransactionVersion}`;
|
|
24
|
+
};
|
|
25
|
+
export type V2DeclareSignerDetails = Required<InvocationsDetails> & {
|
|
26
|
+
classHash: string;
|
|
27
|
+
compiledClassHash?: string;
|
|
28
|
+
senderAddress: string;
|
|
29
|
+
chainId: StarknetChainId;
|
|
30
|
+
version: `${ETransactionVersion2}`;
|
|
31
|
+
};
|
|
32
|
+
export type V3DeclareSignerDetails = V3TransactionDetails & {
|
|
33
|
+
classHash: string;
|
|
34
|
+
compiledClassHash: string;
|
|
35
|
+
senderAddress: string;
|
|
36
|
+
chainId: StarknetChainId;
|
|
37
|
+
version: `${ETransactionVersion3}`;
|
|
38
|
+
};
|
|
39
|
+
export type DeployAccountSignerDetails = V2DeployAccountSignerDetails | V3DeployAccountSignerDetails;
|
|
40
|
+
export type V2DeployAccountSignerDetails = Required<DeployAccountContractPayload> & Required<InvocationsDetails> & {
|
|
41
|
+
contractAddress: BigNumberish;
|
|
42
|
+
chainId: StarknetChainId;
|
|
43
|
+
version: `${ETransactionVersion2}`;
|
|
44
|
+
};
|
|
45
|
+
export type V3DeployAccountSignerDetails = Required<DeployAccountContractPayload> & V3TransactionDetails & {
|
|
46
|
+
contractAddress: BigNumberish;
|
|
47
|
+
chainId: StarknetChainId;
|
|
48
|
+
version: `${ETransactionVersion3}`;
|
|
49
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RejectedTransactionReceiptResponse, RevertedTransactionReceiptResponse, SuccessfulTransactionReceiptResponse } from './provider';
|
|
2
|
+
export type TransactionStatusReceiptSets = {
|
|
3
|
+
success: SuccessfulTransactionReceiptResponse;
|
|
4
|
+
reverted: RevertedTransactionReceiptResponse;
|
|
5
|
+
rejected: RejectedTransactionReceiptResponse;
|
|
6
|
+
error: Error;
|
|
7
|
+
};
|
|
8
|
+
export type TransactionReceiptStatus = keyof TransactionStatusReceiptSets;
|
|
9
|
+
export type TransactionReceiptValue = TransactionStatusReceiptSets[TransactionReceiptStatus];
|
|
10
|
+
export type TransactionReceiptCallbacksDefined = {
|
|
11
|
+
[key in TransactionReceiptStatus]: (response: TransactionStatusReceiptSets[key]) => void;
|
|
12
|
+
};
|
|
13
|
+
export type TransactionReceiptCallbacksDefault = Partial<TransactionReceiptCallbacksDefined> & {
|
|
14
|
+
_: () => void;
|
|
15
|
+
};
|
|
16
|
+
export type TransactionReceiptCallbacks = TransactionReceiptCallbacksDefined | TransactionReceiptCallbacksDefault;
|
|
17
|
+
export type TransactionReceiptUtilityInterface = {
|
|
18
|
+
readonly statusReceipt: TransactionReceiptStatus;
|
|
19
|
+
readonly value: TransactionReceiptValue;
|
|
20
|
+
match(callbacks: TransactionReceiptCallbacks): void;
|
|
21
|
+
} & {
|
|
22
|
+
[key in `is${Capitalize<TransactionReceiptStatus>}`]: () => boolean;
|
|
23
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "TypedDataRevision", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _starknetTypes.TypedDataRevision;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _starknetTypes = require("starknet-types-07");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TypedDataRevision, type StarknetEnumType, type StarknetMerkleType, type StarknetType, type StarknetDomain, type TypedData, } from 'starknet-types-07';
|