diff --git a/packages/sdk-ts/src/client/wasm/index.ts b/packages/sdk-ts/src/client/wasm/index.ts index 8b9b44bcf..93c4cea8e 100644 --- a/packages/sdk-ts/src/client/wasm/index.ts +++ b/packages/sdk-ts/src/client/wasm/index.ts @@ -1,4 +1,3 @@ -export * from './mito' export * from './swap' -export * from './nameservice' export * from './types' +export * from './nameservice' diff --git a/packages/sdk-ts/src/client/wasm/mito/index.ts b/packages/sdk-ts/src/client/wasm/mito/index.ts deleted file mode 100644 index 2b6403383..000000000 --- a/packages/sdk-ts/src/client/wasm/mito/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './queries' -export * from './transformer' -export * from './types' diff --git a/packages/sdk-ts/src/client/wasm/mito/queries/QueryContractAllowance.ts b/packages/sdk-ts/src/client/wasm/mito/queries/QueryContractAllowance.ts deleted file mode 100644 index edc0a601e..000000000 --- a/packages/sdk-ts/src/client/wasm/mito/queries/QueryContractAllowance.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { BaseWasmQuery } from '../../BaseWasmQuery' -import { toBase64 } from '../../../../utils' - -export declare namespace QueryContractAllowanceArg { - export interface Params { - owner: string - spender: string - } -} - -export class QueryContractAllowance extends BaseWasmQuery { - toPayload() { - return toBase64({ - allowance: { - owner: this.params.owner, - spender: this.params.spender, - }, - }) - } -} diff --git a/packages/sdk-ts/src/client/wasm/mito/queries/QueryContractBaseConfig.ts b/packages/sdk-ts/src/client/wasm/mito/queries/QueryContractBaseConfig.ts deleted file mode 100644 index ce71a9de4..000000000 --- a/packages/sdk-ts/src/client/wasm/mito/queries/QueryContractBaseConfig.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { BaseWasmQuery } from '../../BaseWasmQuery' -import { toBase64 } from '../../../../utils' - -export declare namespace QueryContractConfigArg { - export interface Params {} -} - -export class QueryContractBaseConfig extends BaseWasmQuery { - toPayload() { - return toBase64({ base: { config: {} } }) - } -} diff --git a/packages/sdk-ts/src/client/wasm/mito/queries/QueryContractConfig.ts b/packages/sdk-ts/src/client/wasm/mito/queries/QueryContractConfig.ts deleted file mode 100644 index 1f2af121f..000000000 --- a/packages/sdk-ts/src/client/wasm/mito/queries/QueryContractConfig.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { BaseWasmQuery } from '../../BaseWasmQuery' -import { toBase64 } from '../../../../utils' - -export declare namespace QueryContractConfigArg { - export interface Params {} -} - -export class QueryContractConfig extends BaseWasmQuery { - toPayload() { - return toBase64({ config: {} }) - } -} diff --git a/packages/sdk-ts/src/client/wasm/mito/queries/QueryContractMarketingInfo.ts b/packages/sdk-ts/src/client/wasm/mito/queries/QueryContractMarketingInfo.ts deleted file mode 100644 index 75f00be2e..000000000 --- a/packages/sdk-ts/src/client/wasm/mito/queries/QueryContractMarketingInfo.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { BaseWasmQuery } from '../../BaseWasmQuery' -import { toBase64 } from '../../../../utils' - -export declare namespace QueryContractMarketingInfoArg { - export interface Params {} -} - -export class QueryContractMarketingInfo extends BaseWasmQuery { - toPayload() { - return toBase64({ marketing_info: {} }) - } -} diff --git a/packages/sdk-ts/src/client/wasm/mito/queries/QueryLockedLpFunds.ts b/packages/sdk-ts/src/client/wasm/mito/queries/QueryLockedLpFunds.ts deleted file mode 100644 index bc175dd50..000000000 --- a/packages/sdk-ts/src/client/wasm/mito/queries/QueryLockedLpFunds.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { BaseWasmQuery } from '../../BaseWasmQuery' -import { toBase64 } from '../../../../utils' - -export declare namespace QueryLockedLpFundsArg { - export interface Params { - subaccountId: string - userAddress: string - } -} - -export class QueryLockedLpFunds extends BaseWasmQuery { - toPayload() { - return toBase64({ - get_locked_l_p_funds: { - subaccount_id: this.params.subaccountId, - user_address: this.params.userAddress, - }, - }) - } -} diff --git a/packages/sdk-ts/src/client/wasm/mito/queries/QueryRegisteredVault.ts b/packages/sdk-ts/src/client/wasm/mito/queries/QueryRegisteredVault.ts deleted file mode 100644 index 02a61e70a..000000000 --- a/packages/sdk-ts/src/client/wasm/mito/queries/QueryRegisteredVault.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BaseWasmQuery } from '../../BaseWasmQuery' -import { toBase64 } from '../../../../utils' - -export declare namespace QueryRegisteredVaultsArg { - export interface Params {} -} -export class QueryRegisteredVaults extends BaseWasmQuery { - toPayload() { - return toBase64({ get_registered_vaults: {} }) - } -} diff --git a/packages/sdk-ts/src/client/wasm/mito/queries/QueryVaultMarketId.ts b/packages/sdk-ts/src/client/wasm/mito/queries/QueryVaultMarketId.ts deleted file mode 100644 index 1e595d832..000000000 --- a/packages/sdk-ts/src/client/wasm/mito/queries/QueryVaultMarketId.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { BaseWasmQuery } from '../../BaseWasmQuery' -import { toBase64 } from '../../../../utils' - -export declare namespace QueryVaultMarketIdArg { - export interface Params { - subaccountId: string - } -} - -export class QueryVaultMarketId extends BaseWasmQuery { - toPayload() { - return toBase64({ - get_market_id: { - subaccount_id: this.params.subaccountId, - }, - }) - } -} diff --git a/packages/sdk-ts/src/client/wasm/mito/queries/QueryVaultTotalLpSupply.ts b/packages/sdk-ts/src/client/wasm/mito/queries/QueryVaultTotalLpSupply.ts deleted file mode 100644 index 7e2f9dcf0..000000000 --- a/packages/sdk-ts/src/client/wasm/mito/queries/QueryVaultTotalLpSupply.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { BaseWasmQuery } from '../../BaseWasmQuery' -import { toBase64 } from '../../../../utils' - -export declare namespace QueryVaultTotalLpSupplyArg { - export interface Params { - subaccountId: string - } -} - -export class QueryVaultTotalLpSupply extends BaseWasmQuery { - toPayload() { - return toBase64({ - get_total_lp_supply: { - subaccount_id: this.params.subaccountId, - }, - }) - } -} diff --git a/packages/sdk-ts/src/client/wasm/mito/queries/index.ts b/packages/sdk-ts/src/client/wasm/mito/queries/index.ts deleted file mode 100644 index 81cce1d6a..000000000 --- a/packages/sdk-ts/src/client/wasm/mito/queries/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { QueryVaultMarketId } from './QueryVaultMarketId' -export { QueryLockedLpFunds } from './QueryLockedLpFunds' -export { QueryContractConfig } from './QueryContractConfig' -export { QueryContractBaseConfig } from './QueryContractBaseConfig' -export { QueryRegisteredVaults } from './QueryRegisteredVault' -export { QueryContractAllowance } from './QueryContractAllowance' -export { QueryVaultTotalLpSupply } from './QueryVaultTotalLpSupply' -export { QueryContractMarketingInfo } from './QueryContractMarketingInfo' diff --git a/packages/sdk-ts/src/client/wasm/mito/transformer.ts b/packages/sdk-ts/src/client/wasm/mito/transformer.ts deleted file mode 100644 index 3c185040e..000000000 --- a/packages/sdk-ts/src/client/wasm/mito/transformer.ts +++ /dev/null @@ -1,346 +0,0 @@ -import { toUtf8 } from '../../../utils' -import { WasmContractQueryResponse } from '../types' -import { - VaultAMMConfig, - VaultBaseConfig, - VaultSpotConfig, - VaultDerivativeConfig, - VaultMarketMakingConfig, - OffChainVaultSpotConfig, - OffChainVaultDerivativeConfig, - QueryOffChainVaultResponse, - QueryStakingConfigResponse, - QueryVaultMarketIdResponse, - QueryLockedLpFundsResponse, - QueryAllocatorConfigResponse, - QueryRegisteredVaultResponse, - QueryVaultContractBaseConfig, - QueryOffChainVaultSpotResponse, - QueryVaultContractMarketMaking, - QueryContractTokenInfoResponse, - QueryMastContractConfigResponse, - QueryVaultTotalLpSupplyResponse, - QueryVaultUserLpBalanceResponse, - QueryContractMarketingInfoResponse, - QueryVaultContractAMMConfigResponse, - QueryOffChainVaultDerivativeResponse, - QueryVaultContractSpotConfigResponse, - QueryVaultUserLpContractAllowanceResponse, - QueryVaultContractDerivativeConfigResponse, -} from './types' - -/** - * @hidden - */ - -const formatToString = (value?: string | number) => - value ? value.toString() : '' -export class MitoQueryTransformer { - static contractMarketingInfoResponseToContractMarketingInfo( - response: WasmContractQueryResponse, - ) { - const data = JSON.parse( - toUtf8(response.data), - ) as QueryContractMarketingInfoResponse - - return { - project: data.project, - description: data.description, - logo: data.logo, - marketing: data.marketing, - } - } - - static contractTokenInfoResponseToContractTokenInfo( - response: WasmContractQueryResponse, - ) { - const data = JSON.parse( - toUtf8(response.data), - ) as QueryContractTokenInfoResponse - - return { - name: data.name, - symbol: data.symbol, - decimals: data.decimals, - totalSupply: data.total_supply, - } - } - - static masterContractConfigResponseToMasterContractConfig( - response: WasmContractQueryResponse, - ) { - const data = JSON.parse( - toUtf8(response.data), - ) as QueryMastContractConfigResponse - - return { - distributionContract: data.distribution_contract, - ninjaToken: data.ninja_token, - owner: data.owner, - } - } - - static vaultContractBaseConfigResponseToBaseConfig( - config: QueryVaultContractBaseConfig, - ): VaultBaseConfig { - return { - owner: formatToString(config.owner), - marketId: formatToString(config.market_id), - subaccountId: formatToString(config.subaccount_id), - feeRecipient: formatToString(config.fee_recipient), - masterAddress: formatToString(config.master_address), - orderDensity: Number(config.order_density), - notionalValueCap: formatToString(config.notional_value_cap), - } - } - - static vaultContractMarketMakingResponseToMarketMaking( - config: QueryVaultContractMarketMaking, - ): VaultMarketMakingConfig { - return { - reservationPriceSensitivityRatio: formatToString( - config.reservation_price_sensitivity_ratio, - ), - reservationSpreadSensitivityRatio: formatToString( - config.reservation_spread_sensitivity_ratio, - ), - maxActiveCapitalUtilizationRatio: formatToString( - config.max_active_capital_utilization_ratio, - ), - headChangeToleranceRatio: formatToString( - config.head_change_tolerance_ratio, - ), - headToTailDeviationRatio: formatToString( - config.head_to_tail_deviation_ratio, - ), - signedMinHeadToFairPriceDeviationRatio: formatToString( - config.signed_min_head_to_fair_price_deviation_ratio, - ), - signedMinHeadToTobDeviationRatio: formatToString( - config.signed_min_head_to_tob_deviation_ratio, - ), - defaultMidPriceVolatilityRatio: formatToString( - config.default_mid_price_volatility_ratio, - ), - minOracleVolatilitySampleSize: Number( - config.min_oracle_volatility_sample_size, - ), - oracleVolatilityMaxAge: Number(config.oracle_volatility_max_age), - emergencyOracleVolatilitySampleSize: Number( - config.emergency_oracle_volatility_sample_size, - ), - lastValidMarkPrice: formatToString(config.last_valid_mark_price), - minVolatilityRatio: formatToString(config.min_volatility_ratio), - oracleStaleTime: Number(config.oracle_stale_time), - } - } - - static vaultContractConfigResponseToAMMVaultConfig( - response: WasmContractQueryResponse, - ): VaultAMMConfig { - const { config } = JSON.parse( - toUtf8(response.data), - ) as QueryVaultContractAMMConfigResponse - - return { - base: MitoQueryTransformer.vaultContractBaseConfigResponseToBaseConfig( - config.base, - ), - priceTickSize: formatToString(config.price_tick_size), - maxInvariantSensitivity: formatToString(config.max_invariant_sensitivity), - baseDecimals: Number(config.base_decimals), - quoteDecimals: Number(config.quote_decimals), - feeBps: Number(config.fee_bps), - } - } - - static vaultContractConfigResponseToDerivativeVaultConfig( - response: WasmContractQueryResponse, - ): VaultDerivativeConfig { - const { config } = JSON.parse( - toUtf8(response.data), - ) as QueryVaultContractDerivativeConfigResponse - - return { - base: MitoQueryTransformer.vaultContractBaseConfigResponseToBaseConfig( - config.base, - ), - marketMaking: - MitoQueryTransformer.vaultContractMarketMakingResponseToMarketMaking( - config.market_making, - ), - leverage: formatToString(config.leverage), - minProximityToLiquidation: formatToString( - config.min_proximity_to_liquidation, - ), - allowedRedemptionTypes: Number(config.allowed_redemption_types), - positionPnlPenalty: formatToString(config.position_pnl_penalty), - } - } - - static vaultContractConfigResponseToSpotVaultContractConfig( - response: WasmContractQueryResponse, - ): VaultSpotConfig { - const { config } = JSON.parse( - toUtf8(response.data), - ) as QueryVaultContractSpotConfigResponse - - return { - base: MitoQueryTransformer.vaultContractBaseConfigResponseToBaseConfig( - config.base, - ), - marketMaking: - MitoQueryTransformer.vaultContractMarketMakingResponseToMarketMaking( - config.market_making, - ), - oracleType: Number(config.oracle_type), - targetBaseWeight: formatToString(config.target_base_weight), - allowedRedemptionTypes: Number(config.allowed_redemption_types), - baseDecimals: Number(config.base_decimals), - quoteDecimals: Number(config.quote_decimals), - baseOracleSymbol: formatToString(config.base_oracle_symbol), - quoteOracleSymbol: formatToString(config.quote_oracle_symbol), - } - } - - static offChainVaultContractConfigResponseToOffChainVaultConfig( - response: WasmContractQueryResponse, - ): OffChainVaultSpotConfig | OffChainVaultDerivativeConfig { - const data = JSON.parse(toUtf8(response.data)) as QueryOffChainVaultResponse - - const isDerivativeVault = - (data.vault_type as QueryOffChainVaultDerivativeResponse).Derivative !== - undefined - const derivativeConfig = ( - data.vault_type as QueryOffChainVaultDerivativeResponse - ).Derivative - const spotConfig = (data.vault_type as QueryOffChainVaultSpotResponse).Spot - - return { - base: { - admin: formatToString(data.admin), - marketId: formatToString(data.market_id), - vaultSubaccountId: formatToString(data.vault_subaccount_id), - oracleStaleTime: Number(data.oracle_stale_time), - notionalValueCap: formatToString(data.notional_value_cap), - }, - ...(isDerivativeVault - ? { - positionPnlPenalty: formatToString( - derivativeConfig.position_pnl_penalty, - ), - allowedDerivativeRedemptionTypes: Number( - derivativeConfig.allowed_derivative_redemption_types, - ), - } - : { - oracleType: Number(spotConfig.oracle_type), - baseOracleSymbol: formatToString(spotConfig.base_oracle_symbol), - quoteOracleSymbol: formatToString(spotConfig.quote_oracle_symbol), - baseDecimals: Number(spotConfig.base_decimals), - quoteDecimals: Number(spotConfig.quote_decimals), - }), - } - } - - static vaultUserLpAllowanceResponseToVaultUserLpAllowance( - response: WasmContractQueryResponse, - ) { - const data = JSON.parse( - toUtf8(response.data), - ) as QueryVaultUserLpContractAllowanceResponse - - return { - allowance: data.allowance, - } - } - - static vaultMarketIdResponseToVaultMarketId( - response: WasmContractQueryResponse, - ) { - const data = JSON.parse(toUtf8(response.data)) as QueryVaultMarketIdResponse - - return { marketId: data.market_id } - } - - static vaultTotalLpSupplyResponseToVaultTotalLpSupply( - response: WasmContractQueryResponse, - ) { - const data = JSON.parse( - toUtf8(response.data), - ) as QueryVaultTotalLpSupplyResponse - - return { totalSupply: data.total_supply } - } - - static vaultUserLpBalanceResponseToVaultUserLpBalance( - response: WasmContractQueryResponse, - ) { - const data = JSON.parse( - toUtf8(response.data), - ) as QueryVaultUserLpBalanceResponse - - return { balance: data.balance } - } - - static vaultUserLockedLpFundsResponseToVaultUserLockedLpFunds( - response: WasmContractQueryResponse, - ) { - const data = JSON.parse(toUtf8(response.data)) as QueryLockedLpFundsResponse - - return { amount: data.amount, lockTime: data.lock_time } - } - - static registeredVaultsResponseToRegisteredVaults( - response: WasmContractQueryResponse, - ) { - const data = JSON.parse( - toUtf8(response.data), - ) as QueryRegisteredVaultResponse - - return data.registered_vaults.map((payload) => ({ - isDerivative: payload.vault.derivative !== undefined, - masterSubaccountId: payload.master_subaccount_id, - vaultAddress: - payload.vault.derivative?.address || payload.vault.spot?.address, - })) - } - - static allocatorConfigResponseToAllocatorConfig( - response: WasmContractQueryResponse, - ) { - const data = JSON.parse( - toUtf8(response.data), - ) as QueryAllocatorConfigResponse - - return { - owner: formatToString(data.owner), - stakingContractAddress: formatToString(data.staking_contract_address), - maxRewardDenomsPerGauge: data.max_reward_denoms_per_gauge - ? Number(data.max_reward_denoms_per_gauge) - : undefined, - minGaugeDurationInSeconds: data.min_gauge_duration_in_seconds - ? Number(data.min_gauge_duration_in_seconds) - : undefined, - maxActiveGaugesPerLpToken: data.max_active_gauges_per_lp_token - ? Number(data.max_active_gauges_per_lp_token) - : undefined, - gaugeAllocationFeeDenom: formatToString(data.gauge_allocation_fee?.denom), - gaugeAllocationFeeAmount: formatToString( - data.gauge_allocation_fee?.amount, - ), - } - } - - static stakingConfigResponseToAllocatorConfig( - response: WasmContractQueryResponse, - ) { - const data = JSON.parse(toUtf8(response.data)) as QueryStakingConfigResponse - - return { - owner: formatToString(data.owner), - lockupPeriod: Number(data.lockup_period || 0), - allocatorContractAddress: formatToString(data.allocator_contract_address), - } - } -} diff --git a/packages/sdk-ts/src/client/wasm/mito/types.ts b/packages/sdk-ts/src/client/wasm/mito/types.ts deleted file mode 100644 index 9e925c3ee..000000000 --- a/packages/sdk-ts/src/client/wasm/mito/types.ts +++ /dev/null @@ -1,261 +0,0 @@ -export interface QueryContractTokenInfoResponse { - name: string - symbol: string - decimals: number - total_supply: string -} - -export interface QueryContractMarketingInfoResponse { - project: string - description: string - logo: string - marketing: string -} - -export interface QueryMastContractConfigResponse { - distribution_contract: string - ninja_token: string - owner: string -} - -export interface QueryVaultContractBaseConfig { - owner: string - market_id: string - subaccount_id: string - fee_recipient: string - master_address: string - order_density: number - notional_value_cap: string -} - -export interface QueryVaultContractMarketMaking { - reservation_price_sensitivity_ratio: string - reservation_spread_sensitivity_ratio: string - max_active_capital_utilization_ratio: string - head_change_tolerance_ratio: string - head_to_tail_deviation_ratio: string - signed_min_head_to_fair_price_deviation_ratio: string - signed_min_head_to_tob_deviation_ratio: string - default_mid_price_volatility_ratio: string - min_volatility_ratio: string - min_oracle_volatility_sample_size: number - oracle_volatility_max_age: number - emergency_oracle_volatility_sample_size: number - last_valid_mark_price: string - oracle_stale_time: number -} - -export interface QueryVaultContractDerivativeConfigResponse { - config: { - base: QueryVaultContractBaseConfig - market_making: QueryVaultContractMarketMaking - leverage: string - min_proximity_to_liquidation: string - allowed_redemption_types: number - position_pnl_penalty: string - } -} - -export interface QueryVaultContractSpotConfigResponse { - config: { - base: QueryVaultContractBaseConfig - market_making: QueryVaultContractMarketMaking - oracle_type: number - target_base_weight: string - allowed_redemption_types: number - base_decimals: number - quote_decimals: number - base_oracle_symbol: string - quote_oracle_symbol: string - } -} - -export interface QueryVaultContractAMMConfigResponse { - config: { - base: QueryVaultContractBaseConfig - price_tick_size: string - max_invariant_sensitivity: string - base_decimals: number - quote_decimals: number - fee_bps: number - } -} - -export interface QueryVaultUserLpContractAllowanceResponse { - allowance: string - expires: { - never: {} - } -} - -export interface QueryVaultMarketIdResponse { - market_id: string -} - -export interface QueryVaultTotalLpSupplyResponse { - total_supply: string -} - -export interface QueryVaultUserLpBalanceResponse { - balance: string -} - -export interface QueryLockedLpFundsResponse { - amount: string - lock_time: string -} - -export interface QueryRegisteredVaultResponse { - registered_vaults: { - master_subaccount_id: string - vault: { - spot?: { - address: string - } - derivative?: { - address: string - } - } - }[] -} - -export interface QueryOffChainVaultSpotResponse { - Spot: { - oracle_type: number - base_oracle_symbol: string - quote_oracle_symbol: string - base_decimals: number - quote_decimals: number - } -} -export interface QueryOffChainVaultDerivativeResponse { - Derivative: { - position_pnl_penalty: string - allowed_derivative_redemption_types: number - } -} - -export interface QueryOffChainVaultResponse { - admin: string - market_id: string - vault_subaccount_id: string - oracle_stale_time: string - notional_value_cap: string - vault_type: - | QueryOffChainVaultSpotResponse - | QueryOffChainVaultDerivativeResponse -} - -export type VaultBaseConfig = { - owner: string - marketId: string - subaccountId: string - feeRecipient: string - masterAddress: string - orderDensity: number - notionalValueCap: string -} - -export type VaultMarketMakingConfig = { - reservationPriceSensitivityRatio: string - reservationSpreadSensitivityRatio: string - maxActiveCapitalUtilizationRatio: string - headChangeToleranceRatio: string - headToTailDeviationRatio: string - signedMinHeadToFairPriceDeviationRatio: string - signedMinHeadToTobDeviationRatio: string - defaultMidPriceVolatilityRatio: string - minVolatilityRatio: string - minOracleVolatilitySampleSize: number - oracleVolatilityMaxAge: number - emergencyOracleVolatilitySampleSize: number - lastValidMarkPrice: string - oracleStaleTime: number -} - -export type VaultAMMConfig = { - base: VaultBaseConfig - priceTickSize: string - maxInvariantSensitivity: string - baseDecimals: number - quoteDecimals: number - feeBps: number -} - -export type VaultDerivativeConfig = { - base: VaultBaseConfig - marketMaking: VaultMarketMakingConfig - leverage: string - minProximityToLiquidation: string - allowedRedemptionTypes: number - positionPnlPenalty: string -} - -export type VaultSpotConfig = { - base: VaultBaseConfig - marketMaking: VaultMarketMakingConfig - oracleType: number - targetBaseWeight: string - allowedRedemptionTypes: number - baseDecimals: number - quoteDecimals: number - baseOracleSymbol: string - quoteOracleSymbol: string -} - -export type OffChainVaultBaseConfig = { - admin: string - marketId: string - vaultSubaccountId: string - oracleStaleTime: number - notionalValueCap: string -} - -export type OffChainVaultSpotConfig = { - base: OffChainVaultBaseConfig - oracleType: number - baseOracleSymbol: string - quoteOracleSymbol: string - baseDecimals: number - quoteDecimals: number -} - -export type OffChainVaultDerivativeConfig = { - base: OffChainVaultBaseConfig - positionPnlPenalty: string - allowedDerivativeRedemptionTypes: number -} - -export type QueryStakingConfigResponse = { - owner?: string - lockup_period?: number - allocator_contract_address?: string -} - -export type QueryAllocatorConfigResponse = { - owner?: string - staking_contract_address?: string - max_reward_denoms_per_gauge?: number - min_gauge_duration_in_seconds?: number - max_active_gauges_per_lp_token?: number - gauge_allocation_fee?: { - denom: string - amount: string - } -} - -export type StakingConfig = { - owner?: string - lockupPeriod?: number - allocatorContractAddress?: string -} - -export type AllocatorConfig = { - owner?: string - stakingContractAddress?: string - maxRewardDenomsPerGauge?: number - minGaugeDurationInSeconds?: number - maxActiveGaugesPerLpToken?: number - gaugeAllocationFeeDenom?: string - gaugeAllocationFeeAmount?: string -} diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args.ts index d7edd8659..38448dcb3 100644 --- a/packages/sdk-ts/src/core/modules/wasm/exec-args.ts +++ b/packages/sdk-ts/src/core/modules/wasm/exec-args.ts @@ -1,26 +1,15 @@ -import ExecArgUnStake from './exec-args/ExecArgUnstake' -import ExecArgGeneric from './exec-args/ExecArgGeneric' import ExecArgCW20Send from './exec-args/ExecArgCW20Send' import ExecArgSubmitVaa from './exec-args/ExecArgSubmitVaa' -import ExecArgClaimStake from './exec-args/ExecArgClaimStake' -import ExecArgClaimRewards from './exec-args/ExecArgClaimRewards' import ExecArgCW20Transfer from './exec-args/ExecArgCW20Transfer' import ExecArgDepositTokens from './exec-args/ExecArgDepositTokens' -import ExecArgRegisterVault from './exec-args/ExecArgRegisterVault' import ExecArgSwapMinOutput from './exec-args/ExecArgSwapMinOutput' import ExecArgSwapExactOutput from './exec-args/ExecArgSwapExactOutput' import ExecArgInitiateTransfer from './exec-args/ExecArgInitiateTransfer' import ExecArgIncreaseAllowance from './exec-args/ExecArgIncreaseAllowance' import ExecArgRemoveGridStrategy from './exec-args/ExecArgRemoveGridStrategy' -import ExecArgUpdateAMMVaultConfig from './exec-args/ExecArgUpdateAMMVaultConfig' -import ExecArgUpdateSpotVaultConfig from './exec-args/ExecArgUpdateSpotVaultConfig' import ExecArgCreateSpotGridStrategy from './exec-args/ExecArgCreateSpotGridStrategy' -import ExecArgUpdateOffChainVaultConfig from './exec-args/ExecArgUpdateOffChainVaultConfig' -import ExecArgUpdateDerivativeVaultConfig from './exec-args/ExecArgUpdateDerivativeVaultConfig' -import ExecArgUpdateStakingContractConfig from './exec-args/ExecArgUpdateStakingContractConfig' import ExecArgCW20AdapterRedeemAndTransfer from './exec-args/ExecArgCW20AdapterRedeemAndTransfer' -import ExecArgUpdateAllocatorContractConfig from './exec-args/ExecArgUpdateAllocatorContractConfig' import ExecPrivilegedArgVaultRedeem from './exec-priv-args/ExecPrivilegedArgVaultRedeem' import ExecPrivilegedArgVaultSubscribe from './exec-priv-args/ExecPrivilegedArgVaultSubscribe' @@ -28,28 +17,17 @@ import ExecPrivilegedArgOffChainVaultRedeem from './exec-priv-args/ExecPrivilege import ExecPrivilegedArgOffChainVaultSubscribe from './exec-priv-args/ExecPrivilegedArgOffChainVaultSubscribe' export type ExecArgs = - | ExecArgGeneric - | ExecArgUnStake | ExecArgCW20Send | ExecArgSubmitVaa - | ExecArgClaimStake - | ExecArgClaimRewards | ExecArgCW20Transfer | ExecArgSwapMinOutput | ExecArgDepositTokens - | ExecArgRegisterVault | ExecArgCreateSpotGridStrategy | ExecArgRemoveGridStrategy | ExecArgSwapExactOutput | ExecArgInitiateTransfer | ExecArgIncreaseAllowance - | ExecArgUpdateAMMVaultConfig - | ExecArgUpdateSpotVaultConfig - | ExecArgUpdateOffChainVaultConfig - | ExecArgUpdateDerivativeVaultConfig - | ExecArgUpdateStakingContractConfig | ExecArgCW20AdapterRedeemAndTransfer - | ExecArgUpdateAllocatorContractConfig export type ExecPrivilegedArgs = | ExecPrivilegedArgVaultRedeem diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgClaimRewards.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgClaimRewards.ts deleted file mode 100644 index 5d38737a6..000000000 --- a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgClaimRewards.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { - dataToExecData, - ExecArgBase, - ExecDataRepresentation, -} from '../ExecArgBase' - -export declare namespace ExecArgClaimRewards { - export interface Params { - lpToken: string - } - - export interface Data { - lp_token: string - } -} - -/** - * @category Contract Exec Arguments - */ -export default class ExecArgClaimRewards extends ExecArgBase< - ExecArgClaimRewards.Params, - ExecArgClaimRewards.Data -> { - static fromJSON(params: ExecArgClaimRewards.Params): ExecArgClaimRewards { - return new ExecArgClaimRewards(params) - } - - toData(): ExecArgClaimRewards.Data { - const { params } = this - - return { - lp_token: params.lpToken, - } - } - - toExecData(): ExecDataRepresentation { - return dataToExecData('claim_rewards', this.toData()) - } -} diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgClaimStake.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgClaimStake.ts deleted file mode 100644 index 1e3bcce4a..000000000 --- a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgClaimStake.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { - dataToExecData, - ExecArgBase, - ExecDataRepresentation, -} from '../ExecArgBase' - -export declare namespace ExecArgClaimStake { - export interface Params { - lpToken: string - } - - export interface Data { - lp_token: string - } -} - -/** - * @category Contract Exec Arguments - */ -export default class ExecArgClaimStake extends ExecArgBase< - ExecArgClaimStake.Params, - ExecArgClaimStake.Data -> { - static fromJSON(params: ExecArgClaimStake.Params): ExecArgClaimStake { - return new ExecArgClaimStake(params) - } - - toData(): ExecArgClaimStake.Data { - const { params } = this - - return { - lp_token: params.lpToken, - } - } - - toExecData(): ExecDataRepresentation { - return dataToExecData('claim_stake', this.toData()) - } -} diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgGeneric.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgGeneric.ts deleted file mode 100644 index 832b819a6..000000000 --- a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgGeneric.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { - dataToExecData, - ExecArgBase, - ExecDataRepresentation, -} from '../ExecArgBase' - -/** - * @category Contract Exec Arguments for messages that do not require any additional params - */ -export declare namespace ExecArgGeneric { - export interface Params { - name: string - } - - export interface Data {} -} - -export default class ExecArgGeneric extends ExecArgBase< - ExecArgGeneric.Params, - ExecArgGeneric.Data -> { - static fromJSON(params: ExecArgGeneric.Params): ExecArgGeneric { - return new ExecArgGeneric(params) - } - - toData(): ExecArgGeneric.Data { - return {} - } - - toExecData(): ExecDataRepresentation { - const { params } = this - - return dataToExecData(params.name, this.toData()) - } -} diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgRegisterVault.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgRegisterVault.ts deleted file mode 100644 index ce5d3662b..000000000 --- a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgRegisterVault.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { - dataToExecData, - ExecArgBase, - ExecDataRepresentation, -} from '../ExecArgBase' - -export declare namespace ExecArgRegisterVault { - export interface Params { - vaultCodeId: number - vaultLabel: string - instantiateVaultMsg: Record - } - - export interface Data { - vault_code_id: number - vault_label: string - instantiate_vault_msg: Record - } -} - -/** - * @category Contract Exec Arguments - */ -export default class ExecArgRegisterVault extends ExecArgBase< - ExecArgRegisterVault.Params, - ExecArgRegisterVault.Data -> { - static fromJSON(params: ExecArgRegisterVault.Params): ExecArgRegisterVault { - return new ExecArgRegisterVault(params) - } - - toData(): ExecArgRegisterVault.Data { - const { params } = this - - return { - vault_code_id: params.vaultCodeId, - vault_label: params.vaultLabel, - instantiate_vault_msg: params.instantiateVaultMsg, - } - } - - toExecData(): ExecDataRepresentation { - return dataToExecData('register_vault', this.toData()) - } -} diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUnstake.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUnstake.ts deleted file mode 100644 index a81f2f678..000000000 --- a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUnstake.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { - dataToExecData, - ExecArgBase, - ExecDataRepresentation, -} from '../ExecArgBase' - -export declare namespace ExecArgUnStake { - export interface Params { - denom: string - amount: string - } - - export interface Data { - coin: { - denom: string - amount: string - } - } -} - -/** - * @category Contract Exec Arguments - */ -export default class ExecArgUnStake extends ExecArgBase< - ExecArgUnStake.Params, - ExecArgUnStake.Data -> { - static fromJSON(params: ExecArgUnStake.Params): ExecArgUnStake { - return new ExecArgUnStake(params) - } - - toData(): ExecArgUnStake.Data { - const { params } = this - - return { - coin: { - denom: params.denom, - amount: params.amount, - }, - } - } - - toExecData(): ExecDataRepresentation { - return dataToExecData('unstake', this.toData()) - } -} diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateAMMVaultConfig.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateAMMVaultConfig.ts deleted file mode 100644 index 799842cd6..000000000 --- a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateAMMVaultConfig.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { - dataToExecData, - ExecArgBase, - ExecDataRepresentation, -} from '../ExecArgBase' - -export declare namespace ExecArgUpdateAMMVaultConfig { - export interface Params { - marketId: string - orderDensity: number - maxInvariantSensitivity: string - priceTickSize: string - notionalValueCap: string - } - - export interface Data { - market_id: string - order_density: number - max_invariant_sensitivity: string - price_tick_size: string - notional_value_cap: string - } -} - -/** - * @category Contract Exec Arguments - */ -export default class ExecArgUpdateAMMVaultConfig extends ExecArgBase< - ExecArgUpdateAMMVaultConfig.Params, - ExecArgUpdateAMMVaultConfig.Data -> { - static fromJSON( - params: ExecArgUpdateAMMVaultConfig.Params, - ): ExecArgUpdateAMMVaultConfig { - return new ExecArgUpdateAMMVaultConfig(params) - } - - toData(): ExecArgUpdateAMMVaultConfig.Data { - const { params } = this - - return { - market_id: params.marketId, - order_density: params.orderDensity, - max_invariant_sensitivity: params.maxInvariantSensitivity, - price_tick_size: params.priceTickSize, - notional_value_cap: params.notionalValueCap, - } - } - - toExecData(): ExecDataRepresentation { - return dataToExecData('update_vault_config', this.toData()) - } -} diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateAllocatorContractConfig.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateAllocatorContractConfig.ts deleted file mode 100644 index d493907fa..000000000 --- a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateAllocatorContractConfig.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { - dataToExecData, - ExecArgBase, - ExecDataRepresentation, -} from '../ExecArgBase' - -export declare namespace ExecArgUpdateAllocatorContractConfig { - export interface Params { - owner?: string - stakingContractAddress?: string - maxRewardDenomsPerGauge?: string - minGaugeDurationInSeconds?: string - maxActiveGaugesPerLpToken?: string - gaugeAllocationFee?: { - denom: string - amount: string - } - } - - export interface Data { - owner?: string - staking_contract_address?: string - max_reward_denoms_per_gauge?: string - min_gauge_duration_in_seconds?: string - max_active_gauges_per_lp_token?: string - gauge_allocation_fee?: { - denom: string - amount: string - } - } -} - -/** - * @category Contract Exec Arguments - */ -export default class ExecArgUpdateAllocatorContractConfig extends ExecArgBase< - ExecArgUpdateAllocatorContractConfig.Params, - ExecArgUpdateAllocatorContractConfig.Data -> { - static fromJSON( - params: ExecArgUpdateAllocatorContractConfig.Params, - ): ExecArgUpdateAllocatorContractConfig { - return new ExecArgUpdateAllocatorContractConfig(params) - } - - toData(): ExecArgUpdateAllocatorContractConfig.Data { - const { params } = this - - return { - owner: params.owner, - staking_contract_address: params.stakingContractAddress, - max_reward_denoms_per_gauge: params.maxRewardDenomsPerGauge, - min_gauge_duration_in_seconds: params.minGaugeDurationInSeconds, - max_active_gauges_per_lp_token: params.maxActiveGaugesPerLpToken, - gauge_allocation_fee: params.gaugeAllocationFee, - } - } - - toExecData(): ExecDataRepresentation { - return dataToExecData('update_config', this.toData()) - } -} diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateDerivativeVaultConfig.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateDerivativeVaultConfig.ts deleted file mode 100644 index 4dc0cdbe0..000000000 --- a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateDerivativeVaultConfig.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { - dataToExecData, - ExecArgBase, - ExecDataRepresentation, -} from '../ExecArgBase' - -export declare namespace ExecArgUpdateDerivativeVaultConfig { - export interface Params { - marketId: string - leverage: string - orderDensity: number - signedMinHeadToFairPriceDeviationRatio: string - signedMinHeadToTobDeviationRatio: string - reservationPriceSensitivityRatio: string - reservationSpreadSensitivityRatio: string - maxActiveCapitalUtilizationRatio: string - headChangeToleranceRatio: string - headToTailDeviationRatio: string - minProximityToLiquidation: string - minOracleVolatilitySampleSize: number - emergencyOracleVolatilitySampleSize: number - defaultMidPriceVolatilityRatio: string - minVolatilityRatio: string - lastValidMarkPrice: string - allowedRedemptionTypes: number - notionalValueCap: string - oracleStaleTime: number - oracleVolatilityMaxAge: number - } - - export interface Data { - market_id: string - leverage: string - order_density: number - signed_min_head_to_fair_price_deviation_ratio: string - signed_min_head_to_tob_deviation_ratio: string - reservation_price_sensitivity_ratio: string - reservation_spread_sensitivity_ratio: string - max_active_capital_utilization_ratio: string - head_change_tolerance_ratio: string - head_to_tail_deviation_ratio: string - min_proximity_to_liquidation: string - min_oracle_volatility_sample_size: number - emergency_oracle_volatility_sample_size: number - default_mid_price_volatility_ratio: string - min_volatility_ratio: string - last_valid_mark_price: string - allowed_redemption_types: number - notional_value_cap: string - oracle_stale_time: number - oracle_volatility_max_age: number - } -} - -/** - * @category Contract Exec Arguments - */ -export default class ExecArgUpdateDerivativeVaultConfig extends ExecArgBase< - ExecArgUpdateDerivativeVaultConfig.Params, - ExecArgUpdateDerivativeVaultConfig.Data -> { - static fromJSON( - params: ExecArgUpdateDerivativeVaultConfig.Params, - ): ExecArgUpdateDerivativeVaultConfig { - return new ExecArgUpdateDerivativeVaultConfig(params) - } - - toData(): ExecArgUpdateDerivativeVaultConfig.Data { - const { params } = this - - return { - market_id: params.marketId, - leverage: params.leverage, - order_density: params.orderDensity, - signed_min_head_to_fair_price_deviation_ratio: - params.signedMinHeadToFairPriceDeviationRatio, - signed_min_head_to_tob_deviation_ratio: - params.signedMinHeadToTobDeviationRatio, - reservation_price_sensitivity_ratio: - params.reservationPriceSensitivityRatio, - reservation_spread_sensitivity_ratio: - params.reservationSpreadSensitivityRatio, - max_active_capital_utilization_ratio: - params.maxActiveCapitalUtilizationRatio, - head_change_tolerance_ratio: params.headChangeToleranceRatio, - head_to_tail_deviation_ratio: params.headToTailDeviationRatio, - min_proximity_to_liquidation: params.minProximityToLiquidation, - min_oracle_volatility_sample_size: params.minOracleVolatilitySampleSize, - emergency_oracle_volatility_sample_size: - params.emergencyOracleVolatilitySampleSize, - default_mid_price_volatility_ratio: params.defaultMidPriceVolatilityRatio, - min_volatility_ratio: params.minVolatilityRatio, - last_valid_mark_price: params.lastValidMarkPrice, - allowed_redemption_types: params.allowedRedemptionTypes, - notional_value_cap: params.notionalValueCap, - oracle_stale_time: params.oracleStaleTime, - oracle_volatility_max_age: params.oracleVolatilityMaxAge, - } - } - - toExecData(): ExecDataRepresentation { - return dataToExecData('update_vault_config', this.toData()) - } -} diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateOffChainVaultConfig.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateOffChainVaultConfig.ts deleted file mode 100644 index 58b4f6ab4..000000000 --- a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateOffChainVaultConfig.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { - dataToExecData, - ExecArgBase, - ExecDataRepresentation, -} from '../ExecArgBase' - -export declare namespace ExecArgUpdateOffChainVaultConfig { - export interface Params { - oracleStaleTime: number - notionalValueCap: string - vaultType: Record - } - - export interface Data { - oracle_stale_time: number - notional_value_cap: string - vault_type: Record - } -} - -/** - * @category Contract Exec Arguments - */ -export default class ExecArgUpdateOffChainVaultConfig extends ExecArgBase< - ExecArgUpdateOffChainVaultConfig.Params, - ExecArgUpdateOffChainVaultConfig.Data -> { - static fromJSON( - params: ExecArgUpdateOffChainVaultConfig.Params, - ): ExecArgUpdateOffChainVaultConfig { - return new ExecArgUpdateOffChainVaultConfig(params) - } - - toData(): ExecArgUpdateOffChainVaultConfig.Data { - const { params } = this - - return { - oracle_stale_time: params.oracleStaleTime, - notional_value_cap: params.notionalValueCap, - vault_type: params.vaultType, - } - } - - toExecData(): ExecDataRepresentation { - return dataToExecData('update_vault_config', this.toData()) - } -} diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateSpotVaultConfig.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateSpotVaultConfig.ts deleted file mode 100644 index 1b6f8b7f5..000000000 --- a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateSpotVaultConfig.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { - dataToExecData, - ExecArgBase, - ExecDataRepresentation, -} from '../ExecArgBase' - -export declare namespace ExecArgUpdateSpotVaultConfig { - export interface Params { - marketId: string - orderDensity: number - reservationPriceSensitivityRatio: string - reservationSpreadSensitivityRatio: string - maxActiveCapitalUtilizationRatio: string - headChangeToleranceRatio: string - headToTailDeviationRatio: string - signedMinHeadToFairPriceDeviationRatio: string - signedMinHeadToTobDeviationRatio: string - targetBaseWeight: string - oracleType: number - defaultMidPriceVolatilityRatio: string - allowedRedemptionTypes: number - notionalValueCap: string - oracleStaleTime: number - lastValidMarkPrice: string - minOracleVolatilitySampleSize: number - emergencyOracleVolatilitySampleSize: number - minVolatilityRatio: string - oracleVolatilityMaxAge: number - } - - export interface Data { - market_id: string - order_density: number - reservation_price_sensitivity_ratio: string - reservation_spread_sensitivity_ratio: string - max_active_capital_utilization_ratio: string - head_change_tolerance_ratio: string - head_to_tail_deviation_ratio: string - signed_min_head_to_fair_price_deviation_ratio: string - signed_min_head_to_tob_deviation_ratio: string - target_base_weight: string - oracle_type: number - default_mid_price_volatility_ratio: string - allowed_redemption_types: number - notional_value_cap: string - oracle_stale_time: number - last_valid_mark_price: string - min_oracle_volatility_sample_size: number - emergency_oracle_volatility_sample_size: number - min_volatility_ratio: string - oracle_volatility_max_age: number - } -} - -/** - * @category Contract Exec Arguments - */ -export default class ExecArgUpdateSpotVaultConfig extends ExecArgBase< - ExecArgUpdateSpotVaultConfig.Params, - ExecArgUpdateSpotVaultConfig.Data -> { - static fromJSON( - params: ExecArgUpdateSpotVaultConfig.Params, - ): ExecArgUpdateSpotVaultConfig { - return new ExecArgUpdateSpotVaultConfig(params) - } - - toData(): ExecArgUpdateSpotVaultConfig.Data { - const { params } = this - - return { - market_id: params.marketId, - order_density: params.orderDensity, - reservation_price_sensitivity_ratio: - params.reservationPriceSensitivityRatio, - reservation_spread_sensitivity_ratio: - params.reservationSpreadSensitivityRatio, - max_active_capital_utilization_ratio: - params.maxActiveCapitalUtilizationRatio, - head_change_tolerance_ratio: params.headChangeToleranceRatio, - head_to_tail_deviation_ratio: params.headToTailDeviationRatio, - signed_min_head_to_fair_price_deviation_ratio: - params.signedMinHeadToFairPriceDeviationRatio, - signed_min_head_to_tob_deviation_ratio: - params.signedMinHeadToTobDeviationRatio, - target_base_weight: params.targetBaseWeight, - oracle_type: params.oracleType, - default_mid_price_volatility_ratio: params.defaultMidPriceVolatilityRatio, - allowed_redemption_types: params.allowedRedemptionTypes, - notional_value_cap: params.notionalValueCap, - oracle_stale_time: params.oracleStaleTime, - last_valid_mark_price: params.lastValidMarkPrice, - min_oracle_volatility_sample_size: params.minOracleVolatilitySampleSize, - emergency_oracle_volatility_sample_size: - params.emergencyOracleVolatilitySampleSize, - min_volatility_ratio: params.minVolatilityRatio, - oracle_volatility_max_age: params.oracleVolatilityMaxAge, - } - } - - toExecData(): ExecDataRepresentation { - return dataToExecData('update_vault_config', this.toData()) - } -} diff --git a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateStakingContractConfig.ts b/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateStakingContractConfig.ts deleted file mode 100644 index b74314aa0..000000000 --- a/packages/sdk-ts/src/core/modules/wasm/exec-args/ExecArgUpdateStakingContractConfig.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { - dataToExecData, - ExecArgBase, - ExecDataRepresentation, -} from '../ExecArgBase' - -export declare namespace ExecArgUpdateStakingContractConfig { - export interface Params { - owner: string - lockupPeriod?: string - allocatorContractAddress: string - } - - export interface Data { - owner: string - lockup_period?: string - allocator_contract_address: string - } -} - -/** - * @category Contract Exec Arguments - */ -export default class ExecArgUpdateStakingContractConfig extends ExecArgBase< - ExecArgUpdateStakingContractConfig.Params, - ExecArgUpdateStakingContractConfig.Data -> { - static fromJSON( - params: ExecArgUpdateStakingContractConfig.Params, - ): ExecArgUpdateStakingContractConfig { - return new ExecArgUpdateStakingContractConfig(params) - } - - toData(): ExecArgUpdateStakingContractConfig.Data { - const { params } = this - - return { - owner: params.owner, - lockup_period: params.lockupPeriod, - allocator_contract_address: params.allocatorContractAddress, - } - } - - toExecData(): ExecDataRepresentation { - return dataToExecData('update_config', this.toData()) - } -} diff --git a/packages/sdk-ts/src/core/modules/wasm/index.ts b/packages/sdk-ts/src/core/modules/wasm/index.ts index f76aef96e..9eeacc0a5 100644 --- a/packages/sdk-ts/src/core/modules/wasm/index.ts +++ b/packages/sdk-ts/src/core/modules/wasm/index.ts @@ -1,25 +1,14 @@ -import ExecArgGeneric from './exec-args/ExecArgGeneric' -import ExecArgUnStake from './exec-args/ExecArgUnstake' import ExecArgCW20Send from './exec-args/ExecArgCW20Send' import ExecArgSubmitVaa from './exec-args/ExecArgSubmitVaa' -import ExecArgClaimStake from './exec-args/ExecArgClaimStake' -import ExecArgClaimRewards from './exec-args/ExecArgClaimRewards' import ExecArgCW20Transfer from './exec-args/ExecArgCW20Transfer' import ExecArgSwapMinOutput from './exec-args/ExecArgSwapMinOutput' import ExecArgDepositTokens from './exec-args/ExecArgDepositTokens' -import ExecArgRegisterVault from './exec-args/ExecArgRegisterVault' import ExecArgSwapExactOutput from './exec-args/ExecArgSwapExactOutput' import ExecArgInitiateTransfer from './exec-args/ExecArgInitiateTransfer' import ExecArgIncreaseAllowance from './exec-args/ExecArgIncreaseAllowance' import ExecArgRemoveGridStrategy from './exec-args/ExecArgRemoveGridStrategy' -import ExecArgUpdateAMMVaultConfig from './exec-args/ExecArgUpdateAMMVaultConfig' -import ExecArgUpdateSpotVaultConfig from './exec-args/ExecArgUpdateSpotVaultConfig' import ExecArgCreateSpotGridStrategy from './exec-args/ExecArgCreateSpotGridStrategy' -import ExecArgUpdateOffChainVaultConfig from './exec-args/ExecArgUpdateOffChainVaultConfig' -import ExecArgUpdateDerivativeVaultConfig from './exec-args/ExecArgUpdateDerivativeVaultConfig' -import ExecArgUpdateStakingContractConfig from './exec-args/ExecArgUpdateStakingContractConfig' import ExecArgCW20AdapterRedeemAndTransfer from './exec-args/ExecArgCW20AdapterRedeemAndTransfer' -import ExecArgUpdateAllocatorContractConfig from './exec-args/ExecArgUpdateAllocatorContractConfig' import MsgStoreCode from './msgs/MsgStoreCode' import MsgUpdateAdmin from './msgs/MsgUpdateAdmin' @@ -37,28 +26,17 @@ import ExecPrivilegedArgOffChainVaultSubscribe from './exec-priv-args/ExecPrivil export * from './exec-args' export { - ExecArgGeneric, - ExecArgUnStake, ExecArgCW20Send, ExecArgSubmitVaa, - ExecArgClaimStake, - ExecArgClaimRewards, ExecArgCW20Transfer, ExecArgSwapMinOutput, ExecArgDepositTokens, - ExecArgRegisterVault, ExecArgSwapExactOutput, ExecArgInitiateTransfer, ExecArgIncreaseAllowance, ExecArgRemoveGridStrategy, - ExecArgUpdateAMMVaultConfig, - ExecArgUpdateSpotVaultConfig, ExecArgCreateSpotGridStrategy, - ExecArgUpdateOffChainVaultConfig, - ExecArgUpdateDerivativeVaultConfig, - ExecArgUpdateStakingContractConfig, ExecArgCW20AdapterRedeemAndTransfer, - ExecArgUpdateAllocatorContractConfig, // MsgStoreCode, MsgUpdateAdmin,