@bolt-liquidity-hq/cosmwasm-client 0.1.0-beta.4 → 0.1.0-beta.6

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.cts CHANGED
@@ -6,7 +6,14 @@ import { OfflineSigner } from '@cosmjs/proto-signing';
6
6
  * Error codes used throughout the Bolt SDK to categorize different types of errors.
7
7
  *
8
8
  * These codes help in programmatic error handling and provide a consistent way
9
- * to identify error types across the SDK.
9
+ * to identify error types across the SDK. Error codes are organized into ranges
10
+ * by category for easier identification and handling.
11
+ *
12
+ * Error Code Ranges:
13
+ * - 1000-1999: Resource & Data Errors
14
+ * - 2000-2999: Blockchain Transaction Errors
15
+ * - 3000-3999: Infrastructure & Network Errors
16
+ * - 4000-4999: Validation & Input Errors
10
17
  *
11
18
  * @enum {number}
12
19
  * @group Errors
@@ -36,27 +43,27 @@ import { OfflineSigner } from '@cosmjs/proto-signing';
36
43
  */
37
44
  declare enum BoltSdkErrorCode {
38
45
  /** Resource not found (pools, assets, configurations) */
39
- NOT_FOUND = 0,
46
+ NOT_FOUND = 1000,
40
47
  /** Invalid object structure or missing required fields */
41
- INVALID_OBJECT = 1,
48
+ INVALID_OBJECT = 1001,
42
49
  /** Type mismatch or invalid type provided */
43
- INVALID_TYPE = 2,
50
+ INVALID_TYPE = 1002,
44
51
  /** Insufficient balance to perform the operation */
45
- INSUFFICIENT_FUNDS = 3,
52
+ INSUFFICIENT_FUNDS = 2000,
46
53
  /** Invalid blockchain address format */
47
- INVALID_ADDRESS = 4,
54
+ INVALID_ADDRESS = 2001,
48
55
  /** Transaction reverted or failed on-chain */
49
- TRANSACTION_FAILED = 5,
56
+ TRANSACTION_FAILED = 2002,
50
57
  /** Expected transaction event not found in logs */
51
- TRANSACTION_EVENT_NOT_FOUND = 6,
58
+ TRANSACTION_EVENT_NOT_FOUND = 2003,
52
59
  /** Network connectivity or RPC communication failure */
53
- NETWORK_ERROR = 7,
60
+ NETWORK_ERROR = 3000,
54
61
  /** Invalid parameter provided to a method */
55
- INVALID_PARAMETER = 8,
62
+ INVALID_PARAMETER = 4000,
56
63
  /** Required parameter is missing */
57
- MISSING_PARAMETER = 9,
64
+ MISSING_PARAMETER = 4001,
58
65
  /** Numeric value outside acceptable range */
59
- PARAMETER_OUT_OF_RANGE = 10
66
+ PARAMETER_OUT_OF_RANGE = 4002
60
67
  }
61
68
  /**
62
69
  * Base interface for all Bolt SDK errors.
@@ -262,11 +269,6 @@ declare class ParameterOutOfRangeError extends BoltSdkErrorBase {
262
269
  constructor(parameterName: string, value: number | bigint, min?: number | bigint, max?: number | bigint, details?: string);
263
270
  }
264
271
 
265
- declare enum Environment {
266
- Mainnet = "mainnet",
267
- Testnet = "testnet"
268
- }
269
-
270
272
  type Address = string;
271
273
  type AssetPairString = string;
272
274
  type Timestamp = string;
@@ -279,17 +281,35 @@ type Coin = {
279
281
  amount: string;
280
282
  };
281
283
 
282
- type ClientConfig = {
283
- environment?: Environment;
284
- customOverride?: {
285
- rpcEndpoint?: string;
286
- contracts?: Partial<Contracts>;
287
- };
284
+ type Environment = 'mainnet' | 'testnet';
285
+ type Asset = {
286
+ symbol: string;
287
+ name: string;
288
+ chainId: string;
289
+ denom: string;
290
+ decimals: number;
291
+ logo?: string;
292
+ coingeckoId?: string;
293
+ };
294
+ type ChainConfig = {
295
+ name: string;
296
+ id: string;
297
+ rpcEndpoint: string;
288
298
  };
289
299
  type Contracts = {
290
300
  oracle: Address;
291
301
  router: Address;
292
302
  };
303
+ type AssetsConfig = Record<string, Asset>;
304
+
305
+ type ClientConfig<TChainConfig = ChainConfig> = {
306
+ environment?: Environment;
307
+ customOverride?: {
308
+ chainConfig?: Partial<TChainConfig>;
309
+ contracts?: Partial<Contracts>;
310
+ assetsConfig?: AssetsConfig;
311
+ };
312
+ };
293
313
 
294
314
  type OracleConfig = {
295
315
  admin: Address;
@@ -314,10 +334,7 @@ type OracleAssetPair = {
314
334
  quote: OracleAsset;
315
335
  };
316
336
 
317
- declare enum AllowanceMode {
318
- Allow = "allow",
319
- Disallow = "disallow"
320
- }
337
+ type AllowanceMode = 'allow' | 'disallow';
321
338
  type PoolConfig = {
322
339
  priceOracleContract: Address;
323
340
  protocolFeeRecipient: Address;
@@ -366,43 +383,67 @@ type SwapResult<TTxOutput = unknown> = {
366
383
  * defining the core interface for interacting with oracle and router contracts.
367
384
  *
368
385
  * @template TSigner - The type of the transaction signer specific to the blockchain implementation
386
+ * @template TTxOutput - The type of the transaction output specific to the blockchain implementation
369
387
  *
370
388
  * @example
371
389
  * ```typescript
372
- * class BoltCosmWasmClient extends BaseClient<OfflineSigner> {
390
+ * class BoltCosmWasmClient extends BaseClient<OfflineSigner, ExecuteResult> {
373
391
  * // Implementation specific to CosmWasm
374
392
  * }
375
393
  * ```
376
394
  */
377
- declare abstract class BaseClient<TSigner = unknown> {
395
+ declare abstract class BaseClient<TSigner = unknown, TTxOutput = unknown> {
378
396
  /**
379
- * The RPC endpoint URL for connecting to the blockchain network
397
+ * The blockchain network configuration containing chain ID, name, and RPC endpoint
380
398
  */
381
- rpcEndpoint: Address;
399
+ chainConfig: ChainConfig;
382
400
  /**
383
401
  * Smart contract addresses for making Bolt queries and transactions in the blockchain
384
402
  */
385
403
  contracts: Contracts;
404
+ /**
405
+ * Configuration mapping of supported assets indexed by their symbol
406
+ */
407
+ assetsConfig: AssetsConfig;
386
408
  /**
387
409
  * Creates a new instance of the BaseClient.
388
410
  *
389
411
  * @param config - (Optional) Configuration object for the client
390
- * @param config.customOverride - (Optional) Override configuration for RPC endpoint and contract addresses
391
- * @param config.customOverride.rpcEndpoint - (Optional) Custom RPC endpoint URL for the blockchain network
392
- * @param config.customOverride.contracts - (Optional) Custom contract addresses
393
- * @param config.customOverride.contracts.oracle - (Optional) Custom oracle contract address
394
- * @param config.customOverride.contracts.router - (Optional) Custom router contract address
412
+ * @param config.customOverride - (Optional) Override configuration containing chain settings, contracts, and assets
413
+ * @param config.customOverride.chainConfig - (Optional) Chain configuration object
414
+ * @param config.customOverride.chainConfig.id - (Optional) The chain ID of the blockchain network (e.g., "archway-1")
415
+ * @param config.customOverride.chainConfig.name - (Optional) The human-readable name of the chain (e.g., "Archway")
416
+ * @param config.customOverride.chainConfig.rpcEndpoint - (Optional) RPC endpoint URL for the blockchain network
417
+ * @param config.customOverride.contracts - (Optional) Contract addresses for oracle and router
418
+ * @param config.customOverride.contracts.oracle - (Optional) Oracle contract address
419
+ * @param config.customOverride.contracts.router - (Optional) Router contract address
420
+ * @param config.customOverride.assetsConfig - (Optional) Configuration for supported assets indexed by symbol
395
421
  *
396
422
  * @throws {InvalidObjectError} Thrown when required configuration fields are missing
397
423
  *
398
424
  * @example
399
425
  * ```typescript
400
426
  * const client = new ConcreteClient({
401
- * override: {
402
- * rpcEndpoint: 'https://rpc.example.com',
427
+ * customOverride: {
428
+ * chainConfig: {
429
+ * id: 'archway-1',
430
+ * name: 'Archway',
431
+ * rpcEndpoint: 'https://rpc.example.com'
432
+ * },
403
433
  * contracts: {
404
- * oracle: 'archway1...',
405
- * router: 'archway1...'
434
+ * oracle: 'archway1oracle...',
435
+ * router: 'archway1router...'
436
+ * },
437
+ * assetsConfig: {
438
+ * 'ARCH': {
439
+ * symbol: 'ARCH',
440
+ * name: 'Archway',
441
+ * chainId: 'archway-1',
442
+ * denom: 'aarch',
443
+ * decimals: 18,
444
+ * logo: 'https://...',
445
+ * coingeckoId: 'archway'
446
+ * }
406
447
  * }
407
448
  * }
408
449
  * });
@@ -419,6 +460,8 @@ declare abstract class BaseClient<TSigner = unknown> {
419
460
  * ```typescript
420
461
  * const oracleConfig = await client.getOracleConfig();
421
462
  * console.log(`Price expiration: ${oracleConfig.priceExpireTime} seconds`);
463
+ * console.log(`Admin: ${oracleConfig.admin}`);
464
+ * console.log(`Price threshold ratio: ${oracleConfig.priceThresholdRatio}`);
422
465
  * ```
423
466
  */
424
467
  abstract getOracleConfig(): Promise<OracleConfig>;
@@ -433,26 +476,27 @@ declare abstract class BaseClient<TSigner = unknown> {
433
476
  * const pairs = await client.getAllOracleAssetPairs();
434
477
  * pairs.forEach(pair => {
435
478
  * console.log(`${pair.base.symbol}/${pair.quote.symbol}`);
436
- * console.log(` Base: ${pair.base.name}`);
437
- * console.log(` Quote: ${pair.quote.name}`);
479
+ * console.log(` Base: ${pair.base.name} (${pair.base.precision} decimals)`);
480
+ * console.log(` Quote: ${pair.quote.name} (${pair.quote.precision} decimals)`);
438
481
  * });
439
482
  * ```
440
483
  */
441
484
  abstract getAllOracleAssetPairs(): Promise<OracleAssetPair[]>;
442
485
  /**
443
- * Fetches the current price for a specific base/quote asset pair.
486
+ * Fetches the current price for a specific base/quote asset pair from the oracle.
444
487
  *
445
- * @param baseAssetSymbol - The chain symbol of the base asset (e.g., "aarch", "ibc/...")
446
- * @param quoteAssetSymbol - The chain symbol of the quote asset (e.g., "aarch", "ibc/...")
488
+ * @param baseAssetSymbol - The symbol of the base asset (e.g., "ARCH", "USDC")
489
+ * @param quoteAssetSymbol - The symbol of the quote asset (e.g., "ARCH", "USDC")
447
490
  *
448
491
  * @returns A promise that resolves to an invertible price object containing
449
- * the current price from the oracle
492
+ * the current price from the oracle and whether it's inverted
450
493
  *
451
494
  * @example
452
495
  * ```typescript
453
496
  * // Get price of ARCH in terms of USDC
454
- * const priceResult = await client.getPrice("aarch", "ibc/43897B9739BD63E3A08A88191999C632E052724AB96BD4C74AE31375C991F48D");
497
+ * const priceResult = await client.getPrice("ARCH", "USDC");
455
498
  * console.log(`1 ARCH = ${priceResult.price} USDC`);
499
+ * console.log(`Is inverted: ${priceResult.isInverse}`);
456
500
  * ```
457
501
  */
458
502
  abstract getPrice(baseAssetSymbol: string, quoteAssetSymbol: string): Promise<InvertiblePrice>;
@@ -460,14 +504,14 @@ declare abstract class BaseClient<TSigner = unknown> {
460
504
  * Fetches all available prices from the oracle.
461
505
  *
462
506
  * @returns A promise that resolves to an array of all current prices
463
- * available in the oracle with their respective asset pairs
507
+ * available in the oracle with their respective asset pairs and expiry times
464
508
  *
465
509
  * @example
466
510
  * ```typescript
467
511
  * const prices = await client.getAllPrices();
468
512
  * prices.forEach(priceData => {
469
513
  * console.log(`${priceData.assetPair}: ${priceData.price}`);
470
- * console.log(` Expires on: ${priceData.expiryTime}`);
514
+ * console.log(` Expires at: ${new Date(priceData.expiryTime * 1000).toISOString()}`);
471
515
  * });
472
516
  * ```
473
517
  */
@@ -483,6 +527,7 @@ declare abstract class BaseClient<TSigner = unknown> {
483
527
  * const routerConfig = await client.getRouterConfig();
484
528
  * console.log(`Default protocol fee: ${routerConfig.defaultProtocolFee * 100}%`);
485
529
  * console.log(`Default LP fee: ${routerConfig.defaultLpFee * 100}%`);
530
+ * console.log(`Oracle address: ${routerConfig.priceOracleContract}`);
486
531
  * ```
487
532
  */
488
533
  abstract getRouterConfig(): Promise<RouterConfig>;
@@ -518,7 +563,7 @@ declare abstract class BaseClient<TSigner = unknown> {
518
563
  * Object.entries(quotes).forEach(([poolAddress, coins]) => {
519
564
  * console.log(`Pool ${poolAddress}:`);
520
565
  * coins.forEach(coin => {
521
- * console.log(` ${coin.amount} ${coin.symbol}`);
566
+ * console.log(` ${coin.amount} ${coin.denom}`);
522
567
  * });
523
568
  * });
524
569
  * ```
@@ -527,13 +572,15 @@ declare abstract class BaseClient<TSigner = unknown> {
527
572
  /**
528
573
  * Fetches pool information for a specific base asset.
529
574
  *
530
- * @param baseAssetSymbol - The symbol of the base asset (e.g., "aarch", "ibc/...")
575
+ * @param baseAssetSymbol - The symbol of the base asset (e.g., "ARCH", "ATOM")
531
576
  *
532
577
  * @returns A promise that resolves to the pool information for the specified asset
533
578
  *
579
+ * @throws Will throw an error if no pool exists for the specified base asset
580
+ *
534
581
  * @example
535
582
  * ```typescript
536
- * const pool = await client.getPoolByBaseAsset("aarch");
583
+ * const pool = await client.getPoolByBaseAsset("ARCH");
537
584
  * console.log(`Pool address: ${pool.poolAddress}`);
538
585
  * console.log(`Base asset: ${pool.baseAssetSymbol}`);
539
586
  * console.log('Available quote assets:');
@@ -548,8 +595,6 @@ declare abstract class BaseClient<TSigner = unknown> {
548
595
  *
549
596
  * @returns A promise that resolves to an array containing all pool information
550
597
  *
551
- * @throws Will throw an error if no pool exists for the specified base asset
552
- *
553
598
  * @example
554
599
  * ```typescript
555
600
  * const pools = await client.getAllPools();
@@ -585,31 +630,45 @@ declare abstract class BaseClient<TSigner = unknown> {
585
630
  */
586
631
  abstract getPoolConfig(poolContractAddress: string): Promise<PoolConfig>;
587
632
  /**
588
- * Fetches the configuration settings for a pool identified by its base asset symbol.
633
+ * Fetches all supported assets across all pools in the Bolt protocol.
589
634
  *
590
- * This method retrieves the pool configuration by first looking up the pool
591
- * associated with the given base asset, then fetching its configuration parameters.
635
+ * This method retrieves comprehensive information about all assets that can be traded,
636
+ * including their metadata, chain-specific details, and external identifiers.
592
637
  *
593
- * @param baseAssetSymbol - The symbol of the base asset (e.g., "aarch", "ibc/...")
594
- *
595
- * @returns A promise that resolves to a pool configuration object containing
596
- * settings such as fees, oracle address, LP addresses, and minimum trade amounts
597
- *
598
- * @throws Will throw an error if no pool exists for the specified base asset
638
+ * @returns A promise that resolves to an array of Asset objects, each containing:
639
+ * - symbol: The asset's trading symbol (e.g., "ARCH", "USDC")
640
+ * - name: The full name of the asset (e.g., "Archway", "USD Coin")
641
+ * - chainId: The blockchain network identifier where this asset exists
642
+ * - denom: The chain-specific denomination (e.g., "aarch", "ibc/...")
643
+ * - decimals: The number of decimal places for the asset
644
+ * - logo: Optional URL to the asset's logo image
645
+ * - coingeckoId: Optional CoinGecko identifier for price data
599
646
  *
600
647
  * @example
601
648
  * ```typescript
602
- * // Get pool configuration for ARCH base asset
603
- * const poolConfig = await client.getPoolConfigByBaseAsset("aarch");
604
- * console.log(`Oracle: ${poolConfig.priceOracleContract}`);
605
- * console.log(`Protocol fee: ${poolConfig.protocolFee * 100}%`);
606
- * console.log(`LP fee: ${poolConfig.lpFee * 100}%`);
607
- * console.log(`Allowance mode: ${poolConfig.allowanceMode}`);
608
- * console.log(`Number of LPs: ${poolConfig.lps.length}`);
609
- * console.log(`Min base output: ${poolConfig.minBaseOut}`);
649
+ * const assets = await client.getAllAssets();
650
+ *
651
+ * // Display all available assets
652
+ * assets.forEach(asset => {
653
+ * console.log(`${asset.symbol} (${asset.name})`);
654
+ * console.log(` Chain: ${asset.chainId}`);
655
+ * console.log(` Denom: ${asset.denom}`);
656
+ * console.log(` Decimals: ${asset.decimals}`);
657
+ * if (asset.coingeckoId) {
658
+ * console.log(` CoinGecko: ${asset.coingeckoId}`);
659
+ * }
660
+ * });
661
+ *
662
+ * // Find a specific asset
663
+ * const archAsset = assets.find(a => a.symbol === 'ARCH');
664
+ * console.log(`ARCH denom: ${archAsset?.denom}`);
610
665
  * ```
666
+ *
667
+ * @remarks
668
+ * Assets returned by this method represent all tokens available for trading
669
+ * in the Bolt protocol. The list may vary between mainnet and testnet environments.
611
670
  */
612
- abstract getPoolConfigByBaseAsset(baseAssetSymbol: string): Promise<PoolConfig>;
671
+ abstract getAllAssets(): Promise<Asset[]>;
613
672
  /**
614
673
  * Executes a swap operation on the blockchain from one asset to another.
615
674
  *
@@ -628,8 +687,11 @@ declare abstract class BaseClient<TSigner = unknown> {
628
687
  * @param params.receiver - Optional recipient address for the swapped assets.
629
688
  * If not provided, defaults to the signer's address.
630
689
  *
631
- * @returns A promise that resolves to the swap result containing transaction
632
- * details and the actual amount of output asset received
690
+ * @returns A promise that resolves to a SwapResult containing:
691
+ * - txOutput: Transaction execution details (type varies by implementation)
692
+ * - amountOut: The actual amount of output asset received (as a string)
693
+ * - assetOut: The denom of the asset received
694
+ * - txHash: The transaction hash
633
695
  *
634
696
  * @throws Will throw an error if the swap fails due to insufficient balance,
635
697
  * slippage exceeding tolerance, or other transaction errors
@@ -646,7 +708,7 @@ declare abstract class BaseClient<TSigner = unknown> {
646
708
  * });
647
709
  *
648
710
  * console.log(`Swapped exactly 1 ARCH`);
649
- * console.log(`Received: ${result.amountOut} USDC`);
711
+ * console.log(`Received: ${result.amountOut} ${result.assetOut}`);
650
712
  * console.log(`Transaction: ${result.txHash}`);
651
713
  * ```
652
714
  *
@@ -656,18 +718,23 @@ declare abstract class BaseClient<TSigner = unknown> {
656
718
  * - The output amount depends on pool conditions
657
719
  * - Fees are deducted from the output
658
720
  * - Use minimumAmountOut to protect against excessive slippage
721
+ *
722
+ * The TTxOutput type parameter represents the transaction execution result type,
723
+ * which varies by blockchain implementation (e.g., ExecuteResult for CosmWasm).
659
724
  */
660
- abstract swap(signer: TSigner, params: SwapParams): Promise<SwapResult>;
725
+ abstract swap(signer: TSigner, params: SwapParams): Promise<SwapResult<TTxOutput>>;
661
726
  }
662
727
 
663
- type CosmWasmClientConfig = ClientConfig & {
728
+ type CosmWasmChainConfig = ChainConfig & {
729
+ restEndpoint: string;
730
+ };
731
+
732
+ type CosmWasmClientConfig = ClientConfig<CosmWasmChainConfig> & {
664
733
  chain?: CosmWasmChain;
665
734
  cosmWasmClient?: CosmWasmClient | ArchwayClient;
666
735
  signingCosmWasmClient?: SigningCosmWasmClient | SigningArchwayClient;
667
736
  };
668
- declare enum CosmWasmChain {
669
- Archway = "archway"
670
- }
737
+ type CosmWasmChain = 'archway';
671
738
 
672
739
  type QueryOracleConfigResponse = {
673
740
  admin: Address;
@@ -734,21 +801,19 @@ type QueryQuotesForUserAllResponse = {
734
801
  *
735
802
  * This class extends the abstract {@link BaseClient} to provide CosmWasm-specific functionality
736
803
  * for querying and executing transactions on Bolt Protocol's oracle and router smart contracts.
804
+ * It uses ExecuteResult as the transaction output type, providing detailed transaction execution information.
737
805
  *
738
- * @extends {BaseClient<OfflineSigner>}
806
+ * @extends {BaseClient<OfflineSigner, ExecuteResult>}
739
807
  *
740
808
  * @group Bolt API Clients
741
809
  *
742
810
  * @example
743
811
  * ```typescript
744
812
  * // Create a client for Archway mainnet
745
- * const client = new BoltCosmWasmClient({
746
- * environment: Environment.Mainnet,
747
- * chain: CosmWasmChain.Archway
748
- * });
813
+ * const client = new BoltCosmWasmClient();
749
814
  *
750
815
  * // Query oracle prices
751
- * const price = await client.getPrice("aarch", "ibc/43897B9739BD63E3A08A88191999C632E052724AB96BD4C74AE31375C991F48D");
816
+ * const price = await client.getPrice("ARCH", "USDC");
752
817
  *
753
818
  * // Execute a swap (requires signer)
754
819
  * const signer = await DirectSecp256k1HdWallet.fromMnemonic("my mnemonic goes here", {
@@ -761,7 +826,11 @@ type QueryQuotesForUserAllResponse = {
761
826
  * });
762
827
  * ```
763
828
  */
764
- declare class BoltCosmWasmClient extends BaseClient<OfflineSigner> {
829
+ declare class BoltCosmWasmClient extends BaseClient<OfflineSigner, ExecuteResult> {
830
+ /**
831
+ * The CosmWasm-specific chain configuration including REST endpoint
832
+ */
833
+ chainConfig: CosmWasmChainConfig;
765
834
  /**
766
835
  * Cached instance of the CosmWasm client for read-only operations
767
836
  * @private
@@ -780,18 +849,23 @@ declare class BoltCosmWasmClient extends BaseClient<OfflineSigner> {
780
849
  * Creates a new instance of the BoltCosmWasmClient.
781
850
  *
782
851
  * The client automatically configures itself based on the specified chain and environment,
783
- * loading the appropriate contract addresses and RPC endpoints from configuration files.
852
+ * loading the appropriate contract addresses, chain configuration, and assets from configuration files.
784
853
  *
785
854
  * @param config - (Optional) Configuration for the client
786
- * @param config.environment - (Optional) The deployment environment (Mainnet or Testnet). Defaults to Mainnet
787
- * @param config.chain - (Optional) The specific CosmWasm chain to connect to. Defaults to Archway
788
- * @param config.customOverride - (Optional) Overrides for RPC endpoint and contract addresses
789
- * @param config.customOverride.rpcEndpoint - (Optional) Custom RPC endpoint URL
790
- * @param config.customOverride.contracts - (Optional) Custom contract addresses
855
+ * @param config.environment - (Optional) The deployment environment ('mainnet' or 'testnet'). Defaults to 'mainnet'
856
+ * @param config.chain - (Optional) The specific CosmWasm chain to connect to. Defaults to 'archway'
857
+ * @param config.customOverride - (Optional) Custom overrides for chain configuration, contracts, and assets
858
+ * @param config.customOverride.chainConfig - (Optional) Override chain configuration
859
+ * @param config.customOverride.chainConfig.id - (Optional) Custom chain ID
860
+ * @param config.customOverride.chainConfig.name - (Optional) Custom chain name
861
+ * @param config.customOverride.chainConfig.rpcEndpoint - (Optional) Custom RPC endpoint URL
862
+ * @param config.customOverride.chainConfig.restEndpoint - (Optional) Custom REST endpoint URL
863
+ * @param config.customOverride.contracts - (Optional) Override contract addresses
791
864
  * @param config.customOverride.contracts.oracle - (Optional) Custom oracle contract address
792
865
  * @param config.customOverride.contracts.router - (Optional) Custom router contract address
793
- * @param config.customOverride.cosmWasmClient - (Optional) Custom CosmWasmClient to use for blockchain queries
794
- * @param config.customOverride.signingCosmWasmClient - (Optional) Custom SigningCosmWasmClient to use for blockchain transactions
866
+ * @param config.customOverride.assetsConfig - (Optional) Custom asset configurations indexed by denom
867
+ * @param config.cosmWasmClient - (Optional) Pre-existing CosmWasmClient to use for blockchain queries
868
+ * @param config.signingCosmWasmClient - (Optional) Pre-existing SigningCosmWasmClient to use for blockchain transactions
795
869
  *
796
870
  * @throws {InvalidTypeError} Thrown when an unsupported chain is specified
797
871
  *
@@ -802,15 +876,41 @@ declare class BoltCosmWasmClient extends BaseClient<OfflineSigner> {
802
876
  *
803
877
  * // Use testnet configuration
804
878
  * const testnetClient = new BoltCosmWasmClient({
805
- * environment: Environment.Testnet
879
+ * environment: 'testnet'
806
880
  * });
807
881
  *
808
- * // Use custom RPC endpoint
882
+ * // Use custom chain configuration
809
883
  * const customClient = new BoltCosmWasmClient({
810
- * override: {
811
- * rpcEndpoint: 'https://custom-rpc.example.com'
884
+ * customOverride: {
885
+ * chainConfig: {
886
+ * id: 'archway-custom-1',
887
+ * name: 'Archway Custom',
888
+ * rpcEndpoint: 'https://custom-rpc.example.com',
889
+ * restEndpoint: 'https://custom-rest.example.com'
890
+ * },
891
+ * contracts: {
892
+ * oracle: 'archway1custom_oracle...',
893
+ * router: 'archway1custom_router...'
894
+ * },
895
+ * assetsConfig: {
896
+ * 'aarch': {
897
+ * symbol: 'ARCH',
898
+ * name: 'Archway',
899
+ * chainId: 'archway-custom-1',
900
+ * denom: 'aarch',
901
+ * decimals: 18,
902
+ * logo: 'https://example.com/arch.png',
903
+ * coingeckoId: 'archway'
904
+ * }
905
+ * }
812
906
  * }
813
907
  * });
908
+ *
909
+ * // Use pre-existing CosmWasm clients
910
+ * const clientWithCustomClients = new BoltCosmWasmClient({
911
+ * cosmWasmClient: myCosmWasmClient,
912
+ * signingCosmWasmClient: mySigningClient
913
+ * });
814
914
  * ```
815
915
  */
816
916
  constructor(config?: CosmWasmClientConfig);
@@ -879,6 +979,33 @@ declare class BoltCosmWasmClient extends BaseClient<OfflineSigner> {
879
979
  /** @inheritdoc */
880
980
  getPoolConfig(poolContractAddress: Address): Promise<PoolConfig>;
881
981
  /** @inheritdoc */
982
+ getAllAssets(): Promise<Asset[]>;
983
+ /**
984
+ * Fetches the configuration settings for a pool identified by its base asset symbol.
985
+ *
986
+ * This is a convenience method that combines pool lookup and configuration retrieval.
987
+ * It first finds the pool associated with the given base asset, then fetches that
988
+ * pool's configuration parameters from its settlement contract.
989
+ *
990
+ * @param baseAssetSymbol - The symbol of the base asset (e.g., "ARCH", "ATOM")
991
+ *
992
+ * @returns A promise that resolves to a pool configuration object containing
993
+ * settings such as fees, oracle address, LP addresses, and minimum trade amounts
994
+ *
995
+ * @throws Will throw an error if no pool exists for the specified base asset
996
+ *
997
+ * @example
998
+ * ```typescript
999
+ * // Get pool configuration for ARCH base asset
1000
+ * const poolConfig = await client.getPoolConfigByBaseAsset("ARCH");
1001
+ * console.log(`Oracle: ${poolConfig.priceOracleContract}`);
1002
+ * console.log(`Protocol fee: ${parseFloat(poolConfig.protocolFee) * 100}%`);
1003
+ * console.log(`LP fee: ${parseFloat(poolConfig.lpFee) * 100}%`);
1004
+ * console.log(`Allowance mode: ${poolConfig.allowanceMode}`);
1005
+ * console.log(`Number of LPs: ${poolConfig.lps.length}`);
1006
+ * console.log(`Min base output: ${poolConfig.minBaseOut}`);
1007
+ * ```
1008
+ */
882
1009
  getPoolConfigByBaseAsset(baseAssetSymbol: string): Promise<PoolConfig>;
883
1010
  /**
884
1011
  * @inheritdoc
@@ -900,10 +1027,15 @@ declare class BoltCosmWasmClient extends BaseClient<OfflineSigner> {
900
1027
  * console.log(`Swap successful!`);
901
1028
  * console.log(`Transaction hash: ${result.txHash}`);
902
1029
  * console.log(`Received: ${result.amountOut} ${result.assetOut}`);
903
- * console.log(`Gas used: ${result.gasUsed}`);
1030
+ * console.log(`Gas used: ${result.txOutput.gasUsed}`);
1031
+ * console.log(`Block height: ${result.txOutput.height}`);
904
1032
  * ```
1033
+ *
1034
+ * @remarks
1035
+ * This implementation returns a CosmWasm ExecuteResult as the transaction output,
1036
+ * which includes details like gas used, block height, transaction hash, and events.
905
1037
  */
906
1038
  swap(signer: OfflineSigner, params: SwapParams): Promise<SwapResult<ExecuteResult>>;
907
1039
  }
908
1040
 
909
- export { type Address, AllowanceMode, type AssetPairString, BaseClient, type BaseLiquidityDetails, BoltCosmWasmClient, type BoltSdkError, BoltSdkErrorBase, BoltSdkErrorCode, type ClientConfig, type Coin, type Contracts, CosmWasmChain, type CosmWasmClientConfig, type Duration, Environment, InsufficientFundsError, InvalidAddressError, InvalidObjectError, InvalidParameterError, InvalidTypeError, type InvertiblePrice, type InvertiblePriceRepresentation, type MarketRepresentation, MissingParameterError, NetworkError, NotFoundError, type OracleAsset, type OracleAssetPair, type OracleConfig, ParameterOutOfRangeError, type Pool, type PoolConfig, type Price, type PriceRepresentation, type QueryAssetPairsResponse, type QueryBaseLiquidityAllResponse, type QueryBaseLiquidityResponse, type QueryMarketsResponse, type QueryOracleConfigResponse, type QueryPriceResponse, type QueryPricesResponse, type QueryQuotesForUserAllResponse, type QueryRouterConfigResponse, type QuerySettlementConfigResponse, type RouterConfig, type SwapParams, type SwapResult, type Timestamp, TransactionEventNotFoundError, TransactionFailedError };
1041
+ export { type Address, type AllowanceMode, type Asset, type AssetPairString, type AssetsConfig, BaseClient, type BaseLiquidityDetails, BoltCosmWasmClient, type BoltSdkError, BoltSdkErrorBase, BoltSdkErrorCode, type ChainConfig, type ClientConfig, type Coin, type Contracts, type CosmWasmChain, type CosmWasmChainConfig, type CosmWasmClientConfig, type Duration, type Environment, InsufficientFundsError, InvalidAddressError, InvalidObjectError, InvalidParameterError, InvalidTypeError, type InvertiblePrice, type InvertiblePriceRepresentation, type MarketRepresentation, MissingParameterError, NetworkError, NotFoundError, type OracleAsset, type OracleAssetPair, type OracleConfig, ParameterOutOfRangeError, type Pool, type PoolConfig, type Price, type PriceRepresentation, type QueryAssetPairsResponse, type QueryBaseLiquidityAllResponse, type QueryBaseLiquidityResponse, type QueryMarketsResponse, type QueryOracleConfigResponse, type QueryPriceResponse, type QueryPricesResponse, type QueryQuotesForUserAllResponse, type QueryRouterConfigResponse, type QuerySettlementConfigResponse, type RouterConfig, type SwapParams, type SwapResult, type Timestamp, TransactionEventNotFoundError, TransactionFailedError };