starknet 10.5.3 → 10.6.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 +190 -21
- package/dist/index.global.js +119 -12
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +119 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +119 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [10.6.1](https://github.com/starknet-io/starknet.js/compare/v10.6.0...v10.6.1) (2026-07-30)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- memory leak2 ([a23f59f](https://github.com/starknet-io/starknet.js/commit/a23f59f3915847d8bbfab677d1ad711c3630c0f3))
|
|
6
|
+
- ws memory leak ([b7a6ba6](https://github.com/starknet-io/starknet.js/commit/b7a6ba662f1923d5036040b19ea6da302eb3d6ae))
|
|
7
|
+
- ws-bound request-queue draining to prevent OOM on reconnect ([0e6f7c1](https://github.com/starknet-io/starknet.js/commit/0e6f7c14050cda982dd8ed3cb231a9fd55554bdc))
|
|
8
|
+
|
|
9
|
+
# [10.6.0](https://github.com/starknet-io/starknet.js/compare/v10.5.3...v10.6.0) (2026-07-29)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- sub-account handling ([62ec03c](https://github.com/starknet-io/starknet.js/commit/62ec03c84cfa6f3066b516aa1f4e2d1caaa58444))
|
|
14
|
+
|
|
1
15
|
## [10.5.3](https://github.com/starknet-io/starknet.js/compare/v10.5.2...v10.5.3) (2026-07-27)
|
|
2
16
|
|
|
3
17
|
### Bug Fixes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import * as RPCSPEC0103 from '@starknet-io/starknet-types-0103';
|
|
2
|
-
import { PAYMASTER_API, CONTRACT, EDataAvailabilityMode as EDataAvailabilityMode$1, ETransactionType, SUBSCRIPTION_BLOCK_ID, TypedData, CONTRACT_STORAGE_KEYS, StorageProof, CASM_COMPILED_CONTRACT_CLASS, OutsideExecutionTypedData, ETransactionVersion3 as ETransactionVersion3$1, IsType, TransactionReceipt as TransactionReceipt$1, IsSucceeded, IsReverted, BLOCK_WITH_TX_HASHES, PRE_CONFIRMED_BLOCK_WITH_TX_HASHES, 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, STORAGE_RESULT, INVOKE_TXN_V3, StarknetWindowObject, AccountChangeEventHandler, NetworkChangeEventHandler, WatchAssetParameters, AddStarknetChainParameters, Signature as Signature$1,
|
|
3
|
-
export {
|
|
2
|
+
import { PAYMASTER_API, CONTRACT, EDataAvailabilityMode as EDataAvailabilityMode$1, ETransactionType, SUBSCRIPTION_BLOCK_ID, TypedData, CONTRACT_STORAGE_KEYS, StorageProof, CASM_COMPILED_CONTRACT_CLASS, OutsideExecutionTypedData, ETransactionVersion3 as ETransactionVersion3$1, IsType, TransactionReceipt as TransactionReceipt$1, IsSucceeded, IsReverted, BLOCK_WITH_TX_HASHES, PRE_CONFIRMED_BLOCK_WITH_TX_HASHES, 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, STORAGE_RESULT, INVOKE_TXN_V3, 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 as Address$1, Permission, ChainId, AccountDeploymentData, AddInvokeTransactionParameters, AddInvokeTransactionResult, AddDeclareTransactionParameters, AddDeclareTransactionResult, SpecVersion, API_VERSION as API_VERSION$1 } from '@starknet-io/starknet-types-0103';
|
|
3
|
+
export { StarknetDomain, StarknetEnumType, StarknetMerkleType, StarknetType, TypedData, TypedDataRevision } from '@starknet-io/starknet-types-0103';
|
|
4
4
|
import * as RPC$1 from '@starknet-io/starknet-types-0101';
|
|
5
|
-
import { WatchAssetParameters as WatchAssetParameters$1, AddStarknetChainParameters as AddStarknetChainParameters$1, Signature as Signature$2, Address as Address$
|
|
5
|
+
import { WatchAssetParameters as WatchAssetParameters$1, AddStarknetChainParameters as AddStarknetChainParameters$1, Signature as Signature$2, Address as Address$2, 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, API_VERSION as API_VERSION$2 } from '@starknet-io/starknet-types-0101';
|
|
6
6
|
import * as weierstrass from '@noble/curves/abstract/weierstrass';
|
|
7
7
|
import { RecoveredSignatureType } from '@noble/curves/abstract/weierstrass';
|
|
8
8
|
import * as RPC from '@starknet-io/starknet-types-09';
|
|
9
9
|
import { Abi as Abi$1, TypedContract } from 'abi-wan-kanabi';
|
|
10
10
|
import { WalletWithStarknetFeatures, StandardEventsChangeProperties } from '@starknet-io/get-starknet-wallet-standard/features';
|
|
11
11
|
import { WalletWithStarknetFeatures as WalletWithStarknetFeatures$1 } from '@starknet-io/get-starknet-wallet-standard-v6/features';
|
|
12
|
+
import * as _starknet_io_starknet_types_0104 from '@starknet-io/starknet-types-0104';
|
|
13
|
+
import { STRK20_DEPOSIT_ACTION, STRK20_WITHDRAW_ACTION, STRK20_TRANSFER_ACTION, STRK20_INVOKE_ACTION, STRK20_SUBACCOUNT_INVOKE_ACTION as STRK20_SUBACCOUNT_INVOKE_ACTION$1, STRK20_CALL_AND_PROOF as STRK20_CALL_AND_PROOF$1, STRK20_PROOF, Address, STRK20_BALANCE_ENTRY, STRK20_DAPP_NAME, FELT as FELT$1, Permission as Permission$2, WatchAssetParameters as WatchAssetParameters$2, AddStarknetChainParameters as AddStarknetChainParameters$2, ChainId as ChainId$2, AccountDeploymentData as AccountDeploymentData$2, AddInvokeTransactionParameters as AddInvokeTransactionParameters$2, AddInvokeTransactionResult as AddInvokeTransactionResult$2, AddDeclareTransactionParameters as AddDeclareTransactionParameters$2, AddDeclareTransactionResult as AddDeclareTransactionResult$2, TypedData as TypedData$2, Signature as Signature$3, SpecVersion as SpecVersion$2, API_VERSION as API_VERSION$3, STRK20_ACTION as STRK20_ACTION$1 } from '@starknet-io/starknet-types-0104';
|
|
14
|
+
export { STRK20_BALANCE_ENTRY, STRK20_CALLDATA_ITEM, STRK20_CALLDATA_PLACEHOLDER, STRK20_COLLECT_POLICY, STRK20_DAPP_NAME, STRK20_DEPOSIT_ACTION, STRK20_INVOKE_ACTION, STRK20_PROOF, STRK20_TRANSFER_ACTION, STRK20_WITHDRAW_ACTION } from '@starknet-io/starknet-types-0104';
|
|
12
15
|
import * as poseidon from '@noble/curves/abstract/poseidon';
|
|
13
16
|
import * as json$1 from 'lossless-json';
|
|
14
17
|
import * as starknet from '@scure/starknet';
|
|
@@ -6154,6 +6157,76 @@ declare class WalletAccountV5 extends Account {
|
|
|
6154
6157
|
static connectSilent(provider: ProviderOptions | ProviderInterface, walletProvider: WalletWithStarknetFeatures, cairoVersion?: CairoVersion, paymaster?: PaymasterOptions | PaymasterInterface): Promise<WalletAccountV5>;
|
|
6155
6158
|
}
|
|
6156
6159
|
|
|
6160
|
+
/**
|
|
6161
|
+
* STRK20 types as exposed to a DAPP by `WalletAccountV6`.
|
|
6162
|
+
*
|
|
6163
|
+
* They mirror the wallet-api spec types, except that every embedded call is a Starknet.js
|
|
6164
|
+
* `Call` instead of a wallet-api `INVOKE_CALL`. A DAPP therefore never handles the
|
|
6165
|
+
* snake_case spec shape: `WalletAccountV6` converts in both directions (see `adapterV6.ts`).
|
|
6166
|
+
* The raw spec types remain available through the `RPC` namespace.
|
|
6167
|
+
*/
|
|
6168
|
+
/**
|
|
6169
|
+
* Invokes one or more contract calls through the user's STRK20 sub-account for a DAPP,
|
|
6170
|
+
* routed via the sub-account anonymizer. The sub-account is selected by (`dapp_name`,
|
|
6171
|
+
* `nonce`); each nonce maps to a distinct, deterministic sub-account.
|
|
6172
|
+
*
|
|
6173
|
+
* The proceeds of the calls are settled into the open notes created by `transfer` actions
|
|
6174
|
+
* with `amount: "OPEN"` in the same transaction, so the number of open notes filled by
|
|
6175
|
+
* this action must match the number of open notes created in the transaction.
|
|
6176
|
+
* @example
|
|
6177
|
+
* ```typescript
|
|
6178
|
+
* const action: STRK20_SUBACCOUNT_INVOKE_ACTION = {
|
|
6179
|
+
* type: 'subaccount_invoke',
|
|
6180
|
+
* dapp_name: 'myDapp',
|
|
6181
|
+
* nonce: '0x0',
|
|
6182
|
+
* calls: [myContract.populate('stake', { amount: 1000n })],
|
|
6183
|
+
* collect_policy: { type: 'diff' },
|
|
6184
|
+
* };
|
|
6185
|
+
* ```
|
|
6186
|
+
*/
|
|
6187
|
+
type STRK20_SUBACCOUNT_INVOKE_ACTION = Omit<STRK20_SUBACCOUNT_INVOKE_ACTION$1, 'calls'> & {
|
|
6188
|
+
/** The contract calls to execute through the sub-account, in order (min 1). */
|
|
6189
|
+
calls: Call[];
|
|
6190
|
+
};
|
|
6191
|
+
/**
|
|
6192
|
+
* A single action to perform via the STRK20 privacy protocol. The `type` field
|
|
6193
|
+
* discriminates the variant.
|
|
6194
|
+
* @example
|
|
6195
|
+
* ```typescript
|
|
6196
|
+
* const actions: STRK20_ACTION[] = [
|
|
6197
|
+
* { type: 'withdraw', token: strkAddress, amount: '0x2386f26fc10000', recipient: subAccountAddr },
|
|
6198
|
+
* { type: 'transfer', token: strkAddress, amount: 'OPEN', recipient: myAddress },
|
|
6199
|
+
* {
|
|
6200
|
+
* type: 'subaccount_invoke',
|
|
6201
|
+
* dapp_name: 'myDapp',
|
|
6202
|
+
* nonce: '0x0',
|
|
6203
|
+
* calls: [myContract.populate('stake', { amount: 1000n })],
|
|
6204
|
+
* collect_policy: { type: 'all' },
|
|
6205
|
+
* },
|
|
6206
|
+
* ];
|
|
6207
|
+
* ```
|
|
6208
|
+
*/
|
|
6209
|
+
type STRK20_ACTION = STRK20_DEPOSIT_ACTION | STRK20_WITHDRAW_ACTION | STRK20_TRANSFER_ACTION | STRK20_INVOKE_ACTION | STRK20_SUBACCOUNT_INVOKE_ACTION;
|
|
6210
|
+
/**
|
|
6211
|
+
* A Starknet call built by the wallet, together with the SNIP-36 zero-knowledge proof
|
|
6212
|
+
* needed to submit it. In simulate mode the proof fields are present but empty, in which
|
|
6213
|
+
* case the call is not submittable on-chain and is only useful for fee estimation or UI
|
|
6214
|
+
* previews.
|
|
6215
|
+
* @example
|
|
6216
|
+
* ```typescript
|
|
6217
|
+
* const { call, proof }: STRK20_CALL_AND_PROOF = await myWalletAccount.strk20PrepareInvoke(actions);
|
|
6218
|
+
* // `call` is a Starknet.js Call, ready to be submitted by the DAPP:
|
|
6219
|
+
* const { transaction_hash } = await mySponsorAccount.execute(call, {
|
|
6220
|
+
* proof: proof.data,
|
|
6221
|
+
* proofFacts: proof.proof_facts,
|
|
6222
|
+
* });
|
|
6223
|
+
* ```
|
|
6224
|
+
*/
|
|
6225
|
+
type STRK20_CALL_AND_PROOF = Omit<STRK20_CALL_AND_PROOF$1, 'call'> & {
|
|
6226
|
+
/** The Starknet call to submit. */
|
|
6227
|
+
call: Call;
|
|
6228
|
+
};
|
|
6229
|
+
|
|
6157
6230
|
/**
|
|
6158
6231
|
* WalletAccountV6 class.
|
|
6159
6232
|
* Extends WalletAccountV5 with get-starknet v6 types and STRK20 privacy protocol methods.
|
|
@@ -6162,12 +6235,87 @@ declare class WalletAccountV6 extends WalletAccountV5 {
|
|
|
6162
6235
|
constructor(options: WalletAccountV6Options);
|
|
6163
6236
|
private get v6Provider();
|
|
6164
6237
|
switchStarknetChain(chainId: _StarknetChainId, silent_mode?: boolean): Promise<boolean>;
|
|
6165
|
-
|
|
6238
|
+
/**
|
|
6239
|
+
* Execute call(s) with an optional STRK20 privacy proof attached. Same signature as
|
|
6240
|
+
* `execute()`, with an extra parameter for the proof provided by `strk20PrepareInvoke()`.
|
|
6241
|
+
* @param {AllowArray<Call>} calls - The call(s) to invoke.
|
|
6242
|
+
* @param {STRK20_PROOF} [proof] - The SNIP-36 zero-knowledge proof to attach.
|
|
6243
|
+
* @returns {Promise<AddInvokeTransactionResult>} The hash of the submitted transaction.
|
|
6244
|
+
* @example
|
|
6245
|
+
* ```typescript
|
|
6246
|
+
* const { proof } = await myWalletAccount.strk20PrepareInvoke(actions);
|
|
6247
|
+
* const result = await myWalletAccount.executeWithProof(myContract.populate('claim'), proof);
|
|
6248
|
+
* // result = { transaction_hash: '0x6f7d...' }
|
|
6249
|
+
* ```
|
|
6250
|
+
*/
|
|
6251
|
+
executeWithProof(calls: AllowArray<Call>, proof?: STRK20_PROOF): Promise<_starknet_io_starknet_types_0104.AddInvokeTransactionResult>;
|
|
6252
|
+
/**
|
|
6253
|
+
* Get the private balances held by the user inside the STRK20 privacy pool.
|
|
6254
|
+
* @param {Address[]} tokens - The tokens to get the private balance of. An empty array returns every shielded token.
|
|
6255
|
+
* @returns {Promise<STRK20_BALANCE_ENTRY[]>} One entry per token.
|
|
6256
|
+
* @example
|
|
6257
|
+
* ```typescript
|
|
6258
|
+
* const balances = await myWalletAccount.strk20Balances([strkAddress]);
|
|
6259
|
+
* // balances = [{ token: '0x4718...', amount: '0x2386f26fc10000' }]
|
|
6260
|
+
* ```
|
|
6261
|
+
*/
|
|
6166
6262
|
strk20Balances(tokens: Address[]): Promise<STRK20_BALANCE_ENTRY[]>;
|
|
6263
|
+
/**
|
|
6264
|
+
* Build the Starknet call and the SNIP-36 zero-knowledge proof of a STRK20 transaction,
|
|
6265
|
+
* without submitting it : the DAPP submits the returned call itself, and therefore pays
|
|
6266
|
+
* the fee (the wallet adds no fee action in this mode).
|
|
6267
|
+
*
|
|
6268
|
+
* With `simulate` set to true, the wallet skips the expensive proof generation and
|
|
6269
|
+
* returns an empty proof : the call is then NOT submittable on-chain, and is only useful
|
|
6270
|
+
* for fee estimation or UI previews.
|
|
6271
|
+
* @param {STRK20_ACTION[]} actions - The STRK20 actions to perform atomically (min 1).
|
|
6272
|
+
* @param {boolean} [simulate] - True to skip the proof generation.
|
|
6273
|
+
* @returns {Promise<STRK20_CALL_AND_PROOF>} The Starknet.js call to submit, and its proof.
|
|
6274
|
+
* @example
|
|
6275
|
+
* ```typescript
|
|
6276
|
+
* const { call, proof } = await myWalletAccount.strk20PrepareInvoke(actions);
|
|
6277
|
+
* const result = await mySponsorAccount.execute(call, {
|
|
6278
|
+
* proof: proof.data,
|
|
6279
|
+
* proofFacts: proof.proof_facts,
|
|
6280
|
+
* });
|
|
6281
|
+
* // result = { transaction_hash: '0x6f7d...' }
|
|
6282
|
+
* ```
|
|
6283
|
+
*/
|
|
6167
6284
|
strk20PrepareInvoke(actions: STRK20_ACTION[], simulate?: boolean): Promise<STRK20_CALL_AND_PROOF>;
|
|
6285
|
+
/**
|
|
6286
|
+
* Submit STRK20 actions as a single atomic transaction. The wallet displays an approval
|
|
6287
|
+
* UI, generates the SNIP-36 proof, adds the fee action, and submits — so this call may
|
|
6288
|
+
* take significantly longer than a standard invoke.
|
|
6289
|
+
* @param {STRK20_ACTION[]} actions - The STRK20 actions to perform atomically (min 1).
|
|
6290
|
+
* @returns {Promise<{transaction_hash: string}>} The hash of the submitted transaction.
|
|
6291
|
+
* @example
|
|
6292
|
+
* ```typescript
|
|
6293
|
+
* const result = await myWalletAccount.strk20InvokeTransaction(actions);
|
|
6294
|
+
* // result = { transaction_hash: '0x6f7d...' }
|
|
6295
|
+
* ```
|
|
6296
|
+
*/
|
|
6168
6297
|
strk20InvokeTransaction(actions: STRK20_ACTION[]): Promise<{
|
|
6169
6298
|
transaction_hash: string;
|
|
6170
6299
|
}>;
|
|
6300
|
+
/**
|
|
6301
|
+
* Compute the commitment of a DAPP STRK20 sub-account. The commitment is computed
|
|
6302
|
+
* locally by the wallet from the user private state ; no transaction is sent.
|
|
6303
|
+
*
|
|
6304
|
+
* When `nonce` is given, the full commitment of this single sub-account is returned.
|
|
6305
|
+
* When `nonce` is omitted, the partial (nonce independent) commitment is returned
|
|
6306
|
+
* instead : it is shared by every sub-account the user derives for this DAPP, so it can
|
|
6307
|
+
* be published once to let a DAPP recognize all the sub-accounts of a user without
|
|
6308
|
+
* learning any individual nonce.
|
|
6309
|
+
* @param {STRK20_DAPP_NAME} dappName - The DAPP that scopes the sub-account(s).
|
|
6310
|
+
* @param {FELT} [nonce] - The sub-account nonce ; each nonce selects a distinct sub-account for this user + DAPP. Omit it to get the partial commitment.
|
|
6311
|
+
* @returns {Promise<FELT>} The sub-account commitment.
|
|
6312
|
+
* @example
|
|
6313
|
+
* ```typescript
|
|
6314
|
+
* const commitment = await myWalletAccount.strk20SubaccountCommitment('myDapp', '0x0');
|
|
6315
|
+
* // commitment = '0x5f2e...'
|
|
6316
|
+
* ```
|
|
6317
|
+
*/
|
|
6318
|
+
strk20SubaccountCommitment(dappName: STRK20_DAPP_NAME, nonce?: FELT$1): Promise<FELT$1>;
|
|
6171
6319
|
static connect(provider: ProviderOptions | ProviderInterface, walletProvider: WalletWithStarknetFeatures$1, cairoVersion?: CairoVersion, paymaster?: PaymasterOptions | PaymasterInterface, silentMode?: boolean): Promise<WalletAccountV6>;
|
|
6172
6320
|
static connectSilent(provider: ProviderOptions | ProviderInterface, walletProvider: WalletWithStarknetFeatures$1, cairoVersion?: CairoVersion, paymaster?: PaymasterOptions | PaymasterInterface): Promise<WalletAccountV6>;
|
|
6173
6321
|
}
|
|
@@ -10264,7 +10412,7 @@ declare function units(amount: string | bigint, simbol?: 'fri' | 'strk'): string
|
|
|
10264
10412
|
* @param {boolean} [silent_mode=false] false: request user interaction allowance. true: return only pre-allowed
|
|
10265
10413
|
* @returns allowed accounts addresses
|
|
10266
10414
|
*/
|
|
10267
|
-
declare function requestAccounts$2(swo: StarknetWindowObject, silent_mode?: boolean): Promise<Address[]>;
|
|
10415
|
+
declare function requestAccounts$2(swo: StarknetWindowObject, silent_mode?: boolean): Promise<Address$1[]>;
|
|
10268
10416
|
/**
|
|
10269
10417
|
* Request Permission for wallet account
|
|
10270
10418
|
* @returns allowed accounts addresses
|
|
@@ -10371,7 +10519,7 @@ declare function standardConnect$1(walletWSF: WalletWithStarknetFeatures, silent
|
|
|
10371
10519
|
* @param {boolean} [silent_mode=false] false: request user interaction allowance. true: return only pre-allowed
|
|
10372
10520
|
* @returns {Address[]} allowed accounts addresses
|
|
10373
10521
|
*/
|
|
10374
|
-
declare function requestAccounts$1(walletWSF: WalletWithStarknetFeatures, silent_mode?: boolean): Promise<Address$
|
|
10522
|
+
declare function requestAccounts$1(walletWSF: WalletWithStarknetFeatures, silent_mode?: boolean): Promise<Address$2[]>;
|
|
10375
10523
|
/**
|
|
10376
10524
|
* Request if DAPP is connected to wallet.
|
|
10377
10525
|
* @param {WalletWithStarknetFeatures} walletWSF - The get-starknet V5 wallet object to use.
|
|
@@ -10471,23 +10619,43 @@ declare namespace connectV5 {
|
|
|
10471
10619
|
*/
|
|
10472
10620
|
declare function standardConnect(walletWSF: WalletWithStarknetFeatures$1, silent_mode?: boolean): Promise<StandardConnectOutput>;
|
|
10473
10621
|
declare function requestAccounts(walletWSF: WalletWithStarknetFeatures$1, silent_mode?: boolean): Promise<Address[]>;
|
|
10474
|
-
declare function getPermissions(walletWSF: WalletWithStarknetFeatures$1): Promise<Permission[]>;
|
|
10475
|
-
declare function watchAsset(walletWSF: WalletWithStarknetFeatures$1, asset: WatchAssetParameters): Promise<boolean>;
|
|
10476
|
-
declare function addStarknetChain(walletWSF: WalletWithStarknetFeatures$1, chain: AddStarknetChainParameters): Promise<boolean>;
|
|
10477
|
-
declare function switchStarknetChain(walletWSF: WalletWithStarknetFeatures$1, chainId: ChainId, silent_mode?: boolean): Promise<boolean>;
|
|
10478
|
-
declare function requestChainId(walletWSF: WalletWithStarknetFeatures$1): Promise<ChainId>;
|
|
10479
|
-
declare function deploymentData(walletWSF: WalletWithStarknetFeatures$1): Promise<AccountDeploymentData>;
|
|
10480
|
-
declare function addInvokeTransaction(walletWSF: WalletWithStarknetFeatures$1, params: AddInvokeTransactionParameters): Promise<AddInvokeTransactionResult>;
|
|
10481
|
-
declare function addDeclareTransaction(walletWSF: WalletWithStarknetFeatures$1, params: AddDeclareTransactionParameters): Promise<AddDeclareTransactionResult>;
|
|
10482
|
-
declare function signMessage(walletWSF: WalletWithStarknetFeatures$1, typedData: TypedData): Promise<Signature$
|
|
10483
|
-
declare function supportedSpecs(walletWSF: WalletWithStarknetFeatures$1): Promise<SpecVersion[]>;
|
|
10484
|
-
declare function supportedWalletApi(walletWSF: WalletWithStarknetFeatures$1): Promise<API_VERSION$
|
|
10622
|
+
declare function getPermissions(walletWSF: WalletWithStarknetFeatures$1): Promise<Permission$2[]>;
|
|
10623
|
+
declare function watchAsset(walletWSF: WalletWithStarknetFeatures$1, asset: WatchAssetParameters$2): Promise<boolean>;
|
|
10624
|
+
declare function addStarknetChain(walletWSF: WalletWithStarknetFeatures$1, chain: AddStarknetChainParameters$2): Promise<boolean>;
|
|
10625
|
+
declare function switchStarknetChain(walletWSF: WalletWithStarknetFeatures$1, chainId: ChainId$2, silent_mode?: boolean): Promise<boolean>;
|
|
10626
|
+
declare function requestChainId(walletWSF: WalletWithStarknetFeatures$1): Promise<ChainId$2>;
|
|
10627
|
+
declare function deploymentData(walletWSF: WalletWithStarknetFeatures$1): Promise<AccountDeploymentData$2>;
|
|
10628
|
+
declare function addInvokeTransaction(walletWSF: WalletWithStarknetFeatures$1, params: AddInvokeTransactionParameters$2): Promise<AddInvokeTransactionResult$2>;
|
|
10629
|
+
declare function addDeclareTransaction(walletWSF: WalletWithStarknetFeatures$1, params: AddDeclareTransactionParameters$2): Promise<AddDeclareTransactionResult$2>;
|
|
10630
|
+
declare function signMessage(walletWSF: WalletWithStarknetFeatures$1, typedData: TypedData$2): Promise<Signature$3>;
|
|
10631
|
+
declare function supportedSpecs(walletWSF: WalletWithStarknetFeatures$1): Promise<SpecVersion$2[]>;
|
|
10632
|
+
declare function supportedWalletApi(walletWSF: WalletWithStarknetFeatures$1): Promise<API_VERSION$3[]>;
|
|
10485
10633
|
declare function subscribeWalletEvent(walletWSF: WalletWithStarknetFeatures$1, callback: (change: StandardEventsChangeProperties$1) => void): () => void;
|
|
10486
10634
|
declare function strk20Balances(walletWSF: WalletWithStarknetFeatures$1, tokens: Address[]): Promise<STRK20_BALANCE_ENTRY[]>;
|
|
10487
|
-
declare function strk20PrepareInvoke(walletWSF: WalletWithStarknetFeatures$1, actions: STRK20_ACTION[], simulate?: boolean): Promise<STRK20_CALL_AND_PROOF>;
|
|
10488
|
-
declare function strk20InvokeTransaction(walletWSF: WalletWithStarknetFeatures$1, actions: STRK20_ACTION[]): Promise<{
|
|
10635
|
+
declare function strk20PrepareInvoke(walletWSF: WalletWithStarknetFeatures$1, actions: STRK20_ACTION$1[], simulate?: boolean): Promise<STRK20_CALL_AND_PROOF$1>;
|
|
10636
|
+
declare function strk20InvokeTransaction(walletWSF: WalletWithStarknetFeatures$1, actions: STRK20_ACTION$1[]): Promise<{
|
|
10489
10637
|
transaction_hash: string;
|
|
10490
10638
|
}>;
|
|
10639
|
+
/**
|
|
10640
|
+
* Compute the commitment of a DAPP STRK20 sub-account. The commitment is computed locally
|
|
10641
|
+
* by the wallet from the user private state ; no transaction is sent.
|
|
10642
|
+
*
|
|
10643
|
+
* When `nonce` is given, the full commitment of this single sub-account is returned. When
|
|
10644
|
+
* `nonce` is omitted, the partial (nonce independent) commitment is returned instead : it
|
|
10645
|
+
* is shared by every sub-account the user derives for this DAPP, so it can be published
|
|
10646
|
+
* once to let a DAPP recognize all the sub-accounts of a user without learning any
|
|
10647
|
+
* individual nonce.
|
|
10648
|
+
* @param {WalletWithStarknetFeaturesV6} walletWSF - The get-starknet V6 wallet object to use.
|
|
10649
|
+
* @param {STRK20_DAPP_NAME} dapp_name - The DAPP that scopes the sub-account(s).
|
|
10650
|
+
* @param {FELT} [nonce] - The sub-account nonce ; each nonce selects a distinct sub-account for this user + DAPP. Omit it to get the partial commitment.
|
|
10651
|
+
* @returns {Promise<FELT>} The sub-account commitment.
|
|
10652
|
+
* @example
|
|
10653
|
+
* ```typescript
|
|
10654
|
+
* const commitment = await strk20SubaccountCommitment(walletWSF, 'myDapp', '0x0');
|
|
10655
|
+
* // commitment = '0x5f2e...'
|
|
10656
|
+
* ```
|
|
10657
|
+
*/
|
|
10658
|
+
declare function strk20SubaccountCommitment(walletWSF: WalletWithStarknetFeatures$1, dapp_name: STRK20_DAPP_NAME, nonce?: FELT$1): Promise<FELT$1>;
|
|
10491
10659
|
|
|
10492
10660
|
declare const connectV6_addDeclareTransaction: typeof addDeclareTransaction;
|
|
10493
10661
|
declare const connectV6_addInvokeTransaction: typeof addInvokeTransaction;
|
|
@@ -10501,13 +10669,14 @@ declare const connectV6_standardConnect: typeof standardConnect;
|
|
|
10501
10669
|
declare const connectV6_strk20Balances: typeof strk20Balances;
|
|
10502
10670
|
declare const connectV6_strk20InvokeTransaction: typeof strk20InvokeTransaction;
|
|
10503
10671
|
declare const connectV6_strk20PrepareInvoke: typeof strk20PrepareInvoke;
|
|
10672
|
+
declare const connectV6_strk20SubaccountCommitment: typeof strk20SubaccountCommitment;
|
|
10504
10673
|
declare const connectV6_subscribeWalletEvent: typeof subscribeWalletEvent;
|
|
10505
10674
|
declare const connectV6_supportedSpecs: typeof supportedSpecs;
|
|
10506
10675
|
declare const connectV6_supportedWalletApi: typeof supportedWalletApi;
|
|
10507
10676
|
declare const connectV6_switchStarknetChain: typeof switchStarknetChain;
|
|
10508
10677
|
declare const connectV6_watchAsset: typeof watchAsset;
|
|
10509
10678
|
declare namespace connectV6 {
|
|
10510
|
-
export { connectV6_addDeclareTransaction as addDeclareTransaction, connectV6_addInvokeTransaction as addInvokeTransaction, connectV6_addStarknetChain as addStarknetChain, connectV6_deploymentData as deploymentData, connectV6_getPermissions as getPermissions, connectV6_requestAccounts as requestAccounts, connectV6_requestChainId as requestChainId, connectV6_signMessage as signMessage, connectV6_standardConnect as standardConnect, connectV6_strk20Balances as strk20Balances, connectV6_strk20InvokeTransaction as strk20InvokeTransaction, connectV6_strk20PrepareInvoke as strk20PrepareInvoke, connectV6_subscribeWalletEvent as subscribeWalletEvent, connectV6_supportedSpecs as supportedSpecs, connectV6_supportedWalletApi as supportedWalletApi, connectV6_switchStarknetChain as switchStarknetChain, connectV6_watchAsset as watchAsset };
|
|
10679
|
+
export { connectV6_addDeclareTransaction as addDeclareTransaction, connectV6_addInvokeTransaction as addInvokeTransaction, connectV6_addStarknetChain as addStarknetChain, connectV6_deploymentData as deploymentData, connectV6_getPermissions as getPermissions, connectV6_requestAccounts as requestAccounts, connectV6_requestChainId as requestChainId, connectV6_signMessage as signMessage, connectV6_standardConnect as standardConnect, connectV6_strk20Balances as strk20Balances, connectV6_strk20InvokeTransaction as strk20InvokeTransaction, connectV6_strk20PrepareInvoke as strk20PrepareInvoke, connectV6_strk20SubaccountCommitment as strk20SubaccountCommitment, connectV6_subscribeWalletEvent as subscribeWalletEvent, connectV6_supportedSpecs as supportedSpecs, connectV6_supportedWalletApi as supportedWalletApi, connectV6_switchStarknetChain as switchStarknetChain, connectV6_watchAsset as watchAsset };
|
|
10511
10680
|
}
|
|
10512
10681
|
|
|
10513
10682
|
type DefaultConfig = typeof DEFAULT_GLOBAL_CONFIG;
|
|
@@ -10611,4 +10780,4 @@ declare class Logger {
|
|
|
10611
10780
|
*/
|
|
10612
10781
|
declare const logger: Logger;
|
|
10613
10782
|
|
|
10614
|
-
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, type AccountHooks, 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 BlockTransactionTrace, type BlockTransactionsTracesWithInitialReads, type BlockWithTxHashes, BrotherIdImpl, type BrotherIdProviderMethods, type BrotherProfile, 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, ESubscriptionTag, ETH_ADDRESS, ETraceFlag, ETransactionExecutionStatus, ETransactionStatus, ETransactionVersion, ETransactionVersion2, ETransactionVersion3, ETxnResponseFlag, 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 FastExecuteAccountMethods, type FastExecuteProviderMethods, type FastExecuteResponse, type FastWaitForTransactionOptions, type FeeEstimate, type FeeMode, type FormatResponse, type FunctionAbi, type GasPrices, type GetBlockResponse, type GetTransactionReceiptResponse, type GetTransactionResponse, type GetTxReceiptResponseWithoutHelper, type HexCalldata, type Hint, type INITIAL_READS, 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 LoadedContract, 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 PluginConfig, PluginManager, type PreConfirmedBlock, type PreConfirmedStateUpdate, type PreparedDeployAndInvokeTransaction, type PreparedDeployTransaction, type PreparedInvokeTransaction, type PreparedTransaction, type Program, RpcProvider as Provider, type ProviderHooks, ProviderInterface, type ProviderOptions, type ProviderOrAccount, type PythonicHints, type RESOURCE_PRICE, index$4 as RPC, rpc_0_10_2 as RPC0102, rpc_0_10_3 as RPC0103, 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 StarknetIdAccountMethods, StarknetIdImpl, type StarknetIdProviderMethods, type StarknetPlugin, type StateUpdate, type StateUpdateResponse, type StorageResponse, 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, WalletAccountV6, WebSocketChannel, type WebSocketModule, WebSocketNotConnectedError, type WebSocketOptions, type WeierstrassSignatureType, type WithOptions, addAddressPadding, brotherId, byteArray, cairo, compareVersions, config, constants, contractClassResponseToLegacyCompiledContract, contractLoader, createAbiParser, createTransactionReceipt, defaultDeployer, defaultPlugins, ec, encode, eth, index as events, extractContractHashes, fastExecute, fastParsingStrategy, getAbiVersion, type getBlockTransactionsTracesOptions, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, getGasPrices, getLedgerPathBuffer111 as getLedgerPathBuffer, getLedgerPathBuffer111, getLedgerPathBuffer221, type getSimulateTransactionOptions, getTipStatsFromBlocks, index$3 as hash, hdParsingStrategy, isAccount, isFileSystemAvailable, 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, connectV6 as walletV6 };
|
|
10783
|
+
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, type AccountHooks, 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 BlockTransactionTrace, type BlockTransactionsTracesWithInitialReads, type BlockWithTxHashes, BrotherIdImpl, type BrotherIdProviderMethods, type BrotherProfile, 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, ESubscriptionTag, ETH_ADDRESS, ETraceFlag, ETransactionExecutionStatus, ETransactionStatus, ETransactionVersion, ETransactionVersion2, ETransactionVersion3, ETxnResponseFlag, 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 FastExecuteAccountMethods, type FastExecuteProviderMethods, type FastExecuteResponse, type FastWaitForTransactionOptions, type FeeEstimate, type FeeMode, type FormatResponse, type FunctionAbi, type GasPrices, type GetBlockResponse, type GetTransactionReceiptResponse, type GetTransactionResponse, type GetTxReceiptResponseWithoutHelper, type HexCalldata, type Hint, type INITIAL_READS, 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 LoadedContract, 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 PluginConfig, PluginManager, type PreConfirmedBlock, type PreConfirmedStateUpdate, type PreparedDeployAndInvokeTransaction, type PreparedDeployTransaction, type PreparedInvokeTransaction, type PreparedTransaction, type Program, RpcProvider as Provider, type ProviderHooks, ProviderInterface, type ProviderOptions, type ProviderOrAccount, type PythonicHints, type RESOURCE_PRICE, index$4 as RPC, rpc_0_10_2 as RPC0102, rpc_0_10_3 as RPC0103, 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 STRK20_ACTION, type STRK20_CALL_AND_PROOF, type STRK20_SUBACCOUNT_INVOKE_ACTION, 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 StarknetIdAccountMethods, StarknetIdImpl, type StarknetIdProviderMethods, type StarknetPlugin, type StateUpdate, type StateUpdateResponse, type StorageResponse, 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, WalletAccountV6, WebSocketChannel, type WebSocketModule, WebSocketNotConnectedError, type WebSocketOptions, type WeierstrassSignatureType, type WithOptions, addAddressPadding, brotherId, byteArray, cairo, compareVersions, config, constants, contractClassResponseToLegacyCompiledContract, contractLoader, createAbiParser, createTransactionReceipt, defaultDeployer, defaultPlugins, ec, encode, eth, index as events, extractContractHashes, fastExecute, fastParsingStrategy, getAbiVersion, type getBlockTransactionsTracesOptions, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, getGasPrices, getLedgerPathBuffer111 as getLedgerPathBuffer, getLedgerPathBuffer111, getLedgerPathBuffer221, type getSimulateTransactionOptions, getTipStatsFromBlocks, index$3 as hash, hdParsingStrategy, isAccount, isFileSystemAvailable, 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, connectV6 as walletV6 };
|
package/dist/index.global.js
CHANGED
|
@@ -12855,11 +12855,12 @@ ${indent}}` : "}";
|
|
|
12855
12855
|
this.websocket.addEventListener("error", this.errorListener);
|
|
12856
12856
|
}
|
|
12857
12857
|
_processRequestQueue() {
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
|
|
12858
|
+
const pending = this.requestQueue;
|
|
12859
|
+
this.requestQueue = [];
|
|
12860
|
+
logger.info(`WebSocket: Processing ${pending.length} queued requests.`);
|
|
12861
|
+
pending.forEach(({ method, params, resolve, reject }) => {
|
|
12861
12862
|
this.sendReceive(method, params).then(resolve).catch(reject);
|
|
12862
|
-
}
|
|
12863
|
+
});
|
|
12863
12864
|
}
|
|
12864
12865
|
async _restoreSubscriptions() {
|
|
12865
12866
|
const oldSubscriptions = Array.from(this.activeSubscriptions.values());
|
|
@@ -17984,6 +17985,27 @@ ${indent}}` : "}";
|
|
|
17984
17985
|
// TODO: MISSING ESTIMATES
|
|
17985
17986
|
};
|
|
17986
17987
|
|
|
17988
|
+
// src/wallet/adapterV6.ts
|
|
17989
|
+
function toWalletApiCall(call) {
|
|
17990
|
+
return {
|
|
17991
|
+
contract_address: call.contractAddress,
|
|
17992
|
+
entry_point: call.entrypoint,
|
|
17993
|
+
calldata: CallData.toHex(call.calldata)
|
|
17994
|
+
};
|
|
17995
|
+
}
|
|
17996
|
+
function fromWalletApiCall(call) {
|
|
17997
|
+
return {
|
|
17998
|
+
contractAddress: call.contract_address,
|
|
17999
|
+
entrypoint: call.entry_point,
|
|
18000
|
+
calldata: call.calldata ?? []
|
|
18001
|
+
};
|
|
18002
|
+
}
|
|
18003
|
+
function toWalletApiActions(actions) {
|
|
18004
|
+
return actions.map(
|
|
18005
|
+
(action) => action.type === "subaccount_invoke" ? { ...action, calls: action.calls.map(toWalletApiCall) } : action
|
|
18006
|
+
);
|
|
18007
|
+
}
|
|
18008
|
+
|
|
17987
18009
|
// src/wallet/connectV6.ts
|
|
17988
18010
|
var connectV6_exports = {};
|
|
17989
18011
|
__export(connectV6_exports, {
|
|
@@ -17999,6 +18021,7 @@ ${indent}}` : "}";
|
|
|
17999
18021
|
strk20Balances: () => strk20Balances,
|
|
18000
18022
|
strk20InvokeTransaction: () => strk20InvokeTransaction,
|
|
18001
18023
|
strk20PrepareInvoke: () => strk20PrepareInvoke,
|
|
18024
|
+
strk20SubaccountCommitment: () => strk20SubaccountCommitment,
|
|
18002
18025
|
subscribeWalletEvent: () => subscribeWalletEvent2,
|
|
18003
18026
|
supportedSpecs: () => supportedSpecs3,
|
|
18004
18027
|
supportedWalletApi: () => supportedWalletApi3,
|
|
@@ -18086,6 +18109,12 @@ ${indent}}` : "}";
|
|
|
18086
18109
|
params: { actions }
|
|
18087
18110
|
});
|
|
18088
18111
|
}
|
|
18112
|
+
function strk20SubaccountCommitment(walletWSF, dapp_name, nonce) {
|
|
18113
|
+
return walletWSF.features["starknet:walletApi"].request({
|
|
18114
|
+
type: "wallet_strk20SubaccountCommitment",
|
|
18115
|
+
params: { dapp_name, nonce }
|
|
18116
|
+
});
|
|
18117
|
+
}
|
|
18089
18118
|
|
|
18090
18119
|
// src/wallet/accountV6.ts
|
|
18091
18120
|
var WalletAccountV6 = class _WalletAccountV6 extends WalletAccountV5 {
|
|
@@ -18099,22 +18128,100 @@ ${indent}}` : "}";
|
|
|
18099
18128
|
switchStarknetChain(chainId, silent_mode = false) {
|
|
18100
18129
|
return switchStarknetChain3(this.v6Provider, chainId, silent_mode);
|
|
18101
18130
|
}
|
|
18131
|
+
/**
|
|
18132
|
+
* Execute call(s) with an optional STRK20 privacy proof attached. Same signature as
|
|
18133
|
+
* `execute()`, with an extra parameter for the proof provided by `strk20PrepareInvoke()`.
|
|
18134
|
+
* @param {AllowArray<Call>} calls - The call(s) to invoke.
|
|
18135
|
+
* @param {STRK20_PROOF} [proof] - The SNIP-36 zero-knowledge proof to attach.
|
|
18136
|
+
* @returns {Promise<AddInvokeTransactionResult>} The hash of the submitted transaction.
|
|
18137
|
+
* @example
|
|
18138
|
+
* ```typescript
|
|
18139
|
+
* const { proof } = await myWalletAccount.strk20PrepareInvoke(actions);
|
|
18140
|
+
* const result = await myWalletAccount.executeWithProof(myContract.populate('claim'), proof);
|
|
18141
|
+
* // result = { transaction_hash: '0x6f7d...' }
|
|
18142
|
+
* ```
|
|
18143
|
+
*/
|
|
18102
18144
|
executeWithProof(calls, proof) {
|
|
18103
|
-
const txCalls = [].concat(calls).map(
|
|
18104
|
-
contract_address: it.contractAddress,
|
|
18105
|
-
entry_point: it.entrypoint,
|
|
18106
|
-
calldata: it.calldata
|
|
18107
|
-
}));
|
|
18145
|
+
const txCalls = [].concat(calls).map(toWalletApiCall);
|
|
18108
18146
|
return addInvokeTransaction3(this.v6Provider, { calls: txCalls, proof });
|
|
18109
18147
|
}
|
|
18148
|
+
/**
|
|
18149
|
+
* Get the private balances held by the user inside the STRK20 privacy pool.
|
|
18150
|
+
* @param {Address[]} tokens - The tokens to get the private balance of. An empty array returns every shielded token.
|
|
18151
|
+
* @returns {Promise<STRK20_BALANCE_ENTRY[]>} One entry per token.
|
|
18152
|
+
* @example
|
|
18153
|
+
* ```typescript
|
|
18154
|
+
* const balances = await myWalletAccount.strk20Balances([strkAddress]);
|
|
18155
|
+
* // balances = [{ token: '0x4718...', amount: '0x2386f26fc10000' }]
|
|
18156
|
+
* ```
|
|
18157
|
+
*/
|
|
18110
18158
|
strk20Balances(tokens) {
|
|
18111
18159
|
return strk20Balances(this.v6Provider, tokens);
|
|
18112
18160
|
}
|
|
18113
|
-
|
|
18114
|
-
|
|
18161
|
+
/**
|
|
18162
|
+
* Build the Starknet call and the SNIP-36 zero-knowledge proof of a STRK20 transaction,
|
|
18163
|
+
* without submitting it : the DAPP submits the returned call itself, and therefore pays
|
|
18164
|
+
* the fee (the wallet adds no fee action in this mode).
|
|
18165
|
+
*
|
|
18166
|
+
* With `simulate` set to true, the wallet skips the expensive proof generation and
|
|
18167
|
+
* returns an empty proof : the call is then NOT submittable on-chain, and is only useful
|
|
18168
|
+
* for fee estimation or UI previews.
|
|
18169
|
+
* @param {STRK20_ACTION[]} actions - The STRK20 actions to perform atomically (min 1).
|
|
18170
|
+
* @param {boolean} [simulate] - True to skip the proof generation.
|
|
18171
|
+
* @returns {Promise<STRK20_CALL_AND_PROOF>} The Starknet.js call to submit, and its proof.
|
|
18172
|
+
* @example
|
|
18173
|
+
* ```typescript
|
|
18174
|
+
* const { call, proof } = await myWalletAccount.strk20PrepareInvoke(actions);
|
|
18175
|
+
* const result = await mySponsorAccount.execute(call, {
|
|
18176
|
+
* proof: proof.data,
|
|
18177
|
+
* proofFacts: proof.proof_facts,
|
|
18178
|
+
* });
|
|
18179
|
+
* // result = { transaction_hash: '0x6f7d...' }
|
|
18180
|
+
* ```
|
|
18181
|
+
*/
|
|
18182
|
+
async strk20PrepareInvoke(actions, simulate) {
|
|
18183
|
+
const { call, proof } = await strk20PrepareInvoke(
|
|
18184
|
+
this.v6Provider,
|
|
18185
|
+
toWalletApiActions(actions),
|
|
18186
|
+
simulate
|
|
18187
|
+
);
|
|
18188
|
+
return { call: fromWalletApiCall(call), proof };
|
|
18115
18189
|
}
|
|
18190
|
+
/**
|
|
18191
|
+
* Submit STRK20 actions as a single atomic transaction. The wallet displays an approval
|
|
18192
|
+
* UI, generates the SNIP-36 proof, adds the fee action, and submits — so this call may
|
|
18193
|
+
* take significantly longer than a standard invoke.
|
|
18194
|
+
* @param {STRK20_ACTION[]} actions - The STRK20 actions to perform atomically (min 1).
|
|
18195
|
+
* @returns {Promise<{transaction_hash: string}>} The hash of the submitted transaction.
|
|
18196
|
+
* @example
|
|
18197
|
+
* ```typescript
|
|
18198
|
+
* const result = await myWalletAccount.strk20InvokeTransaction(actions);
|
|
18199
|
+
* // result = { transaction_hash: '0x6f7d...' }
|
|
18200
|
+
* ```
|
|
18201
|
+
*/
|
|
18116
18202
|
strk20InvokeTransaction(actions) {
|
|
18117
|
-
return strk20InvokeTransaction(this.v6Provider, actions);
|
|
18203
|
+
return strk20InvokeTransaction(this.v6Provider, toWalletApiActions(actions));
|
|
18204
|
+
}
|
|
18205
|
+
/**
|
|
18206
|
+
* Compute the commitment of a DAPP STRK20 sub-account. The commitment is computed
|
|
18207
|
+
* locally by the wallet from the user private state ; no transaction is sent.
|
|
18208
|
+
*
|
|
18209
|
+
* When `nonce` is given, the full commitment of this single sub-account is returned.
|
|
18210
|
+
* When `nonce` is omitted, the partial (nonce independent) commitment is returned
|
|
18211
|
+
* instead : it is shared by every sub-account the user derives for this DAPP, so it can
|
|
18212
|
+
* be published once to let a DAPP recognize all the sub-accounts of a user without
|
|
18213
|
+
* learning any individual nonce.
|
|
18214
|
+
* @param {STRK20_DAPP_NAME} dappName - The DAPP that scopes the sub-account(s).
|
|
18215
|
+
* @param {FELT} [nonce] - The sub-account nonce ; each nonce selects a distinct sub-account for this user + DAPP. Omit it to get the partial commitment.
|
|
18216
|
+
* @returns {Promise<FELT>} The sub-account commitment.
|
|
18217
|
+
* @example
|
|
18218
|
+
* ```typescript
|
|
18219
|
+
* const commitment = await myWalletAccount.strk20SubaccountCommitment('myDapp', '0x0');
|
|
18220
|
+
* // commitment = '0x5f2e...'
|
|
18221
|
+
* ```
|
|
18222
|
+
*/
|
|
18223
|
+
strk20SubaccountCommitment(dappName, nonce) {
|
|
18224
|
+
return strk20SubaccountCommitment(this.v6Provider, dappName, nonce);
|
|
18118
18225
|
}
|
|
18119
18226
|
static async connect(provider, walletProvider, cairoVersion, paymaster, silentMode = false) {
|
|
18120
18227
|
const { accounts } = await standardConnect2(walletProvider, silentMode);
|