starknet 9.1.1 → 9.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/index.d.ts +260 -170
- package/dist/index.global.js +280 -218
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +177 -115
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +178 -116
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as RPC$1 from '@starknet-io/starknet-types-09';
|
|
2
|
-
import { CONTRACT, ETransactionType, EDataAvailabilityMode as EDataAvailabilityMode$1, SUBSCRIPTION_BLOCK_ID, IsSucceeded, TransactionReceipt as TransactionReceipt$1, IsReverted, PRE_CONFIRMED_BLOCK_WITH_TX_HASHES, 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, REPLACEMENT_TRANSACTION_UNDERPRICED, FEE_BELOW_MINIMUM, 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, BlockHashAndNumber, BLOCK_STATUS, BLOCK_HEADER, BLOCK_BODY_WITH_TX_HASHES, PRE_CONFIRMED_BLOCK_HEADER, BLOCK_BODY_WITH_TXS, BLOCK_BODY_WITH_RECEIPTS, BlockTransactionsTraces, TXN_WITH_HASH, TXN_STATUS_RESULT, Syncing, 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
|
-
export { StarknetDomain, StarknetEnumType, StarknetMerkleType, StarknetType, TypedData, TypedDataRevision } from '@starknet-io/starknet-types-09';
|
|
4
1
|
import * as RPC from '@starknet-io/starknet-types-010';
|
|
5
|
-
import { PAYMASTER_API,
|
|
2
|
+
import { PAYMASTER_API, CONTRACT, ETransactionType, EDataAvailabilityMode as EDataAvailabilityMode$1, SUBSCRIPTION_BLOCK_ID, IsSucceeded, TransactionReceipt as TransactionReceipt$1, IsReverted, PRE_CONFIRMED_BLOCK_WITH_TX_HASHES, BLOCK_WITH_TX_HASHES, IsType, OutsideExecutionTypedData, TypedData, CONTRACT_STORAGE_KEYS, StorageProof, CASM_COMPILED_CONTRACT_CLASS, ETransactionVersion3 as ETransactionVersion3$1, TransactionHash, BlockHash, 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, REPLACEMENT_TRANSACTION_UNDERPRICED, FEE_BELOW_MINIMUM, 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, StarknetWindowObject, AccountChangeEventHandler, NetworkChangeEventHandler, WatchAssetParameters, AddStarknetChainParameters, Signature as Signature$1, EDAMode as EDAMode$1, StarknetType, StarknetMerkleType, TypedDataRevision, OutsideCallV1, OutsideCallV2, EmittedEvent as EmittedEvent$1, Event as Event$2, Address, Permission, ChainId, AccountDeploymentData, AddInvokeTransactionParameters, AddInvokeTransactionResult, AddDeclareTransactionParameters, AddDeclareTransactionResult, SpecVersion } from '@starknet-io/starknet-types-010';
|
|
3
|
+
export { StarknetDomain, StarknetEnumType, StarknetMerkleType, StarknetType, TypedData, TypedDataRevision } from '@starknet-io/starknet-types-010';
|
|
4
|
+
import * as RPC$1 from '@starknet-io/starknet-types-09';
|
|
6
5
|
import { Abi as Abi$1, TypedContract } from 'abi-wan-kanabi';
|
|
7
6
|
import * as weierstrass from '@noble/curves/abstract/weierstrass';
|
|
8
7
|
import { RecoveredSignatureType } from '@noble/curves/abstract/weierstrass';
|
|
@@ -875,6 +874,17 @@ type ContractVersion = {
|
|
|
875
874
|
compiler: CompilerVersion;
|
|
876
875
|
};
|
|
877
876
|
|
|
877
|
+
declare const LogLevelIndex: {
|
|
878
|
+
DEBUG: number;
|
|
879
|
+
INFO: number;
|
|
880
|
+
WARN: number;
|
|
881
|
+
ERROR: number;
|
|
882
|
+
FATAL: number;
|
|
883
|
+
OFF: number;
|
|
884
|
+
};
|
|
885
|
+
type LogLevelIndex = ValuesType<typeof LogLevelIndex>;
|
|
886
|
+
type LogLevel = keyof typeof LogLevelIndex;
|
|
887
|
+
|
|
878
888
|
interface ProviderOptions extends RpcProviderOptions {
|
|
879
889
|
}
|
|
880
890
|
type RpcProviderOptions = {
|
|
@@ -1752,127 +1762,6 @@ declare class PaymasterRpc implements PaymasterInterface {
|
|
|
1752
1762
|
|
|
1753
1763
|
declare const defaultPaymaster: PaymasterRpc;
|
|
1754
1764
|
|
|
1755
|
-
/**
|
|
1756
|
-
* Result of provider.getTipStatsFromBlocks().
|
|
1757
|
-
* @param {bigint} minTip - minimum tip encountered in the analyzed blocks.
|
|
1758
|
-
* @param {bigint} maxTip - maximum tip encountered in the analyzed blocks.
|
|
1759
|
-
* @param {bigint} averageTip - average tip encountered in the analyzed blocks.
|
|
1760
|
-
* @param {bigint} medianTip - median (middle value) tip encountered in the analyzed blocks.
|
|
1761
|
-
* @param {bigint} modeTip - mode (most frequent) tip encountered in the analyzed blocks.
|
|
1762
|
-
* @param {bigint} recommendedTip - suggested tip amount (median tip) for optimal inclusion probability.
|
|
1763
|
-
* @param {bigint} p90Tip - 90th percentile tip (90% of tips are below this value).
|
|
1764
|
-
* @param {bigint} p95Tip - 95th percentile tip (95% of tips are below this value).
|
|
1765
|
-
* @param {object} metrics - Optional performance metrics for the analysis.
|
|
1766
|
-
*/
|
|
1767
|
-
type TipEstimate = {
|
|
1768
|
-
minTip: bigint;
|
|
1769
|
-
maxTip: bigint;
|
|
1770
|
-
averageTip: bigint;
|
|
1771
|
-
medianTip: bigint;
|
|
1772
|
-
modeTip: bigint;
|
|
1773
|
-
recommendedTip: bigint;
|
|
1774
|
-
p90Tip: bigint;
|
|
1775
|
-
p95Tip: bigint;
|
|
1776
|
-
metrics?: {
|
|
1777
|
-
blocksAnalyzed: number;
|
|
1778
|
-
transactionsTipsFound: bigint[];
|
|
1779
|
-
};
|
|
1780
|
-
};
|
|
1781
|
-
type TipType = Exclude<keyof TipEstimate, 'metrics'>;
|
|
1782
|
-
/**
|
|
1783
|
-
* Options for customizing tip analysis behavior.
|
|
1784
|
-
*/
|
|
1785
|
-
type TipAnalysisOptions = {
|
|
1786
|
-
/**
|
|
1787
|
-
* Maximum number of blocks to analyze going backwards from the starting block.
|
|
1788
|
-
* @default 3
|
|
1789
|
-
*/
|
|
1790
|
-
maxBlocks?: number;
|
|
1791
|
-
/**
|
|
1792
|
-
* Minimum number of transactions required to generate reliable statistics.
|
|
1793
|
-
* @default 10
|
|
1794
|
-
*/
|
|
1795
|
-
minTxsNecessary?: number;
|
|
1796
|
-
/**
|
|
1797
|
-
* Whether to include transactions with zero tips in the analysis.
|
|
1798
|
-
* @default true
|
|
1799
|
-
*/
|
|
1800
|
-
includeZeroTips?: boolean;
|
|
1801
|
-
};
|
|
1802
|
-
/**
|
|
1803
|
-
* Analyzes tip statistics from recent blocks to help determine optimal tip amounts.
|
|
1804
|
-
*
|
|
1805
|
-
* This function examines V3 invoke transactions across multiple recent blocks to calculate
|
|
1806
|
-
* minimum, maximum, and average tip amounts. This data can be used to determine an
|
|
1807
|
-
* appropriate tip for new transactions.
|
|
1808
|
-
*
|
|
1809
|
-
* **Performance Notes:**
|
|
1810
|
-
* - Automatically detects if your provider has batching enabled
|
|
1811
|
-
* - When batching is enabled, all block requests are made in parallel and automatically
|
|
1812
|
-
* batched into a single HTTP request for maximum efficiency
|
|
1813
|
-
* - When batching is not enabled, requests are made sequentially with early exit capability
|
|
1814
|
-
*
|
|
1815
|
-
* @param provider - RPC provider for blockchain communication
|
|
1816
|
-
* @param blockIdentifier - Starting block for analysis (goes backwards from this block)
|
|
1817
|
-
* @param options - Configuration options for the analysis
|
|
1818
|
-
* @returns Promise resolving to TipEstimate object
|
|
1819
|
-
*
|
|
1820
|
-
* @throws {Error} When invalid parameters are provided
|
|
1821
|
-
* @throws {LibraryError} When RPC calls fail, data is invalid, or insufficient transaction data is found
|
|
1822
|
-
*
|
|
1823
|
-
* @example
|
|
1824
|
-
* ```typescript
|
|
1825
|
-
* import { RpcProvider } from 'starknet';
|
|
1826
|
-
*
|
|
1827
|
-
* // Create provider with batching for optimal performance
|
|
1828
|
-
* const provider = new RpcProvider({
|
|
1829
|
-
* nodeUrl: 'your_node_url',
|
|
1830
|
-
* batch: 50 // 50ms batch interval - automatically detected and used
|
|
1831
|
-
* });
|
|
1832
|
-
*
|
|
1833
|
-
* // Basic usage - automatically uses best strategy
|
|
1834
|
-
* const tipStats = await getTipStatsFromBlocks(provider, 'latest');
|
|
1835
|
-
* console.log(`Recommended tip (median): ${tipStats.recommendedTip}`);
|
|
1836
|
-
* console.log(`90th percentile tip: ${tipStats.p90Tip}`);
|
|
1837
|
-
* console.log(`95th percentile tip: ${tipStats.p95Tip}`);
|
|
1838
|
-
*
|
|
1839
|
-
* // Advanced usage with custom options
|
|
1840
|
-
* const tipStats = await getTipStatsFromBlocks(
|
|
1841
|
-
* provider,
|
|
1842
|
-
* 'latest',
|
|
1843
|
-
* {
|
|
1844
|
-
* maxBlocks: 10,
|
|
1845
|
-
* minTxsNecessary: 5,
|
|
1846
|
-
* includeZeroTips: true
|
|
1847
|
-
* }
|
|
1848
|
-
* );
|
|
1849
|
-
*
|
|
1850
|
-
* // Check if we have sufficient data
|
|
1851
|
-
* if (tipStats.recommendedTip === 0n) {
|
|
1852
|
-
* console.log('Insufficient transaction data for reliable tip estimation');
|
|
1853
|
-
* } else {
|
|
1854
|
-
* console.log(`Recommended tip: ${tipStats.recommendedTip}`);
|
|
1855
|
-
* console.log(`Average tip: ${tipStats.averageTip}`);
|
|
1856
|
-
* console.log(`Median tip: ${tipStats.medianTip}`);
|
|
1857
|
-
* console.log(`Mode tip: ${tipStats.modeTip}`);
|
|
1858
|
-
* console.log(`Min tip: ${tipStats.minTip}, Max tip: ${tipStats.maxTip}`);
|
|
1859
|
-
* console.log(`P90 tip: ${tipStats.p90Tip} (90% of tips are below this)`);
|
|
1860
|
-
* console.log(`P95 tip: ${tipStats.p95Tip} (95% of tips are below this)`);
|
|
1861
|
-
*
|
|
1862
|
-
* // Access performance metrics if available
|
|
1863
|
-
* if (tipStats.metrics) {
|
|
1864
|
-
* console.log(`Analyzed ${tipStats.metrics.transactionsFound} transactions`);
|
|
1865
|
-
* console.log(`Across ${tipStats.metrics.blocksAnalyzed} blocks`);
|
|
1866
|
-
* }
|
|
1867
|
-
* }
|
|
1868
|
-
*
|
|
1869
|
-
* // Using specific block number
|
|
1870
|
-
* const blockNumber = 650000;
|
|
1871
|
-
* const historicalTips = await getTipStatsFromBlocks(provider, blockNumber);
|
|
1872
|
-
* ```
|
|
1873
|
-
*/
|
|
1874
|
-
declare function getTipStatsFromBlocks(provider: ProviderInterface, blockIdentifier?: BlockIdentifier, options?: TipAnalysisOptions): Promise<TipEstimate>;
|
|
1875
|
-
|
|
1876
1765
|
type TransactionStatusReceiptSets = {
|
|
1877
1766
|
SUCCEEDED: SuccessfulTransactionReceiptResponse;
|
|
1878
1767
|
REVERTED: RevertedTransactionReceiptResponse;
|
|
@@ -3250,9 +3139,11 @@ type WithOptions = ExecuteOptions & CallOptions;
|
|
|
3250
3139
|
type ParsedEvent = {
|
|
3251
3140
|
[name: string]: ParsedStruct;
|
|
3252
3141
|
} & {
|
|
3142
|
+
transaction_hash?: TransactionHash;
|
|
3143
|
+
transaction_index?: number;
|
|
3144
|
+
event_index?: number;
|
|
3253
3145
|
block_hash?: BlockHash;
|
|
3254
3146
|
block_number?: BlockNumber;
|
|
3255
|
-
transaction_hash?: TransactionHash;
|
|
3256
3147
|
};
|
|
3257
3148
|
type ParsedEvents = Array<ParsedEvent> & {
|
|
3258
3149
|
getByPath?(path: string): ParsedStruct | null;
|
|
@@ -3443,16 +3334,126 @@ declare global {
|
|
|
3443
3334
|
}
|
|
3444
3335
|
}
|
|
3445
3336
|
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3337
|
+
/**
|
|
3338
|
+
* Result of provider.getTipStatsFromBlocks().
|
|
3339
|
+
* @param {bigint} minTip - minimum tip encountered in the analyzed blocks.
|
|
3340
|
+
* @param {bigint} maxTip - maximum tip encountered in the analyzed blocks.
|
|
3341
|
+
* @param {bigint} averageTip - average tip encountered in the analyzed blocks.
|
|
3342
|
+
* @param {bigint} medianTip - median (middle value) tip encountered in the analyzed blocks.
|
|
3343
|
+
* @param {bigint} modeTip - mode (most frequent) tip encountered in the analyzed blocks.
|
|
3344
|
+
* @param {bigint} recommendedTip - suggested tip amount (median tip) for optimal inclusion probability.
|
|
3345
|
+
* @param {bigint} p90Tip - 90th percentile tip (90% of tips are below this value).
|
|
3346
|
+
* @param {bigint} p95Tip - 95th percentile tip (95% of tips are below this value).
|
|
3347
|
+
* @param {object} metrics - Optional performance metrics for the analysis.
|
|
3348
|
+
*/
|
|
3349
|
+
type TipEstimate = {
|
|
3350
|
+
minTip: bigint;
|
|
3351
|
+
maxTip: bigint;
|
|
3352
|
+
averageTip: bigint;
|
|
3353
|
+
medianTip: bigint;
|
|
3354
|
+
modeTip: bigint;
|
|
3355
|
+
recommendedTip: bigint;
|
|
3356
|
+
p90Tip: bigint;
|
|
3357
|
+
p95Tip: bigint;
|
|
3358
|
+
metrics?: {
|
|
3359
|
+
blocksAnalyzed: number;
|
|
3360
|
+
transactionsTipsFound: bigint[];
|
|
3361
|
+
};
|
|
3453
3362
|
};
|
|
3454
|
-
type
|
|
3455
|
-
|
|
3363
|
+
type TipType = Exclude<keyof TipEstimate, 'metrics'>;
|
|
3364
|
+
/**
|
|
3365
|
+
* Options for customizing tip analysis behavior.
|
|
3366
|
+
*/
|
|
3367
|
+
type TipAnalysisOptions = {
|
|
3368
|
+
/**
|
|
3369
|
+
* Maximum number of blocks to analyze going backwards from the starting block.
|
|
3370
|
+
* @default 3
|
|
3371
|
+
*/
|
|
3372
|
+
maxBlocks?: number;
|
|
3373
|
+
/**
|
|
3374
|
+
* Minimum number of transactions required to generate reliable statistics.
|
|
3375
|
+
* @default 10
|
|
3376
|
+
*/
|
|
3377
|
+
minTxsNecessary?: number;
|
|
3378
|
+
/**
|
|
3379
|
+
* Whether to include transactions with zero tips in the analysis.
|
|
3380
|
+
* @default true
|
|
3381
|
+
*/
|
|
3382
|
+
includeZeroTips?: boolean;
|
|
3383
|
+
};
|
|
3384
|
+
/**
|
|
3385
|
+
* Analyzes tip statistics from recent blocks to help determine optimal tip amounts.
|
|
3386
|
+
*
|
|
3387
|
+
* This function examines V3 invoke transactions across multiple recent blocks to calculate
|
|
3388
|
+
* minimum, maximum, and average tip amounts. This data can be used to determine an
|
|
3389
|
+
* appropriate tip for new transactions.
|
|
3390
|
+
*
|
|
3391
|
+
* **Performance Notes:**
|
|
3392
|
+
* - Automatically detects if your provider has batching enabled
|
|
3393
|
+
* - When batching is enabled, all block requests are made in parallel and automatically
|
|
3394
|
+
* batched into a single HTTP request for maximum efficiency
|
|
3395
|
+
* - When batching is not enabled, requests are made sequentially with early exit capability
|
|
3396
|
+
*
|
|
3397
|
+
* @param provider - RPC provider for blockchain communication
|
|
3398
|
+
* @param blockIdentifier - Starting block for analysis (goes backwards from this block)
|
|
3399
|
+
* @param options - Configuration options for the analysis
|
|
3400
|
+
* @returns Promise resolving to TipEstimate object
|
|
3401
|
+
*
|
|
3402
|
+
* @throws {Error} When invalid parameters are provided
|
|
3403
|
+
* @throws {LibraryError} When RPC calls fail, data is invalid, or insufficient transaction data is found
|
|
3404
|
+
*
|
|
3405
|
+
* @example
|
|
3406
|
+
* ```typescript
|
|
3407
|
+
* import { RpcProvider } from 'starknet';
|
|
3408
|
+
*
|
|
3409
|
+
* // Create provider with batching for optimal performance
|
|
3410
|
+
* const provider = new RpcProvider({
|
|
3411
|
+
* nodeUrl: 'your_node_url',
|
|
3412
|
+
* batch: 50 // 50ms batch interval - automatically detected and used
|
|
3413
|
+
* });
|
|
3414
|
+
*
|
|
3415
|
+
* // Basic usage - automatically uses best strategy
|
|
3416
|
+
* const tipStats = await getTipStatsFromBlocks(provider, 'latest');
|
|
3417
|
+
* console.log(`Recommended tip (median): ${tipStats.recommendedTip}`);
|
|
3418
|
+
* console.log(`90th percentile tip: ${tipStats.p90Tip}`);
|
|
3419
|
+
* console.log(`95th percentile tip: ${tipStats.p95Tip}`);
|
|
3420
|
+
*
|
|
3421
|
+
* // Advanced usage with custom options
|
|
3422
|
+
* const tipStats = await getTipStatsFromBlocks(
|
|
3423
|
+
* provider,
|
|
3424
|
+
* 'latest',
|
|
3425
|
+
* {
|
|
3426
|
+
* maxBlocks: 10,
|
|
3427
|
+
* minTxsNecessary: 5,
|
|
3428
|
+
* includeZeroTips: true
|
|
3429
|
+
* }
|
|
3430
|
+
* );
|
|
3431
|
+
*
|
|
3432
|
+
* // Check if we have sufficient data
|
|
3433
|
+
* if (tipStats.recommendedTip === 0n) {
|
|
3434
|
+
* console.log('Insufficient transaction data for reliable tip estimation');
|
|
3435
|
+
* } else {
|
|
3436
|
+
* console.log(`Recommended tip: ${tipStats.recommendedTip}`);
|
|
3437
|
+
* console.log(`Average tip: ${tipStats.averageTip}`);
|
|
3438
|
+
* console.log(`Median tip: ${tipStats.medianTip}`);
|
|
3439
|
+
* console.log(`Mode tip: ${tipStats.modeTip}`);
|
|
3440
|
+
* console.log(`Min tip: ${tipStats.minTip}, Max tip: ${tipStats.maxTip}`);
|
|
3441
|
+
* console.log(`P90 tip: ${tipStats.p90Tip} (90% of tips are below this)`);
|
|
3442
|
+
* console.log(`P95 tip: ${tipStats.p95Tip} (95% of tips are below this)`);
|
|
3443
|
+
*
|
|
3444
|
+
* // Access performance metrics if available
|
|
3445
|
+
* if (tipStats.metrics) {
|
|
3446
|
+
* console.log(`Analyzed ${tipStats.metrics.transactionsFound} transactions`);
|
|
3447
|
+
* console.log(`Across ${tipStats.metrics.blocksAnalyzed} blocks`);
|
|
3448
|
+
* }
|
|
3449
|
+
* }
|
|
3450
|
+
*
|
|
3451
|
+
* // Using specific block number
|
|
3452
|
+
* const blockNumber = 650000;
|
|
3453
|
+
* const historicalTips = await getTipStatsFromBlocks(provider, blockNumber);
|
|
3454
|
+
* ```
|
|
3455
|
+
*/
|
|
3456
|
+
declare function getTipStatsFromBlocks(provider: ProviderInterface, blockIdentifier?: BlockIdentifier, options?: TipAnalysisOptions): Promise<TipEstimate>;
|
|
3456
3457
|
|
|
3457
3458
|
declare const IS_BROWSER: boolean;
|
|
3458
3459
|
/**
|
|
@@ -3887,12 +3888,35 @@ type _SupportedRpcVersion = ValuesType<typeof _SupportedRpcVersion>;
|
|
|
3887
3888
|
|
|
3888
3889
|
type SupportedTransactionVersion = typeof ETransactionVersion$1.V3;
|
|
3889
3890
|
type SupportedCairoVersion = '1';
|
|
3891
|
+
/**
|
|
3892
|
+
* Channel method-specific options
|
|
3893
|
+
*/
|
|
3894
|
+
type ChannelMethodOptions = {
|
|
3895
|
+
simulateTransaction: Omit<getSimulateTransactionOptions, 'blockIdentifier'>;
|
|
3896
|
+
getEstimateFee: Omit<getEstimateFeeBulkOptions, 'blockIdentifier'>;
|
|
3897
|
+
};
|
|
3898
|
+
/**
|
|
3899
|
+
* Channel default options
|
|
3900
|
+
*/
|
|
3901
|
+
type ChannelDefaultOptions = {
|
|
3902
|
+
headers: Record<string, string>;
|
|
3903
|
+
blockIdentifier: BlockTag;
|
|
3904
|
+
retries: number;
|
|
3905
|
+
};
|
|
3906
|
+
/**
|
|
3907
|
+
* Channel defaults configuration
|
|
3908
|
+
*/
|
|
3909
|
+
type ChannelDefaults = {
|
|
3910
|
+
options: ChannelDefaultOptions;
|
|
3911
|
+
methods: ChannelMethodOptions;
|
|
3912
|
+
};
|
|
3890
3913
|
declare const DEFAULT_GLOBAL_CONFIG: {
|
|
3891
3914
|
logLevel: LogLevel;
|
|
3892
3915
|
rpcVersion: _SupportedRpcVersion;
|
|
3893
3916
|
transactionVersion: SupportedTransactionVersion;
|
|
3894
3917
|
resourceBoundsOverhead: ResourceBoundsOverhead;
|
|
3895
3918
|
defaultTipType: TipType;
|
|
3919
|
+
channelDefaults: ChannelDefaults;
|
|
3896
3920
|
fetch: any;
|
|
3897
3921
|
websocket: any;
|
|
3898
3922
|
buffer: any;
|
|
@@ -3934,6 +3958,9 @@ declare const SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS: "0.14.1";
|
|
|
3934
3958
|
|
|
3935
3959
|
declare const constants_ADDR_BOUND: typeof ADDR_BOUND;
|
|
3936
3960
|
declare const constants_API_VERSION: typeof API_VERSION;
|
|
3961
|
+
type constants_ChannelDefaultOptions = ChannelDefaultOptions;
|
|
3962
|
+
type constants_ChannelDefaults = ChannelDefaults;
|
|
3963
|
+
type constants_ChannelMethodOptions = ChannelMethodOptions;
|
|
3937
3964
|
declare const constants_DEFAULT_GLOBAL_CONFIG: typeof DEFAULT_GLOBAL_CONFIG;
|
|
3938
3965
|
declare const constants_HARDENING_4BYTES: typeof HARDENING_4BYTES;
|
|
3939
3966
|
declare const constants_HARDENING_BYTE: typeof HARDENING_BYTE;
|
|
@@ -3968,7 +3995,7 @@ declare const constants_TEXT_TO_FELT_MAX_LEN: typeof TEXT_TO_FELT_MAX_LEN;
|
|
|
3968
3995
|
declare const constants_UDC: typeof UDC;
|
|
3969
3996
|
declare const constants_ZERO: typeof ZERO;
|
|
3970
3997
|
declare namespace constants {
|
|
3971
|
-
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_SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS as SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS, 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 };
|
|
3998
|
+
export { constants_ADDR_BOUND as ADDR_BOUND, constants_API_VERSION as API_VERSION, _BaseUrl as BaseUrl, type constants_ChannelDefaultOptions as ChannelDefaultOptions, type constants_ChannelDefaults as ChannelDefaults, type constants_ChannelMethodOptions as ChannelMethodOptions, 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_SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS as SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS, 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 };
|
|
3972
3999
|
}
|
|
3973
4000
|
|
|
3974
4001
|
declare class RpcChannel$1 {
|
|
@@ -4073,7 +4100,7 @@ declare class RpcChannel$1 {
|
|
|
4073
4100
|
* @param invocations AccountInvocations
|
|
4074
4101
|
* @param simulateTransactionOptions blockIdentifier and flags to skip validation and fee charge<br/>
|
|
4075
4102
|
* - blockIdentifier<br/>
|
|
4076
|
-
* - skipValidate (default
|
|
4103
|
+
* - skipValidate (default true)<br/>
|
|
4077
4104
|
* - skipFeeCharge (default true)<br/>
|
|
4078
4105
|
*/
|
|
4079
4106
|
simulateTransaction(invocations: AccountInvocations, simulateTransactionOptions?: getSimulateTransactionOptions): Promise<RPC$1.SimulateTransactionResponse>;
|
|
@@ -4093,7 +4120,7 @@ declare class RpcChannel$1 {
|
|
|
4093
4120
|
sierra_program?: undefined;
|
|
4094
4121
|
contract_class_version?: undefined;
|
|
4095
4122
|
})>;
|
|
4096
|
-
getEstimateFee(invocations: AccountInvocations,
|
|
4123
|
+
getEstimateFee(invocations: AccountInvocations, options?: getEstimateFeeBulkOptions): Promise<RPC$1.FEE_ESTIMATE[]>;
|
|
4097
4124
|
invoke(functionInvocation: Invocation, details: InvocationsDetailsWithNonce): Promise<RPC$1.InvokedTransaction>;
|
|
4098
4125
|
declare(declareTransaction: DeclareContractTransaction, details: InvocationsDetailsWithNonce): Promise<RPC$1.DeclaredTransaction | RPC$1.TXN_RECEIPT>;
|
|
4099
4126
|
deployAccount(deployAccountTransaction: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce): Promise<RPC$1.DeployedAccountTransaction | RPC$1.TXN_RECEIPT>;
|
|
@@ -4249,7 +4276,7 @@ declare class RpcChannel {
|
|
|
4249
4276
|
* @param invocations AccountInvocations
|
|
4250
4277
|
* @param simulateTransactionOptions blockIdentifier and flags to skip validation and fee charge<br/>
|
|
4251
4278
|
* - blockIdentifier<br/>
|
|
4252
|
-
* - skipValidate (default
|
|
4279
|
+
* - skipValidate (default true)<br/>
|
|
4253
4280
|
* - skipFeeCharge (default true)<br/>
|
|
4254
4281
|
*/
|
|
4255
4282
|
simulateTransaction(invocations: AccountInvocations, simulateTransactionOptions?: getSimulateTransactionOptions): Promise<RPC.SimulateTransactionResponse>;
|
|
@@ -4269,7 +4296,7 @@ declare class RpcChannel {
|
|
|
4269
4296
|
sierra_program?: undefined;
|
|
4270
4297
|
contract_class_version?: undefined;
|
|
4271
4298
|
})>;
|
|
4272
|
-
getEstimateFee(invocations: AccountInvocations,
|
|
4299
|
+
getEstimateFee(invocations: AccountInvocations, options?: getEstimateFeeBulkOptions): Promise<RPC.FEE_ESTIMATE[]>;
|
|
4273
4300
|
invoke(functionInvocation: Invocation, details: InvocationsDetailsWithNonce): Promise<RPC.InvokedTransaction>;
|
|
4274
4301
|
declare(declareTransaction: DeclareContractTransaction, details: InvocationsDetailsWithNonce): Promise<RPC.DeclaredTransaction | RPC.TXN_RECEIPT>;
|
|
4275
4302
|
deployAccount(deployAccountTransaction: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce): Promise<RPC.DeployedAccountTransaction | RPC.TXN_RECEIPT>;
|
|
@@ -4747,19 +4774,19 @@ declare class RpcProvider$1 implements ProviderInterface {
|
|
|
4747
4774
|
getBlock(blockIdentifier: 'pre_confirmed'): Promise<PreConfirmedBlock>;
|
|
4748
4775
|
getBlock(blockIdentifier: 'latest'): Promise<Block$1>;
|
|
4749
4776
|
getBlock(blockIdentifier: BlockIdentifier): Promise<GetBlockResponse>;
|
|
4750
|
-
getBlockLatestAccepted(): Promise<BlockHashAndNumber>;
|
|
4777
|
+
getBlockLatestAccepted(): Promise<RPC$1.BlockHashAndNumber>;
|
|
4751
4778
|
getBlockNumber(): Promise<number>;
|
|
4752
4779
|
getBlockWithTxHashes(blockIdentifier?: BlockIdentifier): Promise<({
|
|
4753
|
-
status: BLOCK_STATUS;
|
|
4754
|
-
} & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES & {}) | (BLOCK_BODY_WITH_TX_HASHES & PRE_CONFIRMED_BLOCK_HEADER & {
|
|
4780
|
+
status: RPC$1.BLOCK_STATUS;
|
|
4781
|
+
} & RPC$1.BLOCK_HEADER & RPC$1.BLOCK_BODY_WITH_TX_HASHES & {}) | (RPC$1.BLOCK_BODY_WITH_TX_HASHES & RPC$1.PRE_CONFIRMED_BLOCK_HEADER & {
|
|
4755
4782
|
block_hash?: undefined;
|
|
4756
4783
|
new_root?: undefined;
|
|
4757
4784
|
status?: undefined;
|
|
4758
4785
|
parent_hash?: undefined;
|
|
4759
4786
|
})>;
|
|
4760
4787
|
getBlockWithTxs(blockIdentifier?: BlockIdentifier): Promise<({
|
|
4761
|
-
status: BLOCK_STATUS;
|
|
4762
|
-
} & BLOCK_HEADER & BLOCK_BODY_WITH_TXS & {}) | (BLOCK_BODY_WITH_TXS & PRE_CONFIRMED_BLOCK_HEADER & {
|
|
4788
|
+
status: RPC$1.BLOCK_STATUS;
|
|
4789
|
+
} & RPC$1.BLOCK_HEADER & RPC$1.BLOCK_BODY_WITH_TXS & {}) | (RPC$1.BLOCK_BODY_WITH_TXS & RPC$1.PRE_CONFIRMED_BLOCK_HEADER & {
|
|
4763
4790
|
block_hash?: undefined;
|
|
4764
4791
|
new_root?: undefined;
|
|
4765
4792
|
status?: undefined;
|
|
@@ -4780,8 +4807,8 @@ declare class RpcProvider$1 implements ProviderInterface {
|
|
|
4780
4807
|
getGasPrices(blockIdentifier?: BlockIdentifier): Promise<GasPrices>;
|
|
4781
4808
|
getL1MessageHash(l2TxHash: BigNumberish): Promise<string>;
|
|
4782
4809
|
getBlockWithReceipts(blockIdentifier?: BlockIdentifier): Promise<({
|
|
4783
|
-
status: BLOCK_STATUS;
|
|
4784
|
-
} & BLOCK_HEADER & BLOCK_BODY_WITH_RECEIPTS & {}) | (BLOCK_BODY_WITH_RECEIPTS & PRE_CONFIRMED_BLOCK_HEADER & {
|
|
4810
|
+
status: RPC$1.BLOCK_STATUS;
|
|
4811
|
+
} & RPC$1.BLOCK_HEADER & RPC$1.BLOCK_BODY_WITH_RECEIPTS & {}) | (RPC$1.BLOCK_BODY_WITH_RECEIPTS & RPC$1.PRE_CONFIRMED_BLOCK_HEADER & {
|
|
4785
4812
|
block_hash?: undefined;
|
|
4786
4813
|
new_root?: undefined;
|
|
4787
4814
|
status?: undefined;
|
|
@@ -4797,14 +4824,14 @@ declare class RpcProvider$1 implements ProviderInterface {
|
|
|
4797
4824
|
getBlockStateUpdate(blockIdentifier: 'pre_confirmed'): Promise<PreConfirmedStateUpdate>;
|
|
4798
4825
|
getBlockStateUpdate(blockIdentifier: 'latest'): Promise<StateUpdate>;
|
|
4799
4826
|
getBlockStateUpdate(blockIdentifier?: BlockIdentifier): Promise<StateUpdateResponse>;
|
|
4800
|
-
getBlockTransactionsTraces(blockIdentifier?: BlockIdentifier): Promise<BlockTransactionsTraces>;
|
|
4827
|
+
getBlockTransactionsTraces(blockIdentifier?: BlockIdentifier): Promise<RPC$1.BlockTransactionsTraces>;
|
|
4801
4828
|
getBlockTransactionCount(blockIdentifier?: BlockIdentifier): Promise<number>;
|
|
4802
|
-
getTransaction(txHash: BigNumberish): Promise<TXN_WITH_HASH>;
|
|
4803
|
-
getTransactionByHash(txHash: BigNumberish): Promise<TXN_WITH_HASH>;
|
|
4804
|
-
getTransactionByBlockIdAndIndex(blockIdentifier: BlockIdentifier, index: number): Promise<TXN_WITH_HASH>;
|
|
4829
|
+
getTransaction(txHash: BigNumberish): Promise<RPC$1.TXN_WITH_HASH>;
|
|
4830
|
+
getTransactionByHash(txHash: BigNumberish): Promise<RPC$1.TXN_WITH_HASH>;
|
|
4831
|
+
getTransactionByBlockIdAndIndex(blockIdentifier: BlockIdentifier, index: number): Promise<RPC$1.TXN_WITH_HASH>;
|
|
4805
4832
|
getTransactionReceipt(txHash: BigNumberish): Promise<GetTransactionReceiptResponse>;
|
|
4806
4833
|
getTransactionTrace(txHash: BigNumberish): Promise<RPC.TRANSACTION_TRACE | RPC$1.TRANSACTION_TRACE>;
|
|
4807
|
-
getTransactionStatus(transactionHash: BigNumberish): Promise<TXN_STATUS_RESULT>;
|
|
4834
|
+
getTransactionStatus(transactionHash: BigNumberish): Promise<RPC$1.TXN_STATUS_RESULT>;
|
|
4808
4835
|
getSimulateTransaction(invocations: AccountInvocations, options?: getSimulateTransactionOptions): Promise<SimulateTransactionOverheadResponse>;
|
|
4809
4836
|
waitForTransaction(txHash: BigNumberish, options?: waitForTransactionOptions): Promise<GetTransactionReceiptResponse>;
|
|
4810
4837
|
/**
|
|
@@ -4846,7 +4873,7 @@ declare class RpcProvider$1 implements ProviderInterface {
|
|
|
4846
4873
|
callContract(call: Call, blockIdentifier?: BlockIdentifier): Promise<string[]>;
|
|
4847
4874
|
estimateMessageFee(message: RPC$1.L1Message, // same as spec08.L1Message
|
|
4848
4875
|
blockIdentifier?: BlockIdentifier): Promise<RPC.FEE_ESTIMATE | RPC$1.MESSAGE_FEE_ESTIMATE>;
|
|
4849
|
-
getSyncingStats(): Promise<Syncing>;
|
|
4876
|
+
getSyncingStats(): Promise<RPC$1.Syncing>;
|
|
4850
4877
|
getEvents(eventFilter: RPC.EventFilter | RPC$1.EventFilter): Promise<RPC.EVENTS_CHUNK | RPC$1.EVENTS_CHUNK>;
|
|
4851
4878
|
verifyMessageInStarknet(message: BigNumberish | TypedData, signature: Signature, accountAddress: BigNumberish, signatureVerificationFunctionName?: string, signatureVerificationResponse?: {
|
|
4852
4879
|
okResponse: string[];
|
|
@@ -5210,8 +5237,8 @@ declare class WalletAccount extends Account implements AccountInterface {
|
|
|
5210
5237
|
/**
|
|
5211
5238
|
* ACCOUNT METHODS
|
|
5212
5239
|
*/
|
|
5213
|
-
execute(calls: AllowArray<Call>): Promise<RPC
|
|
5214
|
-
declare(payload: DeclareContractPayload): Promise<RPC
|
|
5240
|
+
execute(calls: AllowArray<Call>): Promise<RPC.AddInvokeTransactionResult>;
|
|
5241
|
+
declare(payload: DeclareContractPayload): Promise<RPC.AddDeclareTransactionResult>;
|
|
5215
5242
|
deploy(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[]): Promise<MultiDeployContractResponse>;
|
|
5216
5243
|
signMessage(typedData: TypedData): Promise<Signature$1>;
|
|
5217
5244
|
static connect(provider: ProviderOptions | ProviderInterface, walletProvider: StarknetWalletProvider, cairoVersion?: CairoVersion, paymaster?: PaymasterOptions | PaymasterInterface, silentMode?: boolean): Promise<WalletAccount>;
|
|
@@ -5241,15 +5268,15 @@ declare class WalletAccountV5 extends Account implements AccountInterface {
|
|
|
5241
5268
|
requestAccounts(silentMode?: boolean): Promise<string[]>;
|
|
5242
5269
|
getPermissions(): Promise<"accounts"[]>;
|
|
5243
5270
|
switchStarknetChain(chainId: _StarknetChainId): Promise<boolean>;
|
|
5244
|
-
watchAsset(asset: WatchAssetParameters
|
|
5245
|
-
addStarknetChain(chain: AddStarknetChainParameters
|
|
5271
|
+
watchAsset(asset: WatchAssetParameters): Promise<boolean>;
|
|
5272
|
+
addStarknetChain(chain: AddStarknetChainParameters): Promise<boolean>;
|
|
5246
5273
|
/**
|
|
5247
5274
|
* ACCOUNT METHODS
|
|
5248
5275
|
*/
|
|
5249
5276
|
execute(calls: AllowArray<Call>): Promise<RPC.AddInvokeTransactionResult>;
|
|
5250
5277
|
declare(payload: DeclareContractPayload): Promise<RPC.AddDeclareTransactionResult>;
|
|
5251
5278
|
deploy(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[]): Promise<MultiDeployContractResponse>;
|
|
5252
|
-
signMessage(typedData: TypedData): Promise<Signature$
|
|
5279
|
+
signMessage(typedData: TypedData): Promise<Signature$1>;
|
|
5253
5280
|
static connect(provider: ProviderInterface, walletProvider: WalletWithStarknetFeatures, cairoVersion?: CairoVersion, paymaster?: PaymasterOptions | PaymasterInterface, silentMode?: boolean): Promise<WalletAccountV5>;
|
|
5254
5281
|
static connectSilent(provider: ProviderInterface, walletProvider: WalletWithStarknetFeatures, cairoVersion?: CairoVersion, paymaster?: PaymasterOptions | PaymasterInterface): Promise<WalletAccountV5>;
|
|
5255
5282
|
}
|
|
@@ -7964,12 +7991,61 @@ declare function getAbiEvents(abi: Abi): AbiEvents;
|
|
|
7964
7991
|
* ```
|
|
7965
7992
|
*/
|
|
7966
7993
|
declare function parseEvents(providerReceivedEvents: EmittedEvent$1[], abiEvents: AbiEvents, abiStructs: AbiStructs, abiEnums: AbiEnums, parser: AbiParserInterface): ParsedEvents;
|
|
7994
|
+
/**
|
|
7995
|
+
* Add getByPath helper method to parsed events array
|
|
7996
|
+
* This method allows finding events by partial key path matching
|
|
7997
|
+
* @param parsedEvents - Array of parsed events to enhance
|
|
7998
|
+
* @returns The same array with getByPath method attached
|
|
7999
|
+
* @example
|
|
8000
|
+
* ```typescript
|
|
8001
|
+
* const events = addGetByPathMethod(parsedEvents);
|
|
8002
|
+
* const transferEvent = events.getByPath('Transfer');
|
|
8003
|
+
* ```
|
|
8004
|
+
*/
|
|
8005
|
+
declare function addGetByPathMethod(parsedEvents: ParsedEvents): ParsedEvents;
|
|
8006
|
+
/**
|
|
8007
|
+
* Extract and prepare emitted events from a transaction receipt
|
|
8008
|
+
* Optionally filters by contract address and enriches with transaction/block metadata
|
|
8009
|
+
* @param receipt - Transaction receipt containing events and metadata
|
|
8010
|
+
* @param contractAddress - Optional contract address to filter events by
|
|
8011
|
+
* @returns Emitted events with transaction and block context, optionally filtered
|
|
8012
|
+
* @example
|
|
8013
|
+
* ```typescript
|
|
8014
|
+
* // Get all emitted events
|
|
8015
|
+
* const allEvents = getEmittedEvents(receipt);
|
|
8016
|
+
*
|
|
8017
|
+
* // Get events from specific contract
|
|
8018
|
+
* const contractEvents = getEmittedEvents(receipt, contractAddress);
|
|
8019
|
+
* ```
|
|
8020
|
+
*/
|
|
8021
|
+
declare function getEmittedEvents(receipt: {
|
|
8022
|
+
events?: Event$2[];
|
|
8023
|
+
transaction_hash: string;
|
|
8024
|
+
block_hash?: string;
|
|
8025
|
+
block_number?: number;
|
|
8026
|
+
}, contractAddress?: string): EmittedEvent$1[];
|
|
8027
|
+
/**
|
|
8028
|
+
* Filter events by contract address
|
|
8029
|
+
* @param events - Array of events to filter (defaults to empty array if undefined)
|
|
8030
|
+
* @param contractAddress - Address to filter by
|
|
8031
|
+
* @returns Filtered events matching the contract address
|
|
8032
|
+
* @example
|
|
8033
|
+
* ```typescript
|
|
8034
|
+
* const myEvents = filterEventsByAddress(allEvents, '0x123...');
|
|
8035
|
+
* ```
|
|
8036
|
+
*/
|
|
8037
|
+
declare function filterEventsByAddress<T extends {
|
|
8038
|
+
from_address: string;
|
|
8039
|
+
}>(events: T[] | undefined, contractAddress: string): T[];
|
|
7967
8040
|
|
|
8041
|
+
declare const index_addGetByPathMethod: typeof addGetByPathMethod;
|
|
8042
|
+
declare const index_filterEventsByAddress: typeof filterEventsByAddress;
|
|
7968
8043
|
declare const index_getAbiEvents: typeof getAbiEvents;
|
|
8044
|
+
declare const index_getEmittedEvents: typeof getEmittedEvents;
|
|
7969
8045
|
declare const index_isAbiEvent: typeof isAbiEvent;
|
|
7970
8046
|
declare const index_parseEvents: typeof parseEvents;
|
|
7971
8047
|
declare namespace index {
|
|
7972
|
-
export { index_getAbiEvents as getAbiEvents, index_isAbiEvent as isAbiEvent, index_parseEvents as parseEvents };
|
|
8048
|
+
export { index_addGetByPathMethod as addGetByPathMethod, index_filterEventsByAddress as filterEventsByAddress, index_getAbiEvents as getAbiEvents, index_getEmittedEvents as getEmittedEvents, index_isAbiEvent as isAbiEvent, index_parseEvents as parseEvents };
|
|
7973
8049
|
}
|
|
7974
8050
|
|
|
7975
8051
|
declare function toOutsideCallV2(call: OutsideCallV1 | OutsideCallV2): OutsideCallV2;
|
|
@@ -9496,73 +9572,73 @@ declare namespace connect {
|
|
|
9496
9572
|
* @param {boolean} [silent_mode=false] false: request user interaction allowance. true: return only pre-allowed
|
|
9497
9573
|
* @returns {Address[]} allowed accounts addresses
|
|
9498
9574
|
*/
|
|
9499
|
-
declare function requestAccounts(walletWSF: WalletWithStarknetFeatures, silent_mode?: boolean): Promise<Address
|
|
9575
|
+
declare function requestAccounts(walletWSF: WalletWithStarknetFeatures, silent_mode?: boolean): Promise<Address[]>;
|
|
9500
9576
|
/**
|
|
9501
9577
|
* Request if DAPP is connected to wallet.
|
|
9502
9578
|
* @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
|
|
9503
9579
|
* @returns {Permission[]} "accounts" if permission granted
|
|
9504
9580
|
*/
|
|
9505
|
-
declare function getPermissions(walletWSF: WalletWithStarknetFeatures): Promise<Permission
|
|
9581
|
+
declare function getPermissions(walletWSF: WalletWithStarknetFeatures): Promise<Permission[]>;
|
|
9506
9582
|
/**
|
|
9507
9583
|
* Request adding an ERC20 Token to the Wallet List
|
|
9508
9584
|
* @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
|
|
9509
9585
|
* @param {WatchAssetParameters} asset description of the token to add.
|
|
9510
9586
|
* @returns {boolean} true if the token was added successfully
|
|
9511
9587
|
*/
|
|
9512
|
-
declare function watchAsset(walletWSF: WalletWithStarknetFeatures, asset: WatchAssetParameters
|
|
9588
|
+
declare function watchAsset(walletWSF: WalletWithStarknetFeatures, asset: WatchAssetParameters): Promise<boolean>;
|
|
9513
9589
|
/**
|
|
9514
9590
|
* Request adding custom Starknet chain
|
|
9515
9591
|
* @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
|
|
9516
9592
|
* @param {AddStarknetChainParameters} chain description of the chain to add.
|
|
9517
9593
|
* @returns {boolean} true if the chain was added successfully
|
|
9518
9594
|
*/
|
|
9519
|
-
declare function addStarknetChain(walletWSF: WalletWithStarknetFeatures, chain: AddStarknetChainParameters
|
|
9595
|
+
declare function addStarknetChain(walletWSF: WalletWithStarknetFeatures, chain: AddStarknetChainParameters): Promise<boolean>;
|
|
9520
9596
|
/**
|
|
9521
9597
|
* Request Wallet Network change
|
|
9522
9598
|
* @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
|
|
9523
9599
|
* @param {ChainId} chainId encoded name of the chain requested.
|
|
9524
9600
|
* @returns {boolean} true if the chain was changed successfully
|
|
9525
9601
|
*/
|
|
9526
|
-
declare function switchStarknetChain(walletWSF: WalletWithStarknetFeatures, chainId: ChainId
|
|
9602
|
+
declare function switchStarknetChain(walletWSF: WalletWithStarknetFeatures, chainId: ChainId): Promise<boolean>;
|
|
9527
9603
|
/**
|
|
9528
9604
|
* Request the current chain ID from the wallet.
|
|
9529
9605
|
* @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
|
|
9530
9606
|
* @returns {ChainId} The current Starknet chain ID.
|
|
9531
9607
|
*/
|
|
9532
|
-
declare function requestChainId(walletWSF: WalletWithStarknetFeatures): Promise<ChainId
|
|
9608
|
+
declare function requestChainId(walletWSF: WalletWithStarknetFeatures): Promise<ChainId>;
|
|
9533
9609
|
/**
|
|
9534
9610
|
* Get deployment data for a contract.
|
|
9535
9611
|
* @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
|
|
9536
9612
|
* @returns {AccountDeploymentData} The deployment data result.
|
|
9537
9613
|
*/
|
|
9538
|
-
declare function deploymentData(walletWSF: WalletWithStarknetFeatures): Promise<AccountDeploymentData
|
|
9614
|
+
declare function deploymentData(walletWSF: WalletWithStarknetFeatures): Promise<AccountDeploymentData>;
|
|
9539
9615
|
/**
|
|
9540
9616
|
* Add an invoke transaction to the wallet.
|
|
9541
9617
|
* @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
|
|
9542
9618
|
* @param {AddInvokeTransactionParameters} params The parameters required for the invoke transaction.
|
|
9543
9619
|
* @returns {AddInvokeTransactionResult} The result of adding the invoke transaction.
|
|
9544
9620
|
*/
|
|
9545
|
-
declare function addInvokeTransaction(walletWSF: WalletWithStarknetFeatures, params: AddInvokeTransactionParameters
|
|
9621
|
+
declare function addInvokeTransaction(walletWSF: WalletWithStarknetFeatures, params: AddInvokeTransactionParameters): Promise<AddInvokeTransactionResult>;
|
|
9546
9622
|
/**
|
|
9547
9623
|
* Add a declare transaction to the wallet.
|
|
9548
9624
|
* @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
|
|
9549
9625
|
* @param {AddDeclareTransactionParameters} params The parameters required for the declare transaction.
|
|
9550
9626
|
* @returns {AddDeclareTransactionResult} The result of adding the declare transaction.
|
|
9551
9627
|
*/
|
|
9552
|
-
declare function addDeclareTransaction(walletWSF: WalletWithStarknetFeatures, params: AddDeclareTransactionParameters
|
|
9628
|
+
declare function addDeclareTransaction(walletWSF: WalletWithStarknetFeatures, params: AddDeclareTransactionParameters): Promise<AddDeclareTransactionResult>;
|
|
9553
9629
|
/**
|
|
9554
9630
|
* Sign typed data using the wallet.
|
|
9555
9631
|
* @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
|
|
9556
9632
|
* @param {TypedData} typedData The typed data to sign.
|
|
9557
9633
|
* @returns {Signature} An array of signatures as strings.
|
|
9558
9634
|
*/
|
|
9559
|
-
declare function signMessage(walletWSF: WalletWithStarknetFeatures, typedData: TypedData
|
|
9635
|
+
declare function signMessage(walletWSF: WalletWithStarknetFeatures, typedData: TypedData): Promise<Signature$1>;
|
|
9560
9636
|
/**
|
|
9561
9637
|
* Get the list of supported Wallet API specifications.
|
|
9562
9638
|
* @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
|
|
9563
9639
|
* @returns {SpecVersion[]} An array of wallet API supported specification strings.
|
|
9564
9640
|
*/
|
|
9565
|
-
declare function supportedSpecs(walletWSF: WalletWithStarknetFeatures): Promise<SpecVersion
|
|
9641
|
+
declare function supportedSpecs(walletWSF: WalletWithStarknetFeatures): Promise<SpecVersion[]>;
|
|
9566
9642
|
/**
|
|
9567
9643
|
* Attaches an event handler function for the changes of network and account.
|
|
9568
9644
|
* When the account/network are changed, the specified callback function will be called.
|
|
@@ -9599,6 +9675,20 @@ declare class Configuration {
|
|
|
9599
9675
|
private constructor();
|
|
9600
9676
|
private initialize;
|
|
9601
9677
|
static getInstance(): Configuration;
|
|
9678
|
+
/**
|
|
9679
|
+
* Get a nested value from an object using a dot-notation path
|
|
9680
|
+
* @param obj - The object to traverse
|
|
9681
|
+
* @param path - The dot-notation path (e.g., 'a.b.c')
|
|
9682
|
+
* @returns The value at the path, or undefined if not found
|
|
9683
|
+
*/
|
|
9684
|
+
private getNestedValue;
|
|
9685
|
+
/**
|
|
9686
|
+
* Set a nested value in an object using a dot-notation path
|
|
9687
|
+
* @param obj - The object to modify
|
|
9688
|
+
* @param path - The dot-notation path (e.g., 'a.b.c')
|
|
9689
|
+
* @param value - The value to set
|
|
9690
|
+
*/
|
|
9691
|
+
private setNestedValue;
|
|
9602
9692
|
get<K extends keyof DefaultConfig>(key: K): DefaultConfig[K];
|
|
9603
9693
|
get(key: string, defaultValue?: any): any;
|
|
9604
9694
|
set<K extends keyof DefaultConfig>(key: K, value: DefaultConfig[K]): void;
|