@smoothsend/sdk 2.2.0 → 2.2.2

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.
Files changed (36) hide show
  1. package/README.md +121 -201
  2. package/dist/avax/SmoothSendAvaxSubmitter.d.ts +79 -0
  3. package/dist/avax/SmoothSendAvaxSubmitter.d.ts.map +1 -0
  4. package/dist/avax/index.d.ts +7 -0
  5. package/dist/avax/index.d.ts.map +1 -0
  6. package/dist/avax/publicAaDefaults.d.ts +16 -0
  7. package/dist/avax/publicAaDefaults.d.ts.map +1 -0
  8. package/dist/avax/simpleAccountFactory.d.ts +44 -0
  9. package/dist/avax/simpleAccountFactory.d.ts.map +1 -0
  10. package/dist/avax/types.d.ts +86 -0
  11. package/dist/avax/types.d.ts.map +1 -0
  12. package/dist/avax/useSmoothSendAvax.d.ts +60 -0
  13. package/dist/avax/useSmoothSendAvax.d.ts.map +1 -0
  14. package/dist/avax/viemHelpers.d.ts +40 -0
  15. package/dist/avax/viemHelpers.d.ts.map +1 -0
  16. package/dist/index.d.ts +440 -15
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.esm.js +2370 -131
  19. package/dist/index.esm.js.map +1 -1
  20. package/dist/index.js +2390 -133
  21. package/dist/index.js.map +1 -1
  22. package/dist/session/SmoothSendSession.d.ts +1 -6
  23. package/dist/session/SmoothSendSession.d.ts.map +1 -1
  24. package/dist/session/constants.d.ts +17 -0
  25. package/dist/session/constants.d.ts.map +1 -0
  26. package/dist/true-gasless/TrueGaslessClient.d.ts +72 -0
  27. package/dist/true-gasless/TrueGaslessClient.d.ts.map +1 -0
  28. package/dist/true-gasless/index.d.ts +2 -0
  29. package/dist/true-gasless/index.d.ts.map +1 -0
  30. package/dist/utils/http.d.ts +2 -0
  31. package/dist/utils/http.d.ts.map +1 -1
  32. package/dist/wallet-adapter/SmoothSendTransactionSubmitter.d.ts +53 -2
  33. package/dist/wallet-adapter/SmoothSendTransactionSubmitter.d.ts.map +1 -1
  34. package/dist/wallet-adapter/useSmoothSend.d.ts +10 -5
  35. package/dist/wallet-adapter/useSmoothSend.d.ts.map +1 -1
  36. package/package.json +18 -7
package/dist/index.js CHANGED
@@ -3,9 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var axios = require('axios');
6
- var react = require('react');
7
- var walletAdapterReact = require('@aptos-labs/wallet-adapter-react');
8
6
  var tsSdk = require('@aptos-labs/ts-sdk');
7
+ var require$$0 = require('react');
8
+ var walletAdapterReact = require('@aptos-labs/wallet-adapter-react');
9
+ var viem = require('viem');
10
+ var accountAbstraction = require('viem/account-abstraction');
11
+ var actions = require('viem/actions');
9
12
 
10
13
  /**
11
14
  * Error handling system for SmoothSend SDK v2
@@ -406,7 +409,7 @@ class HttpClient {
406
409
  this.apiKey = config.apiKey;
407
410
  this.network = config.network || 'testnet';
408
411
  this.maxRetries = config.retries || 3;
409
- this.baseURL = 'https://proxy.smoothsend.xyz';
412
+ this.baseURL = config.baseUrl || 'https://proxy.smoothsend.xyz';
410
413
  this.isProxyMode = true;
411
414
  this.includeOrigin = config.includeOrigin || false;
412
415
  const headers = {
@@ -415,10 +418,9 @@ class HttpClient {
415
418
  'X-Network': this.network,
416
419
  ...config.customHeaders,
417
420
  };
418
- // Add Origin header if in browser and includeOrigin is true
419
- if (this.includeOrigin && typeof window !== 'undefined' && window.location) {
420
- headers['Origin'] = window.location.origin;
421
- }
421
+ // Browsers forbid setting the `Origin` header manually ("unsafe header").
422
+ // The browser will set it automatically on cross-origin requests.
423
+ // If callers need the origin explicitly, they can pass a custom header (e.g. `X-Origin`).
422
424
  this.client = axios.create({
423
425
  baseURL: this.baseURL,
424
426
  timeout: config.timeout || 30000,
@@ -2066,6 +2068,24 @@ class SmoothSendSDK {
2066
2068
  }
2067
2069
  }
2068
2070
 
2071
+ /**
2072
+ * Pre-compiled Move script bytecode for add_permissioned_handle
2073
+ *
2074
+ * This bytecode is used to register session keys on-chain via the
2075
+ * `0x1::permissioned_delegation::add_permissioned_handle` function.
2076
+ *
2077
+ * The function cannot be called as an entry function directly — only via a Move script.
2078
+ * This bytecode handles:
2079
+ * - Takes the session public key bytes (vector<u8>) as input
2080
+ * - Constructs DelegationKey from the bytes
2081
+ * - Passes option::none() for rate limiter
2082
+ * - Hardcodes u64::MAX for expiration (on-chain handle never expires)
2083
+ *
2084
+ * Source: aptos-labs/aptos-ts-sdk tests/e2e/transaction/helper.ts
2085
+ */
2086
+ const ADD_PERMISSIONED_HANDLE_BYTECODE = 'a11ceb0b0700000a0801001002101603262c04520405563d079301d70208ea034010aa041f0103010401060109010d010e011201140002080002080700030b0700040c0f0005100701000001050301010001020704050001030a05060001050f01080100010311090a000106130b01000107150b0100010002030702060c0a020001080001060c010a02010801010802010803010b0401090004060c08020b0401080303010c03060c060c03050802030b04010803060c0c083c53454c463e5f30046d61696e094170746f73436f696e0a6170746f735f636f696e04636f696e196d6967726174655f746f5f66756e6769626c655f73746f72650765643235353139256e65775f756e76616c6964617465645f7075626c69635f6b65795f66726f6d5f627974657314556e76616c6964617465645075626c69634b657917' +
2087
+ '7065726d697373696f6e65645f64656c65676174696f6e0f67656e5f656432353531395f6b65790d44656c65676174696f6e4b65790b526174654c696d697465720c726174655f6c696d69746572066f7074696f6e046e6f6e65064f7074696f6e176164645f7065726d697373696f6e65645f68616e646c65167072696d6172795f66756e6769626c655f73746f7265146772616e745f6170745f7065726d697373696f6e167472616e73616374696f6e5f76616c69646174696f6e146772616e745f6761735f7065726d697373696f6effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000114636f6d70696c6174696f6e5f6d65746164617461090003322e3003322e3100000c170a0038000b01110111020c020a0038010c040b020b040600a0724e1809000011040c060a000e060600e1f5050000000011050b000e060600e1f50500000000110602';
2088
+
2069
2089
  /**
2070
2090
  * SmoothSend Transaction Submitter
2071
2091
  *
@@ -2103,6 +2123,7 @@ class SmoothSendSDK {
2103
2123
  */
2104
2124
  class SmoothSendTransactionSubmitter {
2105
2125
  constructor(config) {
2126
+ this._session = null;
2106
2127
  this.sponsoredFunctionsCache = null;
2107
2128
  this.sponsoredFunctionsCacheAt = 0;
2108
2129
  this.SPONSORED_CACHE_TTL = 5 * 60 * 1000; // 5 minutes
@@ -2127,7 +2148,177 @@ class SmoothSendTransactionSubmitter {
2127
2148
  this.timeout = config.timeout || 30000;
2128
2149
  this.getCaptchaToken = config.getCaptchaToken;
2129
2150
  this.debug = config.debug || false;
2151
+ this.sessionEnabled = config.session || false;
2152
+ this.sessionDuration = config.sessionDuration || '24h';
2153
+ }
2154
+ // ─── Session key methods ────────────────────────────────────────────────────
2155
+ /**
2156
+ * Whether a valid session is currently active.
2157
+ */
2158
+ hasSession() {
2159
+ return this._session !== null && Date.now() < this._session.expiresAtMs;
2160
+ }
2161
+ /**
2162
+ * Create a session key for the given master account.
2163
+ * Called once by useSmoothSend when session: true and no session exists.
2164
+ * SmoothSend pays gas for the setup transaction.
2165
+ *
2166
+ * @param masterAccount - The user's wallet account (from wallet adapter)
2167
+ */
2168
+ async createSession(masterAccount) {
2169
+ const network = this.network === 'mainnet' ? tsSdk.Network.MAINNET : tsSdk.Network.TESTNET;
2170
+ const aptosClient = new tsSdk.Aptos(new tsSdk.AptosConfig({ network }));
2171
+ // Generate fresh in-memory session keypair
2172
+ const sessionAccount = tsSdk.Account.generate();
2173
+ const expiresAtMs = Date.now() + this._parseDuration(this.sessionDuration);
2174
+ // Step 1: Register session key on-chain via pre-compiled Move script
2175
+ const setupTx = await aptosClient.transaction.build.simple({
2176
+ sender: masterAccount.accountAddress,
2177
+ withFeePayer: true,
2178
+ data: {
2179
+ bytecode: ADD_PERMISSIONED_HANDLE_BYTECODE,
2180
+ functionArguments: [tsSdk.MoveVector.U8(sessionAccount.publicKey.toUint8Array())],
2181
+ },
2182
+ options: {
2183
+ replayProtectionNonce: BigInt(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)),
2184
+ },
2185
+ });
2186
+ const senderAuth = await this.signSenderAuthenticator(masterAccount, setupTx, aptosClient);
2187
+ const setupResult = await this.submitTransaction({
2188
+ aptosConfig: aptosClient.config,
2189
+ transaction: setupTx,
2190
+ senderAuthenticator: senderAuth,
2191
+ });
2192
+ await aptosClient.waitForTransaction({ transactionHash: setupResult.hash });
2193
+ if (this.debug) {
2194
+ console.log('[SmoothSend] Session key registered on-chain:', setupResult.hash);
2195
+ }
2196
+ // Step 2: Enable account abstraction (idempotent — skip if already on)
2197
+ const aaEnabled = await aptosClient.abstraction.isAccountAbstractionEnabled({
2198
+ accountAddress: masterAccount.accountAddress,
2199
+ authenticationFunction: '0x1::permissioned_delegation::authenticate',
2200
+ });
2201
+ if (!aaEnabled) {
2202
+ const aaTx = await aptosClient.transaction.build.simple({
2203
+ sender: masterAccount.accountAddress,
2204
+ withFeePayer: true,
2205
+ data: {
2206
+ function: '0x1::account_abstraction::add_authentication_function',
2207
+ functionArguments: [
2208
+ tsSdk.AccountAddress.fromString('0x1'),
2209
+ 'permissioned_delegation',
2210
+ 'authenticate',
2211
+ ],
2212
+ },
2213
+ options: {
2214
+ replayProtectionNonce: BigInt(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)),
2215
+ },
2216
+ });
2217
+ const aaAuth = await this.signSenderAuthenticator(masterAccount, aaTx, aptosClient);
2218
+ const aaResult = await this.submitTransaction({
2219
+ aptosConfig: aptosClient.config,
2220
+ transaction: aaTx,
2221
+ senderAuthenticator: aaAuth,
2222
+ });
2223
+ await aptosClient.waitForTransaction({ transactionHash: aaResult.hash });
2224
+ if (this.debug) {
2225
+ console.log('[SmoothSend] Account abstraction enabled:', aaResult.hash);
2226
+ }
2227
+ }
2228
+ // Build AbstractedAccount — signs future txs with session key,
2229
+ // sender on-chain = master address, chain validates via permissioned_delegation
2230
+ const abstractedAccount = tsSdk.AbstractedAccount.fromPermissionedSigner({
2231
+ signer: sessionAccount,
2232
+ accountAddress: masterAccount.accountAddress,
2233
+ });
2234
+ this._session = {
2235
+ sessionAccount,
2236
+ abstractedAccount,
2237
+ masterAddress: masterAccount.accountAddress,
2238
+ expiresAtMs,
2239
+ aptosClient,
2240
+ };
2241
+ }
2242
+ async isPermissionedSignerEnabled(aptosClient) {
2243
+ try {
2244
+ const result = await aptosClient.view({
2245
+ payload: {
2246
+ function: '0x1::features::is_permissioned_signer_enabled',
2247
+ functionArguments: [],
2248
+ },
2249
+ });
2250
+ return Array.isArray(result) && result[0] === true;
2251
+ }
2252
+ catch (error) {
2253
+ if (this.debug) {
2254
+ console.warn('[SmoothSend] Failed to probe permissioned signer feature:', error);
2255
+ }
2256
+ return false;
2257
+ }
2258
+ }
2259
+ async signSenderAuthenticator(signer, transaction, aptosClient) {
2260
+ const walletLikeSigner = signer;
2261
+ // Wallet-adapter compatible path (returns { authenticator, rawTransaction } in v8)
2262
+ if (typeof walletLikeSigner?.signTransactionWithAuthenticator === 'function') {
2263
+ const result = await walletLikeSigner.signTransactionWithAuthenticator(transaction);
2264
+ return (result?.authenticator ?? result);
2265
+ }
2266
+ // Native ts-sdk account path
2267
+ return aptosClient.transaction.sign({
2268
+ signer,
2269
+ transaction,
2270
+ });
2271
+ }
2272
+ /**
2273
+ * Submit a transaction using the active session key — no wallet popup.
2274
+ * Called by useSmoothSend after session is established.
2275
+ */
2276
+ async submitWithSession(functionName, functionArguments = [], typeArguments = []) {
2277
+ if (!this._session || !this.hasSession()) {
2278
+ throw new Error('[SmoothSend] No active session. Call createSession() first.');
2279
+ }
2280
+ const { abstractedAccount, masterAddress, aptosClient } = this._session;
2281
+ const tx = await aptosClient.transaction.build.simple({
2282
+ sender: masterAddress,
2283
+ withFeePayer: true,
2284
+ data: {
2285
+ function: functionName,
2286
+ functionArguments,
2287
+ ...(typeArguments.length > 0 ? { typeArguments } : {}),
2288
+ },
2289
+ options: {
2290
+ replayProtectionNonce: BigInt(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)),
2291
+ },
2292
+ });
2293
+ const senderAuth = aptosClient.transaction.sign({
2294
+ signer: abstractedAccount,
2295
+ transaction: tx,
2296
+ });
2297
+ return this.submitTransaction({
2298
+ aptosConfig: aptosClient.config,
2299
+ transaction: tx,
2300
+ senderAuthenticator: senderAuth,
2301
+ });
2130
2302
  }
2303
+ _parseDuration(duration) {
2304
+ if (duration === 'never') {
2305
+ // Client-side "never expires" mode; on-chain handle already uses u64::MAX.
2306
+ return Number.MAX_SAFE_INTEGER;
2307
+ }
2308
+ const n = parseInt(duration, 10);
2309
+ if (isNaN(n))
2310
+ throw new Error(`Invalid sessionDuration "${duration}". Use e.g. "2h", "24h", "7d", or "never".`);
2311
+ if (duration.endsWith('s'))
2312
+ return n * 1000;
2313
+ if (duration.endsWith('m'))
2314
+ return n * 60 * 1000;
2315
+ if (duration.endsWith('h'))
2316
+ return n * 3600 * 1000;
2317
+ if (duration.endsWith('d'))
2318
+ return n * 86400 * 1000;
2319
+ throw new Error(`Unknown unit in "${duration}". Supported: s, m, h, d, or "never".`);
2320
+ }
2321
+ // ─── Transaction submission ──────────────────────────────────────────────────
2131
2322
  /**
2132
2323
  * Submit a transaction through SmoothSend's gasless relayer
2133
2324
  *
@@ -2335,6 +2526,10 @@ function createSmoothSendSubmitter(apiKey, options) {
2335
2526
  * - Function in allowlist → fee-payer gasless path via SmoothSend
2336
2527
  * - Function not in allowlist → regular wallet submission (user pays gas)
2337
2528
  *
2529
+ * When submitter has session: true, the first transaction triggers a one-time
2530
+ * wallet sign to register a session key on-chain. Every transaction after that
2531
+ * is signed silently — zero wallet popups.
2532
+ *
2338
2533
  * Requires: react >=17, @aptos-labs/wallet-adapter-react >=3, @aptos-labs/ts-sdk >=1
2339
2534
  *
2340
2535
  * @example
@@ -2346,25 +2541,97 @@ function createSmoothSendSubmitter(apiKey, options) {
2346
2541
  * await signAndSubmitTransaction({ data: { function: '0x1::coin::transfer', functionArguments: [to, amount] } });
2347
2542
  * ```
2348
2543
  */
2349
- /**
2350
- * useSmoothSend
2351
- *
2352
- * @param submitter - A SmoothSendTransactionSubmitter instance (created once, e.g. at module scope)
2353
- */
2354
2544
  function useSmoothSend(submitter) {
2355
2545
  const { account, signTransaction, signAndSubmitTransaction: walletSignAndSubmit, } = walletAdapterReact.useWallet();
2546
+ // Track session state reactively so UI updates when session is created/expires
2547
+ const initialHasSession = submitter?.hasSession?.() ?? false;
2548
+ const [hasSessionState, setHasSessionState] = require$$0.useState(initialHasSession);
2356
2549
  // Prefetch the sponsored-functions list on mount so the first transaction
2357
2550
  // benefits from an already-populated cache with no added latency.
2358
- react.useEffect(() => {
2551
+ require$$0.useEffect(() => {
2359
2552
  submitter.getSponsoredFunctions().catch(() => {
2360
2553
  // Fail-open: getSponsoredFunctions already handles errors internally
2361
2554
  });
2362
2555
  }, [submitter]);
2363
- const signAndSubmitTransaction = react.useCallback(async (input) => {
2556
+ require$$0.useEffect(() => {
2557
+ if (!submitter)
2558
+ return;
2559
+ const refresh = () => {
2560
+ const hasSession = submitter.hasSession?.() ?? false;
2561
+ setHasSessionState(hasSession);
2562
+ };
2563
+ refresh();
2564
+ const timer = setInterval(refresh, 1000);
2565
+ return () => clearInterval(timer);
2566
+ }, [submitter]);
2567
+ const signAndSubmitTransaction = require$$0.useCallback(async (input) => {
2364
2568
  if (!account?.address) {
2365
2569
  throw new Error('[SmoothSend] Wallet not connected');
2366
2570
  }
2367
2571
  const functionName = input?.data?.function ?? '';
2572
+ console.log('[SmoothSend] signAndSubmitTransaction called:', {
2573
+ functionName,
2574
+ sessionEnabled: submitter.sessionEnabled,
2575
+ hasSession: submitter.hasSession(),
2576
+ });
2577
+ // ── Session key path ────────────────────────────────────────────────────
2578
+ // When session: true, bypass wallet signing entirely after first setup.
2579
+ // Still respects the per-function allowlist — non-sponsored functions
2580
+ // fall through to regular wallet submission (user pays gas).
2581
+ if (submitter.sessionEnabled) {
2582
+ console.log('[SmoothSend] Session mode enabled');
2583
+ // Check allowlist first — no point setting up a session for a non-sponsored function
2584
+ const canGoGasless = typeof signTransaction === 'function';
2585
+ const sponsored = canGoGasless && (await submitter.isSponsored(functionName));
2586
+ console.log('[SmoothSend] Sponsored check:', { sponsored, canGoGasless });
2587
+ if (sponsored) {
2588
+ // If no active session, do the one-time setup
2589
+ if (!submitter.hasSession()) {
2590
+ console.log('[SmoothSend] No session, creating one...');
2591
+ if (!signTransaction) {
2592
+ console.warn('[SmoothSend] session: true requires signTransaction support. Falling back to regular submission.');
2593
+ }
2594
+ else {
2595
+ try {
2596
+ // Adapter object only needs accountAddress + signTransactionWithAuthenticator.
2597
+ // The submitter handles both wallet-adapter and native signer shapes.
2598
+ const walletAccount = {
2599
+ accountAddress: account.address,
2600
+ signTransactionWithAuthenticator: async (tx) => {
2601
+ const rawResult = await signTransaction({
2602
+ transactionOrPayload: tx,
2603
+ asFeePayer: false,
2604
+ });
2605
+ return rawResult?.authenticator ?? rawResult;
2606
+ },
2607
+ };
2608
+ await submitter.createSession(walletAccount);
2609
+ console.log('[SmoothSend] Session created successfully');
2610
+ setHasSessionState(submitter.hasSession?.() ?? false);
2611
+ }
2612
+ catch (err) {
2613
+ console.warn('[SmoothSend] Session setup failed, falling back to regular gasless:', err.message);
2614
+ // Fall through to normal gasless path below
2615
+ }
2616
+ }
2617
+ }
2618
+ // If session is now active, submit silently — no wallet popup
2619
+ if (submitter.hasSession()) {
2620
+ console.log('[SmoothSend] Session is active, using submitWithSession');
2621
+ try {
2622
+ return await submitter.submitWithSession(functionName, input.data?.functionArguments ?? [], input.data?.typeArguments ?? []);
2623
+ }
2624
+ catch (err) {
2625
+ // Session may have expired mid-flight — clear it and fall through
2626
+ console.warn('[SmoothSend] Session submit failed, will re-auth on next call:', err.message);
2627
+ setHasSessionState(false);
2628
+ // Fall through to regular gasless path for this call
2629
+ }
2630
+ }
2631
+ }
2632
+ // Non-sponsored function → fall through to walletSignAndSubmit below
2633
+ }
2634
+ // ── Regular gasless path (TransactionSubmitter) ─────────────────────────
2368
2635
  // signTransaction (sign-only) must be available for the gasless path.
2369
2636
  // Most modern wallets (Petra, Nightly) support it. If absent, fall through.
2370
2637
  const canGoGasless = typeof signTransaction === 'function';
@@ -2420,134 +2687,1978 @@ function useSmoothSend(submitter) {
2420
2687
  // Not sponsored or signTransaction unavailable → regular wallet submission
2421
2688
  return walletSignAndSubmit(input);
2422
2689
  }, [account, signTransaction, walletSignAndSubmit, submitter]);
2423
- return { signAndSubmitTransaction };
2690
+ return {
2691
+ signAndSubmitTransaction,
2692
+ hasSession: hasSessionState,
2693
+ };
2424
2694
  }
2425
2695
 
2426
- // ─── Pre-compiled Move script bytecode ───────────────────────────────────────
2427
- // Source: aptos-labs/aptos-ts-sdk tests/e2e/transaction/helper.ts
2428
- // This script calls permissioned_delegation::add_permissioned_handle, which is
2429
- // NOT an entry function and cannot be called directly — only via a Move script.
2430
- // Takes one argument: the session public key bytes (vector<u8>).
2431
- const ADD_PERMISSIONED_HANDLE_BYTECODE = 'a11ceb0b0700000a0801001002101603262c04520405563d079301d70208ea034010aa041f0103010401060109010d010e011201140002080002080700030b0700040c0f0005100701000001050301010001020704050001030a05060001050f01080100010311090a000106130b01000107150b0100010002030702060c0a020001080001060c010a02010801010802010803010b0401090004060c08020b0401080303010c03060c060c03050802030b04010803060c0c083c53454c463e5f30046d61696e094170746f73436f696e0a6170746f735f636f696e04636f696e196d6967726174655f746f5f66756e6769626c655f73746f72650765643235353139256e65775f756e76616c6964617465645f7075626c69635f6b65795f66726f6d5f627974657314556e76616c6964617465645075626c69634b657917' +
2432
- '7065726d697373696f6e65645f64656c65676174696f6e0f67656e5f656432353531395f6b65790d44656c65676174696f6e4b65790b526174654c696d697465720c726174655f6c696d69746572066f7074696f6e046e6f6e65064f7074696f6e176164645f7065726d697373696f6e65645f68616e646c65167072696d6172795f66756e6769626c655f73746f7265146772616e745f6170745f7065726d697373696f6e167472616e73616374696f6e5f76616c69646174696f6e146772616e745f6761735f7065726d697373696f6effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000114636f6d70696c6174696f6e5f6d65746164617461090003322e3003322e3100000c170a0038000b01110111020c020a0038010c040b020b040600a0724e1809000011040c060a000e060600e1f5050000000011050b000e060600e1f50500000000110602';
2433
- // ─── helpers ────────────────────────────────────────────────────────────────
2434
- function parseDurationToSeconds(duration) {
2435
- const n = parseInt(duration, 10);
2436
- if (isNaN(n))
2437
- throw new Error(`Invalid duration "${duration}". Use e.g. "2h", "24h", "7d".`);
2438
- if (duration.endsWith('s'))
2439
- return n;
2440
- if (duration.endsWith('m'))
2441
- return n * 60;
2442
- if (duration.endsWith('h'))
2443
- return n * 3600;
2444
- if (duration.endsWith('d'))
2445
- return n * 86400;
2446
- throw new Error(`Unknown duration unit in "${duration}". Supported: s, m, h, d.`);
2447
- }
2448
- // ─── SmoothSendSession ───────────────────────────────────────────────────────
2449
2696
  /**
2450
- * @experimental
2451
- * Session keys require ACCOUNT_ABSTRACTION (feature 85) and PERMISSIONED_SIGNER (feature 84)
2452
- * to be enabled on the Aptos network. As of now these features are only live on devnet/local node.
2453
- * This will be fully released when the features are activated on testnet and mainnet.
2454
- *
2455
- * A session that lets your app submit transactions on behalf of a user
2456
- * without any wallet popup after the initial one-time setup.
2457
- *
2458
- * Uses Aptos AIP-103 Permissioned Signers — authorization is enforced
2459
- * on-chain by `0x1::permissioned_delegation`. No custom Move contract needed.
2460
- *
2461
- * @example
2462
- * // 1. One-time setup (user signs once — can be keyless/Google login)
2463
- * const session = await SmoothSendSession.create({
2464
- * signer: keylessAccount,
2465
- * expiresIn: '24h',
2466
- * }, submitter)
2697
+ * Avalanche ERC-4337 (EntryPoint v0.7) via SmoothSend gateway — same idea as Aptos submitter.
2467
2698
  *
2468
- * // 2. Every action after — zero popups, zero gas
2469
- * await session.submit('0xgame::player::move', ['north'])
2470
- * await session.submit('0xgame::player::attack', [enemyId])
2699
+ * Minimal dApp flow:
2700
+ * ```ts
2701
+ * const avax = new SmoothSendAvaxSubmitter({ apiKey, network: 'testnet' });
2702
+ * await avax.submitSponsoredUserOperation({ userOp: draft, signUserOp: wallet.sign });
2703
+ * ```
2471
2704
  */
2472
- class SmoothSendSession {
2473
- constructor(args) {
2474
- this.sessionAccount = args.sessionAccount;
2475
- this.abstractedAccount = args.abstractedAccount;
2476
- this.masterAddress = args.masterAddress;
2477
- this.expiresAtMs = args.expiresAtMs;
2478
- this.submitter = args.submitter;
2479
- this.aptosClient = args.aptosClient;
2480
- this._network = args.network;
2705
+ const DEFAULT_GATEWAY = 'https://proxy.smoothsend.xyz';
2706
+ /** Strip ethers@v6 UTF-8 decode noise from bundler JSON-RPC errors (viem shows as “internal error … Details”). */
2707
+ function sanitizeAvaxBundlerRpcMessage(raw) {
2708
+ if (raw.includes('invalid codepoint') ||
2709
+ raw.includes('INVALID_ARGUMENT') ||
2710
+ raw.includes('MISSING_CONTINUE')) {
2711
+ return 'RPC reverted; revert payload could not be decoded as text (usually EntryPoint/account — trace tx on explorer or update bundler).';
2712
+ }
2713
+ return raw;
2714
+ }
2715
+ class SmoothSendAvaxSubmitter {
2716
+ constructor(config) {
2717
+ this.config = config;
2718
+ this.rpcId = 1;
2719
+ if (!config?.apiKey) {
2720
+ throw new Error('[SmoothSendAvaxSubmitter] apiKey is required');
2721
+ }
2722
+ const headers = {
2723
+ 'X-Chain': (config.chain ?? 'avalanche').toLowerCase(),
2724
+ };
2725
+ if (config.corsOrigin?.trim()) {
2726
+ headers.Origin = config.corsOrigin.trim();
2727
+ }
2728
+ this.http = new HttpClient({
2729
+ apiKey: config.apiKey,
2730
+ network: config.network ?? 'testnet',
2731
+ baseUrl: config.gatewayUrl ?? DEFAULT_GATEWAY,
2732
+ timeout: config.timeout ?? 45000,
2733
+ customHeaders: headers,
2734
+ });
2735
+ }
2736
+ getConfig() {
2737
+ return { ...this.config };
2738
+ }
2739
+ /** Merge gas estimate fields into a partial UserOp */
2740
+ static applyGasEstimate(userOp, gas) {
2741
+ return {
2742
+ ...userOp,
2743
+ preVerificationGas: gas.preVerificationGas,
2744
+ verificationGasLimit: gas.verificationGasLimit,
2745
+ callGasLimit: gas.callGasLimit,
2746
+ paymasterVerificationGasLimit: gas.paymasterVerificationGasLimit ??
2747
+ userOp.paymasterVerificationGasLimit,
2748
+ paymasterPostOpGasLimit: gas.paymasterPostOpGasLimit ?? userOp.paymasterPostOpGasLimit,
2749
+ };
2750
+ }
2751
+ /** Attach packed paymaster data returned from {@link paymasterSign} */
2752
+ static applyPaymasterAndData(userOp, paymasterAndData) {
2753
+ return {
2754
+ ...userOp,
2755
+ paymasterAndData,
2756
+ paymaster: undefined,
2757
+ paymasterData: undefined,
2758
+ paymasterVerificationGasLimit: undefined,
2759
+ paymasterPostOpGasLimit: undefined,
2760
+ };
2761
+ }
2762
+ async getChainId() {
2763
+ return this.rpc('eth_chainId', []);
2764
+ }
2765
+ async getSupportedEntryPoints() {
2766
+ return this.rpc('eth_supportedEntryPoints', []);
2767
+ }
2768
+ async estimateUserOperationGas(userOp, entryPoint) {
2769
+ return this.rpc('eth_estimateUserOperationGas', [
2770
+ userOp,
2771
+ entryPoint,
2772
+ ]);
2773
+ }
2774
+ async sendUserOperation(userOp, entryPoint) {
2775
+ return this.rpc('eth_sendUserOperation', [userOp, entryPoint]);
2776
+ }
2777
+ async getUserOperationReceipt(userOpHash) {
2778
+ return this.rpc('eth_getUserOperationReceipt', [userOpHash]);
2779
+ }
2780
+ async waitForUserOperationReceipt(userOpHash, options) {
2781
+ const pollMs = options?.pollMs ?? 2000;
2782
+ const timeoutMs = options?.timeoutMs ?? 120000;
2783
+ const deadline = Date.now() + timeoutMs;
2784
+ while (Date.now() < deadline) {
2785
+ const receipt = await this.getUserOperationReceipt(userOpHash);
2786
+ if (receipt)
2787
+ return receipt;
2788
+ await new Promise((r) => setTimeout(r, pollMs));
2789
+ }
2790
+ return null;
2791
+ }
2792
+ async paymasterSign(body) {
2793
+ const res = await this.http.post('/api/v1/bundler/paymaster/sign', body);
2794
+ if (!res.success || !res.data) {
2795
+ throw new Error('[SmoothSendAvaxSubmitter] paymasterSign failed');
2796
+ }
2797
+ const data = res.data;
2798
+ if (!data.success) {
2799
+ throw new Error(`[SmoothSendAvaxSubmitter] paymasterSign: ${data.error ?? 'unknown error'}`);
2800
+ }
2801
+ return data;
2802
+ }
2803
+ async getBundlerHealth() {
2804
+ const res = await this.http.get('/api/v1/bundler/health');
2805
+ if (!res.success)
2806
+ throw new Error('[SmoothSendAvaxSubmitter] health failed');
2807
+ return res.data;
2481
2808
  }
2482
2809
  /**
2483
- * Create a new session.
2484
- *
2485
- * Registers the session key on-chain via
2486
- * `0x1::permissioned_delegation::add_permissioned_handle`.
2487
- * SmoothSend pays the gas for this setup transaction too.
2488
- *
2489
- * After this returns, the user never needs to approve anything again
2490
- * until the session expires or is revoked.
2810
+ * One call: estimate gas → paymaster/sign → merge → your sign → send → (optional) wait for receipt.
2491
2811
  */
2492
- static async create(options, submitter) {
2493
- // Resolve network from options or submitter config
2494
- const network = options.network ?? submitter.getConfig().network ?? 'testnet';
2495
- const aptosNetwork = network === 'mainnet' ? tsSdk.Network.MAINNET : tsSdk.Network.TESTNET;
2496
- const aptosClient = new tsSdk.Aptos(new tsSdk.AptosConfig({ network: aptosNetwork }));
2497
- // Generate a fresh Ed25519 session keypair (lives in memory, never persisted)
2498
- const sessionAccount = tsSdk.Account.generate();
2499
- // Client-side expiry tracking (the bytecode script doesn't take an expiry arg)
2500
- const nowSecs = Math.floor(Date.now() / 1000);
2501
- const expirationTimeSecs = nowSecs + parseDurationToSeconds(options.expiresIn);
2502
- // Step 1: Register the session key on-chain via a pre-compiled Move script.
2503
- // add_permissioned_handle is NOT an entry function — only callable from a Move script.
2504
- // Must happen BEFORE enabling account abstraction.
2505
- const setupTx = await aptosClient.transaction.build.simple({
2506
- sender: options.signer.accountAddress,
2507
- withFeePayer: true,
2508
- data: {
2509
- bytecode: ADD_PERMISSIONED_HANDLE_BYTECODE,
2510
- functionArguments: [tsSdk.MoveVector.U8(sessionAccount.publicKey.toUint8Array())],
2511
- },
2512
- options: {
2513
- replayProtectionNonce: BigInt(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)),
2514
- },
2515
- });
2516
- const senderAuth = aptosClient.transaction.sign({
2517
- signer: options.signer,
2518
- transaction: setupTx,
2519
- });
2520
- const setupResult = await submitter.submitTransaction({
2521
- aptosConfig: aptosClient.config,
2522
- transaction: setupTx,
2523
- senderAuthenticator: senderAuth,
2812
+ async submitSponsoredUserOperation(opts) {
2813
+ const entryPoint = opts.entryPoint ?? (await this.getSupportedEntryPoints())[0];
2814
+ if (!entryPoint) {
2815
+ throw new Error('[SmoothSendAvaxSubmitter] no EntryPoint from bundler');
2816
+ }
2817
+ let userOp = {
2818
+ ...opts.userOp,
2819
+ signature: opts.userOp.signature ?? '0x',
2820
+ };
2821
+ const gas = await this.estimateUserOperationGas(userOp, entryPoint);
2822
+ userOp = SmoothSendAvaxSubmitter.applyGasEstimate(userOp, gas);
2823
+ const signedPm = await this.paymasterSign({
2824
+ mode: opts.mode ?? 'developer-sponsored',
2825
+ userOp,
2826
+ ...opts.paymaster,
2524
2827
  });
2525
- await aptosClient.waitForTransaction({ transactionHash: setupResult.hash });
2526
- // Step 2: Enable account abstraction — tells the chain to use
2527
- // 0x1::permissioned_delegation::authenticate for this account.
2528
- // Idempotent — skip if already enabled.
2529
- const aaEnabled = await aptosClient.abstraction.isAccountAbstractionEnabled({
2530
- accountAddress: options.signer.accountAddress,
2531
- authenticationFunction: '0x1::permissioned_delegation::authenticate',
2828
+ userOp = SmoothSendAvaxSubmitter.applyPaymasterAndData(userOp, signedPm.paymasterAndData);
2829
+ userOp = {
2830
+ ...userOp,
2831
+ signature: await opts.signUserOp(userOp),
2832
+ };
2833
+ const userOpHash = await this.sendUserOperation(userOp, entryPoint);
2834
+ if (opts.waitForReceipt === false) {
2835
+ return { userOpHash, receipt: null };
2836
+ }
2837
+ const receipt = await this.waitForUserOperationReceipt(userOpHash, opts.receiptPoll);
2838
+ return { userOpHash, receipt };
2839
+ }
2840
+ async rpc(method, params) {
2841
+ const id = this.rpcId++;
2842
+ const envelope = await this.http.post('/', {
2843
+ jsonrpc: '2.0',
2844
+ id,
2845
+ method,
2846
+ params,
2532
2847
  });
2533
- if (!aaEnabled) {
2534
- const aaTx = await aptosClient.transaction.build.simple({
2535
- sender: options.signer.accountAddress,
2536
- withFeePayer: true,
2537
- data: {
2538
- function: '0x1::account_abstraction::add_authentication_function',
2539
- functionArguments: [
2540
- tsSdk.AccountAddress.fromString('0x1'),
2541
- 'permissioned_delegation',
2542
- 'authenticate',
2543
- ],
2544
- },
2545
- });
2546
- const aaAuth = aptosClient.transaction.sign({ signer: options.signer, transaction: aaTx });
2547
- const aaResult = await submitter.submitTransaction({
2548
- aptosConfig: aptosClient.config,
2549
- transaction: aaTx,
2550
- senderAuthenticator: aaAuth,
2848
+ if (!envelope.success || envelope.data == null) {
2849
+ throw new Error(`[SmoothSendAvaxSubmitter] ${method}: empty response`);
2850
+ }
2851
+ const body = envelope.data;
2852
+ if (body.error) {
2853
+ const msg = sanitizeAvaxBundlerRpcMessage(String(body.error.message ?? ''));
2854
+ throw new Error(`[SmoothSendAvaxSubmitter] ${method}: ${body.error.code} ${msg}`);
2855
+ }
2856
+ if (body.result === undefined) {
2857
+ throw new Error(`[SmoothSendAvaxSubmitter] ${method}: missing result`);
2858
+ }
2859
+ return body.result;
2860
+ }
2861
+ }
2862
+ /**
2863
+ * @alias {@link SmoothSendAvaxSubmitter}
2864
+ */
2865
+ const AvaxSubmitter = SmoothSendAvaxSubmitter;
2866
+ function createSmoothSendAvaxSubmitter(config) {
2867
+ return new SmoothSendAvaxSubmitter(config);
2868
+ }
2869
+
2870
+ /**
2871
+ * Viem helpers for ERC-4337 v0.7 + common smart-account `execute` encoding.
2872
+ * Peer dependency: `viem` (optional install).
2873
+ */
2874
+ /** Typical SimpleAccount-style `execute(dest,value,func)`. */
2875
+ const avaxExecuteAbi = [
2876
+ {
2877
+ name: 'execute',
2878
+ type: 'function',
2879
+ stateMutability: 'nonpayable',
2880
+ inputs: [
2881
+ { name: 'dest', type: 'address' },
2882
+ { name: 'value', type: 'uint256' },
2883
+ { name: 'func', type: 'bytes' },
2884
+ ],
2885
+ outputs: [],
2886
+ },
2887
+ ];
2888
+ function encodeAvaxExecuteCalldata(to, value, data = '0x') {
2889
+ return viem.encodeFunctionData({
2890
+ abi: avaxExecuteAbi,
2891
+ functionName: 'execute',
2892
+ args: [to, value, data],
2893
+ });
2894
+ }
2895
+ function parseUint(name, v) {
2896
+ if (v === undefined || v === '') {
2897
+ throw new Error(`[SmoothSend AVAX] UserOp missing ${name}`);
2898
+ }
2899
+ return BigInt(v);
2900
+ }
2901
+ /** Convert API UserOp → viem shape for {@link getUserOperationHash}. */
2902
+ function userOperationAvaxToViem(u) {
2903
+ const base = {
2904
+ sender: u.sender,
2905
+ nonce: parseUint('nonce', u.nonce),
2906
+ callData: (u.callData ?? '0x'),
2907
+ callGasLimit: parseUint('callGasLimit', u.callGasLimit),
2908
+ verificationGasLimit: parseUint('verificationGasLimit', u.verificationGasLimit),
2909
+ preVerificationGas: parseUint('preVerificationGas', u.preVerificationGas),
2910
+ maxFeePerGas: parseUint('maxFeePerGas', u.maxFeePerGas),
2911
+ maxPriorityFeePerGas: parseUint('maxPriorityFeePerGas', u.maxPriorityFeePerGas),
2912
+ signature: (u.signature ?? '0x'),
2913
+ };
2914
+ let out = { ...base };
2915
+ if (u.factory && u.factoryData) {
2916
+ out = {
2917
+ ...out,
2918
+ factory: u.factory,
2919
+ factoryData: u.factoryData,
2920
+ };
2921
+ }
2922
+ else if (u.initCode && u.initCode !== '0x') {
2923
+ const ic = u.initCode;
2924
+ out = {
2925
+ ...out,
2926
+ factory: viem.slice(ic, 0, 20),
2927
+ factoryData: viem.slice(ic, 20),
2928
+ };
2929
+ }
2930
+ if (u.paymasterAndData && u.paymasterAndData !== '0x') {
2931
+ const pm = u.paymasterAndData;
2932
+ if (viem.size(pm) < 52) {
2933
+ throw new Error('[SmoothSend AVAX] paymasterAndData too short');
2934
+ }
2935
+ out = {
2936
+ ...out,
2937
+ paymaster: viem.slice(pm, 0, 20),
2938
+ paymasterVerificationGasLimit: viem.hexToBigInt(viem.slice(pm, 20, 36)),
2939
+ paymasterPostOpGasLimit: viem.hexToBigInt(viem.slice(pm, 36, 52)),
2940
+ paymasterData: viem.size(pm) > 52 ? viem.slice(pm, 52) : '0x',
2941
+ };
2942
+ }
2943
+ else if (u.paymaster) {
2944
+ out = {
2945
+ ...out,
2946
+ paymaster: u.paymaster,
2947
+ paymasterVerificationGasLimit: u.paymasterVerificationGasLimit
2948
+ ? BigInt(u.paymasterVerificationGasLimit)
2949
+ : 0n,
2950
+ paymasterPostOpGasLimit: u.paymasterPostOpGasLimit
2951
+ ? BigInt(u.paymasterPostOpGasLimit)
2952
+ : 0n,
2953
+ paymasterData: (u.paymasterData ?? '0x'),
2954
+ };
2955
+ }
2956
+ return out;
2957
+ }
2958
+ function hashUserOperationAvax(params) {
2959
+ return accountAbstraction.getUserOperationHash({
2960
+ chainId: params.chainId,
2961
+ entryPointAddress: params.entryPointAddress,
2962
+ entryPointVersion: '0.7',
2963
+ userOperation: userOperationAvaxToViem(params.userOperation),
2964
+ });
2965
+ }
2966
+ /** EntryPoint v0.7 `getNonce(sender, key)` with key `0`. */
2967
+ async function readAvaxSenderNonce(params) {
2968
+ return actions.readContract(params.publicClient, {
2969
+ address: params.entryPointAddress,
2970
+ abi: accountAbstraction.entryPoint07Abi,
2971
+ functionName: 'getNonce',
2972
+ args: [params.sender, params.key ?? 0n],
2973
+ });
2974
+ }
2975
+
2976
+ /**
2977
+ * Standard SimpleAccountFactory (EntryPoint v0.7) helpers for counterfactual address + init calldata.
2978
+ */
2979
+ /** Minimal ABI for eth-infinitism–style SimpleAccountFactory. */
2980
+ const SIMPLE_ACCOUNT_FACTORY_ABI = [
2981
+ {
2982
+ inputs: [
2983
+ { name: 'owner', type: 'address' },
2984
+ { name: 'salt', type: 'uint256' },
2985
+ ],
2986
+ name: 'createAccount',
2987
+ outputs: [{ name: 'account', type: 'address' }],
2988
+ stateMutability: 'nonpayable',
2989
+ type: 'function',
2990
+ },
2991
+ {
2992
+ inputs: [
2993
+ { name: 'owner', type: 'address' },
2994
+ { name: 'salt', type: 'uint256' },
2995
+ ],
2996
+ name: 'getAddress',
2997
+ outputs: [{ name: '', type: 'address' }],
2998
+ stateMutability: 'view',
2999
+ type: 'function',
3000
+ },
3001
+ ];
3002
+ async function predictSimpleAccountAddress(params) {
3003
+ const salt = params.salt ?? 0n;
3004
+ const addr = await actions.readContract(params.publicClient, {
3005
+ address: params.factory,
3006
+ abi: SIMPLE_ACCOUNT_FACTORY_ABI,
3007
+ functionName: 'getAddress',
3008
+ args: [params.owner, salt],
3009
+ });
3010
+ return addr;
3011
+ }
3012
+ function encodeCreateAccountFactoryData(owner, salt) {
3013
+ return viem.encodeFunctionData({
3014
+ abi: SIMPLE_ACCOUNT_FACTORY_ABI,
3015
+ functionName: 'createAccount',
3016
+ args: [owner, salt],
3017
+ });
3018
+ }
3019
+
3020
+ /**
3021
+ * Public gateway defaults for Avalanche AA (no API key).
3022
+ */
3023
+ /** Canonical ERC-4337 EntryPoint v0.7 on Fuji / Avalanche C-Chain */
3024
+ const ENTRY_POINT_V07_ADDRESS = '0x0000000071727De22E5E9d8BAf0edAc6f37da032';
3025
+ /**
3026
+ * Fetch SimpleAccount factory hint from SmoothSend gateway (GET; no auth).
3027
+ * Ops configure {@link https://proxy.smoothsend.xyz} `AVAX_FUJI_SIMPLE_ACCOUNT_FACTORY`; until then this returns null.
3028
+ */
3029
+ async function fetchAvaxAaPublicDefaults(gatewayUrl = 'https://proxy.smoothsend.xyz') {
3030
+ const base = gatewayUrl.replace(/\/$/, '');
3031
+ const res = await fetch(`${base}/api/v1/public/avax-aa-defaults`);
3032
+ if (!res.ok) {
3033
+ throw new Error(`fetchAvaxAaPublicDefaults failed: HTTP ${res.status}`);
3034
+ }
3035
+ const j = (await res.json());
3036
+ let factory = null;
3037
+ const fac = j.simpleAccountFactoryFuji?.trim();
3038
+ if (fac && fac.startsWith('0x') && /^0x[a-fA-F0-9]{40}$/.test(fac)) {
3039
+ factory = fac;
3040
+ }
3041
+ return {
3042
+ success: j.success,
3043
+ simpleAccountFactoryFuji: factory,
3044
+ entryPointV07: j.entryPointV07?.startsWith('0x') && /^0x[a-fA-F0-9]{40}$/.test(j.entryPointV07)
3045
+ ? j.entryPointV07
3046
+ : ENTRY_POINT_V07_ADDRESS,
3047
+ };
3048
+ }
3049
+
3050
+ var jsxRuntime = {exports: {}};
3051
+
3052
+ var reactJsxRuntime_production_min = {};
3053
+
3054
+ /**
3055
+ * @license React
3056
+ * react-jsx-runtime.production.min.js
3057
+ *
3058
+ * Copyright (c) Facebook, Inc. and its affiliates.
3059
+ *
3060
+ * This source code is licensed under the MIT license found in the
3061
+ * LICENSE file in the root directory of this source tree.
3062
+ */
3063
+
3064
+ var hasRequiredReactJsxRuntime_production_min;
3065
+
3066
+ function requireReactJsxRuntime_production_min () {
3067
+ if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
3068
+ hasRequiredReactJsxRuntime_production_min = 1;
3069
+ var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:true,ref:true,__self:true,__source:true};
3070
+ function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a) void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
3071
+ return reactJsxRuntime_production_min;
3072
+ }
3073
+
3074
+ var reactJsxRuntime_development = {};
3075
+
3076
+ /**
3077
+ * @license React
3078
+ * react-jsx-runtime.development.js
3079
+ *
3080
+ * Copyright (c) Facebook, Inc. and its affiliates.
3081
+ *
3082
+ * This source code is licensed under the MIT license found in the
3083
+ * LICENSE file in the root directory of this source tree.
3084
+ */
3085
+
3086
+ var hasRequiredReactJsxRuntime_development;
3087
+
3088
+ function requireReactJsxRuntime_development () {
3089
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
3090
+ hasRequiredReactJsxRuntime_development = 1;
3091
+
3092
+ if (process.env.NODE_ENV !== "production") {
3093
+ (function() {
3094
+
3095
+ var React = require$$0;
3096
+
3097
+ // ATTENTION
3098
+ // When adding new symbols to this file,
3099
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
3100
+ // The Symbol used to tag the ReactElement-like types.
3101
+ var REACT_ELEMENT_TYPE = Symbol.for('react.element');
3102
+ var REACT_PORTAL_TYPE = Symbol.for('react.portal');
3103
+ var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
3104
+ var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
3105
+ var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
3106
+ var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
3107
+ var REACT_CONTEXT_TYPE = Symbol.for('react.context');
3108
+ var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
3109
+ var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
3110
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
3111
+ var REACT_MEMO_TYPE = Symbol.for('react.memo');
3112
+ var REACT_LAZY_TYPE = Symbol.for('react.lazy');
3113
+ var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
3114
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
3115
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
3116
+ function getIteratorFn(maybeIterable) {
3117
+ if (maybeIterable === null || typeof maybeIterable !== 'object') {
3118
+ return null;
3119
+ }
3120
+
3121
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
3122
+
3123
+ if (typeof maybeIterator === 'function') {
3124
+ return maybeIterator;
3125
+ }
3126
+
3127
+ return null;
3128
+ }
3129
+
3130
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3131
+
3132
+ function error(format) {
3133
+ {
3134
+ {
3135
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
3136
+ args[_key2 - 1] = arguments[_key2];
3137
+ }
3138
+
3139
+ printWarning('error', format, args);
3140
+ }
3141
+ }
3142
+ }
3143
+
3144
+ function printWarning(level, format, args) {
3145
+ // When changing this logic, you might want to also
3146
+ // update consoleWithStackDev.www.js as well.
3147
+ {
3148
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
3149
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
3150
+
3151
+ if (stack !== '') {
3152
+ format += '%s';
3153
+ args = args.concat([stack]);
3154
+ } // eslint-disable-next-line react-internal/safe-string-coercion
3155
+
3156
+
3157
+ var argsWithFormat = args.map(function (item) {
3158
+ return String(item);
3159
+ }); // Careful: RN currently depends on this prefix
3160
+
3161
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
3162
+ // breaks IE9: https://github.com/facebook/react/issues/13610
3163
+ // eslint-disable-next-line react-internal/no-production-logging
3164
+
3165
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
3166
+ }
3167
+ }
3168
+
3169
+ // -----------------------------------------------------------------------------
3170
+
3171
+ var enableScopeAPI = false; // Experimental Create Event Handle API.
3172
+ var enableCacheElement = false;
3173
+ var enableTransitionTracing = false; // No known bugs, but needs performance testing
3174
+
3175
+ var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
3176
+ // stuff. Intended to enable React core members to more easily debug scheduling
3177
+ // issues in DEV builds.
3178
+
3179
+ var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
3180
+
3181
+ var REACT_MODULE_REFERENCE;
3182
+
3183
+ {
3184
+ REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
3185
+ }
3186
+
3187
+ function isValidElementType(type) {
3188
+ if (typeof type === 'string' || typeof type === 'function') {
3189
+ return true;
3190
+ } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
3191
+
3192
+
3193
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
3194
+ return true;
3195
+ }
3196
+
3197
+ if (typeof type === 'object' && type !== null) {
3198
+ if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
3199
+ // types supported by any Flight configuration anywhere since
3200
+ // we don't know which Flight build this will end up being used
3201
+ // with.
3202
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
3203
+ return true;
3204
+ }
3205
+ }
3206
+
3207
+ return false;
3208
+ }
3209
+
3210
+ function getWrappedName(outerType, innerType, wrapperName) {
3211
+ var displayName = outerType.displayName;
3212
+
3213
+ if (displayName) {
3214
+ return displayName;
3215
+ }
3216
+
3217
+ var functionName = innerType.displayName || innerType.name || '';
3218
+ return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
3219
+ } // Keep in sync with react-reconciler/getComponentNameFromFiber
3220
+
3221
+
3222
+ function getContextName(type) {
3223
+ return type.displayName || 'Context';
3224
+ } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
3225
+
3226
+
3227
+ function getComponentNameFromType(type) {
3228
+ if (type == null) {
3229
+ // Host root, text node or just invalid type.
3230
+ return null;
3231
+ }
3232
+
3233
+ {
3234
+ if (typeof type.tag === 'number') {
3235
+ error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
3236
+ }
3237
+ }
3238
+
3239
+ if (typeof type === 'function') {
3240
+ return type.displayName || type.name || null;
3241
+ }
3242
+
3243
+ if (typeof type === 'string') {
3244
+ return type;
3245
+ }
3246
+
3247
+ switch (type) {
3248
+ case REACT_FRAGMENT_TYPE:
3249
+ return 'Fragment';
3250
+
3251
+ case REACT_PORTAL_TYPE:
3252
+ return 'Portal';
3253
+
3254
+ case REACT_PROFILER_TYPE:
3255
+ return 'Profiler';
3256
+
3257
+ case REACT_STRICT_MODE_TYPE:
3258
+ return 'StrictMode';
3259
+
3260
+ case REACT_SUSPENSE_TYPE:
3261
+ return 'Suspense';
3262
+
3263
+ case REACT_SUSPENSE_LIST_TYPE:
3264
+ return 'SuspenseList';
3265
+
3266
+ }
3267
+
3268
+ if (typeof type === 'object') {
3269
+ switch (type.$$typeof) {
3270
+ case REACT_CONTEXT_TYPE:
3271
+ var context = type;
3272
+ return getContextName(context) + '.Consumer';
3273
+
3274
+ case REACT_PROVIDER_TYPE:
3275
+ var provider = type;
3276
+ return getContextName(provider._context) + '.Provider';
3277
+
3278
+ case REACT_FORWARD_REF_TYPE:
3279
+ return getWrappedName(type, type.render, 'ForwardRef');
3280
+
3281
+ case REACT_MEMO_TYPE:
3282
+ var outerName = type.displayName || null;
3283
+
3284
+ if (outerName !== null) {
3285
+ return outerName;
3286
+ }
3287
+
3288
+ return getComponentNameFromType(type.type) || 'Memo';
3289
+
3290
+ case REACT_LAZY_TYPE:
3291
+ {
3292
+ var lazyComponent = type;
3293
+ var payload = lazyComponent._payload;
3294
+ var init = lazyComponent._init;
3295
+
3296
+ try {
3297
+ return getComponentNameFromType(init(payload));
3298
+ } catch (x) {
3299
+ return null;
3300
+ }
3301
+ }
3302
+
3303
+ // eslint-disable-next-line no-fallthrough
3304
+ }
3305
+ }
3306
+
3307
+ return null;
3308
+ }
3309
+
3310
+ var assign = Object.assign;
3311
+
3312
+ // Helpers to patch console.logs to avoid logging during side-effect free
3313
+ // replaying on render function. This currently only patches the object
3314
+ // lazily which won't cover if the log function was extracted eagerly.
3315
+ // We could also eagerly patch the method.
3316
+ var disabledDepth = 0;
3317
+ var prevLog;
3318
+ var prevInfo;
3319
+ var prevWarn;
3320
+ var prevError;
3321
+ var prevGroup;
3322
+ var prevGroupCollapsed;
3323
+ var prevGroupEnd;
3324
+
3325
+ function disabledLog() {}
3326
+
3327
+ disabledLog.__reactDisabledLog = true;
3328
+ function disableLogs() {
3329
+ {
3330
+ if (disabledDepth === 0) {
3331
+ /* eslint-disable react-internal/no-production-logging */
3332
+ prevLog = console.log;
3333
+ prevInfo = console.info;
3334
+ prevWarn = console.warn;
3335
+ prevError = console.error;
3336
+ prevGroup = console.group;
3337
+ prevGroupCollapsed = console.groupCollapsed;
3338
+ prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
3339
+
3340
+ var props = {
3341
+ configurable: true,
3342
+ enumerable: true,
3343
+ value: disabledLog,
3344
+ writable: true
3345
+ }; // $FlowFixMe Flow thinks console is immutable.
3346
+
3347
+ Object.defineProperties(console, {
3348
+ info: props,
3349
+ log: props,
3350
+ warn: props,
3351
+ error: props,
3352
+ group: props,
3353
+ groupCollapsed: props,
3354
+ groupEnd: props
3355
+ });
3356
+ /* eslint-enable react-internal/no-production-logging */
3357
+ }
3358
+
3359
+ disabledDepth++;
3360
+ }
3361
+ }
3362
+ function reenableLogs() {
3363
+ {
3364
+ disabledDepth--;
3365
+
3366
+ if (disabledDepth === 0) {
3367
+ /* eslint-disable react-internal/no-production-logging */
3368
+ var props = {
3369
+ configurable: true,
3370
+ enumerable: true,
3371
+ writable: true
3372
+ }; // $FlowFixMe Flow thinks console is immutable.
3373
+
3374
+ Object.defineProperties(console, {
3375
+ log: assign({}, props, {
3376
+ value: prevLog
3377
+ }),
3378
+ info: assign({}, props, {
3379
+ value: prevInfo
3380
+ }),
3381
+ warn: assign({}, props, {
3382
+ value: prevWarn
3383
+ }),
3384
+ error: assign({}, props, {
3385
+ value: prevError
3386
+ }),
3387
+ group: assign({}, props, {
3388
+ value: prevGroup
3389
+ }),
3390
+ groupCollapsed: assign({}, props, {
3391
+ value: prevGroupCollapsed
3392
+ }),
3393
+ groupEnd: assign({}, props, {
3394
+ value: prevGroupEnd
3395
+ })
3396
+ });
3397
+ /* eslint-enable react-internal/no-production-logging */
3398
+ }
3399
+
3400
+ if (disabledDepth < 0) {
3401
+ error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
3402
+ }
3403
+ }
3404
+ }
3405
+
3406
+ var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
3407
+ var prefix;
3408
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
3409
+ {
3410
+ if (prefix === undefined) {
3411
+ // Extract the VM specific prefix used by each line.
3412
+ try {
3413
+ throw Error();
3414
+ } catch (x) {
3415
+ var match = x.stack.trim().match(/\n( *(at )?)/);
3416
+ prefix = match && match[1] || '';
3417
+ }
3418
+ } // We use the prefix to ensure our stacks line up with native stack frames.
3419
+
3420
+
3421
+ return '\n' + prefix + name;
3422
+ }
3423
+ }
3424
+ var reentry = false;
3425
+ var componentFrameCache;
3426
+
3427
+ {
3428
+ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
3429
+ componentFrameCache = new PossiblyWeakMap();
3430
+ }
3431
+
3432
+ function describeNativeComponentFrame(fn, construct) {
3433
+ // If something asked for a stack inside a fake render, it should get ignored.
3434
+ if ( !fn || reentry) {
3435
+ return '';
3436
+ }
3437
+
3438
+ {
3439
+ var frame = componentFrameCache.get(fn);
3440
+
3441
+ if (frame !== undefined) {
3442
+ return frame;
3443
+ }
3444
+ }
3445
+
3446
+ var control;
3447
+ reentry = true;
3448
+ var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
3449
+
3450
+ Error.prepareStackTrace = undefined;
3451
+ var previousDispatcher;
3452
+
3453
+ {
3454
+ previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
3455
+ // for warnings.
3456
+
3457
+ ReactCurrentDispatcher.current = null;
3458
+ disableLogs();
3459
+ }
3460
+
3461
+ try {
3462
+ // This should throw.
3463
+ if (construct) {
3464
+ // Something should be setting the props in the constructor.
3465
+ var Fake = function () {
3466
+ throw Error();
3467
+ }; // $FlowFixMe
3468
+
3469
+
3470
+ Object.defineProperty(Fake.prototype, 'props', {
3471
+ set: function () {
3472
+ // We use a throwing setter instead of frozen or non-writable props
3473
+ // because that won't throw in a non-strict mode function.
3474
+ throw Error();
3475
+ }
3476
+ });
3477
+
3478
+ if (typeof Reflect === 'object' && Reflect.construct) {
3479
+ // We construct a different control for this case to include any extra
3480
+ // frames added by the construct call.
3481
+ try {
3482
+ Reflect.construct(Fake, []);
3483
+ } catch (x) {
3484
+ control = x;
3485
+ }
3486
+
3487
+ Reflect.construct(fn, [], Fake);
3488
+ } else {
3489
+ try {
3490
+ Fake.call();
3491
+ } catch (x) {
3492
+ control = x;
3493
+ }
3494
+
3495
+ fn.call(Fake.prototype);
3496
+ }
3497
+ } else {
3498
+ try {
3499
+ throw Error();
3500
+ } catch (x) {
3501
+ control = x;
3502
+ }
3503
+
3504
+ fn();
3505
+ }
3506
+ } catch (sample) {
3507
+ // This is inlined manually because closure doesn't do it for us.
3508
+ if (sample && control && typeof sample.stack === 'string') {
3509
+ // This extracts the first frame from the sample that isn't also in the control.
3510
+ // Skipping one frame that we assume is the frame that calls the two.
3511
+ var sampleLines = sample.stack.split('\n');
3512
+ var controlLines = control.stack.split('\n');
3513
+ var s = sampleLines.length - 1;
3514
+ var c = controlLines.length - 1;
3515
+
3516
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
3517
+ // We expect at least one stack frame to be shared.
3518
+ // Typically this will be the root most one. However, stack frames may be
3519
+ // cut off due to maximum stack limits. In this case, one maybe cut off
3520
+ // earlier than the other. We assume that the sample is longer or the same
3521
+ // and there for cut off earlier. So we should find the root most frame in
3522
+ // the sample somewhere in the control.
3523
+ c--;
3524
+ }
3525
+
3526
+ for (; s >= 1 && c >= 0; s--, c--) {
3527
+ // Next we find the first one that isn't the same which should be the
3528
+ // frame that called our sample function and the control.
3529
+ if (sampleLines[s] !== controlLines[c]) {
3530
+ // In V8, the first line is describing the message but other VMs don't.
3531
+ // If we're about to return the first line, and the control is also on the same
3532
+ // line, that's a pretty good indicator that our sample threw at same line as
3533
+ // the control. I.e. before we entered the sample frame. So we ignore this result.
3534
+ // This can happen if you passed a class to function component, or non-function.
3535
+ if (s !== 1 || c !== 1) {
3536
+ do {
3537
+ s--;
3538
+ c--; // We may still have similar intermediate frames from the construct call.
3539
+ // The next one that isn't the same should be our match though.
3540
+
3541
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
3542
+ // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
3543
+ var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
3544
+ // but we have a user-provided "displayName"
3545
+ // splice it in to make the stack more readable.
3546
+
3547
+
3548
+ if (fn.displayName && _frame.includes('<anonymous>')) {
3549
+ _frame = _frame.replace('<anonymous>', fn.displayName);
3550
+ }
3551
+
3552
+ {
3553
+ if (typeof fn === 'function') {
3554
+ componentFrameCache.set(fn, _frame);
3555
+ }
3556
+ } // Return the line we found.
3557
+
3558
+
3559
+ return _frame;
3560
+ }
3561
+ } while (s >= 1 && c >= 0);
3562
+ }
3563
+
3564
+ break;
3565
+ }
3566
+ }
3567
+ }
3568
+ } finally {
3569
+ reentry = false;
3570
+
3571
+ {
3572
+ ReactCurrentDispatcher.current = previousDispatcher;
3573
+ reenableLogs();
3574
+ }
3575
+
3576
+ Error.prepareStackTrace = previousPrepareStackTrace;
3577
+ } // Fallback to just using the name if we couldn't make it throw.
3578
+
3579
+
3580
+ var name = fn ? fn.displayName || fn.name : '';
3581
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
3582
+
3583
+ {
3584
+ if (typeof fn === 'function') {
3585
+ componentFrameCache.set(fn, syntheticFrame);
3586
+ }
3587
+ }
3588
+
3589
+ return syntheticFrame;
3590
+ }
3591
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
3592
+ {
3593
+ return describeNativeComponentFrame(fn, false);
3594
+ }
3595
+ }
3596
+
3597
+ function shouldConstruct(Component) {
3598
+ var prototype = Component.prototype;
3599
+ return !!(prototype && prototype.isReactComponent);
3600
+ }
3601
+
3602
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
3603
+
3604
+ if (type == null) {
3605
+ return '';
3606
+ }
3607
+
3608
+ if (typeof type === 'function') {
3609
+ {
3610
+ return describeNativeComponentFrame(type, shouldConstruct(type));
3611
+ }
3612
+ }
3613
+
3614
+ if (typeof type === 'string') {
3615
+ return describeBuiltInComponentFrame(type);
3616
+ }
3617
+
3618
+ switch (type) {
3619
+ case REACT_SUSPENSE_TYPE:
3620
+ return describeBuiltInComponentFrame('Suspense');
3621
+
3622
+ case REACT_SUSPENSE_LIST_TYPE:
3623
+ return describeBuiltInComponentFrame('SuspenseList');
3624
+ }
3625
+
3626
+ if (typeof type === 'object') {
3627
+ switch (type.$$typeof) {
3628
+ case REACT_FORWARD_REF_TYPE:
3629
+ return describeFunctionComponentFrame(type.render);
3630
+
3631
+ case REACT_MEMO_TYPE:
3632
+ // Memo may contain any component type so we recursively resolve it.
3633
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
3634
+
3635
+ case REACT_LAZY_TYPE:
3636
+ {
3637
+ var lazyComponent = type;
3638
+ var payload = lazyComponent._payload;
3639
+ var init = lazyComponent._init;
3640
+
3641
+ try {
3642
+ // Lazy may contain any component type so we recursively resolve it.
3643
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
3644
+ } catch (x) {}
3645
+ }
3646
+ }
3647
+ }
3648
+
3649
+ return '';
3650
+ }
3651
+
3652
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
3653
+
3654
+ var loggedTypeFailures = {};
3655
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
3656
+
3657
+ function setCurrentlyValidatingElement(element) {
3658
+ {
3659
+ if (element) {
3660
+ var owner = element._owner;
3661
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
3662
+ ReactDebugCurrentFrame.setExtraStackFrame(stack);
3663
+ } else {
3664
+ ReactDebugCurrentFrame.setExtraStackFrame(null);
3665
+ }
3666
+ }
3667
+ }
3668
+
3669
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
3670
+ {
3671
+ // $FlowFixMe This is okay but Flow doesn't know it.
3672
+ var has = Function.call.bind(hasOwnProperty);
3673
+
3674
+ for (var typeSpecName in typeSpecs) {
3675
+ if (has(typeSpecs, typeSpecName)) {
3676
+ var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
3677
+ // fail the render phase where it didn't fail before. So we log it.
3678
+ // After these have been cleaned up, we'll let them throw.
3679
+
3680
+ try {
3681
+ // This is intentionally an invariant that gets caught. It's the same
3682
+ // behavior as without this statement except with a better message.
3683
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
3684
+ // eslint-disable-next-line react-internal/prod-error-codes
3685
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
3686
+ err.name = 'Invariant Violation';
3687
+ throw err;
3688
+ }
3689
+
3690
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
3691
+ } catch (ex) {
3692
+ error$1 = ex;
3693
+ }
3694
+
3695
+ if (error$1 && !(error$1 instanceof Error)) {
3696
+ setCurrentlyValidatingElement(element);
3697
+
3698
+ error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
3699
+
3700
+ setCurrentlyValidatingElement(null);
3701
+ }
3702
+
3703
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
3704
+ // Only monitor this failure once because there tends to be a lot of the
3705
+ // same error.
3706
+ loggedTypeFailures[error$1.message] = true;
3707
+ setCurrentlyValidatingElement(element);
3708
+
3709
+ error('Failed %s type: %s', location, error$1.message);
3710
+
3711
+ setCurrentlyValidatingElement(null);
3712
+ }
3713
+ }
3714
+ }
3715
+ }
3716
+ }
3717
+
3718
+ var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
3719
+
3720
+ function isArray(a) {
3721
+ return isArrayImpl(a);
3722
+ }
3723
+
3724
+ /*
3725
+ * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
3726
+ * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
3727
+ *
3728
+ * The functions in this module will throw an easier-to-understand,
3729
+ * easier-to-debug exception with a clear errors message message explaining the
3730
+ * problem. (Instead of a confusing exception thrown inside the implementation
3731
+ * of the `value` object).
3732
+ */
3733
+ // $FlowFixMe only called in DEV, so void return is not possible.
3734
+ function typeName(value) {
3735
+ {
3736
+ // toStringTag is needed for namespaced types like Temporal.Instant
3737
+ var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
3738
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
3739
+ return type;
3740
+ }
3741
+ } // $FlowFixMe only called in DEV, so void return is not possible.
3742
+
3743
+
3744
+ function willCoercionThrow(value) {
3745
+ {
3746
+ try {
3747
+ testStringCoercion(value);
3748
+ return false;
3749
+ } catch (e) {
3750
+ return true;
3751
+ }
3752
+ }
3753
+ }
3754
+
3755
+ function testStringCoercion(value) {
3756
+ // If you ended up here by following an exception call stack, here's what's
3757
+ // happened: you supplied an object or symbol value to React (as a prop, key,
3758
+ // DOM attribute, CSS property, string ref, etc.) and when React tried to
3759
+ // coerce it to a string using `'' + value`, an exception was thrown.
3760
+ //
3761
+ // The most common types that will cause this exception are `Symbol` instances
3762
+ // and Temporal objects like `Temporal.Instant`. But any object that has a
3763
+ // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
3764
+ // exception. (Library authors do this to prevent users from using built-in
3765
+ // numeric operators like `+` or comparison operators like `>=` because custom
3766
+ // methods are needed to perform accurate arithmetic or comparison.)
3767
+ //
3768
+ // To fix the problem, coerce this object or symbol value to a string before
3769
+ // passing it to React. The most reliable way is usually `String(value)`.
3770
+ //
3771
+ // To find which value is throwing, check the browser or debugger console.
3772
+ // Before this exception was thrown, there should be `console.error` output
3773
+ // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
3774
+ // problem and how that type was used: key, atrribute, input value prop, etc.
3775
+ // In most cases, this console output also shows the component and its
3776
+ // ancestor components where the exception happened.
3777
+ //
3778
+ // eslint-disable-next-line react-internal/safe-string-coercion
3779
+ return '' + value;
3780
+ }
3781
+ function checkKeyStringCoercion(value) {
3782
+ {
3783
+ if (willCoercionThrow(value)) {
3784
+ error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
3785
+
3786
+ return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
3787
+ }
3788
+ }
3789
+ }
3790
+
3791
+ var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
3792
+ var RESERVED_PROPS = {
3793
+ key: true,
3794
+ ref: true,
3795
+ __self: true,
3796
+ __source: true
3797
+ };
3798
+ var specialPropKeyWarningShown;
3799
+ var specialPropRefWarningShown;
3800
+
3801
+ function hasValidRef(config) {
3802
+ {
3803
+ if (hasOwnProperty.call(config, 'ref')) {
3804
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
3805
+
3806
+ if (getter && getter.isReactWarning) {
3807
+ return false;
3808
+ }
3809
+ }
3810
+ }
3811
+
3812
+ return config.ref !== undefined;
3813
+ }
3814
+
3815
+ function hasValidKey(config) {
3816
+ {
3817
+ if (hasOwnProperty.call(config, 'key')) {
3818
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
3819
+
3820
+ if (getter && getter.isReactWarning) {
3821
+ return false;
3822
+ }
3823
+ }
3824
+ }
3825
+
3826
+ return config.key !== undefined;
3827
+ }
3828
+
3829
+ function warnIfStringRefCannotBeAutoConverted(config, self) {
3830
+ {
3831
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && self) ;
3832
+ }
3833
+ }
3834
+
3835
+ function defineKeyPropWarningGetter(props, displayName) {
3836
+ {
3837
+ var warnAboutAccessingKey = function () {
3838
+ if (!specialPropKeyWarningShown) {
3839
+ specialPropKeyWarningShown = true;
3840
+
3841
+ error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
3842
+ }
3843
+ };
3844
+
3845
+ warnAboutAccessingKey.isReactWarning = true;
3846
+ Object.defineProperty(props, 'key', {
3847
+ get: warnAboutAccessingKey,
3848
+ configurable: true
3849
+ });
3850
+ }
3851
+ }
3852
+
3853
+ function defineRefPropWarningGetter(props, displayName) {
3854
+ {
3855
+ var warnAboutAccessingRef = function () {
3856
+ if (!specialPropRefWarningShown) {
3857
+ specialPropRefWarningShown = true;
3858
+
3859
+ error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
3860
+ }
3861
+ };
3862
+
3863
+ warnAboutAccessingRef.isReactWarning = true;
3864
+ Object.defineProperty(props, 'ref', {
3865
+ get: warnAboutAccessingRef,
3866
+ configurable: true
3867
+ });
3868
+ }
3869
+ }
3870
+ /**
3871
+ * Factory method to create a new React element. This no longer adheres to
3872
+ * the class pattern, so do not use new to call it. Also, instanceof check
3873
+ * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
3874
+ * if something is a React Element.
3875
+ *
3876
+ * @param {*} type
3877
+ * @param {*} props
3878
+ * @param {*} key
3879
+ * @param {string|object} ref
3880
+ * @param {*} owner
3881
+ * @param {*} self A *temporary* helper to detect places where `this` is
3882
+ * different from the `owner` when React.createElement is called, so that we
3883
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
3884
+ * functions, and as long as `this` and owner are the same, there will be no
3885
+ * change in behavior.
3886
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
3887
+ * indicating filename, line number, and/or other information.
3888
+ * @internal
3889
+ */
3890
+
3891
+
3892
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
3893
+ var element = {
3894
+ // This tag allows us to uniquely identify this as a React Element
3895
+ $$typeof: REACT_ELEMENT_TYPE,
3896
+ // Built-in properties that belong on the element
3897
+ type: type,
3898
+ key: key,
3899
+ ref: ref,
3900
+ props: props,
3901
+ // Record the component responsible for creating this element.
3902
+ _owner: owner
3903
+ };
3904
+
3905
+ {
3906
+ // The validation flag is currently mutative. We put it on
3907
+ // an external backing store so that we can freeze the whole object.
3908
+ // This can be replaced with a WeakMap once they are implemented in
3909
+ // commonly used development environments.
3910
+ element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
3911
+ // the validation flag non-enumerable (where possible, which should
3912
+ // include every environment we run tests in), so the test framework
3913
+ // ignores it.
3914
+
3915
+ Object.defineProperty(element._store, 'validated', {
3916
+ configurable: false,
3917
+ enumerable: false,
3918
+ writable: true,
3919
+ value: false
3920
+ }); // self and source are DEV only properties.
3921
+
3922
+ Object.defineProperty(element, '_self', {
3923
+ configurable: false,
3924
+ enumerable: false,
3925
+ writable: false,
3926
+ value: self
3927
+ }); // Two elements created in two different places should be considered
3928
+ // equal for testing purposes and therefore we hide it from enumeration.
3929
+
3930
+ Object.defineProperty(element, '_source', {
3931
+ configurable: false,
3932
+ enumerable: false,
3933
+ writable: false,
3934
+ value: source
3935
+ });
3936
+
3937
+ if (Object.freeze) {
3938
+ Object.freeze(element.props);
3939
+ Object.freeze(element);
3940
+ }
3941
+ }
3942
+
3943
+ return element;
3944
+ };
3945
+ /**
3946
+ * https://github.com/reactjs/rfcs/pull/107
3947
+ * @param {*} type
3948
+ * @param {object} props
3949
+ * @param {string} key
3950
+ */
3951
+
3952
+ function jsxDEV(type, config, maybeKey, source, self) {
3953
+ {
3954
+ var propName; // Reserved names are extracted
3955
+
3956
+ var props = {};
3957
+ var key = null;
3958
+ var ref = null; // Currently, key can be spread in as a prop. This causes a potential
3959
+ // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
3960
+ // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
3961
+ // but as an intermediary step, we will use jsxDEV for everything except
3962
+ // <div {...props} key="Hi" />, because we aren't currently able to tell if
3963
+ // key is explicitly declared to be undefined or not.
3964
+
3965
+ if (maybeKey !== undefined) {
3966
+ {
3967
+ checkKeyStringCoercion(maybeKey);
3968
+ }
3969
+
3970
+ key = '' + maybeKey;
3971
+ }
3972
+
3973
+ if (hasValidKey(config)) {
3974
+ {
3975
+ checkKeyStringCoercion(config.key);
3976
+ }
3977
+
3978
+ key = '' + config.key;
3979
+ }
3980
+
3981
+ if (hasValidRef(config)) {
3982
+ ref = config.ref;
3983
+ warnIfStringRefCannotBeAutoConverted(config, self);
3984
+ } // Remaining properties are added to a new props object
3985
+
3986
+
3987
+ for (propName in config) {
3988
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
3989
+ props[propName] = config[propName];
3990
+ }
3991
+ } // Resolve default props
3992
+
3993
+
3994
+ if (type && type.defaultProps) {
3995
+ var defaultProps = type.defaultProps;
3996
+
3997
+ for (propName in defaultProps) {
3998
+ if (props[propName] === undefined) {
3999
+ props[propName] = defaultProps[propName];
4000
+ }
4001
+ }
4002
+ }
4003
+
4004
+ if (key || ref) {
4005
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
4006
+
4007
+ if (key) {
4008
+ defineKeyPropWarningGetter(props, displayName);
4009
+ }
4010
+
4011
+ if (ref) {
4012
+ defineRefPropWarningGetter(props, displayName);
4013
+ }
4014
+ }
4015
+
4016
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
4017
+ }
4018
+ }
4019
+
4020
+ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
4021
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
4022
+
4023
+ function setCurrentlyValidatingElement$1(element) {
4024
+ {
4025
+ if (element) {
4026
+ var owner = element._owner;
4027
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
4028
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
4029
+ } else {
4030
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
4031
+ }
4032
+ }
4033
+ }
4034
+
4035
+ var propTypesMisspellWarningShown;
4036
+
4037
+ {
4038
+ propTypesMisspellWarningShown = false;
4039
+ }
4040
+ /**
4041
+ * Verifies the object is a ReactElement.
4042
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
4043
+ * @param {?object} object
4044
+ * @return {boolean} True if `object` is a ReactElement.
4045
+ * @final
4046
+ */
4047
+
4048
+
4049
+ function isValidElement(object) {
4050
+ {
4051
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
4052
+ }
4053
+ }
4054
+
4055
+ function getDeclarationErrorAddendum() {
4056
+ {
4057
+ if (ReactCurrentOwner$1.current) {
4058
+ var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
4059
+
4060
+ if (name) {
4061
+ return '\n\nCheck the render method of `' + name + '`.';
4062
+ }
4063
+ }
4064
+
4065
+ return '';
4066
+ }
4067
+ }
4068
+
4069
+ function getSourceInfoErrorAddendum(source) {
4070
+ {
4071
+
4072
+ return '';
4073
+ }
4074
+ }
4075
+ /**
4076
+ * Warn if there's no key explicitly set on dynamic arrays of children or
4077
+ * object keys are not valid. This allows us to keep track of children between
4078
+ * updates.
4079
+ */
4080
+
4081
+
4082
+ var ownerHasKeyUseWarning = {};
4083
+
4084
+ function getCurrentComponentErrorInfo(parentType) {
4085
+ {
4086
+ var info = getDeclarationErrorAddendum();
4087
+
4088
+ if (!info) {
4089
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
4090
+
4091
+ if (parentName) {
4092
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
4093
+ }
4094
+ }
4095
+
4096
+ return info;
4097
+ }
4098
+ }
4099
+ /**
4100
+ * Warn if the element doesn't have an explicit key assigned to it.
4101
+ * This element is in an array. The array could grow and shrink or be
4102
+ * reordered. All children that haven't already been validated are required to
4103
+ * have a "key" property assigned to it. Error statuses are cached so a warning
4104
+ * will only be shown once.
4105
+ *
4106
+ * @internal
4107
+ * @param {ReactElement} element Element that requires a key.
4108
+ * @param {*} parentType element's parent's type.
4109
+ */
4110
+
4111
+
4112
+ function validateExplicitKey(element, parentType) {
4113
+ {
4114
+ if (!element._store || element._store.validated || element.key != null) {
4115
+ return;
4116
+ }
4117
+
4118
+ element._store.validated = true;
4119
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
4120
+
4121
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
4122
+ return;
4123
+ }
4124
+
4125
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
4126
+ // property, it may be the creator of the child that's responsible for
4127
+ // assigning it a key.
4128
+
4129
+ var childOwner = '';
4130
+
4131
+ if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
4132
+ // Give the component that originally created this child.
4133
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
4134
+ }
4135
+
4136
+ setCurrentlyValidatingElement$1(element);
4137
+
4138
+ error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
4139
+
4140
+ setCurrentlyValidatingElement$1(null);
4141
+ }
4142
+ }
4143
+ /**
4144
+ * Ensure that every element either is passed in a static location, in an
4145
+ * array with an explicit keys property defined, or in an object literal
4146
+ * with valid key property.
4147
+ *
4148
+ * @internal
4149
+ * @param {ReactNode} node Statically passed child of any type.
4150
+ * @param {*} parentType node's parent's type.
4151
+ */
4152
+
4153
+
4154
+ function validateChildKeys(node, parentType) {
4155
+ {
4156
+ if (typeof node !== 'object') {
4157
+ return;
4158
+ }
4159
+
4160
+ if (isArray(node)) {
4161
+ for (var i = 0; i < node.length; i++) {
4162
+ var child = node[i];
4163
+
4164
+ if (isValidElement(child)) {
4165
+ validateExplicitKey(child, parentType);
4166
+ }
4167
+ }
4168
+ } else if (isValidElement(node)) {
4169
+ // This element was passed in a valid location.
4170
+ if (node._store) {
4171
+ node._store.validated = true;
4172
+ }
4173
+ } else if (node) {
4174
+ var iteratorFn = getIteratorFn(node);
4175
+
4176
+ if (typeof iteratorFn === 'function') {
4177
+ // Entry iterators used to provide implicit keys,
4178
+ // but now we print a separate warning for them later.
4179
+ if (iteratorFn !== node.entries) {
4180
+ var iterator = iteratorFn.call(node);
4181
+ var step;
4182
+
4183
+ while (!(step = iterator.next()).done) {
4184
+ if (isValidElement(step.value)) {
4185
+ validateExplicitKey(step.value, parentType);
4186
+ }
4187
+ }
4188
+ }
4189
+ }
4190
+ }
4191
+ }
4192
+ }
4193
+ /**
4194
+ * Given an element, validate that its props follow the propTypes definition,
4195
+ * provided by the type.
4196
+ *
4197
+ * @param {ReactElement} element
4198
+ */
4199
+
4200
+
4201
+ function validatePropTypes(element) {
4202
+ {
4203
+ var type = element.type;
4204
+
4205
+ if (type === null || type === undefined || typeof type === 'string') {
4206
+ return;
4207
+ }
4208
+
4209
+ var propTypes;
4210
+
4211
+ if (typeof type === 'function') {
4212
+ propTypes = type.propTypes;
4213
+ } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
4214
+ // Inner props are checked in the reconciler.
4215
+ type.$$typeof === REACT_MEMO_TYPE)) {
4216
+ propTypes = type.propTypes;
4217
+ } else {
4218
+ return;
4219
+ }
4220
+
4221
+ if (propTypes) {
4222
+ // Intentionally inside to avoid triggering lazy initializers:
4223
+ var name = getComponentNameFromType(type);
4224
+ checkPropTypes(propTypes, element.props, 'prop', name, element);
4225
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
4226
+ propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
4227
+
4228
+ var _name = getComponentNameFromType(type);
4229
+
4230
+ error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
4231
+ }
4232
+
4233
+ if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
4234
+ error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
4235
+ }
4236
+ }
4237
+ }
4238
+ /**
4239
+ * Given a fragment, validate that it can only be provided with fragment props
4240
+ * @param {ReactElement} fragment
4241
+ */
4242
+
4243
+
4244
+ function validateFragmentProps(fragment) {
4245
+ {
4246
+ var keys = Object.keys(fragment.props);
4247
+
4248
+ for (var i = 0; i < keys.length; i++) {
4249
+ var key = keys[i];
4250
+
4251
+ if (key !== 'children' && key !== 'key') {
4252
+ setCurrentlyValidatingElement$1(fragment);
4253
+
4254
+ error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
4255
+
4256
+ setCurrentlyValidatingElement$1(null);
4257
+ break;
4258
+ }
4259
+ }
4260
+
4261
+ if (fragment.ref !== null) {
4262
+ setCurrentlyValidatingElement$1(fragment);
4263
+
4264
+ error('Invalid attribute `ref` supplied to `React.Fragment`.');
4265
+
4266
+ setCurrentlyValidatingElement$1(null);
4267
+ }
4268
+ }
4269
+ }
4270
+
4271
+ var didWarnAboutKeySpread = {};
4272
+ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
4273
+ {
4274
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
4275
+ // succeed and there will likely be errors in render.
4276
+
4277
+ if (!validType) {
4278
+ var info = '';
4279
+
4280
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
4281
+ info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
4282
+ }
4283
+
4284
+ var sourceInfo = getSourceInfoErrorAddendum();
4285
+
4286
+ if (sourceInfo) {
4287
+ info += sourceInfo;
4288
+ } else {
4289
+ info += getDeclarationErrorAddendum();
4290
+ }
4291
+
4292
+ var typeString;
4293
+
4294
+ if (type === null) {
4295
+ typeString = 'null';
4296
+ } else if (isArray(type)) {
4297
+ typeString = 'array';
4298
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
4299
+ typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
4300
+ info = ' Did you accidentally export a JSX literal instead of a component?';
4301
+ } else {
4302
+ typeString = typeof type;
4303
+ }
4304
+
4305
+ error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
4306
+ }
4307
+
4308
+ var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
4309
+ // TODO: Drop this when these are no longer allowed as the type argument.
4310
+
4311
+ if (element == null) {
4312
+ return element;
4313
+ } // Skip key warning if the type isn't valid since our key validation logic
4314
+ // doesn't expect a non-string/function type and can throw confusing errors.
4315
+ // We don't want exception behavior to differ between dev and prod.
4316
+ // (Rendering will throw with a helpful message and as soon as the type is
4317
+ // fixed, the key warnings will appear.)
4318
+
4319
+
4320
+ if (validType) {
4321
+ var children = props.children;
4322
+
4323
+ if (children !== undefined) {
4324
+ if (isStaticChildren) {
4325
+ if (isArray(children)) {
4326
+ for (var i = 0; i < children.length; i++) {
4327
+ validateChildKeys(children[i], type);
4328
+ }
4329
+
4330
+ if (Object.freeze) {
4331
+ Object.freeze(children);
4332
+ }
4333
+ } else {
4334
+ error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
4335
+ }
4336
+ } else {
4337
+ validateChildKeys(children, type);
4338
+ }
4339
+ }
4340
+ }
4341
+
4342
+ {
4343
+ if (hasOwnProperty.call(props, 'key')) {
4344
+ var componentName = getComponentNameFromType(type);
4345
+ var keys = Object.keys(props).filter(function (k) {
4346
+ return k !== 'key';
4347
+ });
4348
+ var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
4349
+
4350
+ if (!didWarnAboutKeySpread[componentName + beforeExample]) {
4351
+ var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
4352
+
4353
+ error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
4354
+
4355
+ didWarnAboutKeySpread[componentName + beforeExample] = true;
4356
+ }
4357
+ }
4358
+ }
4359
+
4360
+ if (type === REACT_FRAGMENT_TYPE) {
4361
+ validateFragmentProps(element);
4362
+ } else {
4363
+ validatePropTypes(element);
4364
+ }
4365
+
4366
+ return element;
4367
+ }
4368
+ } // These two functions exist to still get child warnings in dev
4369
+ // even with the prod transform. This means that jsxDEV is purely
4370
+ // opt-in behavior for better messages but that we won't stop
4371
+ // giving you warnings if you use production apis.
4372
+
4373
+ function jsxWithValidationStatic(type, props, key) {
4374
+ {
4375
+ return jsxWithValidation(type, props, key, true);
4376
+ }
4377
+ }
4378
+ function jsxWithValidationDynamic(type, props, key) {
4379
+ {
4380
+ return jsxWithValidation(type, props, key, false);
4381
+ }
4382
+ }
4383
+
4384
+ var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
4385
+ // for now we can ship identical prod functions
4386
+
4387
+ var jsxs = jsxWithValidationStatic ;
4388
+
4389
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
4390
+ reactJsxRuntime_development.jsx = jsx;
4391
+ reactJsxRuntime_development.jsxs = jsxs;
4392
+ })();
4393
+ }
4394
+ return reactJsxRuntime_development;
4395
+ }
4396
+
4397
+ if (process.env.NODE_ENV === 'production') {
4398
+ jsxRuntime.exports = requireReactJsxRuntime_production_min();
4399
+ } else {
4400
+ jsxRuntime.exports = requireReactJsxRuntime_development();
4401
+ }
4402
+
4403
+ var jsxRuntimeExports = jsxRuntime.exports;
4404
+
4405
+ const SmoothSendAvaxContext = require$$0.createContext(null);
4406
+ function SmoothSendAvaxProvider({ apiKey, network = 'testnet', smartAccountAddress, accountFactory, accountSalt, children, }) {
4407
+ const value = require$$0.useMemo(() => ({
4408
+ apiKey,
4409
+ network,
4410
+ smartAccountAddress,
4411
+ accountFactory,
4412
+ accountSalt: accountSalt ?? 0n,
4413
+ }), [apiKey, network, smartAccountAddress, accountFactory, accountSalt]);
4414
+ return (jsxRuntimeExports.jsx(SmoothSendAvaxContext.Provider, { value: value, children: children }));
4415
+ }
4416
+ function useSmoothSendAvaxContext() {
4417
+ return require$$0.useContext(SmoothSendAvaxContext);
4418
+ }
4419
+ function useSmoothSendAvax(params) {
4420
+ const ctx = useSmoothSendAvaxContext();
4421
+ const apiKey = params.apiKey ?? ctx?.apiKey;
4422
+ const network = params.network ?? ctx?.network ?? 'testnet';
4423
+ const smartAccountAddressProp = params.smartAccountAddress ?? ctx?.smartAccountAddress;
4424
+ const accountFactory = params.accountFactory ?? ctx?.accountFactory;
4425
+ const accountSalt = params.accountSalt ?? ctx?.accountSalt ?? 0n;
4426
+ if (!apiKey) {
4427
+ throw new Error('[SmoothSend AVAX] apiKey required — pass useSmoothSendAvax({ apiKey }) or wrap SmoothSendAvaxProvider');
4428
+ }
4429
+ if (!smartAccountAddressProp && !accountFactory) {
4430
+ throw new Error('[SmoothSend AVAX] Provide smartAccountAddress and/or accountFactory (SimpleAccountFactory)');
4431
+ }
4432
+ const submitter = require$$0.useMemo(() => new SmoothSendAvaxSubmitter({ apiKey, network }), [apiKey, network]);
4433
+ const { publicClient, walletClient } = params;
4434
+ const submitCall = require$$0.useCallback(async (call) => {
4435
+ if (!publicClient) {
4436
+ throw new Error('[SmoothSend AVAX] publicClient missing (wagmi usePublicClient)');
4437
+ }
4438
+ if (!walletClient) {
4439
+ throw new Error('[SmoothSend AVAX] walletClient missing (wagmi useWalletClient)');
4440
+ }
4441
+ const account = walletClient.account;
4442
+ if (!account) {
4443
+ throw new Error('[SmoothSend AVAX] walletClient.account missing — connect wallet (wagmi useWalletClient)');
4444
+ }
4445
+ const ownerAddress = account.address;
4446
+ const chainId = Number(publicClient.chain?.id ?? (await publicClient.getChainId()));
4447
+ const entryPoint = (await submitter.getSupportedEntryPoints())[0];
4448
+ let sender;
4449
+ if (accountFactory) {
4450
+ const predicted = await predictSimpleAccountAddress({
4451
+ publicClient,
4452
+ factory: accountFactory,
4453
+ owner: ownerAddress,
4454
+ salt: accountSalt,
4455
+ });
4456
+ if (smartAccountAddressProp &&
4457
+ predicted.toLowerCase() !== smartAccountAddressProp.toLowerCase()) {
4458
+ throw new Error(`[SmoothSend AVAX] smartAccountAddress ${smartAccountAddressProp} does not match factory prediction ${predicted}`);
4459
+ }
4460
+ sender = predicted;
4461
+ }
4462
+ else {
4463
+ sender = smartAccountAddressProp;
4464
+ }
4465
+ const code = await publicClient.getBytecode({ address: sender });
4466
+ const deployed = typeof code === 'string' &&
4467
+ code !== '0x' &&
4468
+ code.length > 2;
4469
+ let nonce;
4470
+ let factory;
4471
+ let factoryData;
4472
+ if (!deployed) {
4473
+ if (!accountFactory) {
4474
+ throw new Error('[SmoothSend AVAX] No bytecode at sender — pass accountFactory so the paymaster can sponsor deploy + call in one UserOp');
4475
+ }
4476
+ nonce = 0n;
4477
+ factory = accountFactory;
4478
+ factoryData = encodeCreateAccountFactoryData(ownerAddress, accountSalt);
4479
+ }
4480
+ else {
4481
+ nonce = await readAvaxSenderNonce({
4482
+ publicClient,
4483
+ entryPointAddress: entryPoint,
4484
+ sender,
4485
+ });
4486
+ }
4487
+ let maxFeePerGas = 50n * 10n ** 9n;
4488
+ let maxPriorityFeePerGas = 2n * 10n ** 9n;
4489
+ try {
4490
+ const est = await publicClient.estimateFeesPerGas();
4491
+ if (est.maxFeePerGas)
4492
+ maxFeePerGas = est.maxFeePerGas;
4493
+ if (est.maxPriorityFeePerGas) {
4494
+ maxPriorityFeePerGas = est.maxPriorityFeePerGas;
4495
+ }
4496
+ }
4497
+ catch {
4498
+ /* chain may not support EIP-1559 estimation */
4499
+ }
4500
+ const callData = encodeAvaxExecuteCalldata(call.to, call.value ?? 0n, call.data ?? '0x');
4501
+ return submitter.submitSponsoredUserOperation({
4502
+ userOp: {
4503
+ sender,
4504
+ nonce: viem.toHex(nonce),
4505
+ callData,
4506
+ maxFeePerGas: viem.toHex(maxFeePerGas),
4507
+ maxPriorityFeePerGas: viem.toHex(maxPriorityFeePerGas),
4508
+ ...(factory && factoryData ? { factory, factoryData } : {}),
4509
+ },
4510
+ mode: call.mode ?? 'developer-sponsored',
4511
+ paymaster: call.paymaster,
4512
+ waitForReceipt: call.waitForReceipt,
4513
+ signUserOp: async (op) => {
4514
+ const hash = hashUserOperationAvax({
4515
+ chainId,
4516
+ entryPointAddress: entryPoint,
4517
+ userOperation: op,
4518
+ });
4519
+ return walletClient.signMessage({
4520
+ account,
4521
+ message: { raw: hash },
4522
+ });
4523
+ },
4524
+ });
4525
+ }, [
4526
+ accountFactory,
4527
+ accountSalt,
4528
+ publicClient,
4529
+ smartAccountAddressProp,
4530
+ submitter,
4531
+ walletClient,
4532
+ ]);
4533
+ return { submitter, submitCall };
4534
+ }
4535
+
4536
+ // ─── helpers ────────────────────────────────────────────────────────────────
4537
+ function parseDurationToSeconds(duration) {
4538
+ if (duration === 'never') {
4539
+ // Client-side "never expires" mode; on-chain handle already uses u64::MAX.
4540
+ return Math.floor(Number.MAX_SAFE_INTEGER / 1000);
4541
+ }
4542
+ const n = parseInt(duration, 10);
4543
+ if (isNaN(n))
4544
+ throw new Error(`Invalid duration "${duration}". Use e.g. "2h", "24h", "7d", or "never".`);
4545
+ if (duration.endsWith('s'))
4546
+ return n;
4547
+ if (duration.endsWith('m'))
4548
+ return n * 60;
4549
+ if (duration.endsWith('h'))
4550
+ return n * 3600;
4551
+ if (duration.endsWith('d'))
4552
+ return n * 86400;
4553
+ throw new Error(`Unknown duration unit in "${duration}". Supported: s, m, h, d, or "never".`);
4554
+ }
4555
+ // ─── SmoothSendSession ───────────────────────────────────────────────────────
4556
+ /**
4557
+ * A session that lets your app submit transactions on behalf of a user
4558
+ * without any wallet popup after the initial one-time setup.
4559
+ *
4560
+ * Uses Aptos AIP-103 Permissioned Signers — authorization is enforced
4561
+ * on-chain by `0x1::permissioned_delegation`. No custom Move contract needed.
4562
+ *
4563
+ * @example
4564
+ * // 1. One-time setup (user signs once — can be keyless/Google login)
4565
+ * const session = await SmoothSendSession.create({
4566
+ * signer: keylessAccount,
4567
+ * expiresIn: '24h',
4568
+ * }, submitter)
4569
+ *
4570
+ * // 2. Every action after — zero popups, zero gas
4571
+ * await session.submit('0xgame::player::move', ['north'])
4572
+ * await session.submit('0xgame::player::attack', [enemyId])
4573
+ */
4574
+ class SmoothSendSession {
4575
+ constructor(args) {
4576
+ this.sessionAccount = args.sessionAccount;
4577
+ this.abstractedAccount = args.abstractedAccount;
4578
+ this.masterAddress = args.masterAddress;
4579
+ this.expiresAtMs = args.expiresAtMs;
4580
+ this.submitter = args.submitter;
4581
+ this.aptosClient = args.aptosClient;
4582
+ this._network = args.network;
4583
+ }
4584
+ /**
4585
+ * Create a new session.
4586
+ *
4587
+ * Registers the session key on-chain via
4588
+ * `0x1::permissioned_delegation::add_permissioned_handle`.
4589
+ * SmoothSend pays the gas for this setup transaction too.
4590
+ *
4591
+ * After this returns, the user never needs to approve anything again
4592
+ * until the session expires or is revoked.
4593
+ */
4594
+ static async create(options, submitter) {
4595
+ // Resolve network from options or submitter config
4596
+ const network = options.network ?? submitter.getConfig().network ?? 'testnet';
4597
+ const aptosNetwork = network === 'mainnet' ? tsSdk.Network.MAINNET : tsSdk.Network.TESTNET;
4598
+ const aptosClient = new tsSdk.Aptos(new tsSdk.AptosConfig({ network: aptosNetwork }));
4599
+ const feature = await aptosClient.view({
4600
+ payload: {
4601
+ function: '0x1::features::is_permissioned_signer_enabled',
4602
+ functionArguments: [],
4603
+ },
4604
+ }).catch(() => [false]);
4605
+ if (!Array.isArray(feature) || feature[0] !== true) {
4606
+ throw new Error('[SmoothSend] Session keys unavailable on this network (permissioned signer feature disabled).');
4607
+ }
4608
+ // Generate a fresh Ed25519 session keypair (lives in memory, never persisted)
4609
+ const sessionAccount = tsSdk.Account.generate();
4610
+ // Client-side expiry tracking (the bytecode script doesn't take an expiry arg)
4611
+ const nowSecs = Math.floor(Date.now() / 1000);
4612
+ const expirationTimeSecs = nowSecs + parseDurationToSeconds(options.expiresIn);
4613
+ // Step 1: Register the session key on-chain via a pre-compiled Move script.
4614
+ // add_permissioned_handle is NOT an entry function — only callable from a Move script.
4615
+ // Must happen BEFORE enabling account abstraction.
4616
+ const setupTx = await aptosClient.transaction.build.simple({
4617
+ sender: options.signer.accountAddress,
4618
+ withFeePayer: true,
4619
+ data: {
4620
+ bytecode: ADD_PERMISSIONED_HANDLE_BYTECODE,
4621
+ functionArguments: [tsSdk.MoveVector.U8(sessionAccount.publicKey.toUint8Array())],
4622
+ },
4623
+ options: {
4624
+ replayProtectionNonce: BigInt(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)),
4625
+ },
4626
+ });
4627
+ const senderAuth = aptosClient.transaction.sign({
4628
+ signer: options.signer,
4629
+ transaction: setupTx,
4630
+ });
4631
+ const setupResult = await submitter.submitTransaction({
4632
+ aptosConfig: aptosClient.config,
4633
+ transaction: setupTx,
4634
+ senderAuthenticator: senderAuth,
4635
+ });
4636
+ await aptosClient.waitForTransaction({ transactionHash: setupResult.hash });
4637
+ // Step 2: Enable account abstraction — tells the chain to use
4638
+ // 0x1::permissioned_delegation::authenticate for this account.
4639
+ // Idempotent — skip if already enabled.
4640
+ const aaEnabled = await aptosClient.abstraction.isAccountAbstractionEnabled({
4641
+ accountAddress: options.signer.accountAddress,
4642
+ authenticationFunction: '0x1::permissioned_delegation::authenticate',
4643
+ });
4644
+ if (!aaEnabled) {
4645
+ const aaTx = await aptosClient.transaction.build.simple({
4646
+ sender: options.signer.accountAddress,
4647
+ withFeePayer: true,
4648
+ data: {
4649
+ function: '0x1::account_abstraction::add_authentication_function',
4650
+ functionArguments: [
4651
+ tsSdk.AccountAddress.fromString('0x1'),
4652
+ 'permissioned_delegation',
4653
+ 'authenticate',
4654
+ ],
4655
+ },
4656
+ });
4657
+ const aaAuth = aptosClient.transaction.sign({ signer: options.signer, transaction: aaTx });
4658
+ const aaResult = await submitter.submitTransaction({
4659
+ aptosConfig: aptosClient.config,
4660
+ transaction: aaTx,
4661
+ senderAuthenticator: aaAuth,
2551
4662
  });
2552
4663
  await aptosClient.waitForTransaction({ transactionHash: aaResult.hash });
2553
4664
  }
@@ -2890,6 +5001,134 @@ function createScriptComposerClient(config) {
2890
5001
  return new ScriptComposerClient(config);
2891
5002
  }
2892
5003
 
5004
+ /**
5005
+ * True Gasless Client
5006
+ *
5007
+ * Designed for server-side (backend) environments to securely build, sign,
5008
+ * and submit 100% sponsored gasless transactions using a Secret Key.
5009
+ *
5010
+ * @example
5011
+ * ```typescript
5012
+ * import { TrueGaslessClient } from '@smoothsend/sdk';
5013
+ * import { Account } from '@aptos-labs/ts-sdk';
5014
+ *
5015
+ * const backendWallet = Account.fromPrivateKey({ privateKey: '...' });
5016
+ * const client = new TrueGaslessClient({ apiKey: 'sk_nogas_...', network: 'mainnet' });
5017
+ *
5018
+ * const result = await client.execute({
5019
+ * senderAccount: backendWallet,
5020
+ * payload: {
5021
+ * function: "0x123::my_module::mint_nft",
5022
+ * functionArguments: []
5023
+ * }
5024
+ * });
5025
+ *
5026
+ * console.log("Gasless NFT Minted!", result.txHash);
5027
+ * ```
5028
+ */
5029
+ class TrueGaslessClient {
5030
+ constructor(config) {
5031
+ if (!config.apiKey) {
5032
+ throw new SmoothSendError('API key is required', 'MISSING_API_KEY', 400);
5033
+ }
5034
+ if (!config.apiKey.startsWith('sk_nogas_')) {
5035
+ console.warn('⚠️ WARNING: TrueGaslessClient is intended for backend use with a Secret Key (sk_nogas_*).\n' +
5036
+ 'Using a Public Key may result in CORS errors if ran in a browser environment.');
5037
+ }
5038
+ if (!config.network) {
5039
+ throw new SmoothSendError('Network is required (testnet or mainnet)', 'MISSING_NETWORK', 400);
5040
+ }
5041
+ this.config = {
5042
+ apiKey: config.apiKey,
5043
+ network: config.network,
5044
+ proxyUrl: config.proxyUrl,
5045
+ timeout: config.timeout || 30000,
5046
+ debug: config.debug || false,
5047
+ };
5048
+ this.httpClient = new HttpClient({
5049
+ apiKey: this.config.apiKey,
5050
+ network: this.config.network,
5051
+ timeout: this.config.timeout,
5052
+ retries: 3,
5053
+ includeOrigin: false, // Backend client should not send Origin header
5054
+ baseUrl: this.config.proxyUrl, // Use custom proxy URL if provided
5055
+ });
5056
+ const networkMap = {
5057
+ testnet: tsSdk.Network.TESTNET,
5058
+ mainnet: tsSdk.Network.MAINNET,
5059
+ };
5060
+ this.aptos = new tsSdk.Aptos(new tsSdk.AptosConfig({ network: networkMap[this.config.network] }));
5061
+ }
5062
+ log(message, data) {
5063
+ if (this.config.debug) {
5064
+ console.log(`[TrueGaslessClient] ${message}`, data || '');
5065
+ }
5066
+ }
5067
+ /**
5068
+ * Builds, signs (as sender), and relays an arbitrary payload for complete sponsorship.
5069
+ */
5070
+ async execute(params) {
5071
+ this.log('Starting gasless execution', { sender: params.senderAccount.accountAddress.toString(), payload: params.payload });
5072
+ if (!params.senderAccount || !params.payload) {
5073
+ throw new SmoothSendError('Missing required parameters: senderAccount and payload', 'INVALID_PARAMETERS', 400);
5074
+ }
5075
+ try {
5076
+ this.log('Building simple transaction with fee payer enabled');
5077
+ // Build the transaction and flag it requires a remote fee payer
5078
+ const transaction = await this.aptos.transaction.build.simple({
5079
+ sender: params.senderAccount.accountAddress,
5080
+ data: params.payload,
5081
+ withFeePayer: true,
5082
+ });
5083
+ this.log('Signing transaction locally with senderAccount');
5084
+ // Sign locally over the transaction hash
5085
+ const senderAuthenticator = this.aptos.transaction.sign({
5086
+ signer: params.senderAccount,
5087
+ transaction,
5088
+ });
5089
+ this.log('Serializing to bytes for relayer transmission');
5090
+ // Convert to BCS bytes expected by the proxy
5091
+ const transactionBytes = Array.from(transaction.bcsToBytes());
5092
+ const authenticatorBytes = Array.from(senderAuthenticator.bcsToBytes());
5093
+ this.log('Sending to relayer...');
5094
+ const response = await this.httpClient.post('/api/v1/relayer/gasless-transaction', {
5095
+ transactionBytes,
5096
+ authenticatorBytes,
5097
+ network: this.config.network,
5098
+ functionName: 'function' in params.payload ? params.payload.function : 'unknown',
5099
+ });
5100
+ this.log('Relayer submission successful', response.data);
5101
+ return {
5102
+ success: response.data.success ?? true,
5103
+ requestId: response.data.requestId,
5104
+ txHash: response.data.txnHash || response.data.txHash,
5105
+ gasUsed: response.data.gasUsed,
5106
+ vmStatus: response.data.vmStatus,
5107
+ sender: response.data.sender || params.senderAccount.accountAddress.toString(),
5108
+ };
5109
+ }
5110
+ catch (error) {
5111
+ this.log('Gasless execution failed', error);
5112
+ if (error instanceof SmoothSendError) {
5113
+ throw error;
5114
+ }
5115
+ throw new SmoothSendError(`Failed to execute gasless transaction: ${error.message}`, 'EXECUTION_FAILED', 500, { originalError: error.message });
5116
+ }
5117
+ }
5118
+ /**
5119
+ * Expose the core Aptos instance to allow backend developers to access chain state if needed
5120
+ */
5121
+ getAptosClient() {
5122
+ return this.aptos;
5123
+ }
5124
+ }
5125
+ /**
5126
+ * Helper to initialize TrueGaslessClient
5127
+ */
5128
+ function createTrueGaslessClient(config) {
5129
+ return new TrueGaslessClient(config);
5130
+ }
5131
+
2893
5132
  /**
2894
5133
  * SmoothSend SDK v2.0
2895
5134
  *
@@ -2921,29 +5160,47 @@ function createScriptComposerClient(config) {
2921
5160
  * SDK version
2922
5161
  * @public
2923
5162
  */
2924
- const VERSION = '2.2.0';
5163
+ const VERSION = '2.2.1';
2925
5164
 
2926
5165
  exports.APTOS_ERROR_CODES = APTOS_ERROR_CODES;
2927
5166
  exports.AptosAdapter = AptosAdapter;
2928
5167
  exports.AuthenticationError = AuthenticationError;
5168
+ exports.AvaxSubmitter = AvaxSubmitter;
2929
5169
  exports.CHAIN_ECOSYSTEM_MAP = CHAIN_ECOSYSTEM_MAP;
5170
+ exports.ENTRY_POINT_V07_ADDRESS = ENTRY_POINT_V07_ADDRESS;
2930
5171
  exports.HttpClient = HttpClient;
2931
5172
  exports.NetworkError = NetworkError;
2932
5173
  exports.RateLimitError = RateLimitError;
5174
+ exports.SIMPLE_ACCOUNT_FACTORY_ABI = SIMPLE_ACCOUNT_FACTORY_ABI;
2933
5175
  exports.STELLAR_ERROR_CODES = STELLAR_ERROR_CODES;
2934
5176
  exports.ScriptComposerClient = ScriptComposerClient;
5177
+ exports.SmoothSendAvaxProvider = SmoothSendAvaxProvider;
5178
+ exports.SmoothSendAvaxSubmitter = SmoothSendAvaxSubmitter;
2935
5179
  exports.SmoothSendError = SmoothSendError;
2936
5180
  exports.SmoothSendSDK = SmoothSendSDK;
2937
5181
  exports.SmoothSendSession = SmoothSendSession;
2938
5182
  exports.SmoothSendTransactionSubmitter = SmoothSendTransactionSubmitter;
2939
5183
  exports.StellarAdapter = StellarAdapter;
2940
5184
  exports.StellarCAddressAdapter = StellarCAddressAdapter;
5185
+ exports.TrueGaslessClient = TrueGaslessClient;
2941
5186
  exports.VERSION = VERSION;
2942
5187
  exports.ValidationError = ValidationError;
5188
+ exports.avaxExecuteAbi = avaxExecuteAbi;
2943
5189
  exports.createErrorFromResponse = createErrorFromResponse;
2944
5190
  exports.createNetworkError = createNetworkError;
2945
5191
  exports.createScriptComposerClient = createScriptComposerClient;
5192
+ exports.createSmoothSendAvaxSubmitter = createSmoothSendAvaxSubmitter;
2946
5193
  exports.createSmoothSendSubmitter = createSmoothSendSubmitter;
5194
+ exports.createTrueGaslessClient = createTrueGaslessClient;
2947
5195
  exports.default = SmoothSendSDK;
5196
+ exports.encodeAvaxExecuteCalldata = encodeAvaxExecuteCalldata;
5197
+ exports.encodeCreateAccountFactoryData = encodeCreateAccountFactoryData;
5198
+ exports.fetchAvaxAaPublicDefaults = fetchAvaxAaPublicDefaults;
5199
+ exports.hashUserOperationAvax = hashUserOperationAvax;
5200
+ exports.predictSimpleAccountAddress = predictSimpleAccountAddress;
5201
+ exports.readAvaxSenderNonce = readAvaxSenderNonce;
2948
5202
  exports.useSmoothSend = useSmoothSend;
5203
+ exports.useSmoothSendAvax = useSmoothSendAvax;
5204
+ exports.useSmoothSendAvaxContext = useSmoothSendAvaxContext;
5205
+ exports.userOperationAvaxToViem = userOperationAvaxToViem;
2949
5206
  //# sourceMappingURL=index.js.map