Skip to content

Commit

Permalink
feat: create spot grid strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-angjelkoski committed Aug 6, 2023
1 parent 3b1a9bc commit a57c40b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/sdk-ts/src/core/modules/wasm/exec-args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ 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 ExecArgCreateStrategy from './exec-args/ExecArgCreateStrategy'
import ExecArgSwapExactOutput from './exec-args/ExecArgSwapExactOutput'
import ExecArgInitiateTransfer from './exec-args/ExecArgInitiateTransfer'
import ExecArgIncreaseAllowance from './exec-args/ExecArgIncreaseAllowance'
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'
Expand All @@ -37,7 +37,7 @@ export type ExecArgs =
| ExecArgSwapMinOutput
| ExecArgDepositTokens
| ExecArgRegisterVault
| ExecArgCreateStrategy
| ExecArgCreateSpotGridStrategy
| ExecArgSwapExactOutput
| ExecArgInitiateTransfer
| ExecArgIncreaseAllowance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ExecDataRepresentation,
} from '../ExecArgBase'

export declare namespace ExecArgCreateStrategy {
export declare namespace ExecArgCreateSpotGridStrategy {
export interface Params {
subaccountId: string
lowerBound: string
Expand All @@ -29,15 +29,17 @@ export declare namespace ExecArgCreateStrategy {
/**
* @category Contract Exec Arguments
*/
export default class ExecArgCreateStrategy extends ExecArgBase<
ExecArgCreateStrategy.Params,
ExecArgCreateStrategy.Data
export default class ExecArgCreateSpotGridStrategy extends ExecArgBase<
ExecArgCreateSpotGridStrategy.Params,
ExecArgCreateSpotGridStrategy.Data
> {
static fromJSON(params: ExecArgCreateStrategy.Params): ExecArgCreateStrategy {
return new ExecArgCreateStrategy(params)
static fromJSON(
params: ExecArgCreateSpotGridStrategy.Params,
): ExecArgCreateSpotGridStrategy {
return new ExecArgCreateSpotGridStrategy(params)
}

toData(): ExecArgCreateStrategy.Data {
toData(): ExecArgCreateSpotGridStrategy.Data {
const { params } = this

return {
Expand All @@ -51,7 +53,7 @@ export default class ExecArgCreateStrategy extends ExecArgBase<
}
}

toExecData(): ExecDataRepresentation<ExecArgCreateStrategy.Data> {
toExecData(): ExecDataRepresentation<ExecArgCreateSpotGridStrategy.Data> {
return dataToExecData('create_strategy', this.toData())
}
}
4 changes: 2 additions & 2 deletions packages/sdk-ts/src/core/modules/wasm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ 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 ExecArgCreateStrategy from './exec-args/ExecArgCreateStrategy'
import ExecArgSwapExactOutput from './exec-args/ExecArgSwapExactOutput'
import ExecArgInitiateTransfer from './exec-args/ExecArgInitiateTransfer'
import ExecArgIncreaseAllowance from './exec-args/ExecArgIncreaseAllowance'
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'
Expand Down Expand Up @@ -46,12 +46,12 @@ export {
ExecArgSwapMinOutput,
ExecArgDepositTokens,
ExecArgRegisterVault,
ExecArgCreateStrategy,
ExecArgSwapExactOutput,
ExecArgInitiateTransfer,
ExecArgIncreaseAllowance,
ExecArgUpdateAMMVaultConfig,
ExecArgUpdateSpotVaultConfig,
ExecArgCreateSpotGridStrategy,
ExecArgUpdateOffChainVaultConfig,
ExecArgUpdateDerivativeVaultConfig,
ExecArgUpdateStakingContractConfig,
Expand Down

0 comments on commit a57c40b

Please sign in to comment.