@chipi-stack/chipi-react 14.9.0 → 14.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hooks.js CHANGED
@@ -10686,6 +10686,7 @@ var OutsideExecutionTypesV2 = {
10686
10686
  ]
10687
10687
  };
10688
10688
  var OutsideExecutionVersion = {
10689
+ UNSUPPORTED: "0",
10689
10690
  V1: "1",
10690
10691
  V2: "2"
10691
10692
  };
@@ -18577,9 +18578,76 @@ var BrotherId = class _BrotherId {
18577
18578
  }
18578
18579
  }
18579
18580
  };
18580
- (class extends Mixin(RpcProvider, StarknetId, BrotherId) {
18581
- });
18581
+ var RpcProvider2 = class extends Mixin(RpcProvider, StarknetId, BrotherId) {
18582
+ };
18582
18583
  new RpcProvider({ default: true });
18584
+ var Signer = class {
18585
+ constructor(pk = utils.randomPrivateKey()) {
18586
+ __publicField(this, "pk");
18587
+ this.pk = pk instanceof Uint8Array ? buf2hex(pk) : toHex(pk);
18588
+ }
18589
+ async getPubKey() {
18590
+ return getStarkKey(this.pk);
18591
+ }
18592
+ async signMessage(typedData, accountAddress) {
18593
+ const msgHash = getMessageHash(typedData, accountAddress);
18594
+ return this.signRaw(msgHash);
18595
+ }
18596
+ async signTransaction(transactions, details) {
18597
+ const compiledCalldata = getExecuteCalldata(transactions, details.cairoVersion);
18598
+ let msgHash;
18599
+ if (Object.values(api_exports3.ETransactionVersion3).includes(details.version)) {
18600
+ const det = details;
18601
+ msgHash = calculateInvokeTransactionHash2({
18602
+ ...det,
18603
+ senderAddress: det.walletAddress,
18604
+ compiledCalldata,
18605
+ version: det.version,
18606
+ nonceDataAvailabilityMode: intDAM(det.nonceDataAvailabilityMode),
18607
+ feeDataAvailabilityMode: intDAM(det.feeDataAvailabilityMode)
18608
+ });
18609
+ } else {
18610
+ throw Error("unsupported signTransaction version");
18611
+ }
18612
+ return this.signRaw(msgHash);
18613
+ }
18614
+ async signDeployAccountTransaction(details) {
18615
+ const compiledConstructorCalldata = CallData.compile(details.constructorCalldata);
18616
+ let msgHash;
18617
+ if (Object.values(api_exports3.ETransactionVersion3).includes(details.version)) {
18618
+ const det = details;
18619
+ msgHash = calculateDeployAccountTransactionHash3({
18620
+ ...det,
18621
+ salt: det.addressSalt,
18622
+ compiledConstructorCalldata,
18623
+ version: det.version,
18624
+ nonceDataAvailabilityMode: intDAM(det.nonceDataAvailabilityMode),
18625
+ feeDataAvailabilityMode: intDAM(det.feeDataAvailabilityMode)
18626
+ });
18627
+ } else {
18628
+ throw Error("unsupported signDeployAccountTransaction version");
18629
+ }
18630
+ return this.signRaw(msgHash);
18631
+ }
18632
+ async signDeclareTransaction(details) {
18633
+ let msgHash;
18634
+ if (Object.values(api_exports3.ETransactionVersion3).includes(details.version)) {
18635
+ const det = details;
18636
+ msgHash = calculateDeclareTransactionHash3({
18637
+ ...det,
18638
+ version: det.version,
18639
+ nonceDataAvailabilityMode: intDAM(det.nonceDataAvailabilityMode),
18640
+ feeDataAvailabilityMode: intDAM(det.feeDataAvailabilityMode)
18641
+ });
18642
+ } else {
18643
+ throw Error("unsupported signDeclareTransaction version");
18644
+ }
18645
+ return this.signRaw(msgHash);
18646
+ }
18647
+ async signRaw(msgHash) {
18648
+ return sign(msgHash, this.pk);
18649
+ }
18650
+ };
18583
18651
  var uint256_exports = {};
18584
18652
  __export2(uint256_exports, {
18585
18653
  bnToUint256: () => bnToUint256,
@@ -19024,7 +19092,7 @@ var PaymasterRpc = class _PaymasterRpc {
19024
19092
  );
19025
19093
  }
19026
19094
  };
19027
- new PaymasterRpc({ default: true });
19095
+ var defaultPaymaster = new PaymasterRpc({ default: true });
19028
19096
  var Deployer = class {
19029
19097
  constructor(address, entryPoint) {
19030
19098
  __publicField(this, "address");
@@ -19099,8 +19167,791 @@ var Deployer = class {
19099
19167
  };
19100
19168
  }
19101
19169
  };
19102
- new Deployer(UDC.ADDRESS, UDC.ENTRYPOINT);
19170
+ var defaultDeployer = new Deployer(UDC.ADDRESS, UDC.ENTRYPOINT);
19103
19171
  new Deployer(LegacyUDC.ADDRESS, LegacyUDC.ENTRYPOINT);
19172
+ var Account = class extends RpcProvider2 {
19173
+ constructor(options) {
19174
+ const {
19175
+ provider,
19176
+ address,
19177
+ signer,
19178
+ cairoVersion,
19179
+ transactionVersion,
19180
+ paymaster,
19181
+ defaultTipType
19182
+ } = options;
19183
+ super(provider);
19184
+ __publicField(this, "signer");
19185
+ __publicField(this, "address");
19186
+ __publicField(this, "cairoVersion");
19187
+ __publicField(this, "transactionVersion");
19188
+ __publicField(this, "paymaster");
19189
+ __publicField(this, "deployer");
19190
+ __publicField(this, "defaultTipType");
19191
+ __publicField(this, "deploySelf", this.deployAccount);
19192
+ this.address = address.toLowerCase();
19193
+ this.signer = isString(signer) || signer instanceof Uint8Array ? new Signer(signer) : signer;
19194
+ if (cairoVersion) {
19195
+ this.cairoVersion = cairoVersion.toString();
19196
+ }
19197
+ this.transactionVersion = transactionVersion ?? config2.get("transactionVersion");
19198
+ this.paymaster = paymaster ? new PaymasterRpc(paymaster) : defaultPaymaster;
19199
+ this.deployer = options.deployer ?? defaultDeployer;
19200
+ this.defaultTipType = defaultTipType ?? config2.get("defaultTipType");
19201
+ logger.debug("Account setup", {
19202
+ transactionVersion: this.transactionVersion,
19203
+ cairoVersion: this.cairoVersion,
19204
+ channel: this.channel.id
19205
+ });
19206
+ }
19207
+ /** @deprecated @hidden */
19208
+ // The deprecation tag is meant to discourage use, not to signal future removal
19209
+ // it should only be removed if the relationship with the corresponding Provider.create(...) method changes
19210
+ static async create() {
19211
+ throw new LibraryError("Not supported");
19212
+ }
19213
+ async getNonce(blockIdentifier) {
19214
+ return super.getNonceForAddress(this.address, blockIdentifier);
19215
+ }
19216
+ async getNonceSafe(nonce) {
19217
+ try {
19218
+ return toBigInt(nonce ?? await this.getNonce());
19219
+ } catch (error) {
19220
+ return 0n;
19221
+ }
19222
+ }
19223
+ /**
19224
+ * Retrieves the Cairo version from the network and sets `cairoVersion` if not already set in the constructor.
19225
+ * @param classHash if provided detects Cairo version from classHash, otherwise from the account address
19226
+ */
19227
+ async getCairoVersion(classHash) {
19228
+ if (!this.cairoVersion) {
19229
+ const { cairo } = classHash ? await super.getContractVersion(void 0, classHash) : await super.getContractVersion(this.address);
19230
+ this.cairoVersion = cairo;
19231
+ }
19232
+ return this.cairoVersion;
19233
+ }
19234
+ // TODO: TT Cairo version is still needed for invoke on existing contracts
19235
+ async estimateInvokeFee(calls, details = {}) {
19236
+ const invocations = [{ type: api_exports3.ETransactionType.INVOKE, payload: [calls].flat() }];
19237
+ const estimateBulk = await this.estimateFeeBulk(invocations, details);
19238
+ return estimateBulk[0];
19239
+ }
19240
+ async estimateDeclareFee(payload, details = {}) {
19241
+ assert(
19242
+ isSierra(payload.contract),
19243
+ "Declare fee estimation is not supported for Cairo0 contracts"
19244
+ );
19245
+ const invocations = [
19246
+ {
19247
+ type: api_exports3.ETransactionType.DECLARE,
19248
+ payload: extractContractHashes(payload, await this.channel.getStarknetVersion())
19249
+ }
19250
+ ];
19251
+ const estimateBulk = await this.estimateFeeBulk(invocations, details);
19252
+ return estimateBulk[0];
19253
+ }
19254
+ async estimateAccountDeployFee({
19255
+ classHash,
19256
+ addressSalt = 0,
19257
+ constructorCalldata = [],
19258
+ contractAddress
19259
+ }, details = {}) {
19260
+ const compiledCalldata = CallData.compile(constructorCalldata);
19261
+ const contractAddressFinal = contractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0);
19262
+ const invocations = [
19263
+ {
19264
+ type: api_exports3.ETransactionType.DEPLOY_ACCOUNT,
19265
+ payload: {
19266
+ classHash,
19267
+ constructorCalldata: compiledCalldata,
19268
+ addressSalt,
19269
+ contractAddress: contractAddressFinal
19270
+ }
19271
+ }
19272
+ ];
19273
+ const estimateBulk = await this.estimateFeeBulk(invocations, details);
19274
+ return estimateBulk[0];
19275
+ }
19276
+ async estimateDeployFee(payload, details = {}) {
19277
+ const { calls } = this.deployer.buildDeployerCall(payload, this.address);
19278
+ return this.estimateInvokeFee(calls, details);
19279
+ }
19280
+ async estimateFeeBulk(invocations, details = {}) {
19281
+ if (!invocations.length) throw TypeError("Invocations should be non-empty array");
19282
+ if (details.resourceBounds)
19283
+ return [resourceBoundsToEstimateFeeResponse(details.resourceBounds)];
19284
+ const { nonce, blockIdentifier, version, skipValidate } = details;
19285
+ const detailsWithTip = await this.resolveDetailsWithTip(details);
19286
+ const accountInvocations = await this.accountInvocationsFactory(invocations, {
19287
+ ...v3Details(detailsWithTip),
19288
+ versions: [
19289
+ toTransactionVersion(
19290
+ toFeeVersion(this.transactionVersion) || ETransactionVersion33.F3,
19291
+ version
19292
+ )
19293
+ // sierra
19294
+ ],
19295
+ nonce,
19296
+ blockIdentifier,
19297
+ skipValidate
19298
+ });
19299
+ return super.getEstimateFeeBulk(accountInvocations, {
19300
+ blockIdentifier,
19301
+ skipValidate
19302
+ });
19303
+ }
19304
+ async simulateTransaction(invocations, details = {}) {
19305
+ if (!invocations.length) throw TypeError("Invocations should be non-empty array");
19306
+ const {
19307
+ nonce,
19308
+ blockIdentifier,
19309
+ skipValidate = true,
19310
+ skipExecute,
19311
+ version: providedVersion
19312
+ } = details;
19313
+ const detailsWithTip = await this.resolveDetailsWithTip(details);
19314
+ const accountInvocations = await this.accountInvocationsFactory(invocations, {
19315
+ ...v3Details(detailsWithTip),
19316
+ versions: [this.resolveTransactionVersion(providedVersion)],
19317
+ nonce,
19318
+ blockIdentifier,
19319
+ skipValidate
19320
+ });
19321
+ return super.getSimulateTransaction(accountInvocations, {
19322
+ blockIdentifier,
19323
+ skipValidate,
19324
+ skipExecute
19325
+ });
19326
+ }
19327
+ async execute(transactions, transactionsDetail = {}) {
19328
+ const calls = [transactions].flat();
19329
+ const detailsWithTip = await this.resolveDetailsWithTip(transactionsDetail);
19330
+ const { resourceBounds: providedResourceBounds } = transactionsDetail;
19331
+ let resourceBounds = providedResourceBounds;
19332
+ if (!resourceBounds) {
19333
+ const estimateResponse = await this.estimateInvokeFee(calls, detailsWithTip);
19334
+ resourceBounds = estimateResponse.resourceBounds;
19335
+ }
19336
+ const accountInvocations = await this.accountInvocationsFactory(
19337
+ [{ type: api_exports3.ETransactionType.INVOKE, payload: calls }],
19338
+ {
19339
+ ...v3Details(detailsWithTip),
19340
+ resourceBounds,
19341
+ versions: [this.resolveTransactionVersion(transactionsDetail.version)],
19342
+ nonce: transactionsDetail.nonce,
19343
+ skipValidate: false
19344
+ }
19345
+ );
19346
+ const invocation = accountInvocations[0];
19347
+ return this.invokeFunction(
19348
+ {
19349
+ contractAddress: invocation.contractAddress,
19350
+ calldata: invocation.calldata,
19351
+ signature: invocation.signature
19352
+ },
19353
+ {
19354
+ ...v3Details(detailsWithTip),
19355
+ resourceBounds: invocation.resourceBounds,
19356
+ nonce: invocation.nonce,
19357
+ version: invocation.version
19358
+ }
19359
+ );
19360
+ }
19361
+ /**
19362
+ * Execute one or multiple calls through the account contract,
19363
+ * responding as soon as a new transaction is possible with the same account.
19364
+ * Useful for gaming usage.
19365
+ * - This method requires the provider to be initialized with `pre_confirmed` blockIdentifier option.
19366
+ * - Rpc 0.9 minimum.
19367
+ * - In a normal myAccount.execute() call, followed by myProvider.waitForTransaction(), you have an immediate access to the events and to the transaction report. Here, we are processing consecutive transactions faster, but events & transaction reports are not available immediately.
19368
+ * - As a consequence of the previous point, do not use contract/account deployment with this method.
19369
+ * @param {AllowArray<Call>} transactions - Single call or array of calls to execute
19370
+ * @param {UniversalDetails} [transactionsDetail] - Transaction execution options
19371
+ * @param {fastWaitForTransactionOptions} [waitDetail={retries: 50, retryInterval: 500}] - options to scan the network for the next possible transaction. `retries` is the number of times to retry, `retryInterval` is the time in ms between retries.
19372
+ * @returns {Promise<fastExecuteResponse>} Response containing the transaction result and status for the next transaction. If `isReady` is true, you can execute the next transaction. If false, timeout has been reached before the next transaction was possible.
19373
+ * @example
19374
+ * ```typescript
19375
+ * const myProvider = new RpcProvider({ nodeUrl: url, blockIdentifier: BlockTag.PRE_CONFIRMED });
19376
+ * const myAccount = new Account({ provider: myProvider, address: accountAddress0, signer: privateKey0 });
19377
+ * const resp = await myAccount.fastExecute(
19378
+ * call, { tip: recommendedTip},
19379
+ * { retries: 30, retryInterval: 500 });
19380
+ * // if resp.isReady is true, you can launch immediately a new tx.
19381
+ * ```
19382
+ */
19383
+ async fastExecute(transactions, transactionsDetail = {}, waitDetail = {}) {
19384
+ assert(
19385
+ this.channel.blockIdentifier === BlockTag.PRE_CONFIRMED,
19386
+ "Provider needs to be initialized with `pre_confirmed` blockIdentifier option."
19387
+ );
19388
+ const initNonce = BigInt(
19389
+ transactionsDetail.nonce ?? await this.getNonceForAddress(this.address, BlockTag.PRE_CONFIRMED)
19390
+ );
19391
+ const details = { ...transactionsDetail, nonce: initNonce };
19392
+ const resultTx = await this.execute(transactions, details);
19393
+ const resultWait = await this.fastWaitForTransaction(
19394
+ resultTx.transaction_hash,
19395
+ this.address,
19396
+ initNonce,
19397
+ waitDetail
19398
+ );
19399
+ return { txResult: resultTx, isReady: resultWait };
19400
+ }
19401
+ /**
19402
+ * First check if contract is already declared, if not declare it
19403
+ * If contract already declared returned transaction_hash is ''.
19404
+ * Method will pass even if contract is already declared
19405
+ * @param transactionsDetail (optional)
19406
+ */
19407
+ async declareIfNot(payload, transactionsDetail = {}) {
19408
+ const declareContractPayload = extractContractHashes(
19409
+ payload,
19410
+ await this.channel.getStarknetVersion()
19411
+ );
19412
+ try {
19413
+ await this.getClassByHash(declareContractPayload.classHash);
19414
+ } catch (error) {
19415
+ return this.declare(payload, transactionsDetail);
19416
+ }
19417
+ return {
19418
+ transaction_hash: "",
19419
+ class_hash: declareContractPayload.classHash
19420
+ };
19421
+ }
19422
+ async declare(payload, details = {}) {
19423
+ assert(isSierra(payload.contract), SYSTEM_MESSAGES.declareNonSierra);
19424
+ const declareContractPayload = extractContractHashes(
19425
+ payload,
19426
+ await this.channel.getStarknetVersion()
19427
+ );
19428
+ const detailsWithTip = await this.resolveDetailsWithTip(details);
19429
+ const { resourceBounds: providedResourceBounds } = details;
19430
+ let resourceBounds = providedResourceBounds;
19431
+ if (!resourceBounds) {
19432
+ const estimateResponse = await this.estimateDeclareFee(payload, detailsWithTip);
19433
+ resourceBounds = estimateResponse.resourceBounds;
19434
+ }
19435
+ const accountInvocations = await this.accountInvocationsFactory(
19436
+ [{ type: api_exports3.ETransactionType.DECLARE, payload: declareContractPayload }],
19437
+ {
19438
+ ...v3Details(detailsWithTip),
19439
+ resourceBounds,
19440
+ versions: [this.resolveTransactionVersion(details.version)],
19441
+ nonce: details.nonce,
19442
+ skipValidate: false
19443
+ }
19444
+ );
19445
+ const declaration = accountInvocations[0];
19446
+ return super.declareContract(
19447
+ {
19448
+ senderAddress: declaration.senderAddress,
19449
+ signature: declaration.signature,
19450
+ contract: declaration.contract,
19451
+ compiledClassHash: declaration.compiledClassHash
19452
+ },
19453
+ {
19454
+ ...v3Details(detailsWithTip),
19455
+ nonce: declaration.nonce,
19456
+ resourceBounds: declaration.resourceBounds,
19457
+ version: declaration.version
19458
+ }
19459
+ );
19460
+ }
19461
+ async deploy(payload, details = {}) {
19462
+ const { calls, addresses } = this.deployer.buildDeployerCall(payload, this.address);
19463
+ const invokeResponse = await this.execute(calls, details);
19464
+ return {
19465
+ ...invokeResponse,
19466
+ contract_address: addresses
19467
+ };
19468
+ }
19469
+ async deployContract(payload, details = {}) {
19470
+ const deployTx = await this.deploy(payload, details);
19471
+ const txReceipt = await this.waitForTransaction(deployTx.transaction_hash, details);
19472
+ return this.deployer.parseDeployerEvent(
19473
+ txReceipt
19474
+ );
19475
+ }
19476
+ async declareAndDeploy(payload, details = {}) {
19477
+ let declare = await this.declareIfNot(payload, details);
19478
+ if (declare.transaction_hash !== "") {
19479
+ const tx = await this.waitForTransaction(declare.transaction_hash, details);
19480
+ declare = { ...declare, ...tx };
19481
+ }
19482
+ const deploy = await this.deployContract(
19483
+ { ...payload, classHash: declare.class_hash },
19484
+ details
19485
+ );
19486
+ return { declare: { ...declare }, deploy };
19487
+ }
19488
+ async deployAccount({
19489
+ classHash,
19490
+ constructorCalldata = [],
19491
+ addressSalt = 0,
19492
+ contractAddress: providedContractAddress
19493
+ }, details = {}) {
19494
+ const compiledCalldata = CallData.compile(constructorCalldata);
19495
+ const contractAddress = providedContractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0);
19496
+ const detailsWithTip = await this.resolveDetailsWithTip(details);
19497
+ const { resourceBounds: providedResourceBounds } = details;
19498
+ let resourceBounds = providedResourceBounds;
19499
+ if (!resourceBounds) {
19500
+ const estimateResponse = await this.estimateAccountDeployFee(
19501
+ {
19502
+ classHash,
19503
+ constructorCalldata,
19504
+ addressSalt,
19505
+ contractAddress
19506
+ },
19507
+ detailsWithTip
19508
+ );
19509
+ resourceBounds = estimateResponse.resourceBounds;
19510
+ }
19511
+ const accountInvocations = await this.accountInvocationsFactory(
19512
+ [
19513
+ {
19514
+ type: api_exports3.ETransactionType.DEPLOY_ACCOUNT,
19515
+ payload: {
19516
+ classHash,
19517
+ constructorCalldata: compiledCalldata,
19518
+ addressSalt,
19519
+ contractAddress
19520
+ }
19521
+ }
19522
+ ],
19523
+ {
19524
+ ...v3Details(detailsWithTip),
19525
+ resourceBounds,
19526
+ versions: [this.resolveTransactionVersion(details.version)],
19527
+ nonce: ZERO,
19528
+ // DEPLOY_ACCOUNT always uses nonce 0
19529
+ skipValidate: false
19530
+ }
19531
+ );
19532
+ const deployment = accountInvocations[0];
19533
+ return super.deployAccountContract(
19534
+ {
19535
+ classHash: deployment.classHash,
19536
+ addressSalt: deployment.addressSalt,
19537
+ constructorCalldata: deployment.constructorCalldata,
19538
+ signature: deployment.signature
19539
+ },
19540
+ {
19541
+ ...v3Details(detailsWithTip),
19542
+ nonce: deployment.nonce,
19543
+ resourceBounds: deployment.resourceBounds,
19544
+ version: deployment.version
19545
+ }
19546
+ );
19547
+ }
19548
+ async signMessage(typedData) {
19549
+ return this.signer.signMessage(typedData, this.address);
19550
+ }
19551
+ async hashMessage(typedData) {
19552
+ return getMessageHash(typedData, this.address);
19553
+ }
19554
+ /**
19555
+ * Verify if an account is compatible with SNIP-9 outside execution, and with which version of this standard.
19556
+ * @returns {OutsideExecutionVersion} Not compatible, V1, V2.
19557
+ * @example
19558
+ * ```typescript
19559
+ * const result = myAccount.getSnip9Version();
19560
+ * // result = "V1"
19561
+ * ```
19562
+ */
19563
+ async getSnip9Version() {
19564
+ if (await supportsInterface(this, this.address, SNIP9_V2_INTERFACE_ID)) {
19565
+ return OutsideExecutionVersion.V2;
19566
+ }
19567
+ if (await supportsInterface(this, this.address, SNIP9_V1_INTERFACE_ID)) {
19568
+ return OutsideExecutionVersion.V1;
19569
+ }
19570
+ return OutsideExecutionVersion.UNSUPPORTED;
19571
+ }
19572
+ /**
19573
+ * Verify if a SNIP-9 nonce has not yet been used by the account.
19574
+ * @param {BigNumberish} nonce SNIP-9 nonce to test.
19575
+ * @returns {boolean} true if SNIP-9 nonce not yet used.
19576
+ * @example
19577
+ * ```typescript
19578
+ * const result = myAccount.isValidSnip9Nonce(1234);
19579
+ * // result = true
19580
+ * ```
19581
+ */
19582
+ async isValidSnip9Nonce(nonce) {
19583
+ try {
19584
+ const call = {
19585
+ contractAddress: this.address,
19586
+ entrypoint: "is_valid_outside_execution_nonce",
19587
+ calldata: [toHex(nonce)]
19588
+ };
19589
+ const resp = await this.callContract(call);
19590
+ return BigInt(resp[0]) !== 0n;
19591
+ } catch (error) {
19592
+ throw new Error(`Failed to check if nonce is valid: ${error}`);
19593
+ }
19594
+ }
19595
+ /**
19596
+ * Outside transaction needs a specific SNIP-9 nonce, that we get in this function.
19597
+ * A SNIP-9 nonce can be any number not yet used ; no ordering is needed.
19598
+ * @returns {string} an Hex string of a SNIP-9 nonce.
19599
+ * @example
19600
+ * ```typescript
19601
+ * const result = myAccount.getSnip9Nonce();
19602
+ * // result = "0x28a612590dbc36927933c8ee0f357eee639c8b22b3d3aa86949eed3ada4ac55"
19603
+ * ```
19604
+ */
19605
+ async getSnip9Nonce() {
19606
+ const nonce = randomAddress();
19607
+ const isValidNonce = await this.isValidSnip9Nonce(nonce);
19608
+ if (!isValidNonce) {
19609
+ return this.getSnip9Nonce();
19610
+ }
19611
+ return nonce;
19612
+ }
19613
+ /**
19614
+ * Creates an object containing transaction(s) that can be executed by an other account with` Account.executeFromOutside()`, called Outside Transaction.
19615
+ * @param {OutsideExecutionOptions} options Parameters of the transaction(s).
19616
+ * @param {AllowArray<Call>} calls Transaction(s) to execute.
19617
+ * @param {OutsideExecutionVersion} [version] SNIP-9 version of the Account that creates the outside transaction.
19618
+ * @param {BigNumberish} [nonce] Outside Nonce.
19619
+ * @returns {OutsideTransaction} and object that can be used in `Account.executeFromOutside()`
19620
+ * @example
19621
+ * ```typescript
19622
+ * const now_seconds = Math.floor(Date.now() / 1000);
19623
+ * const callOptions: OutsideExecutionOptions = {
19624
+ caller: executorAccount.address, execute_after: now_seconds - 3600, execute_before: now_seconds + 3600 };
19625
+ * const call1: Call = { contractAddress: ethAddress, entrypoint: 'transfer', calldata: {
19626
+ * recipient: recipientAccount.address, amount: cairo.uint256(100) } };
19627
+ * const outsideTransaction1: OutsideTransaction = await signerAccount.getOutsideTransaction(callOptions, call3);
19628
+ * // result = {
19629
+ * // outsideExecution: {
19630
+ * // caller: '0x64b48806902a367c8598f4f95c305e8c1a1acba5f082d294a43793113115691',
19631
+ * // nonce: '0x28a612590dbc36927933c8ee0f357eee639c8b22b3d3aa86949eed3ada4ac55',
19632
+ * // execute_after: 1723650229, execute_before: 1723704229, calls: [[Object]] },
19633
+ * // signature: Signature {
19634
+ * // r: 67518627037915514985321278857825384106482999609634873287406612756843916814n,
19635
+ * // s: 737198738569840639192844101690009498983611654458636624293579534560862067709n, recovery: 0 },
19636
+ * // signerAddress: '0x655f8fd7c4013c07cf12a92184aa6c314d181443913e21f7e209a18f0c78492',
19637
+ * // version: '2'
19638
+ * // }
19639
+ * ```
19640
+ */
19641
+ async getOutsideTransaction(options, calls, version, nonce) {
19642
+ if (!isHex2(options.caller) && options.caller !== "ANY_CALLER") {
19643
+ throw new Error(`The caller ${options.caller} is not valid.`);
19644
+ }
19645
+ const codedCaller = isHex2(options.caller) ? options.caller : OutsideExecutionCallerAny;
19646
+ const myCalls = [calls].flat();
19647
+ const supportedVersion = version ?? await this.getSnip9Version();
19648
+ if (!supportedVersion) {
19649
+ throw new Error("This account is not handling outside transactions.");
19650
+ }
19651
+ const myNonce = nonce ? toHex(nonce) : await this.getSnip9Nonce();
19652
+ const message = getTypedData(
19653
+ await this.getChainId(),
19654
+ {
19655
+ caller: codedCaller,
19656
+ execute_after: options.execute_after,
19657
+ execute_before: options.execute_before
19658
+ },
19659
+ myNonce,
19660
+ myCalls,
19661
+ supportedVersion
19662
+ );
19663
+ const sign2 = await this.signMessage(message);
19664
+ const toExecute = {
19665
+ caller: codedCaller,
19666
+ nonce: myNonce,
19667
+ execute_after: options.execute_after,
19668
+ execute_before: options.execute_before,
19669
+ calls: myCalls.map(getOutsideCall)
19670
+ };
19671
+ return {
19672
+ outsideExecution: toExecute,
19673
+ signature: sign2,
19674
+ signerAddress: this.address,
19675
+ version: supportedVersion
19676
+ };
19677
+ }
19678
+ /**
19679
+ * An account B executes a transaction that has been signed by an account A.
19680
+ * Fees are paid by B.
19681
+ * @param {AllowArray<OutsideTransaction>} outsideTransaction the signed transaction generated by `Account.getOutsideTransaction()`.
19682
+ * @param {UniversalDetails} [opts] same options than `Account.execute()`.
19683
+ * @returns {InvokeFunctionResponse} same response than `Account.execute()`.
19684
+ * @example
19685
+ * ```typescript
19686
+ * const outsideTransaction1: OutsideTransaction = await signerAccount.getOutsideTransaction(callOptions, call1);
19687
+ * const outsideTransaction2: OutsideTransaction = await signerAccount.getOutsideTransaction(callOptions4, call4);
19688
+ * const result = await myAccount.executeFromOutside([
19689
+ outsideTransaction1,
19690
+ outsideTransaction2,
19691
+ ]);
19692
+ * // result = { transaction_hash: '0x11233...`}
19693
+ * ```
19694
+ */
19695
+ async executeFromOutside(outsideTransaction, opts) {
19696
+ const multiCall = buildExecuteFromOutsideCall(outsideTransaction);
19697
+ return this.execute(multiCall, opts);
19698
+ }
19699
+ /*
19700
+ * Support methods
19701
+ */
19702
+ /**
19703
+ * Helper method to resolve details with tip estimation
19704
+ * @private
19705
+ */
19706
+ async resolveDetailsWithTip(details) {
19707
+ return {
19708
+ ...details,
19709
+ tip: details.tip ?? (await this.getEstimateTip())[this.defaultTipType]
19710
+ };
19711
+ }
19712
+ /**
19713
+ * Helper method to resolve transaction version
19714
+ * @private
19715
+ */
19716
+ resolveTransactionVersion(providedVersion) {
19717
+ return toTransactionVersion(
19718
+ this.transactionVersion || ETransactionVersion33.V3,
19719
+ providedVersion
19720
+ );
19721
+ }
19722
+ async buildInvocation(call, details) {
19723
+ const calldata = getExecuteCalldata(call, await this.getCairoVersion());
19724
+ const signature = !details.skipValidate ? await this.signer.signTransaction(call, details) : [];
19725
+ return {
19726
+ ...v3Details(details),
19727
+ contractAddress: this.address,
19728
+ calldata,
19729
+ signature
19730
+ };
19731
+ }
19732
+ async buildDeclarePayload(payload, details) {
19733
+ const { classHash, contract, compiledClassHash } = extractContractHashes(
19734
+ payload,
19735
+ await this.channel.getStarknetVersion()
19736
+ );
19737
+ const compressedCompiledContract = parseContract(contract);
19738
+ assert(
19739
+ !isUndefined(compiledClassHash) && (details.version === ETransactionVersion33.F3 || details.version === ETransactionVersion33.V3),
19740
+ "V3 Transaction work with Cairo1 Contracts and require compiledClassHash"
19741
+ );
19742
+ const signature = !details.skipValidate ? await this.signer.signDeclareTransaction({
19743
+ ...details,
19744
+ ...v3Details(details),
19745
+ classHash,
19746
+ compiledClassHash,
19747
+ senderAddress: details.walletAddress
19748
+ }) : [];
19749
+ return {
19750
+ senderAddress: details.walletAddress,
19751
+ signature,
19752
+ contract: compressedCompiledContract,
19753
+ compiledClassHash
19754
+ };
19755
+ }
19756
+ async buildAccountDeployPayload({
19757
+ classHash,
19758
+ addressSalt = 0,
19759
+ constructorCalldata = [],
19760
+ contractAddress: providedContractAddress
19761
+ }, details) {
19762
+ const compiledCalldata = CallData.compile(constructorCalldata);
19763
+ const contractAddress = providedContractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0);
19764
+ const signature = !details.skipValidate ? await this.signer.signDeployAccountTransaction({
19765
+ ...details,
19766
+ ...v3Details(details),
19767
+ classHash,
19768
+ contractAddress,
19769
+ addressSalt,
19770
+ constructorCalldata: compiledCalldata
19771
+ }) : [];
19772
+ return {
19773
+ ...v3Details(details),
19774
+ classHash,
19775
+ addressSalt,
19776
+ constructorCalldata: compiledCalldata,
19777
+ signature
19778
+ };
19779
+ }
19780
+ async accountInvocationsFactory(invocations, details) {
19781
+ const { nonce, blockIdentifier, skipValidate = true } = details;
19782
+ const safeNonce = await this.getNonceSafe(nonce);
19783
+ const chainId = await this.getChainId();
19784
+ const versions = details.versions.map((it) => toTransactionVersion(it));
19785
+ const tx0Payload = "payload" in invocations[0] ? invocations[0].payload : invocations[0];
19786
+ const cairoVersion = invocations[0].type === api_exports3.ETransactionType.DEPLOY_ACCOUNT ? await this.getCairoVersion(tx0Payload.classHash) : await this.getCairoVersion();
19787
+ return Promise.all(
19788
+ [].concat(invocations).map(async (transaction, index) => {
19789
+ const txPayload = "payload" in transaction ? transaction.payload : transaction;
19790
+ const signerDetails = {
19791
+ ...v3Details(details),
19792
+ walletAddress: this.address,
19793
+ nonce: toBigInt(Number(safeNonce) + index),
19794
+ chainId,
19795
+ cairoVersion,
19796
+ version: versions[0],
19797
+ skipValidate
19798
+ };
19799
+ const common2 = {
19800
+ type: transaction.type,
19801
+ nonce: toBigInt(Number(safeNonce) + index),
19802
+ blockIdentifier,
19803
+ version: versions[0]
19804
+ };
19805
+ if (transaction.type === api_exports3.ETransactionType.INVOKE) {
19806
+ const payload = await this.buildInvocation(
19807
+ [].concat(txPayload),
19808
+ signerDetails
19809
+ );
19810
+ return {
19811
+ ...common2,
19812
+ ...payload,
19813
+ ...signerDetails
19814
+ };
19815
+ }
19816
+ if (transaction.type === api_exports3.ETransactionType.DEPLOY) {
19817
+ const { calls } = this.deployer.buildDeployerCall(txPayload, this.address);
19818
+ const payload = await this.buildInvocation(calls, signerDetails);
19819
+ return {
19820
+ ...common2,
19821
+ ...payload,
19822
+ ...signerDetails,
19823
+ type: api_exports3.ETransactionType.INVOKE
19824
+ };
19825
+ }
19826
+ if (transaction.type === api_exports3.ETransactionType.DECLARE) {
19827
+ assert(
19828
+ isSierra(txPayload.contract),
19829
+ "Declare fee estimation is not supported for Cairo0 contracts"
19830
+ );
19831
+ const payload = await this.buildDeclarePayload(txPayload, signerDetails);
19832
+ return {
19833
+ ...common2,
19834
+ ...payload,
19835
+ ...signerDetails
19836
+ };
19837
+ }
19838
+ if (transaction.type === api_exports3.ETransactionType.DEPLOY_ACCOUNT) {
19839
+ const payload = await this.buildAccountDeployPayload(txPayload, signerDetails);
19840
+ return {
19841
+ ...common2,
19842
+ ...payload,
19843
+ ...signerDetails
19844
+ };
19845
+ }
19846
+ throw Error(`accountInvocationsFactory: unsupported transaction type: ${transaction}`);
19847
+ })
19848
+ );
19849
+ }
19850
+ /*
19851
+ * SNIP-29 Paymaster
19852
+ */
19853
+ async buildPaymasterTransaction(calls, paymasterDetails) {
19854
+ if (!paymasterDetails.deploymentData) {
19855
+ const snip9Version = await this.getSnip9Version();
19856
+ if (snip9Version === OutsideExecutionVersion.UNSUPPORTED) {
19857
+ throw Error("Account is not compatible with SNIP-9");
19858
+ }
19859
+ }
19860
+ const parameters = {
19861
+ version: "0x1",
19862
+ feeMode: paymasterDetails.feeMode,
19863
+ timeBounds: paymasterDetails.timeBounds
19864
+ };
19865
+ let transaction;
19866
+ if (paymasterDetails.deploymentData) {
19867
+ if (calls.length > 0) {
19868
+ transaction = {
19869
+ type: "deploy_and_invoke",
19870
+ invoke: { userAddress: this.address, calls },
19871
+ deployment: paymasterDetails.deploymentData
19872
+ };
19873
+ } else {
19874
+ transaction = {
19875
+ type: "deploy",
19876
+ deployment: paymasterDetails.deploymentData
19877
+ };
19878
+ }
19879
+ } else {
19880
+ transaction = {
19881
+ type: "invoke",
19882
+ invoke: { userAddress: this.address, calls }
19883
+ };
19884
+ }
19885
+ return this.paymaster.buildTransaction(transaction, parameters);
19886
+ }
19887
+ async estimatePaymasterTransactionFee(calls, paymasterDetails) {
19888
+ const preparedTransaction = await this.buildPaymasterTransaction(calls, paymasterDetails);
19889
+ return preparedTransaction.fee;
19890
+ }
19891
+ async preparePaymasterTransaction(preparedTransaction) {
19892
+ let transaction;
19893
+ switch (preparedTransaction.type) {
19894
+ case "deploy_and_invoke": {
19895
+ const signature = await this.signMessage(preparedTransaction.typed_data);
19896
+ transaction = {
19897
+ type: "deploy_and_invoke",
19898
+ invoke: {
19899
+ userAddress: this.address,
19900
+ typedData: preparedTransaction.typed_data,
19901
+ signature: signatureToHexArray(signature)
19902
+ },
19903
+ deployment: preparedTransaction.deployment
19904
+ };
19905
+ break;
19906
+ }
19907
+ case "invoke": {
19908
+ const signature = await this.signMessage(preparedTransaction.typed_data);
19909
+ transaction = {
19910
+ type: "invoke",
19911
+ invoke: {
19912
+ userAddress: this.address,
19913
+ typedData: preparedTransaction.typed_data,
19914
+ signature: signatureToHexArray(signature)
19915
+ }
19916
+ };
19917
+ break;
19918
+ }
19919
+ case "deploy": {
19920
+ transaction = {
19921
+ type: "deploy",
19922
+ deployment: preparedTransaction.deployment
19923
+ };
19924
+ break;
19925
+ }
19926
+ default:
19927
+ throw Error("Invalid transaction type");
19928
+ }
19929
+ return transaction;
19930
+ }
19931
+ async executePaymasterTransaction(calls, paymasterDetails, maxFeeInGasToken) {
19932
+ const preparedTransaction = await this.buildPaymasterTransaction(calls, paymasterDetails);
19933
+ assertPaymasterTransactionSafety(
19934
+ preparedTransaction,
19935
+ calls,
19936
+ paymasterDetails,
19937
+ maxFeeInGasToken
19938
+ );
19939
+ const transaction = await this.preparePaymasterTransaction(preparedTransaction);
19940
+ return this.paymaster.executeTransaction(transaction, preparedTransaction.parameters).then((response) => ({ transaction_hash: response.transaction_hash }));
19941
+ }
19942
+ /*
19943
+ * External methods
19944
+ */
19945
+ /**
19946
+ * Get the Starknet ID for an address
19947
+ * @param address - The address to get the Starknet ID for
19948
+ * @param StarknetIdContract - The Starknet ID contract address (optional)
19949
+ * @returns The Starknet ID for the address
19950
+ */
19951
+ async getStarkName(address = this.address, StarknetIdContract2) {
19952
+ return super.getStarkName(address, StarknetIdContract2);
19953
+ }
19954
+ };
19104
19955
  var connect_exports = {};
19105
19956
  __export2(connect_exports, {
19106
19957
  addDeclareTransaction: () => addDeclareTransaction,
@@ -20026,6 +20877,178 @@ function useThresholdSign(opts) {
20026
20877
  finalize
20027
20878
  };
20028
20879
  }
20880
+ var DEFAULTS = {
20881
+ apiBaseUrl: "https://api.chipipay.com/v1",
20882
+ rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet",
20883
+ chainId: "0x534e5f4d41494e",
20884
+ gasTankAddress: "0x232f9c4ec684c03caae94f75987ea0540c06173d96dd5c6705521eb45e28b0a"
20885
+ };
20886
+ async function derivePrivacyAccount(p) {
20887
+ const pool = await core.derivePoolKeypair({
20888
+ anchorSecret: p.anchorSecret,
20889
+ seedDomainTag: p.seedDomainTag
20890
+ });
20891
+ const companion = await core.deriveCompanionKeypair(p.anchorSecret);
20892
+ return {
20893
+ companionAddress: core.deriveCompanionAddress({
20894
+ publicKey: companion.publicKey,
20895
+ classHash: p.classHash
20896
+ }),
20897
+ companionKey: companion.privateKey,
20898
+ classHash: p.classHash,
20899
+ poolKey: BigInt(pool.privateKey)
20900
+ };
20901
+ }
20902
+ function buildCtx(config3, keys) {
20903
+ const rpcUrl = config3.rpcUrl ?? DEFAULTS.rpcUrl;
20904
+ return {
20905
+ provider: new RpcProvider2({ nodeUrl: rpcUrl }),
20906
+ chainId: config3.chainId ?? DEFAULTS.chainId,
20907
+ companionAddress: keys.companionAddress,
20908
+ companionKey: keys.companionKey,
20909
+ classHash: keys.classHash,
20910
+ poolKey: keys.poolKey,
20911
+ provingProvider: new core.ChipiProofProvider({
20912
+ baseUrl: config3.apiBaseUrl ?? DEFAULTS.apiBaseUrl,
20913
+ apiKey: config3.apiPublicKey,
20914
+ getBearerToken: config3.getBearerToken,
20915
+ chainId: config3.chainId ?? DEFAULTS.chainId
20916
+ }),
20917
+ gatewaySubmitUrl: config3.gatewaySubmitUrl,
20918
+ rpcUrl
20919
+ };
20920
+ }
20921
+ async function runShield(input) {
20922
+ const { config: config3, keys } = input;
20923
+ const ctx = buildCtx(config3, keys);
20924
+ input.onStep?.("prepare");
20925
+ input.onStep?.("fund");
20926
+ await core.requestGasFunding(keys.companionAddress, {
20927
+ baseUrl: config3.apiBaseUrl ?? DEFAULTS.apiBaseUrl,
20928
+ apiKey: config3.apiPublicKey,
20929
+ getBearerToken: config3.getBearerToken
20930
+ });
20931
+ if (input.fundDeposit) {
20932
+ input.onStep?.("deposit");
20933
+ await input.fundDeposit(keys.companionAddress, input.amount);
20934
+ }
20935
+ await core.waitForFunding(ctx.provider, keys.companionAddress, {
20936
+ strk: core.GAS_FUND_STRK,
20937
+ token: input.fundDeposit ? { address: input.token, amount: input.amount } : void 0
20938
+ });
20939
+ input.onStep?.("prove");
20940
+ const result = await core.execShield(ctx, input.token, input.amount);
20941
+ input.onStep?.("finish");
20942
+ void core.sweepCompanion({
20943
+ provider: ctx.provider,
20944
+ companionAddress: keys.companionAddress,
20945
+ companionKey: keys.companionKey,
20946
+ gasTank: config3.gasTankAddress ?? DEFAULTS.gasTankAddress
20947
+ });
20948
+ return result;
20949
+ }
20950
+ async function runUnshield(input) {
20951
+ const { config: config3, keys } = input;
20952
+ const ctx = buildCtx(config3, keys);
20953
+ input.onStep?.("prepare");
20954
+ input.onStep?.("fund");
20955
+ await core.requestGasFunding(keys.companionAddress, {
20956
+ baseUrl: config3.apiBaseUrl ?? DEFAULTS.apiBaseUrl,
20957
+ apiKey: config3.apiPublicKey,
20958
+ getBearerToken: config3.getBearerToken
20959
+ });
20960
+ await core.waitForFunding(ctx.provider, keys.companionAddress, { strk: core.GAS_FUND_STRK });
20961
+ input.onStep?.("prove");
20962
+ const result = await core.execUnshield(ctx, input.token, input.amount);
20963
+ input.onStep?.("finish");
20964
+ const swept = await core.sweepCompanion({
20965
+ provider: ctx.provider,
20966
+ companionAddress: keys.companionAddress,
20967
+ companionKey: keys.companionKey,
20968
+ gasTank: config3.gasTankAddress ?? DEFAULTS.gasTankAddress,
20969
+ deliverToken: { address: input.token, to: input.deliverTo },
20970
+ strict: true
20971
+ });
20972
+ if (swept.transactionHash === null) {
20973
+ throw new Error(
20974
+ "unshield_undelivered: the withdrawal settled but delivery to your wallet could not be confirmed \u2014 funds are safe in the companion account; retry"
20975
+ );
20976
+ }
20977
+ return result;
20978
+ }
20979
+ function useShield() {
20980
+ const mutation = reactQuery.useMutation({ mutationFn: runShield });
20981
+ return {
20982
+ shield: mutation.mutate,
20983
+ shieldAsync: mutation.mutateAsync,
20984
+ data: mutation.data,
20985
+ isLoading: mutation.isPending,
20986
+ isError: mutation.isError,
20987
+ error: mutation.error,
20988
+ isSuccess: mutation.isSuccess,
20989
+ reset: mutation.reset
20990
+ };
20991
+ }
20992
+ function useUnshield() {
20993
+ const mutation = reactQuery.useMutation({
20994
+ mutationFn: runUnshield
20995
+ });
20996
+ return {
20997
+ unshield: mutation.mutate,
20998
+ unshieldAsync: mutation.mutateAsync,
20999
+ data: mutation.data,
21000
+ isLoading: mutation.isPending,
21001
+ isError: mutation.isError,
21002
+ error: mutation.error,
21003
+ isSuccess: mutation.isSuccess,
21004
+ reset: mutation.reset
21005
+ };
21006
+ }
21007
+ function netPrivateBalance(events) {
21008
+ const byToken = {};
21009
+ for (const e of events) {
21010
+ const signed = e.direction === "shield" ? e.amount : -e.amount;
21011
+ byToken[e.token] = (byToken[e.token] ?? 0n) + signed;
21012
+ }
21013
+ for (const k of Object.keys(byToken)) if (byToken[k] < 0n) byToken[k] = 0n;
21014
+ return byToken;
21015
+ }
21016
+ function usePrivateBalance(input) {
21017
+ const query = reactQuery.useQuery({
21018
+ queryKey: [
21019
+ "chipi-private-balance",
21020
+ input.mode,
21021
+ // A stale cache here is a stale MONEY balance (review finding m1):
21022
+ // ledger mode keys on a content digest (length alone missed same-count
21023
+ // edits); onchain mode keys on the account AND the token filter.
21024
+ input.mode === "ledger" ? input.events.reduce((h, e) => h + (e.direction === "shield" ? e.amount : -e.amount), 0n).toString() + ":" + input.events.length : input.keys.companionAddress + ":" + (input.tokens ?? []).join(",")
21025
+ ],
21026
+ queryFn: async () => {
21027
+ if (input.mode === "ledger") return netPrivateBalance(input.events);
21028
+ const ctx = buildCtx(input.config, input.keys);
21029
+ const { byToken } = await core.getPrivateBalance({
21030
+ provider: ctx.provider,
21031
+ account: new Account({
21032
+ provider: ctx.provider,
21033
+ address: input.keys.companionAddress,
21034
+ signer: input.keys.companionKey,
21035
+ cairoVersion: "1"
21036
+ }),
21037
+ viewingKey: input.keys.poolKey,
21038
+ provingProvider: ctx.provingProvider,
21039
+ tokens: input.tokens
21040
+ });
21041
+ return byToken;
21042
+ }
21043
+ });
21044
+ return {
21045
+ byToken: query.data ?? {},
21046
+ isLoading: query.isLoading,
21047
+ isError: query.isError,
21048
+ error: query.error,
21049
+ refetch: query.refetch
21050
+ };
21051
+ }
20029
21052
  /*! Bundled license information:
20030
21053
 
20031
21054
  @scure/base/lib/esm/index.js:
@@ -20050,6 +21073,8 @@ pako/dist/pako.esm.mjs:
20050
21073
  (*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) *)
20051
21074
  */
20052
21075
 
21076
+ exports.derivePrivacyAccount = derivePrivacyAccount;
21077
+ exports.netPrivateBalance = netPrivateBalance;
20053
21078
  exports.useAddSessionKeyToContract = useAddSessionKeyToContract;
20054
21079
  exports.useApprove = useApprove;
20055
21080
  exports.useCallAnyContract = useCallAnyContract;
@@ -20071,14 +21096,17 @@ exports.useGetWallet = useGetWallet;
20071
21096
  exports.useGuardianRecovery = useGuardianRecovery;
20072
21097
  exports.useMigrateWalletToPasskey = useMigrateWalletToPasskey;
20073
21098
  exports.useMigrateWalletToShhh = useMigrateWalletToShhh;
21099
+ exports.usePrivateBalance = usePrivateBalance;
20074
21100
  exports.usePurchaseSku = usePurchaseSku;
20075
21101
  exports.useRecordSendTransaction = useRecordSendTransaction;
20076
21102
  exports.useRevokeSessionKey = useRevokeSessionKey;
20077
21103
  exports.useShhhSigner = useShhhSigner;
21104
+ exports.useShield = useShield;
20078
21105
  exports.useSignTypedData = useSignTypedData;
20079
21106
  exports.useSyncOnChainTransfers = useSyncOnChainTransfers;
20080
21107
  exports.useThresholdSign = useThresholdSign;
20081
21108
  exports.useTransfer = useTransfer;
21109
+ exports.useUnshield = useUnshield;
20082
21110
  exports.useUpdateWalletEncryption = useUpdateWalletEncryption;
20083
21111
  exports.useX402Payment = useX402Payment;
20084
21112
  //# sourceMappingURL=hooks.js.map