Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add limit orders #96

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aftermath-ts-sdk",
"version": "1.2.45",
"version": "1.2.45-limit.1",
"description": "Aftermath TypeScript SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/general/providers/aftermath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import { AftermathApi } from "./aftermathApi";
import { SuiClient, SuiHTTPTransport } from "@mysten/sui/client";
import { Dca } from "../../packages/dca/dca";
import { Multisig } from "../../packages/multisig/multisig";
import { LimitOrders } from "../../packages/limitOrders/limitOrders";
import { UserData } from "../../packages/userData/userData";

/**
* @class Aftermath Provider
Expand Down Expand Up @@ -143,6 +145,8 @@ export class Aftermath extends Caller {
*/
public Dca = () => new Dca(this.network, this.Provider);
Fedor-Aftermath marked this conversation as resolved.
Show resolved Hide resolved
public Multisig = () => new Multisig(this.network, this.Provider);
public LimitOrders = () => new LimitOrders(this.network, this.Provider);
public UserData = () => new UserData(this.network, this.Provider);

// =========================================================================
// General
Expand Down
4 changes: 4 additions & 0 deletions src/general/providers/aftermathApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import { NftsApi } from "../nfts/nftsApi";
import { Helpers } from "../utils";
import { MoveErrorsInterface } from "../types/moveErrorsInterface";
import { MultisigApi } from "../../packages/multisig/api/multisigApi";
import { UserDataApi } from "../../packages/userData/api/userDataApi";
import { LimitOrdersApi } from "../../packages/limitOrders/api/limitOrdersApi";

/**
* This class represents the Aftermath API and provides helper methods for various functionalities.
Expand Down Expand Up @@ -126,6 +128,8 @@ export class AftermathApi {
public Farms = () => new FarmsApi(this);
public Dca = () => new DcaApi(this);
public Multisig = () => new MultisigApi(this);
public LimitOrders = () => new LimitOrdersApi(this);
public UserData = () => new UserDataApi(this);

/**
* Creates a new instance of the RouterApi class.
Expand Down
7 changes: 7 additions & 0 deletions src/general/types/configTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface ConfigAddresses {
scallop?: ScallopAddresses;
leveragedStaking?: LeveragedStakingAddresses;
dca?: DcaAddresses;
limit?: LimitAddresses;
sharedCustody?: SharedCustodyAddresses;
nfts?: NftsAddresses;
}
Expand Down Expand Up @@ -195,6 +196,12 @@ export interface DcaAddresses {
};
}

export interface LimitAddresses {
packages: {
limit: SuiAddress;
};
}

export interface SharedCustodyAddresses {
address: ObjectId;
publicKey: ObjectId;
Expand Down
2 changes: 0 additions & 2 deletions src/general/utils/casting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { Helpers } from "../..";
import { BcsTypeName } from "../types/castingTypes";
import { SuiObjectResponse } from "@mysten/sui/client";
import { NftsApiCasting } from "../nfts/nftsApiCasting";
import { DcaApiCasting } from "../../packages/dca/api/dcaApiCasting";

/**
* Utility class for casting and conversion functions.
Expand All @@ -36,7 +35,6 @@ export class Casting {
public static perpetuals = PerpetualsApiCasting;
public static farms = FarmsApiCasting;
public static nfts = NftsApiCasting;
public static dca = DcaApiCasting;

// =========================================================================
// Constants
Expand Down
2 changes: 0 additions & 2 deletions src/packages/dca/api/dcaApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ import {
CoinType,
DcaAddresses,
ObjectId,
SuiAddress,
} from "../../../types";
import { EventsApiHelpers } from "../../../general/apiHelpers/eventsApiHelpers";
import { Helpers } from "../../../general/utils";
import {
TransactionArgument,
TransactionBlock,
} from "@mysten/sui.js/transactions";
import { ApiDcaManualCloseOrderBody } from "../dcaTypes";
import { Transaction } from "@mysten/sui/transactions";

export class DcaApi {
Expand Down
251 changes: 0 additions & 251 deletions src/packages/dca/api/dcaApiCasting.ts

This file was deleted.

Loading