aftermath-ts-sdk 5.1.1-dev.bb5edf0 → 5.1.1-dev.d72bc91

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.js CHANGED
@@ -15134,6 +15134,34 @@ var init_perpetuals = __esm({
15134
15134
  getMarkets24hrStats(inputs) {
15135
15135
  return this.fetchApi("markets/24hr-stats", inputs);
15136
15136
  }
15137
+ /**
15138
+ * Fetch the category and tag labels that group markets in a picker UI.
15139
+ *
15140
+ * The response is the vocabulary behind `PerpetualsMarketMetadata.category`
15141
+ * and `PerpetualsMarketMetadata.tags`: every market names exactly one of
15142
+ * these categories, and each of its tags is declared under that category.
15143
+ * Both lists come back in display order.
15144
+ *
15145
+ * The labels are configuration rather than a fixed enum, so resolve a
15146
+ * market's metadata against this response instead of hard-coding them.
15147
+ *
15148
+ * @param abortSignal - Optional cancellation signal.
15149
+ * @returns `ApiPerpetualsMarketsCategoriesResponse` containing `categories`.
15150
+ *
15151
+ * @remarks
15152
+ * `categories` is empty when the backing static configuration is unavailable.
15153
+ * Treat that as "no grouping" and show every market rather than rendering an
15154
+ * empty picker.
15155
+ *
15156
+ * @example
15157
+ * ```ts
15158
+ * const { categories } = await perps.getMarketsCategories();
15159
+ * // [{ name: "Crypto", tags: ["Layer 1", "DeFi", ...] }, ...]
15160
+ * ```
15161
+ */
15162
+ getMarketsCategories(abortSignal) {
15163
+ return this.fetchApi("markets/categories", {}, abortSignal);
15164
+ }
15137
15165
  // =========================================================================
15138
15166
  // Prices
15139
15167
  // =========================================================================
@@ -15468,7 +15496,7 @@ var init_perpetuals = __esm({
15468
15496
  * collect fees on orders placed on behalf of the user. Once revoked, the integrator
15469
15497
  * will no longer be able to submit orders with integrator fees for this account.
15470
15498
  * The user can re-approve the integrator at any time by calling
15471
- * `getCreateIntegratorConfigTx` again.
15499
+ * `getCreateBuilderCodeIntegratorConfigTx` again.
15472
15500
  *
15473
15501
  * The resulting transaction must be signed by the account owner and executed on-chain.
15474
15502
  *
@@ -15497,86 +15525,6 @@ var init_perpetuals = __esm({
15497
15525
  }
15498
15526
  );
15499
15527
  }
15500
- /**
15501
- * Build a transaction to initialize an integrator's global fee vault.
15502
- *
15503
- * This endpoint creates a transaction that initializes the global vault where an
15504
- * integrator's fees accumulate across all markets. This is a one-time setup that
15505
- * must be performed before the integrator can claim fees. The integrator's identity
15506
- * is taken from the transaction sender on-chain.
15507
- *
15508
- * The resulting transaction must be signed by the integrator and executed on-chain.
15509
- *
15510
- * @param inputs - {@link ApiPerpetualsBuilderCodesCreateIntegratorVaultTxBody}.
15511
- * @returns `SdkTransactionResponse` with `tx`.
15512
- *
15513
- * @example
15514
- * ```ts
15515
- * const tx = await perps.getCreateBuilderCodeIntegratorVaultTx({});
15516
- * ```
15517
- */
15518
- async getCreateBuilderCodeIntegratorVaultTx(inputs) {
15519
- const { tx, ...otherInputs } = inputs;
15520
- return this.fetchApiTxObject(
15521
- "builder-codes/transactions/create-integrator-vault",
15522
- {
15523
- ...otherInputs,
15524
- txKind: await this.api?.Transactions().fetchBase64TxKindFromTx({ tx })
15525
- },
15526
- void 0,
15527
- {
15528
- txKind: true
15529
- }
15530
- );
15531
- }
15532
- /**
15533
- * Build a transaction to claim accumulated integrator fees from a vault.
15534
- *
15535
- * This endpoint creates a transaction that allows an integrator to claim the fees
15536
- * they have earned from orders placed on behalf of users. Fees accumulate in the
15537
- * integrator's global vault (across all markets) and can be claimed at any moment.
15538
- * The fees are proportional to the taker volume generated by the users' orders that
15539
- * the integrator submitted.
15540
- *
15541
- * If a `recipientAddress` is provided, the claimed fees will be automatically
15542
- * transferred to that address. Otherwise, the coin outputs are exposed as transaction
15543
- * arguments for further use in the transaction (one per non-zero collateral balance).
15544
- *
15545
- * The resulting transaction must be signed by the integrator and executed on-chain.
15546
- *
15547
- * @param inputs - {@link ApiPerpetualsBuilderCodesClaimIntegratorVaultFeesTxBody}.
15548
- * @returns `ApiPerpetualsBuilderCodesClaimIntegratorVaultFeesTxResponse` containing
15549
- * `txKind` and optionally `coinOutArgs`.
15550
- *
15551
- * @example
15552
- * ```ts
15553
- * // Claim with automatic transfer to recipient
15554
- * const response = await perps.getClaimBuilderCodeIntegratorVaultFeesTx({
15555
- * integratorId: 7,
15556
- * recipientAddress: "0x...",
15557
- * });
15558
- *
15559
- * // Claim with coin outputs for further use
15560
- * const response = await perps.getClaimBuilderCodeIntegratorVaultFeesTx({
15561
- * integratorId: 7,
15562
- * });
15563
- * // response.coinOutArgs can be used in subsequent transaction commands
15564
- * ```
15565
- */
15566
- async getClaimBuilderCodeIntegratorVaultFeesTx(inputs) {
15567
- const { tx, ...otherInputs } = inputs;
15568
- return this.fetchApiTxObject(
15569
- "builder-codes/transactions/claim-integrator-vault-fees",
15570
- {
15571
- ...otherInputs,
15572
- txKind: await this.api?.Transactions().fetchBase64TxKindFromTx({ tx })
15573
- },
15574
- void 0,
15575
- {
15576
- txKind: true
15577
- }
15578
- );
15579
- }
15580
15528
  // =========================================================================
15581
15529
  // Builder Codes Inspections
15582
15530
  // =========================================================================
@@ -15611,41 +15559,6 @@ var init_perpetuals = __esm({
15611
15559
  async getBuilderCodeIntegratorConfig(inputs) {
15612
15560
  return this.fetchApi("builder-codes/integrator-config", inputs);
15613
15561
  }
15614
- /**
15615
- * Fetch accumulated integrator vault fees.
15616
- *
15617
- * This endpoint queries the total fees an integrator has earned and accumulated in
15618
- * their global vault, grouped by collateral coin type. Integrators earn fees
15619
- * proportional to the taker volume generated by orders they submit on behalf of
15620
- * users. These fees can be claimed at any time using
15621
- * {@link getClaimBuilderCodeIntegratorVaultFeesTx}.
15622
- *
15623
- * This information is useful for:
15624
- * - Displaying total claimable fees to integrators in dashboards
15625
- * - Monitoring fee accrual across collateral types
15626
- * - Determining whether fees are ready to be claimed
15627
- *
15628
- * @param inputs - {@link ApiPerpetualsBuilderCodesIntegratorVaultsBody}.
15629
- * @returns `ApiPerpetualsBuilderCodesIntegratorVaultsResponse` containing
15630
- * a vector of per-collateral vault data with accumulated fees.
15631
- *
15632
- * @example
15633
- * ```ts
15634
- * const vaultFees = await perps.getBuilderCodeIntegratorVaults({
15635
- * integratorId: 7,
15636
- * });
15637
- *
15638
- * for (const vault of vaultFees.integratorVaults) {
15639
- * console.log(`${vault.collateralCoinType}: ${vault.fees} collateral units claimable`);
15640
- * }
15641
- *
15642
- * const totalFeesUsd = vaultFees.integratorVaults.reduce((sum, vault) => sum + vault.feesUsd, 0);
15643
- * console.log(`Total claimable (USD): ${totalFeesUsd}`);
15644
- * ```
15645
- */
15646
- async getBuilderCodeIntegratorVaults(inputs) {
15647
- return this.fetchApi("builder-codes/integrator-vaults", inputs);
15648
- }
15649
15562
  // =========================================================================
15650
15563
  // Public Static Helpers
15651
15564
  // =========================================================================