mirror of
https://github.com/alexgo-io/alex-sdk.git
synced 2026-01-12 14:25:02 +08:00
feat: move TxToBroadCast back to SwapHelper
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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],
|
||||
|
||||
12
src/types.ts
12
src/types.ts
@@ -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>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user