@toon-protocol/client 0.14.2 → 0.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2977,9 +2977,24 @@ interface FundWalletResult {
2977
2977
  interface FundWalletOptions {
2978
2978
  /** Custom fetch implementation (for testing / custom transports). */
2979
2979
  fetchImpl?: typeof fetch;
2980
- /** Request timeout in milliseconds (default: 30000). */
2980
+ /**
2981
+ * Request timeout in milliseconds. Defaults to {@link defaultFaucetTimeout}
2982
+ * for the chain (fast 30s for evm/solana, a longer 120s for the slow-settling
2983
+ * mina faucet).
2984
+ */
2981
2985
  timeout?: number;
2982
2986
  }
2987
+ /**
2988
+ * Default faucet request timeout (ms) for a chain.
2989
+ *
2990
+ * EVM and Solana faucets respond in a few seconds, so 30s is plenty. The Mina
2991
+ * faucet sends native MINA *and* mints USDC on a chain that settles much more
2992
+ * slowly: the drip routinely succeeds server-side (the faucet logs
2993
+ * `✅ Mina faucet request completed`) but takes well over 30s to answer the
2994
+ * HTTP request, so a flat 30s budget makes the client give up on a request that
2995
+ * actually worked. Give mina a much longer budget.
2996
+ */
2997
+ declare function defaultFaucetTimeout(chain: FaucetChain): number;
2983
2998
  /**
2984
2999
  * Drip test funds to `address` on `chain` from the devnet `faucetUrl`.
2985
3000
  *
@@ -3341,4 +3356,4 @@ declare function loadKeystore(path: string, password: string): string;
3341
3356
  */
3342
3357
  declare function writeKeystoreFile(path: string, keystore: EncryptedKeystore): void;
3343
3358
 
3344
- export { type BackupPayload, type BalanceProofParams, BtpRuntimeClient, type BtpRuntimeClientConfig, type ChainMetadata, type ChainSigner, ChannelManager, type ClaimMessage, type ClaimResolver, ConnectorError, type DiscoveredIlpPeer, type EVMClaimMessage, type EncryptedKeystore, EvmSigner, type FaucetChain, type FundWalletOptions, type FundWalletResult, type H402FetchOptions, Http402Client, type Http402ClientConfig, HttpConnectorAdmin, type HttpConnectorAdminConfig, HttpIlpClient, type HttpIlpClientConfig, type HttpIlpClientFactory, HttpRuntimeClient, type HttpRuntimeClientConfig, ILP_CLAIM_HEADER, ILP_CLAIM_WRAPPED_HEADER, ILP_PEER_ID_HEADER, type IlpTransportChoice, type InteractionResultContent, KeyManager, type KeyManagerConfig, type MinaClaimMessage, type MinaDepositReader, MinaSigner, type MinaSignerOptions, NetworkError, OnChainChannelClient, type OnChainChannelClientConfig, type ParsedFulfillHttp, type ParsedX402Challenge, type PasskeyInfo, type PetDvmProvider, type PetInteractionEventData, type PetInteractionRequestParams, type PetInteractionResultData, type PetListing, type PetListingFilterOptions, type PetListingParams, type PetPurchaseRequestParams, type ProofStatus, type PublishEventResult, type RequestBlobStorageParams, type RequestBlobStorageResult, type RetryOptions, type SelectIlpTransportOptions, type SignedBalanceProof, type SolanaChannelClientOptions, type SolanaClaimMessage, SolanaSigner, type StatValues, type ToonChannelAccept, ToonClient, type ToonClientConfig, ToonClientError, type ToonIdentity, type ToonSigners, type ToonStartResult, type UnsignedNostrEvent, ValidationError, type VaultData, applyDefaults, applyNetworkPresets, buildBackupEvent, buildBackupFilter, buildPetInteractionRequest, buildPetListingEvent, buildPetPurchaseRequest, buildSettlementInfo, buildStoreWriteEnvelope, decryptMnemonic, deriveFromNsec, deriveFullIdentity, deriveNostrKeyFromMnemonic, encryptMnemonic, filterPetDvmProviders, filterPetListings, fundWallet, generateKeystore, generateMnemonic, generateRandomIdentity, getNetworkStatus, httpEndpointToBtpUrl, importKeystore, isPrfSupported, loadKeystore, parseBackupPayload, parseFulfillHttp, parseFulfillHttpBytes, parseHttpResponse, parsePetInteractionEvent, parsePetInteractionResult, parsePetListing, parseX402Body, parseX402Challenge, proxyIlpEndpoint, readDiscoveredIlpPeer, readMinaDepositTotal, requestBlobStorage, selectIlpTransport, serializeHttpRequest, validateConfig, validateMnemonic, withRetry, writeKeystoreFile };
3359
+ export { type BackupPayload, type BalanceProofParams, BtpRuntimeClient, type BtpRuntimeClientConfig, type ChainMetadata, type ChainSigner, ChannelManager, type ClaimMessage, type ClaimResolver, ConnectorError, type DiscoveredIlpPeer, type EVMClaimMessage, type EncryptedKeystore, EvmSigner, type FaucetChain, type FundWalletOptions, type FundWalletResult, type H402FetchOptions, Http402Client, type Http402ClientConfig, HttpConnectorAdmin, type HttpConnectorAdminConfig, HttpIlpClient, type HttpIlpClientConfig, type HttpIlpClientFactory, HttpRuntimeClient, type HttpRuntimeClientConfig, ILP_CLAIM_HEADER, ILP_CLAIM_WRAPPED_HEADER, ILP_PEER_ID_HEADER, type IlpTransportChoice, type InteractionResultContent, KeyManager, type KeyManagerConfig, type MinaClaimMessage, type MinaDepositReader, MinaSigner, type MinaSignerOptions, NetworkError, OnChainChannelClient, type OnChainChannelClientConfig, type ParsedFulfillHttp, type ParsedX402Challenge, type PasskeyInfo, type PetDvmProvider, type PetInteractionEventData, type PetInteractionRequestParams, type PetInteractionResultData, type PetListing, type PetListingFilterOptions, type PetListingParams, type PetPurchaseRequestParams, type ProofStatus, type PublishEventResult, type RequestBlobStorageParams, type RequestBlobStorageResult, type RetryOptions, type SelectIlpTransportOptions, type SignedBalanceProof, type SolanaChannelClientOptions, type SolanaClaimMessage, SolanaSigner, type StatValues, type ToonChannelAccept, ToonClient, type ToonClientConfig, ToonClientError, type ToonIdentity, type ToonSigners, type ToonStartResult, type UnsignedNostrEvent, ValidationError, type VaultData, applyDefaults, applyNetworkPresets, buildBackupEvent, buildBackupFilter, buildPetInteractionRequest, buildPetListingEvent, buildPetPurchaseRequest, buildSettlementInfo, buildStoreWriteEnvelope, decryptMnemonic, defaultFaucetTimeout, deriveFromNsec, deriveFullIdentity, deriveNostrKeyFromMnemonic, encryptMnemonic, filterPetDvmProviders, filterPetListings, fundWallet, generateKeystore, generateMnemonic, generateRandomIdentity, getNetworkStatus, httpEndpointToBtpUrl, importKeystore, isPrfSupported, loadKeystore, parseBackupPayload, parseFulfillHttp, parseFulfillHttpBytes, parseHttpResponse, parsePetInteractionEvent, parsePetInteractionResult, parsePetListing, parseX402Body, parseX402Challenge, proxyIlpEndpoint, readDiscoveredIlpPeer, readMinaDepositTotal, requestBlobStorage, selectIlpTransport, serializeHttpRequest, validateConfig, validateMnemonic, withRetry, writeKeystoreFile };
package/dist/index.js CHANGED
@@ -5414,6 +5414,9 @@ function buildPetPurchaseRequest(params) {
5414
5414
  }
5415
5415
 
5416
5416
  // src/faucet.ts
5417
+ function defaultFaucetTimeout(chain) {
5418
+ return chain === "mina" ? 12e4 : 3e4;
5419
+ }
5417
5420
  function faucetPath(chain) {
5418
5421
  switch (chain) {
5419
5422
  case "evm":
@@ -5434,7 +5437,7 @@ async function fundWallet(faucetUrl, address, chain, options = {}) {
5434
5437
  const base = faucetUrl.replace(/\/+$/, "");
5435
5438
  const url = `${base}${faucetPath(chain)}`;
5436
5439
  const fetchImpl = options.fetchImpl ?? fetch;
5437
- const timeout = options.timeout ?? 3e4;
5440
+ const timeout = options.timeout ?? defaultFaucetTimeout(chain);
5438
5441
  const controller = new AbortController();
5439
5442
  const timeoutId = setTimeout(() => controller.abort(), timeout);
5440
5443
  let response;
@@ -6557,6 +6560,7 @@ export {
6557
6560
  buildUiCoordinate,
6558
6561
  classifyIntent,
6559
6562
  decryptMnemonic2 as decryptMnemonic,
6563
+ defaultFaucetTimeout,
6560
6564
  deriveFromNsec,
6561
6565
  deriveFullIdentity,
6562
6566
  deriveNostrKeyFromMnemonic,