Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/methods/limitOrders/approveForOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ApproveToken, approveTokenMethodFactory } from '../../helpers/approve';
import { constructApproveToken } from '../swap/approve';
import { constructGetSpender } from '../swap/spender';

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export type ApproveTokenForLimitOrderFunctions<T> = {
/** @description approving AugustusRFQ as spender for makerAsset */
approveMakerTokenForLimitOrder: ApproveToken<T>;
Expand All @@ -14,6 +15,7 @@ export type ApproveTokenForLimitOrderFunctions<T> = {

// returns whatever `contractCaller` returns
// to allow for better versatility
/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export const constructApproveTokenForLimitOrder = <T>(
options: ConstructProviderFetchInput<T, 'transactCall'>
): ApproveTokenForLimitOrderFunctions<T> => {
Expand Down
3 changes: 3 additions & 0 deletions src/methods/limitOrders/buildOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from './helpers/buildOrderData';
export * from './helpers/buildOrderData';

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export type BuildLimitOrderInput = Omit<
BuildOrderDataInput,
'chainId' | 'verifyingContract' | 'AugustusAddress' | 'AppVersion'
Expand All @@ -18,11 +19,13 @@ type BuildLimitOrder = (
requestParams?: RequestParameters
) => Promise<SignableOrderData>;

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export type BuildLimitOrderFunctions = {
/** @description Build Orders that will be excuted through AugustusSwapper */
buildLimitOrder: BuildLimitOrder;
};

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export const constructBuildLimitOrder = (
options: ConstructFetchInput
): BuildLimitOrderFunctions => {
Expand Down
2 changes: 2 additions & 0 deletions src/methods/limitOrders/cancelOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type CancelOrderBulk<T> = (
requestParams?: RequestParameters
) => Promise<T>;

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export type CancelLimitOrderFunctions<T> = {
cancelLimitOrder: CancelOrder<T>;
cancelLimitOrderBulk: CancelOrderBulk<T>;
Expand Down Expand Up @@ -57,6 +58,7 @@ type AvailableMethods = ExtractAbiMethodNames<typeof MinAugustusRFQAbi>;

// returns whatever `contractCaller` returns
// to allow for better versatility
/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export const constructCancelLimitOrder = <T>(
options: ConstructProviderFetchInput<T, 'transactCall'>
): CancelLimitOrderFunctions<T> => {
Expand Down
2 changes: 2 additions & 0 deletions src/methods/limitOrders/fillOrderDirectly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
encodeEIP_2612PermitFunctionInput,
} from '../common/orders/encoding';

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export type FillOrderDirectlyFunctions<T> = {
fillOrderDirectly: FillOrderDirectly<T>;
};
Expand Down Expand Up @@ -204,6 +205,7 @@ type FillOrderMethods = ExtractAbiMethodNames<typeof MinAugustusRFQAbi>;

// returns whatever `contractCaller` returns
// to allow for better versatility
/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export function constructFillOrderDirectly<T>(
options: ConstructProviderFetchInput<T, 'transactCall'>
): FillOrderDirectlyFunctions<T> {
Expand Down
2 changes: 2 additions & 0 deletions src/methods/limitOrders/getOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type GetRequiredBalance = (
requestParams?: RequestParameters
) => Promise<Record<string, string>>;

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export type GetLimitOrdersFunctions = {
getLimitOrders: GetLimitOrders;
getLimitOrderByHash: GetLimitOrderByHash;
Expand All @@ -67,6 +68,7 @@ export type GetLimitOrdersFunctions = {
getRequiredBalance: GetRequiredBalance;
};

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export const constructGetLimitOrders = ({
apiURL = API_URL,
chainId,
Expand Down
2 changes: 2 additions & 0 deletions src/methods/limitOrders/getOrdersContract.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import type { ConstructFetchInput } from '../../types';
import { constructGetSpender, GetSpender } from '../swap/spender';

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export type GetLimitOrdersContractFunctions = {
getLimitOrdersContract: GetSpender;
getTokenTransferProxy: GetSpender;
};

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export const constructGetLimitOrdersContract = (
options: ConstructFetchInput
): GetLimitOrdersContractFunctions => {
Expand Down
17 changes: 16 additions & 1 deletion src/methods/limitOrders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ type SubmitP2POrder = (
requestParams?: RequestParameters
) => Promise<LimitOrderFromApi>;

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export type SubmitLimitOrderFuncs = {
submitLimitOrder: SubmitLimitOrder;
submitP2POrder: SubmitP2POrder;
};

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export const constructSubmitLimitOrder = (
options: ConstructProviderFetchInput<any, 'signTypedDataCall'>
): SubmitLimitOrderFuncs => {
Expand Down Expand Up @@ -106,6 +108,7 @@ export const constructSubmitLimitOrder = (
return { submitLimitOrder, submitP2POrder };
};

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export type LimitOrderHandlers<T> = SubmitLimitOrderFuncs &
BuildLimitOrderFunctions &
SignLimitOrderFunctions &
Expand All @@ -117,13 +120,25 @@ export type LimitOrderHandlers<T> = SubmitLimitOrderFuncs &
ApproveTokenForLimitOrderFunctions<T> &
FillOrderDirectlyFunctions<T>;

/** @description construct SDK with every LimitOrders-related method, fetching from API and contract calls */
let _limitOrdersDeprecationWarned = false;

/**
* @description construct SDK with every LimitOrders-related method, fetching from API and contract calls
* @deprecated Limit Orders are deprecated and will be removed in a future version.
*/
export const constructAllLimitOrdersHandlers = <TxResponse>(
options: ConstructProviderFetchInput<
TxResponse,
'signTypedDataCall' | 'transactCall' | 'staticCall'
>
): LimitOrderHandlers<TxResponse> => {
if (!_limitOrdersDeprecationWarned) {
_limitOrdersDeprecationWarned = true;
console.warn(
'[velora/sdk] Limit Orders are deprecated and will be removed in a future version.'
);
}

const limitOrdersGetters = constructGetLimitOrders(options);
const limitOrdersContractGetter = constructGetLimitOrdersContract(options);

Expand Down
2 changes: 2 additions & 0 deletions src/methods/limitOrders/postOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ type PostLimitOrder = (
requestParams?: RequestParameters
) => Promise<LimitOrderFromApi>;

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export type PostLimitOrderFunctions = {
postLimitOrder: PostLimitOrder;
postP2POrder: PostLimitOrder;
};

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export const constructPostLimitOrder = ({
apiURL = API_URL,
chainId,
Expand Down
2 changes: 2 additions & 0 deletions src/methods/limitOrders/signOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import type { ConstructProviderFetchInput } from '../../types';
import type { SignableOrderData } from './buildOrder';
import { sanitizeOrderData } from './helpers/misc';

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export type SignLimitOrderFunctions = {
signLimitOrder: (signableOrderData: SignableOrderData) => Promise<string>;
};

// returns whatever `contractCaller` returns
// to allow for better versatility
/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export const constructSignLimitOrder = (
options: Pick<
ConstructProviderFetchInput<any, 'signTypedDataCall'>,
Expand Down
2 changes: 2 additions & 0 deletions src/methods/limitOrders/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type BuildLimitOrdersTx = (
requestParams?: RequestParameters
) => Promise<TransactionParams>;

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export type BuildLimitOrdersTxFunctions = {
getLimitOrdersRate: GetLimitOrdersRate;
buildLimitOrderTx: BuildLimitOrdersTx;
Expand All @@ -57,6 +58,7 @@ type GetLimitOrdersRate = (
requestParams?: RequestParameters
) => Promise<OptimalRate>;

/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
export const constructBuildLimitOrderTx = ({
apiURL = API_URL,
version = DEFAULT_VERSION,
Expand Down
2 changes: 2 additions & 0 deletions src/methods/nftOrders/approveForOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type ApproveNFT<T> = (
requestParams?: RequestParameters
) => Promise<T>;

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export type ApproveTokenForNFTOrderFunctions<T> = {
/** @description approving AugustusSwapper as spender for takerAsset (ERC20) for Limit Orders that will be executed through it */
approveERC20ForNFTOrder: ApproveToken<T>;
Expand Down Expand Up @@ -47,6 +48,7 @@ type ApprovalMethods = ExtractAbiMethodNames<typeof MinNFTAbi>;

// returns whatever `contractCaller` returns
// to allow for better versatility
/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export const constructApproveTokenForNFTOrder = <T>(
options: ConstructProviderFetchInput<T, 'transactCall'>
): ApproveTokenForNFTOrderFunctions<T> => {
Expand Down
3 changes: 3 additions & 0 deletions src/methods/nftOrders/buildOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from './helpers/buildOrderData';
export * from './helpers/buildOrderData';

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export type BuildNFTOrderInput = Omit<
BuildNFTOrderDataInput,
'chainId' | 'verifyingContract' | 'AugustusAddress'
Expand All @@ -17,11 +18,13 @@ type BuildNFTOrder = (
requestParams?: RequestParameters
) => Promise<SignableNFTOrderData>;

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export type BuildNFTOrderFunctions = {
/** @description Build Orders that will be excuted through AugustusSwapper */
buildNFTOrder: BuildNFTOrder;
};

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export const constructBuildNFTOrder = (
options: ConstructFetchInput
): BuildNFTOrderFunctions => {
Expand Down
2 changes: 2 additions & 0 deletions src/methods/nftOrders/cancelOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import {
constructCancelLimitOrder,
} from '../limitOrders/cancelOrder';

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export type CancelNFTOrderFunctions<T> = {
cancelNFTOrder: CancelOrder<T>;
cancelNFTOrderBulk: CancelOrderBulk<T>;
};

// should work the same as for LimitOrders
/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export const constructCancelNFTOrder = <T>(
options: ConstructProviderFetchInput<T, 'transactCall'>
): CancelNFTOrderFunctions<T> => {
Expand Down
2 changes: 2 additions & 0 deletions src/methods/nftOrders/getOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ type GetNFTOrders = (
requestParams?: RequestParameters
) => Promise<NFTOrdersApiResponse>;

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export type GetNFTOrdersFunctions = {
getNFTOrders: GetNFTOrders;
getNFTOrderByHash: GetNFTOrderByHash;
};

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export const constructGetNFTOrders = ({
apiURL = API_URL,
chainId,
Expand Down
2 changes: 2 additions & 0 deletions src/methods/nftOrders/getOrdersContract.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import type { ConstructFetchInput } from '../../types';
import { constructGetSpender, GetSpender } from '../swap/spender';

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export type GetNFTOrdersContractFunctions = {
getNFTOrdersContract: GetSpender;
getTokenTransferProxy: GetSpender;
};

// should work the same as LimitOrders
/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export const constructGetNFTOrdersContract = (
options: ConstructFetchInput
): GetNFTOrdersContractFunctions => {
Expand Down
1 change: 1 addition & 0 deletions src/methods/nftOrders/helpers/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
// ERC721 = 2,
// }

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export const AssetType = {
ERC20: 0,
ERC1155: 1,
Expand Down
17 changes: 16 additions & 1 deletion src/methods/nftOrders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ type SubmitNFTOrder = (
requestParams?: RequestParameters
) => Promise<NFTOrderFromAPI>;

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export type SubmitNFTOrderFuncs = {
submitNFTOrder: SubmitNFTOrder;
submitP2POrder: SubmitNFTOrder;
};

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export const constructSubmitNFTOrder = (
options: ConstructProviderFetchInput<any, 'signTypedDataCall'>
): SubmitNFTOrderFuncs => {
Expand Down Expand Up @@ -95,6 +97,7 @@ export const constructSubmitNFTOrder = (
return { submitNFTOrder, submitP2POrder };
};

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export type NFTOrderHandlers<T> = SubmitNFTOrderFuncs &
BuildNFTOrderFunctions &
SignNFTOrderFunctions &
Expand All @@ -105,13 +108,25 @@ export type NFTOrderHandlers<T> = SubmitNFTOrderFuncs &
CancelNFTOrderFunctions<T> &
ApproveTokenForNFTOrderFunctions<T>;

/** @description construct SDK with every NFTOrders-related method, fetching from API and contract calls */
let _nftOrdersDeprecationWarned = false;

/**
* @description construct SDK with every NFTOrders-related method, fetching from API and contract calls
* @deprecated NFT Orders are deprecated and will be removed in a future version.
*/
export const constructAllNFTOrdersHandlers = <TxResponse>(
options: ConstructProviderFetchInput<
TxResponse,
'signTypedDataCall' | 'transactCall' | 'staticCall'
>
): NFTOrderHandlers<TxResponse> => {
if (!_nftOrdersDeprecationWarned) {
_nftOrdersDeprecationWarned = true;
console.warn(
'[velora/sdk] NFT Orders are deprecated and will be removed in a future version.'
);
}

const NFTOrdersGetters = constructGetNFTOrders(options);
const NFTOrdersContractGetter = constructGetNFTOrdersContract(options);

Expand Down
2 changes: 2 additions & 0 deletions src/methods/nftOrders/postOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ type PostNFTOrder = (
requestParams?: RequestParameters
) => Promise<NFTOrderFromAPI>;

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export type PostNFTOrderFunctions = {
postNFTLimitOrder: PostNFTOrder;
postNFTP2POrder: PostNFTOrder;
};

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export const constructPostNFTOrder = ({
apiURL = API_URL,
chainId,
Expand Down
2 changes: 2 additions & 0 deletions src/methods/nftOrders/signOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import type { ConstructProviderFetchInput } from '../../types';
import type { SignableNFTOrderData } from './buildOrder';
import { sanitizeOrderData } from './helpers/misc';

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export type SignNFTOrderFunctions = {
signNFTOrder: (signableOrderData: SignableNFTOrderData) => Promise<string>;
};

// returns whatever `contractCaller` returns
// to allow for better versatility
/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export const constructSignNFTOrder = (
options: Pick<
ConstructProviderFetchInput<any, 'signTypedDataCall'>,
Expand Down
2 changes: 2 additions & 0 deletions src/methods/nftOrders/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type BuildNFTOrdersTx = (
requestParams?: RequestParameters
) => Promise<TransactionParams>;

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export type BuildNFTOrdersTxFunctions = {
getNFTOrdersRate: GetNFTOrdersRate;
buildNFTOrderTx: BuildNFTOrdersTx;
Expand All @@ -56,6 +57,7 @@ type GetNFTOrdersRate = (
requestParams?: RequestParameters
) => Promise<OptimalRate>;

/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
export const constructBuildNFTOrderTx = ({
apiURL = API_URL,
version = DEFAULT_VERSION,
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import { API_URL, DEFAULT_VERSION } from '../constants';

export type AllSDKMethods<TxResponse> = {
swap: SwapSDKMethods<TxResponse>;
/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
limitOrders: LimitOrderHandlers<TxResponse>;
/** @deprecated NFT Orders are deprecated and will be removed in a future version. */
nftOrders: NFTOrderHandlers<TxResponse>;
delta: DeltaOrderHandlers<TxResponse>;
quote: GetQuoteFunctions;
Expand Down
Loading
Loading