starknet 8.1.2 → 8.3.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 +12 -0
- package/dist/index.d.ts +818 -114
- package/dist/index.global.js +2137 -421
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +2158 -421
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2137 -421
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as RPC from '@starknet-io/starknet-types-09';
|
|
2
|
-
import { CONTRACT, ETransactionType, EDataAvailabilityMode as EDataAvailabilityMode$1,
|
|
2
|
+
import { CONTRACT, ETransactionType, EDataAvailabilityMode as EDataAvailabilityMode$1, SUBSCRIPTION_BLOCK_ID, IsSucceeded, TransactionReceipt as TransactionReceipt$1, IsReverted, BLOCK_WITH_TX_HASHES, IsType, OutsideExecutionTypedData, TypedData, CONTRACT_STORAGE_KEYS, StorageProof, CASM_COMPILED_CONTRACT_CLASS, ETransactionVersion3 as ETransactionVersion3$1, BlockHash, TransactionHash, FAILED_TO_RECEIVE_TXN, NO_TRACE_AVAILABLE, CONTRACT_NOT_FOUND, ENTRYPOINT_NOT_FOUND, BLOCK_NOT_FOUND, INVALID_TXN_INDEX, CLASS_HASH_NOT_FOUND, TXN_HASH_NOT_FOUND, PAGE_SIZE_TOO_BIG, NO_BLOCKS, INVALID_CONTINUATION_TOKEN, TOO_MANY_KEYS_IN_FILTER, CONTRACT_ERROR, TRANSACTION_EXECUTION_ERROR, STORAGE_PROOF_NOT_SUPPORTED, CLASS_ALREADY_DECLARED, INVALID_TRANSACTION_NONCE, INSUFFICIENT_RESOURCES_FOR_VALIDATE, INSUFFICIENT_ACCOUNT_BALANCE, VALIDATION_FAILURE, COMPILATION_FAILED, CONTRACT_CLASS_SIZE_IS_TOO_LARGE, NON_ACCOUNT, DUPLICATE_TX, COMPILED_CLASS_HASH_MISMATCH, UNSUPPORTED_TX_VERSION, UNSUPPORTED_CONTRACT_CLASS_VERSION, UNEXPECTED_ERROR, INVALID_SUBSCRIPTION_ID, TOO_MANY_ADDRESSES_IN_FILTER, TOO_MANY_BLOCKS_BACK, COMPILATION_ERROR, ETransactionVersion as ETransactionVersion$1, SUBSCRIPTION_ID, TXN_FINALITY_STATUS, STATUS_ACCEPTED_ON_L1, TXN_STATUS_WITHOUT_L1, StarknetEventsEvent, TransactionsStatusEvent, NewTransactionReceiptsEvent, NewTransactionEvent, NewHeadsEvent, BLOCK_STATUS, BLOCK_HEADER, BLOCK_BODY_WITH_TX_HASHES, PRE_CONFIRMED_BLOCK_HEADER, BLOCK_BODY_WITH_TXS, BLOCK_BODY_WITH_RECEIPTS, BlockTransactionsTraces, TXN_STATUS_RESULT, StarknetWindowObject, AccountChangeEventHandler, NetworkChangeEventHandler, WatchAssetParameters, AddStarknetChainParameters, Signature as Signature$1, EDAMode as EDAMode$1, StarknetType, StarknetMerkleType, TypedDataRevision, OutsideCallV1, OutsideCallV2, EmittedEvent as EmittedEvent$1, Address, Permission, ChainId, AccountDeploymentData, AddInvokeTransactionParameters, AddInvokeTransactionResult, AddDeclareTransactionParameters, AddDeclareTransactionResult, SpecVersion } from '@starknet-io/starknet-types-09';
|
|
3
3
|
export { StarknetDomain, StarknetEnumType, StarknetMerkleType, StarknetType, TypedData, TypedDataRevision } from '@starknet-io/starknet-types-09';
|
|
4
4
|
import * as RPCSPEC08 from '@starknet-io/starknet-types-08';
|
|
5
5
|
import { PAYMASTER_API } from '@starknet-io/starknet-types-08';
|
|
@@ -491,7 +491,7 @@ declare const ETransactionVersion3: {
|
|
|
491
491
|
type BLOCK_HASH = Merge<RPCSPEC08.BLOCK_HASH, RPC.BLOCK_HASH>;
|
|
492
492
|
type BLOCK_NUMBER = Merge<RPCSPEC08.BLOCK_NUMBER, RPC.BLOCK_NUMBER>;
|
|
493
493
|
type FELT = Merge<RPCSPEC08.FELT, RPC.FELT>;
|
|
494
|
-
type TXN_HASH
|
|
494
|
+
type TXN_HASH = Merge<RPCSPEC08.TXN_HASH, RPC.TXN_HASH>;
|
|
495
495
|
type PRICE_UNIT = Merge<RPCSPEC08.PRICE_UNIT, RPC.PRICE_UNIT>;
|
|
496
496
|
type RESOURCE_PRICE = Merge<RPCSPEC08.RESOURCE_PRICE, RPC.RESOURCE_PRICE>;
|
|
497
497
|
type SIMULATION_FLAG = Merge<RPCSPEC08.SIMULATION_FLAG, RPC.SIMULATION_FLAG>;
|
|
@@ -620,6 +620,16 @@ type ByteArray = {
|
|
|
620
620
|
type Calldata = string[] & {
|
|
621
621
|
readonly __compiled__?: true;
|
|
622
622
|
};
|
|
623
|
+
/**
|
|
624
|
+
* "Abi Entry type"
|
|
625
|
+
* @example
|
|
626
|
+
* 'core::bytes_31::bytes31'
|
|
627
|
+
* 'core::bool'
|
|
628
|
+
* 'core::felt'
|
|
629
|
+
* 'core::uint256'
|
|
630
|
+
* 'core::uint512'
|
|
631
|
+
*/
|
|
632
|
+
type AbiEntryType = AbiEntry['type'];
|
|
623
633
|
/**
|
|
624
634
|
* Represents an integer in the range [0, 2^256)
|
|
625
635
|
*/
|
|
@@ -780,7 +790,8 @@ type BlockNumber = BlockTag | null | number;
|
|
|
780
790
|
* null return 'pending' block tag
|
|
781
791
|
*/
|
|
782
792
|
type BlockIdentifier = BlockNumber | BigNumberish;
|
|
783
|
-
type
|
|
793
|
+
type SubscriptionBlockTag = Extract<SUBSCRIPTION_BLOCK_ID, string>;
|
|
794
|
+
type SubscriptionBlockIdentifier = SubscriptionBlockTag | (string & {}) | number | bigint;
|
|
784
795
|
/**
|
|
785
796
|
* items used by AccountInvocations
|
|
786
797
|
*/
|
|
@@ -1840,9 +1851,9 @@ type TipAnalysisOptions = {
|
|
|
1840
1851
|
declare function getTipStatsFromBlocks(provider: ProviderInterface, blockIdentifier?: BlockIdentifier, options?: TipAnalysisOptions): Promise<TipEstimate>;
|
|
1841
1852
|
|
|
1842
1853
|
type TransactionStatusReceiptSets = {
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1854
|
+
SUCCEEDED: SuccessfulTransactionReceiptResponse;
|
|
1855
|
+
REVERTED: RevertedTransactionReceiptResponse;
|
|
1856
|
+
ERROR: Error;
|
|
1846
1857
|
};
|
|
1847
1858
|
type TransactionReceiptStatus = keyof TransactionStatusReceiptSets;
|
|
1848
1859
|
type TransactionReceiptValue = TransactionStatusReceiptSets[TransactionReceiptStatus];
|
|
@@ -1853,14 +1864,31 @@ type TransactionReceiptCallbacksDefault = Partial<TransactionReceiptCallbacksDef
|
|
|
1853
1864
|
_: () => void;
|
|
1854
1865
|
};
|
|
1855
1866
|
type TransactionReceiptCallbacks = TransactionReceiptCallbacksDefined | TransactionReceiptCallbacksDefault;
|
|
1856
|
-
type
|
|
1857
|
-
|
|
1858
|
-
readonly
|
|
1859
|
-
readonly value: TransactionStatusReceiptSets[T];
|
|
1867
|
+
type SuccessfulTransactionReceiptResponseHelper = SuccessfulTransactionReceiptResponse & {
|
|
1868
|
+
readonly statusReceipt: 'SUCCEEDED';
|
|
1869
|
+
readonly value: SuccessfulTransactionReceiptResponse;
|
|
1860
1870
|
match(callbacks: TransactionReceiptCallbacks): void;
|
|
1861
|
-
|
|
1862
|
-
|
|
1871
|
+
isSuccess(): this is SuccessfulTransactionReceiptResponseHelper;
|
|
1872
|
+
isReverted(): this is RevertedTransactionReceiptResponseHelper;
|
|
1873
|
+
isError(): this is ErrorReceiptResponseHelper;
|
|
1874
|
+
};
|
|
1875
|
+
type RevertedTransactionReceiptResponseHelper = RevertedTransactionReceiptResponse & {
|
|
1876
|
+
readonly statusReceipt: 'REVERTED';
|
|
1877
|
+
readonly value: RevertedTransactionReceiptResponse;
|
|
1878
|
+
match(callbacks: TransactionReceiptCallbacks): void;
|
|
1879
|
+
isSuccess(): this is SuccessfulTransactionReceiptResponseHelper;
|
|
1880
|
+
isReverted(): this is RevertedTransactionReceiptResponseHelper;
|
|
1881
|
+
isError(): this is ErrorReceiptResponseHelper;
|
|
1863
1882
|
};
|
|
1883
|
+
type ErrorReceiptResponseHelper = {
|
|
1884
|
+
readonly statusReceipt: 'ERROR';
|
|
1885
|
+
readonly value: Error;
|
|
1886
|
+
match(callbacks: TransactionReceiptCallbacks): void;
|
|
1887
|
+
isSuccess(): this is SuccessfulTransactionReceiptResponseHelper;
|
|
1888
|
+
isReverted(): this is RevertedTransactionReceiptResponseHelper;
|
|
1889
|
+
isError(): this is ErrorReceiptResponseHelper;
|
|
1890
|
+
};
|
|
1891
|
+
type GetTransactionReceiptResponse = SuccessfulTransactionReceiptResponseHelper | RevertedTransactionReceiptResponseHelper | ErrorReceiptResponseHelper;
|
|
1864
1892
|
|
|
1865
1893
|
declare abstract class ResponseParser {
|
|
1866
1894
|
abstract parseGetBlockResponse(res: BlockWithTxHashes): GetBlockResponse;
|
|
@@ -2508,11 +2536,20 @@ declare const Uint: {
|
|
|
2508
2536
|
readonly u16: "core::integer::u16";
|
|
2509
2537
|
readonly u32: "core::integer::u32";
|
|
2510
2538
|
readonly u64: "core::integer::u64";
|
|
2539
|
+
readonly u96: "core::integer::u96";
|
|
2511
2540
|
readonly u128: "core::integer::u128";
|
|
2512
2541
|
readonly u256: "core::integer::u256";
|
|
2513
2542
|
readonly u512: "core::integer::u512";
|
|
2514
2543
|
};
|
|
2515
2544
|
type Uint = ValuesType<typeof Uint>;
|
|
2545
|
+
declare const Int: {
|
|
2546
|
+
readonly i8: "core::integer::i8";
|
|
2547
|
+
readonly i16: "core::integer::i16";
|
|
2548
|
+
readonly i32: "core::integer::i32";
|
|
2549
|
+
readonly i64: "core::integer::i64";
|
|
2550
|
+
readonly i128: "core::integer::i128";
|
|
2551
|
+
};
|
|
2552
|
+
type Int = ValuesType<typeof Int>;
|
|
2516
2553
|
declare const Literal: {
|
|
2517
2554
|
readonly ClassHash: "core::starknet::class_hash::ClassHash";
|
|
2518
2555
|
readonly ContractAddress: "core::starknet::contract_address::ContractAddress";
|
|
@@ -2954,6 +2991,178 @@ declare abstract class AccountInterface extends ProviderInterface {
|
|
|
2954
2991
|
abstract declareIfNot(contractPayload: DeclareContractPayload, transactionsDetail?: InvocationsDetails): Promise<DeclareContractResponse>;
|
|
2955
2992
|
}
|
|
2956
2993
|
|
|
2994
|
+
/**
|
|
2995
|
+
* Abi parser interface
|
|
2996
|
+
*/
|
|
2997
|
+
declare abstract class AbiParserInterface {
|
|
2998
|
+
/**
|
|
2999
|
+
* Helper to calculate inputs length from abi
|
|
3000
|
+
* @param abiMethod FunctionAbi
|
|
3001
|
+
* @return number
|
|
3002
|
+
*/
|
|
3003
|
+
abstract methodInputsLength(abiMethod: FunctionAbi): number;
|
|
3004
|
+
/**
|
|
3005
|
+
* get method definition from abi
|
|
3006
|
+
* @param name string
|
|
3007
|
+
* @returns FunctionAbi | undefined
|
|
3008
|
+
*/
|
|
3009
|
+
abstract getMethod(name: string): FunctionAbi | undefined;
|
|
3010
|
+
/**
|
|
3011
|
+
* Return Abi in legacy format
|
|
3012
|
+
* @return Abi
|
|
3013
|
+
*/
|
|
3014
|
+
abstract getLegacyFormat(): Abi;
|
|
3015
|
+
/**
|
|
3016
|
+
* Get request parser for the given abi type
|
|
3017
|
+
* @param abiType AbiEntryType
|
|
3018
|
+
* @returns Parser function
|
|
3019
|
+
*/
|
|
3020
|
+
abstract getRequestParser(abiType: AbiEntryType): (val: unknown) => any;
|
|
3021
|
+
/**
|
|
3022
|
+
* Get response parser for the given abi type
|
|
3023
|
+
* @param abiType AbiEntryType
|
|
3024
|
+
* @returns Parser function
|
|
3025
|
+
*/
|
|
3026
|
+
abstract getResponseParser(abiType: AbiEntryType): (responseIterator: Iterator<string>) => any;
|
|
3027
|
+
}
|
|
3028
|
+
|
|
3029
|
+
/**
|
|
3030
|
+
* Parsing map for parser, request and response parsers are separated
|
|
3031
|
+
* Configure parsing strategy for each abi type
|
|
3032
|
+
*/
|
|
3033
|
+
type ParsingStrategy = {
|
|
3034
|
+
request: Record<AbiEntryType, (val: unknown) => any>;
|
|
3035
|
+
response: Record<AbiEntryType, (responseIterator: Iterator<string>) => any>;
|
|
3036
|
+
};
|
|
3037
|
+
/**
|
|
3038
|
+
* More robust parsing strategy
|
|
3039
|
+
* Configuration mapping - data-driven approach
|
|
3040
|
+
* Configure parsing strategy for each abi type
|
|
3041
|
+
*/
|
|
3042
|
+
declare const hdParsingStrategy: {
|
|
3043
|
+
readonly request: {
|
|
3044
|
+
readonly [x: string]: (val: unknown) => string[];
|
|
3045
|
+
readonly "core::bytes_31::bytes31": (val: unknown) => string[];
|
|
3046
|
+
readonly "core::byte_array::ByteArray": (val: unknown) => string[];
|
|
3047
|
+
readonly "core::felt252": (val: unknown) => string[];
|
|
3048
|
+
readonly "core::integer::u256": (val: unknown) => string[];
|
|
3049
|
+
};
|
|
3050
|
+
readonly response: {
|
|
3051
|
+
readonly [x: string]: ((responseIterator: Iterator<string>) => string) | ((responseIterator: Iterator<string>) => bigint);
|
|
3052
|
+
readonly "core::bytes_31::bytes31": (responseIterator: Iterator<string>) => string;
|
|
3053
|
+
readonly "core::byte_array::ByteArray": (responseIterator: Iterator<string>) => string;
|
|
3054
|
+
readonly "core::felt252": (responseIterator: Iterator<string>) => bigint;
|
|
3055
|
+
readonly "core::integer::u256": (responseIterator: Iterator<string>) => bigint;
|
|
3056
|
+
};
|
|
3057
|
+
};
|
|
3058
|
+
/**
|
|
3059
|
+
* Faster parsing strategy
|
|
3060
|
+
* Configuration mapping - data-driven approach
|
|
3061
|
+
* Configure parsing strategy for each abi type
|
|
3062
|
+
*/
|
|
3063
|
+
declare const fastParsingStrategy: ParsingStrategy;
|
|
3064
|
+
|
|
3065
|
+
declare class AbiParser1 implements AbiParserInterface {
|
|
3066
|
+
abi: Abi;
|
|
3067
|
+
parsingStrategy: ParsingStrategy;
|
|
3068
|
+
constructor(abi: Abi, parsingStrategy?: ParsingStrategy);
|
|
3069
|
+
getRequestParser(abiType: AbiEntryType): (val: unknown) => any;
|
|
3070
|
+
getResponseParser(abiType: AbiEntryType): (responseIterator: Iterator<string>) => any;
|
|
3071
|
+
/**
|
|
3072
|
+
* abi method inputs length without '_len' inputs
|
|
3073
|
+
* cairo 0 reducer
|
|
3074
|
+
* @param abiMethod FunctionAbi
|
|
3075
|
+
* @returns number
|
|
3076
|
+
*/
|
|
3077
|
+
methodInputsLength(abiMethod: FunctionAbi): number;
|
|
3078
|
+
/**
|
|
3079
|
+
* get method definition from abi
|
|
3080
|
+
* @param name string
|
|
3081
|
+
* @returns FunctionAbi | undefined
|
|
3082
|
+
*/
|
|
3083
|
+
getMethod(name: string): FunctionAbi | undefined;
|
|
3084
|
+
/**
|
|
3085
|
+
* Get Abi in legacy format
|
|
3086
|
+
* @returns Abi
|
|
3087
|
+
*/
|
|
3088
|
+
getLegacyFormat(): Abi;
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3091
|
+
declare class AbiParser2 implements AbiParserInterface {
|
|
3092
|
+
abi: Abi;
|
|
3093
|
+
parsingStrategy: ParsingStrategy;
|
|
3094
|
+
constructor(abi: Abi, parsingStrategy?: ParsingStrategy);
|
|
3095
|
+
getRequestParser(abiType: AbiEntryType): (val: unknown) => any;
|
|
3096
|
+
getResponseParser(abiType: AbiEntryType): (responseIterator: Iterator<string>) => any;
|
|
3097
|
+
/**
|
|
3098
|
+
* abi method inputs length
|
|
3099
|
+
* @param abiMethod FunctionAbi
|
|
3100
|
+
* @returns number
|
|
3101
|
+
*/
|
|
3102
|
+
methodInputsLength(abiMethod: FunctionAbi): number;
|
|
3103
|
+
/**
|
|
3104
|
+
* get method definition from abi
|
|
3105
|
+
* @param name string
|
|
3106
|
+
* @returns FunctionAbi | undefined
|
|
3107
|
+
*/
|
|
3108
|
+
getMethod(name: string): FunctionAbi | undefined;
|
|
3109
|
+
/**
|
|
3110
|
+
* Get Abi in legacy format
|
|
3111
|
+
* @returns Abi
|
|
3112
|
+
*/
|
|
3113
|
+
getLegacyFormat(): Abi;
|
|
3114
|
+
}
|
|
3115
|
+
|
|
3116
|
+
/**
|
|
3117
|
+
* Creates ABI parser
|
|
3118
|
+
*
|
|
3119
|
+
* @param {Abi} abi
|
|
3120
|
+
* @returns {AbiParserInterface} abi parser interface
|
|
3121
|
+
*
|
|
3122
|
+
* @example
|
|
3123
|
+
* const abiParser2 = createAbiParser([getInterfaceAbi('struct')]);
|
|
3124
|
+
* // abiParser2 instanceof AbiParser2 === true
|
|
3125
|
+
*
|
|
3126
|
+
* const abiParser1 = createAbiParser([getFunctionAbi('struct')]);
|
|
3127
|
+
* // abiParser1 instanceof AbiParser1 === true
|
|
3128
|
+
*/
|
|
3129
|
+
declare function createAbiParser(abi: Abi, parsingStrategy?: ParsingStrategy): AbiParserInterface;
|
|
3130
|
+
/**
|
|
3131
|
+
* Retrieves ABI version
|
|
3132
|
+
*
|
|
3133
|
+
* @param {Abi} abi
|
|
3134
|
+
* @returns {1 | 2 | 0} abi 1, 2 or 0 version
|
|
3135
|
+
*
|
|
3136
|
+
* @example
|
|
3137
|
+
* // Example 1: Return ABI version 2
|
|
3138
|
+
* const version = getAbiVersion([getInterfaceAbi()]);
|
|
3139
|
+
* // version === 2
|
|
3140
|
+
*
|
|
3141
|
+
* // Example 2: Return ABI version 1
|
|
3142
|
+
* const version = getAbiVersion([getInterfaceAbi('core::bool')]);
|
|
3143
|
+
* // version === 1
|
|
3144
|
+
*
|
|
3145
|
+
* // Example 3: Return ABI version 0
|
|
3146
|
+
* const version = getAbiVersion([getInterfaceAbi('felt')]);
|
|
3147
|
+
* // version === 0
|
|
3148
|
+
*/
|
|
3149
|
+
declare function getAbiVersion(abi: Abi): 1 | 2 | 0;
|
|
3150
|
+
/**
|
|
3151
|
+
* Checks if no constructor valid
|
|
3152
|
+
*
|
|
3153
|
+
* @param {string} method
|
|
3154
|
+
* @param {RawArgs} argsCalldata
|
|
3155
|
+
* @param {FunctionAbi} abiMethod
|
|
3156
|
+
* @returns boolean
|
|
3157
|
+
*
|
|
3158
|
+
* @example
|
|
3159
|
+
* const result1 = isNoConstructorValid('constructor', [])
|
|
3160
|
+
* // result1 === true
|
|
3161
|
+
* const result2 = isNoConstructorValid('test', ['test'])
|
|
3162
|
+
* // result2 === false
|
|
3163
|
+
*/
|
|
3164
|
+
declare function isNoConstructorValid(method: string, argsCalldata: RawArgs, abiMethod?: FunctionAbi): boolean;
|
|
3165
|
+
|
|
2957
3166
|
type AsyncContractFunction<T = any> = (...args: ArgsOrCalldataWithOptions) => Promise<T>;
|
|
2958
3167
|
type ContractFunction = (...args: ArgsOrCalldataWithOptions) => any;
|
|
2959
3168
|
type CallResult = {
|
|
@@ -2972,6 +3181,10 @@ type CommonContractOptions = {
|
|
|
2972
3181
|
* @default true
|
|
2973
3182
|
*/
|
|
2974
3183
|
parseResponse?: boolean;
|
|
3184
|
+
/**
|
|
3185
|
+
* Custom parsing strategy for request/response processing
|
|
3186
|
+
*/
|
|
3187
|
+
parsingStrategy?: ParsingStrategy;
|
|
2975
3188
|
};
|
|
2976
3189
|
type ContractOptions = {
|
|
2977
3190
|
abi: Abi;
|
|
@@ -2996,6 +3209,11 @@ type ExecuteOptions = Pick<CommonContractOptions, 'parseRequest'> & {
|
|
|
2996
3209
|
* Deployer contract salt
|
|
2997
3210
|
*/
|
|
2998
3211
|
salt?: string;
|
|
3212
|
+
/**
|
|
3213
|
+
* Wait for transaction to be included in a block
|
|
3214
|
+
* @default false
|
|
3215
|
+
*/
|
|
3216
|
+
waitForTransaction?: boolean;
|
|
2999
3217
|
} & Partial<UniversalDetails>;
|
|
3000
3218
|
type CallOptions = CommonContractOptions & {
|
|
3001
3219
|
formatResponse?: FormatResponse;
|
|
@@ -3008,7 +3226,9 @@ type ParsedEvent = {
|
|
|
3008
3226
|
block_number?: BlockNumber;
|
|
3009
3227
|
transaction_hash?: TransactionHash;
|
|
3010
3228
|
};
|
|
3011
|
-
type ParsedEvents = Array<ParsedEvent
|
|
3229
|
+
type ParsedEvents = Array<ParsedEvent> & {
|
|
3230
|
+
getByPath?(path: string): ParsedStruct | null;
|
|
3231
|
+
};
|
|
3012
3232
|
/**
|
|
3013
3233
|
* Advance formatting used to get js types data as result
|
|
3014
3234
|
* @description https://starknetjs.com/docs/guides/define_call_message/#formatresponse
|
|
@@ -3050,7 +3270,7 @@ type DeployOnlyParams = FactoryParamsBase & {
|
|
|
3050
3270
|
constructorCalldata?: RawArgs;
|
|
3051
3271
|
abi?: Abi;
|
|
3052
3272
|
};
|
|
3053
|
-
type FactoryParams = DeclareAndDeployParams | DeployOnlyParams;
|
|
3273
|
+
type FactoryParams = (DeclareAndDeployParams | DeployOnlyParams) & CommonContractOptions;
|
|
3054
3274
|
|
|
3055
3275
|
type RPC_ERROR_SET = {
|
|
3056
3276
|
FAILED_TO_RECEIVE_TXN: FAILED_TO_RECEIVE_TXN;
|
|
@@ -3237,7 +3457,18 @@ declare function arrayBufferToString(array: ArrayBuffer): string;
|
|
|
3237
3457
|
* // result = Uint8Array(2) [ 72, 105 ]
|
|
3238
3458
|
* ```
|
|
3239
3459
|
*/
|
|
3240
|
-
declare function
|
|
3460
|
+
declare function utf8ToUint8Array(str: string): Uint8Array;
|
|
3461
|
+
/**
|
|
3462
|
+
* @deprecated use utf8ToUint8Array instead
|
|
3463
|
+
*/
|
|
3464
|
+
declare const utf8ToArray: typeof utf8ToUint8Array;
|
|
3465
|
+
/**
|
|
3466
|
+
* Convert utf8-string to bigint
|
|
3467
|
+
*
|
|
3468
|
+
* @param str The UTF-8 string to convert.
|
|
3469
|
+
* @returns The converted bigint.
|
|
3470
|
+
*/
|
|
3471
|
+
declare function utf8ToBigInt(str: string): bigint;
|
|
3241
3472
|
/**
|
|
3242
3473
|
* Convert string to array buffer (browser and node compatible)
|
|
3243
3474
|
*
|
|
@@ -3413,23 +3644,100 @@ declare const pascalToSnake: (text: string) => string;
|
|
|
3413
3644
|
* ```
|
|
3414
3645
|
*/
|
|
3415
3646
|
declare function concatenateArrayBuffer(uint8arrays: Uint8Array[]): Uint8Array;
|
|
3647
|
+
/**
|
|
3648
|
+
* Convert hex string to Uint8Array
|
|
3649
|
+
*
|
|
3650
|
+
* @param {string} hex The hex string to convert (with or without '0x' prefix)
|
|
3651
|
+
* @returns {Uint8Array} The converted byte array
|
|
3652
|
+
* @throws {Error} If the string contains non-hexadecimal characters
|
|
3653
|
+
*
|
|
3654
|
+
* @example
|
|
3655
|
+
* ```typescript
|
|
3656
|
+
* const hexString = '0x48656c6c6f';
|
|
3657
|
+
* const result = encode.hexStringToUint8Array(hexString);
|
|
3658
|
+
* // result = Uint8Array(5) [ 72, 101, 108, 108, 111 ]
|
|
3659
|
+
* ```
|
|
3660
|
+
*/
|
|
3661
|
+
declare function hexStringToUint8Array(hex: string): Uint8Array;
|
|
3662
|
+
/**
|
|
3663
|
+
* Convert any string to Uint8Array
|
|
3664
|
+
*
|
|
3665
|
+
* Handles three types of strings:
|
|
3666
|
+
* - Hex strings (e.g., '0x123f') - converts hex bytes to Uint8Array
|
|
3667
|
+
* - Decimal strings (e.g., '124324332') - converts decimal number to bytes
|
|
3668
|
+
* - Text strings (e.g., 'I am cool ☥') - converts UTF-8 text to bytes
|
|
3669
|
+
*
|
|
3670
|
+
* @param {string} str The string to convert
|
|
3671
|
+
* @returns {Uint8Array} The converted byte array
|
|
3672
|
+
*
|
|
3673
|
+
* @example
|
|
3674
|
+
* ```typescript
|
|
3675
|
+
* // Hex string
|
|
3676
|
+
* const hex = stringToUint8Array('0x48656c6c6f');
|
|
3677
|
+
* // result = Uint8Array(5) [ 72, 101, 108, 108, 111 ]
|
|
3678
|
+
*
|
|
3679
|
+
* // Decimal string
|
|
3680
|
+
* const decimal = stringToUint8Array('256');
|
|
3681
|
+
* // result = Uint8Array(2) [ 1, 0 ]
|
|
3682
|
+
*
|
|
3683
|
+
* // Text string
|
|
3684
|
+
* const text = stringToUint8Array('Hello ☥');
|
|
3685
|
+
* // result = UTF-8 encoded bytes
|
|
3686
|
+
* ```
|
|
3687
|
+
*/
|
|
3688
|
+
declare function stringToUint8Array(str: string): Uint8Array;
|
|
3689
|
+
/**
|
|
3690
|
+
* Convert bigint to Uint8Array (big-endian)
|
|
3691
|
+
*
|
|
3692
|
+
* @param {bigint} value The bigint value to convert (must be non-negative)
|
|
3693
|
+
* @returns {Uint8Array} The converted byte array in big-endian byte order
|
|
3694
|
+
* @throws {Error} If value is negative
|
|
3695
|
+
*
|
|
3696
|
+
* @example
|
|
3697
|
+
* ```typescript
|
|
3698
|
+
* const value = 256n; // 0x0100
|
|
3699
|
+
* const result = encode.bigIntToUint8Array(value);
|
|
3700
|
+
* // result = Uint8Array([1, 0]) - big-endian, MSB first
|
|
3701
|
+
* ```
|
|
3702
|
+
*/
|
|
3703
|
+
declare function bigIntToUint8Array(value: bigint): Uint8Array;
|
|
3704
|
+
/**
|
|
3705
|
+
* Convert Uint8Array to bigint (big-endian)
|
|
3706
|
+
*
|
|
3707
|
+
* @param {Uint8Array} data The Uint8Array to convert (interpreted as big-endian)
|
|
3708
|
+
* @returns {bigint} The converted bigint value
|
|
3709
|
+
*
|
|
3710
|
+
* @example
|
|
3711
|
+
* ```typescript
|
|
3712
|
+
* const data = new Uint8Array([1, 0]); // Big-endian representation
|
|
3713
|
+
* const result = encode.uint8ArrayToBigInt(data);
|
|
3714
|
+
* // result = 256n (0x0100)
|
|
3715
|
+
* ```
|
|
3716
|
+
*/
|
|
3717
|
+
declare function uint8ArrayToBigInt(data: Uint8Array): bigint;
|
|
3416
3718
|
|
|
3417
3719
|
declare const encode_IS_BROWSER: typeof IS_BROWSER;
|
|
3418
3720
|
declare const encode_addHexPrefix: typeof addHexPrefix;
|
|
3419
3721
|
declare const encode_arrayBufferToString: typeof arrayBufferToString;
|
|
3420
3722
|
declare const encode_atobUniversal: typeof atobUniversal;
|
|
3723
|
+
declare const encode_bigIntToUint8Array: typeof bigIntToUint8Array;
|
|
3421
3724
|
declare const encode_btoaUniversal: typeof btoaUniversal;
|
|
3422
3725
|
declare const encode_buf2hex: typeof buf2hex;
|
|
3423
3726
|
declare const encode_calcByteLength: typeof calcByteLength;
|
|
3424
3727
|
declare const encode_concatenateArrayBuffer: typeof concatenateArrayBuffer;
|
|
3728
|
+
declare const encode_hexStringToUint8Array: typeof hexStringToUint8Array;
|
|
3425
3729
|
declare const encode_padLeft: typeof padLeft;
|
|
3426
3730
|
declare const encode_pascalToSnake: typeof pascalToSnake;
|
|
3427
3731
|
declare const encode_removeHexPrefix: typeof removeHexPrefix;
|
|
3428
3732
|
declare const encode_sanitizeBytes: typeof sanitizeBytes;
|
|
3429
3733
|
declare const encode_sanitizeHex: typeof sanitizeHex;
|
|
3734
|
+
declare const encode_stringToUint8Array: typeof stringToUint8Array;
|
|
3735
|
+
declare const encode_uint8ArrayToBigInt: typeof uint8ArrayToBigInt;
|
|
3430
3736
|
declare const encode_utf8ToArray: typeof utf8ToArray;
|
|
3737
|
+
declare const encode_utf8ToBigInt: typeof utf8ToBigInt;
|
|
3738
|
+
declare const encode_utf8ToUint8Array: typeof utf8ToUint8Array;
|
|
3431
3739
|
declare namespace encode {
|
|
3432
|
-
export { encode_IS_BROWSER as IS_BROWSER, encode_addHexPrefix as addHexPrefix, encode_arrayBufferToString as arrayBufferToString, encode_atobUniversal as atobUniversal, encode_btoaUniversal as btoaUniversal, encode_buf2hex as buf2hex, encode_calcByteLength as calcByteLength, encode_concatenateArrayBuffer as concatenateArrayBuffer, encode_padLeft as padLeft, encode_pascalToSnake as pascalToSnake, encode_removeHexPrefix as removeHexPrefix, encode_sanitizeBytes as sanitizeBytes, encode_sanitizeHex as sanitizeHex, encode_utf8ToArray as utf8ToArray };
|
|
3740
|
+
export { encode_IS_BROWSER as IS_BROWSER, encode_addHexPrefix as addHexPrefix, encode_arrayBufferToString as arrayBufferToString, encode_atobUniversal as atobUniversal, encode_bigIntToUint8Array as bigIntToUint8Array, encode_btoaUniversal as btoaUniversal, encode_buf2hex as buf2hex, encode_calcByteLength as calcByteLength, encode_concatenateArrayBuffer as concatenateArrayBuffer, encode_hexStringToUint8Array as hexStringToUint8Array, encode_padLeft as padLeft, encode_pascalToSnake as pascalToSnake, encode_removeHexPrefix as removeHexPrefix, encode_sanitizeBytes as sanitizeBytes, encode_sanitizeHex as sanitizeHex, encode_stringToUint8Array as stringToUint8Array, encode_uint8ArrayToBigInt as uint8ArrayToBigInt, encode_utf8ToArray as utf8ToArray, encode_utf8ToBigInt as utf8ToBigInt, encode_utf8ToUint8Array as utf8ToUint8Array };
|
|
3433
3741
|
}
|
|
3434
3742
|
|
|
3435
3743
|
/**
|
|
@@ -3447,7 +3755,23 @@ declare const RANGE_FELT: {
|
|
|
3447
3755
|
readonly min: bigint;
|
|
3448
3756
|
readonly max: bigint;
|
|
3449
3757
|
};
|
|
3450
|
-
declare const
|
|
3758
|
+
declare const RANGE_U8: {
|
|
3759
|
+
readonly min: bigint;
|
|
3760
|
+
readonly max: bigint;
|
|
3761
|
+
};
|
|
3762
|
+
declare const RANGE_U16: {
|
|
3763
|
+
readonly min: bigint;
|
|
3764
|
+
readonly max: bigint;
|
|
3765
|
+
};
|
|
3766
|
+
declare const RANGE_U32: {
|
|
3767
|
+
readonly min: bigint;
|
|
3768
|
+
readonly max: bigint;
|
|
3769
|
+
};
|
|
3770
|
+
declare const RANGE_U64: {
|
|
3771
|
+
readonly min: bigint;
|
|
3772
|
+
readonly max: bigint;
|
|
3773
|
+
};
|
|
3774
|
+
declare const RANGE_U96: {
|
|
3451
3775
|
readonly min: bigint;
|
|
3452
3776
|
readonly max: bigint;
|
|
3453
3777
|
};
|
|
@@ -3455,6 +3779,26 @@ declare const RANGE_U128: {
|
|
|
3455
3779
|
readonly min: bigint;
|
|
3456
3780
|
readonly max: bigint;
|
|
3457
3781
|
};
|
|
3782
|
+
declare const RANGE_I8: {
|
|
3783
|
+
readonly min: bigint;
|
|
3784
|
+
readonly max: bigint;
|
|
3785
|
+
};
|
|
3786
|
+
declare const RANGE_I16: {
|
|
3787
|
+
readonly min: bigint;
|
|
3788
|
+
readonly max: bigint;
|
|
3789
|
+
};
|
|
3790
|
+
declare const RANGE_I32: {
|
|
3791
|
+
readonly min: bigint;
|
|
3792
|
+
readonly max: bigint;
|
|
3793
|
+
};
|
|
3794
|
+
declare const RANGE_I64: {
|
|
3795
|
+
readonly min: bigint;
|
|
3796
|
+
readonly max: bigint;
|
|
3797
|
+
};
|
|
3798
|
+
declare const RANGE_I128: {
|
|
3799
|
+
readonly min: bigint;
|
|
3800
|
+
readonly max: bigint;
|
|
3801
|
+
};
|
|
3458
3802
|
declare const LegacyUDC: {
|
|
3459
3803
|
readonly ADDRESS: "0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf";
|
|
3460
3804
|
readonly ENTRYPOINT: "deployContract";
|
|
@@ -3516,6 +3860,7 @@ declare const DEFAULT_GLOBAL_CONFIG: {
|
|
|
3516
3860
|
defaultTipType: TipType;
|
|
3517
3861
|
fetch: any;
|
|
3518
3862
|
websocket: any;
|
|
3863
|
+
buffer: any;
|
|
3519
3864
|
};
|
|
3520
3865
|
declare const RPC_DEFAULT_NODES: {
|
|
3521
3866
|
readonly SN_MAIN: readonly ["https://starknet-mainnet.public.blastapi.io/rpc/"];
|
|
@@ -3534,6 +3879,9 @@ declare const SYSTEM_MESSAGES: {
|
|
|
3534
3879
|
maxFeeInV3: string;
|
|
3535
3880
|
declareNonSierra: string;
|
|
3536
3881
|
unsupportedMethodForRpcVersion: string;
|
|
3882
|
+
txEvictedFromMempool: string;
|
|
3883
|
+
consensusFailed: string;
|
|
3884
|
+
txFailsBlockBuildingValidation: string;
|
|
3537
3885
|
};
|
|
3538
3886
|
|
|
3539
3887
|
declare const constants_ADDR_BOUND: typeof ADDR_BOUND;
|
|
@@ -3551,7 +3899,16 @@ declare const constants_PAYMASTER_RPC_NODES: typeof PAYMASTER_RPC_NODES;
|
|
|
3551
3899
|
declare const constants_PRIME: typeof PRIME;
|
|
3552
3900
|
declare const constants_RANGE_FELT: typeof RANGE_FELT;
|
|
3553
3901
|
declare const constants_RANGE_I128: typeof RANGE_I128;
|
|
3902
|
+
declare const constants_RANGE_I16: typeof RANGE_I16;
|
|
3903
|
+
declare const constants_RANGE_I32: typeof RANGE_I32;
|
|
3904
|
+
declare const constants_RANGE_I64: typeof RANGE_I64;
|
|
3905
|
+
declare const constants_RANGE_I8: typeof RANGE_I8;
|
|
3554
3906
|
declare const constants_RANGE_U128: typeof RANGE_U128;
|
|
3907
|
+
declare const constants_RANGE_U16: typeof RANGE_U16;
|
|
3908
|
+
declare const constants_RANGE_U32: typeof RANGE_U32;
|
|
3909
|
+
declare const constants_RANGE_U64: typeof RANGE_U64;
|
|
3910
|
+
declare const constants_RANGE_U8: typeof RANGE_U8;
|
|
3911
|
+
declare const constants_RANGE_U96: typeof RANGE_U96;
|
|
3555
3912
|
declare const constants_RPC_DEFAULT_NODES: typeof RPC_DEFAULT_NODES;
|
|
3556
3913
|
declare const constants_SNIP9_V1_INTERFACE_ID: typeof SNIP9_V1_INTERFACE_ID;
|
|
3557
3914
|
declare const constants_SNIP9_V2_INTERFACE_ID: typeof SNIP9_V2_INTERFACE_ID;
|
|
@@ -3562,7 +3919,7 @@ declare const constants_TEXT_TO_FELT_MAX_LEN: typeof TEXT_TO_FELT_MAX_LEN;
|
|
|
3562
3919
|
declare const constants_UDC: typeof UDC;
|
|
3563
3920
|
declare const constants_ZERO: typeof ZERO;
|
|
3564
3921
|
declare namespace constants {
|
|
3565
|
-
export { constants_ADDR_BOUND as ADDR_BOUND, constants_API_VERSION as API_VERSION, _BaseUrl as BaseUrl, constants_DEFAULT_GLOBAL_CONFIG as DEFAULT_GLOBAL_CONFIG, constants_HARDENING_4BYTES as HARDENING_4BYTES, constants_HARDENING_BYTE as HARDENING_BYTE, constants_IS_BROWSER as IS_BROWSER, constants_LegacyUDC as LegacyUDC, constants_MASK_250 as MASK_250, constants_MASK_31 as MASK_31, constants_MAX_STORAGE_ITEM_SIZE as MAX_STORAGE_ITEM_SIZE, _NetworkName as NetworkName, constants_OutsideExecutionCallerAny as OutsideExecutionCallerAny, constants_PAYMASTER_RPC_NODES as PAYMASTER_RPC_NODES, constants_PRIME as PRIME, constants_RANGE_FELT as RANGE_FELT, constants_RANGE_I128 as RANGE_I128, constants_RANGE_U128 as RANGE_U128, constants_RPC_DEFAULT_NODES as RPC_DEFAULT_NODES, constants_SNIP9_V1_INTERFACE_ID as SNIP9_V1_INTERFACE_ID, constants_SNIP9_V2_INTERFACE_ID as SNIP9_V2_INTERFACE_ID, constants_SYSTEM_MESSAGES as SYSTEM_MESSAGES, _StarknetChainId as StarknetChainId, type constants_SupportedCairoVersion as SupportedCairoVersion, _SupportedRpcVersion as SupportedRpcVersion, type constants_SupportedTransactionVersion as SupportedTransactionVersion, constants_TEXT_TO_FELT_MAX_LEN as TEXT_TO_FELT_MAX_LEN, _TransactionHashPrefix as TransactionHashPrefix, constants_UDC as UDC, constants_ZERO as ZERO };
|
|
3922
|
+
export { constants_ADDR_BOUND as ADDR_BOUND, constants_API_VERSION as API_VERSION, _BaseUrl as BaseUrl, constants_DEFAULT_GLOBAL_CONFIG as DEFAULT_GLOBAL_CONFIG, constants_HARDENING_4BYTES as HARDENING_4BYTES, constants_HARDENING_BYTE as HARDENING_BYTE, constants_IS_BROWSER as IS_BROWSER, constants_LegacyUDC as LegacyUDC, constants_MASK_250 as MASK_250, constants_MASK_31 as MASK_31, constants_MAX_STORAGE_ITEM_SIZE as MAX_STORAGE_ITEM_SIZE, _NetworkName as NetworkName, constants_OutsideExecutionCallerAny as OutsideExecutionCallerAny, constants_PAYMASTER_RPC_NODES as PAYMASTER_RPC_NODES, constants_PRIME as PRIME, constants_RANGE_FELT as RANGE_FELT, constants_RANGE_I128 as RANGE_I128, constants_RANGE_I16 as RANGE_I16, constants_RANGE_I32 as RANGE_I32, constants_RANGE_I64 as RANGE_I64, constants_RANGE_I8 as RANGE_I8, constants_RANGE_U128 as RANGE_U128, constants_RANGE_U16 as RANGE_U16, constants_RANGE_U32 as RANGE_U32, constants_RANGE_U64 as RANGE_U64, constants_RANGE_U8 as RANGE_U8, constants_RANGE_U96 as RANGE_U96, constants_RPC_DEFAULT_NODES as RPC_DEFAULT_NODES, constants_SNIP9_V1_INTERFACE_ID as SNIP9_V1_INTERFACE_ID, constants_SNIP9_V2_INTERFACE_ID as SNIP9_V2_INTERFACE_ID, constants_SYSTEM_MESSAGES as SYSTEM_MESSAGES, _StarknetChainId as StarknetChainId, type constants_SupportedCairoVersion as SupportedCairoVersion, _SupportedRpcVersion as SupportedRpcVersion, type constants_SupportedTransactionVersion as SupportedTransactionVersion, constants_TEXT_TO_FELT_MAX_LEN as TEXT_TO_FELT_MAX_LEN, _TransactionHashPrefix as TransactionHashPrefix, constants_UDC as UDC, constants_ZERO as ZERO };
|
|
3566
3923
|
}
|
|
3567
3924
|
|
|
3568
3925
|
declare class RpcChannel$1 {
|
|
@@ -3870,7 +4227,7 @@ type SubscriptionOptions = {
|
|
|
3870
4227
|
/** The parameters used to create this subscription (optional, defaults to empty object) */
|
|
3871
4228
|
params?: object;
|
|
3872
4229
|
/** The unique identifier for this subscription */
|
|
3873
|
-
id: SUBSCRIPTION_ID
|
|
4230
|
+
id: SUBSCRIPTION_ID;
|
|
3874
4231
|
/** The maximum number of events to buffer */
|
|
3875
4232
|
maxBufferSize: number;
|
|
3876
4233
|
};
|
|
@@ -3917,7 +4274,7 @@ declare class Subscription<T = any> {
|
|
|
3917
4274
|
* The unique identifier for this subscription.
|
|
3918
4275
|
* @internal
|
|
3919
4276
|
*/
|
|
3920
|
-
id: SUBSCRIPTION_ID
|
|
4277
|
+
id: SUBSCRIPTION_ID;
|
|
3921
4278
|
private events;
|
|
3922
4279
|
private buffer;
|
|
3923
4280
|
private maxBufferSize;
|
|
@@ -3957,12 +4314,32 @@ declare class Subscription<T = any> {
|
|
|
3957
4314
|
unsubscribe(): Promise<boolean>;
|
|
3958
4315
|
}
|
|
3959
4316
|
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
4317
|
+
interface SubscribeNewHeadsParams {
|
|
4318
|
+
blockIdentifier?: SubscriptionBlockIdentifier;
|
|
4319
|
+
}
|
|
4320
|
+
interface SubscribeEventsParams {
|
|
4321
|
+
fromAddress?: BigNumberish;
|
|
4322
|
+
keys?: string[][];
|
|
4323
|
+
blockIdentifier?: SubscriptionBlockIdentifier;
|
|
4324
|
+
finalityStatus?: Exclude<TXN_FINALITY_STATUS, STATUS_ACCEPTED_ON_L1>;
|
|
4325
|
+
}
|
|
4326
|
+
interface SubscribeTransactionStatusParams {
|
|
4327
|
+
transactionHash: BigNumberish;
|
|
4328
|
+
blockIdentifier?: SubscriptionBlockIdentifier;
|
|
4329
|
+
}
|
|
4330
|
+
interface SubscribeNewTransactionReceiptsParams {
|
|
4331
|
+
finalityStatus?: Exclude<TXN_FINALITY_STATUS, STATUS_ACCEPTED_ON_L1>[];
|
|
4332
|
+
senderAddress?: BigNumberish[];
|
|
4333
|
+
}
|
|
4334
|
+
interface SubscribeNewTransactionsParams {
|
|
4335
|
+
finalityStatus?: TXN_STATUS_WITHOUT_L1[];
|
|
4336
|
+
senderAddress?: BigNumberish[];
|
|
4337
|
+
}
|
|
4338
|
+
type SubscriptionNewHeadsEvent = Subscription<NewHeadsEvent['result']>;
|
|
4339
|
+
type SubscriptionStarknetEventsEvent = Subscription<StarknetEventsEvent['result']>;
|
|
4340
|
+
type SubscriptionTransactionStatusEvent = Subscription<TransactionsStatusEvent['result']>;
|
|
4341
|
+
type SubscriptionNewTransactionReceiptsEvent = Subscription<NewTransactionReceiptsEvent['result']>;
|
|
4342
|
+
type SubscriptionNewTransactionEvent = Subscription<NewTransactionEvent['result']>;
|
|
3966
4343
|
/**
|
|
3967
4344
|
* Options for configuring the automatic reconnection behavior of the WebSocketChannel.
|
|
3968
4345
|
*/
|
|
@@ -3979,6 +4356,9 @@ type ReconnectOptions = {
|
|
|
3979
4356
|
*/
|
|
3980
4357
|
delay?: number;
|
|
3981
4358
|
};
|
|
4359
|
+
/**
|
|
4360
|
+
* The type of the WebSocket implementation.
|
|
4361
|
+
*/
|
|
3982
4362
|
type WebSocketModule = {
|
|
3983
4363
|
new (nodeUrl: WebSocketOptions['nodeUrl']): WebSocket;
|
|
3984
4364
|
};
|
|
@@ -4166,32 +4546,34 @@ declare class WebSocketChannel {
|
|
|
4166
4546
|
private onMessageProxy;
|
|
4167
4547
|
/**
|
|
4168
4548
|
* Subscribes to new block headers.
|
|
4169
|
-
* @param {
|
|
4549
|
+
* @param {SubscribeNewHeadsParams} params - The parameters for the subscription.
|
|
4170
4550
|
* @returns {Promise<Subscription<BLOCK_HEADER>>} A Promise that resolves with a `Subscription` object for new block headers.
|
|
4171
4551
|
*/
|
|
4172
|
-
subscribeNewHeads(
|
|
4552
|
+
subscribeNewHeads(params?: SubscribeNewHeadsParams): Promise<SubscriptionNewHeadsEvent>;
|
|
4173
4553
|
/**
|
|
4174
4554
|
* Subscribes to events matching a given filter.
|
|
4175
|
-
* @param {
|
|
4176
|
-
* @param {string[][]} [keys] - The event keys to filter by.
|
|
4177
|
-
* @param {SubscriptionBlockIdentifier} [blockIdentifier] - The block to start receiving notifications from. Defaults to 'latest'.
|
|
4555
|
+
* @param {SubscribeEventsParams} params - The parameters for the subscription.
|
|
4178
4556
|
* @returns {Promise<Subscription<EMITTED_EVENT>>} A Promise that resolves with a `Subscription` object for the specified events.
|
|
4179
4557
|
*/
|
|
4180
|
-
subscribeEvents(
|
|
4558
|
+
subscribeEvents(params?: SubscribeEventsParams): Promise<SubscriptionStarknetEventsEvent>;
|
|
4181
4559
|
/**
|
|
4182
4560
|
* Subscribes to status updates for a specific transaction.
|
|
4183
|
-
* @param {
|
|
4184
|
-
* @param {SubscriptionBlockIdentifier} [blockIdentifier] - The block context. Not typically required.
|
|
4561
|
+
* @param {SubscribeTransactionStatusParams} params - The parameters for the subscription.
|
|
4185
4562
|
* @returns {Promise<Subscription<NEW_TXN_STATUS>>} A Promise that resolves with a `Subscription` object for the transaction's status.
|
|
4186
4563
|
*/
|
|
4187
|
-
subscribeTransactionStatus(
|
|
4564
|
+
subscribeTransactionStatus(params: SubscribeTransactionStatusParams): Promise<SubscriptionTransactionStatusEvent>;
|
|
4188
4565
|
/**
|
|
4189
|
-
* Subscribes to
|
|
4190
|
-
* @param {
|
|
4191
|
-
* @
|
|
4192
|
-
* @returns {Promise<Subscription<TXN_HASH | TXN_WITH_HASH>>} A Promise that resolves with a `Subscription` object for pending transactions.
|
|
4566
|
+
* Subscribes to new transaction receipts.
|
|
4567
|
+
* @param {SubscribeNewTransactionReceiptsParams} params - The parameters for the subscription.
|
|
4568
|
+
* @returns {Promise<Subscription<NewTransactionReceiptsEvent['result']>>} A Promise that resolves with a `Subscription` object for new transaction receipts.
|
|
4193
4569
|
*/
|
|
4194
|
-
|
|
4570
|
+
subscribeNewTransactionReceipts(params?: SubscribeNewTransactionReceiptsParams): Promise<SubscriptionNewTransactionReceiptsEvent>;
|
|
4571
|
+
/**
|
|
4572
|
+
* Subscribes to new transactions.
|
|
4573
|
+
* @param {SubscribeNewTransactionsParams} params - The parameters for the subscription.
|
|
4574
|
+
* @returns {Promise<Subscription<NewTransactionEvent['result']>>} A Promise that resolves with a `Subscription` object for new transactions.
|
|
4575
|
+
*/
|
|
4576
|
+
subscribeNewTransactions(params?: SubscribeNewTransactionsParams): Promise<SubscriptionNewTransactionEvent>;
|
|
4195
4577
|
/**
|
|
4196
4578
|
* Internal method to remove subscription from active map.
|
|
4197
4579
|
* @internal
|
|
@@ -4224,7 +4606,7 @@ declare class RpcError<BaseErrorT extends RPC_ERROR = RPC_ERROR> extends Library
|
|
|
4224
4606
|
params: any;
|
|
4225
4607
|
};
|
|
4226
4608
|
constructor(baseError: BaseErrorT, method: string, params: any);
|
|
4227
|
-
get code(): 1 | 66 | 10 | 31 | 20 |
|
|
4609
|
+
get code(): 1 | 66 | 10 | 31 | 20 | 21 | 24 | 27 | 28 | 29 | 32 | 33 | 34 | 40 | 41 | 42 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 67 | 68 | 100 | 150 | 151 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 163;
|
|
4228
4610
|
/**
|
|
4229
4611
|
* Verifies the underlying RPC error, also serves as a type guard for the _baseError_ property
|
|
4230
4612
|
* @example
|
|
@@ -4283,7 +4665,7 @@ declare class RpcProvider$1 implements ProviderInterface {
|
|
|
4283
4665
|
block_number?: undefined;
|
|
4284
4666
|
}) | ({
|
|
4285
4667
|
status: BLOCK_STATUS;
|
|
4286
|
-
} & BLOCK_HEADER
|
|
4668
|
+
} & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES & {}) | (BLOCK_BODY_WITH_TX_HASHES & PRE_CONFIRMED_BLOCK_HEADER & {
|
|
4287
4669
|
block_hash?: undefined;
|
|
4288
4670
|
new_root?: undefined;
|
|
4289
4671
|
status?: undefined;
|
|
@@ -4298,7 +4680,7 @@ declare class RpcProvider$1 implements ProviderInterface {
|
|
|
4298
4680
|
block_number?: undefined;
|
|
4299
4681
|
}) | ({
|
|
4300
4682
|
status: BLOCK_STATUS;
|
|
4301
|
-
} & BLOCK_HEADER
|
|
4683
|
+
} & BLOCK_HEADER & BLOCK_BODY_WITH_TXS & {}) | (BLOCK_BODY_WITH_TXS & PRE_CONFIRMED_BLOCK_HEADER & {
|
|
4302
4684
|
block_hash?: undefined;
|
|
4303
4685
|
new_root?: undefined;
|
|
4304
4686
|
status?: undefined;
|
|
@@ -4327,7 +4709,7 @@ declare class RpcProvider$1 implements ProviderInterface {
|
|
|
4327
4709
|
block_number?: undefined;
|
|
4328
4710
|
}) | ({
|
|
4329
4711
|
status: BLOCK_STATUS;
|
|
4330
|
-
} & BLOCK_HEADER
|
|
4712
|
+
} & BLOCK_HEADER & BLOCK_BODY_WITH_RECEIPTS & {}) | (BLOCK_BODY_WITH_RECEIPTS & PRE_CONFIRMED_BLOCK_HEADER & {
|
|
4331
4713
|
block_hash?: undefined;
|
|
4332
4714
|
new_root?: undefined;
|
|
4333
4715
|
status?: undefined;
|
|
@@ -4882,6 +5264,8 @@ declare class Contract implements ContractInterface {
|
|
|
4882
5264
|
address: string;
|
|
4883
5265
|
providerOrAccount: ProviderOrAccount;
|
|
4884
5266
|
classHash?: string;
|
|
5267
|
+
parseRequest: boolean;
|
|
5268
|
+
parseResponse: boolean;
|
|
4885
5269
|
private structs;
|
|
4886
5270
|
private events;
|
|
4887
5271
|
readonly functions: {
|
|
@@ -4899,6 +5283,7 @@ declare class Contract implements ContractInterface {
|
|
|
4899
5283
|
readonly [key: string]: AsyncContractFunction | any;
|
|
4900
5284
|
private callData;
|
|
4901
5285
|
withOptionsProps?: WithOptions;
|
|
5286
|
+
private parsingStrategy?;
|
|
4902
5287
|
/**
|
|
4903
5288
|
* @param options
|
|
4904
5289
|
* - abi: Abi of the contract object (required)
|
|
@@ -4906,13 +5291,20 @@ declare class Contract implements ContractInterface {
|
|
|
4906
5291
|
* - providerOrAccount?: Provider or Account to attach to (fallback to defaultProvider)
|
|
4907
5292
|
* - parseRequest?: compile and validate arguments (optional, default true)
|
|
4908
5293
|
* - parseResponse?: Parse elements of the response array and structuring them into response object (optional, default true)
|
|
5294
|
+
* - parser?: Abi parser (optional, default createAbiParser(options.abi))
|
|
4909
5295
|
*/
|
|
4910
5296
|
constructor(options: ContractOptions);
|
|
4911
5297
|
withOptions(options: WithOptions): this;
|
|
4912
5298
|
attach(address: string, abi?: Abi): void;
|
|
4913
|
-
isDeployed(): Promise<
|
|
5299
|
+
isDeployed(): Promise<this>;
|
|
4914
5300
|
call(method: string, args?: ArgsOrCalldata, { parseRequest, parseResponse, formatResponse, blockIdentifier, }?: CallOptions): Promise<CallResult>;
|
|
4915
|
-
invoke(method: string, args
|
|
5301
|
+
invoke(method: string, args: ArgsOrCalldata, options: ExecuteOptions & {
|
|
5302
|
+
waitForTransaction: true;
|
|
5303
|
+
}): Promise<SuccessfulTransactionReceiptResponseHelper>;
|
|
5304
|
+
invoke(method: string, args: ArgsOrCalldata, options: ExecuteOptions & {
|
|
5305
|
+
waitForTransaction: false;
|
|
5306
|
+
}): Promise<InvokeFunctionResponse>;
|
|
5307
|
+
invoke(method: string, args?: ArgsOrCalldata, options?: ExecuteOptions): Promise<InvokeFunctionResponse>;
|
|
4916
5308
|
estimate(method: string, args?: ArgsOrCalldata, estimateDetails?: UniversalDetails): Promise<EstimateFeeResponseOverhead>;
|
|
4917
5309
|
populate(method: string, args?: RawArgs): Call;
|
|
4918
5310
|
parseEvents(receipt: GetTransactionReceiptResponse): ParsedEvents;
|
|
@@ -5507,6 +5899,7 @@ declare namespace json {
|
|
|
5507
5899
|
* ```
|
|
5508
5900
|
*/
|
|
5509
5901
|
declare function isHex(hex: string): boolean;
|
|
5902
|
+
declare const isHexString: typeof isHex;
|
|
5510
5903
|
/**
|
|
5511
5904
|
* Convert BigNumberish to bigint
|
|
5512
5905
|
*
|
|
@@ -5764,7 +6157,7 @@ declare function addPercent(number: BigNumberish, percent: number): bigint;
|
|
|
5764
6157
|
declare function stringToSha256ToArrayBuff4(str: string): Uint8Array;
|
|
5765
6158
|
/**
|
|
5766
6159
|
* Checks if a given value is of BigNumberish type.
|
|
5767
|
-
* 234, 234n, "234", "0xea" are valid
|
|
6160
|
+
* 234, 234n, "234", "0xea" are valid, exclude boolean and string
|
|
5768
6161
|
* @param {unknown} input a value
|
|
5769
6162
|
* @returns {boolean} true if type of input is `BigNumberish`
|
|
5770
6163
|
* @example
|
|
@@ -5774,6 +6167,14 @@ declare function stringToSha256ToArrayBuff4(str: string): Uint8Array;
|
|
|
5774
6167
|
* ```
|
|
5775
6168
|
*/
|
|
5776
6169
|
declare function isBigNumberish(input: unknown): input is BigNumberish;
|
|
6170
|
+
/**
|
|
6171
|
+
* Expect the next value from an iterator
|
|
6172
|
+
*
|
|
6173
|
+
* @param iterator The iterator to get the next value from.
|
|
6174
|
+
* @returns The next value from the iterator.
|
|
6175
|
+
* @throws Error if the iterator is done.
|
|
6176
|
+
*/
|
|
6177
|
+
declare function getNext(iterator: Iterator<string>): string;
|
|
5777
6178
|
|
|
5778
6179
|
declare const num_addPercent: typeof addPercent;
|
|
5779
6180
|
declare const num_assertInRange: typeof assertInRange;
|
|
@@ -5783,10 +6184,12 @@ declare const num_cleanHex: typeof cleanHex;
|
|
|
5783
6184
|
declare const num_getDecimalString: typeof getDecimalString;
|
|
5784
6185
|
declare const num_getHexString: typeof getHexString;
|
|
5785
6186
|
declare const num_getHexStringArray: typeof getHexStringArray;
|
|
6187
|
+
declare const num_getNext: typeof getNext;
|
|
5786
6188
|
declare const num_hexToBytes: typeof hexToBytes;
|
|
5787
6189
|
declare const num_hexToDecimalString: typeof hexToDecimalString;
|
|
5788
6190
|
declare const num_isBigNumberish: typeof isBigNumberish;
|
|
5789
6191
|
declare const num_isHex: typeof isHex;
|
|
6192
|
+
declare const num_isHexString: typeof isHexString;
|
|
5790
6193
|
declare const num_isStringWholeNumber: typeof isStringWholeNumber;
|
|
5791
6194
|
declare const num_stringToSha256ToArrayBuff4: typeof stringToSha256ToArrayBuff4;
|
|
5792
6195
|
declare const num_toBigInt: typeof toBigInt;
|
|
@@ -5797,7 +6200,7 @@ declare const num_toHexString: typeof toHexString;
|
|
|
5797
6200
|
declare const num_toStorageKey: typeof toStorageKey;
|
|
5798
6201
|
declare const num_tryToBigInt: typeof tryToBigInt;
|
|
5799
6202
|
declare namespace num {
|
|
5800
|
-
export { num_addPercent as addPercent, num_assertInRange as assertInRange, num_bigNumberishArrayToDecimalStringArray as bigNumberishArrayToDecimalStringArray, num_bigNumberishArrayToHexadecimalStringArray as bigNumberishArrayToHexadecimalStringArray, num_cleanHex as cleanHex, num_getDecimalString as getDecimalString, num_getHexString as getHexString, num_getHexStringArray as getHexStringArray, num_hexToBytes as hexToBytes, num_hexToDecimalString as hexToDecimalString, num_isBigNumberish as isBigNumberish, num_isHex as isHex, num_isStringWholeNumber as isStringWholeNumber, num_stringToSha256ToArrayBuff4 as stringToSha256ToArrayBuff4, num_toBigInt as toBigInt, num_toCairoBool as toCairoBool, num_toHex as toHex, num_toHex64 as toHex64, num_toHexString as toHexString, num_toStorageKey as toStorageKey, num_tryToBigInt as tryToBigInt };
|
|
6203
|
+
export { num_addPercent as addPercent, num_assertInRange as assertInRange, num_bigNumberishArrayToDecimalStringArray as bigNumberishArrayToDecimalStringArray, num_bigNumberishArrayToHexadecimalStringArray as bigNumberishArrayToHexadecimalStringArray, num_cleanHex as cleanHex, num_getDecimalString as getDecimalString, num_getHexString as getHexString, num_getHexStringArray as getHexStringArray, num_getNext as getNext, num_hexToBytes as hexToBytes, num_hexToDecimalString as hexToDecimalString, num_isBigNumberish as isBigNumberish, num_isHex as isHex, num_isHexString as isHexString, num_isStringWholeNumber as isStringWholeNumber, num_stringToSha256ToArrayBuff4 as stringToSha256ToArrayBuff4, num_toBigInt as toBigInt, num_toCairoBool as toCairoBool, num_toHex as toHex, num_toHex64 as toHex64, num_toHexString as toHexString, num_toStorageKey as toStorageKey, num_tryToBigInt as tryToBigInt };
|
|
5801
6204
|
}
|
|
5802
6205
|
|
|
5803
6206
|
/**
|
|
@@ -6464,7 +6867,7 @@ declare function isDecimalString(str: string): boolean;
|
|
|
6464
6867
|
* // result = false
|
|
6465
6868
|
* ```
|
|
6466
6869
|
*/
|
|
6467
|
-
declare function isText(val: any):
|
|
6870
|
+
declare function isText(val: any): val is string;
|
|
6468
6871
|
/**
|
|
6469
6872
|
* Test if value is short text
|
|
6470
6873
|
* @param {any} val - The item to test
|
|
@@ -6499,6 +6902,7 @@ declare const isLongText: (val: any) => boolean;
|
|
|
6499
6902
|
*/
|
|
6500
6903
|
declare function splitLongString(longStr: string): string[];
|
|
6501
6904
|
/**
|
|
6905
|
+
* @deprecated use Utf8 instead
|
|
6502
6906
|
* Convert an ASCII short string to a hexadecimal string.
|
|
6503
6907
|
* @param {string} str short string (ASCII string, 31 characters max)
|
|
6504
6908
|
* @returns {string} hex-string with 248 bits max
|
|
@@ -6510,6 +6914,7 @@ declare function splitLongString(longStr: string): string[];
|
|
|
6510
6914
|
*/
|
|
6511
6915
|
declare function encodeShortString(str: string): string;
|
|
6512
6916
|
/**
|
|
6917
|
+
* @deprecated use Utf8 instead
|
|
6513
6918
|
* Convert a hexadecimal or decimal string to an ASCII string.
|
|
6514
6919
|
* @param {string} str representing a 248 bit max number (ex. "0x1A4F64EA56" or "236942575435676423")
|
|
6515
6920
|
* @returns {string} short string; 31 characters max
|
|
@@ -7250,7 +7655,7 @@ declare function getAbiEvents(abi: Abi): AbiEvents;
|
|
|
7250
7655
|
}}]
|
|
7251
7656
|
* ```
|
|
7252
7657
|
*/
|
|
7253
|
-
declare function parseEvents(providerReceivedEvents: EmittedEvent$1[], abiEvents: AbiEvents, abiStructs: AbiStructs, abiEnums: AbiEnums): ParsedEvents;
|
|
7658
|
+
declare function parseEvents(providerReceivedEvents: EmittedEvent$1[], abiEvents: AbiEvents, abiStructs: AbiStructs, abiEnums: AbiEnums, parser: AbiParserInterface): ParsedEvents;
|
|
7254
7659
|
|
|
7255
7660
|
declare const index_getAbiEvents: typeof getAbiEvents;
|
|
7256
7661
|
declare const index_isAbiEvent: typeof isAbiEvent;
|
|
@@ -7538,6 +7943,96 @@ declare class BatchClient<T extends {
|
|
|
7538
7943
|
}>(method: M, params?: T[M]['params'], id?: string | number): Promise<TResponse>;
|
|
7539
7944
|
}
|
|
7540
7945
|
|
|
7946
|
+
declare class CairoUint8 {
|
|
7947
|
+
data: bigint;
|
|
7948
|
+
static abiSelector: string;
|
|
7949
|
+
constructor(data: BigNumberish | boolean | unknown);
|
|
7950
|
+
static __processData(data: BigNumberish | boolean | unknown): bigint;
|
|
7951
|
+
toApiRequest(): string[];
|
|
7952
|
+
toBigInt(): bigint;
|
|
7953
|
+
decodeUtf8(): string;
|
|
7954
|
+
toHexString(): string;
|
|
7955
|
+
static validate(data: BigNumberish | boolean | unknown): void;
|
|
7956
|
+
static is(data: BigNumberish | boolean | unknown): boolean;
|
|
7957
|
+
/**
|
|
7958
|
+
* Check if provided abi type is this data type
|
|
7959
|
+
*/
|
|
7960
|
+
static isAbiType(abiType: string): boolean;
|
|
7961
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoUint8;
|
|
7962
|
+
}
|
|
7963
|
+
|
|
7964
|
+
declare class CairoUint16 {
|
|
7965
|
+
data: bigint;
|
|
7966
|
+
static abiSelector: string;
|
|
7967
|
+
constructor(data: BigNumberish | boolean | unknown);
|
|
7968
|
+
static __processData(data: BigNumberish | boolean | unknown): bigint;
|
|
7969
|
+
toApiRequest(): string[];
|
|
7970
|
+
toBigInt(): bigint;
|
|
7971
|
+
decodeUtf8(): string;
|
|
7972
|
+
toHexString(): string;
|
|
7973
|
+
static validate(data: BigNumberish | boolean | unknown): void;
|
|
7974
|
+
static is(data: BigNumberish | boolean | unknown): boolean;
|
|
7975
|
+
/**
|
|
7976
|
+
* Check if provided abi type is this data type
|
|
7977
|
+
*/
|
|
7978
|
+
static isAbiType(abiType: string): boolean;
|
|
7979
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoUint16;
|
|
7980
|
+
}
|
|
7981
|
+
|
|
7982
|
+
declare class CairoUint64 {
|
|
7983
|
+
data: bigint;
|
|
7984
|
+
static abiSelector: string;
|
|
7985
|
+
constructor(data: BigNumberish | boolean | unknown);
|
|
7986
|
+
static __processData(data: BigNumberish | boolean | unknown): bigint;
|
|
7987
|
+
toApiRequest(): string[];
|
|
7988
|
+
toBigInt(): bigint;
|
|
7989
|
+
decodeUtf8(): string;
|
|
7990
|
+
toHexString(): string;
|
|
7991
|
+
static validate(data: BigNumberish | boolean | unknown): void;
|
|
7992
|
+
static is(data: BigNumberish | boolean | unknown): boolean;
|
|
7993
|
+
/**
|
|
7994
|
+
* Check if provided abi type is this data type
|
|
7995
|
+
*/
|
|
7996
|
+
static isAbiType(abiType: string): boolean;
|
|
7997
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoUint64;
|
|
7998
|
+
}
|
|
7999
|
+
|
|
8000
|
+
declare class CairoUint96 {
|
|
8001
|
+
data: bigint;
|
|
8002
|
+
static abiSelector: string;
|
|
8003
|
+
constructor(data: BigNumberish | boolean | unknown);
|
|
8004
|
+
static __processData(data: BigNumberish | boolean | unknown): bigint;
|
|
8005
|
+
toApiRequest(): string[];
|
|
8006
|
+
toBigInt(): bigint;
|
|
8007
|
+
decodeUtf8(): string;
|
|
8008
|
+
toHexString(): string;
|
|
8009
|
+
static validate(data: BigNumberish | boolean | unknown): void;
|
|
8010
|
+
static is(data: BigNumberish | boolean | unknown): boolean;
|
|
8011
|
+
/**
|
|
8012
|
+
* Check if provided abi type is this data type
|
|
8013
|
+
*/
|
|
8014
|
+
static isAbiType(abiType: string): boolean;
|
|
8015
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoUint96;
|
|
8016
|
+
}
|
|
8017
|
+
|
|
8018
|
+
declare class CairoUint128 {
|
|
8019
|
+
data: bigint;
|
|
8020
|
+
static abiSelector: string;
|
|
8021
|
+
constructor(data: BigNumberish | boolean | unknown);
|
|
8022
|
+
static __processData(data: BigNumberish | boolean | unknown): bigint;
|
|
8023
|
+
toApiRequest(): string[];
|
|
8024
|
+
toBigInt(): bigint;
|
|
8025
|
+
decodeUtf8(): string;
|
|
8026
|
+
toHexString(): string;
|
|
8027
|
+
static validate(data: BigNumberish | boolean | unknown): void;
|
|
8028
|
+
static is(data: BigNumberish | boolean | unknown): boolean;
|
|
8029
|
+
/**
|
|
8030
|
+
* Check if provided abi type is this data type
|
|
8031
|
+
*/
|
|
8032
|
+
static isAbiType(abiType: string): boolean;
|
|
8033
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoUint128;
|
|
8034
|
+
}
|
|
8035
|
+
|
|
7541
8036
|
/**
|
|
7542
8037
|
* Singular class handling cairo u256 data type
|
|
7543
8038
|
*/
|
|
@@ -7552,24 +8047,19 @@ declare const UINT_256_HIGH_MIN = 0n;
|
|
|
7552
8047
|
declare class CairoUint256 {
|
|
7553
8048
|
low: bigint;
|
|
7554
8049
|
high: bigint;
|
|
7555
|
-
static abiSelector:
|
|
8050
|
+
static abiSelector: "core::integer::u256";
|
|
7556
8051
|
/**
|
|
7557
8052
|
* Default constructor (Lib usage)
|
|
7558
|
-
* @param bigNumberish BigNumberish value representing uin256
|
|
7559
8053
|
*/
|
|
7560
|
-
constructor(
|
|
8054
|
+
constructor(data: BigNumberish | Uint256 | unknown);
|
|
7561
8055
|
/**
|
|
7562
8056
|
* Direct props initialization (Api response)
|
|
7563
8057
|
*/
|
|
7564
8058
|
constructor(low: BigNumberish, high: BigNumberish);
|
|
7565
|
-
/**
|
|
7566
|
-
* Initialization from Uint256 object
|
|
7567
|
-
*/
|
|
7568
|
-
constructor(uint256: Uint256);
|
|
7569
8059
|
/**
|
|
7570
8060
|
* Validate if BigNumberish can be represented as Unit256
|
|
7571
8061
|
*/
|
|
7572
|
-
static validate(bigNumberish: BigNumberish): bigint;
|
|
8062
|
+
static validate(bigNumberish: BigNumberish | unknown): bigint;
|
|
7573
8063
|
/**
|
|
7574
8064
|
* Validate if low and high can be represented as Unit256
|
|
7575
8065
|
*/
|
|
@@ -7580,11 +8070,12 @@ declare class CairoUint256 {
|
|
|
7580
8070
|
/**
|
|
7581
8071
|
* Check if BigNumberish can be represented as Unit256
|
|
7582
8072
|
*/
|
|
7583
|
-
static is(bigNumberish: BigNumberish): boolean;
|
|
8073
|
+
static is(bigNumberish: BigNumberish | unknown): boolean;
|
|
7584
8074
|
/**
|
|
7585
8075
|
* Check if provided abi type is this data type
|
|
7586
8076
|
*/
|
|
7587
|
-
static isAbiType(abiType: string):
|
|
8077
|
+
static isAbiType(abiType: string): abiType is "core::integer::u256";
|
|
8078
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoUint256;
|
|
7588
8079
|
/**
|
|
7589
8080
|
* Return bigint representation
|
|
7590
8081
|
*/
|
|
@@ -7626,21 +8117,16 @@ declare class CairoUint512 {
|
|
|
7626
8117
|
static abiSelector: string;
|
|
7627
8118
|
/**
|
|
7628
8119
|
* Default constructor (Lib usage)
|
|
7629
|
-
* @param bigNumberish BigNumberish value representing u512
|
|
7630
8120
|
*/
|
|
7631
|
-
constructor(bigNumberish: BigNumberish);
|
|
8121
|
+
constructor(bigNumberish: BigNumberish | Uint512 | unknown);
|
|
7632
8122
|
/**
|
|
7633
8123
|
* Direct props initialization (Api response)
|
|
7634
8124
|
*/
|
|
7635
8125
|
constructor(limb0: BigNumberish, limb1: BigNumberish, limb2: BigNumberish, limb3: BigNumberish);
|
|
7636
|
-
/**
|
|
7637
|
-
* Initialization from Uint512 object
|
|
7638
|
-
*/
|
|
7639
|
-
constructor(uint512: Uint512);
|
|
7640
8126
|
/**
|
|
7641
8127
|
* Validate if BigNumberish can be represented as Uint512
|
|
7642
8128
|
*/
|
|
7643
|
-
static validate(bigNumberish: BigNumberish): bigint;
|
|
8129
|
+
static validate(bigNumberish: BigNumberish | unknown): bigint;
|
|
7644
8130
|
/**
|
|
7645
8131
|
* Validate if limbs can be represented as Uint512
|
|
7646
8132
|
*/
|
|
@@ -7653,11 +8139,12 @@ declare class CairoUint512 {
|
|
|
7653
8139
|
/**
|
|
7654
8140
|
* Check if BigNumberish can be represented as Uint512
|
|
7655
8141
|
*/
|
|
7656
|
-
static is(bigNumberish: BigNumberish): boolean;
|
|
8142
|
+
static is(bigNumberish: BigNumberish | unknown): boolean;
|
|
7657
8143
|
/**
|
|
7658
8144
|
* Check if provided abi type is this data type
|
|
7659
8145
|
*/
|
|
7660
8146
|
static isAbiType(abiType: string): boolean;
|
|
8147
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoUint512;
|
|
7661
8148
|
/**
|
|
7662
8149
|
* Return bigint representation
|
|
7663
8150
|
*/
|
|
@@ -7688,6 +8175,116 @@ declare class CairoUint512 {
|
|
|
7688
8175
|
toApiRequest(): string[];
|
|
7689
8176
|
}
|
|
7690
8177
|
|
|
8178
|
+
declare class CairoInt8 {
|
|
8179
|
+
data: bigint;
|
|
8180
|
+
static abiSelector: string;
|
|
8181
|
+
constructor(data: BigNumberish | boolean | unknown);
|
|
8182
|
+
static __processData(data: BigNumberish | boolean | unknown): bigint;
|
|
8183
|
+
toApiRequest(): string[];
|
|
8184
|
+
toBigInt(): bigint;
|
|
8185
|
+
decodeUtf8(): string;
|
|
8186
|
+
/**
|
|
8187
|
+
* For negative values field element representation as positive hex string.
|
|
8188
|
+
* @returns cairo field arithmetic hex string
|
|
8189
|
+
*/
|
|
8190
|
+
toHexString(): string;
|
|
8191
|
+
static validate(data: BigNumberish | boolean | unknown): void;
|
|
8192
|
+
static is(data: BigNumberish | boolean | unknown): boolean;
|
|
8193
|
+
/**
|
|
8194
|
+
* Check if provided abi type is this data type
|
|
8195
|
+
*/
|
|
8196
|
+
static isAbiType(abiType: string): boolean;
|
|
8197
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoInt8;
|
|
8198
|
+
}
|
|
8199
|
+
|
|
8200
|
+
declare class CairoInt16 {
|
|
8201
|
+
data: bigint;
|
|
8202
|
+
static abiSelector: string;
|
|
8203
|
+
constructor(data: BigNumberish | boolean | unknown);
|
|
8204
|
+
static __processData(data: BigNumberish | boolean | unknown): bigint;
|
|
8205
|
+
toApiRequest(): string[];
|
|
8206
|
+
toBigInt(): bigint;
|
|
8207
|
+
decodeUtf8(): string;
|
|
8208
|
+
/**
|
|
8209
|
+
* For negative values field element representation as positive hex string.
|
|
8210
|
+
* @returns cairo field arithmetic hex string
|
|
8211
|
+
*/
|
|
8212
|
+
toHexString(): string;
|
|
8213
|
+
static validate(data: BigNumberish | boolean | unknown): void;
|
|
8214
|
+
static is(data: BigNumberish | boolean | unknown): boolean;
|
|
8215
|
+
/**
|
|
8216
|
+
* Check if provided abi type is this data type
|
|
8217
|
+
*/
|
|
8218
|
+
static isAbiType(abiType: string): boolean;
|
|
8219
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoInt16;
|
|
8220
|
+
}
|
|
8221
|
+
|
|
8222
|
+
declare class CairoInt32 {
|
|
8223
|
+
data: bigint;
|
|
8224
|
+
static abiSelector: string;
|
|
8225
|
+
constructor(data: BigNumberish | boolean | unknown);
|
|
8226
|
+
static __processData(data: BigNumberish | boolean | unknown): bigint;
|
|
8227
|
+
toApiRequest(): string[];
|
|
8228
|
+
toBigInt(): bigint;
|
|
8229
|
+
decodeUtf8(): string;
|
|
8230
|
+
/**
|
|
8231
|
+
* For negative values field element representation as positive hex string.
|
|
8232
|
+
* @returns cairo field arithmetic hex string
|
|
8233
|
+
*/
|
|
8234
|
+
toHexString(): string;
|
|
8235
|
+
static validate(data: BigNumberish | boolean | unknown): void;
|
|
8236
|
+
static is(data: BigNumberish | boolean | unknown): boolean;
|
|
8237
|
+
/**
|
|
8238
|
+
* Check if provided abi type is this data type
|
|
8239
|
+
*/
|
|
8240
|
+
static isAbiType(abiType: string): boolean;
|
|
8241
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoInt32;
|
|
8242
|
+
}
|
|
8243
|
+
|
|
8244
|
+
declare class CairoInt64 {
|
|
8245
|
+
data: bigint;
|
|
8246
|
+
static abiSelector: string;
|
|
8247
|
+
constructor(data: BigNumberish | boolean | unknown);
|
|
8248
|
+
static __processData(data: BigNumberish | boolean | unknown): bigint;
|
|
8249
|
+
toApiRequest(): string[];
|
|
8250
|
+
toBigInt(): bigint;
|
|
8251
|
+
decodeUtf8(): string;
|
|
8252
|
+
/**
|
|
8253
|
+
* For negative values field element representation as positive hex string.
|
|
8254
|
+
* @returns cairo field arithmetic hex string
|
|
8255
|
+
*/
|
|
8256
|
+
toHexString(): string;
|
|
8257
|
+
static validate(data: BigNumberish | boolean | unknown): void;
|
|
8258
|
+
static is(data: BigNumberish | boolean | unknown): boolean;
|
|
8259
|
+
/**
|
|
8260
|
+
* Check if provided abi type is this data type
|
|
8261
|
+
*/
|
|
8262
|
+
static isAbiType(abiType: string): boolean;
|
|
8263
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoInt64;
|
|
8264
|
+
}
|
|
8265
|
+
|
|
8266
|
+
declare class CairoInt128 {
|
|
8267
|
+
data: bigint;
|
|
8268
|
+
static abiSelector: string;
|
|
8269
|
+
constructor(data: BigNumberish | boolean | unknown);
|
|
8270
|
+
static __processData(data: BigNumberish | boolean | unknown): bigint;
|
|
8271
|
+
toApiRequest(): string[];
|
|
8272
|
+
toBigInt(): bigint;
|
|
8273
|
+
decodeUtf8(): string;
|
|
8274
|
+
/**
|
|
8275
|
+
* For negative values field element representation as positive hex string.
|
|
8276
|
+
* @returns cairo field arithmetic hex string
|
|
8277
|
+
*/
|
|
8278
|
+
toHexString(): string;
|
|
8279
|
+
static validate(data: BigNumberish | boolean | unknown): void;
|
|
8280
|
+
static is(data: BigNumberish | boolean | unknown): boolean;
|
|
8281
|
+
/**
|
|
8282
|
+
* Check if provided abi type is this data type
|
|
8283
|
+
*/
|
|
8284
|
+
static isAbiType(abiType: string): boolean;
|
|
8285
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoInt128;
|
|
8286
|
+
}
|
|
8287
|
+
|
|
7691
8288
|
declare class CairoFixedArray {
|
|
7692
8289
|
/**
|
|
7693
8290
|
* JS array representing a Cairo fixed array.
|
|
@@ -7774,6 +8371,7 @@ declare class CairoFixedArray {
|
|
|
7774
8371
|
compile(): Object;
|
|
7775
8372
|
/**
|
|
7776
8373
|
* Checks if the given Cairo type is a fixed-array type.
|
|
8374
|
+
* structure: [string; number]
|
|
7777
8375
|
*
|
|
7778
8376
|
* @param {string} type - The type to check.
|
|
7779
8377
|
* @returns - `true` if the type is a fixed array type, `false` otherwise.
|
|
@@ -7784,6 +8382,119 @@ declare class CairoFixedArray {
|
|
|
7784
8382
|
static isTypeFixedArray(type: string): boolean;
|
|
7785
8383
|
}
|
|
7786
8384
|
|
|
8385
|
+
declare class CairoBytes31 {
|
|
8386
|
+
static MAX_BYTE_SIZE: 31;
|
|
8387
|
+
data: Uint8Array;
|
|
8388
|
+
static abiSelector: "core::bytes_31::bytes31";
|
|
8389
|
+
constructor(data: string | Uint8Array | Buffer | unknown);
|
|
8390
|
+
static __processData(data: Uint8Array | string | Buffer | unknown): Uint8Array;
|
|
8391
|
+
toApiRequest(): string[];
|
|
8392
|
+
toBigInt(): bigint;
|
|
8393
|
+
decodeUtf8(): string;
|
|
8394
|
+
toHexString(): string;
|
|
8395
|
+
static validate(data: Uint8Array | string | Buffer | unknown): void;
|
|
8396
|
+
static is(data: Uint8Array | string | Buffer): boolean;
|
|
8397
|
+
/**
|
|
8398
|
+
* Check if provided abi type is this data type
|
|
8399
|
+
*/
|
|
8400
|
+
static isAbiType(abiType: string): boolean;
|
|
8401
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoBytes31;
|
|
8402
|
+
}
|
|
8403
|
+
|
|
8404
|
+
/**
|
|
8405
|
+
* felt252 is the basic field element used in Cairo.
|
|
8406
|
+
* It corresponds to an integer in the range 0 ≤ x < P where P is a very large prime number currently equal to 2^251 + 17⋅2^192 + 1.
|
|
8407
|
+
* Any operation that uses felt252 will be computed modulo P.
|
|
8408
|
+
* 63 hex symbols (31 bytes + 4 bits), 252 bits
|
|
8409
|
+
*/
|
|
8410
|
+
declare class CairoFelt252 {
|
|
8411
|
+
/**
|
|
8412
|
+
* byte representation of the felt252
|
|
8413
|
+
*/
|
|
8414
|
+
data: Uint8Array;
|
|
8415
|
+
static abiSelector: "core::felt252";
|
|
8416
|
+
constructor(data: BigNumberish | boolean | unknown);
|
|
8417
|
+
static __processData(data: BigNumberish | boolean): Uint8Array;
|
|
8418
|
+
toBigInt(): bigint;
|
|
8419
|
+
decodeUtf8(): string;
|
|
8420
|
+
toHexString(): string;
|
|
8421
|
+
toApiRequest(): string[];
|
|
8422
|
+
static validate(data: BigNumberish | boolean | unknown): void;
|
|
8423
|
+
static is(data: BigNumberish | boolean | unknown): boolean;
|
|
8424
|
+
static isAbiType(abiType: string): boolean;
|
|
8425
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoFelt252;
|
|
8426
|
+
}
|
|
8427
|
+
|
|
8428
|
+
declare class CairoUint32 {
|
|
8429
|
+
data: bigint;
|
|
8430
|
+
static abiSelector: string;
|
|
8431
|
+
constructor(data: BigNumberish);
|
|
8432
|
+
static __processData(data: BigNumberish): bigint;
|
|
8433
|
+
toApiRequest(): string[];
|
|
8434
|
+
toBigInt(): bigint;
|
|
8435
|
+
decodeUtf8(): string;
|
|
8436
|
+
toHexString(): string;
|
|
8437
|
+
static validate(data: BigNumberish): void;
|
|
8438
|
+
static is(data: BigNumberish): boolean;
|
|
8439
|
+
/**
|
|
8440
|
+
* Check if provided abi type is this data type
|
|
8441
|
+
*/
|
|
8442
|
+
static isAbiType(abiType: string): boolean;
|
|
8443
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoUint32;
|
|
8444
|
+
}
|
|
8445
|
+
|
|
8446
|
+
declare class CairoByteArray {
|
|
8447
|
+
/**
|
|
8448
|
+
* entire dataset
|
|
8449
|
+
*/
|
|
8450
|
+
data: CairoBytes31[];
|
|
8451
|
+
/**
|
|
8452
|
+
* cairo specific implementation helper
|
|
8453
|
+
*/
|
|
8454
|
+
pending_word: CairoFelt252;
|
|
8455
|
+
/**
|
|
8456
|
+
* cairo specific implementation helper
|
|
8457
|
+
*/
|
|
8458
|
+
pending_word_len: CairoUint32;
|
|
8459
|
+
static abiSelector: "core::byte_array::ByteArray";
|
|
8460
|
+
/**
|
|
8461
|
+
* byteArray from typed components
|
|
8462
|
+
*/
|
|
8463
|
+
constructor(data: CairoBytes31[], pendingWord: CairoFelt252, pendingWordLen: CairoUint32);
|
|
8464
|
+
constructor(data: BigNumberish | Buffer | Uint8Array | unknown);
|
|
8465
|
+
static __processData(inData: BigNumberish | Buffer | Uint8Array | unknown): {
|
|
8466
|
+
data: CairoBytes31[];
|
|
8467
|
+
pending_word: CairoFelt252;
|
|
8468
|
+
pending_word_len: CairoUint32;
|
|
8469
|
+
};
|
|
8470
|
+
toApiRequest(): string[];
|
|
8471
|
+
decodeUtf8(): string;
|
|
8472
|
+
toBigInt(): bigint;
|
|
8473
|
+
toHexString(): string;
|
|
8474
|
+
toBuffer(): any;
|
|
8475
|
+
static validate(data: Uint8Array | Buffer | BigNumberish | unknown): void;
|
|
8476
|
+
/**
|
|
8477
|
+
* Check if the provided data is a valid CairoByteArray
|
|
8478
|
+
*
|
|
8479
|
+
* @param data - The data to check
|
|
8480
|
+
* @returns True if the data is a valid CairoByteArray, false otherwise
|
|
8481
|
+
*/
|
|
8482
|
+
static is(data: any): boolean;
|
|
8483
|
+
/**
|
|
8484
|
+
* Check if provided abi type is this data type
|
|
8485
|
+
*/
|
|
8486
|
+
static isAbiType(abiType: string): boolean;
|
|
8487
|
+
/**
|
|
8488
|
+
* Private helper to check if the CairoByteArray is properly initialized
|
|
8489
|
+
*/
|
|
8490
|
+
private assertInitialized;
|
|
8491
|
+
/**
|
|
8492
|
+
* Private helper to reconstruct the full byte sequence from chunks and pending word
|
|
8493
|
+
*/
|
|
8494
|
+
private reconstructBytes;
|
|
8495
|
+
static factoryFromApiResponse(responseIterator: Iterator<string>): CairoByteArray;
|
|
8496
|
+
}
|
|
8497
|
+
|
|
7787
8498
|
/**
|
|
7788
8499
|
* Format a hex number to '0x' and 64 characters, adding leading zeros if necessary.
|
|
7789
8500
|
*
|
|
@@ -7849,26 +8560,6 @@ declare function getChecksumAddress(address: BigNumberish): string;
|
|
|
7849
8560
|
*/
|
|
7850
8561
|
declare function validateChecksumAddress(address: string): boolean;
|
|
7851
8562
|
|
|
7852
|
-
declare abstract class AbiParserInterface {
|
|
7853
|
-
/**
|
|
7854
|
-
* Helper to calculate inputs length from abi
|
|
7855
|
-
* @param abiMethod FunctionAbi
|
|
7856
|
-
* @return number
|
|
7857
|
-
*/
|
|
7858
|
-
abstract methodInputsLength(abiMethod: FunctionAbi): number;
|
|
7859
|
-
/**
|
|
7860
|
-
*
|
|
7861
|
-
* @param name string
|
|
7862
|
-
* @return FunctionAbi | undefined
|
|
7863
|
-
*/
|
|
7864
|
-
abstract getMethod(name: string): FunctionAbi | undefined;
|
|
7865
|
-
/**
|
|
7866
|
-
* Return Abi in legacy format
|
|
7867
|
-
* @return Abi
|
|
7868
|
-
*/
|
|
7869
|
-
abstract getLegacyFormat(): Abi;
|
|
7870
|
-
}
|
|
7871
|
-
|
|
7872
8563
|
/**
|
|
7873
8564
|
* Checks if the given name ends with "_len".
|
|
7874
8565
|
*
|
|
@@ -7941,13 +8632,20 @@ declare const isTypeResult: (type: string) => boolean;
|
|
|
7941
8632
|
* @returns - Returns true if the value is a valid Uint type, otherwise false.
|
|
7942
8633
|
*/
|
|
7943
8634
|
declare const isTypeUint: (type: string) => boolean;
|
|
8635
|
+
/**
|
|
8636
|
+
* Checks if the given value is a valid Int type.
|
|
8637
|
+
*
|
|
8638
|
+
* @param {string} type - The value to check.
|
|
8639
|
+
* @returns - Returns true if the value is a valid Int type, otherwise false.
|
|
8640
|
+
*/
|
|
8641
|
+
declare const isTypeInt: (type: string) => boolean;
|
|
7944
8642
|
/**
|
|
7945
8643
|
* Checks if the given type is `uint256`.
|
|
7946
8644
|
*
|
|
7947
8645
|
* @param {string} type - The type to be checked.
|
|
7948
8646
|
* @returns - Returns true if the type is `uint256`, otherwise false.
|
|
7949
8647
|
*/
|
|
7950
|
-
declare const isTypeUint256: (type: string) =>
|
|
8648
|
+
declare const isTypeUint256: (type: string) => type is "core::integer::u256";
|
|
7951
8649
|
/**
|
|
7952
8650
|
* Checks if the given type is a literal type.
|
|
7953
8651
|
*
|
|
@@ -7975,20 +8673,6 @@ declare const isTypeContractAddress: (type: string) => type is "core::starknet::
|
|
|
7975
8673
|
* @returns - Returns true if the given type is 'core::starknet::eth_address::EthAddress', otherwise false.
|
|
7976
8674
|
*/
|
|
7977
8675
|
declare const isTypeEthAddress: (type: string) => type is "core::starknet::eth_address::EthAddress";
|
|
7978
|
-
/**
|
|
7979
|
-
* Checks if the given type is 'core::bytes_31::bytes31'.
|
|
7980
|
-
*
|
|
7981
|
-
* @param {string} type - The type to check.
|
|
7982
|
-
* @returns - True if the type is 'core::bytes_31::bytes31', false otherwise.
|
|
7983
|
-
*/
|
|
7984
|
-
declare const isTypeBytes31: (type: string) => type is "core::bytes_31::bytes31";
|
|
7985
|
-
/**
|
|
7986
|
-
* Checks if the given type is equal to the 'core::byte_array::ByteArray'.
|
|
7987
|
-
*
|
|
7988
|
-
* @param {string} type - The type to check.
|
|
7989
|
-
* @returns - True if the given type is equal to 'core::byte_array::ByteArray', false otherwise.
|
|
7990
|
-
*/
|
|
7991
|
-
declare const isTypeByteArray: (type: string) => type is "core::byte_array::ByteArray";
|
|
7992
8676
|
/**
|
|
7993
8677
|
* Checks if the given type is equal to the u96 type
|
|
7994
8678
|
*
|
|
@@ -8080,12 +8764,11 @@ declare const cairo_isCairo1Type: typeof isCairo1Type;
|
|
|
8080
8764
|
declare const cairo_isLen: typeof isLen;
|
|
8081
8765
|
declare const cairo_isTypeArray: typeof isTypeArray;
|
|
8082
8766
|
declare const cairo_isTypeBool: typeof isTypeBool;
|
|
8083
|
-
declare const cairo_isTypeByteArray: typeof isTypeByteArray;
|
|
8084
|
-
declare const cairo_isTypeBytes31: typeof isTypeBytes31;
|
|
8085
8767
|
declare const cairo_isTypeContractAddress: typeof isTypeContractAddress;
|
|
8086
8768
|
declare const cairo_isTypeEnum: typeof isTypeEnum;
|
|
8087
8769
|
declare const cairo_isTypeEthAddress: typeof isTypeEthAddress;
|
|
8088
8770
|
declare const cairo_isTypeFelt: typeof isTypeFelt;
|
|
8771
|
+
declare const cairo_isTypeInt: typeof isTypeInt;
|
|
8089
8772
|
declare const cairo_isTypeLiteral: typeof isTypeLiteral;
|
|
8090
8773
|
declare const cairo_isTypeNamedTuple: typeof isTypeNamedTuple;
|
|
8091
8774
|
declare const cairo_isTypeNonZero: typeof isTypeNonZero;
|
|
@@ -8101,7 +8784,7 @@ declare const cairo_tuple: typeof tuple;
|
|
|
8101
8784
|
declare const cairo_uint256: typeof uint256;
|
|
8102
8785
|
declare const cairo_uint512: typeof uint512;
|
|
8103
8786
|
declare namespace cairo {
|
|
8104
|
-
export { cairo_felt as felt, cairo_getAbiContractVersion as getAbiContractVersion, cairo_getArrayType as getArrayType, cairo_isCairo1Abi as isCairo1Abi, cairo_isCairo1Type as isCairo1Type, cairo_isLen as isLen, cairo_isTypeArray as isTypeArray, cairo_isTypeBool as isTypeBool,
|
|
8787
|
+
export { cairo_felt as felt, cairo_getAbiContractVersion as getAbiContractVersion, cairo_getArrayType as getArrayType, cairo_isCairo1Abi as isCairo1Abi, cairo_isCairo1Type as isCairo1Type, cairo_isLen as isLen, cairo_isTypeArray as isTypeArray, cairo_isTypeBool as isTypeBool, cairo_isTypeContractAddress as isTypeContractAddress, cairo_isTypeEnum as isTypeEnum, cairo_isTypeEthAddress as isTypeEthAddress, cairo_isTypeFelt as isTypeFelt, cairo_isTypeInt as isTypeInt, cairo_isTypeLiteral as isTypeLiteral, cairo_isTypeNamedTuple as isTypeNamedTuple, cairo_isTypeNonZero as isTypeNonZero, cairo_isTypeOption as isTypeOption, cairo_isTypeResult as isTypeResult, cairo_isTypeSecp256k1Point as isTypeSecp256k1Point, cairo_isTypeStruct as isTypeStruct, cairo_isTypeTuple as isTypeTuple, cairo_isTypeU96 as isTypeU96, cairo_isTypeUint as isTypeUint, cairo_isTypeUint256 as isTypeUint256, cairo_tuple as tuple, cairo_uint256 as uint256, cairo_uint512 as uint512 };
|
|
8105
8788
|
}
|
|
8106
8789
|
|
|
8107
8790
|
/**
|
|
@@ -8193,14 +8876,20 @@ declare namespace byteArray {
|
|
|
8193
8876
|
* );
|
|
8194
8877
|
* // parsedField === ['1952805748']
|
|
8195
8878
|
*/
|
|
8196
|
-
declare function parseCalldataField(argsIterator
|
|
8879
|
+
declare function parseCalldataField({ argsIterator, input, structs, enums, parser, }: {
|
|
8880
|
+
argsIterator: Iterator<any>;
|
|
8881
|
+
input: AbiEntry;
|
|
8882
|
+
structs: AbiStructs;
|
|
8883
|
+
enums: AbiEnums;
|
|
8884
|
+
parser: AbiParserInterface;
|
|
8885
|
+
}): string | string[];
|
|
8197
8886
|
|
|
8198
8887
|
declare class CallData {
|
|
8199
8888
|
abi: Abi;
|
|
8200
8889
|
parser: AbiParserInterface;
|
|
8201
8890
|
protected readonly structs: AbiStructs;
|
|
8202
8891
|
protected readonly enums: AbiEnums;
|
|
8203
|
-
constructor(abi: Abi);
|
|
8892
|
+
constructor(abi: Abi, parsingStrategy?: ParsingStrategy);
|
|
8204
8893
|
/**
|
|
8205
8894
|
* Validate arguments passed to the method as corresponding to the ones in the abi
|
|
8206
8895
|
* @param type ValidateType - type of the method
|
|
@@ -8317,6 +9006,15 @@ declare function extractContractHashes(payload: DeclareContractPayload): Complet
|
|
|
8317
9006
|
declare function contractClassResponseToLegacyCompiledContract(ccr: ContractClassResponse): LegacyCompiledContract;
|
|
8318
9007
|
|
|
8319
9008
|
/**
|
|
9009
|
+
* !! Main design decision:
|
|
9010
|
+
* Class can't extend GetTransactionReceiptResponse because it is union type
|
|
9011
|
+
* and it is not possible to extend union type in current typescript version
|
|
9012
|
+
* So we have to use factory function to create 'data' return type and inject constructor
|
|
9013
|
+
*
|
|
9014
|
+
* ERROR case left but in library flow it is not possible as fetch would throw on error before it could be read by Helper
|
|
9015
|
+
*/
|
|
9016
|
+
/**
|
|
9017
|
+
* @deprecated Use `createTransactionReceipt` instead
|
|
8320
9018
|
* Utility that analyses transaction receipt response and provides helpers to process it
|
|
8321
9019
|
* @example
|
|
8322
9020
|
* ```typescript
|
|
@@ -8332,17 +9030,23 @@ declare function contractClassResponseToLegacyCompiledContract(ccr: ContractClas
|
|
|
8332
9030
|
* }
|
|
8333
9031
|
* ```
|
|
8334
9032
|
*/
|
|
8335
|
-
declare class ReceiptTx
|
|
9033
|
+
declare class ReceiptTx {
|
|
8336
9034
|
readonly statusReceipt: TransactionReceiptStatus;
|
|
8337
9035
|
readonly value: TransactionReceiptValue;
|
|
8338
9036
|
constructor(receipt: GetTxReceiptResponseWithoutHelper);
|
|
8339
|
-
match(callbacks: TransactionReceiptCallbacks)
|
|
8340
|
-
isSuccess()
|
|
8341
|
-
isReverted()
|
|
8342
|
-
isError()
|
|
9037
|
+
match: (callbacks: TransactionReceiptCallbacks) => void;
|
|
9038
|
+
isSuccess: () => this is SuccessfulTransactionReceiptResponseHelper;
|
|
9039
|
+
isReverted: () => this is RevertedTransactionReceiptResponseHelper;
|
|
9040
|
+
isError: () => this is ErrorReceiptResponseHelper;
|
|
8343
9041
|
static isSuccess(transactionReceipt: GetTxReceiptResponseWithoutHelper): transactionReceipt is SuccessfulTransactionReceiptResponse;
|
|
8344
9042
|
static isReverted(transactionReceipt: GetTxReceiptResponseWithoutHelper): transactionReceipt is RevertedTransactionReceiptResponse;
|
|
8345
9043
|
}
|
|
9044
|
+
/**
|
|
9045
|
+
* Creates a transaction receipt response object with helpers
|
|
9046
|
+
* @param receipt - The transaction receipt response from the provider
|
|
9047
|
+
* @returns A transaction receipt response object with helpers
|
|
9048
|
+
*/
|
|
9049
|
+
declare function createTransactionReceipt(receipt: GetTxReceiptResponseWithoutHelper): GetTransactionReceiptResponse;
|
|
8346
9050
|
|
|
8347
9051
|
/**
|
|
8348
9052
|
* Convert strk to fri or fri to strk
|
|
@@ -8540,4 +9244,4 @@ declare class Logger {
|
|
|
8540
9244
|
*/
|
|
8541
9245
|
declare const logger: Logger;
|
|
8542
9246
|
|
|
8543
|
-
export { type Abi, type AbiEntry, type AbiEnum, type AbiEnums, type AbiEvent, type AbiEvents, type AbiInterfaces, type AbiStruct, type AbiStructs, Account, AccountInterface, type AccountInvocationItem, type AccountInvocations, type AccountInvocationsFactoryDetails, type AccountOptions, type AllowArray, type ApiEstimateFeeResponse, type Args, type ArgsOrCalldata, type ArgsOrCalldataWithOptions, type ArraySignatureType, type AsyncContractFunction, type BLOCK_HASH, type BLOCK_NUMBER, BatchClient, type BatchClientOptions, type BigNumberish, type Block$1 as Block, type BlockIdentifier, type BlockNumber, BlockStatus, BlockTag, type BlockWithTxHashes, type Builtins, type ByteArray, type ByteCode, type CairoAssembly, type CairoContract, CairoCustomEnum, type CairoEnum, type CairoEnumRaw, type CairoEvent, type CairoEventDefinition, type CairoEventVariant, CairoFixedArray, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoUint256, CairoUint512, type CairoVersion, type Call, type CallContractResponse, CallData, type CallDetails, type CallOptions, type CallResult, type Calldata, type CommonContractOptions, type CompiledContract, type CompiledSierra, type CompiledSierraCasm, type CompilerVersion, type CompleteDeclareContractPayload, type CompressedProgram, Contract, type ContractClass, type ContractClassIdentifier, type ContractClassPayload, type ContractClassResponse, type ContractEntryPointFields, type ContractFunction, ContractInterface, type ContractOptions, type ContractVersion, type DeclareAndDeployContractPayload, type DeclareContractPayload, type DeclareContractResponse, type DeclareContractTransaction, type DeclareDeployUDCResponse, type DeclareSignerDetails, type DeclareTransactionReceiptResponse, type DeclaredTransaction, type DeployAccountContractPayload, type DeployAccountContractTransaction, type DeployAccountSignerDetails, type DeployAccountTransactionReceiptResponse, type DeployAndInvokeTransaction, type DeployContractResponse, type DeployContractUDCResponse, type DeployTransaction, type DeployTransactionReceiptResponse, type DeployedAccountTransaction, Deployer, type DeployerCall, DeployerInterface, type Details, EDAMode, EDataAvailabilityMode, ETH_ADDRESS, ETransactionExecutionStatus, ETransactionStatus, ETransactionVersion, ETransactionVersion2, ETransactionVersion3, type EVENTS_CHUNK, type EmittedEvent, EntryPointType, type EntryPointsByType, type EstimateFeeBulk, type EstimateFeeResponseBulkOverhead, type EstimateFeeResponseOverhead, EthSigner, type Event$1 as Event, type EventEntry, type EventFilter, type ExecutableDeployAndInvokeTransaction, type ExecutableDeployTransaction, type ExecutableInvokeTransaction, type ExecutableUserInvoke, type ExecutableUserTransaction, type ExecuteOptions, type ExecutionParameters, type FEE_ESTIMATE, type FELT, type FactoryParams, type FeeEstimate, type FeeMode, type FormatResponse, type FunctionAbi, type GasPrices, type GetBlockResponse, type GetTransactionReceiptResponse, type GetTransactionResponse, type GetTxReceiptResponseWithoutHelper, type HexCalldata, type Hint, type InterfaceAbi, type Invocation, type Invocations, type InvocationsDetails, type InvocationsDetailsWithNonce, type InvocationsSignerDetails, type InvokeFunctionResponse, type InvokeTransaction, type InvokeTransactionReceiptResponse, type InvokedTransaction, type L1HandlerTransactionReceiptResponse, type L1_HANDLER_TXN, type LedgerPathCalculation, LedgerSigner111 as LedgerSigner, LedgerSigner111, LedgerSigner221, LedgerSigner231, type LegacyCompiledContract, type LegacyContractClass, type LegacyEvent, LibraryError, Literal, type LogLevel, LogLevelIndex, type Methods, type MultiDeployContractResponse, type MultiType, NON_ZERO_PREFIX, type Nonce, type OptionalPayload, type OutsideCall, type OutsideExecution, type OutsideExecutionOptions, OutsideExecutionTypesV1, OutsideExecutionTypesV2, OutsideExecutionVersion, type OutsideTransaction, type PENDING_DECLARE_TXN_RECEIPT, type PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT, type PENDING_INVOKE_TXN_RECEIPT, type PENDING_L1_HANDLER_TXN_RECEIPT, type PENDING_STATE_UPDATE, type PRE_CONFIRMED_STATE_UPDATE, type PRICE_UNIT, type ParsedEvent, type ParsedEvents, type ParsedStruct, type PaymasterDetails, type PaymasterFeeEstimate, PaymasterInterface, type PaymasterOptions, PaymasterRpc, type PaymasterRpcOptions, type PaymasterTimeBounds, type PendingBlock, type PendingReceipt, type PendingStateUpdate, type PreConfirmedStateUpdate, type PreparedDeployAndInvokeTransaction, type PreparedDeployTransaction, type PreparedInvokeTransaction, type PreparedTransaction, type Program, RpcProvider as Provider, ProviderInterface, type ProviderOptions, type ProviderOrAccount, type PythonicHints, type RESOURCE_PRICE, index$4 as RPC, rpc_0_8_1 as RPC08, rpc_0_9_0 as RPC09, RPCResponseParser, type RPC_ERROR, type RPC_ERROR_SET, type RawArgs, type RawArgsArray, type RawArgsObject, type RawCalldata, type Receipt, ReceiptTx, type RequiredKeysOf, type ResourceBounds, type ResourceBoundsBN, type ResourceBoundsOverhead, ResponseParser, type RevertedTransactionReceiptResponse, RpcChannel, RpcError, RpcProvider, type RpcProviderOptions, type SIMULATION_FLAG, type STATE_UPDATE, type SierraContractClass, type SierraContractEntryPointFields, type SierraEntryPointsByType, type SierraProgramDebugInfo, type Signature, Signer, SignerInterface, type Simplify, type SimulateTransaction, type SimulateTransactionDetails, type SimulateTransactionOverhead, type SimulateTransactionOverheadResponse, type SimulateTransactionResponse, type SimulationFlags, type StarkProfile, type StateUpdate, type StateUpdateResponse, type Storage, Subscription, type SubscriptionBlockIdentifier, type SuccessfulTransactionReceiptResponse, type
|
|
9247
|
+
export { type Abi, type AbiEntry, type AbiEntryType, type AbiEnum, type AbiEnums, type AbiEvent, type AbiEvents, type AbiInterfaces, AbiParser1, AbiParser2, AbiParserInterface, type AbiStruct, type AbiStructs, Account, AccountInterface, type AccountInvocationItem, type AccountInvocations, type AccountInvocationsFactoryDetails, type AccountOptions, type AllowArray, type ApiEstimateFeeResponse, type Args, type ArgsOrCalldata, type ArgsOrCalldataWithOptions, type ArraySignatureType, type AsyncContractFunction, type BLOCK_HASH, type BLOCK_NUMBER, BatchClient, type BatchClientOptions, type BigNumberish, type Block$1 as Block, type BlockIdentifier, type BlockNumber, BlockStatus, BlockTag, type BlockWithTxHashes, type Builtins, type ByteArray, type ByteCode, type CairoAssembly, CairoByteArray, type CairoContract, CairoCustomEnum, type CairoEnum, type CairoEnumRaw, type CairoEvent, type CairoEventDefinition, type CairoEventVariant, CairoFixedArray, CairoInt128, CairoInt16, CairoInt32, CairoInt64, CairoInt8, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoUint128, CairoUint16, CairoUint256, CairoUint512, CairoUint64, CairoUint8, CairoUint96, type CairoVersion, type Call, type CallContractResponse, CallData, type CallDetails, type CallOptions, type CallResult, type Calldata, type CommonContractOptions, type CompiledContract, type CompiledSierra, type CompiledSierraCasm, type CompilerVersion, type CompleteDeclareContractPayload, type CompressedProgram, Contract, type ContractClass, type ContractClassIdentifier, type ContractClassPayload, type ContractClassResponse, type ContractEntryPointFields, type ContractFunction, ContractInterface, type ContractOptions, type ContractVersion, type DeclareAndDeployContractPayload, type DeclareContractPayload, type DeclareContractResponse, type DeclareContractTransaction, type DeclareDeployUDCResponse, type DeclareSignerDetails, type DeclareTransactionReceiptResponse, type DeclaredTransaction, type DeployAccountContractPayload, type DeployAccountContractTransaction, type DeployAccountSignerDetails, type DeployAccountTransactionReceiptResponse, type DeployAndInvokeTransaction, type DeployContractResponse, type DeployContractUDCResponse, type DeployTransaction, type DeployTransactionReceiptResponse, type DeployedAccountTransaction, Deployer, type DeployerCall, DeployerInterface, type Details, EDAMode, EDataAvailabilityMode, ETH_ADDRESS, ETransactionExecutionStatus, ETransactionStatus, ETransactionVersion, ETransactionVersion2, ETransactionVersion3, type EVENTS_CHUNK, type EmittedEvent, EntryPointType, type EntryPointsByType, type ErrorReceiptResponseHelper, type EstimateFeeBulk, type EstimateFeeResponseBulkOverhead, type EstimateFeeResponseOverhead, EthSigner, type Event$1 as Event, type EventEntry, type EventFilter, type ExecutableDeployAndInvokeTransaction, type ExecutableDeployTransaction, type ExecutableInvokeTransaction, type ExecutableUserInvoke, type ExecutableUserTransaction, type ExecuteOptions, type ExecutionParameters, type FEE_ESTIMATE, type FELT, type FactoryParams, type FeeEstimate, type FeeMode, type FormatResponse, type FunctionAbi, type GasPrices, type GetBlockResponse, type GetTransactionReceiptResponse, type GetTransactionResponse, type GetTxReceiptResponseWithoutHelper, type HexCalldata, type Hint, Int, type InterfaceAbi, type Invocation, type Invocations, type InvocationsDetails, type InvocationsDetailsWithNonce, type InvocationsSignerDetails, type InvokeFunctionResponse, type InvokeTransaction, type InvokeTransactionReceiptResponse, type InvokedTransaction, type L1HandlerTransactionReceiptResponse, type L1_HANDLER_TXN, type LedgerPathCalculation, LedgerSigner111 as LedgerSigner, LedgerSigner111, LedgerSigner221, LedgerSigner231, type LegacyCompiledContract, type LegacyContractClass, type LegacyEvent, LibraryError, Literal, type LogLevel, LogLevelIndex, type Methods, type MultiDeployContractResponse, type MultiType, NON_ZERO_PREFIX, type Nonce, type OptionalPayload, type OutsideCall, type OutsideExecution, type OutsideExecutionOptions, OutsideExecutionTypesV1, OutsideExecutionTypesV2, OutsideExecutionVersion, type OutsideTransaction, type PENDING_DECLARE_TXN_RECEIPT, type PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT, type PENDING_INVOKE_TXN_RECEIPT, type PENDING_L1_HANDLER_TXN_RECEIPT, type PENDING_STATE_UPDATE, type PRE_CONFIRMED_STATE_UPDATE, type PRICE_UNIT, type ParsedEvent, type ParsedEvents, type ParsedStruct, type ParsingStrategy, type PaymasterDetails, type PaymasterFeeEstimate, PaymasterInterface, type PaymasterOptions, PaymasterRpc, type PaymasterRpcOptions, type PaymasterTimeBounds, type PendingBlock, type PendingReceipt, type PendingStateUpdate, type PreConfirmedStateUpdate, type PreparedDeployAndInvokeTransaction, type PreparedDeployTransaction, type PreparedInvokeTransaction, type PreparedTransaction, type Program, RpcProvider as Provider, ProviderInterface, type ProviderOptions, type ProviderOrAccount, type PythonicHints, type RESOURCE_PRICE, index$4 as RPC, rpc_0_8_1 as RPC08, rpc_0_9_0 as RPC09, RPCResponseParser, type RPC_ERROR, type RPC_ERROR_SET, type RawArgs, type RawArgsArray, type RawArgsObject, type RawCalldata, type Receipt, ReceiptTx, type ReconnectOptions, type RequiredKeysOf, type ResourceBounds, type ResourceBoundsBN, type ResourceBoundsOverhead, ResponseParser, type RevertedTransactionReceiptResponse, type RevertedTransactionReceiptResponseHelper, RpcChannel, RpcError, RpcProvider, type RpcProviderOptions, type SIMULATION_FLAG, type STATE_UPDATE, type SierraContractClass, type SierraContractEntryPointFields, type SierraEntryPointsByType, type SierraProgramDebugInfo, type Signature, Signer, SignerInterface, type Simplify, type SimulateTransaction, type SimulateTransactionDetails, type SimulateTransactionOverhead, type SimulateTransactionOverheadResponse, type SimulateTransactionResponse, type SimulationFlags, type StarkProfile, type StateUpdate, type StateUpdateResponse, type Storage, type SubscribeEventsParams, type SubscribeNewHeadsParams, type SubscribeNewTransactionReceiptsParams, type SubscribeNewTransactionsParams, type SubscribeTransactionStatusParams, Subscription, type SubscriptionBlockIdentifier, type SubscriptionNewHeadsEvent, type SubscriptionNewTransactionEvent, type SubscriptionNewTransactionReceiptsEvent, type SubscriptionOptions, type SubscriptionStarknetEventsEvent, type SubscriptionTransactionStatusEvent, type SuccessfulTransactionReceiptResponse, type SuccessfulTransactionReceiptResponseHelper, type TXN_EXECUTION_STATUS, type TXN_HASH, type TXN_STATUS, TimeoutError, type TipAnalysisOptions, type TipEstimate, type TipType, type TokenData, TransactionExecutionStatus, TransactionFinalityStatus, type TransactionReceipt, type TransactionReceiptCallbacks, type TransactionReceiptCallbacksDefault, type TransactionReceiptCallbacksDefined, type TransactionReceiptStatus, type TransactionReceiptValue, type TransactionStatus, type TransactionStatusReceiptSets, type TransactionTrace, TransactionType, type TransactionWithHash, type Tupled, type TypedContractV2, UINT_128_MAX, UINT_128_MIN, UINT_256_HIGH_MAX, UINT_256_HIGH_MIN, UINT_256_LOW_MAX, UINT_256_LOW_MIN, UINT_256_MAX, UINT_256_MIN, UINT_512_MAX, UINT_512_MIN, Uint, type Uint256, type Uint512, type UniversalDeployerContractPayload, type UniversalDetails, type UserInvoke, type UserTransaction, type V3DeclareSignerDetails, type V3DeployAccountSignerDetails, type V3InvocationsSignerDetails, type V3TransactionDetails, ValidateType, WalletAccount, WebSocketChannel, type WebSocketModule, WebSocketNotConnectedError, type WebSocketOptions, type WeierstrassSignatureType, type WithOptions, addAddressPadding, byteArray, cairo, config, constants, contractClassResponseToLegacyCompiledContract, createAbiParser, createTransactionReceipt, defaultDeployer, defaultPaymaster, defaultProvider, ec, encode, eth, index as events, extractContractHashes, fastParsingStrategy, getAbiVersion, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, getGasPrices, getLedgerPathBuffer111 as getLedgerPathBuffer, getLedgerPathBuffer111, getLedgerPathBuffer221, type getSimulateTransactionOptions, getTipStatsFromBlocks, index$3 as hash, hdParsingStrategy, isAccount, isNoConstructorValid, isPendingBlock, isPendingStateUpdate, isPendingTransaction, isRPC08Plus_ResourceBounds, isRPC08Plus_ResourceBoundsBN, isSierra, isSupportedSpecVersion, isV3Tx, isVersion, json, legacyDeployer, logger, merkle, num, outsideExecution, parseCalldataField, paymaster, provider, selector, shortString, src5, index$1 as stark, starknetId, toAnyPatchVersion, toApiVersion, index$2 as transaction, typedData, uint256$1 as uint256, units, v2 as v2hash, v3 as v3hash, validateAndParseAddress, validateChecksumAddress, verifyMessageInStarknet, type waitForTransactionOptions, connect as wallet };
|