feat: move TxToBroadCast back to SwapHelper

This commit is contained in:
Kyle Fang
2024-07-11 17:58:38 +08:00
committed by Kyle
parent 8d666ee029
commit 03ab838ddc
3 changed files with 11 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
import { Currency } from './currency';
import { runSpot } from './helpers/SwapHelper';
import { runSpot, TxToBroadCast } from './helpers/SwapHelper';
import { getLiquidityProviderFee } from './helpers/FeeHelper';
import { AlexSDKResponse, PoolData, PriceData, TokenInfo, TxToBroadCast } from './types';
import { AlexSDKResponse, PoolData, PriceData, TokenInfo } from './types';
import {
fetchBalanceForAccount,
getAlexSDKData,

View File

@@ -1,4 +1,5 @@
import {
ClarityValue,
FungibleConditionCode,
FungiblePostCondition,
STXPostCondition,
@@ -10,12 +11,19 @@ import {
import { AlexContracts } from '../generated/smartContract/contracts_Alex';
import { configs } from '../config';
import { Currency } from '../currency';
import { PoolData, TokenInfo, TxToBroadCast } from '../types';
import { PoolData, TokenInfo } from '../types';
import { AMMRouteSegment, resolveAmmRoute } from '../utils/ammRouteResolver';
import { transferFactory } from '../utils/postConditions';
type Contracts = typeof AlexContracts;
export type TxToBroadCast = {
contractAddress: string;
contractName: string;
functionName: string;
functionArgs: ClarityValue[];
postConditions: Array<FungiblePostCondition | STXPostCondition>;
};
const composeTx: <
T extends keyof Contracts,
F extends keyof Contracts[T],

View File

@@ -1,9 +1,4 @@
import { Currency } from './currency';
import {
ClarityValue,
FungiblePostCondition,
STXPostCondition,
} from '@stacks/transactions';
/**
* TokenInfo represents the details of a token that can be used in the AlexSDK.
@@ -70,10 +65,3 @@ export type AlexSDKResponse = {
export type BackendAPIPriceResponse = PriceData[];
export type TxToBroadCast = {
contractAddress: string;
contractName: string;
functionName: string;
functionArgs: ClarityValue[];
postConditions: Array<FungiblePostCondition | STXPostCondition>;
};