starknet 9.0.0 → 9.1.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 CHANGED
@@ -1,3 +1,15 @@
1
+ # [9.1.0](https://github.com/starknet-io/starknet.js/compare/v9.0.0...v9.1.0) (2025-12-08)
2
+
3
+ ### Bug Fixes
4
+
5
+ - buildUDCCall ([9212f32](https://github.com/starknet-io/starknet.js/commit/9212f32297f09d74093a98c10419d1c4b04f0eb4))
6
+ - bump to starknet types 10 ([7ffb4be](https://github.com/starknet-io/starknet.js/commit/7ffb4be6f86c1af3bab05796cd09a726c9176095))
7
+ - package-lock ([ffc50a7](https://github.com/starknet-io/starknet.js/commit/ffc50a788036467ee006fcd12aea06c0c2fcce48))
8
+
9
+ ### Features
10
+
11
+ - handling of get-starknet v5 ([b297d71](https://github.com/starknet-io/starknet.js/commit/b297d7199c018fe8394b867731393e0813f13483))
12
+
1
13
  # [9.0.0](https://github.com/starknet-io/starknet.js/compare/v8.9.2...v9.0.0) (2025-12-08)
2
14
 
3
15
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -2,14 +2,16 @@ import * as RPC$1 from '@starknet-io/starknet-types-09';
2
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
3
  export { StarknetDomain, StarknetEnumType, StarknetMerkleType, StarknetType, TypedData, TypedDataRevision } from '@starknet-io/starknet-types-09';
4
4
  import * as RPC from '@starknet-io/starknet-types-010';
5
- import { PAYMASTER_API } from '@starknet-io/starknet-types-010';
5
+ import { PAYMASTER_API, WatchAssetParameters as WatchAssetParameters$1, AddStarknetChainParameters as AddStarknetChainParameters$1, Signature as Signature$2, Address as Address$1, Permission as Permission$1, ChainId as ChainId$1, AccountDeploymentData as AccountDeploymentData$1, AddInvokeTransactionParameters as AddInvokeTransactionParameters$1, AddInvokeTransactionResult as AddInvokeTransactionResult$1, AddDeclareTransactionParameters as AddDeclareTransactionParameters$1, AddDeclareTransactionResult as AddDeclareTransactionResult$1, TypedData as TypedData$1, SpecVersion as SpecVersion$1 } from '@starknet-io/starknet-types-010';
6
6
  import { Abi as Abi$1, TypedContract } from 'abi-wan-kanabi';
7
7
  import * as weierstrass from '@noble/curves/abstract/weierstrass';
8
8
  import { RecoveredSignatureType } from '@noble/curves/abstract/weierstrass';
9
9
  import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
10
+ import { WalletWithStarknetFeatures, StandardEventsChangeProperties } from '@starknet-io/get-starknet-wallet-standard/features';
10
11
  import * as poseidon from '@noble/curves/abstract/poseidon';
11
12
  import * as json$1 from 'lossless-json';
12
13
  import * as starknet from '@scure/starknet';
14
+ import { StandardEventsChangeProperties as StandardEventsChangeProperties$1 } from '@wallet-standard/features';
13
15
 
14
16
  declare const ec_weierstrass: typeof weierstrass;
15
17
  declare namespace ec {
@@ -5174,17 +5176,24 @@ declare class Account extends RpcProvider implements AccountInterface {
5174
5176
 
5175
5177
  interface StarknetWalletProvider extends StarknetWindowObject {
5176
5178
  }
5177
- type WalletAccountOptions = {
5179
+ type WalletAccountV4Options = {
5178
5180
  provider: ProviderOptions | ProviderInterface;
5179
5181
  walletProvider: StarknetWalletProvider;
5180
5182
  address: string;
5181
5183
  cairoVersion?: CairoVersion;
5182
5184
  paymaster?: PaymasterOptions | PaymasterInterface;
5183
5185
  };
5186
+ type WalletAccountV5Options = {
5187
+ provider: ProviderOptions | ProviderInterface;
5188
+ walletProvider: WalletWithStarknetFeatures;
5189
+ address: string;
5190
+ cairoVersion?: CairoVersion;
5191
+ paymaster?: PaymasterOptions | PaymasterInterface;
5192
+ };
5184
5193
 
5185
5194
  declare class WalletAccount extends Account implements AccountInterface {
5186
5195
  walletProvider: StarknetWalletProvider;
5187
- constructor(options: WalletAccountOptions);
5196
+ constructor(options: WalletAccountV4Options);
5188
5197
  /**
5189
5198
  * WALLET EVENTS
5190
5199
  */
@@ -5209,6 +5218,42 @@ declare class WalletAccount extends Account implements AccountInterface {
5209
5218
  static connectSilent(provider: ProviderInterface, walletProvider: StarknetWalletProvider, cairoVersion?: CairoVersion, paymaster?: PaymasterOptions | PaymasterInterface): Promise<WalletAccount>;
5210
5219
  }
5211
5220
 
5221
+ /**
5222
+ * WalletAccountV5 class.
5223
+ * This class is used to create a wallet account that can be used to interact with a Starknet wallet browser extension, using get-starknet v5.
5224
+ */
5225
+ declare class WalletAccountV5 extends Account implements AccountInterface {
5226
+ walletProvider: WalletWithStarknetFeatures;
5227
+ /**
5228
+ * The function to use to unsubscribe from the wallet events.
5229
+ * To call before the instance is deleted.
5230
+ */
5231
+ private unsubscribe;
5232
+ constructor(options: WalletAccountV5Options);
5233
+ /**
5234
+ * WALLET EVENTS
5235
+ */
5236
+ onChange(callback: (change: StandardEventsChangeProperties) => void): void;
5237
+ unsubscribeChange(): void;
5238
+ /**
5239
+ * WALLET SPECIFIC METHODS
5240
+ */
5241
+ requestAccounts(silentMode?: boolean): Promise<string[]>;
5242
+ getPermissions(): Promise<"accounts"[]>;
5243
+ switchStarknetChain(chainId: _StarknetChainId): Promise<boolean>;
5244
+ watchAsset(asset: WatchAssetParameters$1): Promise<boolean>;
5245
+ addStarknetChain(chain: AddStarknetChainParameters$1): Promise<boolean>;
5246
+ /**
5247
+ * ACCOUNT METHODS
5248
+ */
5249
+ execute(calls: AllowArray<Call>): Promise<RPC.AddInvokeTransactionResult>;
5250
+ declare(payload: DeclareContractPayload): Promise<RPC.AddDeclareTransactionResult>;
5251
+ deploy(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[]): Promise<MultiDeployContractResponse>;
5252
+ signMessage(typedData: TypedData): Promise<Signature$2>;
5253
+ static connect(provider: ProviderInterface, walletProvider: WalletWithStarknetFeatures, cairoVersion?: CairoVersion, paymaster?: PaymasterOptions | PaymasterInterface, silentMode?: boolean): Promise<WalletAccountV5>;
5254
+ static connectSilent(provider: ProviderInterface, walletProvider: WalletWithStarknetFeatures, cairoVersion?: CairoVersion, paymaster?: PaymasterOptions | PaymasterInterface): Promise<WalletAccountV5>;
5255
+ }
5256
+
5212
5257
  declare module 'abi-wan-kanabi' {
5213
5258
  interface Config<OptionT = any, ResultT = any, ErrorT = any> {
5214
5259
  FeltType: BigNumberish;
@@ -9362,64 +9407,64 @@ declare function units(amount: string | bigint, simbol?: 'fri' | 'strk'): string
9362
9407
  * @param {boolean} [silent_mode=false] false: request user interaction allowance. true: return only pre-allowed
9363
9408
  * @returns allowed accounts addresses
9364
9409
  */
9365
- declare function requestAccounts(swo: StarknetWindowObject, silent_mode?: boolean): Promise<Address[]>;
9410
+ declare function requestAccounts$1(swo: StarknetWindowObject, silent_mode?: boolean): Promise<Address[]>;
9366
9411
  /**
9367
9412
  * Request Permission for wallet account
9368
9413
  * @returns allowed accounts addresses
9369
9414
  */
9370
- declare function getPermissions(swo: StarknetWindowObject): Promise<Permission[]>;
9415
+ declare function getPermissions$1(swo: StarknetWindowObject): Promise<Permission[]>;
9371
9416
  /**
9372
9417
  * Request adding ERC20 Token to Wallet List
9373
9418
  * @param asset WatchAssetParameters
9374
9419
  * @returns boolean
9375
9420
  */
9376
- declare function watchAsset(swo: StarknetWindowObject, asset: WatchAssetParameters): Promise<boolean>;
9421
+ declare function watchAsset$1(swo: StarknetWindowObject, asset: WatchAssetParameters): Promise<boolean>;
9377
9422
  /**
9378
9423
  * Request adding custom Starknet chain
9379
9424
  * @param chain AddStarknetChainParameters
9380
9425
  * @returns boolean
9381
9426
  */
9382
- declare function addStarknetChain(swo: StarknetWindowObject, chain: AddStarknetChainParameters): Promise<boolean>;
9427
+ declare function addStarknetChain$1(swo: StarknetWindowObject, chain: AddStarknetChainParameters): Promise<boolean>;
9383
9428
  /**
9384
9429
  * Request Wallet Network change
9385
9430
  * @param chainId StarknetChainId
9386
9431
  * @returns boolean
9387
9432
  */
9388
- declare function switchStarknetChain(swo: StarknetWindowObject, chainId: ChainId): Promise<boolean>;
9433
+ declare function switchStarknetChain$1(swo: StarknetWindowObject, chainId: ChainId): Promise<boolean>;
9389
9434
  /**
9390
9435
  * Request the current chain ID from the wallet.
9391
9436
  * @returns The current Starknet chain ID.
9392
9437
  */
9393
- declare function requestChainId(swo: StarknetWindowObject): Promise<ChainId>;
9438
+ declare function requestChainId$1(swo: StarknetWindowObject): Promise<ChainId>;
9394
9439
  /**
9395
9440
  * Get deployment data for a contract.
9396
9441
  * @returns The deployment data result.
9397
9442
  */
9398
- declare function deploymentData(swo: StarknetWindowObject): Promise<AccountDeploymentData>;
9443
+ declare function deploymentData$1(swo: StarknetWindowObject): Promise<AccountDeploymentData>;
9399
9444
  /**
9400
9445
  * Add an invoke transaction to the wallet.
9401
9446
  * @param params The parameters required for the invoke transaction.
9402
9447
  * @returns The result of adding the invoke transaction.
9403
9448
  */
9404
- declare function addInvokeTransaction(swo: StarknetWindowObject, params: AddInvokeTransactionParameters): Promise<AddInvokeTransactionResult>;
9449
+ declare function addInvokeTransaction$1(swo: StarknetWindowObject, params: AddInvokeTransactionParameters): Promise<AddInvokeTransactionResult>;
9405
9450
  /**
9406
9451
  * Add a declare transaction to the wallet.
9407
9452
  * @param params The parameters required for the declare transaction.
9408
9453
  * @returns The result of adding the declare transaction.
9409
9454
  */
9410
- declare function addDeclareTransaction(swo: StarknetWindowObject, params: AddDeclareTransactionParameters): Promise<AddDeclareTransactionResult>;
9455
+ declare function addDeclareTransaction$1(swo: StarknetWindowObject, params: AddDeclareTransactionParameters): Promise<AddDeclareTransactionResult>;
9411
9456
  /**
9412
9457
  * Sign typed data using the wallet.
9413
9458
  * @param swo the starknet (wallet) window object to request the signature.
9414
9459
  * @param typedData The typed data to sign.
9415
9460
  * @returns An array of signatures as strings.
9416
9461
  */
9417
- declare function signMessage(swo: StarknetWindowObject, typedData: TypedData): Promise<Signature$1>;
9462
+ declare function signMessage$1(swo: StarknetWindowObject, typedData: TypedData): Promise<Signature$1>;
9418
9463
  /**
9419
9464
  * Get the list of supported specifications.
9420
9465
  * @returns An array of supported specification strings.
9421
9466
  */
9422
- declare function supportedSpecs(swo: StarknetWindowObject): Promise<SpecVersion[]>;
9467
+ declare function supportedSpecs$1(swo: StarknetWindowObject): Promise<SpecVersion[]>;
9423
9468
  /**
9424
9469
  * Attaches an event handler function to the "accountsChanged" event of a StarknetWindowObject.
9425
9470
  * When the accounts are changed, the specified callback function will be called.
@@ -9439,21 +9484,108 @@ declare function onAccountChange(swo: StarknetWindowObject, callback: AccountCha
9439
9484
  */
9440
9485
  declare function onNetworkChanged(swo: StarknetWindowObject, callback: NetworkChangeEventHandler): void;
9441
9486
 
9442
- declare const connect_addDeclareTransaction: typeof addDeclareTransaction;
9443
- declare const connect_addInvokeTransaction: typeof addInvokeTransaction;
9444
- declare const connect_addStarknetChain: typeof addStarknetChain;
9445
- declare const connect_deploymentData: typeof deploymentData;
9446
- declare const connect_getPermissions: typeof getPermissions;
9447
9487
  declare const connect_onAccountChange: typeof onAccountChange;
9448
9488
  declare const connect_onNetworkChanged: typeof onNetworkChanged;
9449
- declare const connect_requestAccounts: typeof requestAccounts;
9450
- declare const connect_requestChainId: typeof requestChainId;
9451
- declare const connect_signMessage: typeof signMessage;
9452
- declare const connect_supportedSpecs: typeof supportedSpecs;
9453
- declare const connect_switchStarknetChain: typeof switchStarknetChain;
9454
- declare const connect_watchAsset: typeof watchAsset;
9455
9489
  declare namespace connect {
9456
- export { connect_addDeclareTransaction as addDeclareTransaction, connect_addInvokeTransaction as addInvokeTransaction, connect_addStarknetChain as addStarknetChain, connect_deploymentData as deploymentData, connect_getPermissions as getPermissions, connect_onAccountChange as onAccountChange, connect_onNetworkChanged as onNetworkChanged, connect_requestAccounts as requestAccounts, connect_requestChainId as requestChainId, connect_signMessage as signMessage, connect_supportedSpecs as supportedSpecs, connect_switchStarknetChain as switchStarknetChain, connect_watchAsset as watchAsset };
9490
+ export { addDeclareTransaction$1 as addDeclareTransaction, addInvokeTransaction$1 as addInvokeTransaction, addStarknetChain$1 as addStarknetChain, deploymentData$1 as deploymentData, getPermissions$1 as getPermissions, connect_onAccountChange as onAccountChange, connect_onNetworkChanged as onNetworkChanged, requestAccounts$1 as requestAccounts, requestChainId$1 as requestChainId, signMessage$1 as signMessage, supportedSpecs$1 as supportedSpecs, switchStarknetChain$1 as switchStarknetChain, watchAsset$1 as watchAsset };
9491
+ }
9492
+
9493
+ /**
9494
+ * Request Permission for wallet account, return addresses that are allowed by user
9495
+ * @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
9496
+ * @param {boolean} [silent_mode=false] false: request user interaction allowance. true: return only pre-allowed
9497
+ * @returns {Address[]} allowed accounts addresses
9498
+ */
9499
+ declare function requestAccounts(walletWSF: WalletWithStarknetFeatures, silent_mode?: boolean): Promise<Address$1[]>;
9500
+ /**
9501
+ * Request if DAPP is connected to wallet.
9502
+ * @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
9503
+ * @returns {Permission[]} "accounts" if permission granted
9504
+ */
9505
+ declare function getPermissions(walletWSF: WalletWithStarknetFeatures): Promise<Permission$1[]>;
9506
+ /**
9507
+ * Request adding an ERC20 Token to the Wallet List
9508
+ * @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
9509
+ * @param {WatchAssetParameters} asset description of the token to add.
9510
+ * @returns {boolean} true if the token was added successfully
9511
+ */
9512
+ declare function watchAsset(walletWSF: WalletWithStarknetFeatures, asset: WatchAssetParameters$1): Promise<boolean>;
9513
+ /**
9514
+ * Request adding custom Starknet chain
9515
+ * @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
9516
+ * @param {AddStarknetChainParameters} chain description of the chain to add.
9517
+ * @returns {boolean} true if the chain was added successfully
9518
+ */
9519
+ declare function addStarknetChain(walletWSF: WalletWithStarknetFeatures, chain: AddStarknetChainParameters$1): Promise<boolean>;
9520
+ /**
9521
+ * Request Wallet Network change
9522
+ * @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
9523
+ * @param {ChainId} chainId encoded name of the chain requested.
9524
+ * @returns {boolean} true if the chain was changed successfully
9525
+ */
9526
+ declare function switchStarknetChain(walletWSF: WalletWithStarknetFeatures, chainId: ChainId$1): Promise<boolean>;
9527
+ /**
9528
+ * Request the current chain ID from the wallet.
9529
+ * @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
9530
+ * @returns {ChainId} The current Starknet chain ID.
9531
+ */
9532
+ declare function requestChainId(walletWSF: WalletWithStarknetFeatures): Promise<ChainId$1>;
9533
+ /**
9534
+ * Get deployment data for a contract.
9535
+ * @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
9536
+ * @returns {AccountDeploymentData} The deployment data result.
9537
+ */
9538
+ declare function deploymentData(walletWSF: WalletWithStarknetFeatures): Promise<AccountDeploymentData$1>;
9539
+ /**
9540
+ * Add an invoke transaction to the wallet.
9541
+ * @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
9542
+ * @param {AddInvokeTransactionParameters} params The parameters required for the invoke transaction.
9543
+ * @returns {AddInvokeTransactionResult} The result of adding the invoke transaction.
9544
+ */
9545
+ declare function addInvokeTransaction(walletWSF: WalletWithStarknetFeatures, params: AddInvokeTransactionParameters$1): Promise<AddInvokeTransactionResult$1>;
9546
+ /**
9547
+ * Add a declare transaction to the wallet.
9548
+ * @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
9549
+ * @param {AddDeclareTransactionParameters} params The parameters required for the declare transaction.
9550
+ * @returns {AddDeclareTransactionResult} The result of adding the declare transaction.
9551
+ */
9552
+ declare function addDeclareTransaction(walletWSF: WalletWithStarknetFeatures, params: AddDeclareTransactionParameters$1): Promise<AddDeclareTransactionResult$1>;
9553
+ /**
9554
+ * Sign typed data using the wallet.
9555
+ * @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
9556
+ * @param {TypedData} typedData The typed data to sign.
9557
+ * @returns {Signature} An array of signatures as strings.
9558
+ */
9559
+ declare function signMessage(walletWSF: WalletWithStarknetFeatures, typedData: TypedData$1): Promise<Signature$2>;
9560
+ /**
9561
+ * Get the list of supported Wallet API specifications.
9562
+ * @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
9563
+ * @returns {SpecVersion[]} An array of wallet API supported specification strings.
9564
+ */
9565
+ declare function supportedSpecs(walletWSF: WalletWithStarknetFeatures): Promise<SpecVersion$1[]>;
9566
+ /**
9567
+ * Attaches an event handler function for the changes of network and account.
9568
+ * When the account/network are changed, the specified callback function will be called.
9569
+ * @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
9570
+ * @param {StandardEventsChangeProperties} callback - The function to be called when the account/network are changed.
9571
+ * @returns {() => void} function to execute to unsubscribe events.
9572
+ */
9573
+ declare function subscribeWalletEvent(walletWSF: WalletWithStarknetFeatures, callback: (change: StandardEventsChangeProperties$1) => void): () => void;
9574
+
9575
+ declare const connectV5_addDeclareTransaction: typeof addDeclareTransaction;
9576
+ declare const connectV5_addInvokeTransaction: typeof addInvokeTransaction;
9577
+ declare const connectV5_addStarknetChain: typeof addStarknetChain;
9578
+ declare const connectV5_deploymentData: typeof deploymentData;
9579
+ declare const connectV5_getPermissions: typeof getPermissions;
9580
+ declare const connectV5_requestAccounts: typeof requestAccounts;
9581
+ declare const connectV5_requestChainId: typeof requestChainId;
9582
+ declare const connectV5_signMessage: typeof signMessage;
9583
+ declare const connectV5_subscribeWalletEvent: typeof subscribeWalletEvent;
9584
+ declare const connectV5_supportedSpecs: typeof supportedSpecs;
9585
+ declare const connectV5_switchStarknetChain: typeof switchStarknetChain;
9586
+ declare const connectV5_watchAsset: typeof watchAsset;
9587
+ declare namespace connectV5 {
9588
+ export { connectV5_addDeclareTransaction as addDeclareTransaction, connectV5_addInvokeTransaction as addInvokeTransaction, connectV5_addStarknetChain as addStarknetChain, connectV5_deploymentData as deploymentData, connectV5_getPermissions as getPermissions, connectV5_requestAccounts as requestAccounts, connectV5_requestChainId as requestChainId, connectV5_signMessage as signMessage, connectV5_subscribeWalletEvent as subscribeWalletEvent, connectV5_supportedSpecs as supportedSpecs, connectV5_switchStarknetChain as switchStarknetChain, connectV5_watchAsset as watchAsset };
9457
9589
  }
9458
9590
 
9459
9591
  type DefaultConfig = typeof DEFAULT_GLOBAL_CONFIG;
@@ -9543,4 +9675,4 @@ declare class Logger {
9543
9675
  */
9544
9676
  declare const logger: Logger;
9545
9677
 
9546
- 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, CairoBytes31, type CairoContract, CairoCustomEnum, type CairoEnum, type CairoEnumRaw, type CairoEvent, type CairoEventDefinition, type CairoEventVariant, CairoFelt, CairoFelt252, CairoFixedArray, CairoInt128, CairoInt16, CairoInt32, CairoInt64, CairoInt8, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoUint128, CairoUint16, CairoUint256, CairoUint32, 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 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 PreConfirmedBlock, 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_10_0 as RPC010, 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, compareVersions, config, constants, contractClassResponseToLegacyCompiledContract, createAbiParser, createTransactionReceipt, defaultDeployer, defaultPaymaster, defaultProvider, ec, encode, eth, index as events, extractContractHashes, type fastExecuteResponse, fastParsingStrategy, type fastWaitForTransactionOptions, getAbiVersion, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, getGasPrices, getLedgerPathBuffer111 as getLedgerPathBuffer, getLedgerPathBuffer111, getLedgerPathBuffer221, type getSimulateTransactionOptions, getTipStatsFromBlocks, index$3 as hash, hdParsingStrategy, isAccount, isNoConstructorValid, isPreConfirmedBlock, isPreConfirmedStateUpdate, isPreConfirmedTransaction, 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 };
9678
+ 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, CairoBytes31, type CairoContract, CairoCustomEnum, type CairoEnum, type CairoEnumRaw, type CairoEvent, type CairoEventDefinition, type CairoEventVariant, CairoFelt, CairoFelt252, CairoFixedArray, CairoInt128, CairoInt16, CairoInt32, CairoInt64, CairoInt8, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoUint128, CairoUint16, CairoUint256, CairoUint32, 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 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 PreConfirmedBlock, 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_10_0 as RPC010, 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, WalletAccountV5, WebSocketChannel, type WebSocketModule, WebSocketNotConnectedError, type WebSocketOptions, type WeierstrassSignatureType, type WithOptions, addAddressPadding, byteArray, cairo, compareVersions, config, constants, contractClassResponseToLegacyCompiledContract, createAbiParser, createTransactionReceipt, defaultDeployer, defaultPaymaster, defaultProvider, ec, encode, eth, index as events, extractContractHashes, type fastExecuteResponse, fastParsingStrategy, type fastWaitForTransactionOptions, getAbiVersion, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, getGasPrices, getLedgerPathBuffer111 as getLedgerPathBuffer, getLedgerPathBuffer111, getLedgerPathBuffer221, type getSimulateTransactionOptions, getTipStatsFromBlocks, index$3 as hash, hdParsingStrategy, isAccount, isNoConstructorValid, isPreConfirmedBlock, isPreConfirmedStateUpdate, isPreConfirmedTransaction, 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, connectV5 as walletV5 };
@@ -113,6 +113,7 @@ var starknet = (() => {
113
113
  Uint: () => Uint,
114
114
  ValidateType: () => ValidateType,
115
115
  WalletAccount: () => WalletAccount,
116
+ WalletAccountV5: () => WalletAccountV5,
116
117
  WebSocketChannel: () => WebSocketChannel,
117
118
  WebSocketNotConnectedError: () => WebSocketNotConnectedError,
118
119
  addAddressPadding: () => addAddressPadding,
@@ -178,7 +179,8 @@ var starknet = (() => {
178
179
  validateAndParseAddress: () => validateAndParseAddress,
179
180
  validateChecksumAddress: () => validateChecksumAddress,
180
181
  verifyMessageInStarknet: () => verifyMessageInStarknet,
181
- wallet: () => connect_exports
182
+ wallet: () => connect_exports,
183
+ walletV5: () => connectV5_exports
182
184
  });
183
185
 
184
186
  // src/global/constants.ts
@@ -21403,6 +21405,188 @@ ${indent}}` : "}";
21403
21405
  // TODO: MISSING ESTIMATES
21404
21406
  };
21405
21407
 
21408
+ // src/wallet/connectV5.ts
21409
+ var connectV5_exports = {};
21410
+ __export(connectV5_exports, {
21411
+ addDeclareTransaction: () => addDeclareTransaction2,
21412
+ addInvokeTransaction: () => addInvokeTransaction2,
21413
+ addStarknetChain: () => addStarknetChain2,
21414
+ deploymentData: () => deploymentData2,
21415
+ getPermissions: () => getPermissions2,
21416
+ requestAccounts: () => requestAccounts2,
21417
+ requestChainId: () => requestChainId2,
21418
+ signMessage: () => signMessage2,
21419
+ subscribeWalletEvent: () => subscribeWalletEvent,
21420
+ supportedSpecs: () => supportedSpecs2,
21421
+ switchStarknetChain: () => switchStarknetChain2,
21422
+ watchAsset: () => watchAsset2
21423
+ });
21424
+ function requestAccounts2(walletWSF, silent_mode = false) {
21425
+ return walletWSF.features["starknet:walletApi"].request({
21426
+ type: "wallet_requestAccounts",
21427
+ params: { silent_mode }
21428
+ });
21429
+ }
21430
+ function getPermissions2(walletWSF) {
21431
+ return walletWSF.features["starknet:walletApi"].request({ type: "wallet_getPermissions" });
21432
+ }
21433
+ function watchAsset2(walletWSF, asset) {
21434
+ return walletWSF.features["starknet:walletApi"].request({
21435
+ type: "wallet_watchAsset",
21436
+ params: asset
21437
+ });
21438
+ }
21439
+ function addStarknetChain2(walletWSF, chain2) {
21440
+ return walletWSF.features["starknet:walletApi"].request({
21441
+ type: "wallet_addStarknetChain",
21442
+ params: chain2
21443
+ });
21444
+ }
21445
+ function switchStarknetChain2(walletWSF, chainId) {
21446
+ return walletWSF.features["starknet:walletApi"].request({
21447
+ type: "wallet_switchStarknetChain",
21448
+ params: { chainId }
21449
+ });
21450
+ }
21451
+ function requestChainId2(walletWSF) {
21452
+ return walletWSF.features["starknet:walletApi"].request({ type: "wallet_requestChainId" });
21453
+ }
21454
+ function deploymentData2(walletWSF) {
21455
+ return walletWSF.features["starknet:walletApi"].request({ type: "wallet_deploymentData" });
21456
+ }
21457
+ function addInvokeTransaction2(walletWSF, params) {
21458
+ return walletWSF.features["starknet:walletApi"].request({
21459
+ type: "wallet_addInvokeTransaction",
21460
+ params
21461
+ });
21462
+ }
21463
+ function addDeclareTransaction2(walletWSF, params) {
21464
+ return walletWSF.features["starknet:walletApi"].request({
21465
+ type: "wallet_addDeclareTransaction",
21466
+ params
21467
+ });
21468
+ }
21469
+ function signMessage2(walletWSF, typedData) {
21470
+ return walletWSF.features["starknet:walletApi"].request({
21471
+ type: "wallet_signTypedData",
21472
+ params: typedData
21473
+ });
21474
+ }
21475
+ function supportedSpecs2(walletWSF) {
21476
+ return walletWSF.features["starknet:walletApi"].request({ type: "wallet_supportedSpecs" });
21477
+ }
21478
+ function subscribeWalletEvent(walletWSF, callback) {
21479
+ return walletWSF.features["standard:events"].on("change", callback);
21480
+ }
21481
+
21482
+ // src/wallet/accountV5.ts
21483
+ var WalletAccountV5 = class _WalletAccountV5 extends Account {
21484
+ walletProvider;
21485
+ /**
21486
+ * The function to use to unsubscribe from the wallet events.
21487
+ * To call before the instance is deleted.
21488
+ */
21489
+ unsubscribe;
21490
+ constructor(options) {
21491
+ super({ ...options, signer: "" });
21492
+ this.walletProvider = options.walletProvider;
21493
+ this.unsubscribe = this.walletProvider.features["standard:events"].on(
21494
+ "change",
21495
+ (change) => {
21496
+ if (!change.accounts?.length) return;
21497
+ if (change.accounts[0].address) this.address = change.accounts[0].address;
21498
+ if (change.accounts[0].chains)
21499
+ this.channel.setChainId(change.accounts[0].chains[0].slice(9));
21500
+ }
21501
+ );
21502
+ }
21503
+ /**
21504
+ * WALLET EVENTS
21505
+ */
21506
+ onChange(callback) {
21507
+ subscribeWalletEvent(this.walletProvider, callback);
21508
+ }
21509
+ unsubscribeChange() {
21510
+ this.unsubscribe();
21511
+ }
21512
+ /**
21513
+ * WALLET SPECIFIC METHODS
21514
+ */
21515
+ requestAccounts(silentMode = false) {
21516
+ return requestAccounts2(this.walletProvider, silentMode);
21517
+ }
21518
+ getPermissions() {
21519
+ return getPermissions2(this.walletProvider);
21520
+ }
21521
+ switchStarknetChain(chainId) {
21522
+ return switchStarknetChain2(this.walletProvider, chainId);
21523
+ }
21524
+ watchAsset(asset) {
21525
+ return watchAsset2(this.walletProvider, asset);
21526
+ }
21527
+ addStarknetChain(chain2) {
21528
+ return addStarknetChain2(this.walletProvider, chain2);
21529
+ }
21530
+ /**
21531
+ * ACCOUNT METHODS
21532
+ */
21533
+ execute(calls) {
21534
+ const txCalls = [].concat(calls).map((it) => {
21535
+ const { contractAddress, entrypoint, calldata } = it;
21536
+ return {
21537
+ contract_address: contractAddress,
21538
+ entry_point: entrypoint,
21539
+ calldata
21540
+ };
21541
+ });
21542
+ const params = {
21543
+ calls: txCalls
21544
+ };
21545
+ return addInvokeTransaction2(this.walletProvider, params);
21546
+ }
21547
+ declare(payload) {
21548
+ const declareContractPayload = extractContractHashes(payload);
21549
+ const pContract = payload.contract;
21550
+ const cairo1Contract = {
21551
+ ...pContract,
21552
+ abi: stringify2(pContract.abi)
21553
+ };
21554
+ if (!declareContractPayload.compiledClassHash) {
21555
+ throw Error("compiledClassHash is required");
21556
+ }
21557
+ const params = {
21558
+ compiled_class_hash: declareContractPayload.compiledClassHash,
21559
+ contract_class: cairo1Contract
21560
+ };
21561
+ return addDeclareTransaction2(this.walletProvider, params);
21562
+ }
21563
+ async deploy(payload) {
21564
+ const { calls, addresses } = defaultDeployer.buildDeployerCall(payload, this.address);
21565
+ const invokeResponse = await this.execute(calls);
21566
+ return {
21567
+ ...invokeResponse,
21568
+ contract_address: addresses
21569
+ };
21570
+ }
21571
+ signMessage(typedData) {
21572
+ return signMessage2(this.walletProvider, typedData);
21573
+ }
21574
+ static async connect(provider, walletProvider, cairoVersion, paymaster, silentMode = false) {
21575
+ const [accountAddress] = await requestAccounts2(walletProvider, silentMode);
21576
+ return new _WalletAccountV5({
21577
+ provider,
21578
+ walletProvider,
21579
+ address: accountAddress,
21580
+ cairoVersion,
21581
+ paymaster
21582
+ });
21583
+ }
21584
+ static async connectSilent(provider, walletProvider, cairoVersion, paymaster) {
21585
+ return _WalletAccountV5.connect(provider, walletProvider, cairoVersion, paymaster, true);
21586
+ }
21587
+ // TODO: MISSING ESTIMATES
21588
+ };
21589
+
21406
21590
  // src/utils/events/index.ts
21407
21591
  var events_exports = {};
21408
21592
  __export(events_exports, {