import { AptosSettings, AccountAddress } from '@aptos-labs/ts-sdk'; import { ShelbyNetwork } from '../networks.js'; /** * Configuration for the Shelby RPC connection. */ type ShelbyRPCConfig = { /** Base URL of the Shelby RPC node (e.g., "https://shelby.shelbynet.shelby.xyz/shelby"). */ baseUrl?: string; /** API key for authenticating with the RPC node. */ apiKey?: string; }; /** * Configuration for the Shelby indexer (GraphQL) connection. */ interface ShelbyIndexerConfig { /** Base URL of the indexer GraphQL endpoint. */ baseUrl?: string; /** API key for authenticating with the indexer. */ apiKey?: string; } /** * Complete configuration object for Shelby SDK clients. * * @example * ```typescript * const config: ShelbyClientConfig = { * network: Network.SHELBYNET * }; * ``` */ interface ShelbyClientConfig { /** The Shelby network to use. */ network: ShelbyNetwork; /** API key for authenticating with the Shelby services. */ apiKey?: string; /** An optional Aptos blockchain configuration. If not provided, the default Aptos client will be used. */ aptos?: AptosSettings; /** Custom deployer address for the Shelby smart contract (optional, defaults to SHELBY_DEPLOYER). */ deployer?: AccountAddress; /** Custom deployer address for the micropayments contract (optional, defaults to MICROPAYMENTS_DEPLOYER). */ micropaymentsDeployer?: AccountAddress; /** An optional RPC node configuration for blob storage operations. If not provided, the default RPC node will be used. */ rpc?: ShelbyRPCConfig; /** An optional indexer configuration for GraphQL queries. If not provided, the default indexer will be used. */ indexer?: ShelbyIndexerConfig; /** An optional faucet configuration. */ faucet?: { /** An optional faucet URL for funding accounts. If not provided, the default faucet will be used. */ baseUrl?: string; /** Auth token for the faucet endpoint. */ authToken?: string; }; /** * When true, all on-chain transactions submitted by this client will use Aptos orderless * transactions (replay protection via a random nonce) instead of the default sequence-number * based transactions. This allows concurrent transaction submission from a single account * without serialization on sequence numbers. A cryptographically random 64-bit nonce is * generated automatically for each transaction. */ orderless?: boolean; /** * Best-effort location (region) hint sent with every blob registration from this client, * typically the location closest to where the client runs. Honored only for accounts in * the default `FollowHint` location-preference mode, and overridden by a per-write * `selectedLocation`. Without a resolvable location (no preference, no selection, no * hint), writes abort on chain. */ locationHint?: string; } export type { ShelbyClientConfig, ShelbyIndexerConfig, ShelbyRPCConfig };